Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4245)

Unified Diff: chrome/browser/ui/webui/version_handler.cc

Issue 2607953002: Add flash plugin path to chrome://version (Closed)
Patch Set: Fix the final nit. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/version_handler.cc
diff --git a/chrome/browser/ui/webui/version_handler.cc b/chrome/browser/ui/webui/version_handler.cc
index bea5fad951372f321d58a2a2d105788331062de4..b044d550915e55a0a860f79e6b96126225605503 100644
--- a/chrome/browser/ui/webui/version_handler.cc
+++ b/chrome/browser/ui/webui/version_handler.cc
@@ -10,6 +10,7 @@
#include "base/files/file_util.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string_util.h"
+#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/plugins/plugin_prefs.h"
#include "chrome/browser/profiles/profile.h"
@@ -109,20 +110,23 @@ void VersionHandler::OnGotPlugins(
std::vector<content::WebPluginInfo> info_array;
content::PluginService::GetInstance()->GetPluginInfoArray(
GURL(), content::kFlashPluginSwfMimeType, false, &info_array, NULL);
- base::string16 flash_version =
- l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_PLUGIN);
+ std::string flash_version_and_path =
+ l10n_util::GetStringUTF8(IDS_PLUGINS_DISABLED_PLUGIN);
PluginPrefs* plugin_prefs =
PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())).get();
if (plugin_prefs) {
for (size_t i = 0; i < info_array.size(); ++i) {
if (plugin_prefs->IsPluginEnabled(info_array[i])) {
- flash_version = info_array[i].version;
+ flash_version_and_path = base::StringPrintf(
+ "%s %s", base::UTF16ToUTF8(info_array[i].version).c_str(),
+ base::UTF16ToUTF8(info_array[i].path.LossyDisplayName()).c_str());
break;
}
}
}
- base::StringValue arg(flash_version);
+ base::StringValue arg(flash_version_and_path);
+
web_ui()->CallJavascriptFunctionUnsafe(version_ui::kReturnFlashVersion, arg);
}
#endif // BUILDFLAG(ENABLE_PLUGINS)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698