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

Unified Diff: chrome/browser/resources/media_router/elements/media_router_container/media_router_container.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
diff --git a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
index 1abb0d4a661cfaf1ef3c536d4e87b939fe73723b..624d10ac4002cbcfd597790c07fb12d750a385ad 100644
--- a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
+++ b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
@@ -121,37 +121,6 @@ Polymer({
},
/**
- * The localized strings used by |this|.
- * @private {!Object}
- */
- i18n_: {
- readOnly: true,
- type: Object,
- value: function() {
- var strings = {};
- [
- 'deviceMissingText',
- 'firstRunFlowButtonText',
- 'firstRunFlowCloudPrefText',
- 'firstRunFlowText',
- 'firstRunFlowTitle',
- 'issueHeaderText',
- 'learnMoreText',
- 'searchButtonTitle',
- 'searchInputLabel',
- 'searchNoMatchesText',
- 'selectCastModeHeaderText',
- 'shareYourScreenSubheadingText',
- ]
- .forEach(function(s) {
- strings[s] = loadTimeData.valueExists(s) ?
- loadTimeData.getString(s) : '';
- });
- return strings;
- },
- },
-
- /**
* Whether the search input is currently focused. This is used to prevent
* window focus/blur events from interfering with input-focus-dependent
* operations.
@@ -388,6 +357,10 @@ Polymer({
},
},
+ behaviors: [
+ I18nBehavior,
+ ],
+
listeners: {
'focus': 'onFocus_',
'header-height-changed': 'updateElementPositioning_',
@@ -641,9 +614,9 @@ Polymer({
computeHeaderText_: function(view, headerText) {
switch (view) {
case media_router.MediaRouterView.CAST_MODE_LIST:
- return this.i18n_['selectCastModeHeaderText'];
+ return this.i18n('selectCastModeHeaderText');
case media_router.MediaRouterView.ISSUE:
- return this.i18n_['issueHeaderText'];
+ return this.i18n('issueHeaderText');
case media_router.MediaRouterView.ROUTE_DETAILS:
return this.currentRoute_ ?
this.sinkMap_[this.currentRoute_.sinkId].name : '';
@@ -1042,6 +1015,17 @@ Polymer({
},
/**
+ * Retrieves the first run flow cloud preferences text, if it exists. On
+ * non-officially branded builds, the string is not defined.
+ *
+ * @return {string} Cloud preferences text.
+ */
+ getFirstRunFlowCloudPrefText_: function() {
+ return loadTimeData.valueExists('firstRunFlowCloudPrefText') ?
+ this.i18n('firstRunFlowCloudPrefText') : '';
+ },
+
+ /**
* Returns whether given string is undefined, null, empty, or whitespace only.
* @param {?string} str String to be tested.
* @return {boolean} |true| if the string is undefined, null, empty, or

Powered by Google App Engine
This is Rietveld 408576698