summaryrefslogtreecommitdiffstats
path: root/android_webview
diff options
context:
space:
mode:
authorlazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-03 09:01:54 +0000
committerlazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-03 09:01:54 +0000
commitf85f5037bcba6e52fedae883add00b39f824edc3 (patch)
tree60a6c3fd2830a90d7c18fc6700f1d144bba04ef3 /android_webview
parent090374df3d55fbe4e173d78e43684aa93675063d (diff)
downloadchromium_src-f85f5037bcba6e52fedae883add00b39f824edc3.zip
chromium_src-f85f5037bcba6e52fedae883add00b39f824edc3.tar.gz
chromium_src-f85f5037bcba6e52fedae883add00b39f824edc3.tar.bz2
permissionrequest API for guest Download.
Exposed event: event.type = 'download' event.requestMethod = 'GET'/'POST'... event.url = url BUG=141204 TEST=Pending: osx + win (b/c there is a *ViewGuest change). Added browser_tests:WebViewTest.Download, ran unit_tests:DownloadRequestLimiterTest* Review URL: https://chromiumcodereview.appspot.com/13037003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192029 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview')
-rw-r--r--android_webview/native/aw_web_contents_delegate.cc10
-rw-r--r--android_webview/native/aw_web_contents_delegate.h6
2 files changed, 10 insertions, 6 deletions
diff --git a/android_webview/native/aw_web_contents_delegate.cc b/android_webview/native/aw_web_contents_delegate.cc
index ef93550..427ffa3 100644
--- a/android_webview/native/aw_web_contents_delegate.cc
+++ b/android_webview/native/aw_web_contents_delegate.cc
@@ -52,13 +52,15 @@ void AwWebContentsDelegate::FindReply(WebContents* web_contents,
final_update);
}
-bool AwWebContentsDelegate::CanDownload(content::RenderViewHost* source,
- int request_id,
- const std::string& request_method) {
+void AwWebContentsDelegate::CanDownload(
+ content::RenderViewHost* source,
+ int request_id,
+ const std::string& request_method,
+ const base::Callback<void(bool)>& callback) {
// Android webview intercepts download in its resource dispatcher host
// delegate, so should not reach here.
NOTREACHED();
- return false;
+ callback.Run(false);
}
void AwWebContentsDelegate::AddNewContents(content::WebContents* source,
diff --git a/android_webview/native/aw_web_contents_delegate.h b/android_webview/native/aw_web_contents_delegate.h
index 500097e..56fed6b 100644
--- a/android_webview/native/aw_web_contents_delegate.h
+++ b/android_webview/native/aw_web_contents_delegate.h
@@ -27,9 +27,11 @@ class AwWebContentsDelegate
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update) OVERRIDE;
- virtual bool CanDownload(content::RenderViewHost* source,
+ virtual void CanDownload(content::RenderViewHost* source,
int request_id,
- const std::string& request_method) OVERRIDE;
+ const std::string& request_method,
+ const base::Callback<void(bool)>& callback) OVERRIDE;
+
virtual void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,