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/search_engines/template_url_service_factory.h" | 5 #include "ios/chrome/browser/search_engines/template_url_service_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 ios::ChromeBrowserState::FromBrowserState(context); | 44 ios::ChromeBrowserState::FromBrowserState(context); |
45 return base::MakeUnique<TemplateURLService>( | 45 return base::MakeUnique<TemplateURLService>( |
46 browser_state->GetPrefs(), | 46 browser_state->GetPrefs(), |
47 base::WrapUnique(new ios::UIThreadSearchTermsData(browser_state)), | 47 base::WrapUnique(new ios::UIThreadSearchTermsData(browser_state)), |
48 ios::WebDataServiceFactory::GetKeywordWebDataForBrowserState( | 48 ios::WebDataServiceFactory::GetKeywordWebDataForBrowserState( |
49 browser_state, ServiceAccessType::EXPLICIT_ACCESS), | 49 browser_state, ServiceAccessType::EXPLICIT_ACCESS), |
50 base::WrapUnique(new ios::TemplateURLServiceClientImpl( | 50 base::WrapUnique(new ios::TemplateURLServiceClientImpl( |
51 ios::HistoryServiceFactory::GetForBrowserState( | 51 ios::HistoryServiceFactory::GetForBrowserState( |
52 browser_state, ServiceAccessType::EXPLICIT_ACCESS))), | 52 browser_state, ServiceAccessType::EXPLICIT_ACCESS))), |
53 ios::GoogleURLTrackerFactory::GetForBrowserState(browser_state), | 53 ios::GoogleURLTrackerFactory::GetForBrowserState(browser_state), |
54 GetApplicationContext()->GetRapporService(), | 54 GetApplicationContext()->GetRapporServiceImpl(), |
55 GetDefaultSearchProviderChangedCallback()); | 55 GetDefaultSearchProviderChangedCallback()); |
56 } | 56 } |
57 | 57 |
58 } // namespace | 58 } // namespace |
59 | 59 |
60 // static | 60 // static |
61 TemplateURLService* TemplateURLServiceFactory::GetForBrowserState( | 61 TemplateURLService* TemplateURLServiceFactory::GetForBrowserState( |
62 ios::ChromeBrowserState* browser_state) { | 62 ios::ChromeBrowserState* browser_state) { |
63 return static_cast<TemplateURLService*>( | 63 return static_cast<TemplateURLService*>( |
64 GetInstance()->GetServiceForBrowserState(browser_state, true)); | 64 GetInstance()->GetServiceForBrowserState(browser_state, true)); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 web::BrowserState* TemplateURLServiceFactory::GetBrowserStateToUse( | 101 web::BrowserState* TemplateURLServiceFactory::GetBrowserStateToUse( |
102 web::BrowserState* context) const { | 102 web::BrowserState* context) const { |
103 return GetBrowserStateRedirectedInIncognito(context); | 103 return GetBrowserStateRedirectedInIncognito(context); |
104 } | 104 } |
105 | 105 |
106 bool TemplateURLServiceFactory::ServiceIsNULLWhileTesting() const { | 106 bool TemplateURLServiceFactory::ServiceIsNULLWhileTesting() const { |
107 return true; | 107 return true; |
108 } | 108 } |
109 | 109 |
110 } // namespace ios | 110 } // namespace ios |
OLD | NEW |