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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java

Issue 1954363002: Start using the third_party/custom_tabs_client as support lib source (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 7 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: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
index eeec4727297592f94bf1a559278bc793d49d0990..72791e9b38f8a0f4e686b99796c5fc263f54512e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -13,6 +13,7 @@ import android.os.IBinder;
import android.os.StrictMode;
import android.support.customtabs.CustomTabsCallback;
import android.support.customtabs.CustomTabsIntent;
+import android.support.customtabs.CustomTabsSessionToken;
import android.support.v4.app.ActivityOptionsCompat;
import android.text.TextUtils;
import android.view.KeyEvent;
@@ -55,7 +56,6 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelectorImpl;
import org.chromium.chrome.browser.toolbar.ToolbarControlContainer;
import org.chromium.chrome.browser.util.ColorUtils;
import org.chromium.chrome.browser.util.FeatureUtilities;
-import org.chromium.chrome.browser.util.IntentUtils;
import org.chromium.chrome.browser.util.UrlUtilities;
import org.chromium.chrome.browser.widget.findinpage.FindToolbarManager;
import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils;
@@ -79,7 +79,7 @@ public class CustomTabActivity extends ChromeActivity {
private FindToolbarManager mFindToolbarManager;
private CustomTabIntentDataProvider mIntentDataProvider;
- private IBinder mSession;
+ private CustomTabsSessionToken mSession;
private CustomTabContentHandler mCustomTabContentHandler;
private Tab mMainTab;
private CustomTabBottomBarDelegate mBottomBarDelegate;
@@ -127,7 +127,7 @@ public class CustomTabActivity extends ChromeActivity {
return false;
}
- IBinder session = IntentUtils.safeGetBinderExtra(intent, CustomTabsIntent.EXTRA_SESSION);
+ CustomTabsSessionToken session = CustomTabsSessionToken.getSessionTokenFromIntent(intent);
if (session == null || !session.equals(sActiveContentHandler.getSession())) return false;
String url = IntentHandler.getUrlFromIntent(intent);
@@ -145,7 +145,8 @@ public class CustomTabActivity extends ChromeActivity {
* @param description The new content description for the action button.
* @return Whether the update is successful.
*/
- static boolean updateCustomButton(IBinder session, int id, Bitmap bitmap, String description) {
+ static boolean updateCustomButton(
+ CustomTabsSessionToken session, int id, Bitmap bitmap, String description) {
ThreadUtils.assertOnUiThread();
// Do nothing if there is no activity or the activity does not belong to this session.
if (sActiveContentHandler == null || !sActiveContentHandler.getSession().equals(session)) {
@@ -159,7 +160,8 @@ public class CustomTabActivity extends ChromeActivity {
* if true, updates {@link RemoteViews} on the secondary toolbar.
* @return Whether the update is successful.
*/
- static boolean updateRemoteViews(IBinder session, RemoteViews remoteViews, int[] clickableIDs,
+ static boolean updateRemoteViews(
+ CustomTabsSessionToken session, RemoteViews remoteViews, int[] clickableIDs,
PendingIntent pendingIntent) {
ThreadUtils.assertOnUiThread();
// Do nothing if there is no activity or the activity does not belong to this session.
@@ -297,7 +299,7 @@ public class CustomTabActivity extends ChromeActivity {
}
@Override
- public IBinder getSession() {
+ public CustomTabsSessionToken getSession() {
return mSession;
}

Powered by Google App Engine
This is Rietveld 408576698