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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1648 } | 1648 } |
1649 } | 1649 } |
1650 | 1650 |
1651 void BrowserOptionsHandler::HandleRestartBrowser(const base::ListValue* args) { | 1651 void BrowserOptionsHandler::HandleRestartBrowser(const base::ListValue* args) { |
1652 #if defined(OS_WIN) && defined(USE_ASH) | 1652 #if defined(OS_WIN) && defined(USE_ASH) |
1653 // If hardware acceleration is disabled then we need to force restart | 1653 // If hardware acceleration is disabled then we need to force restart |
1654 // browser in desktop mode. | 1654 // browser in desktop mode. |
1655 // TODO(shrikant): Remove this once we fix start mode logic for browser. | 1655 // TODO(shrikant): Remove this once we fix start mode logic for browser. |
1656 // Currently there are issues with determining correct browser mode | 1656 // Currently there are issues with determining correct browser mode |
1657 // at startup. | 1657 // at startup. |
1658 if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) { | 1658 if (chrome::GetActiveDesktop() == ui::HOST_DESKTOP_TYPE_ASH) { |
1659 PrefService* pref_service = g_browser_process->local_state(); | 1659 PrefService* pref_service = g_browser_process->local_state(); |
1660 if (!pref_service->GetBoolean(prefs::kHardwareAccelerationModeEnabled)) { | 1660 if (!pref_service->GetBoolean(prefs::kHardwareAccelerationModeEnabled)) { |
1661 chrome::AttemptRestartToDesktopMode(); | 1661 chrome::AttemptRestartToDesktopMode(); |
1662 return; | 1662 return; |
1663 } | 1663 } |
1664 } | 1664 } |
1665 #endif | 1665 #endif |
1666 | 1666 |
1667 #if defined(OS_WIN) | 1667 #if defined(OS_WIN) |
1668 // On Windows Breakpad will upload crash reports if the breakpad pipe name | 1668 // On Windows Breakpad will upload crash reports if the breakpad pipe name |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2040 } | 2040 } |
2041 | 2041 |
2042 void BrowserOptionsHandler::SetupProxySettingsSection() { | 2042 void BrowserOptionsHandler::SetupProxySettingsSection() { |
2043 #if !defined(OS_CHROMEOS) | 2043 #if !defined(OS_CHROMEOS) |
2044 // Disable the button if proxy settings are managed by a sysadmin, overridden | 2044 // Disable the button if proxy settings are managed by a sysadmin, overridden |
2045 // by an extension, or the browser is running in Windows Ash (on Windows the | 2045 // by an extension, or the browser is running in Windows Ash (on Windows the |
2046 // proxy settings dialog will open on the Windows desktop and be invisible | 2046 // proxy settings dialog will open on the Windows desktop and be invisible |
2047 // to a user in Ash). | 2047 // to a user in Ash). |
2048 bool is_win_ash = false; | 2048 bool is_win_ash = false; |
2049 #if defined(OS_WIN) | 2049 #if defined(OS_WIN) |
2050 chrome::HostDesktopType desktop_type = helper::GetDesktopType(web_ui()); | 2050 ui::HostDesktopType desktop_type = helper::GetDesktopType(web_ui()); |
2051 is_win_ash = (desktop_type == chrome::HOST_DESKTOP_TYPE_ASH); | 2051 is_win_ash = (desktop_type == ui::HOST_DESKTOP_TYPE_ASH); |
2052 #endif | 2052 #endif |
2053 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 2053 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
2054 const PrefService::Preference* proxy_config = | 2054 const PrefService::Preference* proxy_config = |
2055 pref_service->FindPreference(proxy_config::prefs::kProxy); | 2055 pref_service->FindPreference(proxy_config::prefs::kProxy); |
2056 bool is_extension_controlled = (proxy_config && | 2056 bool is_extension_controlled = (proxy_config && |
2057 proxy_config->IsExtensionControlled()); | 2057 proxy_config->IsExtensionControlled()); |
2058 | 2058 |
2059 base::FundamentalValue disabled(is_win_ash || (proxy_config && | 2059 base::FundamentalValue disabled(is_win_ash || (proxy_config && |
2060 !proxy_config->IsUserModifiable())); | 2060 !proxy_config->IsUserModifiable())); |
2061 base::FundamentalValue extension_controlled(is_extension_controlled); | 2061 base::FundamentalValue extension_controlled(is_extension_controlled); |
2062 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsButton", | 2062 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsButton", |
2063 disabled, extension_controlled); | 2063 disabled, extension_controlled); |
2064 | 2064 |
2065 #if defined(OS_WIN) | 2065 #if defined(OS_WIN) |
2066 SetupExtensionControlledIndicators(); | 2066 SetupExtensionControlledIndicators(); |
2067 #endif // defined(OS_WIN) | 2067 #endif // defined(OS_WIN) |
2068 | 2068 |
2069 #endif // !defined(OS_CHROMEOS) | 2069 #endif // !defined(OS_CHROMEOS) |
2070 } | 2070 } |
2071 | 2071 |
2072 void BrowserOptionsHandler::SetupManageCertificatesSection() { | 2072 void BrowserOptionsHandler::SetupManageCertificatesSection() { |
2073 #if defined(OS_WIN) | 2073 #if defined(OS_WIN) |
2074 // Disable the button if the settings page is displayed in Windows Ash, | 2074 // Disable the button if the settings page is displayed in Windows Ash, |
2075 // otherwise the proxy settings dialog will open on the Windows desktop and | 2075 // otherwise the proxy settings dialog will open on the Windows desktop and |
2076 // be invisible to a user in Ash. | 2076 // be invisible to a user in Ash. |
2077 if (helper::GetDesktopType(web_ui()) == chrome::HOST_DESKTOP_TYPE_ASH) { | 2077 if (helper::GetDesktopType(web_ui()) == ui::HOST_DESKTOP_TYPE_ASH) { |
2078 base::FundamentalValue enabled(false); | 2078 base::FundamentalValue enabled(false); |
2079 web_ui()->CallJavascriptFunction("BrowserOptions.enableCertificateButton", | 2079 web_ui()->CallJavascriptFunction("BrowserOptions.enableCertificateButton", |
2080 enabled); | 2080 enabled); |
2081 } | 2081 } |
2082 #endif // defined(OS_WIN) | 2082 #endif // defined(OS_WIN) |
2083 } | 2083 } |
2084 | 2084 |
2085 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { | 2085 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { |
2086 bool has_users = !Profile::FromWebUI(web_ui())-> | 2086 bool has_users = !Profile::FromWebUI(web_ui())-> |
2087 GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty(); | 2087 GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty(); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2183 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2183 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
2184 const policy::PolicyMap& previous, | 2184 const policy::PolicyMap& previous, |
2185 const policy::PolicyMap& current) { | 2185 const policy::PolicyMap& current) { |
2186 std::set<std::string> different_keys; | 2186 std::set<std::string> different_keys; |
2187 current.GetDifferingKeys(previous, &different_keys); | 2187 current.GetDifferingKeys(previous, &different_keys); |
2188 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2188 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
2189 SetupMetricsReportingCheckbox(); | 2189 SetupMetricsReportingCheckbox(); |
2190 } | 2190 } |
2191 | 2191 |
2192 } // namespace options | 2192 } // namespace options |
OLD | NEW |