Index: chrome/browser/ui/webui/options/browser_options_handler.cc |
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc |
index d7c47ca2c4986ee9904f4989f91bc0b9fc5ea158..6ddfc3fd80b2b8fce024f7525c06280865528750 100644 |
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc |
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc |
@@ -1205,6 +1205,22 @@ void BrowserOptionsHandler::OnTemplateURLServiceChanged() { |
template_url_service_->is_default_search_managed() || |
template_url_service_->IsExtensionControlledDefaultSearch())); |
+ if (default_index != -1 && model_urls[default_index]->HasGoogleBaseURLs( |
+ template_url_service_->search_terms_data())) { |
+ // If the user has chosen Google as the default search provider, make |
+ // hotwording as an option available again. |
+ HandleRequestHotwordAvailable(nullptr); |
+ } else { |
+ // If the user has chosen a default search provide other than Google, turn |
+ // off hotwording since other providers don't provide that functionality. |
+ web_ui()->CallJavascriptFunction("BrowserOptions.setHotwordSectionVisible", |
+ base::FundamentalValue(false)); |
+ HotwordService* hotword_service = |
+ HotwordServiceFactory::GetForProfile(Profile::FromWebUI(web_ui())); |
+ if (hotword_service) |
+ hotword_service->DisableHotwordPreferences(); |
+ } |
+ |
SetupExtensionControlledIndicators(); |
} |