Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade from Chromium 116 to Chromium 117 (uplift to 1.58.x). #20025

Merged
merged 7 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
node_modules/
patches/**/*.patchinfo
/third_party/android_deps/libs/com_google_android_play_core/core-1.10.0.aar
/third_party/android_deps/libs/com_google_android_play_core/core-1.10.3.aar
/third_party/argon2/src
/third_party/brave-vpn-wireguard-nt-dlls/
/third_party/brave-vpn-wireguard-tunnel-dlls/
Expand Down
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ if (is_mac) {

cargo_audit_target_dir = "$root_build_dir/cargo_audit"
cargo_audit_exe = "$cargo_audit_target_dir/release/cargo-audit"
cargo_audit_src = "//brave/tools/crates/cargo_audit/v0_17/crate"
cargo_audit_src = "//brave/tools/crates/cargo_audit/v0_18/crate"
if (host_os == "win") {
cargo_audit_exe += ".exe"
}
Expand Down
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_android_play_core',
'version': 'version:[email protected].0.cr1',
'version': 'version:[email protected].3.cr1',
},
],
'condition': 'checkout_android',
Expand Down
13 changes: 13 additions & 0 deletions android/brave_java_resources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ brave_java_resources = [
"java/res/drawable-night-xhdpi/ic_cookie_background.png",
"java/res/drawable-night-xxhdpi/ic_cookie_background.png",
"java/res/drawable-night-xxxhdpi/ic_cookie_background.png",
"java/res/drawable-night/bookmark_empty_state_illustration.xml",
"java/res/drawable-night/history_empty_state_illustration.xml",
"java/res/drawable-night/phone_recent_tab_empty_state_illustration.xml",
"java/res/drawable-night/reading_list_empty_state_illustration.xml",
"java/res/drawable-night/sardine_logo.xml",
"java/res/drawable-night/tablet_recent_tab_empty_state_illustration.xml",
"java/res/drawable-night/tipping_background_success.xml",
"java/res/drawable-nodpi/dylan_malval_sea_min.webp",
"java/res/drawable-nodpi/eth.png",
Expand Down Expand Up @@ -1014,6 +1019,14 @@ brave_java_resources = [
brave_base_module_resources =
[ "java/res_chromium_base/drawable-night/themed_app_icon.xml" ]

brave_download_internal_java_resources =
[ "java/res/drawable-night/downloads_empty_state_illustration.xml" ]

brave_android_features_java_resources = [
"java/res/drawable-night/phone_tab_switcher_empty_state_illustration.xml",
"java/res/drawable-night/tablet_tab_switcher_empty_state_illustration.xml",
]

# XML preprocessing
brave_java_preprocess_xml_sources =
[ "//chrome/android/java/res/menu/main_menu.xml" ]
Expand Down
1 change: 1 addition & 0 deletions android/features/tab_ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ android_library("java") {
"//chrome/android:chrome_java",
"//chrome/android/features/tab_ui:tab_suggestions_java",
"//chrome/browser/android/lifecycle:java",
"//chrome/browser/browser_controls/android:java",
"//chrome/browser/flags:java",
"//chrome/browser/preferences:java",
"//chrome/browser/tabmodel:java",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2023 The Brave Authors. All rights reserved.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at https://mozilla.org/MPL/2.0/.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="96dp"
android:height="96dp"
android:viewportWidth="96"
android:viewportHeight="96">
<path
android:pathData="M48,0L48,0A48,48 0,0 1,96 48L96,48A48,48 0,0 1,48 96L48,96A48,48 0,0 1,0 48L0,48A48,48 0,0 1,48 0z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="47.63"
android:startY="-15.63"
android:endX="48.613"
android:endY="152.939"
android:type="linear">
<item android:offset="0" android:color="#002A2ADE"/>
<item android:offset="1" android:color="#3F2A2ADE"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M38.24,33.2L64.24,33.2A2.8,2.8 0,0 1,67.04 36L67.04,70A2.8,2.8 0,0 1,64.24 72.8L38.24,72.8A2.8,2.8 0,0 1,35.44 70L35.44,36A2.8,2.8 0,0 1,38.24 33.2z"
android:strokeWidth="1.6"
android:fillColor="#00000000"
android:strokeColor="#7C91FF"/>
<path
android:pathData="M31.76,23.84L57.76,23.84A2.8,2.8 0,0 1,60.56 26.64L60.56,62.64A2.8,2.8 0,0 1,57.76 65.44L31.76,65.44A2.8,2.8 0,0 1,28.96 62.64L28.96,26.64A2.8,2.8 0,0 1,31.76 23.84z"
android:strokeWidth="1.6"
android:fillColor="#00000000"
android:strokeColor="#7C91FF"/>
<path
android:pathData="M38.08,32.971C36.666,32.971 35.52,34.117 35.52,35.531V38.091H66.88V35.531C66.88,34.117 65.734,32.971 64.32,32.971H38.08Z"
android:fillColor="#7C91FF"
android:fillType="evenOdd"/>
<path
android:pathData="M29.12,26.56C29.12,25.146 30.266,24 31.68,24H57.92C59.334,24 60.48,25.146 60.48,26.56V29.12H29.12V26.56ZM32.96,25.28H31.68C31.51,25.28 31.347,25.347 31.228,25.468C31.107,25.587 31.04,25.75 31.04,25.92V27.2C31.04,27.37 31.107,27.533 31.228,27.653C31.347,27.773 31.51,27.84 31.68,27.84H32.96C33.13,27.84 33.293,27.773 33.412,27.653C33.533,27.533 33.6,27.37 33.6,27.2V25.92C33.6,25.75 33.533,25.587 33.412,25.468C33.293,25.347 33.13,25.28 32.96,25.28Z"
android:fillColor="#7C91FF"
android:fillType="evenOdd"/>
</vector>

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2023 The Brave Authors. All rights reserved.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at https://mozilla.org/MPL/2.0/.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="96dp"
android:height="96dp"
android:viewportWidth="96"
android:viewportHeight="96">
<path
android:pathData="M48,0L48,0A48,48 0,0 1,96 48L96,48A48,48 0,0 1,48 96L48,96A48,48 0,0 1,0 48L0,48A48,48 0,0 1,48 0z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="47.63"
android:startY="-15.63"
android:endX="48.613"
android:endY="152.939"
android:type="linear">
<item android:offset="0" android:color="#002A2ADE"/>
<item android:offset="1" android:color="#3F2A2ADE"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M26.264,26.233L56.264,26.233A2.8,2.8 0,0 1,59.064 29.033L59.064,50.033A2.8,2.8 0,0 1,56.264 52.833L26.264,52.833A2.8,2.8 0,0 1,23.464 50.033L23.464,29.033A2.8,2.8 0,0 1,26.264 26.233z"
android:strokeWidth="1.6"
android:fillColor="#00000000"
android:strokeColor="#7C91FF"/>
<path
android:pathData="M32.879,34.728L62.879,34.728A2.8,2.8 0,0 1,65.679 37.528L65.679,58.528A2.8,2.8 0,0 1,62.879 61.328L32.879,61.328A2.8,2.8 0,0 1,30.079 58.528L30.079,37.528A2.8,2.8 0,0 1,32.879 34.728z"
android:strokeWidth="1.6"
android:fillColor="#00000000"
android:strokeColor="#7C91FF"/>
<path
android:pathData="M39.736,43.431L69.736,43.431A2.8,2.8 0,0 1,72.536 46.231L72.536,67.231A2.8,2.8 0,0 1,69.736 70.031L39.736,70.031A2.8,2.8 0,0 1,36.936 67.231L36.936,46.231A2.8,2.8 0,0 1,39.736 43.431z"
android:strokeWidth="1.6"
android:fillColor="#00000000"
android:strokeColor="#7C91FF"/>
<path
android:pathData="M39.297,43.648C38.131,43.648 37.187,44.593 37.187,45.758V47.868H72V45.758C72,44.593 71.056,43.648 69.89,43.648H39.297Z"
android:fillColor="#7C91FF"
android:fillType="evenOdd"/>
<path
android:pathData="M26.11,26.769C24.944,26.769 24,27.713 24,28.879V30.989H58.813V28.879C58.813,27.713 57.869,26.769 56.703,26.769H26.11Z"
android:fillColor="#7C91FF"
android:fillType="evenOdd"/>
<path
android:pathData="M30.593,37.319C30.593,36.153 31.538,35.209 32.703,35.209H63.297C64.462,35.209 65.407,36.153 65.407,37.319V39.429H30.593V37.319ZM33.758,35.91H32.703C32.563,35.91 32.429,35.965 32.33,36.064C32.231,36.163 32.176,36.297 32.176,36.437V37.492C32.176,37.632 32.231,37.766 32.33,37.865C32.429,37.964 32.563,38.019 32.703,38.019H33.758C33.898,38.019 34.033,37.964 34.131,37.865C34.23,37.766 34.286,37.632 34.286,37.492V36.437C34.286,36.297 34.23,36.163 34.131,36.064C34.033,35.965 33.898,35.91 33.758,35.91Z"
android:fillColor="#7C91FF"
android:fillType="evenOdd"/>
</vector>

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2023 The Brave Authors. All rights reserved.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at https://mozilla.org/MPL/2.0/.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="96dp"
android:height="96dp"
android:viewportWidth="96"
android:viewportHeight="96">
<path
android:pathData="M48,0L48,0A48,48 0,0 1,96 48L96,48A48,48 0,0 1,48 96L48,96A48,48 0,0 1,0 48L0,48A48,48 0,0 1,48 0z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="47.63"
android:startY="-15.63"
android:endX="48.613"
android:endY="152.939"
android:type="linear">
<item android:offset="0" android:color="#002A2ADE"/>
<item android:offset="1" android:color="#3F2A2ADE"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M38.24,33.2L64.24,33.2A2.8,2.8 0,0 1,67.04 36L67.04,70A2.8,2.8 0,0 1,64.24 72.8L38.24,72.8A2.8,2.8 0,0 1,35.44 70L35.44,36A2.8,2.8 0,0 1,38.24 33.2z"
android:strokeWidth="1.6"
android:fillColor="#00000000"
android:strokeColor="#545FF8"/>
<path
android:pathData="M31.76,23.84L57.76,23.84A2.8,2.8 0,0 1,60.56 26.64L60.56,62.64A2.8,2.8 0,0 1,57.76 65.44L31.76,65.44A2.8,2.8 0,0 1,28.96 62.64L28.96,26.64A2.8,2.8 0,0 1,31.76 23.84z"
android:strokeWidth="1.6"
android:fillColor="#00000000"
android:strokeColor="#545FF8"/>
<path
android:pathData="M38.08,32.971C36.666,32.971 35.52,34.117 35.52,35.531V38.091H66.88V35.531C66.88,34.117 65.734,32.971 64.32,32.971H38.08Z"
android:fillColor="#545FF8"
android:fillType="evenOdd"/>
<path
android:pathData="M29.12,26.56C29.12,25.146 30.266,24 31.68,24H57.92C59.334,24 60.48,25.146 60.48,26.56V29.12H29.12V26.56ZM32.96,25.28H31.68C31.51,25.28 31.347,25.347 31.228,25.468C31.107,25.587 31.04,25.75 31.04,25.92V27.2C31.04,27.37 31.107,27.533 31.228,27.653C31.347,27.773 31.51,27.84 31.68,27.84H32.96C33.13,27.84 33.293,27.773 33.412,27.653C33.533,27.533 33.6,27.37 33.6,27.2V25.92C33.6,25.75 33.533,25.587 33.412,25.468C33.293,25.347 33.13,25.28 32.96,25.28Z"
android:fillColor="#545FF8"
android:fillType="evenOdd"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2023 The Brave Authors. All rights reserved.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at https://mozilla.org/MPL/2.0/.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="96dp"
android:height="96dp"
android:viewportWidth="96"
android:viewportHeight="96">
<path
android:pathData="M48,0L48,0A48,48 0,0 1,96 48L96,48A48,48 0,0 1,48 96L48,96A48,48 0,0 1,0 48L0,48A48,48 0,0 1,48 0z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="47.63"
android:startY="-15.63"
android:endX="48.613"
android:endY="152.939"
android:type="linear">
<item android:offset="0" android:color="#002A2ADE"/>
<item android:offset="1" android:color="#3F2A2ADE"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M26.264,26.233L56.264,26.233A2.8,2.8 0,0 1,59.064 29.033L59.064,50.033A2.8,2.8 0,0 1,56.264 52.833L26.264,52.833A2.8,2.8 0,0 1,23.464 50.033L23.464,29.033A2.8,2.8 0,0 1,26.264 26.233z"
android:strokeWidth="1.6"
android:fillColor="#00000000"
android:strokeColor="#545FF8"/>
<path
android:pathData="M32.879,34.728L62.879,34.728A2.8,2.8 0,0 1,65.679 37.528L65.679,58.528A2.8,2.8 0,0 1,62.879 61.328L32.879,61.328A2.8,2.8 0,0 1,30.079 58.528L30.079,37.528A2.8,2.8 0,0 1,32.879 34.728z"
android:strokeWidth="1.6"
android:fillColor="#00000000"
android:strokeColor="#545FF8"/>
<path
android:pathData="M39.736,43.431L69.736,43.431A2.8,2.8 0,0 1,72.536 46.231L72.536,67.231A2.8,2.8 0,0 1,69.736 70.031L39.736,70.031A2.8,2.8 0,0 1,36.936 67.231L36.936,46.231A2.8,2.8 0,0 1,39.736 43.431z"
android:strokeWidth="1.6"
android:fillColor="#00000000"
android:strokeColor="#545FF8"/>
<path
android:pathData="M39.297,43.648C38.131,43.648 37.187,44.593 37.187,45.758V47.868H72V45.758C72,44.593 71.056,43.648 69.89,43.648H39.297Z"
android:fillColor="#545FF8"
android:fillType="evenOdd"/>
<path
android:pathData="M26.11,26.769C24.944,26.769 24,27.713 24,28.879V30.989H58.813V28.879C58.813,27.713 57.869,26.769 56.703,26.769H26.11Z"
android:fillColor="#545FF8"
android:fillType="evenOdd"/>
<path
android:pathData="M30.593,37.319C30.593,36.153 31.538,35.209 32.703,35.209H63.297C64.462,35.209 65.407,36.153 65.407,37.319V39.429H30.593V37.319ZM33.758,35.91H32.703C32.563,35.91 32.429,35.965 32.33,36.064C32.231,36.163 32.176,36.297 32.176,36.437V37.492C32.176,37.632 32.231,37.766 32.33,37.865C32.429,37.964 32.563,38.019 32.703,38.019H33.758C33.898,38.019 34.033,37.964 34.131,37.865C34.23,37.766 34.286,37.632 34.286,37.492V36.437C34.286,36.297 34.23,36.163 34.131,36.064C34.033,35.965 33.898,35.91 33.758,35.91Z"
android:fillColor="#545FF8"
android:fillType="evenOdd"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.chromium.base.supplier.ObservableSupplier;
import org.chromium.base.supplier.OneshotSupplier;
import org.chromium.base.supplier.Supplier;
import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider;
import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager;
import org.chromium.chrome.browser.layouts.LayoutStateProvider;
import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher;
Expand All @@ -40,6 +41,7 @@ public class BraveTabGroupUiCoordinator extends TabGroupUiCoordinator {
private IncognitoStateObserver mIncognitoStateObserver;

public BraveTabGroupUiCoordinator(@NonNull Activity activity, @NonNull ViewGroup parentView,
@NonNull BrowserControlsStateProvider browserControlsStateProvider,
@NonNull IncognitoStateProvider incognitoStateProvider,
@NonNull ScrimCoordinator scrimCoordinator,
@NonNull ObservableSupplier<Boolean> omniboxFocusStateSupplier,
Expand All @@ -52,11 +54,11 @@ public BraveTabGroupUiCoordinator(@NonNull Activity activity, @NonNull ViewGroup
@NonNull TabCreatorManager tabCreatorManager,
@NonNull OneshotSupplier<LayoutStateProvider> layoutStateProviderSupplier,
@NonNull SnackbarManager snackbarManager) {
super(activity, parentView, incognitoStateProvider, scrimCoordinator,
omniboxFocusStateSupplier, bottomSheetController, activityLifecycleDispatcher,
isWarmOnResumeSupplier, tabModelSelector, tabContentManager, rootView,
dynamicResourceLoaderSupplier, tabCreatorManager, layoutStateProviderSupplier,
snackbarManager);
super(activity, parentView, browserControlsStateProvider, incognitoStateProvider,
scrimCoordinator, omniboxFocusStateSupplier, bottomSheetController,
activityLifecycleDispatcher, isWarmOnResumeSupplier, tabModelSelector,
tabContentManager, rootView, dynamicResourceLoaderSupplier, tabCreatorManager,
layoutStateProviderSupplier, snackbarManager);

mIncognitoStateProvider = incognitoStateProvider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,10 @@

package org.chromium.chrome.browser.tasks.tab_management;

import android.annotation.SuppressLint;
import android.content.Context;

import org.chromium.base.BravePreferenceKeys;
import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.preferences.SharedPreferencesManager;

public class BraveTabUiFeatureUtilities {
private static final String TAB_GROUP_AUTO_CREATION_PREFERENCE =
"Chrome.Flags.FieldTrialParamCached.TabGridLayoutAndroid:enable_tab_group_auto_creation";

@SuppressLint("VisibleForTests")
public static void maybeOverrideEnableTabGroupAutoCreationPreference(Context context) {
if (TabUiFeatureUtilities.isTabGroupsAndroidEnabled(context)) {
// Override it to make "Open in new tab" menu option in the context menu available if
// applicable.
SharedPreferencesManager.getInstance().writeBoolean(
TAB_GROUP_AUTO_CREATION_PREFERENCE, isBraveTabGroupsEnabled());
CachedFeatureFlags.resetFlagsForTesting();
}
}

public static boolean isBraveTabGroupsEnabled() {
return SharedPreferencesManager.getInstance().readBoolean(
BravePreferenceKeys.BRAVE_TAB_GROUPS_ENABLED, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,20 @@
public class BraveTabUiThemeProvider {
@ColorInt
public static int getTitleTextColor(Context context, boolean isIncognito, boolean isSelected) {
// These checks are just making sure that these values are still used in Chromium to avoid
// lint issues.
assert R.color.empty_state_icon_bg_background_color > 0
: "Something has changed in the upstream!";
assert R.color.empty_state_icon_bg_foreground_color > 0
: "Something has changed in the upstream!";
assert R.color.empty_state_icon_color > 0 : "Something has changed in the upstream!";
assert R.color.empty_state_icon_bg_color > 0 : "Something has changed in the upstream!";
assert R.color.empty_state_icon_tabswitcher_bg_color > 0
: "Something has changed in the upstream!";

if (isSelected) {
return ApiCompatibilityUtils.getColor(
context.getResources(), R.color.baseline_neutral_900);
context.getResources(), R.color.baseline_neutral_10);
}

return TabUiThemeProvider.getTitleTextColor(context, isIncognito, isSelected);
Expand All @@ -28,7 +39,7 @@ public static int getTitleTextColor(Context context, boolean isIncognito, boolea
public static ColorStateList getActionButtonTintList(
Context context, boolean isIncognito, boolean isSelected) {
if (isSelected) {
return AppCompatResources.getColorStateList(context, R.color.baseline_neutral_900);
return AppCompatResources.getColorStateList(context, R.color.baseline_neutral_10);
}

return TabUiThemeProvider.getActionButtonTintList(context, isIncognito, isSelected);
Expand Down
Loading