| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 IOS_CHROME_BROWSER_SIGNIN_ACCOUNT_FETCHER_SERVICE_FACTORY_H_ | 5 #ifndef IOS_CHROME_BROWSER_SIGNIN_ACCOUNT_FETCHER_SERVICE_FACTORY_H_ |
| 6 #define IOS_CHROME_BROWSER_SIGNIN_ACCOUNT_FETCHER_SERVICE_FACTORY_H_ | 6 #define IOS_CHROME_BROWSER_SIGNIN_ACCOUNT_FETCHER_SERVICE_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" | 10 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" |
| 11 | 11 |
| 12 class AccountFetcherService; | 12 class AccountFetcherService; |
| 13 |
| 14 namespace base { |
| 13 template <typename T> | 15 template <typename T> |
| 14 struct DefaultSingletonTraits; | 16 struct DefaultSingletonTraits; |
| 17 } // namespace base |
| 15 | 18 |
| 16 namespace ios { | 19 namespace ios { |
| 17 | 20 |
| 18 class ChromeBrowserState; | 21 class ChromeBrowserState; |
| 19 | 22 |
| 20 class AccountFetcherServiceFactory : public BrowserStateKeyedServiceFactory { | 23 class AccountFetcherServiceFactory : public BrowserStateKeyedServiceFactory { |
| 21 public: | 24 public: |
| 22 static AccountFetcherService* GetForBrowserState( | 25 static AccountFetcherService* GetForBrowserState( |
| 23 ios::ChromeBrowserState* browser_state); | 26 ios::ChromeBrowserState* browser_state); |
| 24 static AccountFetcherServiceFactory* GetInstance(); | 27 static AccountFetcherServiceFactory* GetInstance(); |
| 25 | 28 |
| 26 private: | 29 private: |
| 27 friend struct DefaultSingletonTraits<AccountFetcherServiceFactory>; | 30 friend struct base::DefaultSingletonTraits<AccountFetcherServiceFactory>; |
| 28 | 31 |
| 29 AccountFetcherServiceFactory(); | 32 AccountFetcherServiceFactory(); |
| 30 ~AccountFetcherServiceFactory() override; | 33 ~AccountFetcherServiceFactory() override; |
| 31 | 34 |
| 32 // BrowserStateKeyedServiceFactory implementation | 35 // BrowserStateKeyedServiceFactory implementation |
| 33 void RegisterBrowserStatePrefs( | 36 void RegisterBrowserStatePrefs( |
| 34 user_prefs::PrefRegistrySyncable* registry) override; | 37 user_prefs::PrefRegistrySyncable* registry) override; |
| 35 scoped_ptr<KeyedService> BuildServiceInstanceFor( | 38 scoped_ptr<KeyedService> BuildServiceInstanceFor( |
| 36 web::BrowserState* context) const override; | 39 web::BrowserState* context) const override; |
| 37 | 40 |
| 38 DISALLOW_COPY_AND_ASSIGN(AccountFetcherServiceFactory); | 41 DISALLOW_COPY_AND_ASSIGN(AccountFetcherServiceFactory); |
| 39 }; | 42 }; |
| 40 | 43 |
| 41 } // namespace ios | 44 } // namespace ios |
| 42 | 45 |
| 43 #endif // IOS_CHROME_BROWSER_SIGNIN_ACCOUNT_FETCHER_SERVICE_FACTORY_H_ | 46 #endif // IOS_CHROME_BROWSER_SIGNIN_ACCOUNT_FETCHER_SERVICE_FACTORY_H_ |
| OLD | NEW |