Chromium Code Reviews| Index: android_webview/native/aw_web_contents_delegate.cc |
| diff --git a/android_webview/native/aw_web_contents_delegate.cc b/android_webview/native/aw_web_contents_delegate.cc |
| index 2a04d2dd7f29f0a6521218eb4dc9085e7658e012..a35af90efb9072b3d0a3db602a85509e6b54cffd 100644 |
| --- a/android_webview/native/aw_web_contents_delegate.cc |
| +++ b/android_webview/native/aw_web_contents_delegate.cc |
| @@ -8,10 +8,16 @@ |
| #include "android_webview/browser/find_helper.h" |
| #include "android_webview/native/aw_contents.h" |
| #include "android_webview/native/aw_javascript_dialog_creator.h" |
| +#include "content/public/browser/android/download_controller_android.h" |
| #include "content/public/browser/web_contents.h" |
| +#include "net/http/http_request_headers.h" |
| using content::WebContents; |
| +namespace content{ |
| +class DownloadItem; |
|
jam
2012/10/15 06:45:04
nit: unnecessary
nilesh
2012/10/15 17:13:51
Removed
|
| +} |
| + |
| namespace android_webview { |
| static base::LazyInstance<AwJavaScriptDialogCreator>::Leaky |
| @@ -47,4 +53,19 @@ void AwWebContentsDelegate::FindReply(WebContents* web_contents, |
| final_update); |
| } |
| +bool AwWebContentsDelegate::CanDownload(content::RenderViewHost* source, |
|
joth
2012/10/12 23:03:48
as per my comment over in https://codereview.chrom
nilesh
2012/10/12 23:10:16
This will only be called if you use the Chrome Imp
|
| + int request_id, |
| + const std::string& request_method) { |
| + if (request_method == net::HttpRequestHeaders::kGetMethod) { |
| + content::DownloadControllerAndroid::Get()->CreateGETDownload( |
| + source, request_id); |
| + } |
| + return false; |
| +} |
| + |
| +void AwWebContentsDelegate::OnStartDownload(WebContents* source, |
| + content::DownloadItem* download) { |
| + NOTREACHED(); // We always return false in CanDownload. |
| +} |
| + |
| } // namespace android_webview |