Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: chrome/browser/resources/plugins.js

Issue 1857263004: Always trust internal PDF viewer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 /** 240 /**
241 * @param {Object} plugin An object containing the information about a plugin. 241 * @param {Object} plugin An object containing the information about a plugin.
242 * See returnPluginsData() for the format of this object. 242 * See returnPluginsData() for the format of this object.
243 * @return {boolean} Whether the plugin is enabled. 243 * @return {boolean} Whether the plugin is enabled.
244 */ 244 */
245 function isPluginEnabled(plugin) { 245 function isPluginEnabled(plugin) {
246 return plugin.enabled_mode == 'enabledByUser' || 246 return plugin.enabled_mode == 'enabledByUser' ||
247 plugin.enabled_mode == 'enabledByPolicy'; 247 plugin.enabled_mode == 'enabledByPolicy';
248 } 248 }
249 249
250 /**
251 * @param {Object} plugin An object containing the information about a plugin.
252 * See returnPluginsData() for the format of this object.
253 * @return {boolean} Whether the plugin is fully trusted.
254 */
255 function isPluginTrusted(plugin) {
256 return plugin.trusted == true;
257 }
258
250 // Unfortunately, we don't have notifications for plugin (list) status changes 259 // Unfortunately, we don't have notifications for plugin (list) status changes
251 // (yet), so in the meanwhile just update regularly. 260 // (yet), so in the meanwhile just update regularly.
252 setInterval(function() { 261 setInterval(function() {
253 whenBrowserProxyReady.then(function(browserProxy) { 262 whenBrowserProxyReady.then(function(browserProxy) {
254 return browserProxy.getPluginsData(); 263 return browserProxy.getPluginsData();
255 }).then(returnPluginsData); 264 }).then(returnPluginsData);
256 }, 30000); 265 }, 30000);
257 266
258 // Add handlers to static HTML elements. 267 // Add handlers to static HTML elements.
259 $('collapse').onclick = toggleTmiMode; 268 $('collapse').onclick = toggleTmiMode;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 whenBrowserProxyReady 325 whenBrowserProxyReady
317 ]).then(function(results) { 326 ]).then(function(results) {
318 var browserProxy = results[1]; 327 var browserProxy = results[1];
319 browserProxy.getShowDetails().then(function(response) { 328 browserProxy.getShowDetails().then(function(response) {
320 // Set the |tmiModeExpanded| first otherwise the UI flickers when 329 // Set the |tmiModeExpanded| first otherwise the UI flickers when
321 // returnPlignsData executes. 330 // returnPlignsData executes.
322 loadShowDetailsFromPrefs(response.show_details); 331 loadShowDetailsFromPrefs(response.show_details);
323 return browserProxy.getPluginsData(); 332 return browserProxy.getPluginsData();
324 }).then(returnPluginsData); 333 }).then(returnPluginsData);
325 }); 334 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698