Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: content/renderer/render_view_impl.h

Issue 1980133002: Implement pointer lock API for out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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
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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 blink::WebFrameWidget* frame_widget_; 888 blink::WebFrameWidget* frame_widget_;
898 889
899 // The next group of objects all implement RenderViewObserver, so are deleted 890 // The next group of objects all implement RenderViewObserver, so are deleted
900 // along with the RenderView automatically. This is why we just store 891 // along with the RenderView automatically. This is why we just store
901 // weak references. 892 // weak references.
902 893
903 // The speech recognition dispatcher attached to this view, lazily 894 // The speech recognition dispatcher attached to this view, lazily
904 // initialized. 895 // initialized.
905 SpeechRecognitionDispatcher* speech_recognition_dispatcher_; 896 SpeechRecognitionDispatcher* speech_recognition_dispatcher_;
906 897
907 // Mouse Lock dispatcher attached to this view.
908 MouseLockDispatcher* mouse_lock_dispatcher_;
909
910 std::unique_ptr<HistoryController> history_controller_; 898 std::unique_ptr<HistoryController> history_controller_;
911 899
912 #if defined(OS_ANDROID) 900 #if defined(OS_ANDROID)
913 // Android Specific --------------------------------------------------------- 901 // Android Specific ---------------------------------------------------------
914 902
915 // Expected id of the next content intent launched. Used to prevent scheduled 903 // Expected id of the next content intent launched. Used to prevent scheduled
916 // intents to be launched if aborted. 904 // intents to be launched if aborted.
917 size_t expected_content_intent_id_; 905 size_t expected_content_intent_id_;
918 906
919 // List of click-based content detectors. 907 // List of click-based content detectors.
(...skipping 23 matching lines...) Expand all
943 int64_t session_storage_namespace_id_; 931 int64_t session_storage_namespace_id_;
944 932
945 // Stores edit commands associated to the next key event. 933 // Stores edit commands associated to the next key event.
946 // Shall be cleared as soon as the next key event is processed. 934 // Shall be cleared as soon as the next key event is processed.
947 EditCommands edit_commands_; 935 EditCommands edit_commands_;
948 936
949 // All the registered observers. We expect this list to be small, so vector 937 // All the registered observers. We expect this list to be small, so vector
950 // is fine. 938 // is fine.
951 base::ObserverList<RenderViewObserver> observers_; 939 base::ObserverList<RenderViewObserver> observers_;
952 940
953 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface.
954 std::unique_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_;
955
956 // This field stores drag/drop related info for the event that is currently 941 // This field stores drag/drop related info for the event that is currently
957 // being handled. If the current event results in starting a drag/drop 942 // being handled. If the current event results in starting a drag/drop
958 // session, this info is sent to the browser along with other drag/drop info. 943 // session, this info is sent to the browser along with other drag/drop info.
959 DragEventSourceInfo possible_drag_event_info_; 944 DragEventSourceInfo possible_drag_event_info_;
960 945
961 // NOTE: stats_collection_observer_ should be the last members because their 946 // NOTE: stats_collection_observer_ should be the last members because their
962 // constructors call the AddObservers method of RenderViewImpl. 947 // constructors call the AddObservers method of RenderViewImpl.
963 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; 948 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_;
964 949
965 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; 950 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap;
966 BitmapMap disambiguation_bitmaps_; 951 BitmapMap disambiguation_bitmaps_;
967 952
968 // --------------------------------------------------------------------------- 953 // ---------------------------------------------------------------------------
969 // ADDING NEW DATA? Please see if it fits appropriately in one of the above 954 // ADDING NEW DATA? Please see if it fits appropriately in one of the above
970 // sections rather than throwing it randomly at the end. If you're adding a 955 // sections rather than throwing it randomly at the end. If you're adding a
971 // bunch of stuff, you should probably create a helper class and put your 956 // bunch of stuff, you should probably create a helper class and put your
972 // data and methods on that to avoid bloating RenderView more. You can 957 // data and methods on that to avoid bloating RenderView more. You can
973 // use the Observer interface to filter IPC messages and receive frame change 958 // use the Observer interface to filter IPC messages and receive frame change
974 // notifications. 959 // notifications.
975 // --------------------------------------------------------------------------- 960 // ---------------------------------------------------------------------------
976 961
977 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); 962 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
978 }; 963 };
979 964
980 } // namespace content 965 } // namespace content
981 966
982 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ 967 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698