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

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

Issue 2377193004: [DevTools] Rework some focus code. (Closed)
Patch Set: FocusRestorer Created 4 years, 2 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 }, 325 },
326 326
327 willHide: function() 327 willHide: function()
328 { 328 {
329 this._hidePromptSuggestBox(); 329 this._hidePromptSuggestBox();
330 }, 330 },
331 331
332 wasShown: function() 332 wasShown: function()
333 { 333 {
334 this._viewport.refresh(); 334 this._viewport.refresh();
335 this.focus();
336 }, 335 },
337 336
338 focus: function() 337 focus: function()
339 { 338 {
340 if (this._prompt.hasFocus()) 339 if (this._prompt.hasFocus())
341 return; 340 return;
342 // Set caret position before setting focus in order to avoid scrolling 341 // Set caret position before setting focus in order to avoid scrolling
343 // by focus(). 342 // by focus().
344 this._prompt.moveCaretToEndOfPrompt(); 343 this._prompt.moveCaretToEndOfPrompt();
345 this._prompt.focus(); 344 this._prompt.focus();
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 return true; 1374 return true;
1376 } 1375 }
1377 return false; 1376 return false;
1378 } 1377 }
1379 } 1378 }
1380 1379
1381 /** 1380 /**
1382 * @typedef {{messageIndex: number, matchIndex: number}} 1381 * @typedef {{messageIndex: number, matchIndex: number}}
1383 */ 1382 */
1384 WebInspector.ConsoleView.RegexMatchRange; 1383 WebInspector.ConsoleView.RegexMatchRange;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698