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

Unified Diff: chrome/browser/ui/views/autocomplete/touch_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: 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/touch_autocomplete_popup_contents_view.cc
diff --git a/chrome/browser/ui/views/autocomplete/touch_autocomplete_popup_contents_view.cc b/chrome/browser/ui/views/autocomplete/touch_autocomplete_popup_contents_view.cc
index 773f3080bd1923e381c52118842abc7f6a2158f5..7cc2ef1eeec8a4397cdf42e80dd49d56afbe98fc 100644
--- a/chrome/browser/ui/views/autocomplete/touch_autocomplete_popup_contents_view.cc
+++ b/chrome/browser/ui/views/autocomplete/touch_autocomplete_popup_contents_view.cc
@@ -84,9 +84,22 @@ void TouchAutocompletePopupContentsView::UpdatePopupAppearance() {
Layout();
}
-void TouchAutocompletePopupContentsView::PaintChildren(
+void TouchAutocompletePopupContentsView::LayoutChildren() {
+ std::vector<View*> visible_children(GetVisibleChildren());
+ gfx::Rect bounds(GetContentsBounds());
+ double child_width =
+ static_cast<double>(bounds.width()) / visible_children.size();
+ int x = bounds.x();
+ for (size_t i = 0; i < visible_children.size(); ++i) {
+ int next_x = bounds.x() + static_cast<int>(((i + 1) * child_width) + 0.5);
+ visible_children[i]->SetBounds(x, bounds.y(), next_x - x, bounds.height());
+ x = next_x;
+ }
+}
+
+void TouchAutocompletePopupContentsView::PaintResultViews(
gfx::CanvasSkia* canvas) {
- AutocompletePopupContentsView::PaintChildren(canvas);
+ AutocompletePopupContentsView::PaintResultViews(canvas);
// Draw divider lines.
std::vector<View*> visible_children(GetVisibleChildren());
@@ -102,19 +115,6 @@ void TouchAutocompletePopupContentsView::PaintChildren(
}
}
-void TouchAutocompletePopupContentsView::LayoutChildren() {
- std::vector<View*> visible_children(GetVisibleChildren());
- gfx::Rect bounds(GetContentsBounds());
- double child_width =
- static_cast<double>(bounds.width()) / visible_children.size();
- int x = bounds.x();
- for (size_t i = 0; i < visible_children.size(); ++i) {
- int next_x = bounds.x() + static_cast<int>(((i + 1) * child_width) + 0.5);
- visible_children[i]->SetBounds(x, bounds.y(), next_x - x, bounds.height());
- x = next_x;
- }
-}
-
int TouchAutocompletePopupContentsView::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