Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: content/renderer/render_view_impl.h

Issue 9968097: Browser Plugin: Renderer-side changes (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated after merging with ToT Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 struct ViewMsg_PostMessage_Params; 86 struct ViewMsg_PostMessage_Params;
86 struct ViewMsg_StopFinding_Params; 87 struct ViewMsg_StopFinding_Params;
87 struct ViewMsg_SwapOut_Params; 88 struct ViewMsg_SwapOut_Params;
88 struct WebDropData; 89 struct WebDropData;
89 class WebIntentsHost; 90 class WebIntentsHost;
90 class WebPluginDelegateProxy; 91 class WebPluginDelegateProxy;
91 class WebUIBindings; 92 class WebUIBindings;
92 93
93 namespace content { 94 namespace content {
94 class DocumentState; 95 class DocumentState;
96 class GuestToEmbedderChannel;
95 class NavigationState; 97 class NavigationState;
96 class P2PSocketDispatcher; 98 class P2PSocketDispatcher;
97 class RenderViewObserver; 99 class RenderViewObserver;
98 class RenderViewTest; 100 class RenderViewTest;
99 struct CustomContextMenuContext; 101 struct CustomContextMenuContext;
100 struct FileChooserParams; 102 struct FileChooserParams;
101 struct SelectedFileInfo; 103 struct SelectedFileInfo;
102 } // namespace content 104 } // namespace content
103 105
104 namespace gfx { 106 namespace gfx {
105 class Point; 107 class Point;
106 class Rect; 108 class Rect;
107 } // namespace gfx 109 } // namespace gfx
108 110
109 namespace webkit { 111 namespace webkit {
110 112
111 namespace ppapi { 113 namespace ppapi {
112 class PluginInstance; 114 class PluginInstance;
115 class WebPluginImpl;
113 } // namespace ppapi 116 } // namespace ppapi
114 117
115 } // namespace webkit 118 } // namespace webkit
116 119
117 namespace webkit_glue { 120 namespace webkit_glue {
118 class ImageResourceFetcher; 121 class ImageResourceFetcher;
119 class ResourceFetcher; 122 class ResourceFetcher;
120 } 123 }
121 124
122 namespace WebKit { 125 namespace WebKit {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 const webkit_glue::WebPreferences& webkit_prefs, 196 const webkit_glue::WebPreferences& webkit_prefs,
194 SharedRenderViewCounter* counter, 197 SharedRenderViewCounter* counter,
195 int32 routing_id, 198 int32 routing_id,
196 int32 surface_id, 199 int32 surface_id,
197 int64 session_storage_namespace_id, 200 int64 session_storage_namespace_id,
198 const string16& frame_name, 201 const string16& frame_name,
199 bool is_renderer_created, 202 bool is_renderer_created,
200 bool swapped_out, 203 bool swapped_out,
201 int32 next_page_id, 204 int32 next_page_id,
202 const WebKit::WebScreenInfo& screen_info, 205 const WebKit::WebScreenInfo& screen_info,
203 bool guest, 206 content::GuestToEmbedderChannel* guest_to_embedder_channel,
204 AccessibilityMode accessibility_mode); 207 AccessibilityMode accessibility_mode);
205 208
206 // Returns the RenderViewImpl containing the given WebView. 209 // Returns the RenderViewImpl containing the given WebView.
207 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); 210 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview);
208 211
209 // May return NULL when the view is closing. 212 // May return NULL when the view is closing.
210 CONTENT_EXPORT WebKit::WebView* webview() const; 213 CONTENT_EXPORT WebKit::WebView* webview() const;
211 214
212 // WebGraphicsContext3DSwapBuffersClient implementation. 215 // WebGraphicsContext3DSwapBuffersClient implementation.
213 216
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // no other waiting items in the queue. 257 // no other waiting items in the queue.
255 // 258 //
256 // Returns true if the chooser was successfully scheduled. False means we 259 // Returns true if the chooser was successfully scheduled. False means we
257 // didn't schedule anything. 260 // didn't schedule anything.
258 bool ScheduleFileChooser(const content::FileChooserParams& params, 261 bool ScheduleFileChooser(const content::FileChooserParams& params,
259 WebKit::WebFileChooserCompletion* completion); 262 WebKit::WebFileChooserCompletion* completion);
260 263
261 // Sets whether the renderer should report load progress to the browser. 264 // Sets whether the renderer should report load progress to the browser.
262 void SetReportLoadProgressEnabled(bool enabled); 265 void SetReportLoadProgressEnabled(bool enabled);
263 266
264 bool guest() const { return guest_; } 267 content::GuestToEmbedderChannel*
268 guest_to_embedder_channel() const { return guest_to_embedder_channel_; }
jam 2012/05/16 02:22:40 nit: need to tab here
Fady Samuel 2012/05/16 04:43:54 Done.
269 PP_Instance pp_instance() const { return pp_instance_; }
270 void set_host_resource(const ppapi::HostResource& host_resource) {
271 resource_ = host_resource;
272 }
273 const ppapi::HostResource& host_resource() const { return resource_; }
274
275 void GuestReady(PP_Instance instance);
jam 2012/05/16 02:22:40 nit: please add documentation about these new func
Fady Samuel 2012/05/16 04:43:54 Done.
276
277 webkit::ppapi::WebPluginImpl* CreateBrowserPlugin(
278 const IPC::ChannelHandle& channel_handle,
279 int guest_process_id,
280 const WebKit::WebPluginParams& params);
265 281
266 void LoadNavigationErrorPage( 282 void LoadNavigationErrorPage(
267 WebKit::WebFrame* frame, 283 WebKit::WebFrame* frame,
268 const WebKit::WebURLRequest& failed_request, 284 const WebKit::WebURLRequest& failed_request,
269 const WebKit::WebURLError& error, 285 const WebKit::WebURLError& error,
270 const std::string& html, 286 const std::string& html,
271 bool replace); 287 bool replace);
272 288
273 // Plugin-related functions -------------------------------------------------- 289 // Plugin-related functions --------------------------------------------------
274 // (See also WebPluginPageDelegate implementation.) 290 // (See also WebPluginPageDelegate implementation.)
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 const webkit_glue::WebPreferences& webkit_prefs, 767 const webkit_glue::WebPreferences& webkit_prefs,
752 SharedRenderViewCounter* counter, 768 SharedRenderViewCounter* counter,
753 int32 routing_id, 769 int32 routing_id,
754 int32 surface_id, 770 int32 surface_id,
755 int64 session_storage_namespace_id, 771 int64 session_storage_namespace_id,
756 const string16& frame_name, 772 const string16& frame_name,
757 bool is_renderer_created, 773 bool is_renderer_created,
758 bool swapped_out, 774 bool swapped_out,
759 int32 next_page_id, 775 int32 next_page_id,
760 const WebKit::WebScreenInfo& screen_info, 776 const WebKit::WebScreenInfo& screen_info,
761 bool guest, 777 content::GuestToEmbedderChannel* guest_to_embedder_channel,
762 AccessibilityMode accessibility_mode); 778 AccessibilityMode accessibility_mode);
763 779
764 // Do not delete directly. This class is reference counted. 780 // Do not delete directly. This class is reference counted.
765 virtual ~RenderViewImpl(); 781 virtual ~RenderViewImpl();
766 782
767 void UpdateURL(WebKit::WebFrame* frame); 783 void UpdateURL(WebKit::WebFrame* frame);
768 void UpdateTitle(WebKit::WebFrame* frame, const string16& title, 784 void UpdateTitle(WebKit::WebFrame* frame, const string16& title,
769 WebKit::WebTextDirection title_direction); 785 WebKit::WebTextDirection title_direction);
770 void UpdateSessionHistory(WebKit::WebFrame* frame); 786 void UpdateSessionHistory(WebKit::WebFrame* frame);
771 void SendUpdateState(const WebKit::WebHistoryItem& item); 787 void SendUpdateState(const WebKit::WebHistoryItem& item);
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 // that we can enumerate them to send updates about things like window 1343 // that we can enumerate them to send updates about things like window
1328 // location or tab focus and visibily. These are non-owning references. 1344 // location or tab focus and visibily. These are non-owning references.
1329 std::set<WebPluginDelegateProxy*> plugin_delegates_; 1345 std::set<WebPluginDelegateProxy*> plugin_delegates_;
1330 1346
1331 #if defined(OS_WIN) 1347 #if defined(OS_WIN)
1332 // The ID of the focused NPAPI plug-in. 1348 // The ID of the focused NPAPI plug-in.
1333 int focused_plugin_id_; 1349 int focused_plugin_id_;
1334 #endif 1350 #endif
1335 1351
1336 // Allows JS to access DOM automation. The JS object is only exposed when the 1352 // Allows JS to access DOM automation. The JS object is only exposed when the
1337 // DOM automation bindings are enabled. 1353 // DOM automation bendings are enabled.
jam 2012/05/16 02:22:40 ?
Fady Samuel 2012/05/16 04:43:54 Done.
1338 scoped_ptr<DomAutomationController> dom_automation_controller_; 1354 scoped_ptr<DomAutomationController> dom_automation_controller_;
1339 1355
1340 // Indicates whether this RenderView is a guest of another RenderView. 1356 // Channel for communication with embedding renderer, if it exists.
1341 bool guest_; 1357 scoped_refptr<content::GuestToEmbedderChannel> guest_to_embedder_channel_;
1358
1359 // The pepper instance identifer for this guest RenderView.
1360 PP_Instance pp_instance_;
jam 2012/05/16 02:22:40 nit: this should be something like guest_pp_instan
Fady Samuel 2012/05/16 04:43:54 Done.
1361
1362 // The ppapi::HostResource associated with the on-screen context for this
1363 // guest RenderView.
1364 ppapi::HostResource resource_;
jam 2012/05/16 02:22:40 ditto for all these parameters
Fady Samuel 2012/05/16 04:43:54 Done.
1365
1366 WebGraphicsContext3DCommandBufferImpl* uninitialized_context_;
1367
1368 WebKit::WebGraphicsContext3D::Attributes attributes_;
1342 1369
1343 // The accessibility mode. 1370 // The accessibility mode.
1344 AccessibilityMode accessibility_mode_; 1371 AccessibilityMode accessibility_mode_;
1345 1372
1346 // NOTE: pepper_delegate_ should be last member because its constructor calls 1373 // NOTE: pepper_delegate_ should be last member because its constructor calls
1347 // AddObservers method of RenderViewImpl from c-tor. 1374 // AddObservers method of RenderViewImpl from c-tor.
1348 content::PepperPluginDelegateImpl pepper_delegate_; 1375 content::PepperPluginDelegateImpl pepper_delegate_;
1349 1376
1350 // --------------------------------------------------------------------------- 1377 // ---------------------------------------------------------------------------
1351 // ADDING NEW DATA? Please see if it fits appropriately in one of the above 1378 // 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 1379 // 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 1380 // 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 1381 // 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 1382 // use the Observer interface to filter IPC messages and receive frame change
1356 // notifications. 1383 // notifications.
1357 // --------------------------------------------------------------------------- 1384 // ---------------------------------------------------------------------------
1358 1385
1359 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); 1386 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
1360 }; 1387 };
1361 1388
1362 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ 1389 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698