Home | History | Annotate | Download | only in renderer
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CONTENT_PUBLIC_RENDERER_RENDERER_GAMEPAD_PROVIDER_H_
      6 #define CONTENT_PUBLIC_RENDERER_RENDERER_GAMEPAD_PROVIDER_H_
      7 
      8 #include "content/public/renderer/platform_event_observer.h"
      9 
     10 namespace blink {
     11 class WebGamepadListener;
     12 class WebGamepads;
     13 }
     14 
     15 namespace content {
     16 
     17 // Provides gamepad data and events for blink.
     18 class RendererGamepadProvider
     19     : public PlatformEventObserver<blink::WebGamepadListener> {
     20  public:
     21   explicit RendererGamepadProvider(RenderThread* thread)
     22       : PlatformEventObserver<blink::WebGamepadListener>(thread) { }
     23 
     24   virtual ~RendererGamepadProvider() {}
     25 
     26   // Provides latest snapshot of gamepads.
     27   virtual void SampleGamepads(blink::WebGamepads& gamepads) = 0;
     28 
     29  protected:
     30   DISALLOW_COPY_AND_ASSIGN(RendererGamepadProvider);
     31 };
     32 
     33 } // namespace content
     34 
     35 #endif
     36