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

Side by Side Diff: Source/devtools/front_end/console/ConsoleView.js

Issue 780503003: [DevTools] Resizing DevTools window should clear autocomplete text from console prompt. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: introducing _hidePromptSuggestBox Created 6 years 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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 * @return {?WebInspector.ExecutionContext} 431 * @return {?WebInspector.ExecutionContext}
432 */ 432 */
433 _currentExecutionContext: function() 433 _currentExecutionContext: function()
434 { 434 {
435 var option = this._executionContextSelector.selectedOption(); 435 var option = this._executionContextSelector.selectedOption();
436 return option ? option.__executionContext : null; 436 return option ? option.__executionContext : null;
437 }, 437 },
438 438
439 willHide: function() 439 willHide: function()
440 { 440 {
441 this._prompt.hideSuggestBox(); 441 this._hidePromptSuggestBox();
442 this._prompt.clearAutoComplete(true);
443 }, 442 },
444 443
445 wasShown: function() 444 wasShown: function()
446 { 445 {
447 this._viewport.refresh(); 446 this._viewport.refresh();
448 if (!this._prompt.isCaretInsidePrompt()) 447 if (!this._prompt.isCaretInsidePrompt())
449 this._prompt.moveCaretToEndOfPrompt(); 448 this._prompt.moveCaretToEndOfPrompt();
450 }, 449 },
451 450
452 focus: function() 451 focus: function()
453 { 452 {
454 if (this._promptElement === WebInspector.currentFocusElement()) 453 if (this._promptElement === WebInspector.currentFocusElement())
455 return; 454 return;
456 WebInspector.setCurrentFocusElement(this._promptElement); 455 WebInspector.setCurrentFocusElement(this._promptElement);
457 this._prompt.moveCaretToEndOfPrompt(); 456 this._prompt.moveCaretToEndOfPrompt();
458 }, 457 },
459 458
460 restoreScrollPositions: function() 459 restoreScrollPositions: function()
461 { 460 {
462 if (this._viewport.scrolledToBottom()) 461 if (this._viewport.scrolledToBottom())
463 this._immediatelyScrollToBottom(); 462 this._immediatelyScrollToBottom();
464 else 463 else
465 WebInspector.View.prototype.restoreScrollPositions.call(this); 464 WebInspector.View.prototype.restoreScrollPositions.call(this);
466 }, 465 },
467 466
468 onResize: function() 467 onResize: function()
469 { 468 {
470 this._scheduleViewportRefresh(); 469 this._scheduleViewportRefresh();
471 this._prompt.hideSuggestBox(); 470 this._hidePromptSuggestBox();
472 if (this._viewport.scrolledToBottom()) 471 if (this._viewport.scrolledToBottom())
473 this._immediatelyScrollToBottom(); 472 this._immediatelyScrollToBottom();
474 }, 473 },
475 474
475 _hidePromptSuggestBox: function()
476 {
477 this._prompt.hideSuggestBox();
478 this._prompt.clearAutoComplete(true);
479 },
480
476 _scheduleViewportRefresh: function() 481 _scheduleViewportRefresh: function()
477 { 482 {
478 /** 483 /**
479 * @param {!WebInspector.Throttler.FinishCallback} finishCallback 484 * @param {!WebInspector.Throttler.FinishCallback} finishCallback
480 * @this {WebInspector.ConsoleView} 485 * @this {WebInspector.ConsoleView}
481 */ 486 */
482 function invalidateViewport(finishCallback) 487 function invalidateViewport(finishCallback)
483 { 488 {
484 if (this._needsFullUpdate) { 489 if (this._needsFullUpdate) {
485 this._updateMessageList(); 490 this._updateMessageList();
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 default: 616 default:
612 return new WebInspector.ConsoleViewMessage(message, this._linkifier, nestingLevel); 617 return new WebInspector.ConsoleViewMessage(message, this._linkifier, nestingLevel);
613 } 618 }
614 }, 619 },
615 620
616 _consoleCleared: function() 621 _consoleCleared: function()
617 { 622 {
618 this._clearCurrentSearchResultHighlight(); 623 this._clearCurrentSearchResultHighlight();
619 this._consoleMessages = []; 624 this._consoleMessages = [];
620 this._updateMessageList(); 625 this._updateMessageList();
621 this._prompt.hideSuggestBox(); 626 this._hidePromptSuggestBox();
622 this._prompt.clearAutoComplete(true);
623 627
624 if (this._searchRegex) 628 if (this._searchRegex)
625 this._searchableView.updateSearchMatchesCount(0); 629 this._searchableView.updateSearchMatchesCount(0);
626 630
627 this._linkifier.reset(); 631 this._linkifier.reset();
628 }, 632 },
629 633
630 _handleContextMenuEvent: function(event) 634 _handleContextMenuEvent: function(event)
631 { 635 {
632 if (event.target.enclosingNodeOrSelfWithNodeName("a")) 636 if (event.target.enclosingNodeOrSelfWithNodeName("a"))
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 /** 1316 /**
1313 * @override 1317 * @override
1314 * @return {boolean} 1318 * @return {boolean}
1315 */ 1319 */
1316 handleAction: function() 1320 handleAction: function()
1317 { 1321 {
1318 WebInspector.console.show(); 1322 WebInspector.console.show();
1319 return true; 1323 return true;
1320 } 1324 }
1321 } 1325 }
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