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