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 #include "remoting/host/signaling_connector.h" | 5 #include "remoting/host/signaling_connector.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "google_apis/gaia/gaia_urls.h" | 9 #include "google_apis/gaia/gaia_urls.h" |
10 #include "google_apis/google_api_keys.h" | 10 #include "google_apis/google_api_keys.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 signal_strategy_->RemoveListener(this); | 55 signal_strategy_->RemoveListener(this); |
56 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); | 56 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
57 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); | 57 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); |
58 } | 58 } |
59 | 59 |
60 void SignalingConnector::EnableOAuth( | 60 void SignalingConnector::EnableOAuth( |
61 scoped_ptr<OAuthCredentials> oauth_credentials) { | 61 scoped_ptr<OAuthCredentials> oauth_credentials) { |
62 oauth_credentials_ = oauth_credentials.Pass(); | 62 oauth_credentials_ = oauth_credentials.Pass(); |
63 gaia_oauth_client_.reset( | 63 gaia_oauth_client_.reset( |
64 new gaia::GaiaOAuthClient(GaiaUrls::GetInstance()->oauth2_token_url(), | 64 new gaia::GaiaOAuthClient(GaiaUrls::GetInstance()->oauth2_token_url(), |
65 url_request_context_getter_)); | 65 url_request_context_getter_.get())); |
66 } | 66 } |
67 | 67 |
68 void SignalingConnector::OnSignalStrategyStateChange( | 68 void SignalingConnector::OnSignalStrategyStateChange( |
69 SignalStrategy::State state) { | 69 SignalStrategy::State state) { |
70 DCHECK(CalledOnValidThread()); | 70 DCHECK(CalledOnValidThread()); |
71 | 71 |
72 if (state == SignalStrategy::CONNECTED) { | 72 if (state == SignalStrategy::CONNECTED) { |
73 LOG(INFO) << "Signaling connected."; | 73 LOG(INFO) << "Signaling connected."; |
74 reconnect_attempts_ = 0; | 74 reconnect_attempts_ = 0; |
75 } else if (state == SignalStrategy::DISCONNECTED) { | 75 } else if (state == SignalStrategy::DISCONNECTED) { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // is not required when getting access tokens. | 237 // is not required when getting access tokens. |
238 "" | 238 "" |
239 }; | 239 }; |
240 | 240 |
241 refreshing_oauth_token_ = true; | 241 refreshing_oauth_token_ = true; |
242 gaia_oauth_client_->RefreshToken( | 242 gaia_oauth_client_->RefreshToken( |
243 client_info, oauth_credentials_->refresh_token, 1, this); | 243 client_info, oauth_credentials_->refresh_token, 1, this); |
244 } | 244 } |
245 | 245 |
246 } // namespace remoting | 246 } // namespace remoting |
OLD | NEW |