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

Side by Side Diff: ui/file_manager/gallery/js/image_editor/image_transform.js

Issue 1994563002: Remove the use of KeyEvent.keyIdentifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 * Crop mode. 6 * Crop mode.
7 * 7 *
8 * @extends {ImageEditor.Mode} 8 * @extends {ImageEditor.Mode}
9 * @constructor 9 * @constructor
10 * @struct 10 * @struct
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 for (var name in aspects) { 146 for (var name in aspects) {
147 var button = toolbar.addButton( 147 var button = toolbar.addButton(
148 name, 148 name,
149 ImageEditor.Toolbar.ButtonType.LABEL, 149 ImageEditor.Toolbar.ButtonType.LABEL,
150 this.onCropAspectRatioClicked_.bind(this, toolbar, aspects[name]), 150 this.onCropAspectRatioClicked_.bind(this, toolbar, aspects[name]),
151 'crop-aspect-ratio'); 151 'crop-aspect-ratio');
152 152
153 // Prevent from cropping by Enter key if the button is focused. 153 // Prevent from cropping by Enter key if the button is focused.
154 button.addEventListener('keydown', function(event) { 154 button.addEventListener('keydown', function(event) {
155 var key = util.getKeyModifiers(event) + event.keyIdentifier; 155 var key = util.getKeyModifiers(event) + event.key;
156 if (key === 'Enter') 156 if (key === 'Enter')
157 event.stopPropagation(); 157 event.stopPropagation();
158 }); 158 });
159 } 159 }
160 }; 160 };
161 161
162 /** 162 /**
163 * Handles click events of crop aspect ratio buttons. 163 * Handles click events of crop aspect ratio buttons.
164 * @param {!ImageEditor.Toolbar} toolbar Toolbar. 164 * @param {!ImageEditor.Toolbar} toolbar Toolbar.
165 * @param {number} aspect Aspect ratio. 165 * @param {number} aspect Aspect ratio.
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 break; 737 break;
738 case 'bottom': 738 case 'bottom':
739 this.bounds_.bottom = this.bounds_.top + newHeight; 739 this.bounds_.bottom = this.bounds_.top + newHeight;
740 break; 740 break;
741 case 'none': 741 case 'none':
742 this.bounds_.top = middle - newHeight / 2; 742 this.bounds_.top = middle - newHeight / 2;
743 this.bounds_.bottom = middle + newHeight / 2; 743 this.bounds_.bottom = middle + newHeight / 2;
744 break; 744 break;
745 } 745 }
746 }; 746 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698