OLD | NEW |
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 * @fileoverview Oobe user image screen implementation. | 6 * @fileoverview Oobe user image screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('oobe', function() { | 9 cr.define('oobe', function() { |
10 var UserImagesGrid = options.UserImagesGrid; | 10 var UserImagesGrid = options.UserImagesGrid; |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 this.profileImageLoading = false; | 279 this.profileImageLoading = false; |
280 if (imageUrl !== null) { | 280 if (imageUrl !== null) { |
281 this.profileImagePresent_ = true; | 281 this.profileImagePresent_ = true; |
282 this.profileImageUrl_ = imageUrl; | 282 this.profileImageUrl_ = imageUrl; |
283 this.profileImage_ = | 283 this.profileImage_ = |
284 $('user-image-grid').updateItem(this.profileImage_, imageUrl); | 284 $('user-image-grid').updateItem(this.profileImage_, imageUrl); |
285 } | 285 } |
286 }, | 286 }, |
287 | 287 |
288 /** | 288 /** |
289 <<<<<<< HEAD | |
290 * Appends default images to the image grid. Should only be called once. | 289 * Appends default images to the image grid. Should only be called once. |
291 * @param {Array.<{url: string, author: string, website: string, | 290 * @param {Array.<{url: string, author: string, website: string, |
292 * title: string}>} images An array of default images data, | 291 * title: string}>} images An array of default images data, |
293 * including URL, title, author and website. | 292 * including URL, title, author and website. |
294 * @private | 293 * @private |
295 */ | 294 */ |
296 setDefaultImages_: function(images) { | 295 setDefaultImages_: function(images) { |
297 var imageGrid = $('user-image-grid'); | 296 var imageGrid = $('user-image-grid'); |
298 for (var i = 0, data; data = imagesData[i]; i++) { | 297 for (var i = 0, data; data = imagesData[i]; i++) { |
299 imageGrid.addItem(data.url, data.title); | 298 imageGrid.addItem(data.url, data.title); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 function(el) { // Custom decorator for Profile image element. | 368 function(el) { // Custom decorator for Profile image element. |
370 var spinner = el.ownerDocument.createElement('div'); | 369 var spinner = el.ownerDocument.createElement('div'); |
371 spinner.className = 'spinner'; | 370 spinner.className = 'spinner'; |
372 var spinnerBg = el.ownerDocument.createElement('div'); | 371 var spinnerBg = el.ownerDocument.createElement('div'); |
373 spinnerBg.className = 'spinner-bg'; | 372 spinnerBg.className = 'spinner-bg'; |
374 spinnerBg.appendChild(spinner); | 373 spinnerBg.appendChild(spinner); |
375 el.appendChild(spinnerBg); | 374 el.appendChild(spinnerBg); |
376 el.id = 'profile-image'; | 375 el.id = 'profile-image'; |
377 }); | 376 }); |
378 this.profileImage_.type = 'profile'; | 377 this.profileImage_.type = 'profile'; |
| 378 this.profileImageLoading = true; |
379 | 379 |
380 // Add camera stream element. | 380 // Add camera stream element. |
381 imageGrid.cameraImage = null; | 381 imageGrid.cameraImage = null; |
382 | 382 |
383 // Perform an early check if camera is present, without starting capture. | 383 // Perform an early check if camera is present, without starting capture. |
384 imageGrid.checkCameraPresence(false, false); | 384 imageGrid.checkCameraPresence(false, false); |
385 | 385 |
386 $('take-photo').addEventListener( | 386 $('take-photo').addEventListener( |
387 'click', this.handleTakePhoto_.bind(this)); | 387 'click', this.handleTakePhoto_.bind(this)); |
388 $('discard-photo').addEventListener( | 388 $('discard-photo').addEventListener( |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 ].forEach(function(name) { | 607 ].forEach(function(name) { |
608 UserImageScreen[name] = function(value) { | 608 UserImageScreen[name] = function(value) { |
609 $('user-image')[name + '_'](value); | 609 $('user-image')[name + '_'](value); |
610 }; | 610 }; |
611 }); | 611 }); |
612 | 612 |
613 return { | 613 return { |
614 UserImageScreen: UserImageScreen | 614 UserImageScreen: UserImageScreen |
615 }; | 615 }; |
616 }); | 616 }); |
OLD | NEW |