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

Side by Side Diff: chrome/browser/resources/settings/people_page/change_picture.js

Issue 2623993002: MD Settings People: Fix ChromeOS Change Picture arrow keys (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/chromium/src into 366-settings-fix-chang… Created 3 years, 11 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
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/people_page_change_picture_test.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 * Contains the possible types of Change Picture selections. 6 * Contains the possible types of Change Picture selections.
7 * @enum {string} 7 * @enum {string}
8 */ 8 */
9 var ChangePictureSelectionTypes = { 9 var ChangePictureSelectionTypes = {
10 CAMERA: 'camera', 10 CAMERA: 'camera',
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 var /** IronSelectorElement */ selector = this.$.selector; 275 var /** IronSelectorElement */ selector = this.$.selector;
276 switch (e.detail.key) { 276 switch (e.detail.key) {
277 case 'up': 277 case 'up':
278 case 'left': 278 case 'left':
279 // This loop always terminates because the file and profile icons are 279 // This loop always terminates because the file and profile icons are
280 // never hidden. 280 // never hidden.
281 do { 281 do {
282 selector.selectPrevious(); 282 selector.selectPrevious();
283 } while (this.selectedItem_.hidden); 283 } while (this.selectedItem_.hidden);
284 284
285 if (this.selectedItem_.dataset.type != ChangePictureSelectionTypes.FILE)
286 this.selectImage_(this.selectedItem_);
287
285 this.lastSelectedImageType_ = this.selectedItem_.dataset.type; 288 this.lastSelectedImageType_ = this.selectedItem_.dataset.type;
286 e.detail.keyboardEvent.preventDefault(); 289 e.detail.keyboardEvent.preventDefault();
287 break; 290 break;
288 291
289 case 'down': 292 case 'down':
290 case 'right': 293 case 'right':
291 // This loop always terminates because the file and profile icons are 294 // This loop always terminates because the file and profile icons are
292 // never hidden. 295 // never hidden.
293 do { 296 do {
294 selector.selectNext(); 297 selector.selectNext();
295 } while (this.selectedItem_.hidden); 298 } while (this.selectedItem_.hidden);
296 299
300 if (this.selectedItem_.dataset.type != ChangePictureSelectionTypes.FILE)
301 this.selectImage_(this.selectedItem_);
302
297 this.lastSelectedImageType_ = this.selectedItem_.dataset.type; 303 this.lastSelectedImageType_ = this.selectedItem_.dataset.type;
298 e.detail.keyboardEvent.preventDefault(); 304 e.detail.keyboardEvent.preventDefault();
299 break; 305 break;
300 306
301 case 'enter': 307 case 'enter':
302 case 'space': 308 case 'space':
303 if (this.selectedItem_.dataset.type == 309 if (this.selectedItem_.dataset.type ==
304 ChangePictureSelectionTypes.CAMERA) { 310 ChangePictureSelectionTypes.CAMERA) {
305 var /** SettingsCameraElement */ camera = this.$.camera; 311 var /** SettingsCameraElement */ camera = this.$.camera;
306 camera.takePhoto(); 312 camera.takePhoto();
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 */ 444 */
439 getAuthorWebsite_: function(selectedItem, defaultImages) { 445 getAuthorWebsite_: function(selectedItem, defaultImages) {
440 if (!this.isAuthorCreditShown_(selectedItem)) 446 if (!this.isAuthorCreditShown_(selectedItem))
441 return ''; 447 return '';
442 448
443 assert(selectedItem.dataset.defaultImageIndex !== null && 449 assert(selectedItem.dataset.defaultImageIndex !== null &&
444 selectedItem.dataset.defaultImageIndex < defaultImages.length); 450 selectedItem.dataset.defaultImageIndex < defaultImages.length);
445 return defaultImages[selectedItem.dataset.defaultImageIndex].website; 451 return defaultImages[selectedItem.dataset.defaultImageIndex].website;
446 }, 452 },
447 }); 453 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/people_page_change_picture_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698