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

Unified Diff: chrome/browser/autocomplete/autocomplete.cc

Issue 2013008: Remove --omnibox-popup-count flag. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: nits Created 10 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/autocomplete/autocomplete.cc
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index ba37681a59d5762bafddb986d196bb21779b196f..341afa23054df4ee189d6da73fca438b17e72a04 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -547,7 +547,7 @@ void AutocompleteMatch::ValidateClassifications(
// AutocompleteProvider -------------------------------------------------------
// static
-size_t AutocompleteProvider::max_matches_ = 3;
+const size_t AutocompleteProvider::kMaxMatches = 3;
AutocompleteProvider::~AutocompleteProvider() {
Stop();
@@ -608,7 +608,7 @@ std::wstring AutocompleteProvider::StringForURLDisplay(
// AutocompleteResult ---------------------------------------------------------
// static
-size_t AutocompleteResult::max_matches_ = 6;
+const size_t AutocompleteResult::kMaxMatches = 6;
void AutocompleteResult::Selection::Clear() {
destination_url = GURL();
@@ -619,7 +619,7 @@ void AutocompleteResult::Selection::Clear() {
AutocompleteResult::AutocompleteResult() {
// Reserve space for the max number of matches we'll show. The +1 accounts
// for the history shortcut match as it isn't included in max_matches.
- matches_.reserve(max_matches() + 1);
+ matches_.reserve(kMaxMatches + 1);
// It's probably safe to do this in the initializer list, but there's little
// penalty to doing it here and it ensures our object is fully constructed
@@ -667,10 +667,10 @@ void AutocompleteResult::SortAndCull(const AutocompleteInput& input) {
matches_.end());
// Find the top max_matches.
- if (matches_.size() > max_matches()) {
- std::partial_sort(matches_.begin(), matches_.begin() + max_matches(),
+ if (matches_.size() > kMaxMatches) {
+ std::partial_sort(matches_.begin(), matches_.begin() + kMaxMatches,
matches_.end(), &AutocompleteMatch::MoreRelevant);
- matches_.erase(matches_.begin() + max_matches(), matches_.end());
+ matches_.erase(matches_.begin() + kMaxMatches, matches_.end());
}
// HistoryContentsProvider uses a negative relevance as a way to avoid
« no previous file with comments | « chrome/browser/autocomplete/autocomplete.h ('k') | chrome/browser/autocomplete/history_contents_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698