summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-18 08:16:22 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-18 08:16:22 +0000
commitffadb717d9ab2138fde9dc238ad697449da4d75e (patch)
treeda760106251c583911e476d177c2ed981ecfe211 /ppapi/proxy
parent8de46cee7669abb07f6d3e192f5850872187250b (diff)
downloadchromium_src-ffadb717d9ab2138fde9dc238ad697449da4d75e.zip
chromium_src-ffadb717d9ab2138fde9dc238ad697449da4d75e.tar.gz
chromium_src-ffadb717d9ab2138fde9dc238ad697449da4d75e.tar.bz2
Pepper: Add a function to PPB_Flash to check if a rect is topmost.
This is needed for "Flash dialogs". This is dependent on https://bugs.webkit.org/show_bug.cgi?id=78166 . TEST=check the example plugin (under flash_topmost) Review URL: http://codereview.chromium.org/9369003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122686 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-rw-r--r--ppapi/proxy/interface_list.cc2
-rw-r--r--ppapi/proxy/ppapi_messages.h4
-rw-r--r--ppapi/proxy/ppb_flash_proxy.cc58
-rw-r--r--ppapi/proxy/ppb_flash_proxy.h4
4 files changed, 65 insertions, 3 deletions
diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc
index 0ff81c2e..27563cf 100644
--- a/ppapi/proxy/interface_list.cc
+++ b/ppapi/proxy/interface_list.cc
@@ -270,6 +270,8 @@ void InterfaceList::AddFlashInterfaces() {
PPB_Flash_Proxy::GetInterface11());
AddPPB(PPB_FLASH_INTERFACE_12_0, API_ID_PPB_FLASH,
PPB_Flash_Proxy::GetInterface12_0());
+ AddPPB(PPB_FLASH_INTERFACE_12_1, API_ID_PPB_FLASH,
+ PPB_Flash_Proxy::GetInterface12_1());
AddProxy(API_ID_PPB_FLASH_CLIPBOARD,
&ProxyFactory<PPB_Flash_Clipboard_Proxy>);
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index 7a37f08..2c4ddd3 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -701,6 +701,10 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFlash_GetLocalTimeZoneOffset,
PP_Instance /* instance */,
PP_Time /* t */,
double /* offset */)
+IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFlash_IsRectTopmost,
+ PP_Instance /* instance */,
+ PP_Rect /* rect */,
+ PP_Bool /* result */)
// PPB_Flash_Clipboard.
IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBFlashClipboard_IsFormatAvailable,
diff --git a/ppapi/proxy/ppb_flash_proxy.cc b/ppapi/proxy/ppb_flash_proxy.cc
index bcd692b..d2e5cb6 100644
--- a/ppapi/proxy/ppb_flash_proxy.cc
+++ b/ppapi/proxy/ppb_flash_proxy.cc
@@ -198,6 +198,30 @@ void PreLoadFontWin(const void* logfontw) {
PluginGlobals::Get()->plugin_proxy_delegate()->PreCacheFont(logfontw);
}
+PP_Bool IsRectTopmost(PP_Instance instance, const PP_Rect* rect) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
+ if (!dispatcher)
+ return PP_FALSE;
+ PP_Bool result = PP_FALSE;
+ dispatcher->Send(new PpapiHostMsg_PPBFlash_IsRectTopmost(
+ API_ID_PPB_FLASH, instance, *rect, &result));
+ return result;
+}
+
+int32_t InvokePrinting(PP_Instance instance) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
+ if (!dispatcher)
+ return PP_ERROR_BADARGUMENT;
+
+ // TODO(viettrungluu): Implement me.
+
+ return PP_ERROR_NOTSUPPORTED;
+}
+
+void UpdateActivity(PP_Instance instance) {
+ // TODO(viettrungluu): Implement me.
+}
+
const PPB_Flash_11 flash_interface_11 = {
&SetInstanceAlwaysOnTop,
&DrawGlyphs11,
@@ -209,7 +233,7 @@ const PPB_Flash_11 flash_interface_11 = {
&GetCommandLineArgs
};
-const PPB_Flash flash_interface_12 = {
+const PPB_Flash_12_0 flash_interface_12_0 = {
&SetInstanceAlwaysOnTop,
&DrawGlyphs,
&GetProxyForURL,
@@ -221,6 +245,21 @@ const PPB_Flash flash_interface_12 = {
&PreLoadFontWin
};
+const PPB_Flash_12_1 flash_interface_12_1 = {
+ &SetInstanceAlwaysOnTop,
+ &DrawGlyphs,
+ &GetProxyForURL,
+ &Navigate,
+ &RunMessageLoop,
+ &QuitMessageLoop,
+ &GetLocalTimeZoneOffset,
+ &GetCommandLineArgs,
+ &PreLoadFontWin,
+ &IsRectTopmost,
+ &InvokePrinting,
+ &UpdateActivity
+};
+
} // namespace
PPB_Flash_Proxy::PPB_Flash_Proxy(Dispatcher* dispatcher)
@@ -240,8 +279,13 @@ const PPB_Flash_11* PPB_Flash_Proxy::GetInterface11() {
}
// static
-const PPB_Flash* PPB_Flash_Proxy::GetInterface12_0() {
- return &flash_interface_12;
+const PPB_Flash_12_0* PPB_Flash_Proxy::GetInterface12_0() {
+ return &flash_interface_12_0;
+}
+
+// static
+const PPB_Flash_12_1* PPB_Flash_Proxy::GetInterface12_1() {
+ return &flash_interface_12_1;
}
bool PPB_Flash_Proxy::OnMessageReceived(const IPC::Message& msg) {
@@ -265,6 +309,8 @@ bool PPB_Flash_Proxy::OnMessageReceived(const IPC::Message& msg) {
OnMsgQuitMessageLoop)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetLocalTimeZoneOffset,
OnMsgGetLocalTimeZoneOffset)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_IsRectTopmost,
+ OnMsgIsRectTopmost)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
// TODO(brettw) handle bad messages!
@@ -358,5 +404,11 @@ void PPB_Flash_Proxy::OnMsgGetLocalTimeZoneOffset(PP_Instance instance,
*result = ppb_flash_impl_->GetLocalTimeZoneOffset(instance, t);
}
+void PPB_Flash_Proxy::OnMsgIsRectTopmost(PP_Instance instance,
+ PP_Rect rect,
+ PP_Bool* result) {
+ *result = ppb_flash_impl_->IsRectTopmost(instance, &rect);
+}
+
} // namespace proxy
} // namespace ppapi
diff --git a/ppapi/proxy/ppb_flash_proxy.h b/ppapi/proxy/ppb_flash_proxy.h
index f3453a8..dbdebc7 100644
--- a/ppapi/proxy/ppb_flash_proxy.h
+++ b/ppapi/proxy/ppb_flash_proxy.h
@@ -34,6 +34,7 @@ class PPB_Flash_Proxy : public InterfaceProxy {
// Returns the corresponding version of the Flash interface pointer.
static const PPB_Flash_11* GetInterface11();
static const PPB_Flash_12_0* GetInterface12_0();
+ static const PPB_Flash_12_1* GetInterface12_1();
// InterfaceProxy implementation.
virtual bool OnMessageReceived(const IPC::Message& msg);
@@ -56,6 +57,9 @@ class PPB_Flash_Proxy : public InterfaceProxy {
void OnMsgQuitMessageLoop(PP_Instance instance);
void OnMsgGetLocalTimeZoneOffset(PP_Instance instance, PP_Time t,
double* result);
+ void OnMsgIsRectTopmost(PP_Instance instance,
+ PP_Rect rect,
+ PP_Bool* result);
// When this proxy is in the host side, this value caches the interface
// pointer so we don't have to retrieve it from the dispatcher each time.