| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 | 6 * @fileoverview |
| 7 * 'settings-internet-page' is the settings page containing internet | 7 * 'settings-internet-page' is the settings page containing internet |
| 8 * settings. | 8 * settings. |
| 9 */ | 9 */ |
| 10 Polymer({ | 10 Polymer({ |
| 11 is: 'settings-internet-page', | 11 is: 'settings-internet-page', |
| 12 | 12 |
| 13 properties: { | 13 properties: { |
| 14 /** The network type for the known networks subpage. */ | |
| 15 knownNetworksType: { | |
| 16 type: String, | |
| 17 }, | |
| 18 | |
| 19 /** Whether the 'Add connection' section is expanded. */ | |
| 20 addConnectionExpanded: { | |
| 21 type: Boolean, | |
| 22 value: false, | |
| 23 }, | |
| 24 | |
| 25 /** | 14 /** |
| 26 * Interface for networkingPrivate calls. May be overriden by tests. | 15 * Interface for networkingPrivate calls. May be overriden by tests. |
| 27 * @type {NetworkingPrivate} | 16 * @type {NetworkingPrivate} |
| 28 */ | 17 */ |
| 29 networkingPrivate: { | 18 networkingPrivate: { |
| 30 type: Object, | 19 type: Object, |
| 31 value: chrome.networkingPrivate, | 20 value: chrome.networkingPrivate, |
| 32 }, | 21 }, |
| 22 |
| 23 /** |
| 24 * The network type for the known networks subpage. |
| 25 * @private |
| 26 */ |
| 27 knownNetworksType_: String, |
| 28 |
| 29 /** |
| 30 * Whether the 'Add connection' section is expanded. |
| 31 * @private |
| 32 */ |
| 33 addConnectionExpanded_: { |
| 34 type: Boolean, |
| 35 value: false, |
| 36 }, |
| 33 }, | 37 }, |
| 34 | 38 |
| 35 /** | 39 /** |
| 36 * @param {!{detail: !CrOnc.NetworkStateProperties}} event | 40 * @param {!{detail: !CrOnc.NetworkStateProperties}} event |
| 37 * @private | 41 * @private |
| 38 */ | 42 */ |
| 39 onShowDetail_: function(event) { | 43 onShowDetail_: function(event) { |
| 40 settings.navigateTo( | 44 settings.navigateTo( |
| 41 settings.Route.NETWORK_DETAIL, | 45 settings.Route.NETWORK_DETAIL, |
| 42 new URLSearchParams('guid=' + event.detail.GUID)); | 46 new URLSearchParams('guid=' + event.detail.GUID)); |
| 43 }, | 47 }, |
| 44 | 48 |
| 45 /** | 49 /** |
| 46 * @param {!{detail: {type: string}}} event | 50 * @param {!{detail: {type: string}}} event |
| 47 * @private | 51 * @private |
| 48 */ | 52 */ |
| 49 onShowKnownNetworks_: function(event) { | 53 onShowKnownNetworks_: function(event) { |
| 50 this.knownNetworksType = event.detail.type; | 54 this.knownNetworksType_ = event.detail.type; |
| 51 settings.navigateTo(settings.Route.KNOWN_NETWORKS); | 55 settings.navigateTo(settings.Route.KNOWN_NETWORKS); |
| 52 }, | 56 }, |
| 53 | 57 |
| 54 /** | 58 /** |
| 55 * Event triggered when the 'Add connections' div is tapped. | 59 * Event triggered when the 'Add connections' div is tapped. |
| 56 * @param {Event} event | 60 * @param {Event} event |
| 57 * @private | 61 * @private |
| 58 */ | 62 */ |
| 59 onExpandAddConnectionsTap_: function(event) { | 63 onExpandAddConnectionsTap_: function(event) { |
| 60 if (event.target.id == 'expandAddConnections') | 64 if (event.target.id == 'expandAddConnections') |
| 61 return; | 65 return; |
| 62 this.addConnectionExpanded = !this.addConnectionExpanded; | 66 this.addConnectionExpanded_ = !this.addConnectionExpanded_; |
| 63 }, | 67 }, |
| 64 | 68 |
| 65 /*** @private */ | 69 /*** @private */ |
| 66 onAddWiFiTap_: function() { | 70 onAddWiFiTap_: function() { |
| 67 chrome.send('addNetwork', [CrOnc.Type.WI_FI]); | 71 chrome.send('addNetwork', [CrOnc.Type.WI_FI]); |
| 68 }, | 72 }, |
| 69 | 73 |
| 70 /*** @private */ | 74 /*** @private */ |
| 71 onAddVPNTap_: function() { | 75 onAddVPNTap_: function() { |
| 72 chrome.send('addNetwork', [CrOnc.Type.VPN]); | 76 chrome.send('addNetwork', [CrOnc.Type.VPN]); |
| 73 }, | 77 }, |
| 74 }); | 78 }); |
| OLD | NEW |