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

Unified Diff: content/renderer/render_view_impl.cc

Issue 10024013: chromeos: Add support for the battery status API on chromeos. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DEPS Created 8 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
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 76e4781125471250e8dee52feb435df631d54f35..7d43ceec4655dfdef2c0237a3ba586d3b34cde09 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -53,6 +53,7 @@
#include "content/public/renderer/navigation_state.h"
#include "content/public/renderer/render_view_observer.h"
#include "content/public/renderer/render_view_visitor.h"
+#include "content/renderer/battery_status_dispatcher.h"
#include "content/renderer/device_orientation_dispatcher.h"
#include "content/renderer/devtools_agent.h"
#include "content/renderer/dom_automation_controller.h"
@@ -456,6 +457,7 @@ RenderViewImpl::RenderViewImpl(
geolocation_dispatcher_(NULL),
input_tag_speech_dispatcher_(NULL),
device_orientation_dispatcher_(NULL),
+ battery_status_dispatcher_(NULL),
media_stream_dispatcher_(NULL),
p2p_socket_dispatcher_(NULL),
devtools_agent_(NULL),
@@ -5083,6 +5085,14 @@ WebKit::WebDeviceOrientationClient* RenderViewImpl::deviceOrientationClient() {
return device_orientation_dispatcher_;
}
+WebKit::WebBatteryStatusClient* RenderViewImpl::batteryStatusClient() {
+#if defined(OS_CHROMEOS)
+ if (!battery_status_dispatcher_)
+ battery_status_dispatcher_ = new BatteryStatusDispatcher(this);
+#endif
+ return battery_status_dispatcher_;
+}
+
void RenderViewImpl::zoomLimitsChanged(double minimum_level,
double maximum_level) {
// For now, don't remember plugin zoom values. We don't want to mix them with

Powered by Google App Engine
This is Rietveld 408576698