summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authoramanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-01 19:41:56 +0000
committeramanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-01 19:41:56 +0000
commit1d5ac66b45c8e625fb4ec382d4e38e5357fdb257 (patch)
treeb98aaaafe5243bcd63d0db902d6c8bf1e415dec9 /chrome/plugin
parent4c98db35cdd001ce1585bc703375c92ec3ebea9b (diff)
downloadchromium_src-1d5ac66b45c8e625fb4ec382d4e38e5357fdb257.zip
chromium_src-1d5ac66b45c8e625fb4ec382d4e38e5357fdb257.tar.gz
chromium_src-1d5ac66b45c8e625fb4ec382d4e38e5357fdb257.tar.bz2
Fix several issues around fullscreen Mac plugins:
* Keystrokes are now properly sent to plugins in fullscreen mode * When a plugin creates a fullscreen window, we hide the menu bar and restore it when the window is closed BUG=19534,21020 TEST=Open a page with plugins that can go full screen (example: flash video players). Enter full screen mode and verify that esc, arrow keys, spacebar, etc. work as expected. Verify that the menu bar is hidden when the plugin goes fullscreen and is restored when it exits fullscreen mode. Review URL: http://codereview.chromium.org/257008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27755 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/plugin_main.cc10
-rw-r--r--chrome/plugin/plugin_thread.cc42
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;