Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: content/browser/frame_host/render_frame_host_factory.cc

Issue 103633002: Add RenderFrameHostDelegate and plumb it through all the necessary classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/render_frame_host_impl.h" 8 #include "content/browser/frame_host/render_frame_host_impl.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 // static 12 // static
13 RenderFrameHostFactory* RenderFrameHostFactory::factory_ = NULL; 13 RenderFrameHostFactory* RenderFrameHostFactory::factory_ = NULL;
14 14
15 // static 15 // static
16 scoped_ptr<RenderFrameHostImpl> RenderFrameHostFactory::Create( 16 scoped_ptr<RenderFrameHostImpl> RenderFrameHostFactory::Create(
17 RenderViewHostImpl* render_view_host, 17 RenderViewHostImpl* render_view_host,
18 RenderFrameHostDelegate* delegate,
18 FrameTree* frame_tree, 19 FrameTree* frame_tree,
19 int routing_id, 20 int routing_id,
20 bool is_swapped_out) { 21 bool is_swapped_out) {
21 if (factory_) { 22 if (factory_) {
22 return factory_->CreateRenderFrameHost(render_view_host, 23 return factory_->CreateRenderFrameHost(render_view_host,
24 delegate,
23 frame_tree, 25 frame_tree,
24 routing_id, 26 routing_id,
25 is_swapped_out).Pass(); 27 is_swapped_out).Pass();
26 } 28 }
27 return make_scoped_ptr(new RenderFrameHostImpl( 29 return make_scoped_ptr(new RenderFrameHostImpl(
28 render_view_host, frame_tree, routing_id, is_swapped_out)); 30 render_view_host, delegate, frame_tree, routing_id, is_swapped_out));
29 } 31 }
30 32
31 // static 33 // static
32 void RenderFrameHostFactory::RegisterFactory(RenderFrameHostFactory* factory) { 34 void RenderFrameHostFactory::RegisterFactory(RenderFrameHostFactory* factory) {
33 DCHECK(!factory_) << "Can't register two factories at once."; 35 DCHECK(!factory_) << "Can't register two factories at once.";
34 factory_ = factory; 36 factory_ = factory;
35 } 37 }
36 38
37 // static 39 // static
38 void RenderFrameHostFactory::UnregisterFactory() { 40 void RenderFrameHostFactory::UnregisterFactory() {
39 DCHECK(factory_) << "No factory to unregister."; 41 DCHECK(factory_) << "No factory to unregister.";
40 factory_ = NULL; 42 factory_ = NULL;
41 } 43 }
42 44
43 } // namespace content 45 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_factory.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698