OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_RENDERER_RENDER_VIEW_H_ | 5 #ifndef CHROME_RENDERER_RENDER_VIEW_H_ |
6 #define CHROME_RENDERER_RENDER_VIEW_H_ | 6 #define CHROME_RENDERER_RENDER_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
52 // RenderView is a diamond-shaped hierarchy, with WebWidgetClient at the root. | 52 // RenderView is a diamond-shaped hierarchy, with WebWidgetClient at the root. |
53 // VS warns when we inherit the WebWidgetClient method implementations from | 53 // VS warns when we inherit the WebWidgetClient method implementations from |
54 // RenderWidget. It's safe to ignore that warning. | 54 // RenderWidget. It's safe to ignore that warning. |
55 #pragma warning(disable: 4250) | 55 #pragma warning(disable: 4250) |
56 #endif | 56 #endif |
57 | 57 |
58 class AudioMessageFilter; | 58 class AudioMessageFilter; |
59 class BlockedPlugin; | 59 class BlockedPlugin; |
60 class CustomMenuListener; | |
61 class DictionaryValue; | 60 class DictionaryValue; |
62 class DeviceOrientationDispatcher; | 61 class DeviceOrientationDispatcher; |
63 class DevToolsAgent; | 62 class DevToolsAgent; |
64 class DevToolsClient; | 63 class DevToolsClient; |
65 class DomAutomationController; | 64 class DomAutomationController; |
66 class DOMUIBindings; | 65 class DOMUIBindings; |
67 class ExternalHostBindings; | 66 class ExternalHostBindings; |
68 class FilePath; | 67 class FilePath; |
69 class GeolocationDispatcher; | 68 class GeolocationDispatcher; |
70 class GeolocationDispatcherOld; | 69 class GeolocationDispatcherOld; |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 // Create a new plugin without checking the content settings. | 344 // Create a new plugin without checking the content settings. |
346 WebKit::WebPlugin* CreatePluginNoCheck(WebKit::WebFrame* frame, | 345 WebKit::WebPlugin* CreatePluginNoCheck(WebKit::WebFrame* frame, |
347 const WebKit::WebPluginParams& params); | 346 const WebKit::WebPluginParams& params); |
348 | 347 |
349 // Asks the browser for the CPBrowsingContext associated with this renderer. | 348 // Asks the browser for the CPBrowsingContext associated with this renderer. |
350 // This is an opaque identifier associated with the renderer for sending | 349 // This is an opaque identifier associated with the renderer for sending |
351 // messages for the given "Chrome Plugin." The Chrome Plugin API is used | 350 // messages for the given "Chrome Plugin." The Chrome Plugin API is used |
352 // only by gears and this function can be deleted when we remove gears. | 351 // only by gears and this function can be deleted when we remove gears. |
353 uint32 GetCPBrowsingContext(); | 352 uint32 GetCPBrowsingContext(); |
354 | 353 |
355 // Handles registering and deregistering customer handlers for custom | |
356 // context menu events. | |
357 // To install a custom context menu, call showContextMenu() with your | |
358 // custom entries, followed immediately by CustomMenuListenerInstall() to | |
359 // register a listener for when a custom menu item is selected. Note that | |
360 // subsequent calls to showContextMenu() will clear the custom listener. | |
361 void CustomMenuListenerInstall(CustomMenuListener* listening); | |
362 void CustomMenuListenerDestroyed(CustomMenuListener* dead); | |
363 | |
364 #if defined(OS_MACOSX) | 354 #if defined(OS_MACOSX) |
365 // Enables/disabled plugin IME for the given plugin. | 355 // Enables/disabled plugin IME for the given plugin. |
366 void SetPluginImeEnabled(bool enabled, int plugin_id); | 356 void SetPluginImeEnabled(bool enabled, int plugin_id); |
367 | 357 |
368 // Helper routines for accelerated plugin support. Used by the | 358 // Helper routines for accelerated plugin support. Used by the |
369 // WebPluginDelegateProxy, which has a pointer to the RenderView. | 359 // WebPluginDelegateProxy, which has a pointer to the RenderView. |
370 gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque, | 360 gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque, |
371 bool root); | 361 bool root); |
372 void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window); | 362 void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window); |
373 void AcceleratedSurfaceSetIOSurface(gfx::PluginWindowHandle window, | 363 void AcceleratedSurfaceSetIOSurface(gfx::PluginWindowHandle window, |
374 int32 width, | 364 int32 width, |
375 int32 height, | 365 int32 height, |
376 uint64 io_surface_identifier); | 366 uint64 io_surface_identifier); |
377 TransportDIB::Handle AcceleratedSurfaceAllocTransportDIB(size_t size); | 367 TransportDIB::Handle AcceleratedSurfaceAllocTransportDIB(size_t size); |
378 void AcceleratedSurfaceFreeTransportDIB(TransportDIB::Id dib_id); | 368 void AcceleratedSurfaceFreeTransportDIB(TransportDIB::Id dib_id); |
379 void AcceleratedSurfaceSetTransportDIB(gfx::PluginWindowHandle window, | 369 void AcceleratedSurfaceSetTransportDIB(gfx::PluginWindowHandle window, |
380 int32 width, | 370 int32 width, |
381 int32 height, | 371 int32 height, |
382 TransportDIB::Handle transport_dib); | 372 TransportDIB::Handle transport_dib); |
383 void AcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window, | 373 void AcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window, |
384 uint64 surface_id); | 374 uint64 surface_id); |
385 #endif | 375 #endif |
386 | 376 |
387 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate); | 377 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate); |
388 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate); | 378 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate); |
389 | 379 |
390 void RegisterBlockedPlugin(BlockedPlugin* blocked_plugin); | |
391 void UnregisterBlockedPlugin(BlockedPlugin* blocked_plugin); | |
392 | |
393 // IPC::Channel::Listener implementation ------------------------------------- | 380 // IPC::Channel::Listener implementation ------------------------------------- |
394 | 381 |
395 virtual bool OnMessageReceived(const IPC::Message& msg); | 382 virtual bool OnMessageReceived(const IPC::Message& msg); |
396 | 383 |
397 // WebKit::WebWidgetClient implementation ------------------------------------ | 384 // WebKit::WebWidgetClient implementation ------------------------------------ |
398 | 385 |
399 // Most methods are handled by RenderWidget. | 386 // Most methods are handled by RenderWidget. |
400 virtual void didFocus(); | 387 virtual void didFocus(); |
401 virtual void didBlur(); | 388 virtual void didBlur(); |
402 virtual void show(WebKit::WebNavigationPolicy policy); | 389 virtual void show(WebKit::WebNavigationPolicy policy); |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); | 872 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); |
886 void OnGetApplicationInfo(int page_id); | 873 void OnGetApplicationInfo(int page_id); |
887 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( | 874 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( |
888 const std::vector<GURL>& links, | 875 const std::vector<GURL>& links, |
889 const std::vector<FilePath>& local_paths, | 876 const std::vector<FilePath>& local_paths, |
890 const FilePath& local_directory_name); | 877 const FilePath& local_directory_name); |
891 void OnHandleMessageFromExternalHost(const std::string& message, | 878 void OnHandleMessageFromExternalHost(const std::string& message, |
892 const std::string& origin, | 879 const std::string& origin, |
893 const std::string& target); | 880 const std::string& target); |
894 void OnInstallMissingPlugin(); | 881 void OnInstallMissingPlugin(); |
895 void OnLoadBlockedPlugins(); | |
896 void OnMediaPlayerActionAt(const gfx::Point& location, | 882 void OnMediaPlayerActionAt(const gfx::Point& location, |
897 const WebKit::WebMediaPlayerAction& action); | 883 const WebKit::WebMediaPlayerAction& action); |
898 void OnMoveOrResizeStarted(); | 884 void OnMoveOrResizeStarted(); |
899 void OnNavigate(const ViewMsg_Navigate_Params& params); | 885 void OnNavigate(const ViewMsg_Navigate_Params& params); |
900 void OnNotifyRendererViewType(ViewType::Type view_type); | 886 void OnNotifyRendererViewType(ViewType::Type view_type); |
901 void OnPaste(); | 887 void OnPaste(); |
902 #if defined(OS_MACOSX) | 888 #if defined(OS_MACOSX) |
903 void OnPluginImeCompositionConfirmed(const string16& text, int plugin_id); | 889 void OnPluginImeCompositionConfirmed(const string16& text, int plugin_id); |
904 #endif | 890 #endif |
905 void OnPrintingDone(int document_cookie, bool success); | 891 void OnPrintingDone(int document_cookie, bool success); |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 | 1311 |
1326 // All the currently active plugin delegates for this RenderView; kept so that | 1312 // All the currently active plugin delegates for this RenderView; kept so that |
1327 // we can enumerate them to send updates about things like window location | 1313 // we can enumerate them to send updates about things like window location |
1328 // or tab focus and visibily. These are non-owning references. | 1314 // or tab focus and visibily. These are non-owning references. |
1329 std::set<WebPluginDelegateProxy*> plugin_delegates_; | 1315 std::set<WebPluginDelegateProxy*> plugin_delegates_; |
1330 | 1316 |
1331 // A list of all Pepper v1 plugins that we've created that haven't been | 1317 // A list of all Pepper v1 plugins that we've created that haven't been |
1332 // destroyed yet. Pepper v2 plugins are tracked by the pepper_delegate_. | 1318 // destroyed yet. Pepper v2 plugins are tracked by the pepper_delegate_. |
1333 std::set<WebPluginDelegatePepper*> current_oldstyle_pepper_plugins_; | 1319 std::set<WebPluginDelegatePepper*> current_oldstyle_pepper_plugins_; |
1334 | 1320 |
1335 // A list of all BlockedPlugins so they can all be loaded if needed. | |
1336 std::set<BlockedPlugin*> blocked_plugins_; | |
1337 | |
1338 // Helper objects ------------------------------------------------------------ | 1321 // Helper objects ------------------------------------------------------------ |
1339 | 1322 |
1340 ScopedRunnableMethodFactory<RenderView> page_info_method_factory_; | 1323 ScopedRunnableMethodFactory<RenderView> page_info_method_factory_; |
1341 ScopedRunnableMethodFactory<RenderView> accessibility_method_factory_; | 1324 ScopedRunnableMethodFactory<RenderView> accessibility_method_factory_; |
1342 | 1325 |
1343 // Responsible for translating the page contents to other languages. | 1326 // Responsible for translating the page contents to other languages. |
1344 TranslateHelper translate_helper_; | 1327 TranslateHelper translate_helper_; |
1345 | 1328 |
1346 RendererWebCookieJarImpl cookie_jar_; | 1329 RendererWebCookieJarImpl cookie_jar_; |
1347 | 1330 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 // Allows DOM UI pages (new tab page, etc.) to talk to the browser. The JS | 1441 // Allows DOM UI pages (new tab page, etc.) to talk to the browser. The JS |
1459 // object is only exposed when DOM UI bindings are enabled. | 1442 // object is only exposed when DOM UI bindings are enabled. |
1460 scoped_ptr<DOMUIBindings> dom_ui_bindings_; | 1443 scoped_ptr<DOMUIBindings> dom_ui_bindings_; |
1461 | 1444 |
1462 // External host exposed through automation controller. | 1445 // External host exposed through automation controller. |
1463 scoped_ptr<ExternalHostBindings> external_host_bindings_; | 1446 scoped_ptr<ExternalHostBindings> external_host_bindings_; |
1464 | 1447 |
1465 // The external popup for the currently showing select popup. | 1448 // The external popup for the currently showing select popup. |
1466 scoped_ptr<ExternalPopupMenu> external_popup_menu_; | 1449 scoped_ptr<ExternalPopupMenu> external_popup_menu_; |
1467 | 1450 |
1468 // The custom menu event listener, if any. | |
1469 CustomMenuListener* custom_menu_listener_; | |
1470 | |
1471 // The node that the context menu was pressed over. | 1451 // The node that the context menu was pressed over. |
1472 WebKit::WebNode context_menu_node_; | 1452 WebKit::WebNode context_menu_node_; |
1473 | 1453 |
1474 // Reports load progress to the browser. | 1454 // Reports load progress to the browser. |
1475 scoped_ptr<LoadProgressTracker> load_progress_tracker_; | 1455 scoped_ptr<LoadProgressTracker> load_progress_tracker_; |
1476 | 1456 |
1477 // All the registered observers. We expect this list to be small, so vector | 1457 // All the registered observers. We expect this list to be small, so vector |
1478 // is fine. | 1458 // is fine. |
1479 ObserverList<RenderViewObserver> observers_; | 1459 ObserverList<RenderViewObserver> observers_; |
1480 | 1460 |
1481 // --------------------------------------------------------------------------- | 1461 // --------------------------------------------------------------------------- |
1482 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 1462 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
1483 // sections rather than throwing it randomly at the end. If you're adding a | 1463 // sections rather than throwing it randomly at the end. If you're adding a |
1484 // bunch of stuff, you should probably create a helper class and put your | 1464 // bunch of stuff, you should probably create a helper class and put your |
1485 // data and methods on that to avoid bloating RenderView more. You can use | 1465 // data and methods on that to avoid bloating RenderView more. You can use |
1486 // the Observer interface to filter IPC messages and receive frame change | 1466 // the Observer interface to filter IPC messages and receive frame change |
1487 // notifications. | 1467 // notifications. |
1488 // --------------------------------------------------------------------------- | 1468 // --------------------------------------------------------------------------- |
1489 | 1469 |
1490 DISALLOW_COPY_AND_ASSIGN(RenderView); | 1470 DISALLOW_COPY_AND_ASSIGN(RenderView); |
1491 }; | 1471 }; |
1492 | 1472 |
1493 #endif // CHROME_RENDERER_RENDER_VIEW_H_ | 1473 #endif // CHROME_RENDERER_RENDER_VIEW_H_ |
OLD | NEW |