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

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

Issue 1886003002: [Media Router WebUI] Use I18nBehavior to retrieve strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 /** 45 /**
46 * The text shown in the secondary action button. 46 * The text shown in the secondary action button.
47 * @private {string} 47 * @private {string}
48 */ 48 */
49 secondaryActionButtonText_: { 49 secondaryActionButtonText_: {
50 type: String, 50 type: String,
51 value: '', 51 value: '',
52 }, 52 },
53 }, 53 },
54 54
55 behaviors: [
56 I18nBehavior,
57 ],
58
55 /** 59 /**
56 * @param {?media_router.Issue} issue 60 * @param {?media_router.Issue} issue
57 * @return {boolean} Whether or not to hide the blocking issue UI. 61 * @return {boolean} Whether or not to hide the blocking issue UI.
58 * @private 62 * @private
59 */ 63 */
60 computeIsBlockingIssueHidden_: function(issue) { 64 computeIsBlockingIssueHidden_: function(issue) {
61 return !issue || !issue.isBlocking; 65 return !issue || !issue.isBlocking;
62 }, 66 },
63 67
64 /** 68 /**
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 /** 124 /**
121 * Called when |issue| is updated. This updates the default and secondary 125 * Called when |issue| is updated. This updates the default and secondary
122 * action button text. 126 * action button text.
123 * 127 *
124 * @private 128 * @private
125 */ 129 */
126 updateActionButtonText_: function() { 130 updateActionButtonText_: function() {
127 var defaultText = ''; 131 var defaultText = '';
128 var secondaryText = ''; 132 var secondaryText = '';
129 if (this.issue) { 133 if (this.issue) {
130 defaultText = loadTimeData.getString( 134 defaultText =
131 this.actionTypeToButtonTextResource_[ 135 this.i18n(this.actionTypeToButtonTextResource_[
132 this.issue.defaultActionType]); 136 this.issue.defaultActionType]);
133 137
134 if (this.issue.secondaryActionType) { 138 if (this.issue.secondaryActionType) {
135 secondaryText = loadTimeData.getString( 139 secondaryText =
136 this.actionTypeToButtonTextResource_[ 140 this.i18n(this.actionTypeToButtonTextResource_[
137 this.issue.secondaryActionType]); 141 this.issue.secondaryActionType]);
138 } 142 }
139 } 143 }
140 144
141 this.defaultActionButtonText_ = defaultText; 145 this.defaultActionButtonText_ = defaultText;
142 this.secondaryActionButtonText_ = secondaryText; 146 this.secondaryActionButtonText_ = secondaryText;
143 }, 147 },
144 }); 148 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698