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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js

Issue 1611783002: Devtools Console: Tab to autocomplete and enter to execute command (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 onMouseWheel: function(event) 274 onMouseWheel: function(event)
275 { 275 {
276 // Subclasses can implement. 276 // Subclasses can implement.
277 }, 277 },
278 278
279 /** 279 /**
280 * @param {!Event} event 280 * @param {!Event} event
281 */ 281 */
282 onKeyDown: function(event) 282 onKeyDown: function(event)
283 { 283 {
284 if (isEnterKey(event))
285 return;
286
284 var handled = false; 287 var handled = false;
285 delete this._needUpdateAutocomplete; 288 delete this._needUpdateAutocomplete;
286 289
287 switch (event.keyIdentifier) { 290 switch (event.keyIdentifier) {
288 case "U+0009": // Tab 291 case "U+0009": // Tab
289 handled = this.tabKeyPressed(event); 292 handled = this.tabKeyPressed(event);
290 break; 293 break;
291 case "Left": 294 case "Left":
292 case "Home": 295 case "Home":
293 this._removeSuggestionAids(); 296 this._removeSuggestionAids();
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 selection.removeAllRanges(); 767 selection.removeAllRanges();
765 selection.addRange(selectionRange); 768 selection.addRange(selectionRange);
766 }, 769 },
767 770
768 /** 771 /**
769 * @param {!Event} event 772 * @param {!Event} event
770 * @return {boolean} 773 * @return {boolean}
771 */ 774 */
772 tabKeyPressed: function(event) 775 tabKeyPressed: function(event)
773 { 776 {
774 this._completeCommonPrefix(); 777 this.acceptAutoComplete();
775 778
776 // Consume the key. 779 // Consume the key.
777 return true; 780 return true;
778 }, 781 },
779 782
780 /** 783 /**
781 * @return {?Element} 784 * @return {?Element}
782 */ 785 */
783 proxyElementForTests: function() 786 proxyElementForTests: function()
784 { 787 {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 968
966 return; 969 return;
967 } 970 }
968 971
969 WebInspector.TextPrompt.prototype.onKeyDown.apply(this, arguments); 972 WebInspector.TextPrompt.prototype.onKeyDown.apply(this, arguments);
970 }, 973 },
971 974
972 __proto__: WebInspector.TextPrompt.prototype 975 __proto__: WebInspector.TextPrompt.prototype
973 } 976 }
974 977
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698