Chromium Code Reviews| Index: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc |
| diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc |
| index 857811f3111d7d0ad38e388e9466d3169a09d59d..1827dc7e61860f056916e42d9824cab8650e7448 100644 |
| --- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc |
| +++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc |
| @@ -40,7 +40,7 @@ const size_t kRowHeight = 24; |
| // The vertical height of a separator in pixels. |
| const size_t kSeparatorHeight = 1; |
| -#if !defined(OS_ANDROID) |
| +#if !defined(OS_ANDROID) || defined(USE_AURA) |
| // Size difference between name and label in pixels. |
| const int kLabelFontSizeDelta = -2; |
| @@ -62,7 +62,7 @@ const DataResource kDataResources[] = { |
| { "jcbCC", IDR_AUTOFILL_CC_GENERIC }, |
| { "masterCardCC", IDR_AUTOFILL_CC_MASTERCARD }, |
| { "visaCC", IDR_AUTOFILL_CC_VISA }, |
| -#if defined(OS_ANDROID) |
| +#if defined(OS_ANDROID) && !defined(USE_AURA) |
| { "scanCreditCardIcon", IDR_AUTOFILL_CC_SCAN_NEW }, |
| { "settings", IDR_AUTOFILL_SETTINGS }, |
| #endif |
| @@ -113,7 +113,7 @@ AutofillPopupControllerImpl::AutofillPopupControllerImpl( |
| controller_common_->SetKeyPressCallback( |
| base::Bind(&AutofillPopupControllerImpl::HandleKeyPressEvent, |
| base::Unretained(this))); |
| -#if !defined(OS_ANDROID) |
| +#if !defined(OS_ANDROID) || defined(USE_AURA) |
| label_font_list_ = value_font_list_.DeriveWithSizeDelta(kLabelFontSizeDelta); |
| title_font_list_ = value_font_list_.DeriveWithStyle(gfx::Font::BOLD); |
| #if defined(OS_MACOSX) |
| @@ -133,7 +133,7 @@ void AutofillPopupControllerImpl::Show( |
| DCHECK_EQ(suggestions_.size(), elided_values_.size()); |
| DCHECK_EQ(suggestions_.size(), elided_labels_.size()); |
| -#if !defined(OS_ANDROID) |
| +#if !defined(OS_ANDROID) || defined(USE_AURA) |
| // Android displays the long text with ellipsis using the view attributes. |
| UpdatePopupBounds(); |
| @@ -310,7 +310,7 @@ bool AutofillPopupControllerImpl::HandleKeyPressEvent( |
| } |
| void AutofillPopupControllerImpl::UpdateBoundsAndRedrawPopup() { |
| -#if !defined(OS_ANDROID) |
| +#if !defined(OS_ANDROID) || defined(USE_AURA) |
| // TODO(csharp): Since UpdatePopupBounds can change the position of the popup, |
| // the popup could end up jumping from above the element to below it. |
| // It is unclear if it is better to keep the popup where it was, or if it |
| @@ -359,10 +359,10 @@ int AutofillPopupControllerImpl::GetIconResourceID( |
| } |
| } |
| -#if defined(OS_ANDROID) |
| +#if defined(OS_ANDROID) && !defined(USE_AURA) |
| if (result == IDR_AUTOFILL_CC_SCAN_NEW && IsKeyboardAccessoryEnabled()) |
| result = IDR_AUTOFILL_CC_SCAN_NEW_KEYBOARD_ACCESSORY; |
| -#endif // OS_ANDROID |
| +#endif |
| return result; |
| } |
| @@ -460,7 +460,7 @@ bool AutofillPopupControllerImpl::RemoveSuggestion(int list_index) { |
| return true; |
| } |
| -#if !defined(OS_ANDROID) |
| +#if !defined(OS_ANDROID) || defined(USE_AURA) |
| const gfx::FontList& AutofillPopupControllerImpl::GetValueFontListForRow( |
| size_t index) const { |
| if (suggestions_[index].frontend_id == POPUP_ITEM_ID_WARNING_MESSAGE) |
| @@ -603,7 +603,7 @@ void AutofillPopupControllerImpl::InvalidateRow(size_t row) { |
| view_->InvalidateRow(row); |
| } |
| -#if !defined(OS_ANDROID) |
| +#if !defined(OS_ANDROID) || defined(USE_AURA) |
| int AutofillPopupControllerImpl::GetDesiredPopupWidth() const { |
| int popup_width = controller_common_->RoundedElementBounds().width(); |
| for (size_t i = 0; i < GetLineCount(); ++i) { |
| @@ -657,7 +657,7 @@ void AutofillPopupControllerImpl::UpdatePopupBounds() { |
| popup_bounds_ = controller_common_->GetPopupBounds(popup_width, popup_height); |
| } |
| -#endif // !defined(OS_ANDROID) |
| +#endif |
|
mfomitchev
2015/11/16 22:45:32
nit: When the ifdef spawns a few dozen lines like
bshe
2015/11/17 17:03:23
The problem of comment is that it could be easily
|
| WeakPtr<AutofillPopupControllerImpl> AutofillPopupControllerImpl::GetWeakPtr() { |
| return weak_ptr_factory_.GetWeakPtr(); |