[go: nahoru, domu]

blob: f165730663d89f88b9b72a3dfe06ad8b9841f6c0 [file] [log] [blame]
Blink Reformat4c46d092018-04-07 15:32:371// Copyright 2018 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Tim van der Lippeaa61faf2021-04-07 15:32:075import * as i18n from '../../core/i18n/i18n.js';
Vidal Guillermo Diazleal Ortega9b0bc5b2021-02-22 22:12:046
Paul Lewis9950e182019-12-16 16:06:077import {VBox} from './Widget.js';
8
Simon Zündf6afbca2021-03-02 06:11:149const UIStrings = {
Vidal Guillermo Diazleal Ortega9b0bc5b2021-02-22 22:12:0410 /**
11 *@description Text in dialog box when the target page crashed
12 */
13 devtoolsWasDisconnectedFromThe: 'DevTools was disconnected from the page.',
14 /**
15 *@description Text content of content element
16 */
17 oncePageIsReloadedDevtoolsWill: 'Once page is reloaded, DevTools will automatically reconnect.',
18};
Tim van der Lippeaa61faf2021-04-07 15:32:0719const str_ = i18n.i18n.registerUIStrings('ui/legacy/TargetCrashedScreen.ts', UIStrings);
Vidal Guillermo Diazleal Ortega9b0bc5b2021-02-22 22:12:0420const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
Paul Lewis9950e182019-12-16 16:06:0721export class TargetCrashedScreen extends VBox {
Jan Scheffler01eab3c2021-08-16 17:18:0722 private readonly hideCallback: () => void;
Jan Schefflercef78292021-03-29 18:19:3523 constructor(hideCallback: () => void) {
Blink Reformat4c46d092018-04-07 15:32:3724 super(true);
Jack Franklin84442c62021-06-28 15:02:0625 this.registerRequiredCSS('ui/legacy/targetCrashedScreen.css');
Blink Reformat4c46d092018-04-07 15:32:3726 this.contentElement.createChild('div', 'message').textContent =
Vidal Guillermo Diazleal Ortega9b0bc5b2021-02-22 22:12:0427 i18nString(UIStrings.devtoolsWasDisconnectedFromThe);
Blink Reformat4c46d092018-04-07 15:32:3728 this.contentElement.createChild('div', 'message').textContent =
Vidal Guillermo Diazleal Ortega9b0bc5b2021-02-22 22:12:0429 i18nString(UIStrings.oncePageIsReloadedDevtoolsWill);
Jan Scheffler01eab3c2021-08-16 17:18:0730 this.hideCallback = hideCallback;
Blink Reformat4c46d092018-04-07 15:32:3731 }
32
Jan Schefflercef78292021-03-29 18:19:3533 willHide(): void {
Jan Scheffler01eab3c2021-08-16 17:18:0734 this.hideCallback.call(null);
Blink Reformat4c46d092018-04-07 15:32:3735 }
Tim van der Lippe0830b3d2019-10-03 13:20:0736}