Index: chrome/browser/resources/chromeos/login/screen_fatal_error.js |
diff --git a/chrome/browser/resources/chromeos/login/screen_message_box.js b/chrome/browser/resources/chromeos/login/screen_fatal_error.js |
similarity index 51% |
rename from chrome/browser/resources/chromeos/login/screen_message_box.js |
rename to chrome/browser/resources/chromeos/login/screen_fatal_error.js |
index b7bd21b42301deac1e0b0ae6f4c417e83614b850..dc0332f1ebed9194f42df43824cb8b1152db15cc 100644 |
--- a/chrome/browser/resources/chromeos/login/screen_message_box.js |
+++ b/chrome/browser/resources/chromeos/login/screen_fatal_error.js |
@@ -6,7 +6,7 @@ |
* @fileoverview A simple message box screen implementation. |
*/ |
-login.createScreen('MessageBoxScreen', 'message-box', function() { return { |
+login.createScreen('FatalErrorScreen', 'fatal-error', function() { return { |
EXTERNAL_API: [ |
'show' |
], |
@@ -18,33 +18,19 @@ login.createScreen('MessageBoxScreen', 'message-box', function() { return { |
callback_: null, |
/** |
- * Ok button of the message box. |
- * @type {HTMLButtonElement} |
- */ |
- okButton_: null, |
- |
- /** |
* Saved hidden status of 'progress-dots'. |
* @type {boolean} |
*/ |
savedProgressDotsHidden_: null, |
- /** |
- * Screen controls in bottom strip. |
- * @type {Array.<HTMLButtonElement>} Buttons to be put in the bottom strip. |
- */ |
- get buttons() { |
- var buttons = []; |
- |
- this.okButton_ = this.ownerDocument.createElement('button'); |
- this.okButton_.addEventListener('click', this.onDismiss_.bind(this)); |
- buttons.push(this.okButton_); |
- |
- return buttons; |
+ /** @override */ |
+ decorate: function() { |
+ $('fatal-error-dismiss-button').addEventListener( |
+ 'click', this.onDismiss_.bind(this)); |
}, |
get defaultControl() { |
- return this.okButton_; |
+ return $('fatal-error-dismiss-button'); |
}, |
/** |
@@ -57,19 +43,14 @@ login.createScreen('MessageBoxScreen', 'message-box', function() { return { |
/** |
* Shows the no password warning screen. |
- * @param {string} title Title string of the message box. |
- * @param {string} message Body text of the message box. |
- * @param {string} okLabel Label text for the okay button. |
* @param {function()} callback The callback to be invoked when the |
* screen is dismissed. |
*/ |
- show: function(title, message, okLabel, callback) { |
- $('message-box-title').textContent = title; |
- $('message-box-body').textContent = message; |
- this.okButton_.textContent = okLabel; |
+ show: function(callback) { |
+ Oobe.getInstance().headerHidden = true; |
Nikita (slow)
2014/02/06 05:08:25
nit: When does this header will be restored if we
xiyuan
2014/02/06 05:46:05
Right now it is okay because we always go back to
|
this.callback_ = callback; |
- Oobe.showScreen({id: SCREEN_MESSAGE_BOX}); |
+ Oobe.showScreen({id: SCREEN_FATAL_ERROR}); |
this.savedProgressDotsHidden_ = $('progress-dots').hidden; |
$('progress-dots').hidden = true; |