summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy
diff options
context:
space:
mode:
authorpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 01:55:52 +0000
committerpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 01:55:52 +0000
commitc32a97f251e5d951e86d25815d989d4db2d59bdb (patch)
tree2d4384c2163a46e4c68d9ec0e6ede5dadcb14b33 /ppapi/proxy
parent9ad566288f5f4972570cd52cf6258d2ab0fe5090 (diff)
downloadchromium_src-c32a97f251e5d951e86d25815d989d4db2d59bdb.zip
chromium_src-c32a97f251e5d951e86d25815d989d4db2d59bdb.tar.gz
chromium_src-c32a97f251e5d951e86d25815d989d4db2d59bdb.tar.bz2
Clarify/fix fullscreen semantics, and add GetScreenSize
BUG=none TEST=youtube, nba, amazon Review URL: http://codereview.chromium.org/6625034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-rw-r--r--ppapi/proxy/ppapi_messages_internal.h4
-rw-r--r--ppapi/proxy/ppb_fullscreen_proxy.cc22
-rw-r--r--ppapi/proxy/ppb_fullscreen_proxy.h4
3 files changed, 29 insertions, 1 deletions
diff --git a/ppapi/proxy/ppapi_messages_internal.h b/ppapi/proxy/ppapi_messages_internal.h
index 7ad4551..129502a 100644
--- a/ppapi/proxy/ppapi_messages_internal.h
+++ b/ppapi/proxy/ppapi_messages_internal.h
@@ -456,6 +456,10 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFullscreen_SetFullscreen,
PP_Instance /* instance */,
PP_Bool /* fullscreen */,
PP_Bool /* result */)
+IPC_SYNC_MESSAGE_ROUTED1_2(PpapiHostMsg_PPBFullscreen_GetScreenSize,
+ PP_Instance /* instance */,
+ PP_Bool /* result */,
+ PP_Size /* size */)
// PPB_Graphics2D.
IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBGraphics2D_Create,
diff --git a/ppapi/proxy/ppb_fullscreen_proxy.cc b/ppapi/proxy/ppb_fullscreen_proxy.cc
index 19c9ead..12848bb 100644
--- a/ppapi/proxy/ppb_fullscreen_proxy.cc
+++ b/ppapi/proxy/ppb_fullscreen_proxy.cc
@@ -35,9 +35,21 @@ PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) {
return result;
}
+PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
+ if (!dispatcher)
+ return PP_FALSE;
+
+ PP_Bool result = PP_FALSE;
+ dispatcher->Send(new PpapiHostMsg_PPBFullscreen_GetScreenSize(
+ INTERFACE_ID_PPB_FULLSCREEN, instance, &result, size));
+ return result;
+}
+
const PPB_Fullscreen_Dev fullscreen_interface = {
&IsFullscreen,
- &SetFullscreen
+ &SetFullscreen,
+ &GetScreenSize
};
InterfaceProxy* CreateFullscreenProxy(Dispatcher* dispatcher,
@@ -74,6 +86,8 @@ bool PPB_Fullscreen_Proxy::OnMessageReceived(const IPC::Message& msg) {
OnMsgIsFullscreen)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFullscreen_SetFullscreen,
OnMsgSetFullscreen)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFullscreen_GetScreenSize,
+ OnMsgGetScreenSize)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
// TODO(brettw): handle bad messages!
@@ -91,5 +105,11 @@ void PPB_Fullscreen_Proxy::OnMsgSetFullscreen(PP_Instance instance,
*result = ppb_fullscreen_target()->SetFullscreen(instance, fullscreen);
}
+void PPB_Fullscreen_Proxy::OnMsgGetScreenSize(PP_Instance instance,
+ PP_Bool* result,
+ PP_Size* size) {
+ *result = ppb_fullscreen_target()->GetScreenSize(instance, size);
+}
+
} // namespace proxy
} // namespace pp
diff --git a/ppapi/proxy/ppb_fullscreen_proxy.h b/ppapi/proxy/ppb_fullscreen_proxy.h
index d68965a..0efc189 100644
--- a/ppapi/proxy/ppb_fullscreen_proxy.h
+++ b/ppapi/proxy/ppb_fullscreen_proxy.h
@@ -7,6 +7,7 @@
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_bool.h"
+#include "ppapi/c/pp_size.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/proxy/interface_proxy.h"
@@ -36,6 +37,9 @@ class PPB_Fullscreen_Proxy : public InterfaceProxy {
void OnMsgSetFullscreen(PP_Instance instance,
PP_Bool fullscreen,
PP_Bool* result);
+ void OnMsgGetScreenSize(PP_Instance instance,
+ PP_Bool* result,
+ PP_Size* size);
};
} // namespace proxy