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 of a client that receives commands from a Chromoting host. | 5 // Interface of a client that receives commands from a Chromoting host. |
6 // | 6 // |
7 // This interface is responsible for a subset of control messages sent to | 7 // This interface is responsible for a subset of control messages sent to |
8 // the Chromoting client. | 8 // the Chromoting client. |
9 | 9 |
10 #ifndef REMOTING_PROTOCOL_CLIENT_STUB_H_ | 10 #ifndef REMOTING_PROTOCOL_CLIENT_STUB_H_ |
11 #define REMOTING_PROTOCOL_CLIENT_STUB_H_ | 11 #define REMOTING_PROTOCOL_CLIENT_STUB_H_ |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 | 14 |
15 class Task; | 15 class Task; |
16 | 16 |
17 namespace remoting { | 17 namespace remoting { |
18 namespace protocol { | 18 namespace protocol { |
19 | 19 |
20 class LocalLoginStatus; | 20 class LocalLoginStatus; |
21 class NotifyResolutionRequest; | 21 class NotifyResolutionRequest; |
22 | 22 |
23 class ClientStub { | 23 class ClientStub { |
24 public: | 24 public: |
25 ClientStub() {} | 25 ClientStub() : enable_(false) {} |
26 virtual ~ClientStub() {} | 26 virtual ~ClientStub() {} |
dmac
2011/03/04 01:36:27
as this is no longer pure virtual, may have to mov
garykac
2011/03/04 05:33:24
Done.
| |
27 | 27 |
28 virtual void NotifyResolution(const NotifyResolutionRequest* msg, | 28 virtual void NotifyResolution(const NotifyResolutionRequest* msg, |
29 Task* done) = 0; | 29 Task* done) = 0; |
30 virtual void BeginSessionResponse(const LocalLoginStatus* msg, | 30 virtual void BeginSessionResponse(const LocalLoginStatus* msg, |
31 Task* done) = 0; | 31 Task* done) = 0; |
32 | 32 |
33 // Enable the host->client control channel. | |
34 // This should be set to true only after a trusted communication channel has | |
35 // been established. | |
36 // When this is false, only a limited set of control messages will be | |
37 // processed. | |
38 void SetEnable(bool enable) { | |
dmac
2011/03/04 01:36:27
actually the var name should probably be enabled,
garykac
2011/03/04 05:33:24
Done.
| |
39 enable_ = enable; | |
40 } | |
41 | |
42 // Is the control channel enabled? | |
43 // I.e., should we be processing control events? | |
44 bool Enabled() { | |
dmac
2011/03/04 01:36:27
just enabled()
garykac
2011/03/04 05:33:24
SetEnabled() and enabled()?
or would set_enabled(
| |
45 return enable_; | |
46 } | |
47 | |
33 private: | 48 private: |
49 // Initially false, this controls whether the control events received from the | |
50 // host should be processed. | |
51 bool enable_; | |
52 | |
34 DISALLOW_COPY_AND_ASSIGN(ClientStub); | 53 DISALLOW_COPY_AND_ASSIGN(ClientStub); |
35 }; | 54 }; |
36 | 55 |
37 } // namespace protocol | 56 } // namespace protocol |
38 } // namespace remoting | 57 } // namespace remoting |
39 | 58 |
40 #endif // REMOTING_PROTOCOL_CLIENT_STUB_H_ | 59 #endif // REMOTING_PROTOCOL_CLIENT_STUB_H_ |
OLD | NEW |