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_HOST_CLIENT_SESSION_H_ | 5 #ifndef REMOTING_HOST_CLIENT_SESSION_H_ |
6 #define REMOTING_HOST_CLIENT_SESSION_H_ | 6 #define REMOTING_HOST_CLIENT_SESSION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // per-client state. | 47 // per-client state. |
48 class ClientSession | 48 class ClientSession |
49 : public base::NonThreadSafe, | 49 : public base::NonThreadSafe, |
50 public protocol::HostStub, | 50 public protocol::HostStub, |
51 public protocol::ConnectionToClient::EventHandler, | 51 public protocol::ConnectionToClient::EventHandler, |
52 public ClientSessionControl { | 52 public ClientSessionControl { |
53 public: | 53 public: |
54 // Callback interface for passing events to the ChromotingHost. | 54 // Callback interface for passing events to the ChromotingHost. |
55 class EventHandler { | 55 class EventHandler { |
56 public: | 56 public: |
| 57 // Called after authentication has started. |
| 58 virtual void OnSessionAuthenticating(ClientSession* client) = 0; |
| 59 |
57 // Called after authentication has finished successfully. Returns true if | 60 // Called after authentication has finished successfully. Returns true if |
58 // the connection is allowed, or false otherwise. | 61 // the connection is allowed, or false otherwise. |
59 virtual bool OnSessionAuthenticated(ClientSession* client) = 0; | 62 virtual bool OnSessionAuthenticated(ClientSession* client) = 0; |
60 | 63 |
61 // Called after we've finished connecting all channels. | 64 // Called after we've finished connecting all channels. |
62 virtual void OnSessionChannelsConnected(ClientSession* client) = 0; | 65 virtual void OnSessionChannelsConnected(ClientSession* client) = 0; |
63 | 66 |
64 // Called after authentication has failed. Must not tear down this | 67 // Called after authentication has failed. Must not tear down this |
65 // object. OnSessionClosed() is notified after this handler | 68 // object. OnSessionClosed() is notified after this handler |
66 // returns. | 69 // returns. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 virtual void ControlAudio( | 111 virtual void ControlAudio( |
109 const protocol::AudioControl& audio_control) OVERRIDE; | 112 const protocol::AudioControl& audio_control) OVERRIDE; |
110 virtual void SetCapabilities( | 113 virtual void SetCapabilities( |
111 const protocol::Capabilities& capabilities) OVERRIDE; | 114 const protocol::Capabilities& capabilities) OVERRIDE; |
112 virtual void RequestPairing( | 115 virtual void RequestPairing( |
113 const remoting::protocol::PairingRequest& pairing_request) OVERRIDE; | 116 const remoting::protocol::PairingRequest& pairing_request) OVERRIDE; |
114 virtual void DeliverClientMessage( | 117 virtual void DeliverClientMessage( |
115 const protocol::ExtensionMessage& message) OVERRIDE; | 118 const protocol::ExtensionMessage& message) OVERRIDE; |
116 | 119 |
117 // protocol::ConnectionToClient::EventHandler interface. | 120 // protocol::ConnectionToClient::EventHandler interface. |
| 121 virtual void OnConnectionAuthenticating( |
| 122 protocol::ConnectionToClient* connection) OVERRIDE; |
118 virtual void OnConnectionAuthenticated( | 123 virtual void OnConnectionAuthenticated( |
119 protocol::ConnectionToClient* connection) OVERRIDE; | 124 protocol::ConnectionToClient* connection) OVERRIDE; |
120 virtual void OnConnectionChannelsConnected( | 125 virtual void OnConnectionChannelsConnected( |
121 protocol::ConnectionToClient* connection) OVERRIDE; | 126 protocol::ConnectionToClient* connection) OVERRIDE; |
122 virtual void OnConnectionClosed(protocol::ConnectionToClient* connection, | 127 virtual void OnConnectionClosed(protocol::ConnectionToClient* connection, |
123 protocol::ErrorCode error) OVERRIDE; | 128 protocol::ErrorCode error) OVERRIDE; |
124 virtual void OnSequenceNumberUpdated( | 129 virtual void OnSequenceNumberUpdated( |
125 protocol::ConnectionToClient* connection, int64 sequence_number) OVERRIDE; | 130 protocol::ConnectionToClient* connection, int64 sequence_number) OVERRIDE; |
126 virtual void OnRouteChange( | 131 virtual void OnRouteChange( |
127 protocol::ConnectionToClient* connection, | 132 protocol::ConnectionToClient* connection, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 243 |
239 // Used to proxy gnubby auth traffic. | 244 // Used to proxy gnubby auth traffic. |
240 scoped_ptr<GnubbyAuthHandler> gnubby_auth_handler_; | 245 scoped_ptr<GnubbyAuthHandler> gnubby_auth_handler_; |
241 | 246 |
242 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 247 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
243 }; | 248 }; |
244 | 249 |
245 } // namespace remoting | 250 } // namespace remoting |
246 | 251 |
247 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 252 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
OLD | NEW |