OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/views/frame/test_with_browser_view.h" | 5 #include "chrome/browser/ui/views/frame/test_with_browser_view.h" |
6 | 6 |
7 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 7 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
8 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" | 8 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
9 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 9 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
10 #include "chrome/browser/history/history_service_factory.h" | 10 #include "chrome/browser/history/history_service_factory.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
34 // Caller owns the returned service. | 34 // Caller owns the returned service. |
35 KeyedService* CreateTemplateURLService(content::BrowserContext* context) { | 35 KeyedService* CreateTemplateURLService(content::BrowserContext* context) { |
36 Profile* profile = static_cast<Profile*>(context); | 36 Profile* profile = static_cast<Profile*>(context); |
37 return new TemplateURLService( | 37 return new TemplateURLService( |
38 profile->GetPrefs(), | 38 profile->GetPrefs(), |
39 scoped_ptr<SearchTermsData>(new UIThreadSearchTermsData(profile)), | 39 scoped_ptr<SearchTermsData>(new UIThreadSearchTermsData(profile)), |
40 WebDataServiceFactory::GetKeywordWebDataForProfile( | 40 WebDataServiceFactory::GetKeywordWebDataForProfile( |
41 profile, Profile::EXPLICIT_ACCESS), | 41 profile, ServiceAccessType::EXPLICIT_ACCESS), |
42 scoped_ptr<TemplateURLServiceClient>( | 42 scoped_ptr<TemplateURLServiceClient>(new ChromeTemplateURLServiceClient( |
43 new ChromeTemplateURLServiceClient( | 43 HistoryServiceFactory::GetForProfile( |
44 HistoryServiceFactory::GetForProfile(profile, | 44 profile, ServiceAccessType::EXPLICIT_ACCESS))), |
45 Profile::EXPLICIT_ACCESS))), | |
46 nullptr, nullptr, base::Closure()); | 45 nullptr, nullptr, base::Closure()); |
47 } | 46 } |
48 | 47 |
49 KeyedService* CreateAutocompleteClassifier(content::BrowserContext* context) { | 48 KeyedService* CreateAutocompleteClassifier(content::BrowserContext* context) { |
50 Profile* profile = static_cast<Profile*>(context); | 49 Profile* profile = static_cast<Profile*>(context); |
51 return new AutocompleteClassifier( | 50 return new AutocompleteClassifier( |
52 make_scoped_ptr(new AutocompleteController( | 51 make_scoped_ptr(new AutocompleteController( |
53 profile, TemplateURLServiceFactory::GetForProfile(profile), nullptr, | 52 profile, TemplateURLServiceFactory::GetForProfile(profile), nullptr, |
54 AutocompleteClassifier::kDefaultOmniboxProviders)), | 53 AutocompleteClassifier::kDefaultOmniboxProviders)), |
55 scoped_ptr<AutocompleteSchemeClassifier>(new TestSchemeClassifier())); | 54 scoped_ptr<AutocompleteSchemeClassifier>(new TestSchemeClassifier())); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 AutocompleteClassifierFactory::GetInstance()->SetTestingFactory( | 116 AutocompleteClassifierFactory::GetInstance()->SetTestingFactory( |
118 profile, &CreateAutocompleteClassifier); | 117 profile, &CreateAutocompleteClassifier); |
119 return profile; | 118 return profile; |
120 } | 119 } |
121 | 120 |
122 BrowserWindow* TestWithBrowserView::CreateBrowserWindow() { | 121 BrowserWindow* TestWithBrowserView::CreateBrowserWindow() { |
123 // Allow BrowserWithTestWindowTest to use Browser to create the default | 122 // Allow BrowserWithTestWindowTest to use Browser to create the default |
124 // BrowserView and BrowserFrame. | 123 // BrowserView and BrowserFrame. |
125 return nullptr; | 124 return nullptr; |
126 } | 125 } |
OLD | NEW |