diff --git a/arm/android/media/ffmpeg/ffmpeg_common.cc b/arm/android/media/ffmpeg/ffmpeg_common.cc index 7c2f615e..910f9ad5 100644 --- a/arm/android/media/ffmpeg/ffmpeg_common.cc +++ b/arm/android/media/ffmpeg/ffmpeg_common.cc @@ -739,8 +739,9 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, AVMasteringDisplayMetadata* metadata = reinterpret_cast(side_data.data); + gfx::HdrMetadataSmpteSt2086 smpte_st_2086; if (metadata->has_primaries) { - hdr_metadata.smpte_st_2086.primaries = { + smpte_st_2086.primaries = { static_cast(av_q2d(metadata->display_primaries[0][0])), static_cast(av_q2d(metadata->display_primaries[0][1])), static_cast(av_q2d(metadata->display_primaries[1][0])), @@ -752,10 +753,14 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, }; } if (metadata->has_luminance) { - hdr_metadata.smpte_st_2086.luminance_max = - av_q2d(metadata->max_luminance); - hdr_metadata.smpte_st_2086.luminance_min = - av_q2d(metadata->min_luminance); + smpte_st_2086.luminance_max = av_q2d(metadata->max_luminance); + smpte_st_2086.luminance_min = av_q2d(metadata->min_luminance); + } + + // TODO(https://crbug.com/1446302): Consider rejecting metadata that does + // not specify all values. + if (metadata->has_primaries || metadata->has_luminance) { + hdr_metadata.smpte_st_2086 = smpte_st_2086; } } } diff --git a/arm/android/media/media_options.gni b/arm/android/media/media_options.gni index 59886659..e45fe3b2 100644 --- a/arm/android/media/media_options.gni +++ b/arm/android/media/media_options.gni @@ -112,7 +112,7 @@ declare_args() { # Windows, Mac, and Android. enable_hevc_parser_and_hw_decoder = proprietary_codecs && - (use_fuzzing_engine || is_win || is_mac || is_android || is_linux) + (use_fuzzing_engine || is_win || is_apple || is_android || is_linux) # Enable inclusion of VVC/H.266 parser/demuxer, and also enable VVC/H.266 decoding # with hardware acceleration provided by platform. Disabled by default for all builds. @@ -141,7 +141,7 @@ declare_args() { declare_args() { platform_has_optional_hevc_support = enable_platform_hevc && - (is_win || is_chromeos || is_linux || is_mac || is_android) + (is_win || is_chromeos || is_linux || is_apple || is_android) } assert(!enable_platform_ac3_eac3_audio || proprietary_codecs, @@ -257,7 +257,7 @@ if (is_cast_media_device) { "video_decoder", ] _default_mojo_media_host = "gpu" -} else if (is_mac || is_win) { +} else if (is_apple || is_win) { _default_mojo_media_services = [ "audio_decoder", "audio_encoder", diff --git a/arm/raspi/media/ffmpeg/ffmpeg_common.cc b/arm/raspi/media/ffmpeg/ffmpeg_common.cc index 7c2f615e..910f9ad5 100644 --- a/arm/raspi/media/ffmpeg/ffmpeg_common.cc +++ b/arm/raspi/media/ffmpeg/ffmpeg_common.cc @@ -739,8 +739,9 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, AVMasteringDisplayMetadata* metadata = reinterpret_cast(side_data.data); + gfx::HdrMetadataSmpteSt2086 smpte_st_2086; if (metadata->has_primaries) { - hdr_metadata.smpte_st_2086.primaries = { + smpte_st_2086.primaries = { static_cast(av_q2d(metadata->display_primaries[0][0])), static_cast(av_q2d(metadata->display_primaries[0][1])), static_cast(av_q2d(metadata->display_primaries[1][0])), @@ -752,10 +753,14 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, }; } if (metadata->has_luminance) { - hdr_metadata.smpte_st_2086.luminance_max = - av_q2d(metadata->max_luminance); - hdr_metadata.smpte_st_2086.luminance_min = - av_q2d(metadata->min_luminance); + smpte_st_2086.luminance_max = av_q2d(metadata->max_luminance); + smpte_st_2086.luminance_min = av_q2d(metadata->min_luminance); + } + + // TODO(https://crbug.com/1446302): Consider rejecting metadata that does + // not specify all values. + if (metadata->has_primaries || metadata->has_luminance) { + hdr_metadata.smpte_st_2086 = smpte_st_2086; } } } diff --git a/src/chrome/android/BUILD.gn b/src/chrome/android/BUILD.gn index 162a6b24..37b78dac 100644 --- a/src/chrome/android/BUILD.gn +++ b/src/chrome/android/BUILD.gn @@ -173,6 +173,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/feedback/android:java_resources", "//chrome/browser/image_descriptions:java_resources", "//chrome/browser/lens:java_resources", + "//chrome/browser/mandatory_reauth/android/internal:java_resources", "//chrome/browser/password_check/android:java_resources", "//chrome/browser/password_manager/android:java_resources", "//chrome/browser/quick_delete:java_resources", @@ -234,6 +235,7 @@ if (current_toolchain == default_toolchain) { deps = [ ":app_hooks_java", "//chrome/browser/accessibility/hierarchysnapshotter/android:delegate_public_impl_java", + "//chrome/browser/auxiliary_search:delegate_public_impl_java", "//chrome/browser/feed/android:hooks_public_impl_java", "//chrome/browser/feedback/android:delegate_public_impl_java", "//chrome/browser/lens:delegate_public_impl_java", @@ -291,7 +293,9 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/android/customtabs/branding:java", "//chrome/browser/android/lifecycle:java", "//chrome/browser/android/messages:java", + "//chrome/browser/android/metrics:java", "//chrome/browser/autofill/android:java", + "//chrome/browser/auxiliary_search:java", "//chrome/browser/back_press/android:java", "//chrome/browser/banners/android:java", "//chrome/browser/battery/android:java", @@ -335,15 +339,18 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/notifications/chime/android:java", "//chrome/browser/omaha/android:java", "//chrome/browser/optimization_guide/android:java", + "//chrome/browser/page_load_metrics:java", "//chrome/browser/paint_preview/android:java", "//chrome/browser/partnerbookmarks:delegate_java", "//chrome/browser/partnercustomizations:delegate_java", + "//chrome/browser/partnercustomizations:helper_java", "//chrome/browser/partnercustomizations:java", "//chrome/browser/password_check:public_java", "//chrome/browser/password_entry_edit:public_java", "//chrome/browser/password_manager/android:java", "//chrome/browser/password_manager/android:settings_interface_java", "//chrome/browser/password_manager/android/pwd_migration:java", + "//chrome/browser/password_manager/android/pwd_migration:java_resources", "//chrome/browser/policy/android:java", "//chrome/browser/preferences:java", "//chrome/browser/prefetch/android:java", @@ -353,6 +360,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/profiles/android:java", "//chrome/browser/quick_delete:java", "//chrome/browser/recent_tabs:factory_java", + "//chrome/browser/recent_tabs:helper_java", "//chrome/browser/recent_tabs:java", "//chrome/browser/safe_browsing/android:java", "//chrome/browser/safety_check/android:java", @@ -388,6 +396,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/ui/android/night_mode:java", "//chrome/browser/ui/android/omnibox:java", "//chrome/browser/ui/android/page_info:java", + "//chrome/browser/ui/android/page_insights:java", "//chrome/browser/ui/android/quickactionsearchwidget:java", "//chrome/browser/ui/android/searchactivityutils:java", "//chrome/browser/ui/android/signin:java", @@ -403,7 +412,6 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/webauthn/android:java", "//chrome/browser/xsurface:java", "//components/autofill/android:autofill_java", - "//components/autofill/android:prefeditor_autofill_java", "//components/background_task_scheduler:background_task_scheduler_java", "//components/background_task_scheduler:background_task_scheduler_task_ids_java", "//components/bookmarks/common/android:bookmarks_java", @@ -543,7 +551,6 @@ if (current_toolchain == default_toolchain) { "//content/public/common:common_java", "//device/gamepad:java", "//media/base/android:media_java", - "//media/capture/content/android:screen_capture_java", "//media/capture/video/android:capture_java", "//media/midi:midi_java", "//mojo/public/java:bindings_java", @@ -599,6 +606,7 @@ if (current_toolchain == default_toolchain) { "//third_party/metrics_proto:metrics_proto_java", "//ui/accessibility:ax_base_java", "//ui/android:ui_java", + "//ui/android:ui_no_recycler_view_java", "//ui/base/ime/mojom:mojom_java", "//ui/base/mojom:mojom_java", "//ui/gfx/geometry/mojom:mojom_java", @@ -739,6 +747,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/commerce/merchant_viewer/android:java", "//chrome/browser/content_creation/notes/internal/android:java", "//chrome/browser/download/internal/android:java", + "//chrome/browser/mandatory_reauth/android/internal:java", "//chrome/browser/password_check:internal_java", "//chrome/browser/password_edit_dialog/android:java", "//chrome/browser/password_entry_edit/android/internal:java", @@ -822,8 +831,11 @@ if (current_toolchain == default_toolchain) { # Needed by androidx.test.core.app.ActivityScenario android_manifest = "//chrome/android/junit/AndroidManifest.xml" - # This target OOMs with the default 1G (also OOMS with 2G). - max_heap_size = "4G" + # This target OOMs with the default 1G, and hits CodeCache errors with + # default 4 shards (crbug.com/1453254). + # TODO(crbug.com/1383650): Remove once test runner shards by SDK. + max_heap_size = "3600M" + extra_args = [ "--shards=7" ] package_name = chrome_public_manifest_package @@ -849,6 +861,7 @@ if (current_toolchain == default_toolchain) { "$google_play_services_package:google_play_services_cast_framework_java", "$google_play_services_package:google_play_services_cast_java", "$google_play_services_package:google_play_services_gcm_java", + "$google_play_services_package:google_play_services_tasks_java", "//base:base_java_test_support", "//base:base_java_test_support_uncommon", "//base:base_junit_test_support", @@ -878,7 +891,9 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/android/customtabs/branding:junit", "//chrome/browser/android/httpclient:junit_tests", "//chrome/browser/android/lifecycle:java", + "//chrome/browser/android/metrics:java", "//chrome/browser/autofill/android:java", + "//chrome/browser/autofill/android:junit", "//chrome/browser/back_press/android:java", "//chrome/browser/back_press/android:junit", "//chrome/browser/banners/android:java", @@ -922,10 +937,12 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/lens:java", "//chrome/browser/loading_modal/android:junit", "//chrome/browser/locale:java", + "//chrome/browser/mandatory_reauth/android/internal:junit", "//chrome/browser/notifications:java", "//chrome/browser/notifications:junit_tests", "//chrome/browser/omaha/android:java", "//chrome/browser/optimization_guide/android:java", + "//chrome/browser/page_load_metrics:java", "//chrome/browser/partnercustomizations:java", "//chrome/browser/partnercustomizations:junit", "//chrome/browser/password_edit_dialog/android:junit", @@ -943,6 +960,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/quick_delete:java", "//chrome/browser/quick_delete:junit", "//chrome/browser/recent_tabs:java", + "//chrome/browser/recent_tabs:junit", "//chrome/browser/recent_tabs/internal:junit", "//chrome/browser/safety_check/android:java", "//chrome/browser/safety_check/android:junit", @@ -966,6 +984,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/tabpersistence:junit", "//chrome/browser/thumbnail:java", "//chrome/browser/touch_to_fill/common/android:junit", + "//chrome/browser/touch_to_fill/password_generation/android/internal:junit", "//chrome/browser/touch_to_fill/payments/android/internal:junit", "//chrome/browser/ui/android/appmenu:java", "//chrome/browser/ui/android/appmenu/internal:junit", @@ -1011,7 +1030,6 @@ if (current_toolchain == default_toolchain) { "//chrome/test/android:chrome_java_unit_test_support", "//components/autofill/android:autofill_features_java", "//components/autofill/android:main_autofill_java", - "//components/autofill/android:prefeditor_autofill_java", "//components/background_task_scheduler:background_task_scheduler_java", "//components/background_task_scheduler:background_task_scheduler_task_ids_java", "//components/bookmarks/common/android:bookmarks_java", @@ -1131,6 +1149,7 @@ if (current_toolchain == default_toolchain) { "//third_party/gif_player:gif_player_java", "//third_party/google-truth:google_truth_java", "//third_party/hamcrest:hamcrest_java", + "//ui/accessibility:ax_base_java", "//ui/android:ui_java", "//ui/android:ui_java_test_support", "//ui/android:ui_junit_test_support", @@ -1216,12 +1235,12 @@ if (current_toolchain == default_toolchain) { "//cc:cc_java", "//chrome/android:chrome_java", "//chrome/browser/android/browserservices/intents:java", + "//chrome/browser/autofill/android:java", "//chrome/browser/flags:java", "//chrome/browser/profiles/android:java", "//chrome/browser/tab:java", "//chrome/browser/ui/android/appmenu:java", "//chrome/test/android:chrome_java_integration_test_support", - "//components/autofill/android:prefeditor_autofill_java", "//components/payments/content/android:java", "//components/payments/content/android:java_resources", "//components/payments/content/android:service_java", @@ -1457,6 +1476,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/android/customtabs/branding:java", "//chrome/browser/android/httpclient:javatests", "//chrome/browser/android/lifecycle:java", + "//chrome/browser/android/metrics:java", "//chrome/browser/android/metrics:ukm_java_test_support", "//chrome/browser/android/metrics:ukm_javatests", "//chrome/browser/autofill/android:java_resources", @@ -1502,6 +1522,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/omaha/android:java", "//chrome/browser/optimization_guide/android:java", "//chrome/browser/optimization_guide/android:javatests", + "//chrome/browser/page_load_metrics:java", "//chrome/browser/paint_preview/android:java", "//chrome/browser/paint_preview/android:javatests", "//chrome/browser/partnercustomizations:delegate_java", @@ -1511,6 +1532,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/password_entry_edit/android/internal:javatests", "//chrome/browser/password_manager/android:java", "//chrome/browser/password_manager/android:test_support_java", + "//chrome/browser/password_manager/android/pwd_migration:java", "//chrome/browser/policy/android:java", "//chrome/browser/preferences:java", "//chrome/browser/prefetch/android:java", @@ -1522,6 +1544,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/profiles/android:java", "//chrome/browser/quick_delete:java", "//chrome/browser/quick_delete:javatests", + "//chrome/browser/recent_tabs/internal:javatests", "//chrome/browser/safe_browsing/android:java", "//chrome/browser/safe_browsing/android:javatests", "//chrome/browser/safety_check/android:java", @@ -1578,8 +1601,8 @@ if (current_toolchain == default_toolchain) { "//chrome/test/android:chrome_java_integration_test_support", "//chrome/test/android:chrome_java_test_pagecontroller", "//chrome/test/android/test_trusted_web_activity:test_trusted_web_activity_java", + "//components/autofill/android:autofill_features_java", "//components/autofill/android:autofill_java", - "//components/autofill/android:prefeditor_autofill_java", "//components/background_task_scheduler:background_task_scheduler_java", "//components/background_task_scheduler:background_task_scheduler_task_ids_java", "//components/bookmarks/common/android:bookmarks_java", @@ -1707,6 +1730,7 @@ if (current_toolchain == default_toolchain) { "//net/android:net_java", "//net/android:net_java_test_support", "//services:services_javatests", + "//services/device/public/java:device_feature_list_java", "//services/device/public/java:geolocation_java", "//services/device/public/java:geolocation_java_test_support", "//services/device/public/mojom:mojom_java", @@ -1893,6 +1917,8 @@ if (current_toolchain == default_toolchain) { resources_package = "org.chromium.chrome.vr" sources = [ + "javatests/src/org/chromium/chrome/browser/vr/WebXrVrPermissionTestFramework.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrVrTestFramework.java", "javatests/src/org/chromium/chrome/browser/vr/rules/VrModuleNotInstalled.java", "javatests/src/org/chromium/chrome/browser/vr/rules/VrTestRule.java", "javatests/src/org/chromium/chrome/browser/vr/util/NativeUiUtils.java", @@ -1921,27 +1947,26 @@ if (current_toolchain == default_toolchain) { if (enable_gvr_services) { sources += [ - "javatests/src/org/chromium/chrome/browser/vr/EmulatedVrController.java", + "javatests/src/org/chromium/chrome/browser/vr/EmulatedGvrController.java", + "javatests/src/org/chromium/chrome/browser/vr/GvrDaydreamReadyModuleInstallTest.java", + "javatests/src/org/chromium/chrome/browser/vr/GvrInstallUpdateMessageTest.java", "javatests/src/org/chromium/chrome/browser/vr/TestVrShellDelegate.java", - "javatests/src/org/chromium/chrome/browser/vr/VrDaydreamReadyModuleInstallTest.java", - "javatests/src/org/chromium/chrome/browser/vr/VrInstallUpdateMessageTest.java", # TODO(https://crbug.com/1429384): Modify these tests to run on non-GVR runtimes. - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrDeviceTest.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrInputTest.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrPermissionTest.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrPermissionTestFramework.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrTabTest.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrTestFramework.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrTransitionTest.java", - "javatests/src/org/chromium/chrome/browser/vr/mock/MockVrCoreVersionChecker.java", - "javatests/src/org/chromium/chrome/browser/vr/mock/MockVrDaydreamApi.java", - "javatests/src/org/chromium/chrome/browser/vr/rules/ChromeTabbedActivityVrTestRule.java", - "javatests/src/org/chromium/chrome/browser/vr/rules/CustomTabActivityVrTestRule.java", - "javatests/src/org/chromium/chrome/browser/vr/rules/WebappActivityVrTestRule.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrGvrDeviceTest.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrGvrInputTest.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrGvrPermissionTest.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrGvrTabTest.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrGvrTestFramework.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrGvrTransitionTest.java", + "javatests/src/org/chromium/chrome/browser/vr/mock/MockGvrVrCoreVersionChecker.java", + "javatests/src/org/chromium/chrome/browser/vr/mock/MockGvrVrDaydreamApi.java", + "javatests/src/org/chromium/chrome/browser/vr/rules/ChromeTabbedActivityGvrTestRule.java", + "javatests/src/org/chromium/chrome/browser/vr/rules/CustomTabActivityGvrTestRule.java", + "javatests/src/org/chromium/chrome/browser/vr/rules/WebappActivityGvrTestRule.java", + "javatests/src/org/chromium/chrome/browser/vr/util/GvrTestRuleUtils.java", + "javatests/src/org/chromium/chrome/browser/vr/util/GvrTransitionUtils.java", "javatests/src/org/chromium/chrome/browser/vr/util/VrShellDelegateUtils.java", - "javatests/src/org/chromium/chrome/browser/vr/util/VrTestRuleUtils.java", - "javatests/src/org/chromium/chrome/browser/vr/util/VrTransitionUtils.java", ] deps += [ @@ -2357,7 +2382,7 @@ if (current_toolchain == default_toolchain) { chrome_public_apk_or_module_tmpl("chrome_public_apk") { target_type = "android_apk" - apk_name = "ThoriumPublic" + apk_name = "Thorium_Public" enable_multidex = is_java_debug baseline_profile_path = "//chrome/android/baseline_profiles/profile.txt" } @@ -2626,6 +2651,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/ui/android/appmenu/internal:unit_device_javatests", "//chrome/browser/ui/android/night_mode:unit_device_javatests", "//chrome/browser/ui/android/omnibox:unit_device_javatests", + "//chrome/browser/ui/android/page_insights:unit_device_javatests", "//chrome/browser/ui/android/searchactivityutils:unit_device_javatests", "//chrome/browser/ui/android/signin:unit_device_javatests", "//chrome/browser/ui/messages/android:unit_device_javatests", @@ -2673,6 +2699,7 @@ if (current_toolchain == default_toolchain) { ":chrome_test_apk_template_resources", ":chrome_test_java", "//chrome/android/features/keyboard_accessory:test_java", + "//chrome/browser/autofill/android:test_java", "//chrome/browser/autofill/test:test_java", "//chrome/browser/banners/android:javatests", "//chrome/browser/download/internal/android:javatests", @@ -2682,6 +2709,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/password_manager/android/pwd_migration:javatests", "//chrome/browser/subresource_filter:subresource_filter_javatests", "//chrome/browser/touch_to_fill/android:test_java", + "//chrome/browser/touch_to_fill/password_generation/android/internal:javatests", "//chrome/browser/touch_to_fill/payments/android/internal:javatests", "//chrome/browser/ui/android/fast_checkout/internal:javatests", "//chrome/browser/ui/android/omnibox:javatests", @@ -2961,9 +2989,9 @@ if (current_toolchain == default_toolchain) { args = [ "--product", "chrome_android", + "--zero-tests-executed-ok", "--browser-apk", "@WrappedPath(apks/ChromePublic.apk)", - "-v", ] data_deps = [ ":chrome_public_apk", @@ -3237,11 +3265,10 @@ generate_jni("chrome_jni_headers") { "java/src/org/chromium/chrome/browser/autofill/AutofillSnackbarController.java", "java/src/org/chromium/chrome/browser/autofill/CardUnmaskBridge.java", "java/src/org/chromium/chrome/browser/autofill/CreditCardScannerBridge.java", - "java/src/org/chromium/chrome/browser/autofill/PhoneNumberUtil.java", "java/src/org/chromium/chrome/browser/autofill/SaveUpdateAddressProfilePrompt.java", "java/src/org/chromium/chrome/browser/autofill/SaveUpdateAddressProfilePromptController.java", "java/src/org/chromium/chrome/browser/autofill/settings/AutofillPaymentMethodsDelegate.java", - "java/src/org/chromium/chrome/browser/autofill/settings/AutofillProfileBridge.java", + "java/src/org/chromium/chrome/browser/autofill/settings/SettingsLauncherHelper.java", "java/src/org/chromium/chrome/browser/autofill/settings/VirtualCardEnrollmentFields.java", "java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchBridge.java", "java/src/org/chromium/chrome/browser/background_sync/BackgroundSyncBackgroundTask.java", @@ -3323,7 +3350,6 @@ generate_jni("chrome_jni_headers") { "java/src/org/chromium/chrome/browser/media/PictureInPictureActivity.java", "java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterClient.java", "java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java", - "java/src/org/chromium/chrome/browser/metrics/PageLoadMetrics.java", "java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java", "java/src/org/chromium/chrome/browser/metrics/UmaUtils.java", "java/src/org/chromium/chrome/browser/metrics/VariationsSession.java", @@ -3357,6 +3383,7 @@ generate_jni("chrome_jni_headers") { "java/src/org/chromium/chrome/browser/password_manager/PasswordGenerationDialogBridge.java", "java/src/org/chromium/chrome/browser/password_manager/PasswordGenerationPopupBridge.java", "java/src/org/chromium/chrome/browser/password_manager/PasswordManagerLauncher.java", + "java/src/org/chromium/chrome/browser/password_manager/PasswordMigrationWarningBridge.java", "java/src/org/chromium/chrome/browser/password_manager/settings/PasswordUIView.java", "java/src/org/chromium/chrome/browser/permissions/NotificationBlockedDialog.java", "java/src/org/chromium/chrome/browser/permissions/PermissionSettingsBridge.java", @@ -3444,6 +3471,7 @@ group("jni_headers") { "//chrome/android/features/start_surface:jni_headers", "//chrome/browser/android/browserservices/metrics:jni_headers", "//chrome/browser/android/browserservices/verification:jni_headers", + "//chrome/browser/android/metrics:jni_headers", "//chrome/browser/battery/android:jni_headers", "//chrome/browser/commerce/merchant_viewer/android:jni_headers", "//chrome/browser/commerce/price_tracking/android:jni_headers", @@ -3456,9 +3484,12 @@ group("jni_headers") { "//chrome/browser/image_descriptions:jni_headers", "//chrome/browser/incognito:jni_headers", "//chrome/browser/locale:jni_headers", + "//chrome/browser/mandatory_reauth/android:jni_headers", + "//chrome/browser/page_load_metrics:jni_headers", "//chrome/browser/preferences:jni_headers", "//chrome/browser/privacy:jni_headers", "//chrome/browser/profiles/android:jni_headers", + "//chrome/browser/quick_delete:jni_headers", "//chrome/browser/search_engines/android:jni_headers", "//chrome/browser/segmentation_platform:jni_headers", "//chrome/browser/tab:jni_headers", @@ -3486,9 +3517,6 @@ template("libchrome_impl") { chrome_common_shared_library(target_name) { sources = [ "../browser/android/chrome_entry_point.cc" ] deps = [] - if (allow_jni_multiplexing) { - enable_jni_multiplexing = true - } if (defined(invoker.deps)) { deps += invoker.deps } @@ -3531,6 +3559,7 @@ chrome_common_shared_library("libchromefortest") { "//base/test:test_support", "//chrome:chrome_android_core", "//chrome/browser/android/metrics:ukm_utils_for_test", + "//chrome/browser/autofill:test_support", "//chrome/browser/password_manager/android:test_support", "//chrome/browser/subresource_filter:android_test_support", "//chrome/browser/supervised_user:test_support", @@ -3558,11 +3587,8 @@ chrome_common_shared_library("libchromefortest") { java_targets = [ "//chrome/android:chrome_public_unit_test_apk__test_apk", "//chrome/android:chrome_public_test_apk__test_apk", - "//chrome/test/android:chrome_java_test_pagecontroller_tests__test_apk", "//chrome/test/android:chrome_java_test_wpr_tests__test_apk", "//chrome/test/android:chrome_java_test_feed_test__test_apk", - "//chrome/test/android:chrome_webapk_integration_tests__test_apk", - "//chrome/test/android:chrome_java_test_pagecontroller_codelab__test_apk", ] if (enable_vr) { java_targets += [ "//chrome/android:chrome_public_test_vr_apk__test_apk" ] @@ -3588,9 +3614,6 @@ template("libmonochrome_apk_or_bundle_tmpl") { deps += [ "//weblayer:weblayer_lib" ] } - if (allow_jni_multiplexing) { - enable_jni_multiplexing = true - } if (android_64bit_target_cpu) { java_targets = [ "//chrome/android:monochrome_64_public_bundle" ] } else { diff --git a/src/chrome/browser/feed/android/java/res/layout/new_tab_page_feed_v2_expandable_header.xml b/src/chrome/browser/feed/android/java/res/layout/new_tab_page_feed_v2_expandable_header.xml index e15ddc95..c89b2363 100644 --- a/src/chrome/browser/feed/android/java/res/layout/new_tab_page_feed_v2_expandable_header.xml +++ b/src/chrome/browser/feed/android/java/res/layout/new_tab_page_feed_v2_expandable_header.xml @@ -1,6 +1,6 @@ diff --git a/src/chrome/browser/feed/android/java/res/layout/new_tab_page_multi_feed_header.xml b/src/chrome/browser/feed/android/java/res/layout/new_tab_page_multi_feed_header.xml index 102ba230..15ca071b 100644 --- a/src/chrome/browser/feed/android/java/res/layout/new_tab_page_multi_feed_header.xml +++ b/src/chrome/browser/feed/android/java/res/layout/new_tab_page_multi_feed_header.xml @@ -1,6 +1,6 @@ diff --git a/src/chrome/browser/ui/android/strings/android_chrome_strings.grd b/src/chrome/browser/ui/android/strings/android_chrome_strings.grd index f3377487..8ec93b76 100644 --- a/src/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/src/chrome/browser/ui/android/strings/android_chrome_strings.grd @@ -1,5 +1,5 @@ - + @@ -1135,6 +1167,9 @@ Private state tokens improve privacy on the web and can’t be used to find out You can block topics you don't want shared with sites. Thorium also auto-deletes your topics older than 4 weeks. <link>Learn more</link> + + Thorium auto-deletes topics that are older than 4 weeks. As you keep browsing, a topic might reappear on the list. Or you can block topics you don’t want Thorium to share with sites. Learn more about <link>managing your ad privacy in Thorium.</link> + As you browse, whether an ad you see is personalized depends on this setting, <link1>Site-suggested ads</link1>, your <link2>cookie settings</link2>, and if the site you're viewing personalizes ads. @@ -1198,7 +1233,7 @@ Private state tokens improve privacy on the web and can’t be used to find out For example, if you visit a site that sells long-distance running shoes, the site might decide that you’re interested in running marathons. Later, if you visit a different site, that site can show you an ad for running shoes suggested by the first site. - Thorium auto-deletes sites that are older than 30 days. A site you visit again might reappear on the list. Or you can block a site from suggesting ads for you. + Thorium auto-deletes sites that are older than 30 days. A site you visit again might reappear on the list. Or you can block a site from suggesting ads for you. Learn more about <link>managing your ad privacy in Thorium.</link> Block %1$sexample.com @@ -2965,10 +3000,10 @@ To change this setting, <resetlink>reset sync

- %1$sGoogle Maps will open in Thorium. By continuing, you agree to the <LINK1>Google Terms of Service</LINK1>, and the <LINK2>Thorium and ThoriumOS Additional Terms of Service</LINK2>. + %1$sGoogle Maps will open in Thorium. By continuing, you agree to the <LINK1>Google Terms of Service</LINK1>, and the <LINK2>Google Thorium and ThoriumOS Additional Terms of Service</LINK2>. - %1$sGoogle Maps will open in Thorium. By continuing, you agree to the <LINK1>Google Terms of Service</LINK1>, and the <LINK2>Thorium and ThoriumOS Additional Terms of Service</LINK2>. The <LINK3>Privacy Policy</LINK3> also applies. + %1$sGoogle Maps will open in Thorium. By continuing, you agree to the <LINK1>Google Terms of Service</LINK1>, and the <LINK2>Google Thorium and ThoriumOS Additional Terms of Service</LINK2>. The <LINK3>Privacy Policy</LINK3> also applies. Accept & continue @@ -3271,9 +3306,6 @@ To change this setting, <resetlink>reset sync

Manage reactions - - Manage autoplay - Manage @@ -3319,18 +3351,15 @@ To change this setting, <resetlink>reset sync

Manage the topics you're interested in + + Manage the topics and searches you're interested in + Hidden Hide and unhide topics - - Autoplay - - - Manage Video Preview Settings - Following @@ -4119,9 +4148,6 @@ To change this setting, <resetlink>reset sync

Showing suggestions for %1$sCrater Lake National Park (U.S. National Park Service) - - Thorium action button: %sclear browsing data - %d12 suggested items in list below. @@ -4298,24 +4324,15 @@ To change this setting, <resetlink>reset sync

- - - Autoplay + + + Page insights bottom sheet - - Video previews + + Page insights bottom sheet is opened - - Choose how video previews will automatically play on the Thorium homepage. - - - Never - - - Only on Wi-Fi - - - On Wi-Fi & mobile data + + Page insights bottom sheet is closed @@ -4534,14 +4551,14 @@ To change this setting, <resetlink>reset sync

Reload the current page, ignoring cached content - + Open the Thorium Help Center in a new tab Tab and window shortcuts - Thorium feature shortcuts + Google Thorium feature shortcuts Webpage shortcuts @@ -4995,7 +5012,7 @@ To change this setting, <resetlink>reset sync

- Thorium as a Security Key + Google Thorium as a Security Key <resetlink>reset sync

+ + Copy image with link + + Copy GIF + + Copy without link + + Screenshot @@ -5255,20 +5280,8 @@ To change this setting, <resetlink>reset sync

- - Include link - - - - Exclude link - - - - Text Copied - - - - Image Copied + + Including link: %1$shttps://www.example.com @@ -5451,7 +5464,7 @@ To change this setting, <resetlink>reset sync

- Use Lite mode on Thorium + Use Lite mode on Google Thorium Google recommends Thorium @@ -5733,6 +5746,29 @@ To change this setting, <resetlink>reset sync

Deleted + + + + Strong password suggested. Keyboard hidden. + + + Password suggestion is closed. + + + Use strong password? + + + You won’t need to remember this password. It will be saved to Google Password Manager for %1$selisa.becket@gmail.com. + + + You won’t need to remember this password. It will be saved to Google Password Manager. + + + Use password + + + Create my own + diff --git a/src/chrome/browser/ui/views/frame/browser_root_view.cc b/src/chrome/browser/ui/views/frame/browser_root_view.cc index 25bfc04f..800bf67b 100644 --- a/src/chrome/browser/ui/views/frame/browser_root_view.cc +++ b/src/chrome/browser/ui/views/frame/browser_root_view.cc @@ -385,7 +385,7 @@ void BrowserRootView::PaintChildren(const views::PaintInfo& paint_info) { DCHECK(widget); const SkColor toolbar_top_separator_color = widget->GetColorProvider()->GetColor( - tabstrip()->ShouldPaintAsActiveFrame() + GetWidget()->ShouldPaintAsActive() ? kColorToolbarTopSeparatorFrameActive : kColorToolbarTopSeparatorFrameInactive); diff --git a/src/chrome/browser/ui/views/tabs/tab.cc b/src/chrome/browser/ui/views/tabs/tab.cc index fbc9354d..08ecc711 100644 --- a/src/chrome/browser/ui/views/tabs/tab.cc +++ b/src/chrome/browser/ui/views/tabs/tab.cc @@ -65,6 +65,7 @@ #include "ui/base/pointer/touch_ui_controller.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/theme_provider.h" +#include "ui/base/ui_base_features.h" #include "ui/compositor/clip_recorder.h" #include "ui/compositor/compositor.h" #include "ui/gfx/animation/tween.h" @@ -195,7 +196,7 @@ Tab::Tab(TabSlotController* controller) title_animation_(this) { DCHECK(controller); - tab_style_views_ = TabStyleViews::Create()->CreateForTab(this); + tab_style_views_ = TabStyleViews::CreateForTab(this); // So we get don't get enter/exit on children and don't prematurely stop the // hover. @@ -292,7 +293,10 @@ void Tab::Layout() { UpdateIconVisibility(); int start = contents_rect.x(); - if (extra_padding_before_content_) { + + // ChromeRefresh doesnt respect this extra padding since it has exact values + // for left/right padding. + if (extra_padding_before_content_ && !features::IsChromeRefresh2023()) { constexpr int kExtraLeftPaddingToBalanceCloseButtonPadding = 4; start += kExtraLeftPaddingToBalanceCloseButtonPadding; } @@ -314,9 +318,7 @@ void Tab::Layout() { } // Add space for insets outside the favicon bounds. favicon_bounds.Inset(-icon_->GetInsets()); - favicon_bounds.set_size( - gfx::Size(icon_->GetPreferredSize().width(), - contents_rect.height() - favicon_bounds.y())); + favicon_bounds.set_size(icon_->GetPreferredSize()); } icon_->SetBoundsRect(favicon_bounds); icon_->SetVisible(showing_icon_); @@ -335,7 +337,7 @@ void Tab::Layout() { // for touch events. // TODO(pkasting): The padding should maybe be removed, see comments in // TabCloseButton::TargetForRect(). - const int close_button_size = TabCloseButton::GetGlyphSize(); + const int close_button_size = GetLayoutConstant(TAB_CLOSE_BUTTON_SIZE); const int top = contents_rect.y() + Center(contents_rect.height(), close_button_size); // Clamp the close button position to "centered within the tab"; this should @@ -745,9 +747,8 @@ TabSlotView::ViewType Tab::GetTabSlotViewType() const { } TabSizeInfo Tab::GetTabSizeInfo() const { - return {tab_style()->GetPinnedWidth(), - tab_style_views()->GetMinimumActiveWidth(), - tab_style_views()->GetMinimumInactiveWidth(), + return {tab_style()->GetPinnedWidth(), tab_style()->GetMinimumActiveWidth(), + tab_style()->GetMinimumInactiveWidth(), tab_style()->GetStandardWidth()}; } @@ -772,7 +773,7 @@ absl::optional Tab::GetGroupColor() const { controller_->GetGroupColorId(group().value())); } -SkColor Tab::GetAlertIndicatorColor(TabAlertState state) const { +ui::ColorId Tab::GetAlertIndicatorColor(TabAlertState state) const { const ui::ColorProvider* color_provider = GetColorProvider(); if (!color_provider) return gfx::kPlaceholderColor; @@ -811,10 +812,9 @@ SkColor Tab::GetAlertIndicatorColor(TabAlertState state) const { kColorTabAlertAudioPlayingInactiveFrameActive}, {kColorTabAlertAudioPlayingActiveFrameInactive, kColorTabAlertAudioPlayingActiveFrameActive}}}; - return color_provider->GetColor( - color_ids[group][tab_style_views()->GetApparentActiveState() == - TabActive::kActive] - [controller_->ShouldPaintAsActiveFrame()]); + return color_ids[group][tab_style_views()->GetApparentActiveState() == + TabActive::kActive] + [GetWidget()->ShouldPaintAsActive()]; } bool Tab::IsActive() const { diff --git a/src/chrome/browser/ui/views/tabs/tab_strip.cc b/src/chrome/browser/ui/views/tabs/tab_strip.cc index 2e678b31..057dc81d 100644 --- a/src/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/src/chrome/browser/ui/views/tabs/tab_strip.cc @@ -1704,10 +1704,6 @@ bool TabStrip::HasVisibleBackgroundTabShapes() const { return controller_->HasVisibleBackgroundTabShapes(); } -bool TabStrip::ShouldPaintAsActiveFrame() const { - return controller_->ShouldPaintAsActiveFrame(); -} - SkColor TabStrip::GetTabSeparatorColor() const { return separator_color_; } @@ -1727,9 +1723,9 @@ SkColor TabStrip::GetTabBackgroundColor( using State = BrowserFrameActiveState; const bool tab_active = active == TabActive::kActive; - const bool frame_active = - (active_state == State::kActive) || - ((active_state == State::kUseCurrent) && ShouldPaintAsActiveFrame()); + const bool frame_active = (active_state == State::kActive) || + ((active_state == State::kUseCurrent) && + GetWidget()->ShouldPaintAsActive()); return cp->GetColor(kColorIds[tab_active][frame_active]); } @@ -1745,7 +1741,7 @@ SkColor TabStrip::GetTabForegroundColor(TabActive active) const { kColorTabForegroundActiveFrameActive}}; const bool tab_active = active == TabActive::kActive; - const bool frame_active = ShouldPaintAsActiveFrame(); + const bool frame_active = GetWidget()->ShouldPaintAsActive(); return cp->GetColor(kColorIds[tab_active][frame_active]); } @@ -1793,7 +1789,7 @@ tab_groups::TabGroupColorId TabStrip::GetGroupColorId( SkColor TabStrip::GetPaintedGroupColor( const tab_groups::TabGroupColorId& color_id) const { return GetColorProvider()->GetColor( - GetTabGroupTabStripColorId(color_id, ShouldPaintAsActiveFrame())); + GetTabGroupTabStripColorId(color_id, GetWidget()->ShouldPaintAsActive())); } void TabStrip::ShiftGroupLeft(const tab_groups::TabGroupId& group) { diff --git a/src/chrome/browser/ui/views/tabs/tab_style_views.cc b/src/chrome/browser/ui/views/tabs/tab_style_views.cc index 82a3957a..86439c6b 100644 --- a/src/chrome/browser/ui/views/tabs/tab_style_views.cc +++ b/src/chrome/browser/ui/views/tabs/tab_style_views.cc @@ -107,6 +107,28 @@ class GM2TabStyleViews : public TabStyleViews { // Returns the progress (0 to 1) of the hover animation. double GetHoverAnimationValue() const override; + // Scales |bounds| by scale and aligns so that adjacent tabs meet up exactly + // during painting. + gfx::RectF ScaleAndAlignBounds(const gfx::Rect& bounds, + float scale, + int stroke_thickness) const; + + // Given a tab of width |width|, returns the radius to use for the corners. + float GetTopCornerRadiusForWidth(int width) const; + + protected: + // Returns a single separator's opacity based on whether it is the + // logically `leading` separator. `for_layout` has the same meaning as in + // GetSeparatorOpacities(). + virtual float GetSeparatorOpacity(bool for_layout, bool leading) const; + + // Helper that returns an interpolated opacity if the tab or its neighbor + // `other_tab` is mid-hover-animation. Used in almost all cases when a + // separator is shown, since hovering is independent of tab state. + // `for_layout` has the same meaning as in GetSeparatorOpacities(). + float GetHoverInterpolatedSeparatorOpacity(bool for_layout, + const Tab* other_tab) const; + private: // Gets the bounds for the leading and trailing separators for a tab. TabStyle::SeparatorBounds GetSeparatorBounds(float scale) const; @@ -116,18 +138,6 @@ class GM2TabStyleViews : public TabStyleViews { // effects and consider only the current tab's state. TabStyle::SeparatorOpacities GetSeparatorOpacities(bool for_layout) const; - // Returns a single separator's opacity based on whether it is the - // logically |leading| separator. |for_layout| has the same meaning as in - // GetSeparatorOpacities(). - float GetSeparatorOpacity(bool for_layout, bool leading) const; - - // Helper that returns an interpolated opacity if the tab or its neighbor - // |other_tab| is mid-hover-animation. Used in almost all cases when a - // separator is shown, since hovering is independent of tab state. - // |for_layout| has the same meaning as in GetSeparatorOpacities(). - float GetHoverInterpolatedSeparatorOpacity(bool for_layout, - const Tab* other_tab) const; - // Returns whether we shoould extend the hit test region for Fitts' Law. bool ShouldExtendHitTest() const; @@ -164,15 +174,6 @@ class GM2TabStyleViews : public TabStyleViews { SkColor stroke_color) const; void PaintSeparators(gfx::Canvas* canvas) const; - // Given a tab of width |width|, returns the radius to use for the corners. - virtual float GetTopCornerRadiusForWidth(int width) const; - - // Scales |bounds| by scale and aligns so that adjacent tabs meet up exactly - // during painting. - gfx::RectF ScaleAndAlignBounds(const gfx::Rect& bounds, - float scale, - int stroke_thickness) const; - const raw_ptr tab_; std::unique_ptr hover_controller_; @@ -199,7 +200,6 @@ SkPath GM2TabStyleViews::GetPath(TabStyle::PathType path_type, float scale, bool force_active, TabStyle::RenderUnits render_units) const { - CHECK(tab()); const int stroke_thickness = GetStrokeThickness(force_active); // We'll do the entire path calculation in aligned pixels. @@ -208,6 +208,12 @@ SkPath GM2TabStyleViews::GetPath(TabStyle::PathType path_type, gfx::RectF aligned_bounds = ScaleAndAlignBounds(tab_->bounds(), scale, stroke_thickness); + // Calculate the corner radii. Note that corner radius is based on original + // tab width (in DIP), not our new, scaled-and-aligned bounds. + float content_corner_radius = + GetTopCornerRadiusForWidth(tab_->width()) * scale; + float extension_corner_radius = tab_style()->GetBottomCornerRadius() * scale; + if (path_type == TabStyle::PathType::kInteriorClip) { // When there is a separator, animate the clip to account for it, in sync // with the separator's fading. @@ -220,14 +226,9 @@ SkPath GM2TabStyleViews::GetPath(TabStyle::PathType path_type, kChildClipPadding + opacities.right)); } - // Calculate the corner radii. Note that corner radius is based on original - // tab width (in DIP), not our new, scaled-and-aligned bounds. - float top_radius = GetTopCornerRadiusForWidth(tab_->width()) * scale; - float bottom_radius = tab_style()->GetBottomCornerRadius() * scale; - // Compute |extension| as the width outside the separators. This is a fixed // value equal to the normal corner radius. - const float extension = bottom_radius; + const float extension = extension_corner_radius; // Calculate the bounds of the actual path. const float left = aligned_bounds.x(); @@ -251,21 +252,21 @@ SkPath GM2TabStyleViews::GetPath(TabStyle::PathType path_type, tab_left += stroke_adjustment; tab_right -= stroke_adjustment; tab_top += stroke_adjustment; - top_radius -= stroke_adjustment; + content_corner_radius -= stroke_adjustment; } else if (path_type == TabStyle::PathType::kFill || path_type == TabStyle::PathType::kBorder) { tab_left += 0.5f * stroke_adjustment; tab_right -= 0.5f * stroke_adjustment; tab_top += 0.5f * stroke_adjustment; - top_radius -= 0.5f * stroke_adjustment; + content_corner_radius -= 0.5f * stroke_adjustment; tab_bottom -= 0.5f * stroke_adjustment; - bottom_radius -= 0.5f * stroke_adjustment; + extension_corner_radius -= 0.5f * stroke_adjustment; } else if (path_type == TabStyle::PathType::kHitTest) { // Outside border needs to draw its bottom line a stroke width above the // bottom of the tab, to line up with the stroke that runs across the rest // of the bottom of the tab bar (when strokes are enabled). tab_bottom -= stroke_adjustment; - bottom_radius -= stroke_adjustment; + extension_corner_radius -= stroke_adjustment; if (ShouldExtendHitTest()) { extend_to_top = true; if (tab_->controller()->IsTabFirst(tab_)) { @@ -295,7 +296,7 @@ SkPath GM2TabStyleViews::GetPath(TabStyle::PathType path_type, SkRRect rrect = SkRRect::MakeRectXY( SkRect::MakeLTRB(tab_left + inset, tab_top + inset, tab_right - inset, tab_bottom - inset), - top_radius - inset, top_radius - inset); + content_corner_radius - inset, content_corner_radius - inset); path.addRRect(rrect); } else { // Avoid mallocs at every new path verb by preallocating an @@ -328,9 +329,10 @@ SkPath GM2TabStyleViews::GetPath(TabStyle::PathType path_type, if (extend_left_to_bottom) { path.lineTo(tab_left, tab_bottom); } else { - path.lineTo(tab_left - bottom_radius, tab_bottom); - path.arcTo(bottom_radius, bottom_radius, 0, SkPath::kSmall_ArcSize, - SkPathDirection::kCCW, tab_left, tab_bottom - bottom_radius); + path.lineTo(tab_left - extension_corner_radius, tab_bottom); + path.arcTo(extension_corner_radius, extension_corner_radius, 0, + SkPath::kSmall_ArcSize, SkPathDirection::kCCW, tab_left, + tab_bottom - extension_corner_radius); } } @@ -344,9 +346,10 @@ SkPath GM2TabStyleViews::GetPath(TabStyle::PathType path_type, // ╔─────────╮ // ┃ Content │ // ┌─╯ ╰─┐ - path.lineTo(tab_left, tab_top + top_radius); - path.arcTo(top_radius, top_radius, 0, SkPath::kSmall_ArcSize, - SkPathDirection::kCW, tab_left + top_radius, tab_top); + path.lineTo(tab_left, tab_top + content_corner_radius); + path.arcTo(content_corner_radius, content_corner_radius, 0, + SkPath::kSmall_ArcSize, SkPathDirection::kCW, + tab_left + content_corner_radius, tab_top); } // Draw the top crossbar and top-right curve, if present. @@ -359,9 +362,10 @@ SkPath GM2TabStyleViews::GetPath(TabStyle::PathType path_type, // ╭━━━━━━━━━╗ // │ Content │ // ┌─╯ ╰─┐ - path.lineTo(tab_right - top_radius, tab_top); - path.arcTo(top_radius, top_radius, 0, SkPath::kSmall_ArcSize, - SkPathDirection::kCW, tab_right, tab_top + top_radius); + path.lineTo(tab_right - content_corner_radius, tab_top); + path.arcTo(content_corner_radius, content_corner_radius, 0, + SkPath::kSmall_ArcSize, SkPathDirection::kCW, tab_right, + tab_top + content_corner_radius); } if (tab_right != right) { @@ -372,10 +376,10 @@ SkPath GM2TabStyleViews::GetPath(TabStyle::PathType path_type, if (extend_right_to_bottom) { path.lineTo(tab_right, tab_bottom); } else { - path.lineTo(tab_right, tab_bottom - bottom_radius); - path.arcTo(bottom_radius, bottom_radius, 0, SkPath::kSmall_ArcSize, - SkPathDirection::kCCW, tab_right + bottom_radius, - tab_bottom); + path.lineTo(tab_right, tab_bottom - extension_corner_radius); + path.arcTo(extension_corner_radius, extension_corner_radius, 0, + SkPath::kSmall_ArcSize, SkPathDirection::kCCW, + tab_right + extension_corner_radius, tab_bottom); } if (tab_bottom != extended_bottom) path.lineTo(right, tab_bottom); @@ -409,15 +413,15 @@ SkPath GM2TabStyleViews::GetPath(TabStyle::PathType path_type, gfx::Insets GM2TabStyleViews::GetContentsInsets() const { const int stroke_thickness = GetStrokeThickness(); - const int horizontal_inset = tab_style()->GetContentsHorizontalInsetSize(); + gfx::Insets base_style_insets = tab_style()->GetContentsInsets(); return gfx::Insets::TLBR( - stroke_thickness, horizontal_inset, - stroke_thickness + GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP), - horizontal_inset); + stroke_thickness, 0, + stroke_thickness + GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP), + 0) + + base_style_insets; } float GM2TabStyleViews::GetZValue() const { - CHECK(tab()); // This will return values so that inactive tabs can be sorted in the // following order: // @@ -451,7 +455,6 @@ float GM2TabStyleViews::GetZValue() const { } float GM2TabStyleViews::GetActiveOpacity() const { - CHECK(tab()); if (tab_->IsActive()) return 1.0f; if (tab_->IsSelected()) @@ -471,7 +474,6 @@ TabActive GM2TabStyleViews::GetApparentActiveState() const { } TabStyle::TabColors GM2TabStyleViews::CalculateColors() const { - CHECK(tab()); const TabActive active = GetApparentActiveState(); const SkColor foreground_color = tab_->controller()->GetTabForegroundColor(active); @@ -501,7 +503,6 @@ const gfx::FontList& GM2TabStyleViews::GetFontList() const { } void GM2TabStyleViews::PaintTab(gfx::Canvas* canvas) const { - CHECK(tab()); absl::optional active_tab_fill_id; int active_tab_y_inset = 0; if (tab_->GetThemeProvider()->HasCustomImage(IDR_THEME_TOOLBAR)) { @@ -527,7 +528,6 @@ void GM2TabStyleViews::PaintTab(gfx::Canvas* canvas) const { } void GM2TabStyleViews::SetHoverLocation(const gfx::Point& location) { - CHECK(tab()); // There's a "glow" that gets drawn over inactive tabs based on the mouse's // location. There is no glow for the active tab so don't update the hover // controller and incur a redraw. @@ -536,7 +536,6 @@ void GM2TabStyleViews::SetHoverLocation(const gfx::Point& location) { } void GM2TabStyleViews::ShowHover(TabStyle::ShowHoverStyle style) { - CHECK(tab()); if (!hover_controller_) return; @@ -548,31 +547,34 @@ void GM2TabStyleViews::ShowHover(TabStyle::ShowHoverStyle style) { } void GM2TabStyleViews::HideHover(TabStyle::HideHoverStyle style) { - CHECK(tab()); if (hover_controller_) hover_controller_->Hide(style); } TabStyle::SeparatorBounds GM2TabStyleViews::GetSeparatorBounds( float scale) const { - CHECK(tab()); const gfx::RectF aligned_bounds = ScaleAndAlignBounds(tab_->bounds(), scale, GetStrokeThickness()); const int corner_radius = tab_style()->GetBottomCornerRadius() * scale; gfx::SizeF separator_size(tab_style()->GetSeparatorSize()); separator_size.Scale(scale); + gfx::InsetsF separator_margin = + gfx::InsetsF(tab_style()->GetSeparatorMargins()); + separator_margin.Scale(scale); TabStyle::SeparatorBounds separator_bounds; - separator_bounds.leading = - gfx::RectF(aligned_bounds.x() + corner_radius, - aligned_bounds.y() + - (aligned_bounds.height() - separator_size.height()) / 2, - separator_size.width(), separator_size.height()); + separator_bounds.leading = gfx::RectF( + aligned_bounds.x() + corner_radius - separator_margin.right() - + separator_size.width(), + aligned_bounds.y() + (aligned_bounds.height() - separator_size.height() - + separator_margin.bottom()) / + 2, + separator_size.width(), separator_size.height()); separator_bounds.trailing = separator_bounds.leading; - separator_bounds.trailing.set_x(aligned_bounds.right() - - (corner_radius + separator_size.width())); + separator_bounds.trailing.set_x(aligned_bounds.right() - corner_radius + + separator_margin.left()); gfx::PointF origin(tab_->bounds().origin()); origin.Scale(scale); @@ -609,7 +611,6 @@ TabStyle::SeparatorOpacities GM2TabStyleViews::GetSeparatorOpacities( float GM2TabStyleViews::GetSeparatorOpacity(bool for_layout, bool leading) const { - CHECK(tab()); // If the current tab is active, never show the separator. if (tab_->IsActive()) return 0.0f; @@ -696,7 +697,6 @@ float GM2TabStyleViews::GetSeparatorOpacity(bool for_layout, float GM2TabStyleViews::GetHoverInterpolatedSeparatorOpacity( bool for_layout, const Tab* other_tab) const { - CHECK(tab()); // Fade out the intervening separator while this tab or an adjacent tab is // hovered, which prevents sudden opacity changes when scrubbing the mouse // across the tabstrip. If that adjacent tab is active, don't consider its @@ -731,7 +731,6 @@ double GM2TabStyleViews::GetHoverAnimationValue() const { } float GM2TabStyleViews::GetHoverOpacity() const { - CHECK(tab()); // Opacity boost varies on tab width. The interpolation is nonlinear so // that most tabs will fall on the low end of the opacity range, but very // narrow tabs will still stand out on the high end. @@ -761,7 +760,6 @@ float GM2TabStyleViews::GetThrobValue() const { } int GM2TabStyleViews::GetStrokeThickness(bool should_paint_as_active) const { - CHECK(tab()); absl::optional group = tab_->group(); if (group.has_value() && tab_->IsActive()) return TabGroupUnderline::kStrokeThickness; @@ -775,7 +773,6 @@ int GM2TabStyleViews::GetStrokeThickness(bool should_paint_as_active) const { bool GM2TabStyleViews::ShouldPaintTabBackgroundColor( TabActive active, bool has_custom_background) const { - CHECK(tab()); // In the active case, always paint the tab background. The fill image may be // transparent. if (active == TabActive::kActive) @@ -791,12 +788,10 @@ bool GM2TabStyleViews::ShouldPaintTabBackgroundColor( } SkColor GM2TabStyleViews::GetTabSeparatorColor() const { - CHECK(tab()); return tab_->controller()->GetTabSeparatorColor(); } SkColor GM2TabStyleViews::GetTabBackgroundColor(TabActive active) const { - CHECK(tab()); SkColor color = tab_->controller()->GetTabBackgroundColor( active, BrowserFrameActiveState::kUseCurrent); @@ -805,7 +800,6 @@ SkColor GM2TabStyleViews::GetTabBackgroundColor(TabActive active) const { ShapeModifier GM2TabStyleViews::GetShapeModifier( TabStyle::PathType path_type) const { - CHECK(tab()); ShapeModifier shape_modifier = kNone; if (path_type == TabStyle::PathType::kFill && tab_->IsSelected() && !IsHoverActive() && !tab_->IsActive()) { @@ -824,7 +818,6 @@ ShapeModifier GM2TabStyleViews::GetShapeModifier( } void GM2TabStyleViews::PaintInactiveTabBackground(gfx::Canvas* canvas) const { - CHECK(tab()); PaintTabBackground(canvas, TabActive::kInactive, tab_->controller()->GetCustomBackgroundId( BrowserFrameActiveState::kUseCurrent), @@ -835,7 +828,6 @@ void GM2TabStyleViews::PaintTabBackground(gfx::Canvas* canvas, TabActive active, absl::optional fill_id, int y_inset) const { - CHECK(tab()); // |y_inset| is only set when |fill_id| is being used. DCHECK(!y_inset || fill_id.has_value()); @@ -848,9 +840,8 @@ void GM2TabStyleViews::PaintTabBackground(gfx::Canvas* canvas, const auto* widget = tab_->GetWidget(); DCHECK(widget); const SkColor tab_stroke_color = widget->GetColorProvider()->GetColor( - tab_->controller()->ShouldPaintAsActiveFrame() - ? kColorTabStrokeFrameActive - : kColorTabStrokeFrameInactive); + tab_->GetWidget()->ShouldPaintAsActive() ? kColorTabStrokeFrameActive + : kColorTabStrokeFrameInactive); PaintBackgroundStroke(canvas, active, group_color.value_or(tab_stroke_color)); PaintSeparators(canvas); @@ -861,7 +852,6 @@ void GM2TabStyleViews::PaintTabBackgroundFill(gfx::Canvas* canvas, bool paint_hover_effect, absl::optional fill_id, int y_inset) const { - CHECK(tab()); const SkPath fill_path = GetPath(TabStyle::PathType::kFill, canvas->image_scale(), active == TabActive::kActive); @@ -888,8 +878,6 @@ void GM2TabStyleViews::PaintTabBackgroundFill(gfx::Canvas* canvas, } if (paint_hover_effect) { - SkPoint hover_location(gfx::PointToSkPoint(hover_controller_->location())); - hover_location.scale(SkFloatToScalar(scale)); PaintBackgroundHover(canvas, scale); } } @@ -921,7 +909,6 @@ void GM2TabStyleViews::PaintBackgroundHover(gfx::Canvas* canvas, void GM2TabStyleViews::PaintBackgroundStroke(gfx::Canvas* canvas, TabActive active, SkColor stroke_color) const { - CHECK(tab()); const bool is_active = active == TabActive::kActive; const int stroke_thickness = GetStrokeThickness(is_active); if (!stroke_thickness) @@ -1016,10 +1003,16 @@ class ChromeRefresh2023TabStyleViews : public GM2TabStyleViews { ~ChromeRefresh2023TabStyleViews() override = default; SkColor GetTabBackgroundColor(TabActive active) const override; int GetStrokeThickness(bool should_paint_as_active = false) const override; + SkPath GetPath(TabStyle::PathType path_type, + float scale, + bool force_active = false, + TabStyle::RenderUnits render_units = + TabStyle::RenderUnits::kPixels) const override; void PaintBackgroundHover(gfx::Canvas* canvas, float scale) const override; SkColor GetTabSeparatorColor() const override; - bool ShouldPaintTabBackgroundColor(TabActive active, - bool has_custom_background) const override; + + protected: + float GetSeparatorOpacity(bool for_layout, bool leading) const override; }; ChromeRefresh2023TabStyleViews::ChromeRefresh2023TabStyleViews(Tab* tab) @@ -1027,7 +1020,6 @@ ChromeRefresh2023TabStyleViews::ChromeRefresh2023TabStyleViews(Tab* tab) SkColor ChromeRefresh2023TabStyleViews::GetTabBackgroundColor( TabActive active) const { - CHECK(tab()); const auto* cp = tab()->GetWidget()->GetColorProvider(); DCHECK(cp); if (!cp) { @@ -1041,12 +1033,11 @@ SkColor ChromeRefresh2023TabStyleViews::GetTabBackgroundColor( kColorTabBackgroundActiveFrameActive}}; return cp->GetColor(kColorIds[int(active == TabActive::kActive)][int( - tab()->controller()->ShouldPaintAsActiveFrame())]); + tab()->GetWidget()->ShouldPaintAsActive())]); } int ChromeRefresh2023TabStyleViews::GetStrokeThickness( bool should_paint_as_active) const { - CHECK(tab()); if (tab()->group().has_value() && tab()->IsActive()) { return TabGroupUnderline::kStrokeThickness; } @@ -1054,16 +1045,73 @@ int ChromeRefresh2023TabStyleViews::GetStrokeThickness( return 0; } +SkPath ChromeRefresh2023TabStyleViews::GetPath( + TabStyle::PathType path_type, + float scale, + bool force_active, + TabStyle::RenderUnits render_units) const { + CHECK(tab()); + const int stroke_thickness = GetStrokeThickness(force_active); + + // Active fill for CR23 is the same as GM2. Selected/hover is a detached tab. + if ((path_type == TabStyle::PathType::kFill && !tab()->IsActive() && + tab()->IsSelected()) || + (path_type == TabStyle::PathType::kHighlight)) { + // TODO (crbug.com/1451400): This constant should be unified with + // kCRtabstripRegionViewControlPadding in tab_strip_region_view. + constexpr int kChromeRefreshDetachedTabBottomPadding = 6; + + gfx::RectF aligned_bounds = + ScaleAndAlignBounds(tab()->bounds(), scale, stroke_thickness); + + // Calculate the corner radii. Note that corner radius is based on original + // tab width (in DIP), not our new, scaled-and-aligned bounds. + const float content_corner_radius = + GetTopCornerRadiusForWidth(tab()->width()) * scale; + const float extension_corner_radius = + tab_style()->GetBottomCornerRadius() * scale; + const float tab_height = + (tab_style()->GetHeight() - kChromeRefreshDetachedTabBottomPadding) * + scale; + + SkPath path; + + const int left = aligned_bounds.x() + extension_corner_radius; + const int top = aligned_bounds.y(); + const int right = aligned_bounds.right() - extension_corner_radius; + const int bottom = top + tab_height; + + SkRRect rrect = + SkRRect::MakeRectXY(SkRect::MakeLTRB(left, top, right, bottom), + content_corner_radius, content_corner_radius); + path.addRRect(rrect); + + // Convert path to be relative to the tab origin. + gfx::PointF origin(tab()->origin()); + origin.Scale(scale); + path.offset(-origin.x(), -origin.y()); + + // Possibly convert back to DIPs. + if (render_units == TabStyle::RenderUnits::kDips && scale != 1.0f) { + path.transform(SkMatrix::Scale(1.0f / scale, 1.0f / scale)); + } + + return path; + } + + return GM2TabStyleViews::GetPath(path_type, scale, force_active, + render_units); +} + void ChromeRefresh2023TabStyleViews::PaintBackgroundHover(gfx::Canvas* canvas, float scale) const { const SkPath fill_path = GetPath(TabStyle::PathType::kHighlight, canvas->image_scale(), true); canvas->ClipPath(fill_path, true); - // Override the color for ChromeRefresh2023 const auto* cp = tab()->GetWidget()->GetColorProvider(); const SkColor color = - cp->GetColor(tab()->controller()->ShouldPaintAsActiveFrame() + cp->GetColor(tab()->GetWidget()->ShouldPaintAsActive() ? kColorTabBackgroundHoverFrameActive : kColorTabBackgroundHoverFrameInactive); const SkColor4f color_with_alpha_animation = SkColor4f::FromColor( @@ -1077,24 +1125,64 @@ void ChromeRefresh2023TabStyleViews::PaintBackgroundHover(gfx::Canvas* canvas, } SkColor ChromeRefresh2023TabStyleViews::GetTabSeparatorColor() const { - CHECK(tab()); const auto* cp = tab()->GetWidget()->GetColorProvider(); DCHECK(cp); if (!cp) { return gfx::kPlaceholderColor; } - return cp->GetColor(tab()->controller()->ShouldPaintAsActiveFrame() + return cp->GetColor(tab()->GetWidget()->ShouldPaintAsActive() ? kColorTabDividerFrameActive : kColorTabDividerFrameInactive); } -bool ChromeRefresh2023TabStyleViews::ShouldPaintTabBackgroundColor( - TabActive active, - bool has_custom_background) const { - return (tab()->IsActive() || tab()->IsSelected()) && - GM2TabStyleViews::ShouldPaintTabBackgroundColor(active, - has_custom_background); +float ChromeRefresh2023TabStyleViews::GetSeparatorOpacity(bool for_layout, + bool leading) const { + const auto has_visible_background = [](const Tab* const tab) { + return tab->IsActive() || tab->IsSelected() || tab->IsMouseHovered(); + }; + + // for CR23 these tab states all have visible backgrounds. Separators must not + // be shown between tabs if that is the case; + if (has_visible_background(tab())) { + return 0.0f; + } + + // check the adjacent tab/group header to see if there's a visible shapes. + const Tab* const adjacent_tab = + tab()->controller()->GetAdjacentTab(tab(), leading ? -1 : 1); + + const Tab* const left_tab = leading ? adjacent_tab : tab(); + const Tab* const right_tab = leading ? tab() : adjacent_tab; + const bool adjacent_to_header = + right_tab && right_tab->group().has_value() && + (!left_tab || left_tab->group() != right_tab->group()); + + const float shown_separator_opacity = + GetHoverInterpolatedSeparatorOpacity(for_layout, adjacent_tab); + + // Show the separator unless this tab is the first in the group and is next + // to it's own header. + if (adjacent_to_header) { + return (tab()->group().has_value() && leading) ? 0.0f + : shown_separator_opacity; + } + + // if there isnt an adjacent tab, the tab is at the beginning or end of the + // tabstrip. for the first tab, we shouldnt not show the leading separator, + // for the last tab, we should show the separator between the new tab button + // and the tabstrip IF the tab isnt selected, hovered, or active. + if (!adjacent_tab) { + return leading ? 0.0f : shown_separator_opacity; + } + + // Do not show when the adjacent tab is displaying a visible shape. + if (has_visible_background(adjacent_tab)) { + return 0.0f; + } + + // Otherwise, default to showing the separator. + return shown_separator_opacity; } } // namespace @@ -1155,42 +1243,3 @@ std::unique_ptr TabStyleViews::CreateForTab(Tab* tab) { } return std::make_unique(tab); } - -// static -std::unique_ptr TabStyleViews::Create() { - return TabStyleViews::CreateForTab(nullptr); -} - -int TabStyleViews::GetMinimumActiveWidth() const { - int min_active_width = TabCloseButton::GetGlyphSize() + - tab_style()->GetContentsHorizontalInsetSize() * 2; - if (base::FeatureList::IsEnabled(features::kScrollableTabStrip)) { - return std::max( - min_active_width, - base::GetFieldTrialParamByFeatureAsInt( - features::kScrollableTabStrip, - features::kMinimumTabWidthFeatureParameterName, min_active_width)); - } - return min_active_width; -} - -int TabStyleViews::GetMinimumInactiveWidth() const { - // Allow tabs to shrink until they appear to be 16 DIP wide excluding - // outer corners. - constexpr int kInteriorWidth = 16; - // The overlap contains the trailing separator that is part of the interior - // width; avoid double-counting it. - int min_inactive_width = kInteriorWidth - - tab_style()->GetSeparatorSize().width() + - tab_style()->GetTabOverlap(); - - if (base::FeatureList::IsEnabled(features::kScrollableTabStrip)) { - return std::max(min_inactive_width, - base::GetFieldTrialParamByFeatureAsInt( - features::kScrollableTabStrip, - features::kMinimumTabWidthFeatureParameterName, - min_inactive_width)); - } - - return min_inactive_width; -} diff --git a/src/chrome/browser/ui/views/tabs/tab_style_views.h b/src/chrome/browser/ui/views/tabs/tab_style_views.h index ab947ac9..b9067180 100644 --- a/src/chrome/browser/ui/views/tabs/tab_style_views.h +++ b/src/chrome/browser/ui/views/tabs/tab_style_views.h @@ -34,7 +34,6 @@ class TabStyleViews { // Factory function allows to experiment with different variations on tab // style at runtime or via flag. static std::unique_ptr CreateForTab(Tab* tab); - static std::unique_ptr Create(); TabStyleViews(); virtual ~TabStyleViews(); @@ -85,14 +84,6 @@ class TabStyleViews { // Returns the progress (0 to 1) of the hover animation. virtual double GetHoverAnimationValue() const = 0; - // Returns the minimum possible width of a selected Tab. Selected tabs must - // always show a close button, and thus have a larger minimum size than - // unselected tabs. - int GetMinimumActiveWidth() const; - - // Returns the minimum possible width of a single unselected Tab. - int GetMinimumInactiveWidth() const; - const TabStyle* tab_style() const { return tab_style_; } private: diff --git a/src/chrome/installer/setup/install_worker.cc b/src/chrome/installer/setup/install_worker.cc index 49c0c9ec..69df7883 100644 --- a/src/chrome/installer/setup/install_worker.cc +++ b/src/chrome/installer/setup/install_worker.cc @@ -310,6 +310,14 @@ void AddChromeWorkItems(const InstallParams& install_params, temp_path, WorkItem::NEW_NAME_IF_IN_USE, new_chrome_exe); + // Add Thorium-specific files + install_list->AddCopyTreeWorkItem(src_path.Append('initial_preferences'), + target_path.Append('initial_preferences'), + temp_path, WorkItem::ALWAYS); + install_list->AddCopyTreeWorkItem(src_path.Append('thor_ver'), + target_path.Append('thor_ver'), + temp_path, WorkItem::ALWAYS); + // Install kVisualElementsManifest if it is present in |src_path|. No need to // make this a conditional work item as if the file is not there now, it will // never be. diff --git a/src/components/feed/core/shared_prefs/pref_names.cc b/src/components/feed/core/shared_prefs/pref_names.cc index 21c7aab6..e3397204 100644 --- a/src/components/feed/core/shared_prefs/pref_names.cc +++ b/src/components/feed/core/shared_prefs/pref_names.cc @@ -1,4 +1,4 @@ -// Copyright 2020 The Chromium Authors, Alex313031 and gz83 +// Copyright 2023 The Chromium Authors, Alex313031 and gz83 // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -17,12 +17,10 @@ const char kEnableSnippets[] = "ntp_snippets.enable"; // FEED_ARTICLES_LIST_VISIBLE in ChromePreferenceKeys.java is a pre-native cache // and should be consistent with this pref. const char kArticlesListVisible[] = "ntp_snippets.list_visible"; -const char kVideoPreviewsType[] = "ntp_snippets.video_previews_type"; void RegisterFeedSharedProfilePrefs(PrefRegistrySimple* registry) { registry->RegisterBooleanPref(kEnableSnippets, true); registry->RegisterBooleanPref(kArticlesListVisible, false); - registry->RegisterIntegerPref(kVideoPreviewsType, 1); } } // namespace prefs diff --git a/src/components/history/core/browser/history_backend.cc b/src/components/history/core/browser/history_backend.cc index cd28dcc9..30ec5a54 100644 --- a/src/components/history/core/browser/history_backend.cc +++ b/src/components/history/core/browser/history_backend.cc @@ -228,7 +228,8 @@ class DeleteForeignVisitsDBTask : public HistoryDBTask { return true; } - backend->RemoveVisits(visits); + backend->RemoveVisits(visits, + DeletionInfo::Reason::kDeleteAllForeignVisits); bool done = visits.size() < static_cast(max_count); if (done) { @@ -1878,11 +1879,12 @@ void HistoryBackend::DeleteAllForeignVisitsAndResetIsKnownToSync() { } } -bool HistoryBackend::RemoveVisits(const VisitVector& visits) { +bool HistoryBackend::RemoveVisits(const VisitVector& visits, + DeletionInfo::Reason deletion_reason) { if (!db_) return false; - expirer_.ExpireVisits(visits); + expirer_.ExpireVisits(visits, deletion_reason); ScheduleCommit(); return true; } @@ -2032,6 +2034,16 @@ HistoryBackend::GetDomainDiversity( return std::make_pair(local_result, all_result); } +DomainsVisitedResult HistoryBackend::GetUniqueDomainsVisited( + base::Time begin_time, + base::Time end_time) { + if (!db_) { + return {}; + } + + return db_->GetUniqueDomainsVisited(begin_time, end_time); +} + HistoryLastVisitResult HistoryBackend::GetLastVisitToHost( const std::string& host, base::Time begin_time, @@ -2178,6 +2190,7 @@ void HistoryBackend::SetOnCloseContextAnnotationsForVisit( std::vector HistoryBackend::GetAnnotatedVisits( const QueryOptions& options, + bool compute_redirect_chain_start_properties, bool* limited_by_max_count) { // Gets `VisitVector` matching `options`, then for each visit, gets the // associated `URLRow`, `VisitContextAnnotations`, and @@ -2201,11 +2214,12 @@ std::vector HistoryBackend::GetAnnotatedVisits( DCHECK_LE(static_cast(visit_rows.size()), options.EffectiveMaxCount()); - return ToAnnotatedVisits(visit_rows); + return ToAnnotatedVisits(visit_rows, compute_redirect_chain_start_properties); } std::vector HistoryBackend::ToAnnotatedVisits( - const VisitVector& visit_rows) { + const VisitVector& visit_rows, + bool compute_redirect_chain_start_properties) { if (!db_) return {}; @@ -2234,10 +2248,13 @@ std::vector HistoryBackend::ToAnnotatedVisits( db_->GetContentAnnotationsForVisit(visit_row.visit_id, &content_annotations); - VisitRow redirect_start = GetRedirectChainStart(visit_row); - VisitID referring_visit_of_redirect_chain_start = - redirect_start.referring_visit; - VisitID opener_visit_of_redirect_chain_start = redirect_start.opener_visit; + VisitID referring_visit_of_redirect_chain_start = 0; + VisitID opener_visit_of_redirect_chain_start = 0; + if (compute_redirect_chain_start_properties) { + VisitRow redirect_start = GetRedirectChainStart(visit_row); + referring_visit_of_redirect_chain_start = redirect_start.referring_visit; + opener_visit_of_redirect_chain_start = redirect_start.opener_visit; + } const auto source = sources.count(visit_row.visit_id) == 0 ? VisitSource::SOURCE_BROWSED @@ -2253,7 +2270,8 @@ std::vector HistoryBackend::ToAnnotatedVisits( } std::vector HistoryBackend::ToAnnotatedVisits( - const std::vector& visit_ids) { + const std::vector& visit_ids, + bool compute_redirect_chain_start_properties) { if (!db_) return {}; VisitVector visit_rows; @@ -2262,13 +2280,14 @@ std::vector HistoryBackend::ToAnnotatedVisits( if (db_->GetRowForVisit(visit_id, &visit_row)) visit_rows.push_back(visit_row); } - return ToAnnotatedVisits(visit_rows); + return ToAnnotatedVisits(visit_rows, compute_redirect_chain_start_properties); } std::vector HistoryBackend::ToClusterVisits( const std::vector& visit_ids, bool include_duplicates) { - auto annotated_visits = ToAnnotatedVisits(visit_ids); + auto annotated_visits = ToAnnotatedVisits( + visit_ids, /*compute_redirect_chain_start_properties=*/false); std::vector cluster_visits; std::set seen_duplicate_ids; base::ranges::for_each(annotated_visits, [&](const auto& annotated_visit) { diff --git a/src/media/ffmpeg/ffmpeg_common.cc b/src/media/ffmpeg/ffmpeg_common.cc index 164b34dc..b1b98d28 100644 --- a/src/media/ffmpeg/ffmpeg_common.cc +++ b/src/media/ffmpeg/ffmpeg_common.cc @@ -743,8 +743,9 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, AVMasteringDisplayMetadata* metadata = reinterpret_cast(side_data.data); + gfx::HdrMetadataSmpteSt2086 smpte_st_2086; if (metadata->has_primaries) { - hdr_metadata.smpte_st_2086.primaries = { + smpte_st_2086.primaries = { static_cast(av_q2d(metadata->display_primaries[0][0])), static_cast(av_q2d(metadata->display_primaries[0][1])), static_cast(av_q2d(metadata->display_primaries[1][0])), @@ -756,10 +757,14 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, }; } if (metadata->has_luminance) { - hdr_metadata.smpte_st_2086.luminance_max = - av_q2d(metadata->max_luminance); - hdr_metadata.smpte_st_2086.luminance_min = - av_q2d(metadata->min_luminance); + smpte_st_2086.luminance_max = av_q2d(metadata->max_luminance); + smpte_st_2086.luminance_min = av_q2d(metadata->min_luminance); + } + + // TODO(https://crbug.com/1446302): Consider rejecting metadata that does + // not specify all values. + if (metadata->has_primaries || metadata->has_luminance) { + hdr_metadata.smpte_st_2086 = smpte_st_2086; } } } diff --git a/src/media/media_options.gni b/src/media/media_options.gni index da8810a7..fd3fe3a5 100644 --- a/src/media/media_options.gni +++ b/src/media/media_options.gni @@ -134,7 +134,7 @@ declare_args() { declare_args() { platform_has_optional_hevc_support = enable_platform_hevc && - (is_win || is_chromeos || is_linux || is_mac || is_android) + (is_win || is_chromeos || is_linux || is_apple || is_android) } assert(!enable_platform_ac3_eac3_audio || proprietary_codecs, @@ -249,7 +249,7 @@ if (is_cast_media_device) { "video_decoder", ] _default_mojo_media_host = "gpu" -} else if (is_mac || is_win) { +} else if (is_apple || is_win) { _default_mojo_media_services = [ "audio_decoder", "audio_encoder", diff --git a/src/third_party/blink/renderer/core/exported/web_view_impl.cc b/src/third_party/blink/renderer/core/exported/web_view_impl.cc index 6919422a..dcd60eb0 100644 --- a/src/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/src/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -159,6 +159,7 @@ #include "third_party/blink/renderer/core/probe/core_probes.h" #include "third_party/blink/renderer/core/scroll/scroll_into_view_util.h" #include "third_party/blink/renderer/core/scroll/scrollbar_theme.h" +#include "third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h" #include "third_party/blink/renderer/core/timing/dom_window_performance.h" #include "third_party/blink/renderer/core/timing/performance.h" #include "third_party/blink/renderer/core/timing/window_performance.h" @@ -2482,6 +2483,17 @@ void WebViewImpl::SetPageLifecycleStateInternal( if (MainFrame()->IsWebLocalFrame()) { LocalFrame* local_frame = To(page->MainFrame()); probe::DidRestoreFromBackForwardCache(local_frame); + + if (base::FeatureList::IsEnabled( + blink::features::kRetriggerPreloadingOnBFCacheRestoration)) { + if (local_frame->IsOutermostMainFrame()) { + Document* document = local_frame->GetDocument(); + if (auto* document_rules = + DocumentSpeculationRules::FromIfExists(*document)) { + document_rules->DocumentRestoredFromBFCache(); + } + } + } } } @@ -3302,6 +3314,8 @@ void WebViewImpl::ActivatePrerenderedPage( mojom::blink::PrerenderPageActivationParamsPtr prerender_page_activation_params, ActivatePrerenderedPageCallback callback) { + TRACE_EVENT0("navigation", "WebViewImpl::ActivatePrerenderedPage"); + // From here all new documents will have prerendering false. GetPage()->SetIsPrerendering(false); @@ -3944,4 +3958,12 @@ scheduler::WebAgentGroupScheduler& WebViewImpl::GetWebAgentGroupScheduler() { return web_agent_group_scheduler_; } +void WebViewImpl::UpdatePageBrowsingContextGroup( + const BrowsingContextGroupInfo& browsing_context_group_info) { + Page* page = GetPage(); + CHECK(page); + + page->UpdateBrowsingContextGroup(browsing_context_group_info); +} + } // namespace blink