Migrate Origin settings icons from custom drawables with hardcoded fill
colors to Leo design token equivalents that use @color/icon_default for
proper dark theme support. Remove manual icon tinting code that was
working around the hardcoded colors.
Resolves: https://github.com/brave/brave-browser/issues/53334
The email aliases toggle in Brave Origin settings was always visible
regardless of whether the feature flag is enabled. Since the feature is
disabled by default, users would see a non-functional toggle.
Expose kEmailAliases to Java via ChromeFeatureList and hide the
preference when the flag is disabled.
Resolves: https://github.com/brave/brave-browser/issues/53323
Chromium 146 introduced BadMessageException in the Java Mojo bindings
(crbug.com/469861566, https://github.com/chromium/chromium/commit/c04b8552deeef)
to surface malformed or unexpected messages (invalid headers, unknown methods,
deserialization errors, responses for already-cancelled requests). However, the
default ExceptionHandler simply re-throws the exception as unchecked, causing
crashes instead of gracefully closing the pipe.
This differs from the C++ Mojo bindings behavior where
Connector::DispatchMessage (mojo/public/cpp/bindings/lib/connector.cc) handles
dispatch failures by calling HandleError() which resets the pipe cleanly.
Set a delegate on ExceptionHandler.DefaultExceptionHandler that catches
BadMessageException and returns false (closing the pipe), while re-throwing
all other exceptions to preserve existing behavior.
Resolves: https://github.com/brave/brave-browser/issues/53290
Implements new layout for widget search promo panel and introduces better handling of activity recreations and configuration changes to redraw the widget search promo panel with correct theme (day/night) and proper position.
Other notable enhancements:
- Tweak tablet margins to better frame the onboarding cards on foldable devices after initial review with the design team.
- Fix post-FRE intent and delay activity to avoid a glitch on foldable devices by following the same strategy applied upstream.
- Accessibility: include content descriptions for widget search promo panel images.
- Nala: include new drawables from Nala tokens.
- Append new source android-widget for all searches made from the widget.
- Implement tests to verify new source android-widget.
PlayCoreDialogWrapperActivity (from core-common) lives in base.apk
but deserializes a Parcelable (review.zzc) from split_chrome.apk.
The base split's ClassLoader can't see chrome split classes, causing
ClassNotFoundException. Chromium fixes this for its own activities
via BundleUtils.checkContextClassLoader(), but PlayCoreDialogWrapperActivity
extends plain Activity and is not covered.
Fix by registering an ActivityLifecycleCallbacks that sets the
Application's ClassLoader on the Intent extras Bundle before onCreate().
Also adds a QA preference to force the in-app review flow from settings
for easier testing.
Resolves: https://github.com/brave/brave-browser/issues/53179
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/2eb1baa19a3548ac2bee87fdd1231ea4051442f0
[E2E] Encapsulate TopInsetProvider observer two-step pattern
This CL introduces a new class to encapsulates the common
two-step pattern of:
1. Waiting for TopInsetProvider to become available via a supplier
2. Adding an observer to the provider once available
This pattern was duplicated in ToolbarPositionController,
AutocompleteCoordinator, and NewTabPage.
The new utility class manage TopInsetProvider access with clear
separation between owners and consumers
TransitiveTopInsetProvider:
- Provides access to consumers who need to observe inset changes
- Automatically manages observer registration when provider becomes available
- Queues observers added before provider is set
Bug: 478739083
Change-Id: Ib818c4f16df88f1d6ab6befc633f1fb9031ba3d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7509092
This reverts commit 7d23353a12adf000a22615fd1d07ed389e9fd94c.
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/ecc16f6754610b4e29b7dde1748bea45b3e48a9c
Revert (partial) "Fix @Nullable annotation for ChromeContextMenuPopulator's ShareDelegate"
This reverts commit c6562cde86eaf48819f83a7bd68e37b37626e51b.
Reason for revert:
The Suspect CL https://chromium-review.googlesource.com/q/Icc52e361fd3c5f64ef4ab1ff51397d841bc13f64 is highly likely the cause of the crash. Please see the crash report http://crash/d477a2ee4d2284d8.
Rebase the Revert CL on top of main branch with conflicts allowed option to prevent false positive merge conflicts.
If you agree with the revert CL, please approve it and mark as Commit-Queue +2 to submit it.
More details can be found in the go/crash-revert-cls-creation.
Original change's description:
> Fix @Nullable annotation for ChromeContextMenuPopulator's ShareDelegate
>
> And switch it to not be a Supplier, since nothing currently requires it
> to be one.
>
> Bug: 467389696
> Change-Id: Icc52e361fd3c5f64ef4ab1ff51397d841bc13f64
> Cq-Include-Trybots: luci.chrome.try:android-internal-dbg,android-internal-binary-size
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7542574
> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
> Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1579495}
>
Crash Bug: 482849462
Change-Id: I6042384ff35cd6d3747fa2dab28607fe243e18f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7555790
shouldShowNtpAsHomeSurfaceAtStartup method has new persistableBundle
argyment
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/c2c3eb60bfae7281db65395756660c8977378714
Explicitly disallow start surface after app update when restoring persistent state
When a window is restored as part of the persistAcrossReboots feature,
the start surface may be shown afterwards. This change prevents the
start surface from being shown if the persistent state indicates that
the window was restored after an app update, in order to minimize any
disruptions.
Bug: 459921316
Change-Id: Ib02ef3277d3d536479cab4ae5c877c07b74d5dae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7534264
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/cb00be75174e655ef5bafa4cbd9403923bea0d1b
[Signin][Android] Create Signin Button skeleton & flag flow
Introduces the SigninButton component for the Android NTP in the
toolbar. Currently, this component does nothing and is behind the
SigninLevelUpButton feature flag. This CL sets up the flag logic such
that, when enabled, the IdentityDisc (which will eventually be replaced
by the SigninButton) is removed from the Adaptive Toolbar and the
SigninButton is added to the Top Toolbar. There is no View or XML for
SigninButton currently as it is just a skeleton component. The
implementation for SigninButton will be in follow-up CLs.
Bug: 478828569
Change-Id: Ibbf7d61687e18f12fd9d6a6401fe4da8c414b599
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7511406
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/90bbbf8c22d3727c3f35756a863dc1bb222db2d0
[BrowserControls] Defer lock status change during DTC transition
TopControlsStacker calculates the layer offset assuming they keep a
consistent height and min height during transitions. As a result, if we
change the top control lock status, which would change whether layers
contribute to minHeight, would cause unexpected behaviors for browser
driven offset calculations.
This CL lets TabStripTopControlLayer uses the TokenHolder provided by
TopControlLockCoordinator to prevent the lock status from changing, to
ensure layers can maintain a consistently state whether they contribute
to minHeight during tab strip transition.
Bug: 469484975
Change-Id: I57b55604c062940bcc120788f0b0764c244bd292
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7355240
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/23c8fddd48102899160ce4d71b1ab1949c88a248
[Theme] Add NtpCustomizationPolicyManager.
In this CL, we add NtpCustomizationPolicyManager which listens to
Pref.NTP_CUSTOM_BACKGROUND_DICT changes.
1) Pref.NTP_CUSTOM_BACKGROUND_DICT being managed means the
policy::key::NTPCustomBackgroundEnabled is disabled.
2) When the policy NTPCustomBackgroundEnabled changes,
NtpCustomizationPolicyManager saves the latest policy value to the
shared preference. It will apply after relaunch chrome. This allows
the UI correct when CTA isn't recreated.
Demo: http://shortn/_nBBqRNFS3N
Bug: 467029432
Change-Id: I04a50d0d814802fbd3ef8be29414a17181adae98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7500251
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/800bcec4216aaa7dd4df9f86af6e9804d760c8ec
actions revamp: Extract DragTouchHandler from RecyclerViewAdapter
This CL extracts `DragTouchHandler` from
`DragReorderableRecyclerViewAdapter` for better separation of concerns
and better customizability of the class.
This is in preparation of implementing custom behaviors for the toolbar
actions. The plan is inject a customized `DragTouchHandler` with some
overriding methods. These will come in following CLs.
This is a pure refactor and there should be no functional change with
this CL.
Bypass-Check-License: Renamed file in parent CL
Bug: 477519777
Change-Id: I55dff45b4664d77eb74bdd37c8c18dce74ce7680
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7500135
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/9ada9b92ec00dedb31c75b5e8e77d08a3290b19c
[E2E] Observe TopInsetProvider directly in dependent components
This CL refactors the edge-to-edge top inset observation pattern by
having ToolbarPositionController and AutocompleteCoordinator observe
TopInsetProvider directly, instead of receiving callbacks forwarded
through ToolbarManager.
Previously, ToolbarManager observed TopInsetProvider and forwarded
onToEdgeChange notifications to ToolbarPositionController and
LocationBarCoordinator (which then forwarded to
AutocompleteCoordinator). This created unnecessary coupling and
indirection.
This CL does not introduce any visible behavior changes.
Changes:
- ToolbarPositionController now directly observes TopInsetProvider
- AutocompleteCoordinator now directly observes TopInsetProvider
- Removed intermediate forwarding methods from ToolbarManager and
LocationBarCoordinator
- Added TopInsetProviderSupplier parameter to LocationBarCoordinator
and AutocompleteCoordinator constructors
Bug: 476788729
Change-Id: Ic7344e896ebd8c9e04a821d1cd6df6775255e69c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7487625
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/c2f221f1660fc2df9907093e4db32a6d63879a80
[Android][Signin] Migrate Bookmarks promo to the new sign-in API
This change migrates the Bookmarks promo to the new sign-in flow API.
To enable the new API, dependencies such as WindowAndroid,
BottomSheetController, and ActivityResultTracker are now passed to
BookmarkManagerCoordinator. These dependencies are threaded through
BookmarkPane, BookmarkPage, and BookmarkActivity.
A significant part of the change involves setting up the necessary
components for the bottom sheet UI (like ScrimManager and
BottomSheetController) within BookmarkActivity, which previously lacked
them as it inherits from SynchronousInitializationActivity.
Preview: we do have Privacy approval to NOT show the snackbar if the
user navigates away from the UI.
Known issue: the status bar color is not yet correct.
Bug: 437039516
Change-Id: I5463875270a508ff1c9a44a60e74558c9874c989
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7414706
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/f9f5b7a181842bdf36228500e83649e3d469fbb1
[E2E] Introduce TopInsetProvider to decouple from TopInsetCoordinator
This CL introduces a TopInsetProvider interface to decouple components
that only need to observe top inset state from the concrete
TopInsetCoordinator implementation.
The TopInsetProvider interface exposes:
- Observer interface for onToEdgeChange notifications
- addObserver/removeObserver methods
- getSystemTopInset() method
This change allows components like NewTabAnimationLayout,
LayoutManagerChromePhone, NewTabPage, and NativePageFactory to depend
on the interface rather than the concrete implementation, improving
testability and reducing coupling.
Bug: 475877315
Change-Id: Ife8fa0daa0a8b53e596d40a1f20f72a7748fe06a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7459640
Override DownloadLocationDialogCoordinator to force the download
location dialog even on single-directory devices (no SD card).
Upstream skips the dialog when only one storage directory is
available; the Brave override intercepts that skip and re-triggers
the dialog display. Also transitions SHOW_INITIAL to SHOW_PREFERENCE
so the "Don't show again" checkbox starts unchecked, preventing the
feature from silently disabling itself after the first use.
Resolves: https://github.com/brave/brave-browser/issues/52737
* [Android] Fix NPE in PendingTxHelper when TxService is null
Add null guard for mTxService in fetchTransactions() and null it out
in destroy(). The observer callback can fire after the service is gone
(e.g., wallet service shutdown), causing an NPE at getAllTransactionInfo.
Rename non-public non-static fields to follow the m-prefix convention
required by Chromium's Java style. No functional changes.
Resolves: https://github.com/brave/brave-browser/issues/53102
Pass a temporary no-op HomeSurfaceTracker when mHomeSurfaceTracker is
null during warm startup to prevent the NPE in upstream's
setInitialOverviewStateOnResumeWithNtp. This can happen on activity
recreate (rotation, process death, foldable transitions) where
onResumeWithNative fires before the tracker is initialized.
Resolves: https://github.com/brave/brave-browser/issues/53071
Brave Origin on Android was scaffolded as a subscription (monthly/yearly)
but never shipped. This switches it to a one-time perpetual purchase
using BillingClient.ProductType.INAPP instead of SUBS.
Changes:
- Replace Origin subscription product IDs (monthly/yearly) with perpetual
IDs: brave.origin.perpetual, beta.origin.perpetual,
nightly.origin.perpetual
- Add dedicated INAPP query (queryOriginProductDetailsAsync), purchase
initiation (initiatePurchaseInApp), and price formatting methods for
one-time purchases which don't use offer tokens or subscription phases
- Update queryPurchases to use ProductType.INAPP when querying Origin
- Wire up BraveOriginPlansActivity billing flow: product details loading,
price display, and Buy Now button
- Add "Consume Origin Purchase" option in QA Developer Preferences to
allow testers to clear the Play Store entitlement for re-testing
- Clean up BraveQAPreferences: migrate from android.app.AlertDialog to
androidx.appcompat.app.AlertDialog and from SharedPreferences to
ChromeSharedPreferences
Resolves: https://github.com/brave/brave-browser/issues/53006