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 REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_ | 5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_ |
6 #define REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_ | 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ppapi/cpp/mouse_lock.h" | 10 #include "ppapi/cpp/mouse_lock.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 bool HandleInputEvent(const pp::InputEvent& event); | 37 bool HandleInputEvent(const pp::InputEvent& event); |
38 | 38 |
39 // Enables locking the mouse when the host sets a completely transparent mouse | 39 // Enables locking the mouse when the host sets a completely transparent mouse |
40 // cursor. | 40 // cursor. |
41 void AllowMouseLock(); | 41 void AllowMouseLock(); |
42 | 42 |
43 // Called when the plugin receives or loses focus. | 43 // Called when the plugin receives or loses focus. |
44 void DidChangeFocus(bool has_focus); | 44 void DidChangeFocus(bool has_focus); |
45 | 45 |
46 // Sets the mouse cursor image. Passing NULL image will lock the mouse if | 46 // Sets the mouse cursor image. Passing NULL |image| will cause the cursor to |
47 // mouse lock is enabled. | 47 // be hidden. |
| 48 // Passing NULL |image| will also cause mouse-lock to be entered, if allowed. |
48 void SetMouseCursor(scoped_ptr<pp::ImageData> image, | 49 void SetMouseCursor(scoped_ptr<pp::ImageData> image, |
49 const pp::Point& hotspot); | 50 const pp::Point& hotspot); |
50 | 51 |
| 52 // Hides the mousr cursor without triggering mouse-lock. |
| 53 void HideMouseCursor(); |
| 54 |
51 // Enable or disable sending mouse input when the plugin does not have input | 55 // Enable or disable sending mouse input when the plugin does not have input |
52 // focus. | 56 // focus. |
53 void set_send_mouse_input_when_unfocused(bool send) { | 57 void set_send_mouse_input_when_unfocused(bool send) { |
54 send_mouse_input_when_unfocused_ = send; | 58 send_mouse_input_when_unfocused_ = send; |
55 } | 59 } |
56 | 60 |
57 private: | 61 private: |
58 enum MouseLockState { | 62 enum MouseLockState { |
59 MouseLockDisallowed, | 63 MouseLockDisallowed, |
60 MouseLockOff, | 64 MouseLockOff, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 float wheel_delta_y_; | 111 float wheel_delta_y_; |
108 float wheel_ticks_x_; | 112 float wheel_ticks_x_; |
109 float wheel_ticks_y_; | 113 float wheel_ticks_y_; |
110 | 114 |
111 DISALLOW_COPY_AND_ASSIGN(PepperInputHandler); | 115 DISALLOW_COPY_AND_ASSIGN(PepperInputHandler); |
112 }; | 116 }; |
113 | 117 |
114 } // namespace remoting | 118 } // namespace remoting |
115 | 119 |
116 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_ | 120 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_ |
OLD | NEW |