Commit Graph
262 Commits
Author SHA1 Message Date
Serg 1415725462 An attempt to fix a crash on template_url_service pointer access on Android (#28448)
* An attempt to fix a crash on template_url_service pointer access on Android
2025-04-01 21:54:34 -04:00
AlexeyBarabash 94b880c97f Revert 'Disable refresh of Brave Leo at the panel #21117' (#28369)
Revert 'Disable refresh of Brave Leo at the panel #21117'; fixes brave/brave-browser#45026
2025-04-01 18:39:15 +03:00
Deep Pandya 2ad51c8065 Remove chrome widgets (#27724)
* Remove chrome widgets

Add bytecode changes for quick action search widget

* Add patch to remove chrome widgets from manifest

* Add bytecode tests for method exists

* Update AndroidManifest patch

* Add lint suppression for R.drawable.hairline_border

* Update Bytecode test

* Add classes to apk_for_test

* Add QuickActionSearchWidgetProviderDino test flag

Add QuickActionSearchWidgetProviderSearch test flag
2025-03-31 18:34:40 +02:00
Deep Pandya f521eb37d2 Fix the CustomTabActivity freezing issue caused by touch events (#28374)
* Fix the CustomTabActivity freezing issue caused by touch events being blocked during the enter animation.

* Add supression for unused variable
2025-03-28 21:54:21 -04:00
Artem Samoilenko 152d7a4103 [Android] Additional improvements for bottom address bar
- Moved address bar to bottom on NTP
- Moved menu and updated menu icons and texts
- Added request for relaunch when bottom navigation controls are enabled
- UI and visual improvements
2025-03-27 09:11:22 -04:00
Simone Arpe ca2dd2319d Modify Chromium files to fix PIP behavior (#27849) 2025-03-19 19:46:21 +01:00
Artem Samoilenko eaf84bbfbf [Android] Remove unused bytecode tests 2025-03-18 20:02:22 -04:00
Artem Samoilenko c166457a82 [Android] Extract manager opening logic to interface/impl
Chromium change:
https://chromium.googlesource.com/chromium/src/+/65edd13188a0eb01fa8e1140b7489a40ee517d52

[bookmarks] Extract manager opening logic to interface/impl

The implementation of this interface can't be modularized. Extracting
the BookmarkUtils methods to an interface/impl combo which can
be used by classes in the bookamrks module.

Bug: 395908100
2025-03-18 20:02:15 -04:00
Artem Samoilenko 9955c91430 [Android] Remove unused proguard rule 2025-03-18 20:02:12 -04:00
Artem Samoilenko e32e2442f4 [Android] Fix for search widget suggestions
Removed obsolete check that blocked upstream's code execution.
2025-03-05 09:49:32 -05:00
Deep Pandya a5c0b652be Rewards 3.0 android (#26945)
* Add rewards 3.0 feature flag

* Add a function to check for rewards 3.0 flag

Update entry points for rewards with rewards 3.0 flag

* Add RewardsPageActivity/RewardsCustomTabRootUiCoordinator to show rewards 3.0 changes in custom tab

* Address rewards reset for rewards 3.0

* Add activity transition for rewards page

* Remove onBackPressed override

* Add close button to close the rewards panel as we have disabled back press

Update close button position on the page

* Add creator changes for rewards 3.0

Remove logs

Add null check

Remove changes for backpress

* Add changes for handling creators

Encode Url for creators

* Add open url native fucntion

* Add bubble in query params

* Add bytecode changes for BaseCustomTabActivity

Add native function to open url into rewards_page_ui

* Update copyright header year

* Update close icon for rewards page

Remove comments and refactor changes

* Address naming related changes

* Add test for bytecode changes

Resolve rebase error

* Update changes to use TabUtils open tab

* Remove close button

* Add FullScreenCustomTabActivity
2025-02-22 16:34:57 -05:00
Kamil Jozwiak d1a8ace419 Merge pull request #27172 from brave/cr134
Upgrade from Chromium 133 to Chromium 134
2025-02-18 12:39:34 -05:00
AlexeyBarabash 38a78eb167 [cr134] [Android] ScrimManager instead of ScrimCoordinator
Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/723933f990282b9f4c91d2467ef61b52f292b775

	Creates empty ScrimManager and replace all call sites.

	There should be no functional changes in this. Purely a rename to an
	empty/passthrough super class.

	Bug: 371034867
	Change-Id: I3be1d481c176303545baf831d05db53634a74809
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6219602
2025-02-18 12:46:58 +00:00
Artem Samoilenko f845c3713d [Android] Enforce full method signature check for bytecode tests 2025-02-17 15:33:18 -05:00
Artem Samoilenko 96bd9e01db [Android] Fix for bottom controls visibility in landscape mode
This is a regression from C132 https://chromium.googlesource.com/chromium/src/+/8c7ff112c0ebadc79c298d02acc0082cb560e6ec
2025-02-12 13:29:52 -05:00
Artem Samoilenko cc8c69c7ec [Android] Clean up for UnusedMethod and UnusedVariable lint errors 2025-01-27 09:36:40 -05:00
Serg 1c166f181d Allows to use a microphone for Brave Talk in the background on Android 2024-12-16 13:01:10 -05:00
Serg f840803a0f Adds extra check on ViewProvider class methods in bytecode tests on Android 2024-12-06 11:26:41 -05:00
Serg eb7b4b663b Runs Brave Talk page via a foreground service to prevent audio cut off when Brave is in the background on Android 2024-12-04 10:42:41 -05:00
AlexeyBarabash e7bd3a860e [cr132][Android] Use BottomUiThemeColorProvider for TabGroupUI
TabGroupUiCoordinator.ctor and TabManagementDelegate.createTabGroupUi:
- removed incognitoStateProvider;
- added themeColorProvider.

IncognitoStateProvider / IncognitoStateObserver code at BraveTabGroupUiCoordinator
now does not affect on toolbar color at incognito code, and the code was removed.

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/3468d618873a1bb1ee72fc5c2ca068597f24c7c8

	[Anchor] Use BottomUiThemeColorProvider for TabGroupUI

	For a top-anchored toolbar, this should be non user-visible. Under
	the hood, TabGroupUi doesn't need to explicitly track incognito
	state and instead just takes the colors it's given.
	For a bottom-anchored toolbar, this results in a TabGroup toolbar
	and chin with color and tint matching the toolbar's.

	Bug: 369133954
	Change-Id: I82532e122541c8a20c08c9110fa46e938a4104a4
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5983743
2024-12-01 08:43:44 -05:00
Artem Samoilenko a45719da83 [Android] Deprecate tab_groups package
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/65eee63c0e75ebd343c409a7c14addb00ca4b6dd

[Tab Model] Deprecate tab_groups package

Merge the tab_groups/ package into tabmodel/. The two packages have
significant overlap and should really have a lot of their logic merged
anyway.

This allows us to package protect TabGroupModelFilterInternal and make
destroy method package private as well.

Fixed: 372068933
2024-10-24 12:14:34 +01:00
Artem Samoilenko a8aa9adb60 [Android] Fixes for bytecode unit tests 2024-10-24 12:14:32 +01:00
Artem Samoilenko 2a4f95de3a [Android] Move base.cached_flags to components.cached_flags
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/78b03df18d4625181de54bf6a7efa805c20b367d

Move base.cached_flags to components.cached_flags

We will need to depend on components/variations to support
fieldtrial_testing_config.json.

Since base can't use cached flags, and many clients of base won't
either, it makes more sense to put it in components.

Bug: 370797986
2024-10-24 12:14:32 +01:00
Artem Samoilenko 8604da3db1 [Android] Adopt ServiceLoaderUtil for CustomizationProviderDelegate
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/2c57ce7d0331365cdf349f90451fb1379a5778ab

Adopt ServiceLoaderUtil for CustomizationProviderDelegate

Needs to wait for crrev.com/i/7702286 before landing.

Cq-Include-Trybots: luci.chrome.try:android-internal-binary-size
Bug: 40901855
2024-10-24 12:14:30 +01:00
Artem Samoilenko 120ba02dbe [Android] Adopt ServiceLoaderUtil for LanguageProfileDelegate
Upstream's logic in `AppLocaleUtils` for `getApplicationLocales` and `setApplicationLocales` is the same as it was in our patch, so we don't need it anymore.

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/826aadf32e2ebec6a4086d97937f345ea5f3f912

Android: Adopt ServiceLoaderUtil for LanguageProfileDelegate

And upstreams & inlines the logic from LocaleManagerDelegate, which
existed only to work around Android T SDK not yet being available.

Also adds some @JniType annotations to LanguageBridge to simplify
changes there.

Bug: 40901855
2024-10-24 12:14:28 +01:00
Artem Samoilenko 28b95d7267 [Android] Use ServiceLoaderUtil with AppHooks
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/21849f23ddc564a43b12c209f88cb96621c21040

Use ServiceLoaderUtil with AppHooks

Bug: 40901855
2024-10-24 12:14:27 +01:00
Jagadesh P 2b2ed3785d [Android] Use reflection to call |showUndoBar| in |UndoBarController| by having |BraveUndoBarControllerBase| as super to |UndoBarController|.
Add byte code test for |showUndoBar| method existence and remove the unrequired patch.
2024-10-21 00:00:39 -07:00
AlexeyBarabash 0939827f8f Fixed navigation bar color at private tab (#25923)
* Fixed navigation bar color at private tab; fixes brave/brave-browser#41545

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/52962da478ed750038f966c386c4ee0ff2d73837

Always apply luminance calculation to navigation bar icons

Currently, the navigation bar icons only respond to the color of the navigation bar during animations. Since animations are being disabled for the navbar coloring experiment, it's important that the luminance calculation to properly color the navigation bar icons is applied all the time, not just during animations.

Bug: 364228106, 40925025
2024-10-11 17:17:14 +03:00
AlexeyBarabash 2d17527690 Fixed crash at Content Filtering (#25812)
fixes https://github.com/brave/brave-browser/issues/41402

Crash happened at app menu => Settings => Brave Shields & privacy => Content Filtering.

Tombstone
```
java.lang.ClassCastException: org.chromium.chrome.browser.settings.SettingsActivity cannot be cast to org.chromium.chrome.browser.settings.BraveSettingsActivity
at org.chromium.chrome.browser.shields.ContentFilteringFragment.onAttach(ContentFilteringFragment.java:86)
```

Upstream had added a new place to create Intent for Settings activity.

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

	[Settings] Introduce a central place to construct intents

	SettingsIntentUtil becomes the central place to construct intents
	launching the settings activity.

	Bug: b/356743945
	Change-Id: Id6988af4a182fe6603bb02c9dae8b2ac48f80fed
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5832868
2024-10-04 21:38:23 +03:00
Artem Samoilenko 24f2fc8fcb [Android] Fix for navigation bar colors
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/52962da478ed750038f966c386c4ee0ff2d73837

Always apply luminance calculation to navigation bar icons

Currently, the navigation bar icons only respond to the color of the navigation bar during animations. Since animations are being disabled for the navbar coloring experiment, it's important that the luminance calculation to properly color the navigation bar icons is applied all the time, not just during animations.

Bug: 364228106, 40925025
2024-10-03 17:06:30 +01:00
AlexeyBarabash fca5e8addf [Android] LocationBarMediator.mShouldClearOmniboxOnFocus was removed
"RetainOmniboxOnFocus" feature is used instead

Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/46147680fe334aeec900ec6d76c8b9e443d07452

	Adds flag-guarded support for retaining omnibox on focus.

	This CL adds flag-guarded support for retaining omnibox contents on
	focus (as opposed to clearing it). When enabled, omnibox contents will
	also be fully selected (to allow for quick replace) and zero-prefixed
	suggestions are still shown (to allow for quick search). When enabled,
	only devices with large screens, attached keyboards, and attached
	precision pointers are affected.

	Design doc: http://shortn/_g7JfqshAX0

	Before:
	* google.com: http://shortn/_QQDvhI44dH
	* NTP w/o paste: http://shortn/_RowwKkjjGM
	* NTP w/ paste: http://shortn/_9Im63Fv4Ep

	After:
	* google.com: http://shortn/_29TqnQpVQE
	* NTP w/o paste: http://shortn/_whJqKzcDnv
	* NTP w/ paste: http://shortn/_ZnBOkVUvrU

	Bug: 347632178
	Change-Id: I8c8ceffa766ff7c960f122241ae3fb2efe3654c6
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5804846
2024-10-03 17:06:28 +01:00
AlexeyBarabash fc1686a7af [Android] TranslateCompactInfoBar class was removed
(Verified the transalte infobar bubble is still shown)

Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/333ffb2d4a93d2ce9e9a5fabdf1e593d6d062e9d

	Remove and clean up old Translate Infobar code. Leaving translate_infobar_delegate because there are still iOS dependencies attached.

	Fixed: 353735844
	Bug: 40213244
	Change-Id: Ief6abe1485ef372f1ac44426b1edeb3b69b89208
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5727132
2024-10-03 17:06:28 +01:00
AlexeyBarabash 8e49e11cfb [Android] Removed snackbarManager arg from ToolbarManager.ctor
Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/de54cb9a2c9a0c5e5e28636493a51ac8db18305e

	Remove unused snackbar manager param.

	Change-Id: I95b80fc611d871fd3c9441a8f79776fce8cbcf9f
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5805249
2024-10-03 17:06:19 +01:00
Artem Samoilenko 388af16a52 [Android] Removed obsolete override for ReturnToChromeUtil#shouldShowTabSwitcher
It was only used in `ReturnToChromeUtil#shouldShowNtpAsHomeSurfaceAtStartup` that we explicitly disable now. So no need in this override anymore.
2024-10-02 16:04:57 -04:00
Artem Samoilenko 74b3cfb687 [Android] Disable NTP at start up 2024-10-02 12:21:32 -04:00
Artem Samoilenko 888162c66b [Android] NotificationPlatformBridge.prepareNotificationBuilder became static
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/af4a1a29660d0cfa1ed074d69f782abc9f79fd98

Make NotificationPlatformBridge less native-dependent (3/5).

Mark as `static` several helper methods in `NotificationPlatformBridge`. This is in preparation to enable calling methods like `displayProvisionallyUnsubscribedNotification` without an instance of
`NotificationPlatformBridge` existing, which requires native
libraries to be loaded.

As these methods already access no instance variables, there should be no functional changes.
2024-09-10 14:42:48 -04:00
Artem Samoilenko dceb054522 [Android] Fixes for bytecode tests 2024-09-10 14:42:36 -04:00
AlexeyBarabash 25d8bfd411 Enable constructorsMatch test for BraveLogoMediator (#25322)
Fixes brave/brave-browser#40672
2024-08-26 17:55:26 +02:00
AlexeyBarabash 740ffcd7b2 [Android] Fix incognito switcher icon (#25291)
* [Android] Fixed incognito icon at tab switcher; fixes brave/brave-browser#40584
2024-08-25 14:09:27 +03:00
AlexeyBarabash 77076b739d [Android] 2nd follow-up for cr128 GP top crash (#25254)
* Revert "[Android] Follow-up for cr128 top GP crash (#25191)"

This reverts commit a7407de42a.

* Revert "[Android] Fix crash after cr128 upgrade at TabSwitcherPaneCoordinator (#25130)"

This reverts commit 68bc172dee.

* [Android] Follow-up with incognito tabs for Fix for crash after cr128 upgrade when pressing back at tab switcher

Fixes brave/brave-browser#40581
2024-08-21 21:09:35 +03:00
AlexeyBarabash 68bc172dee [Android] Fix crash after cr128 upgrade at TabSwitcherPaneCoordinator (#25130)
* [Android] Fix for crash after cr128 upgrade when pressing back at tab switcher

Forced invoke of `createTabSwitcherPaneCoordinator` before `TabSwitcherPaneBase.requestAnimationData()` to avoid null access crash.

Fixes brave/brave-browser#40422
2024-08-15 17:41:38 +03:00
AlexeyBarabash c74e229478 Removed patch for ToolbarManager.ConstraintsProxy; removed asm patch for BraveToolbarManager.mConstraintsProxy 2024-08-07 21:32:00 -04:00
AlexeyBarabash f6c8b190a1 Fixed url bar left padding
Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/7c065994b4014bb6e352c90c1df8e4e1a2bc1e83

	[SurfacePolish][CleanUp] Clean up surface polish code related to toolbar and real omnibox appearance.

	This CL cleans up code related to the toolbar and real omnibox
	appearance, including color, icon background, hint text typeface, and
	button end margin. This CL does not include the change in animation.
	Additionally, it makes a small adjustment to the size of the Google icon
	background in the real omnibox.
	Here is a comparison:
	Original: https://drive.google.com/file/d/1ZAu3svqTXe0bjABFgudgv8XnZNO_fph6/view?usp=sharing&resourcekey=0-Rxyvdlg9na3n-M1Jd9VNKQ
	After this CL:
	https://drive.google.com/file/d/1zBX-rTgUz2VNHwHp9NMBIaVklx-VSaol/view?usp=sharing&resourcekey=0--L7FH_jIss1VFlauBEMFVQ

	Bug: 331667743
	Change-Id: I863d9e333fe21509f92f05da73a13d3070fc3bfe
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5688899
2024-08-07 21:31:55 -04:00
AlexeyBarabash 42194fc146 Fixed toolbar background color
Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/7c065994b4014bb6e352c90c1df8e4e1a2bc1e83

[SurfacePolish][CleanUp] Clean up surface polish code related to toolbar and real omnibox appearance.

	This CL cleans up code related to the toolbar and real omnibox
	appearance, including color, icon background, hint text typeface, and
	button end margin. This CL does not include the change in animation.
	Additionally, it makes a small adjustment to the size of the Google icon
	background in the real omnibox.
	Here is a comparison:
	Original: https://drive.google.com/file/d/1ZAu3svqTXe0bjABFgudgv8XnZNO_fph6/view?usp=sharing&resourcekey=0-Rxyvdlg9na3n-M1Jd9VNKQ
	After this CL:
	https://drive.google.com/file/d/1zBX-rTgUz2VNHwHp9NMBIaVklx-VSaol/view?usp=sharing&resourcekey=0--L7FH_jIss1VFlauBEMFVQ

	Bug: 331667743
	Change-Id: I863d9e333fe21509f92f05da73a13d3070fc3bfe
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5688899
2024-08-07 21:31:50 -04:00
AlexeyBarabash 1ed00981f1 Fixed status bar color
Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/f95b49f9885aedcae7091d78c21596545618d678

	[SurfacePolish][CleanUp] Clean up surface polish code related to status bar.

	This CL cleans up code related to the status bar.

	Bug: 331667743
	Change-Id: I102092a03a22fc962362831f31bc2e32bfcdc562
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5697546
2024-08-07 21:31:50 -04:00
AlexeyBarabash dbc3626698 Fix orange opaque address bar.
Set ToolbarPhone.mLocationBarBackgroundColorForNtp with non-opaque regular color.

Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/7c065994b4014bb6e352c90c1df8e4e1a2bc1e83

	[SurfacePolish][CleanUp] Clean up surface polish code related to toolbar and real omnibox appearance.

	This CL cleans up code related to the toolbar and real omnibox
	appearance, including color, icon background, hint text typeface, and
	button end margin. This CL does not include the change in animation.
	Additionally, it makes a small adjustment to the size of the Google icon
	background in the real omnibox.
	Here is a comparison:
	Original: https://drive.google.com/file/d/1ZAu3svqTXe0bjABFgudgv8XnZNO_fph6/view?usp=sharing&resourcekey=0-Rxyvdlg9na3n-M1Jd9VNKQ
	After this CL:
	https://drive.google.com/file/d/1zBX-rTgUz2VNHwHp9NMBIaVklx-VSaol/view?usp=sharing&resourcekey=0--L7FH_jIss1VFlauBEMFVQ

	Bug: 331667743
	Change-Id: I863d9e333fe21509f92f05da73a13d3070fc3bfe
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5688899
2024-08-07 21:31:43 -04:00
AlexeyBarabash d654d564ce Returned back BraveToolbarManager after accidental remove 2024-08-07 21:31:34 -04:00
Artem Samoilenko f295edd810 [Android] Adjustments for the new tab switcher UI
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/c717fb07aed0f4756b9306ae0e55fa8f897bb1dc

[Hub] Cleanup legacy tab switcher code in toolbar

The feature flag controlling Hub was removed and isHubEnabled defaults
to true. Tests were already updated see:
https://chromium-review.googlesource.com/c/chromium/src/+/5634047

Toolbar no longer has a tab switcher mode as the toolbar is now
overlaid when the Hub is visible. Remove the legacy toolbar code related
to this now deprecated UI.

This is a follow up to
https://chromium-review.googlesource.com/c/chromium/src/+/5666417
which removed the StartSurface related code and significantly simplified
this cleanup.

Fixed: 350704312
2024-08-07 21:31:32 -04:00
AlexeyBarabash c46e278a41 Proper parameter for constraintsSupplier args for BottomControlsCoordinator.ctor
Java asm patch for ToolbarManager.mConstraintsProxy
One direct patch is still remaining to expose nested private class

Improved patch around ToolbarManager.mConstraintsProxy
2024-08-07 21:31:31 -04:00
AlexeyBarabash b05553d90c Removed ToolbarManager.mShowStartSurfaceSupplier
Related Chromium change
https://source.chromium.org/chromium/chromium/src/+/76dc0890ae54c50d706857f7dbeb99076a4f07b1

	[Start] Clean up ToolbarManager and ToolbarLayout|Phone.

	In this CL, the followings are cleaned up:
	1) ToolbarManager: anything related to Start surface;
	2) ToolbarPhone: both |mIsShowingStartSurfaceHomepage| and
	   |mIsShowingStartSurfaceTabSwitcher| are always false. Remove both
	   and usages.
	3) ToolbarPhone#isLocationBarShownInGeneralNtpOrStartSurface() is
	   replaced by isLocationBarShownInGeneralNtp(), since "surface
	   polish" has enabled by default.
	4) ToolbarLayout#onStartSurfaceStateChanged(): remove this orphan
	   method.

	Bug: 344651414, 40221888, 40834987
	Change-Id: I089d6c8c5390477d305ea377bd2b6c0e97034ff0
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5675441
2024-08-07 21:31:31 -04:00