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

Unified Diff: chrome/browser/search/hotword_service.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.h ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/hotword_service.cc
diff --git a/chrome/browser/search/hotword_service.cc b/chrome/browser/search/hotword_service.cc
index 94ba90e3464125761c9aa6561312594c9cff347f..e650ffaaffe9e93e6b11599158297c57b16e031d 100644
--- a/chrome/browser/search/hotword_service.cc
+++ b/chrome/browser/search/hotword_service.cc
@@ -743,6 +743,19 @@ void HotwordService::SetAudioHistoryHandler(
audio_history_handler_.reset(handler);
}
+void HotwordService::DisableHotwordPreferences() {
+ if (IsSometimesOnEnabled()) {
+ if (profile_->GetPrefs()->HasPrefPath(prefs::kHotwordSearchEnabled))
+ profile_->GetPrefs()->SetBoolean(prefs::kHotwordSearchEnabled, false);
+ } else if (IsAlwaysOnEnabled()) {
+ if (profile_->GetPrefs()->HasPrefPath(
+ prefs::kHotwordAlwaysOnSearchEnabled)) {
+ profile_->GetPrefs()->SetBoolean(prefs::kHotwordAlwaysOnSearchEnabled,
+ false);
+ }
+ }
+}
+
void HotwordService::OnHotwordSearchEnabledChanged(
const std::string& pref_name) {
DCHECK_EQ(pref_name, std::string(prefs::kHotwordSearchEnabled));
« no previous file with comments | « chrome/browser/search/hotword_service.h ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698