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/ui/webui/version_ui.h" | 5 #include "chrome/browser/ui/webui/version_ui.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/i18n/message_formatter.h" |
| 9 #include "base/time/time.h" |
9 #include "build/build_config.h" | 10 #include "build/build_config.h" |
10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/webui/version_handler.h" | 12 #include "chrome/browser/ui/webui/version_handler.h" |
12 #include "chrome/common/channel_info.h" | 13 #include "chrome/common/channel_info.h" |
13 #include "chrome/common/chrome_content_client.h" | 14 #include "chrome/common/chrome_content_client.h" |
14 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
15 #include "chrome/grit/chromium_strings.h" | 16 #include "chrome/grit/chromium_strings.h" |
16 #include "chrome/grit/generated_resources.h" | 17 #include "chrome/grit/generated_resources.h" |
17 #include "components/version_info/version_info.h" | 18 #include "components/version_info/version_info.h" |
18 #include "components/version_ui/version_ui_constants.h" | 19 #include "components/version_ui/version_ui_constants.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 #else | 73 #else |
73 html_source->AddString(version_ui::kOSVersion, std::string()); | 74 html_source->AddString(version_ui::kOSVersion, std::string()); |
74 html_source->AddString(version_ui::kFlashPlugin, "Flash"); | 75 html_source->AddString(version_ui::kFlashPlugin, "Flash"); |
75 // Note that the Flash version is retrieve asynchronously and returned in | 76 // Note that the Flash version is retrieve asynchronously and returned in |
76 // VersionHandler::OnGotPlugins. The area is initially blank. | 77 // VersionHandler::OnGotPlugins. The area is initially blank. |
77 html_source->AddString(version_ui::kFlashVersion, std::string()); | 78 html_source->AddString(version_ui::kFlashVersion, std::string()); |
78 #endif // defined(OS_ANDROID) | 79 #endif // defined(OS_ANDROID) |
79 | 80 |
80 html_source->AddLocalizedString(version_ui::kCompany, | 81 html_source->AddLocalizedString(version_ui::kCompany, |
81 IDS_ABOUT_VERSION_COMPANY_NAME); | 82 IDS_ABOUT_VERSION_COMPANY_NAME); |
82 base::Time::Exploded exploded_time; | |
83 base::Time::Now().LocalExplode(&exploded_time); | |
84 html_source->AddString( | 83 html_source->AddString( |
85 version_ui::kCopyright, | 84 version_ui::kCopyright, |
86 l10n_util::GetStringFUTF16(IDS_ABOUT_VERSION_COPYRIGHT, | 85 base::i18n::MessageFormatter::FormatWithNumberedArgs( |
87 base::IntToString16(exploded_time.year))); | 86 l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_COPYRIGHT), |
| 87 base::Time::Now())); |
88 html_source->AddLocalizedString(version_ui::kRevision, | 88 html_source->AddLocalizedString(version_ui::kRevision, |
89 IDS_VERSION_UI_REVISION); | 89 IDS_VERSION_UI_REVISION); |
90 html_source->AddString(version_ui::kCL, version_info::GetLastChange()); | 90 html_source->AddString(version_ui::kCL, version_info::GetLastChange()); |
91 html_source->AddLocalizedString(version_ui::kOfficial, | 91 html_source->AddLocalizedString(version_ui::kOfficial, |
92 version_info::IsOfficialBuild() | 92 version_info::IsOfficialBuild() |
93 ? IDS_VERSION_UI_OFFICIAL | 93 ? IDS_VERSION_UI_OFFICIAL |
94 : IDS_VERSION_UI_UNOFFICIAL); | 94 : IDS_VERSION_UI_UNOFFICIAL); |
95 #if defined(ARCH_CPU_64_BITS) | 95 #if defined(ARCH_CPU_64_BITS) |
96 html_source->AddLocalizedString(version_ui::kVersionBitSize, | 96 html_source->AddLocalizedString(version_ui::kVersionBitSize, |
97 IDS_VERSION_UI_64BIT); | 97 IDS_VERSION_UI_64BIT); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // Set up the chrome://theme/ source. | 172 // Set up the chrome://theme/ source. |
173 ThemeSource* theme = new ThemeSource(profile); | 173 ThemeSource* theme = new ThemeSource(profile); |
174 content::URLDataSource::Add(profile, theme); | 174 content::URLDataSource::Add(profile, theme); |
175 #endif | 175 #endif |
176 | 176 |
177 WebUIDataSource::Add(profile, CreateVersionUIDataSource()); | 177 WebUIDataSource::Add(profile, CreateVersionUIDataSource()); |
178 } | 178 } |
179 | 179 |
180 VersionUI::~VersionUI() { | 180 VersionUI::~VersionUI() { |
181 } | 181 } |
OLD | NEW |