Chromium Code Reviews| 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', |
| 11 | 11 |
| 12 properties: { | 12 properties: { |
| 13 /** | 13 /** |
| 14 * Currently selected system language. | 14 * Currently selected system language (display name). |
| 15 */ | 15 */ |
| 16 currentLanguage: { | 16 currentLanguage: { |
| 17 type: String, | 17 type: String, |
| 18 value: 'English (US)', | 18 value: '', |
| 19 }, | 19 }, |
| 20 | 20 |
| 21 /** | 21 /** |
| 22 * Flag that switches Welcome screen to Network Selection screen. | 22 * List of languages for language selector dropdown. |
| 23 * @type {!Array<OobeTypes.LanguageDsc>} | |
| 24 */ | |
| 25 languages: { | |
| 26 type: Array, | |
| 27 }, | |
| 28 | |
| 29 /** | |
| 30 * List of keyboards for keyboard selector dropdown. | |
| 31 * @type {!Array<OobeTypes.IMEDsc>} | |
| 32 */ | |
| 33 keyboards: { | |
| 34 type: Array, | |
| 35 }, | |
| 36 | |
| 37 /** | |
| 38 * Flag that shows Welcome screen. | |
| 39 */ | |
| 40 welcomeScreenShown: { | |
| 41 type: Boolean, | |
| 42 value: true, | |
| 43 }, | |
| 44 | |
| 45 /** | |
| 46 * Flag that shows Language Selection screen. | |
| 47 */ | |
| 48 languageSelectionScreenShown: { | |
| 49 type: Boolean, | |
| 50 value: false, | |
| 51 }, | |
| 52 | |
| 53 /** | |
| 54 * Flag that shows Network Selection screen. | |
| 23 */ | 55 */ |
| 24 networkSelectionScreenShown: { | 56 networkSelectionScreenShown: { |
| 25 type: Boolean, | 57 type: Boolean, |
| 26 value: false, | 58 value: false, |
| 27 }, | 59 }, |
| 60 | |
| 61 /** | |
| 62 * Flag that enables MD-OOBE. | |
|
michaelpg
2016/08/04 07:56:45
Can you explain more what this does? If this is th
| |
| 63 */ | |
| 64 enabled: { | |
| 65 type: Boolean, | |
| 66 value: false, | |
| 67 }, | |
| 28 }, | 68 }, |
| 29 | 69 |
| 30 /** | 70 /** |
| 71 * Hides all screens to help switching from one screen to another. | |
| 72 */ | |
| 73 hideAllScreens_: function() { | |
| 74 this.welcomeScreenShown = false; | |
| 75 this.networkSelectionScreenShown = false; | |
| 76 this.languageSelectionScreenShown = false; | |
| 77 }, | |
| 78 | |
| 79 /** | |
| 31 * GUID of the user-selected network. It is remembered after user taps on | 80 * GUID of the user-selected network. It is remembered after user taps on |
| 32 * network entry. After we receive event "connected" on this network, | 81 * network entry. After we receive event "connected" on this network, |
| 33 * OOBE will proceed. | 82 * OOBE will proceed. |
| 34 */ | 83 */ |
| 35 networkLastSelectedGuid_: '', | 84 networkLastSelectedGuid_: '', |
| 36 | 85 |
| 37 /** | 86 /** |
| 38 * Sets proper focus. | 87 * Sets proper focus. |
| 39 */ | 88 */ |
| 40 focus: function() { | 89 focus: function() { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 }, | 127 }, |
| 79 ]; | 128 ]; |
| 80 }, | 129 }, |
| 81 | 130 |
| 82 /** | 131 /** |
| 83 * Handle "Next" button for "Welcome" screen. | 132 * Handle "Next" button for "Welcome" screen. |
| 84 * | 133 * |
| 85 * @private | 134 * @private |
| 86 */ | 135 */ |
| 87 onWelcomeNextButtonClicked_: function() { | 136 onWelcomeNextButtonClicked_: function() { |
| 137 this.hideAllScreens_(); | |
| 88 this.networkSelectionScreenShown = true; | 138 this.networkSelectionScreenShown = true; |
| 89 }, | 139 }, |
| 90 | 140 |
| 91 /** | 141 /** |
| 142 * Handle "Language" button for "Welcome" screen. | |
| 143 * | |
| 144 * @private | |
| 145 */ | |
| 146 onWelcomeSelectLanguageButtonClicked_: function() { | |
| 147 this.hideAllScreens_(); | |
| 148 this.languageSelectionScreenShown = true; | |
| 149 }, | |
| 150 | |
| 151 /** | |
| 92 * Handle Networwork Setup screen "Proxy settings" button. | 152 * Handle Networwork Setup screen "Proxy settings" button. |
| 93 * | 153 * |
| 94 * @private | 154 * @private |
| 95 */ | 155 */ |
| 96 OpenProxySettingsDialog_: function(item) { | 156 OpenProxySettingsDialog_: function(item) { |
| 97 chrome.send('launchProxySettingsDialog'); | 157 chrome.send('launchProxySettingsDialog'); |
| 98 }, | 158 }, |
| 99 | 159 |
| 100 /** | 160 /** |
| 101 * Handle Networwork Setup screen "Add WiFi network" button. | 161 * Handle Networwork Setup screen "Add WiFi network" button. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 return; | 233 return; |
| 174 } | 234 } |
| 175 | 235 |
| 176 if (lastError.message != 'connecting') | 236 if (lastError.message != 'connecting') |
| 177 console.error('networkingPrivate.startConnect error: ' + lastError); | 237 console.error('networkingPrivate.startConnect error: ' + lastError); |
| 178 }); | 238 }); |
| 179 }, | 239 }, |
| 180 | 240 |
| 181 /** | 241 /** |
| 182 * @param {!Event} event | 242 * @param {!Event} event |
| 243 * @private | |
| 183 */ | 244 */ |
| 184 onNetworkListCustomItemSelected_: function(e) { | 245 onNetworkListCustomItemSelected_: function(e) { |
| 185 var itemState = e.detail; | 246 var itemState = e.detail; |
| 186 itemState.customData.onTap(); | 247 itemState.customData.onTap(); |
| 187 }, | 248 }, |
| 249 | |
| 250 /** | |
| 251 * Handle language selection. | |
| 252 * | |
| 253 * @param {!{detail: {!OobeTypes.LanguageDsc}}} event | |
| 254 * @private | |
| 255 */ | |
| 256 onLanguageSelected_: function(event) { | |
| 257 var item = event.detail; | |
| 258 var languageId = item.value; | |
| 259 this.screen.onLanguageSelected_(languageId); | |
| 260 }, | |
| 261 | |
| 262 /** | |
| 263 * Handle keyboard layout selection. | |
| 264 * | |
| 265 * @param {!{detail: {!OobeTypes.IMEDsc}}} event | |
| 266 * @private | |
| 267 */ | |
| 268 onKeyboardSelected_: function(event) { | |
| 269 var item = event.detail; | |
| 270 var inputMethodId = item.value; | |
| 271 this.screen.onKeyboardSelected_(inputMethodId); | |
| 272 }, | |
| 273 | |
| 274 /** | |
| 275 * Handle "OK" button for "LanguageSelection" screen. | |
| 276 * | |
| 277 * @private | |
| 278 */ | |
| 279 closeLanguageSection_: function() { | |
| 280 this.hideAllScreens_(); | |
| 281 this.welcomeScreenShown = true; | |
| 282 }, | |
| 188 }); | 283 }); |
| OLD | NEW |