Files
react-native-devtools-frontend/front_end/ui/RemoteDebuggingTerminatedScreen.js
T
Jack Franklin 71519f8efb Introduce enableLegacyPatching flag for CSS patching
As part of the dark mode migration we are adding
`enableLegacyPatching:true` to all call sites of `appendStyle` (and
related methods). If a user passes `false` for that flag, no CSS colour
patching will occur.

This CL is therefore a no-op from a user's perspective as we pass `true`
on every call to maintain existing behaviour, but once we start
migrating we will turn the option to `false`. Long term, once all code
is migrated and the old patching is removed, we will remove this flag
entirely once again.

Bug: 1122511
Change-Id: I76b818e83b7d5ee0175e1548759373f53481e0ab
No-Presubmit: True
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2516345
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-03 14:11:46 +00:00

40 lines
1.5 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 * as Common from '../common/common.js';
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', {enableLegacyPatching: true});
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.UIString('Reconnect when ready by reopening DevTools.');
const button = createTextButton(Common.UIString.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();
}
}