Chromium Code Reviews| 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 17 matching lines...) Expand all Loading... | |
| 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 Loading... | |
| 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, | |
| 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 virtual void FrameTranslated(WebKit::WebFrame* frame) {} | |
| 194 | |
| 195 protected: | |
| 196 Observer(); | |
| 197 virtual ~Observer(); | |
| 198 | |
| 199 // IPC::Channel::Listener implementation. | |
| 200 virtual bool OnMessageReceived(const IPC::Message& message); | |
| 201 | |
| 202 // IPC::Message::Sender implementation. | |
| 203 virtual bool Send(IPC::Message* message); | |
| 204 | |
| 205 // These getters are only available after the constructor runs. | |
| 206 RenderView* render_view() { return render_view_; } | |
| 207 int routing_id() { return routing_id_; } | |
|
Ilya Sherman
2011/01/13 02:18:30
nit: please add a blank line below
jam
2011/01/13 02:53:43
Done.
| |
| 208 private: | |
| 209 friend class RenderView; | |
| 210 | |
| 211 void SetRenderView(RenderView* render_view); | |
| 212 | |
| 213 RenderView* render_view_; | |
| 214 // The routing ID of the associated RenderView. | |
| 215 int routing_id_; | |
| 216 }; | |
| 217 | |
| 184 // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the | 218 // 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 | 219 // 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 | 220 // 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). | 221 // responsible for creating this RenderView (corresponding to parent_hwnd). |
| 188 // |counter| is either a currently initialized counter, or NULL (in which case | 222 // |counter| is either a currently initialized counter, or NULL (in which case |
| 189 // we treat this RenderView as a top level window). | 223 // we treat this RenderView as a top level window). |
| 190 static RenderView* Create( | 224 static RenderView* Create( |
| 191 RenderThreadBase* render_thread, | 225 RenderThreadBase* render_thread, |
| 192 gfx::NativeViewId parent_hwnd, | 226 gfx::NativeViewId parent_hwnd, |
| 193 int32 opener_id, | 227 int32 opener_id, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 } | 266 } |
| 233 | 267 |
| 234 const WebPreferences& webkit_preferences() const { | 268 const WebPreferences& webkit_preferences() const { |
| 235 return webkit_preferences_; | 269 return webkit_preferences_; |
| 236 } | 270 } |
| 237 | 271 |
| 238 void set_send_content_state_immediately(bool value) { | 272 void set_send_content_state_immediately(bool value) { |
| 239 send_content_state_immediately_ = value; | 273 send_content_state_immediately_ = value; |
| 240 } | 274 } |
| 241 | 275 |
| 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. | 276 // May be NULL if client-side phishing detection is disabled. |
| 247 safe_browsing::PhishingClassifierDelegate* | 277 safe_browsing::PhishingClassifierDelegate* |
| 248 phishing_classifier_delegate() const { | 278 phishing_classifier_delegate() const { |
| 249 return phishing_delegate_.get(); | 279 return phishing_delegate_.get(); |
| 250 } | 280 } |
| 251 | 281 |
| 252 // Returns true if we should display scrollbars for the given view size and | 282 // Returns true if we should display scrollbars for the given view size and |
| 253 // false if the scrollbars should be hidden. | 283 // false if the scrollbars should be hidden. |
| 254 bool should_display_scrollbars(int width, int height) const { | 284 bool should_display_scrollbars(int width, int height) const { |
| 255 return (!send_preferred_size_changes_ || | 285 return (!send_preferred_size_changes_ || |
| 256 (disable_scrollbars_size_limit_.width() <= width || | 286 (disable_scrollbars_size_limit_.width() <= width || |
| 257 disable_scrollbars_size_limit_.height() <= height)); | 287 disable_scrollbars_size_limit_.height() <= height)); |
| 258 } | 288 } |
| 259 | 289 |
| 260 const SearchBox& searchbox() const { | 290 const SearchBox& searchbox() const { |
| 261 return search_box_; | 291 return search_box_; |
| 262 } | 292 } |
| 263 | 293 |
| 294 // Functions to add and remove observers for this object. | |
| 295 void AddObserver(Observer* observer); | |
| 296 void RemoveObserver(Observer* observer); | |
| 297 | |
| 264 // Called from JavaScript window.external.AddSearchProvider() to add a | 298 // Called from JavaScript window.external.AddSearchProvider() to add a |
| 265 // keyword for a provider described in the given OpenSearch document. | 299 // keyword for a provider described in the given OpenSearch document. |
| 266 void AddSearchProvider(const std::string& url, | 300 void AddSearchProvider(const std::string& url, |
| 267 const ViewHostMsg_PageHasOSDD_Type& provider_type); | 301 const ViewHostMsg_PageHasOSDD_Type& provider_type); |
| 268 | 302 |
| 269 // Returns the install state for the given search provider url. | 303 // Returns the install state for the given search provider url. |
| 270 ViewHostMsg_GetSearchProviderInstallState_Params | 304 ViewHostMsg_GetSearchProviderInstallState_Params |
| 271 GetSearchProviderInstallState(WebKit::WebFrame* frame, | 305 GetSearchProviderInstallState(WebKit::WebFrame* frame, |
| 272 const std::string& url); | 306 const std::string& url); |
| 273 | 307 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate); | 424 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate); |
| 391 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate); | 425 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate); |
| 392 | 426 |
| 393 void RegisterBlockedPlugin(BlockedPlugin* blocked_plugin); | 427 void RegisterBlockedPlugin(BlockedPlugin* blocked_plugin); |
| 394 void UnregisterBlockedPlugin(BlockedPlugin* blocked_plugin); | 428 void UnregisterBlockedPlugin(BlockedPlugin* blocked_plugin); |
| 395 | 429 |
| 396 // IPC::Channel::Listener implementation ------------------------------------- | 430 // IPC::Channel::Listener implementation ------------------------------------- |
| 397 | 431 |
| 398 virtual bool OnMessageReceived(const IPC::Message& msg); | 432 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 399 | 433 |
| 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 ------------------------------------ | 434 // WebKit::WebWidgetClient implementation ------------------------------------ |
| 425 | 435 |
| 426 // Most methods are handled by RenderWidget. | 436 // Most methods are handled by RenderWidget. |
| 427 virtual void didFocus(); | 437 virtual void didFocus(); |
| 428 virtual void didBlur(); | 438 virtual void didBlur(); |
| 429 virtual void show(WebKit::WebNavigationPolicy policy); | 439 virtual void show(WebKit::WebNavigationPolicy policy); |
| 430 virtual void closeWidgetSoon(); | 440 virtual void closeWidgetSoon(); |
| 431 virtual void runModal(); | 441 virtual void runModal(); |
| 432 | 442 |
| 433 // WebKit::WebViewClient implementation -------------------------------------- | 443 // WebKit::WebViewClient implementation -------------------------------------- |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 687 virtual void Close(); | 697 virtual void Close(); |
| 688 virtual void OnResize(const gfx::Size& new_size, | 698 virtual void OnResize(const gfx::Size& new_size, |
| 689 const gfx::Rect& resizer_rect); | 699 const gfx::Rect& resizer_rect); |
| 690 virtual void DidInitiatePaint(); | 700 virtual void DidInitiatePaint(); |
| 691 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( | 701 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( |
| 692 const gfx::Rect& paint_bounds, | 702 const gfx::Rect& paint_bounds, |
| 693 TransportDIB** dib, | 703 TransportDIB** dib, |
| 694 gfx::Rect* location, | 704 gfx::Rect* location, |
| 695 gfx::Rect* clip); | 705 gfx::Rect* clip); |
| 696 virtual void DidHandleKeyEvent(); | 706 virtual void DidHandleKeyEvent(); |
| 697 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event); | |
| 698 virtual void OnSetFocus(bool enable); | 707 virtual void OnSetFocus(bool enable); |
| 699 #if OS_MACOSX | 708 #if OS_MACOSX |
| 700 virtual void OnWasHidden(); | 709 virtual void OnWasHidden(); |
| 701 virtual void OnWasRestored(bool needs_repainting); | 710 virtual void OnWasRestored(bool needs_repainting); |
| 702 #endif | 711 #endif |
| 703 | 712 |
| 704 private: | 713 private: |
| 705 // For unit tests. | 714 // For unit tests. |
| 706 friend class ExternalPopupMenuTest; | 715 friend class ExternalPopupMenuTest; |
| 707 friend class PepperDeviceTest; | 716 friend class PepperDeviceTest; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 752 CONNECTION_ERROR, | 761 CONNECTION_ERROR, |
| 753 }; | 762 }; |
| 754 | 763 |
| 755 RenderView(RenderThreadBase* render_thread, | 764 RenderView(RenderThreadBase* render_thread, |
| 756 const WebPreferences& webkit_preferences, | 765 const WebPreferences& webkit_preferences, |
| 757 int64 session_storage_namespace_id); | 766 int64 session_storage_namespace_id); |
| 758 | 767 |
| 759 // Do not delete directly. This class is reference counted. | 768 // Do not delete directly. This class is reference counted. |
| 760 virtual ~RenderView(); | 769 virtual ~RenderView(); |
| 761 | 770 |
| 762 // Initializes this view with the given parent and ID. The |routing_id| can be | 771 // Initializes this view with the given parent and ID. |
| 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, | 772 void Init(gfx::NativeViewId parent, |
| 766 int32 opener_id, | 773 int32 opener_id, |
| 767 const RendererPreferences& renderer_prefs, | 774 const RendererPreferences& renderer_prefs, |
| 768 SharedRenderViewCounter* counter, | 775 SharedRenderViewCounter* counter, |
| 769 int32 routing_id, | 776 int32 routing_id, |
| 770 const string16& frame_name); | 777 const string16& frame_name); |
| 771 | 778 |
| 772 void UpdateURL(WebKit::WebFrame* frame); | 779 void UpdateURL(WebKit::WebFrame* frame); |
| 773 void UpdateTitle(WebKit::WebFrame* frame, const string16& title); | 780 void UpdateTitle(WebKit::WebFrame* frame, const string16& title); |
| 774 void UpdateSessionHistory(WebKit::WebFrame* frame); | 781 void UpdateSessionHistory(WebKit::WebFrame* frame); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 819 std::wstring* result); | 826 std::wstring* result); |
| 820 | 827 |
| 821 // Sends a message and runs a nested message loop. | 828 // Sends a message and runs a nested message loop. |
| 822 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message); | 829 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message); |
| 823 | 830 |
| 824 // Adds search provider from the given OpenSearch description URL as a | 831 // Adds search provider from the given OpenSearch description URL as a |
| 825 // keyword search. | 832 // keyword search. |
| 826 void AddGURLSearchProvider(const GURL& osd_url, | 833 void AddGURLSearchProvider(const GURL& osd_url, |
| 827 const ViewHostMsg_PageHasOSDD_Type& provider_type); | 834 const ViewHostMsg_PageHasOSDD_Type& provider_type); |
| 828 | 835 |
| 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. | 836 // Send queued accessibility notifications from the renderer to the browser. |
| 834 void SendPendingAccessibilityNotifications(); | 837 void SendPendingAccessibilityNotifications(); |
| 835 | 838 |
| 836 // IPC message handlers ------------------------------------------------------ | 839 // IPC message handlers ------------------------------------------------------ |
| 837 // | 840 // |
| 838 // The documentation for these functions should be in | 841 // The documentation for these functions should be in |
| 839 // render_messages_internal.h for the message that the function is handling. | 842 // render_messages_internal.h for the message that the function is handling. |
| 840 | 843 |
| 841 void OnAccessibilityDoDefaultAction(int acc_obj_id); | 844 void OnAccessibilityDoDefaultAction(int acc_obj_id); |
| 842 void OnAccessibilityNotificationsAck(); | 845 void OnAccessibilityNotificationsAck(); |
| 843 void OnAllowBindings(int enabled_bindings_flags); | 846 void OnAllowBindings(int enabled_bindings_flags); |
| 844 void OnAddMessageToConsole(const string16& frame_xpath, | 847 void OnAddMessageToConsole(const string16& frame_xpath, |
| 845 const string16& message, | 848 const string16& message, |
| 846 const WebKit::WebConsoleMessage::Level&); | 849 const WebKit::WebConsoleMessage::Level&); |
| 847 void OnAdvanceToNextMisspelling(); | 850 void OnAdvanceToNextMisspelling(); |
| 848 void OnAllowScriptToClose(bool script_can_close); | 851 void OnAllowScriptToClose(bool script_can_close); |
| 849 void OnAsyncFileOpened(base::PlatformFileError error_code, | 852 void OnAsyncFileOpened(base::PlatformFileError error_code, |
| 850 IPC::PlatformFileForTransit file_for_transit, | 853 IPC::PlatformFileForTransit file_for_transit, |
| 851 int message_id); | 854 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); | 855 void OnCancelDownload(int32 download_id); |
| 865 void OnClearFocusedNode(); | 856 void OnClearFocusedNode(); |
| 866 void OnClosePage(const ViewMsg_ClosePage_Params& params); | 857 void OnClosePage(const ViewMsg_ClosePage_Params& params); |
| 867 #if defined(ENABLE_FLAPPER_HACKS) | 858 #if defined(ENABLE_FLAPPER_HACKS) |
| 868 void OnConnectTcpACK(int request_id, | 859 void OnConnectTcpACK(int request_id, |
| 869 IPC::PlatformFileForTransit socket_for_transit, | 860 IPC::PlatformFileForTransit socket_for_transit, |
| 870 const PP_Flash_NetAddress& local_addr, | 861 const PP_Flash_NetAddress& local_addr, |
| 871 const PP_Flash_NetAddress& remote_addr); | 862 const PP_Flash_NetAddress& remote_addr); |
| 872 #endif | 863 #endif |
| 873 void OnCopy(); | 864 void OnCopy(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 932 void OnHandleMessageFromExternalHost(const std::string& message, | 923 void OnHandleMessageFromExternalHost(const std::string& message, |
| 933 const std::string& origin, | 924 const std::string& origin, |
| 934 const std::string& target); | 925 const std::string& target); |
| 935 void OnInstallMissingPlugin(); | 926 void OnInstallMissingPlugin(); |
| 936 void OnLoadBlockedPlugins(); | 927 void OnLoadBlockedPlugins(); |
| 937 void OnMediaPlayerActionAt(const gfx::Point& location, | 928 void OnMediaPlayerActionAt(const gfx::Point& location, |
| 938 const WebKit::WebMediaPlayerAction& action); | 929 const WebKit::WebMediaPlayerAction& action); |
| 939 void OnMoveOrResizeStarted(); | 930 void OnMoveOrResizeStarted(); |
| 940 void OnNavigate(const ViewMsg_Navigate_Params& params); | 931 void OnNavigate(const ViewMsg_Navigate_Params& params); |
| 941 void OnNotifyRendererViewType(ViewType::Type view_type); | 932 void OnNotifyRendererViewType(ViewType::Type view_type); |
| 942 void OnFillPasswordForm( | |
| 943 const webkit_glue::PasswordFormFillData& form_data); | |
| 944 void OnPaste(); | 933 void OnPaste(); |
| 945 #if defined(OS_MACOSX) | 934 #if defined(OS_MACOSX) |
| 946 void OnPluginImeCompositionConfirmed(const string16& text, int plugin_id); | 935 void OnPluginImeCompositionConfirmed(const string16& text, int plugin_id); |
| 947 #endif | 936 #endif |
| 948 void OnPrintingDone(int document_cookie, bool success); | 937 void OnPrintingDone(int document_cookie, bool success); |
| 949 void OnPrintPages(); | 938 void OnPrintPages(); |
| 950 void OnPrintPreview(); | 939 void OnPrintPreview(); |
| 951 void OnRedo(); | 940 void OnRedo(); |
| 952 void OnReloadFrame(); | 941 void OnReloadFrame(); |
| 953 void OnReplace(const string16& text); | 942 void OnReplace(const string16& text); |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1369 // A list of all Pepper v1 plugins that we've created that haven't been | 1358 // 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_. | 1359 // destroyed yet. Pepper v2 plugins are tracked by the pepper_delegate_. |
| 1371 std::set<WebPluginDelegatePepper*> current_oldstyle_pepper_plugins_; | 1360 std::set<WebPluginDelegatePepper*> current_oldstyle_pepper_plugins_; |
| 1372 | 1361 |
| 1373 // A list of all BlockedPlugins so they can all be loaded if needed. | 1362 // A list of all BlockedPlugins so they can all be loaded if needed. |
| 1374 std::set<BlockedPlugin*> blocked_plugins_; | 1363 std::set<BlockedPlugin*> blocked_plugins_; |
| 1375 | 1364 |
| 1376 // Helper objects ------------------------------------------------------------ | 1365 // Helper objects ------------------------------------------------------------ |
| 1377 | 1366 |
| 1378 ScopedRunnableMethodFactory<RenderView> page_info_method_factory_; | 1367 ScopedRunnableMethodFactory<RenderView> page_info_method_factory_; |
| 1379 ScopedRunnableMethodFactory<RenderView> autofill_method_factory_; | |
| 1380 ScopedRunnableMethodFactory<RenderView> accessibility_method_factory_; | 1368 ScopedRunnableMethodFactory<RenderView> accessibility_method_factory_; |
| 1381 | 1369 |
| 1382 // Responsible for translating the page contents to other languages. | 1370 // Responsible for translating the page contents to other languages. |
| 1383 TranslateHelper translate_helper_; | 1371 TranslateHelper translate_helper_; |
| 1384 | 1372 |
| 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_; | 1373 RendererWebCookieJarImpl cookie_jar_; |
| 1399 | 1374 |
| 1375 // The next group of objects all implement Observer, so are deleted along with | |
| 1376 // the RenderView automatically. This is why we just store weak references. | |
| 1377 | |
| 1400 // Provides access to this renderer from the remote Inspector UI. | 1378 // Provides access to this renderer from the remote Inspector UI. |
| 1401 scoped_ptr<DevToolsAgent> devtools_agent_; | 1379 DevToolsAgent* devtools_agent_; |
| 1402 | 1380 |
| 1403 // DevToolsClient for renderer hosting developer tools UI. It's NULL for other | 1381 // DevToolsClient for renderer hosting developer tools UI. It's NULL for other |
| 1404 // render views. | 1382 // render views. |
| 1405 scoped_ptr<DevToolsClient> devtools_client_; | 1383 DevToolsClient* devtools_client_; |
| 1406 | 1384 |
| 1407 // Holds a reference to the service which provides desktop notifications. | 1385 // Holds a reference to the service which provides desktop notifications. |
| 1408 scoped_ptr<NotificationProvider> notification_provider_; | 1386 NotificationProvider* notification_provider_; |
| 1387 | |
| 1388 // The geolocation dispatcher attached to this view, lazily initialized. | |
| 1389 GeolocationDispatcher* geolocation_dispatcher_; | |
| 1390 | |
| 1391 // The speech dispatcher attached to this view, lazily initialized. | |
| 1392 SpeechInputDispatcher* speech_input_dispatcher_; | |
| 1393 | |
| 1394 // Device orientation dispatcher attached to this view; lazily initialized. | |
| 1395 DeviceOrientationDispatcher* device_orientation_dispatcher_; | |
| 1409 | 1396 |
| 1410 // PrintWebViewHelper handles printing. Note that this object is constructed | 1397 // PrintWebViewHelper handles printing. Note that this object is constructed |
| 1411 // when printing for the first time but only destroyed with the RenderView. | 1398 // when printing for the first time but only destroyed with the RenderView. |
| 1412 scoped_ptr<PrintWebViewHelper> print_helper_; | 1399 scoped_ptr<PrintWebViewHelper> print_helper_; |
| 1413 | 1400 |
| 1414 scoped_refptr<AudioMessageFilter> audio_message_filter_; | 1401 scoped_refptr<AudioMessageFilter> audio_message_filter_; |
| 1415 | 1402 |
| 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 | 1403 // Handles accessibility requests into the renderer side, as well as |
| 1420 // maintains the cache and other features of the accessibility tree. | 1404 // maintains the cache and other features of the accessibility tree. |
| 1421 scoped_ptr<WebKit::WebAccessibilityCache> accessibility_; | 1405 scoped_ptr<WebKit::WebAccessibilityCache> accessibility_; |
| 1422 | 1406 |
| 1423 // Collect renderer accessibility notifications until they are ready to be | 1407 // Collect renderer accessibility notifications until they are ready to be |
| 1424 // sent to the browser. | 1408 // sent to the browser. |
| 1425 std::vector<RendererAccessibilityNotification> | 1409 std::vector<RendererAccessibilityNotification> |
| 1426 pending_accessibility_notifications_; | 1410 pending_accessibility_notifications_; |
| 1427 | 1411 |
| 1428 // Set if we are waiting for a accessibility notification ack. | 1412 // Set if we are waiting for a accessibility notification ack. |
| 1429 bool accessibility_ack_pending_; | 1413 bool accessibility_ack_pending_; |
| 1430 | 1414 |
| 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. | 1415 // Responsible for sending page load related histograms. |
| 1438 PageLoadHistograms page_load_histograms_; | 1416 PageLoadHistograms page_load_histograms_; |
| 1439 | 1417 |
| 1440 // Handles the interaction between the RenderView and the phishing | 1418 // Handles the interaction between the RenderView and the phishing |
| 1441 // classifier. | 1419 // classifier. |
| 1442 scoped_ptr<safe_browsing::PhishingClassifierDelegate> phishing_delegate_; | 1420 scoped_ptr<safe_browsing::PhishingClassifierDelegate> phishing_delegate_; |
| 1443 | 1421 |
| 1444 // Misc ---------------------------------------------------------------------- | 1422 // Misc ---------------------------------------------------------------------- |
| 1445 | 1423 |
| 1446 // The current and pending file chooser completion objects. If the queue is | 1424 // The current and pending file chooser completion objects. If the queue is |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1512 | 1490 |
| 1513 // The external popup for the currently showing select popup. | 1491 // The external popup for the currently showing select popup. |
| 1514 scoped_ptr<ExternalPopupMenu> external_popup_menu_; | 1492 scoped_ptr<ExternalPopupMenu> external_popup_menu_; |
| 1515 | 1493 |
| 1516 // The custom menu event listener, if any. | 1494 // The custom menu event listener, if any. |
| 1517 CustomMenuListener* custom_menu_listener_; | 1495 CustomMenuListener* custom_menu_listener_; |
| 1518 | 1496 |
| 1519 // Reports load progress to the browser. | 1497 // Reports load progress to the browser. |
| 1520 scoped_ptr<LoadProgressTracker> load_progress_tracker_; | 1498 scoped_ptr<LoadProgressTracker> load_progress_tracker_; |
| 1521 | 1499 |
| 1500 // All the registered observers. We expect this list to be small, so vector | |
| 1501 // is fine. | |
| 1502 std::vector<Observer*> observers_; | |
| 1503 | |
| 1522 // --------------------------------------------------------------------------- | 1504 // --------------------------------------------------------------------------- |
| 1523 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 1505 // 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 | 1506 // 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 | 1507 // bunch of stuff, you should probably create a helper class and put your |
| 1526 // data and methods on that to avoid bloating RenderView more. | 1508 // data and methods on that to avoid bloating RenderView more. You can use |
| 1509 // the Observer interface to filter IPC messages and receive frame change | |
| 1510 // notifications. | |
| 1527 // --------------------------------------------------------------------------- | 1511 // --------------------------------------------------------------------------- |
| 1528 | 1512 |
| 1529 DISALLOW_COPY_AND_ASSIGN(RenderView); | 1513 DISALLOW_COPY_AND_ASSIGN(RenderView); |
| 1530 }; | 1514 }; |
| 1531 | 1515 |
| 1532 #endif // CHROME_RENDERER_RENDER_VIEW_H_ | 1516 #endif // CHROME_RENDERER_RENDER_VIEW_H_ |
| OLD | NEW |