| 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/pepper_flash.h" |
| 23 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
| 24 #include "chrome/grit/generated_resources.h" | 25 #include "chrome/grit/generated_resources.h" |
| 25 #include "components/content_settings/core/browser/host_content_settings_map.h" | 26 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 26 #include "components/prefs/pref_service.h" | 27 #include "components/prefs/pref_service.h" |
| 27 #include "components/prefs/scoped_user_pref_update.h" | 28 #include "components/prefs/scoped_user_pref_update.h" |
| 28 #include "content/public/browser/notification_observer.h" | 29 #include "content/public/browser/notification_observer.h" |
| 29 #include "content/public/browser/plugin_service.h" | 30 #include "content/public/browser/plugin_service.h" |
| 30 #include "content/public/browser/web_ui.h" | 31 #include "content/public/browser/web_ui.h" |
| 31 #include "content/public/common/content_constants.h" | 32 #include "content/public/common/content_constants.h" |
| 32 #include "mojo/common/common_type_converters.h" | 33 #include "mojo/common/common_type_converters.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // description as the system plugin to help the user disambiguate the | 68 // description as the system plugin to help the user disambiguate the |
| 68 // two plugins. | 69 // two plugins. |
| 69 base::string16 desc = plugin.desc; | 70 base::string16 desc = plugin.desc; |
| 70 if (plugin.is_pepper_plugin() && | 71 if (plugin.is_pepper_plugin() && |
| 71 plugin.name == base::ASCIIToUTF16(content::kFlashPluginName)) { | 72 plugin.name == base::ASCIIToUTF16(content::kFlashPluginName)) { |
| 72 base::FilePath system_flash_path; | 73 base::FilePath system_flash_path; |
| 73 PathService::Get(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN, | 74 PathService::Get(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN, |
| 74 &system_flash_path); | 75 &system_flash_path); |
| 75 if (base::FilePath::CompareEqualIgnoreCase(plugin.path.value(), | 76 if (base::FilePath::CompareEqualIgnoreCase(plugin.path.value(), |
| 76 system_flash_path.value())) { | 77 system_flash_path.value())) { |
| 77 #if defined(GOOGLE_CHROME_BUILD) | 78 if (chrome::IsSystemFlashScriptDebuggerPresent()) |
| 78 // Existing documentation for debugging Flash describe this plugin as | 79 desc += base::ASCIIToUTF16(" Debug"); |
| 79 // "Debug" so preserve this nomenclature here. | 80 else |
| 80 desc += base::ASCIIToUTF16(" Debug"); | 81 desc += base::ASCIIToUTF16(" System"); |
| 81 #else | |
| 82 // On Chromium, we can name it what it really is; the system plugin. | |
| 83 desc += base::ASCIIToUTF16(" System"); | |
| 84 #endif | |
| 85 } | 82 } |
| 86 } | 83 } |
| 87 return desc; | 84 return desc; |
| 88 } | 85 } |
| 89 | 86 |
| 90 mojo::Array<mojom::MimeTypePtr> GeneratePluginMimeTypes( | 87 mojo::Array<mojom::MimeTypePtr> GeneratePluginMimeTypes( |
| 91 const WebPluginInfo& plugin) { | 88 const WebPluginInfo& plugin) { |
| 92 mojo::Array<mojom::MimeTypePtr> mime_types; | 89 mojo::Array<mojom::MimeTypePtr> mime_types; |
| 93 for (const auto& plugin_mime_type : plugin.mime_types) { | 90 for (const auto& plugin_mime_type : plugin.mime_types) { |
| 94 mojom::MimeTypePtr mime_type(mojom::MimeType::New()); | 91 mojom::MimeTypePtr mime_type(mojom::MimeType::New()); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 } | 350 } |
| 354 | 351 |
| 355 if (plugins_enabled_by_policy) | 352 if (plugins_enabled_by_policy) |
| 356 return "enabledByPolicy"; | 353 return "enabledByPolicy"; |
| 357 if (plugins_disabled_by_policy) | 354 if (plugins_disabled_by_policy) |
| 358 return "disabledByPolicy"; | 355 return "disabledByPolicy"; |
| 359 if (plugins_managed_by_policy) | 356 if (plugins_managed_by_policy) |
| 360 return "managedByPolicy"; | 357 return "managedByPolicy"; |
| 361 return group_enabled ? "enabledByUser" : "disabledByUser"; | 358 return group_enabled ? "enabledByUser" : "disabledByUser"; |
| 362 } | 359 } |
| OLD | NEW |