| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/frame_host/render_frame_host_factory.h" | 5 #include "content/browser/frame_host/render_frame_host_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/browser/frame_host/frame_tree_node.h" |
| 8 #include "content/browser/frame_host/render_frame_host_impl.h" | 9 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 9 | 10 |
| 10 namespace content { | 11 namespace content { |
| 11 | 12 |
| 12 // static | 13 // static |
| 13 RenderFrameHostFactory* RenderFrameHostFactory::factory_ = NULL; | 14 RenderFrameHostFactory* RenderFrameHostFactory::factory_ = NULL; |
| 14 | 15 |
| 15 // static | 16 // static |
| 16 scoped_ptr<RenderFrameHostImpl> RenderFrameHostFactory::Create( | 17 scoped_ptr<RenderFrameHostImpl> RenderFrameHostFactory::Create( |
| 17 RenderViewHostImpl* render_view_host, | 18 RenderViewHostImpl* render_view_host, |
| 18 FrameTree* frame_tree, | 19 FrameTree* frame_tree, |
| 20 FrameTreeNode* frame_tree_node, |
| 19 int routing_id, | 21 int routing_id, |
| 20 bool is_swapped_out) { | 22 bool is_swapped_out) { |
| 21 if (factory_) { | 23 if (factory_) { |
| 22 return factory_->CreateRenderFrameHost(render_view_host, | 24 return factory_->CreateRenderFrameHost(render_view_host, |
| 23 frame_tree, | 25 frame_tree, |
| 26 frame_tree_node, |
| 24 routing_id, | 27 routing_id, |
| 25 is_swapped_out).Pass(); | 28 is_swapped_out).Pass(); |
| 26 } | 29 } |
| 27 return make_scoped_ptr(new RenderFrameHostImpl( | 30 return make_scoped_ptr(new RenderFrameHostImpl( |
| 28 render_view_host, frame_tree, routing_id, is_swapped_out)); | 31 render_view_host, frame_tree, frame_tree_node, routing_id, |
| 32 is_swapped_out)); |
| 29 } | 33 } |
| 30 | 34 |
| 31 // static | 35 // static |
| 32 void RenderFrameHostFactory::RegisterFactory(RenderFrameHostFactory* factory) { | 36 void RenderFrameHostFactory::RegisterFactory(RenderFrameHostFactory* factory) { |
| 33 DCHECK(!factory_) << "Can't register two factories at once."; | 37 DCHECK(!factory_) << "Can't register two factories at once."; |
| 34 factory_ = factory; | 38 factory_ = factory; |
| 35 } | 39 } |
| 36 | 40 |
| 37 // static | 41 // static |
| 38 void RenderFrameHostFactory::UnregisterFactory() { | 42 void RenderFrameHostFactory::UnregisterFactory() { |
| 39 DCHECK(factory_) << "No factory to unregister."; | 43 DCHECK(factory_) << "No factory to unregister."; |
| 40 factory_ = NULL; | 44 factory_ = NULL; |
| 41 } | 45 } |
| 42 | 46 |
| 43 } // namespace content | 47 } // namespace content |
| OLD | NEW |