Commit Graph
4672 Commits
Author SHA1 Message Date
Artem Samoilenko 26bcbbb982 [cr137][Android] Temporary fix for Utils.getProfile
This function should be removed and proper profile should be passed https://github.com/brave/brave-browser/issues/45937
2025-05-13 15:53:30 -04:00
Artem Samoilenko ab3ac1d05f [cr137][Android] Changes for createWebContentsWithWarmRenderer
Chromium change:
https://chromium.googlesource.com/chromium/src/+/b875fe9e2f6b613d0207655bd970a34427210f0d

[Android][3PPWM] Ignore IsEnabled and load config timely for CCTs

CCTs create webContents in a way that doesn't allow reading the pref
before the autofill machinery is initialized. With this CL, the pref
value is passed in on creation which fixes the issue.

Another, less frequent issue is checking isEnabled. This method lazily
initializes Android's AutofillManager and contributes to CCTs
occasionally preventing Autofill use. This is incorrect since the return
value may change while the app is running and isn't suitable for making
an initial decision about whether Autofill should be enabled. The
safeguard this provided is (already or by now) checked in the Android
Framework when the regular notifyViewEntered calls are invoked.

Just out of caution and because this fix affects a fully launched
feature, both changes are guarded with a new feature:
kAutofillVirtualViewStructureAndroidInCct.

Unlaunching the original feature isn't a good option but holding this
fix back is a bad option, too. Therefore, it's default-enabled and
intended to use only as a possible kill-switch.

The change shouldn't affect WebView but we'll add a flag as guard.

go/scrcast/NTMyNTYxNTEwMzIxMzU2OHw1OTZhYTJlZC02Yg

(cherry picked from commit 5bd3d05740695f1e55c34415cb77bdea0e04759c)

DD: go/3ppwm-dd
Bug: 411164104
Fixed: 415734605
Change-Id: Iaf8ac48eef3fbf833d49d67c3e427d8c8d4d53b5
2025-05-13 15:53:29 -04:00
Artem Samoilenko 8f11e3d05f [cr137] [Android] Changes for TopToolbarCoordinator
Chromium change:
https://chromium.googlesource.com/chromium/src/+/a07f47b0d1c1a4d6230e53ef63cb03a23863025e

[M137][New Tab Animation] Add TabCount wrapper

It allows to overwrite the tab count for purposes such as animations.

(cherry picked from commit 33d6d91f9d80104b2c2df62eac5b0d290959361a)

Bug: 410818580
Fixed: 415757905
2025-05-13 15:53:28 -04:00
Artem Samoilenko 715e203869 [cr137] [Android] Allowing edge to edge fullscreen on Android
Chromium change:
https://chromium.googlesource.com/chromium/src/+/6c3184ab7d8bcc7656e61b8c22f18c4a751c7163

Allowing edge to edge fullscreen on Android

Activity.requestFullscreenMode is now used to allow expand free form
window to the edges of the display.

User can exit the display edge to edge mode by clisking esc or dragging
the window from the top of the display.

Screencast before change:
http://screencast/cast/NDk1ODgxMzA4NDk3NTEwNHwwMTVlNmU1My1mMA
after change:
http://screencast/cast/NjA2NTAyNTg2ODM2NTgyNHw5ZjVmNWFkNi0zYQ

Bug: 373304413
2025-05-13 15:53:26 -04:00
Artem Samoilenko aa061ea173 [cr137] [Android] Move onCLick for home button to coordinator
Chromium change:
https://chromium.googlesource.com/chromium/src/+/06770268566c51e3f3039a4be41cd1d9cee21468

commit 06770268566c51e3f3039a4be41cd1d9cee21468
Author: Sirisha Kavuluru <skavuluru@google.com>
Date:   Thu Apr 24 10:11:10 2025 -0700

    [Toolbar] Move onCLick for home button to coordinator.

    Reland of https://chromium-review.googlesource.com/c/chromium/src/+/6444671

    The above CL failed tests since I missed removing setOnClickListener for home button in toolbar tablet while removing onClick() implementation.

    Change-Id: I66ed76f26c1d979f5535d11e351c0fb945ff244a
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6443761
    Reviewed-by: Patrick Noland <pnoland@chromium.org>
    Commit-Queue: Sirisha Kavuluru <skavuluru@google.com>
    Cr-Commit-Position: refs/heads/main@{#1451247}
2025-05-13 15:53:23 -04:00
Artem Samoilenko 527c099e7f [cr137] [Android] Changes for the edge-to-edge bottom chin feature
Chromium change:
https://chromium.googlesource.com/chromium/src/+/4a0320bb6babe3bcbc220e0c9847f2cd2ea48a45

Default enable the edge-to-edge bottom chin

Launch for the bottom chin: launch/4339772

Intent to ship dynamic safe area insets: https://groups.google.com/a/chromium.org/g/blink-dev/c/hXkimpjYaMg/m/EbDa9c-oAAAJ

Bug: 324436581, 407852142
2025-05-13 15:53:21 -04:00
AlexeyBarabash 5cd09dbdc0 [cr137] Fixed Nullaway warnings 2025-05-13 15:53:21 -04:00
Artem Samoilenko 58e6734aca [cr137] [Android] Fixes for NullAway presubmit errors
Chromium change:
https://chromium.googlesource.com/chromium/src/+/8bafbc5401239117b080d98f49e7bab83eed0e38

Turn NullAway presubmit upload check into an error instead of warning

Bug: 412696018
2025-05-13 15:53:18 -04:00
Artem Samoilenko 8757a298a7 [cr137] [Android] Adds icon for Autofill services setting
Chromium change:
https://chromium.googlesource.com/chromium/src/+/6518be40f7b02e1e973735224d0e994b01e262c6

[Android][3PPWM] Default-enable 3P autofill support

This has been approved in launch/4349206.

Bug: 409579377
2025-05-13 15:53:17 -04:00
Artem Samoilenko 0fac29a2a4 [cr137] [Android] Tab context menu for Tab Group Dialogs
Chromium change:
https://chromium.googlesource.com/chromium/src/+/4de24f972d7e2e062daebcc58856ef7e71091040

[Tab Group Parity] Tab context menu for Tab Group Dialogs

- Now show tab context menu for tab group dialogs
- New interface for showing TabListEditor
- Rename context menu class to TabGridContextMenuCoordinator to resolve naming conflict with `chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListGroupMenuCoordinator.java`
- Recording: https://drive.google.com/file/d/1bXXKs34DMLy5FSXOqnYTaWdaddFjuOcc/view?usp=sharing&resourcekey=0-MNtztibYKcwRsHKRdPDcrA

Bug: 412626589
2025-05-13 15:53:16 -04:00
Artem Samoilenko dff290f724 [cr137] [Android] Add web app header to the main layout
Chromium change:
https://chromium.googlesource.com/chromium/src/+/8cf864537cf0665d3558a5848f92eb469e61fc81

[Minimal UI] Add web app header to the main layout

Integrating web app header into the CCT base activity based on the
feature enabled state and web app launch params.

Support to show web app header in the dialogs will be added in a
separate CL.

HSV: https://hsv.googleplex.com/5366214560841728

Bug: 401230452
2025-05-13 15:53:16 -04:00
Artem Samoilenko 21a2ceee2e [cr137] [Android] Make AppMenuPropertiesDelegateImpl abstract
Chromium change:
https://chromium.googlesource.com/chromium/src/+/19050b6adac2e1f9b0442fc2dc4e58e5e023b251

Make AppMenuPropertiesDelegateImpl abstract.

Previously, the base class had all the logic for tabbed mode, and that
was never accessed by other child classes. This moves the tabbed logic
to the TabbedAppMenuPropertiesDelegate and make the base class abstract.

One of many CLs to try and remove XML menu inflation from the app menu.

Bug: 40145539
2025-05-13 15:53:14 -04:00
Artem Samoilenko 6303275336 [cr137] [Android] Suppress top toolbar scene layer while mini origin bar is active
Chromium change:
https://chromium.googlesource.com/chromium/src/+/44b0ddd43212a03a3a9c7a66c08cd3a0f52b7e4b

[mobar] Suppress top toolbar scene layer while mini origin bar is active

Since the mini origin bar 1) is smaller and 2) looks different from the
scene layer's contents and the Java view will always be visible when
mobar is active, we need to hide it to avoid visual glitches.

Bug: 409317927
2025-05-13 15:53:14 -04:00
Artem Samoilenko 39751f34d6 [cr137] [Android] Remove patch for ExportFlow
Upstream now calls `runCreateFileOnDiskIntent` either way, so this patch becomes obsolete.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/a58bf5281372f484db298f8fcd1c0a8dda0f64a0

[CodeHealth] Clean up LocalPasswordsAndroidAccessLossWarning. Part 1

I've split the cleanup into multiple parts to facilitate the review.

This CL cleans up the code related to password export. It:
1) Enables the feature flag by default in the export flow code.
2) Deletes up ExportWarningDialogFragment that is not used anymore,
and cleans up its tests and strings used only there
3) Deletes PasswordSettingsExportTests, because they test password
export from settings only, and M4.1 export is handled in
PasswordAccessLossExportDialogCoordinatorTest

In the second part I will enable feature by default in other parts of
code.

Change-Id: I233affd3cb8b47cc067a055e92aca219cd5776ef
2025-05-13 15:53:10 -04:00
Artem Samoilenko 9c4c5a701a [cr137] [Android] Throttle tab closure undo snackbar while tab grid dialog visible
Chromium change:
https://chromium.googlesource.com/chromium/src/+/c909285bad37c1d74b163429512d5733f628e260

[A11y] Throttle tab closure undo snackbar while tab grid dialog visible

While the tab grid dialog is visible we disable the UndoBarController
and instead use a custom implementation of the UndoBarController in
TabGridDialogMediator to handle the undo snackbar inside the tab grid
dialog. However, when closing all the tabs shown in the tab grid
dialog we still want to show an undo snackbar using the
UndoBarController. As such the disabled state only exists while the
tab grid dialog is fully visible.

Normally this works fine. However, with recent changes to snackbar
accessibility announcements, the animation would clobber the snackbar
announcing its appearance which is a poor user experience.

This CL introduces the ability to throttle the UndoBarController.
While throttled, tab closure events are queued rather than dropped.
When the throttling is stopped all queued events are displayed. If any
tab closure events become obsolete while in the queue they are
removed from the queue.

The throttling interface is built on TokenHolder and allows multiple
concurrent throttles, only releasing when all throttling is ended.

Presently, there is no TTL for events in the queue as it isn't
necessary for the tab grid dialog case as the period in which events
are only throttled and not dropped entirely is only the duration of
an animation which is very short. Moreover, many actions on the
TabModel force clear the queue, such as opening a new tab.

In the future, if throttling is more prevalent we could elect to
implement a TTL for items in the queue to ensure tabs don't remain
in the pending closure state indefinitely. One possible implementation
is to post a delayed task to wipe an event out of the queue X seconds
after it was added.

Fixed: 39592572
2025-05-13 15:53:09 -04:00
Artem Samoilenko 72060c50ff [cr137] [Android] Changes for saveOffline buttons move
Chromium change:
https://chromium.googlesource.com/chromium/src/+/a3b80168e9abfa063071cc10ab487300c708856f

[Toolbar] Moved click/longClick listeners for bookmark and saveOffline buttons to location bar classes.

* Moved onLongClick for saveOffline and bookmark button to LocationBarLayoutTablet since this has simple implementation.
* Moved onClick for saveOffline and bookmark button to LocationBarCoordinator

Change-Id: I4b97d9209fd04f761e93fe393efe7e0d10f6e0b9
2025-05-13 15:53:08 -04:00
Artem Samoilenko 9cf57ba954 [cr137] [Android] New c-tor signature for ShareDelegateImpl
Chromium change:
https://chromium.googlesource.com/chromium/src/+/d6fc64b0c520c603087467770350a864103ad69b

Check carma phase 2 compliance for OS share sheet

Not CaRMA-compliant car:
https://screenshot.googleplex.com/7SbvEDoQVUYzYnm.png
https://screenshot.googleplex.com/95yX9MypsMhGfU5.png
https://screenshot.googleplex.com/7tm6WS6QLwxX4xX.png

CaRMA-compliant car:
https://screencast.googleplex.com/cast/NTYwMDc2NDY2NjgzOTA0MHxkMzZhNmJiNC01MA

Bug: 408298815
2025-05-13 15:53:08 -04:00
Artem Samoilenko 1c3470e5c2 [cr137] [Android] Separate MultiInstanceManagerImpl
Chromium change:
https://chromium.googlesource.com/chromium/src/+/d3dce6ad13e0b436c737d4573f11caeb878773bb

[MetaClickHistoryNav] Separate MultiInstanceManagerImpl

Keeping abstract class in //chrome/browser/ui/android/multiwindow:java

Bug: 409631603
2025-05-13 15:53:08 -04:00
Artem Samoilenko d873e42e96 [cr137] [Android] Tabwindow moved code into its own module
Chromium change:
https://chromium.googlesource.com/chromium/src/+/d9712a373415d56b728f807a85613036c0115925

[MetaClickHistoryNav] Move tabwindow code into its own module

To remove TabModel's dependency on Multiwindow

Bug: 409631603
2025-05-13 15:53:01 -04:00
Artem Samoilenko 72b16cd130 [cr137] [Android] Refactor classes for improved TextViewWithClickableSpans
Chromium change:
https://chromium.googlesource.com/chromium/src/+/48018d01bf6f0ac186684a9fa73b6a98704ad9c9

Refactor classes for improved TextViewWithClickableSpans

The changes in this CL are preparation for updates in
https://chromium-review.googlesource.com/c/chromium/src/+/6383822.

Bug: 405441323
2025-05-13 15:53:00 -04:00
Artem Samoilenko 7a80025342 [cr137] [Android] Move ButtonData classes from chrome.browser.toolbar to chrome.browser.toolbar.optional_button package
Chromium change:
https://chromium.googlesource.com/chromium/src/+/dfdd24a54d2dc4d911e01f58571a34f4dd277ef5

[Toolbar] Move ButtonData classes from chrome.browser.toolbar to chrome.browser.toolbar.optional_button package.

Planning to create new "ToolbarButton*" classes to manage common code for different toolbar buttons and want to avoid naming confusion with optional button code

Bug: 409638002
2025-05-13 15:52:59 -04:00
Artem Samoilenko fec4844626 [cr137] [Android] Manually specify the next focusable view for the toolbar
Chromium change:
https://chromium.googlesource.com/chromium/src/+/48e1e29f376534ea3238fae1f160832f423712c7

[bookmarks] Manually specify the next focusable view for the toolbar

Bug: 394409324
2025-05-13 15:52:53 -04:00
Artem Samoilenko 345ab2b387 [cr137] [Android] New c-tor signature for StatusBarColorController
Chromium change:
https://chromium.googlesource.com/chromium/src/+/dae1cd5dc2d14f1eccdbc2dad82e4976e565930c

[Hub Animations] Rework Hub Overview Color Management

- No longer allow for changing toolbar color alpha. Instead we will
	only allow for changing hub overview color alpha
- HubColorMixer now manages alpha value mixing as well
- Renames some methods/members
- Fixes tablet status bar color blend (earlier, the status bar would
        not transition colors, and immediately change colors)
- Before this CL: https://drive.google.com/file/d/1U1aBw8-mlI5JPyJaB5gVMdz2w2L7GuTw/view?usp=drive_link&resourcekey=0-poF8KcXgU_MErCw7kf_XRg
- After this CL: https://drive.google.com/file/d/1XRZaJ3W4K_DtbUePT0ln6KKo1icZjNnN/view?usp=sharing&resourcekey=0-mDLQ4RODMIFGI1wBS9USHg

Bug: 395106107
2025-05-13 15:52:52 -04:00
Artem Samoilenko 8f22e635de [cr137] [Android] Changes for shared tab group updates dot
Chromium change:
https://chromium.googlesource.com/chromium/src/+/3210e58505dc5754b9b3a07829519085a7b0ac80

Add IPH for shared tab group updates dot.

Bug: 348733713
2025-05-13 15:52:50 -04:00
Artem Samoilenko 98eeb75eaa [cr137] [Android] Move tracking NTP tab creation to NewTabPageCreationTracker
Chromium change:
https://chromium.googlesource.com/chromium/src/+/d1d408af2fc44106621601a3b35942fdbe2e8cb0

Move tracking NTP tab creation to NewTabPageCreationTracker

This CL moves the tracking NTP tab creation from NewTabPageUma to a new
file NewTabPageCreationTracker.
Also replace the UserAction to a enum histogram that tracks the
TabLaunchType.

Bug: 408364837
2025-05-13 15:52:50 -04:00
Artem Samoilenko deb3ac4cde [cr137] [Android] Toolbar text box color rename
Chromium change:
https://chromium.googlesource.com/chromium/src/+/60bd853aed5f8599a5508a78e45665ddd042fc76

[Surface Color] Omnibox & toolbar

Light:
Toolbar: surface 0 -> surface
Omnibox bg: surface 4 -> surface container high

Dark:
Toolbar: Surface 0 -> Surface
Omnibox bg: surface 4 -> surface container highest

Before:
https://screenshot.googleplex.com/4dX62JRmShEBsBw
https://screenshot.googleplex.com/4B2SZSYpaF5pPBh

After:
https://screenshot.googleplex.com/9kFF4eMkD4FscZV
https://screenshot.googleplex.com/6jpDFSwPNBaWHgk

ChromeColors#getDefaultThemeColor, which is used for the toolbar bg, is already set to colorSurface.

Bug: 406890625
2025-05-13 15:52:47 -04:00
Artem Samoilenko 80995a7978 [cr137] [Android] Support back button animations
Chromium change:
https://chromium.googlesource.com/chromium/src/+/47e443a0bf7813c5e0830f68a751e2efa3bfc091

[Back Button] Support animations

This CL extracts animation related logic from ToolbarTablet into
back button MVC components.

Bug: 404478528
2025-05-13 15:52:46 -04:00
Artem Samoilenko 0ee138c8b9 [cr137] [Android] Remove snackbar that's shown when a bookmark is moved
Chromium change:
https://chromium.googlesource.com/chromium/src/+/0f05cddb6d915dd73f9c3cf4d12e0fc5b984b4d7

[bookmarks] Remove snackbar that's shown when a bookmark is moved

This snackbar isn't necessary as the acounted-ness of the bookmark
is properly conveyed in the BookmarkFolderPicker.

Bug: 399128838
2025-05-13 15:52:44 -04:00
Artem Samoilenko 3325826c66 [cr137][Android] C-tor signature change for TopToolbarCoordinator
Chromium change:
https://chromium.googlesource.com/chromium/src/+/754d173c43ec2d98025a07946e5296828dc239cb

[Reload Button] Add support to observe tab changes

Observe tab changes in the ReloadButtonMediator instead of
updating it from ToolbarManager. Reload state will change based
on the current tab and its loading and crashed states.

Reworked how reload button received updates from NTP. Previously
any component could change reloading state by calling public API.
Now we enforce NTP reloading state with ObservableSupplier
and keeping reloading state management in a single place.

Bug: 402347979
2025-05-13 15:52:44 -04:00
Serg 6eae86c1e5 Android remote keyed services (#28998)
* Fixes functions to retrieve remote for KeyedService factories

* Corrects an invalid handle handling in BraveNewsService on Android
2025-05-09 21:12:57 +02:00
aseren befb8cf6ab [ads] New Tab Takeover infobar fixes (#28986)
* [ads] Fixes New Tab Takeover infobar is displayed after it was closed by (X) button

* [ads] Do not show infobar if should_support_confirmations_for_non_rewards is false

* [ads] Do not display NTT infobar when user joined rewards

* [ads] Do not display Android NTT infobar when rewards is enabled

* [ads] NTT infobar code health

* Android presubmit fix

* [ads] NTT infobar preference code health
2025-05-09 02:41:41 +02:00
samartnik 704ed7a34c Merge pull request #28994 from brave/android_inline_pdf_fix
[Android] Fix for inline pdf feature
2025-05-08 15:25:04 -04:00
Artem Samoilenko 37c6ed9190 [Android] Fix for inline pdf feature 2025-05-08 10:42:50 -04:00
Simone Arpe 7850105ddd (Wallet) Implement ZCash support on Android Wallet (#28883)
* Add required string for Android

* Perform small refactoring

* Introduce support for ZCash Mainnet and Testnet

* Implement logic to extract Zec data

* Improve fragment transaction UI

* Apply code formatting

* Switch ApproveTxBottomSheetDialogFragment to NullAway annotations

* Switch TxDetailsFragment to NullAway annotations

* Rename variable

* Switch SiweMessageFragment to NullAway annotations

* Switch AssetUtils to NullAway annotations

* Switch Utils to NullAway annotations

Removes unused methods and strings.
Adds missing ZCash vector asset.

* Switch ParsedTransaction to NullAway annotations

* Switch ParsedTransactionFees to NullAway annotations

* Remove unused parameters from methods and constructors

* Switch ApproveTxFragmentPageAdapter to NullAway annotations

* Switch TxFragment to NullAway annotations

* Introduce assert instead of throwing

* Add ZCash vector asset

* Extract Zec data into proper field
2025-05-07 20:01:03 +02:00
Serg d2da9de948 Fixes a crash when Brave News service cannot be created in case of OTR profile (#28960)
* Fixes a crash when Brave News service cannot be created in case of private profile
2025-05-06 20:00:08 +02:00
Serg f1ad88184f Android presubmit exceptions (#28912)
* Adds exceptions for registerOnSharedPreferenceChangeListener and unregisterOnSharedPreferenceChangeListener calls

* Adds BraveActivity and BraveNewTabPageLayout to NullAway presubmit exceptions
2025-05-02 03:10:31 +02:00
AlexeyBarabash 80ab3c0e98 Revert of 'Fix some android shared pref warnings #28679' (#28844)
* Revert "Fix some android shared pref warnings (#28679)"

This reverts commit d6cc885db2.
2025-04-26 12:46:13 +02:00
aseren faeca0afd9 [ads] NTT reporting infobar notice (#28203) 2025-04-25 12:01:33 -05:00
Serg e59261e886 Retrieve BraveNewsService by profile (#28783)
* Passes profile from Java to BraveNewsController factory. Removes BraveNewsController member from BraveActivity.
2025-04-24 20:20:27 -04:00
aseren 1ff768b451 [ads] Add New Tab Takeover Learn More link in settings (#28597) 2025-04-24 16:22:21 -05:00
AlexeyBarabash d6cc885db2 Fix some android shared pref warnings (#28679)
* Fixed SharedPreferencesManager presubmit warning at AppearancePreferences.java

* Fixed SharedPreferencesManager presubmit warning at BraveHubManagerImpl.java

* Fixed SharedPreferencesManager presubmit warning at BraveHubToolbarView.java

* Got rid of SharedPreferences.Editor

* Fixed circular dependency by moving //brave/browser/hub/internal:java into brave_chrome_java_deps, codereview notice
2025-04-24 22:55:56 +03:00
Deep Pandya 1a08762a2d Add a separate target for quick search engine feature (#26478)
* Move java classes into brave/browser for quick_search_engines

* Move serach_engines resources to brave/browser/search_engines

* Add translations files for search_engines android string

* Add dimens

Add a function to load favicons

* Add close menu id for quick search

* Add missing deps

* Move quick search engines changes to brave/browser/quick_search_engines

* Remove comments for BUILD.gn
2025-04-23 17:00:28 -04:00
Deep Pandya 53ba9ecc1d Add patch to remove chromium search widget (#28753)
* Add patch to remove chromium search widget

* Add lint suppression for search widget
2025-04-23 10:38:26 -04:00
Brian Johnson c4b7397068 remove unused ProfileUtils (#28588) 2025-04-22 11:01:26 -07:00
Deep Pandya 2ac20d220d Make auto reconnect warning text to Invisible (#28716)
* Make auto reconnect warning text to Invisible

* Calculate height dynamically for warning textview
2025-04-21 14:10:52 -04:00
AlexeyBarabashandArtem Samoilenko 29a7bfd427 [Android] Wait for native initialization when creating bottom strip (#28728)
* [cr137] [Android] Wait for native initialization when creating bottom strip

Chromium change:
https://chromium.googlesource.com/chromium/src/+/ea006a988d2a36db0eb25801e1c02e9c6e9f5b86

[Tab Group UI] Wait for native initialization when creating bottom strip

Wait for native initialization to complete before initializing the
bottom tab strip. Otherwise it will try to initialize pre-native and
crash. This appears to have regressed in M134/M135 likely due to some
lifecycle change for the BottomControlsCoordinator.

Fixed: 407305088

* Suppressed warning around ContextUtils.getAppSharedPreferences()

---------

Co-authored-by: Artem Samoilenko <artem@brave.com>
2025-04-18 13:50:22 +03:00
AlexeyBarabash af6a913380 Fixed some NullAway Java presubmit warnings and suppressed some others (#28726)
* Fixed some NullAway Java warnings and suppressed some others

* Suppressed warning around ContextUtils.getAppSharedPreferences()
because we cannot depend on //chrome from //base to use ChromeSharedPreferences

Fixes brave/brave-browser#45541
2025-04-18 11:57:03 +03:00
AlexeyBarabash b25c92b87c [cr136][Android] Fixed some NullAway warnings
There still many unfixed files:
  android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/BraveIncognitoTabSwitcherPane.java
  android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/BraveTabGroupUiCoordinator.java
  android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/BraveTabSwitcherPaneBase.java
  android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerCoordinator.java
  android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerMediator.java
  android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkToolbarCoordinator.java
  android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkUtils.java
  android/java/org/chromium/chrome/browser/customtabs/FullScreenCustomTabActivity.java
  android/java/org/chromium/chrome/browser/customtabs/FullScreenCustomTabRootUiCoordinator.java
  android/java/org/chromium/chrome/browser/firstrun/WelcomeOnboardingActivity.java
  android/java/org/chromium/chrome/browser/settings/AppearancePreferences.java
  android/java/org/chromium/chrome/browser/suggestions/tile/BraveMostVisitedTilesLayoutBase.java
  android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java
  android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java
  android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsCoordinator.java
  android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java
  android/java/org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator.java
  browser/hub/internal/android/java/src/org/chromium/chrome/browser/hub/BraveHubManagerImpl.java
  browser/hub/internal/android/java/src/org/chromium/chrome/browser/hub/BraveHubToolbarView.java

They are not fixed because they are waiting for the upstream's counterparts to be fixed.
See exclusions at _CheckAndroidNullAwayAnnotatedClasses at src/PRESUBMIT.py

Related Chromium issue:
https://issues.chromium.org/issues/389129271

	Add @NullMarked to all .java Files
2025-04-16 09:30:33 +01:00
AlexeyBarabash 72b40f7798 [cr136][Android] Removed tab_resumption_module_container_stub layout
Related Chromium changes:
https://source.chromium.org/chromium/chromium/src/+/f8de93495c1d5e041d25dfd02d60f03ff1fabeed

	[Android TRM] Remove R.id.tab_resumption_module_container_stub.

	In crrev.com/c/5297855, the Tab Resumption Module was integrated into
	the Magic Stack. Therefore it no longer needs the ViewStub
	R.id.tab_resumption_module_container_stub as the top level layout, but
	it still lingers. This CL deletes the now useless ViewStub.

	Bug: 1515325
	Change-Id: I358b64ef57c267629230578cf8dc5b28af3d7dfc
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5734353

https://source.chromium.org/chromium/chromium/src/+/28cde898edae21f1b807d3e0e43d62701837ac7a

	[Android TRM] Remove feature and most of the code.

	This CL removes the Android Tab Resumption Module:
	* Remove chrome/browser/tab_resumption.
	* Remove flags and configs.
	* Remove 5 UI strings: IDS_TAB_RESUMPTION_MODULE_*,
	  IDS_N_{MINUTES,HOURS}_AGO_NARROW.
	* Remove resources.

	Need to keep for metrics:
	* tools/metrics/histograms/enums.xml entry.

	Out of scope of this CL; TODO in follow-ups:
	* NTP Customization features and tests involving the TRM (will remove in
	  follow-up).
	* Keep IDS_TAB_RESUMPTION_MODULE_SEE_MORE "See more": This got reused by
	  Tab Switcher.
	* Keep IDS_HOME_MODULES_TAB_RESUMPTION_TITLE "Continue with this tab" /
	  "Continue with these tabs": Used by Single Tab Module.

	Unaffected:
	* TRM still exists on Desktop and iOS. Tab data sync from Android
	  continue to work same as before.

	Bug: 400479323, 400479745
	Change-Id: I38cc101c361c761d38dff931b7ab6d15960836fa
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6408054
2025-04-16 09:30:32 +01:00
AlexeyBarabash 81f498fda7 [cr136][Android] AddressBarSettingsFragment.getTitleWithoutSpans changed to getTitle
Span is removed from string resources

Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/1e81dd10e119a703070d54f37110dfa106916c44

	Add "new" label to the "Appearance" settings menu option.

	This CL adds a "new" label to the "Appearance" settings menu option. The
	label is only conditionally added using the same heuristics as are
	currently used for the existing "Address bar" settings menu option.

	This CL also makes "new" label support more generic so that it can power
	both "Address bar" and "Appearance" settings menu options as well as any
	new settings menu options in the future.

	Design: http://shortn/_oxzSbwNuTe
2025-04-16 09:30:31 +01:00