Fix URL bar icon for Brave Origin brave:// pages (#33186)

The reason this is needed is because there is no way to do multi-brand
chromium_src overrides right now.

The chromium_src/components/omnibox/browser/vector_icons/product_chrome_refresh.icon file contains the standard Brave lion logo.
This commit is contained in:
Brian R. Bondy
2026-01-14 07:11:28 -05:00
committed by GitHub
parent 50a1d8db91
commit 2feaeccbae
3 changed files with 14 additions and 0 deletions
+1
View File
@@ -1214,6 +1214,7 @@ source_set("ui") {
# "//brave/browser/extensions",
"//brave/components/brave_extension:generated_resources",
"//brave/components/brave_extension:static_resources",
"//brave/components/brave_origin/buildflags",
"//brave/components/resources:static_resources",
"//brave/components/resources:strings_grit",
"//chrome/browser/extensions",
@@ -10,6 +10,7 @@
#include "brave/browser/brave_shields/brave_shields_tab_helper.h"
#include "brave/browser/ui/brave_scheme_utils.h"
#include "brave/browser/ui/page_info/features.h"
#include "brave/components/brave_origin/buildflags/buildflags.h"
#include "brave/components/constants/url_constants.h"
#include "brave/components/constants/webui_url_constants.h"
#include "brave/components/vector_icons/vector_icons.h"
@@ -19,6 +20,7 @@
#include "components/prefs/pref_service.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
#include "extensions/buildflags/buildflags.h"
#if !BUILDFLAG(IS_ANDROID)
@@ -86,6 +88,16 @@ bool BraveLocationBarModelDelegate::GetURL(GURL* url) const {
const gfx::VectorIcon* BraveLocationBarModelDelegate::GetVectorIconOverride()
const {
#if BUILDFLAG(IS_BRAVE_ORIGIN_BRANDED)
// For Brave Origin branded builds, use the branded product icon for
// chrome:// URLs instead of the omnibox product icon which uses the
// regular Brave branding.
GURL url;
if (GetURL(&url) && url.SchemeIs(content::kChromeUIScheme)) {
return &kLeoBraveIconOnlyFaceIcon;
}
#endif
// Defer to the Chromium implementation first.
const gfx::VectorIcon* parent_icon =
BrowserLocationBarModelDelegate::GetVectorIconOverride();
+1
View File
@@ -20,6 +20,7 @@ aggregate_vector_icons("brave_components_vector_icons") {
"leo_arrow_right.icon",
"leo_arrow_small_right.icon",
"leo_brave_icon_monochrome.icon",
"leo_brave_icon_only_face.icon",
"leo_browser_add.icon",
"leo_browser_bookmark_add.icon",
"leo_browser_bookmark_normal.icon",