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

Unified Diff: chrome/browser/search/hotword_service.cc

Issue 1008303002: Only disable hotwording if the VoiceTrigger field trial is set to 'Disabled'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change some EXPECTs to ASSERTs. Created 5 years, 9 months 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 | « no previous file | chrome/browser/search/hotword_service_unittest.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 ee90a544a30cc0b8a7d69083acafa8a04059ea90..6afe0f21fbc8d3e763f877797f33ec625704db16 100644
--- a/chrome/browser/search/hotword_service.cc
+++ b/chrome/browser/search/hotword_service.cc
@@ -221,7 +221,6 @@ namespace hotword_internal {
// Constants for the hotword field trial.
const char kHotwordFieldTrialName[] = "VoiceTrigger";
const char kHotwordFieldTrialDisabledGroupName[] = "Disabled";
-const char kHotwordFieldTrialExperimentalGroupName[] = "Experimental";
// Old preference constant.
const char kHotwordUnusablePrefName[] = "hotword.search_enabled";
// String passed to indicate the training state has changed.
@@ -296,13 +295,6 @@ bool HotwordService::DoesHotwordSupportLanguage(Profile* profile) {
// static
bool HotwordService::IsExperimentalHotwordingEnabled() {
- std::string group = base::FieldTrialList::FindFullName(
- hotword_internal::kHotwordFieldTrialName);
- if (!group.empty() &&
- group == hotword_internal::kHotwordFieldTrialExperimentalGroupName) {
- return true;
- }
-
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
return !command_line->HasSwitch(switches::kDisableExperimentalHotwording);
}
@@ -670,9 +662,12 @@ bool HotwordService::IsServiceAvailable() {
bool HotwordService::IsHotwordAllowed() {
std::string group = base::FieldTrialList::FindFullName(
hotword_internal::kHotwordFieldTrialName);
- return !group.empty() &&
- group != hotword_internal::kHotwordFieldTrialDisabledGroupName &&
- DoesHotwordSupportLanguage(profile_);
+ // Allow hotwording by default, and only disable if the field trial has been
+ // set.
+ if (group == hotword_internal::kHotwordFieldTrialDisabledGroupName)
+ return false;
+
+ return DoesHotwordSupportLanguage(profile_);
}
bool HotwordService::IsOptedIntoAudioLogging() {
« no previous file with comments | « no previous file | chrome/browser/search/hotword_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698