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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 780703004: [Hotword] Ok Google options disappear if search provider is changed from (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check for no default url Created 6 years 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
« no previous file with comments | « chrome/browser/search/hotword_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « chrome/browser/search/hotword_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698