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_SIGNALING_CONNECTOR_H_ | 5 #ifndef REMOTING_HOST_SIGNALING_CONNECTOR_H_ |
6 #define REMOTING_HOST_SIGNALING_CONNECTOR_H_ | 6 #define REMOTING_HOST_SIGNALING_CONNECTOR_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/threading/non_thread_safe.h" | 10 #include "base/threading/non_thread_safe.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 public base::NonThreadSafe, | 33 public base::NonThreadSafe, |
34 public SignalStrategy::Listener, | 34 public SignalStrategy::Listener, |
35 public net::NetworkChangeNotifier::ConnectionTypeObserver, | 35 public net::NetworkChangeNotifier::ConnectionTypeObserver, |
36 public net::NetworkChangeNotifier::IPAddressObserver, | 36 public net::NetworkChangeNotifier::IPAddressObserver, |
37 public gaia::GaiaOAuthClient::Delegate { | 37 public gaia::GaiaOAuthClient::Delegate { |
38 public: | 38 public: |
39 // This structure contains information required to perform | 39 // This structure contains information required to perform |
40 // authentication to OAuth2. | 40 // authentication to OAuth2. |
41 struct OAuthCredentials { | 41 struct OAuthCredentials { |
42 OAuthCredentials(const std::string& login_value, | 42 OAuthCredentials(const std::string& login_value, |
43 const std::string& refresh_token_value); | 43 const std::string& refresh_token_value, |
| 44 bool is_service_account); |
44 | 45 |
45 // The user's account name (i.e. their email address). | 46 // The user's account name (i.e. their email address). |
46 std::string login; | 47 std::string login; |
47 | 48 |
48 // Token delegating authority to us to act as the user. | 49 // Token delegating authority to us to act as the user. |
49 std::string refresh_token; | 50 std::string refresh_token; |
| 51 |
| 52 // Whether these credentials belong to a service account. |
| 53 bool is_service_account; |
50 }; | 54 }; |
51 | 55 |
52 // The |auth_failed_callback| is called when authentication fails. | 56 // The |auth_failed_callback| is called when authentication fails. |
53 SignalingConnector( | 57 SignalingConnector( |
54 XmppSignalStrategy* signal_strategy, | 58 XmppSignalStrategy* signal_strategy, |
55 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter, | 59 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter, |
56 scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker, | 60 scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker, |
57 const base::Closure& auth_failed_callback); | 61 const base::Closure& auth_failed_callback); |
58 virtual ~SignalingConnector(); | 62 virtual ~SignalingConnector(); |
59 | 63 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 base::Time auth_token_expiry_time_; | 112 base::Time auth_token_expiry_time_; |
109 | 113 |
110 base::OneShotTimer<SignalingConnector> timer_; | 114 base::OneShotTimer<SignalingConnector> timer_; |
111 | 115 |
112 DISALLOW_COPY_AND_ASSIGN(SignalingConnector); | 116 DISALLOW_COPY_AND_ASSIGN(SignalingConnector); |
113 }; | 117 }; |
114 | 118 |
115 } // namespace remoting | 119 } // namespace remoting |
116 | 120 |
117 #endif // REMOTING_HOST_SIGNALING_CONNECTOR_H_ | 121 #endif // REMOTING_HOST_SIGNALING_CONNECTOR_H_ |
OLD | NEW |