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 #include "ios/chrome/browser/autocomplete/in_memory_url_index_factory.h" | 5 #include "ios/chrome/browser/autocomplete/in_memory_url_index_factory.h" |
6 | 6 |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "components/keyed_service/core/service_access_type.h" | 9 #include "components/keyed_service/core/service_access_type.h" |
10 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 10 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 // static | 22 // static |
23 InMemoryURLIndex* InMemoryURLIndexFactory::GetForBrowserState( | 23 InMemoryURLIndex* InMemoryURLIndexFactory::GetForBrowserState( |
24 ios::ChromeBrowserState* browser_state) { | 24 ios::ChromeBrowserState* browser_state) { |
25 return static_cast<InMemoryURLIndex*>( | 25 return static_cast<InMemoryURLIndex*>( |
26 GetInstance()->GetServiceForBrowserState(browser_state, true)); | 26 GetInstance()->GetServiceForBrowserState(browser_state, true)); |
27 } | 27 } |
28 | 28 |
29 // static | 29 // static |
30 InMemoryURLIndexFactory* InMemoryURLIndexFactory::GetInstance() { | 30 InMemoryURLIndexFactory* InMemoryURLIndexFactory::GetInstance() { |
31 return Singleton<InMemoryURLIndexFactory>::get(); | 31 return base::Singleton<InMemoryURLIndexFactory>::get(); |
32 } | 32 } |
33 | 33 |
34 InMemoryURLIndexFactory::InMemoryURLIndexFactory() | 34 InMemoryURLIndexFactory::InMemoryURLIndexFactory() |
35 : BrowserStateKeyedServiceFactory( | 35 : BrowserStateKeyedServiceFactory( |
36 "InMemoryURLIndex", | 36 "InMemoryURLIndex", |
37 BrowserStateDependencyManager::GetInstance()) { | 37 BrowserStateDependencyManager::GetInstance()) { |
38 DependsOn(ios::BookmarkModelFactory::GetInstance()); | 38 DependsOn(ios::BookmarkModelFactory::GetInstance()); |
39 DependsOn(ios::HistoryServiceFactory::GetInstance()); | 39 DependsOn(ios::HistoryServiceFactory::GetInstance()); |
40 } | 40 } |
41 | 41 |
(...skipping 23 matching lines...) Expand all Loading... |
65 web::BrowserState* InMemoryURLIndexFactory::GetBrowserStateToUse( | 65 web::BrowserState* InMemoryURLIndexFactory::GetBrowserStateToUse( |
66 web::BrowserState* context) const { | 66 web::BrowserState* context) const { |
67 return GetBrowserStateRedirectedInIncognito(context); | 67 return GetBrowserStateRedirectedInIncognito(context); |
68 } | 68 } |
69 | 69 |
70 bool InMemoryURLIndexFactory::ServiceIsNULLWhileTesting() const { | 70 bool InMemoryURLIndexFactory::ServiceIsNULLWhileTesting() const { |
71 return true; | 71 return true; |
72 } | 72 } |
73 | 73 |
74 } // namespace ios | 74 } // namespace ios |
OLD | NEW |