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 #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" | |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/memory/ref_counted.h" | |
14 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/singleton.h" | 17 #include "base/memory/singleton.h" |
16 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
17 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
18 #include "base/timer/timer.h" | 20 #include "base/timer/timer.h" |
19 #include "base/values.h" | 21 #include "base/values.h" |
20 #include "chrome/browser/chromeos/cros/network_constants.h" | 22 #include "chrome/browser/chromeos/cros/network_constants.h" |
21 #include "chromeos/network/network_ip_config.h" | 23 #include "chromeos/network/network_ip_config.h" |
22 #include "chromeos/network/network_ui_data.h" | 24 #include "chromeos/network/network_ui_data.h" |
23 #include "chromeos/network/network_util.h" | 25 #include "chromeos/network/network_util.h" |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
649 }; | 651 }; |
650 | 652 |
651 // Class for networks of TYPE_VPN. | 653 // Class for networks of TYPE_VPN. |
652 class VirtualNetwork : public Network { | 654 class VirtualNetwork : public Network { |
653 public: | 655 public: |
654 explicit VirtualNetwork(const std::string& service_path); | 656 explicit VirtualNetwork(const std::string& service_path); |
655 virtual ~VirtualNetwork(); | 657 virtual ~VirtualNetwork(); |
656 | 658 |
657 const std::string& server_hostname() const { return server_hostname_; } | 659 const std::string& server_hostname() const { return server_hostname_; } |
658 ProviderType provider_type() const { return provider_type_; } | 660 ProviderType provider_type() const { return provider_type_; } |
659 const std::string& ca_cert_nss() const { return ca_cert_nss_; } | 661 const std::string& ca_cert_pem() const { |
662 return ca_cert_pem_; | |
Mattias Nissler (ping if slow)
2013/07/02 13:00:35
nit: no need for line break.
pneubeck (no reviews)
2013/07/02 14:38:43
Done.
| |
663 } | |
660 const std::string& psk_passphrase() const { return psk_passphrase_; } | 664 const std::string& psk_passphrase() const { return psk_passphrase_; } |
661 bool psk_passphrase_required() const { return psk_passphrase_required_; } | 665 bool psk_passphrase_required() const { return psk_passphrase_required_; } |
662 const std::string& client_cert_id() const { return client_cert_id_; } | 666 const std::string& client_cert_id() const { return client_cert_id_; } |
663 const std::string& username() const { return username_; } | 667 const std::string& username() const { return username_; } |
664 const std::string& user_passphrase() const { return user_passphrase_; } | 668 const std::string& user_passphrase() const { return user_passphrase_; } |
665 bool user_passphrase_required() const { return user_passphrase_required_; } | 669 bool user_passphrase_required() const { return user_passphrase_required_; } |
666 const std::string& group_name() const { return group_name_; } | 670 const std::string& group_name() const { return group_name_; } |
667 | 671 |
668 // Sets the well-known PKCS#11 slot and PIN for accessing certificates. | 672 // Sets the well-known PKCS#11 slot and PIN for accessing certificates. |
669 void SetCertificateSlotAndPin( | 673 void SetCertificateSlotAndPin( |
670 const std::string& slot, const std::string& pin); | 674 const std::string& slot, const std::string& pin); |
671 | 675 |
672 // Network overrides. | 676 // Network overrides. |
673 virtual bool RequiresUserProfile() const OVERRIDE; | 677 virtual bool RequiresUserProfile() const OVERRIDE; |
674 virtual void CopyCredentialsFromRemembered(Network* remembered) OVERRIDE; | 678 virtual void CopyCredentialsFromRemembered(Network* remembered) OVERRIDE; |
675 virtual void AttemptConnection(const base::Closure& connect) OVERRIDE; | 679 virtual void AttemptConnection(const base::Closure& connect) OVERRIDE; |
676 | 680 |
677 // Public getters. | 681 // Public getters. |
678 bool NeedMoreInfoToConnect() const; | 682 bool NeedMoreInfoToConnect() const; |
679 std::string GetProviderTypeString() const; | 683 std::string GetProviderTypeString() const; |
680 // Returns true if a PSK passphrase is required to connect. | 684 // Returns true if a PSK passphrase is required to connect. |
681 bool IsPSKPassphraseRequired() const; | 685 bool IsPSKPassphraseRequired() const; |
682 // Returns true if a user passphrase is required to connect. | 686 // Returns true if a user passphrase is required to connect. |
683 bool IsUserPassphraseRequired() const; | 687 bool IsUserPassphraseRequired() const; |
684 | 688 |
685 // Public setters. | 689 // Public setters. |
686 void SetCACertNSS(const std::string& ca_cert_nss); | 690 void SetCACertPEM(const std::string& ca_cert_pem); |
687 void SetL2TPIPsecPSKCredentials(const std::string& psk_passphrase, | 691 void SetL2TPIPsecPSKCredentials(const std::string& psk_passphrase, |
688 const std::string& username, | 692 const std::string& username, |
689 const std::string& user_passphrase, | 693 const std::string& user_passphrase, |
690 const std::string& group_name); | 694 const std::string& group_name); |
691 void SetL2TPIPsecCertCredentials(const std::string& client_cert_id, | 695 void SetL2TPIPsecCertCredentials(const std::string& client_cert_id, |
692 const std::string& username, | 696 const std::string& username, |
693 const std::string& user_passphrase, | 697 const std::string& user_passphrase, |
694 const std::string& group_name); | 698 const std::string& group_name); |
695 void SetOpenVPNCredentials(const std::string& client_cert_id, | 699 void SetOpenVPNCredentials(const std::string& client_cert_id, |
696 const std::string& username, | 700 const std::string& username, |
(...skipping 16 matching lines...) Expand all Loading... | |
713 // Use these functions at your peril. They are used by the various | 717 // Use these functions at your peril. They are used by the various |
714 // parsers to set state, and really shouldn't be used by anything else | 718 // parsers to set state, and really shouldn't be used by anything else |
715 // because they don't do the error checking and sending to the | 719 // because they don't do the error checking and sending to the |
716 // network layer that the other setters do. | 720 // network layer that the other setters do. |
717 void set_server_hostname(const std::string& server_hostname) { | 721 void set_server_hostname(const std::string& server_hostname) { |
718 server_hostname_ = server_hostname; | 722 server_hostname_ = server_hostname; |
719 } | 723 } |
720 void set_provider_type(ProviderType provider_type) { | 724 void set_provider_type(ProviderType provider_type) { |
721 provider_type_ = provider_type; | 725 provider_type_ = provider_type; |
722 } | 726 } |
723 void set_ca_cert_nss(const std::string& ca_cert_nss) { | 727 void set_ca_cert_pem(const std::string& ca_cert_pem) { |
724 ca_cert_nss_ = ca_cert_nss; | 728 ca_cert_pem_ = ca_cert_pem; |
725 } | 729 } |
726 void set_psk_passphrase(const std::string& psk_passphrase) { | 730 void set_psk_passphrase(const std::string& psk_passphrase) { |
727 psk_passphrase_ = psk_passphrase; | 731 psk_passphrase_ = psk_passphrase; |
728 } | 732 } |
729 void set_psk_passphrase_required(bool psk_passphrase_required) { | 733 void set_psk_passphrase_required(bool psk_passphrase_required) { |
730 psk_passphrase_required_ = psk_passphrase_required; | 734 psk_passphrase_required_ = psk_passphrase_required; |
731 } | 735 } |
732 void set_client_cert_id(const std::string& client_cert_id) { | 736 void set_client_cert_id(const std::string& client_cert_id) { |
733 client_cert_id_ = client_cert_id; | 737 client_cert_id_ = client_cert_id; |
734 } | 738 } |
(...skipping 19 matching lines...) Expand all Loading... | |
754 | 758 |
755 // Network overrides. | 759 // Network overrides. |
756 virtual void EraseCredentials() OVERRIDE; | 760 virtual void EraseCredentials() OVERRIDE; |
757 virtual void CalculateUniqueId() OVERRIDE; | 761 virtual void CalculateUniqueId() OVERRIDE; |
758 | 762 |
759 // VirtualNetwork private methods. | 763 // VirtualNetwork private methods. |
760 bool ParseProviderValue(int index, const base::Value* value); | 764 bool ParseProviderValue(int index, const base::Value* value); |
761 | 765 |
762 std::string server_hostname_; | 766 std::string server_hostname_; |
763 ProviderType provider_type_; | 767 ProviderType provider_type_; |
764 // NSS nickname for server CA certificate. | 768 std::string ca_cert_pem_; |
765 std::string ca_cert_nss_; | |
766 std::string psk_passphrase_; | 769 std::string psk_passphrase_; |
767 bool psk_passphrase_required_; | 770 bool psk_passphrase_required_; |
768 // PKCS#11 ID for client certificate. | 771 // PKCS#11 ID for client certificate. |
769 std::string client_cert_id_; | 772 std::string client_cert_id_; |
770 std::string username_; | 773 std::string username_; |
771 std::string user_passphrase_; | 774 std::string user_passphrase_; |
772 bool user_passphrase_required_; | 775 bool user_passphrase_required_; |
773 std::string group_name_; | 776 std::string group_name_; |
774 | 777 |
775 // Weak pointer factory for wrapping pointers to this network in callbacks. | 778 // Weak pointer factory for wrapping pointers to this network in callbacks. |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
988 ConnectionSecurity encryption() const { return encryption_; } | 991 ConnectionSecurity encryption() const { return encryption_; } |
989 const std::string& passphrase() const { return passphrase_; } | 992 const std::string& passphrase() const { return passphrase_; } |
990 const std::string& identity() const { return identity_; } | 993 const std::string& identity() const { return identity_; } |
991 bool passphrase_required() const { return passphrase_required_; } | 994 bool passphrase_required() const { return passphrase_required_; } |
992 bool hidden_ssid() const { return hidden_ssid_; } | 995 bool hidden_ssid() const { return hidden_ssid_; } |
993 const std::string& bssid() const { return bssid_; } | 996 const std::string& bssid() const { return bssid_; } |
994 int frequency() const { return frequency_; } | 997 int frequency() const { return frequency_; } |
995 | 998 |
996 EAPMethod eap_method() const { return eap_method_; } | 999 EAPMethod eap_method() const { return eap_method_; } |
997 EAPPhase2Auth eap_phase_2_auth() const { return eap_phase_2_auth_; } | 1000 EAPPhase2Auth eap_phase_2_auth() const { return eap_phase_2_auth_; } |
998 const std::string& eap_server_ca_cert_nss_nickname() const { | 1001 const std::string& eap_server_ca_cert_pem() const { |
999 return eap_server_ca_cert_nss_nickname_; } | 1002 return eap_server_ca_cert_pem_; } |
1000 const std::string& eap_client_cert_pkcs11_id() const { | 1003 const std::string& eap_client_cert_pkcs11_id() const { |
1001 return eap_client_cert_pkcs11_id_; } | 1004 return eap_client_cert_pkcs11_id_; } |
1002 const bool eap_use_system_cas() const { return eap_use_system_cas_; } | 1005 const bool eap_use_system_cas() const { return eap_use_system_cas_; } |
1003 const std::string& eap_identity() const { return eap_identity_; } | 1006 const std::string& eap_identity() const { return eap_identity_; } |
1004 const std::string& eap_anonymous_identity() const { | 1007 const std::string& eap_anonymous_identity() const { |
1005 return eap_anonymous_identity_; | 1008 return eap_anonymous_identity_; |
1006 } | 1009 } |
1007 const std::string& eap_passphrase() const { return eap_passphrase_; } | 1010 const std::string& eap_passphrase() const { return eap_passphrase_; } |
1008 const bool eap_save_credentials() const { return eap_save_credentials_; } | 1011 const bool eap_save_credentials() const { return eap_save_credentials_; } |
1009 | 1012 |
1010 const std::string& GetPassphrase() const; | 1013 const std::string& GetPassphrase() const; |
1011 | 1014 |
1012 // Set property and call SetNetworkServiceProperty: | 1015 // Set property and call SetNetworkServiceProperty: |
1013 | 1016 |
1014 void SetPassphrase(const std::string& passphrase); | 1017 void SetPassphrase(const std::string& passphrase); |
1015 void SetIdentity(const std::string& identity); | 1018 void SetIdentity(const std::string& identity); |
1016 void SetHiddenSSID(bool hidden_ssid); | 1019 void SetHiddenSSID(bool hidden_ssid); |
1017 | 1020 |
1018 // 802.1x properties | 1021 // 802.1x properties |
1019 void SetEAPMethod(EAPMethod method); | 1022 void SetEAPMethod(EAPMethod method); |
1020 void SetEAPPhase2Auth(EAPPhase2Auth auth); | 1023 void SetEAPPhase2Auth(EAPPhase2Auth auth); |
1021 void SetEAPServerCaCertNssNickname(const std::string& nss_nickname); | 1024 void SetEAPServerCaCertPEM(const std::string& ca_cert_pem); |
1022 void SetEAPClientCertPkcs11Id(const std::string& pkcs11_id); | 1025 void SetEAPClientCertPkcs11Id(const std::string& pkcs11_id); |
1023 void SetEAPUseSystemCAs(bool use_system_cas); | 1026 void SetEAPUseSystemCAs(bool use_system_cas); |
1024 void SetEAPIdentity(const std::string& identity); | 1027 void SetEAPIdentity(const std::string& identity); |
1025 void SetEAPAnonymousIdentity(const std::string& identity); | 1028 void SetEAPAnonymousIdentity(const std::string& identity); |
1026 void SetEAPPassphrase(const std::string& passphrase); | 1029 void SetEAPPassphrase(const std::string& passphrase); |
1027 | 1030 |
1028 // Sets the well-known PKCS#11 PIN for accessing certificates. | 1031 // Sets the well-known PKCS#11 PIN for accessing certificates. |
1029 void SetCertificatePin(const std::string& pin); | 1032 void SetCertificatePin(const std::string& pin); |
1030 | 1033 |
1031 // Network overrides. | 1034 // Network overrides. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1072 } | 1075 } |
1073 void set_hidden_ssid(bool hidden_ssid) { | 1076 void set_hidden_ssid(bool hidden_ssid) { |
1074 hidden_ssid_ = hidden_ssid; | 1077 hidden_ssid_ = hidden_ssid; |
1075 } | 1078 } |
1076 void set_bssid(const std::string& bssid) { bssid_ = bssid; } | 1079 void set_bssid(const std::string& bssid) { bssid_ = bssid; } |
1077 void set_frequency(int frequency) { frequency_ = frequency; } | 1080 void set_frequency(int frequency) { frequency_ = frequency; } |
1078 void set_eap_method(EAPMethod eap_method) { eap_method_ = eap_method; } | 1081 void set_eap_method(EAPMethod eap_method) { eap_method_ = eap_method; } |
1079 void set_eap_phase_2_auth(EAPPhase2Auth eap_phase_2_auth) { | 1082 void set_eap_phase_2_auth(EAPPhase2Auth eap_phase_2_auth) { |
1080 eap_phase_2_auth_ = eap_phase_2_auth; | 1083 eap_phase_2_auth_ = eap_phase_2_auth; |
1081 } | 1084 } |
1082 void set_eap_server_ca_cert_nss_nickname( | 1085 void set_eap_server_ca_cert_pem(const std::string& eap_server_ca_cert_pem) { |
1083 const std::string& eap_server_ca_cert_nss_nickname) { | 1086 eap_server_ca_cert_pem_ = eap_server_ca_cert_pem; |
1084 eap_server_ca_cert_nss_nickname_ = eap_server_ca_cert_nss_nickname; | |
1085 } | 1087 } |
1086 void set_eap_client_cert_pkcs11_id( | 1088 void set_eap_client_cert_pkcs11_id( |
1087 const std::string& eap_client_cert_pkcs11_id) { | 1089 const std::string& eap_client_cert_pkcs11_id) { |
1088 eap_client_cert_pkcs11_id_ = eap_client_cert_pkcs11_id; | 1090 eap_client_cert_pkcs11_id_ = eap_client_cert_pkcs11_id; |
1089 } | 1091 } |
1090 void set_eap_use_system_cas(bool eap_use_system_cas) { | 1092 void set_eap_use_system_cas(bool eap_use_system_cas) { |
1091 eap_use_system_cas_ = eap_use_system_cas; | 1093 eap_use_system_cas_ = eap_use_system_cas; |
1092 } | 1094 } |
1093 void set_eap_identity(const std::string& eap_identity) { | 1095 void set_eap_identity(const std::string& eap_identity) { |
1094 eap_identity_ = eap_identity; | 1096 eap_identity_ = eap_identity; |
(...skipping 24 matching lines...) Expand all Loading... | |
1119 ConnectionSecurity encryption_; | 1121 ConnectionSecurity encryption_; |
1120 std::string passphrase_; | 1122 std::string passphrase_; |
1121 bool passphrase_required_; | 1123 bool passphrase_required_; |
1122 std::string identity_; | 1124 std::string identity_; |
1123 bool hidden_ssid_; | 1125 bool hidden_ssid_; |
1124 std::string bssid_; | 1126 std::string bssid_; |
1125 int frequency_; | 1127 int frequency_; |
1126 | 1128 |
1127 EAPMethod eap_method_; | 1129 EAPMethod eap_method_; |
1128 EAPPhase2Auth eap_phase_2_auth_; | 1130 EAPPhase2Auth eap_phase_2_auth_; |
1129 std::string eap_server_ca_cert_nss_nickname_; | 1131 std::string eap_server_ca_cert_pem_; |
1130 std::string eap_client_cert_pkcs11_id_; | 1132 std::string eap_client_cert_pkcs11_id_; |
1131 bool eap_use_system_cas_; | 1133 bool eap_use_system_cas_; |
1132 std::string eap_identity_; | 1134 std::string eap_identity_; |
1133 std::string eap_anonymous_identity_; | 1135 std::string eap_anonymous_identity_; |
1134 std::string eap_passphrase_; | 1136 std::string eap_passphrase_; |
1135 bool eap_save_credentials_; | 1137 bool eap_save_credentials_; |
1136 | 1138 |
1137 // Internal state (not stored in shill). | 1139 // Internal state (not stored in shill). |
1138 // Passphrase set by user (stored for UI). | 1140 // Passphrase set by user (stored for UI). |
1139 std::string user_passphrase_; | 1141 std::string user_passphrase_; |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1557 virtual void ConnectToVirtualNetwork(VirtualNetwork* network) = 0; | 1559 virtual void ConnectToVirtualNetwork(VirtualNetwork* network) = 0; |
1558 | 1560 |
1559 // Connect to an unconfigured network with given SSID, security, passphrase, | 1561 // Connect to an unconfigured network with given SSID, security, passphrase, |
1560 // and optional EAP configuration. If |security| is SECURITY_8021X, | 1562 // and optional EAP configuration. If |security| is SECURITY_8021X, |
1561 // |eap_config| must be provided. | 1563 // |eap_config| must be provided. |
1562 struct EAPConfigData { | 1564 struct EAPConfigData { |
1563 EAPConfigData(); | 1565 EAPConfigData(); |
1564 ~EAPConfigData(); | 1566 ~EAPConfigData(); |
1565 EAPMethod method; | 1567 EAPMethod method; |
1566 EAPPhase2Auth auth; | 1568 EAPPhase2Auth auth; |
1567 std::string server_ca_cert_nss_nickname; | 1569 std::string server_ca_cert_pem; |
1568 bool use_system_cas; | 1570 bool use_system_cas; |
1569 std::string client_cert_pkcs11_id; | 1571 std::string client_cert_pkcs11_id; |
1570 std::string identity; | 1572 std::string identity; |
1571 std::string anonymous_identity; | 1573 std::string anonymous_identity; |
1572 }; | 1574 }; |
1573 virtual void ConnectToUnconfiguredWifiNetwork( | 1575 virtual void ConnectToUnconfiguredWifiNetwork( |
1574 const std::string& ssid, | 1576 const std::string& ssid, |
1575 ConnectionSecurity security, | 1577 ConnectionSecurity security, |
1576 const std::string& passphrase, | 1578 const std::string& passphrase, |
1577 const EAPConfigData* eap_config, | 1579 const EAPConfigData* eap_config, |
1578 bool save_credentials, | 1580 bool save_credentials, |
1579 bool shared) = 0; | 1581 bool shared) = 0; |
1580 | 1582 |
1581 // Connect to the specified virtual network with service name. | 1583 // Connect to the specified virtual network with service name. |
1582 // VPNConfigData must be provided. | 1584 // VPNConfigData must be provided. |
1583 struct VPNConfigData { | 1585 struct VPNConfigData { |
1584 VPNConfigData(); | 1586 VPNConfigData(); |
1585 ~VPNConfigData(); | 1587 ~VPNConfigData(); |
1586 std::string psk; | 1588 std::string psk; |
1587 std::string server_ca_cert_nss_nickname; | 1589 std::string server_ca_cert_pem; |
1588 std::string client_cert_pkcs11_id; | 1590 std::string client_cert_pkcs11_id; |
1589 std::string username; | 1591 std::string username; |
1590 std::string user_passphrase; | 1592 std::string user_passphrase; |
1591 std::string otp; | 1593 std::string otp; |
1592 std::string group_name; | 1594 std::string group_name; |
1593 bool save_credentials; | 1595 bool save_credentials; |
1594 }; | 1596 }; |
1595 virtual void ConnectToUnconfiguredVirtualNetwork( | 1597 virtual void ConnectToUnconfiguredVirtualNetwork( |
1596 const std::string& service_name, | 1598 const std::string& service_name, |
1597 const std::string& server_hostname, | 1599 const std::string& server_hostname, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1658 NetworkServicePropertiesCallback; | 1660 NetworkServicePropertiesCallback; |
1659 virtual void RequestNetworkServiceProperties( | 1661 virtual void RequestNetworkServiceProperties( |
1660 const std::string& service_path, | 1662 const std::string& service_path, |
1661 const NetworkServicePropertiesCallback& callback) = 0; | 1663 const NetworkServicePropertiesCallback& callback) = 0; |
1662 | 1664 |
1663 // This will connect to a preferred network if the currently connected | 1665 // This will connect to a preferred network if the currently connected |
1664 // network is not preferred. This should be called when the active profile | 1666 // network is not preferred. This should be called when the active profile |
1665 // changes. | 1667 // changes. |
1666 virtual void SwitchToPreferredNetwork() = 0; | 1668 virtual void SwitchToPreferredNetwork() = 0; |
1667 | 1669 |
1668 // Load networks from an NetworkConfigurations list of ONC. | 1670 // Load networks from a list of NetworkConfigurations of ONC. |
1669 virtual void LoadOncNetworks(const base::ListValue& network_configs, | 1671 virtual void LoadOncNetworks(const base::ListValue& network_configs, |
1670 onc::ONCSource source) = 0; | 1672 onc::ONCSource source) = 0; |
1671 | 1673 |
1672 // This sets the active network for the network type. Note: priority order | 1674 // This sets the active network for the network type. Note: priority order |
1673 // is unchanged (i.e. if a wifi network is set to active, but an ethernet | 1675 // is unchanged (i.e. if a wifi network is set to active, but an ethernet |
1674 // network is still active, active_network() will still return the ethernet | 1676 // network is still active, active_network() will still return the ethernet |
1675 // network). Other networks of the same type will become inactive. | 1677 // network). Other networks of the same type will become inactive. |
1676 // Used for testing. | 1678 // Used for testing. |
1677 virtual bool SetActiveNetwork(ConnectionType type, | 1679 virtual bool SetActiveNetwork(ConnectionType type, |
1678 const std::string& service_path) = 0; | 1680 const std::string& service_path) = 0; |
1679 | 1681 |
1680 // Factory function, creates a new instance and returns ownership. | 1682 // Factory function, creates a new instance and returns ownership. |
1681 // For normal usage, access the singleton via CrosLibrary::Get(). | 1683 // For normal usage, access the singleton via CrosLibrary::Get(). |
1682 static NetworkLibrary* GetImpl(bool stub); | 1684 static NetworkLibrary* GetImpl(bool stub); |
1683 }; | 1685 }; |
1684 | 1686 |
1685 } // namespace chromeos | 1687 } // namespace chromeos |
1686 | 1688 |
1687 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 1689 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
OLD | NEW |