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

Side by Side Diff: chrome/browser/resources/chromeos/user_images_grid.js

Issue 10825141: Keep CrOS OOBE user image grid from stealing focus from the OK button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 cr.define('options', function() { 5 cr.define('options', function() {
6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel;
7 /** @const */ var Grid = cr.ui.Grid; 7 /** @const */ var Grid = cr.ui.Grid;
8 /** @const */ var GridItem = cr.ui.GridItem; 8 /** @const */ var GridItem = cr.ui.GridItem;
9 /** @const */ var GridSelectionController = cr.ui.GridSelectionController; 9 /** @const */ var GridSelectionController = cr.ui.GridSelectionController;
10 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; 10 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel;
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 imageUrl = UserImagesGrid.ButtonImages.TAKE_PHOTO; 322 imageUrl = UserImagesGrid.ButtonImages.TAKE_PHOTO;
323 if (imageUrl) { 323 if (imageUrl) {
324 this.cameraImage_ = this.cameraImage_ ? 324 this.cameraImage_ = this.cameraImage_ ?
325 this.updateItem(this.cameraImage_, imageUrl) : 325 this.updateItem(this.cameraImage_, imageUrl) :
326 this.addItem(imageUrl, this.cameraTitle_, undefined, 0); 326 this.addItem(imageUrl, this.cameraTitle_, undefined, 0);
327 this.cameraImage_.type = 'camera'; 327 this.cameraImage_.type = 'camera';
328 } else { 328 } else {
329 this.removeItem(this.cameraImage_); 329 this.removeItem(this.cameraImage_);
330 this.cameraImage_ = null; 330 this.cameraImage_ = null;
331 } 331 }
332 this.focus(); 332
333 // Set focus to the grid, unless focus is on the OK button.
334 if (!document.activeElement || document.activeElement.tagName != 'BUTTON')
335 this.focus();
333 }, 336 },
334 337
335 /** 338 /**
336 * Title for the camera element. Must be set before setting |cameraImage| 339 * Title for the camera element. Must be set before setting |cameraImage|
337 * for the first time. 340 * for the first time.
338 * @type {string} 341 * @type {string}
339 */ 342 */
340 set cameraTitle(value) { 343 set cameraTitle(value) {
341 return this.cameraTitle_ = value; 344 return this.cameraTitle_ = value;
342 }, 345 },
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 UserImagesGrid.ButtonImages = { 651 UserImagesGrid.ButtonImages = {
649 TAKE_PHOTO: 'chrome://theme/IDR_BUTTON_USER_IMAGE_TAKE_PHOTO', 652 TAKE_PHOTO: 'chrome://theme/IDR_BUTTON_USER_IMAGE_TAKE_PHOTO',
650 CHOOSE_FILE: 'chrome://theme/IDR_BUTTON_USER_IMAGE_CHOOSE_FILE', 653 CHOOSE_FILE: 'chrome://theme/IDR_BUTTON_USER_IMAGE_CHOOSE_FILE',
651 PROFILE_PICTURE: 'chrome://theme/IDR_PROFILE_PICTURE_LOADING' 654 PROFILE_PICTURE: 'chrome://theme/IDR_PROFILE_PICTURE_LOADING'
652 }; 655 };
653 656
654 return { 657 return {
655 UserImagesGrid: UserImagesGrid 658 UserImagesGrid: UserImagesGrid
656 }; 659 };
657 }); 660 });
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