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

Unified Diff: chrome/browser/android/locale/special_locale_handler.cc

Issue 2816383002: Remove non-const version of GetDefaultSearchProvider() and make all callers call the const version (Closed)
Patch Set: Fix instant extended interactive ui test for calling the const version of GetDefaultSearchProvider() Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/locale/special_locale_handler.cc
diff --git a/chrome/browser/android/locale/special_locale_handler.cc b/chrome/browser/android/locale/special_locale_handler.cc
index 0f3271f1d1396c34db944dd2a21a57391fc1368d..8f26c935db83ee9c134a1180d49ddafe79301176 100644
--- a/chrome/browser/android/locale/special_locale_handler.cc
+++ b/chrome/browser/android/locale/special_locale_handler.cc
@@ -65,8 +65,9 @@ jboolean SpecialLocaleHandler::LoadTemplateUrls(
return false;
for (const auto& data_url : prepopulated_list) {
- TemplateURL* existing = template_url_service_->GetTemplateURLForKeyword(
- data_url.get()->keyword());
+ const TemplateURL* existing =
+ template_url_service_->GetTemplateURLForKeyword(
+ data_url.get()->keyword());
// Do not add local engines if there is already one.
if (existing)
continue;
@@ -99,7 +100,8 @@ void SpecialLocaleHandler::OverrideDefaultSearchProvider(
JNIEnv* env,
const JavaParamRef<jobject>& obj) {
// If the user has changed their default search provider, no-op.
- TemplateURL* current_dsp = template_url_service_->GetDefaultSearchProvider();
+ const TemplateURL* current_dsp =
+ template_url_service_->GetDefaultSearchProvider();
if (!current_dsp ||
current_dsp->prepopulate_id() != TemplateURLPrepopulateData::google.id) {
return;
@@ -116,7 +118,8 @@ void SpecialLocaleHandler::SetGoogleAsDefaultSearch(
JNIEnv* env,
const JavaParamRef<jobject>& obj) {
// If the user has changed their default search provider, no-op.
- TemplateURL* current_dsp = template_url_service_->GetDefaultSearchProvider();
+ const TemplateURL* current_dsp =
+ template_url_service_->GetDefaultSearchProvider();
if (!current_dsp ||
current_dsp->prepopulate_id() != GetDesignatedSearchEngine()) {
return;

Powered by Google App Engine
This is Rietveld 408576698