| 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/chromeos/login/oauth1_token_fetcher.h" | 5 #include "chrome/browser/chromeos/login/oauth1_token_fetcher.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/chromeos/cros/cros_library.h" | 8 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 9 #include "chrome/browser/chromeos/cros/network_library.h" | 9 #include "chrome/browser/chromeos/cros/network_library.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/common/net/gaia/google_service_auth_error.h" | |
| 12 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "google_apis/gaia/google_service_auth_error.h" |
| 13 | 13 |
| 14 using content::BrowserThread; | 14 using content::BrowserThread; |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 // OAuth token request max retry count. | 18 // OAuth token request max retry count. |
| 19 const int kMaxOAuth1TokenRequestAttemptCount = 5; | 19 const int kMaxOAuth1TokenRequestAttemptCount = 5; |
| 20 // OAuth token request retry delay in milliseconds. | 20 // OAuth token request retry delay in milliseconds. |
| 21 const int kOAuth1TokenRequestRestartDelay = 3000; | 21 const int kOAuth1TokenRequestRestartDelay = 3000; |
| 22 | 22 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 void OAuth1TokenFetcher::OnOAuthGetAccessTokenFailure( | 103 void OAuth1TokenFetcher::OnOAuthGetAccessTokenFailure( |
| 104 const GoogleServiceAuthError& error) { | 104 const GoogleServiceAuthError& error) { |
| 105 LOG(WARNING) << "Failed fetching OAuth1 access token, error: " | 105 LOG(WARNING) << "Failed fetching OAuth1 access token, error: " |
| 106 << error.state(); | 106 << error.state(); |
| 107 if (!RetryOnError(error)) | 107 if (!RetryOnError(error)) |
| 108 delegate_->OnOAuth1AccessTokenFetchFailed(); | 108 delegate_->OnOAuth1AccessTokenFetchFailed(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace chromeos | 111 } // namespace chromeos |
| OLD | NEW |