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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 $('take-photo').addEventListener( | 70 $('take-photo').addEventListener( |
71 'click', this.handleTakePhoto_.bind(this)); | 71 'click', this.handleTakePhoto_.bind(this)); |
72 $('discard-photo').addEventListener( | 72 $('discard-photo').addEventListener( |
73 'click', this.handleDiscardPhoto_.bind(this)); | 73 'click', this.handleDiscardPhoto_.bind(this)); |
74 | 74 |
75 // Toggle 'animation' class for the duration of WebKit transition. | 75 // Toggle 'animation' class for the duration of WebKit transition. |
76 $('flip-photo').addEventListener( | 76 $('flip-photo').addEventListener( |
77 'click', this.handleFlipPhoto_.bind(this)); | 77 'click', this.handleFlipPhoto_.bind(this)); |
78 $('user-image-stream-crop').addEventListener( | 78 $('user-image-stream-crop').addEventListener( |
79 'webkitTransitionEnd', function(e) { | 79 'transitionend', function(e) { |
80 previewElement.classList.remove('animation'); | 80 previewElement.classList.remove('animation'); |
81 }); | 81 }); |
82 $('user-image-preview-img').addEventListener( | 82 $('user-image-preview-img').addEventListener( |
83 'webkitTransitionEnd', function(e) { | 83 'transitionend', function(e) { |
84 previewElement.classList.remove('animation'); | 84 previewElement.classList.remove('animation'); |
85 }); | 85 }); |
86 | 86 |
87 var self = this; | 87 var self = this; |
88 this.context.addObserver(CONTEXT_KEY_IS_CAMERA_PRESENT, | 88 this.context.addObserver(CONTEXT_KEY_IS_CAMERA_PRESENT, |
89 function(present) { | 89 function(present) { |
90 $('user-image-grid').cameraPresent = present; | 90 $('user-image-grid').cameraPresent = present; |
91 }); | 91 }); |
92 this.context.addObserver(CONTEXT_KEY_SELECTED_IMAGE_URL, | 92 this.context.addObserver(CONTEXT_KEY_SELECTED_IMAGE_URL, |
93 this.setSelectedImage_); | 93 this.setSelectedImage_); |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 */ | 380 */ |
381 notifyImageSelected_: function() { | 381 notifyImageSelected_: function() { |
382 var imageGrid = $('user-image-grid'); | 382 var imageGrid = $('user-image-grid'); |
383 chrome.send('selectImage', | 383 chrome.send('selectImage', |
384 [imageGrid.selectedItemUrl, | 384 [imageGrid.selectedItemUrl, |
385 imageGrid.selectionType, | 385 imageGrid.selectionType, |
386 !imageGrid.inProgramSelection]); | 386 !imageGrid.inProgramSelection]); |
387 } | 387 } |
388 }; | 388 }; |
389 }); | 389 }); |
OLD | NEW |