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

Unified Diff: content/public/renderer/renderer_gamepad_provider.h

Issue 446603002: Refactor code listening to platform events in content/renderer/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webkitplatform_impl_start_stop
Patch Set: rebase Created 6 years, 4 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/public/renderer/platform_event_observer.h ('k') | content/public/test/layouttest_support.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/renderer/renderer_gamepad_provider.h
diff --git a/content/public/renderer/renderer_gamepad_provider.h b/content/public/renderer/renderer_gamepad_provider.h
index ba6ec9fae98fbb7b5dedc4ccd52420f8751d694a..ede8a6a321cf62aec8576c58a2065e58c7cb1f7e 100644
--- a/content/public/renderer/renderer_gamepad_provider.h
+++ b/content/public/renderer/renderer_gamepad_provider.h
@@ -2,8 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_GAMEPAD_RENDERER_PROVIDER_H_
-#define CONTENT_GAMEPAD_RENDERER_PROVIDER_H_
+#ifndef CONTENT_PUBLIC_RENDERER_RENDERER_GAMEPAD_PROVIDER_H_
+#define CONTENT_PUBLIC_RENDERER_RENDERER_GAMEPAD_PROVIDER_H_
+
+#include "content/public/renderer/platform_event_observer.h"
namespace blink {
class WebGamepadListener;
@@ -13,16 +15,19 @@ class WebGamepads;
namespace content {
// Provides gamepad data and events for blink.
-class RendererGamepadProvider {
+class RendererGamepadProvider
+ : public PlatformEventObserver<blink::WebGamepadListener> {
public:
+ explicit RendererGamepadProvider(RenderThread* thread)
+ : PlatformEventObserver<blink::WebGamepadListener>(thread) { }
+
+ virtual ~RendererGamepadProvider() {}
+
// Provides latest snapshot of gamepads.
virtual void SampleGamepads(blink::WebGamepads& gamepads) = 0;
- // Registers listener for be notified of events.
- virtual void SetGamepadListener(blink::WebGamepadListener* listener) = 0;
-
protected:
- virtual ~RendererGamepadProvider() {}
+ DISALLOW_COPY_AND_ASSIGN(RendererGamepadProvider);
};
} // namespace content
« no previous file with comments | « content/public/renderer/platform_event_observer.h ('k') | content/public/test/layouttest_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698