| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * Contains the possible types of Change Picture selections. | 6 * Contains the possible types of Change Picture selections. |
| 7 * @enum {string} | 7 * @enum {string} |
| 8 */ | 8 */ |
| 9 var ChangePictureSelectionTypes = { | 9 var ChangePictureSelectionTypes = { |
| 10 CAMERA: 'camera', | 10 CAMERA: 'camera', |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 /** @protected */ | 139 /** @protected */ |
| 140 currentRouteChanged: function(newRoute) { | 140 currentRouteChanged: function(newRoute) { |
| 141 if (newRoute == settings.Route.CHANGE_PICTURE) { | 141 if (newRoute == settings.Route.CHANGE_PICTURE) { |
| 142 this.browserProxy_.initialize(); | 142 this.browserProxy_.initialize(); |
| 143 | 143 |
| 144 // This in needed because we manually clear the selectedItem_ property | 144 // This in needed because we manually clear the selectedItem_ property |
| 145 // when navigating away. The selector element doesn't fire its upward | 145 // when navigating away. The selector element doesn't fire its upward |
| 146 // data binding unless its selected item has changed. | 146 // data binding unless its selected item has changed. |
| 147 this.selectedItem_ = this.$.selector.selectedItem; | 147 this.selectedItem_ = this.$.selector.selectedItem; |
| 148 // Focus the container by default so that the arrow keys work (and since |
| 149 // we use the focus highlight to show which picture is selected). |
| 150 this.$.container.focus(); |
| 148 } else { | 151 } else { |
| 149 // Ensure we deactivate the camera when we navigate away. | 152 // Ensure we deactivate the camera when we navigate away. |
| 150 this.selectedItem_ = null; | 153 this.selectedItem_ = null; |
| 151 } | 154 } |
| 152 }, | 155 }, |
| 153 | 156 |
| 154 /** | 157 /** |
| 155 * Handler for the 'default-images-changed' event. | 158 * Handler for the 'default-images-changed' event. |
| 156 * @param {!Array<!settings.DefaultImage>} images | 159 * @param {!Array<!settings.DefaultImage>} images |
| 157 * @private | 160 * @private |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 */ | 447 */ |
| 445 getAuthorWebsite_: function(selectedItem, defaultImages) { | 448 getAuthorWebsite_: function(selectedItem, defaultImages) { |
| 446 if (!this.isAuthorCreditShown_(selectedItem)) | 449 if (!this.isAuthorCreditShown_(selectedItem)) |
| 447 return ''; | 450 return ''; |
| 448 | 451 |
| 449 assert(selectedItem.dataset.defaultImageIndex !== null && | 452 assert(selectedItem.dataset.defaultImageIndex !== null && |
| 450 selectedItem.dataset.defaultImageIndex < defaultImages.length); | 453 selectedItem.dataset.defaultImageIndex < defaultImages.length); |
| 451 return defaultImages[selectedItem.dataset.defaultImageIndex].website; | 454 return defaultImages[selectedItem.dataset.defaultImageIndex].website; |
| 452 }, | 455 }, |
| 453 }); | 456 }); |
| OLD | NEW |