OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 10 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 Oobe.getInstance().headerHidden = true; | 224 Oobe.getInstance().headerHidden = true; |
225 $('user-image-grid').updateAndFocus(); | 225 $('user-image-grid').updateAndFocus(); |
226 chrome.send('onUserImageScreenShown'); | 226 chrome.send('onUserImageScreenShown'); |
227 }, | 227 }, |
228 | 228 |
229 /** | 229 /** |
230 * Accepts currently selected image, if possible. | 230 * Accepts currently selected image, if possible. |
231 * @private | 231 * @private |
232 */ | 232 */ |
233 acceptImage_: function() { | 233 acceptImage_: function() { |
234 if (!$('ok-button').disabled) | 234 var okButton = $('ok-button'); |
| 235 if (!okButton.disabled) { |
| 236 // This ensures that #ok-button won't be re-enabled again. |
| 237 $('user-image-grid').disabled = true; |
| 238 okButton.disabled = true; |
235 chrome.send('onUserImageAccepted'); | 239 chrome.send('onUserImageAccepted'); |
| 240 } |
236 }, | 241 }, |
237 | 242 |
238 /** | 243 /** |
239 * Notifies about camera presence change. | 244 * Notifies about camera presence change. |
240 * @param {boolean} present Whether a camera is present or not. | 245 * @param {boolean} present Whether a camera is present or not. |
241 * @private | 246 * @private |
242 */ | 247 */ |
243 setCameraPresent_: function(present) { | 248 setCameraPresent_: function(present) { |
244 var imageGrid = $('user-image-grid'); | 249 var imageGrid = $('user-image-grid'); |
245 if (present && !this.takePhotoButton_) { | 250 if (present && !this.takePhotoButton_) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 ].forEach(function(name) { | 332 ].forEach(function(name) { |
328 UserImageScreen[name] = function(value) { | 333 UserImageScreen[name] = function(value) { |
329 $('user-image')[name + '_'](value); | 334 $('user-image')[name + '_'](value); |
330 }; | 335 }; |
331 }); | 336 }); |
332 | 337 |
333 return { | 338 return { |
334 UserImageScreen: UserImageScreen | 339 UserImageScreen: UserImageScreen |
335 }; | 340 }; |
336 }); | 341 }); |
OLD | NEW |