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 "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1721 void BrowserOptionsHandler::SetupProxySettingsSection() { | 1721 void BrowserOptionsHandler::SetupProxySettingsSection() { |
1722 #if !defined(OS_CHROMEOS) | 1722 #if !defined(OS_CHROMEOS) |
1723 // Disable the button if proxy settings are managed by a sysadmin or | 1723 // Disable the button if proxy settings are managed by a sysadmin or |
1724 // overridden by an extension. | 1724 // overridden by an extension. |
1725 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1725 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
1726 const PrefService::Preference* proxy_config = | 1726 const PrefService::Preference* proxy_config = |
1727 pref_service->FindPreference(prefs::kProxy); | 1727 pref_service->FindPreference(prefs::kProxy); |
1728 bool is_extension_controlled = (proxy_config && | 1728 bool is_extension_controlled = (proxy_config && |
1729 proxy_config->IsExtensionControlled()); | 1729 proxy_config->IsExtensionControlled()); |
1730 | 1730 |
1731 base::FundamentalValue disabled(profile_pref_registrar_.IsManaged() || | 1731 base::FundamentalValue disabled(!proxy_config->IsUserModifiable()); |
1732 is_extension_controlled); | |
1733 base::FundamentalValue extension_controlled(is_extension_controlled); | 1732 base::FundamentalValue extension_controlled(is_extension_controlled); |
1734 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsSection", | 1733 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsSection", |
1735 disabled, extension_controlled); | 1734 disabled, extension_controlled); |
1736 | 1735 |
1737 #endif // !defined(OS_CHROMEOS) | 1736 #endif // !defined(OS_CHROMEOS) |
1738 } | 1737 } |
1739 | 1738 |
1740 } // namespace options | 1739 } // namespace options |
OLD | NEW |