mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-11 06:04:55 +08:00
Move and rename files. NOAUTOREVERT=true NOPRESUBMIT=true NOTREECHECKS=true Bug: 768828 TBR=darin@chromium.org NOTRY=true Change-Id: I66d3b155808bc5bdbf237b80208e1e552bcf7f28 Reviewed-on: https://chromium-review.googlesource.com/1001153 Reviewed-by: Blink Reformat <blink-reformat@chromium.org> Commit-Queue: Blink Reformat <blink-reformat@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#549061} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 0aee4434a4dba42a42abaea9bfbc0cd196a63bc1
60 lines
1.6 KiB
JavaScript
60 lines
1.6 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.
|
|
|
|
/**
|
|
* @implements {Protocol.InspectorDispatcher}
|
|
*/
|
|
Components.TargetDetachedDialog = class extends SDK.SDKModel {
|
|
/**
|
|
* @param {!SDK.Target} target
|
|
*/
|
|
constructor(target) {
|
|
super(target);
|
|
if (target.parentTarget())
|
|
return;
|
|
target.registerInspectorDispatcher(this);
|
|
target.inspectorAgent().enable();
|
|
this._hideCrashedDialog = null;
|
|
Components.TargetDetachedDialog._disconnectedScreenWithReasonWasShown = false;
|
|
}
|
|
|
|
/**
|
|
* @override
|
|
* @param {string} reason
|
|
*/
|
|
detached(reason) {
|
|
Components.TargetDetachedDialog._disconnectedScreenWithReasonWasShown = true;
|
|
UI.RemoteDebuggingTerminatedScreen.show(reason);
|
|
}
|
|
|
|
static webSocketConnectionLost() {
|
|
UI.RemoteDebuggingTerminatedScreen.show('WebSocket disconnected');
|
|
}
|
|
|
|
/**
|
|
* @override
|
|
*/
|
|
targetCrashed() {
|
|
const dialog = new UI.Dialog();
|
|
dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent);
|
|
dialog.addCloseButton();
|
|
dialog.setDimmed(true);
|
|
this._hideCrashedDialog = dialog.hide.bind(dialog);
|
|
new UI.TargetCrashedScreen(() => this._hideCrashedDialog = null).show(dialog.contentElement);
|
|
dialog.show();
|
|
}
|
|
|
|
/**
|
|
* @override;
|
|
*/
|
|
targetReloadedAfterCrash() {
|
|
if (this._hideCrashedDialog) {
|
|
this._hideCrashedDialog.call(null);
|
|
this._hideCrashedDialog = null;
|
|
}
|
|
}
|
|
};
|
|
|
|
SDK.SDKModel.register(Components.TargetDetachedDialog, 0, true);
|