| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_POLICY_OAUTH2_TOKEN_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_POLICY_OAUTH2_TOKEN_FETCHER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_POLICY_OAUTH2_TOKEN_FETCHER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_POLICY_OAUTH2_TOKEN_FETCHER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 const std::string& oauth2_refresh_token() const { | 58 const std::string& oauth2_refresh_token() const { |
| 59 return oauth2_refresh_token_; | 59 return oauth2_refresh_token_; |
| 60 } | 60 } |
| 61 const std::string& oauth2_access_token() const { | 61 const std::string& oauth2_access_token() const { |
| 62 return oauth2_access_token_; | 62 return oauth2_access_token_; |
| 63 } | 63 } |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 // GaiaAuthConsumer overrides. | 66 // GaiaAuthConsumer overrides. |
| 67 virtual void OnClientOAuthSuccess( | 67 virtual void OnClientOAuthSuccess( |
| 68 const GaiaAuthConsumer::ClientOAuthResult& oauth_tokens) OVERRIDE; | 68 const GaiaAuthConsumer::ClientOAuthResult& oauth_tokens) override; |
| 69 virtual void OnClientOAuthFailure( | 69 virtual void OnClientOAuthFailure( |
| 70 const GoogleServiceAuthError& error) OVERRIDE; | 70 const GoogleServiceAuthError& error) override; |
| 71 | 71 |
| 72 // OAuth2AccessTokenConsumer overrides. | 72 // OAuth2AccessTokenConsumer overrides. |
| 73 virtual void OnGetTokenSuccess(const std::string& access_token, | 73 virtual void OnGetTokenSuccess(const std::string& access_token, |
| 74 const base::Time& expiration_time) OVERRIDE; | 74 const base::Time& expiration_time) override; |
| 75 virtual void OnGetTokenFailure(const GoogleServiceAuthError& error) OVERRIDE; | 75 virtual void OnGetTokenFailure(const GoogleServiceAuthError& error) override; |
| 76 | 76 |
| 77 // Starts fetching OAuth2 refresh token. | 77 // Starts fetching OAuth2 refresh token. |
| 78 void StartFetchingRefreshToken(); | 78 void StartFetchingRefreshToken(); |
| 79 | 79 |
| 80 // Starts fetching OAuth2 access token for the device management service. | 80 // Starts fetching OAuth2 access token for the device management service. |
| 81 void StartFetchingAccessToken(); | 81 void StartFetchingAccessToken(); |
| 82 | 82 |
| 83 // Decides how to proceed on GAIA |error|. If the error looks temporary, | 83 // Decides how to proceed on GAIA |error|. If the error looks temporary, |
| 84 // retries |task| until max retry count is reached. | 84 // retries |task| until max retry count is reached. |
| 85 // If retry count runs out, or error condition is unrecoverable, it calls | 85 // If retry count runs out, or error condition is unrecoverable, it calls |
| (...skipping 25 matching lines...) Expand all Loading... |
| 111 | 111 |
| 112 // The callback to invoke when done. | 112 // The callback to invoke when done. |
| 113 TokenCallback callback_; | 113 TokenCallback callback_; |
| 114 | 114 |
| 115 DISALLOW_COPY_AND_ASSIGN(PolicyOAuth2TokenFetcher); | 115 DISALLOW_COPY_AND_ASSIGN(PolicyOAuth2TokenFetcher); |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 } // namespace policy | 118 } // namespace policy |
| 119 | 119 |
| 120 #endif // CHROME_BROWSER_CHROMEOS_POLICY_POLICY_OAUTH2_TOKEN_FETCHER_H_ | 120 #endif // CHROME_BROWSER_CHROMEOS_POLICY_POLICY_OAUTH2_TOKEN_FETCHER_H_ |
| OLD | NEW |