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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.h

Issue 10824272: Add a skeleton gamepad resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 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: webkit/plugins/ppapi/ppapi_plugin_instance.h
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h
index 89c5be1b2175dd52b6f6b48549a2ea746a8b618f..a1364601ddcf83dfd59d3e5f8a3d574708c6b2a7 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.h
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h
@@ -40,6 +40,7 @@
#include "ppapi/c/private/ppp_instance_private.h"
#include "ppapi/shared_impl/ppb_instance_shared.h"
#include "ppapi/shared_impl/ppb_view_shared.h"
+#include "ppapi/thunk/ppb_gamepad_api.h"
#include "ppapi/thunk/resource_creation_api.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "third_party/skia/include/core/SkRefCnt.h"
@@ -320,10 +321,6 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
bool from_user_action);
bool IsRectTopmost(const gfx::Rect& rect);
- // Implementation of PPB_Gamepad.
- void SampleGamepads(PP_Instance instance, PP_GamepadsSampleData* data)
- OVERRIDE;
-
// Implementation of PPP_Messaging.
void HandleMessage(PP_Var message);
@@ -379,6 +376,8 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size)
OVERRIDE;
virtual ::ppapi::thunk::PPB_Flash_API* GetFlashAPI() OVERRIDE;
+ virtual ::ppapi::thunk::PPB_Gamepad_API* GetGamepadAPI(PP_Instance instance)
+ OVERRIDE;
virtual int32_t RequestInputEvents(PP_Instance instance,
uint32_t event_classes) OVERRIDE;
virtual int32_t RequestFilteringInputEvents(PP_Instance instance,
@@ -462,6 +461,16 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
bool ResetAsProxied();
private:
+ // Implements PPB_Gamepad_API. This is just to avoid having an excessive
+ // number of interfaces implemented by PluginInstance.
+ class GamepadImpl : public ::ppapi::thunk::PPB_Gamepad_API {
+ public:
+ GamepadImpl(PluginDelegate* delegate);
+ virtual void Sample(PP_GamepadsSampleData* data) OVERRIDE;
+ private:
+ PluginDelegate* delegate_;
+ };
+
// See the static Create functions above for creating PluginInstance objects.
// This constructor is private so that we can hide the PPP_Instance_Combined
// details while still having 1 constructor to maintain for member
@@ -642,6 +651,8 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
std::vector<PP_PrintPageNumberRange_Dev> ranges_;
#endif // OS_LINUX || OS_WIN
+ GamepadImpl gamepad_impl_;
+
// The plugin print interface.
const PPP_Printing_Dev* plugin_print_interface_;

Powered by Google App Engine
This is Rietveld 408576698