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

Side by Side 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: cleaner 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_GAMEPAD_RENDERER_PROVIDER_H_ 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDERER_GAMEPAD_PROVIDER_H_
6 #define CONTENT_GAMEPAD_RENDERER_PROVIDER_H_ 6 #define CONTENT_PUBLIC_RENDERER_RENDERER_GAMEPAD_PROVIDER_H_
7
8 #include "content/public/renderer/platform_event_observer.h"
7 9
8 namespace blink { 10 namespace blink {
9 class WebGamepadListener; 11 class WebGamepadListener;
10 class WebGamepads; 12 class WebGamepads;
11 } 13 }
12 14
13 namespace content { 15 namespace content {
14 16
15 // Provides gamepad data and events for blink. 17 // Provides gamepad data and events for blink.
16 class RendererGamepadProvider { 18 class RendererGamepadProvider
19 : public PlatformEventObserver<blink::WebGamepadListener> {
17 public: 20 public:
21 explicit RendererGamepadProvider(RenderThread* thread)
22 : PlatformEventObserver<blink::WebGamepadListener>(thread) { }
18 // Provides latest snapshot of gamepads. 23 // Provides latest snapshot of gamepads.
19 virtual void SampleGamepads(blink::WebGamepads& gamepads) = 0; 24 virtual void SampleGamepads(blink::WebGamepads& gamepads) = 0;
20 25
21 // Registers listener for be notified of events. 26 // This PlatformEventObserver implementation do not handle that.
scottmg 2014/08/05 21:09:18 nit; "do not handle that" -> "does not handle this
mlamouri (slow - plz ping) 2014/08/05 21:32:36 Done.
22 virtual void SetGamepadListener(blink::WebGamepadListener* listener) = 0; 27 virtual void SendFakeDataForTesting(void* data) OVERRIDE { }
23 28
24 protected: 29 protected:
25 virtual ~RendererGamepadProvider() {} 30 virtual ~RendererGamepadProvider() {}
31
32 DISALLOW_COPY_AND_ASSIGN(RendererGamepadProvider);
26 }; 33 };
27 34
28 } // namespace content 35 } // namespace content
29 36
30 #endif 37 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698