| 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 * The issue to show. | 12 * The issue to show. |
| 13 * @type {?media_router.Issue} | 13 * @type {?media_router.Issue} |
| 14 */ | 14 */ |
| 15 issue: { | 15 issue: { |
| 16 type: Object, | 16 type: Object, |
| 17 value: null, | 17 value: null, |
| 18 }, | 18 }, |
| 19 }, | 19 }, |
| 20 | 20 |
| 21 /** | 21 /** |
| 22 * Returns true to hide the blocking issue UI, false to show it. | |
| 23 * | |
| 24 * @param {?media_router.Issue} issue | 22 * @param {?media_router.Issue} issue |
| 23 * @return {boolean} Whether or not to hide the blocking issue UI. |
| 25 * @private | 24 * @private |
| 26 */ | 25 */ |
| 27 computeIsBlockingIssueHidden_: function(issue) { | 26 computeIsBlockingIssueHidden_: function(issue) { |
| 28 return !issue || !issue.isBlocking; | 27 return !issue || !issue.isBlocking; |
| 29 }, | 28 }, |
| 30 | 29 |
| 31 /** | 30 /** |
| 32 * Returns true to hide the non-blocking issue UI, false to show it. | 31 * Returns true to hide the non-blocking issue UI, false to show it. |
| 33 * | 32 * |
| 34 * @param {?media_router.Issue} issue | 33 * @param {?media_router.Issue} issue |
| 35 * @private | 34 * @private |
| 36 */ | 35 */ |
| 37 computeIsNonBlockingIssueHidden_: function(issue) { | 36 computeIsNonBlockingIssueHidden_: function(issue) { |
| 38 return !issue || issue.isBlocking; | 37 return !issue || issue.isBlocking; |
| 39 }, | 38 }, |
| 40 | 39 |
| 41 /** | 40 /** |
| 42 * Returns true to hide |issue|'s optional action, false to show it. | |
| 43 * | |
| 44 * @param {?media_router.Issue} issue | 41 * @param {?media_router.Issue} issue |
| 42 * @return {boolean} Whether or not to hide the non-blocking issue UI. |
| 45 * @private | 43 * @private |
| 46 */ | 44 */ |
| 47 computeOptionalActionHidden_: function(issue) { | 45 computeOptionalActionHidden_: function(issue) { |
| 48 return !issue || !issue.optActionText; | 46 return !issue || !issue.optActionText; |
| 49 }, | 47 }, |
| 50 | 48 |
| 51 /** | 49 /** |
| 52 * Fires an issue-action-click event. | 50 * Fires an issue-action-click event. |
| 53 * | 51 * |
| 54 * @param {number} actionType The type of issue action. | 52 * @param {number} actionType The type of issue action. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 75 /** | 73 /** |
| 76 * Called when an optional issue action is clicked. | 74 * Called when an optional issue action is clicked. |
| 77 * | 75 * |
| 78 * @param {!Event} event The event object. | 76 * @param {!Event} event The event object. |
| 79 * @private | 77 * @private |
| 80 */ | 78 */ |
| 81 onClickOptAction_: function(event) { | 79 onClickOptAction_: function(event) { |
| 82 this.fireIssueActionClick_(this.issue.optActionType); | 80 this.fireIssueActionClick_(this.issue.optActionType); |
| 83 }, | 81 }, |
| 84 }); | 82 }); |
| OLD | NEW |