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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 195873019: Gamepad API: add support for connection events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: and a missing override 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/render_thread_impl.h ('k') | content/renderer/renderer_webkitplatformsupport_impl.cc » ('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 08016d760e1858be4431575e2cf3e711ccbc583c..5e24d9bd0cfa520dde3876fa09ea5b2df98657ad 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -396,6 +396,9 @@ void RenderThreadImpl::Init() {
AddFilter((new EmbeddedWorkerContextMessageFilter())->GetFilter());
+ gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader());
+ AddObserver(gamepad_shared_memory_reader_.get());
+
GetContentClient()->renderer()->RenderThreadStarted();
InitSkiaEventTracer();
@@ -1458,11 +1461,13 @@ void RenderThreadImpl::SetFlingCurveParameters(
}
void RenderThreadImpl::SampleGamepads(blink::WebGamepads* data) {
- if (!gamepad_shared_memory_reader_)
- gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader);
gamepad_shared_memory_reader_->SampleGamepads(*data);
}
+void RenderThreadImpl::SetGamepadListener(blink::WebGamepadListener* listener) {
+ gamepad_shared_memory_reader_->SetGamepadListener(listener);
+}
+
void RenderThreadImpl::WidgetCreated() {
widget_count_++;
}
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/renderer_webkitplatformsupport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698