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
,
25 int32 widget_routing_id
,
29 return factory_
->CreateRenderFrameHost(
30 site_instance
, render_view_host
, delegate
, rwh_delegate
, frame_tree
,
31 frame_tree_node
, routing_id
, widget_routing_id
, surface_id
, flags
);
33 return make_scoped_ptr(new RenderFrameHostImpl(
34 site_instance
, render_view_host
, delegate
, rwh_delegate
, frame_tree
,
35 frame_tree_node
, routing_id
, widget_routing_id
, surface_id
, flags
));
39 void RenderFrameHostFactory::RegisterFactory(RenderFrameHostFactory
* factory
) {
40 DCHECK(!factory_
) << "Can't register two factories at once.";
45 void RenderFrameHostFactory::UnregisterFactory() {
46 DCHECK(factory_
) << "No factory to unregister.";
50 } // namespace content