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 #include <string> | 10 #include <string> |
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 void BrowserOptionsHandler::HandleDefaultZoomFactor( | 1579 void BrowserOptionsHandler::HandleDefaultZoomFactor( |
1580 const base::ListValue* args) { | 1580 const base::ListValue* args) { |
1581 double zoom_factor; | 1581 double zoom_factor; |
1582 if (ExtractDoubleValue(args, &zoom_factor)) { | 1582 if (ExtractDoubleValue(args, &zoom_factor)) { |
1583 Profile::FromWebUI(web_ui())->GetZoomLevelPrefs()->SetDefaultZoomLevelPref( | 1583 Profile::FromWebUI(web_ui())->GetZoomLevelPrefs()->SetDefaultZoomLevelPref( |
1584 content::ZoomFactorToZoomLevel(zoom_factor)); | 1584 content::ZoomFactorToZoomLevel(zoom_factor)); |
1585 } | 1585 } |
1586 } | 1586 } |
1587 | 1587 |
1588 void BrowserOptionsHandler::HandleRestartBrowser(const base::ListValue* args) { | 1588 void BrowserOptionsHandler::HandleRestartBrowser(const base::ListValue* args) { |
1589 #if defined(OS_WIN) && defined(USE_ASH) | |
1590 // If hardware acceleration is disabled then we need to force restart | |
1591 // browser in desktop mode. | |
1592 // TODO(shrikant): Remove this once we fix start mode logic for browser. | |
1593 // Currently there are issues with determining correct browser mode | |
1594 // at startup. | |
1595 if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) { | |
1596 PrefService* pref_service = g_browser_process->local_state(); | |
1597 if (!pref_service->GetBoolean(prefs::kHardwareAccelerationModeEnabled)) { | |
1598 chrome::AttemptRestartToDesktopMode(); | |
1599 return; | |
1600 } | |
1601 } | |
1602 #endif | |
1603 | |
1604 #if defined(OS_WIN) | 1589 #if defined(OS_WIN) |
1605 // On Windows Breakpad will upload crash reports if the breakpad pipe name | 1590 // On Windows Breakpad will upload crash reports if the breakpad pipe name |
1606 // environment variable is defined. So we undefine this environment variable | 1591 // environment variable is defined. So we undefine this environment variable |
1607 // before restarting, as the restarted processes will inherit their | 1592 // before restarting, as the restarted processes will inherit their |
1608 // environment variables from ours, thus suppressing crash uploads. | 1593 // environment variables from ours, thus suppressing crash uploads. |
1609 if (!ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()) { | 1594 if (!ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()) { |
1610 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); | 1595 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); |
1611 if (exe_module) { | 1596 if (exe_module) { |
1612 typedef void (__cdecl *ClearBreakpadPipeEnvVar)(); | 1597 typedef void (__cdecl *ClearBreakpadPipeEnvVar)(); |
1613 ClearBreakpadPipeEnvVar clear = reinterpret_cast<ClearBreakpadPipeEnvVar>( | 1598 ClearBreakpadPipeEnvVar clear = reinterpret_cast<ClearBreakpadPipeEnvVar>( |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2150 | 2135 |
2151 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { | 2136 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { |
2152 #if defined(OS_CHROMEOS) | 2137 #if defined(OS_CHROMEOS) |
2153 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); | 2138 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); |
2154 #else | 2139 #else |
2155 return true; | 2140 return true; |
2156 #endif | 2141 #endif |
2157 } | 2142 } |
2158 | 2143 |
2159 } // namespace options | 2144 } // namespace options |
OLD | NEW |