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

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

Issue 2319523004: DevTools: Remember the last focused widget. (Closed)
Patch Set: Created 4 years, 3 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 /* 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 }, 341 },
342 342
343 focus: function() 343 focus: function()
344 { 344 {
345 if (this._promptElement === WebInspector.currentFocusElement()) 345 if (this._promptElement === WebInspector.currentFocusElement())
346 return; 346 return;
347 // Set caret position before setting focus in order to avoid scrolling 347 // Set caret position before setting focus in order to avoid scrolling
348 // by focus(). 348 // by focus().
349 this._prompt.moveCaretToEndOfPrompt(); 349 this._prompt.moveCaretToEndOfPrompt();
350 WebInspector.setCurrentFocusElement(this._promptElement); 350 WebInspector.setCurrentFocusElement(this._promptElement);
351 this.wasFocused();
351 }, 352 },
352 353
353 restoreScrollPositions: function() 354 restoreScrollPositions: function()
354 { 355 {
355 if (this._viewport.stickToBottom()) 356 if (this._viewport.stickToBottom())
356 this._immediatelyScrollToBottom(); 357 this._immediatelyScrollToBottom();
357 else 358 else
358 WebInspector.Widget.prototype.restoreScrollPositions.call(this); 359 WebInspector.Widget.prototype.restoreScrollPositions.call(this);
359 }, 360 },
360 361
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 return true; 1416 return true;
1416 } 1417 }
1417 return false; 1418 return false;
1418 } 1419 }
1419 } 1420 }
1420 1421
1421 /** 1422 /**
1422 * @typedef {{messageIndex: number, matchIndex: number}} 1423 * @typedef {{messageIndex: number, matchIndex: number}}
1423 */ 1424 */
1424 WebInspector.ConsoleView.RegexMatchRange; 1425 WebInspector.ConsoleView.RegexMatchRange;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698