|
|
6 |
|
6 |
|
7 |
const MAX_ORDINAL = 99; |
7 |
const MAX_ORDINAL = 99; |
8 |
const SPLITCONSOLE_ENABLED_PREF = "devtools.toolbox.splitconsoleEnabled"; |
8 |
const SPLITCONSOLE_ENABLED_PREF = "devtools.toolbox.splitconsoleEnabled"; |
9 |
const SPLITCONSOLE_HEIGHT_PREF = "devtools.toolbox.splitconsoleHeight"; |
9 |
const SPLITCONSOLE_HEIGHT_PREF = "devtools.toolbox.splitconsoleHeight"; |
10 |
const OS_HISTOGRAM = "DEVTOOLS_OS_ENUMERATED_PER_USER"; |
10 |
const OS_HISTOGRAM = "DEVTOOLS_OS_ENUMERATED_PER_USER"; |
11 |
const OS_IS_64_BITS = "DEVTOOLS_OS_IS_64_BITS_PER_USER"; |
11 |
const OS_IS_64_BITS = "DEVTOOLS_OS_IS_64_BITS_PER_USER"; |
12 |
const SCREENSIZE_HISTOGRAM = "DEVTOOLS_SCREEN_RESOLUTION_ENUMERATED_PER_USER"; |
12 |
const SCREENSIZE_HISTOGRAM = "DEVTOOLS_SCREEN_RESOLUTION_ENUMERATED_PER_USER"; |
13 |
const HTML_NS = "http://www.w3.org/1999/xhtml"; |
13 |
const HTML_NS = "http://www.w3.org/1999/xhtml"; |
14 |
const { SourceLocationController } = require("./source-location"); |
14 |
const { SourceMapService } = require("./sourcemap"); |
15 |
|
15 |
|
16 |
var {Cc, Ci, Cu} = require("chrome"); |
16 |
var {Cc, Ci, Cu} = require("chrome"); |
17 |
var promise = require("promise"); |
17 |
var promise = require("promise"); |
18 |
var defer = require("devtools/shared/defer"); |
18 |
var defer = require("devtools/shared/defer"); |
19 |
var Services = require("Services"); |
19 |
var Services = require("Services"); |
20 |
var {Task} = require("devtools/shared/task"); |
20 |
var {Task} = require("devtools/shared/task"); |
21 |
var {gDevTools} = require("devtools/client/framework/devtools"); |
21 |
var {gDevTools} = require("devtools/client/framework/devtools"); |
22 |
var EventEmitter = require("devtools/shared/event-emitter"); |
22 |
var EventEmitter = require("devtools/shared/event-emitter"); |
|
118 |
* @param {object} hostOptions |
118 |
* @param {object} hostOptions |
119 |
* Options for host specifically |
119 |
* Options for host specifically |
120 |
*/ |
120 |
*/ |
121 |
function Toolbox(target, selectedTool, hostType, hostOptions) { |
121 |
function Toolbox(target, selectedTool, hostType, hostOptions) { |
122 |
this._target = target; |
122 |
this._target = target; |
123 |
this._toolPanels = new Map(); |
123 |
this._toolPanels = new Map(); |
124 |
this._telemetry = new Telemetry(); |
124 |
this._telemetry = new Telemetry(); |
125 |
if (Services.prefs.getBoolPref("devtools.sourcemap.locations.enabled")) { |
125 |
if (Services.prefs.getBoolPref("devtools.sourcemap.locations.enabled")) { |
126 |
this._sourceLocationController = new SourceLocationController(this._target); |
126 |
this._sourceMapService = new SourceMapService(this._target); |
127 |
} |
127 |
} |
128 |
|
128 |
|
129 |
this._initInspector = null; |
129 |
this._initInspector = null; |
130 |
this._inspector = null; |
130 |
this._inspector = null; |
131 |
|
131 |
|
132 |
// Map of frames (id => frame-info) and currently selected frame id. |
132 |
// Map of frames (id => frame-info) and currently selected frame id. |
133 |
this.frameMap = new Map(); |
133 |
this.frameMap = new Map(); |
134 |
this.selectedFrameId = null; |
134 |
this.selectedFrameId = null; |
|
2033 |
|
2033 |
|
2034 |
gDevTools.off("tool-registered", this._toolRegistered); |
2034 |
gDevTools.off("tool-registered", this._toolRegistered); |
2035 |
gDevTools.off("tool-unregistered", this._toolUnregistered); |
2035 |
gDevTools.off("tool-unregistered", this._toolUnregistered); |
2036 |
|
2036 |
|
2037 |
gDevTools.off("pref-changed", this._prefChanged); |
2037 |
gDevTools.off("pref-changed", this._prefChanged); |
2038 |
|
2038 |
|
2039 |
this._lastFocusedElement = null; |
2039 |
this._lastFocusedElement = null; |
2040 |
|
2040 |
|
2041 |
if (this._sourceLocationController) { |
2041 |
if (this._sourceMapService) { |
2042 |
this._sourceLocationController.destroy(); |
2042 |
this._sourceMapService.destroy(); |
2043 |
this._sourceLocationController = null; |
2043 |
this._sourceMapService = null; |
2044 |
} |
2044 |
} |
2045 |
|
2045 |
|
2046 |
if (this.webconsolePanel) { |
2046 |
if (this.webconsolePanel) { |
2047 |
this._saveSplitConsoleHeight(); |
2047 |
this._saveSplitConsoleHeight(); |
2048 |
this.webconsolePanel.removeEventListener("resize", |
2048 |
this.webconsolePanel.removeEventListener("resize", |
2049 |
this._saveSplitConsoleHeight); |
2049 |
this._saveSplitConsoleHeight); |
2050 |
} |
2050 |
} |
2051 |
this.closeButton.removeEventListener("click", this.destroy, true); |
2051 |
this.closeButton.removeEventListener("click", this.destroy, true); |