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

Side by Side Diff: chrome/browser/chromeos/cros/network_library.h

Issue 10169014: Parse and store Wifi bssid and frequency properites. (Closed) Base URL: http://git.chromium.org/git/chromium/src@master
Patch Set: Created 8 years, 8 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 (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 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 973
974 explicit WifiNetwork(const std::string& service_path); 974 explicit WifiNetwork(const std::string& service_path);
975 virtual ~WifiNetwork(); 975 virtual ~WifiNetwork();
976 976
977 bool encrypted() const { return encryption_ != SECURITY_NONE; } 977 bool encrypted() const { return encryption_ != SECURITY_NONE; }
978 ConnectionSecurity encryption() const { return encryption_; } 978 ConnectionSecurity encryption() const { return encryption_; }
979 const std::string& passphrase() const { return passphrase_; } 979 const std::string& passphrase() const { return passphrase_; }
980 const std::string& identity() const { return identity_; } 980 const std::string& identity() const { return identity_; }
981 bool passphrase_required() const { return passphrase_required_; } 981 bool passphrase_required() const { return passphrase_required_; }
982 bool hidden_ssid() const { return hidden_ssid_; } 982 bool hidden_ssid() const { return hidden_ssid_; }
983 const std::string& bssid() const { return bssid_; }
984 int frequency() const { return frequency_; }
983 985
984 EAPMethod eap_method() const { return eap_method_; } 986 EAPMethod eap_method() const { return eap_method_; }
985 EAPPhase2Auth eap_phase_2_auth() const { return eap_phase_2_auth_; } 987 EAPPhase2Auth eap_phase_2_auth() const { return eap_phase_2_auth_; }
986 const std::string& eap_server_ca_cert_nss_nickname() const { 988 const std::string& eap_server_ca_cert_nss_nickname() const {
987 return eap_server_ca_cert_nss_nickname_; } 989 return eap_server_ca_cert_nss_nickname_; }
988 const std::string& eap_client_cert_pkcs11_id() const { 990 const std::string& eap_client_cert_pkcs11_id() const {
989 return eap_client_cert_pkcs11_id_; } 991 return eap_client_cert_pkcs11_id_; }
990 const bool eap_use_system_cas() const { return eap_use_system_cas_; } 992 const bool eap_use_system_cas() const { return eap_use_system_cas_; }
991 const std::string& eap_identity() const { return eap_identity_; } 993 const std::string& eap_identity() const { return eap_identity_; }
992 const std::string& eap_anonymous_identity() const { 994 const std::string& eap_anonymous_identity() const {
993 return eap_anonymous_identity_; 995 return eap_anonymous_identity_;
994 } 996 }
995 const std::string& eap_passphrase() const { return eap_passphrase_; } 997 const std::string& eap_passphrase() const { return eap_passphrase_; }
996 const bool eap_save_credentials() const { return eap_save_credentials_; } 998 const bool eap_save_credentials() const { return eap_save_credentials_; }
997 999
998 const std::string& GetPassphrase() const; 1000 const std::string& GetPassphrase() const;
999 1001
1000 bool SetSsid(const std::string& ssid); 1002 // Set property and call SetNetworkServiceProperty:
1001 bool SetHexSsid(const std::string& ssid_hex); 1003
1002 void SetPassphrase(const std::string& passphrase); 1004 void SetPassphrase(const std::string& passphrase);
1003 void SetIdentity(const std::string& identity); 1005 void SetIdentity(const std::string& identity);
1004 void SetHiddenSSID(bool hidden_ssid); 1006 void SetHiddenSSID(bool hidden_ssid);
1005 1007
1006 // 802.1x properties 1008 // 802.1x properties
1007 void SetEAPMethod(EAPMethod method); 1009 void SetEAPMethod(EAPMethod method);
1008 void SetEAPPhase2Auth(EAPPhase2Auth auth); 1010 void SetEAPPhase2Auth(EAPPhase2Auth auth);
1009 void SetEAPServerCaCertNssNickname(const std::string& nss_nickname); 1011 void SetEAPServerCaCertNssNickname(const std::string& nss_nickname);
1010 void SetEAPClientCertPkcs11Id(const std::string& pkcs11_id); 1012 void SetEAPClientCertPkcs11Id(const std::string& pkcs11_id);
1011 void SetEAPUseSystemCAs(bool use_system_cas); 1013 void SetEAPUseSystemCAs(bool use_system_cas);
(...skipping 23 matching lines...) Expand all
1035 friend class NativeWifiNetworkParser; 1037 friend class NativeWifiNetworkParser;
1036 friend class OncWifiNetworkParser; 1038 friend class OncWifiNetworkParser;
1037 1039
1038 // This allows the implementation classes access to privates. 1040 // This allows the implementation classes access to privates.
1039 NETWORK_LIBRARY_IMPL_FRIENDS; 1041 NETWORK_LIBRARY_IMPL_FRIENDS;
1040 1042
1041 // Use these functions at your peril. They are used by the various 1043 // Use these functions at your peril. They are used by the various
1042 // parsers to set state, and really shouldn't be used by anything else 1044 // parsers to set state, and really shouldn't be used by anything else
1043 // because they don't do the error checking and sending to the 1045 // because they don't do the error checking and sending to the
1044 // network layer that the other setters do. 1046 // network layer that the other setters do.
1047
1048 bool SetSsid(const std::string& ssid);
1049 bool SetHexSsid(const std::string& ssid_hex);
1050
1045 void set_encryption(ConnectionSecurity encryption) { 1051 void set_encryption(ConnectionSecurity encryption) {
1046 encryption_ = encryption; 1052 encryption_ = encryption;
1047 } 1053 }
1048 void set_passphrase(const std::string& passphrase) { 1054 void set_passphrase(const std::string& passphrase) {
1049 passphrase_ = passphrase; 1055 passphrase_ = passphrase;
1050 user_passphrase_ = passphrase; 1056 user_passphrase_ = passphrase;
1051 } 1057 }
1052 void set_passphrase_required(bool passphrase_required) { 1058 void set_passphrase_required(bool passphrase_required) {
1053 passphrase_required_ = passphrase_required; 1059 passphrase_required_ = passphrase_required;
1054 } 1060 }
1055 void set_identity(const std::string& identity) { 1061 void set_identity(const std::string& identity) {
1056 identity_ = identity; 1062 identity_ = identity;
1057 } 1063 }
1058 void set_hidden_ssid(bool hidden_ssid) { 1064 void set_hidden_ssid(bool hidden_ssid) {
1059 hidden_ssid_ = hidden_ssid; 1065 hidden_ssid_ = hidden_ssid;
1060 } 1066 }
1067 void set_bssid(const std::string& bssid) { bssid_ = bssid; }
1068 void set_frequency(int frequency) { frequency_ = frequency; }
1061 void set_eap_method(EAPMethod eap_method) { eap_method_ = eap_method; } 1069 void set_eap_method(EAPMethod eap_method) { eap_method_ = eap_method; }
1062 void set_eap_phase_2_auth(EAPPhase2Auth eap_phase_2_auth) { 1070 void set_eap_phase_2_auth(EAPPhase2Auth eap_phase_2_auth) {
1063 eap_phase_2_auth_ = eap_phase_2_auth; 1071 eap_phase_2_auth_ = eap_phase_2_auth;
1064 } 1072 }
1065 void set_eap_server_ca_cert_nss_nickname( 1073 void set_eap_server_ca_cert_nss_nickname(
1066 const std::string& eap_server_ca_cert_nss_nickname) { 1074 const std::string& eap_server_ca_cert_nss_nickname) {
1067 eap_server_ca_cert_nss_nickname_ = eap_server_ca_cert_nss_nickname; 1075 eap_server_ca_cert_nss_nickname_ = eap_server_ca_cert_nss_nickname;
1068 } 1076 }
1069 void set_eap_client_cert_pkcs11_id( 1077 void set_eap_client_cert_pkcs11_id(
1070 const std::string& eap_client_cert_pkcs11_id) { 1078 const std::string& eap_client_cert_pkcs11_id) {
(...skipping 26 matching lines...) Expand all
1097 1105
1098 // Network overrides. 1106 // Network overrides.
1099 virtual void EraseCredentials() OVERRIDE; 1107 virtual void EraseCredentials() OVERRIDE;
1100 virtual void CalculateUniqueId() OVERRIDE; 1108 virtual void CalculateUniqueId() OVERRIDE;
1101 1109
1102 ConnectionSecurity encryption_; 1110 ConnectionSecurity encryption_;
1103 std::string passphrase_; 1111 std::string passphrase_;
1104 bool passphrase_required_; 1112 bool passphrase_required_;
1105 std::string identity_; 1113 std::string identity_;
1106 bool hidden_ssid_; 1114 bool hidden_ssid_;
1115 std::string bssid_;
1116 int frequency_;
1107 1117
1108 EAPMethod eap_method_; 1118 EAPMethod eap_method_;
1109 EAPPhase2Auth eap_phase_2_auth_; 1119 EAPPhase2Auth eap_phase_2_auth_;
1110 std::string eap_server_ca_cert_nss_nickname_; 1120 std::string eap_server_ca_cert_nss_nickname_;
1111 std::string eap_client_cert_pkcs11_id_; 1121 std::string eap_client_cert_pkcs11_id_;
1112 bool eap_use_system_cas_; 1122 bool eap_use_system_cas_;
1113 std::string eap_identity_; 1123 std::string eap_identity_;
1114 std::string eap_anonymous_identity_; 1124 std::string eap_anonymous_identity_;
1115 std::string eap_passphrase_; 1125 std::string eap_passphrase_;
1116 bool eap_save_credentials_; 1126 bool eap_save_credentials_;
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 const std::string& service_path) = 0; 1653 const std::string& service_path) = 0;
1644 1654
1645 // Factory function, creates a new instance and returns ownership. 1655 // Factory function, creates a new instance and returns ownership.
1646 // For normal usage, access the singleton via CrosLibrary::Get(). 1656 // For normal usage, access the singleton via CrosLibrary::Get().
1647 static NetworkLibrary* GetImpl(bool stub); 1657 static NetworkLibrary* GetImpl(bool stub);
1648 }; 1658 };
1649 1659
1650 } // namespace chromeos 1660 } // namespace chromeos
1651 1661
1652 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ 1662 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698