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_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_ | 6 #define CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_ |
7 | 7 |
8 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 8 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
9 | 9 |
10 template <typename T> struct DefaultSingletonTraits; | 10 template <typename T> struct DefaultSingletonTraits; |
11 | 11 |
12 class InMemoryURLIndex; | 12 class FallbackIconService; |
13 class Profile; | |
14 | 13 |
15 class InMemoryURLIndexFactory : public BrowserContextKeyedServiceFactory { | 14 namespace content { |
| 15 class BrowserContext; |
| 16 } |
| 17 |
| 18 // Singleton that owns all FallbackIconService and associates them with |
| 19 // BrowserContext instances. |
| 20 class FallbackIconServiceFactory : public BrowserContextKeyedServiceFactory { |
16 public: | 21 public: |
17 static InMemoryURLIndex* GetForProfile(Profile* profile); | 22 static FallbackIconService* GetForBrowserContext( |
18 static InMemoryURLIndexFactory* GetInstance(); | 23 content::BrowserContext* context); |
| 24 |
| 25 static FallbackIconServiceFactory* GetInstance(); |
19 | 26 |
20 private: | 27 private: |
21 friend struct DefaultSingletonTraits<InMemoryURLIndexFactory>; | 28 friend struct DefaultSingletonTraits<FallbackIconServiceFactory>; |
22 | 29 |
23 InMemoryURLIndexFactory(); | 30 FallbackIconServiceFactory(); |
24 ~InMemoryURLIndexFactory() override; | 31 ~FallbackIconServiceFactory() override; |
25 | 32 |
26 // BrowserContextKeyedServiceFactory: | 33 // BrowserContextKeyedServiceFactory: |
27 KeyedService* BuildServiceInstanceFor( | 34 KeyedService* BuildServiceInstanceFor( |
28 content::BrowserContext* context) const override; | 35 content::BrowserContext* context) const override; |
29 content::BrowserContext* GetBrowserContextToUse( | |
30 content::BrowserContext* context) const override; | |
31 bool ServiceIsNULLWhileTesting() const override; | 36 bool ServiceIsNULLWhileTesting() const override; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(FallbackIconServiceFactory); |
32 }; | 39 }; |
33 | 40 |
34 #endif // CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_ | 41 #endif // CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_ |
OLD | NEW |