Index: content/renderer/renderer_webkitplatformsupport_impl.cc |
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc |
index b507a732a1eacb48b0ecdf3cac6f32fa3f736a22..82fb75bc388b0d9c8f30a1801665c543f6be6596 100644 |
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc |
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc |
@@ -38,6 +38,7 @@ |
#include "content/public/common/content_switches.h" |
#include "content/public/common/webplugininfo.h" |
#include "content/public/renderer/content_renderer_client.h" |
+#include "content/renderer/battery_status/battery_status_dispatcher.h" |
#include "content/renderer/device_sensors/device_motion_event_pump.h" |
#include "content/renderer/device_sensors/device_orientation_event_pump.h" |
#include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
@@ -61,6 +62,7 @@ |
#include "media/filters/stream_parser_factory.h" |
#include "net/base/mime_util.h" |
#include "net/base/net_util.h" |
+#include "third_party/WebKit/public/platform/WebBatteryStatusListener.h" |
#include "third_party/WebKit/public/platform/WebBlobRegistry.h" |
#include "third_party/WebKit/public/platform/WebDeviceMotionListener.h" |
#include "third_party/WebKit/public/platform/WebDeviceOrientationListener.h" |
@@ -1179,4 +1181,15 @@ void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota( |
QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
} |
+//------------------------------------------------------------------------------ |
+ |
+void RendererWebKitPlatformSupportImpl::setBatteryStatusListener( |
+ blink::WebBatteryStatusListener* listener) { |
+ if (!battery_status_dispatcher_) { |
+ battery_status_dispatcher_.reset(new BatteryStatusDispatcher); |
+ battery_status_dispatcher_->Attach(RenderThreadImpl::current()); |
+ } |
+ battery_status_dispatcher_->SetListener(listener); |
+} |
+ |
} // namespace content |