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

Side by Side Diff: chrome/renderer/render_view.h

Issue 6151011: Introduce RenderView::Observer interface so that RenderView doesn't have to k... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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) 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>
11 #include <queue> 11 #include <queue>
12 #include <set> 12 #include <set>
13 #include <string> 13 #include <string>
14 #include <vector> 14 #include <vector>
15 15
16 #include "app/surface/transport_dib.h" 16 #include "app/surface/transport_dib.h"
17 #include "base/basictypes.h" 17 #include "base/basictypes.h"
18 #include "base/gtest_prod_util.h" 18 #include "base/gtest_prod_util.h"
19 #include "base/linked_ptr.h" 19 #include "base/linked_ptr.h"
20 #include "base/observer_list.h"
20 #include "base/timer.h" 21 #include "base/timer.h"
21 #include "base/weak_ptr.h" 22 #include "base/weak_ptr.h"
22 #include "build/build_config.h" 23 #include "build/build_config.h"
23 #include "chrome/common/content_settings.h" 24 #include "chrome/common/content_settings.h"
24 #include "chrome/common/edit_command.h" 25 #include "chrome/common/edit_command.h"
25 #include "chrome/common/navigation_gesture.h" 26 #include "chrome/common/navigation_gesture.h"
26 #include "chrome/common/page_zoom.h" 27 #include "chrome/common/page_zoom.h"
27 #include "chrome/common/render_messages.h" 28 #include "chrome/common/render_messages.h"
28 #include "chrome/common/render_messages_params.h" 29 #include "chrome/common/render_messages_params.h"
29 #include "chrome/common/renderer_preferences.h" 30 #include "chrome/common/renderer_preferences.h"
30 #include "chrome/common/view_types.h" 31 #include "chrome/common/view_types.h"
31 #include "chrome/renderer/external_popup_menu.h" 32 #include "chrome/renderer/external_popup_menu.h"
32 #include "chrome/renderer/page_load_histograms.h" 33 #include "chrome/renderer/page_load_histograms.h"
33 #include "chrome/renderer/pepper_plugin_delegate_impl.h" 34 #include "chrome/renderer/pepper_plugin_delegate_impl.h"
34 #include "chrome/renderer/render_widget.h" 35 #include "chrome/renderer/render_widget.h"
35 #include "chrome/renderer/renderer_webcookiejar_impl.h" 36 #include "chrome/renderer/renderer_webcookiejar_impl.h"
36 #include "chrome/renderer/searchbox.h" 37 #include "chrome/renderer/searchbox.h"
37 #include "chrome/renderer/translate_helper.h" 38 #include "chrome/renderer/translate_helper.h"
38 #include "third_party/WebKit/WebKit/chromium/public/WebAutoFillClient.h"
39 #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" 39 #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h"
40 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h" 40 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h"
41 #include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h" 41 #include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h"
42 #include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h" 42 #include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h"
43 #include "third_party/WebKit/WebKit/chromium/public/WebPageSerializerClient.h" 43 #include "third_party/WebKit/WebKit/chromium/public/WebPageSerializerClient.h"
44 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" 44 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h"
45 #include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h" 45 #include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h"
46 #include "third_party/WebKit/WebKit/chromium/public/WebNavigationType.h" 46 #include "third_party/WebKit/WebKit/chromium/public/WebNavigationType.h"
47 #include "webkit/glue/webpreferences.h" 47 #include "webkit/glue/webpreferences.h"
48 #include "webkit/plugins/npapi/webplugin_page_delegate.h" 48 #include "webkit/plugins/npapi/webplugin_page_delegate.h"
49 49
50 #if defined(OS_WIN) 50 #if defined(OS_WIN)
51 // RenderView is a diamond-shaped hierarchy, with WebWidgetClient at the root. 51 // RenderView is a diamond-shaped hierarchy, with WebWidgetClient at the root.
52 // VS warns when we inherit the WebWidgetClient method implementations from 52 // VS warns when we inherit the WebWidgetClient method implementations from
53 // RenderWidget. It's safe to ignore that warning. 53 // RenderWidget. It's safe to ignore that warning.
54 #pragma warning(disable: 4250) 54 #pragma warning(disable: 4250)
55 #endif 55 #endif
56 56
57 class AudioMessageFilter; 57 class AudioMessageFilter;
58 class AutoFillHelper;
59 class BlockedPlugin; 58 class BlockedPlugin;
60 class CustomMenuListener; 59 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;
71 class GURL; 70 class GURL;
72 class ListValue; 71 class ListValue;
73 class LoadProgressTracker; 72 class LoadProgressTracker;
74 class NavigationState; 73 class NavigationState;
75 class NotificationProvider; 74 class NotificationProvider;
76 class PageClickTracker;
77 class PasswordAutocompleteManager;
78 class PepperDeviceTest; 75 class PepperDeviceTest;
79 class PrintWebViewHelper; 76 class PrintWebViewHelper;
77 class RenderViewObserver;
80 class RenderViewVisitor; 78 class RenderViewVisitor;
81 class SkBitmap; 79 class SkBitmap;
82 class SpeechInputDispatcher; 80 class SpeechInputDispatcher;
83 class WebPluginDelegatePepper; 81 class WebPluginDelegatePepper;
84 class WebPluginDelegateProxy; 82 class WebPluginDelegateProxy;
85 struct ContextMenuMediaParams; 83 struct ContextMenuMediaParams;
86 struct PP_Flash_NetAddress; 84 struct PP_Flash_NetAddress;
87 struct ThumbnailScore; 85 struct ThumbnailScore;
88 struct ViewMsg_ClosePage_Params; 86 struct ViewMsg_ClosePage_Params;
89 struct ViewMsg_Navigate_Params; 87 struct ViewMsg_Navigate_Params;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // 165 //
168 // This is a RefCounted holder of an int because I can't say 166 // This is a RefCounted holder of an int because I can't say
169 // scoped_refptr<int>. 167 // scoped_refptr<int>.
170 typedef base::RefCountedData<int> SharedRenderViewCounter; 168 typedef base::RefCountedData<int> SharedRenderViewCounter;
171 169
172 // 170 //
173 // RenderView is an object that manages a WebView object, and provides a 171 // RenderView is an object that manages a WebView object, and provides a
174 // communication interface with an embedding application process 172 // communication interface with an embedding application process
175 // 173 //
176 class RenderView : public RenderWidget, 174 class RenderView : public RenderWidget,
177 public WebKit::WebAutoFillClient,
178 public WebKit::WebViewClient, 175 public WebKit::WebViewClient,
179 public WebKit::WebFrameClient, 176 public WebKit::WebFrameClient,
180 public WebKit::WebPageSerializerClient, 177 public WebKit::WebPageSerializerClient,
181 public webkit::npapi::WebPluginPageDelegate, 178 public webkit::npapi::WebPluginPageDelegate,
182 public base::SupportsWeakPtr<RenderView> { 179 public base::SupportsWeakPtr<RenderView> {
183 public: 180 public:
184 // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the 181 // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the
185 // parent of the WebView HWND that will be created. If this is a constrained 182 // parent of the WebView HWND that will be created. If this is a constrained
186 // popup or as a new tab, opener_id is the routing ID of the RenderView 183 // popup or as a new tab, opener_id is the routing ID of the RenderView
187 // responsible for creating this RenderView (corresponding to parent_hwnd). 184 // responsible for creating this RenderView (corresponding to parent_hwnd).
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 229 }
233 230
234 const WebPreferences& webkit_preferences() const { 231 const WebPreferences& webkit_preferences() const {
235 return webkit_preferences_; 232 return webkit_preferences_;
236 } 233 }
237 234
238 void set_send_content_state_immediately(bool value) { 235 void set_send_content_state_immediately(bool value) {
239 send_content_state_immediately_ = value; 236 send_content_state_immediately_ = value;
240 } 237 }
241 238
242 PageClickTracker* page_click_tracker() const {
243 return page_click_tracker_.get();
244 }
245
246 // May be NULL if client-side phishing detection is disabled. 239 // May be NULL if client-side phishing detection is disabled.
247 safe_browsing::PhishingClassifierDelegate* 240 safe_browsing::PhishingClassifierDelegate*
248 phishing_classifier_delegate() const { 241 phishing_classifier_delegate() const {
249 return phishing_delegate_.get(); 242 return phishing_delegate_.get();
250 } 243 }
251 244
252 // Returns true if we should display scrollbars for the given view size and 245 // Returns true if we should display scrollbars for the given view size and
253 // false if the scrollbars should be hidden. 246 // false if the scrollbars should be hidden.
254 bool should_display_scrollbars(int width, int height) const { 247 bool should_display_scrollbars(int width, int height) const {
255 return (!send_preferred_size_changes_ || 248 return (!send_preferred_size_changes_ ||
256 (disable_scrollbars_size_limit_.width() <= width || 249 (disable_scrollbars_size_limit_.width() <= width ||
257 disable_scrollbars_size_limit_.height() <= height)); 250 disable_scrollbars_size_limit_.height() <= height));
258 } 251 }
259 252
260 const SearchBox& searchbox() const { 253 const SearchBox& searchbox() const {
261 return search_box_; 254 return search_box_;
262 } 255 }
263 256
257 // Functions to add and remove observers for this object.
258 void AddObserver(RenderViewObserver* observer);
259 void RemoveObserver(RenderViewObserver* observer);
260
264 // Called from JavaScript window.external.AddSearchProvider() to add a 261 // Called from JavaScript window.external.AddSearchProvider() to add a
265 // keyword for a provider described in the given OpenSearch document. 262 // keyword for a provider described in the given OpenSearch document.
266 void AddSearchProvider(const std::string& url, 263 void AddSearchProvider(const std::string& url,
267 const ViewHostMsg_PageHasOSDD_Type& provider_type); 264 const ViewHostMsg_PageHasOSDD_Type& provider_type);
268 265
269 // Returns the install state for the given search provider url. 266 // Returns the install state for the given search provider url.
270 ViewHostMsg_GetSearchProviderInstallState_Params 267 ViewHostMsg_GetSearchProviderInstallState_Params
271 GetSearchProviderInstallState(WebKit::WebFrame* frame, 268 GetSearchProviderInstallState(WebKit::WebFrame* frame,
272 const std::string& url); 269 const std::string& url);
273 270
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate); 387 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate);
391 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate); 388 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate);
392 389
393 void RegisterBlockedPlugin(BlockedPlugin* blocked_plugin); 390 void RegisterBlockedPlugin(BlockedPlugin* blocked_plugin);
394 void UnregisterBlockedPlugin(BlockedPlugin* blocked_plugin); 391 void UnregisterBlockedPlugin(BlockedPlugin* blocked_plugin);
395 392
396 // IPC::Channel::Listener implementation ------------------------------------- 393 // IPC::Channel::Listener implementation -------------------------------------
397 394
398 virtual bool OnMessageReceived(const IPC::Message& msg); 395 virtual bool OnMessageReceived(const IPC::Message& msg);
399 396
400 // WebKit::WebAutoFillClient implementation ----------------------------------
401 virtual void didAcceptAutoFillSuggestion(const WebKit::WebNode& node,
402 const WebKit::WebString& value,
403 const WebKit::WebString& label,
404 int unique_id,
405 unsigned index);
406 virtual void didSelectAutoFillSuggestion(const WebKit::WebNode& node,
407 const WebKit::WebString& value,
408 const WebKit::WebString& label,
409 int unique_id);
410 virtual void didClearAutoFillSelection(const WebKit::WebNode& node);
411 virtual void didAcceptAutocompleteSuggestion(
412 const WebKit::WebInputElement& element);
413 virtual void removeAutocompleteSuggestion(const WebKit::WebString& name,
414 const WebKit::WebString& value);
415 // TODO(jam): remove this function after WebKit roll
416 virtual void removeAutofillSuggestions(const WebKit::WebString& name,
417 const WebKit::WebString& value);
418 virtual void textFieldDidEndEditing(const WebKit::WebInputElement& element);
419 virtual void textFieldDidChange(const WebKit::WebInputElement& element);
420 virtual void textFieldDidReceiveKeyDown(
421 const WebKit::WebInputElement& element,
422 const WebKit::WebKeyboardEvent& event);
423
424 // WebKit::WebWidgetClient implementation ------------------------------------ 397 // WebKit::WebWidgetClient implementation ------------------------------------
425 398
426 // Most methods are handled by RenderWidget. 399 // Most methods are handled by RenderWidget.
427 virtual void didFocus(); 400 virtual void didFocus();
428 virtual void didBlur(); 401 virtual void didBlur();
429 virtual void show(WebKit::WebNavigationPolicy policy); 402 virtual void show(WebKit::WebNavigationPolicy policy);
430 virtual void closeWidgetSoon(); 403 virtual void closeWidgetSoon();
431 virtual void runModal(); 404 virtual void runModal();
432 405
433 // WebKit::WebViewClient implementation -------------------------------------- 406 // WebKit::WebViewClient implementation --------------------------------------
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 ViewHostMsg_AccessibilityNotification_Params::NotificationType type; 719 ViewHostMsg_AccessibilityNotification_Params::NotificationType type;
747 }; 720 };
748 721
749 enum ErrorPageType { 722 enum ErrorPageType {
750 DNS_ERROR, 723 DNS_ERROR,
751 HTTP_404, 724 HTTP_404,
752 CONNECTION_ERROR, 725 CONNECTION_ERROR,
753 }; 726 };
754 727
755 RenderView(RenderThreadBase* render_thread, 728 RenderView(RenderThreadBase* render_thread,
756 const WebPreferences& webkit_preferences, 729 gfx::NativeViewId parent_hwnd,
757 int64 session_storage_namespace_id); 730 int32 opener_id,
731 const RendererPreferences& renderer_prefs,
732 const WebPreferences& webkit_prefs,
733 SharedRenderViewCounter* counter,
734 int32 routing_id,
735 int64 session_storage_namespace_id,
736 const string16& frame_name);
758 737
759 // Do not delete directly. This class is reference counted. 738 // Do not delete directly. This class is reference counted.
760 virtual ~RenderView(); 739 virtual ~RenderView();
761 740
762 // Initializes this view with the given parent and ID. The |routing_id| can be
763 // set to 'MSG_ROUTING_NONE' if the true ID is not yet known. In this case,
764 // CompleteInit must be called later with the true ID.
765 void Init(gfx::NativeViewId parent,
766 int32 opener_id,
767 const RendererPreferences& renderer_prefs,
768 SharedRenderViewCounter* counter,
769 int32 routing_id,
770 const string16& frame_name);
771
772 void UpdateURL(WebKit::WebFrame* frame); 741 void UpdateURL(WebKit::WebFrame* frame);
773 void UpdateTitle(WebKit::WebFrame* frame, const string16& title); 742 void UpdateTitle(WebKit::WebFrame* frame, const string16& title);
774 void UpdateSessionHistory(WebKit::WebFrame* frame); 743 void UpdateSessionHistory(WebKit::WebFrame* frame);
775 744
776 // Update current main frame's encoding and send it to browser window. 745 // Update current main frame's encoding and send it to browser window.
777 // Since we want to let users see the right encoding info from menu 746 // Since we want to let users see the right encoding info from menu
778 // before finishing loading, we call the UpdateEncoding in 747 // before finishing loading, we call the UpdateEncoding in
779 // a) function:DidCommitLoadForFrame. When this function is called, 748 // a) function:DidCommitLoadForFrame. When this function is called,
780 // that means we have got first data. In here we try to get encoding 749 // that means we have got first data. In here we try to get encoding
781 // of page if it has been specified in http header. 750 // of page if it has been specified in http header.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 std::wstring* result); 788 std::wstring* result);
820 789
821 // Sends a message and runs a nested message loop. 790 // Sends a message and runs a nested message loop.
822 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message); 791 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message);
823 792
824 // Adds search provider from the given OpenSearch description URL as a 793 // Adds search provider from the given OpenSearch description URL as a
825 // keyword search. 794 // keyword search.
826 void AddGURLSearchProvider(const GURL& osd_url, 795 void AddGURLSearchProvider(const GURL& osd_url,
827 const ViewHostMsg_PageHasOSDD_Type& provider_type); 796 const ViewHostMsg_PageHasOSDD_Type& provider_type);
828 797
829 // Called in a posted task by textFieldDidChange() to work-around a WebKit bug
830 // http://bugs.webkit.org/show_bug.cgi?id=16976
831 void TextFieldDidChangeImpl(const WebKit::WebInputElement& element);
832
833 // Send queued accessibility notifications from the renderer to the browser. 798 // Send queued accessibility notifications from the renderer to the browser.
834 void SendPendingAccessibilityNotifications(); 799 void SendPendingAccessibilityNotifications();
835 800
836 // IPC message handlers ------------------------------------------------------ 801 // IPC message handlers ------------------------------------------------------
837 // 802 //
838 // The documentation for these functions should be in 803 // The documentation for these functions should be in
839 // render_messages_internal.h for the message that the function is handling. 804 // render_messages_internal.h for the message that the function is handling.
840 805
841 void OnAccessibilityDoDefaultAction(int acc_obj_id); 806 void OnAccessibilityDoDefaultAction(int acc_obj_id);
842 void OnAccessibilityNotificationsAck(); 807 void OnAccessibilityNotificationsAck();
843 void OnAllowBindings(int enabled_bindings_flags); 808 void OnAllowBindings(int enabled_bindings_flags);
844 void OnAddMessageToConsole(const string16& frame_xpath, 809 void OnAddMessageToConsole(const string16& frame_xpath,
845 const string16& message, 810 const string16& message,
846 const WebKit::WebConsoleMessage::Level&); 811 const WebKit::WebConsoleMessage::Level&);
847 void OnAdvanceToNextMisspelling(); 812 void OnAdvanceToNextMisspelling();
848 void OnAllowScriptToClose(bool script_can_close); 813 void OnAllowScriptToClose(bool script_can_close);
849 void OnAsyncFileOpened(base::PlatformFileError error_code, 814 void OnAsyncFileOpened(base::PlatformFileError error_code,
850 IPC::PlatformFileForTransit file_for_transit, 815 IPC::PlatformFileForTransit file_for_transit,
851 int message_id); 816 int message_id);
852 void OnAutocompleteSuggestionsReturned(
853 int query_id,
854 const std::vector<string16>& suggestions,
855 int default_suggestions_index);
856 void OnAutoFillFormDataFilled(int query_id,
857 const webkit_glue::FormData& form);
858 void OnAutoFillSuggestionsReturned(
859 int query_id,
860 const std::vector<string16>& values,
861 const std::vector<string16>& labels,
862 const std::vector<string16>& icons,
863 const std::vector<int>& unique_ids);
864 void OnCancelDownload(int32 download_id); 817 void OnCancelDownload(int32 download_id);
865 void OnClearFocusedNode(); 818 void OnClearFocusedNode();
866 void OnClosePage(const ViewMsg_ClosePage_Params& params); 819 void OnClosePage(const ViewMsg_ClosePage_Params& params);
867 #if defined(ENABLE_FLAPPER_HACKS) 820 #if defined(ENABLE_FLAPPER_HACKS)
868 void OnConnectTcpACK(int request_id, 821 void OnConnectTcpACK(int request_id,
869 IPC::PlatformFileForTransit socket_for_transit, 822 IPC::PlatformFileForTransit socket_for_transit,
870 const PP_Flash_NetAddress& local_addr, 823 const PP_Flash_NetAddress& local_addr,
871 const PP_Flash_NetAddress& remote_addr); 824 const PP_Flash_NetAddress& remote_addr);
872 #endif 825 #endif
873 void OnCopy(); 826 void OnCopy();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 void OnHandleMessageFromExternalHost(const std::string& message, 885 void OnHandleMessageFromExternalHost(const std::string& message,
933 const std::string& origin, 886 const std::string& origin,
934 const std::string& target); 887 const std::string& target);
935 void OnInstallMissingPlugin(); 888 void OnInstallMissingPlugin();
936 void OnLoadBlockedPlugins(); 889 void OnLoadBlockedPlugins();
937 void OnMediaPlayerActionAt(const gfx::Point& location, 890 void OnMediaPlayerActionAt(const gfx::Point& location,
938 const WebKit::WebMediaPlayerAction& action); 891 const WebKit::WebMediaPlayerAction& action);
939 void OnMoveOrResizeStarted(); 892 void OnMoveOrResizeStarted();
940 void OnNavigate(const ViewMsg_Navigate_Params& params); 893 void OnNavigate(const ViewMsg_Navigate_Params& params);
941 void OnNotifyRendererViewType(ViewType::Type view_type); 894 void OnNotifyRendererViewType(ViewType::Type view_type);
942 void OnFillPasswordForm(
943 const webkit_glue::PasswordFormFillData& form_data);
944 void OnPaste(); 895 void OnPaste();
945 #if defined(OS_MACOSX) 896 #if defined(OS_MACOSX)
946 void OnPluginImeCompositionConfirmed(const string16& text, int plugin_id); 897 void OnPluginImeCompositionConfirmed(const string16& text, int plugin_id);
947 #endif 898 #endif
948 void OnPrintingDone(int document_cookie, bool success); 899 void OnPrintingDone(int document_cookie, bool success);
949 void OnPrintPages(); 900 void OnPrintPages();
950 void OnPrintPreview(); 901 void OnPrintPreview();
951 void OnRedo(); 902 void OnRedo();
952 void OnReloadFrame(); 903 void OnReloadFrame();
953 void OnReplace(const string16& text); 904 void OnReplace(const string16& text);
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 // A list of all Pepper v1 plugins that we've created that haven't been 1320 // A list of all Pepper v1 plugins that we've created that haven't been
1370 // destroyed yet. Pepper v2 plugins are tracked by the pepper_delegate_. 1321 // destroyed yet. Pepper v2 plugins are tracked by the pepper_delegate_.
1371 std::set<WebPluginDelegatePepper*> current_oldstyle_pepper_plugins_; 1322 std::set<WebPluginDelegatePepper*> current_oldstyle_pepper_plugins_;
1372 1323
1373 // A list of all BlockedPlugins so they can all be loaded if needed. 1324 // A list of all BlockedPlugins so they can all be loaded if needed.
1374 std::set<BlockedPlugin*> blocked_plugins_; 1325 std::set<BlockedPlugin*> blocked_plugins_;
1375 1326
1376 // Helper objects ------------------------------------------------------------ 1327 // Helper objects ------------------------------------------------------------
1377 1328
1378 ScopedRunnableMethodFactory<RenderView> page_info_method_factory_; 1329 ScopedRunnableMethodFactory<RenderView> page_info_method_factory_;
1379 ScopedRunnableMethodFactory<RenderView> autofill_method_factory_;
1380 ScopedRunnableMethodFactory<RenderView> accessibility_method_factory_; 1330 ScopedRunnableMethodFactory<RenderView> accessibility_method_factory_;
1381 1331
1382 // Responsible for translating the page contents to other languages. 1332 // Responsible for translating the page contents to other languages.
1383 TranslateHelper translate_helper_; 1333 TranslateHelper translate_helper_;
1384 1334
1385 // Responsible for automatically filling login and password textfields.
1386 scoped_ptr<PasswordAutocompleteManager> password_autocomplete_manager_;
1387
1388 // Responsible for filling forms (AutoFill) and single text entries
1389 // (Autocomplete).
1390 scoped_ptr<AutoFillHelper> autofill_helper_;
1391
1392 // Tracks when text input controls get clicked.
1393 // IMPORTANT: this should be declared after autofill_helper_ and
1394 // password_autocomplete_manager_ so the tracker is deleted first (so we won't
1395 // run the risk of notifying deleted objects).
1396 scoped_ptr<PageClickTracker> page_click_tracker_;
1397
1398 RendererWebCookieJarImpl cookie_jar_; 1335 RendererWebCookieJarImpl cookie_jar_;
1399 1336
1337 // The next group of objects all implement RenderViewObserver, so are deleted
1338 // along with the RenderView automatically. This is why we just store weak
1339 // references.
1340
1400 // Provides access to this renderer from the remote Inspector UI. 1341 // Provides access to this renderer from the remote Inspector UI.
1401 scoped_ptr<DevToolsAgent> devtools_agent_; 1342 DevToolsAgent* devtools_agent_;
1402 1343
1403 // DevToolsClient for renderer hosting developer tools UI. It's NULL for other 1344 // DevToolsClient for renderer hosting developer tools UI. It's NULL for other
1404 // render views. 1345 // render views.
1405 scoped_ptr<DevToolsClient> devtools_client_; 1346 DevToolsClient* devtools_client_;
1406 1347
1407 // Holds a reference to the service which provides desktop notifications. 1348 // Holds a reference to the service which provides desktop notifications.
1408 scoped_ptr<NotificationProvider> notification_provider_; 1349 NotificationProvider* notification_provider_;
1350
1351 // The geolocation dispatcher attached to this view, lazily initialized.
1352 GeolocationDispatcher* geolocation_dispatcher_;
1353
1354 // The speech dispatcher attached to this view, lazily initialized.
1355 SpeechInputDispatcher* speech_input_dispatcher_;
1356
1357 // Device orientation dispatcher attached to this view; lazily initialized.
1358 DeviceOrientationDispatcher* device_orientation_dispatcher_;
1409 1359
1410 // PrintWebViewHelper handles printing. Note that this object is constructed 1360 // PrintWebViewHelper handles printing. Note that this object is constructed
1411 // when printing for the first time but only destroyed with the RenderView. 1361 // when printing for the first time but only destroyed with the RenderView.
1412 scoped_ptr<PrintWebViewHelper> print_helper_; 1362 scoped_ptr<PrintWebViewHelper> print_helper_;
1413 1363
1414 scoped_refptr<AudioMessageFilter> audio_message_filter_; 1364 scoped_refptr<AudioMessageFilter> audio_message_filter_;
1415 1365
1416 // The geolocation dispatcher attached to this view, lazily initialized.
1417 scoped_ptr<GeolocationDispatcher> geolocation_dispatcher_;
1418
1419 // Handles accessibility requests into the renderer side, as well as 1366 // Handles accessibility requests into the renderer side, as well as
1420 // maintains the cache and other features of the accessibility tree. 1367 // maintains the cache and other features of the accessibility tree.
1421 scoped_ptr<WebKit::WebAccessibilityCache> accessibility_; 1368 scoped_ptr<WebKit::WebAccessibilityCache> accessibility_;
1422 1369
1423 // Collect renderer accessibility notifications until they are ready to be 1370 // Collect renderer accessibility notifications until they are ready to be
1424 // sent to the browser. 1371 // sent to the browser.
1425 std::vector<RendererAccessibilityNotification> 1372 std::vector<RendererAccessibilityNotification>
1426 pending_accessibility_notifications_; 1373 pending_accessibility_notifications_;
1427 1374
1428 // Set if we are waiting for a accessibility notification ack. 1375 // Set if we are waiting for a accessibility notification ack.
1429 bool accessibility_ack_pending_; 1376 bool accessibility_ack_pending_;
1430 1377
1431 // The speech dispatcher attached to this view, lazily initialized.
1432 scoped_ptr<SpeechInputDispatcher> speech_input_dispatcher_;
1433
1434 // Device orientation dispatcher attached to this view; lazily initialized.
1435 scoped_ptr<DeviceOrientationDispatcher> device_orientation_dispatcher_;
1436
1437 // Responsible for sending page load related histograms. 1378 // Responsible for sending page load related histograms.
1438 PageLoadHistograms page_load_histograms_; 1379 PageLoadHistograms page_load_histograms_;
1439 1380
1440 // Handles the interaction between the RenderView and the phishing 1381 // Handles the interaction between the RenderView and the phishing
1441 // classifier. 1382 // classifier.
1442 scoped_ptr<safe_browsing::PhishingClassifierDelegate> phishing_delegate_; 1383 scoped_ptr<safe_browsing::PhishingClassifierDelegate> phishing_delegate_;
1443 1384
1444 // Misc ---------------------------------------------------------------------- 1385 // Misc ----------------------------------------------------------------------
1445 1386
1446 // The current and pending file chooser completion objects. If the queue is 1387 // The current and pending file chooser completion objects. If the queue is
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1512 1453
1513 // The external popup for the currently showing select popup. 1454 // The external popup for the currently showing select popup.
1514 scoped_ptr<ExternalPopupMenu> external_popup_menu_; 1455 scoped_ptr<ExternalPopupMenu> external_popup_menu_;
1515 1456
1516 // The custom menu event listener, if any. 1457 // The custom menu event listener, if any.
1517 CustomMenuListener* custom_menu_listener_; 1458 CustomMenuListener* custom_menu_listener_;
1518 1459
1519 // Reports load progress to the browser. 1460 // Reports load progress to the browser.
1520 scoped_ptr<LoadProgressTracker> load_progress_tracker_; 1461 scoped_ptr<LoadProgressTracker> load_progress_tracker_;
1521 1462
1463 // All the registered observers. We expect this list to be small, so vector
1464 // is fine.
1465 ObserverList<RenderViewObserver> observers_;
1466
1522 // --------------------------------------------------------------------------- 1467 // ---------------------------------------------------------------------------
1523 // ADDING NEW DATA? Please see if it fits appropriately in one of the above 1468 // ADDING NEW DATA? Please see if it fits appropriately in one of the above
1524 // sections rather than throwing it randomly at the end. If you're adding a 1469 // sections rather than throwing it randomly at the end. If you're adding a
1525 // bunch of stuff, you should probably create a helper class and put your 1470 // bunch of stuff, you should probably create a helper class and put your
1526 // data and methods on that to avoid bloating RenderView more. 1471 // data and methods on that to avoid bloating RenderView more. You can use
1472 // the Observer interface to filter IPC messages and receive frame change
1473 // notifications.
1527 // --------------------------------------------------------------------------- 1474 // ---------------------------------------------------------------------------
1528 1475
1529 DISALLOW_COPY_AND_ASSIGN(RenderView); 1476 DISALLOW_COPY_AND_ASSIGN(RenderView);
1530 }; 1477 };
1531 1478
1532 #endif // CHROME_RENDERER_RENDER_VIEW_H_ 1479 #endif // CHROME_RENDERER_RENDER_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/renderer/password_autocomplete_manager_unittest.cc ('k') | chrome/renderer/render_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698