Commit Graph
67 Commits
Author SHA1 Message Date
samartnik 770ffce1bf [Android] Added option that controls url bar suggestions 2022-01-07 20:17:03 -05:00
samartnik 86959248bf [Android] Reorganized code to avoid patching for bytecode warnings
This reverts previous commit:

[Android] Filter warning after bytecode pacthing
With new R8 library there is a warning related to our bytecode patching:
Warning: Missing method void Lg2.d() (referenced from: void Vf2.run())

Without obfuscation it looks like this:
Warning: Missing method void org.chromium.chrome.browser.toolbar.ToolbarManager.$invoke$special$updateButtonStatus() (referenced from: void org.chromium.chrome.browser.toolbar.ToolbarManager$$ExternalSyntheticLambda3.run())

We do change invoke special to invoke virtual for this method and this is expected.

Chromium change:
chromium/chromium@e3db48a

Android: Stop disabling R8's allowaccessmodification -keep semantics
Causes a 5.5kb regression, but brings us closer to stock R8, and will
ensure visibility of test @rule fields are not changed, thus avoiding
bugs like bug 1265431.

Bug: 1265431
2021-12-07 14:45:58 -05:00
samartnik fc713f6102 [Android] Changes for FeedSurfaceCoordinator
Chromium change:
https://github.com/chromium/chromium/commit/902c97b0859b9a0126bc6dfd5f1b0f5e3897a031

feed modularization: move ntp.snippets to feed.sections
Also:
* removed the obsolete '!mHasHeader' logic in start
  surface.
* Moved creation of section header view into
  FeedSurfaceCoordinator.

Bug: 1254437
2021-12-07 14:45:11 -05:00
samartnik ec4506cca7 [Android] Adjusted position for autofill suggestions 2021-11-19 13:14:00 -05:00
samartnik 7c57d3b276 [Android] Fixes for new tab overview theme
Chromium change:
https://github.com/chromium/chromium/commit/b364155d8f3c7e0085f510d7d0c6b9f5c9cf0a0a

Enable ThemeRefactorAndroid by default.
Bug: 1251194
2021-11-02 12:38:04 -04:00
samartnik 594ca313a1 [Android] Added proguard rules for tests 2021-10-04 17:05:23 -04:00
wchen342 d21977e52d patch and bytecode test fixes 2021-09-27 21:40:21 +03:00
samartnik 1bafd71181 [Android] Added option to disable sharing hub 2021-09-24 16:41:56 -04:00
samartnik 0b57ee430d [Android] Changes for toolbar color retrieval
Chromium change:
https://chromium.googlesource.com/chromium/src/+/020d9a658e7ae62272fcbcf66868c51c13b9779b

Update omnibox with dynamic colors

This CL updates methods that provide the primary color or the background
in utility classes such as ChromeColors and ThemeUtils to use Context
instead of Resources.

Bug: 1217157
2021-09-13 14:53:32 -04:00
samartnik 00e36dd2b7 [Android] Disabled menu animation 2021-08-25 19:38:06 -04:00
AlexeyBarabash 8cd2b2af40 Fix tests on Android caused by regression PR9799; fixes brave/brave-browser#17693 2021-08-25 17:54:27 +03:00
samartnik 0021d75620 [Android] Changes for modularized toolbar
Additionaly fixed:
- c-tor signatures for various classes
- explicitly added header for network::ResourceRequest

Chromuim change:
https://chromium.googlesource.com/chromium/src/+/2c6cbee37831bffa83494c98eca09a8ca9def489

Modularize toolbar/

Moves the files in chrome/browser/toolbar (except some glue code) and
related resources to chrome/browser/ui/android/toolbar.

Bug: 1127732
2021-08-18 10:58:37 -04:00
samartnik 866683157a [Android] Changes for MenuButton implementation
Chromium change:
https://chromium.googlesource.com/chromium/src/+/4a6f627495111794c56c46873349521bcc9b5b22

Toolbar: Remove deps on chrome/browser/omaha

This CL applies some refactoring around toolbar/omaha in preparation
for toolbar modularization:

- Moves menu button/ui/item state definitions from
   c.b.omaha.UpdateMenuItemHelper to toolbar/menu_button
- Inject MenuButtonState supplier to MenuButton MVC instead of
   the components calling UpdateMenuItemHelper directly

Bug: 1127732
2021-08-18 10:57:07 -04:00
samartnik e3ebbace0e [Android] Java code adjustments
Mostly related to changes for various c-tor signatures.
2021-08-18 10:57:06 -04:00
samartnik 7ddb2c4fe4 [Android] Omnibox was modularized
Chromium change:
https://chromium.googlesource.com/chromium/src/+/385121b715b153153f7626baf728cbd588250ff7

Android: Modularize omnibox/

Moves the files in chrome/browser/omnibox and related resources to
a new modularized target under chrome/browser/ui/android/omnibox.

Bug: 1171512
2021-08-18 10:53:16 -04:00
samartnik e762e35637 [Android] Adjustments for FeedSurfaceCoordinator code changes
Chromium change:
https://chromium.googlesource.com/chromium/src/+/c84e15f86da8a6f00920d4dd03087cc88b8970f5

More feed launch reliability logging

* Log the "feed reloading" start event
* Log a catch-all launch end event when the stream is unbound: more specific feed launch end conditions (user navigated away, switched tabs/apps, etc.) will be added in another CL
* Use no-op logger in public builds or if reliability logging is disabled

Bug: 1195940
2021-08-18 10:53:08 -04:00
samartnik 716dfe83f4 [Android] Fix for tab switcher mode in stack layout
Stack layout in not taken into consideration in Chromium anymore and
unintendedly was broken by the following change:

https://chromium.googlesource.com/chromium/src/+/dc3038ca3e29694ab91dfc1832ff7b337489fcfa

Fix tab switcher button not working in a11y mode

This patch is a temporary fix while grid tab switcher is in the process
of being launched. Previously, accessibility mode was one of the cases
where the grid was not created. This poses a problem since the a11y
mode can change without the activity restarting. This patch removes the
a11y check for creating the grid and adds a special case to the
overview showing logic in ChromeTabbedActivity to handle this.

Bug: 1200727
2021-06-29 16:37:26 -04:00
samartnik f2fcbdf87d [Android] Changes for BrowserControlsManagerSupplier
Chromium change:
https://chromium.googlesource.com/chromium/src/+/10041fc90b2a0d2b72be98775c73d35931dbb32e

[ChromeActivity] Dedup and attach BrowserControlsManagerSupplier

BrowserControlsManagerSupplier was introduced in crrev.com/c/2847550, but
never attached to the window.

Bug: 1204868
2021-06-29 16:37:24 -04:00
samartnik 9dfe1382a3 [Android] C-tor signature for NewTabPage was changed 2021-06-29 16:35:56 -04:00
samartnik 30147bacef [Android] BottomControls moved to modularized target
Chromium change:
https://chromium.googlesource.com/chromium/src/+/2336b6557478c544a81650258aab4b0e7af49c78

Toolbar: Move BottomControls to modularized target

This CL moves the classes for BottomControls MVC component plus
its layout xml to chrome/browser/ui/android/toolbar/.

Following dependencies on chrome_java were removed:

- ShareDelegate - was not in use.
- TabGroupUi - split to BottomControlsContentDelegate and extend
               from it.

Bug: 1127732
2021-06-29 16:35:46 -04:00
samartnik b19af7a8fe [Android] Changes for search engine logo
Chromium change:
https://chromium.googlesource.com/chromium/src/+/ea3ad04f98806c71fa5d7ed91faa1afeb1f61cd1

Remove search engine logo feature flag and cleanup surrounding code

- Simplified the logo/no-logo padding cases and removed associated
  plumbing (mostly in LocationBarMediator/Phone).
- Simplified SearchEngineLogoUtils as the feature is enabled by default.
- Removed search engine logo feature flag.
- Move ReturnToChromeExperimentsUtil#isCanonicalizedNTPUrl to
  UrlUtilities and generalize it a bit.

Bug: 1178959
2021-06-29 16:35:34 -04:00
samartnik de9109b7f6 [Android] Most of //chrome/browser/notifications were modularized
Chromium change:
https://chromium.googlesource.com/chromium/src/+/8276a73257bad0497689dfb1edeb735be2b5c26b

Modularize most of //chrome/browser/notifications

Move the framework components of //chrome/browser/notifications out to a
module.  This leaves behind web platform notification information and
notification scheduler files.

Presubmit is flagging in moved files (haven't changed lines), so skipping presubmit for this CL.

NOPRESUBMIT=true

Bug: 1174713
2021-06-29 16:35:33 -04:00
samartnik d9930ae4b5 [Android] Brings Stack layout back as an option 2021-06-02 16:15:01 -04:00
samartnik e730ae3537 [Android] Removed deps on chrome_java in c.b.search_engines
Chromium change:
https://chromium.googlesource.com/chromium/src/+/26eb7c14f9b19ae819bb7dc9a8d10e865a43fcc8

Android: Remove deps on chrome_java in c.b.search_engines

The package c.b.search_engines is used by several components in core
chrome.  This CL removes its dependencies on chrome_java to pave
the way for the other components to be modularized easily.

Main dependencies handled are:
- SettingsLauncherImpl: Injected from ToolbarManager. This is
      a stateless class so it can be shared/reused where the code
      can be simplified.
- LocaleManager: Injects a runnable wrapping
      LocaleManager#setSearchEngineAutoSwitch(false) to
      SearchEngineAdapter

Bug: 1171512
2021-05-05 13:20:49 +02:00
Deep Pandya f40fb0b997 Remove placeholder on NTP (#8241)
* Remove placeholder on NTP

Remove warning regarding placeholder

* Add bytecode tests

* Add exception for test flags
2021-04-27 21:10:44 -04:00
Aleksey Khoroshilov 7adc957534 Replace java patches with bytecode patches. 2021-04-21 18:21:22 +07:00
samartnik 508639a1b1 [Android] Added bytecode tests for super names 2021-04-13 10:42:13 -04:00
Alex C a96db76e69 [Android] Fixes unresponsive close button from Site Settings options 2021-03-26 18:16:22 -04:00
samartnik 01a39dba3e [Android] Fixes Tab Groups controls behaviour on tab closing 2021-03-19 17:18:11 -04:00
samartnik 45fedd4e16 [Android] Reconciles Tab Group feature with bottom toolbar 2021-03-11 16:26:33 -05:00
samartnik 7ca49a75a4 [Android] Changes for disabling safe browsing extended reporting 2021-03-10 10:14:31 -05:00
Deep e719c5eec1 Address PR comments 2021-03-09 12:51:34 -05:00
samartnik 0e49519585 [Android] Fixes crash on closing tabs with Tab Groups 2021-03-05 08:08:31 -05:00
samartnik 010da2f267 [Android] Fixed menu icons for overview mode 2021-02-18 21:19:57 -05:00
samartnik bbd56259b5 [Android] Added main proguard exceptions for tests
This allows to share the same exceptions for methods for invocation in
both test and regular apks.
2021-02-18 09:23:34 -05:00
samartnik 49e7fce600 [Android] Removed check passwords preference 2021-02-17 10:43:13 -05:00
samartnik ade938be82 [Android] Moved patches for ToolbarPhone to bytecode 2021-02-12 18:08:28 -05:00
Deep b24f17479f Remove unused code 2021-02-08 10:09:23 -05:00
samartnik ff468b64a6 [Android] getMaxRowsForMostVisitedTiles was moved
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/00bfce0c7635650f36baa1b335aa17c72cde1e70

Fix a bug Chrome is showing 2 rows of most visited tiles when query tiles are enabled

On small screen device, only 1 row of most visited tile should show when
query tiles are enabled.
However, TileSection hard coded the number of rows to 2. So even though
Chrome reduced most visited tiles to 4, it could still end up showing in
2 rows if the screen can only accommodate 3 tiles in a row.

BUG=1166388

(cherry picked from commit e97d0ce51b15cdb72da9a0ae67d9ceac1d08f646)
2021-02-04 23:52:52 -05:00
samartnik 3476ac29ba [Android] Fixes for java warnings II 2021-02-04 23:52:42 -05:00
samartnik ca2dccb837 [Android] BottomControls were modularized
Chromium change:

https://chromium.googlesource.com/chromium/src.git/+/2336b6557478c544a81650258aab4b0e7af49c78

commit 2336b6557478c544a81650258aab4b0e7af49c78
Author: Jinsuk Kim <jinsukkim@chromium.org>
Date:   Mon Jan 11 01:13:17 2021 +0000

Toolbar: Move BottomControls to modularized target

This CL moves the classes for BottomControls MVC component plus
its layout xml to chrome/browser/ui/android/toolbar/.

Following dependencies on chrome_java were removed:

- ShareDelegate - was not in use.
- TabGroupUi - split to BottomControlsContentDelegate and extend
               from it.

Bug: 1127732
2021-02-04 23:52:41 -05:00
samartnik 86cb3176e1 [Android] ThemeColorProvider replaces TabThemeColorProvider
Chromium change:
https://chromium.googlesource.com/chromium/src/+/eafd059d9f7f4656f7110349fa9ffd221dfae93c

Toolbar: TopUiThemeColorProvider

A ThemeColorProvider for top UI (TopUiThemeColorProvider)
replaces TabThemeColorProvider, and gets moved to a modularized
target chrome/browser/ui/android/theme. This is a new source of
truth for toolbar/top part of Chrome UI theme color.

Previously TabThemeColorHelper played the role, but now it was
redefined to provide the theme color coming from tab
contents only. TopUiThemeColorProvider puts together all
the signals and decides the final theme color to be used for
top UI.

Bug: 1127732
2021-02-04 23:52:23 -05:00
samartnik 29638b8fef [Android] Removed unused bytecode test 2021-02-04 23:52:20 -05:00
samartnik ec86e1bc70 [Android] Modularized LayoutManager interface was applied
Chromium change:
https://chromium.googlesource.com/chromium/src/+/c9e84c85453ea4286cc07c9702ab7d01bbcfe0f7
Reland "Toolbar: Apply modularized LayoutManager interface"

Relands the CL after fixing the build error. A new junit test
should have been a part of chrome_junit_tests suite, not a
separate binary.

This reverts commit 09d519a315f43ee0f176d831e93d1698ee6e4421.

TBR=yfriedman@chromium.org,fgorski@chromium.org,pnoland@chromium.org,mdjones@chromium.org

Bug: 1127732
2021-02-04 23:52:19 -05:00
samartnik e98b75a294 [Android] Renamings and c-tor signature changes 2021-01-05 21:27:43 -05:00
Deep 5b09d67215 Address PR comment 2021-01-04 19:53:40 -05:00
samartnik ff6d803037 [Android] Fixed constructor tests for release build 2020-12-21 17:21:42 -05:00
samartnik 8ae5ae8fb5 [Android] Extended bytecode patching abilities
- added ability to redirect constructor
- simplified invocation of methods that are supposed to be patched
2020-12-15 16:07:33 -05:00
samartnik cccf13837f [Android] Explicitly declare mTabModelProfileSupplier
This prevents from build errors like

../../chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java:627:
error: incompatible types: Object cannot be converted to Profile
                    Profile profile = mTabModelProfileSupplier.get();
2020-12-08 15:25:58 -05:00
samartnik d1f447b053 [Android] ChromeActivity reference removed from ToolbarManager class
Chromium change:
https://chromium.googlesource.com/chromium/src/+/b0a41fbddef0ae42991b0d608ad4126f32cb3580

Remove ChromeActivity reference from ToolbarManager class

Bug: 1123209
2020-12-08 15:25:57 -05:00