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 class Task; | 11 class Task; |
12 | 12 |
13 namespace remoting { | 13 namespace remoting { |
14 namespace protocol { | 14 namespace protocol { |
15 | 15 |
16 class KeyEvent; | 16 class KeyEvent; |
17 class MouseEvent; | 17 class MouseEvent; |
18 | 18 |
19 class InputStub { | 19 class InputStub { |
20 public: | 20 public: |
21 InputStub() {} | 21 InputStub() : enable_(false) {} |
22 virtual ~InputStub() {} | 22 virtual ~InputStub() {} |
dmac
2011/03/04 01:36:27
same deal with other stubs
garykac
2011/03/04 05:33:24
Done.
| |
23 | 23 |
24 virtual void InjectKeyEvent(const KeyEvent* event, Task* done) = 0; | 24 virtual void InjectKeyEvent(const KeyEvent* event, Task* done) = 0; |
25 virtual void InjectMouseEvent(const MouseEvent* event, Task* done) = 0; | 25 virtual void InjectMouseEvent(const MouseEvent* event, Task* done) = 0; |
26 | 26 |
27 // Enable the input channel to allow processing of input events. | |
28 // This should be set to true only after a trusted communication channel has | |
29 // been established. | |
30 void SetEnable(bool enable) { | |
dmac
2011/03/04 01:36:27
same comment about enabled
garykac
2011/03/04 05:33:24
Done.
| |
31 enable_ = enable; | |
32 } | |
33 | |
34 // Is the input channel enabled? | |
35 // I.e., are we processing input events? | |
36 bool Enabled() { | |
37 return enable_; | |
38 } | |
39 | |
27 private: | 40 private: |
41 // Initially false, this controls whether input events should be processed. | |
42 bool enable_; | |
43 | |
28 DISALLOW_COPY_AND_ASSIGN(InputStub); | 44 DISALLOW_COPY_AND_ASSIGN(InputStub); |
29 }; | 45 }; |
30 | 46 |
31 } // namespace protocol | 47 } // namespace protocol |
32 } // namespace remoting | 48 } // namespace remoting |
33 | 49 |
34 #endif // REMOTING_PROTOCOL_INPUT_STUB_H_ | 50 #endif // REMOTING_PROTOCOL_INPUT_STUB_H_ |
OLD | NEW |