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); |
}; |