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

Side by Side Diff: chrome/app/chrome_exe_main_win.cc

Issue 2114503002: Enable Per-Monitor Support for Windows 10 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@framefix
Patch Set: Add Comment Created 4 years, 5 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <windows.h> 5 #include <windows.h>
6 #include <malloc.h> 6 #include <malloc.h>
7 #include <shellscalingapi.h> 7 #include <shellscalingapi.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <tchar.h> 9 #include <tchar.h>
10 10
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID); 120 typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID);
121 SetProcessDPIAwarePtr set_process_dpi_aware_func = 121 SetProcessDPIAwarePtr set_process_dpi_aware_func =
122 reinterpret_cast<SetProcessDPIAwarePtr>( 122 reinterpret_cast<SetProcessDPIAwarePtr>(
123 GetProcAddress(GetModuleHandleA("user32.dll"), 123 GetProcAddress(GetModuleHandleA("user32.dll"),
124 "SetProcessDPIAware")); 124 "SetProcessDPIAware"));
125 return set_process_dpi_aware_func && 125 return set_process_dpi_aware_func &&
126 set_process_dpi_aware_func(); 126 set_process_dpi_aware_func();
127 } 127 }
128 128
129 void EnableHighDPISupport() { 129 void EnableHighDPISupport() {
130 if (!SetProcessDpiAwarenessWrapper(PROCESS_SYSTEM_DPI_AWARE)) { 130 // Enable per-monitor DPI for Win10 or above instead of Win8.1 since Win8.1
131 // does not have EnableChildWindowDpiMessage, necessary for correct non-client
132 // area scaling across monitors.
133 PROCESS_DPI_AWARENESS process_dpi_awareness =
134 base::win::GetVersion() >= base::win::VERSION_WIN10
135 ? PROCESS_PER_MONITOR_DPI_AWARE
136 : PROCESS_SYSTEM_DPI_AWARE;
137 if (!SetProcessDpiAwarenessWrapper(process_dpi_awareness)) {
131 SetProcessDPIAwareWrapper(); 138 SetProcessDPIAwareWrapper();
132 } 139 }
133 } 140 }
134 141
135 // Returns true if |command_line| contains a /prefetch:# argument where # is in 142 // Returns true if |command_line| contains a /prefetch:# argument where # is in
136 // [1, 8]. 143 // [1, 8].
137 bool HasValidWindowsPrefetchArgument(const base::CommandLine& command_line) { 144 bool HasValidWindowsPrefetchArgument(const base::CommandLine& command_line) {
138 const base::char16 kPrefetchArgumentPrefix[] = L"/prefetch:"; 145 const base::char16 kPrefetchArgumentPrefix[] = L"/prefetch:";
139 146
140 for (const auto& arg : command_line.argv()) { 147 for (const auto& arg : command_line.argv()) {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 RemoveAppCompatFlagsEntry(); 264 RemoveAppCompatFlagsEntry();
258 265
259 // Load and launch the chrome dll. *Everything* happens inside. 266 // Load and launch the chrome dll. *Everything* happens inside.
260 VLOG(1) << "About to load main DLL."; 267 VLOG(1) << "About to load main DLL.";
261 MainDllLoader* loader = MakeMainDllLoader(); 268 MainDllLoader* loader = MakeMainDllLoader();
262 int rc = loader->Launch(instance); 269 int rc = loader->Launch(instance);
263 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); 270 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded();
264 delete loader; 271 delete loader;
265 return rc; 272 return rc;
266 } 273 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698