diff --git a/browser/brave_content_browser_client.cc b/browser/brave_content_browser_client.cc index d00bace6728e..0da3dabb1fa7 100644 --- a/browser/brave_content_browser_client.cc +++ b/browser/brave_content_browser_client.cc @@ -54,29 +54,18 @@ bool HandleURLRewrite(GURL* url, return true; } - if (url->SchemeIs(content::kChromeUIScheme) && - url->host() == chrome::kChromeUINewTabHost) { - // Disable new tab overrides, but keep it the same - return true; - } - return false; } bool HandleURLReverseRewrite(GURL* url, content::BrowserContext* browser_context) { - // Handle mapping new tab URL to ourselves - if (url->SchemeIs(content::kChromeUIScheme) && - url->host() == chrome::kChromeUINewTabHost) { - return true; - } if (url->spec() == kBraveUIWelcomeURL) { return true; } return false; } -} +} // namespace BraveContentBrowserClient::BraveContentBrowserClient(std::unique_ptr data_pack, ChromeFeatureListCreator* chrome_feature_list_creator) : @@ -95,8 +84,6 @@ content::BrowserMainParts* BraveContentBrowserClient::CreateBrowserMainParts( void BraveContentBrowserClient::BrowserURLHandlerCreated( content::BrowserURLHandler* handler) { - // Insert handler for chrome://newtab so that we handle it - // before anything else can. handler->AddHandlerPair(&webtorrent::HandleMagnetURLRewrite, content::BrowserURLHandler::null_handler()); handler->AddHandlerPair(&webtorrent::HandleTorrentURLRewrite, diff --git a/chromium_src/chrome/browser/chrome_content_browser_client.cc b/chromium_src/chrome/browser/chrome_content_browser_client.cc index 5f0806579749..d22666002fc8 100644 --- a/chromium_src/chrome/browser/chrome_content_browser_client.cc +++ b/chromium_src/chrome/browser/chrome_content_browser_client.cc @@ -3,6 +3,8 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "build/build_config.h" // For OS_MACOSX +#include "chrome/browser/search/search.h" +#include "content/public/browser/browser_url_handler.h" #if defined(OS_MACOSX) #include "brave/browser/brave_browser_main_parts_mac.h" @@ -15,8 +17,23 @@ #define ChromeBrowserMainExtraPartsViewsLinux BraveBrowserMainExtraPartsViewsLinux #endif +#define HandleNewTabURLRewrite HandleNewTabURLRewrite_ChromiumImpl +#define HandleNewTabURLReverseRewrite HandleNewTabURLReverseRewrite_ChromiumImpl + +namespace search { + bool HandleNewTabURLRewrite(GURL* url, content::BrowserContext* bc) { + return false; + } + bool HandleNewTabURLReverseRewrite(GURL* url, content::BrowserContext* bc) { + return false; + } +} // namespace search + #include "../../../../chrome/browser/chrome_content_browser_client.cc" +#undef HandleNewTabURLRewrite +#undef HandleNewTabURLReverseRewrite_ChromiumImpl + #if defined(OS_LINUX) #undef ChromeBrowserMainExtraPartsViewsLinux -#endif \ No newline at end of file +#endif