OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /* eslint-disable indent */ | 5 /* eslint-disable indent */ |
6 (function(window) { | 6 (function(window) { |
7 | 7 |
8 // DevToolsAPI ---------------------------------------------------------------- | 8 // DevToolsAPI ---------------------------------------------------------------- |
9 | 9 |
10 /** | 10 /** |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 var request = new XMLHttpRequest(); | 323 var request = new XMLHttpRequest(); |
324 request.open("GET", "data:text/plain;base64," + chunk, false); | 324 request.open("GET", "data:text/plain;base64," + chunk, false); |
325 request.send(null); | 325 request.send(null); |
326 if (request.status === 200) { | 326 if (request.status === 200) { |
327 return request.responseText; | 327 return request.responseText; |
328 } else { | 328 } else { |
329 console.error("Error while decoding chunk in streamWrite"); | 329 console.error("Error while decoding chunk in streamWrite"); |
330 return ""; | 330 return ""; |
331 } | 331 } |
332 } | 332 } |
333 } | 333 }; |
334 | 334 |
335 var DevToolsAPI = new DevToolsAPIImpl(); | 335 var DevToolsAPI = new DevToolsAPIImpl(); |
336 window.DevToolsAPI = DevToolsAPI; | 336 window.DevToolsAPI = DevToolsAPI; |
337 | 337 |
338 // InspectorFrontendHostImpl -------------------------------------------------- | 338 // InspectorFrontendHostImpl -------------------------------------------------- |
339 | 339 |
340 /** | 340 /** |
341 * @constructor | 341 * @constructor |
342 * @implements {InspectorFrontendHostAPI} | 342 * @implements {InspectorFrontendHostAPI} |
343 */ | 343 */ |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 }, | 889 }, |
890 | 890 |
891 /** | 891 /** |
892 * Support for legacy front-ends (<M44). | 892 * Support for legacy front-ends (<M44). |
893 * @param {number} panelCode | 893 * @param {number} panelCode |
894 */ | 894 */ |
895 recordPanelShown: function(panelCode) | 895 recordPanelShown: function(panelCode) |
896 { | 896 { |
897 this.recordEnumeratedHistogram("DevTools.PanelShown", panelCode, 20); | 897 this.recordEnumeratedHistogram("DevTools.PanelShown", panelCode, 20); |
898 } | 898 } |
899 } | 899 }; |
900 | 900 |
901 window.InspectorFrontendHost = new InspectorFrontendHostImpl(); | 901 window.InspectorFrontendHost = new InspectorFrontendHostImpl(); |
902 | 902 |
903 // DevToolsApp --------------------------------------------------------------- | 903 // DevToolsApp --------------------------------------------------------------- |
904 | 904 |
905 function installObjectObserve() | 905 function installObjectObserve() |
906 { | 906 { |
907 var properties = [ | 907 var properties = [ |
908 "advancedSearchConfig", "auditsPanelSplitViewState", "auditsSidebarWidth
", "blockedURLs", "breakpoints", "cacheDisabled", "colorFormat", "consoleHistory
", | 908 "advancedSearchConfig", "auditsPanelSplitViewState", "auditsSidebarWidth
", "blockedURLs", "breakpoints", "cacheDisabled", "colorFormat", "consoleHistory
", |
909 "consoleTimestampsEnabled", "cpuProfilerView", "cssSourceMapsEnabled", "
currentDockState", "customColorPalette", "customDevicePresets", "customEmulatedD
eviceList", | 909 "consoleTimestampsEnabled", "cpuProfilerView", "cssSourceMapsEnabled", "
currentDockState", "customColorPalette", "customDevicePresets", "customEmulatedD
eviceList", |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 else | 1158 else |
1159 window.addEventListener("DOMContentLoaded", windowLoaded, false); | 1159 window.addEventListener("DOMContentLoaded", windowLoaded, false); |
1160 | 1160 |
1161 if (!DOMTokenList.prototype.__originalDOMTokenListToggle) { | 1161 if (!DOMTokenList.prototype.__originalDOMTokenListToggle) { |
1162 DOMTokenList.prototype.__originalDOMTokenListToggle = DOMTokenList.prototype
.toggle; | 1162 DOMTokenList.prototype.__originalDOMTokenListToggle = DOMTokenList.prototype
.toggle; |
1163 DOMTokenList.prototype.toggle = function(token, force) | 1163 DOMTokenList.prototype.toggle = function(token, force) |
1164 { | 1164 { |
1165 if (arguments.length === 1) | 1165 if (arguments.length === 1) |
1166 force = !this.contains(token); | 1166 force = !this.contains(token); |
1167 return this.__originalDOMTokenListToggle(token, !!force); | 1167 return this.__originalDOMTokenListToggle(token, !!force); |
1168 } | 1168 }; |
1169 } | 1169 } |
1170 | 1170 |
1171 })(window); | 1171 })(window); |
OLD | NEW |