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_RENDERER_RENDER_VIEW_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 struct ViewMsg_PostMessage_Params; | 85 struct ViewMsg_PostMessage_Params; |
86 struct ViewMsg_StopFinding_Params; | 86 struct ViewMsg_StopFinding_Params; |
87 struct ViewMsg_SwapOut_Params; | 87 struct ViewMsg_SwapOut_Params; |
88 struct WebDropData; | 88 struct WebDropData; |
89 class WebIntentsHost; | 89 class WebIntentsHost; |
90 class WebPluginDelegateProxy; | 90 class WebPluginDelegateProxy; |
91 class WebUIBindings; | 91 class WebUIBindings; |
92 | 92 |
93 namespace content { | 93 namespace content { |
94 class DocumentState; | 94 class DocumentState; |
| 95 class GuestToEmbedderChannel; |
95 class NavigationState; | 96 class NavigationState; |
96 class P2PSocketDispatcher; | 97 class P2PSocketDispatcher; |
97 class RenderViewObserver; | 98 class RenderViewObserver; |
98 class RenderViewTest; | 99 class RenderViewTest; |
99 struct CustomContextMenuContext; | 100 struct CustomContextMenuContext; |
100 struct FileChooserParams; | 101 struct FileChooserParams; |
101 struct SelectedFileInfo; | 102 struct SelectedFileInfo; |
102 } // namespace content | 103 } // namespace content |
103 | 104 |
104 namespace gfx { | 105 namespace gfx { |
105 class Point; | 106 class Point; |
106 class Rect; | 107 class Rect; |
107 } // namespace gfx | 108 } // namespace gfx |
108 | 109 |
109 namespace webkit { | 110 namespace webkit { |
110 | 111 |
111 namespace ppapi { | 112 namespace ppapi { |
112 class PluginInstance; | 113 class PluginInstance; |
| 114 class WebPluginImpl; |
113 } // namespace ppapi | 115 } // namespace ppapi |
114 | 116 |
115 } // namespace webkit | 117 } // namespace webkit |
116 | 118 |
117 namespace webkit_glue { | 119 namespace webkit_glue { |
118 class ImageResourceFetcher; | 120 class ImageResourceFetcher; |
119 class ResourceFetcher; | 121 class ResourceFetcher; |
120 } | 122 } |
121 | 123 |
122 namespace WebKit { | 124 namespace WebKit { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 const webkit_glue::WebPreferences& webkit_prefs, | 195 const webkit_glue::WebPreferences& webkit_prefs, |
194 SharedRenderViewCounter* counter, | 196 SharedRenderViewCounter* counter, |
195 int32 routing_id, | 197 int32 routing_id, |
196 int32 surface_id, | 198 int32 surface_id, |
197 int64 session_storage_namespace_id, | 199 int64 session_storage_namespace_id, |
198 const string16& frame_name, | 200 const string16& frame_name, |
199 bool is_renderer_created, | 201 bool is_renderer_created, |
200 bool swapped_out, | 202 bool swapped_out, |
201 int32 next_page_id, | 203 int32 next_page_id, |
202 const WebKit::WebScreenInfo& screen_info, | 204 const WebKit::WebScreenInfo& screen_info, |
203 bool guest, | 205 content::GuestToEmbedderChannel* guest_to_embedder_channel, |
204 AccessibilityMode accessibility_mode); | 206 AccessibilityMode accessibility_mode); |
205 | 207 |
206 // Returns the RenderViewImpl containing the given WebView. | 208 // Returns the RenderViewImpl containing the given WebView. |
207 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); | 209 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); |
208 | 210 |
209 // May return NULL when the view is closing. | 211 // May return NULL when the view is closing. |
210 CONTENT_EXPORT WebKit::WebView* webview() const; | 212 CONTENT_EXPORT WebKit::WebView* webview() const; |
211 | 213 |
212 // WebGraphicsContext3DSwapBuffersClient implementation. | 214 // WebGraphicsContext3DSwapBuffersClient implementation. |
213 | 215 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // no other waiting items in the queue. | 256 // no other waiting items in the queue. |
255 // | 257 // |
256 // Returns true if the chooser was successfully scheduled. False means we | 258 // Returns true if the chooser was successfully scheduled. False means we |
257 // didn't schedule anything. | 259 // didn't schedule anything. |
258 bool ScheduleFileChooser(const content::FileChooserParams& params, | 260 bool ScheduleFileChooser(const content::FileChooserParams& params, |
259 WebKit::WebFileChooserCompletion* completion); | 261 WebKit::WebFileChooserCompletion* completion); |
260 | 262 |
261 // Sets whether the renderer should report load progress to the browser. | 263 // Sets whether the renderer should report load progress to the browser. |
262 void SetReportLoadProgressEnabled(bool enabled); | 264 void SetReportLoadProgressEnabled(bool enabled); |
263 | 265 |
264 bool guest() const { return guest_; } | 266 content::GuestToEmbedderChannel* |
| 267 guest_to_embedder_channel() const { return guest_to_embedder_channel_; } |
| 268 PP_Instance guest_pp_instance() const { return guest_pp_instance_; } |
| 269 void set_guest_graphics_resource(const ppapi::HostResource& resource) { |
| 270 guest_graphics_resource_ = resource; |
| 271 } |
| 272 const ppapi::HostResource& guest_graphics_resource() const { |
| 273 return guest_graphics_resource_; |
| 274 } |
| 275 |
| 276 // Once the browser plugin embedder has connected to this guest, and is |
| 277 // ready to paint, it informs the guest through GuestReady to begin |
| 278 // compositing. |
| 279 void GuestReady(PP_Instance instance); |
| 280 |
| 281 webkit::ppapi::WebPluginImpl* CreateBrowserPlugin( |
| 282 const IPC::ChannelHandle& channel_handle, |
| 283 int guest_process_id, |
| 284 const WebKit::WebPluginParams& params); |
265 | 285 |
266 void LoadNavigationErrorPage( | 286 void LoadNavigationErrorPage( |
267 WebKit::WebFrame* frame, | 287 WebKit::WebFrame* frame, |
268 const WebKit::WebURLRequest& failed_request, | 288 const WebKit::WebURLRequest& failed_request, |
269 const WebKit::WebURLError& error, | 289 const WebKit::WebURLError& error, |
270 const std::string& html, | 290 const std::string& html, |
271 bool replace); | 291 bool replace); |
272 | 292 |
273 // Plugin-related functions -------------------------------------------------- | 293 // Plugin-related functions -------------------------------------------------- |
274 // (See also WebPluginPageDelegate implementation.) | 294 // (See also WebPluginPageDelegate implementation.) |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 const webkit_glue::WebPreferences& webkit_prefs, | 771 const webkit_glue::WebPreferences& webkit_prefs, |
752 SharedRenderViewCounter* counter, | 772 SharedRenderViewCounter* counter, |
753 int32 routing_id, | 773 int32 routing_id, |
754 int32 surface_id, | 774 int32 surface_id, |
755 int64 session_storage_namespace_id, | 775 int64 session_storage_namespace_id, |
756 const string16& frame_name, | 776 const string16& frame_name, |
757 bool is_renderer_created, | 777 bool is_renderer_created, |
758 bool swapped_out, | 778 bool swapped_out, |
759 int32 next_page_id, | 779 int32 next_page_id, |
760 const WebKit::WebScreenInfo& screen_info, | 780 const WebKit::WebScreenInfo& screen_info, |
761 bool guest, | 781 content::GuestToEmbedderChannel* guest_to_embedder_channel, |
762 AccessibilityMode accessibility_mode); | 782 AccessibilityMode accessibility_mode); |
763 | 783 |
764 // Do not delete directly. This class is reference counted. | 784 // Do not delete directly. This class is reference counted. |
765 virtual ~RenderViewImpl(); | 785 virtual ~RenderViewImpl(); |
766 | 786 |
767 void UpdateURL(WebKit::WebFrame* frame); | 787 void UpdateURL(WebKit::WebFrame* frame); |
768 void UpdateTitle(WebKit::WebFrame* frame, const string16& title, | 788 void UpdateTitle(WebKit::WebFrame* frame, const string16& title, |
769 WebKit::WebTextDirection title_direction); | 789 WebKit::WebTextDirection title_direction); |
770 void UpdateSessionHistory(WebKit::WebFrame* frame); | 790 void UpdateSessionHistory(WebKit::WebFrame* frame); |
771 void SendUpdateState(const WebKit::WebHistoryItem& item); | 791 void SendUpdateState(const WebKit::WebHistoryItem& item); |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 | 1350 |
1331 #if defined(OS_WIN) | 1351 #if defined(OS_WIN) |
1332 // The ID of the focused NPAPI plug-in. | 1352 // The ID of the focused NPAPI plug-in. |
1333 int focused_plugin_id_; | 1353 int focused_plugin_id_; |
1334 #endif | 1354 #endif |
1335 | 1355 |
1336 // Allows JS to access DOM automation. The JS object is only exposed when the | 1356 // Allows JS to access DOM automation. The JS object is only exposed when the |
1337 // DOM automation bindings are enabled. | 1357 // DOM automation bindings are enabled. |
1338 scoped_ptr<DomAutomationController> dom_automation_controller_; | 1358 scoped_ptr<DomAutomationController> dom_automation_controller_; |
1339 | 1359 |
1340 // Indicates whether this RenderView is a guest of another RenderView. | 1360 // Channel for communication with embedding renderer, if it exists. |
1341 bool guest_; | 1361 scoped_refptr<content::GuestToEmbedderChannel> guest_to_embedder_channel_; |
| 1362 |
| 1363 // The pepper instance identifer for this guest RenderView. |
| 1364 PP_Instance guest_pp_instance_; |
| 1365 |
| 1366 // The ppapi::HostResource associated with the on-screen context for this |
| 1367 // guest RenderView. |
| 1368 ppapi::HostResource guest_graphics_resource_; |
| 1369 |
| 1370 // This graphics context is initialized once GuestReady() is called. |
| 1371 WebGraphicsContext3DCommandBufferImpl* guest_uninitialized_context_; |
| 1372 |
| 1373 // These are the attributes originally passed into createGraphicsContext3D |
| 1374 // before the guest_to_embedder_channel was ready. |
| 1375 WebKit::WebGraphicsContext3D::Attributes guest_attributes_; |
1342 | 1376 |
1343 // The accessibility mode. | 1377 // The accessibility mode. |
1344 AccessibilityMode accessibility_mode_; | 1378 AccessibilityMode accessibility_mode_; |
1345 | 1379 |
1346 // NOTE: pepper_delegate_ should be last member because its constructor calls | 1380 // NOTE: pepper_delegate_ should be last member because its constructor calls |
1347 // AddObservers method of RenderViewImpl from c-tor. | 1381 // AddObservers method of RenderViewImpl from c-tor. |
1348 content::PepperPluginDelegateImpl pepper_delegate_; | 1382 content::PepperPluginDelegateImpl pepper_delegate_; |
1349 | 1383 |
1350 // --------------------------------------------------------------------------- | 1384 // --------------------------------------------------------------------------- |
1351 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 1385 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
1352 // sections rather than throwing it randomly at the end. If you're adding a | 1386 // sections rather than throwing it randomly at the end. If you're adding a |
1353 // bunch of stuff, you should probably create a helper class and put your | 1387 // bunch of stuff, you should probably create a helper class and put your |
1354 // data and methods on that to avoid bloating RenderView more. You can | 1388 // data and methods on that to avoid bloating RenderView more. You can |
1355 // use the Observer interface to filter IPC messages and receive frame change | 1389 // use the Observer interface to filter IPC messages and receive frame change |
1356 // notifications. | 1390 // notifications. |
1357 // --------------------------------------------------------------------------- | 1391 // --------------------------------------------------------------------------- |
1358 | 1392 |
1359 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1393 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1360 }; | 1394 }; |
1361 | 1395 |
1362 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1396 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |