Commit Graph
720 Commits
Author SHA1 Message Date
Serg e0365ec5d6 [Android] Remove unused FOREGROUND_SERVICE_CAMERA permission from Android manifest (#35178)
Upstream Chromium cr147 (https://chromium-review.googlesource.com/c/chromium/src/+/7559078)
made FOREGROUND_SERVICE_CAMERA unconditional for all Android builds by
removing the is_desktop_android guard. However, the feature that
actually uses it (kAndroidEnableBackgroundMediaCapturing) is disabled
by default and not enabled by Brave, so the permission is declared but
never used.

This blocks Play Store publishing because Google requires a declaration
with a demo video for any app using FOREGROUND_SERVICE_CAMERA.

This PR:
- Re-gates FOREGROUND_SERVICE_CAMERA behind is_desktop_android so it's
  excluded from Brave builds
- Removes AndroidManifest_user_permissions.xml since upstream now
  declares FOREGROUND_SERVICE_MICROPHONE unconditionally, making
  Brave's duplicate unnecessary

Resolves: https://github.com/brave/brave-browser/issues/54143
2026-04-02 00:06:11 +02:00
Serg 47521cfbf5 Android new tab at the bottom (#35051)
* [Android] Move tab switcher controls to bottom when address bar is at bottom

When the address bar is configured to show at the bottom, reposition the
entire hub toolbar (new tab, menu, pane switcher, search, shred) from
the top to the bottom of the tab switcher for one-handed accessibility.

- BraveHubManagerImpl: Add maybeRepositionToolbarToBottom() that changes
  the toolbar wrapper's FrameLayout gravity to BOTTOM and swaps the pane
  host container's top margin to bottom margin. Uses EdgeToEdge pad
  adjuster (same pattern as upstream HubBottomToolbarCoordinator) to
  handle navigation bar insets. Properly cleans up the adjuster on hub
  hide since the coordinator and views are destroyed between show/hide
  cycles.

- BraveHubManagerImplClassAdapter: Expose parent's mEdgeToEdgeSupplier
  field via deleteField/makeProtectedField bytecode pattern.

- BraveToolbarManager: Remove setLayoutStateProvider() and its
  LayoutStateObserver that toggled menu popup direction on tab switcher
  transitions. No longer needed since the hub toolbar is now at the
  bottom when address bar is at bottom.

- BraveHubToolbarView: Change INVISIBLE to GONE for hidden action/menu
  buttons when bottom navigation controls are enabled (address bar on
  top). INVISIBLE left the buttons clickable despite being hidden.

Resolves: https://github.com/brave/brave-browser/issues/53326
2026-03-27 21:57:06 +01:00
Artem Samoilenko c872d04ae4 [cr147][Android][NtpRefactor] Move usages of MVTilesLayout to MostVisitedTilesCoordinator
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/67b2379a1abe78abaaa3e1bc6f25402c3a1de569

commit 67b2379a1abe78abaaa3e1bc6f25402c3a1de569
Author: Xi Han <hanxi@google.com>
Date:   Fri Mar 6 15:01:24 2026 -0800

    [NtpRefactor] Move usages of MVTilesLayout to MostVisitedTilesCoordinator.

    This is a refactor CL without any behaviour changes. We move all usage
    of MVTilesLayout from NewTabPageLayout to MostVisitedTilesCoordinator.

    Bug: 487641528
    Change-Id: Icb3f65b42a3cb02f214d9f0fa09ab7b71a3e0285
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7644608
    Reviewed-by: Xinyi Ji <xinyiji@chromium.org>
    Commit-Queue: Xi Han <hanxi@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1595724}
2026-03-26 19:55:42 -04:00
Artem Samoilenko bc60e9936d [cr147][Android] Remove mDeferredNativeRunnables for BraveLocationBarMediator
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/b867637d8c6ba714943f3e3166a3b4324c9d1753

commit b867637d8c6ba714943f3e3166a3b4324c9d1753
Author: Tomasz Wiszkowski <ender@google.com>
Date:   Mon Mar 2 19:17:11 2026 -0800

    Simplify FuseboxSessionState activation.

    The change eliminates the need for deferred native initialization,
    allowing the FuseboxSessionState to emit event when the session object
    is ready to be used.

    Bug: 474616308
    Change-Id: I7e72ea03fb0562a2c1b2e7d0fb08bb3044a96123
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7618330
    Commit-Queue: Tomasz Wiszkowski <ender@google.com>
    Reviewed-by: Sky Malice <skym@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1592930}
2026-03-26 19:55:28 -04:00
Artem Samoilenko bcbe9747c4 [cr147][Android] Changes for removed LocationBarMediator.setSearchQuery
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/69d1e350a6a14cbdbf5c4ad071ba5bb149a1a45f

commit 69d1e350a6a14cbdbf5c4ad071ba5bb149a1a45f
Author: Charles Cai <charlesyc@google.com>
Date:   Fri Feb 13 08:34:05 2026 -0800

    Consolidate VoiceRecognitionHandler's Delegate interface into OmniboxStub.

    Bug: 477922724
    Change-Id: I4af3e9f7a5d22b3ef16117193299d542564e197a
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7564529
    Reviewed-by: Sky Malice <skym@chromium.org>
    Reviewed-by: Tomasz Wiszkowski <ender@google.com>
    Commit-Queue: Charles Cai <charlesyc@google.com>
    Auto-Submit: Charles Cai <charlesyc@google.com>
    Cr-Commit-Position: refs/heads/main@{#1584696}
2026-03-26 19:25:03 -04:00
Serg e8dd714c3f [Android] Fix autofill toggle greyed out when Google is the system autofill service (#35018)
* [Android] Fix autofill toggle greyed out when Google is the system autofill service

When Google's Autofill with Google (AWG) is set as the preferred autofill
service in Android OS settings, Chromium disables the third-party autofill
toggle in Settings because Chrome has its own built-in Google-synced
autofill. Since Brave does not have built-in Google autofill, AWG should
be treated like any other third-party provider (e.g. 1Password, Bitwarden).

This fix has two parts:

Java side: Override AutofillClientProviderUtils.getAndroidAutofillFramework-
Availability() via bytecode changeMethodOwner to remap the
ANDROID_AUTOFILL_SERVICE_IS_GOOGLE status to AVAILABLE or SETTING_TURNED_OFF
based on the user's existing pref. This makes the toggle interactive in the
Settings UI.

Native side: The C++ code calls the Java method via JNI, bypassing the
bytecode redirect. To handle this, BraveAutofillClientProviderUtils is
annotated with @CalledByNative to generate its own JNI header. A chromium_src
override of autofill_client_provider.cc uses #define to redirect the original
JNI function to the Brave version, ensuring the native code also uses the
remapped availability status and doesn't reset the pref on browser startup.

Resolves: https://github.com/brave/brave-browser/issues/52960
2026-03-26 22:45:23 +01:00
samartnik afb83224c9 [Android] UI preparation for custom search engines (#34890)
This PR is only prepares UI and strings, the main implementation will be done separately in the context of brave/brave-browser#21837
2026-03-23 15:33:09 -04:00
Szilard Szaloki 60828ac744 Account: pass initiatingServiceName to register/login (#34417) 2026-03-13 11:24:43 +09:00
Serg 25476f8d9a [Android] Hardcode Brave Search icon in Quick Search Engines (#34669)
Convert nala from copy-only targets to a proper android_resources
target so modules with their own resources_package can reference
nala icons via R.drawable at compile time. Use the nala
social-brave-release-favicon-fullheight-color icon for Brave Search
in both the Quick Search Engines view and settings adapters.

Resolves: https://github.com/brave/brave-browser/issues/51364
2026-03-12 14:21:24 -04:00
AlexeyBarabash c36de06488 [Android][cr146] Put url into url bar after QR scan (#34437)
* [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
2026-03-05 16:19:01 +02:00
samartnik 5fce4013bc [Code Health][Android] Clean up code for brave_xml_preprocessor template (#34406) 2026-03-03 23:01:03 +00:00
AlexeyBarabash 91c8ae6079 [cr146][Android] New target //c/b/ui/android/toolbar:core_java
Updated `brave_bytecode_jars`, otherwise bytecode patching wasn't applied
as expected, app crashed with
```
java.lang.IllegalAccessError: Field 'org.chromium.chrome.browser.toolbar.top.TopToolbarCoordinator.mOptionalButtonController' is inaccessible to class 'org.chromium.chrome.browser.toolbar.top.BraveTopToolbarCoordinator'
```
and the test checkSuperName("ToolbarPhone", "BraveToolbarLayoutImpl") were failing

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/ff44f6aed85bd03834121421e2ec8c6add7b7bba

	toolbar: Make extensions toolbar UI an independent build target

	This work is a follow-up to https://crrev.com/c/7534296.

	This CL decouples the Android extensions toolbar UI from the core
	toolbar architecture by extracting it into a standalone GN target and
	enforcing strict DEPS boundaries.

	Historically, extension-specific UI components and their heavyweight
	dependencies (e.g., components/thin_webview) were intertwined within the
	monolithic //chrome/browser/ui/android/toolbar module. As the extensions
	feature set evolves—particularly in the context of Desktop Android—this
	coupling risks architectural bloat, blurs domain boundaries, and
	increases the potential for circular dependencies.

	To establish a scalable, maintainable, and decoupled foundation, this
	change implements the following structural improvements:

	1. Enforces Strict Dependency Isolation Migrates extension UI sources,
	tests, and dependencies into a distinct BUILD.gn under
	toolbar/extensions/. Extension-specific includes are purged from the
	global toolbar DEPS and localized to the new module's DEPS file,
	preventing dependency leakage into the broader UI layer.

	2. Optimizes the Build Graph Refactors the primary toolbar target into
	core_java. A new facade target, java_group("java"), aggregates core_java
	and conditionally includes the extensions module only when
	enable_extensions_core is active. This ensures the core toolbar compiles
	cleanly on its own, shields non-extension builds from unnecessary
	compilation, and preserves existing contracts for upstream targets.

	3. Improves Test Encapsulation Segregates the JUnit and instrumentation
	tests for extensions into their own respective targets, ensuring test
	dependencies and execution are accurately mapped to the isolated module.

	By enforcing these strict modular boundaries, we guarantee that
	extension dependencies do not pollute the core toolbar's architectural
	footprint, significantly clean up the dependency tree, and lay a robust
	architectural runway for future Desktop Android extension features.

	Bug: None
	Test: CQ
	Change-Id: I90dc5993c15e0295f08db2b7f1b096de8ce73195
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7532769
2026-02-26 14:14:53 +00:00
AlexeyBarabash 2304174ac8 [cr146][Android] isInNarrowWindowOnTablet was moved from NewTabPageLayout to NtpCustomizationUtils`
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
2026-02-26 13:47:51 +00:00
AlexeyBarabash a41bfd8044 [cr146][Android] SearchEngineAdapter.ctor change
New arg siteSearchClickHandler

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/ce9bd0417d1e559e2d3ae5f8b19ee1530b62c369

	Site Search: Add site search setting entry

	This CL adds a "Manage search engine and site search entry" in existing
	Search Engine Settings page. This advanced setting option will be
	displayed based on omnibox site search feature flag.

	Bug: 459588730
	Change-Id: I5c1c806f8d0fcec40b87cb94b31573317696d28c
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7494099
2026-02-26 13:47:50 +00:00
AlexeyBarabash 9a0f6e0556 [cr146][Android] Cleanup of unused BraveNewTabPageLayout overrides
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
2026-02-26 13:47:45 +00:00
Serg c405b65020 [Android] Always show download location dialog when user opts in (#34186)
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
2026-02-25 20:05:42 +00:00
Jay Harris 2a3434f0f3 [Nala]: Add Android color tokens (#34106)
* [Nala]: Add color tokens on Android

* [Nala]: Convert some color tokens over to Nala as PoC
2026-02-24 22:40:52 +00:00
Serg 4939f3c098 [Android] Fix NPE in HomeSurfaceTracker on activity resume (#34114)
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
2026-02-23 22:05:42 +00:00
Szilard Szaloki 6fe32071f5 Account: add Email Aliases dependency and internalize kBraveAccount (#34072) 2026-02-23 15:03:02 -07:00
Simone Arpe 59c4389a4b New onboarding flow study (smartphones and small screens) (#33521)
Updates the Day Zero onboarding experience on smartphones and small screen devices to a multi‑step, horizontally advancing flow driven by CTA buttons.
It introduces distinct layouts per step, a pager animation helper, and updates onboarding logic to support a scalable, multi‑step sequence with minimal duplication.

Tablet support is intentionally out of scope and will be handled in a separate PR.
2026-02-06 12:13:01 +01:00
Serg 461d66e02c [Android] Shows Brave Wallet UI based on policy. (#33630)
* [Android] Shows Brave Wallet UI based on policy.

Resolves: https://github.com/brave/brave-browser/issues/52496
2026-02-04 10:08:30 -05:00
Serg bd7950d53a [Android] Fixes a crash in FaviconUtils.getIconDrawableWithFilter when an icon is not available for a particular URL by falling back to the default globe icon. (#33569)
[Android] Fixes a crash in FaviconUtils.getIconDrawableWithFilter
when an icon is not available for a particular URL by falling back
to the default globe icon.

Resolves: https://github.com/brave/brave-browser/issues/52458
2026-02-02 23:49:25 +00:00
AlexeyBarabash cd2c5d4565 [cr145][Android] monochrome_64_public_apk target was removed
Adjusted Brave's targets

Chromium change:
https://github.com/brave/chromium/commit/10cf1c5db2b6cb591c97fc0c097a57615f7503d0

	Android: remove more public monochrome targets
	This removes deprecated monochrome build targets.

	Bug: 434045992
	Test: gn gen out/Default
	Change-Id: Id72d9e783ce164ba529b810398759afc04c2f36d
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7404196
	Reviewed-by: Peter Wen <wnwen@chromium.org>
	Commit-Queue: Peter Wen <wnwen@chromium.org>
	Auto-Submit: Nate Fischer <ntfschr@chromium.org>
	Cr-Commit-Position: refs/heads/main@{#1565575}
2026-01-29 13:41:21 -05:00
Artem Samoilenko a217dc1088 [cr145][Android] Convert ToolbarManager.ConstraintsSupplier to a TransitiveObservableSupplier
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/86102b4bc68e75d3d392be417f8208697701184e

commit 86102b4bc68e75d3d392be417f8208697701184e
Author: Andrew Grieve <agrieve@chromium.org>
Date:   Wed Dec 10 14:29:26 2025 -0800

    Convert ToolbarManager.ConstraintsSupplier to a TransitiveObservableSupplier

    Bug: 467389696
    Change-Id: Iccda1bc4dd1f13c7d5444364f44f8ce5de417d5f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7242146
    Commit-Queue: Andrew Grieve <agrieve@chromium.org>
    Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1556976}
2026-01-29 13:40:31 -05:00
Serg 4ab77b35ea [Android] Shows Brave VPN UI based on policy. (#33467)
Resolves: https://github.com/brave/brave-browser/issues/52355
2026-01-28 18:56:10 +00:00
Szilard Szaloki d9a43e733d Account: resend verification email notifications (Android) (#33410) 2026-01-27 01:48:15 +00:00
Serg 49c34d0a46 [Android] Fixes a crash inside ReturnToChromeUtil.showHomeSurfaceUiOnNtp when HomeSurfaceTracker object is null. (#33408)
[Android] Fixes a crash inside ReturnToChromeUtil.showHomeSurfaceUiOnNtp
when HomeSurfaceTracker object is null.

Resolves: https://github.com/brave/brave-browser/issues/52283
2026-01-26 19:13:05 +00:00
Brian R. Bondy 94e064b2a7 Get rid of BraveOrigin mojo common dir (#33277) 2026-01-20 13:18:27 -05:00
AlexeyBarabash 4e1a164ac5 [Android] Fix build error when android_static_analysis is off (#33220)
* [Android] Fix build error when android_static_analysis is off

Resolves https://github.com/brave/brave-browser/issues/51989
2026-01-15 16:45:08 +02:00
samartnik bd2d4b53df [cr144][Android] Additional fixes for adaptive toolbar buttons (#33066)
* [cr144][Android] Additional fixes for adaptive toolbar buttons

This is additional fixes for the following change https://github.com/brave/brave-core/commit/de0e4fcc2f620c6c725093ab5626adb9b120e061

* Presubmit fixes

* Additional presubmit fixes
2026-01-07 15:41:18 -05:00
AlexeyBarabash 785fb7461c [cr144][Android] Removed MonochromePublic targets
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/53d2c26ab7847426c87cc2a2aaf31b8e31bb2c14

	android: Remove MonochromePublic targets

	Removes MonochromePublic APK and Bundle targets, including smoke tests
	and aliases.

	Updates libmonochrome_tmpl to use ChromePublic targets for JNI
	generation and updates VR benchmark dependencies.

	Bug: 427481836
	Change-Id: Ibba0e8f9035975fc906af4fc469c64e9775b6da0
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7207874
2025-12-21 17:13:14 -05:00
AlexeyBarabash af75c9064c [cr144][Android] New arg clientPackageName at BaseCustomTabRootUiCoordinator.ctor
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/02817219ab601f30168893303c8851195e89f200

	Window Controls Overlay on Android: Toggle button

	Similar to the UI for Window Controls Overlay on other platforms,
	provide a toggle button to enable/disabled the Window Controls
	Overlay.

	Other platforms use single chevron for the toggle button. However,
	this looks very similar to a chevron that is present in Android's
	desktop windowing system UI. Use unfold icons instead for
	differentiation.

	Screenshots:
	When disabled, to enable: https://drive.google.com/file/d/1jxs5koZg0kffQEBFaHWy-P8y8PAdN2HU
	When enabled, to disable:
	https://drive.google.com/file/d/1tsL3jmk93XUVO464LwlRweYO7ebzvpbk/view?usp=drive_link

	Fixed: 447455087
	Change-Id: I11f50cf9e7bf5e93967cec2aac18e7860a97eac1
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7069865
2025-12-20 23:56:15 +00:00
AlexeyBarabash b9c42976d1 [cr144][Android] Library android.support.annotations removed
android.support.annotation.NonNull is not used at code anymore.

The only exception is SafetyNetClient, so moved lib here from upstream cr142:
src/third_party/android_deps/cipd/libs/com_android_support_support_annotations/support-annotations.jar
src/third_party/android_deps/libs/com_android_support_support_annotations/README.chromium
src/third_party/android_deps/libs/com_android_support_support_annotations/LICENSE

Otherwise there are build errors
```
Missing class android.support.annotation.NonNull
(referenced from: com.google.android.gms.safetynet.SafetyNetClient
com.google.android.gms.safetynet.SafetyNet.getClient(android.content.Context)
and 2 other contexts)
```

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/b3748a2d55040afbbccd651513dedbac2d12799b

	Remove legacy android.support.annotations 3p library

	Bug: 455582944
	Change-Id: I9ce7495883574e7f0bdc09dcc2960abce71a54a6
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7081697
2025-12-20 23:56:15 +00:00
vadims f5e7f4b14a [Shred] shred android UI changes add contextual menu (#32834)
Added an ability to start shred manually from two places:
- tab's context menu (includes support of the menu customization)
- tab switch mode
Added confirmation dialog before the site data shred operation

Resolves: https://github.com/brave/brave-browser/issues/51326

---------

Signed-off-by: Vadym Struts <vstruts@brave.com>
2025-12-17 12:49:24 +01:00
AlexeyBarabash 855a518957 [Android] Fix for misaligned MVT area (#32806)
* [Android] Fix for misaligned MVT area

Regression was introduced between
`Nightly v1.85.63 (Chromium 141.0.7390.108)` and
`Nightly v1.85.70 (Chromium 142.0.7444.23)`.

Resolves https://github.com/brave/brave-browser/issues/51406

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/90a9724173475c0c3913a7cb9ca619d2458b1d08

	[SurfacePolish][CleanUp] Clean up surface polish code for MVT (Part 3)

	This CL represents part 3 of the cleanup for the surface polish code in
	the MVT, focusing on refining the code associated New tab page.

	Low-Coverage-Reason: TRIVIAL_CHANGE This CL cleans up the NewTabPageLayout code by deleting unused code and updating variable names.
	Bug: 331667743
	Change-Id: Idaaab489aa72714d4cd294ac86cc86b1dbe20065
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5591789
2025-12-12 21:56:46 +00:00
Serg 7a06a92381 [Android] Android origin policies
Creates origin policies constants for Android
Adds BraveOriginServiceFactory and connect preferences with BraveOriginSettingsHandler
Resolves https://github.com/brave/brave-browser/issues/51333
2025-12-10 07:14:19 +09:00
Serg a7554c1c74 [Android] Enable in-app updates for Android 14+ devices (#32648)
- Migrate in-app reviews to `com.google.android.play:review:2.0.1`
- Migrate in-app updates to `com.google.android.play:app-update:2.1.0`
- Turn on in-app updates for all supported devices
- Remove `com.google.android.play:core` dependency

Resolves https://github.com/brave/brave-browser/issues/51187
2025-12-05 14:01:39 -05:00
samartnik 7d939c6c4f [CodeHealth][Android] Remove obsolete adjustment for menu footer (#32617) 2025-12-01 15:51:22 -05:00
Szilard Szaloki 7a8a6f166b Disables pull-to-refresh in the Brave Account dialog on Android (#32595) 2025-12-01 18:53:03 +01:00
Brian R. Bondy a4d9248fcb Add enable_brave_wallet gn var and build flag (#32484)
* Add enable_brave_wallet GN variable and build flag

This adds a new GN build flag 'enable_brave_wallet' that can be set to
false to exclude Brave Wallet from the build. The flag is true by default
to maintain current behavior.

Changes include:
- Add enable_brave_wallet declare_args in build/config/BUILDCONFIG.gn
- Create brave_wallet/common/buildflags with ENABLE_BRAVE_WALLET flag
- Update all BUILD.gn and sources.gni files to use the new flag
- Add wallet buildflags dependencies via minimal one-line imports

* Add patches for wallet buildflags in Chromium BUILD files

Adds minimal one-line patches to import wallet buildflags dependencies
in Chromium source files. This allows Chromium code to conditionally
depend on wallet headers.

Patches:
- chrome/browser/ui/hid/BUILD.gn
- net/BUILD.gn
- third_party/blink/common/BUILD.gn
- third_party/blink/public/common/BUILD.gn
- third_party/blink/renderer/modules/permissions/BUILD.gn

* Guard wallet code in Chromium source overrides

Updates chromium_src overrides to conditionally compile wallet-related
code based on enable_brave_wallet flag. This includes:

- Adding DEPS files to allow buildflags dependencies
- Guarding wallet permission handling with #if BUILDFLAG(ENABLE_BRAVE_WALLET)
- Keeping wallet permission enum values unconditionally to maintain profile
  interchangeability between wallet-enabled and wallet-disabled builds
- Updating component registration and preference handling

Key changes:
- Permission enums remain stable across build configs for UMA and persistence
- Wallet permission handling code only compiled when wallet enabled
- DEPS files updated to allow buildflags includes

* Guard wallet UI code in front-end TypeScript and Mojom

Conditionally compiles wallet-related UI code in TypeScript and Mojom
interfaces based on enable_brave_wallet preprocessor flag.

Changes:
- Settings menu: Use lastInserted pattern for menu item ordering
- Page visibility: Guard wallet page visibility checks
- Browser commands: Guard wallet command handling
- Routes: Conditionally include wallet routes
- Add non-null assertions for DOM insertions in TypeScript
- Update Mojom interfaces to conditionally include wallet enums

Front-end code uses <if expr="enable_brave_wallet"> preprocessor
directives to exclude wallet UI when the feature is disabled.

* Guard wallet usage in non-wallet Brave code

Conditionally compiles wallet-related code in non-wallet Brave files
based on enable_brave_wallet build flag.

Changes include:
- browser/: Guard wallet service factories, preferences, and helpers
- components/: Guard wallet dependencies in rewards, sidebar, and DNS
- renderer/: Conditionally register wallet content settings
- utility/: Guard wallet component registration
- ios/: Add optional chaining for wallet feature flags
- test/: Guard wallet-related test code

Key files:
- brave_stats_updater.cc: Guard wallet pref registration with #if
- brave_profile_prefs.cc: Conditionally register wallet preferences
- sidebar_service.cc: Guard wallet panel items
- iOS WalletConstants.swift: Use optional chaining for feature checks

This allows building Brave without wallet while maintaining profile
compatibility between wallet-enabled and wallet-disabled builds.

* Add static_assert for ENABLE_BRAVE_WALLET in wallet headers

Adds compile-time assertions to wallet headers to ensure they are only
included when wallet is enabled. This prevents accidental usage of wallet
APIs when enable_brave_wallet=false.

Added static_assert(BUILDFLAG(ENABLE_BRAVE_WALLET)) to:

browser/brave_wallet/ (11 files):
- asset_ratio_service_factory.h
- brave_wallet_context_utils.h
- brave_wallet_ipfs_service_factory.h
- brave_wallet_provider_delegate_impl.h
- brave_wallet_service_factory.h
- brave_wallet_tab_helper.h
- meld_integration_service_factory.h
- wallet_notification_service_factory.h
- simulation_service_factory.h
- swap_service_factory.h
- wallet_data_files_installer_delegate_impl.h

components/brave_wallet/browser/ (15 files):
- brave_wallet_p3a_private.h
- brave_wallet_prefs.h
- brave_wallet_service.h
- brave_wallet_utils.h
- ens_resolver_task.h
- json_rpc_service_test_utils.h
- json_rpc_service.h
- keyring_service_observer_base.h
- keyring_service.h
- network_manager.h
- permission_utils.h
- pref_names.h
- test_utils.h
- tx_service.h
- wallet_data_files_installer.h

components/brave_wallet/common/ (6 files):
- brave_wallet_types.h
- common_utils.h
- eth_abi_utils.h
- features.h
- hex_utils.h
- pref_names.h

Also includes minor wallet code updates to use buildflags and
guard zcash-specific test code.

* Follow up fixes after Parts 1-7
2025-11-28 15:54:27 -05:00
samartnik f51ac207b4 [Android] Fix for qr code reader when device is flipped (#32597)
To avoid copy/pasting of the same code in `BraveLocationBarQRDialogFragment` and `BraveSyncScreensPreference`, the common code related to qr code reading was moved to `QRCodeCameraManager` class.
2025-11-28 13:43:21 -05:00
samartnik b5d1940f4f [cr143][Android] Deprecate TabGroupModelFilterImpl (#32554)
* [cr143][Android] Deprecate TabGroupModelFilterImpl

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/74591e3cce051612058a135c4b7fd55aab1d6320

commit 74591e3cce051612058a135c4b7fd55aab1d6320
Author: Calder Kitagawa <ckitagawa@chromium.org>
Date:   Thu Oct 23 07:08:09 2025 -0700

    [Tab Collection] Publicize deprecation more loudly

    Bug: 454344854
    Change-Id: I7fd5f9af32a76f0c1b8a7e131879d75cbb87dd3e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7079335
    Auto-Submit: Calder Kitagawa <ckitagawa@chromium.org>
    Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
    Reviewed-by: Dan Polanco <polardz@google.com>
    Commit-Queue: Dan Polanco <polardz@google.com>
    Cr-Commit-Position: refs/heads/main@{#1534290}

* Presubmit fixes
2025-11-26 11:04:38 -05:00
samartnik dc731eb5a3 [Android] New privacy-preserving uac codes (#32456)
* [Android] New privacy-preserving uac codes

* Move BraveReferrer to the referrer folder

* Presubmit fixes
2025-11-24 14:06:39 -05:00
Serg 86a4887089 Android new tab page ab test (#32464)
* [Android] Fresh NTP after idle experiment.

Introduces 4 different variants whether to show NTP or not when Brave
is foregrounded.
Resolves: https://github.com/brave/brave-browser/issues/50989
2025-11-21 17:32:50 -05:00
Artem Samoilenko 3f56de865e [cr143][Android] shouldShowDeleteButton is package available now
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/565cfd616cb5b812fa1f4a2c8eee4465dd5542b1

commit 565cfd616cb5b812fa1f4a2c8eee4465dd5542b1
Author: Charles Hager <clhager@google.com>
Date:   Thu Oct 2 12:03:29 2025 -0700

    Add width consumer for the location bar buttons

    This adds a new ToolbarWidthConsumer for the location bar's buttons
    (install, mic, lens, bookmark). The exact order is arbitrary, as
    the buttons are all roughly the same priority other than the bookmark
    button being the highest priority to keep visible.

    https://screencast.googleplex.com/cast/NDkzNjUwODY4MjI3Mjc2OHwyZjNlYjhlMC00ZA

    Bug: 427260734
    Change-Id: Icf0ed2bcf86886ee7806d8c7bd4d9c081268debe
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6945458
    Reviewed-by: Patrick Noland <pnoland@chromium.org>
    Commit-Queue: Charles Hager <clhager@google.com>
    Reviewed-by: Sirisha Kavuluru <skavuluru@google.com>
    Cr-Commit-Position: refs/heads/main@{#1524367}
2025-11-18 11:18:40 -05:00
samartnik 7a2ae80b90 Revert "[Android] Integrate upstream's qr code reader instead of our own" (#32354)
Revert "[Android] Integrate upstream's qr code reader instead of our own (#32…"

This reverts commit 000acdf61c.
2025-11-17 11:18:38 -07:00
Simone Arpe 315796e80c Reset scroll position for Brave overflow main menu when it's shown (#32323)
Resets the overflow main menu to the top every time is shown. Modifications are applied using bytecode manipulations as we needed to modify upstream class `AppMenuHandlerImpl`.
2025-11-17 16:12:05 +01:00
Szilard Szaloki 8698c26abb [Android] Sync Account section with registration flow. (#32319) 2025-11-14 22:31:31 +01:00
samartnik 000acdf61c [Android] Integrate upstream's qr code reader instead of our own (#32312) 2025-11-13 14:54:06 -05:00
Serg d1c604c508 Android fresh ntp after idle (#32132)
[Android] Adds kBraveFreshNtpAfterIdleExpirement experiment flag.

That commit adds the flag with parameters and a functionality
to use cached flags on Android.
Resolves: https://github.com/brave/brave-browser/issues/50567
2025-10-31 09:35:04 -04:00