| 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 login.createScreen('UserImageScreen', 'user-image', function() { | 9 login.createScreen('UserImageScreen', 'user-image', function() { |
| 10 var CONTEXT_KEY_IS_CAMERA_PRESENT = 'isCameraPresent'; | 10 var CONTEXT_KEY_IS_CAMERA_PRESENT = 'isCameraPresent'; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 $('take-photo').addEventListener( | 51 $('take-photo').addEventListener( |
| 52 'click', this.handleTakePhoto_.bind(this)); | 52 'click', this.handleTakePhoto_.bind(this)); |
| 53 $('discard-photo').addEventListener( | 53 $('discard-photo').addEventListener( |
| 54 'click', this.handleDiscardPhoto_.bind(this)); | 54 'click', this.handleDiscardPhoto_.bind(this)); |
| 55 | 55 |
| 56 // Toggle 'animation' class for the duration of WebKit transition. | 56 // Toggle 'animation' class for the duration of WebKit transition. |
| 57 $('flip-photo').addEventListener( | 57 $('flip-photo').addEventListener( |
| 58 'click', this.handleFlipPhoto_.bind(this)); | 58 'click', this.handleFlipPhoto_.bind(this)); |
| 59 $('user-image-stream-crop').addEventListener( | 59 $('user-image-stream-crop').addEventListener( |
| 60 'webkitTransitionEnd', function(e) { | 60 'transitionend', function(e) { |
| 61 previewElement.classList.remove('animation'); | 61 previewElement.classList.remove('animation'); |
| 62 }); | 62 }); |
| 63 $('user-image-preview-img').addEventListener( | 63 $('user-image-preview-img').addEventListener( |
| 64 'webkitTransitionEnd', function(e) { | 64 'transitionend', function(e) { |
| 65 previewElement.classList.remove('animation'); | 65 previewElement.classList.remove('animation'); |
| 66 }); | 66 }); |
| 67 | 67 |
| 68 var self = this; | 68 var self = this; |
| 69 this.context.addObserver(CONTEXT_KEY_IS_CAMERA_PRESENT, | 69 this.context.addObserver(CONTEXT_KEY_IS_CAMERA_PRESENT, |
| 70 function(present) { | 70 function(present) { |
| 71 $('user-image-grid').cameraPresent = present; | 71 $('user-image-grid').cameraPresent = present; |
| 72 }); | 72 }); |
| 73 this.context.addObserver(CONTEXT_KEY_SELECTED_IMAGE_URL, | 73 this.context.addObserver(CONTEXT_KEY_SELECTED_IMAGE_URL, |
| 74 this.setSelectedImage_); | 74 this.setSelectedImage_); |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 */ | 386 */ |
| 387 notifyImageSelected_: function() { | 387 notifyImageSelected_: function() { |
| 388 var imageGrid = $('user-image-grid'); | 388 var imageGrid = $('user-image-grid'); |
| 389 chrome.send('selectImage', | 389 chrome.send('selectImage', |
| 390 [imageGrid.selectedItemUrl, | 390 [imageGrid.selectedItemUrl, |
| 391 imageGrid.selectionType, | 391 imageGrid.selectionType, |
| 392 !imageGrid.inProgramSelection]); | 392 !imageGrid.inProgramSelection]); |
| 393 } | 393 } |
| 394 }; | 394 }; |
| 395 }); | 395 }); |
| OLD | NEW |