| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MOUSE_LOCK_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_MOUSE_LOCK_DISPATCHER_H_ |
| 6 #define CONTENT_RENDERER_MOUSE_LOCK_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_MOUSE_LOCK_DISPATCHER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "content/public/renderer/render_view_observer.h" | 10 #include "content/public/renderer/render_view_observer.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 RenderViewImpl* render_view_impl_; | 69 RenderViewImpl* render_view_impl_; |
| 70 | 70 |
| 71 bool mouse_locked_; | 71 bool mouse_locked_; |
| 72 // If both |pending_lock_request_| and |pending_unlock_request_| are true, | 72 // If both |pending_lock_request_| and |pending_unlock_request_| are true, |
| 73 // it means a lock request was sent before an unlock request and we haven't | 73 // it means a lock request was sent before an unlock request and we haven't |
| 74 // received responses for them. The logic in LockMouse() makes sure that a | 74 // received responses for them. The logic in LockMouse() makes sure that a |
| 75 // lock request won't be sent when there is a pending unlock request. | 75 // lock request won't be sent when there is a pending unlock request. |
| 76 bool pending_lock_request_; | 76 bool pending_lock_request_; |
| 77 bool pending_unlock_request_; | 77 bool pending_unlock_request_; |
| 78 | 78 |
| 79 // Used when locking to indicate when a target application has voluntarily |
| 80 // unlocked and desires to relock the mouse. If the mouse is unlocked due |
| 81 // to ESC being pressed by the user, this will be false |
| 82 bool unlocked_by_target_; |
| 83 |
| 79 // |target_| is the pending or current owner of mouse lock. We retain a non | 84 // |target_| is the pending or current owner of mouse lock. We retain a non |
| 80 // owning reference here that must be cleared by |OnLockTargetDestroyed| | 85 // owning reference here that must be cleared by |OnLockTargetDestroyed| |
| 81 // when it is destroyed. | 86 // when it is destroyed. |
| 82 LockTarget* target_; | 87 LockTarget* target_; |
| 83 | 88 |
| 84 DISALLOW_COPY_AND_ASSIGN(MouseLockDispatcher); | 89 DISALLOW_COPY_AND_ASSIGN(MouseLockDispatcher); |
| 85 }; | 90 }; |
| 86 | 91 |
| 87 #endif // CONTENT_RENDERER_MOUSE_LOCK_DISPATCHER_H_ | 92 #endif // CONTENT_RENDERER_MOUSE_LOCK_DISPATCHER_H_ |
| OLD | NEW |