mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-08 04:44:04 +08:00
This reverts commit 77e01616ea.
Reason for revert:
https://bugs.chromium.org/p/chromium/issues/detail?id=1039577
Original change's description:
> Migrates refs to Common inside ui/ to ESM
>
> Bug: 1006759
> Change-Id: I5967981a53e1f227270c112ce636c32f3c33d9e2
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1985676
> Commit-Queue: Paul Lewis <aerotwist@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
TBR=aerotwist@chromium.org,tvanderlippe@chromium.org
Change-Id: I62c1477175307b0b9a54f2cace5fa6ba5af9d667
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1006759, 1039577
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1989312
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
39 lines
1.4 KiB
JavaScript
39 lines
1.4 KiB
JavaScript
// Copyright 2018 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 {Dialog} from './Dialog.js';
|
|
import {SizeBehavior} from './GlassPane.js';
|
|
import {createTextButton, formatLocalized} from './UIUtils.js';
|
|
import {VBox} from './Widget.js';
|
|
|
|
export class RemoteDebuggingTerminatedScreen extends VBox {
|
|
/**
|
|
* @param {string} reason
|
|
*/
|
|
constructor(reason) {
|
|
super(true);
|
|
this.registerRequiredCSS('ui/remoteDebuggingTerminatedScreen.css');
|
|
const message = this.contentElement.createChild('div', 'message');
|
|
const reasonElement = message.createChild('span', 'reason');
|
|
reasonElement.textContent = reason;
|
|
message.appendChild(formatLocalized('Debugging connection was closed. Reason: %s', [reasonElement]));
|
|
this.contentElement.createChild('div', 'message').textContent =
|
|
Common.UIString('Reconnect when ready by reopening DevTools.');
|
|
const button = createTextButton(Common.UIString('Reconnect DevTools'), () => window.location.reload());
|
|
this.contentElement.createChild('div', 'button').appendChild(button);
|
|
}
|
|
|
|
/**
|
|
* @param {string} reason
|
|
*/
|
|
static show(reason) {
|
|
const dialog = new Dialog();
|
|
dialog.setSizeBehavior(SizeBehavior.MeasureContent);
|
|
dialog.addCloseButton();
|
|
dialog.setDimmed(true);
|
|
new RemoteDebuggingTerminatedScreen(reason).show(dialog.contentElement);
|
|
dialog.show();
|
|
}
|
|
}
|