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

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

Issue 9567003: Prevented default backspace handler in File Browser Gallery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | 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 * Base class that Ribbon uses to display photos. 6 * Base class that Ribbon uses to display photos.
7 */ 7 */
8 8
9 function RibbonClient() {} 9 function RibbonClient() {}
10 10
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 Gallery.prototype.onShare_ = function(event) { 565 Gallery.prototype.onShare_ = function(event) {
566 this.editor_.enterMode(this.shareMode_, event); 566 this.editor_.enterMode(this.shareMode_, event);
567 if (this.isSharing_()) { 567 if (this.isSharing_()) {
568 this.cancelFading_(); 568 this.cancelFading_();
569 } else { 569 } else {
570 this.initiateFading_(); 570 this.initiateFading_();
571 } 571 }
572 }; 572 };
573 573
574 Gallery.prototype.onKeyDown_ = function(event) { 574 Gallery.prototype.onKeyDown_ = function(event) {
575 if (event.keyIdentifier == 'U+0008') { // Backspace.
SeRya 2012/03/01 11:04:08 We should be specific about modification. Otherwis
576 // The default handler would do history.back and close the Gallery.
577 // We do not want that.
578 event.preventDefault();
579 return;
580 }
581
575 if (this.isEditing_() && this.editor_.onKeyDown(event)) 582 if (this.isEditing_() && this.editor_.onKeyDown(event))
576 return; 583 return;
577 584
578 switch (event.keyIdentifier) { 585 switch (event.keyIdentifier) {
579 case 'U+001B': // Escape 586 case 'U+001B': // Escape
580 if (this.isEditing_()) { 587 if (this.isEditing_()) {
581 this.onEdit_(); 588 this.onEdit_();
582 } else if (this.isSharing_()) { 589 } else if (this.isSharing_()) {
583 this.onShare_(); 590 this.onShare_();
584 } else { 591 } else {
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 ShareMode.prototype.setUp = function() { 1264 ShareMode.prototype.setUp = function() {
1258 ImageEditor.Mode.prototype.setUp.apply(this, arguments); 1265 ImageEditor.Mode.prototype.setUp.apply(this, arguments);
1259 ImageUtil.setAttribute(this.menu_, 'hidden', false); 1266 ImageUtil.setAttribute(this.menu_, 'hidden', false);
1260 ImageUtil.setAttribute(this.button_, 'pressed', false); 1267 ImageUtil.setAttribute(this.button_, 'pressed', false);
1261 }; 1268 };
1262 1269
1263 ShareMode.prototype.cleanUpUI = function() { 1270 ShareMode.prototype.cleanUpUI = function() {
1264 ImageEditor.Mode.prototype.cleanUpUI.apply(this, arguments); 1271 ImageEditor.Mode.prototype.cleanUpUI.apply(this, arguments);
1265 ImageUtil.setAttribute(this.menu_, 'hidden', true); 1272 ImageUtil.setAttribute(this.menu_, 'hidden', true);
1266 }; 1273 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698