mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-03 02:21:05 +08:00
Bug: 1006759 Change-Id: I2130d4ba17bb592090c202cfe2b97da2558e72ea Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054544 Reviewed-by: Paul Lewis <aerotwist@chromium.org> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
38 lines
1.1 KiB
JavaScript
38 lines
1.1 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 = self.SDK.targetManager.inspectedURL();
|
|
self.SDK.targetManager.addEventListener(
|
|
SDK.SDKModel.Events.InspectedURLChanged, this._checkUrlAndResetIfChanged, this);
|
|
}
|
|
|
|
_checkUrlAndResetIfChanged() {
|
|
if (this.currentUrl === self.SDK.targetManager.inspectedURL()) {
|
|
return;
|
|
}
|
|
|
|
this.currentUrl = self.SDK.targetManager.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'),
|
|
};
|