| 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 'setBatteryState', |
| 13 'setAvailableSpaceInString', |
| 14 'setNecessarySpaceInString', |
| 13 ], | 15 ], |
| 14 | 16 |
| 15 /** | 17 /** |
| 16 * Ignore any accelerators the user presses on this screen. | 18 * Ignore any accelerators the user presses on this screen. |
| 17 */ | 19 */ |
| 18 ignoreAccelerators: true, | 20 ignoreAccelerators: true, |
| 19 | 21 |
| 20 /** @override */ | 22 /** @override */ |
| 21 decorate: function() { | 23 decorate: function() { |
| 22 var encryptionMigration = $('encryption-migration-element'); | 24 var encryptionMigration = $('encryption-migration-element'); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 * @param {boolean} isResuming | 68 * @param {boolean} isResuming |
| 67 */ | 69 */ |
| 68 setIsResuming: function(isResuming) { | 70 setIsResuming: function(isResuming) { |
| 69 $('encryption-migration-element').isResuming = isResuming; | 71 $('encryption-migration-element').isResuming = isResuming; |
| 70 }, | 72 }, |
| 71 | 73 |
| 72 /** | 74 /** |
| 73 * Updates battery level of the device. | 75 * Updates battery level of the device. |
| 74 * @param {number} batteryPercent Battery level in percent. | 76 * @param {number} batteryPercent Battery level in percent. |
| 75 * @param {boolean} isEnoughBattery True if the battery is enough. | 77 * @param {boolean} isEnoughBattery True if the battery is enough. |
| 78 * @param {boolena} isCharging True if the device is connected to power. |
| 76 */ | 79 */ |
| 77 setBatteryPercent: function(batteryPercent, isEnoughBattery) { | 80 setBatteryState: function(batteryPercent, isEnoughBattery, isCharging) { |
| 78 $('encryption-migration-element').batteryPercent = | 81 var element = $('encryption-migration-element'); |
| 79 Math.floor(batteryPercent); | 82 element.batteryPercent = Math.floor(batteryPercent); |
| 80 $('encryption-migration-element').isEnoughBattery = isEnoughBattery; | 83 element.isEnoughBattery = isEnoughBattery; |
| 84 element.isCharging = isCharging; |
| 85 }, |
| 86 |
| 87 /** |
| 88 * Updates the string representation of available space size. |
| 89 * @param {string} space |
| 90 */ |
| 91 setAvailableSpaceInString: function(space) { |
| 92 $('encryption-migration-element').availableSpaceInString = space; |
| 93 }, |
| 94 |
| 95 /** |
| 96 * Updates the string representation of necessary space size. |
| 97 * @param {string} space |
| 98 */ |
| 99 setNecessarySpaceInString: function(space) { |
| 100 $('encryption-migration-element').necessarySpaceInString = space; |
| 81 }, | 101 }, |
| 82 }; | 102 }; |
| 83 }); | 103 }); |
| OLD | NEW |