| Index: chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
|
| diff --git a/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc b/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
|
| index 2fa7ba5d84a0f4b331f0435a4bb0e8783ffe1383..1e5e564871a3a656ba02d3e654e6371e027d5ca0 100644
|
| --- a/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
|
| +++ b/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
|
| @@ -24,6 +24,7 @@ AutofillPopupViewViews::AutofillPopupViewViews(
|
| AutofillPopupController* controller,
|
| views::Widget* parent_widget)
|
| : AutofillPopupBaseView(controller, parent_widget),
|
| + view_helper_(new AutofillPopupViewHelper(controller)),
|
| controller_(controller) {}
|
|
|
| AutofillPopupViewViews::~AutofillPopupViewViews() {}
|
| @@ -43,6 +44,22 @@ void AutofillPopupViewViews::UpdateBoundsAndRedrawPopup() {
|
| DoUpdateBoundsAndRedrawPopup();
|
| }
|
|
|
| +void AutofillPopupViewViews::UpdatePopupBounds() {
|
| + view_helper_->UpdatePopupBounds();
|
| +}
|
| +
|
| +int AutofillPopupViewViews::GetAvailableWidthForRow(int row, bool with_label) {
|
| + return view_helper_->GetAvailableWidthForRow(row, with_label);
|
| +}
|
| +
|
| +int AutofillPopupViewViews::LineFromY(int y) {
|
| + return view_helper_->LineFromY(y);
|
| +}
|
| +
|
| +gfx::Rect AutofillPopupViewViews::GetPopupBounds() {
|
| + return view_helper_->popup_bounds();
|
| +}
|
| +
|
| void AutofillPopupViewViews::OnPaint(gfx::Canvas* canvas) {
|
| if (!controller_)
|
| return;
|
| @@ -51,7 +68,7 @@ void AutofillPopupViewViews::OnPaint(gfx::Canvas* canvas) {
|
| OnPaintBorder(canvas);
|
|
|
| for (size_t i = 0; i < controller_->GetLineCount(); ++i) {
|
| - gfx::Rect line_rect = controller_->GetRowBounds(i);
|
| + gfx::Rect line_rect = view_helper_->GetRowBounds(i);
|
|
|
| if (controller_->GetSuggestionAt(i).frontend_id ==
|
| POPUP_ITEM_ID_SEPARATOR) {
|
| @@ -63,7 +80,7 @@ void AutofillPopupViewViews::OnPaint(gfx::Canvas* canvas) {
|
| }
|
|
|
| void AutofillPopupViewViews::InvalidateRow(size_t row) {
|
| - SchedulePaintInRect(controller_->GetRowBounds(row));
|
| + SchedulePaintInRect(view_helper_->GetRowBounds(row));
|
| }
|
|
|
| void AutofillPopupViewViews::DrawAutofillEntry(gfx::Canvas* canvas,
|
| @@ -88,9 +105,9 @@ void AutofillPopupViewViews::DrawAutofillEntry(gfx::Canvas* canvas,
|
|
|
| // Draw the Autofill icon, if one exists
|
| ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
| - int row_height = controller_->GetRowBounds(index).height();
|
| + int row_height = view_helper_->GetRowBounds(index).height();
|
| if (!controller_->GetSuggestionAt(index).icon.empty()) {
|
| - int icon = controller_->GetIconResourceID(
|
| + int icon = view_helper_->GetIconResourceID(
|
| controller_->GetSuggestionAt(index).icon);
|
| DCHECK_NE(-1, icon);
|
| const gfx::ImageSkia* image = rb.GetImageSkiaNamed(icon);
|
|
|