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

Side by Side Diff: ui/file_manager/image_loader/image_loader.js

Issue 274473004: Nitpicking fixes for Files.app code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/file_manager/image_loader/cache.js ('k') | ui/file_manager/video_player/js/error_util.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * Loads and resizes an image. 8 * Loads and resizes an image.
9 * @constructor 9 * @constructor
10 */ 10 */
(...skipping 18 matching lines...) Expand all
29 var initPromises = volumeMetadataList.map(function(volumeMetadata) { 29 var initPromises = volumeMetadataList.map(function(volumeMetadata) {
30 var requestPromise = new Promise(function(callback) { 30 var requestPromise = new Promise(function(callback) {
31 chrome.fileBrowserPrivate.requestFileSystem( 31 chrome.fileBrowserPrivate.requestFileSystem(
32 volumeMetadata.volumeId, 32 volumeMetadata.volumeId,
33 callback); 33 callback);
34 }); 34 });
35 return requestPromise; 35 return requestPromise;
36 }); 36 });
37 initPromises.push(new Promise(this.cache_.initialize.bind(this.cache_))); 37 initPromises.push(new Promise(this.cache_.initialize.bind(this.cache_)));
38 38
39 // After all initializatino promises are done, start the worker. 39 // After all initialization promises are done, start the worker.
40 Promise.all(initPromises).then(this.worker_.start.bind(this.worker_)); 40 Promise.all(initPromises).then(this.worker_.start.bind(this.worker_));
41 41
42 // Listen for mount events, and grant permissions to volumes being mounted. 42 // Listen for mount events, and grant permissions to volumes being mounted.
43 chrome.fileBrowserPrivate.onMountCompleted.addListener( 43 chrome.fileBrowserPrivate.onMountCompleted.addListener(
44 function(event) { 44 function(event) {
45 if (event.eventType == 'mount' && event.status == 'success') { 45 if (event.eventType == 'mount' && event.status == 'success') {
46 chrome.fileBrowserPrivate.requestFileSystem( 46 chrome.fileBrowserPrivate.requestFileSystem(
47 event.volumeMetadata.volumeId, function() {}); 47 event.volumeMetadata.volumeId, function() {});
48 } 48 }
49 }); 49 });
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 targetContext.translate(target.width / 2, target.height / 2); 225 targetContext.translate(target.width / 2, target.height / 2);
226 targetContext.rotate(orientation * Math.PI / 2); 226 targetContext.rotate(orientation * Math.PI / 2);
227 targetContext.drawImage( 227 targetContext.drawImage(
228 source, 228 source,
229 0, 0, 229 0, 0,
230 source.width, source.height, 230 source.width, source.height,
231 -drawImageWidth / 2, -drawImageHeight / 2, 231 -drawImageWidth / 2, -drawImageHeight / 2,
232 drawImageWidth, drawImageHeight); 232 drawImageWidth, drawImageHeight);
233 targetContext.restore(); 233 targetContext.restore();
234 }; 234 };
OLDNEW
« no previous file with comments | « ui/file_manager/image_loader/cache.js ('k') | ui/file_manager/video_player/js/error_util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698