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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/flash_ui.h" 5 #include "chrome/browser/ui/webui/flash_ui.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 os_label += "." + base::IntToString(os->service_pack().minor); 264 os_label += "." + base::IntToString(os->service_pack().minor);
265 if (os->architecture() == base::win::OSInfo::X64_ARCHITECTURE) 265 if (os->architecture() == base::win::OSInfo::X64_ARCHITECTURE)
266 os_label += " 64 bit"; 266 os_label += " 64 bit";
267 #endif 267 #endif
268 AddPair(list, l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_OS), os_label); 268 AddPair(list, l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_OS), os_label);
269 269
270 // Obtain the version of the Flash plugins. 270 // Obtain the version of the Flash plugins.
271 std::vector<webkit::WebPluginInfo> info_array; 271 std::vector<webkit::WebPluginInfo> info_array;
272 PluginService::GetInstance()->GetPluginInfoArray( 272 PluginService::GetInstance()->GetPluginInfoArray(
273 GURL(), kFlashPluginSwfMimeType, false, &info_array, NULL); 273 GURL(), kFlashPluginSwfMimeType, false, &info_array, NULL);
274 string16 flash_version;
275 if (info_array.empty()) { 274 if (info_array.empty()) {
276 AddPair(list, ASCIIToUTF16(kFlashPlugin), "Disabled"); 275 AddPair(list, ASCIIToUTF16(kFlashPlugin), "Not installed");
277 } else { 276 } else {
278 PluginPrefs* plugin_prefs = 277 PluginPrefs* plugin_prefs =
279 PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())); 278 PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui()));
279 bool found_enabled = false;
280 for (size_t i = 0; i < info_array.size(); ++i) { 280 for (size_t i = 0; i < info_array.size(); ++i) {
281 string16 flash_version = info_array[i].version + ASCIIToUTF16(" ") +
282 info_array[i].path.LossyDisplayName();
281 if (plugin_prefs->IsPluginEnabled(info_array[i])) { 283 if (plugin_prefs->IsPluginEnabled(info_array[i])) {
282 flash_version = info_array[i].version + ASCIIToUTF16(" ") + 284 // If we have already found an enabled Flash version, this one
283 info_array[i].path.LossyDisplayName(); 285 // is not used.
284 if (i != 0) 286 if (found_enabled)
285 flash_version += ASCIIToUTF16(" (not used)"); 287 flash_version += ASCIIToUTF16(" (not used)");
286 AddPair(list, ASCIIToUTF16(kFlashPlugin), flash_version); 288
289 found_enabled = true;
290 } else {
291 flash_version += ASCIIToUTF16(" (disabled)");
287 } 292 }
293 AddPair(list, ASCIIToUTF16(kFlashPlugin), flash_version);
288 } 294 }
289 } 295 }
290 296
291 // Crash information. 297 // Crash information.
292 AddPair(list, string16(), "--- Crash data ---"); 298 AddPair(list, string16(), "--- Crash data ---");
293 bool crash_reporting_enabled = CrashesUI::CrashReportingEnabled(); 299 bool crash_reporting_enabled = CrashesUI::CrashReportingEnabled();
294 if (crash_reporting_enabled) { 300 if (crash_reporting_enabled) {
295 std::vector<CrashUploadList::CrashInfo> crashes; 301 std::vector<CrashUploadList::CrashInfo> crashes;
296 upload_list_->GetUploadedCrashes(10, &crashes); 302 upload_list_->GetUploadedCrashes(10, &crashes);
297 303
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 Profile* profile = Profile::FromWebUI(web_ui); 389 Profile* profile = Profile::FromWebUI(web_ui);
384 ChromeURLDataManager::AddDataSource(profile, CreateFlashUIHTMLSource()); 390 ChromeURLDataManager::AddDataSource(profile, CreateFlashUIHTMLSource());
385 } 391 }
386 392
387 // static 393 // static
388 base::RefCountedMemory* FlashUI::GetFaviconResourceBytes( 394 base::RefCountedMemory* FlashUI::GetFaviconResourceBytes(
389 ui::ScaleFactor scale_factor) { 395 ui::ScaleFactor scale_factor) {
390 // Use the default icon for now. 396 // Use the default icon for now.
391 return NULL; 397 return NULL;
392 } 398 }
OLDNEW
« 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