Commit Graph
35 Commits
Author SHA1 Message Date
Artem Samoilenko b76031db97 [Android] Rename SharedPreferencesManager -> ChromeSharedPreferences
Chromium change:
https://github.com/brave/chromium/commit/dbcebd8c0cc67763d2740282b6451f9ecc114276

SharedPreferencesManager -> ChromeSharedPreferences (part 1)
Updates all deprecated references. Will remove //chrome's copy
of SharedPreferencesManager in a follow-up.

Bug: 1484291
2023-11-27 11:27:07 -05:00
Max Karolinskiy c504f32d2e Updated l10n for 1.59.x release. (#20443)
* Updated l10n for 1.59.x release.

* [Android] GRD: use upper case for placeholder name.
2023-10-17 22:02:42 -04:00
Max Karolinskiy 112030b236 Updated l10n for 1.58.x release. (#20119)
* Updated l10n for 1.58.x release.

* Replace %% with unicode escape sequence in Android grd/xtbs.
2023-09-12 09:15:03 -04:00
Max Karolinskiy 693757862b [Android] Presumit: remove unused imports. 2023-09-06 12:38:51 +01:00
Artem Samoilenko 4d7af65e5c [Android] New dialogs for empty states
There are new dialogs that are shown when there are no items to show
(eg. no tabs to show, no history, no downdoaded items etc.). Design team
provided new icons for those dialogs.

Chromium changes:
https://github.com/brave/chromium/commit/29065911522b05a09c397504c8ca4f932c6a77af

Reland "[Empty States] Add empty state illustrations to tab switcher UI"
This is a reland of commit e108b3c

- Previously we rely solely on mModel to determine whether tab switcher is in empty state, however, mModel gets reset to null every time in a postHidingCleanup and thus caused the empty view to show up unexpectedly after ~30s of closing tab switcher. To address this issue, we used a     boolean mIsTabSwitcherShowing in TabListEmptyCoordinator. We set the boolean to true from TabListCoordinator.prepareTabSwitcherView() and set it to false from TabListCoordinator.postHiding. That way, we would know whether the mModel signal is from the actual tab switcher usage or from a cleanup.

Phone demo: https://drive.google.com/file/d/15tmY9gKVocYcUSzC40CCOkuiLX3KoCra/view?usp=sharing

Tablet demo:
https://drive.google.com/file/d/15vT6d-lRE8b2p3XJIhZawb7mmTKTeq9J/view?usp=sharing

Bug: 1431589, 1431588

Original change's description:
> [Empty States] Add empty state illustrations to tab switcher UI
>
> - Add TabListEmptyCoordinator class to initialize empty state resources and use ListObserver to observe mModel to decide when to add /remove empty view.
>     - Add empty view when user close a tab and tab count drops to 0.
>     - Remove empty state view when user add tab
>
> - Apply phone_tab_switcher_empty_state_illustration.xml to icon image view when form factor is phone.
> - Apply tablet_tab_switcher_empty_state_illustration.xml to icon image view when form factor is tablet.
>
> Phone demo: https://drive.google.com/file/d/17deVSRomQUQ1wj5Ml04FTM3tJ0ZXXKZo/view?usp=sharing
> Tablet demo: https://drive.google.com/file/d/1012QQcwxmBoqx7TUjOun7BlO6z2sP4o6/view?usp=sharing
>
> Change-Id: I43b89866ae612a05912b0256790cd538b38417f5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4531843
> Reviewed-by: Theresa Sullivan <twellington@chromium.org>
> Commit-Queue: Theresa Sullivan <twellington@chromium.org>
> Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
> Cr-Commit-Position: refs/heads/main@{#1147331}

Change-Id: I0126b9a34bca7f0194b2f08c39495c19020cb618

https://github.com/brave/chromium/commit/8128eb6222ea1d237fc2ac0393e40c8ac2de4f1c

[Empty States] Add empty state illustration to Download page
- Add empty state vector drawable and layout.
  - Added downloads_empty_state_illustration.xml
  - Added downloads_empty_state_view.xml (switch to this new layout when FF is enabled)

- Use GM3 Material colors for empty state icon.
  - Since we currently can only use GM3 tokens to get Material dynamic colors in v31 or above, we have to define some not pre-existing GM3 baseline colors with values in color_palette.xml for pre-v31.
  - GM3 Material dynamic colors defined in (need google3 MaterialComponent dependency):  components/browser_ui/styles/android/java/res/values-v31/colors.xml
  - GM3 Material baseline colors defined in: ui/android/java/res/values/color_palette.xml

- Add Download empty state text strings
  - IDS_DOWNLOAD_MANAGER_NO_DOWNLOADS_EMPTY_STATE
  - IDS_DOWNLOAD_MANAGER_NO_DOWNLOADS_VIEW_OFFLINE_OR_SHARE

Tablet demo:
https://drive.google.com/file/d/1MAtvIlV5sw5U9-zSBmhvfZerqt8jpXfr/view?usp=sharing
Phone demo:
https://drive.google.com/file/d/11TchlrDojWS1XKr6pHtw5ihH_cKdXnT8/view?usp=sharing

Spec: https://www.figma.com/file/wuV3Cx7zhj5O9Hydi7Qxaz/clank-empty-states?node-id=0-1&t=XSFbBmuUjClfkrkH-0

Bug: 1431575

https://github.com/brave/chromium/commit/35223bcab6b70ebf9d01a92715fa3d63965d98d5

[Empty States] Add empty state illustration to History page
- Add empty state vector drawable and layout.
  - Added history_empty_state_illustration.xml
  - Added history_empty_state_view.xml

- In HistoryManager.java, call #mSelectableListLayout.initializeEmptyStateView when Empty State FF is enabled.

- Use ViewStub as Empty State view holder in SelectableListLayout.xml and inflate layout in SelectableListLayout.java when Empty State FF is enabled.

- Add History empty state text strings
  - IDS_HISTORY_MANAGER_EMPTY_STATE
  - IDS_HISTORY_MANAGER_EMPTY_STATE_VIEW_OR_CLEAR_PAGE_VISITED

Phone Demo: https://drive.google.com/file/d/13FUM_x9ooStyZfo6gi4ZtniQdf2Sv4oD/view?usp=sharing
Tablet Demo: https://drive.google.com/file/d/1M8kyncAFdbkY-uCXeoQZlphIOd11zf8a/view?usp=sharing

Bug: 1431575

https://github.com/brave/chromium/commit/f45eef2ccb48048ce510318e17804c9f3155a9e4

[Empty States] Add empty state illustration to Bookmark & Reading lis…
…t pages

- Add bookmark_empty_state_illustration.xml & reading_list_empty_state_illustration.xml
- Initialize Empty State view in BookmarkManagerCoordinator
- Set string and image resources in BookmarkManagerMediator depending  on if we are in bookmark or reading list folder

Phone demo: https://drive.google.com/file/d/11CBTJz4g9mI-X27C8chmdKFJg6WMgwMQ/view?usp=sharing
Tablet demo: https://drive.google.com/file/d/12-8oYox0g806mB3TFJqpzps4u1mMNLl7/view?usp=sharing

Bug: 1431572, 1431580
2023-09-06 12:38:48 +01:00
Artem Samoilenko 145681c02a [Android] Remove tab groups auto creation
Chromium change:
https://github.com/brave/chromium/commit/aa78b431380e08988cccde7e6e2a167568da64a9

[Tab Groups] Remove auto creation and menu order params
Remove tab group auto creation and menu order params as these are
launched in their current and final states.

Tab Group Auto Creation is disabled.
New Tab In Group is first in the context menu.

Bug: 1188370
2023-09-06 12:38:48 +01:00
Artem Samoilenko 97d8e8404b [Android] Minor code adjustments to the C117 upstream changes 2023-09-06 12:38:46 +01:00
Artem Samoilenko eb0580e5a3 [Android] Rename baseline neutral colors
Chromium change:
https://chromium.googlesource.com/chromium/src/+/5c79b41d11275a26499f6969fbb21dd9f4c19de9

[GMNext] Rename baseline neutral colors

This CL updates the baseline neutral colors to align with the new GM3
tonal palette names, i.e. 0 to 1000 with 1000 being black to 0 to 100
with 100 being white.

Bug: 1441952
2023-09-06 12:38:45 +01:00
Claudio DeSouza 6d81ac67ce Updated strings for Chromium 117.0.5938.35. 2023-09-06 12:38:41 +01:00
Max Karolinskiy f4bae97cf9 Updated l10n for 1.57.x release. (#19669) 2023-08-14 16:31:29 -04:00
Emerick Rogulandbrave-builds af5f05815b Upgrade from Chromium 115.0.5790.40 to Chromium 115.0.5790.56 (#19093)
* Upgrade from Chromium 115.0.5790.40 to Chromium 115.0.5790.56

* Upgrade patches from Chromium 115.0.5790.40 to Chromium 115.0.5790.56

* Update pins list timestamp

* Updated strings for Chromium 115.0.5790.56

* Use new internal namespace for kSidePanelCompanion and disable related feature

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/8168e68f8e290ab3d73da121d2db3248c9b5c41c

commit 8168e68f8e290ab3d73da121d2db3248c9b5c41c
Author: Tarun Bansal <tbansal@google.com>
Date:   Mon Jun 26 19:02:28 2023 +0000

    [M115 Merge] [CSC] Enable companion when exps is enabled

    This CL dynamically enables Chrome companion if Chrome detects that user
    is enabled in exps. This happens if the
    CompanionEnabledByObservingExpsNavigations feature is enabled.

    The CL achieves this by changing some of the existing checks to be
    enabled by either of the 2 field trial experiments: (i) CSC itself is
    enabled as a feature (ii) Detection of exps enrollment is enabled

    If detection of exps enrollment is enabled and exps enrollment is
    detected, then companion is dynamically enabled and an entry is pinned
    to the toolbar.

    Design discussion: http://shortn/_nrSG5apNyX

    (cherry picked from commit 083f2748173dcfc19fca70cc40390b1058d54e11)

    Bug: b:286111571, 1449021

---------

Co-authored-by: brave-builds <brave-builds+devops@brave.com>
2023-06-29 14:19:13 -04:00
mkarolin f778f29f53 [Android] Adds initial copies of XTBs for android_chrome_tab_ui_strings.grd. 2023-06-20 16:36:52 -04:00
mkarolin fcde02393a [Android] Adds l10n for android_chrome_tab_ui_strings.grd. 2023-06-20 16:18:21 -04:00
AlexeyBarabash 6523c3bace Enable CheckJavaStyle presubmit check (#18761)
* Enable CheckJavaStyle presubmit check

For now severity for all checks except RedundantImport/UnusedImports
is changed from error to warning with brave-style-5.0.xml.

Once all Java style errors will be fixed, check should be switched
back to upstream's original check.

Fixes brave/brave-browser#30823

* Remove all unused/redundant imports from java files
2023-06-07 20:44:28 +03:00
Artem Samoilenko b8cebb7d80 [Android] Java code adjustments to the upstream changes
Chromium changes:
https://github.com/chromium/chromium/commit/c56158ffd2b647b9c64554e173747c4451021245

Reland "[Tab Switcher] Remove DFM Code"
This reverts commit 3e5825d.

Reason for revert: was reverted for a resource missing bug
which seems to have been remedied by
https://chromium-review.googlesource.com/c/chromium/src/+/4385474

I've tried building the failing gn args config from
https://crbug.com/1427465 locally and didn't encounter any issues.

Also added android-official build to the CQ to double check.

See the delta between PS1 and Latest for changes.

https://github.com/chromium/chromium/commit/b587c288d722f2e06f6bad83a46425e90d172a6e

Remove Android UI jank tracker
This CL removes all classes related to Android UI jank metrics. These
metrics measured durations of native Android UI frames. They were used
to support the Android team and are no longer in use. Their
histograms.xml entries expired in June 2022.

Change-Id: I9103a5289c0f82ae49fc96c2dc9488e1bb2eff18

https://github.com/chromium/chromium/commit/c34a9b5a65d5ed0034439153ae8c3aadc2716439

[Start] Add the single tab card on NewTabPage layout when used on the…
… tablet

Add the single tab card on the New tab page when we use the App on the tablet. We also added the tests for it.

Bug: 1416536, 1420752
2023-05-15 13:10:38 +01:00
Artem Samoilenko 178a80395b [Android] Adjustments to the various upstream java changes
Mostly renaming and removing obsolete code.

Chromium changes:
https://github.com/chromium/chromium/commit/7068c98f7fafe23ea93e203c182f889a04380d2e

Enable All Suggestions to feature Action Chips.
The change renames PedalSuggestionProcessor as ActionChipsProcessor
and relocates it to the `.base` package.

The change also renames OmniboxPedalDelegate as ActionChipsDelegate,
and plumbs the Delegate to all relevant SuggestionProcessors:
- Entity,
- Answer,
- Tail, and
- Basic (catch-all suggestion processor).
to increase the availability of Pedals and Journeys.

Bug: 1418077

https://github.com/chromium/chromium/commit/819d1f2e3fc5b4044abf1b5c0fc24adcab272b04

[Crow] Remove CrowButtonDelegate dependency (Feed+Menu)
Bug: 1408601

https://github.com/chromium/chromium/commit/e82ad92b6f71d5baca1ec94b389c1d7cea903161

Simplify Java TaskTraits
This is essentially prep work for future cleanup, I've minimized the API
exposed from TaskTraits (after 4 years we still haven't needed a lot of
the infrastructure that was built here).

There are no functional changes here, TaskTraits.THREAD_POOL_BEST_EFFORT and TaskTraits.BEST_EFFORT were/are equivalent.

Change-Id: Ida665c009d20d891b25821fec9d603bd9c1a3657

https://github.com/chromium/chromium/commit/2d180440d8b213e2f9b5290dd76998414d0f02ff

[Tab Management] Simplify M5 params
Flatten launch params for M5 to make things a bit easier to reason
about. This CL flattens params for

* ENABLE_LAUNCH_POLISH
* ENABLE_LAUNCH_BUG_FIX
* ENABLE_DEFERRED_FAVICON

into TabUiFeatureUtilities#isTabGroupsAndroidContinuationEnabled(). This
flag has been turned off and will only be re-activated once we are ready
to re-attempt the M5 launch.

This CL also removes

* ENABLE_TAB_GROUP_SHARING

which is deprecated in favor of TabSelectionEditorV2.

The second, third, and fourth bugs are speculatively fixed by this.

Bug: 1420613, 1418922, 1420197, 1419842
2023-04-20 23:56:01 -04:00
Simone Arpe 39cf09370b Fix copyright header (#18011)
Replaces `http` protocol with `https` in the copyright header for Java and XML files.
2023-04-12 15:10:02 +02:00
tapanmodh 649dea59d9 Add option to enable/disable download notification bubble 2023-01-06 21:49:11 +05:30
samartnik fd42dd4528 [Android] Fixes for top and bottom toolbar coordinators
Chromium change:
https://github.com/chromium/chromium/commit/6c2991c06c84d779f1bd0281fac9bf4bef9d5a34

Observe constraints to capture toolbar.
This both stops any captures that happen while the browser controls are
locked, as well as triggers a capture right when controls unlock.

(cherry picked from commit 151e711)

Bug: 1063346
2022-09-15 20:46:19 -04:00
samartnik f9391cd4b8 [Android] OverviewMode* classes were removed
Chromium change:
https://github.com/chromium/chromium/commit/596552c5837326e9858d5d30974ebfa1235c6ff9

Remove OverviewMode* classes
This patch removes OverviewModeBehavior and its observers. Code that
was still using these classes had easy access to the LayoutManager
which could be used in its place.

Bug: 1108496
2022-06-10 05:58:22 -04:00
samartnik dde3bf4360 [Android] Added option Enable Tab Group auto creation 2022-04-05 17:14:00 -04:00
samartnik 0d2cde6122 [Android] Fixed background color for bottom tab groups toolbar
We want bottom tab groups toolbar and bottom toolbar colors to match.

Chromium change:
https://github.com/chromium/chromium/commit/36b698ced32d46de61554b4db1d9ca38143fcfc2

Reland "[GMNext] Migrate default_bg_color_dark_elev_N"
This is a reland of 391590f

The underlying issue has been fixed in https://crrev.com/c/3414069 and
this change is now safe to reland without any modifications.

Original change's description:
> [GMNext] Migrate default_bg_color_dark_elev_N
>
>
> [GMNext] Migrate default_bg_color_light_elev_N to dynamic colors
>
> Migrate default_bg_color_light_elev_N to dynamic colors.
>
> Only usage can be handled with the SurfaceColorDrawable.
>
> Will handle night mode version in followup CL migrating
> default_bg_color_dark_elev_N.
>
> Bug: 1270911
> Change-Id: Id2931d815de83f3d0a57bbd104a65d2cd85c8f8b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3343448
> Reviewed-by: Sky Malice <skym@chromium.org>
> Reviewed-by: Sinan Sahin <sinansahin@google.com>
> Reviewed-by: Theresa Sullivan <twellington@chromium.org>
> Reviewed-by: Colin Blundell <blundell@chromium.org>
> Commit-Queue: Neil Coronado <nemco@google.com>
> Cr-Commit-Position: refs/heads/main@{#957734}

Bug: 1270911, 1287000
2022-03-18 20:04:16 -04:00
samartnik a7daae2fd4 [Android] Fixed context menu for tablets 2022-03-01 16:24:27 -05:00
samartnik e3abd222d4 [Android] Removed stack layout code
Resolves https://github.com/brave/brave-browser/issues/21005

Chromium change:
https://github.com/chromium/chromium/commit/94a231f90d89f9af2996172fae508f9472d573cb

Remove unused rendering code in TabLayout
Follow up to https://chromium-review.googlesource.com/c/chromium/src/+/3388174
and continues to simplify the Tab rendering logic for phones.

Also deletes anything related to tilting/rotating and card backs for the
tabs.

Bug: 1287653
2022-02-17 14:03:25 -05:00
samartnik 897e2cdc44 [Android] Fixed colors for tab overview mode
Chromium change:
https://github.com/chromium/chromium/commit/7d60b1c52274b1b525a36db0986a1ea57c7ebf62

Enable DynamicColors through material_java.
Binary-Size: This is already being paid in downstream.
Bug: 1279417
2022-02-17 14:03:13 -05:00
samartnik e4e259e815 [Android] Made context menu option 'Open in new tab' visible 2022-02-07 10:26:53 -05:00
samartnik 56193fe255 [Android] Adjustments to UI changes in the upstream
Chromium change:
https://chromium-review.googlesource.com/c/chromium/src/+/3283625

Clean up legacy non-ThemeRefactorAndroid code now that the feature has
launched.

Bug: 1251194
2022-01-24 15:34:05 -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 2336c5456e [Android] Fixed color for tab groups toolbar
Chromium change:
https://chromium.googlesource.com/chromium/src/+/73c2d3d5ee5865411e0f09909f1456c5e7bbc4e3

Bottom tab strip bg to Surface-3 in night mode.

The previous implementation assumed that the background color of the tab
strip should match the omnibox. This is no longer the case, as the
tab strip should now match infobars/dialogs, and be surface-0 (day) and
surface-3 (night).

So replace the theme provider with an is incognito provider, to let the
view make the appropriate decision.

Bug: 1243098
2021-10-05 16:21:51 -04:00
samartnik 1a1cd39889 [Android] Changed theme color handling for bottom toolbar
Chromium change:
Bottom tab strip bg to Surface-3 in night mode.

The previous implementation assumed that the background color of the tab
strip should match the omnibox. This is no longer the case, as the
tab strip should now match infobars/dialogs, and be surface-0 (day) and
surface-3 (night).

So replace the theme provider with an is incognito provider, to let the
view make the appropriate decision.

Bug: 1243098
2021-10-05 16:20:19 -04:00
samartnik 5f82c09d85 [Android] Some methods moved from application to activity context
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/d5668a5d7e41aefbc739d76435f1d02fd1f93ec9

Update GTS/Group feature checking util method to use activity context

GTS/Group is currently disabled for tablet. The util method that
determines availability of the GTS and Tab Group is using application
context to identify the tablet mode. We should use activity context
instead. This CL updates those util methods to use the activity context.

Bug: 1217430
2021-07-08 18:23:36 -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 d9930ae4b5 [Android] Brings Stack layout back as an option 2021-06-02 16:15:01 -04:00
samartnik ccfd2dcb17 [Android] Changes icon for new tab in Tab Groups 2021-03-12 12:11:17 -05:00
samartnik 45fedd4e16 [Android] Reconciles Tab Group feature with bottom toolbar 2021-03-11 16:26:33 -05:00