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/+/a41e19ef052b11e14784d8fd9eaa995f2fc4f6af
[Android] Implement ViewFinder#waitForView()
This is intended to replace the ViewUtils helpers:
* onViewWaiting()
* waitforView()
* waitForViewCheckingState()
* waitForVisibleView()
* waitForDialogViewCheckingState()
Migrate two usages as a start.
ViewFinder uses ViewCarryOn, which:
* Avoids the RootViewWithoutFocusException hangs in Espresso.
* Supports scoping searches to specific Activities avoiding
AmbiguousViewMatcherException.
* Provides history of the View state as it polled (including displayed rectangle and percentage, and ancestor visibility)
Bug: 428000595
Change-Id: I3efe6508113d04210588a6478cd7d179b9151cb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7253845
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
BraveNewTabPageLayout.setSearchProviderTopMargin and
BraveNewTabPageLayout.setSearchProviderBottomMargin methods were removed at
https://github.com/brave/brave-core/commit/798973641caa39762bae9dff9d2866c7185ce6c8
but class adapter/bytecode
Chromium commit below is the commit which caused our bytecode test
to fail, because was renamed
setSearchProviderBottomMargin => setLogoViewBottomMargin .
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/9b284825edfb4cea09d686dac7456517c1e8b96e
[Composeplate] Fix composeplate view visibility issue.
There are 3 issues of the existing NTP:
1) When DSE is changed between Google and 3P, the return value of
ComposeplateUtils.isComposeplateEnabled(mIsTablet, profile)
changes, but we didn't recalculate it. It causes the bug that
composeplate view button doesn't show again for Google -> 3p ->
Google.
2) If Chrome starts with 3p DSE, ComposeplateCoornidator won't be
initialized at all. Switching to Google won't make it visible.
3) When switching from Google -> 3p, search box's height doesn't reduce
from 72dp to 64dp.
In this CL, we resolve the above 3 issues:
1) When DSE is changed, initialize ComposeplateCoornidator if hasn't
yet; updates the buttons' visibility.
2) Changes the search box height inside NTP, not in
SaerchBoxContainerView. The height is determined by whether
composeplate is enabled, as well as whether a shadow is added.
3) Polish the initialization process of NTP layout to prevent calling
same function multiple times.
Demo: http://shortn/_vdN9koVnsu
Bug: 474426974
Change-Id: I3a16e56e655465d36184204657626f2bb7c92f24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7487954
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