| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 class WebHitTestResult; | 116 class WebHitTestResult; |
| 117 #endif | 117 #endif |
| 118 } // namespace blink | 118 } // namespace blink |
| 119 | 119 |
| 120 namespace content { | 120 namespace content { |
| 121 | 121 |
| 122 class HistoryController; | 122 class HistoryController; |
| 123 class HistoryEntry; | 123 class HistoryEntry; |
| 124 class MouseLockDispatcher; | 124 class MouseLockDispatcher; |
| 125 class PageState; | 125 class PageState; |
| 126 class PepperPluginInstanceImpl; | |
| 127 class RenderViewImplTest; | 126 class RenderViewImplTest; |
| 128 class RenderViewObserver; | 127 class RenderViewObserver; |
| 129 class RenderViewTest; | 128 class RenderViewTest; |
| 130 class RendererDateTimePicker; | 129 class RendererDateTimePicker; |
| 131 class RendererWebColorChooserImpl; | 130 class RendererWebColorChooserImpl; |
| 132 class SpeechRecognitionDispatcher; | 131 class SpeechRecognitionDispatcher; |
| 133 class WebPluginDelegateProxy; | 132 class WebPluginDelegateProxy; |
| 134 struct DropData; | 133 struct DropData; |
| 135 struct FaviconURL; | 134 struct FaviconURL; |
| 136 struct FileChooserParams; | 135 struct FileChooserParams; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 void FrameDidStopLoading(blink::WebFrame* frame); | 231 void FrameDidStopLoading(blink::WebFrame* frame); |
| 233 | 232 |
| 234 // Sets the zoom level and notifies observers. Doesn't call zoomLevelChanged, | 233 // Sets the zoom level and notifies observers. Doesn't call zoomLevelChanged, |
| 235 // as that is only for changes that aren't initiated by the client. | 234 // as that is only for changes that aren't initiated by the client. |
| 236 void SetZoomLevel(double zoom_level); | 235 void SetZoomLevel(double zoom_level); |
| 237 | 236 |
| 238 double page_zoom_level() { | 237 double page_zoom_level() { |
| 239 return page_zoom_level_; | 238 return page_zoom_level_; |
| 240 } | 239 } |
| 241 | 240 |
| 242 // Indicates whether this page has been focused by the browser. | |
| 243 bool has_focus() const { return has_focus_; } | |
| 244 | |
| 245 // 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 |
| 246 // FocusController. | 242 // FocusController. |
| 247 void SetFocus(bool enable); | 243 void SetFocus(bool enable); |
| 248 | 244 |
| 249 void AttachWebFrameWidget(blink::WebFrameWidget* frame_widget); | 245 void AttachWebFrameWidget(blink::WebFrameWidget* frame_widget); |
| 250 | 246 |
| 251 // Plugin-related functions -------------------------------------------------- | 247 // Plugin-related functions -------------------------------------------------- |
| 252 | 248 |
| 253 #if defined(ENABLE_PLUGINS) | 249 #if defined(ENABLE_PLUGINS) |
| 254 PepperPluginInstanceImpl* focused_pepper_plugin() { | 250 PepperPluginInstanceImpl* GetFocusedPepperPlugin(); |
| 255 return focused_pepper_plugin_; | |
| 256 } | |
| 257 PepperPluginInstanceImpl* pepper_last_mouse_event_target() { | |
| 258 return pepper_last_mouse_event_target_; | |
| 259 } | |
| 260 void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) { | |
| 261 pepper_last_mouse_event_target_ = plugin; | |
| 262 } | |
| 263 | |
| 264 // Indicates that the given instance has been created. | |
| 265 void PepperInstanceCreated(PepperPluginInstanceImpl* instance); | |
| 266 | |
| 267 // Indicates that the given instance is being destroyed. This is called from | |
| 268 // the destructor, so it's important that the instance is not dereferenced | |
| 269 // from this call. | |
| 270 void PepperInstanceDeleted(PepperPluginInstanceImpl* instance); | |
| 271 | |
| 272 // Notification that the given plugin is focused or unfocused. | |
| 273 void PepperFocusChanged(PepperPluginInstanceImpl* instance, bool focused); | |
| 274 #endif // ENABLE_PLUGINS | 251 #endif // ENABLE_PLUGINS |
| 275 | 252 |
| 276 void TransferActiveWheelFlingAnimation( | 253 void TransferActiveWheelFlingAnimation( |
| 277 const blink::WebActiveWheelFlingParameters& params); | 254 const blink::WebActiveWheelFlingParameters& params); |
| 278 | 255 |
| 279 // Starts a timer to send an UpdateState message on behalf of |frame|, if the | 256 // Starts a timer to send an UpdateState message on behalf of |frame|, if the |
| 280 // timer isn't already running. This allows multiple state changing events to | 257 // timer isn't already running. This allows multiple state changing events to |
| 281 // be coalesced into one update. | 258 // be coalesced into one update. |
| 282 void StartNavStateSyncTimerIfNecessary(RenderFrameImpl* frame); | 259 void StartNavStateSyncTimerIfNecessary(RenderFrameImpl* frame); |
| 283 | 260 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 void RenderWidgetDidSetColorProfile( | 573 void RenderWidgetDidSetColorProfile( |
| 597 const std::vector<char>& color_profile) override; | 574 const std::vector<char>& color_profile) override; |
| 598 void RenderWidgetFocusChangeComplete() override; | 575 void RenderWidgetFocusChangeComplete() override; |
| 599 bool DoesRenderWidgetHaveTouchEventHandlersAt( | 576 bool DoesRenderWidgetHaveTouchEventHandlersAt( |
| 600 const gfx::Point& point) const override; | 577 const gfx::Point& point) const override; |
| 601 void RenderWidgetDidHandleKeyEvent() override; | 578 void RenderWidgetDidHandleKeyEvent() override; |
| 602 bool RenderWidgetWillHandleGestureEvent( | 579 bool RenderWidgetWillHandleGestureEvent( |
| 603 const blink::WebGestureEvent& event) override; | 580 const blink::WebGestureEvent& event) override; |
| 604 bool RenderWidgetWillHandleMouseEvent( | 581 bool RenderWidgetWillHandleMouseEvent( |
| 605 const blink::WebMouseEvent& event) override; | 582 const blink::WebMouseEvent& event) override; |
| 606 void RenderWidgetDidCommitAndDrawCompositorFrame() override; | |
| 607 void RenderWidgetDidFlushPaint() override; | 583 void RenderWidgetDidFlushPaint() override; |
| 608 | 584 |
| 609 // Old WebFrameClient implementations ---------------------------------------- | 585 // Old WebFrameClient implementations ---------------------------------------- |
| 610 | 586 |
| 611 // RenderViewImpl used to be a WebFrameClient, but now RenderFrameImpl is the | 587 // RenderViewImpl used to be a WebFrameClient, but now RenderFrameImpl is the |
| 612 // WebFrameClient. However, many implementations of WebFrameClient methods | 588 // WebFrameClient. However, many implementations of WebFrameClient methods |
| 613 // still live here and are called from RenderFrameImpl. These implementations | 589 // still live here and are called from RenderFrameImpl. These implementations |
| 614 // are to be moved to RenderFrameImpl <http://crbug.com/361761>. | 590 // are to be moved to RenderFrameImpl <http://crbug.com/361761>. |
| 615 | 591 |
| 616 void didChangeIcon(blink::WebLocalFrame*, blink::WebIconURL::Type); | 592 void didChangeIcon(blink::WebLocalFrame*, blink::WebIconURL::Type); |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 TopControlsState top_controls_constraints_; | 866 TopControlsState top_controls_constraints_; |
| 891 #endif | 867 #endif |
| 892 | 868 |
| 893 // Whether or not Blink's viewport size should be shrunk by the height of the | 869 // Whether or not Blink's viewport size should be shrunk by the height of the |
| 894 // URL-bar. | 870 // URL-bar. |
| 895 bool top_controls_shrink_blink_size_; | 871 bool top_controls_shrink_blink_size_; |
| 896 | 872 |
| 897 // The height of the top controls. | 873 // The height of the top controls. |
| 898 float top_controls_height_; | 874 float top_controls_height_; |
| 899 | 875 |
| 900 // Indicates whether this page has been focused/unfocused by the browser. | |
| 901 bool has_focus_; | |
| 902 | |
| 903 // View ---------------------------------------------------------------------- | 876 // View ---------------------------------------------------------------------- |
| 904 | 877 |
| 905 blink::WebView* webview_; | 878 blink::WebView* webview_; |
| 906 | 879 |
| 907 // Cache the preferred size of the page in order to prevent sending the IPC | 880 // Cache the preferred size of the page in order to prevent sending the IPC |
| 908 // when layout() recomputes but doesn't actually change sizes. | 881 // when layout() recomputes but doesn't actually change sizes. |
| 909 gfx::Size preferred_size_; | 882 gfx::Size preferred_size_; |
| 910 | 883 |
| 911 // Used to delay determining the preferred size (to avoid intermediate | 884 // Used to delay determining the preferred size (to avoid intermediate |
| 912 // states for the sizes). | 885 // states for the sizes). |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 | 920 |
| 948 // Expected id of the next content intent launched. Used to prevent scheduled | 921 // Expected id of the next content intent launched. Used to prevent scheduled |
| 949 // intents to be launched if aborted. | 922 // intents to be launched if aborted. |
| 950 size_t expected_content_intent_id_; | 923 size_t expected_content_intent_id_; |
| 951 | 924 |
| 952 // List of click-based content detectors. | 925 // List of click-based content detectors. |
| 953 std::vector<std::unique_ptr<ContentDetector>> content_detectors_; | 926 std::vector<std::unique_ptr<ContentDetector>> content_detectors_; |
| 954 | 927 |
| 955 // A date/time picker object for date and time related input elements. | 928 // A date/time picker object for date and time related input elements. |
| 956 std::unique_ptr<RendererDateTimePicker> date_time_picker_client_; | 929 std::unique_ptr<RendererDateTimePicker> date_time_picker_client_; |
| 957 #endif | |
| 958 | 930 |
| 959 // Plugins ------------------------------------------------------------------- | |
| 960 #if defined(ENABLE_PLUGINS) | |
| 961 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet; | |
| 962 PepperPluginSet active_pepper_instances_; | |
| 963 | |
| 964 // TODO(jam): these belong on RenderFrame, once the browser knows which frame | |
| 965 // is focused and sends the IPCs which use these to the correct frame. Until | |
| 966 // then, we must store these on RenderView as that's the one place that knows | |
| 967 // about all the RenderFrames for a page. | |
| 968 | |
| 969 // Whether or not the focus is on a PPAPI plugin | |
| 970 PepperPluginInstanceImpl* focused_pepper_plugin_; | |
| 971 | |
| 972 // The plugin instance that received the last mouse event. It is set to NULL | |
| 973 // if the last mouse event went to elements other than Pepper plugins. | |
| 974 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on | |
| 975 // the RenderFrameImpl to NULL it out when it destructs. | |
| 976 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; | |
| 977 #endif | 931 #endif |
| 978 | 932 |
| 979 // Misc ---------------------------------------------------------------------- | 933 // Misc ---------------------------------------------------------------------- |
| 980 | 934 |
| 981 // The current and pending file chooser completion objects. If the queue is | 935 // The current and pending file chooser completion objects. If the queue is |
| 982 // nonempty, the first item represents the currently running file chooser | 936 // nonempty, the first item represents the currently running file chooser |
| 983 // callback, and the remaining elements are the other file chooser completion | 937 // callback, and the remaining elements are the other file chooser completion |
| 984 // still waiting to be run (in order). | 938 // still waiting to be run (in order). |
| 985 struct PendingFileChooser; | 939 struct PendingFileChooser; |
| 986 std::deque<std::unique_ptr<PendingFileChooser>> file_chooser_completions_; | 940 std::deque<std::unique_ptr<PendingFileChooser>> file_chooser_completions_; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 // use the Observer interface to filter IPC messages and receive frame change | 979 // use the Observer interface to filter IPC messages and receive frame change |
| 1026 // notifications. | 980 // notifications. |
| 1027 // --------------------------------------------------------------------------- | 981 // --------------------------------------------------------------------------- |
| 1028 | 982 |
| 1029 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 983 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
| 1030 }; | 984 }; |
| 1031 | 985 |
| 1032 } // namespace content | 986 } // namespace content |
| 1033 | 987 |
| 1034 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 988 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| OLD | NEW |