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

Unified Diff: net/base/network_change_notifier.h

Issue 328793002: Add wifi AP info to system profile metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: net/base/network_change_notifier.h
diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h
index 4671e4915b0e0de60ca70e031801aa2d3139ae6f..505d7926bc7243d371a4014626d8d9bc00fc7c94 100644
--- a/net/base/network_change_notifier.h
+++ b/net/base/network_change_notifier.h
@@ -46,6 +46,20 @@ class NET_EXPORT NetworkChangeNotifier {
CONNECTION_LAST = CONNECTION_NONE
};
+ // Information of the currently connected wifi AP.
+ struct NET_EXPORT WifiApInfo {
+ WifiApInfo();
+ ~WifiApInfo();
stevenjb 2014/06/12 20:54:40 empty constructors (and destructors for no-virtual
zqiu1 2014/07/07 23:37:33 Done.
+
+ std::string bssid;
+ std::string security;
+ std::string model_number;
+ std::string model_name;
+ std::string device_name;
+ std::string manufacturer;
+ std::string oui_list;
+ };
+
class NET_EXPORT IPAddressObserver {
public:
// Will be called when the IP address of the primary interface changes.
@@ -134,6 +148,10 @@ class NET_EXPORT NetworkChangeNotifier {
// cheap as this could be called (repeatedly) from the network thread.
virtual ConnectionType GetCurrentConnectionType() const = 0;
+ // Fill in the wifi AP info if device is currently connected to a wifi AP,
+ // Return true if device is connected to a wifi AP, false otherwise.
+ virtual bool GetCurrentWifiApInfo(WifiApInfo &info) { return false; }
stevenjb 2014/06/12 20:54:40 virtual methods should never be inlined (only exec
zqiu1 2014/07/07 23:37:33 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);
@@ -158,6 +176,9 @@ class NET_EXPORT NetworkChangeNotifier {
// the internet, the connection type is CONNECTION_WIFI.
static ConnectionType GetConnectionType();
+ // Retreive the wifi AP info.
+ static bool GetWifiApInfo(WifiApInfo &info);
+
// Retrieve the last read DnsConfig. This could be expensive if the system has
// a large HOSTS file.
static void GetDnsConfig(DnsConfig* config);

Powered by Google App Engine
This is Rietveld 408576698