Chromium Code Reviews| 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_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 <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 #include "content/common/mojo/service_registry_impl.h" | |
| 17 #include "content/public/browser/render_frame_host.h" | 18 #include "content/public/browser/render_frame_host.h" |
| 18 #include "content/public/common/javascript_message_type.h" | 19 #include "content/public/common/javascript_message_type.h" |
| 19 #include "content/public/common/page_transition_types.h" | 20 #include "content/public/common/page_transition_types.h" |
| 20 #include "third_party/WebKit/public/web/WebTextDirection.h" | 21 #include "third_party/WebKit/public/web/WebTextDirection.h" |
| 21 | 22 |
| 22 class GURL; | 23 class GURL; |
| 23 struct FrameHostMsg_DidFailProvisionalLoadWithError_Params; | 24 struct FrameHostMsg_DidFailProvisionalLoadWithError_Params; |
| 24 struct FrameHostMsg_OpenURL_Params; | 25 struct FrameHostMsg_OpenURL_Params; |
| 25 struct FrameMsg_Navigate_Params; | 26 struct FrameMsg_Navigate_Params; |
| 26 | 27 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 virtual const std::string& GetFrameName() OVERRIDE; | 60 virtual const std::string& GetFrameName() OVERRIDE; |
| 60 virtual bool IsCrossProcessSubframe() OVERRIDE; | 61 virtual bool IsCrossProcessSubframe() OVERRIDE; |
| 61 virtual GURL GetLastCommittedURL() OVERRIDE; | 62 virtual GURL GetLastCommittedURL() OVERRIDE; |
| 62 virtual gfx::NativeView GetNativeView() OVERRIDE; | 63 virtual gfx::NativeView GetNativeView() OVERRIDE; |
| 63 virtual void ExecuteJavaScript( | 64 virtual void ExecuteJavaScript( |
| 64 const base::string16& javascript) OVERRIDE; | 65 const base::string16& javascript) OVERRIDE; |
| 65 virtual void ExecuteJavaScript( | 66 virtual void ExecuteJavaScript( |
| 66 const base::string16& javascript, | 67 const base::string16& javascript, |
| 67 const JavaScriptResultCallback& callback) OVERRIDE; | 68 const JavaScriptResultCallback& callback) OVERRIDE; |
| 68 virtual RenderViewHost* GetRenderViewHost() OVERRIDE; | 69 virtual RenderViewHost* GetRenderViewHost() OVERRIDE; |
| 70 virtual ServiceRegistry* GetServiceRegistry() OVERRIDE; | |
| 69 | 71 |
| 70 // IPC::Sender | 72 // IPC::Sender |
| 71 virtual bool Send(IPC::Message* msg) OVERRIDE; | 73 virtual bool Send(IPC::Message* msg) OVERRIDE; |
| 72 | 74 |
| 73 // IPC::Listener | 75 // IPC::Listener |
| 74 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 76 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 75 | 77 |
| 76 void Init(); | 78 void Init(); |
| 77 int routing_id() const { return routing_id_; } | 79 int routing_id() const { return routing_id_; } |
| 78 void OnCreateChildFrame(int new_routing_id, | 80 void OnCreateChildFrame(int new_routing_id, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 // Notifies the RenderFrame that the JavaScript message that was shown was | 162 // Notifies the RenderFrame that the JavaScript message that was shown was |
| 161 // closed by the user. | 163 // closed by the user. |
| 162 void JavaScriptDialogClosed(IPC::Message* reply_msg, | 164 void JavaScriptDialogClosed(IPC::Message* reply_msg, |
| 163 bool success, | 165 bool success, |
| 164 const base::string16& user_input, | 166 const base::string16& user_input, |
| 165 bool dialog_was_suppressed); | 167 bool dialog_was_suppressed); |
| 166 | 168 |
| 167 // Called when an HTML5 notification is closed. | 169 // Called when an HTML5 notification is closed. |
| 168 void NotificationClosed(int notification_id); | 170 void NotificationClosed(int notification_id); |
| 169 | 171 |
| 172 // Binds this render frame's service registry to a handle to the remote | |
| 173 // service registry. | |
| 174 void BindServiceRegistry(mojo::ScopedMessagePipeHandle shell_handle); | |
|
darin (slow to review)
2014/06/12 05:27:12
nit: shell_handle seems like the wrong parameter n
Sam McNally
2014/06/12 08:56:40
Done.
| |
| 175 | |
| 170 protected: | 176 protected: |
| 171 friend class RenderFrameHostFactory; | 177 friend class RenderFrameHostFactory; |
| 172 | 178 |
| 173 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost | 179 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost |
| 174 // should be the abstraction needed here, but we need RenderViewHost to pass | 180 // should be the abstraction needed here, but we need RenderViewHost to pass |
| 175 // into WebContentsObserver::FrameDetached for now. | 181 // into WebContentsObserver::FrameDetached for now. |
| 176 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, | 182 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, |
| 177 RenderFrameHostDelegate* delegate, | 183 RenderFrameHostDelegate* delegate, |
| 178 FrameTree* frame_tree, | 184 FrameTree* frame_tree, |
| 179 FrameTreeNode* frame_tree_node, | 185 FrameTreeNode* frame_tree_node, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 | 289 |
| 284 // Map from notification_id to a callback to cancel them. | 290 // Map from notification_id to a callback to cancel them. |
| 285 std::map<int, base::Closure> cancel_notification_callbacks_; | 291 std::map<int, base::Closure> cancel_notification_callbacks_; |
| 286 | 292 |
| 287 int routing_id_; | 293 int routing_id_; |
| 288 bool is_swapped_out_; | 294 bool is_swapped_out_; |
| 289 | 295 |
| 290 // When the last BeforeUnload message was sent. | 296 // When the last BeforeUnload message was sent. |
| 291 base::TimeTicks send_before_unload_start_time_; | 297 base::TimeTicks send_before_unload_start_time_; |
| 292 | 298 |
| 299 ServiceRegistryImpl service_registry_; | |
| 300 | |
| 293 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 301 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 294 | 302 |
| 295 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 303 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 296 }; | 304 }; |
| 297 | 305 |
| 298 } // namespace content | 306 } // namespace content |
| 299 | 307 |
| 300 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 308 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |