| 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 /* eslint-disable indent */ | 4 /* eslint-disable indent */ |
| 5 (function(window) { | 5 (function(window) { |
| 6 | 6 |
| 7 // DevToolsAPI ---------------------------------------------------------------
- | 7 // DevToolsAPI ---------------------------------------------------------------
- |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * @unrestricted | 10 * @unrestricted |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 inspectorFrontendAPI[method].apply(inspectorFrontendAPI, args); | 57 inspectorFrontendAPI[method].apply(inspectorFrontendAPI, args); |
| 58 } | 58 } |
| 59 | 59 |
| 60 // API methods below this line -------------------------------------------- | 60 // API methods below this line -------------------------------------------- |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * @param {!Array.<!ExtensionDescriptor>} extensions | 63 * @param {!Array.<!ExtensionDescriptor>} extensions |
| 64 */ | 64 */ |
| 65 addExtensions(extensions) { | 65 addExtensions(extensions) { |
| 66 // Support for legacy front-ends (<M41). | 66 // Support for legacy front-ends (<M41). |
| 67 if (window['WebInspector']['addExtensions']) | 67 if (window['WebInspector'] && window['WebInspector']['addExtensions']) |
| 68 window['WebInspector']['addExtensions'](extensions); | 68 window['WebInspector']['addExtensions'](extensions); |
| 69 else | 69 else |
| 70 this._dispatchOnInspectorFrontendAPI('addExtensions', [extensions]); | 70 this._dispatchOnInspectorFrontendAPI('addExtensions', [extensions]); |
| 71 } | 71 } |
| 72 | 72 |
| 73 /** | 73 /** |
| 74 * @param {string} url | 74 * @param {string} url |
| 75 */ | 75 */ |
| 76 appendedToURL(url) { | 76 appendedToURL(url) { |
| 77 this._dispatchOnInspectorFrontendAPI('appendedToURL', [url]); | 77 this._dispatchOnInspectorFrontendAPI('appendedToURL', [url]); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 */ | 245 */ |
| 246 searchCompleted(requestId, fileSystemPath, files) { | 246 searchCompleted(requestId, fileSystemPath, files) { |
| 247 this._dispatchOnInspectorFrontendAPI('searchCompleted', [requestId, fileSy
stemPath, files]); | 247 this._dispatchOnInspectorFrontendAPI('searchCompleted', [requestId, fileSy
stemPath, files]); |
| 248 } | 248 } |
| 249 | 249 |
| 250 /** | 250 /** |
| 251 * @param {string} tabId | 251 * @param {string} tabId |
| 252 */ | 252 */ |
| 253 setInspectedTabId(tabId) { | 253 setInspectedTabId(tabId) { |
| 254 // Support for legacy front-ends (<M41). | 254 // Support for legacy front-ends (<M41). |
| 255 if (window['WebInspector']['setInspectedTabId']) | 255 if (window['WebInspector'] && window['WebInspector']['setInspectedTabId']) |
| 256 window['WebInspector']['setInspectedTabId'](tabId); | 256 window['WebInspector']['setInspectedTabId'](tabId); |
| 257 else | 257 else |
| 258 this._dispatchOnInspectorFrontendAPI('setInspectedTabId', [tabId]); | 258 this._dispatchOnInspectorFrontendAPI('setInspectedTabId', [tabId]); |
| 259 } | 259 } |
| 260 | 260 |
| 261 /** | 261 /** |
| 262 * @param {boolean} useSoftMenu | 262 * @param {boolean} useSoftMenu |
| 263 */ | 263 */ |
| 264 setUseSoftMenu(useSoftMenu) { | 264 setUseSoftMenu(useSoftMenu) { |
| 265 this._dispatchOnInspectorFrontendAPI('setUseSoftMenu', [useSoftMenu]); | 265 this._dispatchOnInspectorFrontendAPI('setUseSoftMenu', [useSoftMenu]); |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 * @return {boolean} | 1231 * @return {boolean} |
| 1232 */ | 1232 */ |
| 1233 DOMTokenList.prototype.toggle = function(token, force) { | 1233 DOMTokenList.prototype.toggle = function(token, force) { |
| 1234 if (arguments.length === 1) | 1234 if (arguments.length === 1) |
| 1235 force = !this.contains(token); | 1235 force = !this.contains(token); |
| 1236 return this.__originalDOMTokenListToggle(token, !!force); | 1236 return this.__originalDOMTokenListToggle(token, !!force); |
| 1237 }; | 1237 }; |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 })(window); | 1240 })(window); |
| OLD | NEW |