| Index: chrome/browser/resources/plugins.js
|
| diff --git a/chrome/browser/resources/plugins.js b/chrome/browser/resources/plugins.js
|
| index f57f1332130728c4b0e4b325b782d8c1aa28d23f..b58e14065123249ceb0420860baeba44e477d822 100644
|
| --- a/chrome/browser/resources/plugins.js
|
| +++ b/chrome/browser/resources/plugins.js
|
| @@ -135,13 +135,11 @@ function returnPluginsData(pluginsData) {
|
| slidables[i].style.height = slidables[i].offsetHeight + 'px';
|
|
|
| // Reset visibility of page based on the current tmi mode.
|
| - $('collapse').style.display =
|
| - tmiModeExpanded ? 'inline' : 'none';
|
| - $('expand').style.display =
|
| - tmiModeExpanded ? 'none' : 'inline';
|
| + $('collapse').style.display = tmiModeExpanded ? 'inline' : 'none';
|
| + $('expand').style.display = tmiModeExpanded ? 'none' : 'inline';
|
| bodyContainer.style.visibility = 'visible';
|
| - body.className = tmiModeExpanded ?
|
| - 'show-tmi-mode-initial' : 'hide-tmi-mode-initial';
|
| + body.className =
|
| + tmiModeExpanded ? 'show-tmi-mode-initial' : 'hide-tmi-mode-initial';
|
| }
|
|
|
| /*
|
| @@ -150,13 +148,10 @@ function returnPluginsData(pluginsData) {
|
| function toggleTmiMode() {
|
| tmiModeExpanded = !tmiModeExpanded;
|
|
|
| - $('collapse').style.display =
|
| - tmiModeExpanded ? 'inline' : 'none';
|
| - $('expand').style.display =
|
| - tmiModeExpanded ? 'none' : 'inline';
|
| + $('collapse').style.display = tmiModeExpanded ? 'inline' : 'none';
|
| + $('expand').style.display = tmiModeExpanded ? 'none' : 'inline';
|
|
|
| - document.body.className =
|
| - tmiModeExpanded ? 'show-tmi-mode' : 'hide-tmi-mode';
|
| + document.body.className = tmiModeExpanded ? 'show-tmi-mode' : 'hide-tmi-mode';
|
|
|
| browserProxy.saveShowDetailsToPrefs(tmiModeExpanded);
|
| }
|
| @@ -182,11 +177,10 @@ function shouldDisplayPluginVersion(plugin) {
|
| function shouldDisplayPluginDescription(plugin) {
|
| // Only display the description if it's not blank and if it's not just the
|
| // name, version, or combination thereof.
|
| - return plugin.description &&
|
| - plugin.description != plugin.name &&
|
| - plugin.description != plugin.version &&
|
| - plugin.description != 'Version ' + plugin.version &&
|
| - plugin.description != plugin.name + ' ' + plugin.version;
|
| + return plugin.description && plugin.description != plugin.name &&
|
| + plugin.description != plugin.version &&
|
| + plugin.description != 'Version ' + plugin.version &&
|
| + plugin.description != plugin.name + ' ' + plugin.version;
|
| }
|
|
|
| /**
|
| @@ -196,7 +190,7 @@ function shouldDisplayPluginDescription(plugin) {
|
| */
|
| function isPluginEnabled(plugin) {
|
| return plugin.enabled_mode == 'enabledByUser' ||
|
| - plugin.enabled_mode == 'enabledByPolicy';
|
| + plugin.enabled_mode == 'enabledByPolicy';
|
| }
|
|
|
| /**
|
| @@ -205,7 +199,7 @@ function isPluginEnabled(plugin) {
|
| * @return {boolean} Whether the plugin is fully trusted.
|
| */
|
| function isPluginTrusted(plugin) {
|
| - return plugin.trusted == true;
|
| + return plugin.trusted == true;
|
| }
|
|
|
| /**
|
| @@ -216,7 +210,7 @@ function isPluginTrusted(plugin) {
|
| * This would normally be set by setting the policy DefaultPluginsSetting to 3.
|
| */
|
| function isPluginPolicyClickToPlay(plugin) {
|
| - return plugin.policy_click_to_play == true;
|
| + return plugin.policy_click_to_play == true;
|
| }
|
|
|
| // NOTE: Need to keep a global reference to the |pageImpl| such that it is not
|
| @@ -227,31 +221,33 @@ var browserProxy = null;
|
|
|
| function initializeProxies() {
|
| 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];
|
| + '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];
|
|
|
| - browserProxy = new pluginsMojom.PluginsPageHandlerPtr(
|
| - frameInterfaces.getInterface(pluginsMojom.PluginsPageHandler.name));
|
| + browserProxy = new pluginsMojom.PluginsPageHandlerPtr(
|
| + frameInterfaces.getInterface(pluginsMojom.PluginsPageHandler.name));
|
|
|
| - /** @constructor */
|
| - var PluginsPageImpl = function() {
|
| - this.binding = new bindings.Binding(pluginsMojom.PluginsPage, this);
|
| - };
|
| + /** @constructor */
|
| + var PluginsPageImpl = function() {
|
| + this.binding = new bindings.Binding(pluginsMojom.PluginsPage, this);
|
| + };
|
|
|
| - PluginsPageImpl.prototype = {
|
| - /** @override */
|
| - onPluginsUpdated: function(plugins) {
|
| - returnPluginsData({plugins: plugins});
|
| - },
|
| - };
|
| - pageImpl = new PluginsPageImpl();
|
| - browserProxy.setClientPage(pageImpl.binding.createInterfacePtrAndBind());
|
| - });
|
| + PluginsPageImpl.prototype = {
|
| + /** @override */
|
| + onPluginsUpdated: function(plugins) {
|
| + returnPluginsData({plugins: plugins});
|
| + },
|
| + };
|
| + pageImpl = new PluginsPageImpl();
|
| + browserProxy.setClientPage(
|
| + pageImpl.binding.createInterfacePtrAndBind());
|
| + });
|
| }
|
|
|
| /**
|
| @@ -259,31 +255,37 @@ function initializeProxies() {
|
| * before any other code executes.
|
| * @return {!Promise} A promise firing once necessary setup has been completed.
|
| */
|
| -var setupFn = setupFn || function() { return Promise.resolve(); };
|
| +var setupFn = setupFn || function() {
|
| + return Promise.resolve();
|
| +};
|
|
|
| function main() {
|
| - setupFn().then(function() {
|
| - // Add handlers to static HTML elements.
|
| - $('collapse').onclick = toggleTmiMode;
|
| - $('expand').onclick = toggleTmiMode;
|
| - $('details-link').onclick = toggleTmiMode;
|
| - return initializeProxies();
|
| - }).then(function() {
|
| - return browserProxy.getShowDetails();
|
| - }).then(function(response) {
|
| - // Set the |tmiModeExpanded| first otherwise the UI flickers when
|
| - // returnPlignsData executes.
|
| - loadShowDetailsFromPrefs(response.show_details);
|
| - return browserProxy.getPluginsData();
|
| - }).then(function(pluginsData) {
|
| - returnPluginsData(pluginsData);
|
| + setupFn()
|
| + .then(function() {
|
| + // Add handlers to static HTML elements.
|
| + $('collapse').onclick = toggleTmiMode;
|
| + $('expand').onclick = toggleTmiMode;
|
| + $('details-link').onclick = toggleTmiMode;
|
| + return initializeProxies();
|
| + })
|
| + .then(function() {
|
| + return browserProxy.getShowDetails();
|
| + })
|
| + .then(function(response) {
|
| + // Set the |tmiModeExpanded| first otherwise the UI flickers when
|
| + // returnPlignsData executes.
|
| + loadShowDetailsFromPrefs(response.show_details);
|
| + return browserProxy.getPluginsData();
|
| + })
|
| + .then(function(pluginsData) {
|
| + returnPluginsData(pluginsData);
|
|
|
| - // Unfortunately, we don't have notifications for plugin (list) status
|
| - // changes (yet), so in the meanwhile just update regularly.
|
| - setInterval(function() {
|
| - browserProxy.getPluginsData().then(returnPluginsData);
|
| - }, 30000);
|
| - });
|
| + // Unfortunately, we don't have notifications for plugin (list) status
|
| + // changes (yet), so in the meanwhile just update regularly.
|
| + setInterval(function() {
|
| + browserProxy.getPluginsData().then(returnPluginsData);
|
| + }, 30000);
|
| + });
|
| }
|
|
|
| document.addEventListener('DOMContentLoaded', main);
|
|
|