summaryrefslogtreecommitdiffstats
path: root/chrome/app/chrome_exe_main_win.cc
diff options
context:
space:
mode:
authorcpu <cpu@chromium.org>2014-12-08 15:04:21 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-08 23:05:07 +0000
commit41b15014792895ca400934b2e39804bf4c41a370 (patch)
tree556d764c9a826b5df12eae335297cd5aa71c97df /chrome/app/chrome_exe_main_win.cc
parent65c887788b7f1fc16fd816863945a27b0df656b2 (diff)
downloadchromium_src-41b15014792895ca400934b2e39804bf4c41a370.zip
chromium_src-41b15014792895ca400934b2e39804bf4c41a370.tar.gz
chromium_src-41b15014792895ca400934b2e39804bf4c41a370.tar.bz2
remove safe mode key combo
This was for when we transitioned to Aura, Just a escape valve so if aura was hosed because of bad GPU, you could switch to software rendering without putting the command line into the shortcut. Just to help conops. Its been 11 months to the escape valve is not needed anymore. Also other minor cleanups, in particular removing sdk definitions. BUG=271719 Review URL: https://codereview.chromium.org/788473002 Cr-Commit-Position: refs/heads/master@{#307366}
Diffstat (limited to 'chrome/app/chrome_exe_main_win.cc')
-rw-r--r--chrome/app/chrome_exe_main_win.cc39
1 files changed, 7 insertions, 32 deletions
diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc
index 866ff3d..b09a76b 100644
--- a/chrome/app/chrome_exe_main_win.cc
+++ b/chrome/app/chrome_exe_main_win.cc
@@ -4,6 +4,7 @@
#include <windows.h>
#include <malloc.h>
+#include <shellscalingapi.h>
#include <tchar.h>
#include <string>
@@ -16,7 +17,6 @@
#include "chrome/app/client_util.h"
#include "chrome/browser/chrome_process_finder_win.h"
#include "chrome/browser/policy/policy_path_parser.h"
-#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
#include "chrome_elf/chrome_elf_main.h"
@@ -25,15 +25,6 @@
#include "ui/gfx/win/dpi.h"
namespace {
-
-void CheckSafeModeLaunch() {
- unsigned short k1 = ::GetAsyncKeyState(VK_CONTROL);
- unsigned short k2 = ::GetAsyncKeyState(VK_MENU);
- const unsigned short kPressedMask = 0x8000;
- if ((k1 & kPressedMask) && (k2 & kPressedMask))
- ::SetEnvironmentVariableA(chrome::kSafeModeEnvVar, "1");
-}
-
// List of switches that it's safe to rendezvous early with. Fast start should
// not be done if a command line contains a switch not in this set.
// Note this is currently stored as a list of two because it's probably faster
@@ -80,27 +71,13 @@ bool AttemptFastNotify(const CommandLine& command_line) {
chrome::NOTIFY_SUCCESS;
}
-// Duplicated from Win8.1 SDK ShellScalingApi.h
-typedef enum PROCESS_DPI_AWARENESS {
- PROCESS_DPI_UNAWARE = 0,
- PROCESS_SYSTEM_DPI_AWARE = 1,
- PROCESS_PER_MONITOR_DPI_AWARE = 2
-} PROCESS_DPI_AWARENESS;
-
-typedef enum MONITOR_DPI_TYPE {
- MDT_EFFECTIVE_DPI = 0,
- MDT_ANGULAR_DPI = 1,
- MDT_RAW_DPI = 2,
- MDT_DEFAULT = MDT_EFFECTIVE_DPI
-} MONITOR_DPI_TYPE;
-
// Win8.1 supports monitor-specific DPI scaling.
bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) {
typedef HRESULT(WINAPI *SetProcessDpiAwarenessPtr)(PROCESS_DPI_AWARENESS);
SetProcessDpiAwarenessPtr set_process_dpi_awareness_func =
reinterpret_cast<SetProcessDpiAwarenessPtr>(
GetProcAddress(GetModuleHandleA("user32.dll"),
- "SetProcessDpiAwarenessInternal"));
+ "SetProcessDpiAwarenessInternal"));
if (set_process_dpi_awareness_func) {
HRESULT hr = set_process_dpi_awareness_func(value);
if (SUCCEEDED(hr)) {
@@ -115,7 +92,7 @@ bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) {
}
// This function works for Windows Vista through Win8. Win8.1 must use
-// SetProcessDpiAwareness[Wrapper]
+// SetProcessDpiAwareness[Wrapper].
BOOL SetProcessDPIAwareWrapper() {
typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID);
SetProcessDPIAwarePtr set_process_dpi_aware_func =
@@ -126,7 +103,6 @@ BOOL SetProcessDPIAwareWrapper() {
set_process_dpi_aware_func();
}
-
void EnableHighDPISupport() {
if (!SetProcessDpiAwarenessWrapper(PROCESS_SYSTEM_DPI_AWARE)) {
SetProcessDPIAwareWrapper();
@@ -140,7 +116,7 @@ void SwitchToLFHeap() {
if (HeapSetInformation(reinterpret_cast<HANDLE>(crt_heap),
HeapCompatibilityInformation,
&enable_LFH, sizeof(enable_LFH))) {
- VLOG(1) << "low fragmentation heap enabled";
+ VLOG(1) << "Low fragmentation heap enabled.";
}
}
@@ -166,18 +142,17 @@ int main() {
// The exit manager is in charge of calling the dtors of singletons.
base::AtExitManager exit_manager;
- // We don't want to set DPI awareness on Vista because we don't support
+ // We don't want to set DPI awareness on pre-Win7 because we don't support
// DirectWrite there. GDI fonts are kerned very badly, so better to leave
// DPI-unaware and at effective 1.0. See also ShouldUseDirectWrite().
- if (base::win::GetVersion() > base::win::VERSION_VISTA)
+ if (base::win::GetVersion() >= base::win::VERSION_WIN7)
EnableHighDPISupport();
if (AttemptFastNotify(*CommandLine::ForCurrentProcess()))
return 0;
- CheckSafeModeLaunch();
-
// Load and launch the chrome dll. *Everything* happens inside.
+ VLOG(1) << "About to load main DLL.";
MainDllLoader* loader = MakeMainDllLoader();
int rc = loader->Launch(instance);
loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded();