| OLD | NEW |
| 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_SHELL_RENDERER_TEST_RUNNER_GAMEPAD_CONTROLLER_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_GAMEPAD_CONTROLLER_H_ |
| 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_GAMEPAD_CONTROLLER_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_GAMEPAD_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 public RendererGamepadProvider { | 25 public RendererGamepadProvider { |
| 26 public: | 26 public: |
| 27 static base::WeakPtr<GamepadController> Create(WebTestDelegate* delegate); | 27 static base::WeakPtr<GamepadController> Create(WebTestDelegate* delegate); |
| 28 virtual ~GamepadController(); | 28 virtual ~GamepadController(); |
| 29 | 29 |
| 30 void Reset(); | 30 void Reset(); |
| 31 void Install(blink::WebFrame* frame); | 31 void Install(blink::WebFrame* frame); |
| 32 | 32 |
| 33 // RendererGamepadProvider implementation. | 33 // RendererGamepadProvider implementation. |
| 34 virtual void SampleGamepads( | 34 virtual void SampleGamepads( |
| 35 blink::WebGamepads& gamepads) OVERRIDE; | 35 blink::WebGamepads& gamepads) override; |
| 36 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; | 36 virtual bool OnControlMessageReceived(const IPC::Message& msg) override; |
| 37 virtual void SendStartMessage() OVERRIDE; | 37 virtual void SendStartMessage() override; |
| 38 virtual void SendStopMessage() OVERRIDE; | 38 virtual void SendStopMessage() override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 friend class GamepadControllerBindings; | 41 friend class GamepadControllerBindings; |
| 42 GamepadController(); | 42 GamepadController(); |
| 43 | 43 |
| 44 // TODO(b.kelemen): for historical reasons Connect just initializes the | 44 // TODO(b.kelemen): for historical reasons Connect just initializes the |
| 45 // object. The 'gamepadconnected' event will be dispatched via | 45 // object. The 'gamepadconnected' event will be dispatched via |
| 46 // DispatchConnected. Tests for connected events need to first connect(), | 46 // DispatchConnected. Tests for connected events need to first connect(), |
| 47 // then set the gamepad data and finally call dispatchConnected(). | 47 // then set the gamepad data and finally call dispatchConnected(). |
| 48 // We should consider renaming Connect to Init and DispatchConnected to | 48 // We should consider renaming Connect to Init and DispatchConnected to |
| (...skipping 14 matching lines...) Expand all Loading... |
| 63 std::map<int, bool> pending_changes_; | 63 std::map<int, bool> pending_changes_; |
| 64 | 64 |
| 65 base::WeakPtrFactory<GamepadController> weak_factory_; | 65 base::WeakPtrFactory<GamepadController> weak_factory_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(GamepadController); | 67 DISALLOW_COPY_AND_ASSIGN(GamepadController); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace content | 70 } // namespace content |
| 71 | 71 |
| 72 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_GAMEPAD_CONTROLLER_H_ | 72 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_GAMEPAD_CONTROLLER_H_ |
| OLD | NEW |