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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js

Issue 2802963002: DevTools: Allow tab key to move focus when ConsolePrompt is empty (Closed)
Patch Set: Created 3 years, 8 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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Console.ConsolePrompt = class extends UI.Widget { 7 Console.ConsolePrompt = class extends UI.Widget {
8 constructor() { 8 constructor() {
9 super(); 9 super();
10 this._addCompletionsFromHistory = true; 10 this._addCompletionsFromHistory = true;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 break; 126 break;
127 case UI.KeyboardShortcut.Keys.N.code: // Ctrl+N = Next 127 case UI.KeyboardShortcut.Keys.N.code: // Ctrl+N = Next
128 if (Host.isMac() && keyboardEvent.ctrlKey && !keyboardEvent.metaKey && ! keyboardEvent.altKey && 128 if (Host.isMac() && keyboardEvent.ctrlKey && !keyboardEvent.metaKey && ! keyboardEvent.altKey &&
129 !keyboardEvent.shiftKey) 129 !keyboardEvent.shiftKey)
130 newText = this._history.next(); 130 newText = this._history.next();
131 break; 131 break;
132 case UI.KeyboardShortcut.Keys.Enter.code: 132 case UI.KeyboardShortcut.Keys.Enter.code:
133 this._enterKeyPressed(keyboardEvent); 133 this._enterKeyPressed(keyboardEvent);
134 break; 134 break;
135 case UI.KeyboardShortcut.Keys.Tab.code:
136 if (!this.text())
137 keyboardEvent.consume();
138 break;
135 } 139 }
136 140
137 if (newText === undefined) 141 if (newText === undefined)
138 return; 142 return;
139 keyboardEvent.consume(true); 143 keyboardEvent.consume(true);
140 this.setText(newText); 144 this.setText(newText);
141 145
142 if (isPrevious) 146 if (isPrevious)
143 this._editor.setSelection(TextUtils.TextRange.createFromLocation(0, Infini ty)); 147 this._editor.setSelection(TextUtils.TextRange.createFromLocation(0, Infini ty));
144 else 148 else
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 * @return {string|undefined} 378 * @return {string|undefined}
375 */ 379 */
376 _currentHistoryItem() { 380 _currentHistoryItem() {
377 return this._data[this._data.length - this._historyOffset]; 381 return this._data[this._data.length - this._historyOffset];
378 } 382 }
379 }; 383 };
380 384
381 Console.ConsolePrompt.Events = { 385 Console.ConsolePrompt.Events = {
382 TextChanged: Symbol('TextChanged') 386 TextChanged: Symbol('TextChanged')
383 }; 387 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698