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

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: merge to tip of tree 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 225c5a6c3329043c3f948bc8f3271723fb7b3195..8d4c61793dea237a74229d09e3ce2a6440cacb8d 100644
--- a/content/renderer/mouse_lock_dispatcher.cc
+++ b/content/renderer/mouse_lock_dispatcher.cc
@@ -32,7 +32,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
+ // 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;
+
SendUnlockMouseRequest();
}
}
« 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