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
3 // found in the LICENSE file.
5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_
6 #define REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "remoting/protocol/input_stub.h"
19 } // namespace protocol
21 class PepperInputHandler
{
25 // Sets the input stub to which processed events will be passed.
26 void set_input_stub(protocol::InputStub
* input_stub
) {
27 input_stub_
= input_stub
;
30 // Enable or disable sending mouse input when the plugin does not have input
32 void set_send_mouse_input_when_unfocused(bool send
) {
33 send_mouse_input_when_unfocused_
= send
;
36 void set_send_mouse_move_deltas(bool enable
) {
37 send_mouse_move_deltas_
= enable
;
40 // Processes PPAPI events and dispatches them to |input_stub_|.
41 bool HandleInputEvent(const pp::InputEvent
& event
);
43 // Must be called when the plugin receives or loses focus.
44 void DidChangeFocus(bool has_focus
);
47 // Receives input events generated from PPAPI input.
48 protocol::InputStub
* input_stub_
;
50 // True if the plugin has focus.
53 // True if the plugin should respond to mouse input even if it does not have
55 bool send_mouse_input_when_unfocused_
;
57 // True if the plugin should include mouse move deltas, in addition to
58 // absolute position information, in mouse events.
59 bool send_mouse_move_deltas_
;
61 // Accumulated sub-pixel and sub-tick deltas from wheel events.
67 DISALLOW_COPY_AND_ASSIGN(PepperInputHandler
);
70 } // namespace remoting
72 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_INPUT_HANDLER_H_