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

Unified Diff: net/base/network_change_notifier.h

Issue 899573002: Add WiFi SSID getter to NetworkChangeNotifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 5 years, 11 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
« no previous file with comments | « net/base/address_tracker_linux_unittest.cc ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier.h
diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h
index 964fcf3c4b9a3a050a8030fe65da8bd0b4b0a304..72bc308454e775aef42cbe555fd9649cb4eab097 100644
--- a/net/base/network_change_notifier.h
+++ b/net/base/network_change_notifier.h
@@ -5,6 +5,7 @@
#ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_H_
#define NET_BASE_NETWORK_CHANGE_NOTIFIER_H_
+#include <string>
#include <vector>
#include "base/basictypes.h"
@@ -204,6 +205,10 @@ class NET_EXPORT NetworkChangeNotifier {
// cheap as it is called often.
virtual ConnectionType GetCurrentConnectionType() const = 0;
+ // See the description of NetworkChangeNotifier::GetConnectionType.
+ // Implementations must be thread-safe.
+ virtual std::string GetCurrentWiFiSSID() const = 0;
+
// Replaces the default class factory instance of NetworkChangeNotifier class.
// The method will take over the ownership of |factory| object.
static void SetFactory(NetworkChangeNotifierFactory* factory);
@@ -228,6 +233,13 @@ class NET_EXPORT NetworkChangeNotifier {
// the internet, the connection type is CONNECTION_WIFI.
static ConnectionType GetConnectionType();
+ // Returns the SSID of the current Wi-Fi connection.
+ // A non empty string return value means that the current connection is a
+ // Wi-Fi connection. However, an empty string doesn't necessarily mean the
+ // connection isn't Wi-Fi, any error getting the SSID results in an empty
+ // string.
+ static std::string GetWiFiSSID();
+
// Returns a theoretical upper limit on download bandwidth, potentially based
// on underlying connection type, signal strength, or some other signal. The
// default mapping of connection type to maximum bandwidth is provided in the
« no previous file with comments | « net/base/address_tracker_linux_unittest.cc ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698