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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 258173004: [NO SUBMIT] Battery Status API skeleton implementation ASYNC Base URL: https://chromium.googlesource.com/chromium/src.git@April-17-battery-status-renderer-and-IPC
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') | 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 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)));
« 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