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

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

Issue 353223002: Omnibox: Fix URL-What-You-Typed Allowed-To-Be-Default-Match Issues (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove some test cases; add dcheck Created 6 years, 5 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_result.cc
diff --git a/chrome/browser/autocomplete/autocomplete_result.cc b/chrome/browser/autocomplete/autocomplete_result.cc
index 664384b1624ed159fc9725c13c5ee9f15976f479..8f2c52701b8f6d7ddf2de8c2bf510dfd45acdf72 100644
--- a/chrome/browser/autocomplete/autocomplete_result.cc
+++ b/chrome/browser/autocomplete/autocomplete_result.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <iterator>
+#include "base/i18n/case_conversion.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
@@ -264,6 +265,13 @@ void AutocompleteResult::SortAndCull(
} else {
DCHECK_NE(metrics::OmniboxInputType::FORCED_QUERY, input.type())
<< debug_info;
+ // If the user explicitly typed a scheme, the default match should
+ // have the same scheme.
+ if ((input.type() == metrics::OmniboxInputType::URL) &&
+ input.parts().scheme.is_nonempty()) {
+ DCHECK_EQ(base::UTF16ToUTF8(base::i18n::ToLower(input.scheme())),
Peter Kasting 2014/07/09 22:36:00 This isn't already lowercased for us?
Mark P 2014/07/09 23:12:23 Right you are. Done.
+ default_match_->destination_url.scheme());
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698