Chromium Code Reviews| 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_SYNC_IOS_CHROME_PROFILE_SYNC_SERVICE_FACTORY_H_ | 5 #ifndef IOS_CHROME_BROWSER_SYNC_IOS_CHROME_PROFILE_SYNC_SERVICE_FACTORY_H_ |
| 6 #define IOS_CHROME_BROWSER_SYNC_IOS_CHROME_PROFILE_SYNC_SERVICE_FACTORY_H_ | 6 #define IOS_CHROME_BROWSER_SYNC_IOS_CHROME_PROFILE_SYNC_SERVICE_FACTORY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" | 11 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 template <typename T> | 14 template <typename T> |
| 15 struct DefaultSingletonTraits; | 15 struct DefaultSingletonTraits; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace browser_sync { | |
| 19 class ProfileSyncService; | |
| 20 } // namespace browser_sync | |
| 21 | |
| 18 namespace ios { | 22 namespace ios { |
| 19 class ChromeBrowserState; | 23 class ChromeBrowserState; |
| 20 } | 24 } |
|
skym
2016/09/22 17:26:00
Closing namespaces.
maxbogue
2016/09/22 19:41:15
Done.
| |
| 21 | 25 |
| 22 class ProfileSyncService; | |
| 23 | |
| 24 // Singleton that owns all ProfileSyncService and associates them with | 26 // Singleton that owns all ProfileSyncService and associates them with |
| 25 // ios::ChromeBrowserState. | 27 // ios::ChromeBrowserState. |
| 26 class IOSChromeProfileSyncServiceFactory | 28 class IOSChromeProfileSyncServiceFactory |
| 27 : public BrowserStateKeyedServiceFactory { | 29 : public BrowserStateKeyedServiceFactory { |
| 28 public: | 30 public: |
| 29 static ProfileSyncService* GetForBrowserState( | 31 static browser_sync::ProfileSyncService* GetForBrowserState( |
| 30 ios::ChromeBrowserState* browser_state); | 32 ios::ChromeBrowserState* browser_state); |
| 31 | 33 |
| 32 static ProfileSyncService* GetForBrowserStateIfExists( | 34 static browser_sync::ProfileSyncService* GetForBrowserStateIfExists( |
| 33 ios::ChromeBrowserState* browser_state); | 35 ios::ChromeBrowserState* browser_state); |
| 34 | 36 |
| 35 static IOSChromeProfileSyncServiceFactory* GetInstance(); | 37 static IOSChromeProfileSyncServiceFactory* GetInstance(); |
| 36 | 38 |
| 37 private: | 39 private: |
| 38 friend struct base::DefaultSingletonTraits< | 40 friend struct base::DefaultSingletonTraits< |
| 39 IOSChromeProfileSyncServiceFactory>; | 41 IOSChromeProfileSyncServiceFactory>; |
| 40 | 42 |
| 41 IOSChromeProfileSyncServiceFactory(); | 43 IOSChromeProfileSyncServiceFactory(); |
| 42 ~IOSChromeProfileSyncServiceFactory() override; | 44 ~IOSChromeProfileSyncServiceFactory() override; |
| 43 | 45 |
| 44 // BrowserContextKeyedServiceFactory: | 46 // BrowserContextKeyedServiceFactory: |
| 45 std::unique_ptr<KeyedService> BuildServiceInstanceFor( | 47 std::unique_ptr<KeyedService> BuildServiceInstanceFor( |
| 46 web::BrowserState* context) const override; | 48 web::BrowserState* context) const override; |
| 47 }; | 49 }; |
| 48 | 50 |
| 49 #endif // IOS_CHROME_BROWSER_SYNC_IOS_CHROME_PROFILE_SYNC_SERVICE_FACTORY_H_ | 51 #endif // IOS_CHROME_BROWSER_SYNC_IOS_CHROME_PROFILE_SYNC_SERVICE_FACTORY_H_ |
| OLD | NEW |