Skip to content

Commit

Permalink
Display brave:// protocol for internal urls when hovered
Browse files Browse the repository at this point in the history
Replaces chrome://. This is another unfortunate side effect of us still using chrome:// as the protocol which is neccessary as there are many checks for that string specifically and we're not at a point to change that at the moment. However, this is probably the most visible place remaining where Brave still shows chrome:// and so changing it to brave:// is helpful to avoid confusion
  • Loading branch information
petemill committed Nov 3, 2022
1 parent 91ee9e6 commit 7a808f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions browser/ui/brave_browser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ void BraveBrowser::ResetTryToCloseWindow() {
Browser::ResetTryToCloseWindow();
}

void BraveBrowser::UpdateTargetURL(content::WebContents* source,
const GURL& url) {
GURL target_url = url;
if (url.SchemeIs(content::kChromeUIScheme)) {
GURL::Replacements replacements;
replacements.SetSchemeStr(content::kBraveUIScheme);
target_url = target_url.ReplaceComponents(replacements);
}
Browser::UpdateTargetURL(source, target_url);
}

bool BraveBrowser::ShouldAskForBrowserClosingBeforeHandlers() {
if (g_suppress_dialog_for_testing)
return false;
Expand Down
1 change: 1 addition & 0 deletions browser/ui/brave_browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class BraveBrowser : public Browser {
bool TryToCloseWindow(
bool skip_beforeunload,
const base::RepeatingCallback<void(bool)>& on_close_confirmed) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
void ResetTryToCloseWindow() override;

void TabStripEmpty() override;
Expand Down

0 comments on commit 7a808f8

Please sign in to comment.