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> |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 16 #include "base/callback.h" |
16 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
17 #include "base/id_map.h" | 18 #include "base/id_map.h" |
18 #include "base/memory/linked_ptr.h" | 19 #include "base/memory/linked_ptr.h" |
19 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
20 #include "base/observer_list.h" | 21 #include "base/observer_list.h" |
21 #include "base/timer.h" | 22 #include "base/timer.h" |
22 #include "build/build_config.h" | 23 #include "build/build_config.h" |
23 #include "content/common/content_export.h" | 24 #include "content/common/content_export.h" |
24 #include "content/common/edit_command.h" | 25 #include "content/common/edit_command.h" |
25 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 26 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 struct ViewMsg_Navigate_Params; | 84 struct ViewMsg_Navigate_Params; |
84 struct ViewMsg_StopFinding_Params; | 85 struct ViewMsg_StopFinding_Params; |
85 struct ViewMsg_SwapOut_Params; | 86 struct ViewMsg_SwapOut_Params; |
86 struct WebDropData; | 87 struct WebDropData; |
87 class WebIntentsHost; | 88 class WebIntentsHost; |
88 class WebPluginDelegateProxy; | 89 class WebPluginDelegateProxy; |
89 class WebUIBindings; | 90 class WebUIBindings; |
90 | 91 |
91 namespace content { | 92 namespace content { |
92 class DocumentState; | 93 class DocumentState; |
| 94 class GuestToEmbedderChannel; |
93 class NavigationState; | 95 class NavigationState; |
94 class P2PSocketDispatcher; | 96 class P2PSocketDispatcher; |
95 class RenderViewObserver; | 97 class RenderViewObserver; |
96 class RenderViewTest; | 98 class RenderViewTest; |
97 struct CustomContextMenuContext; | 99 struct CustomContextMenuContext; |
98 struct FileChooserParams; | 100 struct FileChooserParams; |
99 struct SelectedFileInfo; | 101 struct SelectedFileInfo; |
100 } // namespace content | 102 } // namespace content |
101 | 103 |
102 namespace gfx { | 104 namespace gfx { |
103 class Point; | 105 class Point; |
104 class Rect; | 106 class Rect; |
105 } // namespace gfx | 107 } // namespace gfx |
106 | 108 |
107 namespace webkit { | 109 namespace webkit { |
108 | 110 |
109 namespace ppapi { | 111 namespace ppapi { |
110 class PluginInstance; | 112 class PluginInstance; |
| 113 class WebPluginImpl; |
111 } // namespace ppapi | 114 } // namespace ppapi |
112 | 115 |
113 } // namespace webkit | 116 } // namespace webkit |
114 | 117 |
115 namespace webkit_glue { | 118 namespace webkit_glue { |
116 class ImageResourceFetcher; | 119 class ImageResourceFetcher; |
117 class ResourceFetcher; | 120 class ResourceFetcher; |
118 } | 121 } |
119 | 122 |
120 namespace WebKit { | 123 namespace WebKit { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 const webkit_glue::WebPreferences& webkit_prefs, | 193 const webkit_glue::WebPreferences& webkit_prefs, |
191 SharedRenderViewCounter* counter, | 194 SharedRenderViewCounter* counter, |
192 int32 routing_id, | 195 int32 routing_id, |
193 int32 surface_id, | 196 int32 surface_id, |
194 int64 session_storage_namespace_id, | 197 int64 session_storage_namespace_id, |
195 const string16& frame_name, | 198 const string16& frame_name, |
196 bool is_renderer_created, | 199 bool is_renderer_created, |
197 bool swapped_out, | 200 bool swapped_out, |
198 int32 next_page_id, | 201 int32 next_page_id, |
199 const WebKit::WebScreenInfo& screen_info, | 202 const WebKit::WebScreenInfo& screen_info, |
200 bool guest, | 203 content::GuestToEmbedderChannel* guest_to_embedder_channel, |
201 AccessibilityMode accessibility_mode); | 204 AccessibilityMode accessibility_mode); |
202 | 205 |
203 // Returns the RenderViewImpl containing the given WebView. | 206 // Returns the RenderViewImpl containing the given WebView. |
204 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); | 207 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); |
205 | 208 |
206 // May return NULL when the view is closing. | 209 // May return NULL when the view is closing. |
207 CONTENT_EXPORT WebKit::WebView* webview() const; | 210 CONTENT_EXPORT WebKit::WebView* webview() const; |
208 | 211 |
209 // WebGraphicsContext3DSwapBuffersClient implementation. | 212 // WebGraphicsContext3DSwapBuffersClient implementation. |
210 | 213 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // no other waiting items in the queue. | 254 // no other waiting items in the queue. |
252 // | 255 // |
253 // Returns true if the chooser was successfully scheduled. False means we | 256 // Returns true if the chooser was successfully scheduled. False means we |
254 // didn't schedule anything. | 257 // didn't schedule anything. |
255 bool ScheduleFileChooser(const content::FileChooserParams& params, | 258 bool ScheduleFileChooser(const content::FileChooserParams& params, |
256 WebKit::WebFileChooserCompletion* completion); | 259 WebKit::WebFileChooserCompletion* completion); |
257 | 260 |
258 // Sets whether the renderer should report load progress to the browser. | 261 // Sets whether the renderer should report load progress to the browser. |
259 void SetReportLoadProgressEnabled(bool enabled); | 262 void SetReportLoadProgressEnabled(bool enabled); |
260 | 263 |
261 bool guest() const { return guest_; } | 264 content::GuestToEmbedderChannel* |
| 265 guest_to_embedder_channel() const { return guest_to_embedder_channel_; } |
| 266 PP_Instance pp_instance() const { return pp_instance_; } |
| 267 void set_host_resource(const ppapi::HostResource& host_resource) { |
| 268 resource_ = host_resource; |
| 269 } |
| 270 const ppapi::HostResource& host_resource() const { return resource_; } |
| 271 |
| 272 void GuestReady(PP_Instance instance); |
| 273 |
| 274 webkit::ppapi::WebPluginImpl* CreateBrowserPlugin( |
| 275 const IPC::ChannelHandle& channel_handle, |
| 276 int guest_process_id, |
| 277 const WebKit::WebPluginParams& params); |
262 | 278 |
263 void LoadNavigationErrorPage( | 279 void LoadNavigationErrorPage( |
264 WebKit::WebFrame* frame, | 280 WebKit::WebFrame* frame, |
265 const WebKit::WebURLRequest& failed_request, | 281 const WebKit::WebURLRequest& failed_request, |
266 const WebKit::WebURLError& error, | 282 const WebKit::WebURLError& error, |
267 const std::string& html, | 283 const std::string& html, |
268 bool replace); | 284 bool replace); |
269 | 285 |
270 // Plugin-related functions -------------------------------------------------- | 286 // Plugin-related functions -------------------------------------------------- |
271 // (See also WebPluginPageDelegate implementation.) | 287 // (See also WebPluginPageDelegate implementation.) |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 const webkit_glue::WebPreferences& webkit_prefs, | 762 const webkit_glue::WebPreferences& webkit_prefs, |
747 SharedRenderViewCounter* counter, | 763 SharedRenderViewCounter* counter, |
748 int32 routing_id, | 764 int32 routing_id, |
749 int32 surface_id, | 765 int32 surface_id, |
750 int64 session_storage_namespace_id, | 766 int64 session_storage_namespace_id, |
751 const string16& frame_name, | 767 const string16& frame_name, |
752 bool is_renderer_created, | 768 bool is_renderer_created, |
753 bool swapped_out, | 769 bool swapped_out, |
754 int32 next_page_id, | 770 int32 next_page_id, |
755 const WebKit::WebScreenInfo& screen_info, | 771 const WebKit::WebScreenInfo& screen_info, |
756 bool guest, | 772 content::GuestToEmbedderChannel* guest_to_embedder_channel, |
757 AccessibilityMode accessibility_mode); | 773 AccessibilityMode accessibility_mode); |
758 | 774 |
759 // Do not delete directly. This class is reference counted. | 775 // Do not delete directly. This class is reference counted. |
760 virtual ~RenderViewImpl(); | 776 virtual ~RenderViewImpl(); |
761 | 777 |
762 void UpdateURL(WebKit::WebFrame* frame); | 778 void UpdateURL(WebKit::WebFrame* frame); |
763 void UpdateTitle(WebKit::WebFrame* frame, const string16& title, | 779 void UpdateTitle(WebKit::WebFrame* frame, const string16& title, |
764 WebKit::WebTextDirection title_direction); | 780 WebKit::WebTextDirection title_direction); |
765 void UpdateSessionHistory(WebKit::WebFrame* frame); | 781 void UpdateSessionHistory(WebKit::WebFrame* frame); |
766 void SendUpdateState(const WebKit::WebHistoryItem& item); | 782 void SendUpdateState(const WebKit::WebHistoryItem& item); |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 // that we can enumerate them to send updates about things like window | 1333 // that we can enumerate them to send updates about things like window |
1318 // location or tab focus and visibily. These are non-owning references. | 1334 // location or tab focus and visibily. These are non-owning references. |
1319 std::set<WebPluginDelegateProxy*> plugin_delegates_; | 1335 std::set<WebPluginDelegateProxy*> plugin_delegates_; |
1320 | 1336 |
1321 #if defined(OS_WIN) | 1337 #if defined(OS_WIN) |
1322 // The ID of the focused NPAPI plug-in. | 1338 // The ID of the focused NPAPI plug-in. |
1323 int focused_plugin_id_; | 1339 int focused_plugin_id_; |
1324 #endif | 1340 #endif |
1325 | 1341 |
1326 // Allows JS to access DOM automation. The JS object is only exposed when the | 1342 // Allows JS to access DOM automation. The JS object is only exposed when the |
1327 // DOM automation bindings are enabled. | 1343 // DOM automation bendings are enabled. |
1328 scoped_ptr<DomAutomationController> dom_automation_controller_; | 1344 scoped_ptr<DomAutomationController> dom_automation_controller_; |
1329 | 1345 |
1330 // Indicates whether this RenderView is a guest of another RenderView. | 1346 // Channel for communication with embedding renderer, if it exists. |
1331 bool guest_; | 1347 scoped_refptr<content::GuestToEmbedderChannel> guest_to_embedder_channel_; |
| 1348 |
| 1349 // The pepper instance identifer for this guest RenderView. |
| 1350 PP_Instance pp_instance_; |
| 1351 |
| 1352 // The ppapi::HostResource associated with the on-screen context for this |
| 1353 // guest RenderView. |
| 1354 ppapi::HostResource resource_; |
| 1355 |
| 1356 WebGraphicsContext3DCommandBufferImpl* uninitialized_context_; |
| 1357 |
| 1358 WebKit::WebGraphicsContext3D::Attributes attributes_; |
1332 | 1359 |
1333 // The accessibility mode. | 1360 // The accessibility mode. |
1334 AccessibilityMode accessibility_mode_; | 1361 AccessibilityMode accessibility_mode_; |
1335 | 1362 |
1336 // NOTE: pepper_delegate_ should be last member because its constructor calls | 1363 // NOTE: pepper_delegate_ should be last member because its constructor calls |
1337 // AddObservers method of RenderViewImpl from c-tor. | 1364 // AddObservers method of RenderViewImpl from c-tor. |
1338 content::PepperPluginDelegateImpl pepper_delegate_; | 1365 content::PepperPluginDelegateImpl pepper_delegate_; |
1339 | 1366 |
1340 // --------------------------------------------------------------------------- | 1367 // --------------------------------------------------------------------------- |
1341 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 1368 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
1342 // sections rather than throwing it randomly at the end. If you're adding a | 1369 // sections rather than throwing it randomly at the end. If you're adding a |
1343 // bunch of stuff, you should probably create a helper class and put your | 1370 // bunch of stuff, you should probably create a helper class and put your |
1344 // data and methods on that to avoid bloating RenderView more. You can | 1371 // data and methods on that to avoid bloating RenderView more. You can |
1345 // use the Observer interface to filter IPC messages and receive frame change | 1372 // use the Observer interface to filter IPC messages and receive frame change |
1346 // notifications. | 1373 // notifications. |
1347 // --------------------------------------------------------------------------- | 1374 // --------------------------------------------------------------------------- |
1348 | 1375 |
1349 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1376 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1350 }; | 1377 }; |
1351 | 1378 |
1352 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1379 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |