Commit bf713982 authored by Dave Schuyler's avatar Dave Schuyler Committed by Commit Bot

[MD extensions] replace i18n() use with $i18nPolymer.

This CL replaces the slower i18n() code with $i18nPolymer replacements
and reduces usage if I18nBehavior.

Bug: 677338
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I324e5d148e71cd4abc0cfa028d5b48fbc1cefaf2
Reviewed-on: https://chromium-review.googlesource.com/812571Reviewed-by: default avatarHector Carmona <hcarmona@chromium.org>
Commit-Queue: Dave Schuyler <dschuyler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523215}
parent 289f5a3c
......@@ -17,7 +17,6 @@
'<(DEPTH)/ui/webui/resources/cr_elements/compiled_resources2.gyp:cr_container_shadow_behavior',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data',
'<(EXTERNS_GYP):developer_private',
'item',
......
......@@ -10,7 +10,6 @@
<link rel="import" href="chrome://resources/html/action_link.html">
<link rel="import" href="chrome://resources/html/action_link_css.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.html">
......@@ -195,7 +194,8 @@
</div>
<div class="section continuation control-line" id="enable-section">
<span class$="{{computeEnabledStyle_(data.state)}}">
[[computeEnabledText_(data.state)]]
[[computeEnabledText_(data.state, '$i18nPolymer{itemOn}',
'$i18nPolymer{itemOff}')]]
</span>
<div class="layout horizontal">
<cr-tooltip-icon hidden$="[[!data.controlledInfo]]"
......
......@@ -9,7 +9,6 @@ cr.define('extensions', function() {
is: 'extensions-detail-view',
behaviors: [
I18nBehavior,
CrContainerShadowBehavior,
extensions.ItemBehavior,
],
......@@ -94,12 +93,15 @@ cr.define('extensions', function() {
},
/**
* @param {!chrome.developerPrivate.ExtensionState} state
* @param {string} onText
* @param {string} offText
* @return {string}
* @private
*/
computeEnabledText_: function() {
computeEnabledText_: function(state, onText, offText) {
// TODO(devlin): Get the full spectrum of these strings from bettes.
return this.isEnabled_() ? this.i18n('itemOn') : this.i18n('itemOff');
return extensions.isEnabled(state) ? onText : offText;
},
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment