Commit d438ad2d authored by dpapad's avatar dpapad Committed by Commit Bot

MD Extensions: Disable "Extension options" button when extension is disabled.

Convert the "Extension options" row to a cr-link-row and leverage the existing
styling for the disabled case.

Bug: 794756
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I7139e20a17d5e0ac5c85f0e1da7a5ad3bd2ab3d9
Reviewed-on: https://chromium-review.googlesource.com/826484
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarDave Schuyler <dschuyler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524548}
parent 5ee474bc
...@@ -357,13 +357,12 @@ ...@@ -357,13 +357,12 @@
</template> </template>
</div> </div>
</template> </template>
<div class="section control-line actionable" id="extensions-options" <button class="hr" is="cr-link-row" id="extensions-options"
on-tap="onOptionsTap_" disabled="[[!isEnabled_(data.state)]]"
hidden$="[[!shouldShowOptionsLink_(data.*)]]"> hidden="[[!shouldShowOptionsLink_(data.*)]]"
<span id="optionLabel">$i18n{itemOptions}</span> icon-class="icon-external" label="$i18n{itemOptions}"
<button class="icon-external" is="paper-icon-button-light" on-tap="onExtensionOptionsTap_">
aria-labelledby="optionLabel" actionable></button> </button>
</div>
<button class="hr" hidden="[[!data.manifestHomePageUrl.length]]" <button class="hr" hidden="[[!data.manifestHomePageUrl.length]]"
is="cr-link-row" icon-class="icon-external" id="developerWebsite" is="cr-link-row" icon-class="icon-external" id="developerWebsite"
label="$i18n{developerWebsite}" on-tap="onDeveloperWebSiteTap_"> label="$i18n{developerWebsite}" on-tap="onDeveloperWebSiteTap_">
......
...@@ -146,7 +146,7 @@ cr.define('extensions', function() { ...@@ -146,7 +146,7 @@ cr.define('extensions', function() {
}, },
/** @private */ /** @private */
onOptionsTap_: function() { onExtensionOptionsTap_: function() {
this.delegate.showItemOptionsPage(this.data); this.delegate.showItemOptionsPage(this.data);
}, },
......
...@@ -127,6 +127,14 @@ cr.define('extension_detail_view_tests', function() { ...@@ -127,6 +127,14 @@ cr.define('extension_detail_view_tests', function() {
Polymer.dom.flush(); Polymer.dom.flush();
expectTrue(testIsVisible('#id-section')); expectTrue(testIsVisible('#id-section'));
expectTrue(testIsVisible('#inspectable-views')); expectTrue(testIsVisible('#inspectable-views'));
// Ensure that the "Extension options" button is disabled when the item
// itself is disabled.
var extensionOptions = item.$$('#extensions-options');
assertFalse(extensionOptions.disabled);
item.set('data.state', chrome.developerPrivate.ExtensionState.DISABLED);
Polymer.dom.flush();
assertTrue(extensionOptions.disabled);
}); });
test(assert(TestNames.LayoutSource), function() { test(assert(TestNames.LayoutSource), function() {
......
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