| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void WarnAboutMinimumSystemRequirements() { | 92 void WarnAboutMinimumSystemRequirements() { |
| 93 if (base::win::GetVersion() < base::win::VERSION_XP) { | 93 if (base::win::GetVersion() < base::win::VERSION_XP) { |
| 94 const string16 title = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 94 const string16 title = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
| 95 const string16 message = | 95 const string16 message = |
| 96 l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP); | 96 l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP); |
| 97 browser::ShowMessageBox(NULL, title, message, | 97 browser::ShowMessageBox(NULL, title, message, |
| 98 browser::MESSAGE_BOX_TYPE_WARNING); | 98 browser::MESSAGE_BOX_TYPE_WARNING); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 void RecordBrowserStartupTime() { | |
| 103 // Calculate the time that has elapsed from our own process creation. | |
| 104 FILETIME creation_time = {}; | |
| 105 FILETIME ignore = {}; | |
| 106 ::GetProcessTimes(::GetCurrentProcess(), &creation_time, &ignore, &ignore, | |
| 107 &ignore); | |
| 108 | |
| 109 RecordPreReadExperimentTime("Startup.BrowserMessageLoopStartTime", | |
| 110 base::Time::Now() - base::Time::FromFileTime(creation_time)); | |
| 111 } | |
| 112 | |
| 113 void ShowCloseBrowserFirstMessageBox() { | 102 void ShowCloseBrowserFirstMessageBox() { |
| 114 const string16 title = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 103 const string16 title = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
| 115 const string16 message = l10n_util::GetStringUTF16(IDS_UNINSTALL_CLOSE_APP); | 104 const string16 message = l10n_util::GetStringUTF16(IDS_UNINSTALL_CLOSE_APP); |
| 116 browser::ShowMessageBox(NULL, title, message, | 105 browser::ShowMessageBox(NULL, title, message, |
| 117 browser::MESSAGE_BOX_TYPE_WARNING); | 106 browser::MESSAGE_BOX_TYPE_WARNING); |
| 118 } | 107 } |
| 119 | 108 |
| 120 int DoUninstallTasks(bool chrome_still_running) { | 109 int DoUninstallTasks(bool chrome_still_running) { |
| 121 // We want to show a warning to user (and exit) if Chrome is already running | 110 // We want to show a warning to user (and exit) if Chrome is already running |
| 122 // *before* we show the uninstall confirmation dialog box. But while the | 111 // *before* we show the uninstall confirmation dialog box. But while the |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 if (resource_id) | 327 if (resource_id) |
| 339 return l10n_util::GetStringUTF16(resource_id); | 328 return l10n_util::GetStringUTF16(resource_id); |
| 340 return string16(); | 329 return string16(); |
| 341 } | 330 } |
| 342 | 331 |
| 343 // static | 332 // static |
| 344 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 333 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
| 345 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 334 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
| 346 installer::SetTranslationDelegate(&delegate); | 335 installer::SetTranslationDelegate(&delegate); |
| 347 } | 336 } |
| OLD | NEW |