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

Unified Diff: content/shell/renderer/test_runner/gamepad_controller.h

Issue 304403002: Gamepad: add test support for page visibility behavior (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing override's Created 6 years, 6 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
Index: content/shell/renderer/test_runner/gamepad_controller.h
diff --git a/content/shell/renderer/test_runner/gamepad_controller.h b/content/shell/renderer/test_runner/gamepad_controller.h
index b648fd08be275f79fe3ae1695c2f28520eb40edc..99b7efc285598a6b40cbcd3b1caa5e5e8ef9e726 100644
--- a/content/shell/renderer/test_runner/gamepad_controller.h
+++ b/content/shell/renderer/test_runner/gamepad_controller.h
@@ -5,26 +5,38 @@
#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_GAMEPAD_CONTROLLER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_GAMEPAD_CONTROLLER_H_
+#include <map>
+
#include "base/memory/weak_ptr.h"
+#include "content/public/renderer/renderer_gamepad_provider.h"
#include "third_party/WebKit/public/platform/WebGamepads.h"
namespace blink {
class WebFrame;
+class WebGamepadListener;
}
namespace content {
class WebTestDelegate;
-class GamepadController : public base::SupportsWeakPtr<GamepadController> {
+class GamepadController
+ : public base::SupportsWeakPtr<GamepadController>,
+ public RendererGamepadProvider {
public:
GamepadController();
- ~GamepadController();
+ virtual ~GamepadController();
void Reset();
void Install(blink::WebFrame* frame);
void SetDelegate(WebTestDelegate* delegate);
+ // RendererGamepadProvider implementation.
+ virtual void SampleGamepads(
+ blink::WebGamepads& gamepads) OVERRIDE;
+ virtual void SetGamepadListener(
+ blink::WebGamepadListener* listener) OVERRIDE;
+
private:
friend class GamepadControllerBindings;
@@ -46,7 +58,10 @@ class GamepadController : public base::SupportsWeakPtr<GamepadController> {
blink::WebGamepads gamepads_;
- WebTestDelegate* delegate_;
+ blink::WebGamepadListener* listener_;
+
+ // Mapping from gamepad index to connection state.
+ std::map<int, bool> pending_changes_;
base::WeakPtrFactory<GamepadController> weak_factory_;
« no previous file with comments | « content/shell/renderer/test_runner/WebTestDelegate.h ('k') | content/shell/renderer/test_runner/gamepad_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698