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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 252113006: Add Battery Status API support in content/renderer and IPC messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 7 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') | ipc/ipc_message_start.h » ('j') | 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 91906df8dbfc6a5ea5e8767a53602f41fe9c0f80..fa870ec054b77ea95e60a8910d309a4ef6756670 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"
@@ -1182,4 +1184,15 @@ void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota(
QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
}
+//------------------------------------------------------------------------------
+
+void RendererWebKitPlatformSupportImpl::setBatteryStatusListener(
+ blink::WebBatteryStatusListener* listener) {
+ if (!battery_status_dispatcher_) {
+ battery_status_dispatcher_.reset(
+ new BatteryStatusDispatcher(RenderThreadImpl::current()));
+ }
+ battery_status_dispatcher_->SetListener(listener);
+}
+
} // namespace content
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | ipc/ipc_message_start.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698