OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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('EncryptionMigrationScreen', 'encryption-migration', | 5 login.createScreen('EncryptionMigrationScreen', 'encryption-migration', |
6 function() { | 6 function() { |
7 return { | 7 return { |
8 EXTERNAL_API: [ | 8 EXTERNAL_API: [ |
9 'setUIState', | 9 'setUIState', |
10 'setMigrationProgress', | 10 'setMigrationProgress', |
11 ], | 11 ], |
12 | 12 |
13 /** | 13 /** |
14 * Ignore any accelerators the user presses on this screen. | 14 * Ignore any accelerators the user presses on this screen. |
15 */ | 15 */ |
16 ignoreAccelerators: true, | 16 ignoreAccelerators: true, |
17 | 17 |
18 /** @override */ | 18 /** @override */ |
19 decorate: function() { | 19 decorate: function() { |
20 var encryptionMigration = $('encryption-migration-element'); | 20 var encryptionMigration = $('encryption-migration-element'); |
21 encryptionMigration.addEventListener('upgrade', function() { | 21 encryptionMigration.addEventListener('upgrade', function() { |
22 chrome.send('startMigration'); | 22 chrome.send('startMigration'); |
23 }); | 23 }); |
| 24 encryptionMigration.addEventListener('skip', function() { |
| 25 chrome.send('skipMigration'); |
| 26 }); |
24 encryptionMigration.addEventListener('restart', function() { | 27 encryptionMigration.addEventListener('restart', function() { |
25 chrome.send('requestRestart'); | 28 chrome.send('requestRestart'); |
26 }); | 29 }); |
27 }, | 30 }, |
28 | 31 |
29 /** | 32 /** |
30 * Event handler that is invoked just before the screen in shown. | 33 * Event handler that is invoked just before the screen in shown. |
31 */ | 34 */ |
32 onBeforeShow: function() { | 35 onBeforeShow: function() { |
33 $('progress-dots').hidden = true; | 36 $('progress-dots').hidden = true; |
(...skipping 15 matching lines...) Expand all Loading... |
49 | 52 |
50 /** | 53 /** |
51 * Updates the migration progress. | 54 * Updates the migration progress. |
52 * @param {number} progress The progress of migration in range [0, 1]. | 55 * @param {number} progress The progress of migration in range [0, 1]. |
53 */ | 56 */ |
54 setMigrationProgress: function(progress) { | 57 setMigrationProgress: function(progress) { |
55 $('encryption-migration-element').progress = progress; | 58 $('encryption-migration-element').progress = progress; |
56 }, | 59 }, |
57 }; | 60 }; |
58 }); | 61 }); |
OLD | NEW |