Index: chrome/browser/resources/plugins.js |
diff --git a/chrome/browser/resources/plugins.js b/chrome/browser/resources/plugins.js |
index 5f9edcbc733d3e6d90e25288362b613eae2a9715..84f075a26250f9bab9b84e026d04edf666eec94c 100644 |
--- a/chrome/browser/resources/plugins.js |
+++ b/chrome/browser/resources/plugins.js |
@@ -23,10 +23,10 @@ var pluginDataFormat = { |
'description': 'My crappy plugin', |
'mimeTypes': [ |
{ 'description': 'Foo Media', |
- 'fileExtensions': [ 'foo' ], |
+ 'fileExtensions': ['foo'], |
'mimeType': 'application/x-my-foo' }, |
{ 'description': 'Bar Stuff', |
- 'fileExtensions': [ 'bar','baz' ], |
+ 'fileExtensions': ['bar', 'baz'], |
'mimeType': 'application/my-bar' } |
], |
'enabledMode': 'enabledByUser' |
@@ -38,7 +38,7 @@ var pluginDataFormat = { |
'description': 'My first plugin', |
'mimeTypes': [ |
{ 'description': 'New Guy Media', |
- 'fileExtensions': [ 'mfp' ], |
+ 'fileExtensions': ['mfp'], |
'mimeType': 'application/x-my-first' } |
], |
'enabledMode': 'enabledByPolicy' |
@@ -50,7 +50,7 @@ var pluginDataFormat = { |
'description': 'Your great plugin', |
'mimeTypes': [ |
{ 'description': 'Baz Stuff', |
- 'fileExtensions': [ 'baz' ], |
+ 'fileExtensions': ['baz'], |
'mimeType': 'application/x-your-baz' } |
], |
'enabledMode': 'disabledByUser' |
@@ -62,7 +62,7 @@ var pluginDataFormat = { |
'description': 'His great plugin', |
'mimeTypes': [ |
{ 'description': 'More baz Stuff', |
- 'fileExtensions': [ 'bor' ], |
+ 'fileExtensions': ['bor'], |
'mimeType': 'application/x-his-bor' } |
], |
'enabledMode': 'disabledByPolicy' |
@@ -81,7 +81,7 @@ var pluginDataFormat = { |
function renderTemplate(pluginsData) { |
// This is the javascript code that processes the template: |
var input = new JsEvalContext(pluginsData); |
- var output = document.getElementById('pluginTemplate'); |
+ var output = $('pluginTemplate'); |
jstProcess(input, output); |
} |
@@ -97,9 +97,9 @@ function requestPluginsData() { |
function loadShowDetailsFromPrefs(show_details) { |
tmiModeExpanded = show_details; |
- document.getElementById('collapse').style.display = |
+ $('collapse').style.display = |
show_details ? 'inline' : 'none'; |
- document.getElementById('expand').style.display = |
+ $('expand').style.display = |
show_details ? 'none' : 'inline'; |
document.body.className = show_details ? 'show-tmi-mode' : 'hide-tmi-mode'; |
@@ -109,8 +109,8 @@ function loadShowDetailsFromPrefs(show_details) { |
* Called by the web_ui_ to re-populate the page with data representing the |
* current state of installed plugins. |
*/ |
-function returnPluginsData(pluginsData){ |
- var bodyContainer = document.getElementById('body-container'); |
+function returnPluginsData(pluginsData) { |
+ var bodyContainer = $('body-container'); |
var body = document.body; |
// Set all page content to be visible so we can measure heights. |
@@ -125,38 +125,42 @@ function returnPluginsData(pluginsData){ |
// Add handlers to dynamically created HTML elements. |
var links = document.getElementsByClassName('disable-plugin-link'); |
for (var i = 0; i < links.length; i++) { |
- links[i].onclick = function () { |
+ links[i].onclick = function() { |
handleEnablePlugin(this, false, false); |
return false; |
}; |
} |
links = document.getElementsByClassName('enable-plugin-link'); |
for (var i = 0; i < links.length; i++) { |
- links[i].onclick = function () { |
+ links[i].onclick = function() { |
handleEnablePlugin(this, true, false); |
return false; |
}; |
} |
links = document.getElementsByClassName('disable-group-link'); |
for (var i = 0; i < links.length; i++) { |
- links[i].onclick = function () { |
+ links[i].onclick = function() { |
handleEnablePlugin(this, false, true); |
return false; |
}; |
} |
links = document.getElementsByClassName('enable-group-link'); |
for (var i = 0; i < links.length; i++) { |
- links[i].onclick = function () { |
+ links[i].onclick = function() { |
handleEnablePlugin(this, true, true); |
return false; |
}; |
} |
var checkboxes = document.getElementsByClassName('always-allow'); |
for (var i = 0; i < checkboxes.length; i++) { |
- checkboxes[i].onclick = function () { |
- handleSetPluginAlwaysAllowed(this) |
+ checkboxes[i].onclick = function() { |
+ handleSetPluginAlwaysAllowed(this); |
}; |
- }; |
+ } |
+ |
+ // Disable some controls for Guest in ChromeOS. |
+ if (cr.isChromeOS) |
+ uiAccountTweaks.UIAccountTweaks.applyGuestModeVisibility(document); |
// Make sure the left column (with "Description:", "Location:", etc.) is the |
// same size for all plugins. |
@@ -176,9 +180,9 @@ function returnPluginsData(pluginsData){ |
slidables[i].style.height = slidables[i].offsetHeight + 'px'; |
// Reset visibility of page based on the current tmi mode. |
- document.getElementById('collapse').style.display = |
+ $('collapse').style.display = |
tmiModeExpanded ? 'inline' : 'none'; |
- document.getElementById('expand').style.display = |
+ $('expand').style.display = |
tmiModeExpanded ? 'none' : 'inline'; |
bodyContainer.style.visibility = 'visible'; |
body.className = tmiModeExpanded ? |
@@ -203,9 +207,9 @@ var tmiModeExpanded = false; |
function toggleTmiMode() { |
tmiModeExpanded = !tmiModeExpanded; |
- document.getElementById('collapse').style.display = |
+ $('collapse').style.display = |
tmiModeExpanded ? 'inline' : 'none'; |
- document.getElementById('expand').style.display = |
+ $('expand').style.display = |
tmiModeExpanded ? 'none' : 'inline'; |
document.body.className = |
@@ -254,7 +258,7 @@ setInterval(requestPluginsData, 30000); |
document.addEventListener('DOMContentLoaded', requestPluginsData); |
// Add handlers to static HTML elements. |
-document.getElementById('collapse').onclick = toggleTmiMode; |
-document.getElementById('expand').onclick = toggleTmiMode; |
-document.getElementById('details-link').onclick = toggleTmiMode; |
+$('collapse').onclick = toggleTmiMode; |
+$('expand').onclick = toggleTmiMode; |
+$('details-link').onclick = toggleTmiMode; |