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

Unified Diff: chrome/browser/ui/views/autofill/autofill_popup_view_views.cc

Issue 1570783003: [Autofill] Move functions from the AutofillPopupController to AutofillPopupLayoutModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove scoped_ptr and rename mac delegate Created 4 years, 11 months 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/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..2add1dfd8d7c10196c772444fd5720dad08ae230 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_(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);

Powered by Google App Engine
This is Rietveld 408576698