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

Unified Diff: content/renderer/mouse_lock_dispatcher.cc

Issue 10443045: Silent mouse lock after unlock by target (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update for silent mouse relock Created 8 years, 7 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/renderer/mouse_lock_dispatcher.cc
diff --git a/content/renderer/mouse_lock_dispatcher.cc b/content/renderer/mouse_lock_dispatcher.cc
index 886067cd4d6dcf47893698a3d3271b44676152ab..e78b1d3f464c384d2120f6dbad870df5aff51aa0 100644
--- a/content/renderer/mouse_lock_dispatcher.cc
+++ b/content/renderer/mouse_lock_dispatcher.cc
@@ -16,6 +16,7 @@ MouseLockDispatcher::MouseLockDispatcher(RenderViewImpl* render_view_impl)
mouse_locked_(false),
pending_lock_request_(false),
pending_unlock_request_(false),
+ unlock_source_(content::NOT_TARGET),
target_(NULL) {
}
@@ -34,13 +35,19 @@ bool MouseLockDispatcher::LockMouse(LockTarget* target) {
render_view_impl_->webview()->mainFrame() &&
render_view_impl_->webview()->mainFrame()->isProcessingUserGesture();
- Send(new ViewHostMsg_LockMouse(routing_id(), user_gesture));
+ Send(
+ new ViewHostMsg_LockMouse(routing_id(),
+ user_gesture ? content::USER_GESTURE : content::NOT_USER_GESTURE,
+ unlock_source_));
+ // reset the source
+ unlock_source_ = content::NOT_TARGET;
return true;
}
void MouseLockDispatcher::UnlockMouse(LockTarget* target) {
if (target && target == target_ && !pending_unlock_request_) {
pending_unlock_request_ = true;
+ unlock_source_ = content::TARGET;
Send(new ViewHostMsg_UnlockMouse(routing_id()));
}
}
@@ -120,4 +127,3 @@ void MouseLockDispatcher::OnMouseLockLost() {
if (last_target)
last_target->OnMouseLockLost();
}
-
« content/renderer/mouse_lock_dispatcher.h ('K') | « content/renderer/mouse_lock_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698