diff options
Diffstat (limited to 'chromium/chrome/browser/resources/media_router/elements/issue_banner/issue_banner.js')
-rw-r--r-- | chromium/chrome/browser/resources/media_router/elements/issue_banner/issue_banner.js | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/chromium/chrome/browser/resources/media_router/elements/issue_banner/issue_banner.js b/chromium/chrome/browser/resources/media_router/elements/issue_banner/issue_banner.js index 7466340118b..029568514cb 100644 --- a/chromium/chrome/browser/resources/media_router/elements/issue_banner/issue_banner.js +++ b/chromium/chrome/browser/resources/media_router/elements/issue_banner/issue_banner.js @@ -9,23 +9,15 @@ Polymer({ properties: { /** - * The issue to show. - * @type {?media_router.Issue} - */ - issue: { - type: Object, - value: null, - observer: 'updateActionButtonText_', - }, - - /** * Maps an issue action type to the resource identifier of the text shown * in the action button. - * This is a property of issue-banner because it is used in tests. - * @type {!Array<string>} + * This is a property of issue-banner because it is used in tests. This + * property should always be set before |issue| is set or updated. + * @private {!Array<string>} */ - issueActionTypeToButtonTextResource_: { + actionTypeToButtonTextResource_: { type: Array, + readOnly: true, value: function() { return ['dismissButton', 'learnMoreButton']; }, @@ -41,6 +33,16 @@ Polymer({ }, /** + * The issue to show. + * @type {?media_router.Issue} + */ + issue: { + type: Object, + value: null, + observer: 'updateActionButtonText_', + }, + + /** * The text shown in the secondary action button. * @private {string} */ @@ -60,16 +62,6 @@ Polymer({ }, /** - * Returns true to hide the non-blocking issue UI, false to show it. - * - * @param {?media_router.Issue} issue - * @private - */ - computeIsNonBlockingIssueHidden_: function(issue) { - return !issue || issue.isBlocking; - }, - - /** * @param {?media_router.Issue} issue The current issue. * @return {string} The class for the overall issue-banner. * @private @@ -121,7 +113,8 @@ Polymer({ * @private */ onClickOptAction_: function(event) { - this.fireIssueActionClick_(this.issue.secondaryActionType); + this.fireIssueActionClick_( + /** @type {number} */(this.issue.secondaryActionType)); }, /** @@ -135,12 +128,12 @@ Polymer({ var secondaryText = ''; if (this.issue) { defaultText = loadTimeData.getString( - this.issueActionTypeToButtonTextResource_[ + this.actionTypeToButtonTextResource_[ this.issue.defaultActionType]); if (this.issue.secondaryActionType) { secondaryText = loadTimeData.getString( - this.issueActionTypeToButtonTextResource_[ + this.actionTypeToButtonTextResource_[ this.issue.secondaryActionType]); } } |