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

Unified Diff: chrome/browser/resources/md_extensions/detail_view.js

Issue 2723613004: [MD Extensions] Update Detail View UI (Closed)
Patch Set: nit Created 3 years, 9 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/md_extensions/detail_view.js
diff --git a/chrome/browser/resources/md_extensions/detail_view.js b/chrome/browser/resources/md_extensions/detail_view.js
index 5183e2efee29f4144f742d2701b095199ccdf3a4..e8b733e51df39900820738bb09443395630ea338 100644
--- a/chrome/browser/resources/md_extensions/detail_view.js
+++ b/chrome/browser/resources/md_extensions/detail_view.js
@@ -8,7 +8,7 @@ cr.define('extensions', function() {
var DetailView = Polymer({
is: 'extensions-detail-view',
- behaviors: [Polymer.NeonAnimatableBehavior],
+ behaviors: [I18nBehavior, Polymer.NeonAnimatableBehavior],
properties: {
/**
@@ -19,6 +19,9 @@ cr.define('extensions', function() {
/** @type {!extensions.ItemDelegate} */
delegate: Object,
+
+ /** Whether the user has enabled the UI's developer mode. */
+ inDevMode: Boolean,
},
ready: function() {
@@ -36,6 +39,20 @@ cr.define('extensions', function() {
* @return {boolean}
* @private
*/
+ isEnabled_: function() { return extensions.isEnabled(this.data.state); },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ isEnableToggleEnabled_: function() {
+ return extensions.userCanChangeEnablement(this.data);
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
hasDependentExtensions_: function() {
return this.data.dependentExtensions.length > 0;
},
@@ -49,6 +66,24 @@ cr.define('extensions', function() {
},
/**
+ * @return {string}
+ * @private
+ */
+ computeEnabledText_: function() {
+ // TODO(devlin): Get the full spectrum of these strings from bettes.
+ return this.isEnabled_() ? this.i18n('itemOn') : this.i18n('itemOff');
+ },
+
+ /**
+ * @param {!chrome.developerPrivate.ExtensionView} view
+ * @return {string}
+ * @private
+ */
+ computeInspectLabel_: function(view) {
+ return extensions.computeInspectableViewLabel(view);
+ },
+
+ /**
* @return {boolean}
* @private
*/
@@ -64,7 +99,7 @@ cr.define('extensions', function() {
* @return {boolean}
* @private
*/
- shouldShowOptionsButton_: function() {
+ shouldShowOptionsLink_: function() {
return !!this.data.optionsPage;
},
@@ -80,11 +115,30 @@ cr.define('extensions', function() {
},
/** @private */
- onOptionsButtonTap_: function() {
+ onEnableChange_: function() {
+ this.delegate.setItemEnabled(this.data.id,
+ this.$['enable-toggle'].checked);
+ },
+
+ /**
+ * @param {!{model: !{item: !chrome.developerPrivate.ExtensionView}}} e
+ * @private
+ */
+ onInspectTap_: function(e) {
+ this.delegate.inspectItemView(this.data.id, e.model.item);
+ },
+
+ /** @private */
+ onOptionsTap_: function() {
this.delegate.showItemOptionsPage(this.data.id);
},
/** @private */
+ onRemoveTap_: function() {
+ this.delegate.deleteItem(this.data.id);
+ },
+
+ /** @private */
onAllowIncognitoChange_: function() {
this.delegate.setItemAllowedIncognito(
this.data.id, this.$$('#allow-incognito').checked);
« no previous file with comments | « chrome/browser/resources/md_extensions/detail_view.html ('k') | chrome/browser/resources/md_extensions/item.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698