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

Unified Diff: ui/android/java/src/org/chromium/ui/base/WindowAndroid.java

Issue 1902903003: Receive intent callbacks without launching intents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mention request code in comment Created 4 years, 8 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 | « ui/android/java/src/org/chromium/ui/base/ActivityWindowAndroid.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
diff --git a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
index abd7b4bfcfa279145b31914c0b727db23d8d8098..a848f2882d8d5b3649a9bdb1addea033ca7fe8d8 100644
--- a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
+++ b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
@@ -24,6 +24,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityManager;
+import org.chromium.base.Callback;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
@@ -185,7 +186,7 @@ public class WindowAndroid {
* Shows an intent and returns the results to the callback object.
* @param intent The PendingIntent that needs to be shown.
* @param callback The object that will receive the results for the intent.
- * @param errorId The ID of error string to be show if activity is paused before intent
+ * @param errorId The ID of error string to be shown if activity is paused before intent
* results, or null if no message is required.
* @return Whether the intent was shown.
*/
@@ -197,7 +198,7 @@ public class WindowAndroid {
* Shows an intent and returns the results to the callback object.
* @param intent The intent that needs to be shown.
* @param callback The object that will receive the results for the intent.
- * @param errorId The ID of error string to be show if activity is paused before intent
+ * @param errorId The ID of error string to be shown if activity is paused before intent
* results, or null if no message is required.
* @return Whether the intent was shown.
*/
@@ -209,7 +210,7 @@ public class WindowAndroid {
* Shows an intent that could be canceled and returns the results to the callback object.
* @param intent The PendingIntent that needs to be shown.
* @param callback The object that will receive the results for the intent.
- * @param errorId The ID of error string to be show if activity is paused before intent
+ * @param errorId The ID of error string to be shown if activity is paused before intent
* results, or null if no message is required.
* @return A non-negative request code that could be used for finishActivity, or
* START_INTENT_FAILURE if failed.
@@ -222,9 +223,9 @@ public class WindowAndroid {
/**
* Shows an intent that could be canceled and returns the results to the callback object.
- * @param intent The intent that needs to be showed.
+ * @param intent The intent that needs to be shown.
* @param callback The object that will receive the results for the intent.
- * @param errorId The ID of error string to be show if activity is paused before intent
+ * @param errorId The ID of error string to be shown if activity is paused before intent
* results, or null if no message is required.
* @return A non-negative request code that could be used for finishActivity, or
* START_INTENT_FAILURE if failed.
@@ -235,6 +236,22 @@ public class WindowAndroid {
}
/**
+ * Shows an intent that could be canceled and returns the results to the callback object.
+ * @param intentTrigger The callback that triggers the intent that needs to be shown. The value
+ * passed to the trigger is the request code used for issuing the intent.
+ * @param callback The object that will receive the results for the intent.
+ * @param errorId The ID of error string to be shown if activity is paused before intent
+ * results, or null if no message is required.
+ * @return A non-negative request code that could be used for finishActivity, or
+ * START_INTENT_FAILURE if failed.
+ */
+ public int showCancelableIntent(Callback<Integer> intentTrigger, IntentCallback callback,
+ Integer errorId) {
+ Log.d(TAG, "Can't show intent as context is not an Activity");
+ return START_INTENT_FAILURE;
+ }
+
+ /**
* Force finish another activity that you had previously started with showCancelableIntent.
* @param requestCode The request code returned from showCancelableIntent.
*/
« no previous file with comments | « ui/android/java/src/org/chromium/ui/base/ActivityWindowAndroid.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698