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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
387 'click', function(e) { | 387 'click', function(e) { |
388 previewElement.classList.add('animation'); | 388 previewElement.classList.add('animation'); |
389 imageGrid.flipPhoto = !imageGrid.flipPhoto; | 389 imageGrid.flipPhoto = !imageGrid.flipPhoto; |
390 }); | 390 }); |
391 $('user-image-stream-crop').addEventListener( | 391 $('user-image-stream-crop').addEventListener( |
392 'webkitTransitionEnd', function(e) { | 392 'webkitTransitionEnd', function(e) { |
393 previewElement.classList.remove('animation'); | 393 previewElement.classList.remove('animation'); |
394 }); | 394 }); |
395 | 395 |
396 this.updateLocalizedContent(); | 396 this.updateLocalizedContent(); |
397 | |
398 window.setTimeout(function() { | |
399 console.error('\n\n' + document.body.innerHTML + '\n'); | |
Ivan Korotkov
2012/08/03 01:00:23
Cleanup?
dmazzoni
2012/08/03 22:59:01
Done.
| |
400 }, 10000); | |
397 }, | 401 }, |
398 | 402 |
399 /** | 403 /** |
400 * Header text of the screen. | 404 * Header text of the screen. |
401 * @type {string} | 405 * @type {string} |
402 */ | 406 */ |
403 get header() { | 407 get header() { |
404 return localStrings.getString('userImageScreenTitle'); | 408 return localStrings.getString('userImageScreenTitle'); |
405 }, | 409 }, |
406 | 410 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
525 setProfileImage_: function(imageUrl) { | 529 setProfileImage_: function(imageUrl) { |
526 this.profileImageLoading = false; | 530 this.profileImageLoading = false; |
527 if (imageUrl !== null) { | 531 if (imageUrl !== null) { |
528 this.profileImage_ = | 532 this.profileImage_ = |
529 $('user-image-grid').updateItem(this.profileImage_, imageUrl); | 533 $('user-image-grid').updateItem(this.profileImage_, imageUrl); |
530 } | 534 } |
531 }, | 535 }, |
532 | 536 |
533 /** | 537 /** |
534 * Appends received images to the list. | 538 * Appends received images to the list. |
535 * @param {Array.<string>} images An array of URLs to user images. | 539 * @param {Array.<Object>} imageInfos An array of data about user images. |
536 * @private | 540 * @private |
537 */ | 541 */ |
538 setUserImages_: function(images) { | 542 setUserImages_: function(imageInfos) { |
Ivan Korotkov
2012/08/03 01:00:23
There are two distinct implementations in this fil
dmazzoni
2012/08/03 22:59:01
Ah - I thought the top one was going to go away. T
Ivan Korotkov
2012/08/03 23:19:37
It is, but we're keeping both of them operational
| |
539 var imageGrid = $('user-image-grid'); | 543 var imageGrid = $('user-image-grid'); |
540 for (var i = 0, url; url = images[i]; i++) | 544 for (var i = 0, imageInfo; imageInfo = imageInfos[i]; i++) |
Ivan Korotkov
2012/08/03 01:00:23
Indentation & add parens, please.
dmazzoni
2012/08/03 22:59:01
Done.
| |
541 imageGrid.addItem(url).type = 'default'; | 545 imageGrid.addItem(imageInfo.url, imageInfo.title).type = 'default'; |
542 }, | 546 }, |
543 | 547 |
544 /** | 548 /** |
545 * Selects user image with the given URL. | 549 * Selects user image with the given URL. |
546 * @param {string} url URL of the image to select. | 550 * @param {string} url URL of the image to select. |
547 * @private | 551 * @private |
548 */ | 552 */ |
549 setSelectedImage_: function(url) { | 553 setSelectedImage_: function(url) { |
550 var imageGrid = $('user-image-grid'); | 554 var imageGrid = $('user-image-grid'); |
551 imageGrid.selectedItemUrl = url; | 555 imageGrid.selectedItemUrl = url; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
589 ].forEach(function(name) { | 593 ].forEach(function(name) { |
590 UserImageScreen[name] = function(value) { | 594 UserImageScreen[name] = function(value) { |
591 $('user-image')[name + '_'](value); | 595 $('user-image')[name + '_'](value); |
592 }; | 596 }; |
593 }); | 597 }); |
594 | 598 |
595 return { | 599 return { |
596 UserImageScreen: UserImageScreen | 600 UserImageScreen: UserImageScreen |
597 }; | 601 }; |
598 }); | 602 }); |
OLD | NEW |