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

Unified Diff: chrome/browser/ui/autofill/autofill_popup_layout_model.cc

Issue 2531223003: Expanded Autofill Credit Card Popup Layout Experiment in Android. (Closed)
Patch Set: Uses format string for expiration date label. Consistently returns 0 as default (non-experiment) va… Created 4 years 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/browser/ui/autofill/autofill_popup_layout_model.cc
diff --git a/chrome/browser/ui/autofill/autofill_popup_layout_model.cc b/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
index 1b24397deb34abe28169891bfd150173fe235080..3ee0379cc24917cd2aa694543ef8518ce326b6b8 100644
--- a/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
@@ -10,10 +10,12 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/autofill/autofill_popup_view.h"
#include "chrome/browser/ui/autofill/popup_constants.h"
+#include "components/autofill/core/browser/autofill_experiments.h"
#include "components/autofill/core/browser/popup_item_ids.h"
#include "components/autofill/core/browser/suggestion.h"
#include "components/autofill/core/common/autofill_util.h"
#include "components/grit/components_scaled_resources.h"
+#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/font_list.h"
@@ -61,8 +63,8 @@ int GetRowHeightFromId(int identifier) {
} // namespace
AutofillPopupLayoutModel::AutofillPopupLayoutModel(
- AutofillPopupViewDelegate* delegate)
- : delegate_(delegate) {
+ AutofillPopupViewDelegate* delegate, bool is_credit_card_field)
+ : delegate_(delegate), is_credit_card_field_(is_credit_card_field) {
#if !defined(OS_ANDROID)
smaller_font_list_ =
normal_font_list_.DeriveWithSizeDelta(kSmallerFontSizeDelta);
@@ -244,4 +246,27 @@ const gfx::Rect AutofillPopupLayoutModel::RoundedElementBounds() const {
return gfx::ToEnclosingRect(delegate_->element_bounds());
}
+bool AutofillPopupLayoutModel::IsPopupLayoutExperimentEnabled() const {
+ return is_credit_card_field_ ?
Mathieu 2016/12/01 21:59:46 return is_credit_card_field_ && IsAutofill...
csashi 2016/12/02 05:15:29 Done.
+ IsAutofillCreditCardPopupLayoutExperimentEnabled() : false;
+}
+
+SkColor AutofillPopupLayoutModel::GetBackgroundColor() const {
+ return is_credit_card_field_ ?
+ GetCreditCardPopupBackgroundColor() : SK_ColorTRANSPARENT;
+}
+
+SkColor AutofillPopupLayoutModel::GetDividerColor() const {
+ return is_credit_card_field_ ?
+ GetCreditCardPopupDividerColor() : SK_ColorTRANSPARENT;
+}
+
+unsigned int AutofillPopupLayoutModel::GetDropdownItemHeight() const {
+ return is_credit_card_field_ ? GetCreditCardPopupDropdownItemHeight() : 0;
+}
+
+bool AutofillPopupLayoutModel::IsIconAtLeft() const {
+ return is_credit_card_field_ ? IsCreditCardIconInPopupAtLeft() : false;
Mathieu 2016/12/01 21:59:46 same here
csashi 2016/12/02 05:15:29 Done.
+}
+
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698