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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 258693012: Add BatteryStatusEventPump in Chromium for sending Battery status events Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b5a97e6b72d17bfd4fccf5bef3237d17b1e08334 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_event_pump.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"
@@ -1165,6 +1166,17 @@ void RendererWebKitPlatformSupportImpl::SetMockScreenOrientationForTesting(
//------------------------------------------------------------------------------
+void RendererWebKitPlatformSupportImpl::setBatteryStatusListener(
+ blink::WebBatteryStatusListener* listener) {
+ if (!battery_status_event_pump_) {
+ battery_status_event_pump_.reset(new BatteryStatusEventPump);
+ battery_status_event_pump_->Attach(RenderThreadImpl::current());
+ }
+ battery_status_event_pump_->SetBatteryStatusListener(listener);
+}
+
+//------------------------------------------------------------------------------
+
void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota(
const blink::WebURL& storage_partition,
blink::WebStorageQuotaType type,
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698