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

Side by Side Diff: chrome/browser/chromeos/net/network_change_notifier_chromeos.h

Issue 8271024: chromeos: Add power supply info reading capability (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased after http://codereview.chromium.org/8423077 Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_CHANGE_NOTIFIER_CHROMEOS_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_CHANGE_NOTIFIER_CHROMEOS_H_
6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_CHANGE_NOTIFIER_CHROMEOS_H_ 6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_CHANGE_NOTIFIER_CHROMEOS_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/task.h" 11 #include "base/task.h"
12 #include "chrome/browser/chromeos/cros/network_library.h" 12 #include "chrome/browser/chromeos/cros/network_library.h"
13 #include "chrome/browser/chromeos/cros/power_library.h" 13 #include "chrome/browser/chromeos/cros/power_library.h"
14 #include "chrome/browser/chromeos/dbus/power_manager_client.h"
14 #include "net/base/network_change_notifier.h" 15 #include "net/base/network_change_notifier.h"
15 16
16 namespace chromeos { 17 namespace chromeos {
17 18
18 class OnlineStatusReportThreadTask; 19 class OnlineStatusReportThreadTask;
19 20
20 class NetworkChangeNotifierChromeos 21 class NetworkChangeNotifierChromeos
21 : public net::NetworkChangeNotifier, 22 : public net::NetworkChangeNotifier,
22 public chromeos::PowerLibrary::Observer, 23 public chromeos::PowerLibrary::Observer,
24 public chromeos::PowerManagerClient::Observer,
23 public chromeos::NetworkLibrary::NetworkObserver, 25 public chromeos::NetworkLibrary::NetworkObserver,
24 public chromeos::NetworkLibrary::NetworkManagerObserver { 26 public chromeos::NetworkLibrary::NetworkManagerObserver {
25 public: 27 public:
26 NetworkChangeNotifierChromeos(); 28 NetworkChangeNotifierChromeos();
27 virtual ~NetworkChangeNotifierChromeos(); 29 virtual ~NetworkChangeNotifierChromeos();
28 30
29 // Initializes the network change notifier. Starts to observe changes 31 // Initializes the network change notifier. Starts to observe changes
30 // from the power manager and the network manager. 32 // from the power manager and the network manager.
31 void Init(); 33 void Init();
32 34
33 private: 35 private:
34 friend class OnlineStatusReportThreadTask; 36 friend class OnlineStatusReportThreadTask;
35 37
36 // PowerLibrary::Observer overrides. 38 // PowerManagerClient::Observer overrides.
37 virtual void PowerChanged(const PowerSupplyStatus& status) OVERRIDE; 39 virtual void PowerChanged(const PowerSupplyStatus& status) OVERRIDE;
40
41 // PowerLibrary::Observer overrides
38 virtual void SystemResumed() OVERRIDE; 42 virtual void SystemResumed() OVERRIDE;
39 43
40 // NetworkChangeNotifier overrides. 44 // NetworkChangeNotifier overrides.
41 virtual bool IsCurrentlyOffline() const OVERRIDE; 45 virtual bool IsCurrentlyOffline() const OVERRIDE;
42 46
43 // NetworkManagerObserver overrides: 47 // NetworkManagerObserver overrides:
44 virtual void OnNetworkManagerChanged(chromeos::NetworkLibrary* obj) OVERRIDE; 48 virtual void OnNetworkManagerChanged(chromeos::NetworkLibrary* obj) OVERRIDE;
45 49
46 // NetworkObserver overrides: 50 // NetworkObserver overrides:
47 virtual void OnNetworkChanged(chromeos::NetworkLibrary* cros, 51 virtual void OnNetworkChanged(chromeos::NetworkLibrary* cros,
(...skipping 24 matching lines...) Expand all
72 // Current active network's IP address. 76 // Current active network's IP address.
73 std::string ip_address_; 77 std::string ip_address_;
74 78
75 OnlineStatusReportThreadTask* online_notification_task_; 79 OnlineStatusReportThreadTask* online_notification_task_;
76 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierChromeos); 80 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierChromeos);
77 }; 81 };
78 82
79 } // namespace chromeos 83 } // namespace chromeos
80 84
81 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_CHANGE_NOTIFIER_CHROMEOS_H_ 85 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_CHANGE_NOTIFIER_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698