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

Side by Side Diff: Source/devtools/front_end/inspector.js

Issue 177653004: DevTools: Get rid of redundant default selection during inspectElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 | « Source/devtools/front_end/ElementsPanel.js ('k') | 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 WebInspector.log(error, WebInspector.ConsoleMessage.MessageLevel.Error, true ); 766 WebInspector.log(error, WebInspector.ConsoleMessage.MessageLevel.Error, true );
767 } 767 }
768 768
769 // Inspector.inspect protocol event 769 // Inspector.inspect protocol event
770 WebInspector.inspect = function(payload, hints) 770 WebInspector.inspect = function(payload, hints)
771 { 771 {
772 var object = WebInspector.RemoteObject.fromPayload(payload); 772 var object = WebInspector.RemoteObject.fromPayload(payload);
773 if (object.subtype === "node") { 773 if (object.subtype === "node") {
774 function callback(nodeId) 774 function callback(nodeId)
775 { 775 {
776 var elementsPanel = /** @type {!WebInspector.ElementsPanel} */ WebIn spector.panel("elements");
777 elementsPanel.stopOmittingDefaultSelection();
776 WebInspector._updateFocusedNode(nodeId); 778 WebInspector._updateFocusedNode(nodeId);
777 InspectorFrontendHost.inspectElementCompleted(); 779 InspectorFrontendHost.inspectElementCompleted();
778 object.release(); 780 object.release();
779 } 781 }
780 object.pushNodeToFrontend(callback); 782 object.pushNodeToFrontend(callback);
781 WebInspector.showPanel("elements"); 783 var elementsPanel = /** @type {!WebInspector.ElementsPanel} */ WebInspec tor.panel("elements");
784 elementsPanel.omitDefaultSelection();
785 WebInspector.inspectorView.setCurrentPanel(elementsPanel);
782 return; 786 return;
783 } 787 }
784 788
785 if (object.type === "function") { 789 if (object.type === "function") {
786 /** 790 /**
787 * @param {?Protocol.Error} error 791 * @param {?Protocol.Error} error
788 * @param {!DebuggerAgent.FunctionDetails} response 792 * @param {!DebuggerAgent.FunctionDetails} response
789 */ 793 */
790 function didGetDetails(error, response) 794 function didGetDetails(error, response)
791 { 795 {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 { 833 {
830 WebInspector._updateFocusedNode(event.data); 834 WebInspector._updateFocusedNode(event.data);
831 } 835 }
832 836
833 WebInspector._updateFocusedNode = function(nodeId) 837 WebInspector._updateFocusedNode = function(nodeId)
834 { 838 {
835 if (WebInspector.inspectElementModeController && WebInspector.inspectElement ModeController.enabled()) { 839 if (WebInspector.inspectElementModeController && WebInspector.inspectElement ModeController.enabled()) {
836 InspectorFrontendHost.bringToFront(); 840 InspectorFrontendHost.bringToFront();
837 WebInspector.inspectElementModeController.disable(); 841 WebInspector.inspectElementModeController.disable();
838 } 842 }
839 WebInspector.showPanel("elements").revealAndSelectNode(nodeId); 843 WebInspector.panel("elements").revealAndSelectNode(nodeId);
pfeldman 2014/02/25 16:28:12 Do this using revealer instead.
840 } 844 }
841 845
842 WebInspector.evaluateInConsole = function(expression, showResultOnly) 846 WebInspector.evaluateInConsole = function(expression, showResultOnly)
843 { 847 {
844 this.showConsole(); 848 this.showConsole();
845 this.consoleView.evaluateUsingTextPrompt(expression, showResultOnly); 849 this.consoleView.evaluateUsingTextPrompt(expression, showResultOnly);
846 } 850 }
847 851
848 WebInspector.addMainEventListeners = function(doc) 852 WebInspector.addMainEventListeners = function(doc)
849 { 853 {
850 doc.addEventListener("keydown", this.postDocumentKeyDown.bind(this), false); 854 doc.addEventListener("keydown", this.postDocumentKeyDown.bind(this), false);
851 doc.addEventListener("beforecopy", this.documentCanCopy.bind(this), true); 855 doc.addEventListener("beforecopy", this.documentCanCopy.bind(this), true);
852 doc.addEventListener("copy", this.documentCopy.bind(this), false); 856 doc.addEventListener("copy", this.documentCopy.bind(this), false);
853 doc.addEventListener("contextmenu", this.contextMenuEventFired.bind(this), t rue); 857 doc.addEventListener("contextmenu", this.contextMenuEventFired.bind(this), t rue);
854 doc.addEventListener("click", this.documentClick.bind(this), false); 858 doc.addEventListener("click", this.documentClick.bind(this), false);
855 } 859 }
856 860
857 window.DEBUG = true; 861 window.DEBUG = true;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ElementsPanel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698