| 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 /** | 5 /** |
| 6 * @fileoverview Polymer element for displaying material design OOBE. | 6 * @fileoverview Polymer element for displaying material design OOBE. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'oobe-welcome-md', | 10 is: 'oobe-welcome-md', |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 /** | 53 /** |
| 54 * Flag that shows Accessibility Options screen. | 54 * Flag that shows Accessibility Options screen. |
| 55 */ | 55 */ |
| 56 accessibilityOptionsScreenShown: { | 56 accessibilityOptionsScreenShown: { |
| 57 type: Boolean, | 57 type: Boolean, |
| 58 value: false, | 58 value: false, |
| 59 }, | 59 }, |
| 60 | 60 |
| 61 /** | 61 /** |
| 62 * Flag that shows Timezone Selection screen. |
| 63 */ |
| 64 timezoneScreenShown: { |
| 65 type: Boolean, |
| 66 value: false, |
| 67 }, |
| 68 |
| 69 /** |
| 62 * Flag that shows Network Selection screen. | 70 * Flag that shows Network Selection screen. |
| 63 */ | 71 */ |
| 64 networkSelectionScreenShown: { | 72 networkSelectionScreenShown: { |
| 65 type: Boolean, | 73 type: Boolean, |
| 66 value: false, | 74 value: false, |
| 67 }, | 75 }, |
| 68 | 76 |
| 69 /** | 77 /** |
| 70 * Flag that enables MD-OOBE. | 78 * Flag that enables MD-OOBE. |
| 71 */ | 79 */ |
| 72 enabled: { | 80 enabled: { |
| 73 type: Boolean, | 81 type: Boolean, |
| 74 value: false, | 82 value: false, |
| 75 }, | 83 }, |
| 76 | 84 |
| 77 /** | 85 /** |
| 78 * Accessibility options status. | 86 * Accessibility options status. |
| 79 * @type {!OobeTypes.A11yStatuses} | 87 * @type {!OobeTypes.A11yStatuses} |
| 80 */ | 88 */ |
| 81 a11yStatus: { | 89 a11yStatus: { |
| 82 type: Object, | 90 type: Object, |
| 83 }, | 91 }, |
| 92 |
| 93 /** |
| 94 * A list of timezones for Timezone Selection screen. |
| 95 * @type {!Array<OobeTypes.TimezoneDsc>} |
| 96 */ |
| 97 timezones: { |
| 98 type: Object, |
| 99 value: [], |
| 100 }, |
| 101 |
| 102 /** |
| 103 * If UI uses forced keyboard navigation. |
| 104 */ |
| 105 highlightStrength: { |
| 106 type: String, |
| 107 value: '', |
| 108 }, |
| 84 }, | 109 }, |
| 85 | 110 |
| 86 /** | 111 /** |
| 87 * Hides all screens to help switching from one screen to another. | 112 * Hides all screens to help switching from one screen to another. |
| 88 */ | 113 */ |
| 89 hideAllScreens_: function() { | 114 hideAllScreens_: function() { |
| 90 this.welcomeScreenShown = false; | 115 this.welcomeScreenShown = false; |
| 91 this.networkSelectionScreenShown = false; | 116 this.networkSelectionScreenShown = false; |
| 92 this.languageSelectionScreenShown = false; | 117 this.languageSelectionScreenShown = false; |
| 93 this.accessibilityOptionsScreenShown = false; | 118 this.accessibilityOptionsScreenShown = false; |
| 119 this.timezoneScreenShown = false; |
| 94 }, | 120 }, |
| 95 | 121 |
| 96 /** | 122 /** |
| 97 * GUID of the user-selected network. It is remembered after user taps on | 123 * GUID of the user-selected network. It is remembered after user taps on |
| 98 * network entry. After we receive event "connected" on this network, | 124 * network entry. After we receive event "connected" on this network, |
| 99 * OOBE will proceed. | 125 * OOBE will proceed. |
| 100 */ | 126 */ |
| 101 networkLastSelectedGuid_: '', | 127 networkLastSelectedGuid_: '', |
| 102 | 128 |
| 103 /** | 129 /** |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 customItemName: 'addMobileNetworkMenuName', | 165 customItemName: 'addMobileNetworkMenuName', |
| 140 polymerIcon: 'oobe-welcome-20:add-cellular', | 166 polymerIcon: 'oobe-welcome-20:add-cellular', |
| 141 customData: { | 167 customData: { |
| 142 onTap: function() { self.OpenAddWiFiNetworkDialog_(); }, | 168 onTap: function() { self.OpenAddWiFiNetworkDialog_(); }, |
| 143 }, | 169 }, |
| 144 }, | 170 }, |
| 145 ]; | 171 ]; |
| 146 }, | 172 }, |
| 147 | 173 |
| 148 /** | 174 /** |
| 175 * Returns true if timezone button should be visible. |
| 176 * @private |
| 177 */ |
| 178 isTimezoneButtonVisible_: function(highlightStrength) { |
| 179 return highlightStrength === 'strong'; |
| 180 }, |
| 181 |
| 182 /** |
| 149 * Handle "Next" button for "Welcome" screen. | 183 * Handle "Next" button for "Welcome" screen. |
| 150 * | 184 * |
| 151 * @private | 185 * @private |
| 152 */ | 186 */ |
| 153 onWelcomeNextButtonClicked_: function() { | 187 onWelcomeNextButtonClicked_: function() { |
| 154 this.hideAllScreens_(); | 188 this.hideAllScreens_(); |
| 155 this.networkSelectionScreenShown = true; | 189 this.networkSelectionScreenShown = true; |
| 156 }, | 190 }, |
| 157 | 191 |
| 158 /** | 192 /** |
| (...skipping 10 matching lines...) Expand all Loading... |
| 169 * Handle "Accessibility" button for "Welcome" screen. | 203 * Handle "Accessibility" button for "Welcome" screen. |
| 170 * | 204 * |
| 171 * @private | 205 * @private |
| 172 */ | 206 */ |
| 173 onWelcomeAccessibilityButtonClicked_: function() { | 207 onWelcomeAccessibilityButtonClicked_: function() { |
| 174 this.hideAllScreens_(); | 208 this.hideAllScreens_(); |
| 175 this.accessibilityOptionsScreenShown = true; | 209 this.accessibilityOptionsScreenShown = true; |
| 176 }, | 210 }, |
| 177 | 211 |
| 178 /** | 212 /** |
| 213 * Handle "Timezone" button for "Welcome" screen. |
| 214 * |
| 215 * @private |
| 216 */ |
| 217 onWelcomeTimezoneButtonClicked_: function() { |
| 218 this.hideAllScreens_(); |
| 219 this.timezoneScreenShown = true; |
| 220 }, |
| 221 |
| 222 /** |
| 179 * Handle Networwork Setup screen "Proxy settings" button. | 223 * Handle Networwork Setup screen "Proxy settings" button. |
| 180 * | 224 * |
| 181 * @private | 225 * @private |
| 182 */ | 226 */ |
| 183 OpenProxySettingsDialog_: function(item) { | 227 OpenProxySettingsDialog_: function(item) { |
| 184 chrome.send('launchProxySettingsDialog'); | 228 chrome.send('launchProxySettingsDialog'); |
| 185 }, | 229 }, |
| 186 | 230 |
| 187 /** | 231 /** |
| 188 * Handle Networwork Setup screen "Add WiFi network" button. | 232 * Handle Networwork Setup screen "Add WiFi network" button. |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 * Note that each <oobe-a11y-option> has chromeMessage attribute | 382 * Note that each <oobe-a11y-option> has chromeMessage attribute |
| 339 * containing Chromium callback name. | 383 * containing Chromium callback name. |
| 340 * | 384 * |
| 341 * @private | 385 * @private |
| 342 * @param {!Event} event | 386 * @param {!Event} event |
| 343 */ | 387 */ |
| 344 onA11yOptionChanged_: function(event) { | 388 onA11yOptionChanged_: function(event) { |
| 345 chrome.send( | 389 chrome.send( |
| 346 event.currentTarget.chromeMessage, [event.currentTarget.checked]); | 390 event.currentTarget.chromeMessage, [event.currentTarget.checked]); |
| 347 }, | 391 }, |
| 392 |
| 393 /** ******************** Timezone section ******************* */ |
| 394 |
| 395 /** |
| 396 * Handle "OK" button for "Timezone Selection" screen. |
| 397 * |
| 398 * @private |
| 399 */ |
| 400 closeTimezoneSection_: function() { |
| 401 this.hideAllScreens_(); |
| 402 this.welcomeScreenShown = true; |
| 403 }, |
| 404 |
| 405 /** |
| 406 * Handle timezone selection. |
| 407 * |
| 408 * @param {!{detail: {!OobeTypes.Timezone}}} event |
| 409 * @private |
| 410 */ |
| 411 onTimezoneSelected_: function(event) { |
| 412 var item = event.detail; |
| 413 if (!item) |
| 414 return; |
| 415 |
| 416 this.screen.onTimezoneSelected_(item.value); |
| 417 }, |
| 348 }); | 418 }); |
| OLD | NEW |