1 // Copyright 2014 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_CHROME_BOOKMARK_CLIENT_FACTORY_H_
6 #define CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_FACTORY_H_
8 #include "base/macros.h"
9 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
13 struct DefaultSingletonTraits
;
16 class ChromeBookmarkClient
;
19 // Singleton that owns all ChromeBookmarkClients and associates them with
21 class ChromeBookmarkClientFactory
: public BrowserContextKeyedServiceFactory
{
23 static ChromeBookmarkClient
* GetForProfile(Profile
* profile
);
24 static ChromeBookmarkClientFactory
* GetInstance();
25 static TestingFactoryFunction
GetDefaultFactory();
28 friend struct base::DefaultSingletonTraits
<ChromeBookmarkClientFactory
>;
30 ChromeBookmarkClientFactory();
31 ~ChromeBookmarkClientFactory() override
;
33 // BrowserContextKeyedServiceFactory:
34 KeyedService
* BuildServiceInstanceFor(
35 content::BrowserContext
* context
) const override
;
36 content::BrowserContext
* GetBrowserContextToUse(
37 content::BrowserContext
* context
) const override
;
38 bool ServiceIsNULLWhileTesting() const override
;
40 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClientFactory
);
43 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_FACTORY_H_