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

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

Issue 22295002: Base infrastructure for Networking Private API on Windows and Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use crypto_verify_mock for browser_test. Created 7 years, 2 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_event_router.h
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_event_router.h b/chrome/browser/extensions/api/networking_private/networking_private_event_router.h
index 011c8ddf6a8fcd91a6c37ebfd9635d7b44c6467f..4b3dc12d9cdc130d151e66d98c66eca57e1e58d1 100644
--- a/chrome/browser/extensions/api/networking_private/networking_private_event_router.h
+++ b/chrome/browser/extensions/api/networking_private/networking_private_event_router.h
@@ -6,51 +6,35 @@
#define CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_EVENT_ROUTER_H_
#include "chrome/browser/extensions/event_router.h"
-#include "chromeos/network/network_state_handler_observer.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
class Profile;
-namespace chromeos {
+namespace extensions {
-// This is a factory class used by the BrowserContextDependencyManager
-// to instantiate the event router that will forward events
+// This is an event router that will observe listeners to |NetworksChanged| and
+// |NetworkListChanged| events. On ChromeOS it will forward these events
// from the NetworkStateHandler to the JavaScript Networking API.
class NetworkingPrivateEventRouter : public BrowserContextKeyedService,
- public extensions::EventRouter::Observer,
- public NetworkStateHandlerObserver {
+ public EventRouter::Observer {
public:
- explicit NetworkingPrivateEventRouter(Profile* profile);
- virtual ~NetworkingPrivateEventRouter();
+ static NetworkingPrivateEventRouter* Create(Profile* profile);
protected:
+ NetworkingPrivateEventRouter() {}
+
// BrowserContextKeyedService overrides:
- virtual void Shutdown() OVERRIDE;
+ virtual void Shutdown() = 0;
// EventRouter::Observer overrides:
- virtual void OnListenerAdded(
- const extensions::EventListenerInfo& details) OVERRIDE;
- virtual void OnListenerRemoved(
- const extensions::EventListenerInfo& details) OVERRIDE;
-
- // NetworkStateHandlerObserver overrides:
- virtual void NetworkListChanged() OVERRIDE;
- virtual void NetworkPropertiesUpdated(const NetworkState* network) OVERRIDE;
+ virtual void OnListenerAdded(const EventListenerInfo& details) = 0;
+ virtual void OnListenerRemoved(const EventListenerInfo& details) = 0;
private:
- // Decide if we should listen for network changes or not. If there are any
- // JavaScript listeners registered for the onNetworkChanged event, then we
- // want to register for change notification from the network state handler.
- // Otherwise, we want to unregister and not be listening to network changes.
- void StartOrStopListeningForNetworkChanges();
-
- Profile* profile_;
- bool listening_;
-
DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateEventRouter);
};
-} // namespace chromeos
+} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_EVENT_ROUTER_H_

Powered by Google App Engine
This is Rietveld 408576698