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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 460113005: Adds the audio history and always on hotwording settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review Comments Created 6 years, 4 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 | « chrome/browser/search/hotword_service_factory.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 0b29dc17fb48497bddfc57a6e26850de9d58b941..c111558e55e2db6b47a8e056e6eaeca52dbdc175 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -276,6 +276,8 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
{ "homePageShowHomeButton", IDS_OPTIONS_TOOLBAR_SHOW_HOME_BUTTON },
{ "homePageUseNewTab", IDS_OPTIONS_HOMEPAGE_USE_NEWTAB },
{ "homePageUseURL", IDS_OPTIONS_HOMEPAGE_USE_URL },
+ { "hotwordAlwaysOnSearchEnable", IDS_HOTWORD_ALWAYS_ON_SEARCH_PREF_CHKBOX },
+ { "hotwordAudioHistoryEnable", IDS_HOTWORD_AUDIO_HISTORY_PREF_CHKBOX },
{ "hotwordSearchEnable", IDS_HOTWORD_SEARCH_PREF_CHKBOX },
{ "hotwordConfirmEnable", IDS_HOTWORD_CONFIRM_BUBBLE_ENABLE },
{ "hotwordConfirmDisable", IDS_HOTWORD_CONFIRM_BUBBLE_DISABLE },
@@ -1585,16 +1587,17 @@ void BrowserOptionsHandler::HandleRequestHotwordAvailable(
const base::ListValue* args) {
Profile* profile = Profile::FromWebUI(web_ui());
std::string group = base::FieldTrialList::FindFullName("VoiceTrigger");
+ base::FundamentalValue enabled(
+ profile->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled));
if (group != "" && group != "Disabled" &&
HotwordServiceFactory::IsHotwordAllowed(profile)) {
// Update the current error value.
HotwordServiceFactory::IsServiceAvailable(profile);
int error = HotwordServiceFactory::GetCurrentError(profile);
if (!error) {
- web_ui()->CallJavascriptFunction("BrowserOptions.showHotwordSection");
+ web_ui()->CallJavascriptFunction("BrowserOptions.showHotwordSection",
+ enabled);
} else {
- base::FundamentalValue enabled(
- profile->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled));
base::string16 hotword_help_url =
base::ASCIIToUTF16(chrome::kHotwordLearnMoreURL);
base::StringValue error_message(l10n_util::GetStringUTF16(error));
@@ -1605,6 +1608,11 @@ void BrowserOptionsHandler::HandleRequestHotwordAvailable(
web_ui()->CallJavascriptFunction("BrowserOptions.showHotwordSection",
enabled, error_message);
}
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExperimentalHotwording)) {
+ web_ui()->CallJavascriptFunction(
+ "BrowserOptions.showHotwordAlwaysOnSection");
+ }
}
}
« no previous file with comments | « chrome/browser/search/hotword_service_factory.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698