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

Side by Side Diff: chrome/browser/chromeos/extensions/networking_private_event_router.h

Issue 12188027: This adds the onNetworkChanged event to networkingPrivate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review changes Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_EVENT_ROUTER_H_
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_EVENT_ROUTER_H_
7
8 #include "chrome/browser/extensions/event_router.h"
9 #include "chrome/browser/profiles/profile_keyed_service.h"
10 #include "chromeos/network/network_state_handler_observer.h"
11
12 class Profile;
13
14 namespace chromeos {
15
16 // This is a factory class used by the ProfileDependencyManager to instantiate
17 // the event router that will forward events from the NetworkStateHandler to the
18 // JavaScript Networking API.
19 class NetworkingPrivateEventRouter : public ProfileKeyedService,
20 public extensions::EventRouter::Observer,
21 public NetworkStateHandlerObserver {
22 public:
23 explicit NetworkingPrivateEventRouter(Profile* profile);
24 virtual ~NetworkingPrivateEventRouter();
25
26 protected:
27 // ProfileKeyedService overrides:
28 virtual void Shutdown() OVERRIDE;
29
30 // EventRouter::Observer overrides:
31 virtual void OnListenerAdded(
32 const extensions::EventListenerInfo& details) OVERRIDE;
33 virtual void OnListenerRemoved(
34 const extensions::EventListenerInfo& details) OVERRIDE;
35
36 // NetworkStateHandlerObserver overrides:
37 void NetworkListChanged(const NetworkStateList& networks) OVERRIDE;
38 private:
pneubeck (no reviews) 2013/02/05 23:08:30 nit: empty line above
Greg Spencer (Chromium) 2013/02/05 23:17:35 Done.
39 // Decide if we should listen for network changes or not.
40 void StartOrStopListeningForNetworkChanges();
41
42 Profile* profile_;
43 bool listening_;
44
45 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateEventRouter);
46 };
47
48 } // namespace chromeos
49
50 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_EVENT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698