| 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" |
| 11 #include "chrome/browser/ui/webui/version_handler.h" | 11 #include "chrome/browser/ui/webui/version_handler.h" |
| 12 #include "chrome/common/chrome_content_client.h" | 12 #include "chrome/common/chrome_content_client.h" |
| 13 #include "chrome/common/chrome_version_info.h" | 13 #include "chrome/common/chrome_version_info.h" |
| 14 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
| 15 #include "content/public/browser/url_data_source.h" | 15 #include "content/public/browser/url_data_source.h" |
| 16 #include "content/public/browser/web_ui.h" | 16 #include "content/public/browser/web_ui.h" |
| 17 #include "content/public/browser/web_ui_data_source.h" | 17 #include "content/public/browser/web_ui_data_source.h" |
| 18 #include "content/public/common/user_agent.h" |
| 18 #include "grit/browser_resources.h" | 19 #include "grit/browser_resources.h" |
| 19 #include "grit/chromium_strings.h" | 20 #include "grit/chromium_strings.h" |
| 20 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
| 21 #include "grit/google_chrome_strings.h" | 22 #include "grit/google_chrome_strings.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
| 23 #include "v8/include/v8.h" | 24 #include "v8/include/v8.h" |
| 24 #include "webkit/common/user_agent/user_agent_util.h" | |
| 25 | 25 |
| 26 #if defined(ENABLE_THEMES) | 26 #if defined(ENABLE_THEMES) |
| 27 #include "chrome/browser/ui/webui/theme_source.h" | 27 #include "chrome/browser/ui/webui/theme_source.h" |
| 28 #endif | 28 #endif |
| 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 namespace { | 39 namespace { |
| 40 | 40 |
| 41 content::WebUIDataSource* CreateVersionUIDataSource(Profile* profile) { | 41 content::WebUIDataSource* CreateVersionUIDataSource(Profile* profile) { |
| 42 content::WebUIDataSource* html_source = | 42 content::WebUIDataSource* html_source = |
| 43 content::WebUIDataSource::Create(chrome::kChromeUIVersionHost); | 43 content::WebUIDataSource::Create(chrome::kChromeUIVersionHost); |
| 44 | 44 |
| 45 // Localized and data strings. | 45 // Localized and data strings. |
| 46 html_source->AddLocalizedString("title", IDS_ABOUT_VERSION_TITLE); | 46 html_source->AddLocalizedString("title", IDS_ABOUT_VERSION_TITLE); |
| 47 chrome::VersionInfo version_info; | 47 chrome::VersionInfo version_info; |
| 48 html_source->AddString("version", version_info.Version()); | 48 html_source->AddString("version", version_info.Version()); |
| 49 html_source->AddString("version_modifier", | 49 html_source->AddString("version_modifier", |
| 50 chrome::VersionInfo::GetVersionStringModifier()); | 50 chrome::VersionInfo::GetVersionStringModifier()); |
| 51 html_source->AddLocalizedString("os_name", IDS_ABOUT_VERSION_OS); | 51 html_source->AddLocalizedString("os_name", IDS_ABOUT_VERSION_OS); |
| 52 html_source->AddLocalizedString("platform", IDS_PLATFORM_LABEL); | 52 html_source->AddLocalizedString("platform", IDS_PLATFORM_LABEL); |
| 53 html_source->AddString("os_type", version_info.OSType()); | 53 html_source->AddString("os_type", version_info.OSType()); |
| 54 html_source->AddString("blink_version", webkit_glue::GetWebKitVersion()); | 54 html_source->AddString("blink_version", content::GetWebKitVersion()); |
| 55 html_source->AddString("js_engine", "V8"); | 55 html_source->AddString("js_engine", "V8"); |
| 56 html_source->AddString("js_version", v8::V8::GetVersion()); | 56 html_source->AddString("js_version", v8::V8::GetVersion()); |
| 57 | 57 |
| 58 #if defined(OS_ANDROID) | 58 #if defined(OS_ANDROID) |
| 59 html_source->AddLocalizedString("application_label", | 59 html_source->AddLocalizedString("application_label", |
| 60 IDS_ABOUT_VERSION_APPLICATION); | 60 IDS_ABOUT_VERSION_APPLICATION); |
| 61 html_source->AddString("os_version", AndroidAboutAppInfo::GetOsInfo()); | 61 html_source->AddString("os_version", AndroidAboutAppInfo::GetOsInfo()); |
| 62 base::android::BuildInfo* android_build_info = | 62 base::android::BuildInfo* android_build_info = |
| 63 base::android::BuildInfo::GetInstance(); | 63 base::android::BuildInfo::GetInstance(); |
| 64 html_source->AddString("application_name", | 64 html_source->AddString("application_name", |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Set up the chrome://theme/ source. | 148 // Set up the chrome://theme/ source. |
| 149 ThemeSource* theme = new ThemeSource(profile); | 149 ThemeSource* theme = new ThemeSource(profile); |
| 150 content::URLDataSource::Add(profile, theme); | 150 content::URLDataSource::Add(profile, theme); |
| 151 #endif | 151 #endif |
| 152 | 152 |
| 153 content::WebUIDataSource::Add(profile, CreateVersionUIDataSource(profile)); | 153 content::WebUIDataSource::Add(profile, CreateVersionUIDataSource(profile)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 VersionUI::~VersionUI() { | 156 VersionUI::~VersionUI() { |
| 157 } | 157 } |
| OLD | NEW |