| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/chromeos/login/background_view.h" | 5 #include "chrome/browser/chromeos/login/background_view.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "app/x11_util.h" | 9 #include "app/x11_util.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 version_text += l10n_util::GetStringUTF8(IDS_VERSION_FIELD_PREFIX); | 191 version_text += l10n_util::GetStringUTF8(IDS_VERSION_FIELD_PREFIX); |
| 192 version_text += ' '; | 192 version_text += ' '; |
| 193 version_text += version; | 193 version_text += version; |
| 194 os_version_label_->SetText(ASCIIToWide(version_text)); | 194 os_version_label_->SetText(ASCIIToWide(version_text)); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void BackgroundView::OnBootTimes( | 197 void BackgroundView::OnBootTimes( |
| 198 BootTimesLoader::Handle handle, BootTimesLoader::BootTimes boot_times) { | 198 BootTimesLoader::Handle handle, BootTimesLoader::BootTimes boot_times) { |
| 199 // TODO(davemoore) if we decide to keep these times visible we will need | 199 // TODO(davemoore) if we decide to keep these times visible we will need |
| 200 // to localize the strings. | 200 // to localize the strings. |
| 201 std::string boot_times_text = | 201 const char* kBootTimesNoChromeExec = |
| 202 StringPrintf( | 202 "Boot took %.2f seconds (firmware %.2fs, kernel %.2fs, system %.2fs)"; |
| 203 "Boot took %.2f seconds " | 203 const char* kBootTimesChromeExec = |
| 204 "(firmware %.2fs, kernel %.2fs, user %.2fs)", | 204 "Boot took %.2f seconds " |
| 205 boot_times.firmware + boot_times.login_prompt_ready, | 205 "(firmware %.2fs, kernel %.2fs, system %.2fs, chrome %.2fs)"; |
| 206 boot_times.firmware, | 206 std::string boot_times_text; |
| 207 boot_times.pre_startup, | 207 |
| 208 boot_times.login_prompt_ready - boot_times.pre_startup); | 208 if (boot_times.chrome_exec > 0) { |
| 209 boot_times_text = |
| 210 StringPrintf( |
| 211 kBootTimesChromeExec, |
| 212 boot_times.firmware + boot_times.login_prompt_ready, |
| 213 boot_times.firmware, |
| 214 boot_times.pre_startup, |
| 215 boot_times.chrome_exec - boot_times.pre_startup, |
| 216 boot_times.login_prompt_ready - boot_times.chrome_exec); |
| 217 } else { |
| 218 boot_times_text = |
| 219 StringPrintf( |
| 220 kBootTimesNoChromeExec, |
| 221 boot_times.firmware + boot_times.login_prompt_ready, |
| 222 boot_times.firmware, |
| 223 boot_times.pre_startup, |
| 224 boot_times.login_prompt_ready - boot_times.pre_startup); |
| 225 } |
| 209 boot_times_label_->SetText(ASCIIToWide(boot_times_text)); | 226 boot_times_label_->SetText(ASCIIToWide(boot_times_text)); |
| 210 } | 227 } |
| 211 | 228 |
| 212 } // namespace chromeos | 229 } // namespace chromeos |
| OLD | NEW |