| 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};
|
|
|