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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc

Issue 1154063003: removing ShouldHideTopMatch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed ShouldHideTopVerbatim code Created 5 years, 7 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/omnibox/omnibox_popup_contents_view.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
index 4428faa202a350fb16bb4c608f6624ecf0dc6a86..43ec14f38f3e5a792c00e1b0358315d362be3f3f 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
@@ -149,8 +149,7 @@ void OmniboxPopupContentsView::InvalidateLine(size_t line) {
}
void OmniboxPopupContentsView::UpdatePopupAppearance() {
- const size_t hidden_matches = model_->result().ShouldHideTopMatch() ? 1 : 0;
- if (model_->result().size() <= hidden_matches ||
+ if (model_->result().size() <= 0 ||
omnibox_view_->IsImeShowingPopup()) {
// No matches or the IME is showing a popup window which may overlap
// the omnibox popup window. Close any existing popup.
@@ -175,7 +174,7 @@ void OmniboxPopupContentsView::UpdatePopupAppearance() {
OmniboxResultView* view = result_view_at(i);
const AutocompleteMatch& match = GetMatchAtIndex(i);
view->SetMatch(match);
- view->SetVisible(i >= hidden_matches);
+ view->SetVisible(true);
if (match.answer && !model_->answer_bitmap().isNull()) {
view->SetAnswerImage(
gfx::ImageSkia::CreateFrom1xBitmap(model_->answer_bitmap()));
@@ -379,8 +378,7 @@ void OmniboxPopupContentsView::OnGestureEvent(ui::GestureEvent* event) {
int OmniboxPopupContentsView::CalculatePopupHeight() {
DCHECK_GE(static_cast<size_t>(child_count()), model_->result().size());
int popup_height = 0;
- for (size_t i = model_->result().ShouldHideTopMatch() ? 1 : 0;
- i < model_->result().size(); ++i)
+ for (size_t i = 0; i < model_->result().size(); ++i)
popup_height += child_at(i)->GetPreferredSize().height();
// Add enough space on the top and bottom so it looks like there is the same

Powered by Google App Engine
This is Rietveld 408576698