Chromium Code Reviews| 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/win/scoped_hdc.h" | |
| 13 #include "base/win/windows_version.h" | 14 #include "base/win/windows_version.h" |
| 14 #include "chrome/app/client_util.h" | 15 #include "chrome/app/client_util.h" |
| 15 #include "chrome/browser/chrome_process_finder_win.h" | 16 #include "chrome/browser/chrome_process_finder_win.h" |
| 16 #include "chrome/browser/policy/policy_path_parser.h" | 17 #include "chrome/browser/policy/policy_path_parser.h" |
| 17 #include "chrome/common/chrome_constants.h" | 18 #include "chrome/common/chrome_constants.h" |
| 18 #include "chrome/common/chrome_paths_internal.h" | 19 #include "chrome/common/chrome_paths_internal.h" |
| 19 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome_elf/chrome_elf_main.h" | 21 #include "chrome_elf/chrome_elf_main.h" |
| 21 #include "components/startup_metric_utils/startup_metric_utils.h" | 22 #include "components/startup_metric_utils/startup_metric_utils.h" |
| 22 #include "content/public/common/result_codes.h" | 23 #include "content/public/common/result_codes.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 CommandLine::Init(0, NULL); | 98 CommandLine::Init(0, NULL); |
| 98 // The exit manager is in charge of calling the dtors of singletons. | 99 // The exit manager is in charge of calling the dtors of singletons. |
| 99 base::AtExitManager exit_manager; | 100 base::AtExitManager exit_manager; |
| 100 | 101 |
| 101 // We don't want to set DPI awareness on Vista because we don't support | 102 // We don't want to set DPI awareness on Vista because we don't support |
| 102 // DirectWrite there. GDI fonts are kerned very badly, so better to leave | 103 // DirectWrite there. GDI fonts are kerned very badly, so better to leave |
| 103 // DPI-unaware and at effective 1.0. See also ShouldUseDirectWrite(). | 104 // DPI-unaware and at effective 1.0. See also ShouldUseDirectWrite(). |
| 104 if (base::win::GetVersion() > base::win::VERSION_VISTA) | 105 if (base::win::GetVersion() > base::win::VERSION_VISTA) |
| 105 gfx::EnableHighDPISupport(); | 106 gfx::EnableHighDPISupport(); |
| 106 | 107 |
| 108 base::win::ScopedGetDC screen_dc(NULL); | |
| 109 int dpi_x = ::GetDeviceCaps(screen_dc, LOGPIXELSX); | |
| 110 if (dpi_x < 140) { | |
| 111 CommandLine::ForCurrentProcess()->AppendSwitchNative( | |
| 112 "force-device-scale-factor", L"1"); | |
|
cpu_(ooo_6.6-7.5)
2014/08/28 20:59:37
kForceDeviceScaleFactor ?
| |
| 113 } | |
| 114 | |
| 107 if (AttemptFastNotify(*CommandLine::ForCurrentProcess())) | 115 if (AttemptFastNotify(*CommandLine::ForCurrentProcess())) |
| 108 return 0; | 116 return 0; |
| 109 | 117 |
| 110 CheckSafeModeLaunch(); | 118 CheckSafeModeLaunch(); |
| 111 | 119 |
| 112 // Load and launch the chrome dll. *Everything* happens inside. | 120 // Load and launch the chrome dll. *Everything* happens inside. |
| 113 MainDllLoader* loader = MakeMainDllLoader(); | 121 MainDllLoader* loader = MakeMainDllLoader(); |
| 114 int rc = loader->Launch(instance); | 122 int rc = loader->Launch(instance); |
| 115 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); | 123 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); |
| 116 delete loader; | 124 delete loader; |
| 117 return rc; | 125 return rc; |
| 118 } | 126 } |
| OLD | NEW |