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

Unified Diff: customtabs/src/android/support/customtabs/CustomTabsSessionToken.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/CustomTabsSessionToken.java
diff --git a/customtabs/src/android/support/customtabs/CustomTabsSessionToken.java b/customtabs/src/android/support/customtabs/CustomTabsSessionToken.java
index d20921737b7877613ea3327decd6ef2a63890749..1adf7d6e99363e19da4451db32c3161b0a182bc1 100644
--- a/customtabs/src/android/support/customtabs/CustomTabsSessionToken.java
+++ b/customtabs/src/android/support/customtabs/CustomTabsSessionToken.java
@@ -38,13 +38,13 @@ public class CustomTabsSessionToken {
public void onNavigationEvent(int navigationEvent, Bundle extras) {}
@Override
- public void onMessageChannelReady(Uri origin, Bundle extras) {}
+ public void extraCallback(String callbackName, Bundle args) {}
@Override
- public void onPostMessage(String message, Bundle extras) {}
+ public void onMessageChannelReady(Bundle extras) {}
@Override
- public void extraCallback(String callbackName, Bundle args) {}
+ public void onPostMessage(String message, Bundle extras) {}
@Override
public IBinder asBinder() {
@@ -91,27 +91,27 @@ public class CustomTabsSessionToken {
}
@Override
- public synchronized void onMessageChannelReady(Uri origin, Bundle extras) {
+ public void extraCallback(String callbackName, Bundle args) {
try {
- mCallbackBinder.onMessageChannelReady(origin, extras);
+ mCallbackBinder.extraCallback(callbackName, args);
} catch (RemoteException e) {
Log.e(TAG, "RemoteException during ICustomTabsCallback transaction");
}
}
@Override
- public synchronized void onPostMessage(String message, Bundle extras) {
+ public void onMessageChannelReady(Bundle extras) {
try {
- mCallbackBinder.onPostMessage(message, extras);
+ mCallbackBinder.onMessageChannelReady(extras);
} catch (RemoteException e) {
Log.e(TAG, "RemoteException during ICustomTabsCallback transaction");
}
}
@Override
- public void extraCallback(String callbackName, Bundle args) {
+ public void onPostMessage(String message, Bundle extras) {
try {
- mCallbackBinder.extraCallback(callbackName, args);
+ mCallbackBinder.onPostMessage(message, extras);
} catch (RemoteException e) {
Log.e(TAG, "RemoteException during ICustomTabsCallback transaction");
}
@@ -143,4 +143,11 @@ public class CustomTabsSessionToken {
public CustomTabsCallback getCallback() {
return mCallback;
}
+
+ /**
+ * @return Whether this token is associated with the given session.
+ */
+ public boolean isAssociatedWith(CustomTabsSession session) {
+ return session.getBinder().equals(mCallbackBinder);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698