OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
Matt Giuca
2014/08/12 08:37:39
Don't know where to put this comment but: I have a
kcarattini
2014/08/13 03:51:54
Is this still happening for you? I can't reproduce
Matt Giuca
2014/08/13 05:21:09
Yep, it's fixed; it was probably my fault (when I
| |
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" |
11 #include "apps/app_window_registry.h" | 11 #include "apps/app_window_registry.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 { "fontSizeLabelLarge", IDS_OPTIONS_FONT_SIZE_LABEL_LARGE }, | 270 { "fontSizeLabelLarge", IDS_OPTIONS_FONT_SIZE_LABEL_LARGE }, |
271 { "fontSizeLabelMedium", IDS_OPTIONS_FONT_SIZE_LABEL_MEDIUM }, | 271 { "fontSizeLabelMedium", IDS_OPTIONS_FONT_SIZE_LABEL_MEDIUM }, |
272 { "fontSizeLabelSmall", IDS_OPTIONS_FONT_SIZE_LABEL_SMALL }, | 272 { "fontSizeLabelSmall", IDS_OPTIONS_FONT_SIZE_LABEL_SMALL }, |
273 { "fontSizeLabelVeryLarge", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_LARGE }, | 273 { "fontSizeLabelVeryLarge", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_LARGE }, |
274 { "fontSizeLabelVerySmall", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_SMALL }, | 274 { "fontSizeLabelVerySmall", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_SMALL }, |
275 { "hideAdvancedSettings", IDS_SETTINGS_HIDE_ADVANCED_SETTINGS }, | 275 { "hideAdvancedSettings", IDS_SETTINGS_HIDE_ADVANCED_SETTINGS }, |
276 { "homePageNtp", IDS_OPTIONS_HOMEPAGE_NTP }, | 276 { "homePageNtp", IDS_OPTIONS_HOMEPAGE_NTP }, |
277 { "homePageShowHomeButton", IDS_OPTIONS_TOOLBAR_SHOW_HOME_BUTTON }, | 277 { "homePageShowHomeButton", IDS_OPTIONS_TOOLBAR_SHOW_HOME_BUTTON }, |
278 { "homePageUseNewTab", IDS_OPTIONS_HOMEPAGE_USE_NEWTAB }, | 278 { "homePageUseNewTab", IDS_OPTIONS_HOMEPAGE_USE_NEWTAB }, |
279 { "homePageUseURL", IDS_OPTIONS_HOMEPAGE_USE_URL }, | 279 { "homePageUseURL", IDS_OPTIONS_HOMEPAGE_USE_URL }, |
280 { "hotwordAlwaysOnSearchEnable", IDS_HOTWORD_ALWAYS_ON_SEARCH_PREF_CHKBOX }, | |
281 { "hotwordAlwaysOnSearchDescription", | |
282 IDS_HOTWORD_ALWAYS_ON_SEARCH_PREF_DESCRIPTION }, | |
283 { "hotwordAudioHistoryEnable", IDS_HOTWORD_AUDIO_HISTORY_PREF_CHKBOX }, | |
284 { "hotwordAudioHistoryDescription", | |
285 IDS_HOTWORD_AUDIO_HISTORY_PREF_DESCRIPTION }, | |
280 { "hotwordSearchEnable", IDS_HOTWORD_SEARCH_PREF_CHKBOX }, | 286 { "hotwordSearchEnable", IDS_HOTWORD_SEARCH_PREF_CHKBOX }, |
281 { "hotwordConfirmEnable", IDS_HOTWORD_CONFIRM_BUBBLE_ENABLE }, | 287 { "hotwordConfirmEnable", IDS_HOTWORD_CONFIRM_BUBBLE_ENABLE }, |
282 { "hotwordConfirmDisable", IDS_HOTWORD_CONFIRM_BUBBLE_DISABLE }, | 288 { "hotwordConfirmDisable", IDS_HOTWORD_CONFIRM_BUBBLE_DISABLE }, |
283 { "hotwordConfirmMessage", IDS_HOTWORD_SEARCH_PREF_DESCRIPTION }, | 289 { "hotwordConfirmMessage", IDS_HOTWORD_SEARCH_PREF_DESCRIPTION }, |
284 { "hotwordAudioLoggingEnable", IDS_HOTWORD_AUDIO_LOGGING_ENABLE }, | 290 { "hotwordAudioLoggingEnable", IDS_HOTWORD_AUDIO_LOGGING_ENABLE }, |
285 { "importData", IDS_OPTIONS_IMPORT_DATA_BUTTON }, | 291 { "importData", IDS_OPTIONS_IMPORT_DATA_BUTTON }, |
286 { "improveBrowsingExperience", IDS_OPTIONS_IMPROVE_BROWSING_EXPERIENCE }, | 292 { "improveBrowsingExperience", IDS_OPTIONS_IMPROVE_BROWSING_EXPERIENCE }, |
287 { "languageAndSpellCheckSettingsButton", | 293 { "languageAndSpellCheckSettingsButton", |
288 IDS_OPTIONS_SETTINGS_LANGUAGE_AND_INPUT_SETTINGS }, | 294 IDS_OPTIONS_SETTINGS_LANGUAGE_AND_INPUT_SETTINGS }, |
289 { "linkDoctorPref", IDS_OPTIONS_LINKDOCTOR_PREF }, | 295 { "linkDoctorPref", IDS_OPTIONS_LINKDOCTOR_PREF }, |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1585 void BrowserOptionsHandler::HandleRequestHotwordAvailable( | 1591 void BrowserOptionsHandler::HandleRequestHotwordAvailable( |
1586 const base::ListValue* args) { | 1592 const base::ListValue* args) { |
1587 Profile* profile = Profile::FromWebUI(web_ui()); | 1593 Profile* profile = Profile::FromWebUI(web_ui()); |
1588 std::string group = base::FieldTrialList::FindFullName("VoiceTrigger"); | 1594 std::string group = base::FieldTrialList::FindFullName("VoiceTrigger"); |
1589 if (group != "" && group != "Disabled" && | 1595 if (group != "" && group != "Disabled" && |
1590 HotwordServiceFactory::IsHotwordAllowed(profile)) { | 1596 HotwordServiceFactory::IsHotwordAllowed(profile)) { |
1591 // Update the current error value. | 1597 // Update the current error value. |
1592 HotwordServiceFactory::IsServiceAvailable(profile); | 1598 HotwordServiceFactory::IsServiceAvailable(profile); |
1593 int error = HotwordServiceFactory::GetCurrentError(profile); | 1599 int error = HotwordServiceFactory::GetCurrentError(profile); |
1594 if (!error) { | 1600 if (!error) { |
1595 web_ui()->CallJavascriptFunction("BrowserOptions.showHotwordSection"); | 1601 web_ui()->CallJavascriptFunction("BrowserOptions.showHotwordSection"); |
Matt Giuca
2014/08/12 08:37:39
While you're here: there's a little "bug" here tha
kcarattini
2014/08/13 03:51:53
Done.
| |
1602 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
Matt Giuca
2014/08/12 08:37:39
This should not be here -- move it after this if/e
kcarattini
2014/08/13 03:51:54
Done.
| |
1603 switches::kEnableExperimentalHotwording)) { | |
1604 web_ui()->CallJavascriptFunction( | |
1605 "BrowserOptions.showHotwordAlwaysOnSection"); | |
1606 } | |
1596 } else { | 1607 } else { |
1597 base::FundamentalValue enabled( | 1608 base::FundamentalValue enabled( |
1598 profile->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled)); | 1609 profile->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled)); |
1599 base::string16 hotword_help_url = | 1610 base::string16 hotword_help_url = |
1600 base::ASCIIToUTF16(chrome::kHotwordLearnMoreURL); | 1611 base::ASCIIToUTF16(chrome::kHotwordLearnMoreURL); |
1601 base::StringValue error_message(l10n_util::GetStringUTF16(error)); | 1612 base::StringValue error_message(l10n_util::GetStringUTF16(error)); |
1602 if (error == IDS_HOTWORD_GENERIC_ERROR_MESSAGE) { | 1613 if (error == IDS_HOTWORD_GENERIC_ERROR_MESSAGE) { |
1603 error_message = base::StringValue( | 1614 error_message = base::StringValue( |
1604 l10n_util::GetStringFUTF16(error, hotword_help_url)); | 1615 l10n_util::GetStringFUTF16(error, hotword_help_url)); |
1605 } | 1616 } |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1866 extension = extensions::GetExtensionOverridingProxy( | 1877 extension = extensions::GetExtensionOverridingProxy( |
1867 Profile::FromWebUI(web_ui())); | 1878 Profile::FromWebUI(web_ui())); |
1868 AppendExtensionData("proxy", extension, &extension_controlled); | 1879 AppendExtensionData("proxy", extension, &extension_controlled); |
1869 | 1880 |
1870 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", | 1881 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", |
1871 extension_controlled); | 1882 extension_controlled); |
1872 #endif // defined(OS_WIN) | 1883 #endif // defined(OS_WIN) |
1873 } | 1884 } |
1874 | 1885 |
1875 } // namespace options | 1886 } // namespace options |
OLD | NEW |