Chromium Code Reviews| Index: net/base/network_change_notifier.h |
| diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h |
| index b29426e3dc825a3014e228974d4c5bb61ee57a8f..881b33476ce337475d35be8e440cda71b9e05c05 100644 |
| --- a/net/base/network_change_notifier.h |
| +++ b/net/base/network_change_notifier.h |
| @@ -47,6 +47,27 @@ class NET_EXPORT NetworkChangeNotifier { |
| CONNECTION_LAST = CONNECTION_BLUETOOTH |
| }; |
| + // Wifi access point security mode definitions. |
| + enum WifiSecurityMode { |
| + WIFI_SECURITY_UNKNOWN = 0, |
| + WIFI_SECURITY_WPA = 1, |
| + WIFI_SECURITY_WEP = 2, |
| + WIFI_SECURITY_RSN = 3, |
| + WIFI_SECURITY_802_1X = 4, |
| + WIFI_SECURITY_PSK = 5, |
| + WIFI_SECURITY_NONE |
| + }; |
| + |
| + // Information of the currently connected wifi access point. |
| + struct NET_EXPORT WifiAccessPointInfo { |
| + WifiSecurityMode security; |
| + std::string bssid; |
| + std::string model_number; |
| + std::string model_name; |
| + std::string device_name; |
| + std::string oui_list; |
| + }; |
| + |
| class NET_EXPORT IPAddressObserver { |
| public: |
| // Will be called when the IP address of the primary interface changes. |
| @@ -135,6 +156,11 @@ class NET_EXPORT NetworkChangeNotifier { |
| // cheap as this could be called (repeatedly) from the network thread. |
| virtual ConnectionType GetCurrentConnectionType() const = 0; |
| + // Fill in the wifi access point info if device is currently connected to a |
| + // wifi access point. Return true if device is connected to a wifi access |
| + // point, false otherwise. |
| + virtual bool GetCurrentWifiAccessPointInfo(WifiAccessPointInfo *info); |
|
Ilya Sherman
2014/07/11 01:32:18
nit: Swap space and asterisk.
zqiu1
2014/07/14 17:21:58
Done.
|
| + |
| // Replaces the default class factory instance of NetworkChangeNotifier class. |
| // The method will take over the ownership of |factory| object. |
| static void SetFactory(NetworkChangeNotifierFactory* factory); |
| @@ -159,6 +185,9 @@ class NET_EXPORT NetworkChangeNotifier { |
| // the internet, the connection type is CONNECTION_WIFI. |
| static ConnectionType GetConnectionType(); |
| + // Retreive the wifi access point info. |
| + static bool GetWifiAccessPointInfo(WifiAccessPointInfo *info); |
|
Ilya Sherman
2014/07/11 01:32:18
nit: Swap space and asterisk.
zqiu1
2014/07/14 17:21:58
Done.
|
| + |
| // Retrieve the last read DnsConfig. This could be expensive if the system has |
| // a large HOSTS file. |
| static void GetDnsConfig(DnsConfig* config); |