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

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 hotword service 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
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))
Dan Beam 2014/12/04 20:44:07 why do you need to check HasPrefPath?
rpetterson 2014/12/04 23:20:28 We have some special cases for if the user has not
+ 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));

Powered by Google App Engine
This is Rietveld 408576698