summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_flash_proxy.cc
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/ppb_flash_proxy.cc
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/ppb_flash_proxy.cc')
-rw-r--r--ppapi/proxy/ppb_flash_proxy.cc58
1 files changed, 55 insertions, 3 deletions
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