| 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_TRACKER_SERVICE_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ |
| 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/threading/non_thread_safe.h" | 16 #include "base/sequence_checker.h" |
| 17 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
| 18 #include "components/keyed_service/core/keyed_service.h" | 18 #include "components/keyed_service/core/keyed_service.h" |
| 19 #include "components/signin/core/browser/account_info.h" | 19 #include "components/signin/core/browser/account_info.h" |
| 20 #include "google_apis/gaia/gaia_auth_util.h" | 20 #include "google_apis/gaia/gaia_auth_util.h" |
| 21 | 21 |
| 22 | |
| 23 class PrefService; | 22 class PrefService; |
| 24 class SigninClient; | 23 class SigninClient; |
| 25 | 24 |
| 26 namespace base { | 25 namespace base { |
| 27 class DictionaryValue; | 26 class DictionaryValue; |
| 28 } | 27 } |
| 29 | 28 |
| 30 namespace user_prefs { | 29 namespace user_prefs { |
| 31 class PrefRegistrySyncable; | 30 class PrefRegistrySyncable; |
| 32 } | 31 } |
| 33 | 32 |
| 34 // AccountTrackerService is a KeyedService that retrieves and caches GAIA | 33 // AccountTrackerService is a KeyedService that retrieves and caches GAIA |
| 35 // information about Google Accounts. | 34 // information about Google Accounts. |
| 36 class AccountTrackerService : public KeyedService, | 35 class AccountTrackerService : public KeyedService { |
| 37 public base::NonThreadSafe { | |
| 38 public: | 36 public: |
| 39 // Name of the preference property that persists the account information | 37 // Name of the preference property that persists the account information |
| 40 // tracked by this service. | 38 // tracked by this service. |
| 41 static const char kAccountInfoPref[]; | 39 static const char kAccountInfoPref[]; |
| 42 | 40 |
| 43 // TODO(mlerman): Remove all references to Profile::kNoHostedDomainFound in | 41 // TODO(mlerman): Remove all references to Profile::kNoHostedDomainFound in |
| 44 // favour of this. | 42 // favour of this. |
| 45 // Value representing no hosted domain in the kProfileHostedDomain preference. | 43 // Value representing no hosted domain in the kProfileHostedDomain preference. |
| 46 static const char kNoHostedDomainFound[]; | 44 static const char kNoHostedDomainFound[]; |
| 47 | 45 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 148 |
| 151 // Gaia id migration. | 149 // Gaia id migration. |
| 152 bool IsMigratable() const; | 150 bool IsMigratable() const; |
| 153 void MigrateToGaiaId(); | 151 void MigrateToGaiaId(); |
| 154 void SetMigrationState(AccountIdMigrationState state); | 152 void SetMigrationState(AccountIdMigrationState state); |
| 155 | 153 |
| 156 SigninClient* signin_client_; // Not owned. | 154 SigninClient* signin_client_; // Not owned. |
| 157 std::map<std::string, AccountState> accounts_; | 155 std::map<std::string, AccountState> accounts_; |
| 158 base::ObserverList<Observer> observer_list_; | 156 base::ObserverList<Observer> observer_list_; |
| 159 | 157 |
| 158 SEQUENCE_CHECKER(sequence_checker_); |
| 159 |
| 160 DISALLOW_COPY_AND_ASSIGN(AccountTrackerService); | 160 DISALLOW_COPY_AND_ASSIGN(AccountTrackerService); |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ | 163 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ |
| OLD | NEW |