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 <memory> | 7 #include <memory> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "chrome/browser/chrome_notification_types.h" | 15 #include "chrome/browser/chrome_notification_types.h" |
16 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 16 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
17 #include "chrome/browser/plugins/plugin_finder.h" | 17 #include "chrome/browser/plugins/plugin_finder.h" |
18 #include "chrome/browser/plugins/plugin_metadata.h" | 18 #include "chrome/browser/plugins/plugin_metadata.h" |
19 #include "chrome/browser/plugins/plugin_prefs.h" | 19 #include "chrome/browser/plugins/plugin_prefs.h" |
20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/common/chrome_content_client.h" | 21 #include "chrome/common/chrome_content_client.h" |
22 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
| 23 #include "chrome/common/features.h" |
23 #include "chrome/common/pepper_flash.h" | 24 #include "chrome/common/pepper_flash.h" |
24 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
25 #include "chrome/grit/generated_resources.h" | 26 #include "chrome/grit/generated_resources.h" |
26 #include "components/content_settings/core/browser/host_content_settings_map.h" | 27 #include "components/content_settings/core/browser/host_content_settings_map.h" |
27 #include "components/prefs/pref_service.h" | 28 #include "components/prefs/pref_service.h" |
28 #include "components/prefs/scoped_user_pref_update.h" | 29 #include "components/prefs/scoped_user_pref_update.h" |
29 #include "content/public/browser/notification_observer.h" | 30 #include "content/public/browser/notification_observer.h" |
30 #include "content/public/browser/plugin_service.h" | 31 #include "content/public/browser/plugin_service.h" |
31 #include "content/public/browser/web_ui.h" | 32 #include "content/public/browser/web_ui.h" |
32 #include "content/public/common/content_constants.h" | 33 #include "content/public/common/content_constants.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } else if (!GetClickToPlayPolicyEnabled()) { | 272 } else if (!GetClickToPlayPolicyEnabled()) { |
272 const base::DictionaryValue* whitelist = | 273 const base::DictionaryValue* whitelist = |
273 profile->GetPrefs()->GetDictionary( | 274 profile->GetPrefs()->GetDictionary( |
274 prefs::kContentSettingsPluginWhitelist); | 275 prefs::kContentSettingsPluginWhitelist); |
275 whitelist->GetBoolean(group_identifier, &plugin_data->always_allowed); | 276 whitelist->GetBoolean(group_identifier, &plugin_data->always_allowed); |
276 } | 277 } |
277 } | 278 } |
278 | 279 |
279 plugin_data->critical = false; | 280 plugin_data->critical = false; |
280 plugin_data->update_url = ""; | 281 plugin_data->update_url = ""; |
281 #if defined(ENABLE_PLUGIN_INSTALLATION) | 282 #if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) |
282 bool out_of_date = plugin_metadata->GetSecurityStatus(*active_plugin) == | 283 bool out_of_date = plugin_metadata->GetSecurityStatus(*active_plugin) == |
283 PluginMetadata::SECURITY_STATUS_OUT_OF_DATE; | 284 PluginMetadata::SECURITY_STATUS_OUT_OF_DATE; |
284 plugin_data->critical = out_of_date; | 285 plugin_data->critical = out_of_date; |
285 plugin_data->update_url = plugin_metadata->plugin_url().spec(); | 286 plugin_data->update_url = plugin_metadata->plugin_url().spec(); |
286 #endif | 287 #endif |
287 | 288 |
288 plugin_data->description = mojo::String::From(active_plugin->desc); | 289 plugin_data->description = mojo::String::From(active_plugin->desc); |
289 plugin_data->name = base::UTF16ToUTF8(plugin_metadata->name()); | 290 plugin_data->name = base::UTF16ToUTF8(plugin_metadata->name()); |
290 plugin_data->plugin_files = std::move(plugin_files); | 291 plugin_data->plugin_files = std::move(plugin_files); |
291 plugin_data->version = mojo::String::From(active_plugin->version); | 292 plugin_data->version = mojo::String::From(active_plugin->version); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 } | 365 } |
365 | 366 |
366 if (plugins_enabled_by_policy) | 367 if (plugins_enabled_by_policy) |
367 return "enabledByPolicy"; | 368 return "enabledByPolicy"; |
368 if (plugins_disabled_by_policy) | 369 if (plugins_disabled_by_policy) |
369 return "disabledByPolicy"; | 370 return "disabledByPolicy"; |
370 if (plugins_managed_by_policy) | 371 if (plugins_managed_by_policy) |
371 return "managedByPolicy"; | 372 return "managedByPolicy"; |
372 return group_enabled ? "enabledByUser" : "disabledByUser"; | 373 return group_enabled ? "enabledByUser" : "disabledByUser"; |
373 } | 374 } |
OLD | NEW |