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/common/plugin_messages.h | |
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/common/plugin_messages.h')
-rw-r--r-- | chrome/common/plugin_messages.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/chrome/common/plugin_messages.h b/chrome/common/plugin_messages.h index 74de33f..b195f5c 100644 --- a/chrome/common/plugin_messages.h +++ b/chrome/common/plugin_messages.h @@ -39,6 +39,11 @@ struct PluginMsg_Init_Params { std::vector<std::string> arg_values; bool load_manually; int host_render_view_routing_id; +#if defined(OS_MACOSX) + gfx::Rect containing_window_frame; + gfx::Rect containing_content_frame; + bool containing_window_has_focus; +#endif }; struct PluginHostMsg_URLRequest_Params { @@ -119,6 +124,11 @@ struct ParamTraits<PluginMsg_Init_Params> { WriteParam(m, p.arg_values); WriteParam(m, p.load_manually); WriteParam(m, p.host_render_view_routing_id); +#if defined(OS_MACOSX) + WriteParam(m, p.containing_window_frame); + WriteParam(m, p.containing_content_frame); + WriteParam(m, p.containing_window_has_focus); +#endif } static bool Read(const Message* m, void** iter, param_type* p) { return ReadParam(m, iter, &p->containing_window) && @@ -127,7 +137,14 @@ struct ParamTraits<PluginMsg_Init_Params> { ReadParam(m, iter, &p->arg_names) && ReadParam(m, iter, &p->arg_values) && ReadParam(m, iter, &p->load_manually) && - ReadParam(m, iter, &p->host_render_view_routing_id); + ReadParam(m, iter, &p->host_render_view_routing_id) +#if defined(OS_MACOSX) + && + ReadParam(m, iter, &p->containing_window_frame) && + ReadParam(m, iter, &p->containing_content_frame) && + ReadParam(m, iter, &p->containing_window_has_focus) +#endif + ; } static void Log(const param_type& p, std::wstring* l) { l->append(L"("); @@ -144,6 +161,14 @@ struct ParamTraits<PluginMsg_Init_Params> { LogParam(p.load_manually, l); l->append(L", "); LogParam(p.host_render_view_routing_id, l); +#if defined(OS_MACOSX) + l->append(L", "); + LogParam(p.containing_window_frame, l); + l->append(L", "); + LogParam(p.containing_content_frame, l); + l->append(L", "); + LogParam(p.containing_window_has_focus, l); +#endif l->append(L")"); } }; |