diff options
Diffstat (limited to 'chrome/plugin')
-rw-r--r-- | chrome/plugin/plugin_main.cc | 10 | ||||
-rw-r--r-- | chrome/plugin/plugin_thread.cc | 42 |
2 files changed, 52 insertions, 0 deletions
diff --git a/chrome/plugin/plugin_main.cc b/chrome/plugin/plugin_main.cc index afc83a5..835b6ca 100644 --- a/chrome/plugin/plugin_main.cc +++ b/chrome/plugin/plugin_main.cc @@ -67,7 +67,17 @@ static void TrimInterposeEnvironment() { // main() routine for running as the plugin process. int PluginMain(const MainFunctionParams& parameters) { // The main thread of the plugin services UI. +#if defined(OS_MACOSX) + // For Mac NPAPI plugins, we don't want a MessageLoop::TYPE_UI because + // that will cause events to be dispatched via the Cocoa responder chain. + // If the plugin creates its own windows with Carbon APIs (for example, + // full screen mode in Flash), those windows would not receive events. + // Instead, WebPluginDelegateImpl::OnNullEvent will dispatch any pending + // system events directly to the plugin. + MessageLoop main_message_loop(MessageLoop::TYPE_DEFAULT); +#else MessageLoop main_message_loop(MessageLoop::TYPE_UI); +#endif std::wstring app_name = chrome::kBrowserAppName; PlatformThread::SetName(WideToASCII(app_name + L"_PluginMain").c_str()); diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index c2a21bd..5969089 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -164,6 +164,48 @@ bool GetPluginFinderURL(std::string* plugin_finder_url) { return true; } +#if defined(OS_MACOSX) +__attribute__((visibility("default"))) +void NotifyBrowserOfPluginSelectWindow(uint32 window_id, CGRect bounds) { + PluginThread* plugin_thread = PluginThread::current(); + if (plugin_thread) { + gfx::Rect window_bounds(bounds); + plugin_thread->Send( + new PluginProcessHostMsg_PluginSelectWindow(window_id, window_bounds)); + } +} + +__attribute__((visibility("default"))) +void NotifyBrowserOfPluginShowWindow(uint32 window_id, CGRect bounds) { + PluginThread* plugin_thread = PluginThread::current(); + if (plugin_thread) { + gfx::Rect window_bounds(bounds); + plugin_thread->Send( + new PluginProcessHostMsg_PluginShowWindow(window_id, window_bounds)); + } +} + +__attribute__((visibility("default"))) +void NotifyBrowserOfPluginHideWindow(uint32 window_id, CGRect bounds) { + PluginThread* plugin_thread = PluginThread::current(); + if (plugin_thread) { + gfx::Rect window_bounds(bounds); + plugin_thread->Send( + new PluginProcessHostMsg_PluginHideWindow(window_id, window_bounds)); + } +} + +__attribute__((visibility("default"))) +void NotifyBrowserOfPluginDisposeWindow(uint32 window_id, CGRect bounds) { + PluginThread* plugin_thread = PluginThread::current(); + if (plugin_thread) { + gfx::Rect window_bounds(bounds); + plugin_thread->Send( + new PluginProcessHostMsg_PluginDisposeWindow(window_id, window_bounds)); + } +} +#endif + bool IsDefaultPluginEnabled() { #if defined(OS_WIN) return true; |