| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/chromeos/settings/device_oauth2_token_service_delegate.
h" | 5 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_delegate.
h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 | 108 |
| 109 void DeviceOAuth2TokenServiceDelegate::OnRefreshTokenResponse( | 109 void DeviceOAuth2TokenServiceDelegate::OnRefreshTokenResponse( |
| 110 const std::string& access_token, | 110 const std::string& access_token, |
| 111 int expires_in_seconds) { | 111 int expires_in_seconds) { |
| 112 gaia_oauth_client_->GetTokenInfo(access_token, | 112 gaia_oauth_client_->GetTokenInfo(access_token, |
| 113 max_refresh_token_validation_retries_, this); | 113 max_refresh_token_validation_retries_, this); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void DeviceOAuth2TokenServiceDelegate::OnGetTokenInfoResponse( | 116 void DeviceOAuth2TokenServiceDelegate::OnGetTokenInfoResponse( |
| 117 scoped_ptr<base::DictionaryValue> token_info) { | 117 std::unique_ptr<base::DictionaryValue> token_info) { |
| 118 std::string gaia_robot_id; | 118 std::string gaia_robot_id; |
| 119 token_info->GetString("email", &gaia_robot_id); | 119 token_info->GetString("email", &gaia_robot_id); |
| 120 gaia_oauth_client_.reset(); | 120 gaia_oauth_client_.reset(); |
| 121 | 121 |
| 122 CheckRobotAccountId(gaia_robot_id); | 122 CheckRobotAccountId(gaia_robot_id); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void DeviceOAuth2TokenServiceDelegate::OnOAuthError() { | 125 void DeviceOAuth2TokenServiceDelegate::OnOAuthError() { |
| 126 gaia_oauth_client_.reset(); | 126 gaia_oauth_client_.reset(); |
| 127 state_ = STATE_TOKEN_INVALID; | 127 state_ = STATE_TOKEN_INVALID; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 | 316 |
| 317 void DeviceOAuth2TokenServiceDelegate::ReportServiceError( | 317 void DeviceOAuth2TokenServiceDelegate::ReportServiceError( |
| 318 GoogleServiceAuthError::State error) { | 318 GoogleServiceAuthError::State error) { |
| 319 if (validation_status_delegate_) { | 319 if (validation_status_delegate_) { |
| 320 validation_status_delegate_->OnValidationCompleted(error); | 320 validation_status_delegate_->OnValidationCompleted(error); |
| 321 } | 321 } |
| 322 } | 322 } |
| 323 | 323 |
| 324 } // namespace chromeos | 324 } // namespace chromeos |
| OLD | NEW |