OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 login.createScreen('UnrecoverableCryptohomeErrorScreen', | 5 login.createScreen( |
6 'unrecoverable-cryptohome-error', function() { | 6 'UnrecoverableCryptohomeErrorScreen', 'unrecoverable-cryptohome-error', |
7 return { | 7 function() { |
8 EXTERNAL_API: [ | 8 return { |
9 'show', | 9 EXTERNAL_API: ['show', 'resumeAfterFeedbackUI'], |
10 'resumeAfterFeedbackUI' | |
11 ], | |
12 | 10 |
13 /** @override */ | 11 /** @override */ |
14 decorate: function() { | 12 decorate: function() { |
15 this.card_ = $('unrecoverable-cryptohome-error-card'); | 13 this.card_ = $('unrecoverable-cryptohome-error-card'); |
16 this.throbber_ = $('unrecoverable-cryptohome-error-busy'); | 14 this.throbber_ = $('unrecoverable-cryptohome-error-busy'); |
17 | 15 |
18 this.card_.addEventListener('done', function(e) { | 16 this.card_.addEventListener('done', function(e) { |
19 this.setLoading_(true); | 17 this.setLoading_(true); |
20 $('oobe').hidden = true; // Hide while showing the feedback UI. | 18 $('oobe').hidden = true; // Hide while showing the feedback UI. |
21 chrome.send('sendFeedbackAndResyncUserData'); | 19 chrome.send('sendFeedbackAndResyncUserData'); |
22 }.bind(this)); | 20 }.bind(this)); |
23 }, | 21 }, |
24 | 22 |
25 /** | 23 /** |
26 * Sets whether to show the loading throbber. | 24 * Sets whether to show the loading throbber. |
27 * @param {boolean} loading | 25 * @param {boolean} loading |
28 */ | 26 */ |
29 setLoading_: function(loading) { | 27 setLoading_: function(loading) { |
30 this.card_.hidden = loading; | 28 this.card_.hidden = loading; |
31 this.throbber_.hidden = !loading; | 29 this.throbber_.hidden = !loading; |
32 }, | 30 }, |
33 | 31 |
34 /** | 32 /** |
35 * Show the unrecoverable cryptohome error screen to ask user permission | 33 * Show the unrecoverable cryptohome error screen to ask user permission |
36 * to collect a feedback report. | 34 * to collect a feedback report. |
37 */ | 35 */ |
38 show: function() { | 36 show: function() { |
39 this.setLoading_(false); | 37 this.setLoading_(false); |
40 | 38 |
41 Oobe.getInstance().headerHidden = true; | 39 Oobe.getInstance().headerHidden = true; |
42 Oobe.showScreen({id: SCREEN_UNRECOVERABLE_CRYPTOHOME_ERROR}); | 40 Oobe.showScreen({id: SCREEN_UNRECOVERABLE_CRYPTOHOME_ERROR}); |
43 }, | 41 }, |
44 | 42 |
45 /** | 43 /** |
46 * Shows the loading UI after the feedback UI is dismissed. | 44 * Shows the loading UI after the feedback UI is dismissed. |
47 */ | 45 */ |
48 resumeAfterFeedbackUI: function() { | 46 resumeAfterFeedbackUI: function() { |
49 $('oobe').hidden = false; | 47 $('oobe').hidden = false; |
50 } | 48 } |
51 }; | 49 }; |
52 }); | 50 }); |
OLD | NEW |