Commit Graph
4850 Commits
Author SHA1 Message Date
Aleksei Seren 98d1b2b5ff Unify the Android Dynamic NTT for reuse on iOS (#31185)
Unify the Android Rich NTT for reuse on iOS

The current PR is pre-requisite of Dynamic NTT on iOS as it allows
to reuse android `New Tab Takeover WebUI` on iOS. The PR removes
dependency of android `New Tab Takeover WebUI` from
`ViewCounterService` which is not available on iOS. It also removes
`current_wallpaper` base::Value cache in ViewCounterService which
allows to save memory and makes code cleaner.
2025-09-22 09:21:26 -05:00
samartnik d8cd91653c [Android] Fix for the bottom padding of the main menu (#31315) 2025-09-22 07:56:03 -04:00
Serg 5776b02976 Detects URLs better from QR code scanner (#31285)
Sometimes scanning QR codes searches for the URL within
search.brave.com rather than either loading the targeted URL or
displaying the URL within the omnibox so the user can load the
website that was scanned.
Resolves: https://github.com/brave/brave-browser/issues/48806
2025-09-19 09:13:56 -04:00
vadims 9ea69c1d1b [Webcompat Reporter] Add a padding between string and dropdown menu (#31272)
Increase the distance between the dropdown menu and its label.

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

Signed-off-by: Vadym Struts <vstruts@brave.com>
2025-09-18 16:51:42 +02:00
Anirudha BoseandNuo Xu 49e6623f46 feat(wallet): support price lookups via gate3 (#31054)
* feat(gate3): support price lookups via gate3

* Fix android build

* Fix iOS build

* Fix broken unit tests

* Fix storybook build

* review(supermassive): use idl definition for parsing

* review(supermassive): documentation fixes

* review(supermassive): improve typing in pricing-utils.ts

* review(nuo-xu): remove unnecessary guard

* review(nuo-xu): accept tokens in fetchPrices() instead of requests

* fix iOS unit tests with BraveWallet.AssetPrice

* Fix formatting error

* review(supermassive): remove unused argument

* review(supermassive): use both coin and chain_id to reference chains

* Rename coin_type to coin

* Parse address field as optional and nullable string

* review(nuo-xu): refactor AssetPrice comparison logic

* Add getPriceRequestsForTokens util in pricing-utils.ts

* Fix wallet ui build error

* Allow percentage_change_24h to be optional nullable string

* review(supermassive): remove batching logic in getTokenSpotPrices query fn

* Fix Android

* Fix broken android build in AssetsPricesHelper

* Fix android build

* fix iOS unit tests by adding asset prices for tokens on testnets

---------

Co-authored-by: Nuo Xu <nuoxu.nx@gmail.com>
2025-09-17 19:22:35 +05:30
Simone Arpe 673b2e1833 Implement new preference screen "Customize menu" (#31172)
The custom menu item preference screen follows the Figma design and is composed by two sections, Main menu and Page actions.

The screen shows only those items that are supported by the device, items that will never appear won't be shown.
Each item's visibility will default to true and each preference is saved on shared preferences.

The only two items whose visibility cannot be modified are the Main Settings item and the Custom Menu item itself.
2025-09-16 13:54:29 +02:00
Aleksei Seren 87ba6f1985 Fix NTP view counter on Android (#31168)
Changed RegisterPageView() to be called after
GetCurrentWallpaperForDisplay()
2025-09-13 01:11:31 +09:00
Serg 1287169d1e Let users to display only one tiles row in in quick action search widget (#31111)
Let users to display only one tiles row in in quick action search
widget

There are cases on some devices where it is impossible to display
only one tiles row, it displays two right away.
Resolves: https://github.com/brave/brave-browser/issues/49110
2025-09-10 02:10:49 +09:00
Brian R. Bondy 24d9b92d6d Remove top sites suggestions provider (#31073)
The list was not updated nor maintained, and even had invalid entries.

On device which uses a local ML model was tied to this preference for some reason too, so that keeps the preference around and has a checkbox for just that now.

For Android, it doesn't support on device suggestions because the ML
models aren't available there, so no checkbox was added there.
2025-09-08 11:42:41 -04:00
Serg 965a2b137d Hit all 4 edges in quick action search widget (#31018)
Search only form should not hit top anb bottom but a view with top
tiles should hit all 4 edges.
Resolves: https://github.com/brave/brave-browser/issues/48943
2025-09-03 20:24:16 -04:00
AlexeyBarabash 75914cd582 Android tab switcher incognito icon (#31021)
* Updated icons with product-private-window.svg from Leo repository
* Moved incognito_simple icon corresponding to upstream's place

Resolves https://github.com/brave/brave-browser/issues/48913
2025-09-04 07:59:34 +09:00
AlexeyBarabash 6ba7b53384 Set secure clipboard flag when copying Sync code (#30280)
* Set clipboard flag when copying Sync code / wallet recovery

Resolves https://github.com/brave/brave-browser/issues/47843
2025-09-02 19:58:06 +03:00
AlexeyBarabash 1bdfeecdb5 [cr140][Android] Fixed color of search your downloads textbox (#30856)
* [cr140][Android] Fixed color of search your downloads textbox

The color `@color/toolbar_text_box_bg_color` was used which does not
depend on Brave's color accent.

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

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

	Implement new Download page UI for LFF devices

	Implements the new UI for the Download Manager page on large-screen
	devices based on the approved UX spec, http://shortn/_9stIgUxL1u.

	UI behavior after changed: http://shortn/_FOLyyoTdOG

	Bug: 422042079
	Test: chrome://downloads should match UI team's design on LFF device
	Change-Id: Ieb77fcd38d86fd023a149c8186fc1de84819bb60
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6733725
2025-09-01 18:33:20 +03:00
Pavel Beloborodov 644dfbecbf Speedreader GN structure. (#30702)
* Inroduced BUILD.gn for //brave/browser/speedreader.
2025-09-01 20:10:34 +07:00
samartnik 3b342ba258 [Android] Move Quick Shortcut setting to Appearance (#30936) 2025-08-29 14:39:46 -04:00
Oliver Ddin 2dd36ab4ff Merge branch 'brave_vpn_radio_server_selection_radiobutton_fix' 2025-08-29 20:14:18 +02:00
Simone Arpe 1fd0726cb7 Improve Picture-in-picture transition algorithm (#30934)
* Move BraveYouTubeScriptInjectorNativeHelper to main app layer so it can reference BraveActivity

* Save boolean flag in activity bundle

* Add small delay to let the layout pass to complete
2025-08-29 19:24:06 +02:00
Oliver Ddin af14cfe912 [Android] Fix radio button functionality in VPN region selection menu
When a user tapped on the radio button in the VPN region (country)
selection screen, it did not have a click handler which resulted in the
user's interaction being dispatched to the parent container for that
row, causing them to be brought to the next screen where they choose a
city.

Now, the radio button handles clicks and will switch them to that
country. The optimal region is always chosen within the code. Users can
still tap on the row entry itself to access the city selection screen.

Closes brave/brave-browser#48327
2025-08-29 18:08:05 +02:00
Oliver Ddin 798e2ea7a0 [Android] Fix call dispatched on incorrect thread, null string fixes.
When we call into `BraveVpnPrefUtils.setPrefModel`, this function
invokes a method or two that `assert` they're being called on the UI
thread. As a result, previously, the VPN would fail to start in debug
builds as a result of the assertion and could possibly have been causing
breakage in Release builds.

Additionally, a couple of functions have had a null-check added which
causes them to return without doing anything. Prior to this commit, an
exception would be thrown immediately when passed to `setString` which
then resulted in the function not doing anything anyway - along with
negatively impacting any code further up the call chain that didn't
handle the exception.

There was also a problem with the VpnServerSelectionActivity wherein a
member of the class implemented AutoCloseable but was not being closed
in all cases which then resulted in a runtime exception because the
object detected it was freeing its resources by being finalized. A
missing close() has been added and we also handle onDestroy() to close
the object there too.
2025-08-29 18:08:04 +02:00
AlexeyBarabash b5a55e8879 [cr140][Android] Replace tablet arrows icon with correct ones (#30873)
This fixes cr140 regression intruduced at
https://github.com/brave/brave-core/pull/29767/commits/a578a9cfec558824dc6d9264b397957e0d7b5989

Resolves https://github.com/brave/brave-browser/issues/48634
2025-08-27 20:29:01 +03:00
AlexeyBarabash 1961c8c81f [cr140][Android] Fixed close button at Rewards custom tab (#30812)
Fixed close button at Rewards custom tab

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

Chromium change probably:
https://source.chromium.org/chromium/chromium/src/+/10303af4b9ba8510d05ca130a1545f0b303a2721

	Pad snackbars in SettingsActivity when edge-to-edge

	SettingsActivity creates the SnackbarManager with a parent view of the android.R.id.content, which is an issue when drawing edge-to-edge, since that base content view will be drawing underneath the system bars.

	This change adds #getContentView() to ChromeBaseAppCompatActivity, which will return the proper content view for the activity.

	Before:
	https://screenshot.googleplex.com/6wrywD2fGvLCbMA.png

	After:
	https://screenshot.googleplex.com/9wwkQ4GRnUTUNA8.png

	Bug: 398937046
	Change-Id: Ibfcebff816a8f19f091e299ff581aa3188f32afa
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6302322
2025-08-26 05:21:21 +09:00
cdesouza-chromium 32735d0ead Upgrade from Chromium 139 to Chromium 140 (#29767)
<!-- Add brave-browser issue below that this PR will resolve -->
Resolves https://github.com/brave/brave-browser/issues/47105

<!-- CI-related labels that can be applied to this PR:
* CI/run-audit-deps (1) - check for known npm/cargo vulnerabilities
(audit_deps)
* CI/run-network-audit (1) - run network-audit
* CI/run-upstream-tests - run Chromium unit and browser tests on Linux
and Windows (otherwise only on Linux)
* CI/run-linux-arm64, CI/run-macos-x64, CI/run-windows-arm64,
CI/run-windows-x86 - run builds that would otherwise be skipped
* CI/skip - do not run CI builds (except noplatform)
* CI/skip-linux-x64, CI/skip-android, CI/skip-macos-arm64, CI/skip-ios,
CI/skip-windows-x64 - skip CI builds for specific platforms
* CI/skip-upstream-tests - do not run Chromium unit, or browser tests
(otherwise only on Linux)
* CI/skip-all-linters - do not run presubmit and lint checks
* CI/storybook-url (1) - deploy storybook and provide a unique URL for
each build

(1) applied automatically when some files are changed (see:
https://github.com/brave/brave-core/blob/master/.github/labeler.yml)
-->

## Submitter Checklist:

- [ ] I confirm that no [security/privacy review is
needed](https://github.com/brave/brave-browser/wiki/Security-reviews)
and no other type of reviews are needed, or that I have
[requested](https://github.com/brave/reviews/issues/new/choose) them
- [ ] There is a [ticket](https://github.com/brave/brave-browser/issues)
for my issue
- [ ] Used Github [auto-closing
keywords](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue)
in the PR description above
- [ ] Wrote a good [PR/commit
description](https://google.github.io/eng-practices/review/developer/cl-descriptions.html)
- [ ] Squashed any review feedback or "fixup" commits before merge, so
that history is a record of what happened in the repo, not your PR
- [ ] Added appropriate labels (`QA/Yes` or `QA/No`;
`release-notes/include` or `release-notes/exclude`; `OS/...`) to the
associated issue
- [ ] Checked the PR locally:
* `npm run test -- brave_browser_tests`, `npm run test --
brave_unit_tests`
[wiki](https://github.com/brave/brave-browser/wiki/Tests)
* `npm run presubmit`
[wiki](https://github.com/brave/brave-browser/wiki/Presubmit-checks),
`npm run gn_check`, `npm run tslint`
- [ ] Ran `git rebase master` (if needed)

## Reviewer Checklist:

- [ ] A security review [is not
needed](https://github.com/brave/brave-browser/wiki/Security-reviews),
or a link to one is included in the PR description
- [ ] New files have MPL-2.0 license header
- [ ] Adequate test coverage exists to prevent regressions
- [ ] Major classes, functions and non-trivial code blocks are
well-commented
- [ ] Changes in component dependencies are properly reflected in `gn`
- [ ] Code follows the [style
guide](https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/c++.md)
- [ ] Test plan is specified in PR before merging

## After-merge Checklist:

- [ ] The associated issue milestone is set to the smallest version that
the
  changes has landed on
- [ ] All relevant documentation has been updated, for instance:
- [ ]
https://github.com/brave/brave-browser/wiki/Deviations-from-Chromium-(features-we-disable-or-remove)
- [ ] https://github.com/brave/brave-browser/wiki/Proxy-redirected-URLs
- [ ]
https://github.com/brave/brave-browser/wiki/Fingerprinting-Protections
- [ ]
https://github.com/brave/brave-browser/wiki/Brave%E2%80%99s-Use-of-Referral-Codes
- [ ]
https://github.com/brave/brave-browser/wiki/Web-Compatibility-Exceptions-in-Brave
  - [ ] https://github.com/brave/brave-browser/wiki/QA-Guide
  - [ ] https://github.com/brave/brave-browser/wiki/P3A

## Test Plan:
2025-08-20 01:19:41 +01:00
AlexeyBarabash d7256b1461 [cr140][Android] Backport built-in Password Manager (#30433)
Starting from cr140 Password manager was removed from Android.

This commit switches Android to use the same PasswordManagerSettingsService
as Desktop does.
Also backports upstream's Password Manager classes and resources used at cr139.

Chromium changes:

https://source.chromium.org/chromium/chromium/src/+/7511b67d9208bd10463c1e5752976346ab6bd207
	[LoginDbDeprecationAndroid] Remove last usages and delete the flag

https://source.chromium.org/chromium/chromium/src/+/5794e9a0461497b7b810e9366c1c53eab711b6f2
	[passwords/android] Limit kPasswordsUseUPMLocalAndSeparateStores access

https://source.chromium.org/chromium/chromium/src/+/6875d2ce472e7f2097617525feec45313602e225
	[passwords/android] Remove unused password checkup UI

https://source.chromium.org/chromium/chromium/src/+/3662471ee9fabd6d1777b1d5316f0b9eede0f115
	[passwords/android] Remove unused PasswordSettings.java

Or see the log for `chrome/browser/password_manager/android/` directory
https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/password_manager/android/;bpv=1
2025-08-20 01:06:59 +03:00
samartnik dff110a652 [Android] Adds flag to enable dynamic colors (#30666)
* [Android] Adds flag to enable dynamic colors

* Fixes for browser tests
2025-08-19 15:41:52 -04:00
AlexeyBarabash e64749e94c [cr140][Android] Removed deprecated SigninManager.isAccountManaged
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/6853852a6e345346bb9b0578c83b5b7989e8b3ad

	[Android][Signin] Move sign-in operation to bottom sheet mediator

	The main goal of this CL is to move the sign-in related operations and
	the use of SigninManager from the AccountPickerDelegate implementations
	to AccountPickerBottomSheetMediator.

	It also add a sign-out operation right before sign-in if there's an
	existing account. This behavior was previously implemented only for the
	web sign-in entry point, but it also makes sense for the other flows.
	The SignoutReason enum description is updated accordingly to state it's
	not only used by the web-signin anymore.

	The tests are updated accordingly.

	Bug: 431198423, 40646656
	Change-Id: I9ac9f3410cba714d16a1dd02b46f1d69afcf0eb2
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6759794
2025-08-19 19:54:35 +01:00
AlexeyBarabash f753c356a8 [cr140][Android] New arg topInsetCoordinatorSupplier at ToolbarManager.ctor
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/c584fd76ab387632c9fc9fdd181cb64b9e1b3aa8

	[Theme] Update Top toolbar layout to allow edge to edge on top.

	In this CL:
	1) Plumb TopInsetCoordinator to TopToolbarCoordinator.
	2. When the current Tab (NTPs) is draw edge-to-edge, an extra padding
	   is added or removed from toolbar to make it being placed at its
	   original position.
	Remaining work after landing this CL:
	1) Bottom toolbar when navigating from NTP or switching from NTP to a
	   regular Tab;
	2) New tab creating animations.
	Demo: https://docs.google.com/document/d/1CPo5iRHohCpKQcY3do8ZV9i5ds8P4uSW6_vPvuBXdHY/edit?resourcekey=0-dCsYe8rNsKFmoQcZ8fYlpQ&tab=t.0#bookmark=id.es3q54wnd6sn

	Bug: 432527690
	Change-Id: Ib9563ae8e34d06457025b2fdcbd0eae956cb69c8
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6795404
2025-08-19 19:54:34 +01:00
AlexeyBarabash 83e76ad48a [cr140][Android] New arg multiInstanceManager at ChromeTabCreator.ctor
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/47957c6c3cb2e3dbb65aeac5f1f714cc8d52927f

	Add shift+click handling for links

	Demo: https://screencast.googleplex.com/cast/NDcxNDM1NDM4NDU2ODMyMHxmNGNmOTAxMC05MQ

	Bug: 40916071
	Change-Id: I117d9900869c597a681be458cd94b33e9fa9ff51
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6804756
2025-08-19 19:54:34 +01:00
AlexeyBarabash 0e5dd90099 [cr140][Android] Removed activityLifecycleDispatcher from IdentityDiscController.ctor
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/2d3fa6fd4d0d3efbc19271e122458aa3695a3c3e

	[Signin][Android] Update createWithoutBadge be created after native

	In previous Cls profileDataCache was updated to require native by adding
	an identityManager object in the constructor. This CL updates
	profileDataCache#createWithoutBadge to use this constructor.

	IdentityDiscController will now show the button only if the profile has
	been initialized.

	Bug: 342205162
	Change-Id: Iba6741426576ee3dde9e8d3dc76901c1294a49d8
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6772490
2025-08-19 19:54:34 +01:00
AlexeyBarabash 5472fd75e6 [cr140][Android] Prototype adding an intent for opening tab groups from hub search
- new arg bringTabGroupToFrontCallback at LocationBarCoordinator.ctor;
- new arg bringTabGroupToFrontCallback at AutocompleteMediator.ctor

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/9bc7b331449ea2da29ce2d705d5b725f5688127f

	[hub] Prototype adding an intent for opening tab groups from hub search

	Add logic for opening up a BRING_TAB_GROUP_TO_FRONT intent with logic
	for hub search. This flow follows an established pattern in the
	BRING_TAB_TO_FRONT (switch to tab) path and needs to work from all
	contexts such as SearchActivity.

	Validate-Test-Flakiness: skip
	Bug: 431020549, 435216330
	Change-Id: I273c802cd28ff1f36d5e1aef6e4085772cf74699
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6795745
2025-08-19 19:54:33 +01:00
AlexeyBarabash 7a669d2941 [cr140][Android] Renamed MultiInstanceManagerApi31.moveTabAction to moveTabToWindow
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/d93b06c6a2b4deae42d1271c498817a2def6810c

	Implement "move to another window" submenu on tab context menu

	Also includes refactoring for MultiInstanceManager.getInstanceInfo and click listeners on TabOverflowMenu

	Demo: https://screencast.googleplex.com/cast/NDc1NjkyMDM2MjU5ODQwMHw0NjQyNzk5OC05Nw

	Bug: 402164499
	Change-Id: I3e0f9e03ddefc63aec535f603b78e1747a5060e8
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6795706
2025-08-19 19:54:33 +01:00
AlexeyBarabash 5d57425f00 [cr140][Android] Modified BasicListMenu.ctor
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/9d9b0aabaf648e9e829f80396801a9b125e06a72

	Add rendering for fixed header and scrollable content

	Demo: https://screencast.googleplex.com/cast/NTY5NzQxMTM2MzExMDkxMnxhZjU0YjQ5OC01Zg

	Bug: 432981212
	Change-Id: I6c9438bed6881ee5da7627cec62f03bac2fd3b2e
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6788783
2025-08-19 19:54:31 +01:00
AlexeyBarabash ad26da56ce [cr140][Android] Add EphemeralTabCoordinatorSupplier in ChromeActivity
- new ephemeralTabCoordinatorSupplier arg at BaseCustomTabRootUiCoordinator.ctor
- changed type from OneshotSupplierImpl to ObservableSupplierImpl at TabbedRootUiCoordinator.ctor

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/8d210f0ad7b7edb9414d856391403b3773128dc1

	[BNPL][Ephemeral] Add EphemeralTabCoordinatorSupplier in ChromeActivity

	For BNPL (Buy Now, Pay Later) on Clank, when a user selects a BNPL
	issuer, we redirect them to that issuer's site using ephemeral tabs.
	To facilitate this, we need to access EphemeralTabCoordinator
	from PaymentsWindowCoordinator, for which we are creating a
	supplier.

	Design:go/clank-bnpl-ephemeral-tabs-engineering-design

	Bug: 430575808
	Change-Id: Iaccfbcc59a50bcce22f8f623801dbf066bfe6483
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6776167

Fix for EphemeralTabCoordinator
2025-08-19 19:54:31 +01:00
AlexeyBarabash ad3fdaeeae [cr140][Android] Initialize toolbar themeColorProvider and incognitoStateProvider earlier
- new incognitoStateProvider arg at TopToolbarCoordinator.ctor
- removed overviewColorSupplier from ToolbarManager.ctor
- new themeColorProvider, incognitoStateProvider args at ToolbarLayout.ctor

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

	Initialize toolbar themeColorProvider and incognitoStateProvider earlier

	Currently, the ThemeColorProvider and IncognitoStateProvider are passed
	to the ToolbarLayout (and thus to ToolbarTablet) asynchronously after
	their initialization. Because these two classes are needed by the
	ToolbarChild ctor, this initialization order complicates things and
	makes it harder to initialize the toolbar's children, since the
	requisite classes are not available yet.

	This CL reorders initialization such that these two classes are passed
	directly via ToolbarLayout#initialize(), so that all the required inputs
	are available in this method for easier initialization.

	Bug: 427258660
	Change-Id: I84e9cc1378ec91b8fda275b17bf603f216273e16
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6777952

Fix Initialize toolbar themeColorProvider and incognitoStateProvider earlier
2025-08-19 19:54:31 +01:00
AlexeyBarabash c4ebe166c9 [cr140][Android] Add TopInsetCoordinator for consuming top insets
New arg topInsetCoordinatorSupplier at NewTabPage.ctor and TabbedRootUiCoordinator.ctor

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

	[Theme] Add TopInsetCoordinator for consuming top insets.

	In this CL:
	1. Introduce TopInsetCoordinator to consume the top inset for NTPs.
	2. A supplier of TopInsetCoordinator is owned by ChromeTabbedActivity,
	   and the instance is created by RootUiCoordinator.
	This CL plumbs the TopInsetCoordinator, but doesn't change NTP to
	support edge-to-edge.

	Bug: 432527690
	Change-Id: Ia372f7285aaff95ca2bb47e43a76c142729dbed1
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6785207
2025-08-19 19:54:30 +01:00
AlexeyBarabash 3a31b31511 [cr140][Android] Changes at NewTabPageLayout
- updated new_tab_page_layout.xml;
- renamed insertSiteSectionView to initializeSiteSectionView

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

	Remove Unnecessary MVT FrameLayout

	This CL is a follow-up to
	https://chromium-review.googlesource.com/c/chromium/src/+/6771167, which
	removed the unused placeholder for the Most Visited Tiles (MVT) section.

	With the placeholder gone, we no longer need to switch visibility
	between it and the mv_tiles_layout at the MVT section's position.
	Therefore, this CL removes the FrameLayout that previously wrapped both
	the mv_tiles_layout and the placeholder.

	Bug: 421436204
	Change-Id: I8937fcca9dcee78be2a3e3a994ed5aca251c5cd6
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6777058
2025-08-19 19:54:28 +01:00
AlexeyBarabash 4ea295f122 [cr140][Android] PersonalDataManager.getProfilesToSuggest has no arguments anymore
Note: BraveAutofillBackgroundServiceImpl is not invoked since we removed
BraveAutofillService from manifest at 2c6bd81682

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/8bed5e34c6175679c2c5250dea84ef49b9531a39

	[Android] Simplify PersonalDataManager JNI calls

	This CL simplifies the `getProfilesToSuggest()`,
	`getProfileLabelsToSuggest()`, and `GetProfileLabels()` methods by
	inlining their constant arguments.

	Bug: 40100455
	Change-Id: I4ef7cf9286d849dfd2b7699987a45ac6caab769b
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6771813
2025-08-19 19:54:27 +01:00
AlexeyBarabash 065fd1602c [cr140][Android] Delete Most Visited Tiles placeholder from NTP
Removed noMvPlaceholderStub arg from MostVisitedTilesMediator.ctor
Removed MostVisitedTilesMediator.updateTilePlaceholderVisibility

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

	Delete Most Visited Tiles placeholder from NTP

	This CL removes the "mv_tiles_placeholder_stub" view as it never
	actually appears in the New Tab Page (NTP) UI.

	The placeholder's visibility is set to View.VISIBLE when no tiles are
	present. However, its parent, mv_tiles_container, is only visible if and
	only if there are tiles to display. Consequently, if no tiles are
	present, "mv_tiles_container"'s visibility is View.GONE, preventing its
	child, "mv_tiles_placeholder_stub", from ever being rendered on the NTP.

	This CL deletes all related placeholder logic from the view binder, view
	properties, mediator, XML, PNG files, and tests.

	Bug: 421436204
	Change-Id: Iab3a2288a97dcfa2e7c137d5b1d6e7521a07176e
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6771167
2025-08-19 19:54:27 +01:00
AlexeyBarabash b22be51ec9 [cr140][Android] New extensionToolbarCoordinator arg at ToolbarLayout.ctor
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/4470dbf6161828590aa295254384f23413ba67ea

	extensions: Fix the extension button's color in incognito mode

	Currently, the extension buttons's ripple background in incognito mode
	is inconsistent with other button's, i.e. The ripple background color
	should be white but blue now

	Bug: 421795414
	Change-Id: I950c5ca8e952ca1f8a7a21f76a7c667792785e93
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6729174
2025-08-19 19:54:27 +01:00
AlexeyBarabash fc38bd3380 [cr140][Android] Remove offline button in toolbar omnibox
these classes were removed:
- LocationBarMediator.SaveOfflineButtonState;
- LocationBarCoordinator.OfflineDownloader.

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/6f3100cc3588c5a6de3d08a3b40a32c942f3b797

	[Tablet] Remove offline button in toolbar omnibox

	This CL removes the omnibox button and some
	HideTabletToolbarDownloadButton usages for downloading a page.

	Bug: 427257905
	Change-Id: I010221c5885e8b2897a62b75223de64bbd61dcbe
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6770150
2025-08-19 19:54:27 +01:00
AlexeyBarabash 9da25f057c [cr140][Android] Fixed java.lang.VerifyError at RedirectTabCreator class
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/7211ad73ee02dd19c83cb64c27fca687a7ed8344

	Add RedirectTabCreator

	- Add int enum SupportedProfileType to ChromeTabbedActivity to determine
	the type of tab/profile the activity supports.
	- Add RedirectTabCreator to create new tabs in another window.
	- Add method in MultiWindowUtils to get foreground CTA with matching
	profile.

	This change affects the "Open in incognito tab" option, which is
	accessible from the web content context menu, the New Tab Page (NTP)
	most visited tiles, and the NTP news feed.
	When selected, content will open in an incognito tab as follows:
	1. New Window: If there is no adjacent window, or if the adjacent
	window is a regular (non-incognito) window.
	2. Adjacent Window: If the adjacent window is already incognito.

	Bug: 429518553
	Change-Id: Ic3f1744dcfaf34cc87dc74c0ba5d72de7d2e5ced
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6720784
2025-08-19 19:54:26 +01:00
AlexeyBarabash 63d7f64469 [cr140][Android] CustomTabFeatureOverridesManager was removed
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/ec3cf2613084e5182c782597546deca62ac15598

	Clean up CCT feature overrides

	Bug: 427494350
	Change-Id: If7fda6786b3b092262a10f37221520c45cea3dff
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6769954
2025-08-19 19:54:25 +01:00
AlexeyBarabash 9f3ad6aa39 [cr140][Android] MultiWindowUtils.canEnterMultiWindowMode has no argumens now
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/10983706f21359b80b490d3a2937d437e430ea93

	[NullAway] Add @NullMarked to multiwindow/ files

	Additional cleanup:
	Remove unused MultiWindowUtils#canEnterMultiWindowMode() method input.

	Bug: 389129271
	Change-Id: I1716ee37b3e427608235f8fc49fee97a97cdde2c
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6760450
2025-08-19 19:54:25 +01:00
AlexeyBarabash 40b84de3c1 [cr140][Android] New arg at ChromeContextMenuPopulator.ctor: customContentActions
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/157d37538f066ab0467fb47a9247407f244ead28

	Add Support for Contextual Menu Items for CCTs

	This change implements the click-handling logic for custom content
	actions in the CCT context menu, gated by the CctContextualMenuItems
	feature flag. Additionally, it adds a new histogram to record
	interactions based on the action type (e.g. Link or Image).

	For links, the returned intent contains:
	- [Extra][int] The original integer id of the custom action.
	- [Extra][int] The clicked target type (link/image).

	For images, it additionally returns:
	- [Extra][uri] Image data as a uri.
	- [Data][uri] Page url.

	The tests added verify the creation and clicking logic of the contextual
	menu items as well as histogram recording upon selection.

	Bug: 422177241
	Change-Id: I9d05be9b2ba7a455dd324930fe6a0f751f59a016
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6700830
2025-08-19 19:54:23 +01:00
AlexeyBarabash 196a52d8dc [cr140][Android] Remove deprecated #buildMenuItem usages
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/5bf125f2b2472d8484aa08fcfe0af1797208e350

	[ListItemBuilder] Remove deprecated #buildMenuItem usages

	- Removes usages of deprecated BrowserUiListMenuUtils methods
	- Replaces these calls with ListItemBuilder

	Bug: 427787496
	Change-Id: I9e9cac10d15ef634f8895e1058d5d149a6171a40
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6709903
2025-08-19 19:54:22 +01:00
AlexeyBarabash a578a9cfec [cr140][Android] Update btn_right and btn_back to newer asset
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/f5f7db8839213f6a812ba2fb5972547225d0347b

	Update btn_right and btn_back to newer asset

	Replaces btn_right.png and btn_left.png with a newer material vector drawables.

	Bug: 425739282
	Change-Id: Ic1c50a79c7c1eedb7d69e727bbc2463b1bc94cc7
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6692114
2025-08-19 19:54:21 +01:00
AlexeyBarabash 9ef16840ea [cr140][Android] Changed arguments of ToolbarManager.ctor
`extensionService` arg was removed

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

	extensions: Extract toolbar-related stuff from ExtensionService

	ExtensionService (formerly named ExtensionToolbarManager until recently)
	currently contains a lot of toolbar-specific UI logic, requiring the
	dependency from //c/b/ui/android/extensions to //c/b/ui/android/toolbar.
	This dependency is not desirable as it forbids most of the UI code under
	//c/b/ui/android to depend on //c/b/ui/android/extensions due to
	dependency cycles. We want to reverse the dependency direction.

	As the first step towards the goal, this patch extracts the
	toolbar-related methods from ExtensionService to a new class
	ExtensionToolbarCoordinator, and place it under
	//c/b/ui/android/toolbar.

	ExtensionToolbarCoordinator's implementation is loaded with
	ServiceLoader just like ExtensionService, so that its implementation
	can depend on conditionally-compiled extension UI code. It is created
	and owned by ToolbarManager, instead of RootUiCoordinator that formerly
	owned ExtensionService, because it now focuses on toolbar stuff.

	This is a pure refactoring. No functional changes are expected.

	Bug: 428637084
	Change-Id: I141d6ba797626230d59cd0bc481588264ac6cf06
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6694669
2025-08-19 19:54:20 +01:00
AlexeyBarabash 29ad4b5393 [cr140][Android] Arguments of TabbedAppMenuPropertiesDelegate.ctor changed
`extensionService` arg was removed

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/8a30345b5b56d892a62dd6789f9a621df233fed8

	extensions: Rework ExtensionService as ExtensionUiBackend

	It was pointed out in code reviews that ExtensionService (in Java) can
	be confused with ExtensionService (in C++). To avoid confusion and
	clarify the responsibility of the class, this patch renames it to
	ExtensionUiBackend, together with some rework I'm describing below.

	We also introduce a new class, ExtensionUi, that allows easy access to
	ExtensionUiBackend. Production code should use ExtensionUi instead of
	directly calling into ExtensionUiBackend. ExtensionUi holds a singleton
	instance of ExtensionUiBackend, so it can provide static methods to
	call into the backend. It also provides a test-only method to inject
	a fake ExtensionUiBackend to streamline unit testing.

	The only method in ExtensionUi and ExtensionUiBackend, isEnabled(),
	takes a Profile as an explicit argument, rather than saving it in the
	constructor, to make it clear that its result is a function of the
	given profile.

	This is a pure refactoring. No functional changes are expected.

	Bug: 428637084
	Change-Id: I746e78f8f8ed6a9bb563625c17230ee96b4a2d9a
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6694671
2025-08-19 19:54:20 +01:00
AlexeyBarabash 451259288f [cr140][Android] UndoBarController.showUndoBar was changed
New arg: savedTabGroupSyncIds

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/86888604d5609555263c0d6d57f27af9be936c53

	[declutter] Refactor undo close snackbar to support SavedTabGroup types

	Refactor the UndoBarController to support SavedTabGroup types for the
	archived surface use case.

	Bug: 417467809
	Change-Id: Iffd2bc14aba8d8aede63d9eab698455ca81fffcd
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6682164
2025-08-19 19:54:18 +01:00
AlexeyBarabash 3a554ef2cb [cr140][Android] NewTabPage.updateSearchProviderHasLogo is updateSearchProvider
Method was renamed and its functionality was extended

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

	[ParityV2] Show fake search box for 3p DSE.

	In this CL, we show fake search box for 3p DSE without logo in both
	phones and tablets. A temporary top margin is added to the fake search box. We also adjust NtpFakeSearchBoxTransitionStartOffset to
	prevent the search box's alpha is set 0 (transparent) on tablets.
	Screenshots: http://shortn/_qHQjTnhSYU

	Bug: 426594110
	Change-Id: If81df470078dfd24d28fcaf6107bcc401691e985
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6676222
2025-08-19 19:54:18 +01:00
AlexeyBarabash 6f28f4e9aa [cr140][Android] sync: Add extensions checkbox to settings on desktop Android
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/2460bafb67b67c895e7eb21e63fcdfaac1bcfbf5

	sync: Add extensions checkbox to settings on desktop Android

	Support for extensions sync was recently added to desktop Android.
	Update the sync settings page to add a checkbox for the sync data
	type.

	      toggles sync data type in chrome://sync-internals

	Test: added to chrome_public_test_apk
	Test: manually verified checkbox appears on desktop Android and
	Test: manually verified checkbox does not appear on non-desktop Android
	Bug: 424217517
	Change-Id: Ifd6643e1d8b013e5d5383d21ef31a51863277650
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6652500
2025-08-19 19:54:17 +01:00