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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js

Issue 1939803002: DevTools: mute the node highlight & hide devtools while taking screenshots. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Google 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 } 1128 }
1129 return result; 1129 return result;
1130 } 1130 }
1131 1131
1132 WebInspector.DOMModel.hideDOMNodeHighlight = function() 1132 WebInspector.DOMModel.hideDOMNodeHighlight = function()
1133 { 1133 {
1134 for (var domModel of WebInspector.DOMModel.instances()) 1134 for (var domModel of WebInspector.DOMModel.instances())
1135 domModel.highlightDOMNode(0); 1135 domModel.highlightDOMNode(0);
1136 } 1136 }
1137 1137
1138 WebInspector.DOMModel.muteHighlight = function()
1139 {
1140 WebInspector.DOMModel.hideDOMNodeHighlight();
1141 WebInspector.DOMModel._highlightDisabled = true;
1142 }
1143
1144 WebInspector.DOMModel.unmuteHighlight = function()
1145 {
1146 WebInspector.DOMModel._highlightDisabled = false;
1147 }
1148
1138 WebInspector.DOMModel.cancelSearch = function() 1149 WebInspector.DOMModel.cancelSearch = function()
1139 { 1150 {
1140 for (var domModel of WebInspector.DOMModel.instances()) 1151 for (var domModel of WebInspector.DOMModel.instances())
1141 domModel._cancelSearch(); 1152 domModel._cancelSearch();
1142 } 1153 }
1143 1154
1144 WebInspector.DOMModel.prototype = { 1155 WebInspector.DOMModel.prototype = {
1145 /** 1156 /**
1146 * @param {!WebInspector.DOMNode} node 1157 * @param {!WebInspector.DOMNode} node
1147 */ 1158 */
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 }, 1741 },
1731 1742
1732 /** 1743 /**
1733 * @param {!DOMAgent.NodeId=} nodeId 1744 * @param {!DOMAgent.NodeId=} nodeId
1734 * @param {!{mode: (string|undefined), showInfo: (boolean|undefined), select ors: (string|undefined)}=} config 1745 * @param {!{mode: (string|undefined), showInfo: (boolean|undefined), select ors: (string|undefined)}=} config
1735 * @param {!DOMAgent.BackendNodeId=} backendNodeId 1746 * @param {!DOMAgent.BackendNodeId=} backendNodeId
1736 * @param {!RuntimeAgent.RemoteObjectId=} objectId 1747 * @param {!RuntimeAgent.RemoteObjectId=} objectId
1737 */ 1748 */
1738 highlightDOMNodeWithConfig: function(nodeId, config, backendNodeId, objectId ) 1749 highlightDOMNodeWithConfig: function(nodeId, config, backendNodeId, objectId )
1739 { 1750 {
1751 if (WebInspector.DOMModel._highlightDisabled)
1752 return;
1740 config = config || { mode: "all", showInfo: undefined, selectors: undefi ned }; 1753 config = config || { mode: "all", showInfo: undefined, selectors: undefi ned };
1741 if (this._hideDOMNodeHighlightTimeout) { 1754 if (this._hideDOMNodeHighlightTimeout) {
1742 clearTimeout(this._hideDOMNodeHighlightTimeout); 1755 clearTimeout(this._hideDOMNodeHighlightTimeout);
1743 delete this._hideDOMNodeHighlightTimeout; 1756 delete this._hideDOMNodeHighlightTimeout;
1744 } 1757 }
1745 var highlightConfig = this._buildHighlightConfig(config.mode); 1758 var highlightConfig = this._buildHighlightConfig(config.mode);
1746 if (typeof config.showInfo !== "undefined") 1759 if (typeof config.showInfo !== "undefined")
1747 highlightConfig.showInfo = config.showInfo; 1760 highlightConfig.showInfo = config.showInfo;
1748 if (typeof config.selectors !== "undefined") 1761 if (typeof config.selectors !== "undefined")
1749 highlightConfig.selectorList = config.selectors; 1762 highlightConfig.selectorList = config.selectors;
1750 this._highlighter.highlightDOMNode(this.nodeForId(nodeId || 0), highligh tConfig, backendNodeId, objectId); 1763 this._highlighter.highlightDOMNode(this.nodeForId(nodeId || 0), highligh tConfig, backendNodeId, objectId);
1751 }, 1764 },
1752 1765
1753 /** 1766 /**
1754 * @param {!DOMAgent.NodeId} nodeId 1767 * @param {!DOMAgent.NodeId} nodeId
1755 */ 1768 */
1756 highlightDOMNodeForTwoSeconds: function(nodeId) 1769 highlightDOMNodeForTwoSeconds: function(nodeId)
1757 { 1770 {
1758 this.highlightDOMNode(nodeId); 1771 this.highlightDOMNode(nodeId);
1759 this._hideDOMNodeHighlightTimeout = setTimeout(WebInspector.DOMModel.hid eDOMNodeHighlight.bind(WebInspector.DOMModel), 2000); 1772 this._hideDOMNodeHighlightTimeout = setTimeout(WebInspector.DOMModel.hid eDOMNodeHighlight.bind(WebInspector.DOMModel), 2000);
1760 }, 1773 },
1761 1774
1762 /** 1775 /**
1763 * @param {!PageAgent.FrameId} frameId 1776 * @param {!PageAgent.FrameId} frameId
1764 */ 1777 */
1765 highlightFrame: function(frameId) 1778 highlightFrame: function(frameId)
1766 { 1779 {
1780 if (WebInspector.DOMModel._highlightDisabled)
1781 return;
1767 this._highlighter.highlightFrame(frameId); 1782 this._highlighter.highlightFrame(frameId);
1768 }, 1783 },
1769 1784
1770 /** 1785 /**
1771 * @param {!DOMAgent.InspectMode} mode 1786 * @param {!DOMAgent.InspectMode} mode
1772 * @param {function(?Protocol.Error)=} callback 1787 * @param {function(?Protocol.Error)=} callback
1773 */ 1788 */
1774 setInspectMode: function(mode, callback) 1789 setInspectMode: function(mode, callback)
1775 { 1790 {
1776 /** 1791 /**
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 } 2253 }
2239 2254
2240 /** 2255 /**
2241 * @param {!WebInspector.Target} target 2256 * @param {!WebInspector.Target} target
2242 * @return {?WebInspector.DOMModel} 2257 * @return {?WebInspector.DOMModel}
2243 */ 2258 */
2244 WebInspector.DOMModel.fromTarget = function(target) 2259 WebInspector.DOMModel.fromTarget = function(target)
2245 { 2260 {
2246 return /** @type {?WebInspector.DOMModel} */ (target.model(WebInspector.DOMM odel)); 2261 return /** @type {?WebInspector.DOMModel} */ (target.model(WebInspector.DOMM odel));
2247 } 2262 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698