diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-08 15:52:13 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-08 15:52:13 +0000 |
commit | 1e6e3c99f8ca2ef9d8e86ddddec20dadc0fbf467 (patch) | |
tree | 95f198cfa03484708e1df0d75a909e4e99ad3134 /chrome/plugin | |
parent | 0e4898dee7088bf0e0e775ededf342fad6fe9606 (diff) | |
download | chromium_src-1e6e3c99f8ca2ef9d8e86ddddec20dadc0fbf467.zip chromium_src-1e6e3c99f8ca2ef9d8e86ddddec20dadc0fbf467.tar.gz chromium_src-1e6e3c99f8ca2ef9d8e86ddddec20dadc0fbf467.tar.bz2 |
Send window frame information to Mac plugins via IPC
Sends any window frame and relevent content view location changes to the plugin process via IPC, so that the plugin process always knows where the plugin is rather than only knowing when the mouse is within the plugin area. This will be necessary for supporting NPN_ConvertPoint, and for supporting Java2 as currently implemented.
Related changes:
- Now that window information is being sent on init and un-hide, use that to get correct initial window focus information.
- Add a missing window focus change notification uncovered by the above.
- Use live mouse location for idle events, instead of a cached location, now that we have live plugin frame information.
- Refactor and simplify the logic for moving the plugin.
Note that containing_window_frame_ is currently unused, but will be shortly for NPN_ConvertPoint, and is so closely related to the added IPC that I added it now rather than having to immediately change the new messages and functions.
BUG=34046,31858,31543,29457
TEST=Mouse tracking in Carbon plugins should still work correctly, even across window moves, info/bookmark bar show/hides, etc. (Automated tests of location tracking will follow shortly with full NPN_ConvertPoint implementation.)
Review URL: http://codereview.chromium.org/573015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r-- | chrome/plugin/webplugin_delegate_stub.cc | 25 | ||||
-rw-r--r-- | chrome/plugin/webplugin_delegate_stub.h | 5 |
2 files changed, 25 insertions, 5 deletions
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc index 80d6e62..a24f7fa 100644 --- a/chrome/plugin/webplugin_delegate_stub.cc +++ b/chrome/plugin/webplugin_delegate_stub.cc @@ -123,8 +123,9 @@ void WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) { OnSendJavaScriptStream) #if defined(OS_MACOSX) IPC_MESSAGE_HANDLER(PluginMsg_SetWindowFocus, OnSetWindowFocus) - IPC_MESSAGE_HANDLER(PluginMsg_SetContainerVisibility, - OnSetContainerVisibility) + IPC_MESSAGE_HANDLER(PluginMsg_ContainerHidden, OnContainerHidden) + IPC_MESSAGE_HANDLER(PluginMsg_ContainerShown, OnContainerShown) + IPC_MESSAGE_HANDLER(PluginMsg_WindowFrameChanged, OnWindowFrameChanged) #endif IPC_MESSAGE_HANDLER(PluginMsg_DidReceiveManualResponse, OnDidReceiveManualResponse) @@ -195,6 +196,9 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params, params.load_manually); #if defined(OS_MACOSX) delegate_->SetFocusNotifier(FocusNotifier); + delegate_->WindowFrameChanged(params.containing_window_frame, + params.containing_content_frame); + delegate_->SetWindowHasFocus(params.containing_window_has_focus); #endif } } @@ -345,8 +349,21 @@ void WebPluginDelegateStub::OnSetWindowFocus(bool has_focus) { delegate_->SetWindowHasFocus(has_focus); } -void WebPluginDelegateStub::OnSetContainerVisibility(bool is_visible) { - delegate_->SetContainerVisibility(is_visible); +void WebPluginDelegateStub::OnContainerHidden() { + delegate_->SetContainerVisibility(false); +} + +void WebPluginDelegateStub::OnContainerShown(gfx::Rect window_frame, + gfx::Rect view_frame, + bool has_focus) { + delegate_->WindowFrameChanged(window_frame, view_frame); + delegate_->SetContainerVisibility(true); + delegate_->SetWindowHasFocus(has_focus); +} + +void WebPluginDelegateStub::OnWindowFrameChanged(gfx::Rect window_frame, + gfx::Rect view_frame) { + delegate_->WindowFrameChanged(window_frame, view_frame); } #endif // OS_MACOSX diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h index 5a04758..efe93c10 100644 --- a/chrome/plugin/webplugin_delegate_stub.h +++ b/chrome/plugin/webplugin_delegate_stub.h @@ -80,7 +80,10 @@ class WebPluginDelegateStub : public IPC::Channel::Listener, #if defined(OS_MACOSX) void OnSetWindowFocus(bool has_focus); - void OnSetContainerVisibility(bool is_visible); + void OnContainerHidden(); + void OnContainerShown(gfx::Rect window_frame, gfx::Rect view_frame, + bool has_focus); + void OnWindowFrameChanged(gfx::Rect window_frame, gfx::Rect view_frame); #endif void OnDidReceiveManualResponse( |