Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: chrome/browser/ui/views/frame/test_with_browser_view.cc

Issue 367863005: No chrome dependencies in TemplateURLService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename to TemplateURLServiceClient Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/predictors/predictor_database.h" 10 #include "chrome/browser/predictors/predictor_database.h"
11 #include "chrome/browser/search_engines/chrome_template_url_service_client.h"
11 #include "chrome/browser/search_engines/template_url_service.h" 12 #include "chrome/browser/search_engines/template_url_service.h"
12 #include "chrome/browser/search_engines/template_url_service_factory.h" 13 #include "chrome/browser/search_engines/template_url_service_factory.h"
14 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" 15 #include "chrome/browser/ui/tabs/tab_strip_model.h"
14 #include "chrome/browser/ui/views/frame/browser_view.h" 16 #include "chrome/browser/ui/views/frame/browser_view.h"
17 #include "chrome/browser/webdata/web_data_service_factory.h"
15 #include "chrome/test/base/browser_with_test_window_test.h" 18 #include "chrome/test/base/browser_with_test_window_test.h"
16 #include "chrome/test/base/scoped_testing_local_state.h" 19 #include "chrome/test/base/scoped_testing_local_state.h"
17 #include "chrome/test/base/testing_browser_process.h" 20 #include "chrome/test/base/testing_browser_process.h"
18 #include "chrome/test/base/testing_io_thread_state.h" 21 #include "chrome/test/base/testing_io_thread_state.h"
19 #include "components/autocomplete/test_scheme_classifier.h" 22 #include "components/autocomplete/test_scheme_classifier.h"
23 #include "components/search_engines/search_terms_data.h"
20 #include "content/public/test/test_utils.h" 24 #include "content/public/test/test_utils.h"
21 25
22 #if defined(OS_CHROMEOS) 26 #if defined(OS_CHROMEOS)
23 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" 27 #include "chrome/browser/chromeos/input_method/input_method_configuration.h"
24 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" 28 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h"
25 #endif 29 #endif
26 30
27 namespace { 31 namespace {
28 32
29 // Caller owns the returned service. 33 // Caller owns the returned service.
30 KeyedService* CreateTemplateURLService(content::BrowserContext* profile) { 34 KeyedService* CreateTemplateURLService(content::BrowserContext* context) {
31 return new TemplateURLService(static_cast<Profile*>(profile), NULL, 35 Profile* profile = static_cast<Profile*>(context);
32 base::Closure()); 36 return new TemplateURLService(
37 profile->GetPrefs(),
38 scoped_ptr<SearchTermsData>(new UIThreadSearchTermsData(profile)),
39 WebDataServiceFactory::GetKeywordWebDataForProfile(
40 profile, Profile::EXPLICIT_ACCESS),
41 scoped_ptr<TemplateURLServiceClient>(
42 new ChromeTemplateURLServiceClient(profile)),
43 NULL, NULL, base::Closure());
33 } 44 }
34 45
35 KeyedService* CreateAutocompleteClassifier(content::BrowserContext* context) { 46 KeyedService* CreateAutocompleteClassifier(content::BrowserContext* context) {
36 Profile* profile = static_cast<Profile*>(context); 47 Profile* profile = static_cast<Profile*>(context);
37 return new AutocompleteClassifier( 48 return new AutocompleteClassifier(
38 make_scoped_ptr(new AutocompleteController( 49 make_scoped_ptr(new AutocompleteController(
39 profile, TemplateURLServiceFactory::GetForProfile(profile), NULL, 50 profile, TemplateURLServiceFactory::GetForProfile(profile), NULL,
40 AutocompleteClassifier::kDefaultOmniboxProviders)), 51 AutocompleteClassifier::kDefaultOmniboxProviders)),
41 scoped_ptr<AutocompleteSchemeClassifier>(new TestSchemeClassifier())); 52 scoped_ptr<AutocompleteSchemeClassifier>(new TestSchemeClassifier()));
42 } 53 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 AutocompleteClassifierFactory::GetInstance()->SetTestingFactory( 114 AutocompleteClassifierFactory::GetInstance()->SetTestingFactory(
104 profile, &CreateAutocompleteClassifier); 115 profile, &CreateAutocompleteClassifier);
105 return profile; 116 return profile;
106 } 117 }
107 118
108 BrowserWindow* TestWithBrowserView::CreateBrowserWindow() { 119 BrowserWindow* TestWithBrowserView::CreateBrowserWindow() {
109 // Allow BrowserWithTestWindowTest to use Browser to create the default 120 // Allow BrowserWithTestWindowTest to use Browser to create the default
110 // BrowserView and BrowserFrame. 121 // BrowserView and BrowserFrame.
111 return NULL; 122 return NULL;
112 } 123 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698