| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_SERVICE_FLAG_FETCHER_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_SERVICE_FLAG_FETCHER_H_ |
| 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_SERVICE_FLAG_FETCHER_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_SERVICE_FLAG_FETCHER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 public OAuth2TokenService::Observer, | 29 public OAuth2TokenService::Observer, |
| 30 public OAuth2TokenService::Consumer { | 30 public OAuth2TokenService::Consumer { |
| 31 public: | 31 public: |
| 32 enum ResultCode { | 32 enum ResultCode { |
| 33 SUCCESS, | 33 SUCCESS, |
| 34 TOKEN_ERROR, // Failed to get OAuth2 token. | 34 TOKEN_ERROR, // Failed to get OAuth2 token. |
| 35 SERVICE_ERROR, // Service returned an error or malformed reply. | 35 SERVICE_ERROR, // Service returned an error or malformed reply. |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 // If the flag download is successful, this will return the list of service | 38 // If the flag download is successful, this will return the list of service |
| 39 // flags that are set for the given account. | 39 // flags that are set for the given account and the account's hosted |
| 40 // domain. |
| 40 typedef base::Callback<void(ResultCode /* result */, | 41 typedef base::Callback<void(ResultCode /* result */, |
| 41 const std::vector<std::string>& /* flags */)> | 42 const std::vector<std::string>& /* flags */)> |
| 42 ResultCallback; | 43 ResultCallback; |
| 43 | 44 |
| 44 // Immediately starts fetching the flags. | 45 // Immediately starts fetching the flags. |
| 45 AccountServiceFlagFetcher(const std::string& account_id, | 46 AccountServiceFlagFetcher(const std::string& account_id, |
| 46 ProfileOAuth2TokenService* token_service, | 47 ProfileOAuth2TokenService* token_service, |
| 47 net::URLRequestContextGetter* request_context, | 48 net::URLRequestContextGetter* request_context, |
| 48 const ResultCallback& callback); | 49 const ResultCallback& callback); |
| 49 | 50 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 78 GaiaAuthFetcher gaia_auth_fetcher_; | 79 GaiaAuthFetcher gaia_auth_fetcher_; |
| 79 | 80 |
| 80 ResultCallback callback_; | 81 ResultCallback callback_; |
| 81 | 82 |
| 82 scoped_ptr<OAuth2TokenService::Request> oauth2_access_token_request_; | 83 scoped_ptr<OAuth2TokenService::Request> oauth2_access_token_request_; |
| 83 | 84 |
| 84 DISALLOW_COPY_AND_ASSIGN(AccountServiceFlagFetcher); | 85 DISALLOW_COPY_AND_ASSIGN(AccountServiceFlagFetcher); |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_SERVICE_FLAG_FETCHER_H_ | 88 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_SERVICE_FLAG_FETCHER_H_ |
| OLD | NEW |