| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 REMOTING_CLIENT_PLUGIN_PEPPER_MOUSE_LOCKER_H_ | 5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_MOUSE_LOCKER_H_ |
| 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_MOUSE_LOCKER_H_ | 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_MOUSE_LOCKER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/callback.h" | 10 #include "base/callback.h" |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "ppapi/cpp/mouse_lock.h" | 12 #include "ppapi/cpp/mouse_lock.h" |
| 12 #include "ppapi/utility/completion_callback_factory.h" | 13 #include "ppapi/utility/completion_callback_factory.h" |
| 13 #include "remoting/protocol/cursor_shape_stub.h" | 14 #include "remoting/protocol/cursor_shape_stub.h" |
| 14 | 15 |
| 15 namespace pp { | 16 namespace pp { |
| 16 class Instance; | 17 class Instance; |
| 17 } // namespace pp | 18 } // namespace pp |
| 18 | 19 |
| 19 namespace remoting { | 20 namespace remoting { |
| 20 | 21 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // the lock is gone. | 61 // the lock is gone. |
| 61 void CancelMouseLock(); | 62 void CancelMouseLock(); |
| 62 | 63 |
| 63 // Callback used to enable/disable delta motion fields in mouse events. | 64 // Callback used to enable/disable delta motion fields in mouse events. |
| 64 base::Callback<void(bool)> enable_mouse_deltas_; | 65 base::Callback<void(bool)> enable_mouse_deltas_; |
| 65 | 66 |
| 66 // Stub used to set the cursor that will actually be displayed. | 67 // Stub used to set the cursor that will actually be displayed. |
| 67 protocol::CursorShapeStub* cursor_stub_; | 68 protocol::CursorShapeStub* cursor_stub_; |
| 68 | 69 |
| 69 // Copy of the most-recently-set cursor, to set when mouse-lock is cancelled. | 70 // Copy of the most-recently-set cursor, to set when mouse-lock is cancelled. |
| 70 scoped_ptr<protocol::CursorShapeInfo> cursor_shape_; | 71 std::unique_ptr<protocol::CursorShapeInfo> cursor_shape_; |
| 71 | 72 |
| 72 // Used to create PPAPI callbacks that will be abandoned when |this| is | 73 // Used to create PPAPI callbacks that will be abandoned when |this| is |
| 73 // deleted. | 74 // deleted. |
| 74 pp::CompletionCallbackFactory<PepperMouseLocker> callback_factory_; | 75 pp::CompletionCallbackFactory<PepperMouseLocker> callback_factory_; |
| 75 | 76 |
| 76 // True if the plugin has focus. | 77 // True if the plugin has focus. |
| 77 bool has_focus_; | 78 bool has_focus_; |
| 78 | 79 |
| 79 // Holds the current mouse lock state. | 80 // Holds the current mouse lock state. |
| 80 MouseLockState mouse_lock_state_; | 81 MouseLockState mouse_lock_state_; |
| 81 | 82 |
| 82 DISALLOW_COPY_AND_ASSIGN(PepperMouseLocker); | 83 DISALLOW_COPY_AND_ASSIGN(PepperMouseLocker); |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 } // namespace remoting | 86 } // namespace remoting |
| 86 | 87 |
| 87 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_MOUSE_LOCKER_H_ | 88 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_MOUSE_LOCKER_H_ |
| OLD | NEW |