Chromium Code Reviews| 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 |