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_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_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 namespace base { |
10 template <typename T> struct DefaultSingletonTraits; | 11 template <typename T> struct DefaultSingletonTraits; |
| 12 } |
11 | 13 |
12 class InMemoryURLIndex; | 14 class InMemoryURLIndex; |
13 class Profile; | 15 class Profile; |
14 | 16 |
15 class InMemoryURLIndexFactory : public BrowserContextKeyedServiceFactory { | 17 class InMemoryURLIndexFactory : public BrowserContextKeyedServiceFactory { |
16 public: | 18 public: |
17 static InMemoryURLIndex* GetForProfile(Profile* profile); | 19 static InMemoryURLIndex* GetForProfile(Profile* profile); |
18 static InMemoryURLIndexFactory* GetInstance(); | 20 static InMemoryURLIndexFactory* GetInstance(); |
19 | 21 |
20 private: | 22 private: |
21 friend struct DefaultSingletonTraits<InMemoryURLIndexFactory>; | 23 friend struct base::DefaultSingletonTraits<InMemoryURLIndexFactory>; |
22 | 24 |
23 InMemoryURLIndexFactory(); | 25 InMemoryURLIndexFactory(); |
24 ~InMemoryURLIndexFactory() override; | 26 ~InMemoryURLIndexFactory() override; |
25 | 27 |
26 // BrowserContextKeyedServiceFactory: | 28 // BrowserContextKeyedServiceFactory: |
27 KeyedService* BuildServiceInstanceFor( | 29 KeyedService* BuildServiceInstanceFor( |
28 content::BrowserContext* context) const override; | 30 content::BrowserContext* context) const override; |
29 content::BrowserContext* GetBrowserContextToUse( | 31 content::BrowserContext* GetBrowserContextToUse( |
30 content::BrowserContext* context) const override; | 32 content::BrowserContext* context) const override; |
31 bool ServiceIsNULLWhileTesting() const override; | 33 bool ServiceIsNULLWhileTesting() const override; |
32 }; | 34 }; |
33 | 35 |
34 #endif // CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_ | 36 #endif // CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_ |
OLD | NEW |