mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-11-05 04:39:20 +08:00
Bug: none Change-Id: I02ef1182143b7fe091ce92d59f04ac2188903e0d Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2886925 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Mathias Bynens <mathias@chromium.org>
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
// Copyright 2014 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 type * as Common from '../../core/common/common.js'; // eslint-disable-line no-unused-vars
|
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
|
|
export class SimpleApp implements Common.App.App {
|
|
presentUI(document: Document): void {
|
|
const rootView = new UI.RootView.RootView();
|
|
UI.InspectorView.InspectorView.instance().show(rootView.element);
|
|
rootView.attachToDocument(document);
|
|
rootView.focus();
|
|
}
|
|
}
|
|
|
|
let simpleAppProviderInstance: SimpleAppProvider;
|
|
|
|
export class SimpleAppProvider implements Common.AppProvider.AppProvider {
|
|
static instance(opts: {
|
|
forceNew: boolean|null,
|
|
} = {forceNew: null}): SimpleAppProvider {
|
|
const {forceNew} = opts;
|
|
if (!simpleAppProviderInstance || forceNew) {
|
|
simpleAppProviderInstance = new SimpleAppProvider();
|
|
}
|
|
|
|
return simpleAppProviderInstance;
|
|
}
|
|
|
|
createApp(): Common.App.App {
|
|
return new SimpleApp();
|
|
}
|
|
}
|