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