OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_FACTORY_H_ |
6 #define CHROME_BROWSER_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_FACTORY_H_ | 6 #define CHROME_BROWSER_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_FACTORY_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 class BrowserContext; | 12 class BrowserContext; |
13 } // namespace content | 13 } // namespace content |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 template <typename T> struct DefaultSingletonTraits; | 16 template <typename T> struct DefaultSingletonTraits; |
17 } | 17 } |
18 | 18 |
19 class EnhancedBookmarkKeyService; | |
20 | |
21 // Singleton that owns all EnhancedBookmarkKeyServices and associates them with | 19 // Singleton that owns all EnhancedBookmarkKeyServices and associates them with |
22 // BrowserContexts. | 20 // BrowserContexts. |
23 class EnhancedBookmarkKeyServiceFactory | 21 class EnhancedBookmarkKeyServiceFactory |
24 : public BrowserContextKeyedServiceFactory { | 22 : public BrowserContextKeyedServiceFactory { |
25 public: | 23 public: |
26 static EnhancedBookmarkKeyServiceFactory* GetInstance(); | 24 static EnhancedBookmarkKeyServiceFactory* GetInstance(); |
27 | 25 |
28 private: | 26 private: |
29 friend struct base::DefaultSingletonTraits<EnhancedBookmarkKeyServiceFactory>; | 27 friend struct base::DefaultSingletonTraits<EnhancedBookmarkKeyServiceFactory>; |
30 | 28 |
31 EnhancedBookmarkKeyServiceFactory(); | 29 EnhancedBookmarkKeyServiceFactory(); |
32 ~EnhancedBookmarkKeyServiceFactory() override; | 30 ~EnhancedBookmarkKeyServiceFactory() override; |
33 | 31 |
34 // BrowserContextKeyedServiceFactory: | 32 // BrowserContextKeyedServiceFactory: |
35 KeyedService* BuildServiceInstanceFor( | 33 KeyedService* BuildServiceInstanceFor( |
36 content::BrowserContext* context) const override; | 34 content::BrowserContext* context) const override; |
37 content::BrowserContext* GetBrowserContextToUse( | 35 content::BrowserContext* GetBrowserContextToUse( |
38 content::BrowserContext* context) const override; | 36 content::BrowserContext* context) const override; |
39 bool ServiceIsCreatedWithBrowserContext() const override; | 37 bool ServiceIsCreatedWithBrowserContext() const override; |
40 bool ServiceIsNULLWhileTesting() const override; | 38 bool ServiceIsNULLWhileTesting() const override; |
41 | 39 |
42 DISALLOW_COPY_AND_ASSIGN(EnhancedBookmarkKeyServiceFactory); | 40 DISALLOW_COPY_AND_ASSIGN(EnhancedBookmarkKeyServiceFactory); |
43 }; | 41 }; |
44 | 42 |
45 #endif // CHROME_BROWSER_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_FACTORY_H_ | 43 #endif // CHROME_BROWSER_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_FACTORY_H_ |
OLD | NEW |