| 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 /** The network type for the known networks subpage. */ |
| 24 knownNetworksType_: { |
| 25 type: String, |
| 26 }, |
| 27 |
| 28 /** Whether the 'Add connection' section is expanded. */ |
| 29 addConnectionExpanded_: { |
| 30 type: Boolean, |
| 31 value: false, |
| 32 }, |
| 33 }, | 33 }, |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * @param {!{detail: !CrOnc.NetworkStateProperties}} event | 36 * @param {!{detail: !CrOnc.NetworkStateProperties}} event |
| 37 * @private | 37 * @private |
| 38 */ | 38 */ |
| 39 onShowDetail_: function(event) { | 39 onShowDetail_: function(event) { |
| 40 settings.navigateTo( | 40 settings.navigateTo( |
| 41 settings.Route.NETWORK_DETAIL, | 41 settings.Route.NETWORK_DETAIL, |
| 42 new URLSearchParams('guid=' + event.detail.GUID)); | 42 new URLSearchParams('guid=' + event.detail.GUID)); |
| 43 }, | 43 }, |
| 44 | 44 |
| 45 /** | 45 /** |
| 46 * @param {!{detail: {type: string}}} event | 46 * @param {!{detail: {type: string}}} event |
| 47 * @private | 47 * @private |
| 48 */ | 48 */ |
| 49 onShowKnownNetworks_: function(event) { | 49 onShowKnownNetworks_: function(event) { |
| 50 this.knownNetworksType = event.detail.type; | 50 this.knownNetworksType_ = event.detail.type; |
| 51 settings.navigateTo(settings.Route.KNOWN_NETWORKS); | 51 settings.navigateTo(settings.Route.KNOWN_NETWORKS); |
| 52 }, | 52 }, |
| 53 | 53 |
| 54 /** | 54 /** |
| 55 * Event triggered when the 'Add connections' div is tapped. | 55 * Event triggered when the 'Add connections' div is tapped. |
| 56 * @param {Event} event | 56 * @param {Event} event |
| 57 * @private | 57 * @private |
| 58 */ | 58 */ |
| 59 onExpandAddConnectionsTap_: function(event) { | 59 onExpandAddConnectionsTap_: function(event) { |
| 60 if (event.target.id == 'expandAddConnections') | 60 if (event.target.id == 'expandAddConnections') |
| 61 return; | 61 return; |
| 62 this.addConnectionExpanded = !this.addConnectionExpanded; | 62 this.addConnectionExpanded_ = !this.addConnectionExpanded_; |
| 63 }, | 63 }, |
| 64 | 64 |
| 65 /*** @private */ | 65 /*** @private */ |
| 66 onAddWiFiTap_: function() { | 66 onAddWiFiTap_: function() { |
| 67 chrome.send('addNetwork', [CrOnc.Type.WI_FI]); | 67 chrome.send('addNetwork', [CrOnc.Type.WI_FI]); |
| 68 }, | 68 }, |
| 69 | 69 |
| 70 /*** @private */ | 70 /*** @private */ |
| 71 onAddVPNTap_: function() { | 71 onAddVPNTap_: function() { |
| 72 chrome.send('addNetwork', [CrOnc.Type.VPN]); | 72 chrome.send('addNetwork', [CrOnc.Type.VPN]); |
| 73 }, | 73 }, |
| 74 }); | 74 }); |
| OLD | NEW |