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

Side by Side Diff: content/common/power_monitor_service.h

Issue 17074009: Created multi-process-friendly PowerMonitor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 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 CONTENT_COMMON_POWER_MONITOR_SERVICE_H_
6 #define CONTENT_COMMON_POWER_MONITOR_SERVICE_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/power_monitor/power_observer.h"
11
12 #include "content/common/content_export.h"
13
14 namespace IPC {
15 class Sender;
16 }
17
18 namespace content {
19
20 // A class used to monitor the power state change and notify the observers about
21 // the change event.
Ken Russell (switch to Gerrit) 2013/06/24 22:54:38 Isn't this documentation inaccurate? This class mo
bajones 2013/06/25 18:33:34 No precedent aside from my still-fuzzy understandi
22 class CONTENT_EXPORT PowerMonitorService : public base::PowerObserver,
23 public base::RefCounted<PowerMonitorService> {
24 public:
25 PowerMonitorService(IPC::Sender* sender);
26
27 // Implement PowerObserver.
28 virtual void OnPowerStateChange(bool on_battery_power) OVERRIDE;
29 virtual void OnSuspend() OVERRIDE;
30 virtual void OnResume() OVERRIDE;
31
32 private:
33 friend class base::RefCounted<PowerMonitorService>;
34
35 virtual ~PowerMonitorService();
36
37 IPC::Sender* sender_;
38
39 DISALLOW_COPY_AND_ASSIGN(PowerMonitorService);
40 };
41
42 } // namespace base
43
44 #endif // CONTENT_COMMON_POWER_MONITOR_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698