cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / resources / chromeos / login / screen_fatal_error.js
blobc1c3ecbfca1b40be6942dc85a7900c78434aaac1
1 // Copyright 2014 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.
5 /**
6 * @fileoverview A simple message box screen implementation.
7 */
9 login.createScreen('FatalErrorScreen', 'fatal-error', function() { return {
10 EXTERNAL_API: [
11 'show'
14 /**
15 * Callback to run when the screen is dismissed.
16 * @type {function()}
18 callback_: null,
20 /**
21 * Saved UI states to restore when this screen hides.
22 * @type {Object}
24 savedUIStates_: {},
26 /** @override */
27 decorate: function() {
28 $('fatal-error-dismiss-button').addEventListener(
29 'click', this.onDismiss_.bind(this));
30 $('fatal-error-card').addEventListener(
31 'buttonclick', this.onDismiss_.bind(this));
34 /** @override */
35 get defaultControl() {
36 if (Oobe.isNewGaiaFlow()) {
37 return $('fatal-error-card').submitButton;
38 } else {
39 return $('fatal-error-dismiss-button');
43 /** @override */
44 onBeforeShow: function() {
45 this.savedUIStates_.progressDotHidden = $('progress-dots').hidden;
46 $('progress-dots').hidden = true;
48 this.savedUIStates_.headerHidden = Oobe.getInstance().headerHidden;
49 Oobe.getInstance().headerHidden = true;
52 /** @override */
53 onBeforeHide: function() {
54 $('progress-dots').hidden = this.savedUIStates_.progressDotHidden;
55 Oobe.getInstance().headerHidden = this.savedUIStates_.headerHidden;
58 /**
59 * Invoked when user clicks on the ok button.
61 onDismiss_: function() {
62 this.callback_();
65 /**
66 * Shows the fatal error string screen.
67 * @param {string} message The error message to show.
68 * @param {function()} callback The callback to be invoked when the
69 * screen is dismissed.
71 show: function(message, buttonLabel, callback) {
72 if (Oobe.isNewGaiaFlow()) {
73 $('fatal-error-card').textContent = message;
74 $('fatal-error-card').buttonLabel = buttonLabel;
75 } else {
76 $('fatal-error-message').textContent = message;
78 this.callback_ = callback;
79 Oobe.showScreen({id: SCREEN_FATAL_ERROR});
82 });