Skip to content

Commit

Permalink
Merge pull request #15336 from brave/url_bubble_brave_protocol
Browse files Browse the repository at this point in the history
Display brave:// protocol for internal urls when hovered
  • Loading branch information
linhkikuchi authored Nov 3, 2022
2 parents dd55670 + 7a808f8 commit 75145ac
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 75145ac

Please sign in to comment.