OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_H_ | 5 #ifndef COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_H_ |
6 #define COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_H_ | 6 #define COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 29 matching lines...) Expand all Loading... |
40 // purposes. The string will not include the credential's passphrase. | 40 // purposes. The string will not include the credential's passphrase. |
41 std::string ToString() const; | 41 std::string ToString() const; |
42 | 42 |
43 // Returns true if credential |a| comes before credential |b|. | 43 // Returns true if credential |a| comes before credential |b|. |
44 static bool IsLessThan(const WifiCredential& a, const WifiCredential& b); | 44 static bool IsLessThan(const WifiCredential& a, const WifiCredential& b); |
45 | 45 |
46 // Returns an empty set of WifiCredentials, with the IsLessThan | 46 // Returns an empty set of WifiCredentials, with the IsLessThan |
47 // ordering function plumbed in. | 47 // ordering function plumbed in. |
48 static CredentialSet MakeSet(); | 48 static CredentialSet MakeSet(); |
49 | 49 |
| 50 // Returns |ssid| as an SsidBytes instance. This convenience |
| 51 // function simplifies some tests, which need to instantiate |
| 52 // SsidBytes from string literals. |
| 53 static SsidBytes MakeSsidBytes(const std::string& ssid); |
| 54 |
50 private: | 55 private: |
51 // The WiFi network's SSID. | 56 // The WiFi network's SSID. |
52 const SsidBytes ssid_; | 57 const SsidBytes ssid_; |
53 // The WiFi network's security class (e.g. WEP, PSK). | 58 // The WiFi network's security class (e.g. WEP, PSK). |
54 const WifiSecurityClass security_class_; | 59 const WifiSecurityClass security_class_; |
55 // The passphrase for connecting to the network. | 60 // The passphrase for connecting to the network. |
56 const std::string passphrase_; | 61 const std::string passphrase_; |
57 }; | 62 }; |
58 | 63 |
59 } // namespace wifi_sync | 64 } // namespace wifi_sync |
60 | 65 |
61 #endif // COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_H_ | 66 #endif // COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_H_ |
OLD | NEW |