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

Side by Side Diff: chrome/browser/resources/file_manager/js/image_editor/commands.js

Issue 12212127: [cleanup] Files.app: Remove Function declarations within blocks #3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « no previous file | chrome/browser/resources/file_manager/js/image_editor/exif_encoder.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 /** 5 /**
6 * Command queue is the only way to modify images. 6 * Command queue is the only way to modify images.
7 * Supports undo/redo. 7 * Supports undo/redo.
8 * Command execution is asynchronous (callback-based). 8 * Command execution is asynchronous (callback-based).
9 * 9 *
10 * @param {Document} document Document to create canvases in. 10 * @param {Document} document Document to create canvases in.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 if (this.previousImage_) { 177 if (this.previousImage_) {
178 // First undo after an execute call. 178 // First undo after an execute call.
179 this.currentImage_ = this.previousImage_; 179 this.currentImage_ = this.previousImage_;
180 this.previousImage_ = null; 180 this.previousImage_ = null;
181 complete(); 181 complete();
182 // TODO(kaznacheev) Consider recalculating previousImage_ right here 182 // TODO(kaznacheev) Consider recalculating previousImage_ right here
183 // by replaying the commands in the background. 183 // by replaying the commands in the background.
184 } else { 184 } else {
185 this.currentImage_ = this.baselineImage_; 185 this.currentImage_ = this.baselineImage_;
186 186
187 function replay(index) { 187 var replay = function(index) {
188 if (index < self.undo_.length) 188 if (index < self.undo_.length)
189 self.doExecute_(self.undo_[index], {}, replay.bind(null, index + 1)); 189 self.doExecute_(self.undo_[index], {}, replay.bind(null, index + 1));
190 else { 190 else {
191 complete(); 191 complete();
192 } 192 }
193 } 193 };
194 194
195 replay(0); 195 replay(0);
196 } 196 }
197 }; 197 };
198 198
199 /** 199 /**
200 * @return {boolean} True if Redo is applicable. 200 * @return {boolean} True if Redo is applicable.
201 */ 201 */
202 CommandQueue.prototype.canRedo = function() { 202 CommandQueue.prototype.canRedo = function() {
203 return this.redo_.length != 0; 203 return this.redo_.length != 0;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 398
399 function onProgressInvisible(updatedRow, rowCount) { 399 function onProgressInvisible(updatedRow, rowCount) {
400 if (updatedRow == rowCount) { 400 if (updatedRow == rowCount) {
401 callback(result); 401 callback(result);
402 } 402 }
403 } 403 }
404 404
405 filter.applyByStrips(result, srcCanvas, this.filter_, 405 filter.applyByStrips(result, srcCanvas, this.filter_,
406 uiContext.imageView ? onProgressVisible : onProgressInvisible); 406 uiContext.imageView ? onProgressVisible : onProgressInvisible);
407 }; 407 };
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/image_editor/exif_encoder.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698