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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 200873002: Gamepad API: add support for connection events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 8ae38b4d37569d17b4a91794989ecd5b14620919..8ddcda7f175a35c59dfc1c135b807c8214e7c50a 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -393,6 +393,10 @@ void RenderThreadImpl::Init() {
AddFilter((new EmbeddedWorkerContextMessageFilter())->GetFilter());
+ gamepad_shared_memory_reader_ =
+ new GamepadSharedMemoryReader(GetIOMessageLoopProxy());
+ AddFilter(gamepad_shared_memory_reader_.get());
+
GetContentClient()->renderer()->RenderThreadStarted();
InitSkiaEventTracer();
@@ -1453,11 +1457,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.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698