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

Unified Diff: chrome/browser/resources/extensions/extensions.js

Issue 2939273002: DO NOT SUBMIT: what chrome/browser/resources/ could eventually look like with clang-format (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/extensions/extensions.js
diff --git a/chrome/browser/resources/extensions/extensions.js b/chrome/browser/resources/extensions/extensions.js
index e6b511b28f1056d5ce70eaa94eac23d05988f93e..a85c0800406f9213f70f3d9a24ea16085d15f7f8 100644
--- a/chrome/browser/resources/extensions/extensions.js
+++ b/chrome/browser/resources/extensions/extensions.js
@@ -74,8 +74,7 @@ cr.define('extensions', function() {
// Get the initial profile state, and register to be notified of any
// future changes.
- chrome.developerPrivate.getProfileConfiguration(
- this.update_.bind(this));
+ chrome.developerPrivate.getProfileConfiguration(this.update_.bind(this));
chrome.developerPrivate.onProfileStateChanged.addListener(
this.update_.bind(this));
@@ -86,8 +85,9 @@ cr.define('extensions', function() {
chrome.developerPrivate.updateProfileConfiguration(
{inDeveloperMode: e.target.checked});
var suffix = $('toggle-dev-on').checked ? 'Enabled' : 'Disabled';
- chrome.send('metricsHandler:recordAction',
- ['Options_ToggleDeveloperMode_' + suffix]);
+ chrome.send(
+ 'metricsHandler:recordAction',
+ ['Options_ToggleDeveloperMode_' + suffix]);
}.bind(this));
window.addEventListener('resize', function() {
@@ -96,14 +96,14 @@ cr.define('extensions', function() {
// Set up the three dev mode buttons (load unpacked, pack and update).
$('load-unpacked').addEventListener('click', function(e) {
- chrome.send('metricsHandler:recordAction',
- ['Options_LoadUnpackedExtension']);
+ chrome.send(
+ 'metricsHandler:recordAction', ['Options_LoadUnpackedExtension']);
extensionLoader.loadUnpacked();
});
- $('pack-extension').addEventListener('click',
- this.handlePackExtension_.bind(this));
- $('update-extensions-now').addEventListener('click',
- this.handleUpdateExtensionNow_.bind(this));
+ $('pack-extension')
+ .addEventListener('click', this.handlePackExtension_.bind(this));
+ $('update-extensions-now')
+ .addEventListener('click', this.handleUpdateExtensionNow_.bind(this));
var dragTarget = document.documentElement;
/** @private {extensions.DragAndDropHandler} */
@@ -124,8 +124,8 @@ cr.define('extensions', function() {
// Hook up the configure commands link to the overlay.
var link = document.querySelector('.extension-commands-config');
- link.addEventListener('click',
- this.handleExtensionCommandsConfig_.bind(this));
+ link.addEventListener(
+ 'click', this.handleExtensionCommandsConfig_.bind(this));
// Initialize the Commands overlay.
extensions.ExtensionCommandsOverlay.getInstance().initializePage();
@@ -141,8 +141,8 @@ cr.define('extensions', function() {
document.getElementsByClassName('more-extensions-link');
for (var i = 0; i < moreExtensionLink.length; i++) {
moreExtensionLink[i].addEventListener('click', function(e) {
- chrome.send('metricsHandler:recordAction',
- ['Options_GetMoreExtensions']);
+ chrome.send(
+ 'metricsHandler:recordAction', ['Options_GetMoreExtensions']);
});
}
@@ -208,15 +208,17 @@ cr.define('extensions', function() {
$('load-unpacked').disabled = !profileInfo.canLoadUnpacked;
var extensionList = $('extension-settings-list');
- extensionList.updateExtensionsData(
- profileInfo.isIncognitoAvailable,
- profileInfo.appInfoDialogEnabled).then(function() {
- if (!this.hasLoaded_) {
- this.hasLoaded_ = true;
- this.setLoading_(false);
- }
- this.onExtensionCountChanged();
- }.bind(this));
+ extensionList
+ .updateExtensionsData(
+ profileInfo.isIncognitoAvailable,
+ profileInfo.appInfoDialogEnabled)
+ .then(function() {
+ if (!this.hasLoaded_) {
+ this.hasLoaded_ = true;
+ this.setLoading_(false);
+ }
+ this.onExtensionCountChanged();
+ }.bind(this));
},
/**
@@ -227,8 +229,8 @@ cr.define('extensions', function() {
* @private
*/
updateDevToggleControlledIndicator_: function(devModeControlledByPolicy) {
- var controlledIndicator = document.querySelector(
- '#dev-toggle .controlled-setting-indicator');
+ var controlledIndicator =
+ document.querySelector('#dev-toggle .controlled-setting-indicator');
if (!(controlledIndicator instanceof cr.ui.ControlledIndicator))
cr.ui.ControlledIndicator.decorate(controlledIndicator);
@@ -238,8 +240,7 @@ cr.define('extensions', function() {
var isVisible = controlledIndicator.getAttribute('controlled-by');
if (devModeControlledByPolicy && !isVisible) {
var controlledBy = 'policy';
- controlledIndicator.setAttribute(
- 'controlled-by', controlledBy);
+ controlledIndicator.setAttribute('controlled-by', controlledBy);
controlledIndicator.setAttribute(
'text' + controlledBy,
loadTimeData.getString('extensionControlledSettingPolicy'));
@@ -281,8 +282,7 @@ cr.define('extensions', function() {
*/
showExtensionCommandsConfigUi_: function() {
ExtensionSettings.showOverlay($('extension-commands-overlay'));
- chrome.send('metricsHandler:recordAction',
- ['Options_ExtensionCommands']);
+ chrome.send('metricsHandler:recordAction', ['Options_ExtensionCommands']);
},
/**
@@ -301,8 +301,7 @@ cr.define('extensions', function() {
*/
handleUpdateExtensionNow_: function(e) {
chrome.developerPrivate.autoUpdate();
- chrome.send('metricsHandler:recordAction',
- ['Options_UpdateExtensions']);
+ chrome.send('metricsHandler:recordAction', ['Options_UpdateExtensions']);
},
/**
@@ -319,15 +318,15 @@ cr.define('extensions', function() {
devControls.classList.toggle('animated', animated);
var buttons = devControls.querySelector('.button-container');
- Array.prototype.forEach.call(buttons.querySelectorAll('a, button'),
- function(control) {
- control.tabIndex = showDevControls ? 0 : -1;
- });
+ Array.prototype.forEach.call(
+ buttons.querySelectorAll('a, button'), function(control) {
+ control.tabIndex = showDevControls ? 0 : -1;
+ });
buttons.setAttribute('aria-hidden', !showDevControls);
window.requestAnimationFrame(function() {
- devControls.style.height = !showDevControls ? '' :
- buttons.offsetHeight + 'px';
+ devControls.style.height =
+ !showDevControls ? '' : buttons.offsetHeight + 'px';
document.dispatchEvent(new Event('devControlsVisibilityUpdated'));
}.bind(this));
@@ -442,8 +441,7 @@ cr.define('extensions', function() {
var style = document.createElement('style');
style.type = 'text/css';
- style.textContent =
- '.enable-checkbox-text {' +
+ style.textContent = '.enable-checkbox-text {' +
' min-width: ' + (pxWidth - trashWidth) + 'px;' +
'}' +
'#dev-toggle span {' +
@@ -453,9 +451,7 @@ cr.define('extensions', function() {
}
// Export
- return {
- ExtensionSettings: ExtensionSettings
- };
+ return {ExtensionSettings: ExtensionSettings};
});
window.addEventListener('load', function(e) {

Powered by Google App Engine
This is Rietveld 408576698