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

Unified Diff: ui/webui/resources/js/cr.js

Issue 2597013002: Run clang-format on ui/webui/resources (Closed)
Patch Set: remove cr_shared_menu.js Created 4 years 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: ui/webui/resources/js/cr.js
diff --git a/ui/webui/resources/js/cr.js b/ui/webui/resources/js/cr.js
index 3c1b75ec09a88217c47a756253eafb2c0797141d..14bccfb778ea2c0216918456a8065a388b23c621 100644
--- a/ui/webui/resources/js/cr.js
+++ b/ui/webui/resources/js/cr.js
@@ -109,19 +109,13 @@ var cr = cr || function() {
switch (kind) {
case PropertyKind.JS:
var privateName = name + '_';
- return function() {
- return this[privateName];
- };
+ return function() { return this[privateName]; };
case PropertyKind.ATTR:
var attributeName = getAttributeName(name);
- return function() {
- return this.getAttribute(attributeName);
- };
+ return function() { return this.getAttribute(attributeName); };
case PropertyKind.BOOL_ATTR:
var attributeName = getAttributeName(name);
- return function() {
- return this.hasAttribute(attributeName);
- };
+ return function() { return this.hasAttribute(attributeName); };
}
// TODO(dbeam): replace with assertNotReached() in assert.js when I can coax
@@ -220,9 +214,7 @@ var cr = cr || function() {
/**
* @return {number} A new unique ID.
*/
- function createUid() {
- return uidCounter++;
- }
+ function createUid() { return uidCounter++; }
/**
* Returns a unique ID for the item. This mutates the item so it needs to be
@@ -280,8 +272,8 @@ var cr = cr || function() {
// Maybe we should check the prototype chain here? The current usage
// pattern is always using an object literal so we only care about own
// properties.
- var propertyDescriptor = Object.getOwnPropertyDescriptor(exports,
- propertyName);
+ var propertyDescriptor =
+ Object.getOwnPropertyDescriptor(exports, propertyName);
if (propertyDescriptor)
Object.defineProperty(obj, propertyName, propertyDescriptor);
}
@@ -311,7 +303,7 @@ var cr = cr || function() {
methods.forEach(function(method) {
ctor[method] = function() {
var target = opt_target ? document.getElementById(opt_target) :
- ctor.getInstance();
+ ctor.getInstance();
dschuyler 2016/12/22 19:41:40 In some cases the format seems to favor doing a si
Dan Beam 2016/12/22 19:48:11 this is configurable to some extent
return target[method + '_'].apply(target, arguments);
};
});
@@ -448,38 +440,24 @@ var cr = cr || function() {
webUIListenerCallback: webUIListenerCallback,
webUIResponse: webUIResponse,
- get doc() {
- return document;
- },
+ get doc() { return document; },
/** Whether we are using a Mac or not. */
- get isMac() {
- return /Mac/.test(navigator.platform);
- },
+ get isMac() { return /Mac/.test(navigator.platform); },
/** Whether this is on the Windows platform or not. */
- get isWindows() {
- return /Win/.test(navigator.platform);
- },
+ get isWindows() { return /Win/.test(navigator.platform); },
/** Whether this is on chromeOS or not. */
- get isChromeOS() {
- return /CrOS/.test(navigator.userAgent);
- },
+ get isChromeOS() { return /CrOS/.test(navigator.userAgent); },
/** Whether this is on vanilla Linux (not chromeOS). */
- get isLinux() {
- return /Linux/.test(navigator.userAgent);
- },
+ get isLinux() { return /Linux/.test(navigator.userAgent); },
/** Whether this is on Android. */
- get isAndroid() {
- return /Android/.test(navigator.userAgent);
- },
+ get isAndroid() { return /Android/.test(navigator.userAgent); },
/** Whether this is on iOS. */
- get isIOS() {
- return /iPad|iPhone|iPod/.test(navigator.platform);
- }
+ get isIOS() { return /iPad|iPhone|iPod/.test(navigator.platform); }
};
}();

Powered by Google App Engine
This is Rietveld 408576698