| 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 21 matching lines...) Expand all Loading... |
| 32 #include "content/common/frame_message_enums.h" | 32 #include "content/common/frame_message_enums.h" |
| 33 #include "content/common/navigation_gesture.h" | 33 #include "content/common/navigation_gesture.h" |
| 34 #include "content/common/page_message_enums.h" | 34 #include "content/common/page_message_enums.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/top_controls_state.h" | 39 #include "content/public/common/top_controls_state.h" |
| 40 #include "content/public/common/web_preferences.h" | 40 #include "content/public/common/web_preferences.h" |
| 41 #include "content/public/renderer/render_view.h" | 41 #include "content/public/renderer/render_view.h" |
| 42 #include "content/renderer/mouse_lock_dispatcher.h" | |
| 43 #include "content/renderer/render_frame_impl.h" | 42 #include "content/renderer/render_frame_impl.h" |
| 44 #include "content/renderer/render_widget.h" | 43 #include "content/renderer/render_widget.h" |
| 45 #include "content/renderer/render_widget_owner_delegate.h" | 44 #include "content/renderer/render_widget_owner_delegate.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/WebPageVisibilityState.h" | 47 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
| 49 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 48 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 50 #include "third_party/WebKit/public/web/WebAXObject.h" | 49 #include "third_party/WebKit/public/web/WebAXObject.h" |
| 51 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 50 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
| 52 #include "third_party/WebKit/public/web/WebDataSource.h" | 51 #include "third_party/WebKit/public/web/WebDataSource.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 113 |
| 115 #if defined(OS_ANDROID) | 114 #if defined(OS_ANDROID) |
| 116 class WebHitTestResult; | 115 class WebHitTestResult; |
| 117 #endif | 116 #endif |
| 118 } // namespace blink | 117 } // namespace blink |
| 119 | 118 |
| 120 namespace content { | 119 namespace content { |
| 121 | 120 |
| 122 class HistoryController; | 121 class HistoryController; |
| 123 class HistoryEntry; | 122 class HistoryEntry; |
| 124 class MouseLockDispatcher; | |
| 125 class PageState; | 123 class PageState; |
| 126 class RenderViewImplTest; | 124 class RenderViewImplTest; |
| 127 class RenderViewObserver; | 125 class RenderViewObserver; |
| 128 class RenderViewTest; | 126 class RenderViewTest; |
| 129 class RendererDateTimePicker; | 127 class RendererDateTimePicker; |
| 130 class RendererWebColorChooserImpl; | 128 class RendererWebColorChooserImpl; |
| 131 class SpeechRecognitionDispatcher; | 129 class SpeechRecognitionDispatcher; |
| 132 class WebPluginDelegateProxy; | 130 class WebPluginDelegateProxy; |
| 133 struct DropData; | 131 struct DropData; |
| 134 struct FaviconURL; | 132 struct FaviconURL; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 185 } |
| 188 | 186 |
| 189 const RendererPreferences& renderer_preferences() const { | 187 const RendererPreferences& renderer_preferences() const { |
| 190 return renderer_preferences_; | 188 return renderer_preferences_; |
| 191 } | 189 } |
| 192 | 190 |
| 193 void set_send_content_state_immediately(bool value) { | 191 void set_send_content_state_immediately(bool value) { |
| 194 send_content_state_immediately_ = value; | 192 send_content_state_immediately_ = value; |
| 195 } | 193 } |
| 196 | 194 |
| 197 MouseLockDispatcher* mouse_lock_dispatcher() { | |
| 198 return mouse_lock_dispatcher_; | |
| 199 } | |
| 200 | |
| 201 HistoryController* history_controller() { | 195 HistoryController* history_controller() { |
| 202 return history_controller_.get(); | 196 return history_controller_.get(); |
| 203 } | 197 } |
| 204 | 198 |
| 205 // Functions to add and remove observers for this object. | 199 // Functions to add and remove observers for this object. |
| 206 void AddObserver(RenderViewObserver* observer); | 200 void AddObserver(RenderViewObserver* observer); |
| 207 void RemoveObserver(RenderViewObserver* observer); | 201 void RemoveObserver(RenderViewObserver* observer); |
| 208 | 202 |
| 209 // Returns the StatsCollectionObserver associated with this view, or NULL | 203 // Returns the StatsCollectionObserver associated with this view, or NULL |
| 210 // if one wasn't created; | 204 // if one wasn't created; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 280 |
| 287 // IPC::Listener implementation ---------------------------------------------- | 281 // IPC::Listener implementation ---------------------------------------------- |
| 288 | 282 |
| 289 bool OnMessageReceived(const IPC::Message& msg) override; | 283 bool OnMessageReceived(const IPC::Message& msg) override; |
| 290 | 284 |
| 291 // blink::WebWidgetClient implementation ------------------------------------ | 285 // blink::WebWidgetClient implementation ------------------------------------ |
| 292 | 286 |
| 293 // Most methods are handled by RenderWidget. | 287 // Most methods are handled by RenderWidget. |
| 294 void didFocus() override; | 288 void didFocus() override; |
| 295 void show(blink::WebNavigationPolicy policy) override; | 289 void show(blink::WebNavigationPolicy policy) override; |
| 296 bool requestPointerLock() override; | |
| 297 void requestPointerUnlock() override; | |
| 298 bool isPointerLocked() override; | |
| 299 void didHandleGestureEvent(const blink::WebGestureEvent& event, | 290 void didHandleGestureEvent(const blink::WebGestureEvent& event, |
| 300 bool event_cancelled) override; | 291 bool event_cancelled) override; |
| 301 void onMouseDown(const blink::WebNode& mouse_down_node) override; | 292 void onMouseDown(const blink::WebNode& mouse_down_node) override; |
| 302 void initializeLayerTreeView() override; | 293 void initializeLayerTreeView() override; |
| 303 | 294 |
| 304 // TODO(lfg): Remove once WebViewClient no longer inherits from | 295 // TODO(lfg): Remove once WebViewClient no longer inherits from |
| 305 // WebWidgetClient. | 296 // WebWidgetClient. |
| 306 bool allowsBrokenNullLayerTreeView() const override; | 297 bool allowsBrokenNullLayerTreeView() const override; |
| 307 void closeWidgetSoon() override; | 298 void closeWidgetSoon() override; |
| 308 void convertViewportToWindow(blink::WebRect* rect) override; | 299 void convertViewportToWindow(blink::WebRect* rect) override; |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 blink::WebFrameWidget* frame_widget_; | 894 blink::WebFrameWidget* frame_widget_; |
| 904 | 895 |
| 905 // The next group of objects all implement RenderViewObserver, so are deleted | 896 // The next group of objects all implement RenderViewObserver, so are deleted |
| 906 // along with the RenderView automatically. This is why we just store | 897 // along with the RenderView automatically. This is why we just store |
| 907 // weak references. | 898 // weak references. |
| 908 | 899 |
| 909 // The speech recognition dispatcher attached to this view, lazily | 900 // The speech recognition dispatcher attached to this view, lazily |
| 910 // initialized. | 901 // initialized. |
| 911 SpeechRecognitionDispatcher* speech_recognition_dispatcher_; | 902 SpeechRecognitionDispatcher* speech_recognition_dispatcher_; |
| 912 | 903 |
| 913 // Mouse Lock dispatcher attached to this view. | |
| 914 MouseLockDispatcher* mouse_lock_dispatcher_; | |
| 915 | |
| 916 std::unique_ptr<HistoryController> history_controller_; | 904 std::unique_ptr<HistoryController> history_controller_; |
| 917 | 905 |
| 918 #if defined(OS_ANDROID) | 906 #if defined(OS_ANDROID) |
| 919 // Android Specific --------------------------------------------------------- | 907 // Android Specific --------------------------------------------------------- |
| 920 | 908 |
| 921 // Expected id of the next content intent launched. Used to prevent scheduled | 909 // Expected id of the next content intent launched. Used to prevent scheduled |
| 922 // intents to be launched if aborted. | 910 // intents to be launched if aborted. |
| 923 size_t expected_content_intent_id_; | 911 size_t expected_content_intent_id_; |
| 924 | 912 |
| 925 // List of click-based content detectors. | 913 // List of click-based content detectors. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 949 int64_t session_storage_namespace_id_; | 937 int64_t session_storage_namespace_id_; |
| 950 | 938 |
| 951 // Stores edit commands associated to the next key event. | 939 // Stores edit commands associated to the next key event. |
| 952 // Shall be cleared as soon as the next key event is processed. | 940 // Shall be cleared as soon as the next key event is processed. |
| 953 EditCommands edit_commands_; | 941 EditCommands edit_commands_; |
| 954 | 942 |
| 955 // All the registered observers. We expect this list to be small, so vector | 943 // All the registered observers. We expect this list to be small, so vector |
| 956 // is fine. | 944 // is fine. |
| 957 base::ObserverList<RenderViewObserver> observers_; | 945 base::ObserverList<RenderViewObserver> observers_; |
| 958 | 946 |
| 959 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. | |
| 960 std::unique_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; | |
| 961 | |
| 962 // This field stores drag/drop related info for the event that is currently | 947 // This field stores drag/drop related info for the event that is currently |
| 963 // being handled. If the current event results in starting a drag/drop | 948 // being handled. If the current event results in starting a drag/drop |
| 964 // session, this info is sent to the browser along with other drag/drop info. | 949 // session, this info is sent to the browser along with other drag/drop info. |
| 965 DragEventSourceInfo possible_drag_event_info_; | 950 DragEventSourceInfo possible_drag_event_info_; |
| 966 | 951 |
| 967 // NOTE: stats_collection_observer_ should be the last members because their | 952 // NOTE: stats_collection_observer_ should be the last members because their |
| 968 // constructors call the AddObservers method of RenderViewImpl. | 953 // constructors call the AddObservers method of RenderViewImpl. |
| 969 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; | 954 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; |
| 970 | 955 |
| 971 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; | 956 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; |
| 972 BitmapMap disambiguation_bitmaps_; | 957 BitmapMap disambiguation_bitmaps_; |
| 973 | 958 |
| 974 // --------------------------------------------------------------------------- | 959 // --------------------------------------------------------------------------- |
| 975 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 960 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
| 976 // sections rather than throwing it randomly at the end. If you're adding a | 961 // sections rather than throwing it randomly at the end. If you're adding a |
| 977 // bunch of stuff, you should probably create a helper class and put your | 962 // bunch of stuff, you should probably create a helper class and put your |
| 978 // data and methods on that to avoid bloating RenderView more. You can | 963 // data and methods on that to avoid bloating RenderView more. You can |
| 979 // use the Observer interface to filter IPC messages and receive frame change | 964 // use the Observer interface to filter IPC messages and receive frame change |
| 980 // notifications. | 965 // notifications. |
| 981 // --------------------------------------------------------------------------- | 966 // --------------------------------------------------------------------------- |
| 982 | 967 |
| 983 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 968 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
| 984 }; | 969 }; |
| 985 | 970 |
| 986 } // namespace content | 971 } // namespace content |
| 987 | 972 |
| 988 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 973 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| OLD | NEW |