Index: chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc |
diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc |
index 9dbc8df057f282fa040407f7e21fb8645943bf16..35b857317d7a2ab5d0f12feb462c90ae276f0d84 100644 |
--- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc |
+++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc |
@@ -387,9 +387,8 @@ void AutocompletePopupContentsView::OnPaint(gfx::Canvas* canvas) { |
// shader to fill a path representing the round-rect clipping region. This |
// yields a nice anti-aliased edge. |
gfx::CanvasSkia contents_canvas(width(), height(), true); |
- contents_canvas.drawColor(AutocompleteResultView::GetColor( |
- AutocompleteResultView::NORMAL, AutocompleteResultView::BACKGROUND)); |
- View::PaintChildren(&contents_canvas); |
+ PaintChildren(&contents_canvas); |
+ |
// We want the contents background to be slightly transparent so we can see |
// the blurry glass effect on DWM systems behind. We do this _after_ we paint |
// the children since they paint text, and GDI will reset this alpha data if |
@@ -417,10 +416,24 @@ void AutocompletePopupContentsView::OnPaint(gfx::Canvas* canvas) { |
OnPaintBorder(canvas); |
} |
+void AutocompletePopupContentsView::PaintChildren(gfx::CanvasSkia* canvas) { |
+ canvas->drawColor(AutocompleteResultView::GetColor( |
+ AutocompleteResultView::NORMAL, AutocompleteResultView::BACKGROUND)); |
+ View::PaintChildren(canvas); |
+} |
+ |
void AutocompletePopupContentsView::Layout() { |
UpdateBlurRegion(); |
// Size our children to the available content area. |
+ LayoutChildren(); |
+ |
+ // We need to manually schedule a paint here since we are a layered window and |
+ // won't implicitly require painting until we ask for one. |
+ SchedulePaint(); |
+} |
+ |
+void AutocompletePopupContentsView::LayoutChildren() { |
gfx::Rect contents_rect = GetContentsBounds(); |
int top = contents_rect.y(); |
for (int i = 0; i < child_count(); ++i) { |
@@ -431,13 +444,8 @@ void AutocompletePopupContentsView::Layout() { |
top = v->bounds().bottom(); |
} |
} |
- |
- // We need to manually schedule a paint here since we are a layered window and |
- // won't implicitly require painting until we ask for one. |
- SchedulePaint(); |
} |
- |
void AutocompletePopupContentsView::OnMouseEntered( |
const views::MouseEvent& event) { |
model_->SetHoveredLine(GetIndexForPoint(event.location())); |