Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: chrome/browser/resources/settings/internet_page/internet_detail_page.js

Issue 2752223003: MD Settings: Fix Network section styling (Closed)
Patch Set: Fix third party vpn visibility Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
534 /** 540 /**
535 * @param {Event} event 541 * @param {Event} event
536 * @private 542 * @private
537 */ 543 */
538 toggleAdvancedExpanded_: function(event) { 544 toggleAdvancedExpanded_: function(event) {
539 if (event.target.id == 'expandButton') 545 if (event.target.tagName == 'CR-EXPAND-BUTTON')
540 return; // Already handled. 546 return; // Already handled.
541 this.advancedExpanded_ = !this.advancedExpanded_; 547 this.advancedExpanded_ = !this.advancedExpanded_;
542 }, 548 },
543 549
544 /** 550 /**
551 * @param {Event} event
552 * @private
553 */
554 toggleNetworkExpanded_: function(event) {
555 if (event.target.tagName == 'CR-EXPAND-BUTTON')
556 return; // Already handled.
557 this.networkExpanded_ = !this.networkExpanded_;
558 },
559
560 /**
561 * @param {Event} event
562 * @private
563 */
564 toggleProxyExpanded_: function(event) {
565 if (event.target.tagName == 'CR-EXPAND-BUTTON')
dschuyler 2017/03/20 19:11:30 Now that there are three+ uses of this string cons
stevenjb 2017/03/24 21:00:03 Pretty much every use I could find of tagName uses
566 return; // Already handled.
567 this.proxyExpanded_ = !this.proxyExpanded_;
568 },
569
570 /**
545 * Event triggered for elements associated with network properties. 571 * Event triggered for elements associated with network properties.
546 * @param {!{detail: !{field: string, value: (string|!Object)}}} event 572 * @param {!{detail: !{field: string, value: (string|!Object)}}} event
547 * @private 573 * @private
548 */ 574 */
549 onNetworkPropertyChange_: function(event) { 575 onNetworkPropertyChange_: function(event) {
550 if (!this.networkProperties) 576 if (!this.networkProperties)
551 return; 577 return;
552 var field = event.detail.field; 578 var field = event.detail.field;
553 var value = event.detail.value; 579 var value = event.detail.value;
554 var onc = this.getEmptyNetworkProperties_(); 580 var onc = this.getEmptyNetworkProperties_();
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 /** 859 /**
834 * @return {boolean} 860 * @return {boolean}
835 * @private 861 * @private
836 */ 862 */
837 hasAdvancedOrDeviceFields_: function() { 863 hasAdvancedOrDeviceFields_: function() {
838 return this.hasAdvancedFields_() || this.hasDeviceFields_(); 864 return this.hasAdvancedFields_() || this.hasDeviceFields_();
839 }, 865 },
840 866
841 /** 867 /**
842 * @param {!CrOnc.NetworkProperties} networkProperties 868 * @param {!CrOnc.NetworkProperties} networkProperties
843 * @return {boolean} True if the network section should be shown. 869 * @return {boolean}
844 * @private 870 * @private
845 */ 871 */
846 hasNetworkSection_: function(networkProperties) { 872 hasNetworkSection_: function(networkProperties) {
847 if (this.networkProperties.Type == CrOnc.Type.VPN) 873 if (networkProperties.Type == CrOnc.Type.VPN)
848 return false; 874 return false;
849 if (this.networkProperties.Type == CrOnc.Type.CELLULAR) 875 if (networkProperties.Type == CrOnc.Type.CELLULAR)
850 return true; 876 return true;
851 return this.isRememberedOrConnected_(networkProperties); 877 return this.isRememberedOrConnected_(networkProperties);
852 }, 878 },
853 879
854 /** 880 /**
855 * @param {string} type The network type. 881 * @param {string} type The network type.
856 * @return {boolean} True if the network type matches 'type'. 882 * @return {boolean} True if the network type matches 'type'.
857 * @private 883 * @private
858 */ 884 */
859 isType_: function(type) { 885 isType_: function(type) {
(...skipping 23 matching lines...) Expand all
883 */ 909 */
884 allPropertiesMatch_: function(curValue, newValue) { 910 allPropertiesMatch_: function(curValue, newValue) {
885 for (var key in newValue) { 911 for (var key in newValue) {
886 if (newValue[key] != curValue[key]) 912 if (newValue[key] != curValue[key])
887 return false; 913 return false;
888 } 914 }
889 return true; 915 return true;
890 } 916 }
891 }); 917 });
892 })(); 918 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698