OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Interface for a device that receives input events. | 5 // Interface for a device that receives input events. |
6 // This interface handles event messages defined in event.proto. | 6 // This interface handles event messages defined in event.proto. |
7 | 7 |
8 #ifndef REMOTING_PROTOCOL_INPUT_STUB_H_ | 8 #ifndef REMOTING_PROTOCOL_INPUT_STUB_H_ |
9 #define REMOTING_PROTOCOL_INPUT_STUB_H_ | 9 #define REMOTING_PROTOCOL_INPUT_STUB_H_ |
10 | 10 |
11 #include "base/basictypes.h" | |
12 | |
11 class Task; | 13 class Task; |
12 | 14 |
13 namespace remoting { | 15 namespace remoting { |
14 namespace protocol { | 16 namespace protocol { |
15 | 17 |
16 class KeyEvent; | 18 class KeyEvent; |
17 class MouseEvent; | 19 class MouseEvent; |
18 | 20 |
19 class InputStub { | 21 class InputStub { |
20 public: | 22 public: |
21 InputStub() {} | 23 InputStub(); |
22 virtual ~InputStub() {} | 24 virtual ~InputStub(); |
23 | 25 |
24 virtual void InjectKeyEvent(const KeyEvent* event, Task* done) = 0; | 26 virtual void InjectKeyEvent(const KeyEvent* event, Task* done) = 0; |
25 virtual void InjectMouseEvent(const MouseEvent* event, Task* done) = 0; | 27 virtual void InjectMouseEvent(const MouseEvent* event, Task* done) = 0; |
26 | 28 |
29 // Enable the input channel to allow processing of input events. | |
30 // This should be set to true only after a trusted communication channel has | |
31 // been established. | |
32 void SetEnabled(bool enabled); | |
33 | |
Wez
2011/03/04 12:09:38
Similar comments to ClientStub. :)
garykac
2011/03/04 20:28:02
Done.
| |
34 // Is the input channel enabled? | |
35 // I.e., are we processing input events? | |
Wez
2011/03/04 12:09:38
As ClientStub.
garykac
2011/03/04 20:28:02
Done.
| |
36 bool enabled(); | |
37 | |
27 private: | 38 private: |
39 // Initially false, this controls whether input events should be processed. | |
40 bool enabled_; | |
41 | |
28 DISALLOW_COPY_AND_ASSIGN(InputStub); | 42 DISALLOW_COPY_AND_ASSIGN(InputStub); |
29 }; | 43 }; |
30 | 44 |
31 } // namespace protocol | 45 } // namespace protocol |
32 } // namespace remoting | 46 } // namespace remoting |
33 | 47 |
34 #endif // REMOTING_PROTOCOL_INPUT_STUB_H_ | 48 #endif // REMOTING_PROTOCOL_INPUT_STUB_H_ |
OLD | NEW |