Chromium Code Reviews| 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 this.$.container.focus(); | |
|
tommycli
2017/03/03 23:26:51
I think this is a solid solution, but I think it's
stevenjb
2017/03/03 23:34:01
Good call. Done.
| |
| 148 } else { | 149 } else { |
| 149 // Ensure we deactivate the camera when we navigate away. | 150 // Ensure we deactivate the camera when we navigate away. |
| 150 this.selectedItem_ = null; | 151 this.selectedItem_ = null; |
| 151 } | 152 } |
| 152 }, | 153 }, |
| 153 | 154 |
| 154 /** | 155 /** |
| 155 * Handler for the 'default-images-changed' event. | 156 * Handler for the 'default-images-changed' event. |
| 156 * @param {!Array<!settings.DefaultImage>} images | 157 * @param {!Array<!settings.DefaultImage>} images |
| 157 * @private | 158 * @private |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 444 */ | 445 */ |
| 445 getAuthorWebsite_: function(selectedItem, defaultImages) { | 446 getAuthorWebsite_: function(selectedItem, defaultImages) { |
| 446 if (!this.isAuthorCreditShown_(selectedItem)) | 447 if (!this.isAuthorCreditShown_(selectedItem)) |
| 447 return ''; | 448 return ''; |
| 448 | 449 |
| 449 assert(selectedItem.dataset.defaultImageIndex !== null && | 450 assert(selectedItem.dataset.defaultImageIndex !== null && |
| 450 selectedItem.dataset.defaultImageIndex < defaultImages.length); | 451 selectedItem.dataset.defaultImageIndex < defaultImages.length); |
| 451 return defaultImages[selectedItem.dataset.defaultImageIndex].website; | 452 return defaultImages[selectedItem.dataset.defaultImageIndex].website; |
| 452 }, | 453 }, |
| 453 }); | 454 }); |
| OLD | NEW |