summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser
diff options
context:
space:
mode:
authorSelim Gurun <sgurun@google.com>2014-05-15 16:02:47 -0700
committerSelim Gurun <sgurun@google.com>2014-05-15 16:20:50 -0700
commitd667cb5b354815de38045f5fabdc6afe903e2abc (patch)
treeaa6feb22fde4297ef99e74e1550f120c5df1a96e /src/com/android/browser
parent440030f0992eec8da2b717566ad4895d9621041c (diff)
downloadpackages_apps_Browser-d667cb5b354815de38045f5fabdc6afe903e2abc.zip
packages_apps_Browser-d667cb5b354815de38045f5fabdc6afe903e2abc.tar.gz
packages_apps_Browser-d667cb5b354815de38045f5fabdc6afe903e2abc.tar.bz2
Move Browser-only files to Browser package
Bug: 11231013 Change-Id: I2e019adf57464021011ee28d6865e709de43051f
Diffstat (limited to 'src/com/android/browser')
-rw-r--r--src/com/android/browser/BrowserDownloadListener.java58
-rw-r--r--src/com/android/browser/Tab.java2
-rw-r--r--src/com/android/browser/WebBackForwardListClient.java41
3 files changed, 99 insertions, 2 deletions
diff --git a/src/com/android/browser/BrowserDownloadListener.java b/src/com/android/browser/BrowserDownloadListener.java
new file mode 100644
index 0000000..08947fa
--- /dev/null
+++ b/src/com/android/browser/BrowserDownloadListener.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.browser;
+
+import android.webkit.DownloadListener;
+
+/**
+ * An abstract download listener that allows passing extra information as
+ * part of onDownloadStart callback.
+ */
+public abstract class BrowserDownloadListener implements DownloadListener {
+
+ /**
+ * Notify the host application that a file should be downloaded
+ * @param url The full url to the content that should be downloaded
+ * @param userAgent the user agent to be used for the download.
+ * @param contentDisposition Content-disposition http header, if
+ * present.
+ * @param mimetype The mimetype of the content reported by the server
+ * @param referer The referer associated with this url
+ * @param contentLength The file size reported by the server
+ */
+ public abstract void onDownloadStart(String url, String userAgent,
+ String contentDisposition, String mimetype, String referer,
+ long contentLength);
+
+
+ /**
+ * Notify the host application that a file should be downloaded
+ * @param url The full url to the content that should be downloaded
+ * @param userAgent the user agent to be used for the download.
+ * @param contentDisposition Content-disposition http header, if
+ * present.
+ * @param mimetype The mimetype of the content reported by the server
+ * @param contentLength The file size reported by the server
+ */
+ @Override
+ public void onDownloadStart(String url, String userAgent,
+ String contentDisposition, String mimetype, long contentLength) {
+
+ onDownloadStart(url, userAgent, contentDisposition, mimetype, null,
+ contentLength);
+ }
+}
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 668786c..ea5ad89 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -46,7 +46,6 @@ import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewStub;
-import android.webkit.BrowserDownloadListener;
import android.webkit.ClientCertRequest;
import android.webkit.ConsoleMessage;
import android.webkit.GeolocationPermissions;
@@ -57,7 +56,6 @@ import android.webkit.SslErrorHandler;
import android.webkit.URLUtil;
import android.webkit.ValueCallback;
import android.webkit.WebBackForwardList;
-import android.webkit.WebBackForwardListClient;
import android.webkit.WebChromeClient;
import android.webkit.WebHistoryItem;
import android.webkit.WebResourceResponse;
diff --git a/src/com/android/browser/WebBackForwardListClient.java b/src/com/android/browser/WebBackForwardListClient.java
new file mode 100644
index 0000000..60d48fc
--- /dev/null
+++ b/src/com/android/browser/WebBackForwardListClient.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.browser;
+
+import android.webkit.WebHistoryItem;
+
+/**
+ * Interface to receive notifications when items are added to the
+ * {@link android.webkit.WebBackForwardList}.
+ */
+public abstract class WebBackForwardListClient {
+
+ /**
+ * Notify the client that <var>item</var> has been added to the
+ * WebBackForwardList.
+ * @param item The newly created WebHistoryItem
+ */
+ public void onNewHistoryItem(WebHistoryItem item) { }
+
+ /**
+ * Notify the client that the <var>item</var> at <var>index</var> is now
+ * the current history item.
+ * @param item A WebHistoryItem
+ * @param index The new history index
+ */
+ public void onIndexChanged(WebHistoryItem item, int index) { }
+}