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

Unified Diff: chrome/browser/extensions/api/networking_private/networking_private_service_client.h

Issue 64683014: Mac OS X-specific implementation of Networking Private API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix trybot compilation error. Created 6 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
Index: chrome/browser/extensions/api/networking_private/networking_private_service_client.h
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_service_client.h b/chrome/browser/extensions/api/networking_private/networking_private_service_client.h
index a708fc96e5e4bb3648f4bd71da57e6010250a1d4..78a35a29e86e4f212accfc8b347242c62206e19b 100644
--- a/chrome/browser/extensions/api/networking_private/networking_private_service_client.h
+++ b/chrome/browser/extensions/api/networking_private/networking_private_service_client.h
@@ -22,6 +22,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/utility_process_host.h"
#include "content/public/browser/utility_process_host_client.h"
+#include "net/base/network_change_notifier.h"
namespace base {
class SequencedTaskRunner;
@@ -36,8 +37,12 @@ namespace extensions {
using wifi::WiFiService;
// The client wrapper for the WiFiService and CryptoVerify interfaces to invoke
-// them on worker thread. Always used from UI thread only.
-class NetworkingPrivateServiceClient : public BrowserContextKeyedService {
+// them on worker thread. Observes |OnNetworkChanged| notifications and posts
+// them to WiFiService on worker thread to |UpdateConnectedNetwork|. Always used
+// from UI thread only.
+class NetworkingPrivateServiceClient
+ : public BrowserContextKeyedService,
+ net::NetworkChangeNotifier::NetworkChangeObserver {
public:
// Interface for Verify* methods implementation.
class CryptoVerify {
@@ -188,6 +193,10 @@ class NetworkingPrivateServiceClient : public BrowserContextKeyedService {
// then process can be shut down when there are no more calls pending return.
void RemoveObserver(Observer* network_events_observer);
+ // NetworkChangeNotifier::NetworkChangeObserver implementation.
+ virtual void OnNetworkChanged(
+ net::NetworkChangeNotifier::ConnectionType type) OVERRIDE;
+
private:
// Callbacks to extension api function objects. Keep reference to API object
// and are released in ShutdownOnUIThread. Run when WiFiService calls back

Powered by Google App Engine
This is Rietveld 408576698