Omnibox: Allow Shortcuts to Inline
BUG=324809
Review URL: https://codereview.chromium.org/103283002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239360 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/autocomplete/url_prefix.cc b/chrome/browser/autocomplete/url_prefix.cc
index d48ee35..1d58a5b 100644
--- a/chrome/browser/autocomplete/url_prefix.cc
+++ b/chrome/browser/autocomplete/url_prefix.cc
@@ -43,7 +43,14 @@
const base::string16& prefix_suffix) {
const URLPrefixes& list = GetURLPrefixes();
for (URLPrefixes::const_iterator i = list.begin(); i != list.end(); ++i)
- if (StartsWith(text, i->prefix + prefix_suffix, false))
+ if (PrefixMatch(*i, text, prefix_suffix))
return &(*i);
return NULL;
}
+
+// static
+bool URLPrefix::PrefixMatch(const URLPrefix& prefix,
+ const string16& text,
+ const string16& prefix_suffix) {
+ return StartsWith(text, prefix.prefix + prefix_suffix, false);
+}