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

Unified Diff: content/shell/renderer/test_runner/gamepad_controller.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
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 99b7efc285598a6b40cbcd3b1caa5e5e8ef9e726..ece04120e2104b504b094f8fe30c648aee98d8ec 100644
--- a/content/shell/renderer/test_runner/gamepad_controller.h
+++ b/content/shell/renderer/test_runner/gamepad_controller.h
@@ -24,21 +24,22 @@ class GamepadController
: public base::SupportsWeakPtr<GamepadController>,
public RendererGamepadProvider {
public:
- GamepadController();
+ static base::WeakPtr<GamepadController> Create(WebTestDelegate* delegate);
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;
+ virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE;
+ virtual void SendStartMessage() OVERRIDE;
+ virtual void SendStopMessage() OVERRIDE;
private:
friend class GamepadControllerBindings;
+ GamepadController();
// TODO(b.kelemen): for historical reasons Connect just initializes the
// object. The 'gamepadconnected' event will be dispatched via
@@ -58,8 +59,6 @@ class GamepadController
blink::WebGamepads gamepads_;
- blink::WebGamepadListener* listener_;
-
// Mapping from gamepad index to connection state.
std::map<int, bool> pending_changes_;
« 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