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 SiteInstance
* site_instance
,
19 RenderViewHostImpl
* render_view_host
,
20 RenderFrameHostDelegate
* delegate
,
21 RenderWidgetHostDelegate
* rwh_delegate
,
22 FrameTree
* frame_tree
,
23 FrameTreeNode
* frame_tree_node
,
27 return factory_
->CreateRenderFrameHost(site_instance
, render_view_host
,
28 delegate
, rwh_delegate
, frame_tree
,
29 frame_tree_node
, routing_id
, flags
);
31 return make_scoped_ptr(new RenderFrameHostImpl(
32 site_instance
, render_view_host
, delegate
, rwh_delegate
, frame_tree
,
33 frame_tree_node
, routing_id
, flags
));
37 void RenderFrameHostFactory::RegisterFactory(RenderFrameHostFactory
* factory
) {
38 DCHECK(!factory_
) << "Can't register two factories at once.";
43 void RenderFrameHostFactory::UnregisterFactory() {
44 DCHECK(factory_
) << "No factory to unregister.";
48 } // namespace content