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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "remoting/protocol/input_stub.h" | 9 #include "remoting/protocol/input_stub.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... | |
30 // Enable or disable sending mouse input when the plugin does not have input | 30 // Enable or disable sending mouse input when the plugin does not have input |
31 // focus. | 31 // focus. |
32 void set_send_mouse_input_when_unfocused(bool send) { | 32 void set_send_mouse_input_when_unfocused(bool send) { |
33 send_mouse_input_when_unfocused_ = send; | 33 send_mouse_input_when_unfocused_ = send; |
34 } | 34 } |
35 | 35 |
36 void set_send_mouse_move_deltas(bool enable) { | 36 void set_send_mouse_move_deltas(bool enable) { |
37 send_mouse_move_deltas_ = enable; | 37 send_mouse_move_deltas_ = enable; |
38 } | 38 } |
39 | 39 |
40 void set_send_touch_events(bool send) { | |
Wez
2015/01/21 03:08:37
See comments in ChromotingInstance re this
Rintaro Kuroiwa
2015/01/28 01:12:29
Done.
| |
41 send_touch_events_ = send; | |
42 } | |
43 | |
40 // Processes PPAPI events and dispatches them to |input_stub_|. | 44 // Processes PPAPI events and dispatches them to |input_stub_|. |
41 bool HandleInputEvent(const pp::InputEvent& event); | 45 bool HandleInputEvent(const pp::InputEvent& event); |
42 | 46 |
43 // Must be called when the plugin receives or loses focus. | 47 // Must be called when the plugin receives or loses focus. |
44 void DidChangeFocus(bool has_focus); | 48 void DidChangeFocus(bool has_focus); |
45 | 49 |
46 private: | 50 private: |
47 // Receives input events generated from PPAPI input. | 51 // Receives input events generated from PPAPI input. |
48 protocol::InputStub* input_stub_; | 52 protocol::InputStub* input_stub_; |
49 | 53 |
50 // True if the plugin has focus. | 54 // True if the plugin has focus. |
51 bool has_focus_; | 55 bool has_focus_; |
52 | 56 |
53 // True if the plugin should respond to mouse input even if it does not have | 57 // True if the plugin should respond to mouse input even if it does not have |
54 // keyboard focus. | 58 // keyboard focus. |
55 bool send_mouse_input_when_unfocused_; | 59 bool send_mouse_input_when_unfocused_; |
56 | 60 |
57 // True if the plugin should include mouse move deltas, in addition to | 61 // True if the plugin should include mouse move deltas, in addition to |
58 // absolute position information, in mouse events. | 62 // absolute position information, in mouse events. |
59 bool send_mouse_move_deltas_; | 63 bool send_mouse_move_deltas_; |
60 | 64 |
65 // True if the plugin should handle raw touch events. | |
66 bool send_touch_events_; | |
67 | |
61 // Accumulated sub-pixel and sub-tick deltas from wheel events. | 68 // Accumulated sub-pixel and sub-tick deltas from wheel events. |
62 float wheel_delta_x_; | 69 float wheel_delta_x_; |
63 float wheel_delta_y_; | 70 float wheel_delta_y_; |
64 float wheel_ticks_x_; | 71 float wheel_ticks_x_; |
65 float wheel_ticks_y_; | 72 float wheel_ticks_y_; |
66 | 73 |
67 DISALLOW_COPY_AND_ASSIGN(PepperInputHandler); | 74 DISALLOW_COPY_AND_ASSIGN(PepperInputHandler); |
68 }; | 75 }; |
69 | 76 |
70 } // namespace remoting | 77 } // namespace remoting |
71 | 78 |
72 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_ | 79 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_ |
OLD | NEW |