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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view.h

Issue 7863003: Mouse lock implementation, including the renderer side and the Windows version of the browser side. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove two tab chars. Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #if defined(OS_MACOSX) 9 #if defined(OS_MACOSX)
10 #include <OpenGL/OpenGL.h> 10 #include <OpenGL/OpenGL.h>
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { 322 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) {
323 } 323 }
324 324
325 gfx::Rect reserved_contents_rect() const { 325 gfx::Rect reserved_contents_rect() const {
326 return reserved_rect_; 326 return reserved_rect_;
327 } 327 }
328 void set_reserved_contents_rect(const gfx::Rect& reserved_rect) { 328 void set_reserved_contents_rect(const gfx::Rect& reserved_rect) {
329 reserved_rect_ = reserved_rect; 329 reserved_rect_ = reserved_rect;
330 } 330 }
331 331
332 virtual bool LockMouse();
brettw 2011/09/14 22:17:58 These should probably be pure virtual and moved ab
yzshen1 2011/09/19 20:48:41 Good idea, thanks! On 2011/09/14 22:17:58, brettw
333 virtual void UnlockMouse();
334
335 bool mouse_locked() const { return mouse_locked_; }
336
332 protected: 337 protected:
333 // Interface class only, do not construct. 338 // Interface class only, do not construct.
334 RenderWidgetHostView() : popup_type_(WebKit::WebPopupTypeNone) {} 339 RenderWidgetHostView() : popup_type_(WebKit::WebPopupTypeNone),
340 mouse_locked_(false) {}
335 341
336 // Whether this view is a popup and what kind of popup it is (select, 342 // Whether this view is a popup and what kind of popup it is (select,
337 // autofill...). 343 // autofill...).
338 WebKit::WebPopupType popup_type_; 344 WebKit::WebPopupType popup_type_;
339 345
340 // A custom background to paint behind the web content. This will be tiled 346 // A custom background to paint behind the web content. This will be tiled
341 // horizontally. Can be null, in which case we fall back to painting white. 347 // horizontally. Can be null, in which case we fall back to painting white.
342 SkBitmap background_; 348 SkBitmap background_;
343 349
344 // The current reserved area in view coordinates where contents should not be 350 // The current reserved area in view coordinates where contents should not be
345 // rendered to draw the resize corner, sidebar mini tabs etc. 351 // rendered to draw the resize corner, sidebar mini tabs etc.
346 gfx::Rect reserved_rect_; 352 gfx::Rect reserved_rect_;
347 353
354 // While the mouse is locked, the cursor is hidden from the user. Mouse events
355 // are still generated. However, the position they report is the last known
356 // mouse position just as mouse lock was entered; the movement they report
357 // indicates what the change in position of the mouse would be had it not been
358 // locked.
359 bool mouse_locked_;
360
348 private: 361 private:
349 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); 362 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView);
350 }; 363 };
351 364
352 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ 365 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698