| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 if (ExtractDoubleValue(args, &zoom_factor)) { | 1652 if (ExtractDoubleValue(args, &zoom_factor)) { |
| 1653 ChromeZoomLevelPrefs* zoom_level_prefs = | 1653 ChromeZoomLevelPrefs* zoom_level_prefs = |
| 1654 Profile::FromWebUI(web_ui())->GetZoomLevelPrefs(); | 1654 Profile::FromWebUI(web_ui())->GetZoomLevelPrefs(); |
| 1655 DCHECK(zoom_level_prefs); | 1655 DCHECK(zoom_level_prefs); |
| 1656 zoom_level_prefs->SetDefaultZoomLevelPref( | 1656 zoom_level_prefs->SetDefaultZoomLevelPref( |
| 1657 content::ZoomFactorToZoomLevel(zoom_factor)); | 1657 content::ZoomFactorToZoomLevel(zoom_factor)); |
| 1658 } | 1658 } |
| 1659 } | 1659 } |
| 1660 | 1660 |
| 1661 void BrowserOptionsHandler::HandleRestartBrowser(const base::ListValue* args) { | 1661 void BrowserOptionsHandler::HandleRestartBrowser(const base::ListValue* args) { |
| 1662 #if defined(OS_WIN) | |
| 1663 // On Windows Breakpad will upload crash reports if the breakpad pipe name | |
| 1664 // environment variable is defined. So we undefine this environment variable | |
| 1665 // before restarting, as the restarted processes will inherit their | |
| 1666 // environment variables from ours, thus suppressing crash uploads. | |
| 1667 if (!ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()) { | |
| 1668 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); | |
| 1669 if (exe_module) { | |
| 1670 typedef void (__cdecl *ClearBreakpadPipeEnvVar)(); | |
| 1671 ClearBreakpadPipeEnvVar clear = reinterpret_cast<ClearBreakpadPipeEnvVar>( | |
| 1672 GetProcAddress(exe_module, "ClearBreakpadPipeEnvironmentVariable")); | |
| 1673 if (clear) | |
| 1674 clear(); | |
| 1675 } | |
| 1676 } | |
| 1677 #endif | |
| 1678 | |
| 1679 chrome::AttemptRestart(); | 1662 chrome::AttemptRestart(); |
| 1680 } | 1663 } |
| 1681 | 1664 |
| 1682 void BrowserOptionsHandler::HandleRequestProfilesInfo( | 1665 void BrowserOptionsHandler::HandleRequestProfilesInfo( |
| 1683 const base::ListValue* args) { | 1666 const base::ListValue* args) { |
| 1684 SendProfilesInfo(); | 1667 SendProfilesInfo(); |
| 1685 } | 1668 } |
| 1686 | 1669 |
| 1687 #if !defined(OS_CHROMEOS) | 1670 #if !defined(OS_CHROMEOS) |
| 1688 void BrowserOptionsHandler::ShowNetworkProxySettings( | 1671 void BrowserOptionsHandler::ShowNetworkProxySettings( |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2183 | 2166 |
| 2184 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { | 2167 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { |
| 2185 #if defined(OS_CHROMEOS) | 2168 #if defined(OS_CHROMEOS) |
| 2186 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); | 2169 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); |
| 2187 #else | 2170 #else |
| 2188 return true; | 2171 return true; |
| 2189 #endif | 2172 #endif |
| 2190 } | 2173 } |
| 2191 | 2174 |
| 2192 } // namespace options | 2175 } // namespace options |
| OLD | NEW |