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; | |
113 struct WebMediaPlayerAction; | 111 struct WebMediaPlayerAction; |
114 struct WebPluginAction; | 112 struct WebPluginAction; |
115 struct WebPoint; | 113 struct WebPoint; |
116 struct WebWindowFeatures; | 114 struct WebWindowFeatures; |
117 | 115 |
118 #if defined(OS_ANDROID) | 116 #if defined(OS_ANDROID) |
119 class WebHitTestResult; | 117 class WebHitTestResult; |
120 #endif | 118 #endif |
121 } // namespace blink | 119 } // namespace blink |
122 | 120 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 239 |
242 // Sets page-level focus in this view and notifies plugins and Blink's | 240 // Sets page-level focus in this view and notifies plugins and Blink's |
243 // FocusController. | 241 // FocusController. |
244 void SetFocus(bool enable); | 242 void SetFocus(bool enable); |
245 | 243 |
246 void AttachWebFrameWidget(blink::WebWidget* frame_widget); | 244 void AttachWebFrameWidget(blink::WebWidget* frame_widget); |
247 | 245 |
248 // Plugin-related functions -------------------------------------------------- | 246 // Plugin-related functions -------------------------------------------------- |
249 | 247 |
250 #if defined(ENABLE_PLUGINS) | 248 #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() { | 249 PepperPluginInstanceImpl* focused_pepper_plugin() { |
260 return focused_pepper_plugin_; | 250 return focused_pepper_plugin_; |
261 } | 251 } |
262 PepperPluginInstanceImpl* pepper_last_mouse_event_target() { | 252 PepperPluginInstanceImpl* pepper_last_mouse_event_target() { |
263 return pepper_last_mouse_event_target_; | 253 return pepper_last_mouse_event_target_; |
264 } | 254 } |
265 void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) { | 255 void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) { |
266 pepper_last_mouse_event_target_ = plugin; | 256 pepper_last_mouse_event_target_ = plugin; |
267 } | 257 } |
268 | 258 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 ui::TextInputType GetTextInputType() override; | 489 ui::TextInputType GetTextInputType() override; |
500 void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) override; | 490 void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) override; |
501 void GetCompositionCharacterBounds( | 491 void GetCompositionCharacterBounds( |
502 std::vector<gfx::Rect>* character_bounds_in_window) override; | 492 std::vector<gfx::Rect>* character_bounds_in_window) override; |
503 void GetCompositionRange(gfx::Range* range) override; | 493 void GetCompositionRange(gfx::Range* range) override; |
504 bool CanComposeInline() override; | 494 bool CanComposeInline() override; |
505 void DidCommitCompositorFrame() override; | 495 void DidCommitCompositorFrame() override; |
506 void DidCompletePageScaleAnimation() override; | 496 void DidCompletePageScaleAnimation() override; |
507 void OnDeviceScaleFactorChanged() override; | 497 void OnDeviceScaleFactorChanged() override; |
508 | 498 |
509 protected: | |
510 RenderViewImpl(CompositorDependencies* compositor_deps, | 499 RenderViewImpl(CompositorDependencies* compositor_deps, |
511 const ViewMsg_New_Params& params); | 500 const ViewMsg_New_Params& params); |
512 | 501 |
513 void Initialize(const ViewMsg_New_Params& params, | 502 void Initialize(const ViewMsg_New_Params& params, |
514 bool was_created_by_renderer); | 503 bool was_created_by_renderer); |
515 void SetScreenMetricsEmulationParameters( | 504 void SetScreenMetricsEmulationParameters( |
516 bool enabled, | 505 bool enabled, |
517 const blink::WebDeviceEmulationParams& params) override; | 506 const blink::WebDeviceEmulationParams& params) override; |
518 | 507 |
519 // Do not delete directly. This class is reference counted. | 508 // 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, | 638 const gfx::Point& screen_pt, |
650 blink::WebDragOperationsMask operations_allowed, | 639 blink::WebDragOperationsMask operations_allowed, |
651 int key_modifiers); | 640 int key_modifiers); |
652 void OnEnablePreferredSizeChangedMode(); | 641 void OnEnablePreferredSizeChangedMode(); |
653 void OnEnableAutoResize(const gfx::Size& min_size, const gfx::Size& max_size); | 642 void OnEnableAutoResize(const gfx::Size& min_size, const gfx::Size& max_size); |
654 void OnDisableAutoResize(const gfx::Size& new_size); | 643 void OnDisableAutoResize(const gfx::Size& new_size); |
655 void OnEnumerateDirectoryResponse(int id, | 644 void OnEnumerateDirectoryResponse(int id, |
656 const std::vector<base::FilePath>& paths); | 645 const std::vector<base::FilePath>& paths); |
657 void OnFileChooserResponse( | 646 void OnFileChooserResponse( |
658 const std::vector<content::FileChooserFileInfo>& files); | 647 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, | 648 void OnMediaPlayerActionAt(const gfx::Point& location, |
663 const blink::WebMediaPlayerAction& action); | 649 const blink::WebMediaPlayerAction& action); |
664 void OnPluginActionAt(const gfx::Point& location, | 650 void OnPluginActionAt(const gfx::Point& location, |
665 const blink::WebPluginAction& action); | 651 const blink::WebPluginAction& action); |
666 void OnMoveOrResizeStarted(); | 652 void OnMoveOrResizeStarted(); |
667 void OnReleaseDisambiguationPopupBitmap(const cc::SharedBitmapId& id); | 653 void OnReleaseDisambiguationPopupBitmap(const cc::SharedBitmapId& id); |
668 void OnResetPageEncodingToDefault(); | 654 void OnResetPageEncodingToDefault(); |
669 void OnSetActive(bool active); | 655 void OnSetActive(bool active); |
670 void OnSetBackgroundOpaque(bool opaque); | 656 void OnSetBackgroundOpaque(bool opaque); |
671 void OnExitFullscreen(); | 657 void OnExitFullscreen(); |
672 void OnSetHistoryOffsetAndLength(int history_offset, int history_length); | 658 void OnSetHistoryOffsetAndLength(int history_offset, int history_length); |
673 void OnSetInitialFocus(bool reverse); | 659 void OnSetInitialFocus(bool reverse); |
674 void OnSetPageEncoding(const std::string& encoding_name); | 660 void OnSetPageEncoding(const std::string& encoding_name); |
675 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); | 661 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); |
676 void OnSetWebUIProperty(const std::string& name, const std::string& value); | 662 void OnSetWebUIProperty(const std::string& name, const std::string& value); |
677 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level); | 663 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level); |
678 void OnSetZoomLevelForView(bool uses_temporary_zoom_level, double level); | 664 void OnSetZoomLevelForView(bool uses_temporary_zoom_level, double level); |
679 void OnStopFinding(StopFindAction action); | |
680 void OnSuppressDialogsUntilSwapOut(); | 665 void OnSuppressDialogsUntilSwapOut(); |
681 void OnThemeChanged(); | 666 void OnThemeChanged(); |
682 void OnUpdateTargetURLAck(); | 667 void OnUpdateTargetURLAck(); |
683 void OnUpdateWebPreferences(const WebPreferences& prefs); | 668 void OnUpdateWebPreferences(const WebPreferences& prefs); |
684 void OnSetPageScale(float page_scale_factor); | 669 void OnSetPageScale(float page_scale_factor); |
685 void OnZoom(PageZoom zoom); | 670 void OnZoom(PageZoom zoom); |
686 void OnEnableViewSourceMode(); | 671 void OnEnableViewSourceMode(); |
687 void OnForceRedraw(int request_id); | 672 void OnForceRedraw(int request_id); |
688 void OnSelectWordAroundCaret(); | 673 void OnSelectWordAroundCaret(); |
689 #if defined(OS_ANDROID) | 674 #if defined(OS_ANDROID) |
690 void OnActivateNearestFindResult(int request_id, float x, float y); | |
691 void OnFindMatchRects(int current_version); | |
692 void OnUndoScrollFocusedEditableNodeIntoRect(); | 675 void OnUndoScrollFocusedEditableNodeIntoRect(); |
693 void OnUpdateTopControlsState(bool enable_hiding, | 676 void OnUpdateTopControlsState(bool enable_hiding, |
694 bool enable_showing, | 677 bool enable_showing, |
695 bool animate); | 678 bool animate); |
696 void OnExtractSmartClipData(const gfx::Rect& rect); | 679 void OnExtractSmartClipData(const gfx::Rect& rect); |
697 #elif defined(OS_MACOSX) | 680 #elif defined(OS_MACOSX) |
698 void OnGetRenderedText(); | 681 void OnGetRenderedText(); |
699 void OnPluginImeCompositionCompleted(const base::string16& text, | 682 void OnPluginImeCompositionCompleted(const base::string16& text, |
700 int plugin_id); | 683 int plugin_id); |
701 void OnSetInLiveResize(bool in_live_resize); | 684 void OnSetInLiveResize(bool in_live_resize); |
702 void OnSetWindowVisibility(bool visible); | 685 void OnSetWindowVisibility(bool visible); |
703 void OnWindowFrameChanged(const gfx::Rect& window_frame, | 686 void OnWindowFrameChanged(const gfx::Rect& window_frame, |
704 const gfx::Rect& view_frame); | 687 const gfx::Rect& view_frame); |
705 #endif | 688 #endif |
706 | 689 |
707 // Adding a new message handler? Please add it in alphabetical order above | 690 // Adding a new message handler? Please add it in alphabetical order above |
708 // and put it in the same position in the .cc file. | 691 // and put it in the same position in the .cc file. |
709 | 692 |
710 // Misc private functions ---------------------------------------------------- | 693 // Misc private functions ---------------------------------------------------- |
711 // Check whether the preferred size has changed. | 694 // Check whether the preferred size has changed. |
712 void CheckPreferredSize(); | 695 void CheckPreferredSize(); |
713 | 696 |
714 // Gets the currently focused element, if any. | 697 // Gets the currently focused element, if any. |
715 blink::WebElement GetFocusedElement() const; | 698 blink::WebElement GetFocusedElement() const; |
716 | 699 |
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) | 700 #if defined(OS_ANDROID) |
722 // Launch an Android content intent with the given URL. | 701 // Launch an Android content intent with the given URL. |
723 void LaunchAndroidContentIntent(const GURL& intent_url, | 702 void LaunchAndroidContentIntent(const GURL& intent_url, |
724 size_t request_id, | 703 size_t request_id, |
725 bool is_main_frame); | 704 bool is_main_frame); |
726 #endif | 705 #endif |
727 | 706 |
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)) | 707 #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) |
737 void UpdateFontRenderingFromRendererPrefs(); | 708 void UpdateFontRenderingFromRendererPrefs(); |
738 #else | 709 #else |
739 void UpdateFontRenderingFromRendererPrefs() {} | 710 void UpdateFontRenderingFromRendererPrefs() {} |
740 #endif | 711 #endif |
741 | 712 |
742 // In OOPIF-enabled modes, this tells each RenderFrame with a pending state | 713 // In OOPIF-enabled modes, this tells each RenderFrame with a pending state |
743 // update to inform the browser process. | 714 // update to inform the browser process. |
744 void SendFrameStateUpdates(); | 715 void SendFrameStateUpdates(); |
745 | 716 |
(...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 | 942 // that we can enumerate them to send updates about things like window |
972 // location or tab focus and visibily. These are non-owning references. | 943 // location or tab focus and visibily. These are non-owning references. |
973 std::set<WebPluginDelegateProxy*> plugin_delegates_; | 944 std::set<WebPluginDelegateProxy*> plugin_delegates_; |
974 | 945 |
975 #if defined(OS_WIN) | 946 #if defined(OS_WIN) |
976 // The ID of the focused NPAPI plugin. | 947 // The ID of the focused NPAPI plugin. |
977 int focused_plugin_id_; | 948 int focused_plugin_id_; |
978 #endif | 949 #endif |
979 | 950 |
980 #if defined(ENABLE_PLUGINS) | 951 #if defined(ENABLE_PLUGINS) |
981 PepperPluginInstanceImpl* plugin_find_handler_; | |
982 | |
983 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet; | 952 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet; |
984 PepperPluginSet active_pepper_instances_; | 953 PepperPluginSet active_pepper_instances_; |
985 | 954 |
986 // TODO(jam): these belong on RenderFrame, once the browser knows which frame | 955 // 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 | 956 // 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 | 957 // then, we must store these on RenderView as that's the one place that knows |
989 // about all the RenderFrames for a page. | 958 // about all the RenderFrames for a page. |
990 | 959 |
991 // Whether or not the focus is on a PPAPI plugin | 960 // Whether or not the focus is on a PPAPI plugin |
992 PepperPluginInstanceImpl* focused_pepper_plugin_; | 961 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 | 1016 // use the Observer interface to filter IPC messages and receive frame change |
1048 // notifications. | 1017 // notifications. |
1049 // --------------------------------------------------------------------------- | 1018 // --------------------------------------------------------------------------- |
1050 | 1019 |
1051 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1020 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1052 }; | 1021 }; |
1053 | 1022 |
1054 } // namespace content | 1023 } // namespace content |
1055 | 1024 |
1056 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1025 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |