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 'setIsResuming', | 11 'setIsResuming', |
| 12 'setBatteryPercent', |
12 ], | 13 ], |
13 | 14 |
14 /** | 15 /** |
15 * Ignore any accelerators the user presses on this screen. | 16 * Ignore any accelerators the user presses on this screen. |
16 */ | 17 */ |
17 ignoreAccelerators: true, | 18 ignoreAccelerators: true, |
18 | 19 |
19 /** @override */ | 20 /** @override */ |
20 decorate: function() { | 21 decorate: function() { |
21 var encryptionMigration = $('encryption-migration-element'); | 22 var encryptionMigration = $('encryption-migration-element'); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 }, | 61 }, |
61 | 62 |
62 /** | 63 /** |
63 * Updates the migration screen based on whether the migration process is | 64 * Updates the migration screen based on whether the migration process is |
64 * resuming the previous one. | 65 * resuming the previous one. |
65 * @param {boolean} isResuming | 66 * @param {boolean} isResuming |
66 */ | 67 */ |
67 setIsResuming: function(isResuming) { | 68 setIsResuming: function(isResuming) { |
68 $('encryption-migration-element').isResuming = isResuming; | 69 $('encryption-migration-element').isResuming = isResuming; |
69 }, | 70 }, |
| 71 |
| 72 /** |
| 73 * Updates battery level of the device. |
| 74 * @param {number} batteryPercent Battery level in percent. |
| 75 * @param {boolean} isEnoughBattery True if the battery is enough. |
| 76 */ |
| 77 setBatteryPercent: function(batteryPercent, isEnoughBattery) { |
| 78 $('encryption-migration-element').batteryPercent = |
| 79 Math.floor(batteryPercent); |
| 80 $('encryption-migration-element').isEnoughBattery = isEnoughBattery; |
| 81 }, |
70 }; | 82 }; |
71 }); | 83 }); |
OLD | NEW |