OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "remoting/protocol/connection_to_client.h" | 8 #include "remoting/protocol/connection_to_client.h" |
9 #include "remoting/protocol/host_stub.h" | 9 #include "remoting/protocol/host_stub.h" |
10 #include "remoting/protocol/input_stub.h" | 10 #include "remoting/protocol/input_stub.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // Called to signal that local login has succeeded and ChromotingHost can | 27 // Called to signal that local login has succeeded and ChromotingHost can |
28 // proceed with the next step. | 28 // proceed with the next step. |
29 virtual void LocalLoginSucceeded( | 29 virtual void LocalLoginSucceeded( |
30 scoped_refptr<protocol::ConnectionToClient> client) = 0; | 30 scoped_refptr<protocol::ConnectionToClient> client) = 0; |
31 | 31 |
32 // Called to signal that local login has failed. | 32 // Called to signal that local login has failed. |
33 virtual void LocalLoginFailed( | 33 virtual void LocalLoginFailed( |
34 scoped_refptr<protocol::ConnectionToClient> client) = 0; | 34 scoped_refptr<protocol::ConnectionToClient> client) = 0; |
35 }; | 35 }; |
36 | 36 |
37 typedef UserAuthenticator* UserAuthenticatorFactory(); | |
38 | |
39 ClientSession(EventHandler* event_handler, | 37 ClientSession(EventHandler* event_handler, |
40 const base::Callback<UserAuthenticatorFactory>& auth_factory, | 38 UserAuthenticator* user_authenticator, |
41 scoped_refptr<protocol::ConnectionToClient> connection, | 39 scoped_refptr<protocol::ConnectionToClient> connection, |
42 protocol::InputStub* input_stub); | 40 protocol::InputStub* input_stub); |
43 | 41 |
44 // protocol::HostStub interface. | 42 // protocol::HostStub interface. |
45 virtual void SuggestResolution( | 43 virtual void SuggestResolution( |
46 const protocol::SuggestResolutionRequest* msg, Task* done); | 44 const protocol::SuggestResolutionRequest* msg, Task* done); |
47 virtual void BeginSessionRequest( | 45 virtual void BeginSessionRequest( |
48 const protocol::LocalLoginCredentials* credentials, Task* done); | 46 const protocol::LocalLoginCredentials* credentials, Task* done); |
49 | 47 |
50 // protocol::InputStub interface. | 48 // protocol::InputStub interface. |
(...skipping 11 matching lines...) Expand all Loading... |
62 return authenticated_; | 60 return authenticated_; |
63 } | 61 } |
64 | 62 |
65 private: | 63 private: |
66 friend class base::RefCountedThreadSafe<ClientSession>; | 64 friend class base::RefCountedThreadSafe<ClientSession>; |
67 virtual ~ClientSession(); | 65 virtual ~ClientSession(); |
68 | 66 |
69 EventHandler* event_handler_; | 67 EventHandler* event_handler_; |
70 | 68 |
71 // A factory for user authenticators. | 69 // A factory for user authenticators. |
72 base::Callback<UserAuthenticatorFactory> auth_factory_; | 70 scoped_ptr<UserAuthenticator> user_authenticator_; |
73 | 71 |
74 // The connection to the client. | 72 // The connection to the client. |
75 scoped_refptr<protocol::ConnectionToClient> connection_; | 73 scoped_refptr<protocol::ConnectionToClient> connection_; |
76 | 74 |
77 // The input stub to which this object delegates. | 75 // The input stub to which this object delegates. |
78 protocol::InputStub* input_stub_; | 76 protocol::InputStub* input_stub_; |
79 | 77 |
80 // Whether this client is authenticated. | 78 // Whether this client is authenticated. |
81 bool authenticated_; | 79 bool authenticated_; |
82 | 80 |
83 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 81 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
84 }; | 82 }; |
85 | 83 |
86 } // namespace remoting | 84 } // namespace remoting |
87 | 85 |
88 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 86 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
OLD | NEW |