M116 Final

This commit is contained in:
Alexander Frick 2023-09-04 06:45:52 -05:00
parent cb3d4cd555
commit 58483936cb
18 changed files with 452 additions and 295 deletions

View File

@ -739,8 +739,9 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream,
AVMasteringDisplayMetadata* metadata =
reinterpret_cast<AVMasteringDisplayMetadata*>(side_data.data);
gfx::HdrMetadataSmpteSt2086 smpte_st_2086;
if (metadata->has_primaries) {
hdr_metadata.smpte_st_2086.primaries = {
smpte_st_2086.primaries = {
static_cast<float>(av_q2d(metadata->display_primaries[0][0])),
static_cast<float>(av_q2d(metadata->display_primaries[0][1])),
static_cast<float>(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;
}
}
}

View File

@ -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",

View File

@ -739,8 +739,9 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream,
AVMasteringDisplayMetadata* metadata =
reinterpret_cast<AVMasteringDisplayMetadata*>(side_data.data);
gfx::HdrMetadataSmpteSt2086 smpte_st_2086;
if (metadata->has_primaries) {
hdr_metadata.smpte_st_2086.primaries = {
smpte_st_2086.primaries = {
static_cast<float>(av_q2d(metadata->display_primaries[0][0])),
static_cast<float>(av_q2d(metadata->display_primaries[0][1])),
static_cast<float>(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;
}
}
}

View File

@ -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 {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
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.
-->

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2021 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.
-->

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2023 Alex313031. -->
<!-- android_chrome_strings.grd contains strings for Thorium for Android.
FAQ:
@ -747,7 +747,39 @@ CHAR_LIMIT guidelines:
<message name="IDS_PASSWORD_MIGRATION_WARNING_OTHER_OPTIONS" desc="The text on the button that leads to other options in the password migration warning sheet.">
Other options
</message>
<message name="IDS_PASSWORD_MIGRATION_WARNING_CONTENT_DESCRIPTION" desc="Accessibility string read when the password migration warning sheet opens." formatter_data="android_java">
Google Password Manager update
</message>
<message name="IDS_PASSWORD_MIGRATION_WARNING_CLOSED" desc="Accessibility string read when the password migration warning sheet closes." formatter_data="android_java">
Update about password merge is closed
</message>
<message name="IDS_PASSWORD_MIGRATION_WARNING_TURN_ON_SYNC" desc="The text that describes the option to start syncing that is offered in the password migration warning sheet.">
Save the passwords on this device in your Google Account by turning on sync
</message>
<message name="IDS_PASSWORD_MIGRATION_WARNING_TURN_ON_SYNC_SUBTITLE" desc="The subtitle that appears under the option to turn on sync in the password migration warning sheet if the user is not signed in.">
Youll be asked to sign in to your Google Account
</message>
<message name="IDS_PASSWORD_MIGRATION_WARNING_PASSWORD_EXPORT" desc="The text that describes the option to export the passwords that is offered in the password migration warning sheet.">
Export &amp; delete passwords saved to this device
</message>
<message name="IDS_PASSWORD_MIGRATION_WARNING_PASSWORD_EXPORT_SUBTITLE" desc="The subtitle that explaint the password export option in the password migration warning sheet.">
All passwords will be downloaded on your device and removed from Thorium <ph name="CHROME_CHANNEL">%1$s<ex>Dev</ex></ph>
</message>
<message name="IDS_PASSWORD_MIGRATION_WARNING_NEXT" desc="The text for the next button in the password migration warning sheet. It starts one of the flows offered on the sheet.">
Next
</message>
<message name="IDS_PASSWORD_MIGRATION_WARNING_CANCEL" desc="The text for the cancel button in the password migration warning sheet. It closes the sheet">
Cancel
</message>
<message name="IDS_EXPORTED_PASSWORDS_DELETION_DIALOG_TITLE" desc="The title of the dialog that offers to delete passwords from Google Password Manager." formatter_data="android_java">
Delete passwords from Google Password Manager?
</message>
<message name="IDS_EXPORTED_PASSWORDS_DELETION_DIALOG_TEXT" desc="The text that describes the option to delete the passwords that were just exported." formatter_data="android_java">
Your passwords will be deleted from Google Password Manager for Thorium <ph name="CHROME_CHANNEL">%1$s<ex>Dev</ex></ph>. You will keep the passwords file you just downloaded.
</message>
<message name="IDS_EXPORTED_PASSWORDS_DELETE_BUTTON" desc="The text on the button that confirms the action of deleting the passwords that were exported." formatter_data="android_java">
Delete passwords
</message>
<!-- Lock Screen Fragment -->
<message name="IDS_LOCKSCREEN_DESCRIPTION_COPY" desc="When a user attempts to copy a password for a particular website into clipboard in Thorium's settings, Thorium launches a lock screen to verify the user's identity and displays the following explanation.">
@ -1135,6 +1167,9 @@ Private state tokens improve privacy on the web and cant be used to find out
<message name="IDS_SETTINGS_TOPICS_PAGE_CURRENT_TOPICS_DESCRIPTION" desc="A description that appear beneath the 'Your topics' label. * 'You can block': There is a 'Block' button (or an X on mobile) that appears next to each topic in the list. * 'auto-deletes': this could also read 'Thorium deletes...' We included the 'auto' to reinforce that this is part of a system and the deletion is done regularly.">
You can block topics you don't want shared with sites. Thorium also auto-deletes your topics older than 4 weeks. <ph name="BEGIN_LINK">&lt;link&gt;</ph>Learn more<ph name="END_LINK">&lt;/link&gt;</ph>
</message>
<message name="IDS_SETTINGS_TOPICS_PAGE_LEARN_MORE_BULLET_3" desc="Paragraph 3 of 3 on the Learn more about ad topics page. * 'auto-deletes': this could also read 'Thorium deletes...' We included the 'auto' to reinforce that this is part of a system and the deletion is done regularly.">
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 dont want Thorium to share with sites. Learn more about <ph name="BEGIN_LINK">&lt;link&gt;</ph>managing your ad privacy in Thorium.<ph name="END_LINK">&lt;/link&gt;</ph>
</message>
<message name="IDS_SETTINGS_TOPICS_PAGE_FOOTER" desc="This footer helps the user understand that this setting is just one signal among others that affect whether this user sees personalized ads on a site. We define 'personalize' as 'when Google provides recommendations and other content for users based on their data'. At a high level, there are 4 things that affect whether an ad is personalized in this context: * 'this setting' refers to the 'Ad topics' setting. The user is on this page. * 'Site-suggested ads': this is a link to the other new ad setting Thorium is launching and that sites can use to personalize ads a user sees. * 'cookie settings': this is a link to the cookies control section in Thorium settings. The Privacy Sandbox project deprecates third-party cookies, but it's a process, and we're launching new functionality that will replace important functionality of cookies. Until third-party cookies are deprecated, the two systems remain active in Thorium. * 'site you're viewing personalizes ads': When a user engages with a site, Thorium has no control over whether that site shows the user personalized ads. Imagine you visit www.interesting-site.com and they know a lot about you already based on previous visits. They can personalize content and ads to you if they like. They can use an ad-serving product, like Facebook or Google Ads to deliver personalized ads. They can also use the new Privacy Sandbox APIs (if they so choose) in order to get more information about the user that could be helpful to them in order to personalize ads. Those 2 APIs (settings, from the user's perspective), are 'Ad topics' and 'Site-suggested ads'.">
As you browse, whether an ad you see is personalized depends on this setting, <ph name="BEGIN_LINK_1">&lt;link1&gt;</ph>Site-suggested ads<ph name="END_LINK_1">&lt;/link1&gt;</ph>, your <ph name="BEGIN_LINK_2">&lt;link2&gt;</ph>cookie settings<ph name="END_LINK_2">&lt;/link2&gt;</ph>, and if the site you're viewing personalizes ads.
</message>
@ -1198,7 +1233,7 @@ Private state tokens improve privacy on the web and cant be used to find out
For example, if you visit a site that sells long-distance running shoes, the site might decide that youre 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.
</message>
<message name="IDS_SETTINGS_FLEDGE_PAGE_LEARN_MORE_BULLET_3" desc="3 of 3 paragraphs on the Learn more page for Site-suggested ads. * 'Auto-deletes': This could just read 'Thorium deletes...' but we include the 'auto' to suggest that the deletion happens regularly and as part of the system. * 'A site you visit again...': We want to reassure the user. We just told them sites are automatically deleted. And yet, a user might see the same site in the list month after month if they visit that site regularly.">
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 <ph name="BEGIN_LINK">&lt;link&gt;</ph>managing your ad privacy in Thorium.<ph name="END_LINK">&lt;/link&gt;</ph>
</message>
<message name="IDS_SETTINGS_FLEDGE_PAGE_BLOCK_SITE_A11Y_LABEL" desc="A button label read by screen readers that indicates which site will get blocked. The list is of sites the user has recently visited and that use the Site-suggested ads API to suggest ads to other sites as the user continues browsing.">
Block <ph name="DOMAIN">%1$s<ex>example.com</ex></ph>
@ -2965,10 +3000,10 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
Thorium First Run Experience
</message>
<message name="IDS_LIGHTWEIGHT_FRE_ASSOCIATED_APP_TOS" desc="Message explaining that use of Thorium is governed by Thorium's terms of service.">
<ph name="APP_NAME">%1$s<ex>Google Maps</ex></ph> will open in Thorium. By continuing, you agree to the <ph name="BEGIN_LINK1">&lt;LINK1&gt;</ph>Google Terms of Service<ph name="END_LINK1">&lt;/LINK1&gt;</ph>, and the <ph name="BEGIN_LINK2">&lt;LINK2&gt;</ph>Thorium and ThoriumOS Additional Terms of Service<ph name="END_LINK2">&lt;/LINK2&gt;</ph>.
<ph name="APP_NAME">%1$s<ex>Google Maps</ex></ph> will open in Thorium. By continuing, you agree to the <ph name="BEGIN_LINK1">&lt;LINK1&gt;</ph>Google Terms of Service<ph name="END_LINK1">&lt;/LINK1&gt;</ph>, and the <ph name="BEGIN_LINK2">&lt;LINK2&gt;</ph>Google Thorium and ThoriumOS Additional Terms of Service<ph name="END_LINK2">&lt;/LINK2&gt;</ph>.
</message>
<message name="IDS_LIGHTWEIGHT_FRE_ASSOCIATED_APP_TOS_AND_PRIVACY_CHILD_ACCOUNT" desc="Message explaining that use of Thorium is governed by Thorium's terms of service, and the Google Privacy Policy.">
<ph name="APP_NAME">%1$s<ex>Google Maps</ex></ph> will open in Thorium. By continuing, you agree to the <ph name="BEGIN_LINK1">&lt;LINK1&gt;</ph>Google Terms of Service<ph name="END_LINK1">&lt;/LINK1&gt;</ph>, and the <ph name="BEGIN_LINK2">&lt;LINK2&gt;</ph>Thorium and ThoriumOS Additional Terms of Service<ph name="END_LINK2">&lt;/LINK2&gt;</ph>. The <ph name="BEGIN_LINK3">&lt;LINK3&gt;</ph>Privacy Policy<ph name="END_LINK3">&lt;/LINK3&gt;</ph> also applies.
<ph name="APP_NAME">%1$s<ex>Google Maps</ex></ph> will open in Thorium. By continuing, you agree to the <ph name="BEGIN_LINK1">&lt;LINK1&gt;</ph>Google Terms of Service<ph name="END_LINK1">&lt;/LINK1&gt;</ph>, and the <ph name="BEGIN_LINK2">&lt;LINK2&gt;</ph>Google Thorium and ThoriumOS Additional Terms of Service<ph name="END_LINK2">&lt;/LINK2&gt;</ph>. The <ph name="BEGIN_LINK3">&lt;LINK3&gt;</ph>Privacy Policy<ph name="END_LINK3">&lt;/LINK3&gt;</ph> also applies.
</message>
<message name="IDS_FRE_ACCEPT_CONTINUE" desc="Text for first page accept and continue button [CHAR_LIMIT=20]">
Accept &amp; continue
@ -3271,9 +3306,6 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_NTP_MANAGE_REACTIONS" desc="Content description to manage feed reactions from the feed header overflow menu.">
Manage reactions
</message>
<message name="IDS_NTP_MANAGE_AUTOPLAY" desc="Content description to manage feed autoplay from the feed header overflow menu.">
Manage autoplay
</message>
<message name="IDS_NTP_MANAGE_FEED" desc="Menu item to manage feed settings from the feed header overflow menu.">
Manage
</message>
@ -3319,18 +3351,15 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_FEED_MANAGE_INTERESTS_DESCRIPTION" desc="Content description to manage settings from the feed header overflow menu.">
Manage the topics you're interested in
</message>
<message name="IDS_FEED_MANAGE_INTERESTS_DESCRIPTION_UI_UPDATE" desc="Content description to manage settings from the feed header overflow menu.">
Manage the topics and searches you're interested in
</message>
<message name="IDS_FEED_MANAGE_HIDDEN" desc="Menu item to manage hiding and unhiding topics.">
Hidden
</message>
<message name="IDS_FEED_MANAGE_HIDDEN_DESCRIPTION" desc="Content description to manage hiding and unhiding topics.">
Hide and unhide topics
</message>
<message name="IDS_FEED_MANAGE_AUTOPLAY" desc="Menu item to manage feed autoplay from the feed header overflow menu.">
Autoplay
</message>
<message name="IDS_FEED_MANAGE_AUTOPLAY_DESCRIPTION" desc="Content description to manage feed autoplay from the feed header overflow menu.">
Manage Video Preview Settings
</message>
<message name="IDS_FEED_MANAGE_FOLLOWING" desc="Menu item to manage followed sites.">
Following
</message>
@ -4119,9 +4148,6 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_ACCESSIBILITY_OMNIBOX_SHOWING_SUGGESTIONS_FOR_WEBSITE" desc="Whenever the User is visiting a Website, when they click the Omnibox, we will announce this message, if we have suggestions to show.">
Showing suggestions for <ph name="WEBSITE_TITLE">%1$s<ex>Crater Lake National Park (U.S. National Park Service)</ex></ph>
</message>
<message name="IDS_ACCESSIBILITY_OMNIBOX_PEDAL" desc="Announce focused Thorium Action Button on the Omnibox Suggestions List. List of known Action buttons is defined here: https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/omnibox/omnibox_pedal_implementations.cc">
Thorium action button: <ph name="ACTION">%s<ex>clear browsing data</ex></ph>
</message>
<message name="IDS_ACCESSIBILITY_OMNIBOX_SUGGESTED_ITEMS" desc="Announcement about the presence and volume of suggestions below the Omnibox.">
<ph name="SUGGESTIONS_COUNT">%d<ex>12</ex></ph> suggested items in list below.
</message>
@ -4298,24 +4324,15 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
Feed card menu is closed
</message>
<!-- Feed Autoplay Preferences -->
<message name="IDS_FEED_AUTOPLAY_TITLE" desc="Title for feed autoplay preference.">
Autoplay
<!-- PageInsights Hub -->
<message name="IDS_PAGE_INSIGHTS_SHEET_DESCRIPTION" desc="The content description of the page insights sheet.">
Page insights bottom sheet
</message>
<message name="IDS_VIDEO_PREVIEWS_TITLE" desc="Title for setting video previews preference.">
Video previews
<message name="IDS_PAGE_INSIGHTS_SHEET_OPENED_FULL" desc="Accessibility string read when the page insights sheet is opened at full height. The sheet will occupy up to the full screen.">
Page insights bottom sheet is opened
</message>
<message name="IDS_VIDEO_PREVIEWS_SUMMARY" desc="Summary for setting video previews preference.">
Choose how video previews will automatically play on the Thorium homepage.
</message>
<message name="IDS_VIDEO_PREVIEWS_OPTION_NEVER" desc="Option in video previews preference. Users can click this option to disable video previews.">
Never
</message>
<message name="IDS_VIDEO_PREVIEWS_OPTION_WIFI" desc="Option in video previews preference. Users can click this option to allow video previews on Wi-Fi only.">
Only on Wi-Fi
</message>
<message name="IDS_VIDEO_PREVIEWS_OPTION_WIFI_AND_MOBILE_DATA" desc="Option in video previews preference. Users can click this option to allow video previews on both Wi-Fi and mobile data.">
On Wi-Fi &amp; mobile data
<message name="IDS_PAGE_INSIGHTS_SHEET_CLOSED" desc="Accessibility string read when the page insights sheet is closed.">
Page insights bottom sheet is closed
</message>
<!-- WebFeed -->
@ -4534,14 +4551,14 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_KEYBOARD_SHORTCUT_RELOAD_NO_CACHE" desc="A text label that appears next to the keyboard shortcut that will reload the current page without a cache. The shortcut description is shown in a system dialog along with all other supported shortcuts. [CHAR_LIMIT=55]">
Reload the current page, ignoring cached content
</message>
<message name="IDS_KEYBOARD_SHORTCUT_HELP_CENTER" desc="A text label that appears next to the keyboard shortcut that will open the Thorium Help Center in a new tab. The shortcut description is shown in a system dialog along with all other supported shortcuts. [CHAR_LIMIT=55]">
<message name="IDS_KEYBOARD_SHORTCUT_HELP_CENTER" desc="A text label that appears next to the keyboard shortcut that will open the Google Thorium Help Center in a new tab. The shortcut description is shown in a system dialog along with all other supported shortcuts. [CHAR_LIMIT=55]">
Open the Thorium Help Center in a new tab
</message>
<message name="IDS_KEYBOARD_SHORTCUT_TAB_GROUP_HEADER" desc="A text label that appears above a list of shortcuts that are related to the tab window. This group is part of several groups of keyboard shortcuts all shown in a dialog.">
Tab and window shortcuts
</message>
<message name="IDS_KEYBOARD_SHORTCUT_CHROME_FEATURE_GROUP_HEADER" desc="A text label that appears above a list of shortcuts that are related to the Thorium app features. This group is part of several groups of keyboard shortcuts all shown in a dialog.">
Thorium feature shortcuts
Google Thorium feature shortcuts
</message>
<message name="IDS_KEYBOARD_SHORTCUT_WEBPAGE_GROUP_HEADER" desc="A text label that appears above a list of shortcuts that are related to manipulation of the current tab window. This group is part of several groups of keyboard shortcuts all shown in a dialog.">
Webpage shortcuts
@ -4995,7 +5012,7 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_CABLEV2_ACTIVITY_TITLE"
desc="The label of the Activity for using your phone as a security key. A 'security key' in this context is generally a small USB device that is used for logging into websites. This feature allows Thorium on an Android phone to act as a security key. A user may see it in Android permissions prompts (see screenshot).">
Thorium as a Security Key
Google Thorium as a Security Key
</message>
<message name="IDS_CABLEV2_REGISTRATION_SUCCEEDED"
@ -5203,10 +5220,18 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
Copy image
</message>
<message name="IDS_SHARING_COPY_IMAGE_WITH_LINK" desc="Label for the Copy Image button with link in the sharing hub.">
Copy image with link
</message>
<message name="IDS_SHARING_COPY_GIF" desc="Label for the Copy GIF button in the sharing hub.">
Copy GIF
</message>
<message name="IDS_SHARING_COPY_HIGHLIGHT_WITHOUT_LINK" desc="Label for the Copy highlighted text without link button in the sharing hub. This is used when sharing highlighted text with a generated link.">
Copy without link
</message>
<message name="IDS_SHARING_SCREENSHOT" desc="Label for Screenshot button in the sharing hub.">
Screenshot
</message>
@ -5255,20 +5280,8 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
Send to devices
</message>
<message name="IDS_SHARING_INCLUDE_LINK" desc="Label for the button in android share sheet to include a link to share along with highlighted text.">
Include link
</message>
<message name="IDS_SHARING_EXCLUDE_LINK" desc="Label for the button in android share sheet to share the highlighted text without a link.">
Exclude link
</message>
<message name="IDS_TEXT_COPIED" desc="Text shown in the toast notification when Copy Text is selected in the sharing hub.">
Text Copied
</message>
<message name="IDS_IMAGE_COPIED" desc="Text shown in the toast notification when Copy Image is selected in the sharing hub.">
Image Copied
<message name="IDS_SHARING_INCLUDING_LINK_TITLE_TEMPLATE" desc="Title used in share sheet when sharing the highlighted text with a generated link.">
Including link: <ph name="ORIGIN">%1$s<ex>https://www.example.com</ex></ph>
</message>
<message name="IDS_GIF_COPIED" desc="Text shown in the toast notification when Copy GIF is selected in the sharing hub.">
@ -5451,7 +5464,7 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
Save up to 60% data
</message>
<message name="IDS_CHROME_REENGAGEMENT_NOTIFICATION_2_DESCRIPTION" desc="The body text of a notification shown to suggest that users use Thorium. Users probably have not opened Thorium in a while. Promotes data savings.">
Use Lite mode on Thorium
Use Lite mode on Google Thorium
</message>
<message name="IDS_CHROME_REENGAGEMENT_NOTIFICATION_3_TITLE" desc="The title of a notification shown to suggest that users use Thorium. Users probably have not opened Thorium in a while.">
Google recommends Thorium
@ -5733,6 +5746,29 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_QUICK_DELETE_SNACKBAR_MESSAGE" desc="Text inside the snackbar which is shown once the user confirms deletion via the 'Delete last 15 minutes' option present inside the three dots menu.">
Deleted
</message>
<!-- Password generation bottom sheet -->
<message name="IDS_PASSWORD_GENERATION_BOTTOM_SHEET_CONTENT_DESCRIPTION" desc="Accessibility string read when the bottom sheet is opened. It describes that the bottom sheet proposes a generated password to be automatically filled into the sign up form and saved to the Password Manager.">
Strong password suggested. Keyboard hidden.
</message>
<message name="IDS_PASSWORD_GENERATION_BOTTOM_SHEET_CLOSED" desc="Accessibility string read when the password generation bottom sheet is closed.">
Password suggestion is closed.
</message>
<message name="IDS_PASSWORD_GENERATION_BOTTOM_SHEET_TITLE" desc="The title of the password generation bottom sheet.">
Use strong password?
</message>
<message name="IDS_PASSWORD_GENERATION_BOTTOM_SHEET_SUBTITLE" desc="The subtitle for the password generation bottom sheet.">
You wont need to remember this password. It will be saved to Google Password Manager for <ph name="USERNAME">%1$s<ex>elisa.becket@gmail.com</ex></ph>.
</message>
<message name="IDS_PASSWORD_GENERATION_BOTTOM_SHEET_SUBTITLE_NO_ACCOUNT" desc="The subtitle for the password generation bottom sheet.">
You wont need to remember this password. It will be saved to Google Password Manager.
</message>
<message name="IDS_PASSWORD_GENERATION_BOTTOM_SHEET_USE_PASSWORD_BUTTON" desc="Appears on the button, which reflects the user agreement to user the generated strong password.">
Use password
</message>
<message name="IDS_PASSWORD_GENERATION_BOTTOM_SHEET_DISMISS_BUTTON" desc="Appears on the button, which reflects that the user has rejected the proposed generated password and decided to continue with creating their own password.">
Create my own
</message>
</messages>
</release>
</grit>

View File

@ -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);

View File

@ -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<SkColor> 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 {

View File

@ -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) {

View File

@ -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<const Tab> tab_;
std::unique_ptr<GlowHoverController> 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<int> 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<tab_groups::TabGroupId> 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<int> 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<int> 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> TabStyleViews::CreateForTab(Tab* tab) {
}
return std::make_unique<GM2TabStyleViews>(tab);
}
// static
std::unique_ptr<TabStyleViews> 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;
}

View File

@ -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<TabStyleViews> CreateForTab(Tab* tab);
static std::unique_ptr<TabStyleViews> 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:

View File

@ -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.

View File

@ -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

View File

@ -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<size_t>(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<AnnotatedVisit> 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<AnnotatedVisit> HistoryBackend::GetAnnotatedVisits(
DCHECK_LE(static_cast<int>(visit_rows.size()), options.EffectiveMaxCount());
return ToAnnotatedVisits(visit_rows);
return ToAnnotatedVisits(visit_rows, compute_redirect_chain_start_properties);
}
std::vector<AnnotatedVisit> 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<AnnotatedVisit> 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<AnnotatedVisit> HistoryBackend::ToAnnotatedVisits(
}
std::vector<AnnotatedVisit> HistoryBackend::ToAnnotatedVisits(
const std::vector<VisitID>& visit_ids) {
const std::vector<VisitID>& visit_ids,
bool compute_redirect_chain_start_properties) {
if (!db_)
return {};
VisitVector visit_rows;
@ -2262,13 +2280,14 @@ std::vector<AnnotatedVisit> 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<ClusterVisit> HistoryBackend::ToClusterVisits(
const std::vector<VisitID>& 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<ClusterVisit> cluster_visits;
std::set<VisitID> seen_duplicate_ids;
base::ranges::for_each(annotated_visits, [&](const auto& annotated_visit) {

View File

@ -743,8 +743,9 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream,
AVMasteringDisplayMetadata* metadata =
reinterpret_cast<AVMasteringDisplayMetadata*>(side_data.data);
gfx::HdrMetadataSmpteSt2086 smpte_st_2086;
if (metadata->has_primaries) {
hdr_metadata.smpte_st_2086.primaries = {
smpte_st_2086.primaries = {
static_cast<float>(av_q2d(metadata->display_primaries[0][0])),
static_cast<float>(av_q2d(metadata->display_primaries[0][1])),
static_cast<float>(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;
}
}
}

View File

@ -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",

View File

@ -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<LocalFrame>(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