Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Side by Side Diff: chrome/browser/resources/media_router/elements/issue_banner/issue_banner.js

Issue 2014673002: [Media Router WebUI] Show issue's secondary action when 'dismiss'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/media_router/media_router_data.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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: {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 return issue.isBlocking ? 'blocking' : 'non-blocking'; 74 return issue.isBlocking ? 'blocking' : 'non-blocking';
75 }, 75 },
76 76
77 /** 77 /**
78 * @param {?media_router.Issue} issue 78 * @param {?media_router.Issue} issue
79 * @return {boolean} Whether or not to hide the non-blocking issue UI. 79 * @return {boolean} Whether or not to hide the non-blocking issue UI.
80 * @private 80 * @private
81 */ 81 */
82 computeOptionalActionHidden_: function(issue) { 82 computeOptionalActionHidden_: function(issue) {
83 return !issue || !issue.secondaryActionType; 83 return !issue || issue.secondaryActionType === undefined;
84 }, 84 },
85 85
86 /** 86 /**
87 * Fires an issue-action-click event. 87 * Fires an issue-action-click event.
88 * 88 *
89 * @param {number} actionType The type of issue action. 89 * @param {number} actionType The type of issue action.
90 * @private 90 * @private
91 */ 91 */
92 fireIssueActionClick_: function(actionType) { 92 fireIssueActionClick_: function(actionType) {
93 this.fire('issue-action-click', { 93 this.fire('issue-action-click', {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 * @private 125 * @private
126 */ 126 */
127 updateActionButtonText_: function() { 127 updateActionButtonText_: function() {
128 var defaultText = ''; 128 var defaultText = '';
129 var secondaryText = ''; 129 var secondaryText = '';
130 if (this.issue) { 130 if (this.issue) {
131 defaultText = 131 defaultText =
132 this.i18n(this.actionTypeToButtonTextResource_[ 132 this.i18n(this.actionTypeToButtonTextResource_[
133 this.issue.defaultActionType]); 133 this.issue.defaultActionType]);
134 134
135 if (this.issue.secondaryActionType) { 135 if (this.issue.secondaryActionType !== undefined) {
136 secondaryText = 136 secondaryText =
137 this.i18n(this.actionTypeToButtonTextResource_[ 137 this.i18n(this.actionTypeToButtonTextResource_[
138 this.issue.secondaryActionType]); 138 this.issue.secondaryActionType]);
139 } 139 }
140 } 140 }
141 141
142 this.defaultActionButtonText_ = defaultText; 142 this.defaultActionButtonText_ = defaultText;
143 this.secondaryActionButtonText_ = secondaryText; 143 this.secondaryActionButtonText_ = secondaryText;
144 }, 144 },
145 }); 145 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/media_router/media_router_data.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698