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

Unified Diff: components/autofill/android/java/src/org/chromium/components/autofill/AutofillSuggestion.java

Issue 2627153007: Fix styling of Form-Not-Secure warnings on Android (Closed)
Patch Set: actually set the icon size 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: components/autofill/android/java/src/org/chromium/components/autofill/AutofillSuggestion.java
diff --git a/components/autofill/android/java/src/org/chromium/components/autofill/AutofillSuggestion.java b/components/autofill/android/java/src/org/chromium/components/autofill/AutofillSuggestion.java
index ec5efc7eb4564b2f827f0016d2537d21aa4347fb..21d4b897ec6fb095c7552c7b2fdd06d6ed9c8a92 100644
--- a/components/autofill/android/java/src/org/chromium/components/autofill/AutofillSuggestion.java
+++ b/components/autofill/android/java/src/org/chromium/components/autofill/AutofillSuggestion.java
@@ -11,10 +11,11 @@ import org.chromium.ui.DropdownItemBase;
*/
public class AutofillSuggestion extends DropdownItemBase {
/**
- * The constant used to specify a http warning message in a list of Autofill suggestions.
+ * The constant used to specify warning messages in a list of Autofill suggestions.
* Has to be kept in sync with {@code POPUP_ITEM_ID_SEPARATOR} enum in
* components/autofill/core/browser/popup_item_ids.h
*/
+ private static final int ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE = -1;
private static final int ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE = -10;
private final String mLabel;
@@ -80,16 +81,18 @@ public class AutofillSuggestion extends DropdownItemBase {
public int getLabelFontColorResId() {
if (mSuggestionId == ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) {
return R.color.http_bad_warning_message_text;
+ } else if (mSuggestionId == ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE) {
+ return R.color.insecure_context_payment_disabled_message_text;
}
return super.getLabelFontColorResId();
}
@Override
- public int getLabelFontSizeResId() {
+ public int getSublabelFontSizeResId() {
if (mSuggestionId == ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) {
- return R.dimen.dropdown_item_smaller_label_font_size;
+ return R.dimen.dropdown_item_larger_sublabel_font_size;
}
- return super.getLabelFontSizeResId();
+ return super.getSublabelFontSizeResId();
}
@Override
@@ -108,6 +111,22 @@ public class AutofillSuggestion extends DropdownItemBase {
return super.isIconAtStart();
}
+ @Override
+ public int getIconSizeResId() {
+ if (mSuggestionId == ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) {
+ return R.dimen.dropdown_large_icon_size;
+ }
+ return super.getIconSizeResId();
+ }
+
+ @Override
+ public int getIconMarginResId() {
+ if (mSuggestionId == ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) {
+ return R.dimen.dropdown_large_icon_margin;
+ }
+ return super.getIconMarginResId();
+ }
+
public int getSuggestionId() {
return mSuggestionId;
}
« no previous file with comments | « components/autofill/android/java/res/values/dimens.xml ('k') | ui/android/java/res/layout/dropdown_item.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698