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)); |