| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 cr.define('extensions', function() { | 5 cr.define('extensions', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Clear all the content of a given element. | 9 * Clear all the content of a given element. |
| 10 * @param {HTMLElement} element The element to be cleared. | 10 * @param {HTMLElement} element The element to be cleared. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 * @see chrome/browser/ui/webui/extensions/extension_error_ui_util.h | 70 * @see chrome/browser/ui/webui/extensions/extension_error_ui_util.h |
| 71 * @param {Object} args The arguments to pass to openDevTools. | 71 * @param {Object} args The arguments to pass to openDevTools. |
| 72 * @private | 72 * @private |
| 73 */ | 73 */ |
| 74 RuntimeErrorContent.openDevtools_ = function(args) { | 74 RuntimeErrorContent.openDevtools_ = function(args) { |
| 75 if (chrome.send) | 75 if (chrome.send) |
| 76 chrome.send('extensionErrorOpenDevTools', [args]); | 76 chrome.send('extensionErrorOpenDevTools', [args]); |
| 77 else if (chrome.developerPrivate) | 77 else if (chrome.developerPrivate) |
| 78 chrome.developerPrivate.openDevTools(args); | 78 chrome.developerPrivate.openDevTools(args); |
| 79 else | 79 else |
| 80 assert(false, 'Cannot call either openDevTools function.'); | 80 assertNotReached('Cannot call either openDevTools function.'); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 RuntimeErrorContent.prototype = { | 83 RuntimeErrorContent.prototype = { |
| 84 __proto__: HTMLDivElement.prototype, | 84 __proto__: HTMLDivElement.prototype, |
| 85 | 85 |
| 86 /** | 86 /** |
| 87 * The underlying error whose details are being displayed. | 87 * The underlying error whose details are being displayed. |
| 88 * @type {Object} | 88 * @type {Object} |
| 89 * @private | 89 * @private |
| 90 */ | 90 */ |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 * @param {Object} args The arguments to pass to requestFileSource. | 328 * @param {Object} args The arguments to pass to requestFileSource. |
| 329 */ | 329 */ |
| 330 ExtensionErrorOverlay.requestFileSource = function(args) { | 330 ExtensionErrorOverlay.requestFileSource = function(args) { |
| 331 if (chrome.send) { | 331 if (chrome.send) { |
| 332 chrome.send('extensionErrorRequestFileSource', [args]); | 332 chrome.send('extensionErrorRequestFileSource', [args]); |
| 333 } else if (chrome.developerPrivate) { | 333 } else if (chrome.developerPrivate) { |
| 334 chrome.developerPrivate.requestFileSource(args, function(result) { | 334 chrome.developerPrivate.requestFileSource(args, function(result) { |
| 335 extensions.ExtensionErrorOverlay.requestFileSourceResponse(result); | 335 extensions.ExtensionErrorOverlay.requestFileSourceResponse(result); |
| 336 }); | 336 }); |
| 337 } else { | 337 } else { |
| 338 assert(false, 'Cannot call either requestFileSource function.'); | 338 assertNotReached('Cannot call either requestFileSource function.'); |
| 339 } | 339 } |
| 340 }; | 340 }; |
| 341 | 341 |
| 342 cr.addSingletonGetter(ExtensionErrorOverlay); | 342 cr.addSingletonGetter(ExtensionErrorOverlay); |
| 343 | 343 |
| 344 ExtensionErrorOverlay.prototype = { | 344 ExtensionErrorOverlay.prototype = { |
| 345 /** | 345 /** |
| 346 * The underlying error whose details are being displayed. | 346 * The underlying error whose details are being displayed. |
| 347 * @type {Object} | 347 * @type {Object} |
| 348 * @private | 348 * @private |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 var overlay = extensions.ExtensionErrorOverlay.getInstance(); | 505 var overlay = extensions.ExtensionErrorOverlay.getInstance(); |
| 506 overlay.setCode(result); | 506 overlay.setCode(result); |
| 507 overlay.setVisible(true); | 507 overlay.setVisible(true); |
| 508 }; | 508 }; |
| 509 | 509 |
| 510 // Export | 510 // Export |
| 511 return { | 511 return { |
| 512 ExtensionErrorOverlay: ExtensionErrorOverlay | 512 ExtensionErrorOverlay: ExtensionErrorOverlay |
| 513 }; | 513 }; |
| 514 }); | 514 }); |
| OLD | NEW |