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