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

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

Issue 289063012: [Hotword] Add error message display back in. Add error messages for NaCl. Add metrics for errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compile error Created 6 years, 7 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
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 9160d5a482aa659aa530bdc2fe15692ef782e4bb..62c453fafa7f35bbc29a6269378ad6bfb8538276 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -266,7 +266,6 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
{ "hotwordConfirmEnable", IDS_HOTWORD_CONFIRM_BUBBLE_ENABLE },
{ "hotwordConfirmDisable", IDS_HOTWORD_CONFIRM_BUBBLE_DISABLE },
{ "hotwordConfirmMessage", IDS_HOTWORD_SEARCH_PREF_DESCRIPTION },
- { "hotwordRetryDownloadButton", IDS_HOTWORD_RETRY_DOWNLOAD_BUTTON },
{ "hotwordAudioLoggingEnable", IDS_HOTWORD_AUDIO_LOGGING_ENABLE },
{ "importData", IDS_OPTIONS_IMPORT_DATA_BUTTON },
{ "improveBrowsingExperience", IDS_OPTIONS_IMPROVE_BROWSING_EXPERIENCE },
@@ -714,11 +713,6 @@ void BrowserOptionsHandler::RegisterMessages() {
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
- "requestHotwordSetupRetry",
- base::Bind(&BrowserOptionsHandler::HandleRequestHotwordSetupRetry,
- base::Unretained(this)));
-
- web_ui()->RegisterMessageCallback(
"launchEasyUnlockSetup",
base::Bind(&BrowserOptionsHandler::HandleLaunchEasyUnlockSetup,
base::Unretained(this)));
@@ -1533,8 +1527,18 @@ void BrowserOptionsHandler::HandleRequestHotwordAvailable(
Profile* profile = Profile::FromWebUI(web_ui());
std::string group = base::FieldTrialList::FindFullName("VoiceTrigger");
if (group != "" && group != "Disabled") {
- if (HotwordServiceFactory::IsServiceAvailable(profile))
+ if (HotwordServiceFactory::IsServiceAvailable(profile)) {
web_ui()->CallJavascriptFunction("BrowserOptions.showHotwordSection");
+ } else if (HotwordServiceFactory::IsHotwordAllowed(profile)) {
+ base::StringValue error_message(l10n_util::GetStringUTF16(
+ HotwordServiceFactory::GetCurrentError(profile)));
+ base::string16 hotword_help_url =
+ base::ASCIIToUTF16(chrome::kHotwordLearnMoreURL);
+ base::StringValue help_link(l10n_util::GetStringFUTF16(
+ IDS_HOTWORD_HELP_LINK, hotword_help_url));
+ web_ui()->CallJavascriptFunction("BrowserOptions.showHotwordSection",
+ error_message, help_link);
+ }
}
}
@@ -1543,13 +1547,6 @@ void BrowserOptionsHandler::HandleLaunchEasyUnlockSetup(
easy_unlock::LaunchEasyUnlockSetup(Profile::FromWebUI(web_ui()));
}
-void BrowserOptionsHandler::HandleRequestHotwordSetupRetry(
- const base::ListValue* args) {
- // TODO(joshtrask): invoke BrowserOptions.showHotwordSection again, passing
- // the new error message if any.
- HotwordServiceFactory::RetryHotwordExtension(Profile::FromWebUI(web_ui()));
-}
-
void BrowserOptionsHandler::HandleRefreshExtensionControlIndicators(
const base::ListValue* args) {
SetupExtensionControlledIndicators();

Powered by Google App Engine
This is Rietveld 408576698