diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-18 08:16:22 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-18 08:16:22 +0000 |
commit | ffadb717d9ab2138fde9dc238ad697449da4d75e (patch) | |
tree | da760106251c583911e476d177c2ed981ecfe211 /webkit | |
parent | 8de46cee7669abb07f6d3e192f5850872187250b (diff) | |
download | chromium_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 'webkit')
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.cc | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.cc | 16 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.h | 1 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_flash_impl.cc | 48 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_flash_impl.h | 1 |
5 files changed, 66 insertions, 2 deletions
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc index 5622c7f..195046a 100644 --- a/webkit/plugins/ppapi/plugin_module.cc +++ b/webkit/plugins/ppapi/plugin_module.cc @@ -311,6 +311,8 @@ const void* GetInterface(const char* name) { return PPB_Flash_Impl::GetInterface11(); if (strcmp(name, PPB_FLASH_INTERFACE_12_0) == 0) return PPB_Flash_Impl::GetInterface12_0(); + if (strcmp(name, PPB_FLASH_INTERFACE_12_1) == 0) + return PPB_Flash_Impl::GetInterface12_1(); if (strcmp(name, PPB_FLASH_CLIPBOARD_INTERFACE_3_0) == 0) return ::ppapi::thunk::GetPPB_Flash_Clipboard_3_0_Thunk(); if (strcmp(name, PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY) == 0) diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index cdeb48d..1b6ff94 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -1337,6 +1337,22 @@ int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request, return PP_OK; } +bool PluginInstance::IsRectTopmost(const gfx::Rect& rect) { + if (flash_fullscreen_) + return true; + +#if 0 + WebView* web_view = container()->element().document().frame()->view(); + if (!web_view) { + NOTREACHED(); + return false; + } +#else +//FIXME + return container_->isRectTopmost(rect); +#endif +} + void PluginInstance::SampleGamepads(PP_Instance instance, PP_GamepadsData_Dev* data) { diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h index 8e7ee6b..65f8475 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.h +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h @@ -292,6 +292,7 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance : int32_t Navigate(PPB_URLRequestInfo_Impl* request, const char* target, bool from_user_action); + bool IsRectTopmost(const gfx::Rect& rect); // Implementation of PPB_Gamepad. void SampleGamepads(PP_Instance instance, PP_GamepadsData_Dev* data) diff --git a/webkit/plugins/ppapi/ppb_flash_impl.cc b/webkit/plugins/ppapi/ppb_flash_impl.cc index 2dc7842..4042019 100644 --- a/webkit/plugins/ppapi/ppb_flash_impl.cc +++ b/webkit/plugins/ppapi/ppb_flash_impl.cc @@ -23,6 +23,7 @@ #include "third_party/skia/include/core/SkPoint.h" #include "third_party/skia/include/core/SkTemplates.h" #include "third_party/skia/include/core/SkTypeface.h" +#include "ui/gfx/rect.h" #include "webkit/plugins/ppapi/common.h" #include "webkit/plugins/ppapi/host_globals.h" #include "webkit/plugins/ppapi/plugin_delegate.h" @@ -242,6 +243,29 @@ void PreLoadFontWin(const void* logfontw) { // Not implemented in-process. } +PP_Bool IsRectTopmost(PP_Instance pp_instance, const PP_Rect* rect) { + PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance); + if (!instance) + return PP_FALSE; + return PP_FromBool(instance->IsRectTopmost( + gfx::Rect(rect->point.x, rect->point.y, + rect->size.width, rect->size.height))); +} + +int32_t InvokePrinting(PP_Instance pp_instance) { + PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance); + if (!instance) + return PP_ERROR_BADARGUMENT; + + // TODO(viettrungluu): Implement me. + + return PP_ERROR_NOTSUPPORTED; +} + +void UpdateActivity(PP_Instance pp_instance) { + // TODO(viettrungluu): Implement me. +} + const PPB_Flash_11 ppb_flash_11 = { &SetInstanceAlwaysOnTop, &DrawGlyphs11, @@ -253,7 +277,7 @@ const PPB_Flash_11 ppb_flash_11 = { &GetCommandLineArgs }; -const PPB_Flash ppb_flash_12 = { +const PPB_Flash_12_0 ppb_flash_12_0 = { &SetInstanceAlwaysOnTop, &DrawGlyphs, &GetProxyForURL, @@ -265,6 +289,21 @@ const PPB_Flash ppb_flash_12 = { &PreLoadFontWin }; +const PPB_Flash_12_1 ppb_flash_12_1 = { + &SetInstanceAlwaysOnTop, + &DrawGlyphs, + &GetProxyForURL, + &Navigate, + &RunMessageLoop, + &QuitMessageLoop, + &GetLocalTimeZoneOffset, + &GetCommandLineArgs, + &PreLoadFontWin, + &IsRectTopmost, + &InvokePrinting, + &UpdateActivity +}; + } // namespace // static @@ -274,7 +313,12 @@ const PPB_Flash_11* PPB_Flash_Impl::GetInterface11() { // static const PPB_Flash_12_0* PPB_Flash_Impl::GetInterface12_0() { - return &ppb_flash_12; + return &ppb_flash_12_0; +} + +// static +const PPB_Flash_12_1* PPB_Flash_Impl::GetInterface12_1() { + return &ppb_flash_12_1; } } // namespace ppapi diff --git a/webkit/plugins/ppapi/ppb_flash_impl.h b/webkit/plugins/ppapi/ppb_flash_impl.h index b1156c8..9733e6b 100644 --- a/webkit/plugins/ppapi/ppb_flash_impl.h +++ b/webkit/plugins/ppapi/ppb_flash_impl.h @@ -20,6 +20,7 @@ class PPB_Flash_Impl { // exposed to the plugin. static const PPB_Flash_11* GetInterface11(); static const PPB_Flash_12_0* GetInterface12_0(); + static const PPB_Flash_12_1* GetInterface12_1(); private: DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Impl); |