Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2317)

Unified Diff: chrome/browser/chrome_browser_main_win.cc

Issue 57173002: Adds the concept of a 'safe mode' hotkey start (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/win/shortcut.cc ('k') | chrome/installer/setup/install.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_win.cc
===================================================================
--- chrome/browser/chrome_browser_main_win.cc (revision 232633)
+++ chrome/browser/chrome_browser_main_win.cc (working copy)
@@ -51,6 +51,7 @@
#include "ui/base/ui_base_switches.h"
#include "ui/base/win/message_box_win.h"
#include "ui/gfx/platform_font_win.h"
+#include "ui/gfx/switches.h"
namespace {
@@ -86,6 +87,18 @@
virtual string16 GetLocalizedString(int installer_string_id) OVERRIDE;
};
+// There is a special shortcut that you can start Chrome with that
+// puts it in a safe mode. Used for troubleshooting end-user issues.
+bool IsSafeModeStart() {
+ STARTUPINFOW si = {0};
+ ::GetStartupInfo(&si);
+ if ((si.dwFlags & STARTF_USEHOTKEY) == 0)
+ return false;
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution();
+ return (reinterpret_cast<ULONG_PTR>(si.hStdInput) ==
+ static_cast<ULONG_PTR>(dist->GetSafeModeHotkey()));
+}
+
} // namespace
void ShowCloseBrowserFirstMessageBox() {
@@ -208,6 +221,12 @@
int ChromeBrowserMainPartsWin::PreCreateThreads() {
int rv = ChromeBrowserMainParts::PreCreateThreads();
+ if (IsSafeModeStart()) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableGpu);
+ CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kHighDPISupport, "0");
+ }
+
// TODO(viettrungluu): why don't we run this earlier?
if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs) &&
base::win::GetVersion() < base::win::VERSION_XP) {
« no previous file with comments | « base/win/shortcut.cc ('k') | chrome/installer/setup/install.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698