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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 if (!okButton.disabled) { | 298 if (!okButton.disabled) { |
299 // This ensures that #ok-button won't be re-enabled again. | 299 // This ensures that #ok-button won't be re-enabled again. |
300 $('user-image-grid').disabled = true; | 300 $('user-image-grid').disabled = true; |
301 okButton.disabled = true; | 301 okButton.disabled = true; |
302 chrome.send('onUserImageAccepted'); | 302 chrome.send('onUserImageAccepted'); |
303 } | 303 } |
304 }, | 304 }, |
305 | 305 |
306 /** | 306 /** |
307 * Appends default images to the image grid. Should only be called once. | 307 * Appends default images to the image grid. Should only be called once. |
308 * @param {Array.<{url: string, author: string, website: string}>} images | 308 * @param {Array<{url: string, author: string, website: string}>} images |
309 * An array of default images data, including URL, author and website. | 309 * An array of default images data, including URL, author and website. |
310 */ | 310 */ |
311 setDefaultImages: function(imagesData) { | 311 setDefaultImages: function(imagesData) { |
312 $('user-image-grid').setDefaultImages(imagesData); | 312 $('user-image-grid').setDefaultImages(imagesData); |
313 this.setSelectedImage_( | 313 this.setSelectedImage_( |
314 this.context.get(CONTEXT_KEY_SELECTED_IMAGE_URL, '')); | 314 this.context.get(CONTEXT_KEY_SELECTED_IMAGE_URL, '')); |
315 chrome.send('screenReady'); | 315 chrome.send('screenReady'); |
316 }, | 316 }, |
317 | 317 |
318 /** | 318 /** |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 */ | 368 */ |
369 notifyImageSelected_: function() { | 369 notifyImageSelected_: function() { |
370 var imageGrid = $('user-image-grid'); | 370 var imageGrid = $('user-image-grid'); |
371 chrome.send('selectImage', | 371 chrome.send('selectImage', |
372 [imageGrid.selectedItemUrl, | 372 [imageGrid.selectedItemUrl, |
373 imageGrid.selectionType, | 373 imageGrid.selectionType, |
374 !imageGrid.inProgramSelection]); | 374 !imageGrid.inProgramSelection]); |
375 } | 375 } |
376 }; | 376 }; |
377 }); | 377 }); |
OLD | NEW |