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

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

Issue 1310273006: Devtools: convert pair of booleans in setInspectModeEnabled into enum parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address comments Created 5 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 | « Source/devtools/front_end/screencast/ScreencastView.js ('k') | Source/devtools/protocol.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) 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 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1739 1739
1740 /** 1740 /**
1741 * @param {!PageAgent.FrameId} frameId 1741 * @param {!PageAgent.FrameId} frameId
1742 */ 1742 */
1743 highlightFrame: function(frameId) 1743 highlightFrame: function(frameId)
1744 { 1744 {
1745 this._highlighter.highlightFrame(frameId); 1745 this._highlighter.highlightFrame(frameId);
1746 }, 1746 },
1747 1747
1748 /** 1748 /**
1749 * @param {boolean} enabled 1749 * @param {!DOMAgent.InspectMode} mode
1750 * @param {boolean} inspectUAShadowDOM
1751 * @param {function(?Protocol.Error)=} callback 1750 * @param {function(?Protocol.Error)=} callback
1752 */ 1751 */
1753 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, callback) 1752 setInspectMode: function(mode, callback)
1754 { 1753 {
1755 /** 1754 /**
1756 * @this {WebInspector.DOMModel} 1755 * @this {WebInspector.DOMModel}
1757 */ 1756 */
1758 function onDocumentAvailable() 1757 function onDocumentAvailable()
1759 { 1758 {
1760 this.dispatchEventToListeners(WebInspector.DOMModel.Events.InspectMo deWillBeToggled, enabled); 1759 this.dispatchEventToListeners(WebInspector.DOMModel.Events.InspectMo deWillBeToggled, mode !== DOMAgent.InspectMode.None);
1761 this._highlighter.setInspectModeEnabled(enabled, inspectUAShadowDOM, this._buildHighlightConfig(), callback); 1760 this._highlighter.setInspectMode(mode, this._buildHighlightConfig(), callback);
1762 } 1761 }
1763 this.requestDocument(onDocumentAvailable.bind(this)); 1762 this.requestDocument(onDocumentAvailable.bind(this));
1764 }, 1763 },
1765 1764
1766 /** 1765 /**
1767 * @param {boolean} showRulers 1766 * @param {boolean} showRulers
1768 * @param {boolean} showExtensionLines 1767 * @param {boolean} showExtensionLines
1769 */ 1768 */
1770 setHighlightSettings: function(showRulers, showExtensionLines) 1769 setHighlightSettings: function(showRulers, showExtensionLines)
1771 { 1770 {
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
2094 WebInspector.DOMNodeHighlighter.prototype = { 2093 WebInspector.DOMNodeHighlighter.prototype = {
2095 /** 2094 /**
2096 * @param {?WebInspector.DOMNode} node 2095 * @param {?WebInspector.DOMNode} node
2097 * @param {!DOMAgent.HighlightConfig} config 2096 * @param {!DOMAgent.HighlightConfig} config
2098 * @param {!DOMAgent.BackendNodeId=} backendNodeId 2097 * @param {!DOMAgent.BackendNodeId=} backendNodeId
2099 * @param {!RuntimeAgent.RemoteObjectId=} objectId 2098 * @param {!RuntimeAgent.RemoteObjectId=} objectId
2100 */ 2099 */
2101 highlightDOMNode: function(node, config, backendNodeId, objectId) {}, 2100 highlightDOMNode: function(node, config, backendNodeId, objectId) {},
2102 2101
2103 /** 2102 /**
2104 * @param {boolean} enabled 2103 * @param {!DOMAgent.InspectMode} mode
2105 * @param {boolean} inspectUAShadowDOM
2106 * @param {!DOMAgent.HighlightConfig} config 2104 * @param {!DOMAgent.HighlightConfig} config
2107 * @param {function(?Protocol.Error)=} callback 2105 * @param {function(?Protocol.Error)=} callback
2108 */ 2106 */
2109 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k) {}, 2107 setInspectMode: function(mode, config, callback) {},
2110 2108
2111 /** 2109 /**
2112 * @param {!PageAgent.FrameId} frameId 2110 * @param {!PageAgent.FrameId} frameId
2113 */ 2111 */
2114 highlightFrame: function(frameId) {} 2112 highlightFrame: function(frameId) {}
2115 } 2113 }
2116 2114
2117 /** 2115 /**
2118 * @constructor 2116 * @constructor
2119 * @implements {WebInspector.DOMNodeHighlighter} 2117 * @implements {WebInspector.DOMNodeHighlighter}
(...skipping 15 matching lines...) Expand all
2135 highlightDOMNode: function(node, config, backendNodeId, objectId) 2133 highlightDOMNode: function(node, config, backendNodeId, objectId)
2136 { 2134 {
2137 if (objectId || node || backendNodeId) 2135 if (objectId || node || backendNodeId)
2138 this._agent.highlightNode(config, (objectId || backendNodeId) ? unde fined : node.id, backendNodeId, objectId); 2136 this._agent.highlightNode(config, (objectId || backendNodeId) ? unde fined : node.id, backendNodeId, objectId);
2139 else 2137 else
2140 this._agent.hideHighlight(); 2138 this._agent.hideHighlight();
2141 }, 2139 },
2142 2140
2143 /** 2141 /**
2144 * @override 2142 * @override
2145 * @param {boolean} enabled 2143 * @param {!DOMAgent.InspectMode} mode
2146 * @param {boolean} inspectUAShadowDOM
2147 * @param {!DOMAgent.HighlightConfig} config 2144 * @param {!DOMAgent.HighlightConfig} config
2148 * @param {function(?Protocol.Error)=} callback 2145 * @param {function(?Protocol.Error)=} callback
2149 */ 2146 */
2150 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k) 2147 setInspectMode: function(mode, config, callback)
2151 { 2148 {
2152 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c allback); 2149 this._agent.setInspectMode(mode, config, callback);
2153 }, 2150 },
2154 2151
2155 /** 2152 /**
2156 * @override 2153 * @override
2157 * @param {!PageAgent.FrameId} frameId 2154 * @param {!PageAgent.FrameId} frameId
2158 */ 2155 */
2159 highlightFrame: function(frameId) 2156 highlightFrame: function(frameId)
2160 { 2157 {
2161 this._agent.highlightFrame(frameId, WebInspector.Color.PageHighlight.Con tent.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutline.toProtoco lRGBA()); 2158 this._agent.highlightFrame(frameId, WebInspector.Color.PageHighlight.Con tent.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutline.toProtoco lRGBA());
2162 } 2159 }
2163 } 2160 }
2164 2161
2165 /** 2162 /**
2166 * @param {!WebInspector.Target} target 2163 * @param {!WebInspector.Target} target
2167 * @return {?WebInspector.DOMModel} 2164 * @return {?WebInspector.DOMModel}
2168 */ 2165 */
2169 WebInspector.DOMModel.fromTarget = function(target) 2166 WebInspector.DOMModel.fromTarget = function(target)
2170 { 2167 {
2171 return /** @type {?WebInspector.DOMModel} */ (target.model(WebInspector.DOMM odel)); 2168 return /** @type {?WebInspector.DOMModel} */ (target.model(WebInspector.DOMM odel));
2172 } 2169 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/screencast/ScreencastView.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698