Index: content/renderer/renderer_webkitplatformsupport_impl.cc |
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc |
index 2a38f3dc0e8f19b7e3d5edf250836be89c3f5003..edf2e2bc6c55a94ec486602152cc498f713654d4 100644 |
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc |
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc |
@@ -40,6 +40,7 @@ |
#include "content/public/renderer/content_renderer_client.h" |
#include "content/renderer/device_sensors/device_motion_event_pump.h" |
#include "content/renderer/device_sensors/device_orientation_event_pump.h" |
+#include "content/renderer/battery_status/battery_status_dispatcher.h" |
#include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
#include "content/renderer/gamepad_shared_memory_reader.h" |
#include "content/renderer/media/audio_decoder.h" |
@@ -64,6 +65,7 @@ |
#include "third_party/WebKit/public/platform/WebBlobRegistry.h" |
#include "third_party/WebKit/public/platform/WebDeviceMotionListener.h" |
#include "third_party/WebKit/public/platform/WebDeviceOrientationListener.h" |
+#include "third_party/WebKit/public/platform/WebBatteryListener.h" |
#include "third_party/WebKit/public/platform/WebFileInfo.h" |
#include "third_party/WebKit/public/platform/WebGamepads.h" |
#include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" |
@@ -1106,6 +1108,20 @@ void RendererWebKitPlatformSupportImpl::SetMockDeviceOrientationDataForTesting( |
//------------------------------------------------------------------------------ |
+ |
+void RendererWebKitPlatformSupportImpl::setBatteryStatusListener( |
+ blink::WebBatteryListener* listener) { |
+ if (!battery_status_dispatcher_) { |
+ battery_status_dispatcher_.reset(new BatteryStatusDispatcher); |
+ battery_status_dispatcher_->Attach(RenderThreadImpl::current()); |
+ } |
+ battery_status_dispatcher_->SetListener(listener); |
+} |
+ |
+ |
+ |
+ |
+//-------------------------- |
void RendererWebKitPlatformSupportImpl::vibrate(unsigned int milliseconds) { |
RenderThread::Get()->Send( |
new ViewHostMsg_Vibrate(base::checked_cast<int64>(milliseconds))); |