Commit c66a327e authored by tommycli's avatar tommycli Committed by Commit bot

Plugins: Remove chrome://plugins

BUG=615738
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2630443002
Cr-Commit-Position: refs/heads/master@{#443264}
parent 5159f105
...@@ -3920,7 +3920,7 @@ Data associated with this app will be removed from this device. ...@@ -3920,7 +3920,7 @@ Data associated with this app will be removed from this device.
</message> </message>
<message name="IDS_EXTENSION_PROMPT_WARNING_CLIPBOARD_WRITE" desc="Permission string for acess to clipboard for write permission."> <message name="IDS_EXTENSION_PROMPT_WARNING_CLIPBOARD_WRITE" desc="Permission string for acess to clipboard for write permission.">
Modify data you copy and paste Modify data you copy and paste
</message> </message>
<message name="IDS_EXTENSION_PROMPT_WARNING_DEBUGGER" desc="Permission string for access to debugger."> <message name="IDS_EXTENSION_PROMPT_WARNING_DEBUGGER" desc="Permission string for access to debugger.">
Access the page debugger backend Access the page debugger backend
</message> </message>
...@@ -5282,74 +5282,10 @@ Keep your key file in a safe place. You will need it to create new versions of y ...@@ -5282,74 +5282,10 @@ Keep your key file in a safe place. You will need it to create new versions of y
Component downloading Component downloading
</message> </message>
<!-- Plugins -->
<if expr="enable_plugins"> <if expr="enable_plugins">
<message name="IDS_PLUGINS_TITLE" desc="Title for the chrome://plugins page.">
Plugins
</message>
<message name="IDS_PLUGINS_DETAILS_MODE_LINK" desc="Text of the link for details mode.">
Details
</message>
<message name="IDS_PLUGINS_NONE_INSTALLED" desc="Text that lets the user know that no plugins are installed.">
No plugins installed.
</message>
<message name="IDS_PLUGINS_DISABLED_PLUGIN" desc="Text that signifies that the plugin is currently disabled."> <message name="IDS_PLUGINS_DISABLED_PLUGIN" desc="Text that signifies that the plugin is currently disabled.">
(Disabled) (Disabled)
</message> </message>
<message name="IDS_PLUGINS_DISABLED_BY_POLICY_PLUGIN" desc="Text that signifies that the plugin is currently disabled by enterprise policy.">
(Disabled by enterprise policy)
</message>
<message name="IDS_PLUGINS_ENABLED_BY_POLICY_PLUGIN" desc="Text that signifies that the plugin is currently enabled by enterprise policy.">
(Enabled by enterprise policy)
</message>
<message name="IDS_PLUGINS_GROUP_MANAGED_BY_POLICY" desc="Text that signifies that the plugin group is currently managed by enterprise policy.">
(Managed by enterprise policy)
</message>
<message name="IDS_PLUGINS_VERSION" desc="The label in front of a plugin version number.">
Version:
</message>
<message name="IDS_PLUGINS_DESCRIPTION" desc="The label in front of a plugin description.">
Description:
</message>
<message name="IDS_PLUGINS_PATH" desc="The label in front of a plugin path (file/location on disk).">
Location:
</message>
<message name="IDS_PLUGINS_TYPE" desc="The label in front of a plugin type (NPAPI, PPAPI, etc.).">
Type:
</message>
<message name="IDS_PLUGINS_MIME_TYPES" desc="The label in front of a plugin's MIME types table.">
MIME types:
</message>
<message name="IDS_PLUGINS_MIME_TYPES_MIME_TYPE" desc="The label over the MIME type column in a plugin's MIME types table.">
MIME type
</message>
<message name="IDS_PLUGINS_MIME_TYPES_DESCRIPTION" desc="The label over the description column in a plugin's MIME types table.">
Description
</message>
<message name="IDS_PLUGINS_MIME_TYPES_FILE_EXTENSIONS" desc="The label over the file extensions column in a plugin's MIME types table.">
File extensions
</message>
<message name="IDS_PLUGINS_ALWAYS_ALLOWED" desc="The checkbox label for whitelisting a plugin for content settings.">
Always allowed to run
</message>
<message name="IDS_PLUGINS_DOWNLOAD" desc="The link label to download the latest version of this plugin">
Download Critical Security Update
</message>
<message name="IDS_PLUGINS_NAME" desc="The label for the name of this plugin">
Name:
</message>
<message name="IDS_PLUGINS_NO_PLUGINS" desc="Text that indicates that no plugins are installed">
No plugins are installed
</message>
<message name="IDS_PLUGINS_PPAPI_IN_PROCESS" desc="Text that indicates the plugin is an in-process PPAPI plugin.">
PPAPI (in-process)
</message>
<message name="IDS_PLUGINS_PPAPI_OUT_OF_PROCESS" desc="Text that indicates the plugin is an out-of-process PPAPI plugin.">
PPAPI (out-of-process)
</message>
<message name="IDS_PLUGINS_BROWSER_PLUGIN" desc="Text that indicates the plugin is a browser plugin.">
BROWSER PLUGIN
</message>
</if> </if>
<message name="IDS_FLAGS_NACL_NAME" desc="Name of the 'Native Client' lab."> <message name="IDS_FLAGS_NACL_NAME" desc="Name of the 'Native Client' lab.">
......
...@@ -4127,7 +4127,6 @@ grit("resources") { ...@@ -4127,7 +4127,6 @@ grit("resources") {
"//chrome/app:chrome_content_browser_manifest_overlay", "//chrome/app:chrome_content_browser_manifest_overlay",
"//chrome/browser/ui/webui/engagement:mojo_bindings__generator", "//chrome/browser/ui/webui/engagement:mojo_bindings__generator",
"//chrome/browser/ui/webui/omnibox:mojo_bindings__generator", "//chrome/browser/ui/webui/omnibox:mojo_bindings__generator",
"//chrome/browser/ui/webui/plugins:mojo_bindings__generator",
"//chrome/browser/ui/webui/usb_internals:mojo_bindings__generator", "//chrome/browser/ui/webui/usb_internals:mojo_bindings__generator",
"//device/bluetooth/public/interfaces:experimental_interfaces__generator", "//device/bluetooth/public/interfaces:experimental_interfaces__generator",
"//url/mojo:url_mojom_gurl__generator", "//url/mojo:url_mojom_gurl__generator",
......
...@@ -363,11 +363,6 @@ ...@@ -363,11 +363,6 @@
<include name="IDR_OMNIBOX_JS" file="resources\omnibox\omnibox.js" type="BINDATA" /> <include name="IDR_OMNIBOX_JS" file="resources\omnibox\omnibox.js" type="BINDATA" />
<include name="IDR_OMNIBOX_MOJO_JS" file="${root_gen_dir}\chrome\browser\ui\webui\omnibox\omnibox.mojom.js" use_base_dir="false" type="BINDATA"/> <include name="IDR_OMNIBOX_MOJO_JS" file="${root_gen_dir}\chrome\browser\ui\webui\omnibox\omnibox.mojom.js" use_base_dir="false" type="BINDATA"/>
<include name="IDR_ORIGIN_MOJO_JS" file="${root_gen_dir}\url\mojo\origin.mojom.js" use_base_dir="false" type="BINDATA" compress="gzip"/> <include name="IDR_ORIGIN_MOJO_JS" file="${root_gen_dir}\url\mojo\origin.mojom.js" use_base_dir="false" type="BINDATA" compress="gzip"/>
<if expr="enable_plugins">
<include name="IDR_PLUGINS_HTML" file="resources\plugins.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_PLUGINS_JS" file="resources\plugins.js" type="BINDATA" />
<include name="IDR_PLUGINS_MOJO_JS" file="${root_gen_dir}\chrome\browser\ui\webui\plugins\plugins.mojom.js" use_base_dir="false" type="BINDATA"/>
</if>
<include name="IDR_COMPONENTS_HTML" file="resources\components.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> <include name="IDR_COMPONENTS_HTML" file="resources\components.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_COMPONENTS_JS" file="resources\components.js" type="BINDATA" /> <include name="IDR_COMPONENTS_JS" file="resources\components.js" type="BINDATA" />
<if expr="enable_plugins"> <if expr="enable_plugins">
......
...@@ -65,7 +65,6 @@ ...@@ -65,7 +65,6 @@
#include "chrome/browser/ui/webui/flags_ui.h" #include "chrome/browser/ui/webui/flags_ui.h"
#include "chrome/browser/ui/webui/instant_ui.h" #include "chrome/browser/ui/webui/instant_ui.h"
#include "chrome/browser/ui/webui/ntp/new_tab_ui.h" #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
#include "chrome/browser/ui/webui/plugins/plugins_ui.h"
#include "chrome/browser/ui/webui/print_preview/sticky_settings.h" #include "chrome/browser/ui/webui/print_preview/sticky_settings.h"
#include "chrome/common/features.h" #include "chrome/common/features.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
...@@ -543,10 +542,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { ...@@ -543,10 +542,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
ExtensionWelcomeNotification::RegisterProfilePrefs(registry); ExtensionWelcomeNotification::RegisterProfilePrefs(registry);
#endif #endif
#if BUILDFLAG(ENABLE_PLUGINS)
PluginsUI::RegisterProfilePrefs(registry);
#endif
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
printing::StickySettings::RegisterProfilePrefs(registry); printing::StickySettings::RegisterProfilePrefs(registry);
#endif #endif
......
/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
body {
margin: 10px;
min-width: 47em;
}
a {
color: blue;
font-size: 103%;
}
#header {
-webkit-padding-start: 0;
background: url(../../../ui/webui/resources/images/extension.svg)
left center / 48px no-repeat;
box-sizing: border-box;
margin-bottom: 1.05em;
overflow: hidden;
position: relative;
}
html[dir=rtl] #header {
background-position-x: right;
}
#header h1 {
-webkit-padding-start: 51px;
line-height: 48px;
}
h1 {
font-size: 156%;
font-weight: bold;
margin: 0;
padding: 0;
}
#disabled-container {
font-size: 120%;
padding-bottom: 1.5em;
}
#disabled-header {
color: red;
font-weight: bold;
}
div.content {
margin-top: 5px;
}
.section-header {
-webkit-padding-start: 5px;
background: rgb(235, 239, 249);
border-top: 1px solid rgb(181, 199, 222);
font-size: 99%;
padding-bottom: 2px;
padding-top: 3px;
width: 100%;
}
.section-header > table tr td:first-child {
width: 100%;
}
.section-header > table {
width: 100%;
}
.section-header-title {
font-weight: bold;
}
.vbox-container {
-webkit-box-orient: vertical;
display: -webkit-box;
}
.wbox {
-webkit-box-align: stretch;
-webkit-box-flex: 1;
display: -webkit-box;
}
#top {
-webkit-padding-end: 5px;
}
.show-in-tmi-mode {
overflow: hidden;
}
body.hide-tmi-mode-initial .show-in-tmi-mode {
height: 0 !important;
opacity: 0;
}
body.hide-tmi-mode .show-in-tmi-mode {
-webkit-transition: all 100ms ease-out;
height: 0 !important;
opacity: 0;
}
body.show-tmi-mode-initial .show-in-tmi-mode {
opacity: 1;
}
body.show-tmi-mode .show-in-tmi-mode {
-webkit-transition: all 100ms ease-in;
opacity: 1;
}
.wbox-tmi-mode {
-webkit-box-align: stretch;
-webkit-box-flex: 1;
}
.tmi-mode-image {
margin-top: 2px;
padding-left: 5px;
padding-right: 5px;
}
.tmi-mode-link {
margin-right: 3px;
white-space: nowrap;
}
.tmi-mode-link a {
font-size: 97%;
}
.tmi-mode {
-webkit-padding-start: 10px;
background: rgb(244, 246, 252);
border-bottom: 1px solid rgb(237, 239, 245);
font-size: 89%;
padding-bottom: 0.8em;
padding-top: 0.8em;
width: 100%;
}
.plugin-disabled {
background-color: #f0f0f0;
color: #a0a0a0;
}
.plugin > tr > td {
padding-bottom: 4px;
padding-top: 5px;
}
.plugin-file {
padding-bottom: 5px;
padding-top: 5px;
}
.plugin {
border-bottom: 1px solid #cdcdcd;
}
.critical {
color: red;
}
/* Indent the text related to each plug-in. */
.plugin-text {
-webkit-padding-start: 5px;
}
.plugin-name {
font-weight: bold;
}
.no-plugins {
font-size: 1.2em;
margin: 6em 0 0;
text-align: center;
}
/* Use tables for layout, so eliminate extra spacing. */
.plugin-details table {
-webkit-border-horizontal-spacing: 0;
-webkit-border-vertical-spacing: 0;
}
.plugin-details {
-webkit-padding-start: 1em;
}
/* Separate the inital line, Description, Location, and MIME Types lines. */
.plugin-details > div {
padding-top: 0.1em
}
/* Align rows of tables along the top. */
.plugin-details tr {
vertical-align: top;
}
/* Separate columns by 1em for the most part. */
.plugin-details td+td {
-webkit-padding-start: 1em;
}
/* Make the MIME Types tables smaller. */
.plugin-details .mime-types {
font-size: 95%;
}
/* Separate the header from the contents in each MIME Types table. */
.plugin-details .mime-types .header td {
border-bottom: 1px solid black;
padding-bottom: 0.1em;
}
/* Separate the columns for tables used for horizontal listings only a bit. */
.hlisting td+td {
-webkit-padding-start: 0.4em;
}
/* Match the indentation of .plugin-text. */
.plugin-actions {
-webkit-padding-start: 5px;
margin-bottom: 0.2em;
margin-top: 0.2em;
}
button {
font-size: 104%;
}
<!doctype html>
<html i18n-values="dir:textdirection;lang:language">
<head>
<meta charset="utf-8">
<title i18n-content="pluginsTitle"></title>
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="plugins.css">
<if expr="chromeos">
<link rel="stylesheet"
href="chrome://resources/css/chromeos/ui_account_tweaks.css">
</if>
</head>
<body>
<div id="body-container" style="visibility:hidden">
<div id="header"><h1 i18n-content="pluginsTitle">TITLE</h1></div>
<div id="pluginTemplate">
<div id="container" class="vbox-container">
<div id="top" class="wbox">
<div class="section-header">
<table cellpadding="0" cellspacing="0"><tr valign="center">
<td>
<span class="section-header-title" i18n-content="pluginsTitle"
>TITLE</span>
<span class="section-header-title"
jsdisplay="plugins.length > 0">(<span
jscontent="plugins.length"></span>)</span>
</td>
<td width="18">
<img id="collapse" class="tmi-mode-image" style="display:none"
src="../../../ui/webui/resources/images/minus.png">
<img id="expand" class="tmi-mode-image"
src="../../../ui/webui/resources/images/plus.png">
</td>
<td>
<div class="tmi-mode-link">
<a id="details-link" style="cursor: default"
i18n-content="pluginsDetailsModeLink">DETAILS</a>
</div>
</td>
</tr></table>
</div>
</div>
</div>
<div class="content">
<div class="plugin-name no-plugins" jsdisplay="plugins.length === 0">
<div i18n-content="noPlugins">NO_PLUGINS_ARE_INSTALLED</div>
</div>
<div jsdisplay="plugins.length > 0">
<div class="plugin" jsselect="plugins">
<table width="100%" cellpadding="2" cellspacing="0">
<tr jsvalues=
".className:isPluginEnabled($this) ? 'plugin-enabled' : 'plugin-disabled'">
<td valign="top">
<div class="plugin-text">
<div>
<span class="plugin-name" dir="ltr"
jscontent="name">NAME</span>
<span jsdisplay="plugin_files.length > 1"
jscontent="'(' + plugin_files.length +' files)'">(x)</span>
<span jsdisplay="shouldDisplayPluginVersion($this)">
- <span i18n-content="pluginVersion">VERSION</span>
<span jsvalues=".className:critical? 'critical': ''"
dir="ltr" jscontent="version">x.x.x.x</span>
</span>
<a jsdisplay="critical" jsvalues=".href:update_url"
i18n-content="pluginDownload">DOWNLOAD UPDATE</a>
<span jsdisplay="enabled_mode == 'disabledByUser'"
i18n-content="pluginDisabled">(DISABLED)</span>
<span jsdisplay="enabled_mode == 'disabledByPolicy'"
i18n-content="pluginDisabledByPolicy">(DISABLED_BY_POLICY)</span>
<span jsdisplay="enabled_mode == 'enabledByPolicy'"
i18n-content="pluginEnabledByPolicy">(ENABLED_BY_POLICY)</span>
<span jsdisplay="enabled_mode == 'managedByPolicy'"
i18n-content="pluginGroupManagedByPolicy">(MANAGED_BY_POLICY)</span>
<div jsdisplay="shouldDisplayPluginDescription($this)">
<span dir="ltr" jsvalues=".innerHTML:description">
</div>
</div>
<div jsselect="plugin_files" class="plugin-details">
<div class="show-in-tmi-mode plugin-file">
<div jsvalues=
".className:isPluginEnabled($this) ? 'plugin-enabled' : 'plugin-disabled'">
<div><table><tr>
<td class="plugin-details-label"
i18n-content="pluginName">NAME:</td>
<td><span dir="ltr" jscontent="name">NAME</span></td>
</tr></table></div>
<div><table>
<tr jsdisplay="shouldDisplayPluginDescription($this)">
<td class="plugin-details-label"
i18n-content="pluginDescription">DESCRIPTION:</td>
<td>
<span dir="ltr" jsvalues=".innerHTML:description">
</td>
</tr>
</table></div>
<div><table><tr>
<td class="plugin-details-label"
i18n-content="pluginVersion">VERSION:</td>
<td><span dir="ltr" jscontent="version">x.x.x.x</span></td>
</tr></table></div>
<div><table><tr>
<td class="plugin-details-label"
i18n-content="pluginPath">PATH:</td>
<td><span dir="ltr" jscontent="path"></span></td>
</tr></table></div>
<div><table><tr>
<td class="plugin-details-label"
i18n-content="pluginType">TYPE:</td>
<td><span dir="ltr" jscontent="type"></span></td>
</tr></table></div>
<div><table><tr>
<td class="plugin-details-label">&nbsp;</td>
<td>
<span jsdisplay="enabled_mode == 'disabledByPolicy'"
i18n-content="pluginDisabledByPolicy">(DISABLED_BY_POLICY)</span>
<span jsdisplay="enabled_mode == 'enabledByPolicy'"
i18n-content="pluginEnabledByPolicy">(ENABLED_BY_POLICY)</span>
</td>
</tr></table></div>
<table><tr jsdisplay="mime_types.length > 0">
<td class="plugin-details-label"
i18n-content="pluginMimeTypes">MIME_TYPES:</td>
<td><table width="100%" class="mime-types">
<tr class="header">
<td i18n-content="pluginMimeTypesMimeType"
>MIME type</td>
<td i18n-content="pluginMimeTypesDescription"
>DESCRIPTION</td>
<td i18n-content="pluginMimeTypesFileExtensions"
>FILE_EXTENSIONS</td>
</tr>
<tr jsselect="mime_types">
<td><span dir="ltr"
jscontent="mime_type"></span></td>
<td><span dir="ltr"
jsvalues=".innerHTML:description"></span></td>
<td><table jsdisplay="file_extensions.length > 0"
class="hlisting">
<tr><td jsselect="file_extensions">
<span dir="ltr" jscontent="'.' + $this">
</td></tr>
</table></td>
</tr>
</table></td>
</tr></table>
</div>
</div>
</div>
</div>
<div class="plugin-actions" guest-visibility="disabled">
<input
class="always-allow" type="checkbox"
jsvalues=
".identifier:id; id:id + '-always-allowed'; .checked:always_allowed; disabled:isPluginTrusted($this) || !isPluginEnabled($this) || isPluginPolicyClickToPlay($this)">
<label jsvalues="for:id + '-always-allowed'"
i18n-content="alwaysAllowed"></label>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<script src="chrome://resources/js/util.js"></script>
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://plugins/plugins.js"></script>
<if expr="chromeos">
<script src="chrome://resources/js/chromeos/ui_account_tweaks.js"></script>
</if>
<script src="chrome://resources/js/load_time_data.js"></script>
<script src="chrome://resources/js/jstemplate_compiled.js"></script>
<script src="chrome://plugins/strings.js"></script>
<script src="chrome://resources/js/i18n_template.js"></script>
</body>
</html>
This diff is collapsed.
...@@ -471,7 +471,6 @@ split_static_library("ui") { ...@@ -471,7 +471,6 @@ split_static_library("ui") {
"//chrome/browser/devtools", "//chrome/browser/devtools",
"//chrome/browser/ui/webui/engagement:mojo_bindings", "//chrome/browser/ui/webui/engagement:mojo_bindings",
"//chrome/browser/ui/webui/omnibox:mojo_bindings", "//chrome/browser/ui/webui/omnibox:mojo_bindings",
"//chrome/browser/ui/webui/plugins:mojo_bindings",
"//chrome/browser/ui/webui/usb_internals:mojo_bindings", "//chrome/browser/ui/webui/usb_internals:mojo_bindings",
"//chrome/common", "//chrome/common",
"//chrome/common/net", "//chrome/common/net",
...@@ -1204,10 +1203,6 @@ split_static_library("ui") { ...@@ -1204,10 +1203,6 @@ split_static_library("ui") {
"hung_plugin_tab_helper.h", "hung_plugin_tab_helper.h",
"webui/flash_ui.cc", "webui/flash_ui.cc",
"webui/flash_ui.h", "webui/flash_ui.h",
"webui/plugins/plugins_handler.cc",
"webui/plugins/plugins_handler.h",
"webui/plugins/plugins_ui.cc",
"webui/plugins/plugins_ui.h",
] ]
deps += [ "//ppapi/proxy:ipc" ] deps += [ "//ppapi/proxy:ipc" ]
} }
......
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
#include "chrome/browser/ui/webui/options/options_ui.h" #include "chrome/browser/ui/webui/options/options_ui.h"
#include "chrome/browser/ui/webui/password_manager_internals/password_manager_internals_ui.h" #include "chrome/browser/ui/webui/password_manager_internals/password_manager_internals_ui.h"
#include "chrome/browser/ui/webui/physical_web/physical_web_ui.h" #include "chrome/browser/ui/webui/physical_web/physical_web_ui.h"
#include "chrome/browser/ui/webui/plugins/plugins_ui.h"
#include "chrome/browser/ui/webui/policy_material_design_ui.h" #include "chrome/browser/ui/webui/policy_material_design_ui.h"
#include "chrome/browser/ui/webui/policy_ui.h" #include "chrome/browser/ui/webui/policy_ui.h"
#include "chrome/browser/ui/webui/predictors/predictors_ui.h" #include "chrome/browser/ui/webui/predictors/predictors_ui.h"
...@@ -599,8 +598,6 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, ...@@ -599,8 +598,6 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
#if BUILDFLAG(ENABLE_PLUGINS) #if BUILDFLAG(ENABLE_PLUGINS)
if (url.host_piece() == chrome::kChromeUIFlashHost) if (url.host_piece() == chrome::kChromeUIFlashHost)
return &NewWebUI<FlashUI>; return &NewWebUI<FlashUI>;
if (url.host_piece() == chrome::kChromeUIPluginsHost)
return &NewWebUI<PluginsUI>;
#endif #endif
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
if (url.host_piece() == chrome::kChromeUIPrintHost && if (url.host_piece() == chrome::kChromeUIPrintHost &&
...@@ -805,7 +802,7 @@ base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes( ...@@ -805,7 +802,7 @@ base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes(
// The Apps launcher page is not available on android or ChromeOS. // The Apps launcher page is not available on android or ChromeOS.
if (page_url.host_piece() == chrome::kChromeUIAppLauncherPageHost) if (page_url.host_piece() == chrome::kChromeUIAppLauncherPageHost)
return AppLauncherPageUI::GetFaviconResourceBytes(scale_factor); return AppLauncherPageUI::GetFaviconResourceBytes(scale_factor);
#endif #endif // !defined(OS_CHROMEOS)
// Flash is not available on android. // Flash is not available on android.
if (page_url.host_piece() == chrome::kChromeUIFlashHost) if (page_url.host_piece() == chrome::kChromeUIFlashHost)
...@@ -825,13 +822,8 @@ base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes( ...@@ -825,13 +822,8 @@ base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes(
if (page_url.host_piece() == chrome::kChromeUIExtensionsHost || if (page_url.host_piece() == chrome::kChromeUIExtensionsHost ||
page_url.host_piece() == chrome::kChromeUIExtensionsFrameHost) page_url.host_piece() == chrome::kChromeUIExtensionsFrameHost)
return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor);
#endif #endif // BUILDFLAG(ENABLE_EXTENSIONS)
#endif // !defined(OS_ANDROID)
// Android doesn't use the plugins pages.
if (page_url.host_piece() == chrome::kChromeUIPluginsHost)
return PluginsUI::GetFaviconResourceBytes(scale_factor);
#endif
return NULL; return NULL;
} }
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//mojo/public/tools/bindings/mojom.gni")
mojom("mojo_bindings") {
sources = [
"plugins.mojom",
]
}
per-file *.mojom=set noparent
per-file *.mojom=file://ipc/SECURITY_OWNERS
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module mojom;
struct MimeType {
string description;
array<string> file_extensions;
string mime_type;
};
struct PluginFile {
string description;
string enabled_mode;
array<MimeType> mime_types;
string name;
string path;
string type;
string version;
};
struct PluginData {
bool always_allowed;
bool trusted;
bool policy_click_to_play;
string description;
bool critical;
string enabled_mode;
string id;
string name;
string update_url;
string version;
array<PluginFile> plugin_files;
};
interface PluginsPageHandler {
GetPluginsData() => (array<PluginData> plugins);
GetShowDetails() => (bool show_details);
SaveShowDetailsToPrefs(bool details_mode);
SetPluginAlwaysAllowed(string plugin, bool allowed);
SetClientPage(PluginsPage page);
};
interface PluginsPage {
OnPluginsUpdated(array<PluginData> plugins);
};
This diff is collapsed.
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_PLUGINS_PLUGINS_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_PLUGINS_PLUGINS_HANDLER_H_
#include "base/memory/weak_ptr.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/mojo_web_ui_handler.h"
#include "chrome/browser/ui/webui/plugins/plugins.mojom.h"
#include "components/prefs/pref_member.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "content/public/common/webplugininfo.h"
#include "mojo/public/cpp/bindings/binding.h"
class PluginsPageHandler : public MojoWebUIHandler,
public mojom::PluginsPageHandler,
public content::NotificationObserver {
public:
PluginsPageHandler(content::WebUI* web_ui,
mojo::InterfaceRequest<mojom::PluginsPageHandler> request);
~PluginsPageHandler() override;
// mojom::PluginsPageHandler overrides:
void GetPluginsData(const GetPluginsDataCallback& callback) override;
void GetShowDetails(const GetShowDetailsCallback& callback) override;
void SaveShowDetailsToPrefs(bool details_mode) override;
void SetPluginAlwaysAllowed(const std::string& plugin, bool allowed) override;
void SetClientPage(mojom::PluginsPagePtr page) override;
// content::NotificationObserver implementation.
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
private:
std::vector<mojom::PluginDataPtr> GeneratePluginsData(
const std::vector<content::WebPluginInfo>& plugins);
mojom::PluginFilePtr GeneratePluginFile(const content::WebPluginInfo& plugin,
const base::string16& group_name,
bool plugin_enabled) const;
// Detect a plugin's enabled mode (one of enabledByUser, disabledByUser,
// enabledByPolicy, disabledByPolicy).
std::string GetPluginEnabledMode(const base::string16& plugin_name,
const base::string16& group_name,
bool plugin_enabled) const;
// Returns whether the policy for the current profile is "Click To Play" i.e.
// DefaultPluginsSetting is 3 (ASK).
bool GetClickToPlayPolicyEnabled() const;
// Detect a plugin group's enabled mode (one of enabledByUser, disabledByUser,
// enabledByPolicy, disabledByPolicy, managedByPolicy).
std::string GetPluginGroupEnabledMode(
const std::vector<mojom::PluginFilePtr>& plugin_files,
bool group_enabled) const;
// Called on the UI thread when the plugin info requested fom GetPluginsData
// is ready.
void RespondWithPluginsData(
const GetPluginsDataCallback& callback,
const std::vector<content::WebPluginInfo>& plugins);
// Called on the UI thread when the plugin info has changed and calls the page
// to update it.
void NotifyWithPluginsData(
const std::vector<content::WebPluginInfo>& plugins);
content::NotificationRegistrar registrar_;
// This pref guards the value whether about:plugins is in the details mode or
// not.
BooleanPrefMember show_details_;
// Owned by RenderFrameHostImpl.
content::WebUI* web_ui_;
mojo::Binding<mojom::PluginsPageHandler> binding_;
// Handle back to the page by which JS methods can be called.
mojom::PluginsPagePtr page_;
base::WeakPtrFactory<PluginsPageHandler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(PluginsPageHandler);
};
#endif // CHROME_BROWSER_UI_WEBUI_PLUGINS_PLUGINS_HANDLER_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/plugins/plugins_ui.h"
#include <stddef.h>
#include <algorithm>
#include "base/macros.h"
#include "base/memory/ref_counted_memory.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/plugins/plugins_handler.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "ui/base/resource/resource_bundle.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h"
#endif
namespace {
content::WebUIDataSource* CreatePluginsUIHTMLSource(Profile* profile) {
content::WebUIDataSource* source =
content::WebUIDataSource::Create(chrome::kChromeUIPluginsHost);
source->AddLocalizedString("pluginsTitle", IDS_PLUGINS_TITLE);
source->AddLocalizedString("pluginsDetailsModeLink",
IDS_PLUGINS_DETAILS_MODE_LINK);
source->AddLocalizedString("pluginsNoneInstalled",
IDS_PLUGINS_NONE_INSTALLED);
source->AddLocalizedString("pluginDisabled", IDS_PLUGINS_DISABLED_PLUGIN);
source->AddLocalizedString("pluginDisabledByPolicy",
IDS_PLUGINS_DISABLED_BY_POLICY_PLUGIN);
source->AddLocalizedString("pluginEnabledByPolicy",
IDS_PLUGINS_ENABLED_BY_POLICY_PLUGIN);
source->AddLocalizedString("pluginGroupManagedByPolicy",
IDS_PLUGINS_GROUP_MANAGED_BY_POLICY);
source->AddLocalizedString("pluginDownload", IDS_PLUGINS_DOWNLOAD);
source->AddLocalizedString("pluginName", IDS_PLUGINS_NAME);
source->AddLocalizedString("pluginVersion", IDS_PLUGINS_VERSION);
source->AddLocalizedString("pluginDescription", IDS_PLUGINS_DESCRIPTION);
source->AddLocalizedString("pluginPath", IDS_PLUGINS_PATH);
source->AddLocalizedString("pluginType", IDS_PLUGINS_TYPE);
source->AddLocalizedString("pluginMimeTypes", IDS_PLUGINS_MIME_TYPES);
source->AddLocalizedString("pluginMimeTypesMimeType",
IDS_PLUGINS_MIME_TYPES_MIME_TYPE);
source->AddLocalizedString("pluginMimeTypesDescription",
IDS_PLUGINS_MIME_TYPES_DESCRIPTION);
source->AddLocalizedString("pluginMimeTypesFileExtensions",
IDS_PLUGINS_MIME_TYPES_FILE_EXTENSIONS);
source->AddLocalizedString("alwaysAllowed", IDS_PLUGINS_ALWAYS_ALLOWED);
source->AddLocalizedString("noPlugins", IDS_PLUGINS_NO_PLUGINS);
source->SetJsonPath("strings.js");
source->AddResourcePath("plugins.js", IDR_PLUGINS_JS);
source->SetDefaultResource(IDR_PLUGINS_HTML);
#if defined(OS_CHROMEOS)
chromeos::AddAccountUITweaksLocalizedValues(source, profile);
#endif
source->AddResourcePath("chrome/browser/ui/webui/plugins/plugins.mojom",
IDR_PLUGINS_MOJO_JS);
return source;
}
} // namespace
PluginsUI::PluginsUI(content::WebUI* web_ui) : MojoWebUIController(web_ui) {
// Set up the chrome://plugins/ source.
Profile* profile = Profile::FromWebUI(web_ui);
content::WebUIDataSource::Add(profile, CreatePluginsUIHTMLSource(profile));
}
PluginsUI::~PluginsUI() {}
// static
base::RefCountedMemory* PluginsUI::GetFaviconResourceBytes(
ui::ScaleFactor scale_factor) {
return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
IDR_PLUGINS_FAVICON, scale_factor);
}
// static
void PluginsUI::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(prefs::kPluginsShowDetails, false);
registry->RegisterDictionaryPref(
prefs::kContentSettingsPluginWhitelist,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
}
void PluginsUI::BindUIHandler(
mojo::InterfaceRequest<mojom::PluginsPageHandler> request) {
plugins_handler_.reset(new PluginsPageHandler(web_ui(), std::move(request)));
}
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_PLUGINS_PLUGINS_UI_H_
#define CHROME_BROWSER_UI_WEBUI_PLUGINS_PLUGINS_UI_H_
#include "base/macros.h"
#include "chrome/browser/ui/webui/mojo_web_ui_controller.h"
#include "chrome/browser/ui/webui/plugins/plugins.mojom.h"
#include "ui/base/layout.h"
namespace base {
class RefCountedMemory;
}
namespace user_prefs {
class PrefRegistrySyncable;
}
class PluginsPageHandler;
class PluginsUI : public MojoWebUIController<mojom::PluginsPageHandler> {
public:
explicit PluginsUI(content::WebUI* web_ui);
~PluginsUI() override;
static base::RefCountedMemory* GetFaviconResourceBytes(
ui::ScaleFactor scale_factor);
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
private:
// MojoWebUIController overrides:
void BindUIHandler(
mojo::InterfaceRequest<mojom::PluginsPageHandler> request) override;
std::unique_ptr<PluginsPageHandler> plugins_handler_;
DISALLOW_COPY_AND_ASSIGN(PluginsUI);
};
#endif // CHROME_BROWSER_UI_WEBUI_PLUGINS_PLUGINS_UI_H_
...@@ -1009,7 +1009,6 @@ if (!is_android) { ...@@ -1009,7 +1009,6 @@ if (!is_android) {
"data/webui/net_internals/sdch_view.js", "data/webui/net_internals/sdch_view.js",
"data/webui/net_internals/timeline_view.js", "data/webui/net_internals/timeline_view.js",
"data/webui/ntp4.js", "data/webui/ntp4.js",
"data/webui/plugins_browsertest.js",
"data/webui/polymer_browser_test_base.js", "data/webui/polymer_browser_test_base.js",
"data/webui/print_preview.js", "data/webui/print_preview.js",
"data/webui/sandboxstatus_browsertest.js", "data/webui/sandboxstatus_browsertest.js",
......
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview Tests for chrome://plugins
*/
/** @const {string} Path to source root. */
var ROOT_PATH = '../../../../';
/**
* Test fixture for testing async methods of cr.js.
* @constructor
* @extends testing.Test
*/
function PluginsTest() {
this.browserProxy = null;
this.setupFnResolver = new PromiseResolver();
}
PluginsTest.prototype = {
__proto__: testing.Test.prototype,
/** @override */
browsePreload: 'chrome://plugins',
/** @override */
isAsync: true,
/** @override */
runAccessibilityChecks: false,
/** @override */
extraLibraries: [
ROOT_PATH + 'third_party/mocha/mocha.js',
ROOT_PATH + 'chrome/test/data/webui/mocha_adapter.js',
ROOT_PATH + 'ui/webui/resources/js/promise_resolver.js',
ROOT_PATH + 'ui/webui/resources/js/cr.js',
ROOT_PATH + 'ui/webui/resources/js/util.js',
ROOT_PATH + 'chrome/test/data/webui/settings/test_browser_proxy.js',
],
preLoad: function() {
/**
* A test browser proxy for the chrome://plugins page.
*
* @constructor
* @extends {TestBrowserProxyBase}
*/
var TestBrowserProxy = function() {
settings.TestBrowserProxy.call(this, [
'getPluginsData',
'getShowDetails',
'saveShowDetailsToPrefs',
]);
this.bindingSet = null;
/**
* The data to be returned by |getPluginsData_|.
* @private
*/
this.pluginsData_ = [];
};
TestBrowserProxy.prototype = {
__proto__: settings.TestBrowserProxy.prototype,
getPluginsData: function() {
this.methodCalled('getPluginsData');
return Promise.resolve({plugins: this.pluginsData_});
},
setPluginsData: function(pluginsData) {
this.pluginsData_ = pluginsData;
},
getShowDetails: function() {
this.methodCalled('getShowDetails');
return Promise.resolve({show_details: false});
},
saveShowDetailsToPrefs: function(expanded) {
this.methodCalled('saveShowDetailsToPrefs', expanded);
},
setClientPage: function() {
// Nothing to do here.
},
};
this.browserProxy = new TestBrowserProxy();
// A function that is called from chrome://plugins to allow this test to
// replace the real Mojo browser proxy with a fake one, before any other
// code runs.
window.setupFn = function() {
return importModules([
'mojo/public/js/bindings',
'chrome/browser/ui/webui/plugins/plugins.mojom',
'content/public/renderer/frame_interfaces',
]).then(function(modules) {
var bindings = modules[0];
var pluginsMojom = modules[1];
var frameInterfaces = modules[2];
this.browserProxy.bindingSet = new bindings.BindingSet(
pluginsMojom.PluginsPageHandler);
frameInterfaces.addInterfaceOverrideForTesting(
pluginsMojom.PluginsPageHandler.name, function(handle) {
this.browserProxy.bindingSet.addBinding(this.browserProxy,
handle);
}.bind(this));
return this.setupFnResolver.promise;
}.bind(this));
}.bind(this);
},
};
TEST_F('PluginsTest', 'Plugins', function() {
var browserProxy = this.browserProxy;
var setupFnResolver = this.setupFnResolver;
var fakePluginData = {
name: 'Group Name',
description: 'description',
version: 'version',
update_url: 'http://update/',
critical: true,
enabled_mode: 'enabledByUser',
id: 'plugin-name',
always_allowed: false,
plugin_files: [
{
path: '/foo/bar/baz/MyPlugin.plugin',
name: 'MyPlugin',
version: '1.2.3',
description: 'My plugin',
type: 'BROWSER PLUGIN',
mime_types: [
{
description: 'Foo Media',
file_extensions: ['pdf'],
mime_type: 'application/x-my-foo'
},
{
description: 'Bar Stuff',
file_extensions: ['bar', 'baz'],
mime_type: 'application/my-bar'
},
],
enabled_mode: 'enabledByUser',
},
],
};
suite('PluginTest', function() {
var EXPECTED_PLUGINS = 2;
suiteSetup(function() {
browserProxy.setPluginsData([fakePluginData, fakePluginData]);
// Allow code being tested to proceed, now that fake data has been set up.
setupFnResolver.resolve();
return Promise.all([
browserProxy.whenCalled('getPluginsData'),
browserProxy.whenCalled('getShowDetails'),
]);
});
teardown(function() { browserProxy.reset(); });
test('PluginsUpdated', function() {
var plugins = document.querySelectorAll('.plugin');
assertEquals(EXPECTED_PLUGINS, plugins.length);
pageImpl.onPluginsUpdated([fakePluginData]);
plugins = document.querySelectorAll('.plugin');
assertEquals(1, plugins.length);
});
/**
* Test that clicking on the +/- icons results in the expected calls to the
* browser.
*/
test('ToggleDetails', function() {
var collapseEl = document.querySelector('#collapse');
var expandEl = document.querySelector('#expand');
var clickEvent = new MouseEvent('click', {
'view': window, 'bubbles': true, 'cancelable': true
});
assertEquals('none', collapseEl.style.display);
assertNotEquals('none', expandEl.style.display);
expandEl.dispatchEvent(clickEvent);
return browserProxy.whenCalled('saveShowDetailsToPrefs').then(
function(expanded) {
// Booleans are converted to 0/1 by underlying Mojo layers.
assertTrue(Boolean(expanded));
assertNotEquals('none', collapseEl.style.display);
assertEquals('none', expandEl.style.display);
browserProxy.resetResolver('saveShowDetailsToPrefs');
collapseEl.dispatchEvent(clickEvent);
return browserProxy.whenCalled('saveShowDetailsToPrefs');
}).then(function(expanded) {
assertFalse(Boolean(expanded));
});
});
});
// Run all registered tests.
mocha.run();
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment