Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 #include "content/common/content_export.h" | 29 #include "content/common/content_export.h" |
| 30 #include "content/common/drag_event_source_info.h" | 30 #include "content/common/drag_event_source_info.h" |
| 31 #include "content/common/edit_command.h" | 31 #include "content/common/edit_command.h" |
| 32 #include "content/common/frame_message_enums.h" | 32 #include "content/common/frame_message_enums.h" |
| 33 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 33 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 34 #include "content/common/navigation_gesture.h" | 34 #include "content/common/navigation_gesture.h" |
| 35 #include "content/common/view_message_enums.h" | 35 #include "content/common/view_message_enums.h" |
| 36 #include "content/public/common/page_zoom.h" | 36 #include "content/public/common/page_zoom.h" |
| 37 #include "content/public/common/referrer.h" | 37 #include "content/public/common/referrer.h" |
| 38 #include "content/public/common/renderer_preferences.h" | 38 #include "content/public/common/renderer_preferences.h" |
| 39 #include "content/public/common/stop_find_action.h" | |
| 40 #include "content/public/common/top_controls_state.h" | 39 #include "content/public/common/top_controls_state.h" |
| 41 #include "content/public/common/web_preferences.h" | 40 #include "content/public/common/web_preferences.h" |
| 42 #include "content/public/renderer/render_view.h" | 41 #include "content/public/renderer/render_view.h" |
| 43 #include "content/renderer/mouse_lock_dispatcher.h" | 42 #include "content/renderer/mouse_lock_dispatcher.h" |
| 44 #include "content/renderer/render_frame_impl.h" | 43 #include "content/renderer/render_frame_impl.h" |
| 45 #include "content/renderer/render_widget.h" | 44 #include "content/renderer/render_widget.h" |
| 46 #include "content/renderer/stats_collection_observer.h" | 45 #include "content/renderer/stats_collection_observer.h" |
| 47 #include "ipc/ipc_platform_file.h" | 46 #include "ipc/ipc_platform_file.h" |
| 48 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 47 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 49 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 48 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 class WebMouseEvent; | 101 class WebMouseEvent; |
| 103 class WebPeerConnectionHandler; | 102 class WebPeerConnectionHandler; |
| 104 class WebPeerConnectionHandlerClient; | 103 class WebPeerConnectionHandlerClient; |
| 105 class WebSpeechRecognizer; | 104 class WebSpeechRecognizer; |
| 106 class WebStorageNamespace; | 105 class WebStorageNamespace; |
| 107 class WebTouchEvent; | 106 class WebTouchEvent; |
| 108 class WebURLRequest; | 107 class WebURLRequest; |
| 109 struct WebActiveWheelFlingParameters; | 108 struct WebActiveWheelFlingParameters; |
| 110 struct WebDateTimeChooserParams; | 109 struct WebDateTimeChooserParams; |
| 111 struct WebFileChooserParams; | 110 struct WebFileChooserParams; |
| 112 struct WebFindOptions; | 111 struct WebFindOptions; |
|
nasko
2016/01/20 21:43:32
Is this still needed?
paulmeyer
2016/01/20 22:54:15
No. Good catch.
| |
| 113 struct WebMediaPlayerAction; | 112 struct WebMediaPlayerAction; |
| 114 struct WebPluginAction; | 113 struct WebPluginAction; |
| 115 struct WebPoint; | 114 struct WebPoint; |
| 116 struct WebWindowFeatures; | 115 struct WebWindowFeatures; |
| 117 | 116 |
| 118 #if defined(OS_ANDROID) | 117 #if defined(OS_ANDROID) |
| 119 class WebHitTestResult; | 118 class WebHitTestResult; |
| 120 #endif | 119 #endif |
| 121 } // namespace blink | 120 } // namespace blink |
| 122 | 121 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 | 240 |
| 242 // Sets page-level focus in this view and notifies plugins and Blink's | 241 // Sets page-level focus in this view and notifies plugins and Blink's |
| 243 // FocusController. | 242 // FocusController. |
| 244 void SetFocus(bool enable); | 243 void SetFocus(bool enable); |
| 245 | 244 |
| 246 void AttachWebFrameWidget(blink::WebWidget* frame_widget); | 245 void AttachWebFrameWidget(blink::WebWidget* frame_widget); |
| 247 | 246 |
| 248 // Plugin-related functions -------------------------------------------------- | 247 // Plugin-related functions -------------------------------------------------- |
| 249 | 248 |
| 250 #if defined(ENABLE_PLUGINS) | 249 #if defined(ENABLE_PLUGINS) |
| 251 // Get/set the plugin which will be used as to handle document find requests. | |
| 252 void set_plugin_find_handler(PepperPluginInstanceImpl* plugin) { | |
| 253 plugin_find_handler_ = plugin; | |
| 254 } | |
| 255 PepperPluginInstanceImpl* plugin_find_handler() { | |
| 256 return plugin_find_handler_; | |
| 257 } | |
| 258 | |
| 259 PepperPluginInstanceImpl* focused_pepper_plugin() { | 250 PepperPluginInstanceImpl* focused_pepper_plugin() { |
| 260 return focused_pepper_plugin_; | 251 return focused_pepper_plugin_; |
| 261 } | 252 } |
| 262 PepperPluginInstanceImpl* pepper_last_mouse_event_target() { | 253 PepperPluginInstanceImpl* pepper_last_mouse_event_target() { |
| 263 return pepper_last_mouse_event_target_; | 254 return pepper_last_mouse_event_target_; |
| 264 } | 255 } |
| 265 void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) { | 256 void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) { |
| 266 pepper_last_mouse_event_target_ = plugin; | 257 pepper_last_mouse_event_target_ = plugin; |
| 267 } | 258 } |
| 268 | 259 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 499 ui::TextInputType GetTextInputType() override; | 490 ui::TextInputType GetTextInputType() override; |
| 500 void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) override; | 491 void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) override; |
| 501 void GetCompositionCharacterBounds( | 492 void GetCompositionCharacterBounds( |
| 502 std::vector<gfx::Rect>* character_bounds_in_window) override; | 493 std::vector<gfx::Rect>* character_bounds_in_window) override; |
| 503 void GetCompositionRange(gfx::Range* range) override; | 494 void GetCompositionRange(gfx::Range* range) override; |
| 504 bool CanComposeInline() override; | 495 bool CanComposeInline() override; |
| 505 void DidCommitCompositorFrame() override; | 496 void DidCommitCompositorFrame() override; |
| 506 void DidCompletePageScaleAnimation() override; | 497 void DidCompletePageScaleAnimation() override; |
| 507 void OnDeviceScaleFactorChanged() override; | 498 void OnDeviceScaleFactorChanged() override; |
| 508 | 499 |
| 509 protected: | |
|
nasko
2016/01/20 21:43:32
Why was "protected" removed? The following methods
paulmeyer
2016/01/20 22:54:15
Hahahaha, I did this long enough ago that I didn't
| |
| 510 RenderViewImpl(CompositorDependencies* compositor_deps, | 500 RenderViewImpl(CompositorDependencies* compositor_deps, |
| 511 const ViewMsg_New_Params& params); | 501 const ViewMsg_New_Params& params); |
| 512 | 502 |
| 513 void Initialize(const ViewMsg_New_Params& params, | 503 void Initialize(const ViewMsg_New_Params& params, |
| 514 bool was_created_by_renderer); | 504 bool was_created_by_renderer); |
| 515 void SetScreenMetricsEmulationParameters( | 505 void SetScreenMetricsEmulationParameters( |
| 516 bool enabled, | 506 bool enabled, |
| 517 const blink::WebDeviceEmulationParams& params) override; | 507 const blink::WebDeviceEmulationParams& params) override; |
| 518 | 508 |
| 519 // Do not delete directly. This class is reference counted. | 509 // Do not delete directly. This class is reference counted. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 649 const gfx::Point& screen_pt, | 639 const gfx::Point& screen_pt, |
| 650 blink::WebDragOperationsMask operations_allowed, | 640 blink::WebDragOperationsMask operations_allowed, |
| 651 int key_modifiers); | 641 int key_modifiers); |
| 652 void OnEnablePreferredSizeChangedMode(); | 642 void OnEnablePreferredSizeChangedMode(); |
| 653 void OnEnableAutoResize(const gfx::Size& min_size, const gfx::Size& max_size); | 643 void OnEnableAutoResize(const gfx::Size& min_size, const gfx::Size& max_size); |
| 654 void OnDisableAutoResize(const gfx::Size& new_size); | 644 void OnDisableAutoResize(const gfx::Size& new_size); |
| 655 void OnEnumerateDirectoryResponse(int id, | 645 void OnEnumerateDirectoryResponse(int id, |
| 656 const std::vector<base::FilePath>& paths); | 646 const std::vector<base::FilePath>& paths); |
| 657 void OnFileChooserResponse( | 647 void OnFileChooserResponse( |
| 658 const std::vector<content::FileChooserFileInfo>& files); | 648 const std::vector<content::FileChooserFileInfo>& files); |
| 659 void OnFind(int request_id, | |
| 660 const base::string16&, | |
| 661 const blink::WebFindOptions&); | |
| 662 void OnMediaPlayerActionAt(const gfx::Point& location, | 649 void OnMediaPlayerActionAt(const gfx::Point& location, |
| 663 const blink::WebMediaPlayerAction& action); | 650 const blink::WebMediaPlayerAction& action); |
| 664 void OnPluginActionAt(const gfx::Point& location, | 651 void OnPluginActionAt(const gfx::Point& location, |
| 665 const blink::WebPluginAction& action); | 652 const blink::WebPluginAction& action); |
| 666 void OnMoveOrResizeStarted(); | 653 void OnMoveOrResizeStarted(); |
| 667 void OnReleaseDisambiguationPopupBitmap(const cc::SharedBitmapId& id); | 654 void OnReleaseDisambiguationPopupBitmap(const cc::SharedBitmapId& id); |
| 668 void OnResetPageEncodingToDefault(); | 655 void OnResetPageEncodingToDefault(); |
| 669 void OnSetActive(bool active); | 656 void OnSetActive(bool active); |
| 670 void OnSetBackgroundOpaque(bool opaque); | 657 void OnSetBackgroundOpaque(bool opaque); |
| 671 void OnExitFullscreen(); | 658 void OnExitFullscreen(); |
| 672 void OnSetHistoryOffsetAndLength(int history_offset, int history_length); | 659 void OnSetHistoryOffsetAndLength(int history_offset, int history_length); |
| 673 void OnSetInitialFocus(bool reverse); | 660 void OnSetInitialFocus(bool reverse); |
| 674 void OnSetPageEncoding(const std::string& encoding_name); | 661 void OnSetPageEncoding(const std::string& encoding_name); |
| 675 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); | 662 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); |
| 676 void OnSetWebUIProperty(const std::string& name, const std::string& value); | 663 void OnSetWebUIProperty(const std::string& name, const std::string& value); |
| 677 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level); | 664 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level); |
| 678 void OnSetZoomLevelForView(bool uses_temporary_zoom_level, double level); | 665 void OnSetZoomLevelForView(bool uses_temporary_zoom_level, double level); |
| 679 void OnStopFinding(StopFindAction action); | |
| 680 void OnSuppressDialogsUntilSwapOut(); | 666 void OnSuppressDialogsUntilSwapOut(); |
| 681 void OnThemeChanged(); | 667 void OnThemeChanged(); |
| 682 void OnUpdateTargetURLAck(); | 668 void OnUpdateTargetURLAck(); |
| 683 void OnUpdateWebPreferences(const WebPreferences& prefs); | 669 void OnUpdateWebPreferences(const WebPreferences& prefs); |
| 684 void OnSetPageScale(float page_scale_factor); | 670 void OnSetPageScale(float page_scale_factor); |
| 685 void OnZoom(PageZoom zoom); | 671 void OnZoom(PageZoom zoom); |
| 686 void OnEnableViewSourceMode(); | 672 void OnEnableViewSourceMode(); |
| 687 void OnForceRedraw(int request_id); | 673 void OnForceRedraw(int request_id); |
| 688 void OnSelectWordAroundCaret(); | 674 void OnSelectWordAroundCaret(); |
| 689 #if defined(OS_ANDROID) | 675 #if defined(OS_ANDROID) |
| 690 void OnActivateNearestFindResult(int request_id, float x, float y); | |
| 691 void OnFindMatchRects(int current_version); | |
| 692 void OnUndoScrollFocusedEditableNodeIntoRect(); | 676 void OnUndoScrollFocusedEditableNodeIntoRect(); |
| 693 void OnUpdateTopControlsState(bool enable_hiding, | 677 void OnUpdateTopControlsState(bool enable_hiding, |
| 694 bool enable_showing, | 678 bool enable_showing, |
| 695 bool animate); | 679 bool animate); |
| 696 void OnExtractSmartClipData(const gfx::Rect& rect); | 680 void OnExtractSmartClipData(const gfx::Rect& rect); |
| 697 #elif defined(OS_MACOSX) | 681 #elif defined(OS_MACOSX) |
| 698 void OnGetRenderedText(); | 682 void OnGetRenderedText(); |
| 699 void OnPluginImeCompositionCompleted(const base::string16& text, | 683 void OnPluginImeCompositionCompleted(const base::string16& text, |
| 700 int plugin_id); | 684 int plugin_id); |
| 701 void OnSetInLiveResize(bool in_live_resize); | 685 void OnSetInLiveResize(bool in_live_resize); |
| 702 void OnSetWindowVisibility(bool visible); | 686 void OnSetWindowVisibility(bool visible); |
| 703 void OnWindowFrameChanged(const gfx::Rect& window_frame, | 687 void OnWindowFrameChanged(const gfx::Rect& window_frame, |
| 704 const gfx::Rect& view_frame); | 688 const gfx::Rect& view_frame); |
| 705 #endif | 689 #endif |
| 706 | 690 |
| 707 // Adding a new message handler? Please add it in alphabetical order above | 691 // Adding a new message handler? Please add it in alphabetical order above |
| 708 // and put it in the same position in the .cc file. | 692 // and put it in the same position in the .cc file. |
| 709 | 693 |
| 710 // Misc private functions ---------------------------------------------------- | 694 // Misc private functions ---------------------------------------------------- |
| 711 // Check whether the preferred size has changed. | 695 // Check whether the preferred size has changed. |
| 712 void CheckPreferredSize(); | 696 void CheckPreferredSize(); |
| 713 | 697 |
| 714 // Gets the currently focused element, if any. | 698 // Gets the currently focused element, if any. |
| 715 blink::WebElement GetFocusedElement() const; | 699 blink::WebElement GetFocusedElement() const; |
| 716 | 700 |
| 717 // Called to get the WebPlugin to handle find requests in the document. | |
| 718 // Returns NULL if there is no such WebPlugin. | |
| 719 blink::WebPlugin* GetWebPluginForFind(); | |
| 720 | |
| 721 #if defined(OS_ANDROID) | 701 #if defined(OS_ANDROID) |
| 722 // Launch an Android content intent with the given URL. | 702 // Launch an Android content intent with the given URL. |
| 723 void LaunchAndroidContentIntent(const GURL& intent_url, | 703 void LaunchAndroidContentIntent(const GURL& intent_url, |
| 724 size_t request_id, | 704 size_t request_id, |
| 725 bool is_main_frame); | 705 bool is_main_frame); |
| 726 #endif | 706 #endif |
| 727 | 707 |
| 728 // Sends a reply to the current find operation handling if it was a | |
| 729 // synchronous find request. | |
| 730 void SendFindReply(int request_id, | |
| 731 int match_count, | |
| 732 int ordinal, | |
| 733 const blink::WebRect& selection_rect, | |
| 734 bool final_status_update); | |
| 735 | |
| 736 #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) | 708 #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) |
| 737 void UpdateFontRenderingFromRendererPrefs(); | 709 void UpdateFontRenderingFromRendererPrefs(); |
| 738 #else | 710 #else |
| 739 void UpdateFontRenderingFromRendererPrefs() {} | 711 void UpdateFontRenderingFromRendererPrefs() {} |
| 740 #endif | 712 #endif |
| 741 | 713 |
| 742 // In OOPIF-enabled modes, this tells each RenderFrame with a pending state | 714 // In OOPIF-enabled modes, this tells each RenderFrame with a pending state |
| 743 // update to inform the browser process. | 715 // update to inform the browser process. |
| 744 void SendFrameStateUpdates(); | 716 void SendFrameStateUpdates(); |
| 745 | 717 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 971 // that we can enumerate them to send updates about things like window | 943 // that we can enumerate them to send updates about things like window |
| 972 // location or tab focus and visibily. These are non-owning references. | 944 // location or tab focus and visibily. These are non-owning references. |
| 973 std::set<WebPluginDelegateProxy*> plugin_delegates_; | 945 std::set<WebPluginDelegateProxy*> plugin_delegates_; |
| 974 | 946 |
| 975 #if defined(OS_WIN) | 947 #if defined(OS_WIN) |
| 976 // The ID of the focused NPAPI plugin. | 948 // The ID of the focused NPAPI plugin. |
| 977 int focused_plugin_id_; | 949 int focused_plugin_id_; |
| 978 #endif | 950 #endif |
| 979 | 951 |
| 980 #if defined(ENABLE_PLUGINS) | 952 #if defined(ENABLE_PLUGINS) |
| 981 PepperPluginInstanceImpl* plugin_find_handler_; | |
| 982 | |
| 983 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet; | 953 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet; |
| 984 PepperPluginSet active_pepper_instances_; | 954 PepperPluginSet active_pepper_instances_; |
| 985 | 955 |
| 986 // TODO(jam): these belong on RenderFrame, once the browser knows which frame | 956 // TODO(jam): these belong on RenderFrame, once the browser knows which frame |
| 987 // is focused and sends the IPCs which use these to the correct frame. Until | 957 // is focused and sends the IPCs which use these to the correct frame. Until |
| 988 // then, we must store these on RenderView as that's the one place that knows | 958 // then, we must store these on RenderView as that's the one place that knows |
| 989 // about all the RenderFrames for a page. | 959 // about all the RenderFrames for a page. |
| 990 | 960 |
| 991 // Whether or not the focus is on a PPAPI plugin | 961 // Whether or not the focus is on a PPAPI plugin |
| 992 PepperPluginInstanceImpl* focused_pepper_plugin_; | 962 PepperPluginInstanceImpl* focused_pepper_plugin_; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1047 // use the Observer interface to filter IPC messages and receive frame change | 1017 // use the Observer interface to filter IPC messages and receive frame change |
| 1048 // notifications. | 1018 // notifications. |
| 1049 // --------------------------------------------------------------------------- | 1019 // --------------------------------------------------------------------------- |
| 1050 | 1020 |
| 1051 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1021 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
| 1052 }; | 1022 }; |
| 1053 | 1023 |
| 1054 } // namespace content | 1024 } // namespace content |
| 1055 | 1025 |
| 1056 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1026 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| OLD | NEW |