* Fix default browser detection for Origin branded builds
The upstream IsAnotherChromeChannel() on macOS compares only the first
3 bundle ID components, causing Brave Origin (com.brave.Browser.origin)
to incorrectly match regular Brave (com.brave.Browser) as "another
channel". This made Origin think it was already the default when regular
Brave was, suppressing the default browser infobar.
On Linux, the check searched for "brave-browser" in xdg-settings output
regardless of brand, so Origin builds matched regular Brave desktop
files as "another channel" too.
* Guard IsRegularBraveBundleId with buildflag to fix unused function error
Wraps IsRegularBraveBundleId in #if !BUILDFLAG(IS_BRAVE_ORIGIN_BRANDED)
since it is only called in the non-Origin branch of IsAnotherBraveChannel,
fixing -Werror,-Wunused-function on Origin-branded macOS builds.
* [Wallet] Fix bridge spinner and swap "()" in transaction activity
Use Gate3 swap status in the activity list so confirmed bridge
transactions no longer show a perpetual loading spinner. Extract
getGate3EffectiveStatus into a shared utility for reuse. Guard the
swap fiat value parentheses so empty destinationAmount doesn't
render literal "()".
* Scroll to new tab when adding tabs
When adding background tabs, scroll to the new tab to be visible in
the viewport. Otherwise, users will not notice the tab was created or not.
* Add test
Extract the common restrictive WebContentsDelegate overrides
(ShouldSuppressDialogs, CanDownload, IsWebContentsCreationOverridden,
CanEnterFullscreenModeForTab, CanDragEnter, RequestKeyboardLock) into a
shared RestrictedWebContentsDelegate base class.
Both FileTextExtractorBase and BackgroundWebContentsImpl now inherit
from it instead of duplicating these overrides.
When Chromium's vertical tabs feature is enabled, TabStrip::Initialize() is never called
so tab_container_ remains null. This caused a crash in SetAvailableWidthCallback() during startup.
Early return when Brave vertical tabs are not supported.
Resolvesbrave/brave-browser#54419
The deferred PostTask introduced to avoid ANR was causing the bottom
controls to be initialized after the progress bar, breaking it.
Revert to synchronous initialization.
Resolves: https://github.com/brave/brave-browser/issues/54458
The upstream Chromium change
https://chromium-review.googlesource.com/c/chromium/src/+/7567418
("Clean up LocationBar focus and UrlBar management") in cr147 added a
setUrlBarFocus() call in SearchActivity.beginQuery(). This triggers the
omnibox suggestion pipeline (serveCachedZeroSuggest ->
buildDropdownViewInfoList) before native libraries are loaded.
BraveDropdownItemViewInfoListBuilder.isBraveLeoEnabled() and
isBraveSearchPromoBanner() both call ChromeFeatureList.isEnabled() which
requires native, causing UnsatisfiedLinkError on release builds and
AssertionError on debug builds.
Fix: reorder the && conditions to check tab != null before any native
calls. Since there's no tab in SearchActivity, the cheap null check
short-circuits and avoids the native call entirely. No functional
change - these features were never shown in the search widget context.
Resolves: https://github.com/brave/brave-browser/issues/54444
Fix two errors triggered when typing in settings search:
- Add null check in isPrefManaged_ and move <if expr> to wrap
the dom-if template so web_discovery_enabled binding doesn't
evaluate when web discovery is disabled at build time.
- Add searchContents to settings-brave-origin-page so settings
search can enumerate it without throwing.
The Swift-only lastLaunchInfo preference could not be shared with C++
or Objective-C components, limiting which parts of the codebase could
read or update the DAU last ping date.
The PR stores the date as brave.stats.last_check_ymd in local state
using YYYY-MM-DD string so all platform layers share a single
typed value.
* Allow tab activation with Ctrl+ScrollWheel when scrollable tab strip is enabled.
We just disabled the feature but we still want to allow the user to activate
the adjacent tab with Ctrl+ScrollWheel.
* Add test
Extends the brave-core socket-fix workflow to accept optional commit
hashes for web-discovery-project (DEPS) and @brave/leo (package.json).
When provided, the workflow updates these references before running
socket fix, enabling a single PR for both upstream hash bumps and
direct transitive dependency fixes. Also makes issue_link required
so brave-core PRs always close the tracking issue.
Prior to the current fix `AppMenu::OnMenuClosed` was called before
`menu_metrics_->RecordMenuDismiss`.
On macOS, entering full screen while the menu is open causes
`AppMenu::OnMenuClosed` call to trigger destruction of `BraveAppMenu`,
leaving `menu_metrics_` dangling by the time `RecordMenuDismiss` executes.
Reordering ensures `menu_metrics_` is accessed before `BraveAppMenu` is
destructed.
This PR adds authorship reassingment to brockit. This feature will allow
anyone to reassing the author of any given commit in a `cr` branch. This
is important to maintain our git history closer to the reality of who
should have attribution for each change.
The basics are:
```sh
tools/cr/brockit.py reassign <commit_hash>
```
The `reassign` command creates an empty commit with a `reassing!`
prefix, similar to a simple `fixup` change. However, this is only then
picked up when running `rebase` with `--squash-minor-bumps`.
```
tools/cr/brockit.py rebase --squash-minor-bumps
```
At this point the reassign change is moved above the original change,
and the original change is then squashed into the reassign change,
resulting on a natural change of authors as the original commit is
collapsed into the reassignment one.
Notes on discussions relating to this feature design:
In this particular implementation for this PR, it is necessary to call
rebase `--squash-minor-bumps` to have the necessary
reordering/squashing dance to take place that results in the authorship
being swapped (it is perfectly possible to drop `--squash-minor-bumps`
as a requirement, and make reassignment handling integral to regular
brockit rebase but I kept it behind that flag for now for the sake of
expediency).
- Pros: with this method, one can flag a commit for reassignment, but
doesn't need to immediately force push the branch, as the
reassignment only takes place once the daily rebase occurs.
- Cons: Brockit handles the commit message readjustment that is
necessary when squashing the original commit into the reassignment
commit, however if brockit rebase `--squash-minor-bumps` runs into
rebase conflicts, this breaks the editing chain, and requires the
user to manually call `git rebase --continue` and manually fix the
commit message for the squash. This is not a big deal as we already
do this for the minor bumps messages whenever conflicts occur, but
it is a break on automation flow. There could be room for something
like `brockit rebase --continue` to be honest. The other issue is
that we are adding extra tasks to the whole rebase thing, and
unknown bugs could end up interacting with each other (hopefully
won't ever be the case). Of less importance, but still of notice,
there are particular cases I have not completely tested, like
reassigning a bump commit (e.g. Conflict-resolved patches from
Chromium, etc) that is supposed to be squashed when squashing bumps,
so there could be concerns about both types of squash interacting,
which would either require better rebase checks for these corner
cases, or preventing users from reassigning authorship for brockit
generated commits (both options a no biggie).
There is a different way of going about this that this PR has not
pursued: `brockit reassing` immediately rebases doing the whole
reordering/squashing. This means each call to reassign does create a
`reassign!` commit but it immediately runs an interactive rebase to
squash it with the change it is targeting.
- Pros: no chance for conflicts during this process, which means that
the user would never have to deal with occasionally having to edit
the the commit message due to rebase conflicts. It also removes any
of these concerns from brockit's rebasing code, leaving less room
for bugs, as no squashing of fixups would be taking place.
- Cons: An imediate `rebase --interactive` would mean partial
rewrites of the tree, which requires force pushes to origin.
This alternative approach seemed a bit more work to implement. Later,
if preferred, we could also provide this second option with a flag
(e.g. `brockit reassign --now`) and reuse most of the implementation
details for the rebase case.
Resolves https://github.com/brave/brave-browser/issues/54151
Use upstream page content extraction pipeline
Enable the upstream PageContentAnnotationsWebContentsObserver by:
- Overriding OptimizationGuideKeyedServiceFactory to return the service
when kHistoryEmbeddings is enabled (even with kOptimizationHints
disabled), so PageContentAnnotationsService can construct
- Overriding PageContentAnnotationsServiceFactory and
PageContentExtractionServiceFactory to check kHistoryEmbeddings
instead of upstream ShouldEnablePageContentAnnotations
The OptimizationGuideKeyedService is safe to enable because Brave
blocks remote fetching via IsUserPermittedToFetchFromRemoteOptimizationGuide
returning false.
* [Brave Origin] Set window icon on startup dialog
The BraveOriginStartupView did not override any WidgetDelegate icon
methods, causing incorrect icons in taskbars/menus on Linux and macOS.
Override GetWindowAppIcon(), GetWindowIcon(), and ShouldShowWindowIcon()
to return the branded product logo (IDR_PRODUCT_LOGO_128).
* Add chrome_unscaled_resources GN dependency for window icon