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

Unified Diff: content/browser/renderer_host/pepper/pepper_gamepad_host.h

Issue 10912062: Implement the gamepad API in the IPC proxy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/browser/renderer_host/pepper/pepper_gamepad_host.h
diff --git a/content/browser/renderer_host/pepper/pepper_gamepad_host.h b/content/browser/renderer_host/pepper/pepper_gamepad_host.h
index a47d05341fe780e4331b90e8ae34a2cbba946cba..50181c7586e18bdb0900c230373722cb44dd47d4 100644
--- a/content/browser/renderer_host/pepper/pepper_gamepad_host.h
+++ b/content/browser/renderer_host/pepper/pepper_gamepad_host.h
@@ -6,18 +6,34 @@
#define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_GAMEPAD_HOST_H_
#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
#include "content/common/content_export.h"
#include "ppapi/host/resource_host.h"
+namespace ppapi {
+namespace proxy {
+class ResourceMessageReplyParams;
+}
+}
+
namespace content {
class BrowserPpapiHost;
+class GamepadService;
class CONTENT_EXPORT PepperGamepadHost : public ppapi::host::ResourceHost {
public:
PepperGamepadHost(BrowserPpapiHost* host,
PP_Instance instance,
PP_Resource resource);
+
+ // Allows tests to specify a gamepad service to use rather than the global
+ // singleton. The caller owns the gamepad_service pointer.
+ PepperGamepadHost(GamepadService* gamepad_service,
+ BrowserPpapiHost* host,
+ PP_Instance instance,
+ PP_Resource resource);
+
virtual ~PepperGamepadHost();
virtual int32_t OnResourceMessageReceived(
@@ -27,8 +43,16 @@ class CONTENT_EXPORT PepperGamepadHost : public ppapi::host::ResourceHost {
private:
int32_t OnMsgRequestMemory(ppapi::host::HostMessageContext* context);
+ void GotUserGesture(const ppapi::proxy::ResourceMessageReplyParams& params);
+
BrowserPpapiHost* browser_ppapi_host_;
+ GamepadService* gamepad_service_;
+
+ bool is_started_;
+
+ base::WeakPtrFactory<PepperGamepadHost> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(PepperGamepadHost);
};

Powered by Google App Engine
This is Rietveld 408576698