| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/plugins_handler.h" | 5 #include "chrome/browser/ui/webui/plugins/plugins_handler.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 // Update |active_plugin| and |group_enabled|. | 251 // Update |active_plugin| and |group_enabled|. |
| 252 if (!active_plugin || (plugin_enabled && !group_enabled)) | 252 if (!active_plugin || (plugin_enabled && !group_enabled)) |
| 253 active_plugin = group_plugin; | 253 active_plugin = group_plugin; |
| 254 group_enabled = plugin_enabled || group_enabled; | 254 group_enabled = plugin_enabled || group_enabled; |
| 255 } | 255 } |
| 256 | 256 |
| 257 plugin_data->enabled_mode = mojo::String::From( | 257 plugin_data->enabled_mode = mojo::String::From( |
| 258 GetPluginGroupEnabledMode(plugin_files, group_enabled)); | 258 GetPluginGroupEnabledMode(plugin_files, group_enabled)); |
| 259 | 259 |
| 260 plugin_data->always_allowed = false; | 260 plugin_data->always_allowed = false; |
| 261 plugin_data->trusted = false; |
| 262 |
| 261 if (group_enabled) { | 263 if (group_enabled) { |
| 262 const base::DictionaryValue* whitelist = | 264 if (plugin_metadata->GetSecurityStatus(*active_plugin) == |
| 263 profile->GetPrefs()->GetDictionary( | 265 PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) { |
| 264 prefs::kContentSettingsPluginWhitelist); | 266 plugin_data->trusted = true; |
| 265 whitelist->GetBoolean(group_identifier, &plugin_data->always_allowed); | 267 plugin_data->always_allowed = true; |
| 268 } else { |
| 269 const base::DictionaryValue* whitelist = |
| 270 profile->GetPrefs()->GetDictionary( |
| 271 prefs::kContentSettingsPluginWhitelist); |
| 272 whitelist->GetBoolean(group_identifier, &plugin_data->always_allowed); |
| 273 } |
| 266 } | 274 } |
| 267 | 275 |
| 268 plugin_data->critical = false; | 276 plugin_data->critical = false; |
| 269 plugin_data->update_url = ""; | 277 plugin_data->update_url = ""; |
| 270 #if defined(ENABLE_PLUGIN_INSTALLATION) | 278 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 271 bool out_of_date = plugin_metadata->GetSecurityStatus(*active_plugin) == | 279 bool out_of_date = plugin_metadata->GetSecurityStatus(*active_plugin) == |
| 272 PluginMetadata::SECURITY_STATUS_OUT_OF_DATE; | 280 PluginMetadata::SECURITY_STATUS_OUT_OF_DATE; |
| 273 plugin_data->critical = out_of_date; | 281 plugin_data->critical = out_of_date; |
| 274 plugin_data->update_url = plugin_metadata->plugin_url().spec(); | 282 plugin_data->update_url = plugin_metadata->plugin_url().spec(); |
| 275 #endif | 283 #endif |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 351 } |
| 344 | 352 |
| 345 if (plugins_enabled_by_policy) | 353 if (plugins_enabled_by_policy) |
| 346 return "enabledByPolicy"; | 354 return "enabledByPolicy"; |
| 347 if (plugins_disabled_by_policy) | 355 if (plugins_disabled_by_policy) |
| 348 return "disabledByPolicy"; | 356 return "disabledByPolicy"; |
| 349 if (plugins_managed_by_policy) | 357 if (plugins_managed_by_policy) |
| 350 return "managedByPolicy"; | 358 return "managedByPolicy"; |
| 351 return group_enabled ? "enabledByUser" : "disabledByUser"; | 359 return group_enabled ? "enabledByUser" : "disabledByUser"; |
| 352 } | 360 } |
| OLD | NEW |