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

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

Issue 2708703004: Reland "Refactor ContentViewClient (4/6)" (Closed)
Patch Set: rebased Created 3 years, 10 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/AwContents.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/AwContentViewClient.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java b/android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java
index ff33c778a41001192b5aaa9c66067f102079413a..846722b4d17c0c7c0b1ae59df39843986438b091 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java
@@ -4,15 +4,10 @@
package org.chromium.android_webview;
-import android.content.Context;
-import android.content.Intent;
import android.view.KeyEvent;
-import org.chromium.base.Log;
import org.chromium.content.browser.ContentViewClient;
-import java.net.URISyntaxException;
-
/**
* ContentViewClient implementation for WebView
*/
@@ -22,40 +17,12 @@ public class AwContentViewClient extends ContentViewClient {
private final AwContentsClient mAwContentsClient;
private final AwSettings mAwSettings;
private final AwContents mAwContents;
- private final Context mContext;
- public AwContentViewClient(AwContentsClient awContentsClient, AwSettings awSettings,
- AwContents awContents, Context context) {
+ public AwContentViewClient(
+ AwContentsClient awContentsClient, AwSettings awSettings, AwContents awContents) {
mAwContentsClient = awContentsClient;
mAwSettings = awSettings;
mAwContents = awContents;
- mContext = context;
- }
-
- @Override
- public void onBackgroundColorChanged(int color) {
- mAwContentsClient.onBackgroundColorChanged(color);
- }
-
- @Override
- public void onStartContentIntent(Context context, String contentUrl, boolean isMainFrame) {
- // Make sure that this URL is a valid scheme for this callback if interpreted as an intent,
- // even though we don't dispatch it as an intent here, because many WebView apps will once
- // it reaches them.
- String scheme = null;
- try {
- Intent intent = Intent.parseUri(contentUrl, Intent.URI_INTENT_SCHEME);
- scheme = intent.getScheme();
- } catch (URISyntaxException e) {
- // Just don't set the scheme, it will be rejected.
- }
- if (!isAcceptableContentIntentScheme(scheme)) {
- Log.w(TAG, "Invalid scheme for URI %s", contentUrl);
- return;
- }
- // Comes from WebViewImpl::detectContentOnTouch in Blink, so must be user-initiated, and
- // isn't a redirect.
- mAwContentsClient.shouldIgnoreNavigation(context, contentUrl, isMainFrame, true, false);
}
@Override
@@ -63,7 +30,7 @@ public class AwContentViewClient extends ContentViewClient {
if (mAwContentsClient.hasWebViewClient()) {
// The check below is reflecting Chrome's behavior and is a workaround for
// http://b/7697782.
- if (!ContentViewClient.shouldPropagateKey(event.getKeyCode())) return true;
+ if (!shouldPropagateKey(event.getKeyCode())) return true;
return mAwContentsClient.shouldOverrideKeyEvent(event);
}
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContents.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698