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

Unified Diff: ui/file_manager/image_loader/image_loader.js

Issue 571453002: Correct indentation, JSDoc, etc... to comply with closure linter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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
« no previous file with comments | « ui/file_manager/image_loader/cache.js ('k') | ui/file_manager/image_loader/image_loader_client.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/image_loader/image_loader.js
diff --git a/ui/file_manager/image_loader/image_loader.js b/ui/file_manager/image_loader/image_loader.js
index a9019da2f7e56c4c563767f2aed06e8516e6cb93..fd9cfd73d07e6e6ed25129e4753d7f31da5a698f 100644
--- a/ui/file_manager/image_loader/image_loader.js
+++ b/ui/file_manager/image_loader/image_loader.js
@@ -50,23 +50,22 @@ function ImageLoader() {
}.bind(this));
// Listen for incoming requests.
- chrome.extension.onMessageExternal.addListener(function(request,
- sender,
- sendResponse) {
- if (ImageLoader.ALLOWED_CLIENTS.indexOf(sender.id) !== -1) {
- // Sending a response may fail if the receiver already went offline.
- // This is not an error, but a normal and quite common situation.
- var failSafeSendResponse = function(response) {
- try {
- sendResponse(response);
+ chrome.extension.onMessageExternal.addListener(
+ function(request, sender, sendResponse) {
+ if (ImageLoader.ALLOWED_CLIENTS.indexOf(sender.id) !== -1) {
+ // Sending a response may fail if the receiver already went offline.
+ // This is not an error, but a normal and quite common situation.
+ var failSafeSendResponse = function(response) {
+ try {
+ sendResponse(response);
+ }
+ catch (e) {
+ // Ignore the error.
+ }
+ };
+ return this.onMessage_(sender.id, request, failSafeSendResponse);
}
- catch (e) {
- // Ignore the error.
- }
- };
- return this.onMessage_(sender.id, request, failSafeSendResponse);
- }
- }.bind(this));
+ }.bind(this));
}
/**
@@ -168,18 +167,16 @@ ImageLoader.resizeDimensions = function(width, height, options) {
targetHeight = sourceHeight * options.scale;
}
- if (options.maxWidth &&
- targetWidth > options.maxWidth) {
- var scale = options.maxWidth / targetWidth;
- targetWidth *= scale;
- targetHeight *= scale;
+ if (options.maxWidth && targetWidth > options.maxWidth) {
+ var scale = options.maxWidth / targetWidth;
+ targetWidth *= scale;
+ targetHeight *= scale;
}
- if (options.maxHeight &&
- targetHeight > options.maxHeight) {
- var scale = options.maxHeight / targetHeight;
- targetWidth *= scale;
- targetHeight *= scale;
+ if (options.maxHeight && targetHeight > options.maxHeight) {
+ var scale = options.maxHeight / targetHeight;
+ targetWidth *= scale;
+ targetHeight *= scale;
}
if (options.width)
« no previous file with comments | « ui/file_manager/image_loader/cache.js ('k') | ui/file_manager/image_loader/image_loader_client.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698