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

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

Issue 1385283002: [Custom Tabs]Record warnings if given action button bitmap's size out of bound (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refer to url Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/ActionButtonParams.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ActionButtonParams.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ActionButtonParams.java
index f2f4502a5c69bcd616d84b2aff41be248f6f1fff..df1bb3f0fbec7b0a95d6ce958c05cf03bd8673c2 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ActionButtonParams.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ActionButtonParams.java
@@ -15,6 +15,7 @@ import android.support.annotation.NonNull;
import android.support.customtabs.CustomTabsIntent;
import android.text.TextUtils;
+import org.chromium.base.Log;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.util.IntentUtils;
import org.chromium.chrome.browser.widget.TintedDrawable;
@@ -23,6 +24,8 @@ import org.chromium.chrome.browser.widget.TintedDrawable;
* Container for all parameters related to creating a custom action button.
*/
/* package */ class ActionButtonParams {
+ private static final String TAG = "cr_CustomTabs";
+
private Bitmap mIcon;
private String mDescription;
private final PendingIntent mPendingIntent;
@@ -111,6 +114,9 @@ import org.chromium.chrome.browser.widget.TintedDrawable;
Bitmap bitmap = IntentUtils.safeGetParcelable(bundle, CustomTabsIntent.KEY_ICON);
if (bitmap == null) return null;
if (!checkCustomButtonIconWithinBounds(context, bitmap)) {
+ Log.w(TAG, "Action button's icon size not acceptable. Please refer to "
+ + "https://developer.android.com/reference/android/support/customtabs/"
+ + "CustomTabsIntent.html#KEY_ICON");
bitmap.recycle();
return null;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698