Roll src/third_party/WebKit eac3800:0237a66 (svn 202606:202607)
[chromium-blink-merge.git] / chrome / browser / bookmarks / managed_bookmark_service_factory.h
blob3ce2f656a45dfb95437fb712e62a21beede22d6f
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"
12 namespace base {
13 template <typename T>
14 struct DefaultSingletonTraits;
15 } // namespace base
17 class Profile;
19 namespace bookmarks {
20 class ManagedBookmarkService;
23 // Singleton that owns all ManagedBookmarkServices and associates them with
24 // Profile.
25 class ManagedBookmarkServiceFactory : public BrowserContextKeyedServiceFactory {
26 public:
27 static bookmarks::ManagedBookmarkService* GetForProfile(Profile* profile);
28 static ManagedBookmarkServiceFactory* GetInstance();
29 static TestingFactoryFunction GetDefaultFactory();
31 private:
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_