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

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

Issue 2438103002: Add postMessage APIs to the support lib (Closed)
Patch Set: removed unnecessary import Created 4 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
Index: customtabs/src/android/support/customtabs/CustomTabsSessionToken.java
diff --git a/customtabs/src/android/support/customtabs/CustomTabsSessionToken.java b/customtabs/src/android/support/customtabs/CustomTabsSessionToken.java
index 9113eb036a61650d255739016419298deecb9315..d20921737b7877613ea3327decd6ef2a63890749 100644
--- a/customtabs/src/android/support/customtabs/CustomTabsSessionToken.java
+++ b/customtabs/src/android/support/customtabs/CustomTabsSessionToken.java
@@ -17,6 +17,7 @@
package android.support.customtabs;
import android.content.Intent;
+import android.net.Uri;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
@@ -37,6 +38,12 @@ public class CustomTabsSessionToken {
public void onNavigationEvent(int navigationEvent, Bundle extras) {}
@Override
+ public void onMessageChannelReady(Uri origin, Bundle extras) {}
+
+ @Override
+ public void onPostMessage(String message, Bundle extras) {}
+
+ @Override
public void extraCallback(String callbackName, Bundle args) {}
@Override
@@ -84,6 +91,24 @@ public class CustomTabsSessionToken {
}
@Override
+ public synchronized void onMessageChannelReady(Uri origin, Bundle extras) {
+ try {
+ mCallbackBinder.onMessageChannelReady(origin, extras);
+ } catch (RemoteException e) {
+ Log.e(TAG, "RemoteException during ICustomTabsCallback transaction");
+ }
+ }
+
+ @Override
+ public synchronized void onPostMessage(String message, Bundle extras) {
+ try {
+ mCallbackBinder.onPostMessage(message, extras);
+ } catch (RemoteException e) {
+ Log.e(TAG, "RemoteException during ICustomTabsCallback transaction");
+ }
+ }
+
+ @Override
public void extraCallback(String callbackName, Bundle args) {
try {
mCallbackBinder.extraCallback(callbackName, args);

Powered by Google App Engine
This is Rietveld 408576698