mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-07 20:39:31 +08:00
Bug: chromium:1011811 Change-Id: I6dfe7eb704943e0ff267f54fef01a66b7ba7a9b9 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2394593 Auto-Submit: Andres Olivares <andoli@chromium.org> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
// Copyright 2019 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import * as Common from '../common/common.js';
|
|
import * as SDK from '../sdk/sdk.js';
|
|
|
|
/**
|
|
* @unrestricted
|
|
*/
|
|
export class OverviewController extends Common.ObjectWrapper.ObjectWrapper {
|
|
constructor() {
|
|
super();
|
|
|
|
this.currentUrl = SDK.SDKModel.TargetManager.instance().inspectedURL();
|
|
SDK.SDKModel.TargetManager.instance().addEventListener(
|
|
SDK.SDKModel.Events.InspectedURLChanged, this._checkUrlAndResetIfChanged, this);
|
|
}
|
|
|
|
_checkUrlAndResetIfChanged() {
|
|
if (this.currentUrl === SDK.SDKModel.TargetManager.instance().inspectedURL()) {
|
|
return;
|
|
}
|
|
|
|
this.currentUrl = SDK.SDKModel.TargetManager.instance().inspectedURL();
|
|
this.dispatchEventToListeners(Events.Reset);
|
|
}
|
|
}
|
|
|
|
export const Events = {
|
|
RequestOverviewStart: Symbol('RequestOverviewStart'),
|
|
RequestNodeHighlight: Symbol('RequestNodeHighlight'),
|
|
PopulateNodes: Symbol('PopulateNodes'),
|
|
RequestOverviewCancel: Symbol('RequestOverviewCancel'),
|
|
OverviewCompleted: Symbol('OverviewCompleted'),
|
|
Reset: Symbol('Reset'),
|
|
};
|