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

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

Issue 677843002: Updates the hotword settings page according to newest mocks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review Comments Created 6 years, 2 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/resources/options/browser_options.js ('k') | no next file » | 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 c8b391bd03d4f6bcfc293b6323a22d94f7b2d4f7..17ae89bc813e161c1b615964ae4dcf409aca4a03 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -268,12 +268,13 @@ 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 },
{ "hotwordConfirmMessage", IDS_HOTWORD_SEARCH_PREF_DESCRIPTION },
+ { "hotwordNoDSPDesc", IDS_HOTWORD_SEARCH_NO_DSP_DESCRIPTION },
+ { "hotwordAlwaysOnDesc", IDS_HOTWORD_SEARCH_ALWAYS_ON_DESCRIPTION },
{ "hotwordAudioLoggingEnable", IDS_HOTWORD_AUDIO_LOGGING_ENABLE },
{ "importData", IDS_OPTIONS_IMPORT_DATA_BUTTON },
{ "improveBrowsingExperience", IDS_OPTIONS_IMPROVE_BROWSING_EXPERIENCE },
@@ -322,7 +323,6 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
{ "sectionTitleSearch", IDS_OPTIONS_DEFAULTSEARCH_GROUP_NAME },
{ "sectionTitleStartup", IDS_OPTIONS_STARTUP_GROUP_NAME },
{ "sectionTitleSync", IDS_SYNC_OPTIONS_GROUP_NAME },
- { "sectionTitleVoice", IDS_OPTIONS_VOICE_GROUP_NAME },
{ "settingsTitle", IDS_SETTINGS_TITLE },
{ "showAdvancedSettings", IDS_SETTINGS_SHOW_ADVANCED_SETTINGS },
{ "spellingConfirmMessage", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT },
@@ -1623,7 +1623,16 @@ void BrowserOptionsHandler::HandleRequestHotwordAvailable(
// Update the current error value.
HotwordServiceFactory::IsServiceAvailable(profile);
int error = HotwordServiceFactory::GetCurrentError(profile);
- if (!error) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExperimentalHotwording)) {
+ if (HotwordServiceFactory::IsHotwordHardwareAvailable()) {
+ web_ui()->CallJavascriptFunction(
+ "BrowserOptions.showHotwordAlwaysOnSection");
+ } else {
+ web_ui()->CallJavascriptFunction(
+ "BrowserOptions.showHotwordNoDSPSection");
+ }
+ } else if (!error) {
web_ui()->CallJavascriptFunction("BrowserOptions.showHotwordSection",
enabled);
} else {
@@ -1637,11 +1646,6 @@ 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/resources/options/browser_options.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698