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

Unified Diff: chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc

Issue 6469074: AutocompletePopupContentsView must override View::PaintChildren to prevent views (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: modified according to ocmments Created 9 years, 10 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/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 4888a4aa6682b50767e2706a878d1eb916ecb617..a80d48a4d0d33f20e81ff8d18b0e572eb2f54ef6 100644
--- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
+++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
@@ -383,7 +383,7 @@ 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);
- PaintChildren(&contents_canvas);
+ PaintResultViews(&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
@@ -412,10 +412,8 @@ 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::PaintChildren(gfx::Canvas* canvas) {
+ // We paint our children inside OnPaint().
}
void AutocompletePopupContentsView::Layout() {
@@ -512,6 +510,12 @@ views::View* AutocompletePopupContentsView::GetViewForPoint(
////////////////////////////////////////////////////////////////////////////////
// AutocompletePopupContentsView, protected:
+void AutocompletePopupContentsView::PaintResultViews(gfx::CanvasSkia* canvas) {
+ canvas->drawColor(AutocompleteResultView::GetColor(
+ AutocompleteResultView::NORMAL, AutocompleteResultView::BACKGROUND));
+ View::PaintChildren(canvas);
+}
+
int AutocompletePopupContentsView::CalculatePopupHeight() {
DCHECK_GE(static_cast<size_t>(child_count()), model_->result().size());
int popup_height = 0;

Powered by Google App Engine
This is Rietveld 408576698