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 class BatteryStatusDispatcher : public content::RenderViewObserver, |
| 18 public WebKit::WebBatteryStatusClient { |
| 19 public: |
| 20 explicit BatteryStatusDispatcher(RenderViewImpl* render_view); |
| 21 virtual ~BatteryStatusDispatcher(); |
| 22 |
| 23 private: |
| 24 void OnBatteryStatusUpdated(const WebKit::WebBatteryStatus& battery_status); |
| 25 |
| 26 // RenderView::Observer implementation. |
| 27 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 28 |
| 29 // WebKit::WebBatteryStatusClient implementation. |
| 30 virtual void startUpdating(); |
| 31 virtual void stopUpdating(); |
| 32 |
| 33 bool started_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(BatteryStatusDispatcher); |
| 36 }; |
| 37 |
| 38 #endif // CONTENT_RENDERER_BATTERY_STATUS_DISPATCHER_H_ |
OLD | NEW |