OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
300 | 300 |
301 // WebKit::WebWidgetClient implementation ------------------------------------ | 301 // WebKit::WebWidgetClient implementation ------------------------------------ |
302 | 302 |
303 // Most methods are handled by RenderWidget. | 303 // Most methods are handled by RenderWidget. |
304 virtual void didFocus(); | 304 virtual void didFocus(); |
305 virtual void didBlur(); | 305 virtual void didBlur(); |
306 virtual void show(WebKit::WebNavigationPolicy policy); | 306 virtual void show(WebKit::WebNavigationPolicy policy); |
307 virtual void runModal(); | 307 virtual void runModal(); |
308 virtual bool enterFullScreen(); | 308 virtual bool enterFullScreen(); |
309 virtual void exitFullScreen(); | 309 virtual void exitFullScreen(); |
310 virtual void lockPointer(); | |
311 virtual void unlockPointer(); | |
312 virtual bool isPointerLocked(); | |
310 | 313 |
311 // WebKit::WebViewClient implementation -------------------------------------- | 314 // WebKit::WebViewClient implementation -------------------------------------- |
312 | 315 |
313 virtual WebKit::WebView* createView( | 316 virtual WebKit::WebView* createView( |
314 WebKit::WebFrame* creator, | 317 WebKit::WebFrame* creator, |
315 const WebKit::WebURLRequest& request, | 318 const WebKit::WebURLRequest& request, |
316 const WebKit::WebWindowFeatures& features, | 319 const WebKit::WebWindowFeatures& features, |
317 const WebKit::WebString& frame_name); | 320 const WebKit::WebString& frame_name); |
318 virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type); | 321 virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type); |
319 virtual WebKit::WebWidget* createPopupMenu( | 322 virtual WebKit::WebWidget* createPopupMenu( |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
790 void OnEnumerateDirectoryResponse(int id, const std::vector<FilePath>& paths); | 793 void OnEnumerateDirectoryResponse(int id, const std::vector<FilePath>& paths); |
791 void OnExecuteEditCommand(const std::string& name, const std::string& value); | 794 void OnExecuteEditCommand(const std::string& name, const std::string& value); |
792 void OnFileChooserResponse(const std::vector<FilePath>& paths); | 795 void OnFileChooserResponse(const std::vector<FilePath>& paths); |
793 void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&); | 796 void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&); |
794 void OnFindReplyAck(); | 797 void OnFindReplyAck(); |
795 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); | 798 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); |
796 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( | 799 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( |
797 const std::vector<GURL>& links, | 800 const std::vector<GURL>& links, |
798 const std::vector<FilePath>& local_paths, | 801 const std::vector<FilePath>& local_paths, |
799 const FilePath& local_directory_name); | 802 const FilePath& local_directory_name); |
800 void OnLockMouseACK(bool succeeded); | |
801 void OnMediaPlayerActionAt(const gfx::Point& location, | 803 void OnMediaPlayerActionAt(const gfx::Point& location, |
802 const WebKit::WebMediaPlayerAction& action); | 804 const WebKit::WebMediaPlayerAction& action); |
805 void OnLockMouseACK(bool succeeded); | |
803 void OnMouseLockLost(); | 806 void OnMouseLockLost(); |
804 void OnMoveOrResizeStarted(); | 807 void OnMoveOrResizeStarted(); |
805 CONTENT_EXPORT void OnNavigate(const ViewMsg_Navigate_Params& params); | 808 CONTENT_EXPORT void OnNavigate(const ViewMsg_Navigate_Params& params); |
806 void OnPaste(); | 809 void OnPaste(); |
807 void OnPasteAndMatchStyle(); | 810 void OnPasteAndMatchStyle(); |
808 #if defined(OS_MACOSX) | 811 #if defined(OS_MACOSX) |
809 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); | 812 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); |
810 #endif | 813 #endif |
811 void OnRedo(); | 814 void OnRedo(); |
812 void OnReloadFrame(); | 815 void OnReloadFrame(); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1225 | 1228 |
1226 // --------------------------------------------------------------------------- | 1229 // --------------------------------------------------------------------------- |
1227 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 1230 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
1228 // sections rather than throwing it randomly at the end. If you're adding a | 1231 // sections rather than throwing it randomly at the end. If you're adding a |
1229 // bunch of stuff, you should probably create a helper class and put your | 1232 // bunch of stuff, you should probably create a helper class and put your |
1230 // data and methods on that to avoid bloating RenderView more. You can | 1233 // data and methods on that to avoid bloating RenderView more. You can |
1231 // use the Observer interface to filter IPC messages and receive frame change | 1234 // use the Observer interface to filter IPC messages and receive frame change |
1232 // notifications. | 1235 // notifications. |
1233 // --------------------------------------------------------------------------- | 1236 // --------------------------------------------------------------------------- |
1234 | 1237 |
1238 // TEMP -- REFACTOR TO A DISPATCHER | |
yzshen1
2012/01/04 00:50:00
We probably cannot check in the code without a nic
| |
1239 public: | |
1240 bool lockPointer(WebKit::WebWidget* webwidget) { return LockMouseInternal(webw idget, NULL); } | |
1241 bool LockMouse(webkit::ppapi::PluginInstance* pinstance) { return LockMouseInt ernal(NULL, pinstance); } | |
1242 void unlockPointer(WebKit::WebWidget* webwidget) { UnlockMouseInternal(webwidg et, NULL); } | |
1243 void UnlockMouse(webkit::ppapi::PluginInstance* pinstance) { UnlockMouseIntern al(NULL, pinstance); } | |
1244 private: | |
1245 bool LockMouseInternal(WebKit::WebWidget* webwidget, webkit::ppapi::PluginInst ance* pinstance); | |
1246 void UnlockMouseInternal(WebKit::WebWidget* webwidget, webkit::ppapi::PluginIn stance* pinstance); | |
1247 bool MouseLockedOrPendingAction() const { | |
1248 return mouse_locked_ || pending_lock_request_ || pending_unlock_request_; | |
1249 } | |
1250 | |
1251 bool mouse_locked_; | |
1252 // If both |pending_lock_request_| and |pending_unlock_request_| are true, | |
1253 // it means a lock request was sent before an unlock request and we haven't | |
1254 // received responses for them. | |
1255 // The logic in LockMouse() makes sure that a lock request won't be sent when | |
1256 // there is a pending unlock request. | |
1257 bool pending_lock_request_; | |
1258 bool pending_unlock_request_; | |
1259 | |
1260 // |mouse_lock_owner_| is not owned by this class. | |
1261 //???????? need to deal with it being deleted? | |
yzshen1
2012/01/04 00:50:00
As far as PPAPI is concerned, we will get a notifi
| |
1262 // |mouse_lock_owner_| being non-NULL doesn't indicate that currently the | |
1263 // mouse has been locked. It is possible that a request to lock the mouse has | |
1264 // been sent, but the response hasn't arrived yet. | |
1265 WebKit::WebWidget* mouse_lock_webwidget_owner_; | |
1266 webkit::ppapi::PluginInstance* mouse_lock_pinstance_owner_; | |
1267 // TEMP -- REFACTOR TO A DISPATCHER | |
1268 | |
1235 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1269 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1236 }; | 1270 }; |
1237 | 1271 |
1238 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1272 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |