| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
| 6 * Takes the |pluginsData| input argument which represents data about the | 6 * Takes the |pluginsData| input argument which represents data about the |
| 7 * currently installed/running plugins and populates the html jstemplate with | 7 * currently installed/running plugins and populates the html jstemplate with |
| 8 * that data. | 8 * that data. |
| 9 * @param {Object} pluginsData Detailed info about installed plugins. Same | 9 * @param {Object} pluginsData Detailed info about installed plugins. Same |
| 10 * expected format as returnPluginsData(). | 10 * expected format as returnPluginsData(). |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 * @param {Object} plugin An object containing the information about a plugin. | 235 * @param {Object} plugin An object containing the information about a plugin. |
| 236 * See returnPluginsData() for the format of this object. | 236 * See returnPluginsData() for the format of this object. |
| 237 * @return {boolean} Whether the plugin is enabled. | 237 * @return {boolean} Whether the plugin is enabled. |
| 238 */ | 238 */ |
| 239 function isPluginEnabled(plugin) { | 239 function isPluginEnabled(plugin) { |
| 240 return plugin.enabled_mode == 'enabledByUser' || | 240 return plugin.enabled_mode == 'enabledByUser' || |
| 241 plugin.enabled_mode == 'enabledByPolicy'; | 241 plugin.enabled_mode == 'enabledByPolicy'; |
| 242 } | 242 } |
| 243 | 243 |
| 244 /** | 244 /** |
| 245 * @param {Object} plugin An object containing the information about a plugin. |
| 246 * See returnPluginsData() for the format of this object. |
| 247 * @return {boolean} Whether the plugin is fully trusted. |
| 248 */ |
| 249 function isPluginTrusted(plugin) { |
| 250 return plugin.trusted == true; |
| 251 } |
| 252 |
| 253 /** |
| 245 * Helper to convert callback-based define() API to a promise-based API. | 254 * Helper to convert callback-based define() API to a promise-based API. |
| 246 * @param {!Array<string>} moduleNames | 255 * @param {!Array<string>} moduleNames |
| 247 * @return {!Promise} | 256 * @return {!Promise} |
| 248 */ | 257 */ |
| 249 function importModules(moduleNames) { | 258 function importModules(moduleNames) { |
| 250 return new Promise(function(resolve, reject) { | 259 return new Promise(function(resolve, reject) { |
| 251 define(moduleNames, function(var_args) { | 260 define(moduleNames, function(var_args) { |
| 252 resolve(Array.prototype.slice.call(arguments, 0)); | 261 resolve(Array.prototype.slice.call(arguments, 0)); |
| 253 }); | 262 }); |
| 254 }); | 263 }); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 335 |
| 327 // Unfortunately, we don't have notifications for plugin (list) status | 336 // Unfortunately, we don't have notifications for plugin (list) status |
| 328 // changes (yet), so in the meanwhile just update regularly. | 337 // changes (yet), so in the meanwhile just update regularly. |
| 329 setInterval(function() { | 338 setInterval(function() { |
| 330 browserProxy.getPluginsData().then(returnPluginsData); | 339 browserProxy.getPluginsData().then(returnPluginsData); |
| 331 }, 30000); | 340 }, 30000); |
| 332 }); | 341 }); |
| 333 } | 342 } |
| 334 | 343 |
| 335 document.addEventListener('DOMContentLoaded', main); | 344 document.addEventListener('DOMContentLoaded', main); |
| OLD | NEW |