| 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 var Page = cr.ui.pageManager.Page; | 6 var Page = cr.ui.pageManager.Page; |
| 7 var PageManager = cr.ui.pageManager.PageManager; | 7 var PageManager = cr.ui.pageManager.PageManager; |
| 8 var UserImagesGrid = options.UserImagesGrid; | 8 var UserImagesGrid = options.UserImagesGrid; |
| 9 var ButtonImages = UserImagesGrid.ButtonImages; | 9 var ButtonImages = UserImagesGrid.ButtonImages; |
| 10 | 10 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 /** | 197 /** |
| 198 * Handles image selection change. | 198 * Handles image selection change. |
| 199 * @param {Event} e Selection change Event. | 199 * @param {Event} e Selection change Event. |
| 200 * @private | 200 * @private |
| 201 */ | 201 */ |
| 202 handleImageSelected_: function(e) { | 202 handleImageSelected_: function(e) { |
| 203 var imageGrid = $('user-image-grid'); | 203 var imageGrid = $('user-image-grid'); |
| 204 var url = imageGrid.selectedItemUrl; | 204 var url = imageGrid.selectedItemUrl; |
| 205 | 205 |
| 206 // Flip button available only for camera picture. | 206 // Flip button available only for camera picture. |
| 207 imageGrid.flipPhotoElement.tabIndex = | 207 imageGrid.flipPhotoElement.hidden = |
| 208 imageGrid.selectionType == 'camera' ? 1 : -1; | 208 imageGrid.selectionType != 'camera'; |
| 209 // Ignore selection change caused by program itself and selection of one | 209 // Ignore selection change caused by program itself and selection of one |
| 210 // of the action buttons. | 210 // of the action buttons. |
| 211 if (!imageGrid.inProgramSelection && | 211 if (!imageGrid.inProgramSelection && |
| 212 url != ButtonImages.TAKE_PHOTO && url != ButtonImages.CHOOSE_FILE) { | 212 url != ButtonImages.TAKE_PHOTO && url != ButtonImages.CHOOSE_FILE) { |
| 213 chrome.send('selectImage', [url, imageGrid.selectionType]); | 213 chrome.send('selectImage', [url, imageGrid.selectionType]); |
| 214 } | 214 } |
| 215 // Start/stop camera on (de)selection. | 215 // Start/stop camera on (de)selection. |
| 216 if (!imageGrid.inProgramSelection && | 216 if (!imageGrid.inProgramSelection && |
| 217 imageGrid.selectionType != e.oldSelectionType) { | 217 imageGrid.selectionType != e.oldSelectionType) { |
| 218 if (imageGrid.selectionType == 'camera') { | 218 if (imageGrid.selectionType == 'camera') { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 'setProfileImage', | 322 'setProfileImage', |
| 323 'setSelectedImage', | 323 'setSelectedImage', |
| 324 ]); | 324 ]); |
| 325 | 325 |
| 326 // Export | 326 // Export |
| 327 return { | 327 return { |
| 328 ChangePictureOptions: ChangePictureOptions | 328 ChangePictureOptions: ChangePictureOptions |
| 329 }; | 329 }; |
| 330 | 330 |
| 331 }); | 331 }); |
| OLD | NEW |