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

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

Issue 32543003: Adding a way to remove an intent callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Synced Created 7 years, 1 month 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 | 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 c3b85a00eb7696765dcd7b027f08af1b7a74218d..fc4dfeaccc27c5c6069ad3eb852e8fa8c6c02f6d 100644
--- a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
+++ b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
@@ -58,6 +58,20 @@ public class WindowAndroid {
}
/**
+ * Removes a callback from the list of pending intents, so that nothing happens if/when the
+ * result for that intent is received.
+ * @param callback The object that should have received the results
+ * @return True if the callback was removed, false if it was not found.
+ */
+ public boolean removeIntentCallback(IntentCallback callback) {
+ int requestCode = mOutstandingIntents.indexOfValue(callback);
+ if (requestCode < 0) return false;
+ mOutstandingIntents.remove(requestCode);
+ mIntentErrors.remove(requestCode);
+ return true;
+ }
+
+ /**
* Displays an error message with a provided error message string.
* @param error The error message string to be displayed.
*/
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698