Use WebContentsDelegate::CanDownload to intercept file downloads on Android.
On Android we need to
- Intercepts GET download requests, collects all information for the downlaod to be executed on the JAVA/app side.
- POST requests are handled normally.
Review URL: http://codereview.chromium.org/9464025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126336 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index b649872..d5111fd 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -31,6 +31,7 @@
class BrowserContext;
class DownloadItem;
class JavaScriptDialogCreator;
+class RenderViewHost;
class WebContents;
class WebIntentsDispatcher;
struct ContextMenuParams;
@@ -208,7 +209,9 @@
virtual void WebContentsFocused(WebContents* contents) {}
// Asks the delegate if the given tab can download.
- virtual bool CanDownload(WebContents* source, int request_id);
+ virtual bool CanDownload(RenderViewHost* render_view_host,
+ int request_id,
+ const std::string& request_method);
// Notifies the delegate that a download is starting.
virtual void OnStartDownload(WebContents* source, DownloadItem* download) {}