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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/options/browser_options_handler.h" 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "apps/app_window.h" 10 #include "apps/app_window.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 { "fontSizeLabelLarge", IDS_OPTIONS_FONT_SIZE_LABEL_LARGE }, 269 { "fontSizeLabelLarge", IDS_OPTIONS_FONT_SIZE_LABEL_LARGE },
270 { "fontSizeLabelMedium", IDS_OPTIONS_FONT_SIZE_LABEL_MEDIUM }, 270 { "fontSizeLabelMedium", IDS_OPTIONS_FONT_SIZE_LABEL_MEDIUM },
271 { "fontSizeLabelSmall", IDS_OPTIONS_FONT_SIZE_LABEL_SMALL }, 271 { "fontSizeLabelSmall", IDS_OPTIONS_FONT_SIZE_LABEL_SMALL },
272 { "fontSizeLabelVeryLarge", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_LARGE }, 272 { "fontSizeLabelVeryLarge", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_LARGE },
273 { "fontSizeLabelVerySmall", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_SMALL }, 273 { "fontSizeLabelVerySmall", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_SMALL },
274 { "hideAdvancedSettings", IDS_SETTINGS_HIDE_ADVANCED_SETTINGS }, 274 { "hideAdvancedSettings", IDS_SETTINGS_HIDE_ADVANCED_SETTINGS },
275 { "homePageNtp", IDS_OPTIONS_HOMEPAGE_NTP }, 275 { "homePageNtp", IDS_OPTIONS_HOMEPAGE_NTP },
276 { "homePageShowHomeButton", IDS_OPTIONS_TOOLBAR_SHOW_HOME_BUTTON }, 276 { "homePageShowHomeButton", IDS_OPTIONS_TOOLBAR_SHOW_HOME_BUTTON },
277 { "homePageUseNewTab", IDS_OPTIONS_HOMEPAGE_USE_NEWTAB }, 277 { "homePageUseNewTab", IDS_OPTIONS_HOMEPAGE_USE_NEWTAB },
278 { "homePageUseURL", IDS_OPTIONS_HOMEPAGE_USE_URL }, 278 { "homePageUseURL", IDS_OPTIONS_HOMEPAGE_USE_URL },
279 { "hotwordAlwaysOnSearchEnable", IDS_HOTWORD_ALWAYS_ON_SEARCH_PREF_CHKBOX },
280 { "hotwordAudioHistoryEnable", IDS_HOTWORD_AUDIO_HISTORY_PREF_CHKBOX },
279 { "hotwordSearchEnable", IDS_HOTWORD_SEARCH_PREF_CHKBOX }, 281 { "hotwordSearchEnable", IDS_HOTWORD_SEARCH_PREF_CHKBOX },
280 { "hotwordConfirmEnable", IDS_HOTWORD_CONFIRM_BUBBLE_ENABLE }, 282 { "hotwordConfirmEnable", IDS_HOTWORD_CONFIRM_BUBBLE_ENABLE },
281 { "hotwordConfirmDisable", IDS_HOTWORD_CONFIRM_BUBBLE_DISABLE }, 283 { "hotwordConfirmDisable", IDS_HOTWORD_CONFIRM_BUBBLE_DISABLE },
282 { "hotwordConfirmMessage", IDS_HOTWORD_SEARCH_PREF_DESCRIPTION }, 284 { "hotwordConfirmMessage", IDS_HOTWORD_SEARCH_PREF_DESCRIPTION },
283 { "hotwordAudioLoggingEnable", IDS_HOTWORD_AUDIO_LOGGING_ENABLE }, 285 { "hotwordAudioLoggingEnable", IDS_HOTWORD_AUDIO_LOGGING_ENABLE },
284 { "importData", IDS_OPTIONS_IMPORT_DATA_BUTTON }, 286 { "importData", IDS_OPTIONS_IMPORT_DATA_BUTTON },
285 { "improveBrowsingExperience", IDS_OPTIONS_IMPROVE_BROWSING_EXPERIENCE }, 287 { "improveBrowsingExperience", IDS_OPTIONS_IMPROVE_BROWSING_EXPERIENCE },
286 { "languageAndSpellCheckSettingsButton", 288 { "languageAndSpellCheckSettingsButton",
287 IDS_OPTIONS_SETTINGS_LANGUAGE_AND_INPUT_SETTINGS }, 289 IDS_OPTIONS_SETTINGS_LANGUAGE_AND_INPUT_SETTINGS },
288 { "linkDoctorPref", IDS_OPTIONS_LINKDOCTOR_PREF }, 290 { "linkDoctorPref", IDS_OPTIONS_LINKDOCTOR_PREF },
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 CURRENT_TAB, content::PAGE_TRANSITION_LINK, false); 1580 CURRENT_TAB, content::PAGE_TRANSITION_LINK, false);
1579 web_ui()->GetWebContents()->OpenURL(params); 1581 web_ui()->GetWebContents()->OpenURL(params);
1580 } 1582 }
1581 1583
1582 #endif 1584 #endif
1583 1585
1584 void BrowserOptionsHandler::HandleRequestHotwordAvailable( 1586 void BrowserOptionsHandler::HandleRequestHotwordAvailable(
1585 const base::ListValue* args) { 1587 const base::ListValue* args) {
1586 Profile* profile = Profile::FromWebUI(web_ui()); 1588 Profile* profile = Profile::FromWebUI(web_ui());
1587 std::string group = base::FieldTrialList::FindFullName("VoiceTrigger"); 1589 std::string group = base::FieldTrialList::FindFullName("VoiceTrigger");
1590 base::FundamentalValue enabled(
1591 profile->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled));
1588 if (group != "" && group != "Disabled" && 1592 if (group != "" && group != "Disabled" &&
1589 HotwordServiceFactory::IsHotwordAllowed(profile)) { 1593 HotwordServiceFactory::IsHotwordAllowed(profile)) {
1590 // Update the current error value. 1594 // Update the current error value.
1591 HotwordServiceFactory::IsServiceAvailable(profile); 1595 HotwordServiceFactory::IsServiceAvailable(profile);
1592 int error = HotwordServiceFactory::GetCurrentError(profile); 1596 int error = HotwordServiceFactory::GetCurrentError(profile);
1593 if (!error) { 1597 if (!error) {
1594 web_ui()->CallJavascriptFunction("BrowserOptions.showHotwordSection"); 1598 web_ui()->CallJavascriptFunction("BrowserOptions.showHotwordSection",
1599 enabled);
1595 } else { 1600 } else {
1596 base::FundamentalValue enabled(
1597 profile->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled));
1598 base::string16 hotword_help_url = 1601 base::string16 hotword_help_url =
1599 base::ASCIIToUTF16(chrome::kHotwordLearnMoreURL); 1602 base::ASCIIToUTF16(chrome::kHotwordLearnMoreURL);
1600 base::StringValue error_message(l10n_util::GetStringUTF16(error)); 1603 base::StringValue error_message(l10n_util::GetStringUTF16(error));
1601 if (error == IDS_HOTWORD_GENERIC_ERROR_MESSAGE) { 1604 if (error == IDS_HOTWORD_GENERIC_ERROR_MESSAGE) {
1602 error_message = base::StringValue( 1605 error_message = base::StringValue(
1603 l10n_util::GetStringFUTF16(error, hotword_help_url)); 1606 l10n_util::GetStringFUTF16(error, hotword_help_url));
1604 } 1607 }
1605 web_ui()->CallJavascriptFunction("BrowserOptions.showHotwordSection", 1608 web_ui()->CallJavascriptFunction("BrowserOptions.showHotwordSection",
1606 enabled, error_message); 1609 enabled, error_message);
1607 } 1610 }
1611 if (CommandLine::ForCurrentProcess()->HasSwitch(
1612 switches::kEnableExperimentalHotwording)) {
1613 web_ui()->CallJavascriptFunction(
1614 "BrowserOptions.showHotwordAlwaysOnSection");
1615 }
1608 } 1616 }
1609 } 1617 }
1610 1618
1611 void BrowserOptionsHandler::HandleLaunchEasyUnlockSetup( 1619 void BrowserOptionsHandler::HandleLaunchEasyUnlockSetup(
1612 const base::ListValue* args) { 1620 const base::ListValue* args) {
1613 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->LaunchSetup(); 1621 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->LaunchSetup();
1614 } 1622 }
1615 1623
1616 void BrowserOptionsHandler::HandleRefreshExtensionControlIndicators( 1624 void BrowserOptionsHandler::HandleRefreshExtensionControlIndicators(
1617 const base::ListValue* args) { 1625 const base::ListValue* args) {
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 extension = extensions::GetExtensionOverridingProxy( 1873 extension = extensions::GetExtensionOverridingProxy(
1866 Profile::FromWebUI(web_ui())); 1874 Profile::FromWebUI(web_ui()));
1867 AppendExtensionData("proxy", extension, &extension_controlled); 1875 AppendExtensionData("proxy", extension, &extension_controlled);
1868 1876
1869 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", 1877 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators",
1870 extension_controlled); 1878 extension_controlled);
1871 #endif // defined(OS_WIN) 1879 #endif // defined(OS_WIN)
1872 } 1880 }
1873 1881
1874 } // namespace options 1882 } // namespace options
OLDNEW
« 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