| 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 "remoting/host/chromoting_host_context.h" | 9 #include "remoting/host/chromoting_host_context.h" |
| 10 #include "remoting/host/url_request_context.h" | 10 #include "remoting/host/url_request_context.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 SignalingConnector::~SignalingConnector() { | 44 SignalingConnector::~SignalingConnector() { |
| 45 signal_strategy_->RemoveListener(this); | 45 signal_strategy_->RemoveListener(this); |
| 46 net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); | 46 net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); |
| 47 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); | 47 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void SignalingConnector::EnableOAuth( | 50 void SignalingConnector::EnableOAuth( |
| 51 scoped_ptr<OAuthCredentials> oauth_credentials, | 51 scoped_ptr<OAuthCredentials> oauth_credentials, |
| 52 const base::Closure& oauth_failed_callback, | 52 const base::Closure& oauth_failed_callback, |
| 53 URLRequestContextGetter* url_context) { | 53 net::URLRequestContextGetter* url_context) { |
| 54 oauth_credentials_ = oauth_credentials.Pass(); | 54 oauth_credentials_ = oauth_credentials.Pass(); |
| 55 oauth_failed_callback_ = oauth_failed_callback; | 55 oauth_failed_callback_ = oauth_failed_callback; |
| 56 gaia_oauth_client_.reset(new GaiaOAuthClient(kGaiaOAuth2Url, url_context)); | 56 gaia_oauth_client_.reset(new GaiaOAuthClient(kGaiaOAuth2Url, url_context)); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void SignalingConnector::OnSignalStrategyStateChange( | 59 void SignalingConnector::OnSignalStrategyStateChange( |
| 60 SignalStrategy::State state) { | 60 SignalStrategy::State state) { |
| 61 DCHECK(CalledOnValidThread()); | 61 DCHECK(CalledOnValidThread()); |
| 62 | 62 |
| 63 if (state == SignalStrategy::CONNECTED) { | 63 if (state == SignalStrategy::CONNECTED) { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 LOG(INFO) << "Refreshing OAuth token."; | 156 LOG(INFO) << "Refreshing OAuth token."; |
| 157 DCHECK(!refreshing_oauth_token_); | 157 DCHECK(!refreshing_oauth_token_); |
| 158 | 158 |
| 159 refreshing_oauth_token_ = true; | 159 refreshing_oauth_token_ = true; |
| 160 gaia_oauth_client_->RefreshToken( | 160 gaia_oauth_client_->RefreshToken( |
| 161 oauth_credentials_->client_info, | 161 oauth_credentials_->client_info, |
| 162 oauth_credentials_->refresh_token, this); | 162 oauth_credentials_->refresh_token, this); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace remoting | 165 } // namespace remoting |
| OLD | NEW |