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

Unified Diff: customtabs/src/android/support/customtabs/CustomTabsCallback.java

Issue 2591513002: Add a service to handle postMessage callbacks to client (Closed)
Patch Set: Made CustomTabsCallback purely synchronized Created 3 years, 11 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: customtabs/src/android/support/customtabs/CustomTabsCallback.java
diff --git a/customtabs/src/android/support/customtabs/CustomTabsCallback.java b/customtabs/src/android/support/customtabs/CustomTabsCallback.java
index 261fc870e30196ca2c9036eea9886210d359b04e..b7ded7b303a37d4ec7b3a19403a39abc60772046 100644
--- a/customtabs/src/android/support/customtabs/CustomTabsCallback.java
+++ b/customtabs/src/android/support/customtabs/CustomTabsCallback.java
@@ -64,27 +64,6 @@ public class CustomTabsCallback {
public void onNavigationEvent(int navigationEvent, Bundle extras) {}
/**
- * Sent when {@link CustomTabsSession} has requested a postMessage channel through
- * {@link CustomTabsService#validatePostMessageOrigin(CustomTabsSessionToken)} and the channel
- * is ready for sending and receiving messages on both ends.
- * @param origin The web origin that has been validated and will be used in all messages coming
- * from this {@link CustomTabsSession}.
- * @param extras Reserved for future use.
- */
- public synchronized void onMessageChannelReady(Uri origin, Bundle extras) {}
-
- /**
- * Sent when a tab controlled by this {@link CustomTabsSession} has sent a postMessage message.
- * If postMessage() is called from a single thread, then the messages will be posted in the same
- * order. When received on the client side, it is the client's responsibility to preserve the
- * ordering further.
- *
- * @param message The message sent.
- * @param extras Reserved for future use.
- */
- public synchronized void onPostMessage(String message, Bundle extras) {}
-
- /**
* Unsupported callbacks that may be provided by the implementation.
*
* <p>
@@ -99,4 +78,25 @@ public class CustomTabsCallback {
* @param args Arguments for the calback
*/
public void extraCallback(String callbackName, Bundle args) {}
+
+ /**
+ * Called when {@link CustomTabsSession} has requested a postMessage channel through
+ * {@link CustomTabsService#requestPostMessageChannel(
+ * CustomTabsSessionToken, android.content.ComponentName, Uri)} and the channel
+ * is ready for sending and receiving messages on both ends.
+ *
+ * @param extras Reserved for future use.
+ */
+ public void onMessageChannelReady(Bundle extras) {}
+
+ /**
+ * Called when a tab controlled by this {@link CustomTabsSession} has sent a postMessage message.
+ * If postMessage() is called from a single thread, then the messages will be posted in the
+ * same order. When received on the client side, it is the client's responsibility to preserve
+ * the ordering further.
+ *
+ * @param message The message sent.
+ * @param extras Reserved for future use.
+ */
+ public void onPostMessage(String message, Bundle extras) {}
}

Powered by Google App Engine
This is Rietveld 408576698