| 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_CHROMOTING_HOST_H_ | 5 #ifndef REMOTING_HOST_CHROMOTING_HOST_H_ |
| 6 #define REMOTING_HOST_CHROMOTING_HOST_H_ | 6 #define REMOTING_HOST_CHROMOTING_HOST_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // The host uses a pairing registry to generate and store pairing information | 150 // The host uses a pairing registry to generate and store pairing information |
| 151 // for clients for PIN-less authentication. | 151 // for clients for PIN-less authentication. |
| 152 scoped_refptr<protocol::PairingRegistry> pairing_registry() const { | 152 scoped_refptr<protocol::PairingRegistry> pairing_registry() const { |
| 153 return pairing_registry_; | 153 return pairing_registry_; |
| 154 } | 154 } |
| 155 void set_pairing_registry( | 155 void set_pairing_registry( |
| 156 scoped_refptr<protocol::PairingRegistry> pairing_registry) { | 156 scoped_refptr<protocol::PairingRegistry> pairing_registry) { |
| 157 pairing_registry_ = pairing_registry; | 157 pairing_registry_ = pairing_registry; |
| 158 } | 158 } |
| 159 | 159 |
| 160 // Setting enable_cast notifies ChromotingHost that cast mode was enabled |
| 161 // via command line. The ChromotingHost passes this on to the ClientSession on |
| 162 // creation. Enabling cast mode simply means that if requested by the client, |
| 163 // the ClientSession may switch from default video streaming to using WebRTC, |
| 164 // via the CastExtension mechanism. If the ClientSession receives no request, |
| 165 // video streaming carries on normally. This switch is currently allowed |
| 166 // on a per-session basis, i.e., if the client requests cast mode but then |
| 167 // wants to switch back, it must reconnect. |
| 168 void set_enable_cast(bool enable) { |
| 169 enable_cast_ = enable; |
| 170 } |
| 171 |
| 160 base::WeakPtr<ChromotingHost> AsWeakPtr() { | 172 base::WeakPtr<ChromotingHost> AsWeakPtr() { |
| 161 return weak_factory_.GetWeakPtr(); | 173 return weak_factory_.GetWeakPtr(); |
| 162 } | 174 } |
| 163 | 175 |
| 164 private: | 176 private: |
| 165 friend class ChromotingHostTest; | 177 friend class ChromotingHostTest; |
| 166 | 178 |
| 167 typedef std::list<ClientSession*> ClientList; | 179 typedef std::list<ClientSession*> ClientList; |
| 168 typedef ScopedVector<HostExtension> HostExtensionList; | 180 typedef ScopedVector<HostExtension> HostExtensionList; |
| 169 | 181 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 base::TimeDelta max_session_duration_; | 226 base::TimeDelta max_session_duration_; |
| 215 | 227 |
| 216 // The pairing registry for PIN-less authentication. | 228 // The pairing registry for PIN-less authentication. |
| 217 scoped_refptr<protocol::PairingRegistry> pairing_registry_; | 229 scoped_refptr<protocol::PairingRegistry> pairing_registry_; |
| 218 | 230 |
| 219 // List of host extensions. | 231 // List of host extensions. |
| 220 HostExtensionList extensions_; | 232 HostExtensionList extensions_; |
| 221 | 233 |
| 222 base::WeakPtrFactory<ChromotingHost> weak_factory_; | 234 base::WeakPtrFactory<ChromotingHost> weak_factory_; |
| 223 | 235 |
| 236 // True if cast mode is enabled on the host. |
| 237 bool enable_cast_; |
| 238 |
| 224 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); | 239 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); |
| 225 }; | 240 }; |
| 226 | 241 |
| 227 } // namespace remoting | 242 } // namespace remoting |
| 228 | 243 |
| 229 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ | 244 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ |
| OLD | NEW |