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.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.cc')
-rw-r--r-- | chrome_frame/chrome_frame_npapi.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome_frame/chrome_frame_npapi.cc b/chrome_frame/chrome_frame_npapi.cc index 5716801..b503e35 100644 --- a/chrome_frame/chrome_frame_npapi.cc +++ b/chrome_frame/chrome_frame_npapi.cc @@ -1509,3 +1509,15 @@ int32 ChromeFrameNPAPI::Write(NPStream* stream, int32 offset, int32 len, NPError ChromeFrameNPAPI::DestroyStream(NPStream* stream, NPReason reason) { return url_fetcher_.DestroyStream(stream, reason); } + +void ChromeFrameNPAPI::URLRedirectNotify(const char* url, int status, + void* notify_data) { + DVLOG(1) << __FUNCTION__ + << "Received redirect notification for url:" + << url; + // Inform chrome about the redirect and disallow the current redirect + // attempt. + url_fetcher_.UrlRedirectNotify(url, status, notify_data); + npapi::URLRedirectResponse(instance_, notify_data, false); +} + |