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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js

Issue 2254683003: DevTools: setting to auto-reveal in navigator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addrcomm 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/module.json » ('j') | 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 * @param {!WebInspector.UILocation} uiLocation 348 * @param {!WebInspector.UILocation} uiLocation
349 * @param {boolean=} omitFocus 349 * @param {boolean=} omitFocus
350 */ 350 */
351 showUILocation: function(uiLocation, omitFocus) 351 showUILocation: function(uiLocation, omitFocus)
352 { 352 {
353 this.showUISourceCode(uiLocation.uiSourceCode, uiLocation.lineNumber, ui Location.columnNumber, omitFocus); 353 this.showUISourceCode(uiLocation.uiSourceCode, uiLocation.lineNumber, ui Location.columnNumber, omitFocus);
354 }, 354 },
355 355
356 /** 356 /**
357 * @param {!WebInspector.UISourceCode} uiSourceCode 357 * @param {!WebInspector.UISourceCode} uiSourceCode
358 * @param {boolean=} skipShow
358 */ 359 */
359 _revealInNavigator: function(uiSourceCode) 360 _revealInNavigator: function(uiSourceCode, skipShow)
360 { 361 {
361 var extensions = self.runtime.extensions(WebInspector.NavigatorView); 362 var extensions = self.runtime.extensions(WebInspector.NavigatorView);
362 Promise.all(extensions.map(extension => extension.instance())).then(filt erNavigators); 363 Promise.all(extensions.map(extension => extension.instance())).then(filt erNavigators);
363 364
364 /** 365 /**
365 * @param {!Array.<!Object>} objects 366 * @param {!Array.<!Object>} objects
366 */ 367 */
367 function filterNavigators(objects) 368 function filterNavigators(objects)
368 { 369 {
369 for (var i = 0; i < objects.length; ++i) { 370 for (var i = 0; i < objects.length; ++i) {
370 var navigatorView = /** @type {!WebInspector.NavigatorView} */ ( objects[i]); 371 var navigatorView = /** @type {!WebInspector.NavigatorView} */ ( objects[i]);
371 if (navigatorView.accept(uiSourceCode)) { 372 if (navigatorView.accept(uiSourceCode)) {
372 navigatorView.revealUISourceCode(uiSourceCode, true); 373 navigatorView.revealUISourceCode(uiSourceCode, true);
373 WebInspector.viewManager.showView(extensions[i].descriptor() ["viewId"]); 374 if (skipShow)
lushnikov 2016/08/25 02:00:09 should it be vice-versa?
luoe 2016/08/25 18:19:34 This check is wrong. Really, we want to call show
375 WebInspector.viewManager.showView(extensions[i].descript or()["viewId"]);
374 } 376 }
375 } 377 }
376 } 378 }
377 }, 379 },
378 380
379 /** 381 /**
380 * @param {!WebInspector.ContextMenu} contextMenu 382 * @param {!WebInspector.ContextMenu} contextMenu
381 */ 383 */
382 _populateNavigatorMenu: function(contextMenu) 384 _populateNavigatorMenu: function(contextMenu)
383 { 385 {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 return true; 522 return true;
521 }, 523 },
522 524
523 /** 525 /**
524 * @param {!WebInspector.Event} event 526 * @param {!WebInspector.Event} event
525 */ 527 */
526 _editorSelected: function(event) 528 _editorSelected: function(event)
527 { 529 {
528 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data ); 530 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data );
529 this._editorChanged(uiSourceCode); 531 this._editorChanged(uiSourceCode);
532 if (this.editorView.mainWidget() && WebInspector.moduleSetting("autoReve alInNavigator").get())
533 this._revealInNavigator(uiSourceCode, true);
530 }, 534 },
531 535
532 /** 536 /**
533 * @param {!WebInspector.Event} event 537 * @param {!WebInspector.Event} event
534 */ 538 */
535 _editorClosed: function(event) 539 _editorClosed: function(event)
536 { 540 {
537 var wasSelected = /** @type {boolean} */ (event.data.wasSelected); 541 var wasSelected = /** @type {boolean} */ (event.data.wasSelected);
538 if (wasSelected) 542 if (wasSelected)
539 this._editorChanged(null); 543 this._editorChanged(null);
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 __proto__: WebInspector.VBox.prototype 1371 __proto__: WebInspector.VBox.prototype
1368 } 1372 }
1369 1373
1370 /** 1374 /**
1371 * @return {boolean} 1375 * @return {boolean}
1372 */ 1376 */
1373 WebInspector.SourcesPanel.WrapperView.isShowing = function() 1377 WebInspector.SourcesPanel.WrapperView.isShowing = function()
1374 { 1378 {
1375 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing(); 1379 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing();
1376 } 1380 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698