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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_FACTORY_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/singleton.h"
10 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
12 namespace sync_driver
{
17 class ProfileSyncService
;
19 class ProfileSyncServiceFactory
: public BrowserContextKeyedServiceFactory
{
21 static ProfileSyncService
* GetForProfile(Profile
* profile
);
22 static bool HasProfileSyncService(Profile
* profile
);
24 // Convenience method that returns the ProfileSyncService as a
25 // sync_driver::SyncService.
26 static sync_driver::SyncService
* GetSyncServiceForBrowserContext(
27 content::BrowserContext
* context
);
29 static ProfileSyncServiceFactory
* GetInstance();
32 friend struct base::DefaultSingletonTraits
<ProfileSyncServiceFactory
>;
34 ProfileSyncServiceFactory();
35 ~ProfileSyncServiceFactory() override
;
37 // BrowserContextKeyedServiceFactory:
38 KeyedService
* BuildServiceInstanceFor(
39 content::BrowserContext
* context
) const override
;
42 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_FACTORY_H_