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

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

Issue 11308348: Correctly show disabled Flash versions in chrome://flash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/flash_ui.cc
diff --git a/chrome/browser/ui/webui/flash_ui.cc b/chrome/browser/ui/webui/flash_ui.cc
index 90200ec5f1b245c3c40b8f599ed6cd50afc574c2..76904f3ac9bda10a80dcb7d13091b751c713e651 100644
--- a/chrome/browser/ui/webui/flash_ui.cc
+++ b/chrome/browser/ui/webui/flash_ui.cc
@@ -271,20 +271,26 @@ void FlashDOMHandler::MaybeRespondToPage() {
std::vector<webkit::WebPluginInfo> info_array;
PluginService::GetInstance()->GetPluginInfoArray(
GURL(), kFlashPluginSwfMimeType, false, &info_array, NULL);
- string16 flash_version;
if (info_array.empty()) {
- AddPair(list, ASCIIToUTF16(kFlashPlugin), "Disabled");
+ AddPair(list, ASCIIToUTF16(kFlashPlugin), "Not installed");
} else {
PluginPrefs* plugin_prefs =
PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui()));
+ bool found_enabled = false;
for (size_t i = 0; i < info_array.size(); ++i) {
+ string16 flash_version = info_array[i].version + ASCIIToUTF16(" ") +
+ info_array[i].path.LossyDisplayName();
if (plugin_prefs->IsPluginEnabled(info_array[i])) {
- flash_version = info_array[i].version + ASCIIToUTF16(" ") +
- info_array[i].path.LossyDisplayName();
- if (i != 0)
+ // If we have already found an enabled Flash version, this one
+ // is not used.
+ if (found_enabled)
flash_version += ASCIIToUTF16(" (not used)");
- AddPair(list, ASCIIToUTF16(kFlashPlugin), flash_version);
+
+ found_enabled = true;
+ } else {
+ flash_version += ASCIIToUTF16(" (disabled)");
}
+ AddPair(list, ASCIIToUTF16(kFlashPlugin), flash_version);
}
}
« 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