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

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

Issue 2591513002: Add a service to handle postMessage callbacks to client (Closed)
Patch Set: lizeb@ nits 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/CustomTabsClient.java
diff --git a/customtabs/src/android/support/customtabs/CustomTabsClient.java b/customtabs/src/android/support/customtabs/CustomTabsClient.java
index 84cf46374ca39798272f7503a1646ff881945e3d..52cc732625089461e80f8902e8203fd7ac44a82c 100644
--- a/customtabs/src/android/support/customtabs/CustomTabsClient.java
+++ b/customtabs/src/android/support/customtabs/CustomTabsClient.java
@@ -125,7 +125,7 @@ public class CustomTabsClient {
* necessary.
*
* @param context {@link Context} to use to connect to the remote service.
- * @param packageName Package name of the target implamentation.
+ * @param packageName Package name of the target implementation.
* @return Whether the binding was successful.
*/
public static boolean connectAndInitialize(Context context, String packageName) {
@@ -196,35 +196,37 @@ public class CustomTabsClient {
}
@Override
- public synchronized void onMessageChannelReady(final Uri origin, final Bundle extras) {
+ public void extraCallback(final String callbackName, final Bundle args)
+ throws RemoteException {
if (callback == null) return;
mHandler.post(new Runnable() {
@Override
public void run() {
- callback.onMessageChannelReady(origin, extras);
+ callback.extraCallback(callbackName, args);
}
});
}
@Override
- public synchronized void onPostMessage(final String message, final Bundle extras) {
+ public void onMessageChannelReady(final Bundle extras)
+ throws RemoteException {
if (callback == null) return;
mHandler.post(new Runnable() {
@Override
public void run() {
- callback.onPostMessage(message, extras);
+ callback.onMessageChannelReady(extras);
}
});
}
@Override
- public void extraCallback(final String callbackName, final Bundle args)
+ public void onPostMessage(final String message, final Bundle extras)
throws RemoteException {
if (callback == null) return;
mHandler.post(new Runnable() {
@Override
public void run() {
- callback.extraCallback(callbackName, args);
+ callback.onPostMessage(message, extras);
}
});
}

Powered by Google App Engine
This is Rietveld 408576698