Uncomments `getDayZeroVariant` to fetch the variant names and it renames them to X (default) and Y (new onboarding) to avoid naming collision with NTP A/B study.
* [CodeHealth][Android] Ignore patch generation for overwritten resources
This is update of the Android resources list we should
not generate patch for because we overwrite them.
Converted bookmark_toolbar.xml layout file override to patch,
because it is trivial.
Resolves https://github.com/brave/brave-browser/issues/53436
Guard mojo calls with try/catch for IllegalStateException since the
pipe can be closed by onDetachedFromWindow() or onConnectionError()
before the BEST_EFFORT task executes, and Java mojo bindings have no
non-destructive validity check.
Resolves: https://github.com/brave/brave-browser/issues/53479
Initializes exit menu item as hidden for new users only by setting it as disabled during onboarding. Exit item will be shown as disabled in the customized menu and tapping it on the toggle will bring it back.
When a user purchases Brave Origin on one device and later switches to a
new device (or reinstalls), the local preferences are empty and the
Origin menu always shows the purchase screen instead of the settings
screen.
This adds a verifyPurchase() method to BraveOriginSubscriptionPrefs that
queries Google Play for an existing Origin purchase and restores the
local preferences (purchase token, product ID, package name) if one is
found. The query is triggered during
BraveActivity.finishNativeInitialization() only when the local
subscription pref is not already active, so it doesn't run unnecessarily
for users who already have their purchase recorded locally.
Toasts are suppressed during the startup query to avoid showing billing
error messages on devices without Google Play, and re-enabled when the
purchase screen is opened.
Resolves: https://github.com/brave/brave-browser/issues/53405
* [Android][cr146] Put url into url bar after QR scan
This commit brings back pre-cr146 behaviour
on scanning QR codes with url - url text now
is at the url bar and selected again.
Resolves https://github.com/brave/brave-browser/issues/53318
The verified publisher checkmark could persist when switching tabs
because brave:// URLs were not treated as internal URLs and
OnPanelPublisherInfo silently dropped null publisher info without
notifying the Java layer.
- Treat brave:// URLs as internal alongside chrome:// so they
clear the checkmark instead of querying getPublisherInfo.
- Notify Java with an empty publisher ID when OnPanelPublisherInfo
receives null info, so the UI clears stale state.
- Reset the checkmark immediately in didSelectTab as a safety net
before the async publisher query completes.
Resolves: https://github.com/brave/brave-browser/issues/53332
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