| OLD | NEW |
| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 IDS_OPTIONS_ENABLE_DO_NOT_TRACK_BUBBLE_DISABLE }, | 236 IDS_OPTIONS_ENABLE_DO_NOT_TRACK_BUBBLE_DISABLE }, |
| 237 { "downloadLocationAskForSaveLocation", | 237 { "downloadLocationAskForSaveLocation", |
| 238 IDS_OPTIONS_DOWNLOADLOCATION_ASKFORSAVELOCATION }, | 238 IDS_OPTIONS_DOWNLOADLOCATION_ASKFORSAVELOCATION }, |
| 239 { "downloadLocationBrowseTitle", | 239 { "downloadLocationBrowseTitle", |
| 240 IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE }, | 240 IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE }, |
| 241 { "downloadLocationChangeButton", | 241 { "downloadLocationChangeButton", |
| 242 IDS_OPTIONS_DOWNLOADLOCATION_CHANGE_BUTTON }, | 242 IDS_OPTIONS_DOWNLOADLOCATION_CHANGE_BUTTON }, |
| 243 { "downloadLocationGroupName", IDS_OPTIONS_DOWNLOADLOCATION_GROUP_NAME }, | 243 { "downloadLocationGroupName", IDS_OPTIONS_DOWNLOADLOCATION_GROUP_NAME }, |
| 244 { "enableLogging", IDS_OPTIONS_ENABLE_LOGGING }, | 244 { "enableLogging", IDS_OPTIONS_ENABLE_LOGGING }, |
| 245 { "metricsReportingResetRestart", IDS_OPTIONS_ENABLE_LOGGING_RESTART }, | 245 { "metricsReportingResetRestart", IDS_OPTIONS_ENABLE_LOGGING_RESTART }, |
| 246 #if !defined(OS_CHROMEOS) | 246 { "easyUnlockDescription", IDS_OPTIONS_EASY_UNLOCK_DESCRIPTION }, |
| 247 { "easyUnlockCheckboxLabel", IDS_OPTIONS_EASY_UNLOCK_CHECKBOX_LABEL }, | |
| 248 #endif | |
| 249 { "easyUnlockSectionTitle", IDS_OPTIONS_EASY_UNLOCK_SECTION_TITLE }, | 247 { "easyUnlockSectionTitle", IDS_OPTIONS_EASY_UNLOCK_SECTION_TITLE }, |
| 250 { "easyUnlockSetupButton", IDS_OPTIONS_EASY_UNLOCK_SETUP_BUTTON }, | 248 { "easyUnlockSetupButton", IDS_OPTIONS_EASY_UNLOCK_SETUP_BUTTON }, |
| 251 { "easyUnlockManagement", IDS_OPTIONS_EASY_UNLOCK_MANAGEMENT }, | 249 { "easyUnlockSetupIntro", IDS_OPTIONS_EASY_UNLOCK_SETUP_INTRO }, |
| 250 { "easyUnlockTurnOffButton", IDS_OPTIONS_EASY_UNLOCK_TURN_OFF_BUTTON }, |
| 251 { "easyUnlockTurnOffTitle", IDS_OPTIONS_EASY_UNLOCK_TURN_OFF_TITLE }, |
| 252 { "easyUnlockTurnOffDescription", |
| 253 IDS_OPTIONS_EASY_UNLOCK_TURN_OFF_DESCRIPTION }, |
| 254 { "easyUnlockClearServerDataLabel", |
| 255 IDS_OPTIONS_EASY_UNLOCK_CLEAR_SERVER_DATA_LABEL }, |
| 252 { "extensionControlled", IDS_OPTIONS_TAB_EXTENSION_CONTROLLED }, | 256 { "extensionControlled", IDS_OPTIONS_TAB_EXTENSION_CONTROLLED }, |
| 253 { "extensionDisable", IDS_OPTIONS_TAB_EXTENSION_CONTROLLED_DISABLE }, | 257 { "extensionDisable", IDS_OPTIONS_TAB_EXTENSION_CONTROLLED_DISABLE }, |
| 254 { "fontSettingsCustomizeFontsButton", | 258 { "fontSettingsCustomizeFontsButton", |
| 255 IDS_OPTIONS_FONTSETTINGS_CUSTOMIZE_FONTS_BUTTON }, | 259 IDS_OPTIONS_FONTSETTINGS_CUSTOMIZE_FONTS_BUTTON }, |
| 256 { "fontSizeLabelCustom", IDS_OPTIONS_FONT_SIZE_LABEL_CUSTOM }, | 260 { "fontSizeLabelCustom", IDS_OPTIONS_FONT_SIZE_LABEL_CUSTOM }, |
| 257 { "fontSizeLabelLarge", IDS_OPTIONS_FONT_SIZE_LABEL_LARGE }, | 261 { "fontSizeLabelLarge", IDS_OPTIONS_FONT_SIZE_LABEL_LARGE }, |
| 258 { "fontSizeLabelMedium", IDS_OPTIONS_FONT_SIZE_LABEL_MEDIUM }, | 262 { "fontSizeLabelMedium", IDS_OPTIONS_FONT_SIZE_LABEL_MEDIUM }, |
| 259 { "fontSizeLabelSmall", IDS_OPTIONS_FONT_SIZE_LABEL_SMALL }, | 263 { "fontSizeLabelSmall", IDS_OPTIONS_FONT_SIZE_LABEL_SMALL }, |
| 260 { "fontSizeLabelVeryLarge", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_LARGE }, | 264 { "fontSizeLabelVeryLarge", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_LARGE }, |
| 261 { "fontSizeLabelVerySmall", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_SMALL }, | 265 { "fontSizeLabelVerySmall", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_SMALL }, |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 | 603 |
| 600 values->SetString("cloudPrintLearnMoreURL", chrome::kCloudPrintLearnMoreURL); | 604 values->SetString("cloudPrintLearnMoreURL", chrome::kCloudPrintLearnMoreURL); |
| 601 | 605 |
| 602 values->SetString("languagesLearnMoreURL", | 606 values->SetString("languagesLearnMoreURL", |
| 603 chrome::kLanguageSettingsLearnMoreUrl); | 607 chrome::kLanguageSettingsLearnMoreUrl); |
| 604 | 608 |
| 605 values->SetBoolean( | 609 values->SetBoolean( |
| 606 "easyUnlockAllowed", | 610 "easyUnlockAllowed", |
| 607 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->IsAllowed()); | 611 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->IsAllowed()); |
| 608 values->SetString("easyUnlockLearnMoreURL", chrome::kEasyUnlockLearnMoreUrl); | 612 values->SetString("easyUnlockLearnMoreURL", chrome::kEasyUnlockLearnMoreUrl); |
| 609 values->SetString("easyUnlockManagementURL", | 613 |
| 610 chrome::kEasyUnlockManagementUrl); | |
| 611 #if defined(OS_CHROMEOS) | 614 #if defined(OS_CHROMEOS) |
| 612 values->SetString("easyUnlockCheckboxLabel", | |
| 613 l10n_util::GetStringFUTF16( | |
| 614 IDS_OPTIONS_EASY_UNLOCK_CHECKBOX_LABEL_CHROMEOS, | |
| 615 chromeos::GetChromeDeviceType())); | |
| 616 | |
| 617 values->SetBoolean( | 615 values->SetBoolean( |
| 618 "consumerManagementEnabled", | 616 "consumerManagementEnabled", |
| 619 CommandLine::ForCurrentProcess()->HasSwitch( | 617 CommandLine::ForCurrentProcess()->HasSwitch( |
| 620 chromeos::switches::kEnableConsumerManagement)); | 618 chromeos::switches::kEnableConsumerManagement)); |
| 621 | 619 |
| 622 const enterprise_management::PolicyData* policy_data = | 620 const enterprise_management::PolicyData* policy_data = |
| 623 chromeos::DeviceSettingsService::Get()->policy_data(); | 621 chromeos::DeviceSettingsService::Get()->policy_data(); |
| 624 values->SetBoolean( | 622 values->SetBoolean( |
| 625 "consumerManagementEnrolled", | 623 "consumerManagementEnrolled", |
| 626 policy_data && | 624 policy_data && |
| (...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { | 1781 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { |
| 1784 bool has_users = !Profile::FromWebUI(web_ui())-> | 1782 bool has_users = !Profile::FromWebUI(web_ui())-> |
| 1785 GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty(); | 1783 GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty(); |
| 1786 base::FundamentalValue has_users_value(has_users); | 1784 base::FundamentalValue has_users_value(has_users); |
| 1787 web_ui()->CallJavascriptFunction( | 1785 web_ui()->CallJavascriptFunction( |
| 1788 "BrowserOptions.updateManagesSupervisedUsers", | 1786 "BrowserOptions.updateManagesSupervisedUsers", |
| 1789 has_users_value); | 1787 has_users_value); |
| 1790 } | 1788 } |
| 1791 | 1789 |
| 1792 void BrowserOptionsHandler::SetupEasyUnlock() { | 1790 void BrowserOptionsHandler::SetupEasyUnlock() { |
| 1791 // TODO(xiyuan): Update when pairing data is really availble. |
| 1793 bool has_pairing = !Profile::FromWebUI(web_ui())->GetPrefs() | 1792 bool has_pairing = !Profile::FromWebUI(web_ui())->GetPrefs() |
| 1794 ->GetDictionary(prefs::kEasyUnlockPairing)->empty(); | 1793 ->GetDictionary(prefs::kEasyUnlockPairing)->empty(); |
| 1795 base::FundamentalValue has_pairing_value(has_pairing); | 1794 base::FundamentalValue has_pairing_value(has_pairing); |
| 1796 web_ui()->CallJavascriptFunction( | 1795 web_ui()->CallJavascriptFunction( |
| 1797 "BrowserOptions.updateEasyUnlock", | 1796 "BrowserOptions.updateEasyUnlock", |
| 1798 has_pairing_value); | 1797 has_pairing_value); |
| 1799 } | 1798 } |
| 1800 | 1799 |
| 1801 void BrowserOptionsHandler::SetupExtensionControlledIndicators() { | 1800 void BrowserOptionsHandler::SetupExtensionControlledIndicators() { |
| 1802 #if defined(OS_WIN) | 1801 #if defined(OS_WIN) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1839 extension = extensions::GetExtensionOverridingProxy( | 1838 extension = extensions::GetExtensionOverridingProxy( |
| 1840 Profile::FromWebUI(web_ui())); | 1839 Profile::FromWebUI(web_ui())); |
| 1841 AppendExtensionData("proxy", extension, &extension_controlled); | 1840 AppendExtensionData("proxy", extension, &extension_controlled); |
| 1842 | 1841 |
| 1843 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", | 1842 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", |
| 1844 extension_controlled); | 1843 extension_controlled); |
| 1845 #endif // defined(OS_WIN) | 1844 #endif // defined(OS_WIN) |
| 1846 } | 1845 } |
| 1847 | 1846 |
| 1848 } // namespace options | 1847 } // namespace options |
| OLD | NEW |