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 /** | 5 /** |
6 * @fileoverview Polymer element for displaying encryption migration screen. | 6 * @fileoverview Polymer element for displaying encryption migration screen. |
7 */ | 7 */ |
8 | 8 |
9 /** | 9 /** |
10 * Enum for the UI states corresponding to sub steps inside migration screen. | 10 * Enum for the UI states corresponding to sub steps inside migration screen. |
(...skipping 12 matching lines...) Expand all Loading... |
23 Polymer({ | 23 Polymer({ |
24 is: 'encryption-migration', | 24 is: 'encryption-migration', |
25 | 25 |
26 behaviors: [I18nBehavior], | 26 behaviors: [I18nBehavior], |
27 | 27 |
28 properties: { | 28 properties: { |
29 /** | 29 /** |
30 * Current UI state which corresponds to a sub step in migration process. | 30 * Current UI state which corresponds to a sub step in migration process. |
31 * @type {EncryptionMigrationUIState} | 31 * @type {EncryptionMigrationUIState} |
32 */ | 32 */ |
33 uiState: { | 33 uiState: {type: Number, value: 0}, |
34 type: Number, | |
35 value: 0 | |
36 }, | |
37 | 34 |
38 /** | 35 /** |
39 * Current migration progress in range [0, 1]. Negative value means that | 36 * Current migration progress in range [0, 1]. Negative value means that |
40 * the progress is unknown. | 37 * the progress is unknown. |
41 */ | 38 */ |
42 progress: { | 39 progress: {type: Number, value: -1}, |
43 type: Number, | |
44 value: -1 | |
45 }, | |
46 | 40 |
47 /** | 41 /** |
48 * Whether the current migration is resuming the previous one. | 42 * Whether the current migration is resuming the previous one. |
49 */ | 43 */ |
50 isResuming: { | 44 isResuming: {type: Boolean, value: false}, |
51 type: Boolean, | |
52 value: false | |
53 }, | |
54 | 45 |
55 /** | 46 /** |
56 * Battery level. | 47 * Battery level. |
57 */ | 48 */ |
58 batteryPercent: { | 49 batteryPercent: {type: Number, value: 0}, |
59 type: Number, | |
60 value: 0 | |
61 }, | |
62 | 50 |
63 /** | 51 /** |
64 * True if the battery level is enough to start migration. | 52 * True if the battery level is enough to start migration. |
65 */ | 53 */ |
66 isEnoughBattery: { | 54 isEnoughBattery: {type: Boolean, value: true}, |
67 type: Boolean, | |
68 value: true | |
69 }, | |
70 | 55 |
71 /** | 56 /** |
72 * True if the device is charging. | 57 * True if the device is charging. |
73 */ | 58 */ |
74 isCharging: { | 59 isCharging: {type: Boolean, value: false}, |
75 type: Boolean, | |
76 value: false | |
77 }, | |
78 | 60 |
79 /** | 61 /** |
80 * Formatted string of the current available space size. | 62 * Formatted string of the current available space size. |
81 */ | 63 */ |
82 availableSpaceInString: { | 64 availableSpaceInString: {type: String, value: ''}, |
83 type: String, | |
84 value: '' | |
85 }, | |
86 | 65 |
87 /** | 66 /** |
88 * Formatted string of the necessary space size for migration. | 67 * Formatted string of the necessary space size for migration. |
89 */ | 68 */ |
90 necessarySpaceInString: { | 69 necessarySpaceInString: {type: String, value: ''}, |
91 type: String, | |
92 value: '' | |
93 }, | |
94 }, | 70 }, |
95 | 71 |
96 /** | 72 /** |
97 * Returns true if the migration is in initial state. | 73 * Returns true if the migration is in initial state. |
98 * @param {EncryptionMigrationUIState} state Current UI state | 74 * @param {EncryptionMigrationUIState} state Current UI state |
99 * @private | 75 * @private |
100 */ | 76 */ |
101 isInitial_: function(state) { | 77 isInitial_: function(state) { |
102 return state == EncryptionMigrationUIState.INITIAL; | 78 return state == EncryptionMigrationUIState.INITIAL; |
103 }, | 79 }, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 }, | 205 }, |
230 | 206 |
231 /** | 207 /** |
232 * Handles tap on REPORT AN ISSUE button. | 208 * Handles tap on REPORT AN ISSUE button. |
233 * @private | 209 * @private |
234 */ | 210 */ |
235 onReportAnIssue_: function() { | 211 onReportAnIssue_: function() { |
236 this.fire('openFeedbackDialog'); | 212 this.fire('openFeedbackDialog'); |
237 }, | 213 }, |
238 }); | 214 }); |
OLD | NEW |