OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // require: onc_data.js | 5 // require: onc_data.js |
6 | 6 |
7 // NOTE(stevenjb): This code is in the process of being converted to be | 7 // NOTE(stevenjb): This code is in the process of being converted to be |
8 // compatible with the networkingPrivate extension API: | 8 // compatible with the networkingPrivate extension API: |
9 // * The network property dictionaries are being converted to use ONC values. | 9 // * The network property dictionaries are being converted to use ONC values. |
10 // * chrome.send calls will be replaced with chrome.networkingPrivate calls. | 10 // * chrome.send calls will be replaced with chrome.networkingPrivate calls. |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1221 var detailsPage = DetailsInternetPage.getInstance(); | 1221 var detailsPage = DetailsInternetPage.getInstance(); |
1222 if (detailsPage.type_ == 'WiFi') | 1222 if (detailsPage.type_ == 'WiFi') |
1223 sendChromeMetricsAction('Options_NetworkConnectToWifi'); | 1223 sendChromeMetricsAction('Options_NetworkConnectToWifi'); |
1224 else if (detailsPage.type_ == 'VPN') | 1224 else if (detailsPage.type_ == 'VPN') |
1225 sendChromeMetricsAction('Options_NetworkConnectToVPN'); | 1225 sendChromeMetricsAction('Options_NetworkConnectToVPN'); |
1226 | 1226 |
1227 var onc = detailsPage.onc_; | 1227 var onc = detailsPage.onc_; |
1228 var guid = onc.guid(); | 1228 var guid = onc.guid(); |
1229 var type = onc.getActiveValue('Type'); | 1229 var type = onc.getActiveValue('Type'); |
1230 | 1230 |
1231 // VPNs do not correctly set 'Connectable', so we always show the | 1231 // Built-in VPNs do not correctly set 'Connectable', so we always show the |
1232 // configuration UI. | 1232 // configuration UI. |
1233 if (type == 'VPN') { | 1233 if (type == 'VPN') { |
1234 chrome.send('configureNetwork', [guid]); | 1234 if ((onc.getActiveValue('VPN.Type') != 'ThirdPartyVPN') || |
1235 return; | 1235 !onc.getActiveValue('Connectable')) { |
bartfab (slow)
2015/06/02 23:55:26
The first part of the conditional makes sense of c
stevenjb
2015/06/03 01:14:57
I guess the thing to do is to disable the Connect
| |
1236 chrome.send('configureNetwork', [guid]); | |
1237 return; | |
1238 } | |
1236 } | 1239 } |
1237 | 1240 |
1238 // If 'Connectable' is false for WiFi or WiMAX, Shill requires | 1241 // If 'Connectable' is false for WiFi or WiMAX, Shill requires |
1239 // additional configuration to connect, so show the configuration UI. | 1242 // additional configuration to connect, so show the configuration UI. |
1240 if ((type == 'WiFi' || type == 'WiMAX') && | 1243 if ((type == 'WiFi' || type == 'WiMAX') && |
1241 !onc.getActiveValue('Connectable')) { | 1244 !onc.getActiveValue('Connectable')) { |
1242 chrome.send('configureNetwork', [guid]); | 1245 chrome.send('configureNetwork', [guid]); |
1243 return; | 1246 return; |
1244 } | 1247 } |
1245 | 1248 |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1848 | 1851 |
1849 // Don't show page name in address bar and in history to prevent people | 1852 // Don't show page name in address bar and in history to prevent people |
1850 // navigate here by hand and solve issue with page session restore. | 1853 // navigate here by hand and solve issue with page session restore. |
1851 PageManager.showPageByName('detailsInternetPage', false); | 1854 PageManager.showPageByName('detailsInternetPage', false); |
1852 }; | 1855 }; |
1853 | 1856 |
1854 return { | 1857 return { |
1855 DetailsInternetPage: DetailsInternetPage | 1858 DetailsInternetPage: DetailsInternetPage |
1856 }; | 1859 }; |
1857 }); | 1860 }); |
OLD | NEW |