| 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 // This Polymer element is used to show information about issues related | 5 // This Polymer element is used to show information about issues related |
| 6 // to casting. | 6 // to casting. |
| 7 Polymer({ | 7 Polymer({ |
| 8 is: 'issue-banner', | 8 is: 'issue-banner', |
| 9 | 9 |
| 10 properties: { | 10 properties: { |
| 11 /** | 11 /** |
| 12 * Maps an issue action type to the resource identifier of the text shown | 12 * Maps an issue action type to the resource identifier of the text shown |
| 13 * in the action button. | 13 * in the action button. |
| 14 * This is a property of issue-banner because it is used in tests. This | 14 * This is a property of issue-banner because it is used in tests. This |
| 15 * property should always be set before |issue| is set or updated. | 15 * property should always be set before |issue| is set or updated. |
| 16 * @private {!Array<string>} | 16 * @private {!Array<string>} |
| 17 */ | 17 */ |
| 18 actionTypeToButtonTextResource_: { | 18 actionTypeToButtonTextResource_: { |
| 19 type: Array, | 19 type: Array, |
| 20 readOnly: true, | 20 readOnly: true, |
| 21 value: function() { | 21 value: function() { |
| 22 return ['dismissButton', 'learnMoreText']; | 22 return ['dismissButton', 'learnMoreText']; |
| 23 }, | 23 }, |
| 24 }, | 24 }, |
| 25 | 25 |
| 26 /** | 26 /** |
| 27 * The text shown in the default action button. | 27 * The text shown in the default action button. |
| 28 * @private {string} | 28 * @private {string|undefined} |
| 29 */ | 29 */ |
| 30 defaultActionButtonText_: { | 30 defaultActionButtonText_: { |
| 31 type: String, | 31 type: String, |
| 32 value: '', | |
| 33 }, | 32 }, |
| 34 | 33 |
| 35 /** | 34 /** |
| 36 * The issue to show. | 35 * The issue to show. |
| 37 * @type {?media_router.Issue} | 36 * @type {?media_router.Issue|undefined} |
| 38 */ | 37 */ |
| 39 issue: { | 38 issue: { |
| 40 type: Object, | 39 type: Object, |
| 41 value: null, | |
| 42 observer: 'updateActionButtonText_', | 40 observer: 'updateActionButtonText_', |
| 43 }, | 41 }, |
| 44 | 42 |
| 45 /** | 43 /** |
| 46 * The text shown in the secondary action button. | 44 * The text shown in the secondary action button. |
| 47 * @private {string} | 45 * @private {string|undefined} |
| 48 */ | 46 */ |
| 49 secondaryActionButtonText_: { | 47 secondaryActionButtonText_: { |
| 50 type: String, | 48 type: String, |
| 51 value: '', | |
| 52 }, | 49 }, |
| 53 }, | 50 }, |
| 54 | 51 |
| 55 behaviors: [ | 52 behaviors: [ |
| 56 I18nBehavior, | 53 I18nBehavior, |
| 57 ], | 54 ], |
| 58 | 55 |
| 59 /** | 56 /** |
| 60 * @param {?media_router.Issue} issue | 57 * @param {?media_router.Issue} issue |
| 61 * @return {boolean} Whether or not to hide the blocking issue UI. | 58 * @return {boolean} Whether or not to hide the blocking issue UI. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 secondaryText = | 136 secondaryText = |
| 140 this.i18n(this.actionTypeToButtonTextResource_[ | 137 this.i18n(this.actionTypeToButtonTextResource_[ |
| 141 this.issue.secondaryActionType]); | 138 this.issue.secondaryActionType]); |
| 142 } | 139 } |
| 143 } | 140 } |
| 144 | 141 |
| 145 this.defaultActionButtonText_ = defaultText; | 142 this.defaultActionButtonText_ = defaultText; |
| 146 this.secondaryActionButtonText_ = secondaryText; | 143 this.secondaryActionButtonText_ = secondaryText; |
| 147 }, | 144 }, |
| 148 }); | 145 }); |
| OLD | NEW |