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 template <typename T> struct DefaultSingletonTraits; | 16 template <typename T> struct DefaultSingletonTraits; |
| 17 } |
16 | 18 |
17 class EnhancedBookmarkKeyService; | 19 class EnhancedBookmarkKeyService; |
18 | 20 |
19 // Singleton that owns all EnhancedBookmarkKeyServices and associates them with | 21 // Singleton that owns all EnhancedBookmarkKeyServices and associates them with |
20 // BrowserContexts. | 22 // BrowserContexts. |
21 class EnhancedBookmarkKeyServiceFactory | 23 class EnhancedBookmarkKeyServiceFactory |
22 : public BrowserContextKeyedServiceFactory { | 24 : public BrowserContextKeyedServiceFactory { |
23 public: | 25 public: |
24 static EnhancedBookmarkKeyServiceFactory* GetInstance(); | 26 static EnhancedBookmarkKeyServiceFactory* GetInstance(); |
25 | 27 |
26 private: | 28 private: |
27 friend struct DefaultSingletonTraits<EnhancedBookmarkKeyServiceFactory>; | 29 friend struct base::DefaultSingletonTraits<EnhancedBookmarkKeyServiceFactory>; |
28 | 30 |
29 EnhancedBookmarkKeyServiceFactory(); | 31 EnhancedBookmarkKeyServiceFactory(); |
30 ~EnhancedBookmarkKeyServiceFactory() override; | 32 ~EnhancedBookmarkKeyServiceFactory() override; |
31 | 33 |
32 // BrowserContextKeyedServiceFactory: | 34 // BrowserContextKeyedServiceFactory: |
33 KeyedService* BuildServiceInstanceFor( | 35 KeyedService* BuildServiceInstanceFor( |
34 content::BrowserContext* context) const override; | 36 content::BrowserContext* context) const override; |
35 content::BrowserContext* GetBrowserContextToUse( | 37 content::BrowserContext* GetBrowserContextToUse( |
36 content::BrowserContext* context) const override; | 38 content::BrowserContext* context) const override; |
37 bool ServiceIsCreatedWithBrowserContext() const override; | 39 bool ServiceIsCreatedWithBrowserContext() const override; |
38 bool ServiceIsNULLWhileTesting() const override; | 40 bool ServiceIsNULLWhileTesting() const override; |
39 | 41 |
40 DISALLOW_COPY_AND_ASSIGN(EnhancedBookmarkKeyServiceFactory); | 42 DISALLOW_COPY_AND_ASSIGN(EnhancedBookmarkKeyServiceFactory); |
41 }; | 43 }; |
42 | 44 |
43 #endif // CHROME_BROWSER_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_FACTORY_H_ | 45 #endif // CHROME_BROWSER_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_FACTORY_H_ |
OLD | NEW |