OLD | NEW |
(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 "content/public/renderer/render_view_observer.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBatteryStatusClien
t.h" |
| 10 |
| 11 namespace WebKit { |
| 12 class WebBatteryStatus; |
| 13 } |
| 14 |
| 15 class RenderViewImpl; |
| 16 |
| 17 namespace content { |
| 18 |
| 19 class BatteryStatusDispatcher : public RenderViewObserver, |
| 20 public WebKit::WebBatteryStatusClient { |
| 21 public: |
| 22 explicit BatteryStatusDispatcher(RenderViewImpl* render_view); |
| 23 virtual ~BatteryStatusDispatcher(); |
| 24 |
| 25 private: |
| 26 void OnBatteryStatusUpdated(const WebKit::WebBatteryStatus& battery_status); |
| 27 |
| 28 // RenderView::Observer implementation. |
| 29 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 30 |
| 31 // WebKit::WebBatteryStatusClient implementation. |
| 32 virtual void startUpdating(); |
| 33 virtual void stopUpdating(); |
| 34 |
| 35 bool started_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(BatteryStatusDispatcher); |
| 38 }; |
| 39 |
| 40 } // namespace content |
| 41 |
| 42 #endif // CONTENT_RENDERER_BATTERY_STATUS_DISPATCHER_H_ |
OLD | NEW |