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

Side by Side Diff: chrome/browser/resources/image_loader/image_loader.js

Issue 181203002: Get rid of mountPath dependency in Files app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased + cleaned up. Created 6 years, 9 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
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 24 matching lines...) Expand all
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 initializatino 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 // TODO(mtomasz): Get rid of mountPath when possible. 45 if (event.eventType == 'mount' && event.status == 'success') {
46 if (event.eventType == 'mount' && event.volumeMetadata.mountPath) {
47 chrome.fileBrowserPrivate.requestFileSystem( 46 chrome.fileBrowserPrivate.requestFileSystem(
48 event.volumeMetadata.volumeId, function() {}); 47 event.volumeMetadata.volumeId, function() {});
49 } 48 }
50 }); 49 });
51 }.bind(this)); 50 }.bind(this));
52 51
53 // Listen for incoming requests. 52 // Listen for incoming requests.
54 chrome.extension.onMessageExternal.addListener(function(request, 53 chrome.extension.onMessageExternal.addListener(function(request,
55 sender, 54 sender,
56 sendResponse) { 55 sendResponse) {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 targetContext.translate(target.width / 2, target.height / 2); 225 targetContext.translate(target.width / 2, target.height / 2);
227 targetContext.rotate(orientation * Math.PI / 2); 226 targetContext.rotate(orientation * Math.PI / 2);
228 targetContext.drawImage( 227 targetContext.drawImage(
229 source, 228 source,
230 0, 0, 229 0, 0,
231 source.width, source.height, 230 source.width, source.height,
232 -drawImageWidth / 2, -drawImageHeight / 2, 231 -drawImageWidth / 2, -drawImageHeight / 2,
233 drawImageWidth, drawImageHeight); 232 drawImageWidth, drawImageHeight);
234 targetContext.restore(); 233 targetContext.restore();
235 }; 234 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698