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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm

Issue 1154063003: removing ShouldHideTopMatch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed deprecated var name Created 5 years, 6 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
« no previous file with comments | « chrome/browser/metrics/omnibox_metrics_provider.cc ('k') | chrome/browser/ui/omnibox/omnibox_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm
index df0fde6973c09eb81aba08ae88ce5783054ed6cc..f7c94fa616a6ba0d29458f5d7486f663a6a6cd52 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm
@@ -75,8 +75,7 @@ bool OmniboxPopupViewMac::IsOpen() const {
void OmniboxPopupViewMac::UpdatePopupAppearance() {
DCHECK([NSThread isMainThread]);
const AutocompleteResult& result = GetResult();
- const size_t start_match = result.ShouldHideTopMatch() ? 1 : 0;
- const size_t rows = result.size() - start_match;
+ const size_t rows = result.size();
if (rows == 0) {
[[popup_ parentWindow] removeChildWindow:popup_];
[popup_ orderOut:nil];
@@ -107,7 +106,7 @@ void OmniboxPopupViewMac::UpdatePopupAppearance() {
CGFloat contents_offset = -1.0f;
for (size_t ii = 0; ii < rows; ++ii) {
OmniboxPopupCell* cell = [matrix_ cellAtRow:ii column:0];
- const AutocompleteMatch& match = GetResult().match_at(ii + start_match);
+ const AutocompleteMatch& match = GetResult().match_at(ii);
[cell setImage:ImageForMatch(match)];
[cell setMatch:match];
// Only set the image on the one cell with match.answer.
@@ -161,19 +160,12 @@ gfx::Rect OmniboxPopupViewMac::GetTargetBounds() {
// This is only called by model in SetSelectedLine() after updating
// everything. Popup should already be visible.
void OmniboxPopupViewMac::PaintUpdatesNow() {
- size_t start_match = model_->result().ShouldHideTopMatch() ? 1 : 0;
- if (start_match > model_->selected_line()) {
- [matrix_ deselectAllCells];
- } else {
- [matrix_ selectCellAtRow:model_->selected_line() - start_match column:0];
- }
-
+ [matrix_ selectCellAtRow:model_->selected_line() column:0];
}
void OmniboxPopupViewMac::OnMatrixRowSelected(OmniboxPopupMatrix* matrix,
size_t row) {
- size_t start_match = model_->result().ShouldHideTopMatch() ? 1 : 0;
- model_->SetSelectedLine(row + start_match, false, false);
+ model_->SetSelectedLine(row, false, false);
}
void OmniboxPopupViewMac::OnMatrixRowClicked(OmniboxPopupMatrix* matrix,
@@ -336,8 +328,6 @@ NSImage* OmniboxPopupViewMac::ImageForMatch(const AutocompleteMatch& match) {
void OmniboxPopupViewMac::OpenURLForRow(size_t row,
WindowOpenDisposition disposition) {
- size_t start_match = model_->result().ShouldHideTopMatch() ? 1 : 0;
- row += start_match;
DCHECK_LT(row, GetResult().size());
omnibox_view_->OpenMatch(GetResult().match_at(row), disposition, GURL(),
base::string16(), row);
« no previous file with comments | « chrome/browser/metrics/omnibox_metrics_provider.cc ('k') | chrome/browser/ui/omnibox/omnibox_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698