| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 /** | 190 /** |
| 191 * Handles "visible" event. | 191 * Handles "visible" event. |
| 192 * @private | 192 * @private |
| 193 */ | 193 */ |
| 194 onAnimationFinish_: function() { | 194 onAnimationFinish_: function() { |
| 195 this.focus(); | 195 this.focus(); |
| 196 }, | 196 }, |
| 197 | 197 |
| 198 /** | 198 /** |
| 199 * Returns custom items for network selector. | 199 * Returns custom items for network selector. Shows 'Proxy settings' only |
| 200 * when connected to a network. |
| 200 * @private | 201 * @private |
| 201 */ | 202 */ |
| 202 getNetworkCustomItems_: function() { | 203 getNetworkCustomItems_: function(isConnected_) { |
| 203 var self = this; | 204 var self = this; |
| 204 return [ | 205 var items = [ |
| 205 { | 206 { |
| 206 customItemName: 'proxySettingsMenuName', | 207 customItemName: 'proxySettingsMenuName', |
| 207 polymerIcon: 'oobe-welcome-20:add-proxy', | 208 polymerIcon: 'oobe-welcome-20:add-proxy', |
| 208 customData: { | 209 customData: { |
| 209 onTap: function() { self.OpenProxySettingsDialog_(); }, | 210 onTap: function() { self.OpenProxySettingsDialog_(); }, |
| 210 }, | 211 }, |
| 211 }, | 212 }, |
| 212 { | 213 { |
| 213 customItemName: 'addWiFiNetworkMenuName', | 214 customItemName: 'addWiFiNetworkMenuName', |
| 214 polymerIcon: 'oobe-welcome-20:add-wifi', | 215 polymerIcon: 'oobe-welcome-20:add-wifi', |
| 215 customData: { | 216 customData: { |
| 216 onTap: function() { self.OpenAddWiFiNetworkDialog_(); }, | 217 onTap: function() { self.OpenAddWiFiNetworkDialog_(); }, |
| 217 }, | 218 }, |
| 218 }, | 219 }, |
| 219 { | 220 { |
| 220 customItemName: 'addMobileNetworkMenuName', | 221 customItemName: 'addMobileNetworkMenuName', |
| 221 polymerIcon: 'oobe-welcome-20:add-cellular', | 222 polymerIcon: 'oobe-welcome-20:add-cellular', |
| 222 customData: { | 223 customData: { |
| 223 onTap: function() { self.OpenAddWiFiNetworkDialog_(); }, | 224 onTap: function() { self.OpenAddWiFiNetworkDialog_(); }, |
| 224 }, | 225 }, |
| 225 }, | 226 }, |
| 226 ]; | 227 ]; |
| 228 if (isConnected_) |
| 229 return items; |
| 230 return items.slice(1); |
| 227 }, | 231 }, |
| 228 | 232 |
| 229 /** | 233 /** |
| 230 * Returns true if timezone button should be visible. | 234 * Returns true if timezone button should be visible. |
| 231 * @private | 235 * @private |
| 232 */ | 236 */ |
| 233 isTimezoneButtonVisible_: function(highlightStrength) { | 237 isTimezoneButtonVisible_: function(highlightStrength) { |
| 234 return highlightStrength === 'strong'; | 238 return highlightStrength === 'strong'; |
| 235 }, | 239 }, |
| 236 | 240 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 * @private | 487 * @private |
| 484 */ | 488 */ |
| 485 onTimezoneSelected_: function(event) { | 489 onTimezoneSelected_: function(event) { |
| 486 var item = event.detail; | 490 var item = event.detail; |
| 487 if (!item) | 491 if (!item) |
| 488 return; | 492 return; |
| 489 | 493 |
| 490 this.screen.onTimezoneSelected_(item.value); | 494 this.screen.onTimezoneSelected_(item.value); |
| 491 }, | 495 }, |
| 492 }); | 496 }); |
| OLD | NEW |