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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_BOOKMARKS_MANAGED_BOOKMARK_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_BOOKMARKS_MANAGED_BOOKMARK_SERVICE_FACTORY_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
14 struct DefaultSingletonTraits
;
20 class ManagedBookmarkService
;
23 // Singleton that owns all ManagedBookmarkServices and associates them with
25 class ManagedBookmarkServiceFactory
: public BrowserContextKeyedServiceFactory
{
27 static bookmarks::ManagedBookmarkService
* GetForProfile(Profile
* profile
);
28 static ManagedBookmarkServiceFactory
* GetInstance();
29 static TestingFactoryFunction
GetDefaultFactory();
32 friend struct base::DefaultSingletonTraits
<ManagedBookmarkServiceFactory
>;
34 ManagedBookmarkServiceFactory();
35 ~ManagedBookmarkServiceFactory() override
;
37 // BrowserStateKeyedServiceFactory implementation.
38 KeyedService
* BuildServiceInstanceFor(
39 content::BrowserContext
* context
) const override
;
40 content::BrowserContext
* GetBrowserContextToUse(
41 content::BrowserContext
* context
) const override
;
42 bool ServiceIsNULLWhileTesting() const override
;
44 DISALLOW_COPY_AND_ASSIGN(ManagedBookmarkServiceFactory
);
47 #endif // CHROME_BROWSER_BOOKMARKS_MANAGED_BOOKMARK_SERVICE_FACTORY_H_