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

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

Issue 553573003: Compile chrome://settings, part 3: 167 proper errors left (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@G_options_errors_1
Patch Set: rebase Created 6 years, 3 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/browser/resources/options/autofill_edit_address_overlay.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 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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 * @return {boolean} Whether photo capture was successful. 459 * @return {boolean} Whether photo capture was successful.
460 */ 460 */
461 takePhoto: function() { 461 takePhoto: function() {
462 if (!this.cameraOnline) 462 if (!this.cameraOnline)
463 return false; 463 return false;
464 var canvas = /** @type {HTMLCanvasElement} */( 464 var canvas = /** @type {HTMLCanvasElement} */(
465 document.createElement('canvas')); 465 document.createElement('canvas'));
466 canvas.width = CAPTURE_SIZE.width; 466 canvas.width = CAPTURE_SIZE.width;
467 canvas.height = CAPTURE_SIZE.height; 467 canvas.height = CAPTURE_SIZE.height;
468 this.captureFrame_( 468 this.captureFrame_(
469 this.cameraVideo_, canvas.getContext('2d'), CAPTURE_SIZE); 469 this.cameraVideo_,
470 /** @type {CanvasRenderingContext2D} */(canvas.getContext('2d')),
471 CAPTURE_SIZE);
470 // Preload image before displaying it. 472 // Preload image before displaying it.
471 var previewImg = new Image(); 473 var previewImg = new Image();
472 previewImg.addEventListener('load', function(e) { 474 previewImg.addEventListener('load', function(e) {
473 this.cameraTitle_ = this.capturedImageTitle_; 475 this.cameraTitle_ = this.capturedImageTitle_;
474 this.cameraImage = previewImg.src; 476 this.cameraImage = previewImg.src;
475 }.bind(this)); 477 }.bind(this));
476 previewImg.src = canvas.toDataURL('image/png'); 478 previewImg.src = canvas.toDataURL('image/png');
477 var e = new Event('phototaken'); 479 var e = new Event('phototaken');
478 e.dataURL = this.flipPhoto ? this.flipFrame_(canvas) : previewImg.src; 480 e.dataURL = this.flipPhoto ? this.flipFrame_(canvas) : previewImg.src;
479 this.dispatchEvent(e); 481 this.dispatchEvent(e);
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 UserImagesGrid.ButtonImages = { 642 UserImagesGrid.ButtonImages = {
641 TAKE_PHOTO: 'chrome://theme/IDR_BUTTON_USER_IMAGE_TAKE_PHOTO', 643 TAKE_PHOTO: 'chrome://theme/IDR_BUTTON_USER_IMAGE_TAKE_PHOTO',
642 CHOOSE_FILE: 'chrome://theme/IDR_BUTTON_USER_IMAGE_CHOOSE_FILE', 644 CHOOSE_FILE: 'chrome://theme/IDR_BUTTON_USER_IMAGE_CHOOSE_FILE',
643 PROFILE_PICTURE: 'chrome://theme/IDR_PROFILE_PICTURE_LOADING' 645 PROFILE_PICTURE: 'chrome://theme/IDR_PROFILE_PICTURE_LOADING'
644 }; 646 };
645 647
646 return { 648 return {
647 UserImagesGrid: UserImagesGrid 649 UserImagesGrid: UserImagesGrid
648 }; 650 };
649 }); 651 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/options/autofill_edit_address_overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698