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

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>
(...skipping 17 matching lines...) Expand all
28 #include "chrome/common/render_messages_params.h" 28 #include "chrome/common/render_messages_params.h"
29 #include "chrome/common/renderer_preferences.h" 29 #include "chrome/common/renderer_preferences.h"
30 #include "chrome/common/view_types.h" 30 #include "chrome/common/view_types.h"
31 #include "chrome/renderer/external_popup_menu.h" 31 #include "chrome/renderer/external_popup_menu.h"
32 #include "chrome/renderer/page_load_histograms.h" 32 #include "chrome/renderer/page_load_histograms.h"
33 #include "chrome/renderer/pepper_plugin_delegate_impl.h" 33 #include "chrome/renderer/pepper_plugin_delegate_impl.h"
34 #include "chrome/renderer/render_widget.h" 34 #include "chrome/renderer/render_widget.h"
35 #include "chrome/renderer/renderer_webcookiejar_impl.h" 35 #include "chrome/renderer/renderer_webcookiejar_impl.h"
36 #include "chrome/renderer/searchbox.h" 36 #include "chrome/renderer/searchbox.h"
37 #include "chrome/renderer/translate_helper.h" 37 #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" 38 #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h"
40 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h" 39 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h"
41 #include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h" 40 #include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h"
42 #include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h" 41 #include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h"
43 #include "third_party/WebKit/WebKit/chromium/public/WebPageSerializerClient.h" 42 #include "third_party/WebKit/WebKit/chromium/public/WebPageSerializerClient.h"
44 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" 43 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h"
45 #include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h" 44 #include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h"
46 #include "third_party/WebKit/WebKit/chromium/public/WebNavigationType.h" 45 #include "third_party/WebKit/WebKit/chromium/public/WebNavigationType.h"
47 #include "webkit/glue/webpreferences.h" 46 #include "webkit/glue/webpreferences.h"
48 #include "webkit/plugins/npapi/webplugin_page_delegate.h" 47 #include "webkit/plugins/npapi/webplugin_page_delegate.h"
49 48
50 #if defined(OS_WIN) 49 #if defined(OS_WIN)
51 // RenderView is a diamond-shaped hierarchy, with WebWidgetClient at the root. 50 // RenderView is a diamond-shaped hierarchy, with WebWidgetClient at the root.
52 // VS warns when we inherit the WebWidgetClient method implementations from 51 // VS warns when we inherit the WebWidgetClient method implementations from
53 // RenderWidget. It's safe to ignore that warning. 52 // RenderWidget. It's safe to ignore that warning.
54 #pragma warning(disable: 4250) 53 #pragma warning(disable: 4250)
55 #endif 54 #endif
56 55
57 class AudioMessageFilter; 56 class AudioMessageFilter;
58 class AutoFillHelper;
59 class BlockedPlugin; 57 class BlockedPlugin;
60 class CustomMenuListener; 58 class CustomMenuListener;
61 class DictionaryValue; 59 class DictionaryValue;
62 class DeviceOrientationDispatcher; 60 class DeviceOrientationDispatcher;
63 class DevToolsAgent; 61 class DevToolsAgent;
64 class DevToolsClient; 62 class DevToolsClient;
65 class DomAutomationController; 63 class DomAutomationController;
66 class DOMUIBindings; 64 class DOMUIBindings;
67 class ExternalHostBindings; 65 class ExternalHostBindings;
68 class FilePath; 66 class FilePath;
69 class GeolocationDispatcher; 67 class GeolocationDispatcher;
70 class GeolocationDispatcherOld; 68 class GeolocationDispatcherOld;
71 class GURL; 69 class GURL;
72 class ListValue; 70 class ListValue;
73 class LoadProgressTracker; 71 class LoadProgressTracker;
74 class NavigationState; 72 class NavigationState;
75 class NotificationProvider; 73 class NotificationProvider;
76 class PageClickTracker;
77 class PasswordAutocompleteManager;
78 class PepperDeviceTest; 74 class PepperDeviceTest;
79 class PrintWebViewHelper; 75 class PrintWebViewHelper;
80 class RenderViewVisitor; 76 class RenderViewVisitor;
81 class SkBitmap; 77 class SkBitmap;
82 class SpeechInputDispatcher; 78 class SpeechInputDispatcher;
83 class WebPluginDelegatePepper; 79 class WebPluginDelegatePepper;
84 class WebPluginDelegateProxy; 80 class WebPluginDelegateProxy;
85 struct ContextMenuMediaParams; 81 struct ContextMenuMediaParams;
86 struct PP_Flash_NetAddress; 82 struct PP_Flash_NetAddress;
87 struct ThumbnailScore; 83 struct ThumbnailScore;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // 163 //
168 // This is a RefCounted holder of an int because I can't say 164 // This is a RefCounted holder of an int because I can't say
169 // scoped_refptr<int>. 165 // scoped_refptr<int>.
170 typedef base::RefCountedData<int> SharedRenderViewCounter; 166 typedef base::RefCountedData<int> SharedRenderViewCounter;
171 167
172 // 168 //
173 // RenderView is an object that manages a WebView object, and provides a 169 // RenderView is an object that manages a WebView object, and provides a
174 // communication interface with an embedding application process 170 // communication interface with an embedding application process
175 // 171 //
176 class RenderView : public RenderWidget, 172 class RenderView : public RenderWidget,
177 public WebKit::WebAutoFillClient,
178 public WebKit::WebViewClient, 173 public WebKit::WebViewClient,
179 public WebKit::WebFrameClient, 174 public WebKit::WebFrameClient,
180 public WebKit::WebPageSerializerClient, 175 public WebKit::WebPageSerializerClient,
181 public webkit::npapi::WebPluginPageDelegate, 176 public webkit::npapi::WebPluginPageDelegate,
182 public base::SupportsWeakPtr<RenderView> { 177 public base::SupportsWeakPtr<RenderView> {
183 public: 178 public:
179 // Base class for objects that want to filter incoming IPCs, and also get
180 // notified of changes to the frame.
181 class Observer : public IPC::Channel::Listener,
brettw 2011/01/14 02:20:05 Personally, I would split this out into a separate
182 public IPC::Message::Sender {
183 public:
184 // By default, observers will be deleted when the RenderView goes away. If
185 // they want to outlive it, they can override this function.
186 virtual void OnDestruct();
187
188 // These match the WebKit API notifications.
189 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) {}
190 virtual void DidFinishLoad(WebKit::WebFrame* frame) {}
191 virtual void FrameDetached(WebKit::WebFrame* frame) {}
192 virtual void FrameWillClose(WebKit::WebFrame* frame) {}
193
194 // These match the RenderView methods below.
195 virtual void FrameTranslated(WebKit::WebFrame* frame) {}
196 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) {}
197
198 protected:
199 Observer(RenderView* render_view);
200 virtual ~Observer();
201
202 // IPC::Channel::Listener implementation.
203 virtual bool OnMessageReceived(const IPC::Message& message);
204
205 // IPC::Message::Sender implementation.
206 virtual bool Send(IPC::Message* message);
207
208 RenderView* render_view() { return render_view_; }
209 int routing_id() { return routing_id_; }
210
211 private:
212 friend class RenderView;
213
214 void set_render_view(RenderView* rv) { render_view_ = rv; }
215
216 RenderView* render_view_;
217 // The routing ID of the associated RenderView.
218 int routing_id_;
219 };
220
184 // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the 221 // 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 222 // 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 223 // 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). 224 // responsible for creating this RenderView (corresponding to parent_hwnd).
188 // |counter| is either a currently initialized counter, or NULL (in which case 225 // |counter| is either a currently initialized counter, or NULL (in which case
189 // we treat this RenderView as a top level window). 226 // we treat this RenderView as a top level window).
190 static RenderView* Create( 227 static RenderView* Create(
191 RenderThreadBase* render_thread, 228 RenderThreadBase* render_thread,
192 gfx::NativeViewId parent_hwnd, 229 gfx::NativeViewId parent_hwnd,
193 int32 opener_id, 230 int32 opener_id,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 269 }
233 270
234 const WebPreferences& webkit_preferences() const { 271 const WebPreferences& webkit_preferences() const {
235 return webkit_preferences_; 272 return webkit_preferences_;
236 } 273 }
237 274
238 void set_send_content_state_immediately(bool value) { 275 void set_send_content_state_immediately(bool value) {
239 send_content_state_immediately_ = value; 276 send_content_state_immediately_ = value;
240 } 277 }
241 278
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. 279 // May be NULL if client-side phishing detection is disabled.
247 safe_browsing::PhishingClassifierDelegate* 280 safe_browsing::PhishingClassifierDelegate*
248 phishing_classifier_delegate() const { 281 phishing_classifier_delegate() const {
249 return phishing_delegate_.get(); 282 return phishing_delegate_.get();
250 } 283 }
251 284
252 // Returns true if we should display scrollbars for the given view size and 285 // Returns true if we should display scrollbars for the given view size and
253 // false if the scrollbars should be hidden. 286 // false if the scrollbars should be hidden.
254 bool should_display_scrollbars(int width, int height) const { 287 bool should_display_scrollbars(int width, int height) const {
255 return (!send_preferred_size_changes_ || 288 return (!send_preferred_size_changes_ ||
256 (disable_scrollbars_size_limit_.width() <= width || 289 (disable_scrollbars_size_limit_.width() <= width ||
257 disable_scrollbars_size_limit_.height() <= height)); 290 disable_scrollbars_size_limit_.height() <= height));
258 } 291 }
259 292
260 const SearchBox& searchbox() const { 293 const SearchBox& searchbox() const {
261 return search_box_; 294 return search_box_;
262 } 295 }
263 296
297 // Functions to add and remove observers for this object.
298 void AddObserver(Observer* observer);
299 void RemoveObserver(Observer* observer);
300
264 // Called from JavaScript window.external.AddSearchProvider() to add a 301 // Called from JavaScript window.external.AddSearchProvider() to add a
265 // keyword for a provider described in the given OpenSearch document. 302 // keyword for a provider described in the given OpenSearch document.
266 void AddSearchProvider(const std::string& url, 303 void AddSearchProvider(const std::string& url,
267 const ViewHostMsg_PageHasOSDD_Type& provider_type); 304 const ViewHostMsg_PageHasOSDD_Type& provider_type);
268 305
269 // Returns the install state for the given search provider url. 306 // Returns the install state for the given search provider url.
270 ViewHostMsg_GetSearchProviderInstallState_Params 307 ViewHostMsg_GetSearchProviderInstallState_Params
271 GetSearchProviderInstallState(WebKit::WebFrame* frame, 308 GetSearchProviderInstallState(WebKit::WebFrame* frame,
272 const std::string& url); 309 const std::string& url);
273 310
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate); 427 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate);
391 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate); 428 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate);
392 429
393 void RegisterBlockedPlugin(BlockedPlugin* blocked_plugin); 430 void RegisterBlockedPlugin(BlockedPlugin* blocked_plugin);
394 void UnregisterBlockedPlugin(BlockedPlugin* blocked_plugin); 431 void UnregisterBlockedPlugin(BlockedPlugin* blocked_plugin);
395 432
396 // IPC::Channel::Listener implementation ------------------------------------- 433 // IPC::Channel::Listener implementation -------------------------------------
397 434
398 virtual bool OnMessageReceived(const IPC::Message& msg); 435 virtual bool OnMessageReceived(const IPC::Message& msg);
399 436
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 ------------------------------------ 437 // WebKit::WebWidgetClient implementation ------------------------------------
425 438
426 // Most methods are handled by RenderWidget. 439 // Most methods are handled by RenderWidget.
427 virtual void didFocus(); 440 virtual void didFocus();
428 virtual void didBlur(); 441 virtual void didBlur();
429 virtual void show(WebKit::WebNavigationPolicy policy); 442 virtual void show(WebKit::WebNavigationPolicy policy);
430 virtual void closeWidgetSoon(); 443 virtual void closeWidgetSoon();
431 virtual void runModal(); 444 virtual void runModal();
432 445
433 // WebKit::WebViewClient implementation -------------------------------------- 446 // WebKit::WebViewClient implementation --------------------------------------
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 ViewHostMsg_AccessibilityNotification_Params::NotificationType type; 759 ViewHostMsg_AccessibilityNotification_Params::NotificationType type;
747 }; 760 };
748 761
749 enum ErrorPageType { 762 enum ErrorPageType {
750 DNS_ERROR, 763 DNS_ERROR,
751 HTTP_404, 764 HTTP_404,
752 CONNECTION_ERROR, 765 CONNECTION_ERROR,
753 }; 766 };
754 767
755 RenderView(RenderThreadBase* render_thread, 768 RenderView(RenderThreadBase* render_thread,
756 const WebPreferences& webkit_preferences, 769 gfx::NativeViewId parent_hwnd,
757 int64 session_storage_namespace_id); 770 int32 opener_id,
771 const RendererPreferences& renderer_prefs,
772 const WebPreferences& webkit_prefs,
773 SharedRenderViewCounter* counter,
774 int32 routing_id,
775 int64 session_storage_namespace_id,
776 const string16& frame_name);
758 777
759 // Do not delete directly. This class is reference counted. 778 // Do not delete directly. This class is reference counted.
760 virtual ~RenderView(); 779 virtual ~RenderView();
761 780
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); 781 void UpdateURL(WebKit::WebFrame* frame);
773 void UpdateTitle(WebKit::WebFrame* frame, const string16& title); 782 void UpdateTitle(WebKit::WebFrame* frame, const string16& title);
774 void UpdateSessionHistory(WebKit::WebFrame* frame); 783 void UpdateSessionHistory(WebKit::WebFrame* frame);
775 784
776 // Update current main frame's encoding and send it to browser window. 785 // 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 786 // Since we want to let users see the right encoding info from menu
778 // before finishing loading, we call the UpdateEncoding in 787 // before finishing loading, we call the UpdateEncoding in
779 // a) function:DidCommitLoadForFrame. When this function is called, 788 // a) function:DidCommitLoadForFrame. When this function is called,
780 // that means we have got first data. In here we try to get encoding 789 // 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. 790 // 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); 828 std::wstring* result);
820 829
821 // Sends a message and runs a nested message loop. 830 // Sends a message and runs a nested message loop.
822 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message); 831 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message);
823 832
824 // Adds search provider from the given OpenSearch description URL as a 833 // Adds search provider from the given OpenSearch description URL as a
825 // keyword search. 834 // keyword search.
826 void AddGURLSearchProvider(const GURL& osd_url, 835 void AddGURLSearchProvider(const GURL& osd_url,
827 const ViewHostMsg_PageHasOSDD_Type& provider_type); 836 const ViewHostMsg_PageHasOSDD_Type& provider_type);
828 837
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. 838 // Send queued accessibility notifications from the renderer to the browser.
834 void SendPendingAccessibilityNotifications(); 839 void SendPendingAccessibilityNotifications();
835 840
836 // IPC message handlers ------------------------------------------------------ 841 // IPC message handlers ------------------------------------------------------
837 // 842 //
838 // The documentation for these functions should be in 843 // The documentation for these functions should be in
839 // render_messages_internal.h for the message that the function is handling. 844 // render_messages_internal.h for the message that the function is handling.
840 845
841 void OnAccessibilityDoDefaultAction(int acc_obj_id); 846 void OnAccessibilityDoDefaultAction(int acc_obj_id);
842 void OnAccessibilityNotificationsAck(); 847 void OnAccessibilityNotificationsAck();
843 void OnAllowBindings(int enabled_bindings_flags); 848 void OnAllowBindings(int enabled_bindings_flags);
844 void OnAddMessageToConsole(const string16& frame_xpath, 849 void OnAddMessageToConsole(const string16& frame_xpath,
845 const string16& message, 850 const string16& message,
846 const WebKit::WebConsoleMessage::Level&); 851 const WebKit::WebConsoleMessage::Level&);
847 void OnAdvanceToNextMisspelling(); 852 void OnAdvanceToNextMisspelling();
848 void OnAllowScriptToClose(bool script_can_close); 853 void OnAllowScriptToClose(bool script_can_close);
849 void OnAsyncFileOpened(base::PlatformFileError error_code, 854 void OnAsyncFileOpened(base::PlatformFileError error_code,
850 IPC::PlatformFileForTransit file_for_transit, 855 IPC::PlatformFileForTransit file_for_transit,
851 int message_id); 856 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); 857 void OnCancelDownload(int32 download_id);
865 void OnClearFocusedNode(); 858 void OnClearFocusedNode();
866 void OnClosePage(const ViewMsg_ClosePage_Params& params); 859 void OnClosePage(const ViewMsg_ClosePage_Params& params);
867 #if defined(ENABLE_FLAPPER_HACKS) 860 #if defined(ENABLE_FLAPPER_HACKS)
868 void OnConnectTcpACK(int request_id, 861 void OnConnectTcpACK(int request_id,
869 IPC::PlatformFileForTransit socket_for_transit, 862 IPC::PlatformFileForTransit socket_for_transit,
870 const PP_Flash_NetAddress& local_addr, 863 const PP_Flash_NetAddress& local_addr,
871 const PP_Flash_NetAddress& remote_addr); 864 const PP_Flash_NetAddress& remote_addr);
872 #endif 865 #endif
873 void OnCopy(); 866 void OnCopy();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 void OnHandleMessageFromExternalHost(const std::string& message, 925 void OnHandleMessageFromExternalHost(const std::string& message,
933 const std::string& origin, 926 const std::string& origin,
934 const std::string& target); 927 const std::string& target);
935 void OnInstallMissingPlugin(); 928 void OnInstallMissingPlugin();
936 void OnLoadBlockedPlugins(); 929 void OnLoadBlockedPlugins();
937 void OnMediaPlayerActionAt(const gfx::Point& location, 930 void OnMediaPlayerActionAt(const gfx::Point& location,
938 const WebKit::WebMediaPlayerAction& action); 931 const WebKit::WebMediaPlayerAction& action);
939 void OnMoveOrResizeStarted(); 932 void OnMoveOrResizeStarted();
940 void OnNavigate(const ViewMsg_Navigate_Params& params); 933 void OnNavigate(const ViewMsg_Navigate_Params& params);
941 void OnNotifyRendererViewType(ViewType::Type view_type); 934 void OnNotifyRendererViewType(ViewType::Type view_type);
942 void OnFillPasswordForm(
943 const webkit_glue::PasswordFormFillData& form_data);
944 void OnPaste(); 935 void OnPaste();
945 #if defined(OS_MACOSX) 936 #if defined(OS_MACOSX)
946 void OnPluginImeCompositionConfirmed(const string16& text, int plugin_id); 937 void OnPluginImeCompositionConfirmed(const string16& text, int plugin_id);
947 #endif 938 #endif
948 void OnPrintingDone(int document_cookie, bool success); 939 void OnPrintingDone(int document_cookie, bool success);
949 void OnPrintPages(); 940 void OnPrintPages();
950 void OnPrintPreview(); 941 void OnPrintPreview();
951 void OnRedo(); 942 void OnRedo();
952 void OnReloadFrame(); 943 void OnReloadFrame();
953 void OnReplace(const string16& text); 944 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 1360 // 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_. 1361 // destroyed yet. Pepper v2 plugins are tracked by the pepper_delegate_.
1371 std::set<WebPluginDelegatePepper*> current_oldstyle_pepper_plugins_; 1362 std::set<WebPluginDelegatePepper*> current_oldstyle_pepper_plugins_;
1372 1363
1373 // A list of all BlockedPlugins so they can all be loaded if needed. 1364 // A list of all BlockedPlugins so they can all be loaded if needed.
1374 std::set<BlockedPlugin*> blocked_plugins_; 1365 std::set<BlockedPlugin*> blocked_plugins_;
1375 1366
1376 // Helper objects ------------------------------------------------------------ 1367 // Helper objects ------------------------------------------------------------
1377 1368
1378 ScopedRunnableMethodFactory<RenderView> page_info_method_factory_; 1369 ScopedRunnableMethodFactory<RenderView> page_info_method_factory_;
1379 ScopedRunnableMethodFactory<RenderView> autofill_method_factory_;
1380 ScopedRunnableMethodFactory<RenderView> accessibility_method_factory_; 1370 ScopedRunnableMethodFactory<RenderView> accessibility_method_factory_;
1381 1371
1382 // Responsible for translating the page contents to other languages. 1372 // Responsible for translating the page contents to other languages.
1383 TranslateHelper translate_helper_; 1373 TranslateHelper translate_helper_;
1384 1374
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_; 1375 RendererWebCookieJarImpl cookie_jar_;
1399 1376
1377 // The next group of objects all implement Observer, so are deleted along with
1378 // the RenderView automatically. This is why we just store weak references.
1379
1400 // Provides access to this renderer from the remote Inspector UI. 1380 // Provides access to this renderer from the remote Inspector UI.
1401 scoped_ptr<DevToolsAgent> devtools_agent_; 1381 DevToolsAgent* devtools_agent_;
1402 1382
1403 // DevToolsClient for renderer hosting developer tools UI. It's NULL for other 1383 // DevToolsClient for renderer hosting developer tools UI. It's NULL for other
1404 // render views. 1384 // render views.
1405 scoped_ptr<DevToolsClient> devtools_client_; 1385 DevToolsClient* devtools_client_;
1406 1386
1407 // Holds a reference to the service which provides desktop notifications. 1387 // Holds a reference to the service which provides desktop notifications.
1408 scoped_ptr<NotificationProvider> notification_provider_; 1388 NotificationProvider* notification_provider_;
1389
1390 // The geolocation dispatcher attached to this view, lazily initialized.
1391 GeolocationDispatcher* geolocation_dispatcher_;
1392
1393 // The speech dispatcher attached to this view, lazily initialized.
1394 SpeechInputDispatcher* speech_input_dispatcher_;
1395
1396 // Device orientation dispatcher attached to this view; lazily initialized.
1397 DeviceOrientationDispatcher* device_orientation_dispatcher_;
1409 1398
1410 // PrintWebViewHelper handles printing. Note that this object is constructed 1399 // PrintWebViewHelper handles printing. Note that this object is constructed
1411 // when printing for the first time but only destroyed with the RenderView. 1400 // when printing for the first time but only destroyed with the RenderView.
1412 scoped_ptr<PrintWebViewHelper> print_helper_; 1401 scoped_ptr<PrintWebViewHelper> print_helper_;
1413 1402
1414 scoped_refptr<AudioMessageFilter> audio_message_filter_; 1403 scoped_refptr<AudioMessageFilter> audio_message_filter_;
1415 1404
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 1405 // Handles accessibility requests into the renderer side, as well as
1420 // maintains the cache and other features of the accessibility tree. 1406 // maintains the cache and other features of the accessibility tree.
1421 scoped_ptr<WebKit::WebAccessibilityCache> accessibility_; 1407 scoped_ptr<WebKit::WebAccessibilityCache> accessibility_;
1422 1408
1423 // Collect renderer accessibility notifications until they are ready to be 1409 // Collect renderer accessibility notifications until they are ready to be
1424 // sent to the browser. 1410 // sent to the browser.
1425 std::vector<RendererAccessibilityNotification> 1411 std::vector<RendererAccessibilityNotification>
1426 pending_accessibility_notifications_; 1412 pending_accessibility_notifications_;
1427 1413
1428 // Set if we are waiting for a accessibility notification ack. 1414 // Set if we are waiting for a accessibility notification ack.
1429 bool accessibility_ack_pending_; 1415 bool accessibility_ack_pending_;
1430 1416
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. 1417 // Responsible for sending page load related histograms.
1438 PageLoadHistograms page_load_histograms_; 1418 PageLoadHistograms page_load_histograms_;
1439 1419
1440 // Handles the interaction between the RenderView and the phishing 1420 // Handles the interaction between the RenderView and the phishing
1441 // classifier. 1421 // classifier.
1442 scoped_ptr<safe_browsing::PhishingClassifierDelegate> phishing_delegate_; 1422 scoped_ptr<safe_browsing::PhishingClassifierDelegate> phishing_delegate_;
1443 1423
1444 // Misc ---------------------------------------------------------------------- 1424 // Misc ----------------------------------------------------------------------
1445 1425
1446 // The current and pending file chooser completion objects. If the queue is 1426 // 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 1492
1513 // The external popup for the currently showing select popup. 1493 // The external popup for the currently showing select popup.
1514 scoped_ptr<ExternalPopupMenu> external_popup_menu_; 1494 scoped_ptr<ExternalPopupMenu> external_popup_menu_;
1515 1495
1516 // The custom menu event listener, if any. 1496 // The custom menu event listener, if any.
1517 CustomMenuListener* custom_menu_listener_; 1497 CustomMenuListener* custom_menu_listener_;
1518 1498
1519 // Reports load progress to the browser. 1499 // Reports load progress to the browser.
1520 scoped_ptr<LoadProgressTracker> load_progress_tracker_; 1500 scoped_ptr<LoadProgressTracker> load_progress_tracker_;
1521 1501
1502 // All the registered observers. We expect this list to be small, so vector
1503 // is fine.
1504 std::vector<Observer*> observers_;
1505
1522 // --------------------------------------------------------------------------- 1506 // ---------------------------------------------------------------------------
1523 // ADDING NEW DATA? Please see if it fits appropriately in one of the above 1507 // 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 1508 // 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 1509 // bunch of stuff, you should probably create a helper class and put your
1526 // data and methods on that to avoid bloating RenderView more. 1510 // data and methods on that to avoid bloating RenderView more. You can use
1511 // the Observer interface to filter IPC messages and receive frame change
1512 // notifications.
1527 // --------------------------------------------------------------------------- 1513 // ---------------------------------------------------------------------------
1528 1514
1529 DISALLOW_COPY_AND_ASSIGN(RenderView); 1515 DISALLOW_COPY_AND_ASSIGN(RenderView);
1530 }; 1516 };
1531 1517
1532 #endif // CHROME_RENDERER_RENDER_VIEW_H_ 1518 #endif // CHROME_RENDERER_RENDER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698