mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-07 04:26:32 +08:00
Trying to upload a CL with missing newlines at the end of files fails with the following warning: These files should end in one (and only one) newline character: Update the ESLint config to let the linter fix these errors. Change-Id: Ia858b5864a1dc43144e0c6d81dedbf46376c2b8d Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1897679 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Commit-Queue: Yang Guo <yangguo@chromium.org> Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org>
71 lines
1.8 KiB
JavaScript
71 lines
1.8 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}
|
|
*/
|
|
export default class TargetDetachedDialog extends SDK.SDKModel {
|
|
/**
|
|
* @param {!SDK.Target} target
|
|
*/
|
|
constructor(target) {
|
|
super(target);
|
|
if (target.parentTarget()) {
|
|
return;
|
|
}
|
|
target.registerInspectorDispatcher(this);
|
|
target.inspectorAgent().enable();
|
|
this._hideCrashedDialog = null;
|
|
TargetDetachedDialog._disconnectedScreenWithReasonWasShown = false;
|
|
}
|
|
|
|
/**
|
|
* @override
|
|
* @param {string} reason
|
|
*/
|
|
detached(reason) {
|
|
TargetDetachedDialog._disconnectedScreenWithReasonWasShown = true;
|
|
UI.RemoteDebuggingTerminatedScreen.show(reason);
|
|
}
|
|
|
|
static webSocketConnectionLost() {
|
|
UI.RemoteDebuggingTerminatedScreen.show(ls`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() {
|
|
this.target().runtimeAgent().runIfWaitingForDebugger();
|
|
if (this._hideCrashedDialog) {
|
|
this._hideCrashedDialog.call(null);
|
|
this._hideCrashedDialog = null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* Legacy exported object */
|
|
self.Components = self.Components || {};
|
|
|
|
/* Legacy exported object */
|
|
Components = Components || {};
|
|
|
|
/** @constructor */
|
|
Components.TargetDetachedDialog = TargetDetachedDialog;
|
|
|
|
SDK.SDKModel.register(TargetDetachedDialog, SDK.Target.Capability.Inspector, true);
|