| 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-detail' is the settings subpage containing details | 7 * 'settings-internet-detail' is the settings subpage containing details |
| 8 * for a network. | 8 * for a network. |
| 9 */ | 9 */ |
| 10 (function() { | 10 (function() { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 * @private | 106 * @private |
| 107 */ | 107 */ |
| 108 IPAddress_: { | 108 IPAddress_: { |
| 109 type: String, | 109 type: String, |
| 110 value: '', | 110 value: '', |
| 111 }, | 111 }, |
| 112 | 112 |
| 113 /** @private */ | 113 /** @private */ |
| 114 advancedExpanded_: Boolean, | 114 advancedExpanded_: Boolean, |
| 115 | 115 |
| 116 /** @private */ |
| 117 networkExpanded_: Boolean, |
| 118 |
| 119 /** @private */ |
| 120 proxyExpanded_: Boolean, |
| 121 |
| 116 /** | 122 /** |
| 117 * Object providing network type values for data binding. | 123 * Object providing network type values for data binding. |
| 118 * @const | 124 * @const |
| 119 * @private | 125 * @private |
| 120 */ | 126 */ |
| 121 NetworkType_: { | 127 NetworkType_: { |
| 122 type: Object, | 128 type: Object, |
| 123 value: { | 129 value: { |
| 124 CELLULAR: CrOnc.Type.CELLULAR, | 130 CELLULAR: CrOnc.Type.CELLULAR, |
| 125 ETHERNET: CrOnc.Type.ETHERNET, | 131 ETHERNET: CrOnc.Type.ETHERNET, |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 onConfigureTap_: function() { | 530 onConfigureTap_: function() { |
| 525 chrome.send('configureNetwork', [this.guid]); | 531 chrome.send('configureNetwork', [this.guid]); |
| 526 }, | 532 }, |
| 527 | 533 |
| 528 /** @private */ | 534 /** @private */ |
| 529 onViewAccountTap_: function() { | 535 onViewAccountTap_: function() { |
| 530 // startActivate() will show the account page for activated networks. | 536 // startActivate() will show the account page for activated networks. |
| 531 this.networkingPrivate.startActivate(this.guid); | 537 this.networkingPrivate.startActivate(this.guid); |
| 532 }, | 538 }, |
| 533 | 539 |
| 540 /** @const {string} */ CR_EXPAND_BUTTON_TAG: 'CR-EXPAND-BUTTON', |
| 541 |
| 542 /** |
| 543 * @param {Event} event |
| 544 * @private |
| 545 */ |
| 546 toggleAdvancedExpanded_: function(event) { |
| 547 if (event.target.tagName == this.CR_EXPAND_BUTTON_TAG) |
| 548 return; // Already handled. |
| 549 this.advancedExpanded_ = !this.advancedExpanded_; |
| 550 }, |
| 551 |
| 534 /** | 552 /** |
| 535 * @param {Event} event | 553 * @param {Event} event |
| 536 * @private | 554 * @private |
| 537 */ | 555 */ |
| 538 toggleAdvancedExpanded_: function(event) { | 556 toggleNetworkExpanded_: function(event) { |
| 539 if (event.target.id == 'expandButton') | 557 if (event.target.tagName == this.CR_EXPAND_BUTTON_TAG) |
| 540 return; // Already handled. | 558 return; // Already handled. |
| 541 this.advancedExpanded_ = !this.advancedExpanded_; | 559 this.networkExpanded_ = !this.networkExpanded_; |
| 560 }, |
| 561 |
| 562 /** |
| 563 * @param {Event} event |
| 564 * @private |
| 565 */ |
| 566 toggleProxyExpanded_: function(event) { |
| 567 if (event.target.tagName == this.CR_EXPAND_BUTTON_TAG) |
| 568 return; // Already handled. |
| 569 this.proxyExpanded_ = !this.proxyExpanded_; |
| 542 }, | 570 }, |
| 543 | 571 |
| 544 /** | 572 /** |
| 545 * Event triggered for elements associated with network properties. | 573 * Event triggered for elements associated with network properties. |
| 546 * @param {!{detail: !{field: string, value: (string|!Object)}}} event | 574 * @param {!{detail: !{field: string, value: (string|!Object)}}} event |
| 547 * @private | 575 * @private |
| 548 */ | 576 */ |
| 549 onNetworkPropertyChange_: function(event) { | 577 onNetworkPropertyChange_: function(event) { |
| 550 if (!this.networkProperties) | 578 if (!this.networkProperties) |
| 551 return; | 579 return; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 /** | 861 /** |
| 834 * @return {boolean} | 862 * @return {boolean} |
| 835 * @private | 863 * @private |
| 836 */ | 864 */ |
| 837 hasAdvancedOrDeviceFields_: function() { | 865 hasAdvancedOrDeviceFields_: function() { |
| 838 return this.hasAdvancedFields_() || this.hasDeviceFields_(); | 866 return this.hasAdvancedFields_() || this.hasDeviceFields_(); |
| 839 }, | 867 }, |
| 840 | 868 |
| 841 /** | 869 /** |
| 842 * @param {!CrOnc.NetworkProperties} networkProperties | 870 * @param {!CrOnc.NetworkProperties} networkProperties |
| 843 * @return {boolean} True if the network section should be shown. | 871 * @return {boolean} |
| 844 * @private | 872 * @private |
| 845 */ | 873 */ |
| 846 hasNetworkSection_: function(networkProperties) { | 874 hasNetworkSection_: function(networkProperties) { |
| 847 if (this.networkProperties.Type == CrOnc.Type.VPN) | 875 if (networkProperties.Type == CrOnc.Type.VPN) |
| 848 return false; | 876 return false; |
| 849 if (this.networkProperties.Type == CrOnc.Type.CELLULAR) | 877 if (networkProperties.Type == CrOnc.Type.CELLULAR) |
| 850 return true; | 878 return true; |
| 851 return this.isRememberedOrConnected_(networkProperties); | 879 return this.isRememberedOrConnected_(networkProperties); |
| 852 }, | 880 }, |
| 853 | 881 |
| 854 /** | 882 /** |
| 855 * @param {string} type The network type. | 883 * @param {string} type The network type. |
| 856 * @return {boolean} True if the network type matches 'type'. | 884 * @return {boolean} True if the network type matches 'type'. |
| 857 * @private | 885 * @private |
| 858 */ | 886 */ |
| 859 isType_: function(type) { | 887 isType_: function(type) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 883 */ | 911 */ |
| 884 allPropertiesMatch_: function(curValue, newValue) { | 912 allPropertiesMatch_: function(curValue, newValue) { |
| 885 for (var key in newValue) { | 913 for (var key in newValue) { |
| 886 if (newValue[key] != curValue[key]) | 914 if (newValue[key] != curValue[key]) |
| 887 return false; | 915 return false; |
| 888 } | 916 } |
| 889 return true; | 917 return true; |
| 890 } | 918 } |
| 891 }); | 919 }); |
| 892 })(); | 920 })(); |
| OLD | NEW |