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

Side by Side Diff: chrome/browser/search_engines/template_url_service_test_util.cc

Issue 839193002: Move ServiceAccessType into //components/keyed_service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on android Created 5 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/search_engines/template_url_service_test_util.h" 5 #include "chrome/browser/search_engines/template_url_service_test_util.h"
6 6
7 #include "base/message_loop/message_loop_proxy.h" 7 #include "base/message_loop/message_loop_proxy.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/history/history_service_factory.h" 9 #include "chrome/browser/history/history_service_factory.h"
10 #include "chrome/browser/search_engines/chrome_template_url_service_client.h" 10 #include "chrome/browser/search_engines/chrome_template_url_service_client.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 search_terms_data_ = NULL; 107 search_terms_data_ = NULL;
108 } 108 }
109 109
110 void TemplateURLServiceTestUtil::ResetModel(bool verify_load) { 110 void TemplateURLServiceTestUtil::ResetModel(bool verify_load) {
111 if (model_) 111 if (model_)
112 ClearModel(); 112 ClearModel();
113 search_terms_data_ = new TestingSearchTermsData("http://www.google.com/"); 113 search_terms_data_ = new TestingSearchTermsData("http://www.google.com/");
114 model_.reset(new TemplateURLService( 114 model_.reset(new TemplateURLService(
115 profile()->GetPrefs(), scoped_ptr<SearchTermsData>(search_terms_data_), 115 profile()->GetPrefs(), scoped_ptr<SearchTermsData>(search_terms_data_),
116 web_data_service_.get(), 116 web_data_service_.get(),
117 scoped_ptr<TemplateURLServiceClient>( 117 scoped_ptr<TemplateURLServiceClient>(new TestingTemplateURLServiceClient(
118 new TestingTemplateURLServiceClient( 118 HistoryServiceFactory::GetForProfileIfExists(
119 HistoryServiceFactory::GetForProfileIfExists( 119 profile(), ServiceAccessType::EXPLICIT_ACCESS),
120 profile(), Profile::EXPLICIT_ACCESS), 120 &search_term_)),
121 &search_term_)),
122 NULL, NULL, base::Closure())); 121 NULL, NULL, base::Closure()));
123 model()->AddObserver(this); 122 model()->AddObserver(this);
124 changed_count_ = 0; 123 changed_count_ = 0;
125 if (verify_load) 124 if (verify_load)
126 VerifyLoad(); 125 VerifyLoad();
127 } 126 }
128 127
129 base::string16 TemplateURLServiceTestUtil::GetAndClearSearchTerm() { 128 base::string16 TemplateURLServiceTestUtil::GetAndClearSearchTerm() {
130 base::string16 search_term; 129 base::string16 search_term;
131 search_term.swap(search_term_); 130 search_term.swap(search_term_);
(...skipping 19 matching lines...) Expand all
151 DefaultSearchPrefTestUtil::SetManagedPref( 150 DefaultSearchPrefTestUtil::SetManagedPref(
152 profile()->GetTestingPrefService(), 151 profile()->GetTestingPrefService(),
153 enabled, name, keyword, search_url, suggest_url, icon_url, encodings, 152 enabled, name, keyword, search_url, suggest_url, icon_url, encodings,
154 alternate_url, search_terms_replacement_key); 153 alternate_url, search_terms_replacement_key);
155 } 154 }
156 155
157 void TemplateURLServiceTestUtil::RemoveManagedDefaultSearchPreferences() { 156 void TemplateURLServiceTestUtil::RemoveManagedDefaultSearchPreferences() {
158 DefaultSearchPrefTestUtil::RemoveManagedPref( 157 DefaultSearchPrefTestUtil::RemoveManagedPref(
159 profile()->GetTestingPrefService()); 158 profile()->GetTestingPrefService());
160 } 159 }
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url_service_factory.cc ('k') | chrome/browser/signin/chrome_signin_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698