mirror of
https://github.com/morgan9e/helium
synced 2026-04-14 00:14:20 +09:00
helium/override-protocol: use helium:// in omnibox suggestions (#505)
This commit is contained in:
@@ -303,14 +303,40 @@
|
||||
bool devtools_url = (scheme == kDevToolsScheme);
|
||||
if (chrome_url || devtools_url || url::IsStandard(scheme)) {
|
||||
// Replace the about: scheme with the chrome: scheme.
|
||||
@@ -754,7 +759,9 @@ bool IsEquivalentScheme(const std::strin
|
||||
@@ -754,7 +759,11 @@ bool IsEquivalentScheme(const std::strin
|
||||
const std::string& scheme2) {
|
||||
return scheme1 == scheme2 ||
|
||||
(scheme1 == url::kAboutScheme && scheme2 == kChromeUIScheme) ||
|
||||
- (scheme1 == kChromeUIScheme && scheme2 == url::kAboutScheme);
|
||||
+ (scheme1 == kChromeUIScheme && scheme2 == url::kAboutScheme) ||
|
||||
+ (scheme1 == kHeliumUIScheme && scheme2 == url::kAboutScheme) ||
|
||||
+ (scheme1 == url::kAboutScheme && scheme2 == kHeliumUIScheme);
|
||||
+ (scheme1 == url::kAboutScheme && scheme2 == kHeliumUIScheme) ||
|
||||
+ (scheme1 == kHeliumUIScheme && scheme2 == kChromeUIScheme) ||
|
||||
+ (scheme1 == kChromeUIScheme && scheme2 == kHeliumUIScheme);
|
||||
}
|
||||
|
||||
} // namespace url_formatter
|
||||
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
|
||||
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
|
||||
@@ -372,7 +372,7 @@ std::string ChromeAutocompleteProviderCl
|
||||
std::string
|
||||
ChromeAutocompleteProviderClient::GetEmbedderRepresentationOfAboutScheme()
|
||||
const {
|
||||
- return content::kChromeUIScheme;
|
||||
+ return content::kHeliumUIScheme;
|
||||
}
|
||||
|
||||
std::vector<std::u16string> ChromeAutocompleteProviderClient::GetBuiltinURLs() {
|
||||
--- a/components/omnibox/browser/builtin_provider.cc
|
||||
+++ b/components/omnibox/browser/builtin_provider.cc
|
||||
@@ -73,7 +73,9 @@ void BuiltinProvider::DoBuiltinAutocompl
|
||||
// Include some common builtin URLs as the user types the scheme.
|
||||
for (const std::u16string& url :
|
||||
client_->GetBuiltinsToProvideAsUserTypes()) {
|
||||
- AddBuiltinMatch(url, std::u16string(), styles);
|
||||
+ DCHECK(url.starts_with(u"chrome://"));
|
||||
+ AddBuiltinMatch(std::u16string(url).replace(0, 6, u"helium"),
|
||||
+ std::u16string(), styles);
|
||||
}
|
||||
} else {
|
||||
// Match input about: or |embedderAbout| URL input against builtin URLs.
|
||||
|
||||
Reference in New Issue
Block a user