OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/chromeos/cros/network_library.h" | 5 #include "chrome/browser/chromeos/cros/network_library.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/i18n/icu_encoding_detection.h" | 10 #include "base/i18n/icu_encoding_detection.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 | 220 |
221 // Flimflam security options. | 221 // Flimflam security options. |
222 const char* kSecurityWpa = "wpa"; | 222 const char* kSecurityWpa = "wpa"; |
223 const char* kSecurityWep = "wep"; | 223 const char* kSecurityWep = "wep"; |
224 const char* kSecurityRsn = "rsn"; | 224 const char* kSecurityRsn = "rsn"; |
225 const char* kSecurity8021x = "802_1x"; | 225 const char* kSecurity8021x = "802_1x"; |
226 const char* kSecurityPsk = "psk"; | 226 const char* kSecurityPsk = "psk"; |
227 const char* kSecurityNone = "none"; | 227 const char* kSecurityNone = "none"; |
228 | 228 |
229 // Flimflam L2TPIPsec property names. | 229 // Flimflam L2TPIPsec property names. |
230 const char* kL2TPIPSecCACertProperty = "L2TPIPsec.CACert"; | 230 const char* kL2TPIPSecCACertNSSProperty = "L2TPIPsec.CACertNSS"; |
231 const char* kL2TPIPSecCertProperty = "L2TPIPsec.Cert"; | 231 const char* kL2TPIPSecClientCertIDProperty = "L2TPIPsec.ClientCertID"; |
232 const char* kL2TPIPSecKeyProperty = "L2TPIPsec.Key"; | |
233 const char* kL2TPIPSecPSKProperty = "L2TPIPsec.PSK"; | 232 const char* kL2TPIPSecPSKProperty = "L2TPIPsec.PSK"; |
234 const char* kL2TPIPSecUserProperty = "L2TPIPsec.User"; | 233 const char* kL2TPIPSecUserProperty = "L2TPIPsec.User"; |
235 const char* kL2TPIPSecPasswordProperty = "L2TPIPsec.Password"; | 234 const char* kL2TPIPSecPasswordProperty = "L2TPIPsec.Password"; |
236 | 235 |
237 // Flimflam EAP property names. | 236 // Flimflam EAP property names. |
238 // See src/third_party/flimflam/doc/service-api.txt. | 237 // See src/third_party/flimflam/doc/service-api.txt. |
239 const char* kEapIdentityProperty = "EAP.Identity"; | 238 const char* kEapIdentityProperty = "EAP.Identity"; |
240 const char* kEapMethodProperty = "EAP.EAP"; | 239 const char* kEapMethodProperty = "EAP.EAP"; |
241 const char* kEapPhase2AuthProperty = "EAP.InnerEAP"; | 240 const char* kEapPhase2AuthProperty = "EAP.InnerEAP"; |
242 const char* kEapAnonymousIdentityProperty = "EAP.AnonymousIdentity"; | 241 const char* kEapAnonymousIdentityProperty = "EAP.AnonymousIdentity"; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 PROPERTY_INDEX_FAVORITE, | 464 PROPERTY_INDEX_FAVORITE, |
466 PROPERTY_INDEX_FIRMWARE_REVISION, | 465 PROPERTY_INDEX_FIRMWARE_REVISION, |
467 PROPERTY_INDEX_FOUND_NETWORKS, | 466 PROPERTY_INDEX_FOUND_NETWORKS, |
468 PROPERTY_INDEX_HARDWARE_REVISION, | 467 PROPERTY_INDEX_HARDWARE_REVISION, |
469 PROPERTY_INDEX_HOME_PROVIDER, | 468 PROPERTY_INDEX_HOME_PROVIDER, |
470 PROPERTY_INDEX_HOST, | 469 PROPERTY_INDEX_HOST, |
471 PROPERTY_INDEX_IDENTITY, | 470 PROPERTY_INDEX_IDENTITY, |
472 PROPERTY_INDEX_IMEI, | 471 PROPERTY_INDEX_IMEI, |
473 PROPERTY_INDEX_IMSI, | 472 PROPERTY_INDEX_IMSI, |
474 PROPERTY_INDEX_IS_ACTIVE, | 473 PROPERTY_INDEX_IS_ACTIVE, |
475 PROPERTY_INDEX_L2TPIPSEC_CA_CERT, | 474 PROPERTY_INDEX_L2TPIPSEC_CA_CERT_NSS, |
476 PROPERTY_INDEX_L2TPIPSEC_CERT, | 475 PROPERTY_INDEX_L2TPIPSEC_CLIENT_CERT_ID, |
Charlie Lee
2011/05/20 21:44:46
is this still needed?
| |
477 PROPERTY_INDEX_L2TPIPSEC_KEY, | |
478 PROPERTY_INDEX_L2TPIPSEC_PASSWORD, | 476 PROPERTY_INDEX_L2TPIPSEC_PASSWORD, |
479 PROPERTY_INDEX_L2TPIPSEC_PSK, | 477 PROPERTY_INDEX_L2TPIPSEC_PSK, |
480 PROPERTY_INDEX_L2TPIPSEC_USER, | 478 PROPERTY_INDEX_L2TPIPSEC_USER, |
481 PROPERTY_INDEX_MANUFACTURER, | 479 PROPERTY_INDEX_MANUFACTURER, |
482 PROPERTY_INDEX_MDN, | 480 PROPERTY_INDEX_MDN, |
483 PROPERTY_INDEX_MEID, | 481 PROPERTY_INDEX_MEID, |
484 PROPERTY_INDEX_MIN, | 482 PROPERTY_INDEX_MIN, |
485 PROPERTY_INDEX_MODE, | 483 PROPERTY_INDEX_MODE, |
486 PROPERTY_INDEX_MODEL_ID, | 484 PROPERTY_INDEX_MODEL_ID, |
487 PROPERTY_INDEX_NAME, | 485 PROPERTY_INDEX_NAME, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
556 { kFavoriteProperty, PROPERTY_INDEX_FAVORITE }, | 554 { kFavoriteProperty, PROPERTY_INDEX_FAVORITE }, |
557 { kFirmwareRevisionProperty, PROPERTY_INDEX_FIRMWARE_REVISION }, | 555 { kFirmwareRevisionProperty, PROPERTY_INDEX_FIRMWARE_REVISION }, |
558 { kFoundNetworksProperty, PROPERTY_INDEX_FOUND_NETWORKS }, | 556 { kFoundNetworksProperty, PROPERTY_INDEX_FOUND_NETWORKS }, |
559 { kHardwareRevisionProperty, PROPERTY_INDEX_HARDWARE_REVISION }, | 557 { kHardwareRevisionProperty, PROPERTY_INDEX_HARDWARE_REVISION }, |
560 { kHomeProviderProperty, PROPERTY_INDEX_HOME_PROVIDER }, | 558 { kHomeProviderProperty, PROPERTY_INDEX_HOME_PROVIDER }, |
561 { kHostProperty, PROPERTY_INDEX_HOST }, | 559 { kHostProperty, PROPERTY_INDEX_HOST }, |
562 { kIdentityProperty, PROPERTY_INDEX_IDENTITY }, | 560 { kIdentityProperty, PROPERTY_INDEX_IDENTITY }, |
563 { kImeiProperty, PROPERTY_INDEX_IMEI }, | 561 { kImeiProperty, PROPERTY_INDEX_IMEI }, |
564 { kImsiProperty, PROPERTY_INDEX_IMSI }, | 562 { kImsiProperty, PROPERTY_INDEX_IMSI }, |
565 { kIsActiveProperty, PROPERTY_INDEX_IS_ACTIVE }, | 563 { kIsActiveProperty, PROPERTY_INDEX_IS_ACTIVE }, |
566 { kL2TPIPSecCACertProperty, PROPERTY_INDEX_L2TPIPSEC_CA_CERT }, | 564 { kL2TPIPSecCACertNSSProperty, PROPERTY_INDEX_L2TPIPSEC_CA_CERT_NSS }, |
567 { kL2TPIPSecCertProperty, PROPERTY_INDEX_L2TPIPSEC_CERT }, | 565 { kL2TPIPSecClientCertIDProperty, PROPERTY_INDEX_L2TPIPSEC_CLIENT_CERT_ID }, |
568 { kL2TPIPSecKeyProperty, PROPERTY_INDEX_L2TPIPSEC_KEY }, | |
569 { kL2TPIPSecPasswordProperty, PROPERTY_INDEX_L2TPIPSEC_PASSWORD }, | 566 { kL2TPIPSecPasswordProperty, PROPERTY_INDEX_L2TPIPSEC_PASSWORD }, |
570 { kL2TPIPSecPSKProperty, PROPERTY_INDEX_L2TPIPSEC_PSK }, | 567 { kL2TPIPSecPSKProperty, PROPERTY_INDEX_L2TPIPSEC_PSK }, |
571 { kL2TPIPSecUserProperty, PROPERTY_INDEX_L2TPIPSEC_USER }, | 568 { kL2TPIPSecUserProperty, PROPERTY_INDEX_L2TPIPSEC_USER }, |
572 { kManufacturerProperty, PROPERTY_INDEX_MANUFACTURER }, | 569 { kManufacturerProperty, PROPERTY_INDEX_MANUFACTURER }, |
573 { kMdnProperty, PROPERTY_INDEX_MDN }, | 570 { kMdnProperty, PROPERTY_INDEX_MDN }, |
574 { kMeidProperty, PROPERTY_INDEX_MEID }, | 571 { kMeidProperty, PROPERTY_INDEX_MEID }, |
575 { kMinProperty, PROPERTY_INDEX_MIN }, | 572 { kMinProperty, PROPERTY_INDEX_MIN }, |
576 { kModeProperty, PROPERTY_INDEX_MODE }, | 573 { kModeProperty, PROPERTY_INDEX_MODE }, |
577 { kModelIDProperty, PROPERTY_INDEX_MODEL_ID }, | 574 { kModelIDProperty, PROPERTY_INDEX_MODEL_ID }, |
578 { kNameProperty, PROPERTY_INDEX_NAME }, | 575 { kNameProperty, PROPERTY_INDEX_NAME }, |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1303 // Note: shadows Network::name_ property. | 1300 // Note: shadows Network::name_ property. |
1304 return value->GetAsString(&name_); | 1301 return value->GetAsString(&name_); |
1305 case PROPERTY_INDEX_TYPE: { | 1302 case PROPERTY_INDEX_TYPE: { |
1306 std::string provider_type_string; | 1303 std::string provider_type_string; |
1307 if (value->GetAsString(&provider_type_string)) { | 1304 if (value->GetAsString(&provider_type_string)) { |
1308 provider_type_ = ParseProviderType(provider_type_string); | 1305 provider_type_ = ParseProviderType(provider_type_string); |
1309 return true; | 1306 return true; |
1310 } | 1307 } |
1311 break; | 1308 break; |
1312 } | 1309 } |
1313 case PROPERTY_INDEX_L2TPIPSEC_CA_CERT: | 1310 case PROPERTY_INDEX_L2TPIPSEC_CA_CERT_NSS: |
1314 return value->GetAsString(&ca_cert_); | 1311 return value->GetAsString(&ca_cert_nss_); |
1315 case PROPERTY_INDEX_L2TPIPSEC_PSK: | 1312 case PROPERTY_INDEX_L2TPIPSEC_PSK: |
1316 return value->GetAsString(&psk_passphrase_); | 1313 return value->GetAsString(&psk_passphrase_); |
1317 case PROPERTY_INDEX_L2TPIPSEC_CERT: | 1314 case PROPERTY_INDEX_L2TPIPSEC_CLIENT_CERT_ID: |
1318 return value->GetAsString(&user_cert_); | 1315 return value->GetAsString(&client_cert_id_); |
1319 case PROPERTY_INDEX_L2TPIPSEC_KEY: | |
1320 return value->GetAsString(&user_cert_key_); | |
1321 case PROPERTY_INDEX_L2TPIPSEC_USER: | 1316 case PROPERTY_INDEX_L2TPIPSEC_USER: |
1322 return value->GetAsString(&username_); | 1317 return value->GetAsString(&username_); |
1323 case PROPERTY_INDEX_L2TPIPSEC_PASSWORD: | 1318 case PROPERTY_INDEX_L2TPIPSEC_PASSWORD: |
1324 return value->GetAsString(&user_passphrase_); | 1319 return value->GetAsString(&user_passphrase_); |
1325 default: | 1320 default: |
1326 break; | 1321 break; |
1327 } | 1322 } |
1328 return false; | 1323 return false; |
1329 } | 1324 } |
1330 | 1325 |
(...skipping 22 matching lines...) Expand all Loading... | |
1353 break; | 1348 break; |
1354 } | 1349 } |
1355 return false; | 1350 return false; |
1356 } | 1351 } |
1357 | 1352 |
1358 void VirtualNetwork::ParseInfo(const DictionaryValue* info) { | 1353 void VirtualNetwork::ParseInfo(const DictionaryValue* info) { |
1359 Network::ParseInfo(info); | 1354 Network::ParseInfo(info); |
1360 VLOG(1) << "VPN: " << name() | 1355 VLOG(1) << "VPN: " << name() |
1361 << " Type: " << ProviderTypeToString(provider_type()); | 1356 << " Type: " << ProviderTypeToString(provider_type()); |
1362 if (provider_type_ == PROVIDER_TYPE_L2TP_IPSEC_PSK) { | 1357 if (provider_type_ == PROVIDER_TYPE_L2TP_IPSEC_PSK) { |
1363 if (!user_cert_.empty()) | 1358 if (!client_cert_id_.empty()) |
1364 provider_type_ = PROVIDER_TYPE_L2TP_IPSEC_USER_CERT; | 1359 provider_type_ = PROVIDER_TYPE_L2TP_IPSEC_USER_CERT; |
1365 } | 1360 } |
1366 } | 1361 } |
1367 | 1362 |
1368 bool VirtualNetwork::NeedMoreInfoToConnect() const { | 1363 bool VirtualNetwork::NeedMoreInfoToConnect() const { |
1369 if (server_hostname_.empty() || username_.empty() || user_passphrase_.empty()) | 1364 if (server_hostname_.empty() || username_.empty() || user_passphrase_.empty()) |
1370 return true; | 1365 return true; |
1371 switch (provider_type_) { | 1366 switch (provider_type_) { |
1372 case PROVIDER_TYPE_L2TP_IPSEC_PSK: | 1367 case PROVIDER_TYPE_L2TP_IPSEC_PSK: |
1373 if (psk_passphrase_.empty()) | 1368 if (psk_passphrase_.empty()) |
1374 return true; | 1369 return true; |
1375 break; | 1370 break; |
1376 case PROVIDER_TYPE_L2TP_IPSEC_USER_CERT: | 1371 case PROVIDER_TYPE_L2TP_IPSEC_USER_CERT: |
1377 case PROVIDER_TYPE_OPEN_VPN: | 1372 case PROVIDER_TYPE_OPEN_VPN: |
1378 if (user_cert_.empty()) | 1373 if (client_cert_id_.empty()) |
1379 return true; | 1374 return true; |
1380 break; | 1375 break; |
1381 case PROVIDER_TYPE_MAX: | 1376 case PROVIDER_TYPE_MAX: |
1382 break; | 1377 break; |
1383 } | 1378 } |
1384 return false; | 1379 return false; |
1385 } | 1380 } |
1386 | 1381 |
1387 void VirtualNetwork::SetCACert(const std::string& ca_cert) { | 1382 void VirtualNetwork::SetCACertNSS(const std::string& ca_cert_nss) { |
1388 SetStringProperty(kL2TPIPSecCACertProperty, ca_cert, &ca_cert_); | 1383 SetStringProperty(kL2TPIPSecCACertNSSProperty, ca_cert_nss, &ca_cert_nss_); |
1389 } | 1384 } |
1390 | 1385 |
1391 void VirtualNetwork::SetPSKPassphrase(const std::string& psk_passphrase) { | 1386 void VirtualNetwork::SetPSKPassphrase(const std::string& psk_passphrase) { |
1392 SetStringProperty(kL2TPIPSecPSKProperty, psk_passphrase, | 1387 SetStringProperty(kL2TPIPSecPSKProperty, psk_passphrase, |
1393 &psk_passphrase_); | 1388 &psk_passphrase_); |
1394 } | 1389 } |
1395 | 1390 |
1396 void VirtualNetwork::SetUserCert(const std::string& user_cert) { | 1391 void VirtualNetwork::SetClientCertID(const std::string& cert_id) { |
1397 SetStringProperty(kL2TPIPSecCertProperty, user_cert, &user_cert_); | 1392 SetStringProperty(kL2TPIPSecClientCertIDProperty, cert_id, &client_cert_id_); |
1398 } | |
1399 | |
1400 void VirtualNetwork::SetUserCertKey(const std::string& key) { | |
1401 SetStringProperty(kL2TPIPSecKeyProperty, key, &user_cert_key_); | |
1402 } | 1393 } |
1403 | 1394 |
1404 void VirtualNetwork::SetUsername(const std::string& username) { | 1395 void VirtualNetwork::SetUsername(const std::string& username) { |
1405 SetStringProperty(kL2TPIPSecUserProperty, username, &username_); | 1396 SetStringProperty(kL2TPIPSecUserProperty, username, &username_); |
1406 } | 1397 } |
1407 | 1398 |
1408 void VirtualNetwork::SetUserPassphrase(const std::string& user_passphrase) { | 1399 void VirtualNetwork::SetUserPassphrase(const std::string& user_passphrase) { |
1409 SetStringProperty(kL2TPIPSecPasswordProperty, user_passphrase, | 1400 SetStringProperty(kL2TPIPSecPasswordProperty, user_passphrase, |
1410 &user_passphrase_); | 1401 &user_passphrase_); |
1411 } | 1402 } |
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2970 connect_data_.server_hostname = server; | 2961 connect_data_.server_hostname = server; |
2971 connect_data_.psk_username = username; | 2962 connect_data_.psk_username = username; |
2972 connect_data_.passphrase = user_passphrase; | 2963 connect_data_.passphrase = user_passphrase; |
2973 RequestVirtualNetwork(service_name.c_str(), | 2964 RequestVirtualNetwork(service_name.c_str(), |
2974 server.c_str(), | 2965 server.c_str(), |
2975 kProviderL2tpIpsec, | 2966 kProviderL2tpIpsec, |
2976 VPNServiceUpdateAndConnect, | 2967 VPNServiceUpdateAndConnect, |
2977 this); | 2968 this); |
2978 } | 2969 } |
2979 | 2970 |
2971 virtual void ConnectToVirtualNetworkCert( | |
2972 const std::string& service_name, | |
2973 const std::string& server_hostname, | |
2974 const std::string& client_cert_id, | |
2975 const std::string& username, | |
2976 const std::string& user_passphrase) { | |
2977 if (!EnsureCrosLoaded()) | |
2978 return; | |
2979 // Store the connection data to be used by the callback. | |
2980 connect_data_.service_name = service_name; | |
2981 connect_data_.server_hostname = server_hostname; | |
2982 connect_data_.vpn_client_cert_pkcs11_id = client_cert_id; | |
2983 connect_data_.psk_username = username; | |
2984 connect_data_.passphrase = user_passphrase; | |
2985 RequestVirtualNetwork(service_name.c_str(), | |
2986 server_hostname.c_str(), | |
2987 kProviderL2tpIpsec, | |
2988 VPNServiceUpdateAndConnect, | |
2989 this); | |
2990 } | |
2991 | |
2980 // Callback | 2992 // Callback |
2981 static void VPNServiceUpdateAndConnect(void* object, | 2993 static void VPNServiceUpdateAndConnect(void* object, |
2982 const char* service_path, | 2994 const char* service_path, |
2983 const Value* info) { | 2995 const Value* info) { |
2984 NetworkLibraryImpl* networklib = static_cast<NetworkLibraryImpl*>(object); | 2996 NetworkLibraryImpl* networklib = static_cast<NetworkLibraryImpl*>(object); |
2985 DCHECK(networklib); | 2997 DCHECK(networklib); |
2986 if (service_path && info) { | 2998 if (service_path && info) { |
2987 VLOG(1) << "Connecting to new VPN Service: " << service_path; | 2999 VLOG(1) << "Connecting to new VPN Service: " << service_path; |
2988 DCHECK_EQ(info->GetType(), Value::TYPE_DICTIONARY); | 3000 DCHECK_EQ(info->GetType(), Value::TYPE_DICTIONARY); |
2989 const DictionaryValue* dict = static_cast<const DictionaryValue*>(info); | 3001 const DictionaryValue* dict = static_cast<const DictionaryValue*>(info); |
(...skipping 11 matching lines...) Expand all Loading... | |
3001 ConnectData& data = connect_data_; | 3013 ConnectData& data = connect_data_; |
3002 if (vpn->name() != data.service_name) { | 3014 if (vpn->name() != data.service_name) { |
3003 LOG(WARNING) << "Virtual network name does not match ConnectData: " | 3015 LOG(WARNING) << "Virtual network name does not match ConnectData: " |
3004 << vpn->name() << " != " << data.service_name; | 3016 << vpn->name() << " != " << data.service_name; |
3005 return; | 3017 return; |
3006 } | 3018 } |
3007 | 3019 |
3008 vpn->set_added(true); | 3020 vpn->set_added(true); |
3009 if (!data.server_hostname.empty()) | 3021 if (!data.server_hostname.empty()) |
3010 vpn->set_server_hostname(data.server_hostname); | 3022 vpn->set_server_hostname(data.server_hostname); |
3011 vpn->SetCACert(""); | 3023 vpn->SetCACertNSS(""); |
3012 vpn->SetUserCert(""); | 3024 vpn->SetClientCertID(data.vpn_client_cert_pkcs11_id); |
3013 vpn->SetUserCertKey(""); | |
3014 vpn->SetPSKPassphrase(data.psk_key); | 3025 vpn->SetPSKPassphrase(data.psk_key); |
3015 vpn->SetUsername(data.psk_username); | 3026 vpn->SetUsername(data.psk_username); |
3016 vpn->SetUserPassphrase(data.passphrase); | 3027 vpn->SetUserPassphrase(data.passphrase); |
3017 | 3028 |
3018 CallConnectToNetwork(vpn); | 3029 CallConnectToNetwork(vpn); |
3019 } | 3030 } |
3020 | 3031 |
3021 virtual void DisconnectFromNetwork(const Network* network) { | 3032 virtual void DisconnectFromNetwork(const Network* network) { |
3022 DCHECK(network); | 3033 DCHECK(network); |
3023 if (!EnsureCrosLoaded() || !network) | 3034 if (!EnsureCrosLoaded() || !network) |
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4461 EAPPhase2Auth eap_auth; | 4472 EAPPhase2Auth eap_auth; |
4462 std::string eap_server_ca_cert_nss_nickname; | 4473 std::string eap_server_ca_cert_nss_nickname; |
4463 bool eap_use_system_cas; | 4474 bool eap_use_system_cas; |
4464 std::string eap_client_cert_pkcs11_id; | 4475 std::string eap_client_cert_pkcs11_id; |
4465 std::string eap_identity; | 4476 std::string eap_identity; |
4466 std::string eap_anonymous_identity; | 4477 std::string eap_anonymous_identity; |
4467 bool save_credentials; | 4478 bool save_credentials; |
4468 std::string psk_key; | 4479 std::string psk_key; |
4469 std::string psk_username; | 4480 std::string psk_username; |
4470 std::string server_hostname; | 4481 std::string server_hostname; |
4482 std::string vpn_client_cert_pkcs11_id; | |
4471 }; | 4483 }; |
4472 ConnectData connect_data_; | 4484 ConnectData connect_data_; |
4473 | 4485 |
4474 DISALLOW_COPY_AND_ASSIGN(NetworkLibraryImpl); | 4486 DISALLOW_COPY_AND_ASSIGN(NetworkLibraryImpl); |
4475 }; | 4487 }; |
4476 | 4488 |
4477 class NetworkLibraryStubImpl : public NetworkLibrary { | 4489 class NetworkLibraryStubImpl : public NetworkLibrary { |
4478 public: | 4490 public: |
4479 NetworkLibraryStubImpl() | 4491 NetworkLibraryStubImpl() |
4480 : ip_address_("1.1.1.1"), | 4492 : ip_address_("1.1.1.1"), |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4607 const std::string& passphrase, | 4619 const std::string& passphrase, |
4608 bool save_credentials) {} | 4620 bool save_credentials) {} |
4609 virtual void ConnectToCellularNetwork(CellularNetwork* network) {} | 4621 virtual void ConnectToCellularNetwork(CellularNetwork* network) {} |
4610 virtual void ConnectToVirtualNetwork(VirtualNetwork* network) {} | 4622 virtual void ConnectToVirtualNetwork(VirtualNetwork* network) {} |
4611 virtual void ConnectToVirtualNetworkPSK( | 4623 virtual void ConnectToVirtualNetworkPSK( |
4612 const std::string& service_name, | 4624 const std::string& service_name, |
4613 const std::string& server, | 4625 const std::string& server, |
4614 const std::string& psk, | 4626 const std::string& psk, |
4615 const std::string& username, | 4627 const std::string& username, |
4616 const std::string& user_passphrase) {} | 4628 const std::string& user_passphrase) {} |
4629 virtual void ConnectToVirtualNetworkCert( | |
4630 const std::string& service_name, | |
4631 const std::string& server_hostname, | |
4632 const std::string& client_cert_id, | |
4633 const std::string& username, | |
4634 const std::string& user_passphrase) {} | |
4617 virtual void SignalCellularPlanPayment() {} | 4635 virtual void SignalCellularPlanPayment() {} |
4618 virtual bool HasRecentCellularPlanPayment() { return false; } | 4636 virtual bool HasRecentCellularPlanPayment() { return false; } |
4619 virtual void DisconnectFromNetwork(const Network* network) {} | 4637 virtual void DisconnectFromNetwork(const Network* network) {} |
4620 virtual void ForgetWifiNetwork(const std::string& service_path) {} | 4638 virtual void ForgetWifiNetwork(const std::string& service_path) {} |
4621 virtual std::string GetCellularHomeCarrierId() const { return std::string(); } | 4639 virtual std::string GetCellularHomeCarrierId() const { return std::string(); } |
4622 virtual bool ethernet_available() const { return true; } | 4640 virtual bool ethernet_available() const { return true; } |
4623 virtual bool wifi_available() const { return false; } | 4641 virtual bool wifi_available() const { return false; } |
4624 virtual bool cellular_available() const { return false; } | 4642 virtual bool cellular_available() const { return false; } |
4625 virtual bool ethernet_enabled() const { return true; } | 4643 virtual bool ethernet_enabled() const { return true; } |
4626 virtual bool wifi_enabled() const { return false; } | 4644 virtual bool wifi_enabled() const { return false; } |
(...skipping 30 matching lines...) Expand all Loading... | |
4657 return new NetworkLibraryStubImpl(); | 4675 return new NetworkLibraryStubImpl(); |
4658 else | 4676 else |
4659 return new NetworkLibraryImpl(); | 4677 return new NetworkLibraryImpl(); |
4660 } | 4678 } |
4661 | 4679 |
4662 } // namespace chromeos | 4680 } // namespace chromeos |
4663 | 4681 |
4664 // Allows InvokeLater without adding refcounting. This class is a Singleton and | 4682 // Allows InvokeLater without adding refcounting. This class is a Singleton and |
4665 // won't be deleted until it's last InvokeLater is run. | 4683 // won't be deleted until it's last InvokeLater is run. |
4666 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImpl); | 4684 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImpl); |
OLD | NEW |