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

Side by Side Diff: chrome/browser/search/hotword_service.cc

Issue 774003002: [Hotword] Reverse the experimental flag so that it is on by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix spacing 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/search/hotword_service.h" 5 #include "chrome/browser/search/hotword_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/case_conversion.h" 10 #include "base/i18n/case_conversion.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // static 205 // static
206 bool HotwordService::IsExperimentalHotwordingEnabled() { 206 bool HotwordService::IsExperimentalHotwordingEnabled() {
207 std::string group = base::FieldTrialList::FindFullName( 207 std::string group = base::FieldTrialList::FindFullName(
208 hotword_internal::kHotwordFieldTrialName); 208 hotword_internal::kHotwordFieldTrialName);
209 if (!group.empty() && 209 if (!group.empty() &&
210 group == hotword_internal::kHotwordFieldTrialExperimentalGroupName) { 210 group == hotword_internal::kHotwordFieldTrialExperimentalGroupName) {
211 return true; 211 return true;
212 } 212 }
213 213
214 CommandLine* command_line = CommandLine::ForCurrentProcess(); 214 CommandLine* command_line = CommandLine::ForCurrentProcess();
215 return command_line->HasSwitch(switches::kEnableExperimentalHotwording); 215 return !command_line->HasSwitch(switches::kDisableExperimentalHotwording);
216 } 216 }
217 217
218 HotwordService::HotwordService(Profile* profile) 218 HotwordService::HotwordService(Profile* profile)
219 : profile_(profile), 219 : profile_(profile),
220 extension_registry_observer_(this), 220 extension_registry_observer_(this),
221 client_(NULL), 221 client_(NULL),
222 error_message_(0), 222 error_message_(0),
223 reinstall_pending_(false), 223 reinstall_pending_(false),
224 training_(false), 224 training_(false),
225 weak_factory_(this) { 225 weak_factory_(this) {
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 return false; 623 return false;
624 624
625 std::string previous_locale = 625 std::string previous_locale =
626 profile_->GetPrefs()->GetString(prefs::kHotwordPreviousLanguage); 626 profile_->GetPrefs()->GetString(prefs::kHotwordPreviousLanguage);
627 std::string locale = GetCurrentLocale(profile_); 627 std::string locale = GetCurrentLocale(profile_);
628 628
629 // If it's a new locale, then the old extension should be uninstalled. 629 // If it's a new locale, then the old extension should be uninstalled.
630 return locale != previous_locale && 630 return locale != previous_locale &&
631 HotwordService::DoesHotwordSupportLanguage(profile_); 631 HotwordService::DoesHotwordSupportLanguage(profile_);
632 } 632 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698