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

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

Issue 2175693004: Enable Per-Monitor DPI Unless Explicitly Disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 120
121 void EnableHighDPISupport() { 121 void EnableHighDPISupport() {
122 // Enable per-monitor DPI for Win10 or above instead of Win8.1 since Win8.1 122 // Enable per-monitor DPI for Win10 or above instead of Win8.1 since Win8.1
123 // does not have EnableChildWindowDpiMessage, necessary for correct non-client 123 // does not have EnableChildWindowDpiMessage, necessary for correct non-client
124 // area scaling across monitors. 124 // area scaling across monitors.
125 bool allowed_platform = base::win::GetVersion() >= base::win::VERSION_WIN10; 125 bool allowed_platform = base::win::GetVersion() >= base::win::VERSION_WIN10;
126 const base::CommandLine* command_line = 126 const base::CommandLine* command_line =
127 base::CommandLine::ForCurrentProcess(); 127 base::CommandLine::ForCurrentProcess();
128 bool per_monitor_dpi_switch = 128 bool per_monitor_dpi_switch =
129 command_line->HasSwitch(switches::kEnablePerMonitorDpi) &&
130 !command_line->HasSwitch(switches::kDisablePerMonitorDpi); 129 !command_line->HasSwitch(switches::kDisablePerMonitorDpi);
131 PROCESS_DPI_AWARENESS process_dpi_awareness = 130 PROCESS_DPI_AWARENESS process_dpi_awareness =
132 allowed_platform && per_monitor_dpi_switch 131 allowed_platform && per_monitor_dpi_switch
133 ? PROCESS_PER_MONITOR_DPI_AWARE 132 ? PROCESS_PER_MONITOR_DPI_AWARE
134 : PROCESS_SYSTEM_DPI_AWARE; 133 : PROCESS_SYSTEM_DPI_AWARE;
135 if (!SetProcessDpiAwarenessWrapper(process_dpi_awareness)) { 134 if (!SetProcessDpiAwarenessWrapper(process_dpi_awareness)) {
136 SetProcessDPIAwareWrapper(); 135 SetProcessDPIAwareWrapper();
137 } 136 }
138 } 137 }
139 138
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 RemoveAppCompatFlagsEntry(); 245 RemoveAppCompatFlagsEntry();
247 246
248 // Load and launch the chrome dll. *Everything* happens inside. 247 // Load and launch the chrome dll. *Everything* happens inside.
249 VLOG(1) << "About to load main DLL."; 248 VLOG(1) << "About to load main DLL.";
250 MainDllLoader* loader = MakeMainDllLoader(); 249 MainDllLoader* loader = MakeMainDllLoader();
251 int rc = loader->Launch(instance); 250 int rc = loader->Launch(instance);
252 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); 251 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded();
253 delete loader; 252 delete loader;
254 return rc; 253 return rc;
255 } 254 }
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