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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.h

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 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "content/public/browser/render_frame_host.h" 12 #include "content/public/browser/render_frame_host.h"
13 13
14 class GURL; 14 class GURL;
15 15
16 namespace content { 16 namespace content {
17 17
18 class FrameTree; 18 class FrameTree;
19 class RenderFrameHostDelegate;
19 class RenderProcessHost; 20 class RenderProcessHost;
20 class RenderViewHostImpl; 21 class RenderViewHostImpl;
21 22
22 class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost { 23 class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost {
23 public: 24 public:
24 static RenderFrameHostImpl* FromID(int process_id, int routing_id); 25 static RenderFrameHostImpl* FromID(int process_id, int routing_id);
25 26
26 virtual ~RenderFrameHostImpl(); 27 virtual ~RenderFrameHostImpl();
27 28
28 // IPC::Sender 29 // IPC::Sender
29 virtual bool Send(IPC::Message* msg) OVERRIDE; 30 virtual bool Send(IPC::Message* msg) OVERRIDE;
30 31
31 // IPC::Listener 32 // IPC::Listener
32 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 33 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
33 34
34 void Init(); 35 void Init();
35 RenderProcessHost* GetProcess() const; 36 RenderProcessHost* GetProcess() const;
36 int routing_id() const { return routing_id_; } 37 int routing_id() const { return routing_id_; }
37 void OnCreateChildFrame(int new_frame_routing_id, 38 void OnCreateChildFrame(int new_frame_routing_id,
38 int64 parent_frame_id, 39 int64 parent_frame_id,
39 int64 frame_id, 40 int64 frame_id,
40 const std::string& frame_name); 41 const std::string& frame_name);
41 42
42 RenderViewHostImpl* render_view_host() { 43 RenderViewHostImpl* render_view_host() { return render_view_host_; }
43 return render_view_host_; 44 RenderFrameHostDelegate* delegate() { return delegate_; }
44 }
45 45
46 protected: 46 protected:
47 friend class RenderFrameHostFactory; 47 friend class RenderFrameHostFactory;
48 48
49 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost 49 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost
50 // should be the abstraction needed here, but we need RenderViewHost to pass 50 // should be the abstraction needed here, but we need RenderViewHost to pass
51 // into WebContentsObserver::FrameDetached for now. 51 // into WebContentsObserver::FrameDetached for now.
52 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, 52 RenderFrameHostImpl(RenderViewHostImpl* render_view_host,
53 RenderFrameHostDelegate* delegate,
53 FrameTree* frame_tree, 54 FrameTree* frame_tree,
54 int routing_id, 55 int routing_id,
55 bool is_swapped_out); 56 bool is_swapped_out);
56 57
57 private: 58 private:
58 // IPC Message handlers. 59 // IPC Message handlers.
59 void OnDetach(int64 parent_frame_id, int64 frame_id); 60 void OnDetach(int64 parent_frame_id, int64 frame_id);
60 void OnDidStartProvisionalLoadForFrame(int64 frame_id, 61 void OnDidStartProvisionalLoadForFrame(int64 frame_id,
61 int64 parent_frame_id, 62 int64 parent_frame_id,
62 bool main_frame, 63 bool main_frame,
63 const GURL& url); 64 const GURL& url);
64 65
65 bool is_swapped_out() { return is_swapped_out_; } 66 bool is_swapped_out() { return is_swapped_out_; }
66 67
67 // TODO(nasko): This should be removed and replaced by RenderProcessHost. 68 // TODO(nasko): This should be removed and replaced by RenderProcessHost.
68 RenderViewHostImpl* render_view_host_; // Not owned. 69 RenderViewHostImpl* render_view_host_; // Not owned.
69 70
71 RenderFrameHostDelegate* delegate_;
72
70 // Reference to the whole frame tree that this RenderFrameHost belongs too. 73 // Reference to the whole frame tree that this RenderFrameHost belongs too.
71 // Allows this RenderFrameHost to add and remove nodes in response to 74 // Allows this RenderFrameHost to add and remove nodes in response to
72 // messages from the renderer requesting DOM manipulation. 75 // messages from the renderer requesting DOM manipulation.
73 FrameTree* frame_tree_; 76 FrameTree* frame_tree_;
74 int routing_id_; 77 int routing_id_;
75 bool is_swapped_out_; 78 bool is_swapped_out_;
76 79
77 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); 80 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
78 }; 81 };
79 82
80 } // namespace content 83 } // namespace content
81 84
82 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 85 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_factory.cc ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698