| Index: components/signin/core/browser/account_fetcher_service.h
|
| diff --git a/components/signin/core/browser/account_fetcher_service.h b/components/signin/core/browser/account_fetcher_service.h
|
| index a049b8d15ac633a814312eb26f3d9413791bf6b6..c82d8caaca325bb49fff81daf81dfcd83920dfb6 100644
|
| --- a/components/signin/core/browser/account_fetcher_service.h
|
| +++ b/components/signin/core/browser/account_fetcher_service.h
|
| @@ -5,8 +5,6 @@
|
| #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_FETCHER_SERVICE_H_
|
| #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_FETCHER_SERVICE_H_
|
|
|
| -#include <list>
|
| -
|
| #include "base/containers/scoped_ptr_hash_map.h"
|
| #include "base/threading/non_thread_safe.h"
|
| #include "base/timer/timer.h"
|
| @@ -44,16 +42,11 @@ class AccountFetcherService : public KeyedService,
|
|
|
| void Initialize(SigninClient* signin_client,
|
| OAuth2TokenService* token_service,
|
| - AccountTrackerService* account_tracker_service,
|
| - invalidation::InvalidationService* invalidation_service);
|
| + AccountTrackerService* account_tracker_service);
|
|
|
| // KeyedService implementation
|
| void Shutdown() override;
|
|
|
| - // To be called after the Profile is fully initialized; permits network
|
| - // calls to be executed.
|
| - void EnableNetworkFetches();
|
| -
|
| // Indicates if all user information has been fetched. If the result is false,
|
| // there are still unfininshed fetchers.
|
| virtual bool IsAllUserInfoFetched() const;
|
| @@ -64,9 +57,21 @@ class AccountFetcherService : public KeyedService,
|
| return account_tracker_service_;
|
| }
|
|
|
| + void SetupInvalidations(
|
| + invalidation::InvalidationService* invalidation_service);
|
| +
|
| + // base::TestSimpleTaskRunner::RunUntilIdle() does not handle recursive
|
| + // delayed schedule calls. Hence we disable this scheduling in tests.
|
| + void DisableScheduledRefreshForTesting();
|
| +
|
| // Called by ChildAccountInfoFetcher.
|
| void SetIsChildAccount(const std::string& account_id, bool is_child_account);
|
|
|
| + // OAuth2TokenService::Observer implementation.
|
| + void OnRefreshTokenAvailable(const std::string& account_id) override;
|
| + void OnRefreshTokenRevoked(const std::string& account_id) override;
|
| + void OnRefreshTokensLoaded() override;
|
| +
|
| private:
|
| friend class AccountInfoFetcher;
|
| friend class ChildAccountInfoFetcherImpl;
|
| @@ -102,20 +107,16 @@ class AccountFetcherService : public KeyedService,
|
| scoped_ptr<base::DictionaryValue> user_info);
|
| void OnUserInfoFetchFailure(const std::string& account_id);
|
|
|
| - // OAuth2TokenService::Observer implementation.
|
| - void OnRefreshTokenAvailable(const std::string& account_id) override;
|
| - void OnRefreshTokenRevoked(const std::string& account_id) override;
|
| - void OnRefreshTokensLoaded() override;
|
| -
|
| AccountTrackerService* account_tracker_service_; // Not owned.
|
| OAuth2TokenService* token_service_; // Not owned.
|
| SigninClient* signin_client_; // Not owned.
|
| invalidation::InvalidationService* invalidation_service_; // Not owned.
|
| bool network_fetches_enabled_;
|
| - std::list<std::string> pending_user_info_fetches_;
|
| base::Time last_updated_;
|
| base::OneShotTimer timer_;
|
| bool shutdown_called_;
|
| + // Only disabled in tests.
|
| + bool scheduled_refresh_enabled_;
|
|
|
| std::string child_request_account_id_;
|
| scoped_ptr<ChildAccountInfoFetcher> child_info_request_;
|
|
|