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 <tchar.h> | 6 #include <tchar.h> |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 typedef enum MONITOR_DPI_TYPE { | 89 typedef enum MONITOR_DPI_TYPE { |
90 MDT_EFFECTIVE_DPI = 0, | 90 MDT_EFFECTIVE_DPI = 0, |
91 MDT_ANGULAR_DPI = 1, | 91 MDT_ANGULAR_DPI = 1, |
92 MDT_RAW_DPI = 2, | 92 MDT_RAW_DPI = 2, |
93 MDT_DEFAULT = MDT_EFFECTIVE_DPI | 93 MDT_DEFAULT = MDT_EFFECTIVE_DPI |
94 } MONITOR_DPI_TYPE; | 94 } MONITOR_DPI_TYPE; |
95 | 95 |
96 // Win8.1 supports monitor-specific DPI scaling. | 96 // Win8.1 supports monitor-specific DPI scaling. |
97 bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) { | 97 bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) { |
98 typedef BOOL(WINAPI *SetProcessDpiAwarenessPtr)(PROCESS_DPI_AWARENESS); | 98 typedef HRESULT(WINAPI *SetProcessDpiAwarenessPtr)(PROCESS_DPI_AWARENESS); |
99 SetProcessDpiAwarenessPtr set_process_dpi_awareness_func = | 99 SetProcessDpiAwarenessPtr set_process_dpi_awareness_func = |
100 reinterpret_cast<SetProcessDpiAwarenessPtr>( | 100 reinterpret_cast<SetProcessDpiAwarenessPtr>( |
101 GetProcAddress(GetModuleHandleA("user32.dll"), | 101 GetProcAddress(GetModuleHandleA("user32.dll"), |
102 "SetProcessDpiAwarenessInternal")); | 102 "SetProcessDpiAwarenessInternal")); |
103 if (set_process_dpi_awareness_func) { | 103 if (set_process_dpi_awareness_func) { |
104 HRESULT hr = set_process_dpi_awareness_func(value); | 104 HRESULT hr = set_process_dpi_awareness_func(value); |
105 if (SUCCEEDED(hr)) { | 105 if (SUCCEEDED(hr)) { |
106 VLOG(1) << "SetProcessDpiAwareness succeeded."; | 106 VLOG(1) << "SetProcessDpiAwareness succeeded."; |
107 return true; | 107 return true; |
108 } else if (hr == E_ACCESSDENIED) { | 108 } else if (hr == E_ACCESSDENIED) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 CheckSafeModeLaunch(); | 164 CheckSafeModeLaunch(); |
165 | 165 |
166 // Load and launch the chrome dll. *Everything* happens inside. | 166 // Load and launch the chrome dll. *Everything* happens inside. |
167 MainDllLoader* loader = MakeMainDllLoader(); | 167 MainDllLoader* loader = MakeMainDllLoader(); |
168 int rc = loader->Launch(instance); | 168 int rc = loader->Launch(instance); |
169 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); | 169 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); |
170 delete loader; | 170 delete loader; |
171 return rc; | 171 return rc; |
172 } | 172 } |
OLD | NEW |