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/google_api_keys.h" | 9 #include "google_apis/google_api_keys.h" |
10 #include "net/url_request/url_fetcher.h" | 10 #include "net/url_request/url_fetcher.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 SignalingConnector::~SignalingConnector() { | 53 SignalingConnector::~SignalingConnector() { |
54 signal_strategy_->RemoveListener(this); | 54 signal_strategy_->RemoveListener(this); |
55 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); | 55 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
56 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); | 56 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); |
57 } | 57 } |
58 | 58 |
59 void SignalingConnector::EnableOAuth( | 59 void SignalingConnector::EnableOAuth( |
60 scoped_ptr<OAuthCredentials> oauth_credentials) { | 60 scoped_ptr<OAuthCredentials> oauth_credentials) { |
61 oauth_credentials_ = oauth_credentials.Pass(); | 61 oauth_credentials_ = oauth_credentials.Pass(); |
62 gaia_oauth_client_.reset(new gaia::GaiaOAuthClient( | 62 gaia_oauth_client_.reset(new gaia::GaiaOAuthClient( |
63 gaia::kGaiaOAuth2Url, url_request_context_getter_)); | 63 gaia::kGaiaOAuth2Url, url_request_context_getter_.get())); |
64 } | 64 } |
65 | 65 |
66 void SignalingConnector::OnSignalStrategyStateChange( | 66 void SignalingConnector::OnSignalStrategyStateChange( |
67 SignalStrategy::State state) { | 67 SignalStrategy::State state) { |
68 DCHECK(CalledOnValidThread()); | 68 DCHECK(CalledOnValidThread()); |
69 | 69 |
70 if (state == SignalStrategy::CONNECTED) { | 70 if (state == SignalStrategy::CONNECTED) { |
71 LOG(INFO) << "Signaling connected."; | 71 LOG(INFO) << "Signaling connected."; |
72 reconnect_attempts_ = 0; | 72 reconnect_attempts_ = 0; |
73 } else if (state == SignalStrategy::DISCONNECTED) { | 73 } else if (state == SignalStrategy::DISCONNECTED) { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // is not required when getting access tokens. | 232 // is not required when getting access tokens. |
233 "" | 233 "" |
234 }; | 234 }; |
235 | 235 |
236 refreshing_oauth_token_ = true; | 236 refreshing_oauth_token_ = true; |
237 gaia_oauth_client_->RefreshToken( | 237 gaia_oauth_client_->RefreshToken( |
238 client_info, oauth_credentials_->refresh_token, 1, this); | 238 client_info, oauth_credentials_->refresh_token, 1, this); |
239 } | 239 } |
240 | 240 |
241 } // namespace remoting | 241 } // namespace remoting |
OLD | NEW |