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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view.h
diff --git a/content/browser/renderer_host/render_widget_host_view.h b/content/browser/renderer_host/render_widget_host_view.h
index 3a85148269972308b921184627769a8c7ee2e3aa..79de6838ac5d8b768ac94731cfe1b5224e48126e 100644
--- a/content/browser/renderer_host/render_widget_host_view.h
+++ b/content/browser/renderer_host/render_widget_host_view.h
@@ -329,9 +329,15 @@ class RenderWidgetHostView {
reserved_rect_ = reserved_rect;
}
+ 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
+ virtual void UnlockMouse();
+
+ bool mouse_locked() const { return mouse_locked_; }
+
protected:
// Interface class only, do not construct.
- RenderWidgetHostView() : popup_type_(WebKit::WebPopupTypeNone) {}
+ RenderWidgetHostView() : popup_type_(WebKit::WebPopupTypeNone),
+ mouse_locked_(false) {}
// Whether this view is a popup and what kind of popup it is (select,
// autofill...).
@@ -345,6 +351,13 @@ class RenderWidgetHostView {
// rendered to draw the resize corner, sidebar mini tabs etc.
gfx::Rect reserved_rect_;
+ // While the mouse is locked, the cursor is hidden from the user. Mouse events
+ // are still generated. However, the position they report is the last known
+ // mouse position just as mouse lock was entered; the movement they report
+ // indicates what the change in position of the mouse would be had it not been
+ // locked.
+ bool mouse_locked_;
+
private:
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView);
};

Powered by Google App Engine
This is Rietveld 408576698