Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/DownloadController.java

Issue 11139003: Move DownloadListener handling out to webview layer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: comment nit Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/DownloadController.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/DownloadController.java b/content/public/android/java/src/org/chromium/content/browser/DownloadController.java
index 9b821816a3bc3775d2aa45e74245e154063322f1..1c9050cde074bf6465294b6e3d67242ef7c576fb 100644
--- a/content/public/android/java/src/org/chromium/content/browser/DownloadController.java
+++ b/content/public/android/java/src/org/chromium/content/browser/DownloadController.java
@@ -5,7 +5,6 @@
package org.chromium.content.browser;
import android.content.Context;
-import android.webkit.DownloadListener;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
@@ -33,10 +32,6 @@ class DownloadController {
nativeInit();
}
- private static DownloadListener listenerFromView(ContentViewCore view) {
- return view.downloadListener();
- }
-
private static ContentViewDownloadDelegate downloadDelegateFromView(ContentViewCore view) {
return view.getDownloadDelegate();
}
@@ -46,10 +41,10 @@ class DownloadController {
}
/**
- * Notifies the DownloadListener of a new GET download and passes all the information
+ * Notifies the download delegate of a new GET download and passes all the information
* needed to download the file.
*
- * The DownloadListener is expected to handle the download.
+ * The download delegate is expected to handle the download.
*/
@CalledByNative
public void newHttpGetDownload(ContentViewCore view, String url,
@@ -60,17 +55,11 @@ class DownloadController {
if (downloadDelagate != null) {
downloadDelagate.requestHttpGetDownload(url, userAgent, contentDisposition,
mimetype, cookie, referer, contentLength);
- return;
- }
-
- DownloadListener listener = listenerFromView(view);
- if (listener != null) {
- listener.onDownloadStart(url, userAgent, contentDisposition, mimetype, contentLength);
}
}
/**
- * Notifies the DownloadListener that a new POST download has started.
+ * Notifies the download delegate that a new POST download has started.
*/
@CalledByNative
public void onHttpPostDownloadStarted(ContentViewCore view) {
@@ -82,7 +71,7 @@ class DownloadController {
}
/**
- * Notifies the DownloadListener that a POST download completed and passes along info about the
+ * Notifies the download delegate that a POST download completed and passes along info about the
* download.
*/
@CalledByNative
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698