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

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

Issue 10963041: Revert "Revert 158067 - Remove native side of content_view_client" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add additional_input_paths as a variable and input to java.gypi 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
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/ErrorCodeConversionHelper.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b933a6e48439a23d25ee45f4c4269c903f540f82..e239b3f2fbad505f76f17d435ced4164db40992a 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
@@ -11,6 +11,8 @@ import android.view.KeyEvent;
import android.webkit.ConsoleMessage;
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.
@@ -102,6 +104,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;
}
@@ -140,16 +165,18 @@ public abstract class AwContentsClient extends ContentViewClient {
public abstract void onFindResultReceived(int activeMatchOrdinal, int numberOfMatches,
boolean isDoneCounting);
+ 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;
}
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/ErrorCodeConversionHelper.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698