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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_FRAME_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_FRAME_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_FRAME_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_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/public/browser/render_frame_host.h" | 11 #include "content/public/browser/render_frame_host.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
15 class FrameTree; | 15 class FrameTree; |
| 16 class Navigator; |
16 class RenderProcessHost; | 17 class RenderProcessHost; |
17 class RenderViewHostImpl; | 18 class RenderViewHostImpl; |
| 19 class SiteInstance; |
18 | 20 |
19 class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost { | 21 class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost { |
20 public: | 22 public: |
21 static RenderFrameHostImpl* FromID(int process_id, int routing_id); | 23 static RenderFrameHostImpl* FromID(int process_id, int routing_id); |
22 | 24 |
23 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost | 25 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost |
24 // should be the abstraction needed here, but we need RenderViewHost to pass | 26 // should be the abstraction needed here, but we need RenderViewHost to pass |
25 // into WebContentsObserver::FrameDetached for now. | 27 // into WebContentsObserver::FrameDetached for now. |
26 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, | 28 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, |
27 FrameTree* frame_tree, | 29 FrameTree* frame_tree, |
28 int routing_id, | 30 int routing_id, |
29 bool is_swapped_out); | 31 bool is_swapped_out); |
30 virtual ~RenderFrameHostImpl(); | 32 virtual ~RenderFrameHostImpl(); |
31 | 33 |
32 // IPC::Sender | 34 // IPC::Sender |
33 virtual bool Send(IPC::Message* msg) OVERRIDE; | 35 virtual bool Send(IPC::Message* msg) OVERRIDE; |
34 | 36 |
35 // IPC::Listener | 37 // IPC::Listener |
36 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 38 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
37 | 39 |
| 40 // RenderFrameHost |
| 41 virtual RenderProcessHost* GetProcess() const OVERRIDE; |
| 42 virtual SiteInstance* GetSiteInstance() const OVERRIDE; |
| 43 |
38 void Init(); | 44 void Init(); |
39 RenderProcessHost* GetProcess() const; | |
40 int routing_id() const { return routing_id_; } | 45 int routing_id() const { return routing_id_; } |
41 void OnCreateChildFrame(int new_frame_routing_id, | 46 void OnCreateChildFrame(int new_frame_routing_id, |
42 int64 parent_frame_id, | 47 int64 parent_frame_id, |
43 int64 frame_id, | 48 int64 frame_id, |
44 const std::string& frame_name); | 49 const std::string& frame_name); |
45 | 50 |
46 RenderViewHostImpl* render_view_host() { | 51 RenderViewHostImpl* render_view_host() { |
47 return render_view_host_; | 52 return render_view_host_; |
48 } | 53 } |
49 | 54 |
50 private: | 55 private: |
51 bool is_swapped_out() { return is_swapped_out_; } | 56 bool is_swapped_out() { return is_swapped_out_; } |
52 | 57 |
53 // IPC message handlers. | 58 // IPC message handlers. |
54 void OnDetach(int64 parent_frame_id, int64 frame_id); | 59 void OnDetach(int64 parent_frame_id, int64 frame_id); |
55 | 60 |
56 // TODO(nasko): This should be removed and replaced by RenderProcessHost. | 61 // TODO(nasko): This should be removed and replaced by RenderProcessHost. |
57 RenderViewHostImpl* render_view_host_; // Not owned. | 62 RenderViewHostImpl* render_view_host_; // Not owned. |
58 | 63 |
59 // Reference to the whole frame tree that this RenderFrameHost belongs too. | 64 // Reference to the whole frame tree that this RenderFrameHost belongs too. |
60 // Allows this RenderFrameHost to add and remove nodes in response to | 65 // Allows this RenderFrameHost to add and remove nodes in response to |
61 // messages from the renderer requesting DOM manipulation. | 66 // messages from the renderer requesting DOM manipulation. |
62 FrameTree* frame_tree_; | 67 FrameTree* frame_tree_; |
| 68 |
| 69 // The Navigator object allows the RenderFrameHost to perform navigations |
| 70 // in its own frame in the frame tree. The Navigator is owned by FrameTree. |
| 71 Navigator* navigator_; |
| 72 |
63 int routing_id_; | 73 int routing_id_; |
64 bool is_swapped_out_; | 74 bool is_swapped_out_; |
65 | 75 |
66 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 76 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
67 }; | 77 }; |
68 | 78 |
69 } // namespace content | 79 } // namespace content |
70 | 80 |
71 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_FRAME_HOST_IMPL_H_ | 81 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_FRAME_HOST_IMPL_H_ |
OLD | NEW |