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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContentsClient.java

Issue 10952029: Remove native side of content_view_client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
Index: android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
index bcd0d19f9a21d2307e69a9ded1d9f14039790300..b6d9752d51d5758ef8671c8c3ec06cfcc9f4f737 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
@@ -10,7 +10,15 @@ import android.util.Log;
import android.view.KeyEvent;
import android.webkit.ConsoleMessage;
+import org.chromium.android_webview.AwContentsClient;
+import org.chromium.android_webview.AwWebContentsDelegate;
+import org.chromium.android_webview.ErrorCodeConversionHelper;
+import org.chromium.android_webview.JsPromptResultReceiver;
+import org.chromium.android_webview.JsResultReceiver;
+import org.chromium.base.CalledByNative;
import org.chromium.content.browser.ContentViewClient;
+import org.chromium.content.browser.ContentViewCore;
+import org.chromium.content.browser.WebContentsObserverAndroid;
/**
* Base-class that an AwContents embedder derives from to receive callbacks.
@@ -103,6 +111,29 @@ public abstract class AwContentsClient extends ContentViewClient {
}
}
+ class WebContentsObserverAdapter extends WebContentsObserverAndroid {
+ public WebContentsObserverAdapter(ContentViewCore contentViewCore) {
+ super(contentViewCore);
+ }
+
+ @Override
+ public void didStartLoading(String url) {
+ AwContentsClient.this.onPageStarted(url);
+ }
+
+ @Override
+ public void didStopLoading(String url) {
+ AwContentsClient.this.onPageFinished(url);
+ }
+
+ @Override
+ public void didFailLoad(boolean isProvisionalLoad,
+ boolean isMainFrame, int errorCode, String description, String failingUrl) {
+ AwContentsClient.this.onReceivedError(
+ ErrorCodeConversionHelper.convertErrorCode(errorCode), description, failingUrl);
+ }
+ }
+
final AwWebContentsDelegate getWebContentsDelegate() {
return mWebContentsDelegateAdapter;
}
@@ -123,16 +154,18 @@ public abstract class AwContentsClient extends ContentViewClient {
public abstract void onReceivedHttpAuthRequest(AwHttpAuthHandler handler,
String host, String realm);
+ public abstract void onPageStarted(String url);
+
+ public abstract void onPageFinished(String url);
+
+ public abstract void onReceivedError(int errorCode, String description, String failingUrl);
+
//--------------------------------------------------------------------------------------------
// Stuff that we ignore since it only makes sense for Chrome browser
//--------------------------------------------------------------------------------------------
//
@Override
- final public void onMainFrameCommitted(String url, String baseUrl) {
- }
-
- @Override
final public boolean shouldOverrideScroll(float dx, float dy, float scrollX, float scrollY) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698