Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 1 | // 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 | |
Paul Lewis | 17e384e | 2020-01-08 15:46:51 | [diff] [blame] | 5 | import * as Common from '../common/common.js'; |
Paul Lewis | 9950e18 | 2019-12-16 16:06:07 | [diff] [blame] | 6 | import {VBox} from './Widget.js'; |
| 7 | |
| 8 | export class TargetCrashedScreen extends VBox { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 9 | /** |
Tim van der Lippe | 403a88d | 2020-05-13 11:51:32 | [diff] [blame] | 10 | * @param {function():*} hideCallback |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 11 | */ |
| 12 | constructor(hideCallback) { |
| 13 | super(true); |
Jack Franklin | 71519f8 | 2020-11-03 12:08:59 | [diff] [blame^] | 14 | this.registerRequiredCSS('ui/targetCrashedScreen.css', {enableLegacyPatching: true}); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 15 | this.contentElement.createChild('div', 'message').textContent = |
Paul Lewis | 17e384e | 2020-01-08 15:46:51 | [diff] [blame] | 16 | Common.UIString.UIString('DevTools was disconnected from the page.'); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 17 | this.contentElement.createChild('div', 'message').textContent = |
Paul Lewis | 17e384e | 2020-01-08 15:46:51 | [diff] [blame] | 18 | Common.UIString.UIString('Once page is reloaded, DevTools will automatically reconnect.'); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 19 | this._hideCallback = hideCallback; |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @override |
| 24 | */ |
| 25 | willHide() { |
| 26 | this._hideCallback.call(null); |
| 27 | } |
Tim van der Lippe | 0830b3d | 2019-10-03 13:20:07 | [diff] [blame] | 28 | } |