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

Unified Diff: content/renderer/mouse_lock_dispatcher.cc

Issue 10512011: Only set MouseLockDispatcher unlocked_by_target_ after mouse lock confirmed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/mouse_lock_dispatcher.cc
diff --git a/content/renderer/mouse_lock_dispatcher.cc b/content/renderer/mouse_lock_dispatcher.cc
index dd2326aba77661ac879acc93c799346e23fc8db1..d1d5edbf1860fa2693f557a93ee493ffaddf98ea 100644
--- a/content/renderer/mouse_lock_dispatcher.cc
+++ b/content/renderer/mouse_lock_dispatcher.cc
@@ -44,7 +44,14 @@ bool MouseLockDispatcher::LockMouse(LockTarget* target) {
void MouseLockDispatcher::UnlockMouse(LockTarget* target) {
if (target && target == target_ && !pending_unlock_request_) {
pending_unlock_request_ = true;
- unlocked_by_target_ = true;
+
+ // When a target application voluntarily unlocks the mouse we permit
yzshen1 2012/06/04 21:40:30 [I don't know the exact answer, but would like to
scheib 2012/06/04 23:25:40 I considered this when designing the first patch.
+ // relocking the mouse silently and with no user gesture requirement.
+ // Check that the lock request is not currently pending and not yet
+ // accepted by the browser process before setting |unlocked_by_target_|.
+ if (!pending_lock_request_)
+ unlocked_by_target_ = true;
+
Send(new ViewHostMsg_UnlockMouse(routing_id()));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698