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

Side by Side Diff: chrome/browser/resources/md_extensions/shortcut_input.js

Issue 2948443003: Run clang-format on .js files in c/b/r/md_extensions (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('extensions', function() { 5 cr.define('extensions', function() {
6 'use strict'; 6 'use strict';
7 7
8 // The UI to display and manage keyboard shortcuts set for extension commands. 8 // The UI to display and manage keyboard shortcuts set for extension commands.
9 var ShortcutInput = Polymer({ 9 var ShortcutInput = Polymer({
10 is: 'extensions-shortcut-input', 10 is: 'extensions-shortcut-input',
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 if (extensions.isValidKeyCode(e.keyCode)) { 125 if (extensions.isValidKeyCode(e.keyCode)) {
126 this.commitPending_(); 126 this.commitPending_();
127 this.endCapture_(); 127 this.endCapture_();
128 } 128 }
129 }, 129 },
130 130
131 /** @private */ 131 /** @private */
132 commitPending_: function() { 132 commitPending_: function() {
133 this.shortcut = this.pendingShortcut_; 133 this.shortcut = this.pendingShortcut_;
134 this.fire('shortcut-updated', {keybinding: this.shortcut, 134 this.fire('shortcut-updated', {
135 item: this.item, 135 keybinding: this.shortcut,
136 commandName: this.commandName}); 136 item: this.item,
137 commandName: this.commandName
138 });
137 }, 139 },
138 140
139 /** 141 /**
140 * @return {string} The text to be displayed in the shortcut field. 142 * @return {string} The text to be displayed in the shortcut field.
141 * @private 143 * @private
142 */ 144 */
143 computeText_: function() { 145 computeText_: function() {
144 if (this.capturing_) 146 if (this.capturing_)
145 return this.pendingShortcut_; 147 return this.pendingShortcut_;
146 return this.shortcut; 148 return this.shortcut;
(...skipping 13 matching lines...) Expand all
160 onClearTap_: function() { 162 onClearTap_: function() {
161 if (this.shortcut) { 163 if (this.shortcut) {
162 this.pendingShortcut_ = ''; 164 this.pendingShortcut_ = '';
163 this.commitPending_(); 165 this.commitPending_();
164 } 166 }
165 }, 167 },
166 }); 168 });
167 169
168 return {ShortcutInput: ShortcutInput}; 170 return {ShortcutInput: ShortcutInput};
169 }); 171 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698