| 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 "chrome/browser/extensions/api/identity/experimental_identity_api.h" | 5 #include "chrome/browser/extensions/api/identity/experimental_identity_api.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 void ExperimentalIdentityGetAuthTokenFunction::OnMintTokenSuccess( | 152 void ExperimentalIdentityGetAuthTokenFunction::OnMintTokenSuccess( |
| 153 const std::string& access_token, int time_to_live) { | 153 const std::string& access_token, int time_to_live) { |
| 154 CompleteFunctionWithResult(access_token); | 154 CompleteFunctionWithResult(access_token); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void ExperimentalIdentityGetAuthTokenFunction::OnMintTokenFailure( | 157 void ExperimentalIdentityGetAuthTokenFunction::OnMintTokenFailure( |
| 158 const GoogleServiceAuthError& error) { | 158 const GoogleServiceAuthError& error) { |
| 159 switch (error.state()) { | 159 switch (error.state()) { |
| 160 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: | 160 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: |
| 161 case GoogleServiceAuthError::SERVICE_ERROR: |
| 161 case GoogleServiceAuthError::ACCOUNT_DELETED: | 162 case GoogleServiceAuthError::ACCOUNT_DELETED: |
| 162 case GoogleServiceAuthError::ACCOUNT_DISABLED: | 163 case GoogleServiceAuthError::ACCOUNT_DISABLED: |
| 163 extensions::IdentityAPI::GetFactoryInstance() | 164 extensions::IdentityAPI::GetFactoryInstance() |
| 164 ->GetForProfile(GetProfile()) | 165 ->GetForProfile(GetProfile()) |
| 165 ->ReportAuthError(error); | 166 ->ReportAuthError(error); |
| 166 if (should_prompt_for_signin_) { | 167 if (should_prompt_for_signin_) { |
| 167 // Display a login prompt and try again (once). | 168 // Display a login prompt and try again (once). |
| 168 StartSigninFlow(); | 169 StartSigninFlow(); |
| 169 return; | 170 return; |
| 170 } | 171 } |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 } | 392 } |
| 392 } | 393 } |
| 393 | 394 |
| 394 void ExperimentalIdentityLaunchWebAuthFlowFunction:: | 395 void ExperimentalIdentityLaunchWebAuthFlowFunction:: |
| 395 InitFinalRedirectURLPrefixesForTest(const std::string& extension_id) { | 396 InitFinalRedirectURLPrefixesForTest(const std::string& extension_id) { |
| 396 final_prefixes_.clear(); | 397 final_prefixes_.clear(); |
| 397 InitFinalRedirectURLPrefixes(extension_id); | 398 InitFinalRedirectURLPrefixes(extension_id); |
| 398 } | 399 } |
| 399 | 400 |
| 400 } // namespace extensions | 401 } // namespace extensions |
| OLD | NEW |