mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-09 21:28:43 +08:00
Bug: 1134103 Change-Id: I8339a3082d9d009f919e217cac59bec59921fb3d Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2692891 Commit-Queue: Andres Olivares <andoli@chromium.org> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
53 lines
1.1 KiB
JavaScript
53 lines
1.1 KiB
JavaScript
// 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 * as Common from '../common/common.js'; // eslint-disable-line no-unused-vars
|
|
import * as UI from '../ui/ui.js';
|
|
|
|
/**
|
|
* @implements {Common.App.App}
|
|
*/
|
|
export class SimpleApp {
|
|
/**
|
|
* @override
|
|
* @param {!Document} document
|
|
*/
|
|
presentUI(document) {
|
|
const rootView = new UI.RootView.RootView();
|
|
UI.InspectorView.InspectorView.instance().show(rootView.element);
|
|
rootView.attachToDocument(document);
|
|
rootView.focus();
|
|
}
|
|
}
|
|
|
|
|
|
/** @type {!SimpleAppProvider} */
|
|
let simpleAppProviderInstance;
|
|
|
|
|
|
/**
|
|
* @implements {Common.AppProvider.AppProvider}
|
|
*/
|
|
export class SimpleAppProvider {
|
|
/**
|
|
* @param {{forceNew: ?boolean}} opts
|
|
*/
|
|
static instance(opts = {forceNew: null}) {
|
|
const {forceNew} = opts;
|
|
if (!simpleAppProviderInstance || forceNew) {
|
|
simpleAppProviderInstance = new SimpleAppProvider();
|
|
}
|
|
|
|
return simpleAppProviderInstance;
|
|
}
|
|
|
|
/**
|
|
* @override
|
|
* @return {!Common.App.App}
|
|
*/
|
|
createApp() {
|
|
return new SimpleApp();
|
|
}
|
|
}
|