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

Unified Diff: content/renderer/render_thread_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: . Created 8 years, 5 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/render_thread_impl.h ('k') | content/renderer/renderer_webkitplatformsupport_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 19e02596992b6b79122616234bda21a0afe0ba02..62314e5410ecfab5308ad27ed1af9dc85a05cf8f 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -46,6 +46,7 @@
#include "content/public/renderer/content_renderer_client.h"
#include "content/public/renderer/render_process_observer.h"
#include "content/public/renderer/render_view_visitor.h"
+#include "content/renderer/battery_status_dispatcher.h"
#include "content/renderer/browser_plugin/old/browser_plugin_channel_manager.h"
#include "content/renderer/browser_plugin/old/browser_plugin_registry.h"
#include "content/renderer/devtools_agent_filter.h"
@@ -69,6 +70,7 @@
#include "media/base/media.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebBatteryMonitor.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
@@ -1000,6 +1002,18 @@ GpuChannelHost* RenderThreadImpl::GetGpuChannel() {
return gpu_channel_.get();
}
+WebKit::WebBatteryMonitor* RenderThreadImpl::GetBatteryMonitor() {
+#if defined(OS_CHROMEOS)
+ if (!battery_monitor_.get()) {
+ content::BatteryStatusDispatcher* dispatcher =
+ new content::BatteryStatusDispatcher;
+ battery_monitor_.reset(dispatcher);
+ AddObserver(dispatcher);
+ }
+#endif
+ return battery_monitor_.get();
+}
+
void RenderThreadImpl::OnPurgePluginListCache(bool reload_pages) {
EnsureWebKitInitialized();
// The call below will cause a GetPlugins call with refresh=true, but at this
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/renderer_webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698