| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_FACTORY_H_ | 6 #define CHROME_BROWSER_SYNC_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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class ProfileSyncService; | 21 class ProfileSyncService; |
| 22 } // namespace browser_sync | 22 } // namespace browser_sync |
| 23 | 23 |
| 24 namespace syncer { | 24 namespace syncer { |
| 25 class SyncClient; | 25 class SyncClient; |
| 26 class SyncService; | 26 class SyncService; |
| 27 } // namespace syncer | 27 } // namespace syncer |
| 28 | 28 |
| 29 class ProfileSyncServiceFactory : public BrowserContextKeyedServiceFactory { | 29 class ProfileSyncServiceFactory : public BrowserContextKeyedServiceFactory { |
| 30 public: | 30 public: |
| 31 typedef base::Callback<std::unique_ptr<syncer::SyncClient>(Profile*)> | 31 using SyncClientFactory = |
| 32 SyncClientFactory; | 32 base::Callback<std::unique_ptr<syncer::SyncClient>(Profile*)>; |
| 33 | 33 |
| 34 static browser_sync::ProfileSyncService* GetForProfile(Profile* profile); | 34 static browser_sync::ProfileSyncService* GetForProfile(Profile* profile); |
| 35 static bool HasProfileSyncService(Profile* profile); | 35 static bool HasProfileSyncService(Profile* profile); |
| 36 | 36 |
| 37 // Convenience method that returns the ProfileSyncService as a | 37 // Convenience method that returns the ProfileSyncService as a |
| 38 // syncer::SyncService. | 38 // syncer::SyncService. |
| 39 static syncer::SyncService* GetSyncServiceForBrowserContext( | 39 static syncer::SyncService* GetSyncServiceForBrowserContext( |
| 40 content::BrowserContext* context); | 40 content::BrowserContext* context); |
| 41 | 41 |
| 42 static ProfileSyncServiceFactory* GetInstance(); | 42 static ProfileSyncServiceFactory* GetInstance(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 55 content::BrowserContext* context) const override; | 55 content::BrowserContext* context) const override; |
| 56 | 56 |
| 57 // A factory function for overriding the way the SyncClient is created. | 57 // A factory function for overriding the way the SyncClient is created. |
| 58 // This is a raw pointer so it can be statically initialized. | 58 // This is a raw pointer so it can be statically initialized. |
| 59 static SyncClientFactory* client_factory_; | 59 static SyncClientFactory* client_factory_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceFactory); | 61 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceFactory); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_FACTORY_H_ | 64 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_FACTORY_H_ |
| OLD | NEW |