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

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: Adding a way to remove an intent callback. 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 3c4827241de79de48caa6b75e3d0829d7e9d1a67..c526cd9c3a3c0d9c4eb96725b6fbc084b5ce5d6d 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) {
David Trainor- moved to gerrit 2013/11/19 23:27:39 Is this meant to cancel the action? If not, shoul
Jay Civelli 2013/11/20 00:46:40 You mean removing the callback from mOutstandingIn
+ 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