| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 { "profilesCreate", IDS_PROFILES_CREATE_BUTTON_LABEL }, | 288 { "profilesCreate", IDS_PROFILES_CREATE_BUTTON_LABEL }, |
| 289 { "profilesDelete", IDS_PROFILES_DELETE_BUTTON_LABEL }, | 289 { "profilesDelete", IDS_PROFILES_DELETE_BUTTON_LABEL }, |
| 290 { "profilesDeleteSingle", IDS_PROFILES_DELETE_SINGLE_BUTTON_LABEL }, | 290 { "profilesDeleteSingle", IDS_PROFILES_DELETE_SINGLE_BUTTON_LABEL }, |
| 291 { "profilesListItemCurrent", IDS_PROFILES_LIST_ITEM_CURRENT }, | 291 { "profilesListItemCurrent", IDS_PROFILES_LIST_ITEM_CURRENT }, |
| 292 { "profilesManage", IDS_PROFILES_MANAGE_BUTTON_LABEL }, | 292 { "profilesManage", IDS_PROFILES_MANAGE_BUTTON_LABEL }, |
| 293 { "profilesSupervisedDashboardTip", | 293 { "profilesSupervisedDashboardTip", |
| 294 IDS_PROFILES_SUPERVISED_USER_DASHBOARD_TIP }, | 294 IDS_PROFILES_SUPERVISED_USER_DASHBOARD_TIP }, |
| 295 #if defined(ENABLE_SETTINGS_APP) | 295 #if defined(ENABLE_SETTINGS_APP) |
| 296 { "profilesAppListSwitch", IDS_SETTINGS_APP_PROFILES_SWITCH_BUTTON_LABEL }, | 296 { "profilesAppListSwitch", IDS_SETTINGS_APP_PROFILES_SWITCH_BUTTON_LABEL }, |
| 297 #endif | 297 #endif |
| 298 { "proxiesLabelExtension", IDS_OPTIONS_EXTENSION_PROXIES_LABEL }, | |
| 299 { "proxiesLabelSystem", IDS_OPTIONS_SYSTEM_PROXIES_LABEL, | 298 { "proxiesLabelSystem", IDS_OPTIONS_SYSTEM_PROXIES_LABEL, |
| 300 IDS_PRODUCT_NAME }, | 299 IDS_PRODUCT_NAME }, |
| 301 { "resetProfileSettings", IDS_RESET_PROFILE_SETTINGS_BUTTON }, | 300 { "resetProfileSettings", IDS_RESET_PROFILE_SETTINGS_BUTTON }, |
| 302 { "resetProfileSettingsDescription", | 301 { "resetProfileSettingsDescription", |
| 303 IDS_RESET_PROFILE_SETTINGS_DESCRIPTION }, | 302 IDS_RESET_PROFILE_SETTINGS_DESCRIPTION }, |
| 304 { "resetProfileSettingsSectionTitle", | 303 { "resetProfileSettingsSectionTitle", |
| 305 IDS_RESET_PROFILE_SETTINGS_SECTION_TITLE }, | 304 IDS_RESET_PROFILE_SETTINGS_SECTION_TITLE }, |
| 306 { "safeBrowsingEnableProtection", | 305 { "safeBrowsingEnableProtection", |
| 307 IDS_OPTIONS_SAFEBROWSING_ENABLEPROTECTION }, | 306 IDS_OPTIONS_SAFEBROWSING_ENABLEPROTECTION }, |
| 308 { "safeBrowsingEnableDownloadFeedback", | 307 { "safeBrowsingEnableDownloadFeedback", |
| 309 IDS_OPTIONS_SAFEBROWSING_ENABLEDOWNLOADFEEDBACK }, | 308 IDS_OPTIONS_SAFEBROWSING_ENABLEDOWNLOADFEEDBACK }, |
| 310 { "sectionTitleAppearance", IDS_APPEARANCE_GROUP_NAME }, | 309 { "sectionTitleAppearance", IDS_APPEARANCE_GROUP_NAME }, |
| 311 { "sectionTitleDefaultBrowser", IDS_OPTIONS_DEFAULTBROWSER_GROUP_NAME }, | 310 { "sectionTitleDefaultBrowser", IDS_OPTIONS_DEFAULTBROWSER_GROUP_NAME }, |
| 312 { "sectionTitleUsers", IDS_PROFILES_OPTIONS_GROUP_NAME }, | 311 { "sectionTitleUsers", IDS_PROFILES_OPTIONS_GROUP_NAME }, |
| 312 { "sectionTitleProxy", IDS_OPTIONS_PROXY_GROUP_NAME }, |
| 313 { "sectionTitleSearch", IDS_OPTIONS_DEFAULTSEARCH_GROUP_NAME }, | 313 { "sectionTitleSearch", IDS_OPTIONS_DEFAULTSEARCH_GROUP_NAME }, |
| 314 { "sectionTitleStartup", IDS_OPTIONS_STARTUP_GROUP_NAME }, | 314 { "sectionTitleStartup", IDS_OPTIONS_STARTUP_GROUP_NAME }, |
| 315 { "sectionTitleSync", IDS_SYNC_OPTIONS_GROUP_NAME }, | 315 { "sectionTitleSync", IDS_SYNC_OPTIONS_GROUP_NAME }, |
| 316 { "spellingConfirmMessage", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT }, | 316 { "spellingConfirmMessage", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT }, |
| 317 { "spellingConfirmEnable", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_ENABLE }, | 317 { "spellingConfirmEnable", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_ENABLE }, |
| 318 { "spellingConfirmDisable", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_DISABLE }, | 318 { "spellingConfirmDisable", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_DISABLE }, |
| 319 { "spellingPref", IDS_OPTIONS_SPELLING_PREF }, | 319 { "spellingPref", IDS_OPTIONS_SPELLING_PREF }, |
| 320 { "startupRestoreLastSession", IDS_OPTIONS_STARTUP_RESTORE_LAST_SESSION }, | 320 { "startupRestoreLastSession", IDS_OPTIONS_STARTUP_RESTORE_LAST_SESSION }, |
| 321 { "settingsTitle", IDS_SETTINGS_TITLE }, | 321 { "settingsTitle", IDS_SETTINGS_TITLE }, |
| 322 { "showAdvancedSettings", IDS_SETTINGS_SHOW_ADVANCED_SETTINGS }, | 322 { "showAdvancedSettings", IDS_SETTINGS_SHOW_ADVANCED_SETTINGS }, |
| (...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 pref_service->FindPreference(prefs::kProxy); | 1706 pref_service->FindPreference(prefs::kProxy); |
| 1707 bool is_extension_controlled = (proxy_config && | 1707 bool is_extension_controlled = (proxy_config && |
| 1708 proxy_config->IsExtensionControlled()); | 1708 proxy_config->IsExtensionControlled()); |
| 1709 | 1709 |
| 1710 base::FundamentalValue disabled(is_win_ash || (proxy_config && | 1710 base::FundamentalValue disabled(is_win_ash || (proxy_config && |
| 1711 !proxy_config->IsUserModifiable())); | 1711 !proxy_config->IsUserModifiable())); |
| 1712 base::FundamentalValue extension_controlled(is_extension_controlled); | 1712 base::FundamentalValue extension_controlled(is_extension_controlled); |
| 1713 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsSection", | 1713 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsSection", |
| 1714 disabled, extension_controlled); | 1714 disabled, extension_controlled); |
| 1715 | 1715 |
| 1716 #if defined(OS_WIN) |
| 1717 SetupExtensionControlledIndicators(); |
| 1718 #endif // defined(OS_WIN) |
| 1719 |
| 1716 #endif // !defined(OS_CHROMEOS) | 1720 #endif // !defined(OS_CHROMEOS) |
| 1717 } | 1721 } |
| 1718 | 1722 |
| 1719 void BrowserOptionsHandler::SetupManageCertificatesSection() { | 1723 void BrowserOptionsHandler::SetupManageCertificatesSection() { |
| 1720 #if defined(OS_WIN) | 1724 #if defined(OS_WIN) |
| 1721 // Disable the button if the settings page is displayed in Windows Ash, | 1725 // Disable the button if the settings page is displayed in Windows Ash, |
| 1722 // otherwise the proxy settings dialog will open on the Windows desktop and | 1726 // otherwise the proxy settings dialog will open on the Windows desktop and |
| 1723 // be invisible to a user in Ash. | 1727 // be invisible to a user in Ash. |
| 1724 if (helper::GetDesktopType(web_ui()) == chrome::HOST_DESKTOP_TYPE_ASH) { | 1728 if (helper::GetDesktopType(web_ui()) == chrome::HOST_DESKTOP_TYPE_ASH) { |
| 1725 base::FundamentalValue enabled(false); | 1729 base::FundamentalValue enabled(false); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1775 &ignored_param); | 1779 &ignored_param); |
| 1776 if (ntp_url.SchemeIs("chrome-extension")) { | 1780 if (ntp_url.SchemeIs("chrome-extension")) { |
| 1777 using extensions::ExtensionRegistry; | 1781 using extensions::ExtensionRegistry; |
| 1778 ExtensionRegistry* registry = ExtensionRegistry::Get( | 1782 ExtensionRegistry* registry = ExtensionRegistry::Get( |
| 1779 Profile::FromWebUI(web_ui())); | 1783 Profile::FromWebUI(web_ui())); |
| 1780 extension = registry->GetExtensionById(ntp_url.host(), | 1784 extension = registry->GetExtensionById(ntp_url.host(), |
| 1781 ExtensionRegistry::ENABLED); | 1785 ExtensionRegistry::ENABLED); |
| 1782 } | 1786 } |
| 1783 AppendExtensionData("newTabPage", extension, &extension_controlled); | 1787 AppendExtensionData("newTabPage", extension, &extension_controlled); |
| 1784 | 1788 |
| 1789 // Check if an extension is overwriting the proxy setting. |
| 1790 extension = extensions::OverridesProxy( |
| 1791 Profile::FromWebUI(web_ui())); |
| 1792 AppendExtensionData("proxy", extension, &extension_controlled); |
| 1793 |
| 1785 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", | 1794 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", |
| 1786 extension_controlled); | 1795 extension_controlled); |
| 1787 #endif // defined(OS_WIN) | 1796 #endif // defined(OS_WIN) |
| 1788 } | 1797 } |
| 1789 | 1798 |
| 1790 } // namespace options | 1799 } // namespace options |
| OLD | NEW |