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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 else | 608 else |
609 chrome.send('configureNetwork', [this.guid]); | 609 chrome.send('configureNetwork', [this.guid]); |
610 }, | 610 }, |
611 | 611 |
612 /** @private */ | 612 /** @private */ |
613 onViewAccountTap_: function() { | 613 onViewAccountTap_: function() { |
614 // startActivate() will show the account page for activated networks. | 614 // startActivate() will show the account page for activated networks. |
615 this.networkingPrivate.startActivate(this.guid); | 615 this.networkingPrivate.startActivate(this.guid); |
616 }, | 616 }, |
617 | 617 |
| 618 /** @private */ |
| 619 onChooseMobileTap_: function() { |
| 620 // TODO(stevenjb): Integrate ChooseMobileNetworkDialog with WebUI. |
| 621 chrome.send('addNetwork', [this.networkProperties.Type]); |
| 622 }, |
| 623 |
618 /** @const {string} */ | 624 /** @const {string} */ |
619 CR_EXPAND_BUTTON_TAG: 'CR-EXPAND-BUTTON', | 625 CR_EXPAND_BUTTON_TAG: 'CR-EXPAND-BUTTON', |
620 | 626 |
621 /** @private */ | 627 /** @private */ |
622 showTetherDialog_: function() { | 628 showTetherDialog_: function() { |
623 this.getTetherDialog_().open(); | 629 this.getTetherDialog_().open(); |
624 }, | 630 }, |
625 | 631 |
626 /** | 632 /** |
627 * @param {Event} event | 633 * @param {Event} event |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 if (networkProperties.Type == CrOnc.Type.CELLULAR) | 984 if (networkProperties.Type == CrOnc.Type.CELLULAR) |
979 return true; | 985 return true; |
980 return this.isRememberedOrConnected_(networkProperties); | 986 return this.isRememberedOrConnected_(networkProperties); |
981 }, | 987 }, |
982 | 988 |
983 /** | 989 /** |
984 * @param {!CrOnc.NetworkProperties} networkProperties | 990 * @param {!CrOnc.NetworkProperties} networkProperties |
985 * @return {boolean} | 991 * @return {boolean} |
986 * @private | 992 * @private |
987 */ | 993 */ |
988 showCellularSim_: function(networkProperties) { | 994 showCellularChooseNetwork_: function(networkProperties) { |
989 if (networkProperties.Type != 'Cellular' || !networkProperties.Cellular) { | 995 return networkProperties.Type == CrOnc.Type.CELLULAR && |
990 return false; | 996 !!this.get('Cellular.SupportNetworkScan', this.networkProperties); |
991 } | |
992 return networkProperties.Cellular.Family == 'GSM'; | |
993 }, | 997 }, |
994 | 998 |
995 /** | 999 /** |
| 1000 * @param {!CrOnc.NetworkProperties} networkProperties |
| 1001 * @return {boolean} |
| 1002 * @private |
| 1003 */ |
| 1004 showCellularSim_: function(networkProperties) { |
| 1005 return networkProperties.Type == CrOnc.Type.CELLULAR && |
| 1006 this.get('Cellular.Family', this.networkProperties) == |
| 1007 CrOnc.NetworkTechnology.GSM; |
| 1008 }, |
| 1009 |
| 1010 /** |
996 * @param {!Object} curValue | 1011 * @param {!Object} curValue |
997 * @param {!Object} newValue | 1012 * @param {!Object} newValue |
998 * @return {boolean} True if all properties set in |newValue| are equal to | 1013 * @return {boolean} True if all properties set in |newValue| are equal to |
999 * the corresponding properties in |curValue|. Note: Not all properties | 1014 * the corresponding properties in |curValue|. Note: Not all properties |
1000 * of |curValue| need to be specified in |newValue| for this to return | 1015 * of |curValue| need to be specified in |newValue| for this to return |
1001 * true. | 1016 * true. |
1002 * @private | 1017 * @private |
1003 */ | 1018 */ |
1004 allPropertiesMatch_: function(curValue, newValue) { | 1019 allPropertiesMatch_: function(curValue, newValue) { |
1005 for (var key in newValue) { | 1020 for (var key in newValue) { |
1006 if (newValue[key] != curValue[key]) | 1021 if (newValue[key] != curValue[key]) |
1007 return false; | 1022 return false; |
1008 } | 1023 } |
1009 return true; | 1024 return true; |
1010 } | 1025 } |
1011 }); | 1026 }); |
1012 })(); | 1027 })(); |
OLD | NEW |