Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chrome_browser_main_win.h" | 5 #include "chrome/browser/chrome_browser_main_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 #include "chrome/installer/util/shell_util.h" | 40 #include "chrome/installer/util/shell_util.h" |
| 41 #include "content/public/common/main_function_params.h" | 41 #include "content/public/common/main_function_params.h" |
| 42 #include "grit/app_locale_settings.h" | 42 #include "grit/app_locale_settings.h" |
| 43 #include "grit/chromium_strings.h" | 43 #include "grit/chromium_strings.h" |
| 44 #include "grit/generated_resources.h" | 44 #include "grit/generated_resources.h" |
| 45 #include "installer_util_strings/installer_util_strings.h" | 45 #include "installer_util_strings/installer_util_strings.h" |
| 46 #include "ui/base/cursor/cursor_loader_win.h" | 46 #include "ui/base/cursor/cursor_loader_win.h" |
| 47 #include "ui/base/l10n/l10n_util.h" | 47 #include "ui/base/l10n/l10n_util.h" |
| 48 #include "ui/base/l10n/l10n_util_win.h" | 48 #include "ui/base/l10n/l10n_util_win.h" |
| 49 #include "ui/base/ui_base_switches.h" | 49 #include "ui/base/ui_base_switches.h" |
| 50 #include "ui/base/win/dpi_setup.h" | |
| 50 #include "ui/base/win/message_box_win.h" | 51 #include "ui/base/win/message_box_win.h" |
| 51 #include "ui/gfx/platform_font_win.h" | 52 #include "ui/gfx/platform_font_win.h" |
| 52 | 53 |
| 53 namespace { | 54 namespace { |
| 54 | 55 |
| 55 typedef HRESULT (STDAPICALLTYPE* RegisterApplicationRestartProc)( | 56 typedef HRESULT (STDAPICALLTYPE* RegisterApplicationRestartProc)( |
| 56 const wchar_t* command_line, | 57 const wchar_t* command_line, |
| 57 DWORD flags); | 58 DWORD flags); |
| 58 | 59 |
| 59 void InitializeWindowProcExceptions() { | 60 void InitializeWindowProcExceptions() { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 void ChromeBrowserMainPartsWin::PreMainMessageLoopStart() { | 195 void ChromeBrowserMainPartsWin::PreMainMessageLoopStart() { |
| 195 // installer_util references strings that are normally compiled into | 196 // installer_util references strings that are normally compiled into |
| 196 // setup.exe. In Chrome, these strings are in the locale files. | 197 // setup.exe. In Chrome, these strings are in the locale files. |
| 197 SetupInstallerUtilStrings(); | 198 SetupInstallerUtilStrings(); |
| 198 | 199 |
| 199 ChromeBrowserMainParts::PreMainMessageLoopStart(); | 200 ChromeBrowserMainParts::PreMainMessageLoopStart(); |
| 200 if (!parameters().ui_task) { | 201 if (!parameters().ui_task) { |
| 201 // Make sure that we know how to handle exceptions from the message loop. | 202 // Make sure that we know how to handle exceptions from the message loop. |
| 202 InitializeWindowProcExceptions(); | 203 InitializeWindowProcExceptions(); |
| 203 } | 204 } |
| 205 | |
| 206 ui::win::InitDeviceScaleFactor(); | |
|
sky
2013/09/25 19:28:15
Should this be earlier on? Maybe before toolkit is
| |
| 204 } | 207 } |
| 205 | 208 |
| 206 int ChromeBrowserMainPartsWin::PreCreateThreads() { | 209 int ChromeBrowserMainPartsWin::PreCreateThreads() { |
| 207 int rv = ChromeBrowserMainParts::PreCreateThreads(); | 210 int rv = ChromeBrowserMainParts::PreCreateThreads(); |
| 208 | 211 |
| 209 // TODO(viettrungluu): why don't we run this earlier? | 212 // TODO(viettrungluu): why don't we run this earlier? |
| 210 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs) && | 213 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs) && |
| 211 base::win::GetVersion() < base::win::VERSION_XP) { | 214 base::win::GetVersion() < base::win::VERSION_XP) { |
| 212 chrome::ShowMessageBox(NULL, | 215 chrome::ShowMessageBox(NULL, |
| 213 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 216 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 393 if (resource_id) | 396 if (resource_id) |
| 394 return l10n_util::GetStringUTF16(resource_id); | 397 return l10n_util::GetStringUTF16(resource_id); |
| 395 return string16(); | 398 return string16(); |
| 396 } | 399 } |
| 397 | 400 |
| 398 // static | 401 // static |
| 399 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 402 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
| 400 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 403 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
| 401 installer::SetTranslationDelegate(&delegate); | 404 installer::SetTranslationDelegate(&delegate); |
| 402 } | 405 } |
| OLD | NEW |