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 b96260b08f80c6d544b6bce9d1dacf15cc96179c..19be440377971c5f0301808329ca640e8bbcd4d8 100644 |
--- a/chrome/browser/android/locale/special_locale_handler.cc |
+++ b/chrome/browser/android/locale/special_locale_handler.cc |
@@ -112,6 +112,25 @@ void SpecialLocaleHandler::OverrideDefaultSearchProvider( |
} |
} |
+void SpecialLocaleHandler::SetGoogleAsDefaultSearch( |
+ JNIEnv* env, |
+ const JavaParamRef<jobject>& obj) { |
+ // If the user has changed his default search provider, no-op. |
+ TemplateURL* current_dsp = template_url_service_->GetDefaultSearchProvider(); |
+ if (!current_dsp || |
+ current_dsp->prepopulate_id() != |
+ GetDesignatedPrepopulatedIdForLocale(locale_)) { |
+ return; |
+ } |
+ |
+ TemplateURL* turl = |
+ FindURLByPrepopulateID(template_url_service_->GetTemplateURLs(), |
+ TemplateURLPrepopulateData::google.id); |
+ if (turl) { |
+ template_url_service_->SetUserSelectedDefaultSearchProvider(turl); |
+ } |
+} |
+ |
SpecialLocaleHandler::~SpecialLocaleHandler() {} |
// static |