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

Side by Side Diff: content/renderer/battery_status_dispatcher.h

Issue 10024013: chromeos: Add support for the battery status API on chromeos. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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) 2012 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_RENDERER_BATTERY_STATUS_DISPATCHER_H_
6 #define CONTENT_RENDERER_BATTERY_STATUS_DISPATCHER_H_
7
8 #include <vector>
9
10 #include "base/compiler_specific.h"
11 #include "content/public/renderer/render_process_observer.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBatteryMonitor.h"
13
14 namespace WebKit {
15 class WebBatteryMonitorClient;
16 class WebBatteryStatus;
17 }
18
19 namespace content {
20
21 class BatteryStatusDispatcher : public RenderProcessObserver,
22 public WebKit::WebBatteryMonitor {
23 public:
24 BatteryStatusDispatcher();
25 virtual ~BatteryStatusDispatcher();
26
27 private:
28 void OnBatteryStatusUpdated(const WebKit::WebBatteryStatus& battery_status);
29
30 void StopUpdates();
31
32 // RenderProcessObserver implementation.
33 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
34
35 // WebKit::WebBatteryMonitor implementation.
36 virtual void start(WebKit::WebBatteryMonitorClient* client);
37 virtual void stop(WebKit::WebBatteryMonitorClient* client);
38
39 typedef std::vector<WebKit::WebBatteryMonitorClient*>
40 WebBatteryMonitorClientList;
41 WebBatteryMonitorClientList client_list_;
42
43 DISALLOW_COPY_AND_ASSIGN(BatteryStatusDispatcher);
44 };
45
46 } // namespace content
47
48 #endif // CONTENT_RENDERER_BATTERY_STATUS_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/public/browser/power_supply_status.h ('k') | content/renderer/battery_status_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698