1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/browser/frame_host/render_frame_host_factory.h"
7 #include "base/logging.h"
8 #include "content/browser/frame_host/frame_tree_node.h"
9 #include "content/browser/frame_host/render_frame_host_impl.h"
14 RenderFrameHostFactory
* RenderFrameHostFactory::factory_
= NULL
;
17 scoped_ptr
<RenderFrameHostImpl
> RenderFrameHostFactory::Create(
18 RenderViewHostImpl
* render_view_host
,
19 RenderFrameHostDelegate
* delegate
,
20 FrameTree
* frame_tree
,
21 FrameTreeNode
* frame_tree_node
,
23 bool is_swapped_out
) {
25 return factory_
->CreateRenderFrameHost(render_view_host
,
30 is_swapped_out
).Pass();
32 return make_scoped_ptr(new RenderFrameHostImpl(
33 render_view_host
, delegate
, frame_tree
, frame_tree_node
, routing_id
,
38 void RenderFrameHostFactory::RegisterFactory(RenderFrameHostFactory
* factory
) {
39 DCHECK(!factory_
) << "Can't register two factories at once.";
44 void RenderFrameHostFactory::UnregisterFactory() {
45 DCHECK(factory_
) << "No factory to unregister.";
49 } // namespace content