mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 995347 - Allow domain auto completion when entering "h" in url bar. r=bnicholson
This commit is contained in:
parent
bd1b4c5c45
commit
85e97692c4
@ -79,6 +79,10 @@ public class BrowserSearch extends HomeFragment
|
||||
// for an autocomplete result
|
||||
private static final int MAX_AUTOCOMPLETE_SEARCH = 20;
|
||||
|
||||
// Length of https:// + 1 required to make autocomplete
|
||||
// fill in the domain, for both http:// and https://
|
||||
private static final int HTTPS_PREFIX_LENGTH = 9;
|
||||
|
||||
// Duration for fade-in animation
|
||||
private static final int ANIMATION_DURATION = 250;
|
||||
|
||||
@ -418,7 +422,8 @@ public class BrowserSearch extends HomeFragment
|
||||
// Does the completion match against the whole URL? This will match
|
||||
// about: pages, as well as user input including "http://...".
|
||||
if (url.startsWith(searchTerm)) {
|
||||
return uriSubstringUpToMatchedPath(url, 0, searchLength);
|
||||
return uriSubstringUpToMatchedPath(url, 0,
|
||||
(searchLength > HTTPS_PREFIX_LENGTH) ? searchLength : HTTPS_PREFIX_LENGTH);
|
||||
}
|
||||
|
||||
final Uri uri = Uri.parse(url);
|
||||
|
Loading…
Reference in New Issue
Block a user