OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEW_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // you will not be able to traverse pages back and forward. We need to determine | 112 // you will not be able to traverse pages back and forward. We need to determine |
113 // if we want to bring that and other functionality down into this object so it | 113 // if we want to bring that and other functionality down into this object so it |
114 // can be shared by others. | 114 // can be shared by others. |
115 class CONTENT_EXPORT RenderViewHostImpl | 115 class CONTENT_EXPORT RenderViewHostImpl |
116 : public RenderViewHost, | 116 : public RenderViewHost, |
117 public RenderWidgetHostImpl { | 117 public RenderWidgetHostImpl { |
118 public: | 118 public: |
119 // Convenience function, just like RenderViewHost::FromID. | 119 // Convenience function, just like RenderViewHost::FromID. |
120 static RenderViewHostImpl* FromID(int render_process_id, int render_view_id); | 120 static RenderViewHostImpl* FromID(int render_process_id, int render_view_id); |
121 | 121 |
122 // routing_id could be a valid route id, or it could be MSG_ROUTING_NONE, in | 122 // |routing_id| could be a valid route id, or it could be MSG_ROUTING_NONE, in |
123 // which case RenderWidgetHost will create a new one. | 123 // which case RenderWidgetHost will create a new one. |swapped_out| indicates |
| 124 // whether the view should initially be swapped out (e.g., for an opener |
| 125 // frame being rendered by another process). |
124 // | 126 // |
125 // The session storage namespace parameter allows multiple render views and | 127 // The |session_storage_namespace| parameter allows multiple render views and |
126 // WebContentses to share the same session storage (part of the WebStorage | 128 // WebContentses to share the same session storage (part of the WebStorage |
127 // spec) space. This is useful when restoring contentses, but most callers | 129 // spec) space. This is useful when restoring contentses, but most callers |
128 // should pass in NULL which will cause a new SessionStorageNamespace to be | 130 // should pass in NULL which will cause a new SessionStorageNamespace to be |
129 // created. | 131 // created. |
130 RenderViewHostImpl( | 132 RenderViewHostImpl( |
131 SiteInstance* instance, | 133 SiteInstance* instance, |
132 RenderViewHostDelegate* delegate, | 134 RenderViewHostDelegate* delegate, |
133 int routing_id, | 135 int routing_id, |
| 136 bool swapped_out, |
134 SessionStorageNamespace* session_storage_namespace); | 137 SessionStorageNamespace* session_storage_namespace); |
135 virtual ~RenderViewHostImpl(); | 138 virtual ~RenderViewHostImpl(); |
136 | 139 |
137 // RenderViewHost implementation. | 140 // RenderViewHost implementation. |
138 virtual void AllowBindings(int binding_flags) OVERRIDE; | 141 virtual void AllowBindings(int binding_flags) OVERRIDE; |
139 virtual void ClearFocusedNode() OVERRIDE; | 142 virtual void ClearFocusedNode() OVERRIDE; |
140 virtual void ClosePage() OVERRIDE; | 143 virtual void ClosePage() OVERRIDE; |
141 virtual void CopyImageAt(int x, int y) OVERRIDE; | 144 virtual void CopyImageAt(int x, int y) OVERRIDE; |
142 virtual void DisassociateFromPopupCount() OVERRIDE; | 145 virtual void DisassociateFromPopupCount() OVERRIDE; |
143 virtual void DesktopNotificationPermissionRequestDone( | 146 virtual void DesktopNotificationPermissionRequestDone( |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 virtual void ToggleSpeechInput() OVERRIDE; | 221 virtual void ToggleSpeechInput() OVERRIDE; |
219 virtual void UpdateWebkitPreferences(const WebPreferences& prefs) OVERRIDE; | 222 virtual void UpdateWebkitPreferences(const WebPreferences& prefs) OVERRIDE; |
220 | 223 |
221 void set_delegate(RenderViewHostDelegate* d) { | 224 void set_delegate(RenderViewHostDelegate* d) { |
222 CHECK(d); // http://crbug.com/82827 | 225 CHECK(d); // http://crbug.com/82827 |
223 delegate_ = d; | 226 delegate_ = d; |
224 } | 227 } |
225 | 228 |
226 // Set up the RenderView child process. Virtual because it is overridden by | 229 // Set up the RenderView child process. Virtual because it is overridden by |
227 // TestRenderViewHost. If the |frame_name| parameter is non-empty, it is used | 230 // TestRenderViewHost. If the |frame_name| parameter is non-empty, it is used |
228 // as the name of the new top-level frame. If |max_page_id| is larger than | 231 // as the name of the new top-level frame. The |opener_route_id| parameter |
229 // -1, the RenderView is told to start issuing page IDs at |max_page_id| + 1. | 232 // indicates which RenderView created this (MSG_ROUTING_NONE if none). If |
230 virtual bool CreateRenderView(const string16& frame_name, int32 max_page_id); | 233 // |max_page_id| is larger than -1, the RenderView is told to start issuing |
| 234 // page IDs at |max_page_id| + 1. |
| 235 virtual bool CreateRenderView(const string16& frame_name, |
| 236 int opener_route_id, |
| 237 int32 max_page_id); |
231 | 238 |
232 base::TerminationStatus render_view_termination_status() const { | 239 base::TerminationStatus render_view_termination_status() const { |
233 return render_view_termination_status_; | 240 return render_view_termination_status_; |
234 } | 241 } |
235 | 242 |
236 // Sends the given navigation message. Use this rather than sending it | 243 // Sends the given navigation message. Use this rather than sending it |
237 // yourself since this does the internal bookkeeping described below. This | 244 // yourself since this does the internal bookkeeping described below. This |
238 // function takes ownership of the provided message pointer. | 245 // function takes ownership of the provided message pointer. |
239 // | 246 // |
240 // If a cross-site request is in progress, we may be suspended while waiting | 247 // If a cross-site request is in progress, we may be suspended while waiting |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 633 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
627 }; | 634 }; |
628 | 635 |
629 #if defined(COMPILER_MSVC) | 636 #if defined(COMPILER_MSVC) |
630 #pragma warning(pop) | 637 #pragma warning(pop) |
631 #endif | 638 #endif |
632 | 639 |
633 } // namespace content | 640 } // namespace content |
634 | 641 |
635 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 642 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
OLD | NEW |