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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 class DeviceOrientationDispatcher; | 61 class DeviceOrientationDispatcher; |
62 class DevToolsAgent; | 62 class DevToolsAgent; |
63 class ExternalPopupMenu; | 63 class ExternalPopupMenu; |
64 class GeolocationDispatcher; | 64 class GeolocationDispatcher; |
65 class GURL; | 65 class GURL; |
66 class JavaBridgeDispatcher; | 66 class JavaBridgeDispatcher; |
67 class LoadProgressTracker; | 67 class LoadProgressTracker; |
68 class MediaStreamDispatcher; | 68 class MediaStreamDispatcher; |
69 class MediaStreamImpl; | 69 class MediaStreamImpl; |
| 70 class MouseLockDispatcher; |
70 class NotificationProvider; | 71 class NotificationProvider; |
71 class PepperDeviceTest; | 72 class PepperDeviceTest; |
72 struct PP_NetAddress_Private; | 73 struct PP_NetAddress_Private; |
73 class RenderWidgetFullscreenPepper; | 74 class RenderWidgetFullscreenPepper; |
74 class RendererAccessibility; | 75 class RendererAccessibility; |
75 class SkBitmap; | 76 class SkBitmap; |
76 class SpeechInputDispatcher; | 77 class SpeechInputDispatcher; |
77 struct ViewMsg_Navigate_Params; | 78 struct ViewMsg_Navigate_Params; |
78 struct ViewMsg_StopFinding_Params; | 79 struct ViewMsg_StopFinding_Params; |
79 struct ViewMsg_SwapOut_Params; | 80 struct ViewMsg_SwapOut_Params; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 207 |
207 MediaStreamDispatcher* media_stream_dispatcher() { | 208 MediaStreamDispatcher* media_stream_dispatcher() { |
208 return media_stream_dispatcher_; | 209 return media_stream_dispatcher_; |
209 } | 210 } |
210 | 211 |
211 // Current P2PSocketDispatcher. Set to NULL if P2P API is disabled. | 212 // Current P2PSocketDispatcher. Set to NULL if P2P API is disabled. |
212 content::P2PSocketDispatcher* p2p_socket_dispatcher() { | 213 content::P2PSocketDispatcher* p2p_socket_dispatcher() { |
213 return p2p_socket_dispatcher_; | 214 return p2p_socket_dispatcher_; |
214 } | 215 } |
215 | 216 |
| 217 MouseLockDispatcher* mouse_lock_dispatcher() { |
| 218 return mouse_lock_dispatcher_; |
| 219 } |
| 220 |
216 WebKit::WebPeerConnectionHandler* CreatePeerConnectionHandler( | 221 WebKit::WebPeerConnectionHandler* CreatePeerConnectionHandler( |
217 WebKit::WebPeerConnectionHandlerClient* client); | 222 WebKit::WebPeerConnectionHandlerClient* client); |
218 | 223 |
219 // Functions to add and remove observers for this object. | 224 // Functions to add and remove observers for this object. |
220 void AddObserver(content::RenderViewObserver* observer); | 225 void AddObserver(content::RenderViewObserver* observer); |
221 void RemoveObserver(content::RenderViewObserver* observer); | 226 void RemoveObserver(content::RenderViewObserver* observer); |
222 | 227 |
223 // Adds the given file chooser request to the file_chooser_completion_ queue | 228 // Adds the given file chooser request to the file_chooser_completion_ queue |
224 // (see that var for more) and requests the chooser be displayed if there are | 229 // (see that var for more) and requests the chooser be displayed if there are |
225 // no other waiting items in the queue. | 230 // no other waiting items in the queue. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 315 |
311 // WebKit::WebWidgetClient implementation ------------------------------------ | 316 // WebKit::WebWidgetClient implementation ------------------------------------ |
312 | 317 |
313 // Most methods are handled by RenderWidget. | 318 // Most methods are handled by RenderWidget. |
314 virtual void didFocus(); | 319 virtual void didFocus(); |
315 virtual void didBlur(); | 320 virtual void didBlur(); |
316 virtual void show(WebKit::WebNavigationPolicy policy); | 321 virtual void show(WebKit::WebNavigationPolicy policy); |
317 virtual void runModal(); | 322 virtual void runModal(); |
318 virtual bool enterFullScreen(); | 323 virtual bool enterFullScreen(); |
319 virtual void exitFullScreen(); | 324 virtual void exitFullScreen(); |
| 325 virtual bool requestPointerLock(); |
| 326 virtual void requestPointerUnlock(); |
| 327 virtual bool isPointerLocked(); |
320 | 328 |
321 // WebKit::WebViewClient implementation -------------------------------------- | 329 // WebKit::WebViewClient implementation -------------------------------------- |
322 | 330 |
323 virtual WebKit::WebView* createView( | 331 virtual WebKit::WebView* createView( |
324 WebKit::WebFrame* creator, | 332 WebKit::WebFrame* creator, |
325 const WebKit::WebURLRequest& request, | 333 const WebKit::WebURLRequest& request, |
326 const WebKit::WebWindowFeatures& features, | 334 const WebKit::WebWindowFeatures& features, |
327 const WebKit::WebString& frame_name); | 335 const WebKit::WebString& frame_name); |
328 virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type); | 336 virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type); |
329 virtual WebKit::WebWidget* createPopupMenu( | 337 virtual WebKit::WebWidget* createPopupMenu( |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 void OnEnumerateDirectoryResponse(int id, const std::vector<FilePath>& paths); | 811 void OnEnumerateDirectoryResponse(int id, const std::vector<FilePath>& paths); |
804 void OnExecuteEditCommand(const std::string& name, const std::string& value); | 812 void OnExecuteEditCommand(const std::string& name, const std::string& value); |
805 void OnFileChooserResponse(const std::vector<FilePath>& paths); | 813 void OnFileChooserResponse(const std::vector<FilePath>& paths); |
806 void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&); | 814 void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&); |
807 void OnFindReplyAck(); | 815 void OnFindReplyAck(); |
808 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); | 816 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); |
809 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( | 817 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( |
810 const std::vector<GURL>& links, | 818 const std::vector<GURL>& links, |
811 const std::vector<FilePath>& local_paths, | 819 const std::vector<FilePath>& local_paths, |
812 const FilePath& local_directory_name); | 820 const FilePath& local_directory_name); |
813 void OnLockMouseACK(bool succeeded); | |
814 void OnMediaPlayerActionAt(const gfx::Point& location, | 821 void OnMediaPlayerActionAt(const gfx::Point& location, |
815 const WebKit::WebMediaPlayerAction& action); | 822 const WebKit::WebMediaPlayerAction& action); |
816 void OnPluginActionAt(const gfx::Point& location, | 823 void OnPluginActionAt(const gfx::Point& location, |
817 const WebKit::WebPluginAction& action); | 824 const WebKit::WebPluginAction& action); |
818 void OnMouseLockLost(); | |
819 void OnMoveOrResizeStarted(); | 825 void OnMoveOrResizeStarted(); |
820 CONTENT_EXPORT void OnNavigate(const ViewMsg_Navigate_Params& params); | 826 CONTENT_EXPORT void OnNavigate(const ViewMsg_Navigate_Params& params); |
821 void OnPaste(); | 827 void OnPaste(); |
822 void OnPasteAndMatchStyle(); | 828 void OnPasteAndMatchStyle(); |
823 #if defined(OS_MACOSX) | 829 #if defined(OS_MACOSX) |
824 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); | 830 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); |
825 #endif | 831 #endif |
826 void OnRedo(); | 832 void OnRedo(); |
827 void OnReloadFrame(); | 833 void OnReloadFrame(); |
828 void OnReplace(const string16& text); | 834 void OnReplace(const string16& text); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 // Dispatches all P2P socket used by the renderer. | 1167 // Dispatches all P2P socket used by the renderer. |
1162 content::P2PSocketDispatcher* p2p_socket_dispatcher_; | 1168 content::P2PSocketDispatcher* p2p_socket_dispatcher_; |
1163 | 1169 |
1164 DevToolsAgent* devtools_agent_; | 1170 DevToolsAgent* devtools_agent_; |
1165 | 1171 |
1166 RendererAccessibility* renderer_accessibility_; | 1172 RendererAccessibility* renderer_accessibility_; |
1167 | 1173 |
1168 // Java Bridge dispatcher attached to this view; lazily initialized. | 1174 // Java Bridge dispatcher attached to this view; lazily initialized. |
1169 scoped_ptr<JavaBridgeDispatcher> java_bridge_dispatcher_; | 1175 scoped_ptr<JavaBridgeDispatcher> java_bridge_dispatcher_; |
1170 | 1176 |
| 1177 // Mouse Lock dispatcher attached to this view. |
| 1178 MouseLockDispatcher* mouse_lock_dispatcher_; |
| 1179 |
1171 // Misc ---------------------------------------------------------------------- | 1180 // Misc ---------------------------------------------------------------------- |
1172 | 1181 |
1173 // The current and pending file chooser completion objects. If the queue is | 1182 // The current and pending file chooser completion objects. If the queue is |
1174 // nonempty, the first item represents the currently running file chooser | 1183 // nonempty, the first item represents the currently running file chooser |
1175 // callback, and the remaining elements are the other file chooser completion | 1184 // callback, and the remaining elements are the other file chooser completion |
1176 // still waiting to be run (in order). | 1185 // still waiting to be run (in order). |
1177 struct PendingFileChooser; | 1186 struct PendingFileChooser; |
1178 std::deque< linked_ptr<PendingFileChooser> > file_chooser_completions_; | 1187 std::deque< linked_ptr<PendingFileChooser> > file_chooser_completions_; |
1179 | 1188 |
1180 // The current directory enumeration callback | 1189 // The current directory enumeration callback |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 scoped_ptr<LoadProgressTracker> load_progress_tracker_; | 1228 scoped_ptr<LoadProgressTracker> load_progress_tracker_; |
1220 | 1229 |
1221 // All the registered observers. We expect this list to be small, so vector | 1230 // All the registered observers. We expect this list to be small, so vector |
1222 // is fine. | 1231 // is fine. |
1223 ObserverList<content::RenderViewObserver> observers_; | 1232 ObserverList<content::RenderViewObserver> observers_; |
1224 | 1233 |
1225 // Used to inform didChangeSelection() when it is called in the context | 1234 // Used to inform didChangeSelection() when it is called in the context |
1226 // of handling a ViewMsg_SelectRange IPC. | 1235 // of handling a ViewMsg_SelectRange IPC. |
1227 bool handling_select_range_; | 1236 bool handling_select_range_; |
1228 | 1237 |
| 1238 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. |
| 1239 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; |
| 1240 |
1229 // Plugins ------------------------------------------------------------------- | 1241 // Plugins ------------------------------------------------------------------- |
1230 | 1242 |
1231 // All the currently active plugin delegates for this RenderView; kept so | 1243 // All the currently active plugin delegates for this RenderView; kept so |
1232 // that we can enumerate them to send updates about things like window | 1244 // that we can enumerate them to send updates about things like window |
1233 // location or tab focus and visibily. These are non-owning references. | 1245 // location or tab focus and visibily. These are non-owning references. |
1234 std::set<WebPluginDelegateProxy*> plugin_delegates_; | 1246 std::set<WebPluginDelegateProxy*> plugin_delegates_; |
1235 | 1247 |
1236 #if defined(OS_WIN) | 1248 #if defined(OS_WIN) |
1237 // The ID of the focused NPAPI plug-in. | 1249 // The ID of the focused NPAPI plug-in. |
1238 int focused_plugin_id_; | 1250 int focused_plugin_id_; |
1239 #endif | 1251 #endif |
1240 | 1252 |
1241 // NOTE: pepper_delegate_ should be last member because its constructor calls | 1253 // NOTE: pepper_delegate_ should be last member because its constructor calls |
1242 // AddObservers method of RenderViewImpl from c-tor. | 1254 // AddObservers method of RenderViewImpl from c-tor. |
1243 PepperPluginDelegateImpl pepper_delegate_; | 1255 PepperPluginDelegateImpl pepper_delegate_; |
1244 | 1256 |
1245 // --------------------------------------------------------------------------- | 1257 // --------------------------------------------------------------------------- |
1246 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 1258 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
1247 // sections rather than throwing it randomly at the end. If you're adding a | 1259 // sections rather than throwing it randomly at the end. If you're adding a |
1248 // bunch of stuff, you should probably create a helper class and put your | 1260 // bunch of stuff, you should probably create a helper class and put your |
1249 // data and methods on that to avoid bloating RenderView more. You can | 1261 // data and methods on that to avoid bloating RenderView more. You can |
1250 // use the Observer interface to filter IPC messages and receive frame change | 1262 // use the Observer interface to filter IPC messages and receive frame change |
1251 // notifications. | 1263 // notifications. |
1252 // --------------------------------------------------------------------------- | 1264 // --------------------------------------------------------------------------- |
1253 | 1265 |
1254 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1266 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1255 }; | 1267 }; |
1256 | 1268 |
1257 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1269 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |