mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-07 20:39:31 +08:00
Bug: 1006759 Change-Id: Idf78688fa354b7e169edd508667dd2e298eacea4 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1928914 Commit-Queue: Paul Lewis <aerotwist@chromium.org> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
48 lines
1.2 KiB
JavaScript
48 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.
|
|
|
|
/**
|
|
* @unrestricted
|
|
*/
|
|
export class OverviewController extends Common.Object {
|
|
constructor() {
|
|
super();
|
|
|
|
this.currentUrl = SDK.targetManager.inspectedURL();
|
|
SDK.targetManager.addEventListener(
|
|
SDK.TargetManager.Events.InspectedURLChanged, this._checkUrlAndResetIfChanged, this);
|
|
}
|
|
|
|
_checkUrlAndResetIfChanged() {
|
|
if (this.currentUrl === SDK.targetManager.inspectedURL()) {
|
|
return;
|
|
}
|
|
|
|
this.currentUrl = 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'),
|
|
};
|
|
|
|
/* Legacy exported object */
|
|
self.CssOverview = self.CssOverview || {};
|
|
|
|
/* Legacy exported object */
|
|
CssOverview = CssOverview || {};
|
|
|
|
/**
|
|
* @constructor
|
|
*/
|
|
CssOverview.OverviewController = OverviewController;
|
|
|
|
CssOverview.Events = Events;
|