diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-13 00:37:22 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-13 00:37:22 +0000 |
commit | 96171cb12c21ded18210e72b2a240f641cfeafff (patch) | |
tree | 093f31cb7403676e364518b2849e3172e7395ad8 /chrome_frame/chrome_frame_npapi_entrypoints.cc | |
parent | 1c53a1f1fa5074d24e7324e76e55ce57bb1c33b4 (diff) | |
download | chromium_src-96171cb12c21ded18210e72b2a240f641cfeafff.zip chromium_src-96171cb12c21ded18210e72b2a240f641cfeafff.tar.gz chromium_src-96171cb12c21ded18210e72b2a240f641cfeafff.tar.bz2 |
Add support in the ChromeFrame NPAPI plugin for receiving URL redirect notifications. This
is basically implementing the NPP_URLRedirectNotify plugin function and invoking the browser
end function NPN_URLRedirectResponse indicating whether the redirect is to be followed or
not.
The ChromeFrame NPAPI implementation always disallows url redirects from the plugin and
instead expects Chrome to follow the redirect.
Tested this with a Firefox 4 nightly build. Currently this does not work as expected because
of a bug in Firefox where it invokes the NPP_URLRedirectNotify function with the original
URL instead of the redirected URL. This is tracked by mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=625164
BUG=69419
TEST=none. Will add a test for this once we have a builder with a working version of Firefox 4.
Review URL: http://codereview.chromium.org/6223003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71271 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_npapi_entrypoints.cc')
-rw-r--r-- | chrome_frame/chrome_frame_npapi_entrypoints.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/chrome_frame/chrome_frame_npapi_entrypoints.cc b/chrome_frame/chrome_frame_npapi_entrypoints.cc index 267aba5..17eba60 100644 --- a/chrome_frame/chrome_frame_npapi_entrypoints.cc +++ b/chrome_frame/chrome_frame_npapi_entrypoints.cc @@ -37,6 +37,7 @@ NPError NPAPI NP_GetEntryPoints(NPPluginFuncs* plugin_funcs) { plugin_funcs->urlnotify = chrome_frame::NPP_URLNotify; plugin_funcs->getvalue = chrome_frame::NPP_GetValue; plugin_funcs->setvalue = chrome_frame::NPP_SetValue; + plugin_funcs->urlredirectnotify = chrome_frame::NPP_URLRedirectNotify; return NPERR_NO_ERROR; } @@ -194,11 +195,24 @@ void NPP_Print(NPP instance, NPPrint* print_info) { ChromeFrameNPAPI::ChromeFrameInstanceFromPluginInstance(instance); if (plugin_instance == NULL) { - NOTREACHED(); + NOTREACHED() << "Failed to find plugin instance"; return; } plugin_instance->Print(print_info); } +void NPP_URLRedirectNotify(NPP instance, const char* url, int status, + void* notify_data) { + ChromeFrameNPAPI* plugin_instance = + ChromeFrameNPAPI::ChromeFrameInstanceFromPluginInstance(instance); + + if (plugin_instance == NULL) { + NOTREACHED() << "Failed to find plugin instance"; + npapi::URLRedirectResponse(instance, notify_data, false); + return; + } + plugin_instance->URLRedirectNotify(url, status, notify_data); +} + } // namespace chrome_frame |