OLD | NEW |
---|---|
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 Loading... | |
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 PROCESS_DPI_AWARENESS process_dpi_awareness = |
131 base::win::GetVersion() >= base::win::VERSION_WIN10 | |
scottmg
2016/06/30 17:06:29
Why not >= VERSION_WIN8_1? If there's some good re
robliao
2016/06/30 19:53:48
Done. Add this comment:
// Enable per-monitor DP
| |
132 ? PROCESS_PER_MONITOR_DPI_AWARE | |
133 : PROCESS_SYSTEM_DPI_AWARE; | |
134 if (!SetProcessDpiAwarenessWrapper(process_dpi_awareness)) { | |
131 SetProcessDPIAwareWrapper(); | 135 SetProcessDPIAwareWrapper(); |
132 } | 136 } |
133 } | 137 } |
134 | 138 |
135 // Returns true if |command_line| contains a /prefetch:# argument where # is in | 139 // Returns true if |command_line| contains a /prefetch:# argument where # is in |
136 // [1, 8]. | 140 // [1, 8]. |
137 bool HasValidWindowsPrefetchArgument(const base::CommandLine& command_line) { | 141 bool HasValidWindowsPrefetchArgument(const base::CommandLine& command_line) { |
138 const base::char16 kPrefetchArgumentPrefix[] = L"/prefetch:"; | 142 const base::char16 kPrefetchArgumentPrefix[] = L"/prefetch:"; |
139 | 143 |
140 for (const auto& arg : command_line.argv()) { | 144 for (const auto& arg : command_line.argv()) { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 RemoveAppCompatFlagsEntry(); | 261 RemoveAppCompatFlagsEntry(); |
258 | 262 |
259 // Load and launch the chrome dll. *Everything* happens inside. | 263 // Load and launch the chrome dll. *Everything* happens inside. |
260 VLOG(1) << "About to load main DLL."; | 264 VLOG(1) << "About to load main DLL."; |
261 MainDllLoader* loader = MakeMainDllLoader(); | 265 MainDllLoader* loader = MakeMainDllLoader(); |
262 int rc = loader->Launch(instance); | 266 int rc = loader->Launch(instance); |
263 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); | 267 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); |
264 delete loader; | 268 delete loader; |
265 return rc; | 269 return rc; |
266 } | 270 } |
OLD | NEW |