Bug 1696372 - [devtools] Migrate inspector panel from toolbox.targetList to commands.TargetCommand. r=nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D110209
This commit is contained in:
Alexandre Poirot 2021-03-30 21:29:38 +00:00
Родитель 1e42ba365c
Коммит 6b3fd01026
4 изменённых файлов: 19 добавлений и 19 удалений

Просмотреть файл

@ -147,8 +147,8 @@ class AnimationInspector {
}
async initListeners() {
await this.inspector.toolbox.targetList.watchTargets(
[this.inspector.toolbox.targetList.TYPES.FRAME],
await this.inspector.commands.targetCommand.watchTargets(
[this.inspector.commands.targetCommand.TYPES.FRAME],
this.onTargetAvailable
);

Просмотреть файл

@ -203,8 +203,8 @@ Inspector.prototype = {
r => (this._resolveMarkupViewInitialized = r)
);
await this.toolbox.targetList.watchTargets(
[this.toolbox.targetList.TYPES.FRAME],
await this.commands.targetCommand.watchTargets(
[this.commands.targetCommand.TYPES.FRAME],
this._onTargetAvailable,
this._onTargetDestroyed
);
@ -274,8 +274,8 @@ Inspector.prototype = {
* @return {Array} The list of InspectorFront instances.
*/
async getAllInspectorFronts() {
return this.toolbox.targetList.getAllFronts(
this.toolbox.targetList.TYPES.FRAME,
return this.commands.targetCommand.getAllFronts(
this.commands.targetCommand.TYPES.FRAME,
"inspector"
);
},
@ -482,7 +482,7 @@ Inspector.prototype = {
* Top level target front getter.
*/
get currentTarget() {
return this.toolbox.targetList.targetFront;
return this.commands.targetCommand.targetFront;
},
/**
@ -1678,12 +1678,12 @@ Inspector.prototype = {
this.styleChangeTracker.destroy();
this.searchboxShortcuts.destroy();
const { targetList, resourceWatcher } = this.toolbox;
targetList.unwatchTargets(
[targetList.TYPES.FRAME],
this.commands.targetCommand.unwatchTargets(
[this.commands.targetCommand.TYPES.FRAME],
this._onTargetAvailable,
this._onTargetDestroyed
);
const { resourceWatcher } = this.toolbox;
resourceWatcher.unwatchResources(
[resourceWatcher.TYPES.ROOT_NODE, resourceWatcher.TYPES.CSS_CHANGE],
{ onAvailable: this.onResourceAvailable }

Просмотреть файл

@ -1766,7 +1766,7 @@ CssRuleView.prototype = {
this.colorSchemeDarkSimulationButton.classList.toggle("checked");
}
await this.inspector.toolbox.commands.targetConfigurationCommand.updateConfiguration(
await this.inspector.commands.targetConfigurationCommand.updateConfiguration(
{
colorSchemeSimulation: shouldSimulateLightScheme ? "light" : null,
}
@ -1787,7 +1787,7 @@ CssRuleView.prototype = {
this.colorSchemeLightSimulationButton.classList.toggle("checked");
}
await this.inspector.toolbox.commands.targetConfigurationCommand.updateConfiguration(
await this.inspector.commands.targetConfigurationCommand.updateConfiguration(
{
colorSchemeSimulation: shouldSimulateDarkScheme ? "dark" : null,
}
@ -1798,7 +1798,7 @@ CssRuleView.prototype = {
async _onTogglePrintSimulation() {
const enabled = this.printSimulationButton.classList.toggle("checked");
await this.inspector.toolbox.commands.targetConfigurationCommand.updateConfiguration(
await this.inspector.commands.targetConfigurationCommand.updateConfiguration(
{
printSimulationEnabled: enabled,
}

Просмотреть файл

@ -32,14 +32,14 @@ class WalkerEventListener {
* Clean up function.
*/
destroy() {
this._inspector.toolbox.targetList.unwatchTargets(
[this._inspector.toolbox.targetList.TYPES.FRAME],
this._inspector.commands.targetCommand.unwatchTargets(
[this._inspector.commands.targetCommand.TYPES.FRAME],
this._onTargetAvailable,
this._onTargetDestroyed
);
const targets = this._inspector.toolbox.targetList.getAllTargets([
this._inspector.toolbox.targetList.TYPES.FRAME,
const targets = this._inspector.commands.targetCommand.getAllTargets([
this._inspector.commands.targetCommand.TYPES.FRAME,
]);
for (const targetFront of targets) {
this._onTargetDestroyed({
@ -52,8 +52,8 @@ class WalkerEventListener {
}
_init() {
this._inspector.toolbox.targetList.watchTargets(
[this._inspector.toolbox.targetList.TYPES.FRAME],
this._inspector.commands.targetCommand.watchTargets(
[this._inspector.commands.targetCommand.TYPES.FRAME],
this._onTargetAvailable,
this._onTargetDestroyed
);