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/strings/string_number_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 #if defined(OS_ANDROID) | 30 #if defined(OS_ANDROID) |
31 #include "base/android/build_info.h" | 31 #include "base/android/build_info.h" |
32 #include "chrome/browser/ui/android/android_about_app_info.h" | 32 #include "chrome/browser/ui/android/android_about_app_info.h" |
33 #endif | 33 #endif |
34 | 34 |
35 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
36 #include "chrome/browser/ui/webui/version_handler_chromeos.h" | 36 #include "chrome/browser/ui/webui/version_handler_chromeos.h" |
37 #endif | 37 #endif |
38 | 38 |
39 #include "dartvm_revision.h" // NOLINT | |
40 | |
41 namespace { | 39 namespace { |
42 | 40 |
43 content::WebUIDataSource* CreateVersionUIDataSource(Profile* profile) { | 41 content::WebUIDataSource* CreateVersionUIDataSource(Profile* profile) { |
44 content::WebUIDataSource* html_source = | 42 content::WebUIDataSource* html_source = |
45 content::WebUIDataSource::Create(chrome::kChromeUIVersionHost); | 43 content::WebUIDataSource::Create(chrome::kChromeUIVersionHost); |
46 | 44 |
47 // Localized and data strings. | 45 // Localized and data strings. |
48 html_source->AddLocalizedString("title", IDS_ABOUT_VERSION_TITLE); | 46 html_source->AddLocalizedString("title", IDS_ABOUT_VERSION_TITLE); |
49 chrome::VersionInfo version_info; | 47 chrome::VersionInfo version_info; |
50 html_source->AddString("version", version_info.Version()); | 48 html_source->AddString("version", version_info.Version()); |
51 html_source->AddString("version_modifier", | 49 html_source->AddString("version_modifier", |
52 chrome::VersionInfo::GetVersionStringModifier()); | 50 chrome::VersionInfo::GetVersionStringModifier()); |
53 html_source->AddLocalizedString("os_name", IDS_ABOUT_VERSION_OS); | 51 html_source->AddLocalizedString("os_name", IDS_ABOUT_VERSION_OS); |
54 html_source->AddLocalizedString("platform", IDS_PLATFORM_LABEL); | 52 html_source->AddLocalizedString("platform", IDS_PLATFORM_LABEL); |
55 html_source->AddString("os_type", version_info.OSType()); | 53 html_source->AddString("os_type", version_info.OSType()); |
56 html_source->AddString("blink_version", content::GetWebKitVersion()); | 54 html_source->AddString("blink_version", content::GetWebKitVersion()); |
57 html_source->AddString("js_engine", "V8"); | 55 html_source->AddString("js_engine", "V8"); |
58 html_source->AddString("js_version", v8::V8::GetVersion()); | 56 html_source->AddString("js_version", v8::V8::GetVersion()); |
59 html_source->AddString("dart_version", DART_VM_REVISION); | |
60 | 57 |
61 #if defined(OS_ANDROID) | 58 #if defined(OS_ANDROID) |
62 html_source->AddLocalizedString("application_label", | 59 html_source->AddLocalizedString("application_label", |
63 IDS_ABOUT_VERSION_APPLICATION); | 60 IDS_ABOUT_VERSION_APPLICATION); |
64 html_source->AddString("os_version", AndroidAboutAppInfo::GetOsInfo()); | 61 html_source->AddString("os_version", AndroidAboutAppInfo::GetOsInfo()); |
65 base::android::BuildInfo* android_build_info = | 62 base::android::BuildInfo* android_build_info = |
66 base::android::BuildInfo::GetInstance(); | 63 base::android::BuildInfo::GetInstance(); |
67 html_source->AddString("application_name", | 64 html_source->AddString("application_name", |
68 android_build_info->package_label()); | 65 android_build_info->package_label()); |
69 html_source->AddString("application_version_name", | 66 html_source->AddString("application_version_name", |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // Set up the chrome://theme/ source. | 148 // Set up the chrome://theme/ source. |
152 ThemeSource* theme = new ThemeSource(profile); | 149 ThemeSource* theme = new ThemeSource(profile); |
153 content::URLDataSource::Add(profile, theme); | 150 content::URLDataSource::Add(profile, theme); |
154 #endif | 151 #endif |
155 | 152 |
156 content::WebUIDataSource::Add(profile, CreateVersionUIDataSource(profile)); | 153 content::WebUIDataSource::Add(profile, CreateVersionUIDataSource(profile)); |
157 } | 154 } |
158 | 155 |
159 VersionUI::~VersionUI() { | 156 VersionUI::~VersionUI() { |
160 } | 157 } |
OLD | NEW |