Commit Graph
4336 Commits
Author SHA1 Message Date
Artem Samoilenko a5562072d1 [cr141][Android] Use java.util.function.Supplier rather than Chrome's copy of it
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/94e940f0ad7bd5d37452ee71ab06fe87d675afb2

Use java.util.function.Supplier rather than Chrome's copy of it.
This is 99% sed + git cl format.

The 1% was a couple shims to not break internal builds.
See PS1->PS5 for them.

Bug: 440309602
Change-Id: I9ff8438583286b238505c4f63062279c7b24b254
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6897327
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1507988}
2025-09-22 15:02:14 -04:00
Artem Samoilenko 83b4a8670f [cr141][Android] Apply Error Prone fixes for NonCanonicalType
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/8832afce78a8c5f089f74d8ef8bc2de9ec3ecf0b

commit 8832afce78a8c5f089f74d8ef8bc2de9ec3ecf0b
Author: Andrew Grieve <agrieve@chromium.org>
Date:   Tue Aug 26 10:30:05 2025 -0700

    Apply Error Prone auto-fixes for NonCanonicalType

    Bug: 40661145
    Change-Id: I2ff0d9005ed8e26cfbde75be6fa1d8dc326dfc51
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6883121
    Auto-Submit: Andrew Grieve <agrieve@chromium.org>
    Owners-Override: Andrew Grieve <agrieve@chromium.org>
    Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
    Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1506620}
2025-09-22 15:00:01 -04:00
Artem Samoilenko ac454132ef [cr141][Android] New params for MenuButtonCoordinator c-tor
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/a897a4e519ebb2a6480cda54f2e42f70dd837ede

commit a897a4e519ebb2a6480cda54f2e42f70dd837ede
Author: Charles Hager <clhager@google.com>
Date:   Wed Aug 27 10:31:50 2025 -0700

    Have MenuButtonCoordinator extend ToolbarChildButton

    Bug: 427260734
    Change-Id: I27c0e074fa78f4f0e91a7300700c3ec3c0ca2282
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6886473
    Reviewed-by: Sirisha Kavuluru <skavuluru@google.com>
    Commit-Queue: Charles Hager <clhager@google.com>
    Cr-Commit-Position: refs/heads/main@{#1507190}
2025-09-22 15:00:01 -04:00
Artem Samoilenko 1af745f44b [cr141][Android] Adjustments for private page changes
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/f25185ae594943aa879b703a3c4a2d6244c943b5

commit f25185ae594943aa879b703a3c4a2d6244c943b5
Author: Fiona Macintosh <fmacintosh@google.com>
Date:   Wed Aug 27 11:13:30 2025 -0700

    [3PC] Clean up AlwaysBlock3pcsIncognito in Clank NTP

    Bug: b:424271289
    Change-Id: I78c9e7f7f3eb7d27f21989c98cf23e823ce7ace6
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6883800
    Reviewed-by: Theresa Sullivan <twellington@chromium.org>
    Reviewed-by: Paul Adedeji <pauladedeji@google.com>
    Reviewed-by: Christian Dullweber <dullweber@chromium.org>
    Commit-Queue: Fiona Macintosh <fmacintosh@google.com>
    Auto-Submit: Fiona Macintosh <fmacintosh@google.com>
    Cr-Commit-Position: refs/heads/main@{#1507230}
2025-09-22 15:00:00 -04:00
Artem Samoilenko 39c30d2d47 [cr141][Android] Moves PasswordManagerHelper code to BravePasswordManagerHelper
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/d0940950fdb4359249fe5ee6018a76668e9c2b9e

commit d0940950fdb4359249fe5ee6018a76668e9c2b9e
Author: Victor Hugo Vianna Silva <victorvianna@google.com>
Date:   Thu Aug 21 12:19:31 2025 -0700

    Remove unused code in PasswordManagerHelper

    Bug: None
    Change-Id: I8249cb0a4e8273a819307dbfd5bbddc3d2b0b6ce
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6870717
    Commit-Queue: Victor Vianna <victorvianna@google.com>
    Auto-Submit: Victor Vianna <victorvianna@google.com>
    Reviewed-by: Ivana Žužić <izuzic@google.com>
    Cr-Commit-Position: refs/heads/main@{#1504668}
2025-09-22 14:59:49 -04:00
Artem Samoilenko 34f1d61e39 [cr141][Android] Fixes for AlreadyChecked warnings 2025-09-22 14:59:49 -04:00
Artem Samoilenko 6ae558a856 [cr141][Android] Add @NullMarked to BraveShareDelegateImpl
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/d6eb201ceecff3d4a08d84c45be8dd882234fa05

commit d6eb201ceecff3d4a08d84c45be8dd882234fa05
Author: Aishwarya Rajesh <aishwaryarj@google.com>
Date:   Wed Aug 20 11:21:15 2025 -0700

    [NullAway] Add @NullMarked to some chrome/browser files

    Bug: 389129271
    Change-Id: I1273fa3d23b309a3768ee4bbb50bb56f3134dc0f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6860424
    Commit-Queue: Aishwarya Rajesh <aishwaryarj@google.com>
    Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
    Owners-Override: Henrique Nakashima <hnakashima@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1504099}
2025-09-22 14:59:48 -04:00
Artem Samoilenko bc4a6ed8c5 [cr141][Android] Remove references to deprecated BuildInfo.java
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/a3f43d273827d82ead6e8cf5a19b6c7bdf6db74b

commit a3f43d273827d82ead6e8cf5a19b6c7bdf6db74b
Author: Andrew Grieve <agrieve@chromium.org>
Date:   Wed Aug 20 11:22:01 2025 -0700

    Android: Remove references to deprecated BuildInfo.java

    It was split into ApkInfo.java, AndroidInfo.java, DeviceInfo.java.

    Used Android Studio refactorings to update all references.

    Bug: 437095883
    Change-Id: I6b88a3ff43cc8c96ae1e1c9a8240c7ae69b717cf
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6865032
    Owners-Override: Andrew Grieve <agrieve@chromium.org>
    Auto-Submit: Andrew Grieve <agrieve@chromium.org>
    Reviewed-by: Peter Wen <wnwen@chromium.org>
    Commit-Queue: Peter Wen <wnwen@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1504100}
2025-09-22 14:59:48 -04:00
Artem Samoilenko 8b16dd9f1b [cr141][Android] Changes for NewTabPage.updateSearchProvider signature
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/f9b2ec34e51605ef8b3b12f8685efa28f5ca7469

commit f9b2ec34e51605ef8b3b12f8685efa28f5ca7469
Author: Xi Han <hanxi@google.com>
Date:   Thu Aug 14 10:36:54 2025 -0700

    [Theme] Allow NTPs to notify TopInsetCoordinator for DSE changes.

    NTP has observed any DSE changes. In this CL, when DSE is changed, we
    allow the current NTP to notify NtpCustomizationConfigManager, and it
    will notify TopInsetCoordinator to call
    InsetObserver#retriggerOnApplyWindowInsets() to get updated window
    insets.
    Video: http://shortn/_o8q1oovbWo

    Bug: 432527690
    Change-Id: I6176e47c8ff31c6eebbb5bb7df3a3a2b30131617
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6846500
    Commit-Queue: Xi Han <hanxi@chromium.org>
    Reviewed-by: Wenyu Fu <wenyufu@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1501471}
2025-09-22 14:59:46 -04:00
Artem Samoilenko 87e9d1f81e [cr141][Android] Modularize ToolbarTablet forward button
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/f34024558050bdb3ca902954efd0cbd5b5168f68

commit f34024558050bdb3ca902954efd0cbd5b5168f68
Author: Charles Hager <clhager@google.com>
Date:   Tue Aug 19 11:26:10 2025 -0700

    Modularize ToolbarTablet forward button

    Bug: 427258660
    Change-Id: I31e73d43ac61c142c97598590867829881171ca7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6837416
    Reviewed-by: Sirisha Kavuluru <skavuluru@google.com>
    Commit-Queue: Charles Hager <clhager@google.com>
    Cr-Commit-Position: refs/heads/main@{#1503487}
2025-09-22 14:59:46 -04:00
Artem Samoilenko abe130a03f [cr141][Android] Add install button to omnibox
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/55e44d63ae9fcb516aa390039db404871e3f310f

commit 55e44d63ae9fcb516aa390039db404871e3f310f
Author: Adam Raine <asraine@chromium.org>
Date:   Tue Aug 19 09:27:43 2025 -0700

    [Clank Desktop] Add install button to omnibox

    This CL reuses the installability checks from `AppBannerManager` instead
    of `AddToHomescreenDataFetcher`. The insatiability criteria should be
    the same for each:
    - `WebappsUtils::AreWebManifestUrlsWebApkCompatible` is true
    - `data.installable_check_passed` is true
    - `data.errors` is empty

    Future refactors in this area should consider:
    - Using the delegate pattern instead of inheritance
      crbug.com/322342499
    - Replacing `AddToHomscreenDataFetcher` with a connection to
      `AppBannerManager`, reducing the amount of duplicate logic.

    Bug: 430109659
    Change-Id: Ia4237505fb45aefa1ab8e3789eb8af22289c3700
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6735615
    Commit-Queue: Adam Raine <asraine@chromium.org>
    Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
    Reviewed-by: Dibyajyoti Pal <dibyapal@chromium.org>
    Reviewed-by: Patrick Noland <pnoland@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1503393}
2025-09-22 14:59:45 -04:00
Artem Samoilenko faad40c505 [cr141][Android] Move E2ELayout related code to //ui/edge_to_edge
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/f2e21c980c2bf08ed6a578ea408a5d9db04cfb27

commit f2e21c980c2bf08ed6a578ea408a5d9db04cfb27
Author: Joel Tan-Aristy <jtanaristy@google.com>
Date:   Tue Aug 19 11:27:32 2025 -0700

    [E2E] Move E2ELayout related code to //ui/edge_to_edge

    Moved Edge to Edge layout classes to a new //ui/edge_to_edge
    directory.

    Bug: 428281174
    Bypass-Check-License: Refactoring directory
    Change-Id: I91fa6da9535d8f5f1956b135040a578466952900
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6804203
    Reviewed-by: Jesse McKenna <jessemckenna@google.com>
    Reviewed-by: Tomasz Wiszkowski <ender@google.com>
    Reviewed-by: Theresa Sullivan <twellington@chromium.org>
    Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
    Reviewed-by: Charles Hager <clhager@google.com>
    Commit-Queue: Joel Tan-Aristy <jtanaristy@google.com>
    Reviewed-by: Wenyu Fu <wenyufu@chromium.org>
    Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1503489}
2025-09-22 14:59:45 -04:00
Artem Samoilenko 8cc588aff4 [cr141][Android] New param for StatusBarColorController c-tor
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/12719a7f7cc937c06c038d49d9a1b53fd9cd1353

commit 12719a7f7cc937c06c038d49d9a1b53fd9cd1353
Author: Xi Han <hanxi@google.com>
Date:   Mon Aug 18 15:18:15 2025 -0700

    [Theme] Update status bar and toolbar color with NTP's background color.

    In this CL, Status bar will get NTP's background color via function
    NtpCustomizationConfigManager#getBackgroundColor(). Status bar will
    listen to the background change, and update itself when the color
    changes.

    Demo: http://shortn/_LdsF9GhqbP.

    Bug: 432527690
    Change-Id: Ia470fcef8c4a771f08cc35bc6921c80c9ae45889
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6858391
    Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
    Commit-Queue: Xi Han <hanxi@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1502992}
2025-09-22 14:59:44 -04:00
Artem Samoilenko cb21669d9e [cr141][Android] Adjust icon for the new main menu item
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/8c20f1c394693bcb5f98982e3d188319c9568107

commit 8c20f1c394693bcb5f98982e3d188319c9568107
Author: Fiaz Muhammad <mfiaz@google.com>
Date:   Tue Aug 12 07:40:28 2025 -0700

    [TabGroupParity] Enable feature by default

    - Switch TabGroupParity and EntryPoints flags to enabled by default.
    - Fix broken tests.

    Bug: 391387522
    Change-Id: I78e7ed6a3e88598657fd314e270a590c17897258
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6832532
    Commit-Queue: Fiaz Muhammad <mfiaz@google.com>
    Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
    Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
    Auto-Submit: Fiaz Muhammad <mfiaz@google.com>
    Cr-Commit-Position: refs/heads/main@{#1500131}
2025-09-22 14:59:42 -04:00
Artem Samoilenko 2e5e5fc665 [cr141][Android] Remove references to the SafetyHub flag
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/65622c009574f5e76554db7bf48763b7657863ca

commit 65622c009574f5e76554db7bf48763b7657863ca
Author: Filipa Senra <fsenra@google.com>
Date:   Wed Aug 13 10:39:13 2025 -0700

    [SH] Remove references to the SafetyHub flag

    This is done in preparation of moving the flag to components. We need to
    move the flag to components because Bling frequency between password
    checks needs to be finch configurable.

    Bug: 383479015
    Change-Id: I8f2e3abe4fc6a7f69ee8645a89bf0db0da486890
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6700791
    Reviewed-by: Zaina Al-Mashni <zalmashni@google.com>
    Commit-Queue: Filipa Senra <fsenra@google.com>
    Reviewed-by: Christian Dullweber <dullweber@chromium.org>
    Reviewed-by: David Pennington <dpenning@chromium.org>
    Reviewed-by: Boris Sazonov <bsazonov@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1500890}
2025-09-22 14:59:38 -04:00
Artem Samoilenko 6c7565ced6 [cr141][Android] Changes for AutocompleteMediator c-tor
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/86f5cec0117fbbf339bec2e377847444c6cb256f

commit 86f5cec0117fbbf339bec2e377847444c6cb256f
Author: Tomasz Wiszkowski <ender@google.com>
Date:   Tue Aug 12 13:39:41 2025 -0700

    [Omnibox] Refactor large screen logic to the mediator

    This change moves the logic for determining the screen size from
    independent View implementations to AutocompleteMediator.

    This improves separation of concerns and makes the view layer simpler.

    Bug: N/A
    Change-Id: Ic387e6f2c881da8a3d125d86564650c375d11bcf
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6843320
    Commit-Queue: Tomasz Wiszkowski <ender@google.com>
    Auto-Submit: Tomasz Wiszkowski <ender@google.com>
    Reviewed-by: Jian Li <jianli@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1500392}
2025-09-22 14:59:36 -04:00
Artem Samoilenko 022a13c022 [cr141][Android] Consolidate single-tab reparenting into multi-tab methods
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/09316976243447de4c0b3979b3c00c747792fa98

commit 09316976243447de4c0b3979b3c00c747792fa98
Author: Hitarth Kothari <hitarthkothari@google.com>
Date:   Tue Aug 12 13:48:48 2025 -0700

    Consolidate single-tab reparenting into multi-tab methods.

    This change renames `ReparentingMultiTabTask` to `ReparentingTabsTask`
    and updates its `begin` method to accept additional parameters. All
    instances of moving a single tab are now handled by the
    `moveTabsToWindow` and `moveTabsToNewWindow` methods by passing a
    `Collections.singletonList` containing the single tab. This removes
    redundant single-tab reparenting methods from `MultiInstanceManager` and
    its implementations.

    Bug: 432819744
    Change-Id: I03394cbd3ae0f9afb49065d40a4271c2adcbc78e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6841517
    Auto-Submit: Hitarth Kothari <hitarthkothari@google.com>
    Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
    Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1500399}
2025-09-22 14:59:36 -04:00
Artem Samoilenko ae146154ab [cr141][Android] Changes for TOOLBAR_TOP_ANCHORED option type
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/80937223ea10c49f6c9359d5174a0c9c7283e03c

commit 80937223ea10c49f6c9359d5174a0c9c7283e03c
Author: Peilin Wang <peilinwang@google.com>
Date:   Tue Aug 5 09:08:14 2025 -0700

    [Bottom toolbar] Don't animate position changes if changed in settings

    When the bottom toolbar's position change is animated, the renderer is
    driving the animation by sending the new offsets to the browser on every
    animation tick.

    However, if the position change was done in chrome's settings, the
    browser won't get these updates (I'm guessing because the settings UI is
    covering up the toolbar?) which is why BrowserControlsManager explicitly
    updates the browser's offset when the position changes. However, this
    doesn't work with BCIV, because it causes the browser to submit a frame
    with the new height before viz receives the animation offset from the
    renderer, so the controls could appear to be in the wrong position for a
    frame or two.

    The position of the toolbar was controlled by a boolean
    SharedPreference. This CL adds more state to this SharedPreference, to
    include where the update came from. With this CL, if the update came
    from the settings page, the position change will not be animated.

    Bug: 433524798
    Change-Id: Ic47106b1caec3d99752550edb54476f773553b2e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6811960
    Reviewed-by: Patrick Noland <pnoland@chromium.org>
    Commit-Queue: Peilin Wang <peilinwang@google.com>
    Cr-Commit-Position: refs/heads/main@{#1496957}
2025-09-22 14:59:34 -04:00
Artem Samoilenko 8d9f00ca61 [cr141][Android] Fixes for HidingField warning
warning: [HidingField] Hiding fields of superclasses may cause confusion and errors
2025-09-22 14:59:32 -04:00
Artem Samoilenko 68cdfb4dba [cr141][Android] New param for FullScreenCustomTabRootUiCoordinator
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/cbdcbecdf3292b68c698532cbde53d41dc332cff

commit cbdcbecdf3292b68c698532cbde53d41dc332cff
Author: Joel Hockey <joelhockey@chromium.org>
Date:   Fri Aug 8 13:06:38 2025 -0700

    Disable drag-drop of files such as images replacing tab for CCT

    Support for drag-drop of files was recently added to clank which had
    the unintended side effect that dropping a file into a page in a
    CCT / TWA which is not registered to handle the drop event will
    replace the tab contents with the file (e.g. image).

    This fixes clank to set the accept_load_drops param to false for CCT
    to match the behavior of PWAs on other platforms.

    Bug: 409632787
    Change-Id: I4340b11eede64ab0c66ed790ca95db50e3bc70e1
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6814772
    Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
    Commit-Queue: Joel Hockey <joelhockey@chromium.org>
    Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1498987}
2025-09-22 14:59:30 -04:00
Artem Samoilenko 6778b2823d [cr141][Android] Add ToJniType for PrefService
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/1c0bb6fea57a708d7da3503567561eb6208d7774

commit 1c0bb6fea57a708d7da3503567561eb6208d7774
Author: quacksort <quacksort@google.com>
Date:   Fri Aug 8 07:35:54 2025 -0700

    [Signin][Android] Add ToJniType for PrefService

    This CL adds ToJniType for PrefService and updates existing usages to
    remove manual GetJavaObject() calls.

    Bug: 404801135
    Change-Id: I2101ce0339d3d00cdf4810517ab60196eccc79e8
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6811883
    Commit-Queue: Lucia Giorgi <quacksort@google.com>
    Reviewed-by: Theresa Sullivan <twellington@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1498781}
2025-09-22 14:59:30 -04:00
Artem Samoilenko 421db7320a [cr141][Android] Pass PrefService in SigninManagerImpl constructor
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/a3ae3847577b7918b8a6084f10309407a53294e5

commit a3ae3847577b7918b8a6084f10309407a53294e5
Author: quacksort <quacksort@google.com>
Date:   Tue Aug 5 06:47:10 2025 -0700

    [Signin][Android] Pass PrefService in SigninManagerImpl constructor

    This makes the PrefService dependency more explicit.

    This CL is a follow-up to this comment:
    https://crrev.com/c/6759932/7..10/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManagerImpl.java#b165

    Bug: 404801135
    Change-Id: I94c8638db320227d45515b5e7f4dffe19a0d5934
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6781187
    Reviewed-by: Menghan Yang <myuu@google.com>
    Commit-Queue: Lucia Giorgi <quacksort@google.com>
    Cr-Commit-Position: refs/heads/main@{#1496885}
2025-09-22 14:59:27 -04:00
samartnik a15ed443a5 [Android] Initial integration of Brave adaptive buttons (#31303)
* [Android] Initial integration of Brave adaptive buttons

The Bookmarks button is the first in the list; the rest of the buttons will be added in separate PRs.

Important notes:
- override via `chromium_src` doesn't work for `patches/chrome-browser-ui-android-toolbar-adaptive_toolbar_enums.h.patch` since this file is parsed by `java_cpp_enum.py` to convert it to java enum
- patch to `java_cpp_enum.py` was added to be able to do 1 line patch, since upsteam parses each value as a separate line
- in `patches/chrome-browser-ui-android-toolbar-adaptive_toolbar_enums.h.patch` were added values for all planned Brave buttons to avoid additional patching for each consecutive PR

* Python patch optimisations

* Presubmit fixes

* Remove python patch in favour of multiline header patch
2025-09-22 10:33:12 -04:00
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
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
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 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
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 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