diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-15 22:08:52 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-15 22:08:52 +0000 |
commit | 0e455283ea503530831c17390b634c70005a076c (patch) | |
tree | 554be0dfef4f41b28cc508282cb21c271c06c2be | |
parent | 3936c7789d5b2e0cd59e3fe17a66cb3d3e9f1486 (diff) | |
download | chromium_src-0e455283ea503530831c17390b634c70005a076c.zip chromium_src-0e455283ea503530831c17390b634c70005a076c.tar.gz chromium_src-0e455283ea503530831c17390b634c70005a076c.tar.bz2 |
Show version of Flash plugin on about:version. If no flash plugin is
enabled, we show "(disabled)".
BUG=45241
TEST=Open about:version and you should see the Flash version. Disable Flash
using about:plugins and about:version should update accordingly.
Review URL: http://codereview.chromium.org/6852023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81816 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser_about_handler.cc | 21 | ||||
-rw-r--r-- | chrome/browser/resources/about_version.html | 3 |
2 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index d03c149..12f008c 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -57,6 +57,9 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "webkit/glue/webkit_glue.h" +#include "webkit/glue/plugins/plugin_list.h" +#include "webkit/plugins/npapi/webplugininfo.h" + #ifdef CHROME_V8 #include "v8/include/v8.h" #endif @@ -920,10 +923,28 @@ std::string AboutVersion(DictionaryValue* localized_strings) { localized_strings->SetString("name", l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); localized_strings->SetString("version", version_info.Version()); + // Bug 79458: Need to evaluate the use of getting the version string on + // this thread. + base::ThreadRestrictions::ScopedAllowIO allow_io; localized_strings->SetString("version_modifier", platform_util::GetVersionStringModifier()); localized_strings->SetString("js_engine", js_engine); localized_strings->SetString("js_version", js_version); + + // Obtain the version of the first enabled Flash plugin. + std::vector<webkit::npapi::WebPluginInfo> info_array; + webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( + GURL(), "application/x-shockwave-flash", false, &info_array, NULL); + string16 flash_version = + l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_PLUGIN); + for (size_t i = 0; i < info_array.size(); ++i) { + if (webkit::npapi::IsPluginEnabled(info_array[i])) { + flash_version = info_array[i].version; + break; + } + } + localized_strings->SetString("flash_plugin", "Flash"); + localized_strings->SetString("flash_version", flash_version); localized_strings->SetString("webkit_version", webkit_version); localized_strings->SetString("company", l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_COMPANY_NAME)); diff --git a/chrome/browser/resources/about_version.html b/chrome/browser/resources/about_version.html index 29dc838..9d3e368 100644 --- a/chrome/browser/resources/about_version.html +++ b/chrome/browser/resources/about_version.html @@ -83,6 +83,9 @@ about:version template page <tr><td class="label" valign="top" i18n-content="js_engine"></td> <td class="version" id="js_version" i18n-content="js_version"></td> </tr> + <tr><td class="label" valign="top" i18n-content="flash_plugin"></td> + <td class="version" id="flash_version" i18n-content="flash_version"></td> + </tr> <tr><td class="label" valign="top" i18n-content="user_agent_name"></td> <td class="version" id="useragent" i18n-content="useragent"></td> </tr> |