OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_about_handler.h" | 5 #include "chrome/browser/browser_about_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "crypto/nss_util.h" | 53 #include "crypto/nss_util.h" |
54 #include "googleurl/src/gurl.h" | 54 #include "googleurl/src/gurl.h" |
55 #include "grit/browser_resources.h" | 55 #include "grit/browser_resources.h" |
56 #include "grit/chromium_strings.h" | 56 #include "grit/chromium_strings.h" |
57 #include "grit/generated_resources.h" | 57 #include "grit/generated_resources.h" |
58 #include "grit/locale_settings.h" | 58 #include "grit/locale_settings.h" |
59 #include "net/base/escape.h" | 59 #include "net/base/escape.h" |
60 #include "net/base/net_util.h" | 60 #include "net/base/net_util.h" |
61 #include "ui/base/l10n/l10n_util.h" | 61 #include "ui/base/l10n/l10n_util.h" |
62 #include "ui/base/resource/resource_bundle.h" | 62 #include "ui/base/resource/resource_bundle.h" |
| 63 #include "v8/include/v8.h" |
63 #include "webkit/glue/user_agent.h" | 64 #include "webkit/glue/user_agent.h" |
64 #include "webkit/glue/webkit_glue.h" | 65 #include "webkit/glue/webkit_glue.h" |
65 #include "webkit/plugins/npapi/plugin_list.h" | 66 #include "webkit/plugins/npapi/plugin_list.h" |
66 #include "webkit/plugins/webplugininfo.h" | 67 #include "webkit/plugins/webplugininfo.h" |
67 | 68 |
68 #ifdef CHROME_V8 | |
69 #include "v8/include/v8.h" | |
70 #endif | |
71 | |
72 #if defined(OS_WIN) | 69 #if defined(OS_WIN) |
73 #include "chrome/browser/enumerate_modules_model_win.h" | 70 #include "chrome/browser/enumerate_modules_model_win.h" |
74 #elif defined(OS_CHROMEOS) | 71 #elif defined(OS_CHROMEOS) |
75 #include "chrome/browser/chromeos/cros/cros_library.h" | 72 #include "chrome/browser/chromeos/cros/cros_library.h" |
76 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 73 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
77 #include "chrome/browser/chromeos/cros/network_library.h" | 74 #include "chrome/browser/chromeos/cros/network_library.h" |
78 #include "chrome/browser/chromeos/customization_document.h" | 75 #include "chrome/browser/chromeos/customization_document.h" |
79 #include "chrome/browser/chromeos/login/wizard_controller.h" | 76 #include "chrome/browser/chromeos/login/wizard_controller.h" |
80 #include "chrome/browser/chromeos/version_loader.h" | 77 #include "chrome/browser/chromeos/version_loader.h" |
81 #include "chrome/browser/oom_priority_manager.h" | 78 #include "chrome/browser/oom_priority_manager.h" |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 IDR_ABOUT_VERSION_JS : | 1098 IDR_ABOUT_VERSION_JS : |
1102 IDR_ABOUT_VERSION_HTML).as_string(); | 1099 IDR_ABOUT_VERSION_HTML).as_string(); |
1103 } | 1100 } |
1104 | 1101 |
1105 std::string AboutVersionStrings(DictionaryValue* localized_strings, | 1102 std::string AboutVersionStrings(DictionaryValue* localized_strings, |
1106 Profile* profile) { | 1103 Profile* profile) { |
1107 localized_strings->SetString("title", | 1104 localized_strings->SetString("title", |
1108 l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_TITLE)); | 1105 l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_TITLE)); |
1109 chrome::VersionInfo version_info; | 1106 chrome::VersionInfo version_info; |
1110 | 1107 |
1111 std::string webkit_version = webkit_glue::GetWebKitVersion(); | |
1112 #ifdef CHROME_V8 | |
1113 std::string js_version(v8::V8::GetVersion()); | |
1114 std::string js_engine = "V8"; | |
1115 #else | |
1116 std::string js_version = webkit_version; | |
1117 std::string js_engine = "JavaScriptCore"; | |
1118 #endif | |
1119 | |
1120 localized_strings->SetString("name", | 1108 localized_strings->SetString("name", |
1121 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 1109 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
1122 localized_strings->SetString("version", version_info.Version()); | 1110 localized_strings->SetString("version", version_info.Version()); |
1123 // Bug 79458: Need to evaluate the use of getting the version string on | 1111 // Bug 79458: Need to evaluate the use of getting the version string on |
1124 // this thread. | 1112 // this thread. |
1125 base::ThreadRestrictions::ScopedAllowIO allow_io; | 1113 base::ThreadRestrictions::ScopedAllowIO allow_io; |
1126 localized_strings->SetString("version_modifier", | 1114 localized_strings->SetString("version_modifier", |
1127 chrome::VersionInfo::GetVersionStringModifier()); | 1115 chrome::VersionInfo::GetVersionStringModifier()); |
1128 localized_strings->SetString("os_name", | 1116 localized_strings->SetString("os_name", |
1129 l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_OS)); | 1117 l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_OS)); |
1130 localized_strings->SetString("platform", | 1118 localized_strings->SetString("platform", |
1131 l10n_util::GetStringUTF16(IDS_PLATFORM_LABEL)); | 1119 l10n_util::GetStringUTF16(IDS_PLATFORM_LABEL)); |
1132 localized_strings->SetString("os_type", version_info.OSType()); | 1120 localized_strings->SetString("os_type", version_info.OSType()); |
1133 localized_strings->SetString("webkit_version", webkit_version); | 1121 localized_strings->SetString("webkit_version", |
1134 localized_strings->SetString("js_engine", js_engine); | 1122 webkit_glue::GetWebKitVersion()); |
1135 localized_strings->SetString("js_version", js_version); | 1123 localized_strings->SetString("js_engine", "V8"); |
| 1124 localized_strings->SetString("js_version", v8::V8::GetVersion()); |
1136 | 1125 |
1137 // Obtain the version of the first enabled Flash plugin. | 1126 // Obtain the version of the first enabled Flash plugin. |
1138 std::vector<webkit::WebPluginInfo> info_array; | 1127 std::vector<webkit::WebPluginInfo> info_array; |
1139 webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( | 1128 webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( |
1140 GURL(), "application/x-shockwave-flash", false, NULL, &info_array, NULL); | 1129 GURL(), "application/x-shockwave-flash", false, NULL, &info_array, NULL); |
1141 string16 flash_version = | 1130 string16 flash_version = |
1142 l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_PLUGIN); | 1131 l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_PLUGIN); |
1143 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile); | 1132 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile); |
1144 for (size_t i = 0; i < info_array.size(); ++i) { | 1133 for (size_t i = 0; i < info_array.size(); ++i) { |
1145 if (plugin_prefs->IsPluginEnabled(info_array[i])) { | 1134 if (plugin_prefs->IsPluginEnabled(info_array[i])) { |
1146 flash_version = info_array[i].version; | 1135 flash_version = info_array[i].version; |
1147 break; | 1136 break; |
1148 } | 1137 } |
1149 } | 1138 } |
1150 localized_strings->SetString("flash_plugin", "Flash"); | 1139 localized_strings->SetString("flash_plugin", "Flash"); |
1151 localized_strings->SetString("flash_version", flash_version); | 1140 localized_strings->SetString("flash_version", flash_version); |
1152 localized_strings->SetString("webkit_version", webkit_version); | |
1153 localized_strings->SetString("company", | 1141 localized_strings->SetString("company", |
1154 l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_COMPANY_NAME)); | 1142 l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_COMPANY_NAME)); |
1155 localized_strings->SetString("copyright", | 1143 localized_strings->SetString("copyright", |
1156 l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_COPYRIGHT)); | 1144 l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_COPYRIGHT)); |
1157 localized_strings->SetString("cl", version_info.LastChange()); | 1145 localized_strings->SetString("cl", version_info.LastChange()); |
1158 localized_strings->SetString("official", | 1146 localized_strings->SetString("official", |
1159 l10n_util::GetStringUTF16( | 1147 l10n_util::GetStringUTF16( |
1160 version_info.IsOfficialBuild() ? | 1148 version_info.IsOfficialBuild() ? |
1161 IDS_ABOUT_VERSION_OFFICIAL | 1149 IDS_ABOUT_VERSION_OFFICIAL |
1162 : IDS_ABOUT_VERSION_UNOFFICIAL)); | 1150 : IDS_ABOUT_VERSION_UNOFFICIAL)); |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 return false; | 1568 return false; |
1581 } | 1569 } |
1582 | 1570 |
1583 std::vector<std::string> ChromePaths() { | 1571 std::vector<std::string> ChromePaths() { |
1584 std::vector<std::string> paths; | 1572 std::vector<std::string> paths; |
1585 paths.reserve(arraysize(kChromePaths)); | 1573 paths.reserve(arraysize(kChromePaths)); |
1586 for (size_t i = 0; i < arraysize(kChromePaths); i++) | 1574 for (size_t i = 0; i < arraysize(kChromePaths); i++) |
1587 paths.push_back(kChromePaths[i]); | 1575 paths.push_back(kChromePaths[i]); |
1588 return paths; | 1576 return paths; |
1589 } | 1577 } |
OLD | NEW |