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

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

Issue 2938933002: WebUI: swap paper-dropdown-menu out for md-select. (Closed)
Patch Set: fix test Created 3 years, 6 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/keyboard_shortcuts.js
diff --git a/chrome/browser/resources/md_extensions/keyboard_shortcuts.js b/chrome/browser/resources/md_extensions/keyboard_shortcuts.js
index 98dd95e9079f3721cce1d6defccd997605fd7071..1490eeb7b0d0339768ff83384ed93437d5a033ff 100644
--- a/chrome/browser/resources/md_extensions/keyboard_shortcuts.js
+++ b/chrome/browser/resources/md_extensions/keyboard_shortcuts.js
@@ -14,6 +14,15 @@ cr.define('extensions', function() {
properties: {
/** @type {Array<!chrome.developerPrivate.ExtensionInfo>} */
items: Array,
+
+ /**
+ * Proxying the enum to be used easily by the html template.
+ * @private
+ */
+ CommandScope_: {
+ type: Object,
+ value: chrome.developerPrivate.CommandScope
+ },
},
ready: function() {
@@ -57,26 +66,27 @@ cr.define('extensions', function() {
},
/**
- * Returns the scope index in the dropdown menu for the command's scope.
- * @param {chrome.developerPrivate.Command} command
- * @return {number}
- * @private
+ * This function exists to force trigger an update when CommandScope_
+ * becomes available.
+ * @param {string} scope
+ * @return {string}
*/
- computeSelectedScope_: function(command) {
- // These numbers match the indexes in the dropdown menu in the html.
- switch (command.scope) {
- case chrome.developerPrivate.CommandScope.CHROME:
- return 0;
- case chrome.developerPrivate.CommandScope.GLOBAL:
- return 1;
- }
- assertNotReached();
+ triggerScopeChange_: function(scope) {
+ return scope;
},
/** @private */
onCloseButtonClick_: function() {
this.fire('close');
},
+
+ /**
+ * @param {!{target: HTMLSelectElement, model: Object}} event
+ * @private
+ */
+ onScopeChanged_: function(event) {
+ event.model.set('command.scope', event.target.value);
+ },
});
return {KeyboardShortcuts: KeyboardShortcuts};

Powered by Google App Engine
This is Rietveld 408576698