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

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

Issue 2496683003: Http Bad: Add a PopupItemId to identify http warning message (Closed)
Patch Set: update Created 4 years, 1 month 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 cfe248c61ac5de25b3877cc29d0a1842fc9a85ae..517b38f5d66d2d8141b8b679c29b4ebb2ff74963 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
@@ -4,12 +4,18 @@
package org.chromium.components.autofill;
-import org.chromium.ui.DropdownItem;
+import org.chromium.ui.DropdownItemBase;
/**
* Autofill suggestion container used to store information needed for each Autofill popup entry.
*/
-public class AutofillSuggestion implements DropdownItem {
+public class AutofillSuggestion extends DropdownItemBase {
+ /**
+ * The constant used to specify a http warning message in a list of Autofill suggestions.
+ * Has to be kept in sync with enum in popup_item_ids.h
+ */
+ private static final int ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE = -10;
Ted C 2016/11/17 17:52:26 We support generating java constants from a C++ en
lshang 2016/11/18 00:03:19 Yeah you're right, that way we can also get rid of
Ted C 2016/11/18 00:18:05 Generating java from c++ is usually like 5 or 6 li
+
private final String mLabel;
private final String mSublabel;
private final int mIconId;
@@ -51,18 +57,24 @@ public class AutofillSuggestion implements DropdownItem {
}
@Override
- public boolean isEnabled() {
- return true;
+ public boolean isMultilineLabel() {
+ return mIsMultilineLabel;
}
@Override
- public boolean isGroupHeader() {
- return false;
+ public int getLabelFontColor() {
+ if (mSuggestionId == ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) {
+ return R.color.http_bad_warning_message_text;
+ }
+ return super.getLabelFontColor();
}
@Override
- public boolean isMultilineLabel() {
- return mIsMultilineLabel;
+ public int getLabelFontSize() {
+ if (mSuggestionId == ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) {
+ return R.dimen.dropdown_item_smaller_label_font_size;
+ }
+ return super.getLabelFontSize();
}
public int getSuggestionId() {

Powered by Google App Engine
This is Rietveld 408576698