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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
14 #include "chrome/app/chrome_breakpad_client.h" | 14 #include "chrome/app/chrome_breakpad_client.h" |
15 #include "chrome/app/client_util.h" | 15 #include "chrome/app/client_util.h" |
16 #include "chrome/app/metro_driver_win.h" | 16 #include "chrome/app/metro_driver_win.h" |
17 #include "chrome/browser/chrome_process_finder_win.h" | 17 #include "chrome/browser/chrome_process_finder_win.h" |
18 #include "chrome/browser/policy/policy_path_parser.h" | 18 #include "chrome/browser/policy/policy_path_parser.h" |
19 #include "chrome/common/chrome_constants.h" | 19 #include "chrome/common/chrome_constants.h" |
20 #include "chrome/common/chrome_paths_internal.h" | 20 #include "chrome/common/chrome_paths_internal.h" |
21 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
22 #include "chrome_elf/chrome_elf_main.h" | 22 #include "chrome_elf/chrome_elf_main.h" |
23 #include "components/breakpad/app/breakpad_client.h" | 23 #include "components/breakpad/app/breakpad_client.h" |
24 #include "components/breakpad/app/breakpad_win.h" | 24 #include "components/breakpad/app/breakpad_win.h" |
25 #include "components/startup_metric_utils/startup_metric_utils.h" | 25 #include "components/startup_metric_utils/startup_metric_utils.h" |
26 #include "content/public/app/startup_helper_win.h" | 26 #include "content/public/app/startup_helper_win.h" |
27 #include "content/public/common/result_codes.h" | 27 #include "content/public/common/result_codes.h" |
28 #include "sandbox/win/src/sandbox_factory.h" | 28 #include "sandbox/win/src/sandbox_factory.h" |
| 29 #include "ui/gfx/win/dpi.h" |
29 | 30 |
30 namespace { | 31 namespace { |
31 | 32 |
32 base::LazyInstance<chrome::ChromeBreakpadClient>::Leaky | 33 base::LazyInstance<chrome::ChromeBreakpadClient>::Leaky |
33 g_chrome_breakpad_client = LAZY_INSTANCE_INITIALIZER; | 34 g_chrome_breakpad_client = LAZY_INSTANCE_INITIALIZER; |
34 | 35 |
35 void CheckSafeModeLaunch() { | 36 void CheckSafeModeLaunch() { |
36 unsigned short k1 = ::GetAsyncKeyState(VK_CONTROL); | 37 unsigned short k1 = ::GetAsyncKeyState(VK_CONTROL); |
37 unsigned short k2 = ::GetAsyncKeyState(VK_MENU); | 38 unsigned short k2 = ::GetAsyncKeyState(VK_MENU); |
38 const unsigned short kPressedMask = 0x8000; | 39 const unsigned short kPressedMask = 0x8000; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 119 |
119 } // namespace | 120 } // namespace |
120 | 121 |
121 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) { | 122 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) { |
122 startup_metric_utils::RecordExeMainEntryTime(); | 123 startup_metric_utils::RecordExeMainEntryTime(); |
123 // Initialize the commandline singleton from the environment. | 124 // Initialize the commandline singleton from the environment. |
124 CommandLine::Init(0, NULL); | 125 CommandLine::Init(0, NULL); |
125 // The exit manager is in charge of calling the dtors of singletons. | 126 // The exit manager is in charge of calling the dtors of singletons. |
126 base::AtExitManager exit_manager; | 127 base::AtExitManager exit_manager; |
127 | 128 |
| 129 gfx::EnableHighDPISupport(); |
| 130 |
128 if (AttemptFastNotify(*CommandLine::ForCurrentProcess())) | 131 if (AttemptFastNotify(*CommandLine::ForCurrentProcess())) |
129 return 0; | 132 return 0; |
130 | 133 |
131 // The purpose of this call is to force the addition of an entry in the IAT | 134 // The purpose of this call is to force the addition of an entry in the IAT |
132 // for chrome_elf.dll to force a load time dependency. | 135 // for chrome_elf.dll to force a load time dependency. |
133 InitChromeElf(); | 136 InitChromeElf(); |
134 | 137 |
135 MetroDriver metro_driver; | 138 MetroDriver metro_driver; |
136 if (metro_driver.in_metro_mode()) | 139 if (metro_driver.in_metro_mode()) |
137 return metro_driver.RunInMetro(instance, &RunChrome); | 140 return metro_driver.RunInMetro(instance, &RunChrome); |
138 // Not in metro mode, proceed as normal. | 141 // Not in metro mode, proceed as normal. |
139 return RunChrome(instance); | 142 return RunChrome(instance); |
140 } | 143 } |
OLD | NEW |