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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // per-client state. | 46 // per-client state. |
47 class ClientSession | 47 class ClientSession |
48 : public base::NonThreadSafe, | 48 : public base::NonThreadSafe, |
49 public protocol::HostStub, | 49 public protocol::HostStub, |
50 public protocol::ConnectionToClient::EventHandler, | 50 public protocol::ConnectionToClient::EventHandler, |
51 public ClientSessionControl { | 51 public ClientSessionControl { |
52 public: | 52 public: |
53 // Callback interface for passing events to the ChromotingHost. | 53 // Callback interface for passing events to the ChromotingHost. |
54 class EventHandler { | 54 class EventHandler { |
55 public: | 55 public: |
56 // Called after authentication has finished successfully. | 56 // Called after authentication has finished successfully. Returns true if |
57 virtual void OnSessionAuthenticated(ClientSession* client) = 0; | 57 // the connection is allowed, or false otherwise. |
| 58 virtual bool OnSessionAuthenticated(ClientSession* client) = 0; |
58 | 59 |
59 // Called after we've finished connecting all channels. | 60 // Called after we've finished connecting all channels. |
60 virtual void OnSessionChannelsConnected(ClientSession* client) = 0; | 61 virtual void OnSessionChannelsConnected(ClientSession* client) = 0; |
61 | 62 |
62 // Called after authentication has failed. Must not tear down this | 63 // Called after authentication has failed. Must not tear down this |
63 // object. OnSessionClosed() is notified after this handler | 64 // object. OnSessionClosed() is notified after this handler |
64 // returns. | 65 // returns. |
65 virtual void OnSessionAuthenticationFailed(ClientSession* client) = 0; | 66 virtual void OnSessionAuthenticationFailed(ClientSession* client) = 0; |
66 | 67 |
67 // Called after connection has failed or after the client closed it. | 68 // Called after connection has failed or after the client closed it. |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 223 |
223 // Used to apply client-requested changes in screen resolution. | 224 // Used to apply client-requested changes in screen resolution. |
224 scoped_ptr<ScreenControls> screen_controls_; | 225 scoped_ptr<ScreenControls> screen_controls_; |
225 | 226 |
226 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 227 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
227 }; | 228 }; |
228 | 229 |
229 } // namespace remoting | 230 } // namespace remoting |
230 | 231 |
231 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 232 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
OLD | NEW |