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

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

Issue 1399613002: Public glue layer plumbing for View#startActivityForResult (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 1a0acbfb9d883386d19a1026b0a087017e734252..ab356ff21ca2bf69c585cbdd21e2cd605082d0f6 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -8,6 +8,7 @@ import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ComponentCallbacks2;
import android.content.Context;
+import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Canvas;
@@ -153,6 +154,11 @@ public class AwContents implements SmartClipProvider,
* @see View#getScrollBarStyle()
*/
int super_getScrollBarStyle();
+
+ /**
+ * @see View#startActivityForResult(Intent, int)
+ */
+ void super_startActivityForResult(Intent intent, int requestCode);
}
/**
@@ -2199,6 +2205,23 @@ public class AwContents implements SmartClipProvider,
//--------------------------------------------------------------------------------------------
// View and ViewGroup method implementations
//--------------------------------------------------------------------------------------------
+ /**
+ * Calls android.view.View#startActivityForResult. A RuntimeException will
+ * be thrown by Android framework if startActivityForResult is called with
+ * a non-Activity context.
+ */
+ public void startActivityForResult(Intent intent, int requestCode) {
+ // Even in fullscreen mode, startActivityForResult will still use the
+ // initial internal access delegate because it has access to
+ // the hidden API View#startActivityForResult.
+ mFullScreenTransitionsState.getInitialInternalAccessDelegate()
+ .super_startActivityForResult(intent, requestCode);
+ }
+
+ public void onActivityResult(int requestCode, int resultCode, Intent data) {
+ // TODO(hush): Forward the activity result to content view core and
+ // replace the text with translated text.
+ }
/**
* @see android.webkit.View#onTouchEvent()

Powered by Google App Engine
This is Rietveld 408576698