OLD | NEW |
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/plugins_ui.h" | 5 #include "chrome/browser/ui/webui/plugins_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 419 |
420 plugin_files->Append(plugin_file); | 420 plugin_files->Append(plugin_file); |
421 } | 421 } |
422 DictionaryValue* group_data = new DictionaryValue(); | 422 DictionaryValue* group_data = new DictionaryValue(); |
423 | 423 |
424 group_data->Set("plugin_files", plugin_files); | 424 group_data->Set("plugin_files", plugin_files); |
425 group_data->SetString("name", group_name); | 425 group_data->SetString("name", group_name); |
426 group_data->SetString("id", group.identifier()); | 426 group_data->SetString("id", group.identifier()); |
427 group_data->SetString("description", active_plugin->desc); | 427 group_data->SetString("description", active_plugin->desc); |
428 group_data->SetString("version", active_plugin->version); | 428 group_data->SetString("version", active_plugin->version); |
| 429 group_data->SetBoolean("critical", group.IsVulnerable(*active_plugin)); |
429 | 430 |
| 431 std::string update_url; |
430 #if defined(ENABLE_PLUGIN_INSTALLATION) | 432 #if defined(ENABLE_PLUGIN_INSTALLATION) |
431 PluginInstaller* installer = | 433 PluginInstaller* installer = |
432 plugin_finder->FindPluginWithIdentifier(group.identifier()); | 434 plugin_finder->FindPluginWithIdentifier(group.identifier()); |
433 if (installer) { | 435 if (installer) |
434 bool out_of_date = installer->GetSecurityStatus(*active_plugin) == | 436 update_url = installer->plugin_url().spec(); |
435 PluginInstaller::SECURITY_STATUS_OUT_OF_DATE; | |
436 group_data->SetBoolean("critical", out_of_date); | |
437 group_data->SetString("update_url", installer->plugin_url().spec()); | |
438 } | |
439 #endif | 437 #endif |
| 438 group_data->SetString("update_url", update_url); |
440 | 439 |
441 std::string enabled_mode; | 440 std::string enabled_mode; |
442 if (all_plugins_enabled_by_policy) { | 441 if (all_plugins_enabled_by_policy) { |
443 enabled_mode = "enabledByPolicy"; | 442 enabled_mode = "enabledByPolicy"; |
444 } else if (all_plugins_disabled_by_policy) { | 443 } else if (all_plugins_disabled_by_policy) { |
445 enabled_mode = "disabledByPolicy"; | 444 enabled_mode = "disabledByPolicy"; |
446 } else if (group_enabled) { | 445 } else if (group_enabled) { |
447 enabled_mode = "enabledByUser"; | 446 enabled_mode = "enabledByUser"; |
448 } else { | 447 } else { |
449 enabled_mode = "disabledByUser"; | 448 enabled_mode = "disabledByUser"; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { | 490 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { |
492 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, | 491 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, |
493 false, | 492 false, |
494 PrefService::UNSYNCABLE_PREF); | 493 PrefService::UNSYNCABLE_PREF); |
495 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, | 494 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, |
496 true, | 495 true, |
497 PrefService::UNSYNCABLE_PREF); | 496 PrefService::UNSYNCABLE_PREF); |
498 prefs->RegisterDictionaryPref(prefs::kContentSettingsPluginWhitelist, | 497 prefs->RegisterDictionaryPref(prefs::kContentSettingsPluginWhitelist, |
499 PrefService::SYNCABLE_PREF); | 498 PrefService::SYNCABLE_PREF); |
500 } | 499 } |
OLD | NEW |