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

Unified Diff: ppapi/proxy/ppb_instance_proxy.cc

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: ppapi/proxy/ppb_instance_proxy.cc
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index e9eaf35b19b71d13e5e18b17c7051791ec28cb0a..01fae690f1946aecbefb4d406ce9c6250c91fe1c 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -14,6 +14,7 @@
#include "ppapi/c/private/pp_content_decryptor.h"
#include "ppapi/proxy/content_decryptor_private_serializer.h"
#include "ppapi/proxy/enter_proxy.h"
+#include "ppapi/proxy/gamepad_resource.h"
#include "ppapi/proxy/host_dispatcher.h"
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/plugin_proxy_delegate.h"
@@ -314,9 +315,20 @@ thunk::PPB_Flash_API* PPB_Instance_Proxy::GetFlashAPI() {
return static_cast<PPB_Flash_Proxy*>(ip);
}
-void PPB_Instance_Proxy::SampleGamepads(PP_Instance instance,
- PP_GamepadsSampleData* data) {
- NOTIMPLEMENTED();
+thunk::PPB_Gamepad_API* PPB_Instance_Proxy::GetGamepadAPI(
+ PP_Instance instance) {
+ InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
+ GetInstanceData(instance);
+ if (!data)
+ return NULL;
+
+ if (!data->gamepad_resource.get()) {
+ Connection connection(
+ PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(),
+ dispatcher());
+ data->gamepad_resource = new GamepadResource(connection, instance);
+ }
+ return data->gamepad_resource.get();
}
int32_t PPB_Instance_Proxy::RequestInputEvents(PP_Instance instance,

Powered by Google App Engine
This is Rietveld 408576698