Chromium Code Reviews| Index: android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java |
| diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java |
| index 94e67dd841d38323afd7ef20022ac23056bb297f..bd2ffdf00a34d4cbe1bb6c20ba8bc7f0af8168bb 100644 |
| --- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java |
| +++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java |
| @@ -6,6 +6,7 @@ package com.android.webview.chromium; |
| import android.app.assist.AssistStructure.ViewNode; |
| import android.content.Context; |
| +import android.content.Intent; |
| import android.content.res.Configuration; |
| import android.graphics.Bitmap; |
| import android.graphics.Canvas; |
| @@ -60,6 +61,7 @@ import org.chromium.content_public.browser.NavigationHistory; |
| import java.io.BufferedWriter; |
| import java.io.File; |
| +import java.lang.reflect.Method; |
| import java.util.Iterator; |
| import java.util.Map; |
| import java.util.Queue; |
| @@ -1746,6 +1748,20 @@ class WebViewChromium implements WebViewProvider, WebViewProvider.ScrollDelegate |
| mAwContents.setLayoutParams(layoutParams); |
| } |
| + // Overrides WebViewProvider.ViewDelegate.onActivityResult (not in system api jar yet). |
| + public void onActivityResult(final int requestCode, final int resultCode, final Intent data) { |
| + if (checkNeedsPost()) { |
| + mRunQueue.addTask(new Runnable() { |
| + @Override |
| + public void run() { |
| + onActivityResult(requestCode, resultCode, data); |
| + } |
| + }); |
| + return; |
| + } |
| + mAwContents.onActivityResult(requestCode, resultCode, data); |
| + } |
| + |
| @Override |
| public boolean performLongClick() { |
| // Return false unless the WebView is attached to a View with a parent |
| @@ -2240,6 +2256,18 @@ class WebViewChromium implements WebViewProvider, WebViewProvider.ScrollDelegate |
| } |
| @Override |
| + public void super_startActivityForResult(Intent intent, int requestCode) { |
| + // TODO(hush): Use mWebViewPrivate.super_startActivityForResult after N release. |
|
sgurun-gerrit only
2015/10/14 17:40:13
add this as a second clean up item in the bug I me
hush (inactive)
2015/10/14 21:33:58
Done.
|
| + try { |
| + Method startActivityForResultMethod = |
| + View.class.getMethod("startActivityForResult", Intent.class, int.class); |
| + startActivityForResultMethod.invoke(mWebView, intent, requestCode); |
| + } catch (Exception e) { |
| + throw new RuntimeException("Invalid reflection", e); |
|
Torne
2015/10/14 13:42:58
Maybe you should API-level guard this function for
sgurun-gerrit only
2015/10/14 17:40:13
+1
also note that, in theory, which api level you
hush (inactive)
2015/10/14 21:33:58
View#startActivityForResult will work in M. WebVie
hush (inactive)
2015/10/14 21:33:58
This is function can only be called on M+ because
|
| + } |
| + } |
| + |
| + @Override |
| public boolean awakenScrollBars() { |
| mWebViewPrivate.awakenScrollBars(0); |
| // TODO: modify the WebView.PrivateAccess to provide a return value. |