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.
6 * @fileoverview A simple message box screen implementation.
9 login.createScreen('FatalErrorScreen', 'fatal-error', function() { return {
15 * Callback to run when the screen is dismissed.
21 * Saved UI states to restore when this screen hides.
27 decorate: function() {
28 $('fatal-error-dismiss-button').addEventListener(
29 'click', this.onDismiss_.bind(this));
33 get defaultControl() {
34 return $('fatal-error-dismiss-button');
38 onBeforeShow: function() {
39 this.savedUIStates_.progressDotHidden = $('progress-dots').hidden;
40 $('progress-dots').hidden = true;
42 this.savedUIStates_.headerHidden = Oobe.getInstance().headerHidden;
43 Oobe.getInstance().headerHidden = true;
47 onBeforeHide: function() {
48 $('progress-dots').hidden = this.savedUIStates_.progressDotHidden;
49 Oobe.getInstance().headerHidden = this.savedUIStates_.headerHidden;
53 * Invoked when user clicks on the ok button.
55 onDismiss_: function() {
60 * Shows the fatal error string screen.
61 * @param {string} message The error message to show.
62 * @param {function()} callback The callback to be invoked when the
63 * screen is dismissed.
65 show: function(message, callback) {
66 $('fatal-error-message').textContent = message;
67 this.callback_ = callback;
68 Oobe.showScreen({id: SCREEN_FATAL_ERROR});