diff --git a/PRESUBMIT.py b/PRESUBMIT.py index ebb04e4d55db..2617dc9b0b87 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -358,15 +358,6 @@ def CheckNewSourceFileWithoutGnChangeOnUpload(input_api, output_api): treat_as_error=True, excluded_paths=[_THIRD_PARTY_EXCEPT_BLINK], ), - BanRule( - 'NOTREACHED_IN_MIGRATION', - ('Do not introduce new cases of of NOTREACHED_IN_MIGRATION. Please ', - 'refer to the guide for how to use CHECK/DCHECK/NOTREACHED ', - 'https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/checks.md.' - ), - treat_as_error=True, - excluded_paths=[], - ), ) diff --git a/android/brave_java_resources.gni b/android/brave_java_resources.gni index 58ac8f84e3a2..de5dbf5ad996 100644 --- a/android/brave_java_resources.gni +++ b/android/brave_java_resources.gni @@ -57,7 +57,7 @@ brave_java_resources = [ "java/res/drawable-hdpi/location_bar_incognito_badge.png", "java/res/drawable-hdpi/modern_location_bar.9.png", "java/res/drawable-hdpi/naver.png", - "java/res/drawable-hdpi/omnibox_https_valid.png", + "java/res/drawable-hdpi/omnibox_https_valid_lock.png", "java/res/drawable-hdpi/plus.png", "java/res/drawable-hdpi/search_engine_bing.png", "java/res/drawable-hdpi/search_engine_brave.png", @@ -113,7 +113,7 @@ brave_java_resources = [ "java/res/drawable-mdpi/location_bar_incognito_badge.png", "java/res/drawable-mdpi/modern_location_bar.9.png", "java/res/drawable-mdpi/naver.png", - "java/res/drawable-mdpi/omnibox_https_valid.png", + "java/res/drawable-mdpi/omnibox_https_valid_lock.png", "java/res/drawable-mdpi/plus.png", "java/res/drawable-mdpi/search_engine_bing.png", "java/res/drawable-mdpi/search_engine_brave.png", @@ -191,7 +191,7 @@ brave_java_resources = [ "java/res/drawable-xhdpi/location_bar_incognito_badge.png", "java/res/drawable-xhdpi/modern_location_bar.9.png", "java/res/drawable-xhdpi/naver.png", - "java/res/drawable-xhdpi/omnibox_https_valid.png", + "java/res/drawable-xhdpi/omnibox_https_valid_lock.png", "java/res/drawable-xhdpi/plus.png", "java/res/drawable-xhdpi/search_engine_bing.png", "java/res/drawable-xhdpi/search_engine_brave.png", @@ -246,7 +246,7 @@ brave_java_resources = [ "java/res/drawable-xxhdpi/location_bar_incognito_badge.png", "java/res/drawable-xxhdpi/modern_location_bar.9.png", "java/res/drawable-xxhdpi/naver.png", - "java/res/drawable-xxhdpi/omnibox_https_valid.png", + "java/res/drawable-xxhdpi/omnibox_https_valid_lock.png", "java/res/drawable-xxhdpi/plus.png", "java/res/drawable-xxhdpi/search_engine_bing.png", "java/res/drawable-xxhdpi/search_engine_brave.png", @@ -299,7 +299,7 @@ brave_java_resources = [ "java/res/drawable-xxxhdpi/incognito_simple.png", "java/res/drawable-xxxhdpi/location_bar_incognito_badge.png", "java/res/drawable-xxxhdpi/naver.png", - "java/res/drawable-xxxhdpi/omnibox_https_valid.png", + "java/res/drawable-xxxhdpi/omnibox_https_valid_lock.png", "java/res/drawable-xxxhdpi/plus.png", "java/res/drawable-xxxhdpi/search_engine_brave.png", "java/res/drawable-xxxhdpi/search_engine_startpage.png", @@ -374,7 +374,6 @@ brave_java_resources = [ "java/res/drawable/brave_sync_top_rounded.xml", "java/res/drawable/brave_sync_top_rounded_light.xml", "java/res/drawable/card_bg.xml", - "java/res/drawable/checked_circle_filled.xml", "java/res/drawable/circular_progress.xml", "java/res/drawable/country_spinner_background.xml", "java/res/drawable/create_custom_filter_edit_bg.xml", @@ -1046,7 +1045,10 @@ 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/phone_tab_switcher_empty_state_illustration_bottom_window.xml", + "java/res/drawable-night/phone_tab_switcher_empty_state_illustration_cloud_left.xml", + "java/res/drawable-night/phone_tab_switcher_empty_state_illustration_cloud_right.xml", + "java/res/drawable-night/phone_tab_switcher_empty_state_illustration_top_window.xml", "java/res/drawable-night/tablet_tab_switcher_empty_state_illustration.xml", ] diff --git a/android/features/tab_ui/BUILD.gn b/android/features/tab_ui/BUILD.gn index 3d7cba83805c..48845713364d 100644 --- a/android/features/tab_ui/BUILD.gn +++ b/android/features/tab_ui/BUILD.gn @@ -17,7 +17,7 @@ android_library("java") { "//chrome/browser/android/lifecycle:java", "//chrome/browser/browser_controls/android:java", "//chrome/browser/commerce/merchant_viewer/android:java", - "//chrome/browser/data_sharing:tab_group_ui_java", + "//chrome/browser/data_sharing:data_sharing_public_java", "//chrome/browser/flags:java", "//chrome/browser/preferences:java", "//chrome/browser/profiles/android:java", diff --git a/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration_bottom_window.xml b/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration_bottom_window.xml new file mode 100644 index 000000000000..c84bfab9bc05 --- /dev/null +++ b/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration_bottom_window.xml @@ -0,0 +1,23 @@ + + + + + + + diff --git a/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration_cloud_left.xml b/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration_cloud_left.xml new file mode 100644 index 000000000000..bc25346e8dda --- /dev/null +++ b/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration_cloud_left.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration_cloud_right.xml b/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration_cloud_right.xml new file mode 100644 index 000000000000..bc25346e8dda --- /dev/null +++ b/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration_cloud_right.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration.xml b/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration_top_window.xml similarity index 55% rename from android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration.xml rename to android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration_top_window.xml index c7260b2eff79..8efe02a40f35 100644 --- a/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration.xml +++ b/android/features/tab_ui/java/res/drawable-night/phone_tab_switcher_empty_state_illustration_top_window.xml @@ -1,5 +1,5 @@ - + + + + + diff --git a/android/features/tab_ui/java/res/drawable/phone_tab_switcher_empty_state_illustration_cloud_left.xml b/android/features/tab_ui/java/res/drawable/phone_tab_switcher_empty_state_illustration_cloud_left.xml new file mode 100644 index 000000000000..bc25346e8dda --- /dev/null +++ b/android/features/tab_ui/java/res/drawable/phone_tab_switcher_empty_state_illustration_cloud_left.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/android/features/tab_ui/java/res/drawable/phone_tab_switcher_empty_state_illustration_cloud_right.xml b/android/features/tab_ui/java/res/drawable/phone_tab_switcher_empty_state_illustration_cloud_right.xml new file mode 100644 index 000000000000..bc25346e8dda --- /dev/null +++ b/android/features/tab_ui/java/res/drawable/phone_tab_switcher_empty_state_illustration_cloud_right.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/android/features/tab_ui/java/res/drawable/phone_tab_switcher_empty_state_illustration.xml b/android/features/tab_ui/java/res/drawable/phone_tab_switcher_empty_state_illustration_top_window.xml similarity index 55% rename from android/features/tab_ui/java/res/drawable/phone_tab_switcher_empty_state_illustration.xml rename to android/features/tab_ui/java/res/drawable/phone_tab_switcher_empty_state_illustration_top_window.xml index 5213e9e0a6d9..eea6ee05708c 100644 --- a/android/features/tab_ui/java/res/drawable/phone_tab_switcher_empty_state_illustration.xml +++ b/android/features/tab_ui/java/res/drawable/phone_tab_switcher_empty_state_illustration_top_window.xml @@ -1,5 +1,5 @@ - - - You can now open a new tab here - - %1$s1 tab grouped @@ -661,9 +656,6 @@ Your tab groups automatically save - - Show dialog on new tab group creation - @@ -759,6 +751,9 @@ Share group + + Share + Rename tab group @@ -828,6 +823,9 @@ If you leave, you will immediately lose access to the " Remove tab and delete group + + Remove tab and leave group + Your tab groups automatically save and update across all your signed-in devices @@ -919,6 +917,12 @@ If you leave, you will immediately lose access to the "%1$d15 days} } + + All duplicate tabs will now also be archived, with the exception of the most recently used copy. + + + Archive duplicate tabs + Inactive tabs will automatically be closed. You can always find them in History. diff --git a/android/java/apk_for_test.flags b/android/java/apk_for_test.flags index 6c528aa72d83..b9687e06c813 100644 --- a/android/java/apk_for_test.flags +++ b/android/java/apk_for_test.flags @@ -516,7 +516,6 @@ } -keep class org.chromium.chrome.browser.notifications.permissions.NotificationPermissionRationaleDialogController { - *** wrapDialogDismissalCallback(...); public (...); } diff --git a/android/java/org/chromium/chrome/browser/BraveRewardsHelper.java b/android/java/org/chromium/chrome/browser/BraveRewardsHelper.java index 1b38de41e431..faaa3605fc3b 100644 --- a/android/java/org/chromium/chrome/browser/BraveRewardsHelper.java +++ b/android/java/org/chromium/chrome/browser/BraveRewardsHelper.java @@ -46,7 +46,7 @@ import org.chromium.components.browser_ui.widget.RoundedIconGenerator; import org.chromium.components.favicon.IconType; import org.chromium.components.favicon.LargeIconBridge; -import org.chromium.ui.text.NoUnderlineClickableSpan; +import org.chromium.ui.text.ChromeClickableSpan; import org.chromium.url.GURL; import java.math.BigDecimal; @@ -245,17 +245,8 @@ public BraveRewardsHelper(Tab tab) { } } - /** we don't destroy sLargeIconBridge sisnce it's static */ - private void destroy() { - if (sLargeIconBridge != null) { - sLargeIconBridge.destroy(); - sLargeIconBridge = null; - } - mCallback = null; - } - public void detach() { - mCallback = null; + mCallback = null; } public void retrieveLargeIcon(String favIconURL, LargeIconReadyCallback callback) { @@ -579,19 +570,34 @@ public static SpannableString tosSpannableString(String text, int colorRes) { Spanned textSpanned = spannedFromHtmlString(text); SpannableString textSpannableString = new SpannableString(textSpanned.toString()); - NoUnderlineClickableSpan termsOfServiceClickableSpan = - new NoUnderlineClickableSpan(context, colorRes, (textView) -> { - CustomTabActivity.showInfoPage(context, BraveActivity.BRAVE_TERMS_PAGE); - }); + ChromeClickableSpan termsOfServiceClickableSpan = + new ChromeClickableSpan( + context, + colorRes, + (textView) -> { + CustomTabActivity.showInfoPage(context, BraveActivity.BRAVE_TERMS_PAGE); + }); - NoUnderlineClickableSpan privacyPolicyClickableSpan = - new NoUnderlineClickableSpan(context, colorRes, (textView) -> { - CustomTabActivity.showInfoPage(context, BraveActivity.BRAVE_PRIVACY_POLICY); - }); + ChromeClickableSpan privacyPolicyClickableSpan = + new ChromeClickableSpan( + context, + colorRes, + (textView) -> { + CustomTabActivity.showInfoPage( + context, BraveActivity.BRAVE_PRIVACY_POLICY); + }); - setSpan(context, text, textSpannableString, R.string.terms_of_service, + setSpan( + context, + text, + textSpannableString, + R.string.terms_of_service, termsOfServiceClickableSpan); // terms of service - setSpan(context, text, textSpannableString, R.string.privacy_policy, + setSpan( + context, + text, + textSpannableString, + R.string.privacy_policy, privacyPolicyClickableSpan); // privacy policy return textSpannableString; } @@ -605,8 +611,8 @@ public static SpannableString toSpannableString( Spanned textSpanned = spannedFromHtmlString(text); SpannableString textSpannableString = new SpannableString(textSpanned.toString()); - NoUnderlineClickableSpan substringClickableSpan = - new NoUnderlineClickableSpan( + ChromeClickableSpan substringClickableSpan = + new ChromeClickableSpan( context, colorRes, (textView) -> { diff --git a/android/java/org/chromium/chrome/browser/accessibility/settings/BraveAccessibilitySettings.java b/android/java/org/chromium/chrome/browser/accessibility/settings/BraveAccessibilitySettings.java index 143b0e97b406..d83fe1c3833e 100644 --- a/android/java/org/chromium/chrome/browser/accessibility/settings/BraveAccessibilitySettings.java +++ b/android/java/org/chromium/chrome/browser/accessibility/settings/BraveAccessibilitySettings.java @@ -9,6 +9,7 @@ import org.chromium.base.BraveFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.components.browser_ui.accessibility.AccessibilitySettings; import org.chromium.components.browser_ui.settings.ChromeSwitchPreference; public class BraveAccessibilitySettings extends AccessibilitySettings { diff --git a/android/java/org/chromium/chrome/browser/app/BraveActivity.java b/android/java/org/chromium/chrome/browser/app/BraveActivity.java index 6d10d87b39cc..56bce7d2a9f5 100644 --- a/android/java/org/chromium/chrome/browser/app/BraveActivity.java +++ b/android/java/org/chromium/chrome/browser/app/BraveActivity.java @@ -154,8 +154,7 @@ import org.chromium.chrome.browser.preferences.BravePrefServiceBridge; import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; import org.chromium.chrome.browser.preferences.Pref; -import org.chromium.chrome.browser.preferences.PrefChangeRegistrar; -import org.chromium.chrome.browser.preferences.PrefChangeRegistrar.PrefObserver; +import org.chromium.chrome.browser.preferences.PrefServiceUtil; import org.chromium.chrome.browser.preferences.website.BraveShieldsContentSettings; import org.chromium.chrome.browser.prefetch.settings.PreloadPagesSettingsBridge; import org.chromium.chrome.browser.prefetch.settings.PreloadPagesState; @@ -221,6 +220,8 @@ import org.chromium.components.browser_ui.settings.SettingsNavigation; import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.components.embedder_support.util.UrlUtilities; +import org.chromium.components.prefs.PrefChangeRegistrar; +import org.chromium.components.prefs.PrefChangeRegistrar.PrefObserver; import org.chromium.components.safe_browsing.BraveSafeBrowsingApiHandler; import org.chromium.components.search_engines.TemplateUrl; import org.chromium.components.user_prefs.UserPrefs; @@ -1033,7 +1034,7 @@ public void finishNativeInitialization() { BraveHelper.maybeMigrateSettings(); - PrefChangeRegistrar mPrefChangeRegistrar = new PrefChangeRegistrar(); + PrefChangeRegistrar mPrefChangeRegistrar = PrefServiceUtil.createFor(getCurrentProfile()); mPrefChangeRegistrar.addObserver(BravePref.SCHEDULED_CAPTCHA_ID, this); if (UserPrefs.get(ProfileManager.getLastUsedRegularProfile()) @@ -1833,7 +1834,7 @@ public void closeAllTabsByOrigin(@NonNull final String origin) { Tab tab = tabModel.getTabAt(index); if (tab != null) { tab.setClosing(true); - tabModel.closeTabs(TabClosureParams.closeTab(tab).build()); + tabModel.getTabRemover().closeTabs(TabClosureParams.closeTab(tab).build(), false); } } } diff --git a/android/java/org/chromium/chrome/browser/app/bookmarks/BraveBookmarkActivity.java b/android/java/org/chromium/chrome/browser/app/bookmarks/BraveBookmarkActivity.java index 184f704781a0..62f747864439 100644 --- a/android/java/org/chromium/chrome/browser/app/bookmarks/BraveBookmarkActivity.java +++ b/android/java/org/chromium/chrome/browser/app/bookmarks/BraveBookmarkActivity.java @@ -23,7 +23,9 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); IntentRequestTracker intentRequestTracker = IntentRequestTracker.createFromActivity(this); - mWindowAndroid = new ActivityWindowAndroid(this, true, intentRequestTracker, null); + mWindowAndroid = + new ActivityWindowAndroid( + this, true, intentRequestTracker, null, /* trackOcclusion= */ false); mWindowAndroid.getIntentRequestTracker().restoreInstanceState(savedInstanceState); if (mBookmarkManagerCoordinator instanceof BraveBookmarkManagerCoordinator) { ((BraveBookmarkManagerCoordinator) mBookmarkManagerCoordinator) diff --git a/android/java/org/chromium/chrome/browser/app/domain/NetworkModel.java b/android/java/org/chromium/chrome/browser/app/domain/NetworkModel.java index 649f2e3fa771..5a6fd041a864 100644 --- a/android/java/org/chromium/chrome/browser/app/domain/NetworkModel.java +++ b/android/java/org/chromium/chrome/browser/app/domain/NetworkModel.java @@ -65,6 +65,7 @@ public class NetworkModel implements JsonRpcServiceObserver { public final LiveData> mSecondaryNetworks; public final LiveData mNetworkLists; + @SuppressWarnings("NoStreams") public NetworkModel( BraveWalletService braveWalletService, @NonNull JsonRpcService jsonRpcService, @@ -228,6 +229,7 @@ public void refreshNetworks() { init(); } + @SuppressWarnings("NoStreams") static void getAllNetworks( JsonRpcService jsonRpcService, Callbacks.Callback1> callback) { if (jsonRpcService == null) { diff --git a/android/java/org/chromium/chrome/browser/base/SplitCompatJobIntentService.java b/android/java/org/chromium/chrome/browser/base/SplitCompatJobIntentService.java index 88b237b3d2bf..986f100505a3 100644 --- a/android/java/org/chromium/chrome/browser/base/SplitCompatJobIntentService.java +++ b/android/java/org/chromium/chrome/browser/base/SplitCompatJobIntentService.java @@ -33,12 +33,11 @@ public SplitCompatJobIntentService(String serviceClassName, String splitName) { @Override protected void attachBaseContext(Context context) { // Make sure specified split is installed, otherwise fall back to chrome split. + String splitName = SplitCompatApplication.CHROME_SPLIT_NAME; if (mSplitName != null && BundleUtils.isIsolatedSplitInstalled(mSplitName)) { - context = BundleUtils.createIsolatedSplitContext(context, mSplitName); - } else { - context = SplitCompatApplication.createChromeContext(context); + splitName = mSplitName; } - mImpl = (Impl) BundleUtils.newInstance(context, mServiceClassName); + mImpl = (Impl) BundleUtils.newInstance(mServiceClassName, splitName); mImpl.setService(this); super.attachBaseContext(context); } diff --git a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkBridge.java b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkBridge.java index 52af69a3d160..0dadb9e49452 100644 --- a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkBridge.java +++ b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkBridge.java @@ -10,6 +10,7 @@ import org.jni_zero.CalledByNative; import org.jni_zero.NativeMethods; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.ui.base.WindowAndroid; class BraveBookmarkBridge extends BookmarkBridge { @@ -18,8 +19,8 @@ class BraveBookmarkBridge extends BookmarkBridge { private WindowAndroid mWindowAndroid; private String mExportFilePath; - BraveBookmarkBridge(long nativeBookmarkBridge) { - super(nativeBookmarkBridge); + BraveBookmarkBridge(long nativeBookmarkBridge, Profile profile) { + super(nativeBookmarkBridge, profile); } @CalledByNative diff --git a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerCoordinator.java b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerCoordinator.java index 1ee5793cb37b..05c2de8fff57 100644 --- a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerCoordinator.java +++ b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerCoordinator.java @@ -8,6 +8,8 @@ import android.content.ComponentName; import android.content.Context; +import androidx.annotation.Nullable; + import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.ui.base.ActivityWindowAndroid; @@ -22,14 +24,16 @@ public BraveBookmarkManagerCoordinator( boolean isDialogUi, SnackbarManager snackbarManager, Profile profile, - BookmarkUiPrefs bookmarkUiPrefs) { + BookmarkUiPrefs bookmarkUiPrefs, + @Nullable Runnable bookmarkOpenedCallback) { super( context, openBookmarkComponentName, isDialogUi, snackbarManager, profile, - bookmarkUiPrefs); + bookmarkUiPrefs, + bookmarkOpenedCallback); } public void setWindow(ActivityWindowAndroid window) { diff --git a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerMediator.java b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerMediator.java index bd246771a179..0c00f681e172 100644 --- a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerMediator.java +++ b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerMediator.java @@ -15,6 +15,7 @@ import android.os.Environment; import androidx.appcompat.app.AppCompatActivity; +import androidx.lifecycle.LifecycleOwner; import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView.OnScrollListener; @@ -32,16 +33,18 @@ import org.chromium.components.commerce.core.ShoppingService; import org.chromium.ui.base.ActivityWindowAndroid; import org.chromium.ui.base.WindowAndroid; +import org.chromium.ui.modaldialog.ModalDialogManager; import org.chromium.ui.modelutil.MVCListAdapter.ModelList; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.util.function.BooleanSupplier; import java.util.function.Consumer; -class BraveBookmarkManagerMediator - extends BookmarkManagerMediator implements BraveBookmarkDelegate { +class BraveBookmarkManagerMediator extends BookmarkManagerMediator + implements BraveBookmarkDelegate { private ActivityWindowAndroid mWindowAndroid; // Overridden Chromium's BookmarkManagerMediator.mBookmarkModel @@ -53,7 +56,9 @@ class BraveBookmarkManagerMediator private static final String IMPORTED_BOOKMARKS_TEMP_FILENAME = "ImportedBookmarks"; BraveBookmarkManagerMediator( - Context context, + Activity activity, + LifecycleOwner lifecycleOwner, + ModalDialogManager modalDialogManager, BookmarkModel bookmarkModel, BookmarkOpener bookmarkOpener, SelectableListLayout selectableListLayout, @@ -70,10 +75,13 @@ class BraveBookmarkManagerMediator BookmarkImageFetcher bookmarkImageFetcher, ShoppingService shoppingService, SnackbarManager snackbarManager, + BooleanSupplier canShowSigninPromo, Consumer onScrollListenerConsumer, BookmarkMoveSnackbarManager bookmarkMoveSnackbarManager) { super( - context, + activity, + lifecycleOwner, + modalDialogManager, bookmarkModel, bookmarkOpener, selectableListLayout, @@ -90,6 +98,7 @@ class BraveBookmarkManagerMediator bookmarkImageFetcher, shoppingService, snackbarManager, + canShowSigninPromo, onScrollListenerConsumer, bookmarkMoveSnackbarManager); } diff --git a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java index 5a78a54c9528..44f6574394d8 100644 --- a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java +++ b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java @@ -5,11 +5,12 @@ package org.chromium.chrome.browser.bookmarks; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.ui.base.WindowAndroid; public class BraveBookmarkModel extends BookmarkModel { - BraveBookmarkModel(long nativeBookmarkBridge) { - super(nativeBookmarkBridge); + BraveBookmarkModel(long nativeBookmarkBridge, Profile profile) { + super(nativeBookmarkBridge, profile); } public void importBookmarks(WindowAndroid windowAndroid, String importFilePath) { diff --git a/android/java/org/chromium/chrome/browser/brave_news/CardBuilderFeedCard.java b/android/java/org/chromium/chrome/browser/brave_news/CardBuilderFeedCard.java index 0e9e0d4e6672..4fbd92cb00ec 100644 --- a/android/java/org/chromium/chrome/browser/brave_news/CardBuilderFeedCard.java +++ b/android/java/org/chromium/chrome/browser/brave_news/CardBuilderFeedCard.java @@ -10,7 +10,6 @@ import android.graphics.Color; import android.graphics.Paint; import android.graphics.Typeface; -import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.LayerDrawable; @@ -40,15 +39,11 @@ import com.bumptech.glide.Glide; import com.bumptech.glide.Priority; import com.bumptech.glide.RequestManager; -import com.bumptech.glide.load.DataSource; import com.bumptech.glide.load.engine.DiskCacheStrategy; -import com.bumptech.glide.load.engine.GlideException; import com.bumptech.glide.load.resource.bitmap.CenterCrop; import com.bumptech.glide.load.resource.bitmap.GranularRoundedCorners; -import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.target.CustomTarget; -import com.bumptech.glide.request.target.Target; import com.bumptech.glide.request.transition.Transition; import org.chromium.base.ContextUtils; @@ -1425,39 +1420,6 @@ private void setImage(ImageView imageView, String type, int index) { } } - // used for logging the Glide implementation - private RequestListener createLoggerListener(final String unused_name) { - return new RequestListener() { - @Override - public boolean onLoadFailed( - @Nullable GlideException e, - Object model, - Target target, - boolean isFirstResource) { - return false; - } - - @Override - public boolean onResourceReady( - Drawable resource, - Object model, - Target target, - DataSource dataSource, - boolean isFirstResource) { - if (resource instanceof BitmapDrawable) { - // Bitmap bitmap = ((BitmapDrawable) resource).getBitmap(); - // Log.d(TAG,String.format(Locale.getDefault(), "Ready %s bitmap %,d bytes, - // size: %d x %d", - // unused_name, - // bitmap.getByteCount(), - // bitmap.getWidth(), - // bitmap.getHeight())); - } - return false; - } - }; - } - private LayerDrawable makeRound(int type, int background, int radius) { float[] outerRadii = new float[] {radius, radius, radius, radius, radius, radius, radius, radius}; diff --git a/android/java/org/chromium/chrome/browser/browsing_data/BraveClearBrowsingDataFragmentAdvanced.java b/android/java/org/chromium/chrome/browser/browsing_data/BraveClearBrowsingDataFragmentAdvanced.java index d07e46a38172..aad53bc57a95 100644 --- a/android/java/org/chromium/chrome/browser/browsing_data/BraveClearBrowsingDataFragmentAdvanced.java +++ b/android/java/org/chromium/chrome/browser/browsing_data/BraveClearBrowsingDataFragmentAdvanced.java @@ -19,7 +19,7 @@ import org.chromium.chrome.browser.util.TabUtils; import org.chromium.components.browser_ui.settings.ClickableSpansTextMessagePreference; import org.chromium.components.browser_ui.settings.SpinnerPreference; -import org.chromium.ui.text.NoUnderlineClickableSpan; +import org.chromium.ui.text.ChromeClickableSpan; import org.chromium.ui.text.SpanApplier; import org.chromium.ui.text.SpanApplier.SpanInfo; @@ -55,7 +55,7 @@ private ClickableSpansTextMessagePreference buildResetBraveRewardsDataPref() { new SpanInfo( "", "", - new NoUnderlineClickableSpan( + new ChromeClickableSpan( requireContext(), resetBraveRewardsDataCallback()))); ClickableSpansTextMessagePreference resetBraveRewardsDataPref = @@ -71,7 +71,7 @@ private ClickableSpansTextMessagePreference buildClearBraveAdsDataPref() { new SpanInfo( "", "", - new NoUnderlineClickableSpan( + new ChromeClickableSpan( requireContext(), clearBraveAdsDataCallback()))); ClickableSpansTextMessagePreference clearBraveAdsDataPref = diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/activities/BraveWalletActivity.java b/android/java/org/chromium/chrome/browser/crypto_wallet/activities/BraveWalletActivity.java index 5a822b5d49b3..57f31541d455 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/activities/BraveWalletActivity.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/activities/BraveWalletActivity.java @@ -176,7 +176,8 @@ public void onDestroy() { @Override protected ActivityWindowAndroid createWindowAndroid() { - return new ActivityWindowAndroid(this, true, getIntentRequestTracker(), null) { + return new ActivityWindowAndroid( + this, true, getIntentRequestTracker(), null, /* trackOcclusion= */ false) { @Override public ModalDialogManager getModalDialogManager() { return mModalDialogManager; diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/activities/NetworkSelectorActivity.java b/android/java/org/chromium/chrome/browser/crypto_wallet/activities/NetworkSelectorActivity.java index 6c749b9eeebd..99bfefdd798e 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/activities/NetworkSelectorActivity.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/activities/NetworkSelectorActivity.java @@ -115,6 +115,7 @@ private void initState() { } @NonNull + @SuppressWarnings("NoStreams") private NetworkModel.NetworkLists filterSupportedDapp( @NonNull final NetworkModel.NetworkLists networkLists) { final Predicate supportedNetworkFilter = diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/adapters/OnboardingNetworkSelectorGridAdapter.java b/android/java/org/chromium/chrome/browser/crypto_wallet/adapters/OnboardingNetworkSelectorGridAdapter.java index 2a986903e9b8..006a8da7e5f5 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/adapters/OnboardingNetworkSelectorGridAdapter.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/adapters/OnboardingNetworkSelectorGridAdapter.java @@ -330,6 +330,7 @@ public void filter(@NonNull final String text) { mHandler.postDelayed(mFilteringRunnable, DEBOUNCE_SEARCH_MILLIS); } + @SuppressWarnings("NoStreams") private void performFiltering( @NonNull final List source, @NonNull final List filtered, diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/dapps/SignSolTransactionsFragment.java b/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/dapps/SignSolTransactionsFragment.java index 91a9f3d121f2..9023529f2a67 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/dapps/SignSolTransactionsFragment.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/dapps/SignSolTransactionsFragment.java @@ -243,7 +243,7 @@ private void updateActionState(boolean isEnabled) { } else { mBtSign.setBackgroundTintList( ColorStateList.valueOf( - ContextCompat.getColor(requireContext(), R.color.modern_grey_700))); + ContextCompat.getColor(requireContext(), R.color.baseline_neutral_30))); } } diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/dapps/SiweMessageFragment.java b/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/dapps/SiweMessageFragment.java index f90e0ee5fec8..2884a236917c 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/dapps/SiweMessageFragment.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/fragments/dapps/SiweMessageFragment.java @@ -236,6 +236,7 @@ private void updateDetails(String chainId, AccountId accountId) { mTwoLineAdapter.notifyItemRangeChanged(0, items.size()); } + @SuppressWarnings("NoStreams") private String getSiweResources(Url[] urls) { if (urls == null || urls.length == 0) return ""; return Arrays.stream(urls) diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/presenters/Amount.java b/android/java/org/chromium/chrome/browser/crypto_wallet/presenters/Amount.java index 20912f502806..c66fb29f449d 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/presenters/Amount.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/presenters/Amount.java @@ -69,10 +69,6 @@ private static BigDecimal safeVal(Amount value) { return (value != null && value.mValue != null) ? value.mValue : BigDecimal.ZERO; } - private void safeInit() { - if (mValue == null) mValue = BigDecimal.ZERO; - } - public BigDecimal getValue() { return BigDecimal.valueOf(mValue.doubleValue()); } diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/AccountsPermissionsHelper.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/AccountsPermissionsHelper.java index 2169592508f4..12b1c8093e5f 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/AccountsPermissionsHelper.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/AccountsPermissionsHelper.java @@ -31,6 +31,7 @@ public HashSet getAccountsWithPermissions() { return mAccountsWithPermissions; } + @SuppressWarnings("NoStreams") private static boolean containsAccount(AccountId[] accounts, AccountId searchFor) { return Arrays.stream(accounts) .anyMatch( @@ -39,6 +40,7 @@ private static boolean containsAccount(AccountId[] accounts, AccountId searchFor }); } + @SuppressWarnings("NoStreams") public void checkAccounts(Runnable runWhenDone) { AccountId[] allAccountIds = Arrays.stream(mAccounts).map(acc -> acc.accountId).toArray(AccountId[]::new); diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/AndroidUtils.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/AndroidUtils.java index 3459a73a8ef9..d4c6a2ea69ec 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/AndroidUtils.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/AndroidUtils.java @@ -23,7 +23,7 @@ import org.chromium.base.Callback; import org.chromium.base.ContextUtils; import org.chromium.chrome.R; -import org.chromium.ui.text.NoUnderlineClickableSpan; +import org.chromium.ui.text.ChromeClickableSpan; public class AndroidUtils { public static int getToolBarHeight(Context context) { @@ -127,10 +127,10 @@ public static boolean isDebugBuild() { public static SpannableString createClickableSpanString( Context context, @StringRes int id, Callback listener) { - NoUnderlineClickableSpan noUnderlineClickableSpan = - new NoUnderlineClickableSpan(context, R.color.brave_link, listener); + ChromeClickableSpan chromeClickableSpan = + new ChromeClickableSpan(context, R.color.brave_link, listener); SpannableString spannableString = new SpannableString(context.getString(id)); - spannableString.setSpan(noUnderlineClickableSpan, 0, spannableString.length(), 0); + spannableString.setSpan(chromeClickableSpan, 0, spannableString.length(), 0); return spannableString; } } diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/AssetUtils.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/AssetUtils.java index 0bf5c9a60956..eab53f14586a 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/AssetUtils.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/AssetUtils.java @@ -63,6 +63,7 @@ public static boolean isSameToken( } } + @SuppressWarnings("NoStreams") public static AccountInfo[] filterAccountsByNetwork( AccountInfo[] accounts, @CoinType.EnumType int coinType, @Nullable String chainId) { @KeyringId.EnumType int keyringId = AssetUtils.getKeyring(coinType, chainId); diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/JavaUtils.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/JavaUtils.java index f972ffdd3297..542fa9af3594 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/JavaUtils.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/JavaUtils.java @@ -109,6 +109,7 @@ public static T[] asArray(T... items) { * @param items of string values. * @return a combined or empty string. */ + @SuppressWarnings("NoStreams") public static String concatStrings(String separator, String... items) { if (items == null) return ""; return Arrays.stream(items) diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/NetworkUtils.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/NetworkUtils.java index bbcfc5eca220..95b60c8a3b2c 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/NetworkUtils.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/NetworkUtils.java @@ -72,6 +72,7 @@ public static boolean isAllNetwork(@Nullable final NetworkInfo networkInfo) { return networkInfo.chainId.equals("all"); } + @SuppressWarnings("NoStreams") public static List nonTestNetwork(List networkInfos) { if (networkInfos == null) return Collections.emptyList(); return networkInfos.stream() diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/TokenUtils.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/TokenUtils.java index b0feb255cb9b..9bf69f0d149a 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/TokenUtils.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/TokenUtils.java @@ -72,6 +72,7 @@ public enum TokenType { * *

See `refreshVisibleTokenInfo` in components/brave_wallet_ui/common/async/lib.ts. */ + @SuppressWarnings("NoStreams") private static BlockchainToken[] filterTokens( NetworkInfo selectedNetwork, BlockchainToken[] tokens, diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/Utils.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/Utils.java index f2ea9a5bbbae..076a72b18cc0 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/Utils.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/Utils.java @@ -80,7 +80,7 @@ import org.chromium.chrome.browser.profiles.ProfileManager; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.util.TabUtils; -import org.chromium.ui.text.NoUnderlineClickableSpan; +import org.chromium.ui.text.ChromeClickableSpan; import org.chromium.ui.widget.Toast; import java.io.InputStream; @@ -1052,6 +1052,7 @@ public static AccountInfo findAccount(AccountInfo[] accounts, AccountId accountI return null; } + @SuppressWarnings("NoStreams") public static List filterAccountsByCoin( AccountInfo[] accounts, @CoinType.EnumType int coinType) { return Arrays.stream(accounts) @@ -1146,9 +1147,8 @@ public static SpannableString createSpanForSurroundedPhrase( SpannableString spannable = new SpannableString(AndroidUtils.formatHTML(htmlString)); URLSpan[] spans = spannable.getSpans(0, spannable.length(), URLSpan.class); for (URLSpan urlSpan : spans) { - NoUnderlineClickableSpan linkSpan = - new NoUnderlineClickableSpan( - context, R.color.brave_link, onClickListener::onClick); + ChromeClickableSpan linkSpan = + new ChromeClickableSpan(context, R.color.brave_link, onClickListener::onClick); int spanStart = spannable.getSpanStart(urlSpan); int spanEnd = spannable.getSpanEnd(urlSpan); spannable.setSpan(linkSpan, spanStart, spanEnd, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/WalletUtils.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/WalletUtils.java index 941ff619abcc..d051ba158a55 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/WalletUtils.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/WalletUtils.java @@ -55,6 +55,7 @@ public static String timeDeltaToDateString(TimeDelta timeDelta) { return dateFormat.format(new Date(timeDelta.microseconds / 1000)); } + @SuppressWarnings("NoStreams") public static String generateUniqueAccountName( @CoinType.EnumType int coinType, AccountInfo[] accountInfos) { Context context = ContextUtils.getApplicationContext(); diff --git a/android/java/org/chromium/chrome/browser/custom_layout/popup_window_tooltip/PopupWindowTooltipUtils.java b/android/java/org/chromium/chrome/browser/custom_layout/popup_window_tooltip/PopupWindowTooltipUtils.java index f9de969b59ef..c1732629608c 100644 --- a/android/java/org/chromium/chrome/browser/custom_layout/popup_window_tooltip/PopupWindowTooltipUtils.java +++ b/android/java/org/chromium/chrome/browser/custom_layout/popup_window_tooltip/PopupWindowTooltipUtils.java @@ -8,7 +8,6 @@ import android.content.Context; import android.graphics.RectF; -import android.os.Build; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; @@ -59,26 +58,8 @@ public static int tooltipGravityToArrowDirection(int tooltipGravity) { } } - private static ViewGroup.MarginLayoutParams getOrCreateMarginLayoutParams(View view) { - ViewGroup.LayoutParams lp = view.getLayoutParams(); - if (lp != null) { - if (lp instanceof ViewGroup.MarginLayoutParams) { - return (ViewGroup.MarginLayoutParams) lp; - } else { - return new ViewGroup.MarginLayoutParams(lp); - } - } else { - return new ViewGroup.MarginLayoutParams(view.getWidth(), view.getHeight()); - } - } - public static int getColor(Context context, @ColorRes int colorRes) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - return context.getColor(colorRes); - } else { - // noinspection deprecation - return context.getColor(colorRes); - } + return context.getColor(colorRes); } public static ViewGroup findFrameLayout(View anchorView) { diff --git a/android/java/org/chromium/chrome/browser/firstrun/BraveFirstRunFlowSequencer.java b/android/java/org/chromium/chrome/browser/firstrun/BraveFirstRunFlowSequencer.java index 1c9e4fd1620f..3d05cd1f2130 100644 --- a/android/java/org/chromium/chrome/browser/firstrun/BraveFirstRunFlowSequencer.java +++ b/android/java/org/chromium/chrome/browser/firstrun/BraveFirstRunFlowSequencer.java @@ -7,6 +7,8 @@ import org.chromium.base.supplier.OneshotSupplier; import org.chromium.chrome.browser.profiles.ProfileProvider; +import org.chromium.chrome.browser.signin.AppRestrictionSupplier; +import org.chromium.chrome.browser.signin.ChildAccountStatusSupplier; import org.chromium.components.signin.AccountManagerFacadeProvider; public abstract class BraveFirstRunFlowSequencer extends FirstRunFlowSequencer { @@ -15,7 +17,7 @@ public BraveFirstRunFlowSequencer(OneshotSupplier profileSuppli profileSupplier, new ChildAccountStatusSupplier( AccountManagerFacadeProvider.getInstance(), - FirstRunAppRestrictionInfo.takeMaybeInitialized())); + AppRestrictionSupplier.takeMaybeInitialized())); } @Override diff --git a/android/java/org/chromium/chrome/browser/firstrun/WelcomeOnboardingActivity.java b/android/java/org/chromium/chrome/browser/firstrun/WelcomeOnboardingActivity.java index 19473b491ed2..2adc1877cf33 100644 --- a/android/java/org/chromium/chrome/browser/firstrun/WelcomeOnboardingActivity.java +++ b/android/java/org/chromium/chrome/browser/firstrun/WelcomeOnboardingActivity.java @@ -238,10 +238,6 @@ private void onClickViews() { } } - private boolean shouldForceDefaultBrowserPrompt() { - return !isDefaultBrowser(); - } - private void setDefaultBrowserAndProceedToNextStep() { BraveSetDefaultBrowserUtils.setDefaultBrowser(this); if (!BraveSetDefaultBrowserUtils.supportsDefaultRoleManager()) { @@ -288,7 +284,7 @@ private void nextOnboardingStep() { FirstRunUtils.setEulaAccepted(); finish(); - sendFirstRunCompletePendingIntent(); + sendFirstRunCompleteIntent(); } } diff --git a/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java b/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java index 07dbf8181f7b..6b0817ed41bf 100644 --- a/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java +++ b/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java @@ -255,32 +255,6 @@ public long insertStats(BraveStatsTable braveStat) { // return -1; } - private boolean isAdsTrackerAlreadyAdded(BraveStatsTable braveStat) { - String sql = - "SELECT * FROM " - + BraveStatsTable.TABLE_NAME - + " WHERE " - + BraveStatsTable.COLUMN_STAT_SITE - + " = '" - + braveStat.getStatSite() - + "'" - + " AND " - + BraveStatsTable.COLUMN_URL - + " = '" - + braveStat.getUrl() - + "'"; - - Log.e("NTP", sql); - - SQLiteDatabase db = this.getReadableDatabase(); - Cursor cursor = db.rawQuery(sql, null); - - int count = cursor.getCount(); - cursor.close(); - - return count > 0; - } - @SuppressLint("Range") public List getAllStats() { List braveStats = new ArrayList<>(); diff --git a/android/java/org/chromium/chrome/browser/notifications/BraveOnboardingNotification.java b/android/java/org/chromium/chrome/browser/notifications/BraveOnboardingNotification.java index 3de09bd891b2..bcd23e3c2cd0 100644 --- a/android/java/org/chromium/chrome/browser/notifications/BraveOnboardingNotification.java +++ b/android/java/org/chromium/chrome/browser/notifications/BraveOnboardingNotification.java @@ -58,8 +58,7 @@ BRAVE_ONBOARDING_NOTIFICATION_TAG, getNotificationUrl(), public static void showOnboardingNotification() { Context context = ContextUtils.getApplicationContext(); if (context == null) return; - NotificationManagerProxyImpl notificationManager = - new NotificationManagerProxyImpl(context); + NotificationManagerProxyImpl notificationManager = new NotificationManagerProxyImpl(); NotificationBuilderBase notificationBuilder = new BraveNotificationBuilder(context) @@ -129,10 +128,9 @@ private static String getNotificationUrl() { } } - public static void cancelOnboardingNotification(Context context) { - NotificationManagerProxyImpl notificationManager = - new NotificationManagerProxyImpl(context); + public static void cancelOnboardingNotification() { + NotificationManagerProxyImpl notificationManager = new NotificationManagerProxyImpl(); notificationManager.cancel( - BRAVE_ONBOARDING_NOTIFICATION_TAG, BRAVE_ONBOARDING_NOTIFICATION_ID); + BRAVE_ONBOARDING_NOTIFICATION_TAG, BRAVE_ONBOARDING_NOTIFICATION_ID); } } diff --git a/android/java/org/chromium/chrome/browser/notifications/permissions/BraveNotificationPermissionRationaleDialogController.java b/android/java/org/chromium/chrome/browser/notifications/permissions/BraveNotificationPermissionRationaleDialogController.java index e23628f9018b..308f01d8f85f 100644 --- a/android/java/org/chromium/chrome/browser/notifications/permissions/BraveNotificationPermissionRationaleDialogController.java +++ b/android/java/org/chromium/chrome/browser/notifications/permissions/BraveNotificationPermissionRationaleDialogController.java @@ -24,10 +24,4 @@ public BraveNotificationPermissionRationaleDialogController( /** This is empty override method, to block default android 13 chromium dialog */ @Override public void showRationaleUi(Callback rationaleCallback) {} - - @SuppressWarnings("UnusedVariable") - private Callback wrapDialogDismissalCallback(Callback rationaleCallback) { - assert false : "wrapDialogDismissalCallback should be redirected to parent in bytecode!"; - return null; - } } diff --git a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java index 80dc8feb20c3..feb346a336a6 100644 --- a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java +++ b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java @@ -37,7 +37,6 @@ import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; import org.chromium.components.search_engines.TemplateUrlService; import org.chromium.ui.base.WindowAndroid; -import org.chromium.ui.modaldialog.ModalDialogManager; public class BraveNewTabPage extends NewTabPage { private JankTracker mJankTracker; @@ -57,7 +56,6 @@ public BraveNewTabPage( Activity activity, BrowserControlsStateProvider browserControlsStateProvider, Supplier activityTabProvider, - ModalDialogManager modalDialogManager, SnackbarManager snackbarManager, ActivityLifecycleDispatcher lifecycleDispatcher, TabModelSelector tabModelSelector, @@ -81,7 +79,6 @@ public BraveNewTabPage( activity, browserControlsStateProvider, activityTabProvider, - modalDialogManager, snackbarManager, lifecycleDispatcher, tabModelSelector, diff --git a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java index c791ae2fab70..3f7775fa5955 100644 --- a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java +++ b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java @@ -1485,22 +1485,6 @@ private void initBraveNewsController() { } } - private int getMaxRowsForMostVisitedTiles() { - try { - if (!ProfileManager.isInitialized() - || !UserPrefs.get(BraveActivity.getBraveActivity().getCurrentProfile()) - .getBoolean(BravePref.NEW_TAB_PAGE_SHOW_BACKGROUND_IMAGE)) { - return 2; - } else { - return 1; - } - } catch (BraveActivity.BraveActivityNotFoundException e) { - Log.e(TAG, "getMaxRowsForMostVisitedTiles ", e); - } - - return 2; - } - @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (mIsTablet) { diff --git a/android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPImageUtil.java b/android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPImageUtil.java index cc88b8c6c4d5..257a0d91e5a8 100644 --- a/android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPImageUtil.java +++ b/android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPImageUtil.java @@ -11,20 +11,13 @@ import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Build; -import android.text.SpannableString; -import android.text.Spanned; -import android.text.style.ForegroundColorSpan; import android.view.View; import org.chromium.base.ContextUtils; import org.chromium.base.Log; -import org.chromium.chrome.R; -import org.chromium.chrome.browser.BraveRewardsHelper; -import org.chromium.chrome.browser.app.ChromeActivity; import org.chromium.chrome.browser.ntp_background_images.NTPBackgroundImagesBridge; import org.chromium.chrome.browser.ntp_background_images.model.BackgroundImage; import org.chromium.chrome.browser.ntp_background_images.model.NTPImage; -import org.chromium.chrome.browser.ntp_background_images.model.SponsoredTab; import org.chromium.chrome.browser.ntp_background_images.model.Wallpaper; import org.chromium.chrome.browser.preferences.BravePref; import org.chromium.chrome.browser.profiles.Profile; @@ -47,61 +40,6 @@ public class NTPImageUtil { public static HashMap> imageCache = new HashMap>(); - // This function is not used, but removing it completely causes errors for unused resources: - // The resource R.string.earn_tokens_for_viewing appears to be unused [UnusedResources] - // The resource R.string.you_are_earning_tokens appears to be unused [UnusedResources] - // This is related to rewards, so I keep it till review - @SuppressWarnings("UnusedVariable") - private static SpannableString getBannerText( - ChromeActivity chromeActivity, - int ntpType, - View bannerLayout, - SponsoredTab sponsoredTab, - NewTabPageListener newTabPageListener) { - String bannerText = ""; - if (ntpType == SponsoredImageUtil.BR_ON_ADS_ON) { - bannerText = - String.format( - chromeActivity - .getResources() - .getString(R.string.you_are_earning_tokens), - chromeActivity.getResources().getString(R.string.learn_more)); - } else if (ntpType == SponsoredImageUtil.BR_ON_ADS_OFF) { - bannerText = - String.format( - chromeActivity - .getResources() - .getString(R.string.earn_tokens_for_viewing), - chromeActivity.getResources().getString(R.string.learn_more)); - } - int learnMoreIndex = - bannerText.indexOf(chromeActivity.getResources().getString(R.string.learn_more)); - Spanned learnMoreSpanned = BraveRewardsHelper.spannedFromHtmlString(bannerText); - SpannableString learnMoreTextSS = new SpannableString(learnMoreSpanned.toString()); - - ForegroundColorSpan brOffForegroundSpan = - new ForegroundColorSpan(chromeActivity.getColor(R.color.brave_theme_color)); - // setSpan gives us IndexOutOfBoundsException in case of end or start are > length and in - // some other cases. - int length = learnMoreTextSS.length(); - int endIndex = learnMoreIndex - + chromeActivity.getResources().getString(R.string.learn_more).length(); - if (endIndex < learnMoreIndex || learnMoreIndex >= length || endIndex >= length - || learnMoreIndex < 0 || endIndex < 0) { - return learnMoreTextSS; - } - try { - learnMoreTextSS.setSpan(brOffForegroundSpan, learnMoreIndex, endIndex, - Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - } catch (IndexOutOfBoundsException e) { - Log.e(TAG, - "getBannerText: learnMoreIndex == " + learnMoreIndex - + ", endIndex == " + endIndex + ". Error: " + e.getMessage()); - } - - return learnMoreTextSS; - } - public static Bitmap getWallpaperBitmap(NTPImage ntpImage, int layoutWidth, int layoutHeight) { Context mContext = ContextUtils.getApplicationContext(); diff --git a/android/java/org/chromium/chrome/browser/omnibox/BraveLocationBarCoordinator.java b/android/java/org/chromium/chrome/browser/omnibox/BraveLocationBarCoordinator.java index ab6073b5f469..8fa656d28a0d 100644 --- a/android/java/org/chromium/chrome/browser/omnibox/BraveLocationBarCoordinator.java +++ b/android/java/org/chromium/chrome/browser/omnibox/BraveLocationBarCoordinator.java @@ -16,6 +16,7 @@ import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.back_press.BackPressManager; +import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider; import org.chromium.chrome.browser.browser_controls.BrowserStateBrowserControlsVisibilityDelegate; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.merchant_viewer.MerchantTrustSignalsCoordinator; @@ -89,7 +90,9 @@ public BraveLocationBarCoordinator( LocationBarEmbedderUiOverrides uiOverrides, @Nullable View baseChromeLayout, Supplier bottomWindowPaddingSupplier, - @Nullable OnLongClickListener onLongClickListener) { + @Nullable OnLongClickListener onLongClickListener, + @Nullable BrowserControlsStateProvider browserControlsStateProvider, + boolean isToolbarPositionCustomizationEnabled) { super( locationBarLayout, autocompleteAnchorView, @@ -122,7 +125,9 @@ public BraveLocationBarCoordinator( () -> bottomWindowPaddingSupplier.get() + (isBottomToolbarVisible() ? locationBarLayout.getHeight() : 0), - onLongClickListener); + onLongClickListener, + browserControlsStateProvider, + isToolbarPositionCustomizationEnabled); if (mUrlBar != null) { ((UrlBar) mUrlBar).setSelectAllOnFocus(true); diff --git a/android/java/org/chromium/chrome/browser/playlist/PlaylistHostActivity.java b/android/java/org/chromium/chrome/browser/playlist/PlaylistHostActivity.java index 0ff6c591e34a..5c7692ee577d 100644 --- a/android/java/org/chromium/chrome/browser/playlist/PlaylistHostActivity.java +++ b/android/java/org/chromium/chrome/browser/playlist/PlaylistHostActivity.java @@ -432,29 +432,6 @@ private void openPlaylistInTab(boolean isIncognito, String url) { TabUtils.openUrlInNewTab(isIncognito, url); } - private void updatePlaylistItem(String playlistId, PlaylistItem playlistItem) { - if (mPlaylistViewModel == null) { - return; - } - PlaylistItemModel playlistItemModel = - new PlaylistItemModel( - playlistItem.id, - playlistId, - playlistItem.name, - playlistItem.pageSource.url, - playlistItem.mediaPath.url, - playlistItem.hlsMediaPath.url, - playlistItem.mediaSource.url, - playlistItem.thumbnailPath.url, - playlistItem.author, - playlistItem.duration, - playlistItem.lastPlayedPosition, - (long) playlistItem.mediaFileBytes, - playlistItem.cached, - false); - mPlaylistViewModel.updatePlaylistItem(playlistItemModel); - } - private void deleteHLSContent(String playlistItemId) { PostTask.postTask( TaskTraits.BEST_EFFORT_MAY_BLOCK, diff --git a/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java b/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java index 7355c1581ec2..575703643973 100644 --- a/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java +++ b/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java @@ -45,7 +45,7 @@ import org.chromium.gms.ChromiumPlayServicesAvailability; import org.chromium.mojo.bindings.ConnectionErrorHandler; import org.chromium.mojo.system.MojoException; -import org.chromium.ui.text.NoUnderlineClickableSpan; +import org.chromium.ui.text.ChromeClickableSpan; import org.chromium.ui.text.SpanApplier; import org.chromium.webcompat_reporter.mojom.WebcompatReporterHandler; @@ -64,6 +64,7 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE private static final String PREF_SYNC_AND_SERVICES_LINK = "sync_and_services_link"; private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data"; private static final String PREF_PRIVACY_SANDBOX = "privacy_sandbox"; + private static final String PREF_HTTPS_FIRST_MODE_LEGACY = "https_first_mode_legacy"; private static final String PREF_HTTPS_FIRST_MODE = "https_first_mode"; private static final String PREF_INCOGNITO_LOCK = "incognito_lock"; private static final String PREF_PHONE_AS_A_SECURITY_KEY = "phone_as_a_security_key"; @@ -73,6 +74,8 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE private static final String PREF_THIRD_PARTY_COOKIES = "third_party_cookies"; private static final String PREF_SECURITY_SECTION = "security_section"; private static final String PREF_PRIVACY_GUIDE = "privacy_guide"; + private static final String PREF_JAVASCRIPT_OPTIMIZER = "javascript_optimizer"; + private static final String PREF_PASSWORD_LEAK_DETECTION = "password_leak_detection"; // brave Prefs private static final String PREF_BRAVE_SHIELDS_GLOBALS_SECTION = @@ -125,6 +128,7 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE PREF_DE_AMP, PREF_DEBOUNCE, PREF_HTTPS_UPGRADE, + PREF_HTTPS_FIRST_MODE_LEGACY, PREF_HTTPS_FIRST_MODE, PREF_BLOCK_SCRIPTS, PREF_BLOCK_CROSS_SITE_COOKIES, @@ -154,6 +158,7 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE PREF_SNS, PREF_REQUEST_OTR, PREF_SECURE_DNS, + PREF_JAVASCRIPT_OPTIMIZER, PREF_BLOCK_COOKIE_CONSENT_NOTICES, PREF_BLOCK_SWITCH_TO_APP_NOTICES, PREF_DO_NOT_TRACK, @@ -178,7 +183,8 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE private TextMessagePreference mBlockCrosssiteCookiesLearnMore; private ChromeSwitchPreference mDeAmpPref; private ChromeSwitchPreference mDebouncePref; - private ChromeSwitchPreference mHttpsFirstModePref; + private ChromeSwitchPreference mHttpsFirstModePrefLegacy; + private Preference mHttpsFirstModePref; private BraveDialogPreference mHttpsUpgradePref; private BraveDialogPreference mFingerprintingProtectionPref; private ChromeSwitchPreference mFingerprintingProtection2Pref; @@ -262,14 +268,20 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { removePreferenceIfPresent(PREF_DEBOUNCE); } - mHttpsFirstModePref = (ChromeSwitchPreference) findPreference(PREF_HTTPS_FIRST_MODE); + boolean httpsByDefaultIsEnabled = + ChromeFeatureList.isEnabled(BraveFeatureList.HTTPS_BY_DEFAULT); + if (!ChromeFeatureList.isEnabled(ChromeFeatureList.HTTPS_FIRST_BALANCED_MODE)) { + mHttpsFirstModePrefLegacy = + (ChromeSwitchPreference) findPreference(PREF_HTTPS_FIRST_MODE_LEGACY); + mHttpsFirstModePrefLegacy.setVisible(!httpsByDefaultIsEnabled); + } else { + mHttpsFirstModePref = (Preference) findPreference(PREF_HTTPS_FIRST_MODE); + mHttpsFirstModePref.setVisible(!httpsByDefaultIsEnabled); + } mHttpsUpgradePref = (BraveDialogPreference) findPreference(PREF_HTTPS_UPGRADE); mHttpsUpgradePref.setOnPreferenceChangeListener(this); - boolean httpsByDefaultIsEnabled = - ChromeFeatureList.isEnabled(BraveFeatureList.HTTPS_BY_DEFAULT); - mHttpsFirstModePref.setVisible(!httpsByDefaultIsEnabled); mHttpsUpgradePref.setVisible(httpsByDefaultIsEnabled); mCanMakePayment = (ChromeSwitchPreference) findPreference(PREF_CAN_MAKE_PAYMENT); @@ -308,7 +320,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { new SpanApplier.SpanInfo( "", "", - new NoUnderlineClickableSpan( + new ChromeClickableSpan( requireContext(), R.color.brave_link, result -> { @@ -413,6 +425,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { removePreferenceIfPresent(PREF_THIRD_PARTY_COOKIES); removePreferenceIfPresent(PREF_SECURITY_SECTION); removePreferenceIfPresent(PREF_PRIVACY_GUIDE); + removePreferenceIfPresent(PREF_PASSWORD_LEAK_DETECTION); if (!ChromeFeatureList.isEnabled(BraveFeatureList.BRAVE_ANDROID_SAFE_BROWSING)) { removePreferenceIfPresent(PREF_SAFE_BROWSING); @@ -661,10 +674,14 @@ private void updateBravePreferences() { // HTTPS only mode boolean httpsByDefaultIsEnabled = ChromeFeatureList.isEnabled(BraveFeatureList.HTTPS_BY_DEFAULT); - mHttpsFirstModePref.setVisible(!httpsByDefaultIsEnabled); - mHttpsFirstModePref.setChecked( - UserPrefs.get(ProfileManager.getLastUsedRegularProfile()) - .getBoolean(Pref.HTTPS_ONLY_MODE_ENABLED)); + if (!ChromeFeatureList.isEnabled(ChromeFeatureList.HTTPS_FIRST_BALANCED_MODE)) { + mHttpsFirstModePrefLegacy.setVisible(!httpsByDefaultIsEnabled); + mHttpsFirstModePrefLegacy.setChecked( + UserPrefs.get(ProfileManager.getLastUsedRegularProfile()) + .getBoolean(Pref.HTTPS_ONLY_MODE_ENABLED)); + } else { + mHttpsFirstModePref.setVisible(!httpsByDefaultIsEnabled); + } if (blockAdTrackersPref.equals(BraveShieldsContentSettings.BLOCK_RESOURCE)) { mAdsTrakersBlockPref.setCheckedIndex(0); diff --git a/android/java/org/chromium/chrome/browser/qrreader/CameraSource.java b/android/java/org/chromium/chrome/browser/qrreader/CameraSource.java index f4374efffb31..75a6cc3a9e66 100644 --- a/android/java/org/chromium/chrome/browser/qrreader/CameraSource.java +++ b/android/java/org/chromium/chrome/browser/qrreader/CameraSource.java @@ -16,7 +16,6 @@ package org.chromium.chrome.browser.qrreader; import android.annotation.SuppressLint; -import android.annotation.TargetApi; import android.content.Context; import android.graphics.ImageFormat; import android.graphics.SurfaceTexture; @@ -31,6 +30,7 @@ import android.view.WindowManager; import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; import androidx.annotation.RequiresPermission; import androidx.annotation.StringDef; @@ -632,9 +632,10 @@ public void cancelAutoFocus() { * Sets camera auto-focus move callback. * * @param cb the callback to run - * @return {@code true} if the operation is supported (i.e. from Jelly Bean), {@code false} otherwise + * @return {@code true} if the operation is supported (i.e. from Jelly Bean), {@code false} + * otherwise */ - @TargetApi(Build.VERSION_CODES.JELLY_BEAN) + @RequiresApi(Build.VERSION_CODES.JELLY_BEAN) public boolean setAutoFocusMoveCallback(@Nullable AutoFocusMoveCallback cb) { synchronized (mCameraLock) { if (mCamera != null) { @@ -702,7 +703,7 @@ public void onAutoFocus(boolean success, Camera camera) { } /** Wraps the camera1 auto focus move callback so that the deprecated API isn't exposed. */ - @TargetApi(Build.VERSION_CODES.JELLY_BEAN) + @RequiresApi(Build.VERSION_CODES.JELLY_BEAN) private static class CameraAutoFocusMoveCallback implements Camera.AutoFocusMoveCallback { private AutoFocusMoveCallback mDelegate; diff --git a/android/java/org/chromium/chrome/browser/rewards/BraveRewardsPanel.java b/android/java/org/chromium/chrome/browser/rewards/BraveRewardsPanel.java index 62f8a0ce9354..e45cb7e73d2b 100644 --- a/android/java/org/chromium/chrome/browser/rewards/BraveRewardsPanel.java +++ b/android/java/org/chromium/chrome/browser/rewards/BraveRewardsPanel.java @@ -5,7 +5,6 @@ package org.chromium.chrome.browser.rewards; -import android.Manifest; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; @@ -33,7 +32,6 @@ import androidx.appcompat.widget.AppCompatImageView; import androidx.cardview.widget.CardView; -import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.core.content.res.ResourcesCompat; import androidx.viewpager.widget.ViewPager; @@ -43,7 +41,6 @@ import org.json.JSONException; import org.chromium.base.BraveReflectionUtil; -import org.chromium.base.BuildInfo; import org.chromium.base.ContextUtils; import org.chromium.base.Log; import org.chromium.base.SysUtils; @@ -79,11 +76,10 @@ import org.chromium.chrome.browser.util.TabUtils; import org.chromium.components.user_prefs.UserPrefs; import org.chromium.ui.base.DeviceFormFactor; -import org.chromium.ui.text.NoUnderlineClickableSpan; +import org.chromium.ui.text.ChromeClickableSpan; import org.chromium.ui.text.SpanApplier; import org.chromium.ui.text.SpanApplier.SpanInfo; -import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; @@ -188,9 +184,7 @@ public enum NotificationClickAction { private View mNotificationPermissionLayout; private boolean mNotificationShown; - private View mRewardsResponseModal; private View mConnectAccountModal; - private View mRewardsVbatExpireNoticeModal; private View mRewardsTosModal; private View mRewardsWalletBalance; @@ -296,7 +290,6 @@ private void setUpViews() { mPopupView.findViewById(R.id.brave_rewards_panel_notification_layout_id); mNotificationPermissionLayout = mPopupView.findViewById(R.id.brave_rewards_notification_permission_id); - mRewardsResponseModal = mPopupView.findViewById(R.id.rewards_response_modal_id); mConnectAccountModal = mPopupView.findViewById(R.id.connect_account_layout_id); mBraveRewardsUnverifiedView = mPopupView.findViewById(R.id.brave_rewards_panel_unverified_layout_id); @@ -307,9 +300,6 @@ private void setUpViews() { mPopupView.findViewById(R.id.brave_rewards_panel_payout_layout_id); mRewardsTipLayout = mPopupView.findViewById(R.id.brave_rewards_panel_tip_layout_id); - mRewardsVbatExpireNoticeModal = - mPopupView.findViewById(R.id.brave_rewards_vbat_expire_notice_modal_id); - mRewardsTosModal = mPopupView.findViewById(R.id.rewards_tos_layout_id); mRewardsWalletBalance = mPopupView.findViewById(R.id.wallet_balance_layout); @@ -827,32 +817,6 @@ public void onGetCurrentBalanceReport(double[] report) { } } - private void requestNotificationPermission() { - if (BravePermissionUtils.isBraveAdsNotificationPermissionBlocked(mAnchorView.getContext()) - || mActivity.shouldShowRequestPermissionRationale( - Manifest.permission.POST_NOTIFICATIONS) - || (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU - || !BuildInfo.targetsAtLeastT())) { - // other than android 13 redirect to - // setting page and for android 13 Last time don't allow selected in permission - // dialog, then enable through setting, this done through this dialog - showNotificationWarningDialog(); - } else { - // 1st time request permission - ActivityCompat.requestPermissions( - mActivity, new String[] {Manifest.permission.POST_NOTIFICATIONS}, 1); - } - } - - private void showNotificationWarningDialog() { - BraveNotificationWarningDialog notificationWarningDialog = - BraveNotificationWarningDialog.newInstance( - BraveNotificationWarningDialog.FROM_LAUNCHED_BRAVE_PANEL); - notificationWarningDialog.setCancelable(false); - notificationWarningDialog.show(mActivity.getSupportFragmentManager(), - BraveNotificationWarningDialog.NOTIFICATION_WARNING_DIALOG_TAG); - } - @Override public void onGetAdsAccountStatement( boolean success, @@ -1062,16 +1026,16 @@ private void showTermsOfServiceUi() { enableControls(false, mRewardsMainLayout); mRewardsTosModal.setVisibility(View.VISIBLE); - NoUnderlineClickableSpan resetClickableSpan = - new NoUnderlineClickableSpan( + ChromeClickableSpan resetClickableSpan = + new ChromeClickableSpan( mActivity, R.color.rewards_panel_notification_secondary_text_color, (textView) -> { TabUtils.openUrlInNewTab(false, BraveActivity.BRAVE_REWARDS_RESET_PAGE); dismiss(); }); - NoUnderlineClickableSpan tosClickableSpan = - new NoUnderlineClickableSpan( + ChromeClickableSpan tosClickableSpan = + new ChromeClickableSpan( mActivity, R.color.brave_blue_tint_color, (textView) -> { @@ -1557,85 +1521,6 @@ private void panelShadow(boolean isEnable) { } } - private void showVbatExpireNotice() { - if (mRewardsVbatExpireNoticeModal == null) { - return; - } - - panelShadow(true); - - mRewardsVbatExpireNoticeModal.setVisibility(View.VISIBLE); - TextView vBatModalTitle = mRewardsVbatExpireNoticeModal.findViewById(R.id.vbat_modal_title); - TextView vBatModalText = mRewardsVbatExpireNoticeModal.findViewById(R.id.vbat_modal_text); - FrameLayout vBatConnectButtonLayout = - mRewardsVbatExpireNoticeModal.findViewById(R.id.layout_vbat_connect_account); - vBatConnectButtonLayout.setVisibility( - mBraveRewardsNativeWorker.canConnectAccount() ? View.VISIBLE : View.GONE); - vBatConnectButtonLayout.setOnClickListener( - new View.OnClickListener() { - @Override - public void onClick(View v) { - TabUtils.openUrlInNewTab( - false, - BraveActivity.BRAVE_REWARDS_SETTINGS_WALLET_VERIFICATION_URL); - dismiss(); - } - }); - - Button vBatConnectButton = - mRewardsVbatExpireNoticeModal.findViewById(R.id.btn_vbat_connect_account); - vBatConnectButton.setOnClickListener( - new View.OnClickListener() { - @Override - public void onClick(View v) { - TabUtils.openUrlInNewTab( - false, - BraveActivity.BRAVE_REWARDS_SETTINGS_WALLET_VERIFICATION_URL); - dismiss(); - } - }); - - Button vBatLearnMoreButton = - mRewardsVbatExpireNoticeModal.findViewById(R.id.btn_vbat_learn_more); - vBatLearnMoreButton.setOnClickListener( - new View.OnClickListener() { - @Override - public void onClick(View v) { - CustomTabActivity.showInfoPage(mActivity, BRAVE_REWARDS_CHANGES_PAGE); - } - }); - AppCompatImageView vbatCloseBtn = - mRewardsVbatExpireNoticeModal.findViewById(R.id.vbat_modal_close); - vbatCloseBtn.setOnClickListener( - new View.OnClickListener() { - @Override - public void onClick(View v) { - if (mRewardsVbatExpireNoticeModal != null) { - mRewardsVbatExpireNoticeModal.setVisibility(View.GONE); - } - panelShadow(false); - } - }); - - String vbatModalTitleString = ""; - String vbatModalTextString = ""; - double dueDateInMillis = mBraveRewardsNativeWorker.getVbatDeadline(); - SimpleDateFormat sdf = new SimpleDateFormat("MMMM dd, yyyy h:mm a", Locale.getDefault()); - String dueDate = sdf.format(new Date((long) dueDateInMillis)); - if (mBraveRewardsNativeWorker.canConnectAccount()) { - vbatModalTitleString = mActivity.getString(R.string.vbat_supported_region_title); - vbatModalTextString = String.format( - mActivity.getString(R.string.vbat_supported_region_text), dueDate); - } else { - vbatModalTitleString = mActivity.getString(R.string.vbat_unsupported_region_title); - vbatModalTextString = - String.format(mActivity.getString(R.string.vbat_unsupported_region_text), - dueDate, mBraveRewardsNativeWorker.getCountryCode()); - } - vBatModalTitle.setText(vbatModalTitleString); - vBatModalText.setText(vbatModalTextString); - } - private void showConnectAccountModal() { if (mConnectAccountModal == null) { return; @@ -1687,13 +1572,18 @@ private SpannableString learnMoreSpannableString(String text) { SpannableString ss = new SpannableString(textToAgree.toString()); - NoUnderlineClickableSpan clickableSpan = new NoUnderlineClickableSpan( - mActivity, R.color.brave_rewards_modal_theme_color, (textView) -> { - CustomTabActivity.showInfoPage(mActivity, NEW_SIGNUP_DISABLED_URL); - }); + ChromeClickableSpan clickableSpan = + new ChromeClickableSpan( + mActivity, + R.color.brave_rewards_modal_theme_color, + (textView) -> { + CustomTabActivity.showInfoPage(mActivity, NEW_SIGNUP_DISABLED_URL); + }); int learnMoreIndex = text.indexOf(mActivity.getResources().getString(R.string.learn_more)); - ss.setSpan(clickableSpan, learnMoreIndex, + ss.setSpan( + clickableSpan, + learnMoreIndex, learnMoreIndex + mActivity.getResources().getString(R.string.learn_more).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); return ss; @@ -1705,84 +1595,23 @@ private SpannableString spannableClickSpan( SpannableString ss = new SpannableString(textMain.toString()); - NoUnderlineClickableSpan clickableSpan = - new NoUnderlineClickableSpan(mActivity, R.color.brave_rewards_modal_theme_color, - (textView) -> { CustomTabActivity.showInfoPage(mActivity, clickUrl); }); + ChromeClickableSpan clickableSpan = + new ChromeClickableSpan( + mActivity, + R.color.brave_rewards_modal_theme_color, + (textView) -> { + CustomTabActivity.showInfoPage(mActivity, clickUrl); + }); int clickableTextIndex = mainText.indexOf(clickableText); - ss.setSpan(clickableSpan, clickableTextIndex, clickableTextIndex + clickableText.length(), + ss.setSpan( + clickableSpan, + clickableTextIndex, + clickableTextIndex + clickableText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); return ss; } - private void showRewardsResponseModal(boolean isSuccess, String errorMessage) { - if (mRewardsResponseModal == null) { - return; - } - mRewardsResponseModal.setVisibility(View.VISIBLE); - - TextView responseModalTitle = mRewardsResponseModal.findViewById(R.id.response_modal_title); - TextView responseModalText = mRewardsResponseModal.findViewById(R.id.response_modal_text); - TextView responseErrorText = mRewardsResponseModal.findViewById(R.id.response_error_text); - TextView responseRewardsBtn = mRewardsResponseModal.findViewById(R.id.response_action_btn); - AppCompatImageView responseCloseBtn = - mRewardsResponseModal.findViewById(R.id.response_modal_close); - if (isSuccess) { - responseModalTitle.setText(mActivity.getString(R.string.thank_you)); - responseModalTitle.setCompoundDrawablesWithIntrinsicBounds( - 0, R.drawable.checked_circle_filled, 0, 0); - responseModalText.setText( - String.format(mActivity.getString(R.string.declare_geo_success_response_text), - new Locale("", mBraveRewardsNativeWorker.getCountryCode()) - .getDisplayCountry())); - responseRewardsBtn.setText(mActivity.getString(R.string.close_text)); - } else { - String title = mActivity.getString(R.string.something_went_wrong_text); - String text = mActivity.getString(R.string.declare_geo_failed_response_text); - String actionText = mActivity.getString(R.string.retry_text); - if (errorMessage.equals(WALLET_GENERATION_DISABLED_ERROR)) { - title = mActivity.getString(R.string.wallet_generation_disabled_error_title); - text = - String.format( - mActivity.getString(R.string.wallet_generation_disabled_error_text), - mActivity.getResources().getString(R.string.learn_more)); - SpannableString spannableWithLearnMore = learnMoreSpannableString(text); - responseModalText.setMovementMethod(LinkMovementMethod.getInstance()); - responseModalText.setText(spannableWithLearnMore); - actionText = mActivity.getString(R.string.close_text); - } else { - responseModalText.setText(text); - } - responseModalTitle.setText(title); - responseModalTitle.setCompoundDrawablesWithIntrinsicBounds( - 0, R.drawable.ic_warning_circle_filled, 0, 0); - responseRewardsBtn.setText(actionText); - responseErrorText.setText(errorMessage); - } - - responseRewardsBtn.setOnClickListener( - new View.OnClickListener() { - @Override - public void onClick(View v) { - mRewardsResponseModal.setVisibility(View.GONE); - mRewardsMainLayout.setForeground(null); - panelShadow(false); - if (!isSuccess && !errorMessage.equals(WALLET_GENERATION_DISABLED_ERROR)) { - showOnBoarding(); - } - } - }); - - responseCloseBtn.setOnClickListener( - new View.OnClickListener() { - @Override - public void onClick(View v) { - mRewardsResponseModal.setVisibility(View.GONE); - mRewardsMainLayout.setForeground(null); - } - }); - } - @Override public void onGetPublishersVisitedCount(int count) { if (mPopupView != null) { @@ -2002,13 +1831,6 @@ private void updateMonthlyContributionUI() { } } - private void openBannerActivity() { - Intent intent = new Intent( - ContextUtils.getApplicationContext(), RewardsTippingBannerActivity.class); - intent.putExtra(RewardsTippingBannerActivity.TAB_ID_EXTRA, mCurrentTabId); - mActivity.startActivityForResult(intent, BraveConstants.MONTHLY_CONTRIBUTION_REQUEST_CODE); - } - private void updatePublisherStatus(int pubStatus) { TextView publisherVerified = mPopupView.findViewById(R.id.publisher_verified); publisherVerified.setAlpha(1f); diff --git a/android/java/org/chromium/chrome/browser/rewards/onboarding/RewardsOnboarding.java b/android/java/org/chromium/chrome/browser/rewards/onboarding/RewardsOnboarding.java index 151a83c3695a..f1b6dfa83be2 100644 --- a/android/java/org/chromium/chrome/browser/rewards/onboarding/RewardsOnboarding.java +++ b/android/java/org/chromium/chrome/browser/rewards/onboarding/RewardsOnboarding.java @@ -38,7 +38,7 @@ import org.chromium.chrome.browser.rewards.BraveRewardsPanel; import org.chromium.chrome.browser.util.BraveTouchUtils; import org.chromium.chrome.browser.util.TabUtils; -import org.chromium.ui.text.NoUnderlineClickableSpan; +import org.chromium.ui.text.ChromeClickableSpan; import java.text.Collator; import java.util.ArrayList; @@ -289,14 +289,19 @@ private SpannableString learnMoreSpannableString(Context context, String text) { SpannableString ss = new SpannableString(textToAgree.toString()); - NoUnderlineClickableSpan clickableSpan = new NoUnderlineClickableSpan( - context, R.color.brave_rewards_modal_theme_color, (textView) -> { - CustomTabActivity.showInfoPage( - context, BraveRewardsPanel.NEW_SIGNUP_DISABLED_URL); - }); + ChromeClickableSpan clickableSpan = + new ChromeClickableSpan( + context, + R.color.brave_rewards_modal_theme_color, + (textView) -> { + CustomTabActivity.showInfoPage( + context, BraveRewardsPanel.NEW_SIGNUP_DISABLED_URL); + }); int learnMoreIndex = text.indexOf(context.getResources().getString(R.string.learn_more)); - ss.setSpan(clickableSpan, learnMoreIndex, + ss.setSpan( + clickableSpan, + learnMoreIndex, learnMoreIndex + context.getResources().getString(R.string.learn_more).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); return ss; diff --git a/android/java/org/chromium/chrome/browser/rewards/tipping/RewardsTippingPanelFragment.java b/android/java/org/chromium/chrome/browser/rewards/tipping/RewardsTippingPanelFragment.java index 771e93cafc7f..21aab07895a4 100644 --- a/android/java/org/chromium/chrome/browser/rewards/tipping/RewardsTippingPanelFragment.java +++ b/android/java/org/chromium/chrome/browser/rewards/tipping/RewardsTippingPanelFragment.java @@ -22,7 +22,6 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; -import android.widget.FrameLayout; import android.widget.ProgressBar; import android.widget.TextView; @@ -32,9 +31,6 @@ import androidx.core.content.res.ResourcesCompat; import androidx.fragment.app.Fragment; -import com.google.android.material.bottomsheet.BottomSheetBehavior; -import com.google.android.material.bottomsheet.BottomSheetDialog; - import org.json.JSONException; import org.chromium.base.Log; @@ -52,7 +48,7 @@ import org.chromium.chrome.browser.rewards.BraveRewardsBannerInfo; import org.chromium.chrome.browser.util.TabUtils; import org.chromium.ui.base.DeviceFormFactor; -import org.chromium.ui.text.NoUnderlineClickableSpan; +import org.chromium.ui.text.ChromeClickableSpan; import java.math.RoundingMode; import java.text.DecimalFormat; @@ -168,17 +164,12 @@ public void onBalance(boolean success) { private void setMonthlyInformationClick(View view) { View informationButton = view.findViewById(R.id.info_outline); - informationButton.setOnClickListener(v -> { - MonthlyContributionToolTip toolTip = new MonthlyContributionToolTip(view.getContext()); - toolTip.show(informationButton); - }); - } - - private void setupFullHeight(BottomSheetDialog bottomSheetDialog) { - FrameLayout bottomSheet = - (FrameLayout) bottomSheetDialog.findViewById(R.id.design_bottom_sheet); - BottomSheetBehavior behavior = BottomSheetBehavior.from(bottomSheet); - behavior.setState(BottomSheetBehavior.STATE_EXPANDED); + informationButton.setOnClickListener( + v -> { + MonthlyContributionToolTip toolTip = + new MonthlyContributionToolTip(view.getContext()); + toolTip.show(informationButton); + }); } private void updateTermsOfServicePlaceHolder(View view) { @@ -340,15 +331,22 @@ private void showAlreadySetMonthlyContribution() { private SpannableString stringMonthlyToSpannableString(String text) { Spanned textSpanned = BraveRewardsHelper.spannedFromHtmlString(text); SpannableString textSpannableString = new SpannableString(textSpanned.toString()); - NoUnderlineClickableSpan monthlyContributionClickableSpan = new NoUnderlineClickableSpan( - getActivity(), R.color.monthly_contributions_text_color, (textView) -> { - TabUtils.openUrlInNewTab( - false, BraveActivity.BRAVE_REWARDS_SETTINGS_MONTHLY_URL); - dismissRewardsPanel(); - }); - - BraveRewardsHelper.setSpan(getActivity(), text, textSpannableString, - R.string.monthly_contributions, monthlyContributionClickableSpan); + ChromeClickableSpan monthlyContributionClickableSpan = + new ChromeClickableSpan( + getActivity(), + R.color.monthly_contributions_text_color, + (textView) -> { + TabUtils.openUrlInNewTab( + false, BraveActivity.BRAVE_REWARDS_SETTINGS_MONTHLY_URL); + dismissRewardsPanel(); + }); + + BraveRewardsHelper.setSpan( + getActivity(), + text, + textSpannableString, + R.string.monthly_contributions, + monthlyContributionClickableSpan); return textSpannableString; } diff --git a/android/java/org/chromium/chrome/browser/rewards/tipping/TippingVerifiedCreatorToolTip.java b/android/java/org/chromium/chrome/browser/rewards/tipping/TippingVerifiedCreatorToolTip.java index 322f8244b577..72464be2fc7f 100644 --- a/android/java/org/chromium/chrome/browser/rewards/tipping/TippingVerifiedCreatorToolTip.java +++ b/android/java/org/chromium/chrome/browser/rewards/tipping/TippingVerifiedCreatorToolTip.java @@ -27,7 +27,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.BraveRewardsHelper; import org.chromium.chrome.browser.customtabs.CustomTabActivity; -import org.chromium.ui.text.NoUnderlineClickableSpan; +import org.chromium.ui.text.ChromeClickableSpan; public class TippingVerifiedCreatorToolTip { private static final String NEW_SIGNUP_DISABLED_URL = @@ -77,10 +77,13 @@ private SpannableString learnMoreSpannableString(Context context, String text) { SpannableString ss = new SpannableString(textToAgree.toString()); - NoUnderlineClickableSpan clickableSpan = new NoUnderlineClickableSpan( - context, R.color.brave_rewards_modal_theme_color, (textView) -> { - CustomTabActivity.showInfoPage(context, NEW_SIGNUP_DISABLED_URL); - }); + ChromeClickableSpan clickableSpan = + new ChromeClickableSpan( + context, + R.color.brave_rewards_modal_theme_color, + (textView) -> { + CustomTabActivity.showInfoPage(context, NEW_SIGNUP_DISABLED_URL); + }); int learnMoreIndex = text.indexOf(context.getResources().getString(R.string.learn_more)); diff --git a/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java b/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java index a89479476248..d55c4b7c21d6 100644 --- a/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java +++ b/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java @@ -6,12 +6,10 @@ package org.chromium.chrome.browser.settings; import android.content.Intent; -import android.content.res.Resources; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.provider.Settings; -import android.util.DisplayMetrics; import androidx.preference.Preference; @@ -174,12 +172,12 @@ private void notificationClick() { private void updateBravePreferences() { // Below prefs are removed from main settings. - removePreferenceIfPresent(MainSettings.PREF_SYNC_PROMO); removePreferenceIfPresent(MainSettings.PREF_SIGN_IN); removePreferenceIfPresent(MainSettings.PREF_SEARCH_ENGINE); removePreferenceIfPresent(MainSettings.PREF_UI_THEME); removePreferenceIfPresent(MainSettings.PREF_DOWNLOADS); removePreferenceIfPresent(MainSettings.PREF_SAFETY_CHECK); + removePreferenceIfPresent(MainSettings.PREF_SAFETY_HUB); removePreferenceIfPresent(MainSettings.PREF_ACCOUNT_AND_GOOGLE_SERVICES_SECTION); removePreferenceIfPresent(MainSettings.PREF_GOOGLE_SERVICES); removePreferenceIfPresent(MainSettings.PREF_HOME_MODULES_CONFIG); @@ -455,14 +453,6 @@ public boolean onPreferenceClick(Preference preference) { } } - // TODO(simonhong): Make this static public with proper class. - private int dp2px(int dp) { - final float dpPerInchMdpi = 160f; - DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics(); - float px = dp * (metrics.densityDpi / dpPerInchMdpi); - return Math.round(px); - } - @Override public boolean onPreferenceChange(Preference preference, Object newValue) { String key = preference.getKey(); diff --git a/android/java/org/chromium/chrome/browser/settings/BraveStatsPreferences.java b/android/java/org/chromium/chrome/browser/settings/BraveStatsPreferences.java index f745ff586614..fb4a578d1650 100644 --- a/android/java/org/chromium/chrome/browser/settings/BraveStatsPreferences.java +++ b/android/java/org/chromium/chrome/browser/settings/BraveStatsPreferences.java @@ -96,11 +96,6 @@ public ObservableSupplier getPageTitle() { return mPageTitle; } - private void removePreferenceIfPresent(String key) { - Preference preference = getPreferenceScreen().findPreference(key); - if (preference != null) getPreferenceScreen().removePreference(preference); - } - @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); diff --git a/android/java/org/chromium/chrome/browser/settings/BraveSyncScreensPreference.java b/android/java/org/chromium/chrome/browser/settings/BraveSyncScreensPreference.java index 1c840838f1ed..839523d00c05 100644 --- a/android/java/org/chromium/chrome/browser/settings/BraveSyncScreensPreference.java +++ b/android/java/org/chromium/chrome/browser/settings/BraveSyncScreensPreference.java @@ -12,7 +12,6 @@ import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; -import android.content.ContextWrapper; import android.content.DialogInterface; import android.content.pm.PackageManager; import android.content.res.Configuration; @@ -56,7 +55,6 @@ import org.json.JSONException; import org.json.JSONObject; -import org.chromium.base.ContextUtils; import org.chromium.base.Log; import org.chromium.base.ThreadUtils; import org.chromium.base.supplier.ObservableSupplier; @@ -903,38 +901,6 @@ private void seedWordsReceivedImpl(String seedWords, SyncInputType syncInputType getBraveSyncWorker().finalizeSyncSetup(); } - private void showMainSyncScrypt() { - if (null != mScrollViewSyncInitial) { - mScrollViewSyncInitial.setVisibility(View.VISIBLE); - } - if (null != mScrollViewAddMobileDevice) { - mScrollViewAddMobileDevice.setVisibility(View.GONE); - } - if (null != mScrollViewAddLaptop) { - mScrollViewAddLaptop.setVisibility(View.GONE); - } - if (null != mScrollViewSyncStartChain) { - mScrollViewSyncStartChain.setVisibility(View.GONE); - } - if (null != mScrollViewSyncChainCode) { - mScrollViewSyncChainCode.setVisibility(View.GONE); - } - if (null != mScrollViewEnterCodeWords) { - mScrollViewEnterCodeWords.setVisibility(View.GONE); - } - } - - // Handles the requesting of the camera permission. - private void requestCameraPermission() { - Log.w(TAG, "Camera permission is not granted. Requesting permission"); - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - final String[] permissions = new String[] {Manifest.permission.CAMERA}; - - requestPermissions(permissions, RC_HANDLE_CAMERA_PERM); - } - } - @SuppressLint("InlinedApi") private void createCameraSource(boolean autoFocus, boolean useFlash) { Context context = getActivity().getApplicationContext(); @@ -1594,15 +1560,6 @@ private void clearBackground(View view) { } } - private Context getBaseApplicationContext() { - Context context = ContextUtils.getApplicationContext(); - if (context instanceof ContextWrapper) { - return ((ContextWrapper) context).getBaseContext(); - } else { - return context; - } - } - // Handles 'Back' button. Returns true if it is handled, false otherwise. @Override public boolean onBackPressed() { diff --git a/android/java/org/chromium/chrome/browser/settings/BraveWalletNetworksPreference.java b/android/java/org/chromium/chrome/browser/settings/BraveWalletNetworksPreference.java index 54c4a7b1c9aa..2486a2050dda 100644 --- a/android/java/org/chromium/chrome/browser/settings/BraveWalletNetworksPreference.java +++ b/android/java/org/chromium/chrome/browser/settings/BraveWalletNetworksPreference.java @@ -195,6 +195,7 @@ public void updateNetworks() { }); } + @SuppressWarnings("NoStreams") private NetworkInfo[] filterNetworksByCoin( @CoinType.EnumType final int coinType, NetworkInfo[] networks) { return Arrays.stream(networks).filter(n -> n.coin == coinType).toArray(NetworkInfo[]::new); diff --git a/android/java/org/chromium/chrome/browser/settings/BraveWalletPreferences.java b/android/java/org/chromium/chrome/browser/settings/BraveWalletPreferences.java index a4b1fb463943..91862740dee6 100644 --- a/android/java/org/chromium/chrome/browser/settings/BraveWalletPreferences.java +++ b/android/java/org/chromium/chrome/browser/settings/BraveWalletPreferences.java @@ -31,7 +31,7 @@ import org.chromium.components.browser_ui.settings.TextMessagePreference; import org.chromium.mojo.bindings.ConnectionErrorHandler; import org.chromium.mojo.system.MojoException; -import org.chromium.ui.text.NoUnderlineClickableSpan; +import org.chromium.ui.text.ChromeClickableSpan; import org.chromium.ui.text.SpanApplier; public class BraveWalletPreferences extends BravePreferenceFragment @@ -179,7 +179,7 @@ private void setUpNftDiscoveryPreference() { new SpanApplier.SpanInfo( "", "", - new NoUnderlineClickableSpan( + new ChromeClickableSpan( requireContext(), R.color.brave_link, result -> { diff --git a/android/java/org/chromium/chrome/browser/settings/NetworkPreferenceAdapter.java b/android/java/org/chromium/chrome/browser/settings/NetworkPreferenceAdapter.java index 635aad7051d8..6a2654e146aa 100644 --- a/android/java/org/chromium/chrome/browser/settings/NetworkPreferenceAdapter.java +++ b/android/java/org/chromium/chrome/browser/settings/NetworkPreferenceAdapter.java @@ -33,7 +33,7 @@ import org.chromium.ui.listmenu.BasicListMenu; import org.chromium.ui.listmenu.ListMenu; import org.chromium.ui.listmenu.ListMenuButton; -import org.chromium.ui.listmenu.ListMenuButtonDelegate; +import org.chromium.ui.listmenu.ListMenuDelegate; import org.chromium.ui.listmenu.ListMenuItemProperties; import org.chromium.ui.modelutil.MVCListAdapter.ModelList; @@ -461,9 +461,9 @@ static class NetworkViewHolder extends ViewHolder { /** * Sets up the menu button at the end of this row with a given delegate. * - * @param delegate A {@link ListMenuButtonDelegate}. + * @param delegate A {@link ListMenuDelegate}. */ - void setMenuButtonDelegate(@NonNull final ListMenuButtonDelegate delegate) { + void setMenuButtonDelegate(@NonNull final ListMenuDelegate delegate) { mMoreButton.setVisibility(View.VISIBLE); mMoreButton.setDelegate(delegate); } diff --git a/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java b/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java index 3534f0882a6c..84ee3af8e339 100644 --- a/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java +++ b/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java @@ -510,11 +510,6 @@ public void onClick(View view) { initWebcompatReporterService(); } - private void shareStats() { - View shareStatsLayout = BraveStatsUtil.getLayout(R.layout.brave_stats_share_layout); - BraveStatsUtil.updateBraveShareStatsLayoutAndShare(shareStatsLayout); - } - private void setToggleView(boolean shouldShow) { if (shouldShow) { mSecondaryLayout.setVisibility(View.VISIBLE); diff --git a/android/java/org/chromium/chrome/browser/shields/CreateCustomFiltersFragment.java b/android/java/org/chromium/chrome/browser/shields/CreateCustomFiltersFragment.java index a6dc911a0d04..90d487cf1691 100644 --- a/android/java/org/chromium/chrome/browser/shields/CreateCustomFiltersFragment.java +++ b/android/java/org/chromium/chrome/browser/shields/CreateCustomFiltersFragment.java @@ -28,7 +28,7 @@ import org.chromium.chrome.browser.settings.BravePreferenceFragment; import org.chromium.mojo.bindings.ConnectionErrorHandler; import org.chromium.mojo.system.MojoException; -import org.chromium.ui.text.NoUnderlineClickableSpan; +import org.chromium.ui.text.ChromeClickableSpan; import org.chromium.ui.widget.Toast; public class CreateCustomFiltersFragment extends BravePreferenceFragment @@ -72,8 +72,8 @@ private void setData() { new SpannableString(summaryTextSpanned.toString()); if (getActivity() != null) { - NoUnderlineClickableSpan summaryTextClickableSpan = - new NoUnderlineClickableSpan( + ChromeClickableSpan summaryTextClickableSpan = + new ChromeClickableSpan( getActivity(), R.color.brave_link, (textView) -> { diff --git a/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java b/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java index 6d636dd2fa5c..f5a69bc3fb9f 100644 --- a/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java +++ b/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java @@ -11,6 +11,7 @@ import androidx.annotation.Nullable; import org.jni_zero.CalledByNative; +import org.jni_zero.JniType; import org.chromium.base.Callback; import org.chromium.chrome.browser.profiles.Profile; @@ -96,8 +97,8 @@ public String extractDomainName(String accountEmail) { @CalledByNative static SigninManager create( long nativeSigninManagerAndroid, - Profile profile, - IdentityManager identityManager, + @JniType("Profile*") Profile profile, + @JniType("signin::IdentityManager*") IdentityManager identityManager, IdentityMutator identityMutator, SyncService syncService) { AccountInfoServiceProvider.init(identityManager); diff --git a/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate.java b/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate.java index 55cba0d26498..60f118167792 100644 --- a/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate.java +++ b/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate.java @@ -33,6 +33,8 @@ public boolean isCategoryVisible(@SiteSettingsCategory.Type int type) { switch (type) { case SiteSettingsCategory.Type.STORAGE_ACCESS: return false; + case SiteSettingsCategory.Type.ANTI_ABUSE: + return false; default: return super.isCategoryVisible(type); } diff --git a/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java b/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java index 66b53eafde64..82105b23935c 100644 --- a/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java +++ b/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java @@ -48,7 +48,8 @@ import org.chromium.chrome.browser.ui.edge_to_edge.EdgeToEdgeController; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.chrome.browser.ui.system.StatusBarColorController.StatusBarColorProvider; -import org.chromium.components.browser_ui.edge_to_edge.EdgeToEdgeStateProvider; +import org.chromium.components.browser_ui.edge_to_edge.EdgeToEdgeManager; +import org.chromium.components.browser_ui.edge_to_edge.SystemBarColorHelper; import org.chromium.components.browser_ui.widget.MenuOrKeyboardActionController; import org.chromium.ui.InsetObserver; import org.chromium.ui.base.ActivityWindowAndroid; @@ -76,7 +77,6 @@ public BraveTabbedRootUiCoordinator( @NonNull OneshotSupplier hubManagerSupplier, @NonNull OneshotSupplier intentMetadataOneshotSupplier, @NonNull OneshotSupplier layoutStateProviderOneshotSupplier, - @NonNull Supplier lastUserInteractionTimeSupplier, @NonNull BrowserControlsManager browserControlsManager, @NonNull ActivityWindowAndroid windowAndroid, @NonNull ActivityLifecycleDispatcher activityLifecycleDispatcher, @@ -93,6 +93,7 @@ public BraveTabbedRootUiCoordinator( @NonNull Supplier tabContentManagerSupplier, @NonNull Supplier snackbarManagerSupplier, @NonNull ObservableSupplierImpl edgeToEdgeSupplier, + @NonNull OneshotSupplierImpl systemBarColorHelperSupplier, @ActivityType int activityType, @NonNull Supplier isInOverviewModeSupplier, @NonNull AppMenuDelegate appMenuDelegate, @@ -109,7 +110,7 @@ public BraveTabbedRootUiCoordinator( @Nullable ObservableSupplier overviewColorSupplier, @Nullable View baseChromeLayout, @NonNull ManualFillingComponentSupplier manualFillingComponentSupplier, - @NonNull EdgeToEdgeStateProvider edgeToEdgeStateProvider) { + @NonNull EdgeToEdgeManager edgeToEdgeManager) { super( activity, onOmniboxFocusChangedListener, @@ -124,7 +125,6 @@ public BraveTabbedRootUiCoordinator( hubManagerSupplier, intentMetadataOneshotSupplier, layoutStateProviderOneshotSupplier, - lastUserInteractionTimeSupplier, browserControlsManager, windowAndroid, activityLifecycleDispatcher, @@ -141,6 +141,7 @@ public BraveTabbedRootUiCoordinator( tabContentManagerSupplier, snackbarManagerSupplier, edgeToEdgeSupplier, + systemBarColorHelperSupplier, activityType, isInOverviewModeSupplier, appMenuDelegate, @@ -157,7 +158,7 @@ public BraveTabbedRootUiCoordinator( overviewColorSupplier, baseChromeLayout, manualFillingComponentSupplier, - edgeToEdgeStateProvider); + edgeToEdgeManager); mActivity = activity; mHubManagerSupplier = hubManagerSupplier; diff --git a/android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java b/android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java index e2aab8824a0c..1bcced81f8ff 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java +++ b/android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java @@ -275,6 +275,7 @@ public void enableBottomControls() { new BottomUiThemeColorProvider( mTopUiThemeColorProvider, mBrowserControlsSizer, + mBottomControlsStacker, mIncognitoStateProvider, mActivity); @@ -358,7 +359,8 @@ public void initializeWithNative( Runnable openGridTabSwitcherHandler, OnClickListener bookmarkClickHandler, OnClickListener customTabsBackClickHandler, - @Nullable ObservableSupplier archivedTabCountSupplier) { + @Nullable ObservableSupplier archivedTabCountSupplier, + ObservableSupplier tabModelNotificationDotSupplier) { super.initializeWithNative( layoutManager, @@ -366,7 +368,8 @@ public void initializeWithNative( openGridTabSwitcherHandler, bookmarkClickHandler, customTabsBackClickHandler, - archivedTabCountSupplier); + archivedTabCountSupplier, + tabModelNotificationDotSupplier); if (isToolbarPhone() && BottomToolbarConfiguration.isBottomToolbarEnabled()) { enableBottomControls(); @@ -374,7 +377,8 @@ public void initializeWithNative( () -> { mTabModelSelector .getModel(mIncognitoStateProvider.isIncognitoSelected()) - .closeTabs(TabClosureParams.closeAllTabs().build()); + .getTabRemover() + .closeTabs(TabClosureParams.closeAllTabs().build(), false); }; assert (mActivity instanceof ChromeActivity); diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarMediator.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarMediator.java index 3ce540050799..453d02ae3ab3 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarMediator.java +++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarMediator.java @@ -5,8 +5,6 @@ package org.chromium.chrome.browser.toolbar.bottom; -import androidx.annotation.ColorInt; - import org.chromium.chrome.browser.theme.ThemeColorProvider; import org.chromium.chrome.browser.theme.ThemeColorProvider.ThemeColorObserver; @@ -53,14 +51,4 @@ void destroy() { public void onThemeColorChanged(int primaryColor, boolean shouldAnimate) { mModel.set(BrowsingModeBottomToolbarModel.PRIMARY_COLOR, primaryColor); } - - /** - * Set the alpha for the color. - * @param baseColor The color which alpha will apply to. - * @param alpha The desired alpha for the color. The value should between 0 to 1. 0 means total - * transparency, 1 means total non-transparency. - */ - private @ColorInt int applyCustomAlphaToColor(@ColorInt int baseColor, float alpha) { - return (baseColor & 0x00FFFFFF) | ((int) (alpha * 255) << 24); - } } diff --git a/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java b/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java index b3fb2ba2f930..3bf4d54e1123 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java +++ b/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java @@ -10,7 +10,6 @@ import android.animation.Animator; import android.animation.ObjectAnimator; import android.app.Activity; -import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.content.res.ColorStateList; @@ -19,25 +18,17 @@ import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; -import android.text.SpannableString; -import android.text.Spanned; -import android.text.TextPaint; -import android.text.method.LinkMovementMethod; -import android.text.style.ClickableSpan; -import android.text.style.ForegroundColorSpan; import android.util.AttributeSet; import android.view.Gravity; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; -import android.view.Window; import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; -import androidx.annotation.NonNull; import androidx.core.content.ContextCompat; import androidx.core.content.res.ResourcesCompat; import androidx.core.widget.ImageViewCompat; @@ -67,7 +58,6 @@ import org.chromium.chrome.browser.brave_stats.BraveStatsUtil; import org.chromium.chrome.browser.crypto_wallet.controller.DAppsWalletController; import org.chromium.chrome.browser.custom_layout.popup_window_tooltip.PopupWindowTooltip; -import org.chromium.chrome.browser.customtabs.CustomTabActivity; import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar; import org.chromium.chrome.browser.dialogs.BraveAdsSignupDialog; import org.chromium.chrome.browser.flags.ChromeFeatureList; @@ -955,109 +945,6 @@ public void onConfigurationChanged(Configuration newConfig) { // TODO: show wallet panel } - private void showBraveRewardsOnboardingModal() { - Context context = getContext(); - final Dialog dialog = new Dialog(context); - dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); - dialog.setCancelable(false); - dialog.setContentView(R.layout.brave_rewards_onboarding_modal); - dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent); - - View braveRewardsOnboardingModalView = - dialog.findViewById(R.id.brave_rewards_onboarding_modal_layout); - - String tosText = - String.format(context.getResources().getString(R.string.brave_rewards_tos_text), - context.getResources().getString(R.string.terms_of_service), - context.getResources().getString(R.string.privacy_policy)); - int termsOfServiceIndex = - tosText.indexOf(context.getResources().getString(R.string.terms_of_service)); - Spanned tosTextSpanned = BraveRewardsHelper.spannedFromHtmlString(tosText); - SpannableString tosTextSS = new SpannableString(tosTextSpanned.toString()); - - ClickableSpan tosClickableSpan = new ClickableSpan() { - @Override - public void onClick(@NonNull View textView) { - CustomTabActivity.showInfoPage(context, BraveActivity.BRAVE_TERMS_PAGE); - } - @Override - public void updateDrawState(@NonNull TextPaint ds) { - super.updateDrawState(ds); - ds.setUnderlineText(false); - } - }; - - tosTextSS.setSpan( - tosClickableSpan, - termsOfServiceIndex, - termsOfServiceIndex - + context.getResources().getString(R.string.terms_of_service).length(), - Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - tosTextSS.setSpan( - new ForegroundColorSpan(context.getColor(R.color.brave_rewards_modal_theme_color)), - termsOfServiceIndex, - termsOfServiceIndex - + context.getResources().getString(R.string.terms_of_service).length(), - Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - - ClickableSpan privacyProtectionClickableSpan = new ClickableSpan() { - @Override - public void onClick(@NonNull View textView) { - CustomTabActivity.showInfoPage(context, BraveActivity.BRAVE_PRIVACY_POLICY); - } - @Override - public void updateDrawState(@NonNull TextPaint ds) { - super.updateDrawState(ds); - ds.setUnderlineText(false); - } - }; - - int privacyPolicyIndex = - tosText.indexOf(context.getResources().getString(R.string.privacy_policy)); - tosTextSS.setSpan(privacyProtectionClickableSpan, privacyPolicyIndex, - privacyPolicyIndex - + context.getResources().getString(R.string.privacy_policy).length(), - Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - tosTextSS.setSpan( - new ForegroundColorSpan(context.getColor(R.color.brave_rewards_modal_theme_color)), - privacyPolicyIndex, - privacyPolicyIndex - + context.getResources().getString(R.string.privacy_policy).length(), - Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - - TextView tosAndPpText = braveRewardsOnboardingModalView.findViewById( - R.id.brave_rewards_onboarding_modal_tos_pp_text); - tosAndPpText.setMovementMethod(LinkMovementMethod.getInstance()); - tosAndPpText.setText(tosTextSS); - BraveTouchUtils.ensureMinTouchTarget(tosAndPpText); - - TextView takeQuickTourButton = - braveRewardsOnboardingModalView.findViewById(R.id.take_quick_tour_button); - takeQuickTourButton.setOnClickListener( - new View.OnClickListener() { - @Override - public void onClick(View v) { - BraveRewardsHelper.setShowBraveRewardsOnboardingOnce(true); - openRewardsPanel(); - dialog.dismiss(); - } - }); - BraveTouchUtils.ensureMinTouchTarget(takeQuickTourButton); - TextView btnBraveRewards = - braveRewardsOnboardingModalView.findViewById(R.id.start_using_brave_rewards_text); - btnBraveRewards.setOnClickListener( - new View.OnClickListener() { - @Override - public void onClick(View v) { - BraveRewardsHelper.setShowDeclareGeoModal(true); - openRewardsPanel(); - dialog.dismiss(); - } - }); - - dialog.show(); - } - private void addSavedBandwidthToDb(long savings) { new AsyncTask() { @Override diff --git a/android/java/org/chromium/chrome/browser/util/TouchDelegateComposite.java b/android/java/org/chromium/chrome/browser/util/TouchDelegateComposite.java index ffc418040db0..4afb4abf425d 100644 --- a/android/java/org/chromium/chrome/browser/util/TouchDelegateComposite.java +++ b/android/java/org/chromium/chrome/browser/util/TouchDelegateComposite.java @@ -38,6 +38,7 @@ public void addDelegate(TouchDelegate delegate) { } /** Add a delegate by bounds and view. */ + @SuppressWarnings("NoStreams") public void addDelegate(Rect bounds, View view) { mDelegates = mDelegates.stream() diff --git a/android/java/res/drawable-hdpi/omnibox_https_valid.png b/android/java/res/drawable-hdpi/omnibox_https_valid_lock.png similarity index 100% rename from android/java/res/drawable-hdpi/omnibox_https_valid.png rename to android/java/res/drawable-hdpi/omnibox_https_valid_lock.png diff --git a/android/java/res/drawable-mdpi/omnibox_https_valid.png b/android/java/res/drawable-mdpi/omnibox_https_valid_lock.png similarity index 100% rename from android/java/res/drawable-mdpi/omnibox_https_valid.png rename to android/java/res/drawable-mdpi/omnibox_https_valid_lock.png diff --git a/android/java/res/drawable-xhdpi/omnibox_https_valid.png b/android/java/res/drawable-xhdpi/omnibox_https_valid_lock.png similarity index 100% rename from android/java/res/drawable-xhdpi/omnibox_https_valid.png rename to android/java/res/drawable-xhdpi/omnibox_https_valid_lock.png diff --git a/android/java/res/drawable-xxhdpi/omnibox_https_valid.png b/android/java/res/drawable-xxhdpi/omnibox_https_valid_lock.png similarity index 100% rename from android/java/res/drawable-xxhdpi/omnibox_https_valid.png rename to android/java/res/drawable-xxhdpi/omnibox_https_valid_lock.png diff --git a/android/java/res/drawable-xxxhdpi/omnibox_https_valid.png b/android/java/res/drawable-xxxhdpi/omnibox_https_valid_lock.png similarity index 100% rename from android/java/res/drawable-xxxhdpi/omnibox_https_valid.png rename to android/java/res/drawable-xxxhdpi/omnibox_https_valid_lock.png diff --git a/android/java/res/drawable/add_widget_button.xml b/android/java/res/drawable/add_widget_button.xml index 5cf4f87b325d..5313692f7e5d 100644 --- a/android/java/res/drawable/add_widget_button.xml +++ b/android/java/res/drawable/add_widget_button.xml @@ -7,7 +7,7 @@ - + diff --git a/android/java/res/drawable/checked_circle_filled.xml b/android/java/res/drawable/checked_circle_filled.xml deleted file mode 100644 index 46844e26a34d..000000000000 --- a/android/java/res/drawable/checked_circle_filled.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/android/java/res/drawable/crypto_wallet_blue_button.xml b/android/java/res/drawable/crypto_wallet_blue_button.xml index 7429467ed3cb..4616e61455b8 100644 --- a/android/java/res/drawable/crypto_wallet_blue_button.xml +++ b/android/java/res/drawable/crypto_wallet_blue_button.xml @@ -2,7 +2,7 @@ - + diff --git a/android/java/res/drawable/crypto_wallet_hollow_button.xml b/android/java/res/drawable/crypto_wallet_hollow_button.xml index 936e5972d884..768c6f9ce8a2 100644 --- a/android/java/res/drawable/crypto_wallet_hollow_button.xml +++ b/android/java/res/drawable/crypto_wallet_hollow_button.xml @@ -6,7 +6,7 @@ - + diff --git a/android/java/res/layout/brave_sync_done.xml b/android/java/res/layout/brave_sync_done.xml index 9dfec08fc1f9..a1ce4ee6dc3c 100644 --- a/android/java/res/layout/brave_sync_done.xml +++ b/android/java/res/layout/brave_sync_done.xml @@ -25,7 +25,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/brave_sync_settings_title" - android:textColor="@color/modern_grey_500" + android:textColor="@color/baseline_neutral_50" android:paddingStart="15dip" android:paddingTop="30dip" android:visibility="gone" /> @@ -37,7 +37,7 @@ android:layout_height="wrap_content" android:text="@string/brave_sync_settings_description" android:paddingStart="15dip" - android:textColor="@color/modern_grey_500" + android:textColor="@color/baseline_neutral_50" android:visibility="gone" /> + android:textColor="@color/baseline_neutral_50" /> + android:textColor="@color/baseline_neutral_40" /> + android:textColor="@color/baseline_neutral_40" /> diff --git a/android/java/res/layout/brave_sync_layout.xml b/android/java/res/layout/brave_sync_layout.xml index 844f7390c111..1953531c9da5 100644 --- a/android/java/res/layout/brave_sync_layout.xml +++ b/android/java/res/layout/brave_sync_layout.xml @@ -64,7 +64,7 @@ android:text="@string/brave_sync_start_new_chain" style="@style/BraveSyncBottomButton" android:background="@android:color/transparent" - android:textColor="@color/modern_grey_600" /> + android:textColor="@color/baseline_neutral_40" /> @@ -129,7 +129,7 @@ android:text="@string/enter_code_words_sync" style="@style/BraveSyncBottomButton" android:background="@android:color/transparent" - android:textColor="@color/modern_grey_600" /> + android:textColor="@color/baseline_neutral_40" /> @@ -271,7 +271,7 @@ android:text="@string/brave_sync_use_camera_text" style="@style/BraveSyncBottomButton" android:background="@android:color/transparent" - android:textColor="@color/modern_grey_600" /> + android:textColor="@color/baseline_neutral_40" /> diff --git a/android/java/res/values-night/brave_colors.xml b/android/java/res/values-night/brave_colors.xml index dbb321e6a9a1..8913f20bec34 100644 --- a/android/java/res/values-night/brave_colors.xml +++ b/android/java/res/values-night/brave_colors.xml @@ -88,7 +88,7 @@ @android:color/transparent - @color/modern_grey_800 + @color/baseline_neutral_20 #212529 #0d1214 @@ -101,7 +101,7 @@ @android:color/white - @color/modern_grey_800 + @color/baseline_neutral_20 #F0F2FF #F0F2FF diff --git a/android/java/res/values/brave_colors.xml b/android/java/res/values/brave_colors.xml index 09f69db7f793..241b8046802e 100644 --- a/android/java/res/values/brave_colors.xml +++ b/android/java/res/values/brave_colors.xml @@ -116,9 +116,9 @@ @color/baseline_neutral_90 - @color/modern_grey_700 + @color/baseline_neutral_30 - @color/modern_grey_700 + @color/baseline_neutral_30 #fb542b @@ -166,7 +166,7 @@ @color/white_alpha_70 @android:color/white - @color/modern_grey_800 + @color/baseline_neutral_20 #AA3B3B3B #F1F3F5 #49CC69 diff --git a/android/java/res/values/brave_styles.xml b/android/java/res/values/brave_styles.xml index 98bc38386bb3..49edf504604a 100644 --- a/android/java/res/values/brave_styles.xml +++ b/android/java/res/values/brave_styles.xml @@ -21,8 +21,8 @@ +