diff --git a/DEPS b/DEPS index 7b52d87..6b4ca1b 100644 --- a/DEPS +++ b/DEPS
@@ -311,11 +311,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '34e169fdea3d11997c45cba943e3acafb00ecea0', + 'v8_revision': 'd1e492cac3a317eb629176ae4de5ddba455f7c4f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '9d9b8b07ba821cd9c1121f36f2a26e016097b5bb', + 'angle_revision': '67ee4976869102a76d6405fb87cedd6f6cd057ac', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -323,7 +323,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '16812d6c18001cccc303e25e8f6f02ab27e3f6d5', + 'pdfium_revision': 'c323bf9ba9e72893a25ccfc3000c6e08e640f79e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -422,11 +422,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': 'cc85ed6dd1502fe16723378e9e6de317576030e6', + 'dawn_revision': '508df1a6b3348b3b76aff28b78e7da32050f6dcb', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'quiche_revision': '97d97a5358600b69b37716e60d73b8b9d59c800f', + 'quiche_revision': '24a2385b4a295f34b82115789540443cc4d09448', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ios_webkit # and whatever else without interference from each other. @@ -817,12 +817,12 @@ 'src/clank': { 'url': 'https://chrome-internal.googlesource.com/clank/internal/apps.git' + '@' + - '86c73e183de5432c77233addbea4ad2b81ddeccf', + '8270bc1395192834c23ce82f5def647b4832d2a2', 'condition': 'checkout_android and checkout_src_internal and not checkout_clank_via_src_internal', }, 'src/docs/website': { - 'url': Var('chromium_git') + '/website.git' + '@' + 'd1ab9aa7dd70b9c165e8da29ca7e3dd064fa95d0', + 'url': Var('chromium_git') + '/website.git' + '@' + '99af831d51449181a8094f19101d93dbd6a38487', }, 'src/ios/third_party/earl_grey2/src': { @@ -1817,7 +1817,7 @@ # Display server protocol for Linux. 'src/third_party/wayland/src': { - 'url': Var('chromium_git') + '/external/anongit.freedesktop.org/git/wayland/wayland.git' + '@' + '8135e856ebd79872f886466e9cee39affb7d9ee8', + 'url': Var('chromium_git') + '/external/anongit.freedesktop.org/git/wayland/wayland.git' + '@' + 'c7473676b8abc682e820546287044cee3bca9147', 'condition': 'checkout_linux', }, @@ -1920,7 +1920,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@f911de2e5935a62de88869159df12a973377051d', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@c407094e7bfa2ab7497317b4773f1a9bbeea69a7', 'condition': 'checkout_src_internal', }, @@ -1961,7 +1961,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'BBb3pqswJRtDgW1s8ypbyBiDH-qxuDuBlg_3iSoupGIC', + 'version': 'vGJzNTqAywikH3aqgvFEvCcDhs2n4qH_TBGyglkgReMC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal',
diff --git a/WATCHLISTS b/WATCHLISTS index 1ae0d42..69fa2c13 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -791,7 +791,6 @@ 'filepath': 'ash/login/|'\ 'chrome/browser/ash/login/|'\ 'chrome/browser/ui/webui/ash/login/|'\ - 'chrome/browser/ui/webui/chromeos/login/|'\ 'chrome/browser/resources/chromeos/login/|'\ 'ui/login/', },
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 1bd5451..78ac95a 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -1869,8 +1869,8 @@ "system/usb_peripheral/usb_peripheral_notification_controller.h", "system/user/login_status.cc", "system/user/login_status.h", - "system/video_conference/vc_tray.cc", - "system/video_conference/vc_tray.h", + "system/video_conference/video_conference_tray.cc", + "system/video_conference/video_conference_tray.h", "system/video_conference/video_conference_tray_controller.cc", "system/video_conference/video_conference_tray_controller.h", "system/virtual_keyboard/virtual_keyboard_observer.h", @@ -3060,7 +3060,7 @@ "system/unified/user_chooser_detailed_view_controller_unittest.cc", "system/update/update_notification_controller_unittest.cc", "system/usb_peripheral/usb_peripheral_notification_controller_unittest.cc", - "system/video_conference/vc_tray_unittest.cc", + "system/video_conference/video_conference_tray_unittest.cc", "system/virtual_keyboard/virtual_keyboard_tray_unittest.cc", "test/ash_test_helper_unittest.cc", "tooltips/tooltip_controller_unittest.cc",
diff --git a/ash/components/phonehub/BUILD.gn b/ash/components/phonehub/BUILD.gn index ace3fc5..11a832b 100644 --- a/ash/components/phonehub/BUILD.gn +++ b/ash/components/phonehub/BUILD.gn
@@ -130,11 +130,11 @@ "//ash/components/phonehub/proto", "//ash/constants", "//ash/resources/vector_icons", - "//ash/services/device_sync/public/cpp", "//ash/webui/eche_app_ui:eche_app_ui_pref", "//base", "//chromeos/ash/components/multidevice", "//chromeos/ash/components/multidevice/logging", + "//chromeos/ash/services/device_sync/public/cpp", "//chromeos/ash/services/multidevice_setup/public/cpp", "//chromeos/ash/services/multidevice_setup/public/cpp:prefs", "//chromeos/ash/services/secure_channel/public/cpp/client", @@ -271,8 +271,6 @@ ":test_support", "//ash/components/phonehub/proto", "//ash/constants", - "//ash/services/device_sync/public/cpp", - "//ash/services/device_sync/public/cpp:test_support", "//ash/webui/eche_app_ui:eche_app_ui_pref", "//base", "//base/test:test_support", @@ -280,6 +278,8 @@ "//chromeos/ash/components/multidevice:test_support", "//chromeos/ash/components/network", "//chromeos/ash/components/network:test_support", + "//chromeos/ash/services/device_sync/public/cpp", + "//chromeos/ash/services/device_sync/public/cpp:test_support", "//chromeos/ash/services/multidevice_setup/public/cpp", "//chromeos/ash/services/multidevice_setup/public/cpp:prefs", "//chromeos/ash/services/multidevice_setup/public/cpp:test_support",
diff --git a/ash/components/phonehub/DEPS b/ash/components/phonehub/DEPS index fe174a9..c1b3cde 100644 --- a/ash/components/phonehub/DEPS +++ b/ash/components/phonehub/DEPS
@@ -1,5 +1,5 @@ include_rules = [ - "+ash/services/device_sync/public/cpp", + "+chromeos/ash/services/device_sync/public/cpp", "+chromeos/services/network_config/in_process_instance.h", "+components/keyed_service/core/keyed_service.h", "+components/session_manager/core",
diff --git a/ash/components/phonehub/feature_status_provider_impl.h b/ash/components/phonehub/feature_status_provider_impl.h index f624e54..d57b7406 100644 --- a/ash/components/phonehub/feature_status_provider_impl.h +++ b/ash/components/phonehub/feature_status_provider_impl.h
@@ -6,9 +6,9 @@ #define ASH_COMPONENTS_PHONEHUB_FEATURE_STATUS_PROVIDER_IMPL_H_ #include "ash/components/phonehub/feature_status_provider.h" -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/multidevice_setup_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/connection_manager.h" #include "chromeos/dbus/power/power_manager_client.h"
diff --git a/ash/components/phonehub/feature_status_provider_impl_unittest.cc b/ash/components/phonehub/feature_status_provider_impl_unittest.cc index dc47b87..d6b545e 100644 --- a/ash/components/phonehub/feature_status_provider_impl_unittest.cc +++ b/ash/components/phonehub/feature_status_provider_impl_unittest.cc
@@ -7,9 +7,9 @@ #include <memory> #include <vector> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/test/task_environment.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_connection_manager.h" #include "chromeos/dbus/power/fake_power_manager_client.h"
diff --git a/ash/constants/tray_background_view_catalog.h b/ash/constants/tray_background_view_catalog.h index 0128b8c2..95ca8fa 100644 --- a/ash/constants/tray_background_view_catalog.h +++ b/ash/constants/tray_background_view_catalog.h
@@ -35,8 +35,8 @@ kVirtualKeyboardStatusArea = 19, kVirtualKeyboardAccessibilityWindow = 20, kWmMode = 21, - kVcTray = 22, - kMaxValue = kVcTray, + kVideoConferenceTray = 22, + kMaxValue = kVideoConferenceTray, }; } // namespace ash
diff --git a/ash/services/device_sync/BUILD.gn b/ash/services/device_sync/BUILD.gn index adefc16..dd4da8c3 100644 --- a/ash/services/device_sync/BUILD.gn +++ b/ash/services/device_sync/BUILD.gn
@@ -151,9 +151,9 @@ public_deps = [ ":feature_status_change", - "//ash/services/device_sync/public/mojom", "//chromeos/ash/components/multidevice", "//chromeos/ash/components/multidevice/logging", + "//chromeos/ash/services/device_sync/public/mojom", "//components/signin/public/identity_manager", "//services/network/public/cpp", ] @@ -161,12 +161,12 @@ deps = [ "//ash/constants", "//ash/services/device_sync/proto:util", - "//ash/services/device_sync/public/cpp", - "//ash/services/device_sync/public/mojom", "//base", "//chromeos/ash/components/multidevice", "//chromeos/ash/components/multidevice/logging", "//chromeos/ash/components/network", + "//chromeos/ash/services/device_sync/public/cpp", + "//chromeos/ash/services/device_sync/public/mojom", "//components/gcm_driver", "//components/prefs", "//device/bluetooth", @@ -176,11 +176,11 @@ visibility = [ ":*", - "//ash/services/device_sync/public/cpp:prefs", - "//ash/services/device_sync/public/cpp:unit_tests", "//chrome/browser/ash", "//chrome/browser/chromeos", "//chrome/test:test_support_ui", + "//chromeos/ash/services/device_sync/public/cpp:prefs", + "//chromeos/ash/services/device_sync/public/cpp:unit_tests", ] } @@ -247,9 +247,9 @@ deps = [ ":device_sync", "//ash/services/device_sync/proto:test_support", - "//ash/services/device_sync/public/cpp", - "//ash/services/device_sync/public/mojom", "//base", + "//chromeos/ash/services/device_sync/public/cpp", + "//chromeos/ash/services/device_sync/public/mojom", "//testing/gmock", "//testing/gtest", ] @@ -315,11 +315,6 @@ "//ash/constants", "//ash/services/device_sync/proto:test_support", "//ash/services/device_sync/proto:util", - "//ash/services/device_sync/public/cpp:prefs", - "//ash/services/device_sync/public/cpp:test_support", - "//ash/services/device_sync/public/cpp:unit_tests", - "//ash/services/device_sync/public/mojom", - "//ash/services/device_sync/public/mojom:unit_tests", "//base", "//base/test:test_support", "//chromeos/ash/components/dbus:test_support", @@ -327,6 +322,11 @@ "//chromeos/ash/components/multidevice:test_support", "//chromeos/ash/components/network", "//chromeos/ash/components/network:test_support", + "//chromeos/ash/services/device_sync/public/cpp:prefs", + "//chromeos/ash/services/device_sync/public/cpp:test_support", + "//chromeos/ash/services/device_sync/public/cpp:unit_tests", + "//chromeos/ash/services/device_sync/public/mojom", + "//chromeos/ash/services/device_sync/public/mojom:unit_tests", "//components/gcm_driver:test_support", "//components/prefs:test_support", "//components/signin/public/identity_manager:test_support",
diff --git a/ash/services/device_sync/DEPS b/ash/services/device_sync/DEPS index 493ec75..640c607 100644 --- a/ash/services/device_sync/DEPS +++ b/ash/services/device_sync/DEPS
@@ -1,3 +1,6 @@ +# TODO(https://crbug.com/1164001): When this file is edited, same file in +# //chromeos/ash/services/device_sync should be updated as well. We need +# to sync both files until the migration is done. include_rules = [ "+ash/constants", "+chromeos/ash/components/multidevice", @@ -12,4 +15,8 @@ "+services/network/test", "+third_party/protobuf/src/google/protobuf/message_lite.h", "+third_party/securemessage", + + # TODO(https://crbug.com/1164001): This is a temporary deps during + # //{ash=>chromeos/ash}/services/device_sync migration. + "+chromeos/ash/services/device_sync", ]
diff --git a/ash/services/device_sync/DIR_METADATA b/ash/services/device_sync/DIR_METADATA index dd4c190..dabff1b 100644 --- a/ash/services/device_sync/DIR_METADATA +++ b/ash/services/device_sync/DIR_METADATA
@@ -1,3 +1,6 @@ +# TODO(https://crbug.com/1164001): When this file is edited, same file in +# //chromeos/ash/services/device_sync should be updated as well. We need +# to sync both files until the migration is done. buganizer { component_id: 1108889 }
diff --git a/ash/services/device_sync/OWNERS b/ash/services/device_sync/OWNERS index 34fbbfb..f3d006f 100644 --- a/ash/services/device_sync/OWNERS +++ b/ash/services/device_sync/OWNERS
@@ -1,4 +1,4 @@ -file://chromeos/ash/components/multidevice/OWNERS +file://chromeos/ash/services/device_sync/OWNERS per-file *_type_converter*.*=set noparent per-file *_type_converter*.*=file://ipc/SECURITY_OWNERS
diff --git a/ash/services/device_sync/cryptauth_device_activity_getter.h b/ash/services/device_sync/cryptauth_device_activity_getter.h index 0624002..683d0515 100644 --- a/ash/services/device_sync/cryptauth_device_activity_getter.h +++ b/ash/services/device_sync/cryptauth_device_activity_getter.h
@@ -8,8 +8,8 @@ #include <vector> #include "ash/services/device_sync/network_request_error.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "base/callback.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" namespace ash {
diff --git a/ash/services/device_sync/cryptauth_device_activity_getter_impl.h b/ash/services/device_sync/cryptauth_device_activity_getter_impl.h index 1203aaa..75f0f28e 100644 --- a/ash/services/device_sync/cryptauth_device_activity_getter_impl.h +++ b/ash/services/device_sync/cryptauth_device_activity_getter_impl.h
@@ -11,9 +11,9 @@ #include "ash/services/device_sync/cryptauth_device_activity_getter.h" #include "ash/services/device_sync/network_request_error.h" #include "ash/services/device_sync/proto/cryptauth_devicesync.pb.h" -#include "ash/services/device_sync/public/cpp/client_app_metadata_provider.h" #include "base/time/time.h" #include "base/timer/timer.h" +#include "chromeos/ash/services/device_sync/public/cpp/client_app_metadata_provider.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace ash {
diff --git a/ash/services/device_sync/cryptauth_gcm_manager_impl.cc b/ash/services/device_sync/cryptauth_gcm_manager_impl.cc index 58efde50..32216b9 100644 --- a/ash/services/device_sync/cryptauth_gcm_manager_impl.cc +++ b/ash/services/device_sync/cryptauth_gcm_manager_impl.cc
@@ -8,13 +8,13 @@ #include "ash/services/device_sync/cryptauth_key_bundle.h" #include "ash/services/device_sync/pref_names.h" #include "ash/services/device_sync/proto/cryptauth_common.pb.h" -#include "ash/services/device_sync/public/cpp/gcm_constants.h" #include "base/bind.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_functions.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "chromeos/ash/components/multidevice/logging/logging.h" +#include "chromeos/ash/services/device_sync/public/cpp/gcm_constants.h" #include "components/gcm_driver/gcm_driver.h" #include "components/prefs/pref_service.h"
diff --git a/ash/services/device_sync/cryptauth_v2_enroller_impl.cc b/ash/services/device_sync/cryptauth_v2_enroller_impl.cc index 6d5919c..ffe8a8c 100644 --- a/ash/services/device_sync/cryptauth_v2_enroller_impl.cc +++ b/ash/services/device_sync/cryptauth_v2_enroller_impl.cc
@@ -15,11 +15,11 @@ #include "ash/services/device_sync/cryptauth_task_metrics_logger.h" #include "ash/services/device_sync/proto/cryptauth_client_app_metadata.pb.h" #include "ash/services/device_sync/proto/cryptauth_common.pb.h" -#include "ash/services/device_sync/public/cpp/gcm_constants.h" #include "base/bind.h" #include "base/memory/ptr_util.h" #include "base/no_destructor.h" #include "chromeos/ash/components/multidevice/logging/logging.h" +#include "chromeos/ash/services/device_sync/public/cpp/gcm_constants.h" namespace ash {
diff --git a/ash/services/device_sync/cryptauth_v2_enroller_impl_unittest.cc b/ash/services/device_sync/cryptauth_v2_enroller_impl_unittest.cc index fddd561..2e46157 100644 --- a/ash/services/device_sync/cryptauth_v2_enroller_impl_unittest.cc +++ b/ash/services/device_sync/cryptauth_v2_enroller_impl_unittest.cc
@@ -24,12 +24,12 @@ #include "ash/services/device_sync/proto/cryptauth_directive.pb.h" #include "ash/services/device_sync/proto/cryptauth_enrollment.pb.h" #include "ash/services/device_sync/proto/cryptauth_v2_test_util.h" -#include "ash/services/device_sync/public/cpp/gcm_constants.h" #include "base/bind.h" #include "base/containers/contains.h" #include "base/containers/flat_map.h" #include "base/no_destructor.h" #include "base/timer/mock_timer.h" +#include "chromeos/ash/services/device_sync/public/cpp/gcm_constants.h" #include "components/prefs/testing_pref_service.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/ash/services/device_sync/cryptauth_v2_enrollment_manager_impl_unittest.cc b/ash/services/device_sync/cryptauth_v2_enrollment_manager_impl_unittest.cc index eb36267..2e6e69e 100644 --- a/ash/services/device_sync/cryptauth_v2_enrollment_manager_impl_unittest.cc +++ b/ash/services/device_sync/cryptauth_v2_enrollment_manager_impl_unittest.cc
@@ -27,12 +27,12 @@ #include "ash/services/device_sync/proto/cryptauth_common.pb.h" #include "ash/services/device_sync/proto/cryptauth_directive.pb.h" #include "ash/services/device_sync/proto/cryptauth_v2_test_util.h" -#include "ash/services/device_sync/public/cpp/gcm_constants.h" #include "ash/services/device_sync/value_string_encoding.h" #include "base/no_destructor.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/simple_test_clock.h" #include "base/timer/mock_timer.h" +#include "chromeos/ash/services/device_sync/public/cpp/gcm_constants.h" #include "components/prefs/pref_service.h" #include "components/prefs/testing_pref_service.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/ash/services/device_sync/device_sync_base.h b/ash/services/device_sync/device_sync_base.h index 8a6179cd..5891003f 100644 --- a/ash/services/device_sync/device_sync_base.h +++ b/ash/services/device_sync/device_sync_base.h
@@ -5,7 +5,7 @@ #ifndef ASH_SERVICES_DEVICE_SYNC_DEVICE_SYNC_BASE_H_ #define ASH_SERVICES_DEVICE_SYNC_DEVICE_SYNC_BASE_H_ -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver_set.h"
diff --git a/ash/services/device_sync/device_sync_impl.cc b/ash/services/device_sync/device_sync_impl.cc index 5d8a156..8e49eee 100644 --- a/ash/services/device_sync/device_sync_impl.cc +++ b/ash/services/device_sync/device_sync_impl.cc
@@ -25,7 +25,6 @@ #include "ash/services/device_sync/device_sync_type_converters.h" #include "ash/services/device_sync/proto/cryptauth_api.pb.h" #include "ash/services/device_sync/proto/device_classifier_util.h" -#include "ash/services/device_sync/public/cpp/gcm_device_info_provider.h" #include "ash/services/device_sync/remote_device_provider_impl.h" #include "ash/services/device_sync/software_feature_manager_impl.h" #include "ash/services/device_sync/synced_bluetooth_address_tracker_impl.h" @@ -41,6 +40,7 @@ #include "base/unguessable_token.h" #include "chromeos/ash/components/multidevice/logging/logging.h" #include "chromeos/ash/components/multidevice/secure_message_delegate_impl.h" +#include "chromeos/ash/services/device_sync/public/cpp/gcm_device_info_provider.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "components/signin/public/base/consent_level.h"
diff --git a/ash/services/device_sync/device_sync_impl.h b/ash/services/device_sync/device_sync_impl.h index a158f48..592b794 100644 --- a/ash/services/device_sync/device_sync_impl.h +++ b/ash/services/device_sync/device_sync_impl.h
@@ -17,13 +17,13 @@ #include "ash/services/device_sync/network_request_error.h" #include "ash/services/device_sync/proto/cryptauth_client_app_metadata.pb.h" #include "ash/services/device_sync/proto/cryptauth_common.pb.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "ash/services/device_sync/remote_device_provider.h" #include "base/containers/flat_map.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "base/unguessable_token.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "components/signin/public/identity_manager/account_info.h" #include "components/signin/public/identity_manager/identity_manager.h"
diff --git a/ash/services/device_sync/device_sync_service_unittest.cc b/ash/services/device_sync/device_sync_service_unittest.cc index 53fb67f..307c0ab 100644 --- a/ash/services/device_sync/device_sync_service_unittest.cc +++ b/ash/services/device_sync/device_sync_service_unittest.cc
@@ -33,10 +33,6 @@ #include "ash/services/device_sync/proto/cryptauth_client_app_metadata.pb.h" #include "ash/services/device_sync/proto/cryptauth_common.pb.h" #include "ash/services/device_sync/proto/cryptauth_v2_test_util.h" -#include "ash/services/device_sync/public/cpp/device_sync_prefs.h" -#include "ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.h" -#include "ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "ash/services/device_sync/remote_device_provider_impl.h" #include "ash/services/device_sync/software_feature_manager_impl.h" #include "base/bind.h" @@ -55,6 +51,10 @@ #include "chromeos/ash/components/multidevice/remote_device_test_util.h" #include "chromeos/ash/components/multidevice/secure_message_delegate.h" #include "chromeos/ash/components/network/network_handler_test_helper.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_prefs.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "components/gcm_driver/fake_gcm_driver.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/testing_pref_service.h"
diff --git a/ash/services/device_sync/device_sync_type_converters.h b/ash/services/device_sync/device_sync_type_converters.h index 5fdb0be4..d2b62c6 100644 --- a/ash/services/device_sync/device_sync_type_converters.h +++ b/ash/services/device_sync/device_sync_type_converters.h
@@ -6,7 +6,7 @@ #define ASH_SERVICES_DEVICE_SYNC_DEVICE_SYNC_TYPE_CONVERTERS_H_ #include "ash/services/device_sync/network_request_error.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "mojo/public/cpp/bindings/type_converter.h" namespace mojo {
diff --git a/ash/services/device_sync/fake_device_sync_observer.h b/ash/services/device_sync/fake_device_sync_observer.h index f7f1cfa..cdb0167c 100644 --- a/ash/services/device_sync/fake_device_sync_observer.h +++ b/ash/services/device_sync/fake_device_sync_observer.h
@@ -5,7 +5,7 @@ #ifndef ASH_SERVICES_DEVICE_SYNC_FAKE_DEVICE_SYNC_OBSERVER_H_ #define ASH_SERVICES_DEVICE_SYNC_FAKE_DEVICE_SYNC_OBSERVER_H_ -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver_set.h"
diff --git a/ash/services/device_sync/proto/BUILD.gn b/ash/services/device_sync/proto/BUILD.gn index b97b8a1..39a0d672 100644 --- a/ash/services/device_sync/proto/BUILD.gn +++ b/ash/services/device_sync/proto/BUILD.gn
@@ -55,7 +55,7 @@ public_deps = [ ":proto" ] deps = [ - "//ash/services/device_sync/public/cpp:cpp", "//base", + "//chromeos/ash/services/device_sync/public/cpp:cpp", ] }
diff --git a/ash/services/device_sync/proto/cryptauth_v2_test_util.cc b/ash/services/device_sync/proto/cryptauth_v2_test_util.cc index 11440009..0d2da1b 100644 --- a/ash/services/device_sync/proto/cryptauth_v2_test_util.cc +++ b/ash/services/device_sync/proto/cryptauth_v2_test_util.cc
@@ -4,9 +4,9 @@ #include "ash/services/device_sync/proto/cryptauth_v2_test_util.h" -#include "ash/services/device_sync/public/cpp/gcm_constants.h" #include "base/no_destructor.h" #include "base/strings/string_number_conversions.h" +#include "chromeos/ash/services/device_sync/public/cpp/gcm_constants.h" namespace cryptauthv2 {
diff --git a/ash/services/device_sync/stub_device_sync.cc b/ash/services/device_sync/stub_device_sync.cc index 3ccf777..659c34f3 100644 --- a/ash/services/device_sync/stub_device_sync.cc +++ b/ash/services/device_sync/stub_device_sync.cc
@@ -9,13 +9,13 @@ #include "ash/services/device_sync/device_sync_base.h" #include "ash/services/device_sync/device_sync_impl.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "base/memory/ptr_util.h" #include "base/no_destructor.h" #include "base/ranges/algorithm.h" #include "base/time/time.h" #include "chromeos/ash/components/multidevice/remote_device.h" #include "chromeos/ash/components/multidevice/stub_multidevice_util.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/ash/system/bluetooth/bluetooth_feature_pod_controller_legacy.cc b/ash/system/bluetooth/bluetooth_feature_pod_controller_legacy.cc deleted file mode 100644 index cd224363..0000000 --- a/ash/system/bluetooth/bluetooth_feature_pod_controller_legacy.cc +++ /dev/null
@@ -1,180 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/system/bluetooth/bluetooth_feature_pod_controller_legacy.h" - -#include <utility> - -#include "ash/constants/quick_settings_catalogs.h" -#include "ash/resources/vector_icons/vector_icons.h" -#include "ash/session/session_controller_impl.h" -#include "ash/shell.h" -#include "ash/strings/grit/ash_strings.h" -#include "ash/system/bluetooth/tray_bluetooth_helper.h" -#include "ash/system/unified/feature_pod_button.h" -#include "ash/system/unified/unified_system_tray_controller.h" -#include "base/i18n/number_formatting.h" -#include "base/strings/string_number_conversions.h" -#include "services/device/public/cpp/bluetooth/bluetooth_utils.h" -#include "ui/base/l10n/l10n_util.h" - -using device::mojom::BluetoothDeviceInfo; -using device::mojom::BluetoothSystem; - -namespace ash { - -BluetoothFeaturePodControllerLegacy::BluetoothFeaturePodControllerLegacy( - UnifiedSystemTrayController* tray_controller) - : tray_controller_(tray_controller) { - Shell::Get()->tray_bluetooth_helper()->AddObserver(this); -} - -BluetoothFeaturePodControllerLegacy::~BluetoothFeaturePodControllerLegacy() { - auto* helper = Shell::Get()->tray_bluetooth_helper(); - if (helper) - helper->RemoveObserver(this); -} - -FeaturePodButton* BluetoothFeaturePodControllerLegacy::CreateButton() { - DCHECK(!button_); - button_ = new FeaturePodButton(this); - button_->ShowDetailedViewArrow(); - UpdateButton(); - return button_; -} - -QsFeatureCatalogName BluetoothFeaturePodControllerLegacy::GetCatalogName() { - return QsFeatureCatalogName::kBluetooth; -} - -void BluetoothFeaturePodControllerLegacy::OnIconPressed() { - bool was_enabled = button_->IsToggled(); - Shell::Get()->tray_bluetooth_helper()->SetBluetoothEnabled(!was_enabled); - - if (was_enabled) { - TrackToggleUMA(/*target_toggle_state=*/false); - return; - } - - // If Bluetooth was disabled, show device list as well as enabling Bluetooth. - TrackDiveInUMA(); - tray_controller_->ShowBluetoothDetailedView(); -} - -void BluetoothFeaturePodControllerLegacy::OnLabelPressed() { - TrackDiveInUMA(); - Shell::Get()->tray_bluetooth_helper()->SetBluetoothEnabled(true); - tray_controller_->ShowBluetoothDetailedView(); -} - -void BluetoothFeaturePodControllerLegacy::UpdateButton() { - bool is_available = - Shell::Get()->tray_bluetooth_helper()->IsBluetoothStateAvailable(); - button_->SetVisible(is_available); - if (!is_available) - return; - - // Bluetooth power setting is always mutable in login screen before any - // user logs in. The changes will affect local state preferences. - // - // Otherwise, the bluetooth setting should be mutable only if: - // * the active user is the primary user, and - // * the session is not in lock screen - // The changes will affect the primary user's preferences. - SessionControllerImpl* session_controller = - Shell::Get()->session_controller(); - button_->SetEnabled(!session_controller->IsActiveUserSessionStarted() || - (session_controller->IsUserPrimary() && - !session_controller->IsScreenLocked())); - - bool is_enabled = - Shell::Get()->tray_bluetooth_helper()->GetBluetoothState() == - BluetoothSystem::State::kPoweredOn; - button_->SetToggled(is_enabled); - - if (!is_enabled) { - button_->SetVectorIcon(kUnifiedMenuBluetoothLegacyIcon); - button_->SetLabel(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_BLUETOOTH)); - button_->SetSubLabel(l10n_util::GetStringUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_DISABLED_SHORT)); - SetTooltipState(l10n_util::GetStringUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_DISABLED_TOOLTIP)); - return; - } - - BluetoothDeviceList connected_devices; - for (auto& device : - Shell::Get()->tray_bluetooth_helper()->GetAvailableBluetoothDevices()) { - if (device->connection_state == - BluetoothDeviceInfo::ConnectionState::kConnected) { - connected_devices.push_back(device->Clone()); - } - } - - if (connected_devices.size() > 1) { - const size_t device_count = connected_devices.size(); - button_->SetVectorIcon(kUnifiedMenuBluetoothConnectedLegacyIcon); - button_->SetLabel(l10n_util::GetStringUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_MULTIPLE_DEVICES_CONNECTED_LABEL_LEGACY)); - button_->SetSubLabel(base::FormatNumber(device_count)); - SetTooltipState(l10n_util::GetPluralStringFUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_MULTIPLE_DEVICES_CONNECTED_TOOLTIP_LEGACY, - device_count)); - } else if (connected_devices.size() == 1) { - const device::mojom::BluetoothDeviceInfoPtr& device = - connected_devices.back(); - const std::u16string device_name = - device::GetBluetoothDeviceNameForDisplay(device); - button_->SetVectorIcon(kUnifiedMenuBluetoothConnectedLegacyIcon); - button_->SetLabel(device_name); - - if (device->battery_info) { - button_->SetSubLabel(l10n_util::GetStringFUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_DEVICE_BATTERY_PERCENTAGE_LABEL, - base::NumberToString16(device->battery_info->battery_percentage))); - } else { - button_->SetSubLabel(l10n_util::GetStringUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_DEVICE_CONNECTED_LABEL)); - } - SetTooltipState(l10n_util::GetStringFUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_DEVICE_CONNECTED_TOOLTIP_LEGACY, - device_name)); - } else { - button_->SetVectorIcon(kUnifiedMenuBluetoothLegacyIcon); - button_->SetLabel(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_BLUETOOTH)); - button_->SetSubLabel( - l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_BLUETOOTH_ENABLED_SHORT)); - SetTooltipState(l10n_util::GetStringUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_ENABLED_TOOLTIP)); - } -} - -void BluetoothFeaturePodControllerLegacy::SetTooltipState( - const std::u16string& tooltip_state) { - if (button_->GetEnabled()) { - button_->SetIconTooltip(l10n_util::GetStringFUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_TOGGLE_TOOLTIP, tooltip_state)); - button_->SetLabelTooltip(l10n_util::GetStringFUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_SETTINGS_TOOLTIP, tooltip_state)); - } else { - // Do not show "Toggle" text in tooltip when the button is disabled (e.g. - // when the screen is locked or for secondary users). - button_->SetIconTooltip(tooltip_state); - button_->SetLabelTooltip(tooltip_state); - } -} - -void BluetoothFeaturePodControllerLegacy::OnBluetoothSystemStateChanged() { - UpdateButton(); -} - -void BluetoothFeaturePodControllerLegacy::OnBluetoothScanStateChanged() { - UpdateButton(); -} - -void BluetoothFeaturePodControllerLegacy::OnBluetoothDeviceListChanged() { - UpdateButton(); -} - -} // namespace ash
diff --git a/ash/system/bluetooth/bluetooth_feature_pod_controller_legacy.h b/ash/system/bluetooth/bluetooth_feature_pod_controller_legacy.h deleted file mode 100644 index 596b2eb3..0000000 --- a/ash/system/bluetooth/bluetooth_feature_pod_controller_legacy.h +++ /dev/null
@@ -1,57 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef ASH_SYSTEM_BLUETOOTH_BLUETOOTH_FEATURE_POD_CONTROLLER_LEGACY_H_ -#define ASH_SYSTEM_BLUETOOTH_BLUETOOTH_FEATURE_POD_CONTROLLER_LEGACY_H_ - -#include <string> - -#include "ash/constants/quick_settings_catalogs.h" -#include "ash/system/bluetooth/tray_bluetooth_helper.h" -#include "ash/system/unified/feature_pod_controller_base.h" - -namespace ash { - -class UnifiedSystemTrayController; - -// Controller of a feature pod button of bluetooth. -// TODO(crbug.com/1234138): Remove this class when the -// |ash::features::kBluetoothRevamp| feature flag is fully launched. -class BluetoothFeaturePodControllerLegacy - : public FeaturePodControllerBase, - public TrayBluetoothHelper::Observer { - public: - BluetoothFeaturePodControllerLegacy( - UnifiedSystemTrayController* tray_controller); - - BluetoothFeaturePodControllerLegacy( - const BluetoothFeaturePodControllerLegacy&) = delete; - BluetoothFeaturePodControllerLegacy& operator=( - const BluetoothFeaturePodControllerLegacy&) = delete; - - ~BluetoothFeaturePodControllerLegacy() override; - - // FeaturePodControllerBase: - FeaturePodButton* CreateButton() override; - QsFeatureCatalogName GetCatalogName() override; - void OnIconPressed() override; - void OnLabelPressed() override; - - private: - void UpdateButton(); - void SetTooltipState(const std::u16string& tooltip_state); - - // BluetoothObserver: - void OnBluetoothSystemStateChanged() override; - void OnBluetoothScanStateChanged() override; - void OnBluetoothDeviceListChanged() override; - - // Unowned. - UnifiedSystemTrayController* const tray_controller_; - FeaturePodButton* button_ = nullptr; -}; - -} // namespace ash - -#endif // ASH_SYSTEM_BLUETOOTH_BLUETOOTH_FEATURE_POD_CONTROLLER_LEGACY_H_
diff --git a/ash/system/notification_center/notification_center_tray.cc b/ash/system/notification_center/notification_center_tray.cc index 3da95a3..1c6562d 100644 --- a/ash/system/notification_center/notification_center_tray.cc +++ b/ash/system/notification_center/notification_center_tray.cc
@@ -7,9 +7,11 @@ #include <string> #include "ash/constants/tray_background_view_catalog.h" +#include "ash/public/cpp/shelf_config.h" #include "ash/shelf/shelf.h" #include "ash/system/tray/tray_background_view.h" #include "ash/system/tray/tray_bubble_view.h" +#include "ash/system/tray/tray_container.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/message_center/message_center.h" @@ -21,11 +23,24 @@ NotificationCenterTray::NotificationCenterTray(Shelf* shelf) : TrayBackgroundView(shelf, TrayBackgroundViewCatalogName::kNotificationCenter, - RoundedCornerBehavior::kStartRounded) { + RoundedCornerBehavior::kStartRounded), + notification_icons_controller_( + std::make_unique<NotificationIconsController>(shelf)) { SetLayoutManager(std::make_unique<views::FlexLayout>()); set_use_bounce_in_animation(false); message_center::MessageCenter::Get()->AddObserver(this); + + tray_container()->SetMargin( + /*main_axis_margin=*/kUnifiedTrayContentPadding - + ShelfConfig::Get()->status_area_hit_region_padding(), + 0); + + // TODO(b/255986529): Rewrite the `NotificationIconsController` class so that + // we do not have to add icon views that are owned by the + // `NotificationCenterTray` from the controller. We should make sure views are + // only added by host views. + notification_icons_controller_->AddNotificationTrayItems(tray_container()); } NotificationCenterTray::~NotificationCenterTray() { @@ -97,6 +112,9 @@ return; SetVisiblePreferred(new_visibility); + + notification_icons_controller_->UpdateNotificationIcons(); + notification_icons_controller_->UpdateNotificationIndicators(); } BEGIN_METADATA(NotificationCenterTray, TrayBackgroundView)
diff --git a/ash/system/notification_center/notification_center_tray.h b/ash/system/notification_center/notification_center_tray.h index 4c9ccfa..4a3ae3f4 100644 --- a/ash/system/notification_center/notification_center_tray.h +++ b/ash/system/notification_center/notification_center_tray.h
@@ -53,6 +53,9 @@ views::Widget* GetBubbleWidget() const override; private: + friend class NotificationCounterViewTest; + friend class NotificationIconsControllerTest; + // message_center::MessageCenterObserver: void OnNotificationAdded(const std::string& notification_id) override; void OnNotificationDisplayed(
diff --git a/ash/system/status_area_widget.cc b/ash/system/status_area_widget.cc index 863b77d..49a9b81 100644 --- a/ash/system/status_area_widget.cc +++ b/ash/system/status_area_widget.cc
@@ -39,7 +39,7 @@ #include "ash/system/tray/tray_container.h" #include "ash/system/unified/date_tray.h" #include "ash/system/unified/unified_system_tray.h" -#include "ash/system/video_conference/vc_tray.h" +#include "ash/system/video_conference/video_conference_tray.h" #include "ash/system/virtual_keyboard/virtual_keyboard_tray.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm_mode/wm_mode_button_tray.h" @@ -125,7 +125,8 @@ shelf_, TrayBackgroundViewCatalogName::kVirtualKeyboardStatusArea)); if (features::IsVcControlsUiEnabled()) - vc_tray_ = AddTrayButton(std::make_unique<VcTray>(shelf_)); + video_conference_tray_ = + AddTrayButton(std::make_unique<VideoConferenceTray>(shelf_)); stop_recording_button_tray_ = AddTrayButton(std::make_unique<StopRecordingButtonTray>(shelf_)); @@ -294,7 +295,7 @@ case TrayBackgroundViewCatalogName::kLogoutButton: case TrayBackgroundViewCatalogName::kVirtualKeyboardStatusArea: case TrayBackgroundViewCatalogName::kWmMode: - case TrayBackgroundViewCatalogName::kVcTray: + case TrayBackgroundViewCatalogName::kVideoConferenceTray: if (!tray_button->GetVisible()) continue; visible_pod_count += 1;
diff --git a/ash/system/status_area_widget.h b/ash/system/status_area_widget.h index 75c0ceb7..1f89c5d 100644 --- a/ash/system/status_area_widget.h +++ b/ash/system/status_area_widget.h
@@ -41,7 +41,7 @@ class StopRecordingButtonTray; class TrayBackgroundView; class UnifiedSystemTray; -class VcTray; +class VideoConferenceTray; class VirtualKeyboardTray; class WmModeButtonTray; @@ -144,7 +144,9 @@ } OverviewButtonTray* overview_button_tray() { return overview_button_tray_; } PaletteTray* palette_tray() { return palette_tray_; } - VcTray* vc_tray() { return vc_tray_; } + VideoConferenceTray* video_conference_tray() { + return video_conference_tray_; + } StopRecordingButtonTray* stop_recording_button_tray() { return stop_recording_button_tray_; } @@ -281,7 +283,7 @@ PaletteTray* palette_tray_ = nullptr; PhoneHubTray* phone_hub_tray_ = nullptr; EcheTray* eche_tray_ = nullptr; - VcTray* vc_tray_ = nullptr; + VideoConferenceTray* video_conference_tray_ = nullptr; StopRecordingButtonTray* stop_recording_button_tray_ = nullptr; ProjectorAnnotationTray* projector_annotation_tray_ = nullptr; VirtualKeyboardTray* virtual_keyboard_tray_ = nullptr;
diff --git a/ash/system/unified/notification_counter_view_unittest.cc b/ash/system/unified/notification_counter_view_unittest.cc index e141d78..60c96779 100644 --- a/ash/system/unified/notification_counter_view_unittest.cc +++ b/ash/system/unified/notification_counter_view_unittest.cc
@@ -4,10 +4,14 @@ #include "ash/system/unified/notification_counter_view.h" +#include "ash/constants/ash_features.h" +#include "ash/shelf/shelf.h" +#include "ash/system/notification_center/notification_center_tray.h" #include "ash/system/unified/notification_icons_controller.h" #include "ash/system/unified/unified_system_tray.h" #include "ash/test/ash_test_base.h" #include "base/strings/string_number_conversions.h" +#include "base/test/scoped_feature_list.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/image/image.h" #include "ui/message_center/message_center.h" @@ -36,7 +40,8 @@ } // namespace -class NotificationCounterViewTest : public AshTestBase { +class NotificationCounterViewTest : public AshTestBase, + public testing::WithParamInterface<bool> { public: NotificationCounterViewTest() = default; NotificationCounterViewTest(const NotificationCounterViewTest&) = delete; @@ -44,121 +49,119 @@ delete; ~NotificationCounterViewTest() override = default; - // AshTestBase: void SetUp() override { + scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>(); + scoped_feature_list_->InitWithFeatureState(features::kQsRevamp, + IsQsRevampEnabled()); + AshTestBase::SetUp(); - - tray_ = std::make_unique<UnifiedSystemTray>(GetPrimaryShelf()); - notification_icons_controller_ = - std::make_unique<NotificationIconsController>(tray_.get()); - notification_icons_controller_->AddNotificationTrayItems( - tray_->tray_container()); - notification_counter_view_ = - notification_icons_controller_->notification_counter_view(); } - void TearDown() override { - notification_icons_controller_.reset(); - tray_.reset(); - AshTestBase::TearDown(); - } + bool IsQsRevampEnabled() { return GetParam(); } protected: - NotificationCounterView* notification_counter_view() { - return notification_counter_view_; + NotificationCounterView* GetNotificationCounterView() { + auto* status_area_widget = GetPrimaryShelf()->status_area_widget(); + return IsQsRevampEnabled() ? status_area_widget->notification_center_tray() + ->notification_icons_controller_ + ->notification_counter_view() + : status_area_widget->unified_system_tray() + ->notification_icons_controller_ + ->notification_counter_view(); } private: - std::unique_ptr<UnifiedSystemTray> tray_; - std::unique_ptr<NotificationIconsController> notification_icons_controller_; - NotificationCounterView* notification_counter_view_; + std::unique_ptr<base::test::ScopedFeatureList> scoped_feature_list_; }; -TEST_F(NotificationCounterViewTest, CountForDisplay) { +INSTANTIATE_TEST_SUITE_P(All, + NotificationCounterViewTest, + testing::Bool() /* IsQsRevampEnabled() */); + +TEST_P(NotificationCounterViewTest, CountForDisplay) { // Not visible when count == 0. - notification_counter_view()->Update(); - EXPECT_EQ(0, notification_counter_view()->count_for_display_for_testing()); - EXPECT_FALSE(notification_counter_view()->GetVisible()); + GetNotificationCounterView()->Update(); + EXPECT_EQ(0, GetNotificationCounterView()->count_for_display_for_testing()); + EXPECT_FALSE(GetNotificationCounterView()->GetVisible()); // Count is visible and updates between 1..max+1. int max = static_cast<int>(kTrayNotificationMaxCount); for (int i = 1; i <= max + 1; i++) { AddNotification(base::NumberToString(i)); - notification_counter_view()->Update(); - EXPECT_EQ(i, notification_counter_view()->count_for_display_for_testing()); - EXPECT_TRUE(notification_counter_view()->GetVisible()); + GetNotificationCounterView()->Update(); + EXPECT_EQ(i, GetNotificationCounterView()->count_for_display_for_testing()); + EXPECT_TRUE(GetNotificationCounterView()->GetVisible()); } // Count does not change after max+1. AddNotification(base::NumberToString(max + 2)); - notification_counter_view()->Update(); + GetNotificationCounterView()->Update(); EXPECT_EQ(max + 1, - notification_counter_view()->count_for_display_for_testing()); - EXPECT_TRUE(notification_counter_view()->GetVisible()); + GetNotificationCounterView()->count_for_display_for_testing()); + EXPECT_TRUE(GetNotificationCounterView()->GetVisible()); } -TEST_F(NotificationCounterViewTest, HiddenNotificationCount) { +TEST_P(NotificationCounterViewTest, HiddenNotificationCount) { // Not visible when count == 0. - notification_counter_view()->Update(); - EXPECT_EQ(0, notification_counter_view()->count_for_display_for_testing()); - EXPECT_FALSE(notification_counter_view()->GetVisible()); + GetNotificationCounterView()->Update(); + EXPECT_EQ(0, GetNotificationCounterView()->count_for_display_for_testing()); + EXPECT_FALSE(GetNotificationCounterView()->GetVisible()); - // Added a pinned notification, counter should not be visible when the feature - // is enabled. + // Added a pinned notification, counter should not be visible. AddNotification("1", true /* is_pinned */); - notification_counter_view()->Update(); - EXPECT_TRUE(!notification_counter_view()->GetVisible()); + GetNotificationCounterView()->Update(); + EXPECT_TRUE(!GetNotificationCounterView()->GetVisible()); // Added a normal notification. AddNotification("2"); - notification_counter_view()->Update(); - EXPECT_TRUE(notification_counter_view()->GetVisible()); - EXPECT_EQ(1, notification_counter_view()->count_for_display_for_testing()); + GetNotificationCounterView()->Update(); + EXPECT_TRUE(GetNotificationCounterView()->GetVisible()); + EXPECT_EQ(1, GetNotificationCounterView()->count_for_display_for_testing()); // Added another pinned. AddNotification("3", true /* is_pinned */); - notification_counter_view()->Update(); - EXPECT_TRUE(notification_counter_view()->GetVisible()); - EXPECT_EQ(1, notification_counter_view()->count_for_display_for_testing()); + GetNotificationCounterView()->Update(); + EXPECT_TRUE(GetNotificationCounterView()->GetVisible()); + EXPECT_EQ(1, GetNotificationCounterView()->count_for_display_for_testing()); message_center::MessageCenter::Get()->RemoveNotification("1", false /* by_user */); message_center::MessageCenter::Get()->RemoveNotification("3", false /* by_user */); - notification_counter_view()->Update(); - EXPECT_EQ(1, notification_counter_view()->count_for_display_for_testing()); + GetNotificationCounterView()->Update(); + EXPECT_EQ(1, GetNotificationCounterView()->count_for_display_for_testing()); } -TEST_F(NotificationCounterViewTest, DisplayChanged) { +TEST_P(NotificationCounterViewTest, DisplayChanged) { AddNotification("1", true /* is_pinned */); - notification_counter_view()->Update(); + GetNotificationCounterView()->Update(); // In medium size screen, the counter should not be displayed since pinned // notification icon is shown (if the feature is enabled). UpdateDisplay("800x700"); - EXPECT_TRUE(!notification_counter_view()->GetVisible()); + EXPECT_TRUE(!GetNotificationCounterView()->GetVisible()); // The counter should not be shown when we remove the pinned notification. message_center::MessageCenter::Get()->RemoveNotification("1", false /* by_user */); - notification_counter_view()->Update(); - EXPECT_FALSE(notification_counter_view()->GetVisible()); + GetNotificationCounterView()->Update(); + EXPECT_FALSE(GetNotificationCounterView()->GetVisible()); AddNotification("1", true /* is_pinned */); - notification_counter_view()->Update(); + GetNotificationCounterView()->Update(); // In small display, the counter show be shown with pinned notification. UpdateDisplay("600x500"); - EXPECT_TRUE(notification_counter_view()->GetVisible()); + EXPECT_TRUE(GetNotificationCounterView()->GetVisible()); // In large screen size, expected the same behavior like medium screen size. UpdateDisplay("1680x800"); - EXPECT_TRUE(!notification_counter_view()->GetVisible()); + EXPECT_TRUE(!GetNotificationCounterView()->GetVisible()); message_center::MessageCenter::Get()->RemoveNotification("1", false /* by_user */); - notification_counter_view()->Update(); - EXPECT_FALSE(notification_counter_view()->GetVisible()); + GetNotificationCounterView()->Update(); + EXPECT_FALSE(GetNotificationCounterView()->GetVisible()); } } // namespace ash
diff --git a/ash/system/unified/notification_icons_controller.cc b/ash/system/unified/notification_icons_controller.cc index 9612019..f3567ea 100644 --- a/ash/system/unified/notification_icons_controller.cc +++ b/ash/system/unified/notification_icons_controller.cc
@@ -8,10 +8,12 @@ #include "ash/public/cpp/vm_camera_mic_constants.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/session/session_controller_impl.h" +#include "ash/shelf/shelf.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/message_center/ash_message_center_lock_screen_controller.h" #include "ash/system/message_center/message_center_utils.h" +#include "ash/system/notification_center/notification_center_tray.h" #include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_container.h" #include "ash/system/tray/tray_utils.h" @@ -33,6 +35,8 @@ namespace { +constexpr int kIconsViewDisplaySizeThreshold = 768; + // Maximum number of notification icons shown in the system tray button. constexpr int kMaxNotificationIconsShown = 2; constexpr int kNotificationIconSpacing = 1; @@ -57,8 +61,8 @@ return false; } - // We don't want to show these notifications since the information is already - // indicated by another item in tray. + // We don't want to show these notifications since the information is + // already indicated by another item in tray. if (notifier_id == kVmCameraMicNotifierId || notifier_id == kBatteryNotificationNotifierId || notifier_id == kUsbNotificationNotifierId) @@ -139,9 +143,17 @@ } NotificationIconsController::NotificationIconsController( - UnifiedSystemTray* tray) - : tray_(tray) { - system_tray_model_observation_.Observe(tray_->model().get()); + Shelf* shelf, + UnifiedSystemTrayModel* system_tray_model) + : shelf_(shelf), system_tray_model_(system_tray_model) { + if (system_tray_model) { + // `UnifiedSystemTrayModel` should not be used once the kQsRevamp feature is + // enabled. Once kQsRevamp is enabled `UnifiedSystemTrayModel` and + // `NotificationIconsController will have different owner classes so we need + // to remove any dependencies for this class in `UnifiedSystemTrayModel`. + DCHECK(!features::IsQsRevampEnabled()); + system_tray_model_observation_.Observe(system_tray_model); + } message_center::MessageCenter::Get()->AddObserver(this); Shell::Get()->session_controller()->AddObserver(this); } @@ -155,20 +167,30 @@ TrayContainer* tray_container) { for (int i = 0; i < kMaxNotificationIconsShown; ++i) { tray_items_.push_back(tray_container->AddChildView( - std::make_unique<NotificationIconTrayItemView>(tray_->shelf(), this))); + std::make_unique<NotificationIconTrayItemView>(shelf_, + /*controller=*/this))); } notification_counter_view_ = tray_container->AddChildView( - std::make_unique<NotificationCounterView>(tray_->shelf(), this)); + std::make_unique<NotificationCounterView>(shelf_, /*controller=*/this)); + + // `quiet_mode_view_` and `separator_` are only shown in the + // `UnifiedSystemTray` with the QsRevamp feature disabled. Once kQsRevamp + // launches `quiet_mode_view_` will remain in the `UnifiedSystemTray`. + // The `separator_` will not be needed because the icons related to this + // controller will have their own dedicated tray button. + if (!features::IsQsRevampEnabled()) { + quiet_mode_view_ = + tray_container->AddChildView(std::make_unique<QuietModeView>(shelf_)); + + separator_ = tray_container->AddChildView( + std::make_unique<SeparatorTrayItemView>(shelf_)); + } if (!features::IsQsRevampEnabled()) { - quiet_mode_view_ = tray_container->AddChildView( - std::make_unique<QuietModeView>(tray_->shelf())); + OnSystemTrayButtonSizeChanged( + system_tray_model_->GetSystemTrayButtonSize()); } - separator_ = tray_container->AddChildView( - std::make_unique<SeparatorTrayItemView>(tray_->shelf())); - - OnSystemTrayButtonSizeChanged(tray_->model()->GetSystemTrayButtonSize()); } bool NotificationIconsController::TrayItemHasNotification() const { @@ -204,9 +226,39 @@ } void NotificationIconsController::OnSystemTrayButtonSizeChanged( - UnifiedSystemTrayModel::SystemTrayButtonSize system_tray_size) { - icons_view_visible_ = - system_tray_size != UnifiedSystemTrayModel::SystemTrayButtonSize::kSmall; + UnifiedSystemTrayModel::SystemTrayButtonSize unified_system_tray_size) { + icons_view_visible_ = unified_system_tray_size != + UnifiedSystemTrayModel::SystemTrayButtonSize::kSmall; + UpdateNotificationIcons(); + UpdateNotificationIndicators(); +} + +void NotificationIconsController::OnDisplayMetricsChanged( + const display::Display& display, + uint32_t changed_metrics) { + // Icons view visibility is determined by the `UnifiedSystemTrayModel` + // without the QsRevamp feature. + // TODO(b/256692263): Remove `OnSystemTrayButtonSizeChanged` from + // `UnifiedSystemTrayModel` once QsRevamp launches. It is only used to update + // icon visibility for notifications in the tray. + if (!features::IsQsRevampEnabled()) + return; + + aura::Window* window = shelf_->status_area_widget()->GetNativeWindow(); + if (display::Screen::GetScreen()->GetDisplayNearestWindow(window).id() != + display.id()) { + return; + } + + const int display_size = + std::max(display.size().width(), display.size().height()); + + const bool old_icons_view_visible = icons_view_visible_; + icons_view_visible_ = display_size >= kIconsViewDisplaySizeThreshold; + + if (old_icons_view_visible == icons_view_visible_) + return; + UpdateNotificationIcons(); UpdateNotificationIndicators(); } @@ -215,12 +267,13 @@ message_center::Notification* notification = message_center::MessageCenter::Get()->FindVisibleNotificationById(id); // `notification` is null if it is not visible. - if (!notification || !ShouldShowNotification(notification)) - return; + if (notification && ShouldShowNotification(notification)) { + // Reset the notification icons if a notification is added since we don't + // know the position where its icon should be added. + UpdateNotificationIcons(); + } - // Reset the notification icons if a notification is added since we don't - // know the position where its icon should be added. - UpdateNotificationIcons(); + UpdateNotificationIndicators(); } void NotificationIconsController::OnNotificationRemoved(const std::string& id, @@ -229,19 +282,24 @@ // another notification if needed. if (GetNotificationIconShownInTray(id)) UpdateNotificationIcons(); + + UpdateNotificationIndicators(); } void NotificationIconsController::OnNotificationUpdated(const std::string& id) { - // A notification update may impact certain notification icon(s) visibility in - // the tray, so update all notification icons. + // A notification update may impact certain notification icon(s) visibility + // in the tray, so update all notification icons. UpdateNotificationIcons(); + UpdateNotificationIndicators(); } void NotificationIconsController::OnSessionStateChanged( session_manager::SessionState state) { UpdateNotificationIcons(); UpdateNotificationIndicators(); - separator_->UpdateColor(state); + + if (separator_) + separator_->UpdateColor(state); } void NotificationIconsController::UpdateNotificationIcons() { @@ -255,6 +313,7 @@ notification_it != notifications.rend(); ++notification_it) { if (tray_it == tray_items_.rend()) break; + if (ShouldShowNotification(*notification_it)) { (*tray_it)->SetNotification(*notification_it); (*tray_it)->SetVisible(icons_view_visible_); @@ -268,7 +327,9 @@ (*tray_it)->Reset(); (*tray_it)->SetVisible(false); } - separator_->SetVisible(icons_view_visible_ && TrayItemHasNotification()); + + if (separator_) + separator_->SetVisible(icons_view_visible_ && TrayItemHasNotification()); } NotificationIconTrayItemView*
diff --git a/ash/system/unified/notification_icons_controller.h b/ash/system/unified/notification_icons_controller.h index 65d96c02..33e6412 100644 --- a/ash/system/unified/notification_icons_controller.h +++ b/ash/system/unified/notification_icons_controller.h
@@ -5,11 +5,14 @@ #ifndef ASH_SYSTEM_UNIFIED_NOTIFICATION_ICONS_CONTROLLER_H_ #define ASH_SYSTEM_UNIFIED_NOTIFICATION_ICONS_CONTROLLER_H_ +#include <cstdint> + #include "ash/ash_export.h" #include "ash/public/cpp/session/session_observer.h" #include "ash/system/tray/tray_item_view.h" #include "ash/system/unified/unified_system_tray_model.h" #include "base/scoped_observation.h" +#include "ui/display/display_observer.h" #include "ui/message_center/message_center_observer.h" namespace message_center { @@ -18,13 +21,14 @@ namespace ash { -class UnifiedSystemTray; -class TrayContainer; -class TrayItemView; +class NotificationCenterTray; class NotificationCounterView; class NotificationIconsController; class QuietModeView; class SeparatorTrayItemView; +class TrayContainer; +class TrayItemView; +class UnifiedSystemTray; // Tray item view for notification icon shown in the tray. class ASH_EXPORT NotificationIconTrayItemView : public TrayItemView { @@ -60,15 +64,18 @@ NotificationIconsController* const controller_; }; -// Controller for notification icons in UnifiedSystemTray button. The icons will -// be displayed in medium or large screen size and only for important +// Controller for notification icons in `UnifiedSystemTray` button. If the +// QsRevamp feature is enabled, this is used in `NotificationCenterTray`. The +// icons will be displayed in medium or large screen size and only for important // notifications. class ASH_EXPORT NotificationIconsController : public UnifiedSystemTrayModel::Observer, + public display::DisplayObserver, public message_center::MessageCenterObserver, public SessionObserver { public: - explicit NotificationIconsController(UnifiedSystemTray* tray); + explicit NotificationIconsController(Shelf* shelf, + UnifiedSystemTrayModel* model = nullptr); ~NotificationIconsController() override; NotificationIconsController(const NotificationIconsController&) = delete; NotificationIconsController& operator=(const NotificationIconsController&) = @@ -93,6 +100,10 @@ void OnSystemTrayButtonSizeChanged( UnifiedSystemTrayModel::SystemTrayButtonSize system_tray_size) override; + // display::DisplayObserver: + void OnDisplayMetricsChanged(const display::Display& display, + uint32_t changed_metrics) override; + // message_center::MessageCenterObserver: void OnNotificationAdded(const std::string& id) override; void OnNotificationRemoved(const std::string& id, bool by_user) override; @@ -137,7 +148,11 @@ // show the icon view in medium or large screen size. bool icons_view_visible_ = false; - UnifiedSystemTray* tray_; + // Owned by `RootWindowController` + Shelf* const shelf_; + + // Owned by `UnifiedSystemTray` + UnifiedSystemTrayModel* const system_tray_model_; NotificationCounterView* notification_counter_view_ = nullptr; QuietModeView* quiet_mode_view_ = nullptr; @@ -146,6 +161,8 @@ base::ScopedObservation<UnifiedSystemTrayModel, UnifiedSystemTrayModel::Observer> system_tray_model_observation_{this}; + + display::ScopedDisplayObserver display_observer_{this}; }; } // namespace ash
diff --git a/ash/system/unified/notification_icons_controller_unittest.cc b/ash/system/unified/notification_icons_controller_unittest.cc index b2c2faf..5c19c5c8 100644 --- a/ash/system/unified/notification_icons_controller_unittest.cc +++ b/ash/system/unified/notification_icons_controller_unittest.cc
@@ -4,13 +4,17 @@ #include "ash/system/unified/notification_icons_controller.h" +#include "ash/constants/ash_features.h" #include "ash/constants/notifier_catalogs.h" #include "ash/public/cpp/notification_utils.h" #include "ash/public/cpp/vm_camera_mic_constants.h" +#include "ash/shelf/shelf.h" +#include "ash/system/notification_center/notification_center_tray.h" #include "ash/system/tray/tray_item_view.h" #include "ash/system/unified/notification_counter_view.h" #include "ash/system/unified/unified_system_tray.h" #include "ash/test/ash_test_base.h" +#include "base/test/scoped_feature_list.h" #include "ui/message_center/message_center.h" #include "ui/message_center/public/cpp/notification.h" @@ -22,32 +26,27 @@ const char kUsbNotificationNotifierId[] = "ash.power"; } // namespace -class NotificationIconsControllerTest : public AshTestBase { +class NotificationIconsControllerTest + : public AshTestBase, + public testing::WithParamInterface<bool> { public: NotificationIconsControllerTest() = default; ~NotificationIconsControllerTest() override = default; - // AshTestBase: void SetUp() override { + scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>(); + scoped_feature_list_->InitWithFeatureState(features::kQsRevamp, + IsQsRevampEnabled()); + AshTestBase::SetUp(); - - tray_ = std::make_unique<UnifiedSystemTray>(GetPrimaryShelf()); - notification_icons_controller_ = - std::make_unique<NotificationIconsController>(tray_.get()); - notification_icons_controller_->AddNotificationTrayItems( - tray_->tray_container()); - } - - void TearDown() override { - notification_icons_controller_.reset(); - tray_.reset(); - AshTestBase::TearDown(); } TrayItemView* separator() { - return notification_icons_controller_->separator_; + return GetNotificationIconsController()->separator_; } + bool IsQsRevampEnabled() { return GetParam(); } + std::string AddNotification(bool is_pinned, bool is_critical_warning, const std::string& app_id = "app") { @@ -76,12 +75,24 @@ } protected: + NotificationIconsController* GetNotificationIconsController() { + auto* status_area_widget = GetPrimaryShelf()->status_area_widget(); + return IsQsRevampEnabled() ? status_area_widget->notification_center_tray() + ->notification_icons_controller_.get() + : status_area_widget->unified_system_tray() + ->notification_icons_controller_.get(); + } int notification_id_ = 0; - std::unique_ptr<UnifiedSystemTray> tray_; - std::unique_ptr<NotificationIconsController> notification_icons_controller_; + + private: + std::unique_ptr<base::test::ScopedFeatureList> scoped_feature_list_; }; -TEST_F(NotificationIconsControllerTest, DisplayChanged) { +INSTANTIATE_TEST_SUITE_P(All, + NotificationIconsControllerTest, + testing::Bool() /* IsQsRevampEnabled() */); + +TEST_P(NotificationIconsControllerTest, DisplayChanged) { AddNotification(true /* is_pinned */, false /* is_critical_warning */); AddNotification(false /* is_pinned */, false /* is_critical_warning */); @@ -90,148 +101,185 @@ // Notification icons should be shown in medium screen size. UpdateDisplay("800x700"); EXPECT_TRUE( - notification_icons_controller_->tray_items().back()->GetVisible()); - EXPECT_TRUE(separator()->GetVisible()); + GetNotificationIconsController()->tray_items().back()->GetVisible()); + + if (!IsQsRevampEnabled()) + EXPECT_TRUE(separator()->GetVisible()); // Notification icons should not be shown in small screen size. UpdateDisplay("600x500"); EXPECT_FALSE( - notification_icons_controller_->tray_items().back()->GetVisible()); - EXPECT_FALSE(separator()->GetVisible()); + GetNotificationIconsController()->tray_items().back()->GetVisible()); + + if (!IsQsRevampEnabled()) + EXPECT_FALSE(separator()->GetVisible()); // Notification icons should be shown in large screen size. UpdateDisplay("1680x800"); EXPECT_TRUE( - notification_icons_controller_->tray_items().back()->GetVisible()); - EXPECT_TRUE(separator()->GetVisible()); + GetNotificationIconsController()->tray_items().back()->GetVisible()); + + if (!IsQsRevampEnabled()) + EXPECT_TRUE(separator()->GetVisible()); } -TEST_F(NotificationIconsControllerTest, ShowNotificationIcons) { +TEST_P(NotificationIconsControllerTest, ShowNotificationIcons) { UpdateDisplay("800x700"); // Icons get added from RTL, so we check the end of the vector first. - const int end = notification_icons_controller_->tray_items().size() - 1; + const int end = GetNotificationIconsController()->tray_items().size() - 1; // Ensure that the indexes that will be accessed exist. - ASSERT_TRUE(notification_icons_controller_->tray_items().size() >= 2); + ASSERT_TRUE(GetNotificationIconsController()->tray_items().size() >= 2); // If there's no notification, no notification icons should be shown. - EXPECT_FALSE(notification_icons_controller_->tray_items()[end]->GetVisible()); EXPECT_FALSE( - notification_icons_controller_->tray_items()[end - 1]->GetVisible()); - EXPECT_FALSE(separator()->GetVisible()); + GetNotificationIconsController()->tray_items()[end]->GetVisible()); + EXPECT_FALSE( + GetNotificationIconsController()->tray_items()[end - 1]->GetVisible()); + + if (!IsQsRevampEnabled()) + EXPECT_FALSE(separator()->GetVisible()); // Same case for non pinned or non critical warning notification. AddNotification(false /* is_pinned */, false /* is_critical_warning */); - EXPECT_FALSE(notification_icons_controller_->tray_items()[end]->GetVisible()); EXPECT_FALSE( - notification_icons_controller_->tray_items()[end - 1]->GetVisible()); - EXPECT_FALSE(separator()->GetVisible()); + GetNotificationIconsController()->tray_items()[end]->GetVisible()); + EXPECT_FALSE( + GetNotificationIconsController()->tray_items()[end - 1]->GetVisible()); + + if (!IsQsRevampEnabled()) + EXPECT_FALSE(separator()->GetVisible()); // Notification icons should be shown when pinned or critical warning // notification is added. std::string id0 = AddNotification(true /* is_pinned */, false /* is_critical_warning */); - EXPECT_TRUE(notification_icons_controller_->tray_items()[end]->GetVisible()); + EXPECT_TRUE( + GetNotificationIconsController()->tray_items()[end]->GetVisible()); EXPECT_FALSE( - notification_icons_controller_->tray_items()[end - 1]->GetVisible()); - EXPECT_TRUE(separator()->GetVisible()); + GetNotificationIconsController()->tray_items()[end - 1]->GetVisible()); + + if (!IsQsRevampEnabled()) + EXPECT_TRUE(separator()->GetVisible()); std::string id1 = AddNotification(false /* is_pinned */, true /* is_critical_warning */); - EXPECT_TRUE(notification_icons_controller_->tray_items()[end]->GetVisible()); EXPECT_TRUE( - notification_icons_controller_->tray_items()[end - 1]->GetVisible()); - EXPECT_TRUE(separator()->GetVisible()); + GetNotificationIconsController()->tray_items()[end]->GetVisible()); + EXPECT_TRUE( + GetNotificationIconsController()->tray_items()[end - 1]->GetVisible()); + + if (!IsQsRevampEnabled()) + EXPECT_TRUE(separator()->GetVisible()); // Remove the critical warning notification should make the tray show only one // icon. message_center::MessageCenter::Get()->RemoveNotification(id1, false /* by_user */); - EXPECT_TRUE(notification_icons_controller_->tray_items()[end]->GetVisible()); + EXPECT_TRUE( + GetNotificationIconsController()->tray_items()[end]->GetVisible()); EXPECT_FALSE( - notification_icons_controller_->tray_items()[end - 1]->GetVisible()); - EXPECT_TRUE(separator()->GetVisible()); + GetNotificationIconsController()->tray_items()[end - 1]->GetVisible()); + + if (!IsQsRevampEnabled()) + EXPECT_TRUE(separator()->GetVisible()); // Remove the pinned notification, no icon is shown. message_center::MessageCenter::Get()->RemoveNotification(id0, false /* by_user */); - EXPECT_FALSE(notification_icons_controller_->tray_items()[end]->GetVisible()); EXPECT_FALSE( - notification_icons_controller_->tray_items()[end - 1]->GetVisible()); - EXPECT_FALSE(separator()->GetVisible()); + GetNotificationIconsController()->tray_items()[end]->GetVisible()); + EXPECT_FALSE( + GetNotificationIconsController()->tray_items()[end - 1]->GetVisible()); + + if (!IsQsRevampEnabled()) + EXPECT_FALSE(separator()->GetVisible()); } -TEST_F(NotificationIconsControllerTest, NotShowNotificationIcons) { +TEST_P(NotificationIconsControllerTest, NotShowNotificationIcons) { UpdateDisplay("800x700"); // Icons get added from RTL, so we check the end of the vector first. EXPECT_FALSE( - notification_icons_controller_->tray_items().back()->GetVisible()); + GetNotificationIconsController()->tray_items().back()->GetVisible()); AddNotification(true /* is_pinned */, false /* is_critical_warning */, kBatteryNotificationNotifierId); // Battery notification should not be shown. EXPECT_FALSE( - notification_icons_controller_->tray_items().back()->GetVisible()); - EXPECT_FALSE(separator()->GetVisible()); + GetNotificationIconsController()->tray_items().back()->GetVisible()); + + if (!IsQsRevampEnabled()) + EXPECT_FALSE(separator()->GetVisible()); + // Notification count does update for this notification. - notification_icons_controller_->notification_counter_view()->Update(); - EXPECT_EQ(1, notification_icons_controller_->notification_counter_view() + GetNotificationIconsController()->notification_counter_view()->Update(); + EXPECT_EQ(1, GetNotificationIconsController() + ->notification_counter_view() ->count_for_display_for_testing()); AddNotification(true /* is_pinned */, false /* is_critical_warning */, kUsbNotificationNotifierId); // Usb charging notification should not be shown. EXPECT_FALSE( - notification_icons_controller_->tray_items().back()->GetVisible()); - EXPECT_FALSE(separator()->GetVisible()); + GetNotificationIconsController()->tray_items().back()->GetVisible()); + + if (!IsQsRevampEnabled()) + EXPECT_FALSE(separator()->GetVisible()); + // Notification count does update for this notification. - notification_icons_controller_->notification_counter_view()->Update(); - EXPECT_EQ(2, notification_icons_controller_->notification_counter_view() + GetNotificationIconsController()->notification_counter_view()->Update(); + EXPECT_EQ(2, GetNotificationIconsController() + ->notification_counter_view() ->count_for_display_for_testing()); AddNotification(true /* is_pinned */, false /* is_critical_warning */, kVmCameraMicNotifierId); // VM camera/mic notification should not be shown. EXPECT_FALSE( - notification_icons_controller_->tray_items().back()->GetVisible()); - EXPECT_FALSE(separator()->GetVisible()); + GetNotificationIconsController()->tray_items().back()->GetVisible()); + + if (!IsQsRevampEnabled()) + EXPECT_FALSE(separator()->GetVisible()); + // Notification count does not update for this notification (since there's // another tray item for this). - notification_icons_controller_->notification_counter_view()->Update(); - EXPECT_EQ(2, notification_icons_controller_->notification_counter_view() + GetNotificationIconsController()->notification_counter_view()->Update(); + EXPECT_EQ(2, GetNotificationIconsController() + ->notification_counter_view() ->count_for_display_for_testing()); } -TEST_F(NotificationIconsControllerTest, NotificationItemInQuietMode) { +TEST_P(NotificationIconsControllerTest, NotificationItemInQuietMode) { UpdateDisplay("800x700"); message_center::MessageCenter::Get()->SetQuietMode(true); // Icons get added from RTL, so we check the end of the vector first. At // first, no icons should be shown. EXPECT_FALSE( - notification_icons_controller_->tray_items().back()->GetVisible()); + GetNotificationIconsController()->tray_items().back()->GetVisible()); // In quiet mode, notification other than capslock notification should not // show an item in the tray. auto id1 = AddNotification(/*is_pinned=*/true, /*is_critical_warning=*/false); EXPECT_FALSE( - notification_icons_controller_->tray_items().back()->GetVisible()); + GetNotificationIconsController()->tray_items().back()->GetVisible()); auto id2 = AddNotification(/*is_pinned=*/true, /*is_critical_warning=*/false, kCapsLockNotifierId); EXPECT_TRUE( - notification_icons_controller_->tray_items().back()->GetVisible()); - EXPECT_EQ( - id2, - notification_icons_controller_->tray_items().back()->GetNotificationId()); + GetNotificationIconsController()->tray_items().back()->GetVisible()); + EXPECT_EQ(id2, GetNotificationIconsController() + ->tray_items() + .back() + ->GetNotificationId()); message_center::MessageCenter::Get()->RemoveNotification(id2, /*by_user=*/false); EXPECT_FALSE( - notification_icons_controller_->tray_items().back()->GetVisible()); + GetNotificationIconsController()->tray_items().back()->GetVisible()); } } // namespace ash
diff --git a/ash/system/unified/unified_system_tray.cc b/ash/system/unified/unified_system_tray.cc index 0e1252a..7a14849 100644 --- a/ash/system/unified/unified_system_tray.cc +++ b/ash/system/unified/unified_system_tray.cc
@@ -187,7 +187,8 @@ notification_icons_controller_( features::IsQsRevampEnabled() ? nullptr - : std::make_unique<NotificationIconsController>(this)), + : std::make_unique<NotificationIconsController>(shelf, + model_.get())), snooping_protection_view_(features::IsSnoopingProtectionEnabled() ? new SnoopingProtectionView(shelf) : nullptr),
diff --git a/ash/system/unified/unified_system_tray.h b/ash/system/unified/unified_system_tray.h index c843cb4e..8ab2fb9 100644 --- a/ash/system/unified/unified_system_tray.h +++ b/ash/system/unified/unified_system_tray.h
@@ -236,7 +236,9 @@ private: static const base::TimeDelta kNotificationCountUpdateDelay; + friend class NotificationCounterViewTest; friend class NotificationGroupingControllerTest; + friend class NotificationIconsControllerTest; friend class SystemTrayTestApi; friend class UnifiedSystemTrayTest;
diff --git a/ash/system/video_conference/vc_tray.cc b/ash/system/video_conference/video_conference_tray.cc similarity index 69% rename from ash/system/video_conference/vc_tray.cc rename to ash/system/video_conference/video_conference_tray.cc index 27fe3af..e57da28 100644 --- a/ash/system/video_conference/vc_tray.cc +++ b/ash/system/video_conference/video_conference_tray.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/system/video_conference/vc_tray.h" +#include "ash/system/video_conference/video_conference_tray.h" #include <string> @@ -32,40 +32,48 @@ // microphone, and screen sharing. // Note that it's safe to use `base::Unretained()` in IconButton since callback // is destroyed with `this`. -class VcTrayButton : public IconButton { +class VideoConferenceTrayButton : public IconButton { public: - VcTrayButton(const gfx::VectorIcon* icon, const int accessible_name_id) - : IconButton(base::BindRepeating(&VcTrayButton::ToggleButton, + VideoConferenceTrayButton(const gfx::VectorIcon* icon, + const int accessible_name_id) + : IconButton(base::BindRepeating(&VideoConferenceTrayButton::ToggleButton, base::Unretained(this)), IconButton::Type::kMedium, icon, accessible_name_id, /*is_togglable=*/true, /*has_border=*/true) {} - VcTrayButton(const VcTrayButton&) = delete; - VcTrayButton& operator=(const VcTrayButton&) = delete; - ~VcTrayButton() override = default; + VideoConferenceTrayButton(const VideoConferenceTrayButton&) = delete; + VideoConferenceTrayButton& operator=(const VideoConferenceTrayButton&) = + delete; + ~VideoConferenceTrayButton() override = default; private: void ToggleButton() { SetToggled(!toggled()); } }; -VcTray::VcTray(Shelf* shelf) - : TrayBackgroundView(shelf, TrayBackgroundViewCatalogName::kVcTray) { - audio_icon_ = tray_container()->AddChildView(std::make_unique<VcTrayButton>( - &kPrivacyIndicatorsMicrophoneIcon, IDS_PRIVACY_NOTIFICATION_TITLE_MIC)); - camera_icon_ = tray_container()->AddChildView(std::make_unique<VcTrayButton>( - &kPrivacyIndicatorsCameraIcon, IDS_PRIVACY_NOTIFICATION_TITLE_CAMERA)); +VideoConferenceTray::VideoConferenceTray(Shelf* shelf) + : TrayBackgroundView(shelf, + TrayBackgroundViewCatalogName::kVideoConferenceTray) { + audio_icon_ = tray_container()->AddChildView( + std::make_unique<VideoConferenceTrayButton>( + &kPrivacyIndicatorsMicrophoneIcon, + IDS_PRIVACY_NOTIFICATION_TITLE_MIC)); + camera_icon_ = tray_container()->AddChildView( + std::make_unique<VideoConferenceTrayButton>( + &kPrivacyIndicatorsCameraIcon, + IDS_PRIVACY_NOTIFICATION_TITLE_CAMERA)); screen_share_icon_ = tray_container()->AddChildView( - std::make_unique<VcTrayButton>(&kPrivacyIndicatorsScreenShareIcon, - IDS_ASH_STATUS_TRAY_SCREEN_SHARE_TITLE)); + std::make_unique<VideoConferenceTrayButton>( + &kPrivacyIndicatorsScreenShareIcon, + IDS_ASH_STATUS_TRAY_SCREEN_SHARE_TITLE)); expand_indicator_ = tray_container()->AddChildView(std::make_unique<views::ImageView>()); } -VcTray::~VcTray() = default; +VideoConferenceTray::~VideoConferenceTray() = default; -void VcTray::ShowBubble() { +void VideoConferenceTray::ShowBubble() { TrayBubbleView::InitParams init_params; init_params.delegate = GetWeakPtr(); init_params.parent_window = GetBubbleWindowContainer(); @@ -95,7 +103,7 @@ UpdateExpandIndicator(); } -void VcTray::CloseBubble() { +void VideoConferenceTray::CloseBubble() { SetIsActive(false); UpdateExpandIndicator(); @@ -103,50 +111,51 @@ shelf()->UpdateAutoHideState(); } -TrayBubbleView* VcTray::GetBubbleView() { +TrayBubbleView* VideoConferenceTray::GetBubbleView() { return bubble_ ? bubble_->bubble_view() : nullptr; } -views::Widget* VcTray::GetBubbleWidget() const { +views::Widget* VideoConferenceTray::GetBubbleWidget() const { return bubble_ ? bubble_->bubble_widget() : nullptr; } -std::u16string VcTray::GetAccessibleNameForTray() { +std::u16string VideoConferenceTray::GetAccessibleNameForTray() { // TODO(b/253646076): Finish this function. return std::u16string(); } -void VcTray::HideBubbleWithView(const TrayBubbleView* bubble_view) { +void VideoConferenceTray::HideBubbleWithView( + const TrayBubbleView* bubble_view) { if (bubble_ && bubble_->bubble_view() == bubble_view) CloseBubble(); } -void VcTray::ClickedOutsideBubble() { +void VideoConferenceTray::ClickedOutsideBubble() { CloseBubble(); } -void VcTray::HandleLocaleChange() { +void VideoConferenceTray::HandleLocaleChange() { // TODO(b/253646076): Finish this function. } -void VcTray::UpdateLayout() { +void VideoConferenceTray::UpdateLayout() { TrayBackgroundView::UpdateLayout(); // Updates expand indicator for shelf alignment change. UpdateExpandIndicator(); } -void VcTray::OnThemeChanged() { +void VideoConferenceTray::OnThemeChanged() { TrayBackgroundView::OnThemeChanged(); UpdateExpandIndicator(); } -void VcTray::UpdateAfterLoginStatusChange() { +void VideoConferenceTray::UpdateAfterLoginStatusChange() { SetVisiblePreferred(true); } -void VcTray::UpdateExpandIndicator() { +void VideoConferenceTray::UpdateExpandIndicator() { auto image = gfx::CreateVectorIcon( kUnifiedMenuExpandIcon, TrayIconColor(Shell::Get()->session_controller()->GetSessionState())); @@ -177,7 +186,7 @@ gfx::ImageSkiaOperations::CreateRotatedImage(image, rotation)); } -BEGIN_METADATA(VcTray, TrayBackgroundView) +BEGIN_METADATA(VideoConferenceTray, TrayBackgroundView) END_METADATA } // namespace ash
diff --git a/ash/system/video_conference/vc_tray.h b/ash/system/video_conference/video_conference_tray.h similarity index 74% rename from ash/system/video_conference/vc_tray.h rename to ash/system/video_conference/video_conference_tray.h index ddc8f40..43960fd 100644 --- a/ash/system/video_conference/vc_tray.h +++ b/ash/system/video_conference/video_conference_tray.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SYSTEM_VIDEO_CONFERENCE_VC_TRAY_H_ -#define ASH_SYSTEM_VIDEO_CONFERENCE_VC_TRAY_H_ +#ifndef ASH_SYSTEM_VIDEO_CONFERENCE_VIDEO_CONFERENCE_TRAY_H_ +#define ASH_SYSTEM_VIDEO_CONFERENCE_VIDEO_CONFERENCE_TRAY_H_ #include <string> @@ -25,14 +25,14 @@ // This class represents the VC Controls tray button in the status area and // controls the bubble that is shown when the tray button is clicked. -class ASH_EXPORT VcTray : public TrayBackgroundView { +class ASH_EXPORT VideoConferenceTray : public TrayBackgroundView { public: - METADATA_HEADER(VcTray); + METADATA_HEADER(VideoConferenceTray); - explicit VcTray(Shelf* shelf); - VcTray(const VcTray&) = delete; - VcTray& operator=(const VcTray&) = delete; - ~VcTray() override; + explicit VideoConferenceTray(Shelf* shelf); + VideoConferenceTray(const VideoConferenceTray&) = delete; + VideoConferenceTray& operator=(const VideoConferenceTray&) = delete; + ~VideoConferenceTray() override; // TrayBackgroundView: void CloseBubble() override; @@ -48,7 +48,7 @@ void UpdateAfterLoginStatusChange() override; private: - friend class VcTrayTest; + friend class VideoConferenceTrayTest; // Updates the orientation of the expand indicator, based on shelf alignment // and whether the bubble is opened. @@ -66,4 +66,4 @@ } // namespace ash -#endif // ASH_SYSTEM_VIDEO_CONFERENCE_VC_TRAY_H_ +#endif // ASH_SYSTEM_VIDEO_CONFERENCE_VIDEO_CONFERENCE_TRAY_H_
diff --git a/ash/system/video_conference/vc_tray_unittest.cc b/ash/system/video_conference/video_conference_tray_unittest.cc similarity index 77% rename from ash/system/video_conference/vc_tray_unittest.cc rename to ash/system/video_conference/video_conference_tray_unittest.cc index fc8f4d8..d732fe38 100644 --- a/ash/system/video_conference/vc_tray_unittest.cc +++ b/ash/system/video_conference/video_conference_tray_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/system/video_conference/vc_tray.h" +#include "ash/system/video_conference/video_conference_tray.h" #include "ash/constants/ash_features.h" #include "ash/resources/vector_icons/vector_icons.h" @@ -29,12 +29,12 @@ } // namespace -class VcTrayTest : public AshTestBase { +class VideoConferenceTrayTest : public AshTestBase { public: - VcTrayTest() = default; - VcTrayTest(const VcTrayTest&) = delete; - VcTrayTest& operator=(const VcTrayTest&) = delete; - ~VcTrayTest() override = default; + VideoConferenceTrayTest() = default; + VideoConferenceTrayTest(const VideoConferenceTrayTest&) = delete; + VideoConferenceTrayTest& operator=(const VideoConferenceTrayTest&) = delete; + ~VideoConferenceTrayTest() override = default; void SetUp() override { scoped_feature_list_.InitAndEnableFeature(features::kVcControlsUi); @@ -42,40 +42,43 @@ AshTestBase::SetUp(); } - VcTray* vc_tray() { - return StatusAreaWidgetTestHelper::GetStatusAreaWidget()->vc_tray(); + VideoConferenceTray* video_conference_tray() { + return StatusAreaWidgetTestHelper::GetStatusAreaWidget() + ->video_conference_tray(); } - views::ImageView* expand_indicator() { return vc_tray()->expand_indicator_; } + views::ImageView* expand_indicator() { + return video_conference_tray()->expand_indicator_; + } private: base::test::ScopedFeatureList scoped_feature_list_; }; -TEST_F(VcTrayTest, ClickTrayButton) { - EXPECT_FALSE(vc_tray()->GetBubbleView()); +TEST_F(VideoConferenceTrayTest, ClickTrayButton) { + EXPECT_FALSE(video_conference_tray()->GetBubbleView()); // Clicking the tray button should construct and open up the bubble. LeftClickOn(expand_indicator()); - EXPECT_TRUE(vc_tray()->GetBubbleView()); - EXPECT_TRUE(vc_tray()->GetBubbleView()->GetVisible()); + EXPECT_TRUE(video_conference_tray()->GetBubbleView()); + EXPECT_TRUE(video_conference_tray()->GetBubbleView()->GetVisible()); // Clicking it again should reset the bubble. LeftClickOn(expand_indicator()); - EXPECT_FALSE(vc_tray()->GetBubbleView()); + EXPECT_FALSE(video_conference_tray()->GetBubbleView()); LeftClickOn(expand_indicator()); - EXPECT_TRUE(vc_tray()->GetBubbleView()); - EXPECT_TRUE(vc_tray()->GetBubbleView()->GetVisible()); + EXPECT_TRUE(video_conference_tray()->GetBubbleView()); + EXPECT_TRUE(video_conference_tray()->GetBubbleView()->GetVisible()); // Click anywhere else outside the bubble (i.e. the status area button) should // close the bubble. LeftClickOn( StatusAreaWidgetTestHelper::GetStatusAreaWidget()->unified_system_tray()); - EXPECT_FALSE(vc_tray()->GetBubbleView()); + EXPECT_FALSE(video_conference_tray()->GetBubbleView()); } -TEST_F(VcTrayTest, ExpandIndicator) { +TEST_F(VideoConferenceTrayTest, ExpandIndicator) { GetPrimaryShelf()->SetAlignment(ShelfAlignment::kBottom); auto expected_image = gfx::CreateVectorIcon( kUnifiedMenuExpandIcon,
diff --git a/ash/webui/common/resources/multidevice_setup/BUILD.gn b/ash/webui/common/resources/multidevice_setup/BUILD.gn index e81a537..30f6ed5 100644 --- a/ash/webui/common/resources/multidevice_setup/BUILD.gn +++ b/ash/webui/common/resources/multidevice_setup/BUILD.gn
@@ -41,7 +41,7 @@ js_library("mojo_api") { deps = [ "//chromeos/ash/services/multidevice_setup/public/mojom:mojom_webui_js", - "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] } @@ -57,6 +57,7 @@ "//ash/webui/common/resources:web_ui_listener_behavior", "//chromeos/ash/services/multidevice_setup/public/mojom:mojom_webui_js", "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] } @@ -87,8 +88,8 @@ ":mojo_api", ":multidevice_setup_delegate", ":ui_page_container_behavior", - "//ash/services/device_sync/public/mojom:mojom_webui_js", "//ash/webui/common/resources:web_ui_listener_behavior", + "//chromeos/ash/services/device_sync/public/mojom:mojom_webui_js", "//chromeos/ash/services/multidevice_setup/public/mojom:mojom_webui_js", ] externs_list =
diff --git a/ash/webui/common/resources/multidevice_setup/mojo_api.js b/ash/webui/common/resources/multidevice_setup/mojo_api.js index 3641968..6d27a39 100644 --- a/ash/webui/common/resources/multidevice_setup/mojo_api.js +++ b/ash/webui/common/resources/multidevice_setup/mojo_api.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; import {MultiDeviceSetup, MultiDeviceSetupRemote} from 'chrome://resources/mojo/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom-webui.js'; /** @interface */
diff --git a/ash/webui/common/resources/multidevice_setup/multidevice_setup_browser_proxy.js b/ash/webui/common/resources/multidevice_setup/multidevice_setup_browser_proxy.js index 5d6ac99..ffb2ddde 100644 --- a/ash/webui/common/resources/multidevice_setup/multidevice_setup_browser_proxy.js +++ b/ash/webui/common/resources/multidevice_setup/multidevice_setup_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** @interface */ export class BrowserProxy {
diff --git a/ash/webui/common/resources/multidevice_setup/start_setup_page.js b/ash/webui/common/resources/multidevice_setup/start_setup_page.js index 0a6d77b..68f4c64 100644 --- a/ash/webui/common/resources/multidevice_setup/start_setup_page.js +++ b/ash/webui/common/resources/multidevice_setup/start_setup_page.js
@@ -14,7 +14,7 @@ import {WebUIListenerBehavior} from '//resources/ash/common/web_ui_listener_behavior.js'; import {loadTimeData} from '//resources/js/load_time_data.m.js'; import {Polymer} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {ConnectivityStatus} from 'chrome://resources/mojo/ash/services/device_sync/public/mojom/device_sync.mojom-webui.js'; +import {ConnectivityStatus} from 'chrome://resources/mojo/chromeos/ash/services/device_sync/public/mojom/device_sync.mojom-webui.js'; import {HostDevice} from 'chrome://resources/mojo/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom-webui.js'; import {MultiDeviceSetupDelegate} from './multidevice_setup_delegate.js';
diff --git a/ash/webui/common/resources/network/BUILD.gn b/ash/webui/common/resources/network/BUILD.gn index c8568811a..26c31f3a 100644 --- a/ash/webui/common/resources/network/BUILD.gn +++ b/ash/webui/common/resources/network/BUILD.gn
@@ -44,7 +44,7 @@ js_library("mojo_interface_provider") { deps = [ "//chromeos/services/network_config/public/mojom:mojom_webui_js", - "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] }
diff --git a/ash/webui/common/resources/network/mojo_interface_provider.js b/ash/webui/common/resources/network/mojo_interface_provider.js index 14c479c..d9786c75 100644 --- a/ash/webui/common/resources/network/mojo_interface_provider.js +++ b/ash/webui/common/resources/network/mojo_interface_provider.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter} from '//resources/js/cr.m.js'; +import {addSingletonGetter} from '//resources/js/cr_deprecated.js'; import {CrosNetworkConfig, CrosNetworkConfigRemote} from 'chrome://resources/mojo/chromeos/services/network_config/public/mojom/cros_network_config.mojom-webui.js'; /** @interface */
diff --git a/ash/webui/common/resources/smb_shares/BUILD.gn b/ash/webui/common/resources/smb_shares/BUILD.gn index 85d6df4..87b31475 100644 --- a/ash/webui/common/resources/smb_shares/BUILD.gn +++ b/ash/webui/common/resources/smb_shares/BUILD.gn
@@ -31,5 +31,8 @@ } js_library("smb_browser_proxy") { - deps = [ "//ui/webui/resources/js:cr.m" ] + deps = [ + "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", + ] }
diff --git a/ash/webui/common/resources/smb_shares/smb_browser_proxy.js b/ash/webui/common/resources/smb_shares/smb_browser_proxy.js index 1996f2d..0b42c03 100644 --- a/ash/webui/common/resources/smb_shares/smb_browser_proxy.js +++ b/ash/webui/common/resources/smb_shares/smb_browser_proxy.js
@@ -7,7 +7,8 @@ * interact with the browser. Used only on Chrome OS. */ -import {addSingletonGetter, sendWithPromise} from '//resources/js/cr.m.js'; +import {sendWithPromise} from '//resources/js/cr.m.js'; +import {addSingletonGetter} from '//resources/js/cr_deprecated.js'; /** * @enum {number}
diff --git a/ash/webui/diagnostics_ui/resources/keyboard_tester.ts b/ash/webui/diagnostics_ui/resources/keyboard_tester.ts index 48cb29ed..75f5770 100644 --- a/ash/webui/diagnostics_ui/resources/keyboard_tester.ts +++ b/ash/webui/diagnostics_ui/resources/keyboard_tester.ts
@@ -177,8 +177,8 @@ constructor() { super(); - this.addEventListener('keydown', this.onKeyDown.bind(this)); - this.addEventListener('keyup', this.onKeyUp.bind(this)); + document.addEventListener('keydown', (e) => this.onKeyPress(e)); + document.addEventListener('keyup', (e) => this.onKeyPress(e)); } private computeLayoutIsKnown_(keyboard?: KeyboardInfo): boolean { @@ -259,17 +259,17 @@ this.$.dialog.showModal(); } - onKeyUp(e: KeyboardEvent): void { - e.preventDefault(); - e.stopPropagation(); - } - - onKeyDown(e: KeyboardEvent): void { + // Prevent the default behavior for keydown/keyup only when the keyboard + // tester dialog is opened. + onKeyPress(e: KeyboardEvent): void { + if (!this.isOpen()) { + return; + } e.preventDefault(); e.stopPropagation(); - // If we receive alt + esc we should close the app - if (e.altKey && e.key === 'Escape') { + // If we receive alt + esc we should close the tester. + if (e.type === 'keydown' && e.altKey && e.key === 'Escape') { this.close(); } } @@ -373,6 +373,9 @@ */ onKeyEventsResumed(): void { console.log('Key events resumed'); + if (this.isOpen()) { + this.$.dialog.focus(); + } this.$.lostFocusToast.hide(); } }
diff --git a/ash/webui/eche_app_ui/BUILD.gn b/ash/webui/eche_app_ui/BUILD.gn index 393868c..d473a240 100644 --- a/ash/webui/eche_app_ui/BUILD.gn +++ b/ash/webui/eche_app_ui/BUILD.gn
@@ -86,13 +86,13 @@ "//ash/components/phonehub", "//ash/constants", "//ash/public/cpp", - "//ash/services/device_sync/public/cpp:cpp", "//ash/webui/eche_app_ui/mojom", "//ash/webui/eche_app_ui/proto", "//ash/webui/resources:eche_app_resources", "//ash/webui/resources:eche_bundle_resources", "//chromeos/ash/components/multidevice:multidevice", "//chromeos/ash/components/multidevice/logging", + "//chromeos/ash/services/device_sync/public/cpp:cpp", "//chromeos/ash/services/multidevice_setup/public/cpp:cpp", "//chromeos/ash/services/multidevice_setup/public/cpp:prefs", "//chromeos/ash/services/secure_channel/public/cpp/client", @@ -161,14 +161,14 @@ "//ash/components/phonehub", "//ash/components/phonehub:debug", "//ash/public/cpp", - "//ash/services/device_sync/public/cpp", - "//ash/services/device_sync/public/cpp:test_support", "//ash/webui/eche_app_ui/proto", "//base", "//base/test:test_support", "//chromeos/ash/components:test_support", "//chromeos/ash/components/multidevice", "//chromeos/ash/components/multidevice:test_support", + "//chromeos/ash/services/device_sync/public/cpp", + "//chromeos/ash/services/device_sync/public/cpp:test_support", "//chromeos/ash/services/multidevice_setup/public/cpp", "//chromeos/ash/services/multidevice_setup/public/cpp:prefs", "//chromeos/ash/services/multidevice_setup/public/cpp:test_support",
diff --git a/ash/webui/eche_app_ui/DEPS b/ash/webui/eche_app_ui/DEPS index 3408a3e..4e108c2 100644 --- a/ash/webui/eche_app_ui/DEPS +++ b/ash/webui/eche_app_ui/DEPS
@@ -1,6 +1,6 @@ include_rules = [ # Do not add chrome here (use a delegate instead). - "+ash/services/device_sync/public/cpp", + "+chromeos/ash/services/device_sync/public/cpp", "+components/keyed_service/core/keyed_service.h", "+crypto/random.h", "+third_party/blink/public/common/web_preferences",
diff --git a/ash/webui/eche_app_ui/eche_app_manager_unittest.cc b/ash/webui/eche_app_ui/eche_app_manager_unittest.cc index 6878eb1..78493289 100644 --- a/ash/webui/eche_app_ui/eche_app_manager_unittest.cc +++ b/ash/webui/eche_app_ui/eche_app_manager_unittest.cc
@@ -8,7 +8,6 @@ #include "ash/components/phonehub/fake_phone_hub_manager.h" #include "ash/components/phonehub/phone_hub_manager.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "ash/webui/eche_app_ui/eche_stream_status_change_handler.h" #include "ash/webui/eche_app_ui/launch_app_helper.h" #include "ash/webui/eche_app_ui/system_info.h" @@ -18,6 +17,7 @@ #include "base/test/task_environment.h" #include "chromeos/ash/components/multidevice/logging/logging.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/presence_monitor_client.h"
diff --git a/ash/webui/eche_app_ui/eche_feature_status_provider.cc b/ash/webui/eche_app_ui/eche_feature_status_provider.cc index 926d816..2245685 100644 --- a/ash/webui/eche_app_ui/eche_feature_status_provider.cc +++ b/ash/webui/eche_app_ui/eche_feature_status_provider.cc
@@ -6,11 +6,11 @@ #include "ash/components/phonehub/feature_status.h" #include "ash/components/phonehub/phone_hub_manager.h" -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/components/multidevice/logging/logging.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" #include "chromeos/ash/components/multidevice/software_feature.h" #include "chromeos/ash/components/multidevice/software_feature_state.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" namespace ash { namespace eche_app {
diff --git a/ash/webui/eche_app_ui/eche_feature_status_provider_unittest.cc b/ash/webui/eche_app_ui/eche_feature_status_provider_unittest.cc index da6eed9..e5b0d1f8 100644 --- a/ash/webui/eche_app_ui/eche_feature_status_provider_unittest.cc +++ b/ash/webui/eche_app_ui/eche_feature_status_provider_unittest.cc
@@ -9,9 +9,9 @@ #include "ash/components/phonehub/fake_phone_hub_manager.h" #include "ash/components/phonehub/phone_hub_manager.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/test/task_environment.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_connection_manager.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/ash/webui/eche_app_ui/eche_presence_manager.cc b/ash/webui/eche_app_ui/eche_presence_manager.cc index a0cb3bd..0da6831 100644 --- a/ash/webui/eche_app_ui/eche_presence_manager.cc +++ b/ash/webui/eche_app_ui/eche_presence_manager.cc
@@ -4,11 +4,11 @@ #include "ash/webui/eche_app_ui/eche_presence_manager.h" -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "ash/webui/eche_app_ui/eche_connector.h" #include "ash/webui/eche_app_ui/proto/exo_messages.pb.h" #include "chromeos/ash/components/multidevice/logging/logging.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/presence_monitor_client.h" namespace ash {
diff --git a/ash/webui/eche_app_ui/eche_presence_manager_unittest.cc b/ash/webui/eche_app_ui/eche_presence_manager_unittest.cc index d273774..f7ad51a 100644 --- a/ash/webui/eche_app_ui/eche_presence_manager_unittest.cc +++ b/ash/webui/eche_app_ui/eche_presence_manager_unittest.cc
@@ -5,7 +5,6 @@ #include "ash/webui/eche_app_ui/eche_presence_manager.h" #include "ash/constants/ash_features.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "ash/webui/eche_app_ui/fake_eche_connector.h" #include "ash/webui/eche_app_ui/fake_eche_message_receiver.h" #include "ash/webui/eche_app_ui/fake_feature_status_provider.h" @@ -13,6 +12,7 @@ #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/presence_monitor_client_impl.h" #include "components/prefs/testing_pref_service.h"
diff --git a/ash/webui/multidevice_debug/BUILD.gn b/ash/webui/multidevice_debug/BUILD.gn index 6aca62d..4f092a4 100644 --- a/ash/webui/multidevice_debug/BUILD.gn +++ b/ash/webui/multidevice_debug/BUILD.gn
@@ -20,11 +20,11 @@ "//ash/constants", "//ash/services/device_sync/proto", "//ash/services/device_sync/proto:util", - "//ash/services/device_sync/public/cpp", "//ash/webui/resources:multidevice_debug_resources", "//base", "//base:i18n", "//chromeos/ash/components/multidevice/logging", + "//chromeos/ash/services/device_sync/public/cpp", "//chromeos/ash/services/multidevice_setup/public/mojom", "//chromeos/ash/services/secure_channel/public/cpp/client", "//chromeos/ash/services/secure_channel/public/mojom", @@ -36,5 +36,5 @@ "//ui/resources", "//ui/webui", ] - public_deps = [ "//ash/services/device_sync/public/mojom" ] + public_deps = [ "//chromeos/ash/services/device_sync/public/mojom" ] }
diff --git a/ash/webui/multidevice_debug/DEPS b/ash/webui/multidevice_debug/DEPS index 4d30432..9c19860 100644 --- a/ash/webui/multidevice_debug/DEPS +++ b/ash/webui/multidevice_debug/DEPS
@@ -1,6 +1,6 @@ include_rules = [ "+ash/services/device_sync/proto", - "+ash/services/device_sync/public/cpp", + "+chromeos/ash/services/device_sync/public/cpp", "+chromeos/ash/services/multidevice_setup/public/mojom", "+device/bluetooth", ]
diff --git a/ash/webui/multidevice_debug/proximity_auth_ui.cc b/ash/webui/multidevice_debug/proximity_auth_ui.cc index b9d0e6a..949185b 100644 --- a/ash/webui/multidevice_debug/proximity_auth_ui.cc +++ b/ash/webui/multidevice_debug/proximity_auth_ui.cc
@@ -6,11 +6,11 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "ash/webui/grit/ash_multidevice_debug_resources.h" #include "ash/webui/multidevice_debug/proximity_auth_webui_handler.h" #include "ash/webui/multidevice_debug/url_constants.h" #include "base/bind.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h"
diff --git a/ash/webui/multidevice_debug/proximity_auth_webui_handler.h b/ash/webui/multidevice_debug/proximity_auth_webui_handler.h index 40f5352..853265ee 100644 --- a/ash/webui/multidevice_debug/proximity_auth_webui_handler.h +++ b/ash/webui/multidevice_debug/proximity_auth_webui_handler.h
@@ -5,11 +5,11 @@ #ifndef ASH_WEBUI_MULTIDEVICE_DEBUG_PROXIMITY_AUTH_WEBUI_HANDLER_H_ #define ASH_WEBUI_MULTIDEVICE_DEBUG_PROXIMITY_AUTH_WEBUI_HANDLER_H_ -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/memory/weak_ptr.h" #include "base/values.h" #include "chromeos/ash/components/multidevice/logging/log_buffer.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "content/public/browser/web_ui_message_handler.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/ash/webui/multidevice_debug/resources/proximity_auth.html b/ash/webui/multidevice_debug/resources/proximity_auth.html index 39cd7f9..2b9ed4b 100644 --- a/ash/webui/multidevice_debug/resources/proximity_auth.html +++ b/ash/webui/multidevice_debug/resources/proximity_auth.html
@@ -17,7 +17,7 @@ </script> <script src="chrome://resources/mojo/chromeos/ash/components/multidevice/mojom/multidevice_types.mojom-lite.js"> </script> - <script src="chrome://resources/mojo/ash/services/device_sync/public/mojom/device_sync.mojom-lite.js"> + <script src="chrome://resources/mojo/chromeos/ash/services/device_sync/public/mojom/device_sync.mojom-lite.js"> </script> <script src="chrome://resources/mojo/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom-lite.js"> </script>
diff --git a/ash/webui/os_feedback_ui/resources/share_data_page.html b/ash/webui/os_feedback_ui/resources/share_data_page.html index 33429d5..2b57657 100644 --- a/ash/webui/os_feedback_ui/resources/share_data_page.html +++ b/ash/webui/os_feedback_ui/resources/share_data_page.html
@@ -156,7 +156,9 @@ .checkbox-label { color: var(--cros-text-color-primary); + font-size: 13px; line-height: 20px; + margin-top: -2px; } cr-dialog::part(dialog) { @@ -234,6 +236,11 @@ #screenshotCheckbox:focus { --cr-checkbox-ripple-ring: 2px solid var(--cros-focus-ring-color); } + + cr-checkbox { + align-items: flex-start; + padding-top: 2px; + } </style> <div id="container"> <div id="header"> @@ -316,7 +323,8 @@ <!-- System Information --> <div id="sysInfoContainer" class="checkbox-field-container"> <cr-checkbox id="sysInfoCheckbox" aria-labelledby="sysInfoCheckboxLabel" checked> - <div id="sysInfoCheckboxLabel" inner-h-t-m-l="[[sysInfoCheckboxLabel_]]"></div> + <div id="sysInfoCheckboxLabel" inner-h-t-m-l="[[sysInfoCheckboxLabel_]]" + class="checkbox-label"></div> </cr-checkbox> </div> <!-- Assistant Logs (Googler Internal Only) -->
diff --git a/ash/webui/projector_app/resources/annotator/trusted/BUILD.gn b/ash/webui/projector_app/resources/annotator/trusted/BUILD.gn index e3fc9f3..afd945b 100644 --- a/ash/webui/projector_app/resources/annotator/trusted/BUILD.gn +++ b/ash/webui/projector_app/resources/annotator/trusted/BUILD.gn
@@ -20,6 +20,8 @@ "//ash/webui/common/resources/post_message_api:post_message_api_request_handler", "//ash/webui/projector_app/resources/common:message_types", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", + "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] externs_list = [ "../../common/projector_app.externs.js" ] }
diff --git a/ash/webui/projector_app/resources/annotator/trusted/annotator_browser_proxy.js b/ash/webui/projector_app/resources/annotator/trusted/annotator_browser_proxy.js index 696ed57..6a0cf19 100644 --- a/ash/webui/projector_app/resources/annotator/trusted/annotator_browser_proxy.js +++ b/ash/webui/projector_app/resources/annotator/trusted/annotator_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** * To use the annotator proxy, please import this module and call
diff --git a/ash/webui/projector_app/resources/app/trusted/projector_browser_proxy.js b/ash/webui/projector_app/resources/app/trusted/projector_browser_proxy.js index 472c46b..64dfe57 100644 --- a/ash/webui/projector_app/resources/app/trusted/projector_browser_proxy.js +++ b/ash/webui/projector_app/resources/app/trusted/projector_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** * To use the browser proxy, please import this module and call
diff --git a/ash/webui/scanning/resources/BUILD.gn b/ash/webui/scanning/resources/BUILD.gn index 38978eb..cbae326a 100644 --- a/ash/webui/scanning/resources/BUILD.gn +++ b/ash/webui/scanning/resources/BUILD.gn
@@ -184,7 +184,10 @@ } js_library("scanning_browser_proxy") { - deps = [ "//ui/webui/resources/js:cr.m" ] + deps = [ + "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", + ] } js_library("mojo_interface_provider") {
diff --git a/ash/webui/scanning/resources/scanning_browser_proxy.js b/ash/webui/scanning/resources/scanning_browser_proxy.js index c6f3f6eb..c3a9cd0 100644 --- a/ash/webui/scanning/resources/scanning_browser_proxy.js +++ b/ash/webui/scanning/resources/scanning_browser_proxy.js
@@ -8,7 +8,8 @@ * in chrome/. */ -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; import {ScanCompleteAction} from './scanning_app_types.js';
diff --git a/ash/webui/shortcut_customization_ui/resources/js/accelerator_lookup_manager.ts b/ash/webui/shortcut_customization_ui/resources/js/accelerator_lookup_manager.ts index c4fb311..57db5b4 100644 --- a/ash/webui/shortcut_customization_ui/resources/js/accelerator_lookup_manager.ts +++ b/ash/webui/shortcut_customization_ui/resources/js/accelerator_lookup_manager.ts
@@ -62,12 +62,12 @@ {keyCode: accelerator.key, modifiers: accelerator.modifiers}); } - getAccelerators(source: number|string, action: number|string): + getAcceleratorInfos(source: number|string, action: number|string): AcceleratorInfo[] { const uuid = `${source}-${action}`; - const accelerator = this.acceleratorLookup_.get(uuid); - assert(accelerator); - return accelerator; + const acceleratorInfos = this.acceleratorLookup_.get(uuid); + assert(acceleratorInfos); + return acceleratorInfos; } getAcceleratorLayout(category: number, subCategory: number): LayoutInfo[] { @@ -113,7 +113,8 @@ this.acceleratorLookup_.set(id, []); } accelInfos.forEach((info: AcceleratorInfo) => { - this.getAccelerators(source, actionId).push(Object.assign({}, info)); + this.getAcceleratorInfos(source, actionId) + .push(Object.assign({}, info)); this.reverseAcceleratorLookup_.set( this.getKeyForLookup(info.accelerator), id); }); @@ -145,7 +146,7 @@ replaceAccelerator( source: AcceleratorSource, action: number, oldAccelerator: Accelerator, - newAccelerator: Accelerator) { + newAccelInfo: AcceleratorInfo) { const foundIdx = this.getAcceleratorInfoIndex_(source, action, oldAccelerator); @@ -155,21 +156,22 @@ assertNotReached(); } - if (areAcceleratorsEqual(oldAccelerator, newAccelerator)) { + if (areAcceleratorsEqual(oldAccelerator, newAccelInfo.accelerator)) { // Attempted to replace with the same accelerator. return; } // Check to see if there is a pre-existing accelerator to remove or disable // first. - this.maybeRemoveOrDisableAccelerator_(newAccelerator); + this.maybeRemoveOrDisableAccelerator_(newAccelInfo.accelerator); - const accelInfos = this.getAccelerators(source, action); + const accelInfos = this.getAcceleratorInfos(source, action); const currentAccelerator = accelInfos[foundIdx]; // Handle the edge case in which the user is attempting to replace an // existing accelerator with a disabled default accelerator. - if (this.maybeReenableDefaultAccelerator(accelInfos, newAccelerator)) { + if (this.maybeReenableDefaultAccelerator( + accelInfos, newAccelInfo.accelerator)) { // User replaced a non-default accelerator with a default accelerator. // Remove the non-default accelerator. accelInfos.splice(foundIdx, 1); @@ -180,47 +182,42 @@ // The default accelerator should be disabled. currentAccelerator.state = AcceleratorState.kDisabledByUser; - this.addAccelerator(source, action, newAccelerator); + this.addAccelerator(source, action, newAccelInfo); } else { - // Update the old accelerator with the new one. - currentAccelerator.accelerator = newAccelerator; + // Replace previous AcceleratorInfo with the new one. + accelInfos[foundIdx] = newAccelInfo; } } // Update the reverse look up maps. this.reverseAcceleratorLookup_.set( - this.getKeyForLookup(newAccelerator), `${source}-${action}`); + this.getKeyForLookup(newAccelInfo.accelerator), `${source}-${action}`); this.reverseAcceleratorLookup_.delete(this.getKeyForLookup(oldAccelerator)); } addAccelerator( - source: AcceleratorSource, action: number, newAccelerator: Accelerator) { + source: AcceleratorSource, action: number, + newAccelInfo: AcceleratorInfo) { // Check to see if there is a pre-existing accelerator to remove first. - this.maybeRemoveOrDisableAccelerator_(newAccelerator); + this.maybeRemoveOrDisableAccelerator_(newAccelInfo.accelerator); // Get the matching accelerator and add the new accelerator to its // container. - const accelInfos = this.getAccelerators(source, action); + const accelInfos = this.getAcceleratorInfos(source, action); // Handle edge case in which the user attempts to add a disabled default // accelerator. - const addedDefault = - this.maybeReenableDefaultAccelerator(accelInfos, newAccelerator); + const addedDefault = this.maybeReenableDefaultAccelerator( + accelInfos, newAccelInfo.accelerator); if (!addedDefault) { // No matching default accelerator, add the new accelerator directly. - const newAccelInfo: AcceleratorInfo = { - accelerator: newAccelerator, - type: AcceleratorType.kUser, - state: AcceleratorState.kEnabled, - locked: false, - }; accelInfos.push(newAccelInfo); } // Update the reverse look up maps. this.reverseAcceleratorLookup_.set( - this.getKeyForLookup(newAccelerator), `${source}-${action}`); + this.getKeyForLookup(newAccelInfo.accelerator), `${source}-${action}`); } removeAccelerator( @@ -245,7 +242,7 @@ assertNotReached(); } - const accelInfos = this.getAccelerators(source, action); + const accelInfos = this.getAcceleratorInfos(source, action); const foundIdx = this.getAcceleratorInfoIndex_(source, action, accelerator); // Remove accelerator from main map. accelInfos.splice(foundIdx, 1); @@ -297,7 +294,7 @@ const uuidSplit = uuid.split('-'); const source: AcceleratorSource = parseInt(uuidSplit[0], 10); const action = parseInt(uuidSplit[1], 10); - const accelInfos = this.getAccelerators(source, action); + const accelInfos = this.getAcceleratorInfos(source, action); const foundIdx = this.getAcceleratorInfoIndex_(source, action, accelerator); const foundAccel = accelInfos[foundIdx]; @@ -326,7 +323,7 @@ private getAcceleratorInfoIndex_( source: AcceleratorSource, action: number, accelerator: Accelerator): number { - const accelInfos = this.getAccelerators(source, action); + const accelInfos = this.getAcceleratorInfos(source, action); for (let i = 0; i < accelInfos.length; ++i) { if (areAcceleratorsEqual(accelerator, accelInfos[i].accelerator)) { return i; @@ -344,7 +341,7 @@ return null; } - const accelInfos = this.getAccelerators(source, action); + const accelInfos = this.getAcceleratorInfos(source, action); return accelInfos[foundIdx]; }
diff --git a/ash/webui/shortcut_customization_ui/resources/js/accelerator_subsection.ts b/ash/webui/shortcut_customization_ui/resources/js/accelerator_subsection.ts index 954a558..6cbc74d2 100644 --- a/ash/webui/shortcut_customization_ui/resources/js/accelerator_subsection.ts +++ b/ash/webui/shortcut_customization_ui/resources/js/accelerator_subsection.ts
@@ -101,7 +101,7 @@ const tempAccelContainer: Accelerator[] = []; layoutInfos!.forEach((value) => { const acceleratorInfos = - this.lookupManager_.getAccelerators(value.source, value.action); + this.lookupManager_.getAcceleratorInfos(value.source, value.action); acceleratorInfos!.filter((accel) => { // Hide accelerators that are default and disabled. return !(
diff --git a/ash/webui/shortcut_customization_ui/resources/js/accelerator_view.ts b/ash/webui/shortcut_customization_ui/resources/js/accelerator_view.ts index 01c51a94..5d6b192 100644 --- a/ash/webui/shortcut_customization_ui/resources/js/accelerator_view.ts +++ b/ash/webui/shortcut_customization_ui/resources/js/accelerator_view.ts
@@ -11,8 +11,8 @@ import {getTemplate} from './accelerator_view.html.js'; import {getShortcutProvider} from './mojo_interface_provider.js'; import {ModifierKeyCodes} from './shortcut_input.js'; -import {Accelerator, AcceleratorConfigResult, AcceleratorInfo, AcceleratorSource, AcceleratorState, AcceleratorType, Modifier, ShortcutProviderInterface} from './shortcut_types.js'; -import {areAcceleratorsEqual} from './shortcut_utils.js'; +import {Accelerator, AcceleratorConfigResult, AcceleratorInfo, AcceleratorSource, Modifier, ShortcutProviderInterface} from './shortcut_types.js'; +import {areAcceleratorsEqual, createEmptyAcceleratorInfo} from './shortcut_utils.js'; export interface AcceleratorViewElement { $: { @@ -51,15 +51,6 @@ } } -function createEmptyAcceleratorInfo(): AcceleratorInfo { - return { - accelerator: {modifiers: 0, key: 0, keyDisplay: ''}, - type: AcceleratorType.kDefault, - state: AcceleratorState.kEnabled, - locked: false, - }; -} - /** * @fileoverview * 'accelerator-view' is wrapper component for an accelerator. It maintains both @@ -241,17 +232,17 @@ this.set( 'pendingAcceleratorInfo_.accelerator', this.keystrokeToAccelerator_(e)); - const pendingAccelerator = this.pendingAcceleratorInfo_.accelerator; // New shortcut matches the current shortcut, end capture. if (areAcceleratorsEqual( - pendingAccelerator, this.acceleratorInfo.accelerator)) { + this.pendingAcceleratorInfo_.accelerator, + this.acceleratorInfo.accelerator)) { this.endCapture_(); return; } // Only process valid accelerators. - if (this.isValidDefaultAccelerator_(pendingAccelerator)) { - this.processPendingAccelerator_(pendingAccelerator); + if (this.isValidDefaultAccelerator_(this.pendingAcceleratorInfo_)) { + this.processPendingAccelerator_(this.pendingAcceleratorInfo_); } } @@ -259,7 +250,7 @@ * Checks that |pendingAccelerator_| is not a pre-existing shortcut. Sets the * error message if there is a conflict. */ - private processPendingAccelerator_(pendingAccelerator: Accelerator) { + private processPendingAccelerator_(pendingAccelInfo: AcceleratorInfo) { // Reset status state when processing the new accelerator. this.statusMessage = ''; this.hasError = false; @@ -268,17 +259,18 @@ // replace a pre-existing accelerator. Check that the new accelerator // matches the |acceleratorOnHold_|, otherwise reset its value. if (this.acceleratorOnHold_ !== '') { - if (this.acceleratorOnHold_ === JSON.stringify(pendingAccelerator)) { + if (this.acceleratorOnHold_ === + JSON.stringify(pendingAccelInfo.accelerator)) { // User re-pressed the shortcut, send a request to replace the // accelerator. - this.requestUpdateAccelerator_(pendingAccelerator); + this.requestUpdateAccelerator_(pendingAccelInfo); return; } this.acceleratorOnHold_ = ''; } const foundId = this.lookupManager_.getAcceleratorIdFromReverseLookup( - pendingAccelerator); + pendingAccelInfo.accelerator); // Pre-existing shortcut, update the error message. if (foundId !== undefined) { @@ -292,7 +284,7 @@ // Cannot override a locked action. if (!this.shortcutProvider_.isMutable(conflictSource) || this.lookupManager_.isAcceleratorLocked( - conflictSource, conflictAction, pendingAccelerator)) { + conflictSource, conflictAction, pendingAccelInfo.accelerator)) { // TODO(jimmyxgong): i18n this string. this.statusMessage = 'Shortcut is used by \"' + conflictAccelName + '\". Press a new shortcut to replace.'; @@ -313,7 +305,7 @@ } // No conflicts, request replacement. - this.requestUpdateAccelerator_(pendingAccelerator); + this.requestUpdateAccelerator_(pendingAccelInfo); } /** @@ -417,27 +409,28 @@ return e.ctrlKey || e.altKey || e.metaKey; } - private isValidDefaultAccelerator_(accelerator: Accelerator): boolean { + private isValidDefaultAccelerator_(accelInfo: AcceleratorInfo): boolean { // A valid default accelerator is on that has modifier(s) and a key. - return accelerator.modifiers > 0 && accelerator.keyDisplay !== ''; + return accelInfo.accelerator.modifiers > 0 && + accelInfo.accelerator.keyDisplay !== ''; } private showEditView_(): boolean { return this.viewState !== ViewState.VIEW; } - private requestUpdateAccelerator_(newAccelerator: Accelerator) { + private requestUpdateAccelerator_(newAcceleratorInfo: AcceleratorInfo) { if (this.viewState === ViewState.EDIT) { this.shortcutProvider_ .replaceAccelerator( this.source, this.action, this.acceleratorInfo.accelerator, - newAccelerator) + newAcceleratorInfo.accelerator) .then((result: AcceleratorConfigResult) => { // TODO(jimmyxgong): Handle other error cases. if (result === AcceleratorConfigResult.SUCCESS) { this.lookupManager_.replaceAccelerator( this.source, this.action, this.acceleratorInfo.accelerator, - newAccelerator); + newAcceleratorInfo); this.fireUpdateEvent_(); } }); @@ -445,12 +438,13 @@ if (this.viewState === ViewState.ADD) { this.shortcutProvider_ - .addUserAccelerator(this.source, this.action, newAccelerator) + .addUserAccelerator( + this.source, this.action, newAcceleratorInfo.accelerator) .then((result: AcceleratorConfigResult) => { // TODO(jimmyxgong): Handle other error cases. if (result === AcceleratorConfigResult.SUCCESS) { this.lookupManager_.addAccelerator( - this.source, this.action, newAccelerator); + this.source, this.action, newAcceleratorInfo); this.fireUpdateEvent_(); } });
diff --git a/ash/webui/shortcut_customization_ui/resources/js/shortcut_customization_app.ts b/ash/webui/shortcut_customization_ui/resources/js/shortcut_customization_app.ts index 134492ea..3c844cc 100644 --- a/ash/webui/shortcut_customization_ui/resources/js/shortcut_customization_app.ts +++ b/ash/webui/shortcut_customization_ui/resources/js/shortcut_customization_app.ts
@@ -171,7 +171,7 @@ this.$.navigationPanel.notifyEvent('updateSubsections'); const updatedAccels = this.acceleratorLookupManager_ - .getAccelerators(e.detail.source, e.detail.action) + .getAcceleratorInfos(e.detail.source, e.detail.action) ?.filter((accel) => { // Hide accelerators that are default and disabled. return !(
diff --git a/ash/webui/shortcut_customization_ui/resources/js/shortcut_utils.ts b/ash/webui/shortcut_customization_ui/resources/js/shortcut_utils.ts index fb2a2d8a..2d0444b 100644 --- a/ash/webui/shortcut_customization_ui/resources/js/shortcut_utils.ts +++ b/ash/webui/shortcut_customization_ui/resources/js/shortcut_utils.ts
@@ -6,7 +6,7 @@ import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; -import {Accelerator} from './shortcut_types.js'; +import {Accelerator, AcceleratorInfo, AcceleratorState, AcceleratorType} from './shortcut_types.js'; // Returns true if shortcut customization is disabled via the feature flag. export const isCustomizationDisabled = (): boolean => { @@ -16,4 +16,18 @@ export const areAcceleratorsEqual = (accelA: Accelerator, accelB: Accelerator): boolean => { return JSON.stringify(accelA) === JSON.stringify(accelB); - }; \ No newline at end of file + }; + +export const createEmptyAccelInfoFromAccel = + (accel: Accelerator): AcceleratorInfo => { + return { + accelerator: accel, + type: AcceleratorType.kUser, + state: AcceleratorState.kEnabled, + locked: false, + }; + }; + +export const createEmptyAcceleratorInfo = (): AcceleratorInfo => { + return createEmptyAccelInfoFromAccel({modifiers: 0, key: 0, keyDisplay: ''}); +};
diff --git a/ash/wm/float/float_controller.cc b/ash/wm/float/float_controller.cc index 1545f4b..19e52a43 100644 --- a/ash/wm/float/float_controller.cc +++ b/ash/wm/float/float_controller.cc
@@ -370,8 +370,28 @@ magnetism_corner = MagnetismCorner::kBottomRight; } + MagnetismCorner original_corner = floated_window_info->magnetism_corner(); floated_window_info->set_magnetism_corner(magnetism_corner); - floated_window_info->MaybeTuckWindow(left); + // If the window was flung to the closest edge from `original_corner` then + // tuck the window, otherwise magnetize it. + switch (original_corner) { + case MagnetismCorner::kTopLeft: + case MagnetismCorner::kBottomLeft: + if (left) { + floated_window_info->MaybeTuckWindow(true); + return; + } + break; + case MagnetismCorner::kTopRight: + case MagnetismCorner::kBottomRight: + if (!left) { + floated_window_info->MaybeTuckWindow(false); + return; + } + break; + } + UpdateWindowBoundsForTablet(floated_window, + WindowState::BoundsChangeAnimationType::kAnimate); } const Desk* FloatController::FindDeskOfFloatedWindow(
diff --git a/ash/wm/float/float_controller_unittest.cc b/ash/wm/float/float_controller_unittest.cc index d79f896..d3716e1 100644 --- a/ash/wm/float/float_controller_unittest.cc +++ b/ash/wm/float/float_controller_unittest.cc
@@ -1177,6 +1177,36 @@ CheckMagnetized(window.get(), FloatController::MagnetismCorner::kBottomRight); } +// Tests that the window gets tucked to the closer edge and corner based on the +// fling velocity. +TEST_F(TabletWindowFloatTest, TuckToMagnetismCorner) { + UpdateDisplay("1600x1000"); + + Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true); + + // Create a floated window in the bottom right. + std::unique_ptr<aura::Window> window = CreateFloatedWindow(); + CheckMagnetized(window.get(), FloatController::MagnetismCorner::kBottomRight); + + auto* float_controller = Shell::Get()->float_controller(); + + // Fling the window left and up. Test that it does not tuck but magnetizes to + // the top left. + FlingWindow(window.get(), /*left=*/true, /*up=*/true); + ASSERT_FALSE(float_controller->IsFloatedWindowTuckedForTablet(window.get())); + CheckMagnetized(window.get(), FloatController::MagnetismCorner::kTopLeft); + + // Fling the window left and down. Now the window should tuck in the bottom + // left. + FlingWindow(window.get(), /*left=*/true, /*up=*/false); + ASSERT_TRUE(float_controller->IsFloatedWindowTuckedForTablet(window.get())); + const gfx::Rect work_area = WorkAreaInsets::ForWindow(window->GetRootWindow()) + ->user_work_area_bounds(); + const int padding = chromeos::wm::kFloatedWindowPaddingDp; + EXPECT_EQ(gfx::Point(0, work_area.bottom() - padding), + window->bounds().bottom_right()); +} + TEST_F(TabletWindowFloatTest, UntuckExtendedHitBounds) { Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true);
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h index 16253b22..0d3af334c 100644 --- a/base/threading/thread_restrictions.h +++ b/base/threading/thread_restrictions.h
@@ -242,6 +242,7 @@ class AudioOutputDevice; class BlockingUrlProtocol; class FileVideoCaptureDeviceFactory; +class MojoVideoEncodeAccelerator; class PaintCanvasVideoRenderer; } // namespace media namespace memory_instrumentation { @@ -599,6 +600,7 @@ friend class location::nearby::chrome::SubmittableExecutor; friend class media::AudioOutputDevice; friend class media::BlockingUrlProtocol; + friend class media::MojoVideoEncodeAccelerator; friend class mojo::core::ScopedIPCSupport; friend class net::MultiThreadedCertVerifierScopedAllowBaseSyncPrimitives; friend class rlz_lib::FinancialPing;
diff --git a/chrome/VERSION b/chrome/VERSION index bb24224..f9c2e14 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=109 MINOR=0 -BUILD=5394 +BUILD=5395 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 0d3a4af1..1b993ad 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -1486,9 +1486,9 @@ "//ui/android:ui_full_java", "//ui/android:ui_java_test_support", "//url:gurl_java", - "//url:gurl_java_unit_tests", "//url:gurl_junit_test_support", "//url:origin_java", + "//url:url_java_unit_tests", ] sources += share_unit_device_javatest_java_sources @@ -2465,8 +2465,9 @@ "//third_party/android_deps:protobuf_lite_runtime_java", "//third_party/androidx:androidx_annotation_annotation_java", "//third_party/junit", - "//url:gurl_android_test_helper_java", + "//url:android_test_helper_java", "//url:gurl_java", + "//url:origin_java", ] annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] @@ -2494,8 +2495,8 @@ "//components/sync:test_support", "//content/test:test_support", "//net:test_support", + "//url:android_test_helper", "//url:gurl_android", - "//url:gurl_android_test_helper", ] }
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java index 8cbcd0f..f7f96fa 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java
@@ -112,6 +112,7 @@ private boolean mIsActive; private int mHeaderCount; private int mSectionHeaderIndex; + private int mToolbarHeight; // Used when Feed is enabled. private @Nullable Profile mProfile; @@ -296,6 +297,7 @@ mEmbeddingSurfaceCreatedTimeNs = embeddingSurfaceCreatedTimeNs; mWebFeedHasContent = false; mSectionHeaderIndex = 0; + mToolbarHeight = toolbarHeight; Resources resources = mActivity.getResources(); @@ -344,6 +346,7 @@ (StickySectionHeaderView) LayoutInflater.from(mActivity).inflate( R.layout.new_tab_page_multi_sticky_feed_header, null, false); mRootView.addView(mStickySectionHeaderView); + mStickySectionHeaderModelChangeProcessor = PropertyModelChangeProcessor.create( mSectionHeaderModel, mStickySectionHeaderView, binder); mStickySectionHeaderListModelChangeProcessor = new ListModelChangeProcessor<>( @@ -370,6 +373,20 @@ mMediator.updateContent(); } + /** + * TODO(b/241271058): update toolbar height by calling delegate instead of passing it as a + * parameter. + */ + public int getToolbarHeight() { + return mToolbarHeight; + } + + /** @return the position of the in-feed header. */ + public int getFeedHeaderPosition() { + return mScrollableContainerDelegate.getTopPositionRelativeToContainerView( + mSectionHeaderView); + } + @Override public void hasContentChanged(@StreamKind int kind, boolean hasContent) { if (kind == StreamKind.FOLLOWING) {
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceMediator.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceMediator.java index bfa6d50..f9a4712 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceMediator.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceMediator.java
@@ -489,6 +489,16 @@ @Override public void onScrolled(RecyclerView v, int dx, int dy) { + int headerPosition = mCoordinator.getFeedHeaderPosition(); + int toolbarHeight = mCoordinator.getToolbarHeight(); + + // When the distance from the header to the top is bigger than the toolbar height, + // it hasn't yet reached the position where it should be fixed/sticky, + // so the sticky header is kept hidden. Show it otherwise. + boolean isHeaderOutOfView = headerPosition < toolbarHeight; + mSectionHeaderModel.set(SectionHeaderListProperties.STICKY_HEADER_VISIBLILITY_KEY, + isHeaderOutOfView); + if (mSnapScrollHelper != null) { mSnapScrollHelper.handleScroll(); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImplTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImplTest.java index c302166..ec83f0d 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImplTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImplTest.java
@@ -32,6 +32,7 @@ import org.chromium.components.external_intents.ExternalNavigationDelegate.IntentToAutofillAllowingAppResult; import org.chromium.components.external_intents.ExternalNavigationHandler; import org.chromium.components.external_intents.ExternalNavigationParams; +import org.chromium.content_public.browser.test.NativeLibraryTestUtils; import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.ui.base.WindowAndroid; import org.chromium.url.GURL; @@ -115,8 +116,6 @@ } } - private static class MockOrigin extends Origin {}; - public void maybeSetAndGetRequestMetadata(ExternalNavigationDelegateImpl delegate, Intent intent, boolean hasUserGesture, boolean isRendererInitiated, Origin initiatorOrigin) { @@ -140,6 +139,7 @@ @Before public void setUp() throws InterruptedException { MockitoAnnotations.initMocks(this); + NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess(); doReturn(mMockWindowAndroid).when(mMockTab).getWindowAndroid(); mExternalNavigationDelegateImpl = TestThreadUtils.runOnUiThreadBlockingNoException( () -> new ExternalNavigationDelegateImpl(mMockTab)); @@ -177,7 +177,7 @@ maybeSetAndGetRequestMetadata(mExternalNavigationDelegateImpl, intent, true, false, null); maybeSetAndGetRequestMetadata(mExternalNavigationDelegateImpl, intent, false, true, null); maybeSetAndGetRequestMetadata( - mExternalNavigationDelegateImpl, intent, false, false, new MockOrigin()); + mExternalNavigationDelegateImpl, intent, false, false, Origin.createOpaqueOrigin()); } @Test
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/Fido2CredentialRequestTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/Fido2CredentialRequestTest.java index e0c195c..957250f20 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/Fido2CredentialRequestTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/Fido2CredentialRequestTest.java
@@ -315,45 +315,6 @@ long nativeInternalAuthenticator, byte[][] matchingCredentials) {} } - private static class MockOrigin extends Origin { - private final String mScheme; - private final String mHost; - private final int mPort; - - public MockOrigin(GURL url) { - mScheme = url.getScheme(); - mHost = url.getHost(); - String portStr = url.getPort(); - mPort = portStr.isEmpty() ? 443 : Integer.parseInt(portStr); - } - - public MockOrigin(String scheme, String host, int port) { - mScheme = scheme; - mHost = host; - mPort = port; - } - - @Override - public String getScheme() { - return mScheme; - } - - @Override - public String getHost() { - return mHost; - } - - @Override - public int getPort() { - return mPort; - } - - @Override - public boolean isOpaque() { - return false; - } - } - private static class MockBrowserBridge extends WebAuthnBrowserBridge { private byte[] mSelectedCredentialId; private List<WebAuthnCredentialDetails> mExpectedCredentialList; @@ -434,7 +395,7 @@ @Override public Origin getLastCommittedOrigin() { - return new MockOrigin(mLastUrl); + return Origin.create(mLastUrl); } public void setLastCommittedURL(GURL url) { @@ -460,7 +421,7 @@ String url = mTestServer.getURLWithHostName( "subdomain.example.test", "/content/test/data/android/authenticator.html"); GURL gurl = new GURL(url); - mOrigin = new MockOrigin(gurl); + mOrigin = Origin.create(gurl); sActivityTestRule.loadUrl(url); mFrameHost = new MockAuthenticatorRenderFrameHost(); mFrameHost.setLastCommittedURL(gurl); @@ -503,7 +464,7 @@ @Test @SmallTest public void testConvertOriginToString_defaultPortRemoved() { - MockOrigin origin = new MockOrigin("https", "www.example.com", 443); + Origin origin = Origin.create(new GURL("https://www.example.com:443")); String parsedOrigin = mRequest.convertOriginToString(origin); Assert.assertEquals(parsedOrigin, "https://www.example.com/"); }
diff --git a/chrome/android/profiles/newest.txt b/chrome/android/profiles/newest.txt index 44b1d60..7a535ce 100644 --- a/chrome/android/profiles/newest.txt +++ b/chrome/android/profiles/newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-109.0.5391.0_rc-r1-merged.afdo.bz2 +chromeos-chrome-amd64-109.0.5391.0_rc-r2-merged.afdo.bz2
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 74fba0b..00a2779 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -34,6 +34,7 @@ import("//printing/buildflags/buildflags.gni") import("//rlz/buildflags/buildflags.gni") import("//sandbox/features.gni") +import("//testing/libfuzzer/fuzzer_test.gni") import("//third_party/blink/public/public_features.gni") import("//third_party/protobuf/proto_library.gni") import("//third_party/webrtc/webrtc.gni") @@ -2256,6 +2257,7 @@ "//components/reporting/encryption:verification", "//components/reporting/proto:record_constants", "//components/reporting/proto:record_proto", + "//components/reporting/proto:status_proto", "//components/reporting/resources:resource_interface", "//components/reporting/storage:storage_configuration", "//components/reporting/storage:storage_module", @@ -2265,7 +2267,6 @@ "//components/reporting/util:backoff_settings", "//components/reporting/util:status", "//components/reporting/util:status_macros", - "//components/reporting/util:status_proto", "//components/reporting/util:task_runner_context", "//components/reputation/core", "//components/reputation/core:proto", @@ -5172,9 +5173,6 @@ "//ash/constants", "//ash/public/cpp", "//ash/public/cpp/external_arc", - "//ash/services/device_sync/public/cpp:prefs", - "//ash/services/device_sync/public/cpp:prefs", - "//ash/services/device_sync/public/mojom", "//ash/webui/camera_app_ui", "//ash/webui/camera_app_ui:mojo_bindings", "//ash/webui/color_internals", @@ -5304,6 +5302,9 @@ "//chromeos/ash/services/cellular_setup", "//chromeos/ash/services/cros_healthd/public/cpp", "//chromeos/ash/services/cros_healthd/public/mojom", + "//chromeos/ash/services/device_sync/public/cpp:prefs", + "//chromeos/ash/services/device_sync/public/cpp:prefs", + "//chromeos/ash/services/device_sync/public/mojom", "//chromeos/ash/services/hotspot_config/public/mojom", "//chromeos/ash/services/multidevice_setup", "//chromeos/ash/services/multidevice_setup/public/cpp", @@ -8266,11 +8267,11 @@ "//components/reporting/client:test_support", "//components/reporting/proto:record_constants", "//components/reporting/proto:record_proto", + "//components/reporting/proto:status_proto", "//components/reporting/storage:storage_module", "//components/reporting/storage_selector", "//components/reporting/util:status", "//components/reporting/util:status_macros", - "//components/reporting/util:status_proto", "//components/reporting/util:task_runner_context", "//components/reputation/core", "//components/reputation/core:proto", @@ -8592,3 +8593,14 @@ sources = [ "chromeos/policy/dlp/dlp_policy_event.proto" ] } } + +if (is_chromeos_ash) { + fuzzer_test("nearby_sharing_instantmessaging_stream_parser_fuzzer") { + sources = [ "nearby_sharing/instantmessaging/stream_parser_fuzzer.cc" ] + deps = [ + ":browser", + "//base", + "//third_party/protobuf:protobuf_lite", + ] + } +}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 7ac3979..9cce2449 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -6147,6 +6147,11 @@ kNtpChromeCartModuleVariations, "DesktopNtpModules")}, + {"chrome-cart-dom-based-heuristics", + commerce::flag_descriptions::kChromeCartDomBasedHeuristicsName, + commerce::flag_descriptions::kChromeCartDomBasedHeuristicsDescription, + kOsDesktop, FEATURE_VALUE_TYPE(commerce::kChromeCartDomBasedHeuristics)}, + {"ntp-comprehensive-theme-realbox", flag_descriptions::kNtpComprehensiveThemeRealboxName, flag_descriptions::kNtpComprehensiveThemeRealboxDescription, kOsDesktop,
diff --git a/chrome/browser/apps/app_service/app_service_proxy_ash.cc b/chrome/browser/apps/app_service/app_service_proxy_ash.cc index 601b7f1..6303a7b 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_ash.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_ash.cc
@@ -327,28 +327,6 @@ } } -void AppServiceProxyAsh::LaunchAppWithIntent( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - apps::mojom::Publisher::LaunchAppWithIntentCallback callback) { - apps::IntentPtr intent_copy = apps::ConvertMojomIntentToIntent(intent); - base::OnceCallback launch_callback = base::BindOnce( - &AppServiceProxyAsh::LaunchAppWithMojoIntentIfAllowed, - weak_ptr_factory_.GetWeakPtr(), app_id, event_flags, std::move(intent), - std::move(launch_source), std::move(window_info), std::move(callback)); - - policy::DlpFilesController* files_controller = GetDlpFilesController(); - if (files_controller) { - files_controller->CheckIfLaunchAllowed(app_id, std::move(intent_copy), - std::move(launch_callback)); - } else { - std::move(launch_callback).Run(/*is_allowed=*/true); - } -} - base::WeakPtr<AppServiceProxyAsh> AppServiceProxyAsh::GetWeakPtr() { return weak_ptr_factory_.GetWeakPtr(); } @@ -720,21 +698,4 @@ std::move(window_info), std::move(callback)); } -void AppServiceProxyAsh::LaunchAppWithMojoIntentIfAllowed( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - apps::mojom::Publisher::LaunchAppWithIntentCallback callback, - bool is_allowed) { - if (!is_allowed) { - std::move(callback).Run(/*success=*/false); - return; - } - AppServiceProxyBase::LaunchAppWithIntent( - app_id, event_flags, std::move(intent), std::move(launch_source), - std::move(window_info), std::move(callback)); -} - } // namespace apps
diff --git a/chrome/browser/apps/app_service/app_service_proxy_ash.h b/chrome/browser/apps/app_service/app_service_proxy_ash.h index 089719d..8317dd7 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_ash.h +++ b/chrome/browser/apps/app_service/app_service_proxy_ash.h
@@ -123,13 +123,6 @@ LaunchSource launch_source, WindowInfoPtr window_info, LaunchCallback callback) override; - void LaunchAppWithIntent( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - apps::mojom::Publisher::LaunchAppWithIntentCallback callback) override; base::WeakPtr<AppServiceProxyAsh> GetWeakPtr(); @@ -248,16 +241,6 @@ WindowInfoPtr window_info, LaunchCallback callback, bool is_allowed); - // TODO(crbug.com/1253250): Will be removed soon. Please use the non mojom - // interface. - void LaunchAppWithMojoIntentIfAllowed( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - apps::mojom::Publisher::LaunchAppWithIntentCallback callback, - bool is_allowed); SubscriberCrosapi* crosapi_subscriber_ = nullptr;
diff --git a/chrome/browser/apps/app_service/app_service_proxy_base.cc b/chrome/browser/apps/app_service/app_service_proxy_base.cc index 99dde005..1c72848 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_base.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_base.cc
@@ -357,41 +357,6 @@ }); } -void AppServiceProxyBase::LaunchAppWithFiles( - const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource mojom_launch_source, - apps::mojom::FilePathsPtr file_paths) { - if (app_service_.is_connected()) { - app_registry_cache_.ForOneApp( - app_id, [this, event_flags, mojom_launch_source, - &file_paths](const apps::AppUpdate& update) { - if (MaybeShowLaunchPreventionDialog(update)) { - return; - } - - apps::LaunchSource launch_source = - ConvertMojomLaunchSourceToLaunchSource(mojom_launch_source); - RecordAppPlatformMetrics(profile_, update, launch_source, - apps::LaunchContainer::kLaunchContainerNone); - - // TODO(crbug/1117655): File manager records metrics for apps it - // launched. So we only record launches from other places. We should - // eventually move those metrics here, after AppService supports all - // app types launched by file manager. - if (launch_source != apps::LaunchSource::kFromFileManager) { - RecordAppLaunch(update.AppId(), launch_source); - } - - app_service_->LaunchAppWithFiles( - ConvertAppTypeToMojomAppType(update.AppType()), update.AppId(), - event_flags, mojom_launch_source, std::move(file_paths)); - - PerformPostLaunchTasks(launch_source); - }); - } -} - void AppServiceProxyBase::LaunchAppWithIntent(const std::string& app_id, int32_t event_flags, IntentPtr intent, @@ -432,49 +397,6 @@ }); } -void AppServiceProxyBase::LaunchAppWithIntent( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource mojom_launch_source, - apps::mojom::WindowInfoPtr window_info, - apps::mojom::Publisher::LaunchAppWithIntentCallback callback) { - CHECK(intent); - if (app_service_.is_connected()) { - app_registry_cache_.ForOneApp( - app_id, [this, event_flags, &intent, mojom_launch_source, &window_info, - callback = std::move(callback)]( - const apps::AppUpdate& update) mutable { - if (MaybeShowLaunchPreventionDialog(update)) { - if (callback) - std::move(callback).Run(/*success=*/false); - return; - } - - apps::LaunchSource launch_source = - ConvertMojomLaunchSourceToLaunchSource(mojom_launch_source); - // TODO(crbug/1117655): File manager records metrics for apps it - // launched. So we only record launches from other places. We should - // eventually move those metrics here, after AppService supports all - // app types launched by file manager. - if (launch_source != apps::LaunchSource::kFromFileManager) { - RecordAppLaunch(update.AppId(), launch_source); - } - RecordAppPlatformMetrics(profile_, update, launch_source, - apps::LaunchContainer::kLaunchContainerNone); - - app_service_->LaunchAppWithIntent( - ConvertAppTypeToMojomAppType(update.AppType()), update.AppId(), - event_flags, std::move(intent), mojom_launch_source, - std::move(window_info), std::move(callback)); - - PerformPostLaunchTasks(launch_source); - }); - } else if (callback) { - std::move(callback).Run(/*success=*/false); - } -} - void AppServiceProxyBase::LaunchAppWithUrl(const std::string& app_id, int32_t event_flags, GURL url, @@ -486,27 +408,6 @@ launch_source, std::move(window_info), base::DoNothing()); } -void AppServiceProxyBase::LaunchAppWithUrlForBind(const std::string& app_id, - int32_t event_flags, - GURL url, - LaunchSource launch_source, - WindowInfoPtr window_info) { - LaunchAppWithIntent( - app_id, event_flags, - std::make_unique<apps::Intent>(apps_util::kIntentActionView, url), - launch_source, std::move(window_info), base::DoNothing()); -} - -void AppServiceProxyBase::LaunchAppWithUrl( - const std::string& app_id, - int32_t event_flags, - GURL url, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info) { - LaunchAppWithIntent(app_id, event_flags, apps_util::CreateIntentFromUrl(url), - launch_source, std::move(window_info), {}); -} - void AppServiceProxyBase::LaunchAppWithParams(AppLaunchParams&& params, LaunchCallback callback) { auto app_type = app_registry_cache_.GetAppType(params.app_id);
diff --git a/chrome/browser/apps/app_service/app_service_proxy_base.h b/chrome/browser/apps/app_service/app_service_proxy_base.h index ceb05cc0..016166da 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_base.h +++ b/chrome/browser/apps/app_service/app_service_proxy_base.h
@@ -158,12 +158,6 @@ int32_t event_flags, LaunchSource launch_source, std::vector<base::FilePath> file_paths); - // TODO(crbug.com/1253250): Will be removed soon. Please use the non mojom - // interface. - void LaunchAppWithFiles(const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths); // Launches an app for the given |app_id|, passing |intent| to the app. // |event_flags| provides additional context about the action which launch the @@ -176,15 +170,6 @@ LaunchSource launch_source, WindowInfoPtr window_info, LaunchCallback callback); - // TODO(crbug.com/1253250): Will be removed soon. Please use the non mojom - // interface. - virtual void LaunchAppWithIntent( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - apps::mojom::Publisher::LaunchAppWithIntentCallback callback); // Launches an app for the given |app_id|, passing |url| to the app. // |event_flags| provides additional context about the action which launch the @@ -196,20 +181,6 @@ GURL url, LaunchSource launch_source, WindowInfoPtr window_info = nullptr); - // TODO(crbug.com/1253250): Will be replaced with LaunchAppWithUrl once the - // mojom LaunchAppWithUrl interface is removed. - void LaunchAppWithUrlForBind(const std::string& app_id, - int32_t event_flags, - GURL url, - LaunchSource launch_source, - WindowInfoPtr window_info = nullptr); - // TODO(crbug.com/1253250): Will be removed soon. Please use the non mojom - // interface. - void LaunchAppWithUrl(const std::string& app_id, - int32_t event_flags, - GURL url, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info = nullptr); // Launches an app for the given |params.app_id|. The |params| can also // contain other param such as launch container, window diposition, etc.
diff --git a/chrome/browser/apps/app_service/app_service_proxy_lacros.cc b/chrome/browser/apps/app_service/app_service_proxy_lacros.cc index d752e59..889c91a 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_lacros.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_lacros.cc
@@ -175,16 +175,6 @@ ProxyLaunch(std::move(params)); } -void AppServiceProxyLacros::LaunchAppWithFiles( - const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) { - LaunchAppWithFiles(app_id, event_flags, - ConvertMojomLaunchSourceToLaunchSource(launch_source), - ConvertMojomFilePathsToFilePaths(std::move(file_paths))); -} - void AppServiceProxyLacros::LaunchAppWithIntent( const std::string& app_id, int32_t event_flags, @@ -218,41 +208,6 @@ std::move(callback).Run(true); } -void AppServiceProxyLacros::LaunchAppWithIntent( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - apps::mojom::Publisher::LaunchAppWithIntentCallback callback) { - CHECK(intent); - - if (!remote_crosapi_app_service_proxy_) { - std::move(callback).Run(/*success=*/false); - return; - } - - if (crosapi_app_service_proxy_version_ < - int{crosapi::mojom::AppServiceProxy::MethodMinVersions:: - kLaunchMinVersion}) { - LOG(WARNING) << "Ash AppServiceProxy version " - << crosapi_app_service_proxy_version_ - << " does not support Launch()."; - std::move(callback).Run(/*success=*/false); - return; - } - - auto params = CreateCrosapiLaunchParamsWithEventFlags( - this, app_id, event_flags, - ConvertMojomLaunchSourceToLaunchSource(launch_source), - window_info ? window_info->display_id : display::kInvalidDisplayId); - params->intent = - apps_util::ConvertAppServiceToCrosapiIntent(intent, profile_); - - ProxyLaunch(std::move(params)); - std::move(callback).Run(/*success=*/true); -} - void AppServiceProxyLacros::LaunchAppWithUrl(const std::string& app_id, int32_t event_flags, GURL url, @@ -264,27 +219,6 @@ launch_source, std::move(window_info), base::DoNothing()); } -void AppServiceProxyLacros::LaunchAppWithUrlForBind(const std::string& app_id, - int32_t event_flags, - GURL url, - LaunchSource launch_source, - WindowInfoPtr window_info) { - LaunchAppWithIntent( - app_id, event_flags, - std::make_unique<apps::Intent>(apps_util::kIntentActionView, url), - launch_source, std::move(window_info), base::DoNothing()); -} - -void AppServiceProxyLacros::LaunchAppWithUrl( - const std::string& app_id, - int32_t event_flags, - GURL url, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info) { - LaunchAppWithIntent(app_id, event_flags, apps_util::CreateIntentFromUrl(url), - launch_source, std::move(window_info), {}); -} - void AppServiceProxyLacros::LaunchAppWithParams(AppLaunchParams&& params, LaunchCallback callback) { if (!remote_crosapi_app_service_proxy_) {
diff --git a/chrome/browser/apps/app_service/app_service_proxy_lacros.h b/chrome/browser/apps/app_service/app_service_proxy_lacros.h index 7d67d38..4dc06edd 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_lacros.h +++ b/chrome/browser/apps/app_service/app_service_proxy_lacros.h
@@ -135,12 +135,6 @@ int32_t event_flags, LaunchSource launch_source, std::vector<base::FilePath> file_paths); - // TODO(crbug.com/1253250): Will be removed soon. Please use the non mojom - // interface. - void LaunchAppWithFiles(const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths); // Launches an app for the given |app_id|, passing |intent| to the app. // |event_flags| provides additional context about the action which launch the @@ -153,15 +147,6 @@ LaunchSource launch_source, WindowInfoPtr window_info, base::OnceCallback<void(bool)> callback); - // TODO(crbug.com/1253250): Will be removed soon. Please use the non mojom - // interface. - void LaunchAppWithIntent( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - apps::mojom::Publisher::LaunchAppWithIntentCallback callback); // Launches an app for the given |app_id|, passing |url| to the app. // |event_flags| provides additional context about the action which launch the @@ -173,21 +158,6 @@ GURL url, LaunchSource launch_source, WindowInfoPtr window_info = nullptr); - // TODO(crbug.com/1253250): Will be replaced with LaunchAppWithUrl once the - // mojom LaunchAppWithUrl interface is removed. - void LaunchAppWithUrlForBind(const std::string& app_id, - int32_t event_flags, - GURL url, - LaunchSource launch_source, - WindowInfoPtr window_info = nullptr); - - // TODO(crbug.com/1253250): Will be removed soon. Please use the non mojom - // interface. - void LaunchAppWithUrl(const std::string& app_id, - int32_t event_flags, - GURL url, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info = nullptr); // Launches an app for the given |params.app_id|. The |params| can also // contain other param such as launch container, window diposition, etc.
diff --git a/chrome/browser/apps/app_service/publishers/arc_apps.cc b/chrome/browser/apps/app_service/publishers/arc_apps.cc index 34da1f5..fcf7f4f 100644 --- a/chrome/browser/apps/app_service/publishers/arc_apps.cc +++ b/chrome/browser/apps/app_service/publishers/arc_apps.cc
@@ -588,19 +588,6 @@ return all_files_have_mime_type || intent->mime_type.has_value(); } -// TODO(crbug.com/1253250): Remove. Prefer the non mojom -// IntentHasFilesAndMimeTypes. -bool IntentHasFilesAndMimeTypes(const apps::mojom::IntentPtr& intent) { - if (!intent->files.has_value()) { - return false; - } - bool all_files_have_mime_type = base::ranges::all_of( - *intent->files, [](apps::mojom::IntentFilePtr& file) { - return file->mime_type.has_value(); - }); - return all_files_have_mime_type || intent->mime_type.has_value(); -} - // Returns true if the app with the given |app_id| should open supported links // inside the browser by default. bool AppShouldDefaultHandleLinksInBrowser(const std::string& app_id) { @@ -660,6 +647,12 @@ ash::ArcNotificationsHostInitializer::Get()); } + auto* arc_bridge_service = + arc::ArcPrivacyItemsBridge::GetForBrowserContext(profile_); + if (arc_bridge_service) { + arc_privacy_items_bridge_observation_.Observe(arc_bridge_service); + } + auto* instance_registry = &proxy()->InstanceRegistry(); if (instance_registry) { instance_registry_observation_.Observe(instance_registry); @@ -717,6 +710,7 @@ } arc_intent_helper_observation_.Reset(); + arc_privacy_items_bridge_observation_.Reset(); } void ArcApps::LoadIcon(const std::string& app_id, @@ -966,17 +960,10 @@ auto event_flags = apps::GetEventFlags(params.disposition, /*prefer_container=*/false); if (params.intent) { - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - LaunchAppWithIntent(params.app_id, event_flags, std::move(params.intent), - params.launch_source, - std::make_unique<WindowInfo>(params.display_id), - base::DoNothing()); - } else { - LaunchAppWithIntent( - params.app_id, event_flags, ConvertIntentToMojomIntent(params.intent), - ConvertLaunchSourceToMojomLaunchSource(params.launch_source), - apps::MakeWindowInfo(params.display_id), base::DoNothing()); - } + LaunchAppWithIntent(params.app_id, event_flags, std::move(params.intent), + params.launch_source, + std::make_unique<WindowInfo>(params.display_id), + base::DoNothing()); } else { if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { Launch(params.app_id, event_flags, params.launch_source, @@ -1171,179 +1158,6 @@ app_id, event_flags, session_id, display_id)); } -void ArcApps::LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) { - auto user_interaction_type = GetUserInterationType( - ConvertMojomLaunchSourceToLaunchSource(launch_source)); - if (!user_interaction_type.has_value()) { - std::move(callback).Run(/*success=*/false); - return; - } - - if (app_id == arc::kPlayStoreAppId && - apps_util::IsHumanLaunch( - ConvertMojomLaunchSourceToLaunchSource(launch_source))) { - arc::RecordPlayStoreLaunchWithinAWeek(profile_->GetPrefs(), - /*launched=*/true); - } - - arc::ArcMetricsService::RecordArcUserInteraction( - profile_, user_interaction_type.value()); - - ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_); - if (!prefs) { - std::move(callback).Run(/*success=*/false); - return; - } - const std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = - prefs->GetApp(app_id); - if (!app_info) { - LOG(ERROR) << "Launch App failed, could not find app with id " << app_id; - std::move(callback).Run(/*success=*/false); - return; - } - - if (app_info->ready) { - arc::mojom::ActivityNamePtr activity = arc::mojom::ActivityName::New(); - activity->package_name = app_info->package_name; - if (intent->activity_name.has_value() && - !intent->activity_name.value().empty()) { - activity->activity_name = intent->activity_name.value(); - } - - auto new_window_info = SetSessionId(std::move(window_info)); - int32_t session_id = new_window_info->window_id; - int64_t display_id = new_window_info->display_id; - - // Check if the intent has files, and whether the intent has a mime type or - // all the individual files have mime types. - if (IntentHasFilesAndMimeTypes(intent)) { - std::vector<GURL> file_urls; - for (const auto& file : intent->files.value()) { - file_urls.push_back(file->url); - } - arc::ConvertToContentUrlsAndShare( - profile_, apps::GetFileSystemURL(profile_, file_urls), - base::BindOnce(&OnContentUrlResolved, profile_->GetPath(), app_id, - event_flags, ConvertMojomIntentToIntent(intent), - std::move(activity), - ConvertMojomWindowInfoToWindowInfo(new_window_info), - std::move(callback))); - return; - } - - auto intent_for_full_restore = intent.Clone(); - - std::string intent_str = apps_util::CreateLaunchIntent( - app_info->package_name, ConvertMojomIntentToIntent(intent)); - if (!intent_str.empty()) { - // If |intent| can be converted to a string, call the Launch interface. - if (!arc::LaunchAppWithIntent( - profile_, app_id, intent_str, event_flags, - user_interaction_type.value(), - MakeArcWindowInfo(std::move(new_window_info)))) { - VLOG(2) << "Failed to launch app: " + app_id + "."; - std::move(callback).Run(/*success=*/false); - return; - } - } else { - // If |intent| can't be converted to a string, call the HandleIntent - // interface. - auto arc_intent = - apps_util::ConvertAppServiceToArcIntent(std::move(intent)); - - if (!arc_intent) { - LOG(ERROR) << "Launch App failed, launch intent is not valid"; - std::move(callback).Run(/*success=*/false); - return; - } - - auto* arc_service_manager = arc::ArcServiceManager::Get(); - if (!arc_service_manager) { - std::move(callback).Run(/*success=*/false); - return; - } - - arc::mojom::IntentHelperInstance* instance = ARC_GET_INSTANCE_FOR_METHOD( - arc_service_manager->arc_bridge_service()->intent_helper(), - HandleIntentWithWindowInfo); - if (instance) { - instance->HandleIntentWithWindowInfo( - std::move(arc_intent), std::move(activity), - MakeArcWindowInfo(std::move(new_window_info))); - } else { - instance = ARC_GET_INSTANCE_FOR_METHOD( - arc_service_manager->arc_bridge_service()->intent_helper(), - HandleIntent); - if (!instance) { - std::move(callback).Run(/*success=*/false); - return; - } - - instance->HandleIntent(std::move(arc_intent), std::move(activity)); - } - } - - prefs->SetLastLaunchTime(app_id); - - full_restore::SaveAppLaunchInfo( - profile_->GetPath(), - std::make_unique<app_restore::AppLaunchInfo>( - app_id, event_flags, - apps::ConvertMojomIntentToIntent(intent_for_full_restore), - session_id, display_id)); - std::move(callback).Run(/*success=*/true); - return; - } - - if (arc::IsArcPlayStoreEnabledForProfile(profile_)) { - // Handle the case when default app tries to re-activate OptIn flow. - if (arc::IsArcPlayStoreEnabledPreferenceManagedForProfile(profile_) && - !arc::ArcSessionManager::Get()->enable_requested() && - prefs->IsDefault(app_id)) { - arc::SetArcPlayStoreEnabledForProfile(profile_, true); - // PlayStore item has special handling for shelf controllers. In order - // to avoid unwanted initial animation for PlayStore item do not create - // deferred launch request when PlayStore item enables Google Play - // Store. - if (app_id == arc::kPlayStoreAppId) { - prefs->SetLastLaunchTime(app_id); - std::move(callback).Run(/*success=*/true); - return; - } - } - } else { - if (prefs->IsDefault(app_id)) { - // The setting can fail if the preference is managed. However, the - // caller is responsible to not call this function in such case. DCHECK - // is here to prevent possible mistake. - if (!arc::SetArcPlayStoreEnabledForProfile(profile_, true)) { - std::move(callback).Run(/*success=*/false); - return; - } - DCHECK(arc::IsArcPlayStoreEnabledForProfile(profile_)); - - // PlayStore item has special handling for shelf controllers. In order - // to avoid unwanted initial animation for PlayStore item do not create - // deferred launch request when PlayStore item enables Google Play - // Store. - if (app_id == arc::kPlayStoreAppId) { - prefs->SetLastLaunchTime(app_id); - std::move(callback).Run(/*success=*/false); - return; - } - } else { - // Only reachable when ARC always starts. - DCHECK(arc::ShouldArcAlwaysStart()); - } - } - std::move(callback).Run(/*success=*/true); -} - void ArcApps::SetResizeLocked(const std::string& app_id, apps::mojom::OptionalBool locked) { ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_); @@ -1726,7 +1540,7 @@ } void ArcApps::OnPrivacyItemsChanged( - std::vector<arc::mojom::PrivacyItemPtr> privacy_items) { + const std::vector<arc::mojom::PrivacyItemPtr>& privacy_items) { ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_); if (!prefs) { return;
diff --git a/chrome/browser/apps/app_service/publishers/arc_apps.h b/chrome/browser/apps/app_service/publishers/arc_apps.h index b372a8d3..c74f7f5a 100644 --- a/chrome/browser/apps/app_service/publishers/arc_apps.h +++ b/chrome/browser/apps/app_service/publishers/arc_apps.h
@@ -32,6 +32,7 @@ #include "chrome/browser/apps/app_service/paused_apps.h" #include "chrome/browser/apps/app_service/publishers/app_publisher.h" #include "chrome/browser/ash/arc/app_shortcuts/arc_app_shortcuts_request.h" +#include "chrome/browser/ash/arc/privacy_items/arc_privacy_items_bridge.h" #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" #include "components/arc/intent_helper/arc_intent_helper_bridge.h" #include "components/arc/intent_helper/arc_intent_helper_observer.h" @@ -72,7 +73,7 @@ public ash::ArcNotificationManagerBase::Observer, public ash::ArcNotificationsHostInitializer::Observer, public apps::InstanceRegistry::Observer, - public arc::mojom::PrivacyItemsHost { + public arc::ArcPrivacyItemsBridge::Observer { public: static ArcApps* Get(Profile* profile); @@ -148,12 +149,6 @@ int32_t event_flags, apps::mojom::LaunchSource launch_source, apps::mojom::WindowInfoPtr window_info) override; - void LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) override; void SetResizeLocked(const std::string& app_id, apps::mojom::OptionalBool locked) override; void PauseApp(const std::string& app_id) override; @@ -215,11 +210,9 @@ void OnArcNotificationManagerDestroyed( ash::ArcNotificationManagerBase* notification_manager) override; - // PrivacyItemsHost overrides. + // ArcPrivacyItemsBridgeObserver overrides. void OnPrivacyItemsChanged( - std::vector<arc::mojom::PrivacyItemPtr> privacy_items) override; - void OnMicCameraIndicatorRequirementChanged(bool flag) override {} - void OnLocationIndicatorRequirementChanged(bool flag) override {} + const std::vector<arc::mojom::PrivacyItemPtr>& privacy_items) override; // apps::InstanceRegistry::Observer overrides. void OnInstanceUpdate(const apps::InstanceUpdate& update) override; @@ -297,6 +290,10 @@ AppNotifications app_notifications_; + base::ScopedObservation<arc::ArcPrivacyItemsBridge, + arc::ArcPrivacyItemsBridge::Observer> + arc_privacy_items_bridge_observation_{this}; + base::ScopedObservation<apps::InstanceRegistry, apps::InstanceRegistry::Observer> instance_registry_observation_{this};
diff --git a/chrome/browser/apps/app_service/publishers/crostini_apps.cc b/chrome/browser/apps/app_service/publishers/crostini_apps.cc index 3bfb9bf..a26b61e 100644 --- a/chrome/browser/apps/app_service/publishers/crostini_apps.cc +++ b/chrome/browser/apps/app_service/publishers/crostini_apps.cc
@@ -214,17 +214,10 @@ /*prefer_container=*/false); auto window_info = apps::MakeWindowInfo(params.display_id); if (params.intent) { - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - LaunchAppWithIntent(params.app_id, event_flags, std::move(params.intent), - params.launch_source, - std::make_unique<WindowInfo>(params.display_id), - base::DoNothing()); - } else { - LaunchAppWithIntent( - params.app_id, event_flags, ConvertIntentToMojomIntent(params.intent), - ConvertLaunchSourceToMojomLaunchSource(params.launch_source), - std::move(window_info), base::DoNothing()); - } + LaunchAppWithIntent(params.app_id, event_flags, std::move(params.intent), + params.launch_source, + std::make_unique<WindowInfo>(params.display_id), + base::DoNothing()); } else { if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { Launch(params.app_id, event_flags, params.launch_source, @@ -320,35 +313,6 @@ window_info ? window_info->display_id : display::kInvalidDisplayId); } -void CrostiniApps::LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) { - // Retrieve URLs from the files in the intent. - std::vector<crostini::LaunchArg> args; - if (intent && intent->files.has_value()) { - storage::FileSystemContext* file_system_context = - file_manager::util::GetFileManagerFileSystemContext(profile_); - args.reserve(intent->files.value().size()); - for (auto& file : intent->files.value()) { - args.emplace_back( - file_system_context->CrackURLInFirstPartyContext(file->url)); - } - } - crostini::LaunchCrostiniAppWithIntent( - profile_, app_id, - window_info ? window_info->display_id : display::kInvalidDisplayId, - ConvertMojomIntentToIntent(intent), args, - base::BindOnce( - [](LaunchAppWithIntentCallback callback, bool success, - const std::string& failure_reason) { - std::move(callback).Run(success); - }, - std::move(callback))); -} - void CrostiniApps::GetMenuModel(const std::string& app_id, apps::mojom::MenuType menu_type, int64_t display_id,
diff --git a/chrome/browser/apps/app_service/publishers/crostini_apps.h b/chrome/browser/apps/app_service/publishers/crostini_apps.h index cc3dd55e..c7e106a 100644 --- a/chrome/browser/apps/app_service/publishers/crostini_apps.h +++ b/chrome/browser/apps/app_service/publishers/crostini_apps.h
@@ -92,12 +92,6 @@ int32_t event_flags, apps::mojom::LaunchSource launch_source, apps::mojom::WindowInfoPtr window_info) override; - void LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) override; void GetMenuModel(const std::string& app_id, apps::mojom::MenuType menu_type, int64_t display_id,
diff --git a/chrome/browser/apps/app_service/publishers/extension_apps_base.cc b/chrome/browser/apps/app_service/publishers/extension_apps_base.cc index 812567cb..8ee7938 100644 --- a/chrome/browser/apps/app_service/publishers/extension_apps_base.cc +++ b/chrome/browser/apps/app_service/publishers/extension_apps_base.cc
@@ -313,20 +313,19 @@ IntentPtr intent, LaunchSource launch_source, WindowInfoPtr window_info, - base::OnceCallback<void(bool)> callback) { + LaunchCallback callback) { const auto* extension = MaybeGetExtension(app_id); if (!extension || !extensions::util::IsAppLaunchable(app_id, profile_)) { - std::move(callback).Run(/*success=*/false); + std::move(callback).Run(ConvertBoolToLaunchResult(/*success=*/false)); return nullptr; } if (!extensions::util::IsAppLaunchableWithoutEnabling(app_id, profile_)) { RunExtensionEnableFlow( - app_id, - base::BindOnce(&ExtensionAppsBase::LaunchAppWithIntentWhenEnabled, - weak_factory_.GetWeakPtr(), app_id, event_flags, - std::move(intent), launch_source, std::move(window_info), - CallbackWrapper(std::move(callback)))); + app_id, base::BindOnce(&ExtensionAppsBase::LaunchAppWithIntent, + weak_factory_.GetWeakPtr(), app_id, event_flags, + std::move(intent), launch_source, + std::move(window_info), std::move(callback))); return nullptr; } @@ -336,7 +335,7 @@ extensions::GetLaunchContainer(extensions::ExtensionPrefs::Get(profile_), extension), std::move(intent), profile_); - std::move(callback).Run(/*success=*/true); + std::move(callback).Run(ConvertBoolToLaunchResult(/*success=*/true)); return LaunchImpl(std::move(params)); } @@ -367,18 +366,6 @@ return extension; } -ExtensionAppsBase::CallbackWrapper::CallbackWrapper( - base::OnceCallback<void(bool)> callback) - : callback(std::move(callback)) {} - -ExtensionAppsBase::CallbackWrapper::CallbackWrapper(CallbackWrapper&&) = - default; - -ExtensionAppsBase::CallbackWrapper::~CallbackWrapper() { - if (callback) - std::move(callback).Run(false); -} - void ExtensionAppsBase::Initialize() { RegisterPublisher(app_type()); @@ -526,14 +513,8 @@ LaunchSource launch_source, WindowInfoPtr window_info, LaunchCallback callback) { - LaunchAppWithIntentImpl( - app_id, event_flags, std::move(intent), launch_source, - std::move(window_info), - base::BindOnce( - [](LaunchCallback callback, bool success) { - std::move(callback).Run(ConvertBoolToLaunchResult(success)); - }, - std::move(callback))); + LaunchAppWithIntentImpl(app_id, event_flags, std::move(intent), launch_source, + std::move(window_info), std::move(callback)); } void ExtensionAppsBase::LaunchAppWithParams(AppLaunchParams&& params, @@ -706,38 +687,6 @@ LaunchImpl(std::move(params)); } -void ExtensionAppsBase::LaunchAppWithFiles( - const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) { - const auto* extension = MaybeGetExtension(app_id); - AppLaunchParams params( - app_id, - extensions::GetLaunchContainer(extensions::ExtensionPrefs::Get(profile_), - extension), - ui::DispositionFromEventFlags(event_flags), - ConvertMojomLaunchSourceToLaunchSource(launch_source), - display::kDefaultDisplayId); - for (const auto& file_path : file_paths->file_paths) { - params.launch_files.push_back(file_path); - } - LaunchImpl(std::move(params)); -} - -void ExtensionAppsBase::LaunchAppWithIntent( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) { - LaunchAppWithIntentImpl( - app_id, event_flags, ConvertMojomIntentToIntent(intent), - ConvertMojomLaunchSourceToLaunchSource(launch_source), - ConvertMojomWindowInfoToWindowInfo(window_info), std::move(callback)); -} - void ExtensionAppsBase::OpenNativeSettings(const std::string& app_id) { const auto* extension = MaybeGetExtension(app_id); if (!extension) { @@ -950,23 +899,6 @@ Launch(app_id, event_flags, launch_source, std::move(window_info)); } -void ExtensionAppsBase::LaunchAppWithIntentWhenEnabled( - const std::string& app_id, - int32_t event_flags, - IntentPtr intent, - LaunchSource launch_source, - WindowInfoPtr window_info, - CallbackWrapper wrapper) { - LaunchAppWithIntent( - app_id, event_flags, std::move(intent), std::move(launch_source), - std::move(window_info), - base::BindOnce( - [](LaunchAppWithIntentCallback callback, LaunchResult&& result) { - std::move(callback).Run(ConvertLaunchResultToBool(result)); - }, - std::move(wrapper.callback))); -} - void ExtensionAppsBase::LaunchMojom(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source, @@ -974,16 +906,4 @@ Launch(app_id, event_flags, std::move(launch_source), std::move(window_info)); } -void ExtensionAppsBase::LaunchAppWithIntentMojom( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - CallbackWrapper wrapper) { - LaunchAppWithIntent(app_id, event_flags, std::move(intent), - std::move(launch_source), std::move(window_info), - std::move(wrapper.callback)); -} - } // namespace apps
diff --git a/chrome/browser/apps/app_service/publishers/extension_apps_base.h b/chrome/browser/apps/app_service/publishers/extension_apps_base.h index 8156481..1b621e0 100644 --- a/chrome/browser/apps/app_service/publishers/extension_apps_base.h +++ b/chrome/browser/apps/app_service/publishers/extension_apps_base.h
@@ -92,13 +92,12 @@ // Calculate the icon effects for the extension. IconEffects GetIconEffects(const extensions::Extension* extension); - content::WebContents* LaunchAppWithIntentImpl( - const std::string& app_id, - int32_t event_flags, - IntentPtr intent, - LaunchSource launch_source, - WindowInfoPtr window_info, - base::OnceCallback<void(bool)> callback); + content::WebContents* LaunchAppWithIntentImpl(const std::string& app_id, + int32_t event_flags, + IntentPtr intent, + LaunchSource launch_source, + WindowInfoPtr window_info, + LaunchCallback callback); virtual content::WebContents* LaunchImpl(AppLaunchParams&& params); virtual void LaunchAppWithParamsImpl(AppLaunchParams&& params, @@ -134,19 +133,6 @@ } private: - // Holds onto a success/failure callback and invokes it with `false` if the - // holding object is deleted before the callback is otherwise invoked. - struct CallbackWrapper { - public: - explicit CallbackWrapper(base::OnceCallback<void(bool)> callback); - CallbackWrapper(const CallbackWrapper&) = delete; - CallbackWrapper& operator=(const CallbackWrapper&) = delete; - CallbackWrapper(CallbackWrapper&&); - ~CallbackWrapper(); - - base::OnceCallback<void(bool)> callback; - }; - // Determines whether the given extension should be treated as type app_type_, // and should therefore by handled by this publisher. virtual bool Accepts(const extensions::Extension* extension) = 0; @@ -188,16 +174,6 @@ int32_t event_flags, apps::mojom::LaunchSource launch_source, apps::mojom::WindowInfoPtr window_info) override; - void LaunchAppWithFiles(const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) override; - void LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) override; void OpenNativeSettings(const std::string& app_id) override; // extensions::ExtensionPrefsObserver overrides. @@ -259,18 +235,6 @@ int32_t event_flags, LaunchSource launch_source, WindowInfoPtr window_info); - // TODO(crbug.com/1253250): This function is used as `callback` for - // RunExtensionEnableFlow. The LaunchAppWithIntent interface can't be used as - // `callback` with `base::BindOnce`, because we have both mojom and non mojom - // Launch function. Remove this function after migrating to the non mojom - // Launch interface when we have one non mojom LaunchAppWithIntent interface - // only. - void LaunchAppWithIntentWhenEnabled(const std::string& app_id, - int32_t event_flags, - IntentPtr intent, - LaunchSource launch_source, - WindowInfoPtr window_info, - CallbackWrapper callback); // TODO(crbug.com/1253250): Remove after migrating to the non mojom Launch // interface. @@ -279,15 +243,6 @@ apps::mojom::LaunchSource launch_source, apps::mojom::WindowInfoPtr window_info); - // TODO(crbug.com/1253250): Remove after migrating to the non mojom Launch - // interface. - void LaunchAppWithIntentMojom(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - CallbackWrapper callback); - mojo::RemoteSet<apps::mojom::Subscriber> subscribers_; const raw_ptr<Profile> profile_;
diff --git a/chrome/browser/apps/app_service/publishers/extension_apps_chromeos.cc b/chrome/browser/apps/app_service/publishers/extension_apps_chromeos.cc index c5374ab..41be24e0 100644 --- a/chrome/browser/apps/app_service/publishers/extension_apps_chromeos.cc +++ b/chrome/browser/apps/app_service/publishers/extension_apps_chromeos.cc
@@ -229,12 +229,7 @@ if (extension->is_app() || is_quickoffice) { content::WebContents* web_contents = LaunchAppWithIntentImpl( app_id, event_flags, std::move(intent), launch_source, - std::move(window_info), - base::BindOnce( - [](LaunchCallback callback, bool success) { - std::move(callback).Run(ConvertBoolToLaunchResult(success)); - }, - std::move(callback))); + std::move(window_info), std::move(callback)); if (launch_source == LaunchSource::kFromArc && web_contents) { // Add a flag to remember this web_contents originated in the ARC context. @@ -245,14 +240,8 @@ } else { DCHECK(extension->is_extension()); // TODO(petermarshall): Set Arc flag as above? - LaunchExtension( - app_id, event_flags, std::move(intent), launch_source, - std::move(window_info), - base::BindOnce( - [](LaunchCallback callback, bool success) { - std::move(callback).Run(ConvertBoolToLaunchResult(success)); - }, - std::move(callback))); + LaunchExtension(app_id, event_flags, std::move(intent), launch_source, + std::move(window_info), std::move(callback)); } } @@ -311,48 +300,12 @@ std::move(callback).Run(std::move(menu_items)); } -void ExtensionAppsChromeOs::LaunchAppWithIntent( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) { - const auto* extension = MaybeGetExtension(app_id); - if (!extension) { - std::move(callback).Run(/*success=*/false); - return; - } - bool is_quickoffice = extension_misc::IsQuickOfficeExtension(extension->id()); - if (extension->is_app() || is_quickoffice) { - content::WebContents* web_contents = LaunchAppWithIntentImpl( - app_id, event_flags, ConvertMojomIntentToIntent(intent), - ConvertMojomLaunchSourceToLaunchSource(launch_source), - ConvertMojomWindowInfoToWindowInfo(window_info), std::move(callback)); - - if (launch_source == apps::mojom::LaunchSource::kFromArc && web_contents) { - // Add a flag to remember this web_contents originated in the ARC context. - web_contents->SetUserData( - &arc::ArcWebContentsData::kArcTransitionFlag, - std::make_unique<arc::ArcWebContentsData>(web_contents)); - } - } else { - DCHECK(extension->is_extension()); - // TODO(petermarshall): Set Arc flag as above? - LaunchExtension(app_id, event_flags, ConvertMojomIntentToIntent(intent), - ConvertMojomLaunchSourceToLaunchSource(launch_source), - ConvertMojomWindowInfoToWindowInfo(window_info), - std::move(callback)); - } -} - -void ExtensionAppsChromeOs::LaunchExtension( - const std::string& app_id, - int32_t event_flags, - IntentPtr intent, - LaunchSource launch_source, - WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) { +void ExtensionAppsChromeOs::LaunchExtension(const std::string& app_id, + int32_t event_flags, + IntentPtr intent, + LaunchSource launch_source, + WindowInfoPtr window_info, + LaunchCallback callback) { const auto* extension = MaybeGetExtension(app_id); DCHECK(extension); @@ -373,13 +326,13 @@ file_manager::file_browser_handlers::ExecuteFileBrowserHandler( profile(), extension, action_id, file_urls, base::BindOnce( - [](LaunchAppWithIntentCallback callback, + [](LaunchCallback callback, extensions::api::file_manager_private::TaskResult result, std::string error) { bool success = result != extensions::api::file_manager_private::TASK_RESULT_FAILED; - std::move(callback).Run(success); + std::move(callback).Run(ConvertBoolToLaunchResult(success)); }, std::move(callback))); }
diff --git a/chrome/browser/apps/app_service/publishers/extension_apps_chromeos.h b/chrome/browser/apps/app_service/publishers/extension_apps_chromeos.h index aad938da..ee22497b 100644 --- a/chrome/browser/apps/app_service/publishers/extension_apps_chromeos.h +++ b/chrome/browser/apps/app_service/publishers/extension_apps_chromeos.h
@@ -91,12 +91,6 @@ base::OnceCallback<void(MenuItems)> callback) override; // apps::mojom::Publisher overrides. - void LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) override; void PauseApp(const std::string& app_id) override; void UnpauseApp(const std::string& app_id) override; void GetMenuModel(const std::string& app_id, @@ -193,7 +187,7 @@ IntentPtr intent, LaunchSource launch_source, WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback); + LaunchCallback callback); apps::InstanceRegistry* const instance_registry_; base::ScopedObservation<extensions::AppWindowRegistry,
diff --git a/chrome/browser/apps/app_service/publishers/plugin_vm_apps.cc b/chrome/browser/apps/app_service/publishers/plugin_vm_apps.cc index c4d53eaa..6dcfcad 100644 --- a/chrome/browser/apps/app_service/publishers/plugin_vm_apps.cc +++ b/chrome/browser/apps/app_service/publishers/plugin_vm_apps.cc
@@ -409,17 +409,6 @@ } } -void PluginVmApps::LaunchAppWithIntent( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - PluginVmApps::LaunchAppWithIntentCallback callback) { - NOTIMPLEMENTED(); - std::move(callback).Run(/*success=*/false); -} - void PluginVmApps::GetMenuModel(const std::string& app_id, apps::mojom::MenuType menu_type, int64_t display_id,
diff --git a/chrome/browser/apps/app_service/publishers/plugin_vm_apps.h b/chrome/browser/apps/app_service/publishers/plugin_vm_apps.h index e5a3773..d0a504db 100644 --- a/chrome/browser/apps/app_service/publishers/plugin_vm_apps.h +++ b/chrome/browser/apps/app_service/publishers/plugin_vm_apps.h
@@ -94,12 +94,6 @@ int32_t event_flags, apps::mojom::LaunchSource launch_source, apps::mojom::WindowInfoPtr window_info) override; - void LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) override; void GetMenuModel(const std::string& app_id, apps::mojom::MenuType menu_type, int64_t display_id,
diff --git a/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.cc b/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.cc index 66974bf..fc933f5 100644 --- a/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.cc +++ b/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.cc
@@ -361,70 +361,6 @@ } } -void StandaloneBrowserExtensionApps::LaunchAppWithIntent( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) { - // It is possible that Lacros is briefly unavailable, for example if it shuts - // down for an update. - if (!controller_.is_bound()) { - std::move(callback).Run(/*success=*/false); - return; - } - - auto launch_params = crosapi::mojom::LaunchParams::New(); - launch_params->app_id = app_id; - launch_params->launch_source = - ConvertMojomLaunchSourceToLaunchSource(launch_source); - launch_params->intent = apps_util::ConvertAppServiceToCrosapiIntent( - intent, ProfileManager::GetPrimaryUserProfile()); - controller_->Launch(std::move(launch_params), - /*callback=*/base::DoNothing()); - std::move(callback).Run(/*success=*/true); - - if (ShouldSaveToFullRestore(proxy(), app_id)) { - auto launch_info = std::make_unique<app_restore::AppLaunchInfo>( - app_id, apps::LaunchContainer::kLaunchContainerNone, - WindowOpenDisposition::UNKNOWN, display::kInvalidDisplayId, - std::vector<base::FilePath>{}, - apps::ConvertMojomIntentToIntent(intent)); - full_restore::SaveAppLaunchInfo(proxy()->profile()->GetPath(), - std::move(launch_info)); - } -} - -void StandaloneBrowserExtensionApps::LaunchAppWithFiles( - const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) { - // It is possible that Lacros is briefly unavailable, for example if it shuts - // down for an update. - if (!controller_.is_bound()) - return; - - auto launch_params = crosapi::mojom::LaunchParams::New(); - launch_params->app_id = app_id; - launch_params->launch_source = - ConvertMojomLaunchSourceToLaunchSource(launch_source); - launch_params->intent = - apps_util::CreateCrosapiIntentForViewFiles(file_paths); - controller_->Launch(std::move(launch_params), - /*callback=*/base::DoNothing()); - - if (ShouldSaveToFullRestore(proxy(), app_id)) { - auto launch_info = std::make_unique<app_restore::AppLaunchInfo>( - app_id, apps::LaunchContainer::kLaunchContainerNone, - WindowOpenDisposition::UNKNOWN, display::kInvalidDisplayId, - std::move(file_paths->file_paths), nullptr); - full_restore::SaveAppLaunchInfo(proxy()->profile()->GetPath(), - std::move(launch_info)); - } -} - void StandaloneBrowserExtensionApps::GetMenuModel( const std::string& app_id, apps::mojom::MenuType menu_type,
diff --git a/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.h b/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.h index 066a8d6..add3a189 100644 --- a/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.h +++ b/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.h
@@ -121,16 +121,6 @@ int32_t event_flags, apps::mojom::LaunchSource launch_source, apps::mojom::WindowInfoPtr window_info) override; - void LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) override; - void LaunchAppWithFiles(const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) override; void GetMenuModel(const std::string& app_id, apps::mojom::MenuType menu_type, int64_t display_id,
diff --git a/chrome/browser/apps/app_service/publishers/web_apps_crosapi.cc b/chrome/browser/apps/app_service/publishers/web_apps_crosapi.cc index e91e169..53909ac 100644 --- a/chrome/browser/apps/app_service/publishers/web_apps_crosapi.cc +++ b/chrome/browser/apps/app_service/publishers/web_apps_crosapi.cc
@@ -269,46 +269,6 @@ base::DoNothing()); } -void WebAppsCrosapi::LaunchAppWithIntent( - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) { - if (!LogIfNotConnected(FROM_HERE)) { - std::move(callback).Run(/*success=*/false); - return; - } - - auto params = CreateCrosapiLaunchParamsWithEventFlags( - proxy_, app_id, event_flags, - ConvertMojomLaunchSourceToLaunchSource(launch_source), - window_info ? window_info->display_id : display::kInvalidDisplayId); - - params->intent = - apps_util::ConvertAppServiceToCrosapiIntent(intent, proxy_->profile()); - controller_->Launch(std::move(params), base::DoNothing()); - // TODO(crbug/1261263): handle the case where launch fails. - std::move(callback).Run(/*success=*/true); -} - -void WebAppsCrosapi::LaunchAppWithFiles(const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) { - if (!LogIfNotConnected(FROM_HERE)) { - return; - } - - auto params = CreateCrosapiLaunchParamsWithEventFlags( - proxy_, app_id, event_flags, - ConvertMojomLaunchSourceToLaunchSource(launch_source), - display::kInvalidDisplayId); - params->intent = apps_util::CreateCrosapiIntentForViewFiles(file_paths); - controller_->Launch(std::move(params), base::DoNothing()); -} - void WebAppsCrosapi::GetMenuModel(const std::string& app_id, apps::mojom::MenuType menu_type, int64_t display_id,
diff --git a/chrome/browser/apps/app_service/publishers/web_apps_crosapi.h b/chrome/browser/apps/app_service/publishers/web_apps_crosapi.h index 447f6e9..571dfaa 100644 --- a/chrome/browser/apps/app_service/publishers/web_apps_crosapi.h +++ b/chrome/browser/apps/app_service/publishers/web_apps_crosapi.h
@@ -128,16 +128,6 @@ int32_t event_flags, apps::mojom::LaunchSource launch_source, apps::mojom::WindowInfoPtr window_info) override; - void LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) override; - void LaunchAppWithFiles(const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) override; void GetMenuModel(const std::string& app_id, apps::mojom::MenuType menu_type, int64_t display_id,
diff --git a/chrome/browser/apps/intent_helper/chromeos_intent_picker_helpers.cc b/chrome/browser/apps/intent_helper/chromeos_intent_picker_helpers.cc index a60aeb6..6cc17666 100644 --- a/chrome/browser/apps/intent_helper/chromeos_intent_picker_helpers.cc +++ b/chrome/browser/apps/intent_helper/chromeos_intent_picker_helpers.cc
@@ -28,9 +28,7 @@ #include "chrome/browser/ui/web_applications/web_app_launch_utils.h" #include "components/feature_engagement/public/tracker.h" #include "components/services/app_service/public/cpp/app_launch_util.h" -#include "components/services/app_service/public/cpp/features.h" #include "components/services/app_service/public/cpp/intent_util.h" -#include "components/services/app_service/public/mojom/types.mojom.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/visibility.h" #include "content/public/browser/web_contents.h" @@ -230,20 +228,12 @@ auto* proxy = AppServiceProxyFactory::GetForProfile(profile); // TODO(crbug.com/853604): Distinguish the source from link and omnibox. - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - proxy->LaunchAppWithUrl( - launch_name, - GetEventFlags(WindowOpenDisposition::NEW_WINDOW, - /*prefer_container=*/true), - url, LaunchSource::kFromLink, - std::make_unique<WindowInfo>(display::kDefaultDisplayId)); - } else { - proxy->LaunchAppWithUrl(launch_name, - GetEventFlags(WindowOpenDisposition::NEW_WINDOW, - /*prefer_container=*/true), - url, mojom::LaunchSource::kFromLink, - apps::MakeWindowInfo(display::kDefaultDisplayId)); - } + proxy->LaunchAppWithUrl( + launch_name, + GetEventFlags(WindowOpenDisposition::NEW_WINDOW, + /*prefer_container=*/true), + url, LaunchSource::kFromLink, + std::make_unique<WindowInfo>(display::kDefaultDisplayId)); CloseOrGoBack(web_contents); } }
diff --git a/chrome/browser/apps/intent_helper/common_apps_navigation_throttle.cc b/chrome/browser/apps/intent_helper/common_apps_navigation_throttle.cc index e0309040..9e10f061 100644 --- a/chrome/browser/apps/intent_helper/common_apps_navigation_throttle.cc +++ b/chrome/browser/apps/intent_helper/common_apps_navigation_throttle.cc
@@ -35,8 +35,6 @@ #include "components/prefs/pref_service.h" #include "components/services/app_service/public/cpp/app_launch_util.h" #include "components/services/app_service/public/cpp/app_types.h" -#include "components/services/app_service/public/cpp/features.h" -#include "components/services/app_service/public/mojom/types.mojom.h" #include "components/strings/grit/components_strings.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" @@ -261,28 +259,18 @@ : LaunchSource::kFromOmnibox; GURL redirected_url = RedirectUrlIfSwa(profile, preferred_app_id.value(), url, clock_); - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - // The tab may have been closed, which runs async and causes the browser - // window to be refocused. Post a task to launch the app to ensure launching - // happens after the tab closed, otherwise the opened app window might be - // inactivated. - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::BindOnce( - &AppServiceProxy::LaunchAppWithUrlForBind, proxy->GetWeakPtr(), - preferred_app_id.value(), - GetEventFlags(WindowOpenDisposition::NEW_WINDOW, - /*prefer_container=*/true), - redirected_url, launch_source, - std::make_unique<WindowInfo>(display::kDefaultDisplayId))); - } else { - proxy->LaunchAppWithUrl( - preferred_app_id.value(), - GetEventFlags(WindowOpenDisposition::NEW_WINDOW, - /*prefer_container=*/true), - redirected_url, ConvertLaunchSourceToMojomLaunchSource(launch_source), - apps::MakeWindowInfo(display::kDefaultDisplayId)); - } + // The tab may have been closed, which runs async and causes the browser + // window to be refocused. Post a task to launch the app to ensure launching + // happens after the tab closed, otherwise the opened app window might be + // inactivated. + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::BindOnce(&AppServiceProxy::LaunchAppWithUrl, proxy->GetWeakPtr(), + preferred_app_id.value(), + GetEventFlags(WindowOpenDisposition::NEW_WINDOW, + /*prefer_container=*/true), + redirected_url, launch_source, + std::make_unique<WindowInfo>(display::kDefaultDisplayId))); IntentHandlingMetrics::RecordPreferredAppLinkClickMetrics( GetMetricsPlatform(app_type));
diff --git a/chrome/browser/apps/platform_apps/app_browsertest_util.cc b/chrome/browser/apps/platform_apps/app_browsertest_util.cc index 1ab41712..1fc3a3a 100644 --- a/chrome/browser/apps/platform_apps/app_browsertest_util.cc +++ b/chrome/browser/apps/platform_apps/app_browsertest_util.cc
@@ -20,8 +20,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/extensions/app_launch_params.h" #include "components/services/app_service/public/cpp/app_launch_util.h" -#include "content/public/browser/notification_service.h" -#include "content/public/browser/notification_types.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/test_utils.h" #include "extensions/browser/app_window/app_window_contents.h" @@ -145,9 +143,7 @@ const Extension* PlatformAppBrowserTest::InstallAndLaunchPlatformApp( const char* name) { - content::WindowedNotificationObserver app_loaded_observer( - content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, - content::NotificationService::AllSources()); + content::CreateAndLoadWebContentsObserver app_loaded_observer; const Extension* extension = InstallPlatformApp(name);
diff --git a/chrome/browser/apps/platform_apps/app_window_browsertest.cc b/chrome/browser/apps/platform_apps/app_window_browsertest.cc index 80c8fce..cd1afda 100644 --- a/chrome/browser/apps/platform_apps/app_window_browsertest.cc +++ b/chrome/browser/apps/platform_apps/app_window_browsertest.cc
@@ -14,8 +14,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "components/services/app_service/public/cpp/app_launch_util.h" -#include "content/public/browser/notification_service.h" -#include "content/public/browser/notification_types.h" #include "content/public/test/browser_test.h" #include "content/public/test/test_utils.h" #include "extensions/browser/app_window/app_window_geometry_cache.h" @@ -55,7 +53,7 @@ content::RunMessageLoop(); } - // Implements the content::NotificationObserver interface. + // Implements the AppWindowGeometryCache::Observer interface. void OnGeometryCacheChanged(const std::string& extension_id, const std::string& window_id, const gfx::Rect& bounds) override { @@ -222,10 +220,6 @@ ExtensionTestMessageListener launched_listener("Launched", ReplyBehavior::kWillReply); - content::WindowedNotificationObserver app_loaded_observer( - content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, - content::NotificationService::AllSources()); - const extensions::Extension* extension = LoadExtension( test_data_dir_.AppendASCII("platform_apps").AppendASCII("window_api")); EXPECT_TRUE(extension);
diff --git a/chrome/browser/ash/BUILD.gn b/chrome/browser/ash/BUILD.gn index 82d3e13..4418300a 100644 --- a/chrome/browser/ash/BUILD.gn +++ b/chrome/browser/ash/BUILD.gn
@@ -904,6 +904,8 @@ "dbus/mojo_connection_service_provider.h", "dbus/printers_service_provider.cc", "dbus/printers_service_provider.h", + "dbus/profiler_status_service_provider.cc", + "dbus/profiler_status_service_provider.h", "dbus/proxy_resolution_service_provider.cc", "dbus/proxy_resolution_service_provider.h", "dbus/screen_lock_service_provider.cc", @@ -3062,7 +3064,6 @@ "//ash/public/mojom", "//ash/quick_pair/common", "//ash/services/device_sync/proto", - "//ash/services/device_sync/public/cpp", "//ash/style", "//ash/webui/camera_app_ui", "//ash/webui/connectivity_diagnostics", @@ -3185,6 +3186,7 @@ "//chromeos/ash/components/trash_service/public/cpp", "//chromeos/ash/services/cros_healthd/public/cpp", "//chromeos/ash/services/cros_healthd/public/mojom", + "//chromeos/ash/services/device_sync/public/cpp", "//chromeos/ash/services/ime/public/cpp:structs", "//chromeos/ash/services/ime/public/mojom", "//chromeos/ash/services/multidevice_setup/public/cpp", @@ -3594,8 +3596,8 @@ "//components/proxy_config", "//components/reporting/client:report_queue_factory", "//components/reporting/proto:interface_proto", + "//components/reporting/proto:status_proto", "//components/reporting/util:status", - "//components/reporting/util:status_proto", "//components/safe_browsing/core/common:safe_browsing_prefs", "//components/services/app_service/public/cpp:app_file_handling", "//components/services/app_service/public/cpp:types",
diff --git a/chrome/browser/ash/app_restore/arc_app_queue_restore_handler.cc b/chrome/browser/ash/app_restore/arc_app_queue_restore_handler.cc index 0d3a6e55..3ec8bf6 100644 --- a/chrome/browser/ash/app_restore/arc_app_queue_restore_handler.cc +++ b/chrome/browser/ash/app_restore/arc_app_queue_restore_handler.cc
@@ -658,18 +658,10 @@ } if (app_restore_data->intent) { - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - proxy->LaunchAppWithIntent(app_id, app_restore_data->event_flag.value(), - app_restore_data->intent->Clone(), - apps::LaunchSource::kFromFullRestore, - std::move(window_info), base::DoNothing()); - } else { - proxy->LaunchAppWithIntent( - app_id, app_restore_data->event_flag.value(), - apps::ConvertIntentToMojomIntent(app_restore_data->intent), - apps::mojom::LaunchSource::kFromFullRestore, - ConvertWindowInfoToMojomWindowInfo(window_info), {}); - } + proxy->LaunchAppWithIntent(app_id, app_restore_data->event_flag.value(), + app_restore_data->intent->Clone(), + apps::LaunchSource::kFromFullRestore, + std::move(window_info), base::DoNothing()); } else { if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { proxy->Launch(app_id, app_restore_data->event_flag.value(),
diff --git a/chrome/browser/ash/arc/input_method_manager/arc_input_method_manager_service.cc b/chrome/browser/ash/arc/input_method_manager/arc_input_method_manager_service.cc index ed51643e..bcbf1972 100644 --- a/chrome/browser/ash/arc/input_method_manager/arc_input_method_manager_service.cc +++ b/chrome/browser/ash/arc/input_method_manager/arc_input_method_manager_service.cc
@@ -4,7 +4,6 @@ #include "chrome/browser/ash/arc/input_method_manager/arc_input_method_manager_service.h" -#include <algorithm> #include <utility> #include "ash/components/arc/arc_browser_context_keyed_service_factory_base.h" @@ -21,6 +20,7 @@ #include "base/containers/cxx20_erase.h" #include "base/logging.h" #include "base/memory/singleton.h" +#include "base/ranges/algorithm.h" #include "base/strings/string_piece.h" #include "chrome/browser/ash/arc/arc_util.h" #include "chrome/browser/ash/arc/input_method_manager/arc_input_method_manager_bridge_impl.h" @@ -634,10 +634,10 @@ // Filter out non ARC IME ids. std::set<std::string> new_arc_enabled_ime_ids; - std::copy_if( - new_enabled_ime_ids.begin(), new_enabled_ime_ids.end(), + base::ranges::copy_if( + new_enabled_ime_ids, std::inserter(new_arc_enabled_ime_ids, new_arc_enabled_ime_ids.end()), - [](const auto& id) { return ash::extension_ime_util::IsArcIME(id); }); + &ash::extension_ime_util::IsArcIME); // TODO(yhanada|yusukes): Instead of observing ImeMenuListChanged(), it's // probably better to just observe the pref (and not disabling ones still
diff --git a/chrome/browser/ash/arc/privacy_items/arc_privacy_items_bridge.cc b/chrome/browser/ash/arc/privacy_items/arc_privacy_items_bridge.cc index 2b931aa..531bf98 100644 --- a/chrome/browser/ash/arc/privacy_items/arc_privacy_items_bridge.cc +++ b/chrome/browser/ash/arc/privacy_items/arc_privacy_items_bridge.cc
@@ -58,6 +58,9 @@ std::vector<arc::mojom::PrivacyItemPtr> privacy_items) { DVLOG(1) << "ArcPrivacyItemsBridge::OnPrivacyItemsChanged size=" << privacy_items.size(); + + for (auto& observer : observer_list_) + observer.OnPrivacyItemsChanged(privacy_items); } void ArcPrivacyItemsBridge::OnMicCameraIndicatorRequirementChanged(bool flag) { @@ -86,4 +89,12 @@ instance->OnStaticPrivacyIndicatorBoundsChanged(display_id, bounds); } +void ArcPrivacyItemsBridge::AddObserver(Observer* observer) { + observer_list_.AddObserver(observer); +} + +void ArcPrivacyItemsBridge::RemoveObserver(Observer* observer) { + observer_list_.RemoveObserver(observer); +} + } // namespace arc
diff --git a/chrome/browser/ash/arc/privacy_items/arc_privacy_items_bridge.h b/chrome/browser/ash/arc/privacy_items/arc_privacy_items_bridge.h index 33085bb..17accd9 100644 --- a/chrome/browser/ash/arc/privacy_items/arc_privacy_items_bridge.h +++ b/chrome/browser/ash/arc/privacy_items/arc_privacy_items_bridge.h
@@ -7,6 +7,7 @@ #include "ash/components/arc/mojom/privacy_items.mojom.h" #include "ash/components/arc/session/connection_observer.h" +#include "base/observer_list.h" #include "components/keyed_service/core/keyed_service.h" namespace content { @@ -23,6 +24,13 @@ public ConnectionObserver<mojom::PrivacyItemsInstance>, public mojom::PrivacyItemsHost { public: + class Observer : public base::CheckedObserver { + public: + // Called when `privacy_items` were changed. + virtual void OnPrivacyItemsChanged( + const std::vector<arc::mojom::PrivacyItemPtr>& privacy_items) {} + }; + // Returns singleton instance for the given BrowserContext, // or nullptr if the browser |context| is not allowed to use ARC. static ArcPrivacyItemsBridge* GetForBrowserContext( @@ -46,8 +54,12 @@ void OnStaticPrivacyIndicatorBoundsChanged(int32_t display_id, std::vector<gfx::Rect> bounds); + void AddObserver(Observer* observer); + void RemoveObserver(Observer* observer); + private: ArcBridgeService* const arc_bridge_service_; + base::ObserverList<Observer> observer_list_; }; } // namespace arc
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_time_controller.cc b/chrome/browser/ash/child_accounts/time_limits/app_time_controller.cc index d6849d7..ee4b4fd 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_time_controller.cc +++ b/chrome/browser/ash/child_accounts/time_limits/app_time_controller.cc
@@ -37,8 +37,6 @@ #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "components/services/app_service/public/cpp/app_launch_util.h" -#include "components/services/app_service/public/cpp/features.h" -#include "components/services/app_service/public/mojom/types.mojom.h" #include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_registry.h" #include "extensions/common/extension.h" @@ -527,17 +525,10 @@ // Link Help app install page. DCHECK( apps::AppServiceProxyFactory::IsAppServiceAvailableForProfile(profile_)); - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - apps::AppServiceProxyFactory::GetForProfile(profile_)->LaunchAppWithUrl( - arc::kPlayStoreAppId, ui::EF_NONE, - GURL(ChildUserService::kFamilyLinkHelperAppPlayStoreURL), - apps::LaunchSource::kFromChromeInternal); - } else { - apps::AppServiceProxyFactory::GetForProfile(profile_)->LaunchAppWithUrl( - arc::kPlayStoreAppId, ui::EF_NONE, - GURL(ChildUserService::kFamilyLinkHelperAppPlayStoreURL), - apps::mojom::LaunchSource::kFromChromeInternal); - } + apps::AppServiceProxyFactory::GetForProfile(profile_)->LaunchAppWithUrl( + arc::kPlayStoreAppId, ui::EF_NONE, + GURL(ChildUserService::kFamilyLinkHelperAppPlayStoreURL), + apps::LaunchSource::kFromChromeInternal); } void AppTimeController::ShowNotificationForApp(
diff --git a/chrome/browser/ash/chrome_browser_main_parts_ash.cc b/chrome/browser/ash/chrome_browser_main_parts_ash.cc index 642d6195..e24f526 100644 --- a/chrome/browser/ash/chrome_browser_main_parts_ash.cc +++ b/chrome/browser/ash/chrome_browser_main_parts_ash.cc
@@ -78,6 +78,7 @@ #include "chrome/browser/ash/dbus/metrics_event_service_provider.h" #include "chrome/browser/ash/dbus/mojo_connection_service_provider.h" #include "chrome/browser/ash/dbus/printers_service_provider.h" +#include "chrome/browser/ash/dbus/profiler_status_service_provider.h" #include "chrome/browser/ash/dbus/proxy_resolution_service_provider.h" #include "chrome/browser/ash/dbus/screen_lock_service_provider.h" #include "chrome/browser/ash/dbus/smb_fs_service_provider.h" @@ -408,6 +409,12 @@ CrosDBusService::CreateServiceProviderList( std::make_unique<PrintersServiceProvider>())); + profiler_status_service_ = CrosDBusService::Create( + system_bus, ProfilerStatusServiceProvider::kServiceName, + dbus::ObjectPath(ProfilerStatusServiceProvider::kServicePath), + CrosDBusService::CreateServiceProviderList( + std::make_unique<ProfilerStatusServiceProvider>())); + vm_applications_service_ = CrosDBusService::Create( system_bus, vm_tools::apps::kVmApplicationsServiceName, dbus::ObjectPath(vm_tools::apps::kVmApplicationsServicePath), @@ -545,6 +552,7 @@ metrics_event_service_.reset(); plugin_vm_service_.reset(); printers_service_.reset(); + profiler_status_service_.reset(); virtual_file_request_service_.reset(); component_updater_service_.reset(); chrome_features_service_.reset(); @@ -576,6 +584,7 @@ std::unique_ptr<CrosDBusService> metrics_event_service_; std::unique_ptr<CrosDBusService> plugin_vm_service_; std::unique_ptr<CrosDBusService> printers_service_; + std::unique_ptr<CrosDBusService> profiler_status_service_; std::unique_ptr<CrosDBusService> screen_lock_service_; std::unique_ptr<CrosDBusService> virtual_file_request_service_; std::unique_ptr<CrosDBusService> component_updater_service_;
diff --git a/chrome/browser/ash/crosapi/sharesheet_ash_browsertest.cc b/chrome/browser/ash/crosapi/sharesheet_ash_browsertest.cc index ddfe164..789c087f 100644 --- a/chrome/browser/ash/crosapi/sharesheet_ash_browsertest.cc +++ b/chrome/browser/ash/crosapi/sharesheet_ash_browsertest.cc
@@ -134,7 +134,7 @@ // The Sample System Web App will be automatically selected from the // Sharesheet bubble. sharesheet::SharesheetService::SetSelectedAppForTesting( - base::UTF8ToUTF16(web_app::kSampleSystemWebAppId)); + base::UTF8ToUTF16(base::StringPiece{web_app::kSampleSystemWebAppId})); } void TearDownOnMainThread() override { sharesheet::SharesheetService::SetSelectedAppForTesting(std::u16string());
diff --git a/chrome/browser/ash/cryptauth/client_app_metadata_provider_service.cc b/chrome/browser/ash/cryptauth/client_app_metadata_provider_service.cc index 973267c1..175f5326 100644 --- a/chrome/browser/ash/cryptauth/client_app_metadata_provider_service.cc +++ b/chrome/browser/ash/cryptauth/client_app_metadata_provider_service.cc
@@ -9,7 +9,6 @@ #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/services/device_sync/proto/cryptauth_better_together_feature_metadata.pb.h" -#include "ash/services/device_sync/public/cpp/gcm_constants.h" #include "base/callback.h" #include "base/feature_list.h" #include "base/linux_util.h" @@ -26,6 +25,7 @@ #include "chromeos/ash/components/multidevice/logging/logging.h" #include "chromeos/ash/components/network/network_state_handler.h" #include "chromeos/ash/components/network/network_type_pattern.h" +#include "chromeos/ash/services/device_sync/public/cpp/gcm_constants.h" #include "components/gcm_driver/instance_id/instance_id_driver.h" #include "components/gcm_driver/instance_id/instance_id_profile_service.h" #include "components/prefs/pref_registry_simple.h"
diff --git a/chrome/browser/ash/cryptauth/client_app_metadata_provider_service.h b/chrome/browser/ash/cryptauth/client_app_metadata_provider_service.h index 87f891cc..6235a0a 100644 --- a/chrome/browser/ash/cryptauth/client_app_metadata_provider_service.h +++ b/chrome/browser/ash/cryptauth/client_app_metadata_provider_service.h
@@ -8,11 +8,11 @@ #include <list> #include "ash/services/device_sync/proto/cryptauth_client_app_metadata.pb.h" -#include "ash/services/device_sync/public/cpp/client_app_metadata_provider.h" #include "base/gtest_prod_util.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/system/sys_info.h" +#include "chromeos/ash/services/device_sync/public/cpp/client_app_metadata_provider.h" #include "components/gcm_driver/instance_id/instance_id.h" #include "components/keyed_service/core/keyed_service.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ash/cryptauth/cryptauth_device_id_provider_impl.h b/chrome/browser/ash/cryptauth/cryptauth_device_id_provider_impl.h index da421cf9..d952e576 100644 --- a/chrome/browser/ash/cryptauth/cryptauth_device_id_provider_impl.h +++ b/chrome/browser/ash/cryptauth/cryptauth_device_id_provider_impl.h
@@ -7,8 +7,8 @@ #include <string> -#include "ash/services/device_sync/public/cpp/cryptauth_device_id_provider.h" #include "base/no_destructor.h" +#include "chromeos/ash/services/device_sync/public/cpp/cryptauth_device_id_provider.h" class PrefRegistrySimple;
diff --git a/chrome/browser/ash/cryptauth/gcm_device_info_provider_impl.h b/chrome/browser/ash/cryptauth/gcm_device_info_provider_impl.h index 18c5e83..4bbc1f3 100644 --- a/chrome/browser/ash/cryptauth/gcm_device_info_provider_impl.h +++ b/chrome/browser/ash/cryptauth/gcm_device_info_provider_impl.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_ASH_CRYPTAUTH_GCM_DEVICE_INFO_PROVIDER_IMPL_H_ #include "ash/services/device_sync/proto/cryptauth_api.pb.h" -#include "ash/services/device_sync/public/cpp/gcm_device_info_provider.h" #include "base/no_destructor.h" +#include "chromeos/ash/services/device_sync/public/cpp/gcm_device_info_provider.h" namespace ash {
diff --git a/chrome/browser/ash/dbus/encrypted_reporting_service_provider.cc b/chrome/browser/ash/dbus/encrypted_reporting_service_provider.cc index 9cd223dc..2dfc362 100644 --- a/chrome/browser/ash/dbus/encrypted_reporting_service_provider.cc +++ b/chrome/browser/ash/dbus/encrypted_reporting_service_provider.cc
@@ -20,10 +20,10 @@ #include "chrome/browser/policy/messaging_layer/upload/upload_provider.h" #include "chromeos/dbus/missive/missive_client.h" #include "components/reporting/proto/synced/interface.pb.h" +#include "components/reporting/proto/synced/status.pb.h" #include "components/reporting/resources/memory_resource_impl.h" #include "components/reporting/storage_selector/storage_selector.h" #include "components/reporting/util/status.h" -#include "components/reporting/util/status.pb.h" #include "components/reporting/util/statusor.h" #include "dbus/bus.h" #include "dbus/exported_object.h"
diff --git a/chrome/browser/ash/dbus/org.chromium.ProfilerStatusService.conf b/chrome/browser/ash/dbus/org.chromium.ProfilerStatusService.conf new file mode 100644 index 0000000..1d4360d --- /dev/null +++ b/chrome/browser/ash/dbus/org.chromium.ProfilerStatusService.conf
@@ -0,0 +1,20 @@ +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<!-- + Copyright 2022 The Chromium Authors + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. + + This file will be installed at /opt/google/chrome/dbus on Chromium OS. +--> +<busconfig> + <policy user="chronos"> + <allow own="org.chromium.ProfilerStatusService"/> + </policy> + + <!-- tast tests run as root --> + <policy user="root"> + <allow send_destination="org.chromium.ProfilerStatusService" + send_interface="org.chromium.ProfilerStatusService"/> + </policy> +</busconfig>
diff --git a/chrome/browser/ash/dbus/profiler_status_service_provider.cc b/chrome/browser/ash/dbus/profiler_status_service_provider.cc new file mode 100644 index 0000000..5bf69a0 --- /dev/null +++ b/chrome/browser/ash/dbus/profiler_status_service_provider.cc
@@ -0,0 +1,72 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/dbus/profiler_status_service_provider.h" + +#include <memory> +#include <utility> + +#include "base/bind.h" +#include "base/logging.h" +#include "components/metrics/call_stack_profile_metrics_provider.h" +#include "dbus/message.h" + +namespace ash { + +ProfilerStatusServiceProvider::ProfilerStatusServiceProvider() = default; + +ProfilerStatusServiceProvider::~ProfilerStatusServiceProvider() = default; + +void ProfilerStatusServiceProvider::Start( + scoped_refptr<dbus::ExportedObject> exported_object) { + exported_object->ExportMethod( + kServiceName, kGetSuccessfullyCollectedCountsMethod, + base::BindRepeating( + &ProfilerStatusServiceProvider::GetSuccessfullyCollectedCounts), + base::BindOnce(&ProfilerStatusServiceProvider::OnExported)); +} + +// static +void ProfilerStatusServiceProvider::OnExported( + const std::string& interface_name, + const std::string& method_name, + bool success) { + if (!success) { + LOG(ERROR) << "Failed to export " << interface_name << "." << method_name; + } +} + +// static +void ProfilerStatusServiceProvider::GetSuccessfullyCollectedCounts( + dbus::MethodCall* method_call, + dbus::ExportedObject::ResponseSender response_sender) { + metrics::CallStackProfileMetricsProvider::ProcessThreadCount counts = + metrics::CallStackProfileMetricsProvider:: + GetSuccessfullyCollectedCounts(); + + std::unique_ptr<dbus::Response> response = + dbus::Response::FromMethodCall(method_call); + dbus::MessageWriter writer(response.get()); + + dbus::MessageWriter array_writer(nullptr); + // Send an array of structures, where each structure contains three ints: the + // process type, the thread type, and the # of successfully-stack-walked + // profile samples received. + writer.OpenArray("(iii)", &array_writer); + for (const auto& [process, thread_counts] : counts) { + for (auto [thread, count] : thread_counts) { + dbus::MessageWriter struct_writer(nullptr); + array_writer.OpenStruct(&struct_writer); + struct_writer.AppendInt32(process); + struct_writer.AppendInt32(thread); + struct_writer.AppendInt32(count); + array_writer.CloseContainer(&struct_writer); + } + } + writer.CloseContainer(&array_writer); + + std::move(response_sender).Run(std::move(response)); +} + +} // namespace ash
diff --git a/chrome/browser/ash/dbus/profiler_status_service_provider.h b/chrome/browser/ash/dbus/profiler_status_service_provider.h new file mode 100644 index 0000000..b361c8d --- /dev/null +++ b/chrome/browser/ash/dbus/profiler_status_service_provider.h
@@ -0,0 +1,57 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ASH_DBUS_PROFILER_STATUS_SERVICE_PROVIDER_H_ +#define CHROME_BROWSER_ASH_DBUS_PROFILER_STATUS_SERVICE_PROVIDER_H_ + +#include <string> + +#include "base/memory/ref_counted.h" +#include "chromeos/ash/components/dbus/services/cros_dbus_service.h" +#include "dbus/exported_object.h" + +namespace dbus { +class MethodCall; +} + +namespace ash { + +// A dbus interface that lets tast tests check that the stack profiler is +// working. +class ProfilerStatusServiceProvider + : public CrosDBusService::ServiceProviderInterface { + public: + // Normally, these would go into + // third_party/cros_system_api/dbus/service_constants.h to be shared with + // ChromeOS. But since this interface is only called from Go code, we won't + // use the C-style declarations in ChromeOS-land and it's easier to just + // define the constants here. + static constexpr char kServiceName[] = "org.chromium.ProfilerStatusService"; + static constexpr char kServicePath[] = "/org/chromium/ProfilerStatusService"; + static constexpr char kGetSuccessfullyCollectedCountsMethod[] = + "GetSuccessfullyCollectedCounts"; + + ProfilerStatusServiceProvider(); + ProfilerStatusServiceProvider(const ProfilerStatusServiceProvider&) = delete; + ProfilerStatusServiceProvider& operator=( + const ProfilerStatusServiceProvider&) = delete; + ~ProfilerStatusServiceProvider() override; + + // CrosDBusService::ServiceProviderInterface: + void Start(scoped_refptr<dbus::ExportedObject> exported_object) override; + + private: + // Called from ExportedObject when a handler is exported as a D-Bus method or + // failed to be exported. + static void OnExported(const std::string& interface_name, + const std::string& method_name, + bool success); + static void GetSuccessfullyCollectedCounts( + dbus::MethodCall* method_call, + dbus::ExportedObject::ResponseSender response_sender); +}; + +} // namespace ash + +#endif // CHROME_BROWSER_ASH_DBUS_PROFILER_STATUS_SERVICE_PROVIDER_H_
diff --git a/chrome/browser/ash/device_sync/device_sync_client_factory.cc b/chrome/browser/ash/device_sync/device_sync_client_factory.cc index 778692e..04a39393 100644 --- a/chrome/browser/ash/device_sync/device_sync_client_factory.cc +++ b/chrome/browser/ash/device_sync/device_sync_client_factory.cc
@@ -5,8 +5,6 @@ #include "chrome/browser/ash/device_sync/device_sync_client_factory.h" #include "ash/services/device_sync/device_sync_impl.h" -#include "ash/services/device_sync/public/cpp/device_sync_client.h" -#include "ash/services/device_sync/public/cpp/device_sync_client_impl.h" #include "ash/services/device_sync/stub_device_sync.h" #include "base/bind.h" #include "base/callback.h" @@ -20,6 +18,8 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/identity_manager_factory.h" #include "chromeos/ash/components/multidevice/stub_multidevice_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/prefs.h" #include "components/account_id/account_id.h" #include "components/gcm_driver/gcm_profile_service.h"
diff --git a/chrome/browser/ash/file_manager/app_service_file_tasks.cc b/chrome/browser/ash/file_manager/app_service_file_tasks.cc index 75462259..6ffd4e9 100644 --- a/chrome/browser/ash/file_manager/app_service_file_tasks.cc +++ b/chrome/browser/ash/file_manager/app_service_file_tasks.cc
@@ -41,11 +41,8 @@ #include "components/prefs/pref_service.h" #include "components/services/app_service/public/cpp/app_launch_util.h" #include "components/services/app_service/public/cpp/app_types.h" -#include "components/services/app_service/public/cpp/features.h" #include "components/services/app_service/public/cpp/intent.h" #include "components/services/app_service/public/cpp/intent_util.h" -#include "components/services/app_service/public/mojom/types.mojom-shared.h" -#include "components/services/app_service/public/mojom/types.mojom.h" #include "content/public/browser/browser_thread.h" #include "extensions/browser/entry_info.h" #include "extensions/browser/extension_registry.h" @@ -179,6 +176,10 @@ ToSwaActionId(kActionIdWebDriveOfficePowerPoint); } +bool IsSystemAppIdWithFileHandlers(base::StringPiece id) { + return id == web_app::kMediaAppId; +} + void FindAppServiceTasks(Profile* profile, const std::vector<extensions::EntryInfo>& entries, const std::vector<GURL>& file_urls, @@ -251,7 +252,7 @@ // Media app and other SWAs can handle "non-native" files, as can special // tasks which only access the file via URL. if (has_non_native_file && - !(web_app::IsSystemAppIdWithFileHandlers(launch_entry.app_id) || + !(IsSystemAppIdWithFileHandlers(launch_entry.app_id) || IsFilesAppUrlOpener(launch_entry))) { continue; } @@ -347,46 +348,18 @@ apps_util::kIntentActionView, std::move(intent_files)); intent->activity_name = task.action_id; - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - apps::AppServiceProxyFactory::GetForProfile(profile_with_app_service) - ->LaunchAppWithIntent( - task.app_id, ui::EF_NONE, std::move(intent), - apps::LaunchSource::kFromFileManager, - std::make_unique<apps::WindowInfo>(display::kDefaultDisplayId), - base::BindOnce( - [](FileTaskFinishedCallback done, TaskType task_type, - apps::LaunchResult&& result) { - std::move(done).Run( - ConvertLaunchResultToTaskResult(result, task_type), ""); - }, - std::move(done), task.task_type)); - } else { - apps::AppServiceProxyFactory::GetForProfile(profile_with_app_service) - ->LaunchAppWithIntent( - task.app_id, ui::EF_NONE, apps::ConvertIntentToMojomIntent(intent), - apps::mojom::LaunchSource::kFromFileManager, - apps::MakeWindowInfo(display::kDefaultDisplayId), - base::BindOnce( - [](FileTaskFinishedCallback done, TaskType task_type, - bool success) { - if (!success) { - std::move(done).Run(extensions::api::file_manager_private:: - TASK_RESULT_FAILED, - ""); - } else if (task_type == TASK_TYPE_WEB_APP) { - // TODO(benwells): return the correct code here, depending - // on how the app will be opened in multiprofile. - std::move(done).Run(extensions::api::file_manager_private:: - TASK_RESULT_OPENED, - ""); - } else { - std::move(done).Run(extensions::api::file_manager_private:: - TASK_RESULT_MESSAGE_SENT, - ""); - } - }, - std::move(done), task.task_type)); - } + apps::AppServiceProxyFactory::GetForProfile(profile_with_app_service) + ->LaunchAppWithIntent( + task.app_id, ui::EF_NONE, std::move(intent), + apps::LaunchSource::kFromFileManager, + std::make_unique<apps::WindowInfo>(display::kDefaultDisplayId), + base::BindOnce( + [](FileTaskFinishedCallback done, TaskType task_type, + apps::LaunchResult&& result) { + std::move(done).Run( + ConvertLaunchResultToTaskResult(result, task_type), ""); + }, + std::move(done), task.task_type)); } absl::optional<std::string> GetPolicyDefaultHandlerForFileExtension(
diff --git a/chrome/browser/ash/guest_os/guest_os_registry_service.cc b/chrome/browser/ash/guest_os/guest_os_registry_service.cc index eb2c12c..33b9a680 100644 --- a/chrome/browser/ash/guest_os/guest_os_registry_service.cc +++ b/chrome/browser/ash/guest_os/guest_os_registry_service.cc
@@ -499,7 +499,6 @@ base_icon_path_(profile->GetPath().AppendASCII(kCrostiniIconFolder)), clock_(base::DefaultClock::GetInstance()), svg_icon_transcoder_(std::make_unique<apps::SvgIconTranscoder>(profile)) { - RecordStartupMetrics(); } GuestOsRegistryService::~GuestOsRegistryService() = default; @@ -584,24 +583,6 @@ app_id, base::Value(pref_registration->Clone())); } -void GuestOsRegistryService::RecordStartupMetrics() { - const base::Value::Dict& apps = - prefs_->GetDict(guest_os::prefs::kGuestOsRegistry); - - base::flat_map<int, int> num_apps; - - for (const auto item : apps) { - absl::optional<bool> no_display = - item.second.FindBoolKey(guest_os::prefs::kAppNoDisplayKey); - if (no_display && no_display.value()) { - continue; - } - - VmType vm_type = VmTypeFromPref(item.second); - num_apps[static_cast<int>(vm_type)]++; - } -} - base::FilePath GuestOsRegistryService::GetAppPath( const std::string& app_id) const { return base_icon_path_.AppendASCII(app_id);
diff --git a/chrome/browser/ash/guest_os/guest_os_registry_service.h b/chrome/browser/ash/guest_os/guest_os_registry_service.h index 1115b3b1..58d3604 100644 --- a/chrome/browser/ash/guest_os/guest_os_registry_service.h +++ b/chrome/browser/ash/guest_os/guest_os_registry_service.h
@@ -247,9 +247,6 @@ const std::string& container_name); private: - // Run start up tasks for the registry (e.g. recording metrics). - void RecordStartupMetrics(); - // Construct path to app local data. base::FilePath GetAppPath(const std::string& app_id) const; // Called to request an icon from the container.
diff --git a/chrome/browser/ash/login/active_directory_login_browsertest.cc b/chrome/browser/ash/login/active_directory_login_browsertest.cc index 7f8e2e7..300d00d1 100644 --- a/chrome/browser/ash/login/active_directory_login_browsertest.cc +++ b/chrome/browser/ash/login/active_directory_login_browsertest.cc
@@ -19,7 +19,7 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/ash/settings/scoped_testing_cros_settings.h" #include "chrome/browser/ash/settings/stub_cros_settings_provider.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h" #include "chromeos/ash/components/dbus/authpolicy/fake_authpolicy_client.h" #include "components/user_manager/user_names.h" #include "content/public/browser/network_service_instance.h"
diff --git a/chrome/browser/ash/login/app_mode/test/auto_launched_kiosk_browsertest.cc b/chrome/browser/ash/login/app_mode/test/auto_launched_kiosk_browsertest.cc index e230c6c..409246d 100644 --- a/chrome/browser/ash/login/app_mode/test/auto_launched_kiosk_browsertest.cc +++ b/chrome/browser/ash/login/app_mode/test/auto_launched_kiosk_browsertest.cc
@@ -28,7 +28,7 @@ #include "chrome/browser/extensions/browsertest_util.h" #include "chrome/browser/lifetime/termination_notification.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/pref_names.h" #include "chromeos/ash/components/dbus/dbus_thread_manager.h"
diff --git a/chrome/browser/ash/login/app_mode/test/kiosk_browsertest.cc b/chrome/browser/ash/login/app_mode/test/kiosk_browsertest.cc index 31f83b5..238dd67f 100644 --- a/chrome/browser/ash/login/app_mode/test/kiosk_browsertest.cc +++ b/chrome/browser/ash/login/app_mode/test/kiosk_browsertest.cc
@@ -24,7 +24,7 @@ #include "chrome/browser/speech/extension_api/tts_engine_extension_api.h" #include "chrome/browser/ui/webui/ash/login/kiosk_autolaunch_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/kiosk_enable_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chromeos/ash/components/settings/cros_settings_provider.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h"
diff --git a/chrome/browser/ash/login/app_mode/test/web_kiosk_browsertest.cc b/chrome/browser/ash/login/app_mode/test/web_kiosk_browsertest.cc index 93c381c3..f204acc 100644 --- a/chrome/browser/ash/login/app_mode/test/web_kiosk_browsertest.cc +++ b/chrome/browser/ash/login/app_mode/test/web_kiosk_browsertest.cc
@@ -32,7 +32,7 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chrome/browser/web_applications/external_install_options.h" #include "chrome/browser/web_applications/externally_managed_app_manager.h" #include "chrome/browser/web_applications/user_display_mode.h"
diff --git a/chrome/browser/ash/login/arc_terms_of_service_browsertest.cc b/chrome/browser/ash/login/arc_terms_of_service_browsertest.cc index 6cdf70a..a16768c 100644 --- a/chrome/browser/ash/login/arc_terms_of_service_browsertest.cc +++ b/chrome/browser/ash/login/arc_terms_of_service_browsertest.cc
@@ -41,8 +41,8 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/webui/ash/login/arc_terms_of_service_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "chrome/test/base/interactive_test_utils.h"
diff --git a/chrome/browser/ash/login/configuration_based_oobe_browsertest.cc b/chrome/browser/ash/login/configuration_based_oobe_browsertest.cc index c0068e0..4f87634 100644 --- a/chrome/browser/ash/login/configuration_based_oobe_browsertest.cc +++ b/chrome/browser/ash/login/configuration_based_oobe_browsertest.cc
@@ -21,9 +21,9 @@ #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/hid_detection_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chromeos/ash/components/attestation/attestation_flow_utils.h" #include "chromeos/ash/components/dbus/attestation/fake_attestation_client.h" #include "chromeos/ash/components/dbus/shill/shill_manager_client.h"
diff --git a/chrome/browser/ash/login/demo_mode/demo_setup_browsertest.cc b/chrome/browser/ash/login/demo_mode/demo_setup_browsertest.cc index 9f966b7..ec4b4252 100644 --- a/chrome/browser/ash/login/demo_mode/demo_setup_browsertest.cc +++ b/chrome/browser/ash/login/demo_mode/demo_setup_browsertest.cc
@@ -48,8 +48,8 @@ #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "chrome/test/base/testing_browser_process.h"
diff --git a/chrome/browser/ash/login/easy_unlock/chrome_proximity_auth_client.cc b/chrome/browser/ash/login/easy_unlock/chrome_proximity_auth_client.cc index 32dde3eb..dbe1eac 100644 --- a/chrome/browser/ash/login/easy_unlock/chrome_proximity_auth_client.cc +++ b/chrome/browser/ash/login/easy_unlock/chrome_proximity_auth_client.cc
@@ -6,7 +6,6 @@ #include <stdint.h> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/logging.h" #include "base/system/sys_info.h" #include "base/version.h" @@ -18,6 +17,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_window.h" #include "chromeos/ash/components/multidevice/logging/logging.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "components/prefs/pref_service.h" #include "components/version_info/version_info.h"
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular.h b/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular.h index a0753ca..aeabad1 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular.h +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular.h
@@ -9,13 +9,13 @@ #include <string> #include "ash/services/device_sync/proto/cryptauth_api.pb.h" -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/callback.h" #include "base/time/time.h" #include "build/build_config.h" #include "chrome/browser/ash/login/easy_unlock/easy_unlock_service.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" #include "chromeos/ash/components/proximity_auth/screenlock_bridge.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/multidevice_setup_client.h" // TODO(https://crbug.com/1164001): move to forward declaration #include "chromeos/ash/services/secure_channel/public/cpp/client/secure_channel_client.h"
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular_unittest.cc b/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular_unittest.cc index 5824e7b..7cec28c 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular_unittest.cc +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular_unittest.cc
@@ -13,7 +13,6 @@ #include "ash/constants/ash_features.h" #include "ash/services/device_sync/proto/cryptauth_api.pb.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/bind.h" #include "base/logging.h" #include "base/memory/ptr_util.h" @@ -39,6 +38,7 @@ #include "chromeos/ash/components/multidevice/remote_device_test_util.h" #include "chromeos/ash/components/proximity_auth/fake_lock_handler.h" #include "chromeos/ash/components/proximity_auth/screenlock_bridge.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h" #include "chromeos/dbus/power/fake_power_manager_client.h"
diff --git a/chrome/browser/ash/login/enrollment/enrollment_embedded_policy_server_browsertest.cc b/chrome/browser/ash/login/enrollment/enrollment_embedded_policy_server_browsertest.cc index 11cad88..f37f8ef 100644 --- a/chrome/browser/ash/login/enrollment/enrollment_embedded_policy_server_browsertest.cc +++ b/chrome/browser/ash/login/enrollment/enrollment_embedded_policy_server_browsertest.cc
@@ -46,7 +46,7 @@ #include "chrome/browser/ui/webui/ash/login/device_disabled_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "chromeos/ash/components/attestation/attestation_flow_utils.h" @@ -897,9 +897,7 @@ test::kTestDomain)); host()->StartWizard(AutoEnrollmentCheckScreenView::kScreenId); - enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepDeviceAttributes); - enrollment_ui_.SubmitDeviceAttributes(test::values::kAssetId, - test::values::kLocation); + enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepSuccess); EXPECT_TRUE(StartupUtils::IsDeviceRegistered()); EXPECT_TRUE(InstallAttributes::Get()->IsCloudManaged()); @@ -1155,8 +1153,12 @@ ZeroTouchForcedAttestationSuccess) { AllowlistSimpleChallengeSigningKey(); policy_server_.SetupZeroTouchForcedEnrollment(); + policy_server_.SetUpdateDeviceAttributesPermission(true); host()->StartWizard(AutoEnrollmentCheckScreenView::kScreenId); + enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepDeviceAttributes); + enrollment_ui_.SubmitDeviceAttributes(test::values::kAssetId, + test::values::kLocation); enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepSuccess); EXPECT_TRUE(StartupUtils::IsDeviceRegistered()); EXPECT_TRUE(InstallAttributes::Get()->IsCloudManaged());
diff --git a/chrome/browser/ash/login/enrollment/enrollment_screen_browsertest.cc b/chrome/browser/ash/login/enrollment/enrollment_screen_browsertest.cc index 69888566..13b966c9 100644 --- a/chrome/browser/ash/login/enrollment/enrollment_screen_browsertest.cc +++ b/chrome/browser/ash/login/enrollment/enrollment_screen_browsertest.cc
@@ -24,7 +24,7 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/ash/policy/enrollment/enrollment_config.h" #include "chrome/browser/ash/policy/enrollment/enrollment_status.h" -#include "chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.h" #include "chromeos/dbus/tpm_manager/fake_tpm_manager_client.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" #include "chromeos/test/chromeos_test_utils.h"
diff --git a/chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_impl.cc b/chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_impl.cc index c743ae0..2ad60ed 100644 --- a/chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_impl.cc +++ b/chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_impl.cc
@@ -253,7 +253,7 @@ // is performing the attestation-based enrollment. if (auth_data_.has_oauth_token()) { return auth_data_.Clone(); - } else if (enrollment_config_.is_mode_attestation()) { + } else if (enrollment_config_.is_mode_initial_attestation_server_forced()) { return policy::DMAuth::FromDMToken(device_cloud_policy_client->dm_token()); } else { return {};
diff --git a/chrome/browser/ash/login/error_screen_browsertest.cc b/chrome/browser/ash/login/error_screen_browsertest.cc index 6ed49d1..3623c629 100644 --- a/chrome/browser/ash/login/error_screen_browsertest.cc +++ b/chrome/browser/ash/login/error_screen_browsertest.cc
@@ -23,7 +23,7 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/ui/webui/ash/login/app_launch_splash_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/grit/generated_resources.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h"
diff --git a/chrome/browser/ash/login/eula_browsertest.cc b/chrome/browser/ash/login/eula_browsertest.cc index 5fe258e..b5c645b 100644 --- a/chrome/browser/ash/login/eula_browsertest.cc +++ b/chrome/browser/ash/login/eula_browsertest.cc
@@ -33,8 +33,8 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" #include "chrome/grit/generated_resources.h" #include "chrome/installer/util/google_update_settings.h" #include "chrome/test/base/interactive_test_utils.h"
diff --git a/chrome/browser/ash/login/existing_user_controller.cc b/chrome/browser/ash/login/existing_user_controller.cc index a6483df..a4983b7 100644 --- a/chrome/browser/ash/login/existing_user_controller.cc +++ b/chrome/browser/ash/login/existing_user_controller.cc
@@ -85,8 +85,8 @@ #include "chrome/browser/ui/webui/ash/login/kiosk_autolaunch_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/kiosk_enable_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/l10n_util.h" -#include "chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_required_screen_handler.h" #include "chrome/common/channel_info.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h"
diff --git a/chrome/browser/ash/login/existing_user_controller_browsertest.cc b/chrome/browser/ash/login/existing_user_controller_browsertest.cc index af6bd1ed..0764c90 100644 --- a/chrome/browser/ash/login/existing_user_controller_browsertest.cc +++ b/chrome/browser/ash/login/existing_user_controller_browsertest.cc
@@ -62,8 +62,8 @@ #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.h" #include "chrome/grit/generated_resources.h" #include "chrome/test/base/testing_browser_process.h" #include "chromeos/ash/components/cryptohome/cryptohome_parameters.h"
diff --git a/chrome/browser/ash/login/guest_login_browsertest.cc b/chrome/browser/ash/login/guest_login_browsertest.cc index 6c8781f..f449aca 100644 --- a/chrome/browser/ash/login/guest_login_browsertest.cc +++ b/chrome/browser/ash/login/guest_login_browsertest.cc
@@ -16,7 +16,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" #include "chrome/browser/ui/webui/ash/login/guest_tos_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "chromeos/ash/components/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/ash/components/dbus/userdataauth/fake_userdataauth_client.h"
diff --git a/chrome/browser/ash/login/lock/screen_locker.cc b/chrome/browser/ash/login/lock/screen_locker.cc index d6940ab..a729c67 100644 --- a/chrome/browser/ash/login/lock/screen_locker.cc +++ b/chrome/browser/ash/login/lock/screen_locker.cc
@@ -4,8 +4,6 @@ #include "chrome/browser/ash/login/lock/screen_locker.h" -#include <algorithm> - #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/public/cpp/login_screen.h" @@ -18,6 +16,7 @@ #include "base/memory/weak_ptr.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" +#include "base/ranges/algorithm.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/task/current_thread.h" @@ -586,11 +585,12 @@ user_manager::UserList ScreenLocker::GetUsersToShow() const { user_manager::UserList users_to_show; // Filter out Managed Guest Session users as they should not appear on the UI. - std::copy_if(users_.begin(), users_.end(), std::back_inserter(users_to_show), - [](const user_manager::User* user) -> bool { - return user->GetType() != - user_manager::UserType::USER_TYPE_PUBLIC_ACCOUNT; - }); + base::ranges::copy_if( + users_, std::back_inserter(users_to_show), + [](const user_manager::User* user) { + return user->GetType() != + user_manager::UserType::USER_TYPE_PUBLIC_ACCOUNT; + }); return users_to_show; }
diff --git a/chrome/browser/ash/login/login_browsertest.cc b/chrome/browser/ash/login/login_browsertest.cc index 8488146d..0fb3e11 100644 --- a/chrome/browser/ash/login/login_browsertest.cc +++ b/chrome/browser/ash/login/login_browsertest.cc
@@ -41,8 +41,8 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/in_process_browser_test.h"
diff --git a/chrome/browser/ash/login/login_ui_browsertest.cc b/chrome/browser/ash/login/login_ui_browsertest.cc index 37b3b17..cb52b32 100644 --- a/chrome/browser/ash/login/login_ui_browsertest.cc +++ b/chrome/browser/ash/login/login_ui_browsertest.cc
@@ -32,9 +32,9 @@ #include "chrome/browser/ash/settings/stub_cros_settings_provider.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/browser/ui/webui/ash/system_web_dialog_delegate.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" #include "chrome/common/pref_names.h" #include "chromeos/ash/components/dbus/dbus_thread_manager.h" #include "chromeos/ash/components/dbus/debug_daemon/fake_debug_daemon_client.h"
diff --git a/chrome/browser/ash/login/login_ui_keyboard_browsertest.cc b/chrome/browser/ash/login/login_ui_keyboard_browsertest.cc index 4c0fcec..513680d 100644 --- a/chrome/browser/ash/login/login_ui_keyboard_browsertest.cc +++ b/chrome/browser/ash/login/login_ui_keyboard_browsertest.cc
@@ -31,7 +31,7 @@ #include "chrome/browser/ash/settings/stub_cros_settings_provider.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/ash/login_screen_shown_observer.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/common/pref_names.h" #include "chromeos/ash/components/login/auth/public/user_context.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/login/login_ui_shelf_visibility_browsertest.cc b/chrome/browser/ash/login/login_ui_shelf_visibility_browsertest.cc index 2f5001ac..5e77463 100644 --- a/chrome/browser/ash/login/login_ui_shelf_visibility_browsertest.cc +++ b/chrome/browser/ash/login/login_ui_shelf_visibility_browsertest.cc
@@ -19,9 +19,9 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_install_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/proto/device_management_backend.pb.h" #include "content/public/test/browser_test.h"
diff --git a/chrome/browser/ash/login/oobe_browsertest.cc b/chrome/browser/ash/login/oobe_browsertest.cc index c4404974..5dfcfafa 100644 --- a/chrome/browser/ash/login/oobe_browsertest.cc +++ b/chrome/browser/ash/login/oobe_browsertest.cc
@@ -28,9 +28,9 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/browser/ui/webui/signin/signin_utils.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h"
diff --git a/chrome/browser/ash/login/oobe_interactive_ui_test.cc b/chrome/browser/ash/login/oobe_interactive_ui_test.cc index aee376d..a4b94c69 100644 --- a/chrome/browser/ash/login/oobe_interactive_ui_test.cc +++ b/chrome/browser/ash/login/oobe_interactive_ui_test.cc
@@ -54,11 +54,11 @@ #include "chrome/browser/ui/webui/ash/login/assistant_optin_flow_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gesture_navigation_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/common/chrome_features.h" #include "chromeos/ash/components/assistant/buildflags.h" #include "chromeos/ash/components/attestation/attestation_flow_utils.h"
diff --git a/chrome/browser/ash/login/oobe_localization_browsertest.cc b/chrome/browser/ash/login/oobe_localization_browsertest.cc index 3d867ee..8f19245 100644 --- a/chrome/browser/ash/login/oobe_localization_browsertest.cc +++ b/chrome/browser/ash/login/oobe_localization_browsertest.cc
@@ -20,7 +20,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/in_process_browser_test.h" #include "chromeos/system/fake_statistics_provider.h"
diff --git a/chrome/browser/ash/login/proxy_auth_dialog_browsertest.cc b/chrome/browser/ash/login/proxy_auth_dialog_browsertest.cc index 369cee0..751a844 100644 --- a/chrome/browser/ash/login/proxy_auth_dialog_browsertest.cc +++ b/chrome/browser/ash/login/proxy_auth_dialog_browsertest.cc
@@ -12,7 +12,7 @@ #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/ui/login/login_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/common/chrome_switches.h" #include "content/public/common/content_switches.h" #include "content/public/test/browser_test.h"
diff --git a/chrome/browser/ash/login/reset_browsertest.cc b/chrome/browser/ash/login/reset_browsertest.cc index c90eb7e..47df8fe4 100644 --- a/chrome/browser/ash/login/reset_browsertest.cc +++ b/chrome/browser/ash/login/reset_browsertest.cc
@@ -20,8 +20,8 @@ #include "chrome/browser/ash/login/test/oobe_window_visibility_waiter.h" #include "chrome/browser/ash/login/ui/login_display_host.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "chromeos/ash/components/dbus/session_manager/fake_session_manager_client.h"
diff --git a/chrome/browser/ash/login/saml/saml_browsertest.cc b/chrome/browser/ash/login/saml/saml_browsertest.cc index a5f96b58..abe8bfa 100644 --- a/chrome/browser/ash/login/saml/saml_browsertest.cc +++ b/chrome/browser/ash/login/saml/saml_browsertest.cc
@@ -61,9 +61,9 @@ #include "chrome/browser/ui/login/login_handler.h" #include "chrome/browser/ui/login/login_handler_test_utils.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/saml_challenge_key_handler.h" +#include "chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h" #include "chrome/browser/ui/webui/signin/signin_utils.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h"
diff --git a/chrome/browser/ash/login/screens/active_directory_login_screen.h b/chrome/browser/ash/login/screens/active_directory_login_screen.h index 2e782d79..68cdebe 100644 --- a/chrome/browser/ash/login/screens/active_directory_login_screen.h +++ b/chrome/browser/ash/login/screens/active_directory_login_screen.h
@@ -17,7 +17,7 @@ #include "chrome/browser/ash/login/screens/error_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. #include "chrome/browser/ui/webui/ash/login/active_directory_login_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/active_directory_password_change_screen.cc b/chrome/browser/ash/login/screens/active_directory_password_change_screen.cc index a4c249fe..5118144 100644 --- a/chrome/browser/ash/login/screens/active_directory_password_change_screen.cc +++ b/chrome/browser/ash/login/screens/active_directory_password_change_screen.cc
@@ -12,7 +12,7 @@ #include "chrome/browser/ash/login/ui/login_display_host.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/webui/ash/login/active_directory_password_change_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chrome/grit/generated_resources.h" #include "chromeos/ash/components/login/auth/public/cryptohome_key_constants.h" #include "chromeos/ash/components/login/auth/public/key.h"
diff --git a/chrome/browser/ash/login/screens/chrome_user_selection_screen.cc b/chrome/browser/ash/login/screens/chrome_user_selection_screen.cc index 3ebfaf9..c1eff38 100644 --- a/chrome/browser/ash/login/screens/chrome_user_selection_screen.cc +++ b/chrome/browser/ash/login/screens/chrome_user_selection_screen.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/ui/webui/ash/login/l10n_util.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "components/account_id/account_id.h" #include "components/policy/core/common/cloud/cloud_policy_core.h" #include "components/policy/core/common/cloud/cloud_policy_store.h"
diff --git a/chrome/browser/ash/login/screens/demo_preferences_screen.cc b/chrome/browser/ash/login/screens/demo_preferences_screen.cc index 627b786..4916977d 100644 --- a/chrome/browser/ash/login/screens/demo_preferences_screen.cc +++ b/chrome/browser/ash/login/screens/demo_preferences_screen.cc
@@ -13,7 +13,7 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/webui/ash/login/demo_preferences_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/common/pref_names.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/login/screens/edu_coexistence_login_browsertest.cc b/chrome/browser/ash/login/screens/edu_coexistence_login_browsertest.cc index ab9a8fc..b33f335 100644 --- a/chrome/browser/ash/login/screens/edu_coexistence_login_browsertest.cc +++ b/chrome/browser/ash/login/screens/edu_coexistence_login_browsertest.cc
@@ -19,8 +19,8 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/supervised_user/supervised_user_service.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/browser/ui/webui/ash/system_web_dialog_delegate.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" #include "chrome/browser/ui/webui/signin/ash/inline_login_dialog_onboarding.h" #include "components/account_id/account_id.h" #include "content/public/test/browser_test.h"
diff --git a/chrome/browser/ash/login/screens/error_screen.cc b/chrome/browser/ash/login/screens/error_screen.cc index ef8c73f..925b8a5b 100644 --- a/chrome/browser/ash/login/screens/error_screen.cc +++ b/chrome/browser/ash/login/screens/error_screen.cc
@@ -31,7 +31,7 @@ #include "chrome/browser/ui/webui/ash/connectivity_diagnostics_dialog.h" #include "chrome/browser/ui/webui/ash/internet_detail_dialog.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chrome/grit/browser_resources.h" #include "chromeos/ash/components/network/network_connection_handler.h" #include "chromeos/ash/components/network/network_handler.h"
diff --git a/chrome/browser/ash/login/screens/error_screen.h b/chrome/browser/ash/login/screens/error_screen.h index 29a7c081..afda212c 100644 --- a/chrome/browser/ash/login/screens/error_screen.h +++ b/chrome/browser/ash/login/screens/error_screen.h
@@ -18,7 +18,7 @@ #include "chrome/browser/ash/settings/device_settings_service.h" // TODO(https://crbug.com/1164001): move to forward declaration. #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" #include "chromeos/ash/components/network/network_connection_observer.h" #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
diff --git a/chrome/browser/ash/login/screens/family_link_notice_browsertest.cc b/chrome/browser/ash/login/screens/family_link_notice_browsertest.cc index c1af98a..209aa4c7 100644 --- a/chrome/browser/ash/login/screens/family_link_notice_browsertest.cc +++ b/chrome/browser/ash/login/screens/family_link_notice_browsertest.cc
@@ -17,7 +17,7 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/webui/ash/login/family_link_notice_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/common/pref_names.h" #include "chromeos/ash/components/login/auth/stub_authenticator_builder.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/login/screens/hid_detection_screen_browsertest.cc b/chrome/browser/ash/login/screens/hid_detection_screen_browsertest.cc index 25c11362..470a404 100644 --- a/chrome/browser/ash/login/screens/hid_detection_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/hid_detection_screen_browsertest.cc
@@ -26,8 +26,8 @@ #include "chrome/browser/ash/login/test/oobe_screens_utils.h" #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/ui/webui/ash/login/hid_detection_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chromeos/ash/components/hid_detection/bluetooth_hid_detector.h" #include "chromeos/ash/components/hid_detection/fake_hid_detection_manager.h" #include "chromeos/ash/components/hid_detection/hid_detection_manager.h"
diff --git a/chrome/browser/ash/login/screens/management_transition_screen.cc b/chrome/browser/ash/login/screens/management_transition_screen.cc index e7493ee..d61919e4 100644 --- a/chrome/browser/ash/login/screens/management_transition_screen.cc +++ b/chrome/browser/ash/login/screens/management_transition_screen.cc
@@ -19,7 +19,7 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/browser/ui/managed_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/management_transition_screen_handler.h" namespace {
diff --git a/chrome/browser/ash/login/screens/management_transition_screen.h b/chrome/browser/ash/login/screens/management_transition_screen.h index 1d0ff491..d290ba37 100644 --- a/chrome/browser/ash/login/screens/management_transition_screen.h +++ b/chrome/browser/ash/login/screens/management_transition_screen.h
@@ -14,7 +14,7 @@ #include "components/prefs/pref_change_registrar.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/management_transition_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/management_transition_screen_browsertest.cc b/chrome/browser/ash/login/screens/management_transition_screen_browsertest.cc index 2ace762..2e09e17 100644 --- a/chrome/browser/ash/login/screens/management_transition_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/management_transition_screen_browsertest.cc
@@ -26,8 +26,8 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/ui/webui/ash/login/management_transition_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "components/policy/policy_constants.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/login/screens/marketing_opt_in_screen.cc b/chrome/browser/ash/login/screens/marketing_opt_in_screen.cc index d442425a..2cb990e73 100644 --- a/chrome/browser/ash/login/screens/marketing_opt_in_screen.cc +++ b/chrome/browser/ash/login/screens/marketing_opt_in_screen.cc
@@ -31,7 +31,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/webui/ash/login/gesture_navigation_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h" #include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h"
diff --git a/chrome/browser/ash/login/screens/marketing_opt_in_screen.h b/chrome/browser/ash/login/screens/marketing_opt_in_screen.h index d433c70b..ea9e919b 100644 --- a/chrome/browser/ash/login/screens/marketing_opt_in_screen.h +++ b/chrome/browser/ash/login/screens/marketing_opt_in_screen.h
@@ -13,7 +13,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h" #include "components/prefs/pref_change_registrar.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/marketing_opt_in_screen_browsertest.cc b/chrome/browser/ash/login/screens/marketing_opt_in_screen_browsertest.cc index 87dc041..796babaa 100644 --- a/chrome/browser/ash/login/screens/marketing_opt_in_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/marketing_opt_in_screen_browsertest.cc
@@ -35,7 +35,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h" #include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chromeos/constants/chromeos_features.h"
diff --git a/chrome/browser/ash/login/screens/mock_network_screen.h b/chrome/browser/ash/login/screens/mock_network_screen.h index 98dc3bd..507a713 100644 --- a/chrome/browser/ash/login/screens/mock_network_screen.h +++ b/chrome/browser/ash/login/screens/mock_network_screen.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_ASH_LOGIN_SCREENS_MOCK_NETWORK_SCREEN_H_ #include "chrome/browser/ash/login/screens/network_screen.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" #include "testing/gmock/include/gmock/gmock.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/mock_update_screen.h b/chrome/browser/ash/login/screens/mock_update_screen.h index 1ffdec4..df66300 100644 --- a/chrome/browser/ash/login/screens/mock_update_screen.h +++ b/chrome/browser/ash/login/screens/mock_update_screen.h
@@ -7,7 +7,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/screens/update_screen.h" -#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h" #include "testing/gmock/include/gmock/gmock.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/mock_welcome_screen.h b/chrome/browser/ash/login/screens/mock_welcome_screen.h index 28c118a..8c8a34e 100644 --- a/chrome/browser/ash/login/screens/mock_welcome_screen.h +++ b/chrome/browser/ash/login/screens/mock_welcome_screen.h
@@ -8,7 +8,7 @@ #include <string> #include "chrome/browser/ash/login/screens/welcome_screen.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "testing/gmock/include/gmock/gmock.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/mock_wrong_hwid_screen.h b/chrome/browser/ash/login/screens/mock_wrong_hwid_screen.h index d02a3b4..aa5a7c5 100644 --- a/chrome/browser/ash/login/screens/mock_wrong_hwid_screen.h +++ b/chrome/browser/ash/login/screens/mock_wrong_hwid_screen.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_ASH_LOGIN_SCREENS_MOCK_WRONG_HWID_SCREEN_H_ #include "chrome/browser/ash/login/screens/wrong_hwid_screen.h" -#include "chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.h" #include "testing/gmock/include/gmock/gmock.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/multidevice_setup_screen.cc b/chrome/browser/ash/login/screens/multidevice_setup_screen.cc index e164c3e..a3de34b9 100644 --- a/chrome/browser/ash/login/screens/multidevice_setup_screen.cc +++ b/chrome/browser/ash/login/screens/multidevice_setup_screen.cc
@@ -12,7 +12,7 @@ #include "chrome/browser/ash/multidevice_setup/multidevice_setup_client_factory.h" #include "chrome/browser/ash/multidevice_setup/oobe_completion_tracker_factory.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/webui/chromeos/login/multidevice_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/multidevice_setup_screen_handler.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/multidevice_setup_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/oobe_completion_tracker.h"
diff --git a/chrome/browser/ash/login/screens/multidevice_setup_screen.h b/chrome/browser/ash/login/screens/multidevice_setup_screen.h index 8a67f963..6db85a6 100644 --- a/chrome/browser/ash/login/screens/multidevice_setup_screen.h +++ b/chrome/browser/ash/login/screens/multidevice_setup_screen.h
@@ -12,7 +12,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/multidevice_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/multidevice_setup_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/multidevice_setup_screen_browsertest.cc b/chrome/browser/ash/login/screens/multidevice_setup_screen_browsertest.cc index ca4d6b95..b73e680 100644 --- a/chrome/browser/ash/login/screens/multidevice_setup_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/multidevice_setup_screen_browsertest.cc
@@ -16,7 +16,7 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/multidevice_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/multidevice_setup_screen_handler.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h" #include "content/public/test/browser_test.h"
diff --git a/chrome/browser/ash/login/screens/network_screen.cc b/chrome/browser/ash/login/screens/network_screen.cc index 19a16ac4..2b1eacd5 100644 --- a/chrome/browser/ash/login/screens/network_screen.cc +++ b/chrome/browser/ash/login/screens/network_screen.cc
@@ -13,7 +13,7 @@ #include "chrome/browser/ash/login/oobe_screen.h" #include "chrome/browser/ash/login/wizard_context.h" #include "chrome/browser/ash/login/wizard_controller.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "chromeos/ash/components/network/network_handler.h"
diff --git a/chrome/browser/ash/login/screens/network_screen.h b/chrome/browser/ash/login/screens/network_screen.h index c937784..c717304a 100644 --- a/chrome/browser/ash/login/screens/network_screen.h +++ b/chrome/browser/ash/login/screens/network_screen.h
@@ -19,7 +19,7 @@ #include "chromeos/ash/components/network/network_state_handler.h" #include "chromeos/ash/components/network/network_state_handler_observer.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/network_screen_browsertest.cc b/chrome/browser/ash/login/screens/network_screen_browsertest.cc index 7d40f36..e6016aa 100644 --- a/chrome/browser/ash/login/screens/network_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/network_screen_browsertest.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/ash/login/test/oobe_screen_waiter.h" #include "chrome/browser/ash/login/ui/login_display_host.h" #include "chrome/browser/ash/login/wizard_controller.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" #include "chrome/test/base/in_process_browser_test.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h"
diff --git a/chrome/browser/ash/login/screens/offline_login_screen.cc b/chrome/browser/ash/login/screens/offline_login_screen.cc index 219d394..50349ea 100644 --- a/chrome/browser/ash/login/screens/offline_login_screen.cc +++ b/chrome/browser/ash/login/screens/offline_login_screen.cc
@@ -19,7 +19,7 @@ #include "chrome/browser/ash/settings/cros_settings.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" -#include "chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/offline_login_screen_handler.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "chromeos/ash/components/login/auth/public/key.h"
diff --git a/chrome/browser/ash/login/screens/offline_login_screen.h b/chrome/browser/ash/login/screens/offline_login_screen.h index 52336c6..4e4c4d54 100644 --- a/chrome/browser/ash/login/screens/offline_login_screen.h +++ b/chrome/browser/ash/login/screens/offline_login_screen.h
@@ -11,9 +11,9 @@ #include "base/scoped_observation.h" #include "chrome/browser/ash/idle_detector.h" #include "chrome/browser/ash/login/screens/base_screen.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/offline_login_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/os_install_screen.cc b/chrome/browser/ash/login/screens/os_install_screen.cc index a3b12c6..e05d612 100644 --- a/chrome/browser/ash/login/screens/os_install_screen.cc +++ b/chrome/browser/ash/login/screens/os_install_screen.cc
@@ -7,7 +7,7 @@ #include "ash/public/cpp/login_accelerators.h" #include "base/time/default_tick_clock.h" #include "chrome/browser/ash/login/ui/login_display_host.h" -#include "chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_install_screen_handler.h" #include "chromeos/dbus/power/power_manager_client.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/os_install_screen.h b/chrome/browser/ash/login/screens/os_install_screen.h index 9a590146..0ccf2a2 100644 --- a/chrome/browser/ash/login/screens/os_install_screen.h +++ b/chrome/browser/ash/login/screens/os_install_screen.h
@@ -13,7 +13,7 @@ #include "base/timer/timer.h" #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_install_screen_handler.h" #include "chromeos/ash/components/dbus/os_install/os_install_client.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/os_install_screen_browsertest.cc b/chrome/browser/ash/login/screens/os_install_screen_browsertest.cc index ca1a73edc..e200f10 100644 --- a/chrome/browser/ash/login/screens/os_install_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/os_install_screen_browsertest.cc
@@ -10,10 +10,10 @@ #include "chrome/browser/ash/login/test/oobe_base_test.h" #include "chrome/browser/ash/login/test/oobe_screen_waiter.h" #include "chrome/browser/ash/login/wizard_controller.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_install_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_trial_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "chromeos/dbus/power/fake_power_manager_client.h"
diff --git a/chrome/browser/ash/login/screens/os_trial_screen.cc b/chrome/browser/ash/login/screens/os_trial_screen.cc index cade7cc..b97c01e 100644 --- a/chrome/browser/ash/login/screens/os_trial_screen.cc +++ b/chrome/browser/ash/login/screens/os_trial_screen.cc
@@ -4,7 +4,7 @@ #include "chrome/browser/ash/login/screens/os_trial_screen.h" -#include "chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_trial_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/os_trial_screen.h b/chrome/browser/ash/login/screens/os_trial_screen.h index b06c734..fc9c7a8 100644 --- a/chrome/browser/ash/login/screens/os_trial_screen.h +++ b/chrome/browser/ash/login/screens/os_trial_screen.h
@@ -9,7 +9,7 @@ #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_trial_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/os_trial_screen_browsertest.cc b/chrome/browser/ash/login/screens/os_trial_screen_browsertest.cc index 75b95aa..e1686ee 100644 --- a/chrome/browser/ash/login/screens/os_trial_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/os_trial_screen_browsertest.cc
@@ -8,11 +8,11 @@ #include "chrome/browser/ash/login/test/oobe_base_test.h" #include "chrome/browser/ash/login/test/oobe_screen_waiter.h" #include "chrome/browser/ash/login/wizard_controller.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_install_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_trial_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "content/public/test/browser_test.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/packaged_license_screen.cc b/chrome/browser/ash/login/screens/packaged_license_screen.cc index 6b85ceab..2e32eb9 100644 --- a/chrome/browser/ash/login/screens/packaged_license_screen.cc +++ b/chrome/browser/ash/login/screens/packaged_license_screen.cc
@@ -10,7 +10,7 @@ #include "chrome/browser/ash/policy/enrollment/enrollment_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part_ash.h" -#include "chrome/browser/ui/webui/chromeos/login/packaged_license_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/packaged_license_screen_handler.h" namespace ash { namespace {
diff --git a/chrome/browser/ash/login/screens/packaged_license_screen.h b/chrome/browser/ash/login/screens/packaged_license_screen.h index 2fbd5de..b2eb71f5 100644 --- a/chrome/browser/ash/login/screens/packaged_license_screen.h +++ b/chrome/browser/ash/login/screens/packaged_license_screen.h
@@ -11,7 +11,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/packaged_license_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/packaged_license_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/packaged_license_screen_browsertest.cc b/chrome/browser/ash/login/screens/packaged_license_screen_browsertest.cc index 8d70249..7913e6f9 100644 --- a/chrome/browser/ash/login/screens/packaged_license_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/packaged_license_screen_browsertest.cc
@@ -14,7 +14,7 @@ #include "chrome/browser/ash/policy/enrollment/enrollment_config.h" #include "chrome/browser/ash/policy/server_backed_state/server_backed_device_state.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/ui/webui/chromeos/login/packaged_license_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/packaged_license_screen_handler.h" #include "chrome/common/pref_names.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h"
diff --git a/chrome/browser/ash/login/screens/parental_handoff_screen.cc b/chrome/browser/ash/login/screens/parental_handoff_screen.cc index 794aba1..4b01041c 100644 --- a/chrome/browser/ash/login/screens/parental_handoff_screen.cc +++ b/chrome/browser/ash/login/screens/parental_handoff_screen.cc
@@ -11,7 +11,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/supervised_user/supervised_user_features/supervised_user_features.h" -#include "chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/parental_handoff_screen_handler.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/ash/login/screens/parental_handoff_screen.h b/chrome/browser/ash/login/screens/parental_handoff_screen.h index 9ea3168..8a54e91 100644 --- a/chrome/browser/ash/login/screens/parental_handoff_screen.h +++ b/chrome/browser/ash/login/screens/parental_handoff_screen.h
@@ -11,7 +11,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/parental_handoff_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/parental_handoff_screen_browsertest.cc b/chrome/browser/ash/login/screens/parental_handoff_screen_browsertest.cc index 45d822a..c82d204 100644 --- a/chrome/browser/ash/login/screens/parental_handoff_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/parental_handoff_screen_browsertest.cc
@@ -28,10 +28,10 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/supervised_user/supervised_user_service.h" #include "chrome/browser/ui/webui/ash/login/assistant_optin_flow_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/parental_handoff_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/browser/ui/webui/ash/system_web_dialog_delegate.h" -#include "chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" #include "components/account_id/account_id.h" #include "content/public/test/browser_test.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ash/login/screens/pin_setup_screen.cc b/chrome/browser/ash/login/screens/pin_setup_screen.cc index 365c279..032c25da 100644 --- a/chrome/browser/ash/login/screens/pin_setup_screen.cc +++ b/chrome/browser/ash/login/screens/pin_setup_screen.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/ash/login/wizard_context.h" #include "chrome/browser/policy/profile_policy_connector.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.h" #include "chromeos/ash/components/login/auth/public/cryptohome_key_constants.h" #include "chromeos/ash/components/login/auth/public/user_context.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/login/screens/pin_setup_screen.h b/chrome/browser/ash/login/screens/pin_setup_screen.h index 62e91017..2c4ebc6 100644 --- a/chrome/browser/ash/login/screens/pin_setup_screen.h +++ b/chrome/browser/ash/login/screens/pin_setup_screen.h
@@ -15,7 +15,7 @@ // TODO(https://crbug.com/1164001): move to forward declaration. #include "chrome/browser/ash/login/wizard_context.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/pin_setup_screen_browsertest.cc b/chrome/browser/ash/login/screens/pin_setup_screen_browsertest.cc index 5d8c09e..7d39506 100644 --- a/chrome/browser/ash/login/screens/pin_setup_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/pin_setup_screen_browsertest.cc
@@ -18,7 +18,7 @@ #include "chrome/browser/ash/login/ui/login_display_host.h" #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.h" #include "chromeos/ash/components/dbus/userdataauth/fake_userdataauth_client.h" #include "components/user_manager/user_type.h" #include "content/public/test/browser_test.h"
diff --git a/chrome/browser/ash/login/screens/quick_start_screen.cc b/chrome/browser/ash/login/screens/quick_start_screen.cc index 6f709f8..889ea85 100644 --- a/chrome/browser/ash/login/screens/quick_start_screen.cc +++ b/chrome/browser/ash/login/screens/quick_start_screen.cc
@@ -13,7 +13,7 @@ #include "chrome/browser/ash/login/oobe_quick_start/target_device_bootstrap_controller.h" #include "chrome/browser/ash/login/oobe_quick_start/verification_shapes.h" #include "chrome/browser/ash/login/ui/login_display_host.h" -#include "chrome/browser/ui/webui/chromeos/login/quick_start_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h" #include "third_party/abseil-cpp/absl/types/variant.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/quick_start_screen.h b/chrome/browser/ash/login/screens/quick_start_screen.h index 0133044..136b3e7 100644 --- a/chrome/browser/ash/login/screens/quick_start_screen.h +++ b/chrome/browser/ash/login/screens/quick_start_screen.h
@@ -11,7 +11,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/oobe_quick_start/target_device_bootstrap_controller.h" #include "chrome/browser/ash/login/screens/base_screen.h" -#include "chrome/browser/ui/webui/chromeos/login/quick_start_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/quick_start_screen_browsertest.cc b/chrome/browser/ash/login/screens/quick_start_screen_browsertest.cc index 30064f8..cdf3d8f9 100644 --- a/chrome/browser/ash/login/screens/quick_start_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/quick_start_screen_browsertest.cc
@@ -11,8 +11,8 @@ #include "chrome/browser/ash/login/test/js_checker.h" #include "chrome/browser/ash/login/test/oobe_base_test.h" #include "chrome/browser/ash/login/test/oobe_screen_waiter.h" -#include "chrome/browser/ui/webui/chromeos/login/quick_start_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "content/public/test/browser_test.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/recommend_apps_screen.cc b/chrome/browser/ash/login/screens/recommend_apps_screen.cc index 46d9233..093b978 100644 --- a/chrome/browser/ash/login/screens/recommend_apps_screen.cc +++ b/chrome/browser/ash/login/screens/recommend_apps_screen.cc
@@ -16,7 +16,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/app_list/arc/arc_fast_app_reinstall_starter.h" -#include "chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.h" #include "chrome/common/chrome_features.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/ash/login/screens/recommend_apps_screen.h b/chrome/browser/ash/login/screens/recommend_apps_screen.h index eabcfb0..79cd386 100644 --- a/chrome/browser/ash/login/screens/recommend_apps_screen.h +++ b/chrome/browser/ash/login/screens/recommend_apps_screen.h
@@ -16,7 +16,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.h" #include "components/prefs/pref_service.h" namespace base {
diff --git a/chrome/browser/ash/login/screens/recommend_apps_screen_browsertest.cc b/chrome/browser/ash/login/screens/recommend_apps_screen_browsertest.cc index 271e8b0..f941414b 100644 --- a/chrome/browser/ash/login/screens/recommend_apps_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/recommend_apps_screen_browsertest.cc
@@ -35,7 +35,7 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.h" #include "chrome/common/chrome_features.h" #include "components/account_id/account_id.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/login/screens/reset_screen.cc b/chrome/browser/ash/login/screens/reset_screen.cc index 9a9f754..7467bfd 100644 --- a/chrome/browser/ash/login/screens/reset_screen.cc +++ b/chrome/browser/ash/login/screens/reset_screen.cc
@@ -26,7 +26,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/browser_process_platform_part_ash.h" -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" #include "chrome/common/pref_names.h" #include "chromeos/ash/components/dbus/session_manager/session_manager_client.h" #include "chromeos/ash/components/dbus/update_engine/update_engine_client.h"
diff --git a/chrome/browser/ash/login/screens/reset_screen.h b/chrome/browser/ash/login/screens/reset_screen.h index 206db0b..00f992a 100644 --- a/chrome/browser/ash/login/screens/reset_screen.h +++ b/chrome/browser/ash/login/screens/reset_screen.h
@@ -17,7 +17,7 @@ #include "chrome/browser/ash/tpm_firmware_update.h" #include "third_party/abseil-cpp/absl/types/optional.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" #include "chromeos/ash/components/dbus/update_engine/update_engine_client.h" class PrefRegistrySimple;
diff --git a/chrome/browser/ash/login/screens/saml_confirm_password_screen.cc b/chrome/browser/ash/login/screens/saml_confirm_password_screen.cc index 76bb5b2..cb15f9c4 100644 --- a/chrome/browser/ash/login/screens/saml_confirm_password_screen.cc +++ b/chrome/browser/ash/login/screens/saml_confirm_password_screen.cc
@@ -11,7 +11,7 @@ #include "chrome/browser/ash/login/screens/base_screen.h" #include "chrome/browser/ash/login/ui/login_display_host.h" #include "chrome/browser/ui/webui/ash/login/check_passwords_against_cryptohome_helper.h" -#include "chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.h" +#include "chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.h" #include "chromeos/ash/components/login/auth/public/cryptohome_key_constants.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/saml_confirm_password_screen.h b/chrome/browser/ash/login/screens/saml_confirm_password_screen.h index cd94ffc7..e1b4e87 100644 --- a/chrome/browser/ash/login/screens/saml_confirm_password_screen.h +++ b/chrome/browser/ash/login/screens/saml_confirm_password_screen.h
@@ -14,7 +14,7 @@ #include "chromeos/ash/components/login/auth/public/user_context.h" // TODO(https://crbug.com/1164001): move to forward declaration. #include "chrome/browser/ui/webui/ash/login/check_passwords_against_cryptohome_helper.h" -#include "chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.h" +#include "chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.h" #include "components/login/base_screen_handler_utils.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/signin_fatal_error_screen.cc b/chrome/browser/ash/login/screens/signin_fatal_error_screen.cc index 7c1d6b0..16e07e7 100644 --- a/chrome/browser/ash/login/screens/signin_fatal_error_screen.cc +++ b/chrome/browser/ash/login/screens/signin_fatal_error_screen.cc
@@ -6,7 +6,7 @@ #include "base/values.h" #include "chrome/browser/ash/login/ui/login_display_host.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h" namespace ash { namespace {
diff --git a/chrome/browser/ash/login/screens/smart_privacy_protection_screen.cc b/chrome/browser/ash/login/screens/smart_privacy_protection_screen.cc index c52a7003..a9b0366 100644 --- a/chrome/browser/ash/login/screens/smart_privacy_protection_screen.cc +++ b/chrome/browser/ash/login/screens/smart_privacy_protection_screen.cc
@@ -7,7 +7,7 @@ #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/webui/chromeos/login/smart_privacy_protection_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/smart_privacy_protection_screen_handler.h" #include "components/prefs/pref_service.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/smart_privacy_protection_screen.h b/chrome/browser/ash/login/screens/smart_privacy_protection_screen.h index 4d42192f..0f77dce 100644 --- a/chrome/browser/ash/login/screens/smart_privacy_protection_screen.h +++ b/chrome/browser/ash/login/screens/smart_privacy_protection_screen.h
@@ -9,7 +9,7 @@ #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/smart_privacy_protection_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/smart_privacy_protection_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/smart_privacy_protection_screen_browsertest.cc b/chrome/browser/ash/login/screens/smart_privacy_protection_screen_browsertest.cc index b3a13cf..cfb4015 100644 --- a/chrome/browser/ash/login/screens/smart_privacy_protection_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/smart_privacy_protection_screen_browsertest.cc
@@ -14,7 +14,7 @@ #include "chrome/browser/ash/login/test/oobe_screen_waiter.h" #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/webui/chromeos/login/smart_privacy_protection_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/smart_privacy_protection_screen_handler.h" #include "content/public/test/browser_test.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/sync_consent_browsertest.cc b/chrome/browser/ash/login/screens/sync_consent_browsertest.cc index 490714b..63efa28d 100644 --- a/chrome/browser/ash/login/screens/sync_consent_browsertest.cc +++ b/chrome/browser/ash/login/screens/sync_consent_browsertest.cc
@@ -31,9 +31,9 @@ #include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/sync/sync_service_factory.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "chrome/test/base/testing_profile_manager.h"
diff --git a/chrome/browser/ash/login/screens/sync_consent_screen.h b/chrome/browser/ash/login/screens/sync_consent_screen.h index 2710683..b02511c 100644 --- a/chrome/browser/ash/login/screens/sync_consent_screen.h +++ b/chrome/browser/ash/login/screens/sync_consent_screen.h
@@ -15,7 +15,7 @@ #include "base/timer/timer.h" #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.h" #include "components/sync/driver/sync_service.h" #include "components/sync/driver/sync_service_observer.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/ash/login/screens/terms_of_service_screen.cc b/chrome/browser/ash/login/screens/terms_of_service_screen.cc index 7bd5111e..a6a115d 100644 --- a/chrome/browser/ash/login/screens/terms_of_service_screen.cc +++ b/chrome/browser/ash/login/screens/terms_of_service_screen.cc
@@ -26,7 +26,7 @@ #include "chrome/browser/net/system_network_context_manager.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h" #include "chrome/common/pref_names.h" #include "components/prefs/pref_service.h" #include "content/public/browser/storage_partition.h"
diff --git a/chrome/browser/ash/login/screens/terms_of_service_screen.h b/chrome/browser/ash/login/screens/terms_of_service_screen.h index c619ea9e..b7dc3a3 100644 --- a/chrome/browser/ash/login/screens/terms_of_service_screen.h +++ b/chrome/browser/ash/login/screens/terms_of_service_screen.h
@@ -13,7 +13,7 @@ #include "base/timer/timer.h" #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h" namespace network { class SimpleURLLoader;
diff --git a/chrome/browser/ash/login/screens/terms_of_service_screen_browsertest.cc b/chrome/browser/ash/login/screens/terms_of_service_screen_browsertest.cc index 621ec96..d0c22dfb 100644 --- a/chrome/browser/ash/login/screens/terms_of_service_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/terms_of_service_screen_browsertest.cc
@@ -34,8 +34,8 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h" #include "chromeos/ash/components/dbus/session_manager/fake_session_manager_client.h" #include "components/policy/core/common/cloud/test/policy_builder.h" #include "components/policy/proto/chrome_device_policy.pb.h"
diff --git a/chrome/browser/ash/login/screens/theme_selection_screen.cc b/chrome/browser/ash/login/screens/theme_selection_screen.cc index f3d44250..4ec8939 100644 --- a/chrome/browser/ash/login/screens/theme_selection_screen.cc +++ b/chrome/browser/ash/login/screens/theme_selection_screen.cc
@@ -10,7 +10,7 @@ #include "ash/system/scheduled_feature/scheduled_feature.h" #include "chrome/browser/ash/login/screens/base_screen.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/webui/chromeos/login/theme_selection_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/theme_selection_screen_handler.h" #include "components/prefs/pref_service.h" #include "ui/native_theme/native_theme.h"
diff --git a/chrome/browser/ash/login/screens/theme_selection_screen.h b/chrome/browser/ash/login/screens/theme_selection_screen.h index 8ab37a8..56c2aa2d 100644 --- a/chrome/browser/ash/login/screens/theme_selection_screen.h +++ b/chrome/browser/ash/login/screens/theme_selection_screen.h
@@ -11,7 +11,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/theme_selection_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/theme_selection_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/theme_selection_screen_browsertest.cc b/chrome/browser/ash/login/screens/theme_selection_screen_browsertest.cc index fe7b7898..fa6af37 100644 --- a/chrome/browser/ash/login/screens/theme_selection_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/theme_selection_screen_browsertest.cc
@@ -21,10 +21,10 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/webui/ash/login/guest_tos_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/theme_selection_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/theme_selection_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chromeos/constants/chromeos_features.h" #include "content/public/test/browser_test.h"
diff --git a/chrome/browser/ash/login/screens/tpm_error_screen.cc b/chrome/browser/ash/login/screens/tpm_error_screen.cc index 2b3a4e4..d2fa247 100644 --- a/chrome/browser/ash/login/screens/tpm_error_screen.cc +++ b/chrome/browser/ash/login/screens/tpm_error_screen.cc
@@ -5,7 +5,7 @@ #include "chrome/browser/ash/login/screens/tpm_error_screen.h" #include "base/memory/weak_ptr.h" -#include "chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.h" #include "chromeos/dbus/power/power_manager_client.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/tpm_error_screen.h b/chrome/browser/ash/login/screens/tpm_error_screen.h index 43315e5..2638a4d3 100644 --- a/chrome/browser/ash/login/screens/tpm_error_screen.h +++ b/chrome/browser/ash/login/screens/tpm_error_screen.h
@@ -8,7 +8,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration -#include "chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/update_required_screen.cc b/chrome/browser/ash/login/screens/update_required_screen.cc index 77b5d61..bb4a8d9 100644 --- a/chrome/browser/ash/login/screens/update_required_screen.cc +++ b/chrome/browser/ash/login/screens/update_required_screen.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" -#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_required_screen_handler.h" #include "chromeos/ash/components/network/network_handler.h" #include "chromeos/ash/components/settings/cros_settings_names.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/ash/login/screens/update_required_screen.h b/chrome/browser/ash/login/screens/update_required_screen.h index acf2d3ac..80036db 100644 --- a/chrome/browser/ash/login/screens/update_required_screen.h +++ b/chrome/browser/ash/login/screens/update_required_screen.h
@@ -21,7 +21,7 @@ #include "chrome/browser/ash/login/screens/error_screen.h" #include "chrome/browser/ash/login/version_updater/version_updater.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_required_screen_handler.h" #include "components/user_manager/remove_user_delegate.h" namespace base {
diff --git a/chrome/browser/ash/login/screens/update_required_screen_browsertest.cc b/chrome/browser/ash/login/screens/update_required_screen_browsertest.cc index 6991159b5..6cc3be1 100644 --- a/chrome/browser/ash/login/screens/update_required_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/update_required_screen_browsertest.cc
@@ -29,7 +29,7 @@ #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_required_screen_handler.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "chromeos/ash/components/dbus/dbus_thread_manager.h"
diff --git a/chrome/browser/ash/login/screens/update_screen.cc b/chrome/browser/ash/login/screens/update_screen.cc index 454c6d45..0f01a5d3 100644 --- a/chrome/browser/ash/login/screens/update_screen.cc +++ b/chrome/browser/ash/login/screens/update_screen.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/ash/login/wizard_context.h" #include "chrome/browser/ash/system/timezone_util.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h"
diff --git a/chrome/browser/ash/login/screens/update_screen.h b/chrome/browser/ash/login/screens/update_screen.h index bf0829a..8309b63 100644 --- a/chrome/browser/ash/login/screens/update_screen.h +++ b/chrome/browser/ash/login/screens/update_screen.h
@@ -24,7 +24,7 @@ // TODO(https://crbug.com/1164001): move to forward declaration. #include "chrome/browser/ash/login/wizard_context.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h" #include "chromeos/dbus/power/power_manager_client.h" namespace base {
diff --git a/chrome/browser/ash/login/screens/update_screen_browsertest.cc b/chrome/browser/ash/login/screens/update_screen_browsertest.cc index 9123a819..aadd672 100644 --- a/chrome/browser/ash/login/screens/update_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/update_screen_browsertest.cc
@@ -27,9 +27,9 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h"
diff --git a/chrome/browser/ash/login/screens/user_creation_screen.cc b/chrome/browser/ash/login/screens/user_creation_screen.cc index 97d3f7b4..1f2272b 100644 --- a/chrome/browser/ash/login/screens/user_creation_screen.cc +++ b/chrome/browser/ash/login/screens/user_creation_screen.cc
@@ -12,7 +12,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chromeos/ash/components/network/network_state.h" #include "chromeos/ash/components/network/network_state_handler.h"
diff --git a/chrome/browser/ash/login/screens/user_creation_screen.h b/chrome/browser/ash/login/screens/user_creation_screen.h index 9be34da..92ba2b2d 100644 --- a/chrome/browser/ash/login/screens/user_creation_screen.h +++ b/chrome/browser/ash/login/screens/user_creation_screen.h
@@ -11,9 +11,9 @@ #include "chrome/browser/ash/login/error_screens_histogram_helper.h" #include "chrome/browser/ash/login/screens/base_screen.h" #include "chrome/browser/ash/login/screens/error_screen.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/user_creation_screen_browsertest.cc b/chrome/browser/ash/login/screens/user_creation_screen_browsertest.cc index b68a1c7..10d999f 100644 --- a/chrome/browser/ash/login/screens/user_creation_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/user_creation_screen_browsertest.cc
@@ -19,8 +19,8 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/offline_login_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "content/public/test/browser_test.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/user_selection_screen_browsertest.cc b/chrome/browser/ash/login/screens/user_selection_screen_browsertest.cc index 2dce2e3..3f6b229 100644 --- a/chrome/browser/ash/login/screens/user_selection_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/user_selection_screen_browsertest.cc
@@ -28,8 +28,8 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chromeos/ash/components/cryptohome/cryptohome_parameters.h" #include "chromeos/ash/components/dbus/userdataauth/fake_userdataauth_client.h" #include "chromeos/constants/chromeos_features.h"
diff --git a/chrome/browser/ash/login/screens/welcome_screen.cc b/chrome/browser/ash/login/screens/welcome_screen.cc index 281ea359..2d9e687 100644 --- a/chrome/browser/ash/login/screens/welcome_screen.cc +++ b/chrome/browser/ash/login/screens/welcome_screen.cc
@@ -36,7 +36,7 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/ash/login_screen_client_impl.h" #include "chrome/browser/ui/webui/ash/login/l10n_util.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h"
diff --git a/chrome/browser/ash/login/screens/welcome_screen.h b/chrome/browser/ash/login/screens/welcome_screen.h index 74bd9fcf..0d7f088 100644 --- a/chrome/browser/ash/login/screens/welcome_screen.h +++ b/chrome/browser/ash/login/screens/welcome_screen.h
@@ -25,7 +25,7 @@ #include "chrome/browser/ash/login/ui/input_events_blocker.h" #include "chrome/browser/ash/login/wizard_context.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "ui/base/ime/ash/input_method_manager.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/welcome_screen_browsertest.cc b/chrome/browser/ash/login/screens/welcome_screen_browsertest.cc index 73f23408..993f789b 100644 --- a/chrome/browser/ash/login/screens/welcome_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/welcome_screen_browsertest.cc
@@ -36,7 +36,7 @@ #include "chrome/browser/ui/webui/ash/login/enable_debugging_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/interactive_test_utils.h" #include "chromeos/dbus/constants/dbus_switches.h"
diff --git a/chrome/browser/ash/login/screens/wrong_hwid_screen.cc b/chrome/browser/ash/login/screens/wrong_hwid_screen.cc index 790a6541..2d14ad3 100644 --- a/chrome/browser/ash/login/screens/wrong_hwid_screen.cc +++ b/chrome/browser/ash/login/screens/wrong_hwid_screen.cc
@@ -5,7 +5,7 @@ #include "chrome/browser/ash/login/screens/wrong_hwid_screen.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/wizard_controller.h" -#include "chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.h" namespace ash { namespace {
diff --git a/chrome/browser/ash/login/screens/wrong_hwid_screen.h b/chrome/browser/ash/login/screens/wrong_hwid_screen.h index d34f9625..8dbcdf9 100644 --- a/chrome/browser/ash/login/screens/wrong_hwid_screen.h +++ b/chrome/browser/ash/login/screens/wrong_hwid_screen.h
@@ -9,7 +9,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/wrong_hwid_screen_browsertest.cc b/chrome/browser/ash/login/screens/wrong_hwid_screen_browsertest.cc index 7312fb6..1d5dd17 100644 --- a/chrome/browser/ash/login/screens/wrong_hwid_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/wrong_hwid_screen_browsertest.cc
@@ -10,7 +10,7 @@ #include "chrome/browser/ash/login/test/oobe_base_test.h" #include "chrome/browser/ash/login/test/oobe_screen_exit_waiter.h" #include "chrome/browser/ash/login/test/oobe_screen_waiter.h" -#include "chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.h" #include "content/public/test/browser_test.h" namespace ash {
diff --git a/chrome/browser/ash/login/session_login_browsertest.cc b/chrome/browser/ash/login/session_login_browsertest.cc index 0033db6..ac2e189 100644 --- a/chrome/browser/ash/login/session_login_browsertest.cc +++ b/chrome/browser/ash/login/session_login_browsertest.cc
@@ -28,7 +28,7 @@ #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/view_ids.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/common/chrome_switches.h" #include "components/session_manager/core/session_manager.h" #include "components/user_manager/known_user.h"
diff --git a/chrome/browser/ash/login/signin/oauth2_browsertest.cc b/chrome/browser/ash/login/signin/oauth2_browsertest.cc index 4f9889cf..da70283 100644 --- a/chrome/browser/ash/login/signin/oauth2_browsertest.cc +++ b/chrome/browser/ash/login/signin/oauth2_browsertest.cc
@@ -40,7 +40,7 @@ #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/ui_test_utils.h"
diff --git a/chrome/browser/ash/login/test/active_directory_login_mixin.cc b/chrome/browser/ash/login/test/active_directory_login_mixin.cc index 3d9aba7..8e84a044 100644 --- a/chrome/browser/ash/login/test/active_directory_login_mixin.cc +++ b/chrome/browser/ash/login/test/active_directory_login_mixin.cc
@@ -15,7 +15,7 @@ #include "chrome/browser/ui/webui/ash/login/active_directory_login_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/active_directory_password_change_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chromeos/ash/components/dbus/authpolicy/fake_authpolicy_client.h" #include "content/public/test/browser_test_utils.h"
diff --git a/chrome/browser/ash/login/test/oobe_base_test.cc b/chrome/browser/ash/login/test/oobe_base_test.cc index d9495b1..d2dbf83 100644 --- a/chrome/browser/ash/login/test/oobe_base_test.cc +++ b/chrome/browser/ash/login/test/oobe_base_test.cc
@@ -30,9 +30,9 @@ #include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/browser/ui/webui/signin/signin_utils.h" #include "chrome/common/chrome_switches.h" #include "chromeos/ash/components/dbus/dbus_thread_manager.h"
diff --git a/chrome/browser/ash/login/test/oobe_screens_utils.cc b/chrome/browser/ash/login/test/oobe_screens_utils.cc index 4e3a901..6a2a571 100644 --- a/chrome/browser/ash/login/test/oobe_screens_utils.cc +++ b/chrome/browser/ash/login/test/oobe_screens_utils.cc
@@ -19,12 +19,12 @@ #include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/fingerprint_setup_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/guest_tos_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/web_contents.h" #include "content/public/test/browser_test_utils.h"
diff --git a/chrome/browser/ash/login/ui/login_display_host_common.cc b/chrome/browser/ash/login/ui/login_display_host_common.cc index 5539372..e01ddcf 100644 --- a/chrome/browser/ash/login/ui/login_display_host_common.cc +++ b/chrome/browser/ash/login/ui/login_display_host_common.cc
@@ -39,12 +39,12 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/webui/ash/diagnostics_dialog.h" #include "chrome/browser/ui/webui/ash/login/locale_switch_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/management_transition_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "components/keep_alive_registry/keep_alive_types.h"
diff --git a/chrome/browser/ash/login/ui/login_display_host_mojo.cc b/chrome/browser/ash/login/ui/login_display_host_mojo.cc index 4a7aca5..60cce868 100644 --- a/chrome/browser/ash/login/ui/login_display_host_mojo.cc +++ b/chrome/browser/ash/login/ui/login_display_host_mojo.cc
@@ -44,8 +44,8 @@ #include "chrome/browser/ui/webui/ash/login/gaia_password_changed_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/lacros_data_migration_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/common/channel_info.h" #include "chromeos/ash/components/login/auth/public/user_context.h" #include "components/startup_metric_utils/browser/startup_metric_utils.h"
diff --git a/chrome/browser/ash/login/ui/login_display_host_webui.cc b/chrome/browser/ash/login/ui/login_display_host_webui.cc index 7410697..408089c 100644 --- a/chrome/browser/ash/login/ui/login_display_host_webui.cc +++ b/chrome/browser/ash/login/ui/login_display_host_webui.cc
@@ -69,8 +69,8 @@ #include "chrome/browser/ui/webui/ash/login/lacros_data_backward_migration_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/lacros_data_migration_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h"
diff --git a/chrome/browser/ash/login/ui/login_display_mojo.cc b/chrome/browser/ash/login/ui/login_display_mojo.cc index 65b745d..afea64a 100644 --- a/chrome/browser/ash/login/ui/login_display_mojo.cc +++ b/chrome/browser/ash/login/ui/login_display_mojo.cc
@@ -20,7 +20,7 @@ #include "chrome/browser/ui/webui/ash/login/enable_adb_sideloading_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/enable_debugging_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/kiosk_autolaunch_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" #include "chrome/common/pref_names.h" #include "chromeos/ash/components/dbus/session_manager/session_manager_client.h" #include "components/session_manager/core/session_manager.h"
diff --git a/chrome/browser/ash/login/ui/mock_login_display_host.h b/chrome/browser/ash/login/ui/mock_login_display_host.h index f04a16c..75c38e15 100644 --- a/chrome/browser/ash/login/ui/mock_login_display_host.h +++ b/chrome/browser/ash/login/ui/mock_login_display_host.h
@@ -14,7 +14,7 @@ // TODO(https://crbug.com/1164001): move to forward declaration #include "chrome/browser/ash/login/oobe_quick_start/target_device_bootstrap_controller.h" #include "chrome/browser/ash/login/ui/webui_login_view.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "components/user_manager/user_type.h" #include "testing/gmock/include/gmock/gmock.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ash/login/webview_login_browsertest.cc b/chrome/browser/ash/login/webview_login_browsertest.cc index a24649a..8493b23 100644 --- a/chrome/browser/ash/login/webview_login_browsertest.cc +++ b/chrome/browser/ash/login/webview_login_browsertest.cc
@@ -66,8 +66,8 @@ #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/browser/ui/webui/signin/signin_utils.h" #include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" @@ -1999,7 +1999,13 @@ &mixin_host_, DeviceStateMixin::State::OOBE_COMPLETED_CLOUD_ENROLLED}; }; -IN_PROC_BROWSER_TEST_F(WebviewProxyAuthLoginTest, ProxyAuthTransfer) { +// TODO(crbug.com/1377241): The test times out on ASAN. +#if defined(ADDRESS_SANITIZER) +#define MAYBE_ProxyAuthTransfer DISABLED_ProxyAuthTransfer +#else +#define MAYBE_ProxyAuthTransfer ProxyAuthTransfer +#endif +IN_PROC_BROWSER_TEST_F(WebviewProxyAuthLoginTest, MAYBE_ProxyAuthTransfer) { WaitForSigninScreen(); LoginHandler* login_handler = WaitForAuthRequested();
diff --git a/chrome/browser/ash/login/wizard_controller.cc b/chrome/browser/ash/login/wizard_controller.cc index fefd81b..6b124ea 100644 --- a/chrome/browser/ash/login/wizard_controller.cc +++ b/chrome/browser/ash/login/wizard_controller.cc
@@ -155,32 +155,32 @@ #include "chrome/browser/ui/webui/ash/login/lacros_data_migration_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/local_state_error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/locale_switch_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/management_transition_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/multidevice_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/offline_login_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/multidevice_setup_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/packaged_license_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/quick_start_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/smart_privacy_protection_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/theme_selection_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_install_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_trial_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/packaged_license_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/parental_handoff_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/smart_privacy_protection_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/theme_selection_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_required_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.h" #include "chrome/browser/ui/webui/help/help_utils_chromeos.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/pref_names.h"
diff --git a/chrome/browser/ash/login/wizard_controller_browsertest.cc b/chrome/browser/ash/login/wizard_controller_browsertest.cc index f7d5aff..a094addd 100644 --- a/chrome/browser/ash/login/wizard_controller_browsertest.cc +++ b/chrome/browser/ash/login/wizard_controller_browsertest.cc
@@ -81,9 +81,9 @@ #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/local_state_error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_required_screen_handler.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h"
diff --git a/chrome/browser/ash/note_taking_helper.cc b/chrome/browser/ash/note_taking_helper.cc index 49c94df..c9b2bb4 100644 --- a/chrome/browser/ash/note_taking_helper.cc +++ b/chrome/browser/ash/note_taking_helper.cc
@@ -215,16 +215,9 @@ // Apps in 'kDefaultAllowedAppIds' might not have a note-taking intent filter. // They can just launch without the intent. if (has_note_taking_intent_filter) { - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - apps::AppServiceProxyFactory::GetForProfile(profile)->LaunchAppWithIntent( - app_id, ui::EF_NONE, apps_util::CreateCreateNoteIntent(), - apps::LaunchSource::kFromShelf, nullptr, base::DoNothing()); - } else { - apps::AppServiceProxyFactory::GetForProfile(profile)->LaunchAppWithIntent( - app_id, ui::EF_NONE, - apps::ConvertIntentToMojomIntent(apps_util::CreateCreateNoteIntent()), - apps::mojom::LaunchSource::kFromShelf, nullptr, {}); - } + apps::AppServiceProxyFactory::GetForProfile(profile)->LaunchAppWithIntent( + app_id, ui::EF_NONE, apps_util::CreateCreateNoteIntent(), + apps::LaunchSource::kFromShelf, nullptr, base::DoNothing()); } else { if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { apps::AppServiceProxyFactory::GetForProfile(profile)->Launch(
diff --git a/chrome/browser/ash/policy/core/device_local_account_browsertest.cc b/chrome/browser/ash/policy/core/device_local_account_browsertest.cc index 540fd19..6298db7 100644 --- a/chrome/browser/ash/policy/core/device_local_account_browsertest.cc +++ b/chrome/browser/ash/policy/core/device_local_account_browsertest.cc
@@ -92,7 +92,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h" #include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension_constants.h"
diff --git a/chrome/browser/ash/policy/enrollment/enrollment_config.h b/chrome/browser/ash/policy/enrollment/enrollment_config.h index 22141bf..567428e 100644 --- a/chrome/browser/ash/policy/enrollment/enrollment_config.h +++ b/chrome/browser/ash/policy/enrollment/enrollment_config.h
@@ -174,6 +174,12 @@ mode == MODE_ATTESTATION_INITIAL_SERVER_FORCED; } + // Whether this configuration is in initial attestation forced mode per server + // request. + bool is_mode_initial_attestation_server_forced() const { + return mode == MODE_ATTESTATION_INITIAL_SERVER_FORCED; + } + // Whether this configuration is in attestation mode per client request. bool is_mode_attestation_client() const { return mode == MODE_ATTESTATION || mode == MODE_ATTESTATION_LOCAL_FORCED ||
diff --git a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_browsertest.cc b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_browsertest.cc index 95748bd..b4cfeb6 100644 --- a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_browsertest.cc +++ b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_browsertest.cc
@@ -49,7 +49,7 @@ #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/webui/ash/login/app_launch_splash_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_required_screen_handler.h" #include "chrome/browser/upgrade_detector/upgrade_detector.h" #include "chrome/common/pref_names.h" #include "chromeos/ash/components/dbus/shill/shill_service_client.h"
diff --git a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_delegate_impl.cc b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_delegate_impl.cc index 36867767..0ed0c05 100644 --- a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_delegate_impl.cc +++ b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_delegate_impl.cc
@@ -19,7 +19,7 @@ #include "chrome/browser/policy/profile_policy_connector.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_required_screen_handler.h" #include "components/session_manager/core/session_manager.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/ash/policy/login/blocking_login_browsertest.cc b/chrome/browser/ash/policy/login/blocking_login_browsertest.cc index 21dded3..ff78333 100644 --- a/chrome/browser/ash/policy/login/blocking_login_browsertest.cc +++ b/chrome/browser/ash/policy/login/blocking_login_browsertest.cc
@@ -17,7 +17,7 @@ #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/in_process_browser_test.h" #include "chromeos/ash/components/install_attributes/install_attributes.h"
diff --git a/chrome/browser/ash/policy/login/device_login_screen_policy_browsertest.cc b/chrome/browser/ash/policy/login/device_login_screen_policy_browsertest.cc index 45d2ca4..099834f 100644 --- a/chrome/browser/ash/policy/login/device_login_screen_policy_browsertest.cc +++ b/chrome/browser/ash/policy/login/device_login_screen_policy_browsertest.cc
@@ -28,7 +28,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" #include "chrome/common/pref_names.h" #include "components/policy/core/common/policy_types.h" #include "components/policy/proto/chrome_device_policy.pb.h"
diff --git a/chrome/browser/ash/policy/login/login_policy_test_base.cc b/chrome/browser/ash/policy/login/login_policy_test_base.cc index ce9b514f..2a9a81f 100644 --- a/chrome/browser/ash/policy/login/login_policy_test_base.cc +++ b/chrome/browser/ash/policy/login/login_policy_test_base.cc
@@ -16,7 +16,7 @@ #include "chrome/browser/ash/policy/core/user_policy_test_helper.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chromeos/ash/components/login/auth/public/user_context.h" #include "components/policy/proto/cloud_policy.pb.h" #include "google_apis/gaia/fake_gaia.h"
diff --git a/chrome/browser/ash/policy/networking/policy_certs_browsertest.cc b/chrome/browser/ash/policy/networking/policy_certs_browsertest.cc index 4f1b048c..31d8110 100644 --- a/chrome/browser/ash/policy/networking/policy_certs_browsertest.cc +++ b/chrome/browser/ash/policy/networking/policy_certs_browsertest.cc
@@ -45,7 +45,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/in_process_browser_test.h" #include "chromeos/ash/components/network/network_cert_loader.h"
diff --git a/chrome/browser/ash/printing/history/print_job_reporting_service_impl.cc b/chrome/browser/ash/printing/history/print_job_reporting_service_impl.cc index a0128b2e..ba36f78 100644 --- a/chrome/browser/ash/printing/history/print_job_reporting_service_impl.cc +++ b/chrome/browser/ash/printing/history/print_job_reporting_service_impl.cc
@@ -23,8 +23,8 @@ #include "components/reporting/client/report_queue.h" #include "components/reporting/client/report_queue_factory.h" #include "components/reporting/proto/synced/record_constants.pb.h" +#include "components/reporting/proto/synced/status.pb.h" #include "components/reporting/util/status.h" -#include "components/reporting/util/status.pb.h" #include "components/user_manager/user_manager.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/ash/system/device_disabling_browsertest.cc b/chrome/browser/ash/system/device_disabling_browsertest.cc index 0ac92c6..1e28054 100644 --- a/chrome/browser/ash/system/device_disabling_browsertest.cc +++ b/chrome/browser/ash/system/device_disabling_browsertest.cc
@@ -28,9 +28,9 @@ #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/ui/webui/ash/login/device_disabled_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chromeos/ash/components/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/ash/components/dbus/shill/fake_shill_manager_client.h" #include "chromeos/ash/components/dbus/shill/shill_manager_client.h"
diff --git a/chrome/browser/ash/system_web_apps/system_web_app_manager.cc b/chrome/browser/ash/system_web_apps/system_web_app_manager.cc index 814febf..d75032a4 100644 --- a/chrome/browser/ash/system_web_apps/system_web_app_manager.cc +++ b/chrome/browser/ash/system_web_apps/system_web_app_manager.cc
@@ -4,7 +4,6 @@ #include "chrome/browser/ash/system_web_apps/system_web_app_manager.h" -#include <algorithm> #include <iterator> #include <memory> #include <ostream> @@ -30,6 +29,7 @@ #include "base/memory/scoped_refptr.h" #include "base/metrics/histogram_functions.h" #include "base/one_shot_event.h" +#include "base/ranges/algorithm.h" #include "base/run_loop.h" #include "base/strings/string_piece_forward.h" #include "base/task/single_thread_task_runner.h" @@ -567,12 +567,13 @@ // the install success rate. std::map<GURL, web_app::ExternallyManagedAppManager::InstallResult> results_to_report; - std::copy_if(install_results.begin(), install_results.end(), - std::inserter(results_to_report, results_to_report.end()), - [](const auto& url_and_result) { - return url_and_result.second.code != - webapps::InstallResultCode::kSuccessAlreadyInstalled; - }); + base::ranges::copy_if( + install_results, + std::inserter(results_to_report, results_to_report.end()), + [](const auto& url_and_result) { + return url_and_result.second.code != + webapps::InstallResultCode::kSuccessAlreadyInstalled; + }); for (const auto& url_and_result : results_to_report) { // Record aggregate result.
diff --git a/chrome/browser/ash/tether/tether_service.h b/chrome/browser/ash/tether/tether_service.h index eb7750ec..54a7b99b 100644 --- a/chrome/browser/ash/tether/tether_service.h +++ b/chrome/browser/ash/tether/tether_service.h
@@ -7,7 +7,6 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/gtest_prod_util.h" #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" @@ -16,6 +15,7 @@ #include "chromeos/ash/components/network/network_state_handler_observer.h" #include "chromeos/ash/components/tether/tether_component.h" #include "chromeos/ash/components/tether/tether_host_fetcher.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/multidevice_setup_client.h" #include "chromeos/dbus/power/power_manager_client.h" #include "components/keyed_service/core/keyed_service.h"
diff --git a/chrome/browser/ash/tether/tether_service_unittest.cc b/chrome/browser/ash/tether/tether_service_unittest.cc index 0a842f2..0ff88b30 100644 --- a/chrome/browser/ash/tether/tether_service_unittest.cc +++ b/chrome/browser/ash/tether/tether_service_unittest.cc
@@ -12,8 +12,6 @@ #include "ash/services/device_sync/cryptauth_enrollment_manager.h" #include "ash/services/device_sync/fake_cryptauth_enrollment_manager.h" #include "ash/services/device_sync/fake_remote_device_provider.h" -#include "ash/services/device_sync/public/cpp/device_sync_client_impl.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "ash/services/device_sync/remote_device_provider_impl.h" #include "base/bind.h" #include "base/command_line.h" @@ -44,6 +42,8 @@ #include "chromeos/ash/components/tether/fake_tether_host_fetcher.h" #include "chromeos/ash/components/tether/tether_component_impl.h" #include "chromeos/ash/components/tether/tether_host_fetcher_impl.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/multidevice_setup_client_impl.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/prefs.h"
diff --git a/chrome/browser/ash/web_applications/media_app/chrome_media_app_ui_delegate.cc b/chrome/browser/ash/web_applications/media_app/chrome_media_app_ui_delegate.cc index 22dd924..d9c3044 100644 --- a/chrome/browser/ash/web_applications/media_app/chrome_media_app_ui_delegate.cc +++ b/chrome/browser/ash/web_applications/media_app/chrome_media_app_ui_delegate.cc
@@ -27,7 +27,6 @@ #include "chrome/browser/ui/chrome_pages.h" #include "chrome/common/channel_info.h" #include "components/services/app_service/public/cpp/app_launch_util.h" -#include "components/services/app_service/public/cpp/features.h" #include "components/services/app_service/public/cpp/intent.h" #include "components/services/app_service/public/cpp/intent_util.h" #include "components/version_info/channel.h" @@ -173,34 +172,17 @@ intent->extras = { std::make_pair(kPhotosKeepOpenExtraName, kPhotosKeepOpenExtraValue)}; - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - proxy->LaunchAppWithIntent( - arc::kGooglePhotosAppId, ui::EF_NONE, std::move(intent), - apps::LaunchSource::kFromOtherApp, nullptr, - base::BindOnce( - [](base::OnceCallback<void()> callback, - base::WeakPtr<content::WebContents> web_contents, - apps::LaunchResult&& result) { - if (result.state == apps::State::SUCCESS && web_contents) { - web_contents->Close(); - } - std::move(callback).Run(); - }, - std::move(edit_in_photos_callback), web_contents->GetWeakPtr())); - } else { - proxy->LaunchAppWithIntent( - arc::kGooglePhotosAppId, ui::EF_NONE, - apps::ConvertIntentToMojomIntent(intent), - apps::mojom::LaunchSource::kFromOtherApp, nullptr, - base::BindOnce( - [](base::OnceCallback<void()> callback, - base::WeakPtr<content::WebContents> web_contents, - bool launch_success) { - if (launch_success && web_contents) { - web_contents->Close(); - } - std::move(callback).Run(); - }, - std::move(edit_in_photos_callback), web_contents->GetWeakPtr())); - } + proxy->LaunchAppWithIntent( + arc::kGooglePhotosAppId, ui::EF_NONE, std::move(intent), + apps::LaunchSource::kFromOtherApp, nullptr, + base::BindOnce( + [](base::OnceCallback<void()> callback, + base::WeakPtr<content::WebContents> web_contents, + apps::LaunchResult&& result) { + if (result.state == apps::State::SUCCESS && web_contents) { + web_contents->Close(); + } + std::move(callback).Run(); + }, + std::move(edit_in_photos_callback), web_contents->GetWeakPtr())); }
diff --git a/chrome/browser/captive_portal/captive_portal_browsertest.cc b/chrome/browser/captive_portal/captive_portal_browsertest.cc index 85375ffb1..6f97ccb 100644 --- a/chrome/browser/captive_portal/captive_portal_browsertest.cc +++ b/chrome/browser/captive_portal/captive_portal_browsertest.cc
@@ -340,12 +340,10 @@ : waiting_for_navigation_(false) { registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, content::NotificationService::AllSources()); - std::copy_if( - AllTabContentses().begin(), AllTabContentses().end(), + base::ranges::copy_if( + AllTabContentses(), std::inserter(tabs_needing_navigation_, tabs_needing_navigation_.end()), - [](content::WebContents* web_contents) { - return web_contents->IsLoading(); - }); + &content::WebContents::IsLoading); } FailLoadsAfterLoginObserver::~FailLoadsAfterLoginObserver() {
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index ff5f542c..9f170ca3 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -91,7 +91,6 @@ "//ash/quick_pair/proto:fastpair_proto", "//ash/services/device_sync", "//ash/services/device_sync:stub_device_sync", - "//ash/services/device_sync/public/cpp", "//ash/webui/camera_app_ui", "//ash/webui/camera_app_ui:document_scanning", "//ash/webui/connectivity_diagnostics", @@ -315,6 +314,7 @@ "//chromeos/ash/services/cros_healthd/private/cpp", "//chromeos/ash/services/cros_healthd/public/cpp", "//chromeos/ash/services/cros_healthd/public/mojom", + "//chromeos/ash/services/device_sync/public/cpp", "//chromeos/ash/services/ime:constants", "//chromeos/ash/services/ime/public/cpp:structs", "//chromeos/ash/services/ime/public/mojom", @@ -442,11 +442,11 @@ "//components/reporting/proto:interface_proto", "//components/reporting/proto:metric_data_proto", "//components/reporting/proto:record_constants", + "//components/reporting/proto:status_proto", "//components/reporting/storage:storage_module", "//components/reporting/storage_selector", "//components/reporting/util:backoff_settings", "//components/reporting/util:status", - "//components/reporting/util:status_proto", "//components/reporting/util:task_runner_context", "//components/rlz", "//components/safe_browsing/core/browser/db:metadata_proto", @@ -882,6 +882,7 @@ "../ash/dbus/org.chromium.MojoConnectionService.conf", "../ash/dbus/org.chromium.NetworkProxyService.conf", "../ash/dbus/org.chromium.PrintersService.conf", + "../ash/dbus/org.chromium.ProfilerStatusService.conf", "../ash/dbus/org.chromium.ScreenLockService.conf", "../ash/dbus/org.chromium.SmbFsService.conf", "../ash/dbus/org.chromium.VirtualFileRequestService.conf", @@ -2001,11 +2002,11 @@ # builds as well. "../ui/views/frame/immersive_mode_controller_chromeos_unittest.cc", "../ui/views/select_file_dialog_extension_unittest.cc", - "../ui/webui/ash/login/oobe_display_chooser_unittest.cc", "../ui/webui/ash/login/l10n_util_test_util.cc", "../ui/webui/ash/login/l10n_util_test_util.h", "../ui/webui/ash/login/l10n_util_unittest.cc", - "../ui/webui/chromeos/login/signin_userlist_unittest.cc", + "../ui/webui/ash/login/oobe_display_chooser_unittest.cc", + "../ui/webui/ash/login/signin_userlist_unittest.cc", "../ui/webui/settings/about_handler_unittest.cc", "../ui/webui/settings/ash/bluetooth_handler_unittest.cc", "../ui/webui/settings/ash/calculator/size_calculator_test_api.h", @@ -2054,7 +2055,6 @@ "//ash/quick_pair/proto:fastpair_proto", "//ash/quick_pair/repository:test_support", "//ash/services/device_sync:test_support", - "//ash/services/device_sync/public/cpp:test_support", "//ash/webui/eche_app_ui:test_support", "//base", "//build:chromeos_buildflags", @@ -2113,6 +2113,7 @@ "//chromeos/ash/components/sync_wifi:test_support", "//chromeos/ash/components/tether:test_support", "//chromeos/ash/components/tpm", + "//chromeos/ash/services/device_sync/public/cpp:test_support", "//chromeos/ash/services/multidevice_setup/public/cpp:prefs", "//chromeos/ash/services/multidevice_setup/public/cpp:test_support", "//chromeos/ash/services/nearby/public/cpp:test_support",
diff --git a/chrome/browser/chromeos/arc/start_smart_selection_action_menu.cc b/chrome/browser/chromeos/arc/start_smart_selection_action_menu.cc index 50df6cd8..af5cc46 100644 --- a/chrome/browser/chromeos/arc/start_smart_selection_action_menu.cc +++ b/chrome/browser/chromeos/arc/start_smart_selection_action_menu.cc
@@ -24,7 +24,6 @@ #include "components/arc/common/intent_helper/arc_intent_helper_package.h" #include "components/renderer_context_menu/render_view_context_menu_proxy.h" #include "components/services/app_service/public/cpp/app_launch_util.h" -#include "components/services/app_service/public/cpp/features.h" #include "components/services/app_service/public/cpp/intent.h" #include "content/public/browser/context_menu_params.h" #include "ui/base/layout.h" @@ -163,22 +162,12 @@ return; } // The app that this intent points to is able to handle it, launch it. - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - apps::AppServiceProxyFactory::GetForProfile(profile)->LaunchAppWithIntent( - actions_[index].app_id, ui::EF_NONE, - CreateIntent(std::move(actions_[index].action_intent), - std::move(actions_[index].activity)), - apps::LaunchSource::kFromSmartTextContextMenu, - std::make_unique<apps::WindowInfo>(display.id()), base::DoNothing()); - } else { - apps::AppServiceProxyFactory::GetForProfile(profile)->LaunchAppWithIntent( - actions_[index].app_id, ui::EF_NONE, - apps::ConvertIntentToMojomIntent( - CreateIntent(std::move(actions_[index].action_intent), - std::move(actions_[index].activity))), - apps::mojom::LaunchSource::kFromSmartTextContextMenu, - apps::MakeWindowInfo(display.id()), {}); - } + apps::AppServiceProxyFactory::GetForProfile(profile)->LaunchAppWithIntent( + actions_[index].app_id, ui::EF_NONE, + CreateIntent(std::move(actions_[index].action_intent), + std::move(actions_[index].activity)), + apps::LaunchSource::kFromSmartTextContextMenu, + std::make_unique<apps::WindowInfo>(display.id()), base::DoNothing()); } void StartSmartSelectionActionMenu::HandleTextSelectionActions(
diff --git a/chrome/browser/component_updater/pki_metadata_component_installer_unittest.cc b/chrome/browser/component_updater/pki_metadata_component_installer_unittest.cc index b576948..3fbc6f0a 100644 --- a/chrome/browser/component_updater/pki_metadata_component_installer_unittest.cc +++ b/chrome/browser/component_updater/pki_metadata_component_installer_unittest.cc
@@ -21,7 +21,9 @@ #include "components/component_updater/mock_component_updater_service.h" #include "content/public/browser/network_service_instance.h" #include "content/public/test/browser_task_environment.h" +#include "net/base/features.h" #include "net/http/transport_security_state.h" +#include "net/net_buildflags.h" #include "services/network/network_service.h" #include "services/network/public/mojom/ct_log_info.mojom.h" #include "services/network/sct_auditing/sct_auditing_cache.h" @@ -523,6 +525,17 @@ class PKIMetadataComponentInstallerDisabledTest : public PKIMetadataComponentInstallerTest { void SetUp() override { +#if BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) + if (base::FeatureList::IsEnabled(net::features::kChromeRootStoreUsed)) { + // If ChromeRootStoreUsed feature is enabled by default, PKI metadata + // component will always be registered. It is not safe to change the + // kChromeRootStoreUsed flag in unit_tests since multiple tests run in + // the same process, and GetChromeCertVerifierServiceParams will + // globally enforce a single configuration for the lifetime of the + // process. Therefore just skip this test if CRS is enabled. + GTEST_SKIP(); + } +#endif scoped_feature_list_.InitWithFeatures( /* enabled_features = */ {}, /* disabled_features = */ {certificate_transparency::features::
diff --git a/chrome/browser/devtools/global_confirm_info_bar.cc b/chrome/browser/devtools/global_confirm_info_bar.cc index 5ec6112..dfa5bda 100644 --- a/chrome/browser/devtools/global_confirm_info_bar.cc +++ b/chrome/browser/devtools/global_confirm_info_bar.cc
@@ -41,6 +41,7 @@ bool Accept() override; bool Cancel() override; bool IsCloseable() const override; + bool ShouldAnimate() const override; infobars::InfoBar* info_bar_ = nullptr; base::WeakPtr<GlobalConfirmInfoBar> global_info_bar_; @@ -73,6 +74,11 @@ : ConfirmInfoBarDelegate::IsCloseable(); } +bool GlobalConfirmInfoBar::DelegateProxy::ShouldAnimate() const { + return global_info_bar_ ? global_info_bar_->delegate_->ShouldAnimate() + : ConfirmInfoBarDelegate::ShouldAnimate(); +} + bool GlobalConfirmInfoBar::DelegateProxy::LinkClicked( WindowOpenDisposition disposition) { return global_info_bar_
diff --git a/chrome/browser/devtools/global_confirm_info_bar_browsertest.cc b/chrome/browser/devtools/global_confirm_info_bar_browsertest.cc index 9de243ec..f8f697f 100644 --- a/chrome/browser/devtools/global_confirm_info_bar_browsertest.cc +++ b/chrome/browser/devtools/global_confirm_info_bar_browsertest.cc
@@ -35,33 +35,31 @@ } }; -class NonCloseableTestConfirmInfoBarDelegate - : public TestConfirmInfoBarDelegate { +class NonDefaultTestConfirmInfoBarDelegate : public TestConfirmInfoBarDelegate { public: - NonCloseableTestConfirmInfoBarDelegate() = default; + NonDefaultTestConfirmInfoBarDelegate() = default; - NonCloseableTestConfirmInfoBarDelegate( - const NonCloseableTestConfirmInfoBarDelegate&) = delete; - NonCloseableTestConfirmInfoBarDelegate& operator=( - const NonCloseableTestConfirmInfoBarDelegate&) = delete; + NonDefaultTestConfirmInfoBarDelegate( + const NonDefaultTestConfirmInfoBarDelegate&) = delete; + NonDefaultTestConfirmInfoBarDelegate& operator=( + const NonDefaultTestConfirmInfoBarDelegate&) = delete; - ~NonCloseableTestConfirmInfoBarDelegate() override = default; + ~NonDefaultTestConfirmInfoBarDelegate() override = default; bool IsCloseable() const override { return false; } + bool ShouldAnimate() const override { return false; } }; -class CloseableTestConfirmInfoBarDelegate : public TestConfirmInfoBarDelegate { +class DefaultTestConfirmInfoBarDelegate : public TestConfirmInfoBarDelegate { public: - CloseableTestConfirmInfoBarDelegate() = default; + DefaultTestConfirmInfoBarDelegate() = default; - CloseableTestConfirmInfoBarDelegate( - const CloseableTestConfirmInfoBarDelegate&) = delete; - CloseableTestConfirmInfoBarDelegate& operator=( - const CloseableTestConfirmInfoBarDelegate&) = delete; + DefaultTestConfirmInfoBarDelegate(const DefaultTestConfirmInfoBarDelegate&) = + delete; + DefaultTestConfirmInfoBarDelegate& operator=( + const DefaultTestConfirmInfoBarDelegate&) = delete; - ~CloseableTestConfirmInfoBarDelegate() override = default; - - bool IsCloseable() const override { return true; } + ~DefaultTestConfirmInfoBarDelegate() override = default; }; class GlobalConfirmInfoBarTest : public InProcessBrowserTest { @@ -138,8 +136,8 @@ // Make sure the tab has no info bar. EXPECT_EQ(0u, infobar_manager->infobar_count()); - auto delegate = std::make_unique<CloseableTestConfirmInfoBarDelegate>(); - CloseableTestConfirmInfoBarDelegate* delegate_ptr = delegate.get(); + auto delegate = std::make_unique<DefaultTestConfirmInfoBarDelegate>(); + DefaultTestConfirmInfoBarDelegate* delegate_ptr = delegate.get(); GlobalConfirmInfoBar* infobar = GlobalConfirmInfoBar::Show(std::move(delegate)); @@ -156,7 +154,8 @@ EXPECT_EQ(0u, infobar_manager->infobar_count()); } -IN_PROC_BROWSER_TEST_F(GlobalConfirmInfoBarTest, VerifyInfobarIsNonCloseable) { +IN_PROC_BROWSER_TEST_F(GlobalConfirmInfoBarTest, + VerifyInfobarNonDefaultProperties) { TabStripModel* tab_strip_model = browser()->tab_strip_model(); ASSERT_EQ(1, tab_strip_model->count()); infobars::ContentInfoBarManager* infobar_manager = @@ -165,8 +164,8 @@ // Make sure the tab has no info bar. EXPECT_EQ(0u, infobar_manager->infobar_count()); - auto delegate = std::make_unique<NonCloseableTestConfirmInfoBarDelegate>(); - NonCloseableTestConfirmInfoBarDelegate* delegate_ptr = delegate.get(); + auto delegate = std::make_unique<NonDefaultTestConfirmInfoBarDelegate>(); + NonDefaultTestConfirmInfoBarDelegate* delegate_ptr = delegate.get(); GlobalConfirmInfoBar::Show(std::move(delegate)); @@ -175,5 +174,7 @@ auto* test_infobar = infobar_manager->infobar_at(0)->delegate(); EXPECT_TRUE(test_infobar->EqualsDelegate(delegate_ptr)); + EXPECT_FALSE(test_infobar->IsCloseable()); + EXPECT_FALSE(test_infobar->ShouldAnimate()); }
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc index 108ca7d..df663efa 100644 --- a/chrome/browser/download/download_browsertest.cc +++ b/chrome/browser/download/download_browsertest.cc
@@ -101,6 +101,7 @@ #include "components/safe_browsing/content/browser/safe_browsing_service_interface.h" #include "components/safe_browsing/content/common/file_type_policies_test_util.h" #include "components/safe_browsing/content/common/proto/download_file_types.pb.h" +#include "components/safe_browsing/core/common/features.h" #include "components/safe_browsing/core/common/proto/csd.pb.h" #include "components/safe_browsing/core/common/safe_browsing_prefs.h" #include "components/security_state/core/security_state.h" @@ -159,7 +160,6 @@ #include "chrome/browser/download/bubble/download_bubble_controller.h" #include "chrome/browser/download/bubble/download_display.h" #include "chrome/browser/download/bubble/download_display_controller.h" -#include "components/safe_browsing/core/common/features.h" #endif #if BUILDFLAG(FULL_SAFE_BROWSING) @@ -1432,7 +1432,10 @@ class DownloadTestWithFakeSafeBrowsing : public DownloadTest { public: DownloadTestWithFakeSafeBrowsing() - : test_safe_browsing_factory_(new TestSafeBrowsingServiceFactory()) {} + : test_safe_browsing_factory_(new TestSafeBrowsingServiceFactory()) { + feature_list_.InitAndDisableFeature( + safe_browsing::kSafeBrowsingCsbrrNewDownloadTrigger); + } void SetUp() override { safe_browsing::SafeBrowsingServiceInterface::RegisterFactory( @@ -1447,6 +1450,21 @@ protected: std::unique_ptr<TestSafeBrowsingServiceFactory> test_safe_browsing_factory_; + + private: + base::test::ScopedFeatureList feature_list_; +}; + +class DownloadTestWithFakeSafeBrowsingNewCsbrrTrigger + : public DownloadTestWithFakeSafeBrowsing { + public: + DownloadTestWithFakeSafeBrowsingNewCsbrrTrigger() { + feature_list_.InitAndEnableFeature( + safe_browsing::kSafeBrowsingCsbrrNewDownloadTrigger); + } + + private: + base::test::ScopedFeatureList feature_list_; }; class DownloadWakeLockTest : public DownloadTest { @@ -5541,6 +5559,42 @@ download->Cancel(true); } +IN_PROC_BROWSER_TEST_F(DownloadTestWithFakeSafeBrowsingNewCsbrrTrigger, + SendUncommonDownloadReportIfUserDiscard) { + browser()->profile()->GetPrefs()->SetBoolean(prefs::kSafeBrowsingEnabled, + true); + // Make a dangerous file. + embedded_test_server()->ServeFilesFromDirectory(GetTestDataDirectory()); + ASSERT_TRUE(embedded_test_server()->Start()); + GURL download_url = embedded_test_server()->GetURL(kDangerousMockFilePath); + std::unique_ptr<content::DownloadTestObserver> dangerous_observer( + DangerousDownloadWaiter( + browser(), 1, + content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_QUIT)); + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), download_url)); + dangerous_observer->WaitForFinished(); + + std::vector<DownloadItem*> downloads; + DownloadManagerForBrowser(browser())->GetAllDownloads(&downloads); + ASSERT_EQ(1u, downloads.size()); + DownloadItem* download = downloads[0]; + DownloadItemModel model(download); + DownloadCommands(model.GetWeakPtr()) + .ExecuteCommand(DownloadCommands::DISCARD); + + safe_browsing::ClientSafeBrowsingReportRequest actual_report; + actual_report.ParseFromString( + test_safe_browsing_factory_->fake_safe_browsing_service() + ->serilized_download_report()); + EXPECT_EQ(safe_browsing::ClientSafeBrowsingReportRequest:: + DANGEROUS_DOWNLOAD_WARNING, + actual_report.type()); + EXPECT_EQ(safe_browsing::ClientDownloadResponse::UNCOMMON, + actual_report.download_verdict()); + EXPECT_EQ(download_url.spec(), actual_report.url()); + EXPECT_FALSE(actual_report.did_proceed()); +} + #endif // FULL_SAFE_BROWSING // The rest of these tests rely on the download surface, which ChromeOS doesn't
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc index 3c46941..470b369f 100644 --- a/chrome/browser/download/download_item_model.cc +++ b/chrome/browser/download/download_item_model.cc
@@ -172,6 +172,37 @@ return false; } } + +void MaybeSendDownloadReport(const GURL& url, + download::DownloadDangerType danger_type, + bool did_proceed, + Profile* profile, + download::DownloadItem* download) { + // Dangerous download delete report is gated by the new trigger flag. + if (!base::FeatureList::IsEnabled( + safe_browsing::kSafeBrowsingCsbrrNewDownloadTrigger) && + !did_proceed) { + return; + } + // Only sends dangerous download report if : + // 1. FULL_SAFE_BROWSING is enabled, and + // 2. Download verdict is one of the dangerous types, and + // 3. Download URL is not empty, and + // 4. User is not in incognito mode. + if (ShouldSendDownloadReport(danger_type) && !url.is_empty() && + !profile->IsOffTheRecord()) { + safe_browsing::SafeBrowsingService* sb_service = + g_browser_process->safe_browsing_service(); + if (sb_service) { + bool is_successful = sb_service->SendDownloadReport( + download, + safe_browsing::ClientSafeBrowsingReportRequest:: + DANGEROUS_DOWNLOAD_WARNING, + did_proceed, /*show_download_in_folder=*/absl::nullopt); + DCHECK(is_successful); + } + } +} #endif // Enum representing reasons why a download is not preferred to be opened in @@ -828,34 +859,19 @@ break; } DCHECK(IsDangerous()); -// Only sends dangerous download accept report if : -// 1. FULL_SAFE_BROWSING is enabled, and -// 2. Download verdict is one of the dangerous types, and -// 3. Download URL is not empty, and -// 4. User is not in incognito mode. #if BUILDFLAG(FULL_SAFE_BROWSING) - if (ShouldSendDownloadReport(GetDangerType()) && !GetURL().is_empty() && - !profile()->IsOffTheRecord()) { - // The bypassed danger type can only be uncommon in the old UI, because - // the other danger types are not bypassable in the download shelf. - // However, it can be any dangerous danger type in the new UI. - DCHECK(GetDangerType() == - download::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT || - download::IsDownloadBubbleEnabled(profile())); - safe_browsing::SafeBrowsingService* sb_service = - g_browser_process->safe_browsing_service(); - if (sb_service) { - bool is_successful = sb_service->SendDownloadReport( - download_, - safe_browsing::ClientSafeBrowsingReportRequest:: - DANGEROUS_DOWNLOAD_WARNING, - /*did_proceed=*/true, /*show_download_in_folder=*/absl::nullopt); - DCHECK(is_successful); - } - } + MaybeSendDownloadReport(GetURL(), GetDangerType(), /*did_proceed=*/true, + profile(), download_); #endif download_->ValidateDangerousDownload(); break; + case DownloadCommands::DISCARD: +#if BUILDFLAG(FULL_SAFE_BROWSING) + MaybeSendDownloadReport(GetURL(), GetDangerType(), /*did_proceed=*/false, + profile(), download_); +#endif + DownloadUIModel::ExecuteCommand(download_commands, command); + break; case DownloadCommands::LEARN_MORE_SCANNING: { #if BUILDFLAG(FULL_SAFE_BROWSING) using safe_browsing::DownloadProtectionService; @@ -878,7 +894,6 @@ break; case DownloadCommands::PLATFORM_OPEN: case DownloadCommands::CANCEL: - case DownloadCommands::DISCARD: case DownloadCommands::LEARN_MORE_INTERRUPTED: case DownloadCommands::LEARN_MORE_MIXED_CONTENT: case DownloadCommands::PAUSE:
diff --git a/chrome/browser/engagement/important_sites_util.cc b/chrome/browser/engagement/important_sites_util.cc index 49359adb..57b146d 100644 --- a/chrome/browser/engagement/important_sites_util.cc +++ b/chrome/browser/engagement/important_sites_util.cc
@@ -13,6 +13,7 @@ #include "base/containers/contains.h" #include "base/metrics/histogram_macros.h" +#include "base/ranges/algorithm.h" #include "base/values.h" #include "build/build_config.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" @@ -313,9 +314,8 @@ // Process the bookmarks and optionally trim them if we have too many. std::vector<UrlAndTitle> result_bookmarks; if (untrimmed_bookmarks.size() > kMaxBookmarks) { - std::copy_if( - untrimmed_bookmarks.begin(), untrimmed_bookmarks.end(), - std::back_inserter(result_bookmarks), + base::ranges::copy_if( + untrimmed_bookmarks, std::back_inserter(result_bookmarks), [&engagement_map](const UrlAndTitle& entry) { auto it = engagement_map.find(entry.url.DeprecatedGetOriginAsURL()); double score = it == engagement_map.end() ? 0 : it->second;
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc index 04d8946..1a9960b 100644 --- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc +++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc
@@ -150,12 +150,19 @@ const std::string& webstore_url = ExtensionsClient::Get()->GetWebstoreBaseURL().spec(); + const std::string& new_webstore_url = + ExtensionsClient::Get()->GetNewWebstoreBaseURL().spec(); // The protected URLs should not be touched at all. EXPECT_FALSE(ActionWorksOnRequest(webstore_url.c_str(), extension_->id(), action_set.get(), stage)); EXPECT_FALSE(ActionWorksOnRequest(webstore_url.c_str(), extension_all_urls_->id(), action_set.get(), stage)); + EXPECT_FALSE(ActionWorksOnRequest(new_webstore_url.c_str(), extension_->id(), + action_set.get(), stage)); + EXPECT_FALSE(ActionWorksOnRequest(new_webstore_url.c_str(), + extension_all_urls_->id(), action_set.get(), + stage)); } TEST(WebRequestActionTest, CreateAction) { @@ -344,6 +351,13 @@ EXPECT_FALSE(ActionWorksOnRequest(webstore_url.c_str(), extension_all_urls_->id(), action_set.get(), ON_BEFORE_REQUEST)); + const std::string& new_webstore_url = + ExtensionsClient::Get()->GetNewWebstoreBaseURL().spec(); + EXPECT_FALSE(ActionWorksOnRequest(new_webstore_url.c_str(), extension_->id(), + action_set.get(), ON_BEFORE_REQUEST)); + EXPECT_FALSE(ActionWorksOnRequest(new_webstore_url.c_str(), + extension_all_urls_->id(), action_set.get(), + ON_BEFORE_REQUEST)); } TEST_F(WebRequestActionWithThreadsTest, PermissionsToAddRequestCookie) {
diff --git a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api_unittest.cc b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api_unittest.cc index da38707..8372b414 100644 --- a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api_unittest.cc +++ b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api_unittest.cc
@@ -10,7 +10,6 @@ #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/containers/contains.h" @@ -43,6 +42,7 @@ #include "chromeos/ash/components/dbus/userdataauth/fake_cryptohome_misc_client.h" #include "chromeos/ash/components/dbus/userdataauth/fake_userdataauth_client.h" #include "chromeos/ash/components/login/auth/fake_extended_authenticator.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/feed/android/java/res/layout/new_tab_page_multi_sticky_feed_header.xml b/chrome/browser/feed/android/java/res/layout/new_tab_page_multi_sticky_feed_header.xml index 9ae4f2c..63ea7fc8 100644 --- a/chrome/browser/feed/android/java/res/layout/new_tab_page_multi_sticky_feed_header.xml +++ b/chrome/browser/feed/android/java/res/layout/new_tab_page_multi_sticky_feed_header.xml
@@ -11,8 +11,10 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical" > + android:orientation="vertical"> + <!-- We set the main content of the sticky header clickable to prevent clicking on feed cards + underneath the sticky header, while still allowing for the rest of the feed to be interact-able. --> <RelativeLayout android:id="@+id/main_content" android:layout_width="match_parent" @@ -21,9 +23,12 @@ android:orientation="horizontal" android:gravity="center_vertical" android:layoutDirection="locale" - android:paddingHorizontal="@dimen/ntp_header_lateral_paddings_v2" > + android:paddingHorizontal="@dimen/ntp_header_lateral_paddings_v2" + android:background="@macro/toolbar_background_primary" + android:clickable="true" + android:focusable="true"> - <ImageView + <ImageView android:id="@+id/section_status_indicator" android:layout_width="@dimen/feed_header_icon_size" android:layout_height="@dimen/feed_header_icon_size" @@ -69,4 +74,11 @@ app:menuMaxWidth="@dimen/feed_header_menu_max_width" app:tint="@null" /> </RelativeLayout> + <ImageView + android:id="@+id/sticky_header_hairline" + android:src="@drawable/toolbar_hairline" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:scaleType="fitXY" + android:importantForAccessibility="no" /> </org.chromium.chrome.browser.feed.sections.StickySectionHeaderView>
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/sections/SectionHeaderListProperties.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/sections/SectionHeaderListProperties.java index 7553928..a7eb382 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/sections/SectionHeaderListProperties.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/sections/SectionHeaderListProperties.java
@@ -64,6 +64,7 @@ .with(SECTION_HEADERS_KEY, new PropertyListModel<>()) .with(INDICATOR_VIEW_VISIBILITY_KEY, ViewVisibility.INVISIBLE) .with(TOOLBAR_HEIGHT_PX, toolbarHeight) + .with(STICKY_HEADER_VISIBLILITY_KEY, false) .build(); } }
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/sections/StickySectionHeaderView.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/sections/StickySectionHeaderView.java index 2e97a1a..0d614ff 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/sections/StickySectionHeaderView.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/sections/StickySectionHeaderView.java
@@ -4,10 +4,16 @@ package org.chromium.chrome.browser.feed.sections; +import static android.view.View.GONE; +import static android.view.View.VISIBLE; + import android.content.Context; import android.util.AttributeSet; +import android.view.ViewGroup; import androidx.annotation.Nullable; +import androidx.annotation.Px; + /** * View for the feed header that sticks to the top of the screen upon scroll. */ @@ -16,6 +22,21 @@ super(context, attrs); } + /** Sets the sticky header’s visibility. */ @Override - void setStickyHeaderVisible(boolean visible) {} + void setStickyHeaderVisible(boolean isVisible) { + this.setVisibility(isVisible ? VISIBLE : GONE); + } + + /** + * When we set/update the toolbar height, the margin of the sticky header should be updated + * simultaneously. + */ + @Override + public void setToolbarHeight(@Px int toolbarHeight) { + super.setToolbarHeight(toolbarHeight); + ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) this.getLayoutParams(); + params.setMargins( + params.leftMargin, toolbarHeight, params.rightMargin, params.bottomMargin); + } }
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 37c6fdc0..728ad31 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -936,6 +936,11 @@ "expiry_milestone": 115 }, { + "name": "chrome-cart-dom-based-heuristics", + "owners": [ "yuezhanggg", "wychen"], + "expiry_milestone": 112 + }, + { "name": "chrome-labs", "owners": ["elainechien", "robliao"], "expiry_milestone": 112
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc index 4e08595..8a494ec 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -255,7 +255,6 @@ &kInstanceSwitcher, &kInstantStart, &kIsVoiceSearchEnabledCache, - &kKitKatSupported, &kLensCameraAssistedSearch, &kLensOnQuickActionSearchWidget, &kNewInstanceFromDraggedLink, @@ -803,10 +802,6 @@ "IsVoiceSearchEnabledCache", base::FEATURE_ENABLED_BY_DEFAULT); -BASE_FEATURE(kKitKatSupported, - "KitKatSupported", - base::FEATURE_DISABLED_BY_DEFAULT); - BASE_FEATURE(kSearchEnginePromoExistingDevice, "SearchEnginePromo.ExistingDevice", base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h index 74946851..be037ae0 100644 --- a/chrome/browser/flags/android/chrome_feature_list.h +++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -103,7 +103,6 @@ BASE_DECLARE_FEATURE(kInstanceSwitcher); BASE_DECLARE_FEATURE(kInstantStart); BASE_DECLARE_FEATURE(kIsVoiceSearchEnabledCache); -BASE_DECLARE_FEATURE(kKitKatSupported); BASE_DECLARE_FEATURE(kLanguagesPreference); BASE_DECLARE_FEATURE(kLensCameraAssistedSearch); BASE_DECLARE_FEATURE(kLensOnQuickActionSearchWidget);
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java index 87e7e77..562f085 100644 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -398,7 +398,6 @@ public static final String IS_VOICE_SEARCH_ENABLED_CACHE = "IsVoiceSearchEnabledCache"; public static final String HISTORY_JOURNEYS = "Journeys"; public static final String HISTORY_ORGANIC_REPEATABLE_QUERIES = "OrganicRepeatableQueries"; - public static final String KITKAT_SUPPORTED = "KitKatSupported"; public static final String LEAK_DETECTION_UNAUTHENTICATED = "LeakDetectionUnauthenticated"; public static final String LENS_ON_QUICK_ACTION_SEARCH_WIDGET = "LensOnQuickActionSearchWidget"; public static final String LIGHTWEIGHT_REACTIONS = "LightweightReactions";
diff --git a/chrome/browser/lacros/account_manager/account_manager_util.cc b/chrome/browser/lacros/account_manager/account_manager_util.cc index e7d81d9..43acee1 100644 --- a/chrome/browser/lacros/account_manager/account_manager_util.cc +++ b/chrome/browser/lacros/account_manager/account_manager_util.cc
@@ -4,13 +4,13 @@ #include "chrome/browser/lacros/account_manager/account_manager_util.h" -#include <algorithm> #include <utility> #include <vector> #include "base/bind.h" #include "base/containers/cxx20_erase.h" #include "base/containers/flat_set.h" +#include "base/ranges/algorithm.h" #include "chrome/browser/profiles/profile_attributes_entry.h" #include "chrome/browser/profiles/profile_attributes_storage.h" #include "chrome/browser/profiles/profile_manager.h" @@ -25,11 +25,8 @@ std::vector<account_manager::Account> result; // Copy all accounts into result, except for those denylisted. for (const auto& path_and_list_pair : accounts_map) { - const std::vector<account_manager::Account>& list = - path_and_list_pair.second; - - std::copy_if( - list.begin(), list.end(), std::back_inserter(result), + base::ranges::copy_if( + path_and_list_pair.second, std::back_inserter(result), [&denylisted_gaia_ids](const account_manager::Account& account) { return !denylisted_gaia_ids.contains(account.key.id()); });
diff --git a/chrome/browser/nearby_sharing/instantmessaging/stream_parser_fuzzer.cc b/chrome/browser/nearby_sharing/instantmessaging/stream_parser_fuzzer.cc new file mode 100644 index 0000000..137463590 --- /dev/null +++ b/chrome/browser/nearby_sharing/instantmessaging/stream_parser_fuzzer.cc
@@ -0,0 +1,37 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <stdint.h> + +#include <tuple> + +#include <fuzzer/FuzzedDataProvider.h> + +#include "base/logging.h" +#include "base/strings/string_piece.h" +#include "chrome/browser/nearby_sharing/instantmessaging/stream_parser.h" +#include "third_party/protobuf/src/google/protobuf/stubs/logging.h" + +// Does initialization and holds state that's shared across all runs. +class Environment { + public: + Environment() { + // Disable noisy logging. + logging::SetMinLogLevel(logging::LOG_FATAL); + } + + private: + google::protobuf::LogSilencer log_silencer_; +}; + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + static Environment env; + FuzzedDataProvider provider(data, size); + + StreamParser parser; + while (provider.remaining_bytes() > 0) + std::ignore = parser.Append(provider.ConsumeRandomLengthString()); + + return 0; +}
diff --git a/chrome/browser/net/secure_dns_util.cc b/chrome/browser/net/secure_dns_util.cc index 4498486..58cdc63 100644 --- a/chrome/browser/net/secure_dns_util.cc +++ b/chrome/browser/net/secure_dns_util.cc
@@ -95,11 +95,10 @@ const net::DohProviderEntry::List& providers, int country_id) { net::DohProviderEntry::List local_providers; - std::copy_if(providers.begin(), providers.end(), - std::back_inserter(local_providers), - [country_id](const auto* entry) { - return EntryIsForCountry(entry, country_id); - }); + base::ranges::copy_if(providers, std::back_inserter(local_providers), + [country_id](const auto* entry) { + return EntryIsForCountry(entry, country_id); + }); return local_providers; }
diff --git a/chrome/browser/net/trial_comparison_cert_verifier_controller_unittest.cc b/chrome/browser/net/trial_comparison_cert_verifier_controller_unittest.cc index 99eb0f3..625ca9e 100644 --- a/chrome/browser/net/trial_comparison_cert_verifier_controller_unittest.cc +++ b/chrome/browser/net/trial_comparison_cert_verifier_controller_unittest.cc
@@ -33,6 +33,7 @@ #include "net/cert/cert_verify_result.h" #include "net/cert/x509_certificate.h" #include "net/cert/x509_util.h" +#include "net/net_buildflags.h" #include "net/test/cert_test_util.h" #include "net/test/gtest_util.h" #include "net/test/test_data_directory.h" @@ -279,6 +280,17 @@ TEST_F(TrialComparisonCertVerifierControllerTest, NotOfficialBuildTrialEnabled) { +#if BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) + if (base::FeatureList::IsEnabled(net::features::kChromeRootStoreUsed)) { + // If ChromeRootStoreUsed feature is enabled by default, + // TrialComparisonCertVerifier will not be allowed. It is not safe to + // change the kChromeRootStoreUsed flag in unit_tests since multiple tests + // run in the same process, and GetChromeCertVerifierServiceParams will + // globally enforce a single configuration for the lifetime of the + // process. Therefore just skip this test if CRS is enabled. + GTEST_SKIP(); + } +#endif scoped_feature_ = std::make_unique<base::test::ScopedFeatureList>(); scoped_feature_->InitAndEnableFeature( net::features::kCertDualVerificationTrialFeature); @@ -316,6 +328,17 @@ } TEST_F(TrialComparisonCertVerifierControllerTest, OfficialBuildTrialEnabled) { +#if BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) + if (base::FeatureList::IsEnabled(net::features::kChromeRootStoreUsed)) { + // If ChromeRootStoreUsed feature is enabled by default, + // TrialComparisonCertVerifier will not be allowed. It is not safe to + // change the kChromeRootStoreUsed flag in unit_tests since multiple tests + // run in the same process, and GetChromeCertVerifierServiceParams will + // globally enforce a single configuration for the lifetime of the + // process. Therefore just skip this test if CRS is enabled. + GTEST_SKIP(); + } +#endif TrialComparisonCertVerifierController::SetFakeOfficialBuildForTesting(true); scoped_feature_ = std::make_unique<base::test::ScopedFeatureList>(); scoped_feature_->InitAndEnableFeature( @@ -397,6 +420,17 @@ TEST_F(TrialComparisonCertVerifierControllerTest, OfficialBuildTrialEnabledTwoClients) { +#if BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) + if (base::FeatureList::IsEnabled(net::features::kChromeRootStoreUsed)) { + // If ChromeRootStoreUsed feature is enabled by default, + // TrialComparisonCertVerifier will not be allowed. It is not safe to + // change the kChromeRootStoreUsed flag in unit_tests since multiple tests + // run in the same process, and GetChromeCertVerifierServiceParams will + // globally enforce a single configuration for the lifetime of the + // process. Therefore just skip this test if CRS is enabled. + GTEST_SKIP(); + } +#endif TrialComparisonCertVerifierController::SetFakeOfficialBuildForTesting(true); scoped_feature_ = std::make_unique<base::test::ScopedFeatureList>(); scoped_feature_->InitAndEnableFeature( @@ -506,6 +540,17 @@ TEST_F(TrialComparisonCertVerifierControllerTest, OfficialBuildTrialEnabledUmaOnly) { +#if BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) + if (base::FeatureList::IsEnabled(net::features::kChromeRootStoreUsed)) { + // If ChromeRootStoreUsed feature is enabled by default, + // TrialComparisonCertVerifier will not be allowed. It is not safe to + // change the kChromeRootStoreUsed flag in unit_tests since multiple tests + // run in the same process, and GetChromeCertVerifierServiceParams will + // globally enforce a single configuration for the lifetime of the + // process. Therefore just skip this test if CRS is enabled. + GTEST_SKIP(); + } +#endif TrialComparisonCertVerifierController::SetFakeOfficialBuildForTesting(true); scoped_feature_ = std::make_unique<base::test::ScopedFeatureList>(); scoped_feature_->InitAndEnableFeatureWithParameters( @@ -542,6 +587,17 @@ TEST_F(TrialComparisonCertVerifierControllerTest, IncognitoOfficialBuildTrialEnabled) { +#if BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) + if (base::FeatureList::IsEnabled(net::features::kChromeRootStoreUsed)) { + // If ChromeRootStoreUsed feature is enabled by default, + // TrialComparisonCertVerifier will not be allowed. It is not safe to + // change the kChromeRootStoreUsed flag in unit_tests since multiple tests + // run in the same process, and GetChromeCertVerifierServiceParams will + // globally enforce a single configuration for the lifetime of the + // process. Therefore just skip this test if CRS is enabled. + GTEST_SKIP(); + } +#endif TrialComparisonCertVerifierController::SetFakeOfficialBuildForTesting(true); scoped_feature_ = std::make_unique<base::test::ScopedFeatureList>(); scoped_feature_->InitAndEnableFeature(
diff --git a/chrome/browser/policy/messaging_layer/upload/upload_provider.cc b/chrome/browser/policy/messaging_layer/upload/upload_provider.cc index 3309d94..3130dbd 100644 --- a/chrome/browser/policy/messaging_layer/upload/upload_provider.cc +++ b/chrome/browser/policy/messaging_layer/upload/upload_provider.cc
@@ -17,9 +17,9 @@ #include "base/thread_annotations.h" #include "chrome/browser/policy/messaging_layer/upload/upload_client.h" #include "components/reporting/proto/synced/record.pb.h" +#include "components/reporting/proto/synced/status.pb.h" #include "components/reporting/util/backoff_settings.h" #include "components/reporting/util/status.h" -#include "components/reporting/util/status.pb.h" #include "components/reporting/util/statusor.h" #include "net/base/backoff_entry.h"
diff --git a/chrome/browser/policy/test/policy_browsertest.cc b/chrome/browser/policy/test/policy_browsertest.cc index 2016856..67bd66ec 100644 --- a/chrome/browser/policy/test/policy_browsertest.cc +++ b/chrome/browser/policy/test/policy_browsertest.cc
@@ -120,7 +120,13 @@ EXPECT_TRUE(IsWebGLEnabled(contents)); } -IN_PROC_BROWSER_TEST_F(PolicyTest, HomepageLocation) { +// TODO(crbug.com/1378338): Re-enable this flaky test on Linux. +#if BUILDFLAG(IS_LINUX) +#define MAYBE_HomepageLocation DISABLED_HomepageLocation +#else +#define MAYBE_HomepageLocation HomepageLocation +#endif +IN_PROC_BROWSER_TEST_F(PolicyTest, MAYBE_HomepageLocation) { // Verifies that the homepage can be configured with policies. // Set a default, and check that the home button navigates there. browser()->profile()->GetPrefs()->SetString(prefs::kHomePage,
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index c57339d..bd3d290a 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc
@@ -300,7 +300,6 @@ #include "ash/components/arc/arc_prefs.h" #include "ash/constants/ash_pref_names.h" #include "ash/public/cpp/ash_prefs.h" -#include "ash/services/device_sync/public/cpp/device_sync_prefs.h" #include "chrome/browser/apps/app_preload_service/app_preload_service.h" #include "chrome/browser/apps/app_service/metrics/app_platform_metrics_service.h" #include "chrome/browser/apps/app_service/webapk/webapk_prefs.h" @@ -395,7 +394,7 @@ #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" #include "chrome/browser/ui/ash/shelf/chrome_shelf_prefs.h" #include "chrome/browser/ui/webui/ash/login/enable_debugging_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chrome/browser/ui/webui/settings/ash/os_settings_ui.h" #include "chrome/browser/upgrade_detector/upgrade_detector_chromeos.h" #include "chromeos/ash/components/audio/audio_devices_pref_handler_impl.h" @@ -412,6 +411,7 @@ #include "chromeos/ash/services/auth_factor_config/auth_factor_config.h" #include "chromeos/ash/services/bluetooth_config/bluetooth_power_controller_impl.h" #include "chromeos/ash/services/bluetooth_config/device_name_manager_impl.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_prefs.h" #include "chromeos/ash/services/multidevice_setup/multidevice_setup_service.h" #include "chromeos/components/quick_answers/public/cpp/quick_answers_prefs.h" #include "components/account_manager_core/chromeos/account_manager.h"
diff --git a/chrome/browser/printing/print_browsertest.cc b/chrome/browser/printing/print_browsertest.cc index e1e835f2..8e77e74 100644 --- a/chrome/browser/printing/print_browsertest.cc +++ b/chrome/browser/printing/print_browsertest.cc
@@ -51,7 +51,6 @@ #include "content/public/browser/global_routing_id.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" -#include "content/public/browser/web_contents_observer.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/test/browser_test.h" @@ -508,68 +507,6 @@ mojo::AssociatedReceiver<mojom::PrintRenderFrame> receiver_{this}; }; -class SetPrintingEnabledInterceptor - : public mojom::PrintRenderFrameInterceptorForTesting { - public: - SetPrintingEnabledInterceptor() = default; - ~SetPrintingEnabledInterceptor() override = default; - - SetPrintingEnabledInterceptor(const SetPrintingEnabledInterceptor&) = delete; - SetPrintingEnabledInterceptor& operator=( - const SetPrintingEnabledInterceptor&) = delete; - - mojom::PrintRenderFrame* GetForwardingInterface() override { - NOTREACHED(); - return nullptr; - } - - void OverrideBinderForTesting(content::RenderFrameHost* render_frame_host) { - render_frame_host->GetRemoteAssociatedInterfaces() - ->OverrideBinderForTesting( - mojom::PrintRenderFrame::Name_, - base::BindRepeating(&SetPrintingEnabledInterceptor::BindReceiver, - base::Unretained(this))); - } - - void BindReceiver(mojo::ScopedInterfaceEndpointHandle handle) { - receiver_.Bind(mojo::PendingAssociatedReceiver<mojom::PrintRenderFrame>( - std::move(handle))); - } - - MOCK_METHOD1(SetPrintingEnabled, void(bool)); - - private: - mojo::AssociatedReceiver<mojom::PrintRenderFrame> receiver_{this}; -}; - -// Wrapper around `SetPrintingEnabledInterceptor` that performs the interception -// for the first subframe created. -class SubframeSetPrintingEnabledInterceptor - : public content::WebContentsObserver { - public: - explicit SubframeSetPrintingEnabledInterceptor( - content::WebContents* web_contents) - : WebContentsObserver(web_contents) {} - ~SubframeSetPrintingEnabledInterceptor() override = default; - - // content::WebContentsObserver: - void RenderFrameCreated( - content::RenderFrameHost* render_frame_host) override { - if (intercepting_) - return; - - intercepting_ = true; - interceptor_.OverrideBinderForTesting(render_frame_host); - } - - bool intercepting() const { return intercepting_; } - SetPrintingEnabledInterceptor& interceptor() { return interceptor_; } - - private: - bool intercepting_ = false; - SetPrintingEnabledInterceptor interceptor_; -}; - } // namespace class TestPrintViewManager : public PrintViewManager { @@ -2100,40 +2037,6 @@ print_preview_observer.WaitUntilPreviewIsReady(); } -IN_PROC_BROWSER_TEST_F(PrintBrowserTest, NoExtraSetPrintingEnabledCalls) { - content::WebContents* web_contents = - browser()->tab_strip_model()->GetActiveWebContents(); - - SetPrintingEnabledInterceptor main_frame_interceptor; - main_frame_interceptor.OverrideBinderForTesting( - web_contents->GetPrimaryMainFrame()); - - // Clear `print_render_frames_` to use the overridden binder. - auto* print_view_manager = - TestPrintViewManager::FromWebContents(web_contents); - ASSERT_TRUE(print_view_manager); - print_view_manager->ClearPrintRenderFramesForTesting(); - - // SetPrintingEnabled() should be called only once per navigation. - EXPECT_CALL(main_frame_interceptor, SetPrintingEnabled(_)).Times(2); - - // Navigate to an initial page. - const GURL kDomainAUrl( - embedded_test_server()->GetURL("a.com", "/printing/test1.html")); - ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), kDomainAUrl)); - - // Navigate to a different site to a page with iframes. The subframe for the - // `kDomainAUrl` page should not ever get a SetPrintingEnabled() call. - SubframeSetPrintingEnabledInterceptor subframe_interceptor(web_contents); - EXPECT_CALL(subframe_interceptor.interceptor(), SetPrintingEnabled(_)) - .Times(0); - - const GURL kDomainBUrl(embedded_test_server()->GetURL( - "b.com", "/printing/content_with_same_site_iframe.html")); - ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), kDomainBUrl)); - EXPECT_TRUE(subframe_interceptor.intercepting()); -} - class PrintPrerenderBrowserTest : public PrintBrowserTest { public: PrintPrerenderBrowserTest() @@ -2216,51 +2119,6 @@ EXPECT_EQ(1u, console_observer.messages().size()); } -IN_PROC_BROWSER_TEST_F(PrintPrerenderBrowserTest, - SetPrintingEnabledShouldNotBeCalledInPrerendering) { - SetPrintingEnabledInterceptor interceptor; - interceptor.OverrideBinderForTesting(web_contents()->GetPrimaryMainFrame()); - - // Clear `print_render_frames_` to use the overridden binder. - auto* print_view_manager = - TestPrintViewManager::FromWebContents(web_contents()); - ASSERT_TRUE(print_view_manager); - print_view_manager->ClearPrintRenderFramesForTesting(); - - // SetPrintingEnabled() should be called third times from the initial page - // loading, triggering UpdatePrintingEnabled() through changing - // kPrintingEnabled prefs, and activating the prerender page. - EXPECT_CALL(interceptor, SetPrintingEnabled(_)).Times(3); - - // Navigate to an initial page. - const GURL kEmptyUrl(embedded_test_server()->GetURL("/empty.html")); - ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), kEmptyUrl)); - - // Start a prerender. - GURL kPrerenderUrl = - embedded_test_server()->GetURL("/printing/prerendering.html"); - int host_id = prerender_helper_.AddPrerender(kPrerenderUrl); - content::RenderFrameHost* prerender_rfh = - prerender_helper_.GetPrerenderedMainFrameHost(host_id); - SetPrintingEnabledInterceptor prerendered_interceptor; - prerendered_interceptor.OverrideBinderForTesting(prerender_rfh); - // SetPrintingEnabled() is not called when prerendering HTML (non-PDF) - // content. - EXPECT_CALL(prerendered_interceptor, SetPrintingEnabled(_)).Times(0); - - // Trigger to call PrintViewManagerBase::UpdatePrintingEnabled() to check if - // SetPrintingEnabled() is not called in prerendering. - content::BrowserContext* context = web_contents()->GetBrowserContext(); - ASSERT_TRUE(context); - PrefService* prefs = Profile::FromBrowserContext(context)->GetPrefs(); - prefs->SetBoolean(prefs::kPrintingEnabled, false); - - // Activate the prerender. - prerender_helper_.NavigatePrimaryPage(kPrerenderUrl); - - base::RunLoop().RunUntilIdle(); -} - class PrintFencedFrameBrowserTest : public testing::WithParamInterface< blink::features::FencedFramesImplementationType>, @@ -2379,51 +2237,6 @@ RunPrintTest("document.execCommand('print');"); } -IN_PROC_BROWSER_TEST_P(PrintFencedFrameBrowserTest, - SetPrintingEnabledShouldNotBeCalledInFencedFrame) { - // Only test the MPArch version of the fenced frame. - if (!fenced_frame_test_helper()) - return; - - SetPrintingEnabledInterceptor interceptor; - interceptor.OverrideBinderForTesting(web_contents()->GetPrimaryMainFrame()); - - // Clear `print_render_frames_` to use the overridden binder. - auto* print_view_manager = - TestPrintViewManager::FromWebContents(web_contents()); - ASSERT_TRUE(print_view_manager); - print_view_manager->ClearPrintRenderFramesForTesting(); - - // SetPrintingEnabled() should be called twice from the initial page loading - // and triggering UpdatePrintingEnabled() through changing kPrintingEnabled - // prefs. - EXPECT_CALL(interceptor, SetPrintingEnabled(_)).Times(2); - - // Navigate to an initial page. - const GURL kEmptyUrl(embedded_test_server()->GetURL("/empty.html")); - ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), kEmptyUrl)); - - // Create a fenced frame. - GURL kFencedFrameUrl = - embedded_test_server()->GetURL("/fenced_frames/title1.html"); - content::RenderFrameHost* fenced_frame_host = - fenced_frame_test_helper()->CreateFencedFrame( - web_contents()->GetPrimaryMainFrame(), kFencedFrameUrl); - ASSERT_TRUE(fenced_frame_host); - - // The fenced frame should not call SetPrintingEnabled(). - SetPrintingEnabledInterceptor fenced_frame_interceptor; - fenced_frame_interceptor.OverrideBinderForTesting(fenced_frame_host); - EXPECT_CALL(fenced_frame_interceptor, SetPrintingEnabled(_)).Times(0); - - // Trigger to call PrintViewManagerBase::UpdatePrintingEnabled() to check if - // SetPrintingEnabled() is not called on the fenced frame. - content::BrowserContext* context = web_contents()->GetBrowserContext(); - ASSERT_TRUE(context); - PrefService* prefs = Profile::FromBrowserContext(context)->GetPrefs(); - prefs->SetBoolean(prefs::kPrintingEnabled, false); -} - INSTANTIATE_TEST_SUITE_P( PrintFencedFrameBrowserTest, PrintFencedFrameBrowserTest,
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc index d252084..3fbf4fae 100644 --- a/chrome/browser/printing/print_view_manager_base.cc +++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -197,10 +197,7 @@ DCHECK(queue_); Profile* profile = Profile::FromBrowserContext(web_contents->GetBrowserContext()); - printing_enabled_.Init( - prefs::kPrintingEnabled, profile->GetPrefs(), - base::BindRepeating(&PrintViewManagerBase::UpdatePrintingEnabled, - weak_ptr_factory_.GetWeakPtr())); + printing_enabled_.Init(prefs::kPrintingEnabled, profile->GetPrefs()); } PrintViewManagerBase::~PrintViewManagerBase() { @@ -414,14 +411,6 @@ std::move(callback).Run(std::move(params)); } -void PrintViewManagerBase::UpdatePrintingEnabled() { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - web_contents()->GetPrimaryMainFrame()->ForEachRenderFrameHost( - [this](content::RenderFrameHost* rfh) { - SendPrintingEnabled(printing_enabled_.GetValue(), rfh); - }); -} - void PrintViewManagerBase::NavigationStopped() { // Cancel the current job, wait for the worker to finish. TerminatePrintJob(true); @@ -616,6 +605,12 @@ } #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) +void PrintViewManagerBase::IsPrintingEnabled( + IsPrintingEnabledCallback callback) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + std::move(callback).Run(printing_enabled_.GetValue()); +} + void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params, ScriptedPrintCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -701,15 +696,12 @@ content::RenderFrameHost::LifecycleState /*old_state*/, content::RenderFrameHost::LifecycleState new_state) { if (new_state == content::RenderFrameHost::LifecycleState::kActive && - render_frame_host->GetProcess()->IsPdf()) { - SendPrintingEnabled(printing_enabled_.GetValue(), render_frame_host); + render_frame_host->GetProcess()->IsPdf() && + !render_frame_host->GetMainFrame()->GetParentOrOuterDocument()) { + GetPrintRenderFrame(render_frame_host)->ConnectToPdfRenderer(); } } -void PrintViewManagerBase::DidStartLoading() { - UpdatePrintingEnabled(); -} - void PrintViewManagerBase::RenderFrameDeleted( content::RenderFrameHost* render_frame_host) { PrintManager::RenderFrameDeleted(render_frame_host); @@ -1056,14 +1048,6 @@ printer_query->StopWorker(); } -void PrintViewManagerBase::SendPrintingEnabled(bool enabled, - content::RenderFrameHost* rfh) { - if (rfh->IsRenderFrameLive() && - !rfh->GetMainFrame()->GetParentOrOuterDocument()) { - GetPrintRenderFrame(rfh)->SetPrintingEnabled(enabled); - } -} - void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) { GetPrintRenderFrame(rfh)->PrintRequestedPages();
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h index a413a26..a12011e 100644 --- a/chrome/browser/printing/print_view_manager_base.h +++ b/chrome/browser/printing/print_view_manager_base.h
@@ -87,9 +87,6 @@ mojom::PrintPagesParamsPtr print_pages_params, print_to_pdf::PdfPrintJob::PrintToPdfCallback callback); - // Whether printing is enabled or not. - void UpdatePrintingEnabled(); - // Notifies the print view manager that the system dialog has been cancelled // after being opened from Print Preview. #if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_PRINT_PREVIEW) @@ -118,6 +115,7 @@ base::Value::Dict job_settings, UpdatePrintSettingsCallback callback) override; #endif + void IsPrintingEnabled(IsPrintingEnabledCallback callback) override; void ScriptedPrint(mojom::ScriptedPrintParamsPtr params, ScriptedPrintCallback callback) override; void ShowInvalidPrinterSettingsError() override; @@ -215,7 +213,6 @@ content::RenderFrameHost* render_frame_host, content::RenderFrameHost::LifecycleState /*old_state*/, content::RenderFrameHost::LifecycleState new_state) override; - void DidStartLoading() override; // Cancels the print job. void NavigationStopped() override; @@ -303,9 +300,6 @@ // Release the PrinterQuery associated with our `cookie_`. void ReleasePrinterQuery(); - // Notifies `rfh` about whether printing is `enabled`. - void SendPrintingEnabled(bool enabled, content::RenderFrameHost* rfh); - // Prints the document by calling the `PrintRequestedPages()` renderer API and // notifies observers. This should only be called by `PrintNow()` or // `CompletePrintNowAfterContentAnalysis()`.
diff --git a/chrome/browser/profiles/profile_shortcut_manager_win.cc b/chrome/browser/profiles/profile_shortcut_manager_win.cc index 546ea17..a308979 100644 --- a/chrome/browser/profiles/profile_shortcut_manager_win.cc +++ b/chrome/browser/profiles/profile_shortcut_manager_win.cc
@@ -458,8 +458,8 @@ // Do not call ListUserDesktopContents again (but with filter) to avoid // excess work inside it. Just reuse non-filtered desktop_contents. // We need both of them (desktop_contents and shortcuts) later. - std::copy_if(desktop_contents.begin(), desktop_contents.end(), - std::inserter(shortcuts, shortcuts.begin()), filter); + base::ranges::copy_if(desktop_contents, + std::inserter(shortcuts, shortcuts.begin()), filter); if (params.old_profile_name != params.profile_name || params.single_profile) { RenameChromeDesktopShortcutForProfile(
diff --git a/chrome/browser/resources/chromeos/account_manager/BUILD.gn b/chrome/browser/resources/chromeos/account_manager/BUILD.gn index bccfc8b..240ebcb 100644 --- a/chrome/browser/resources/chromeos/account_manager/BUILD.gn +++ b/chrome/browser/resources/chromeos/account_manager/BUILD.gn
@@ -33,7 +33,7 @@ } js_library("account_manager_browser_proxy") { - deps = [ "//ui/webui/resources/js:cr.m" ] + deps = [ "//ui/webui/resources/js:cr_deprecated" ] externs_list = [ "$externs_path/chrome_send.js" ] }
diff --git a/chrome/browser/resources/chromeos/account_manager/account_manager_browser_proxy.js b/chrome/browser/resources/chromeos/account_manager/account_manager_browser_proxy.js index 19bf2cd8..91ea2d5 100644 --- a/chrome/browser/resources/chromeos/account_manager/account_manager_browser_proxy.js +++ b/chrome/browser/resources/chromeos/account_manager/account_manager_browser_proxy.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** * @fileoverview Functions for Account manager screens.
diff --git a/chrome/browser/resources/chromeos/arc_account_picker/BUILD.gn b/chrome/browser/resources/chromeos/arc_account_picker/BUILD.gn index 64958d9..5c0e12a 100644 --- a/chrome/browser/resources/chromeos/arc_account_picker/BUILD.gn +++ b/chrome/browser/resources/chromeos/arc_account_picker/BUILD.gn
@@ -72,7 +72,10 @@ } js_library("arc_account_picker_browser_proxy") { - deps = [ "//ui/webui/resources/js:cr.m" ] + deps = [ + "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", + ] externs_list = [ "$externs_path/chrome_send.js" ] }
diff --git a/chrome/browser/resources/chromeos/arc_account_picker/arc_account_picker_browser_proxy.js b/chrome/browser/resources/chromeos/arc_account_picker/arc_account_picker_browser_proxy.js index a140aabf..8ee4c86 100644 --- a/chrome/browser/resources/chromeos/arc_account_picker/arc_account_picker_browser_proxy.js +++ b/chrome/browser/resources/chromeos/arc_account_picker/arc_account_picker_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** * Data representing a Gaia account added in-session.
diff --git a/chrome/browser/resources/chromeos/assistant_optin/browser_proxy.js b/chrome/browser/resources/chromeos/assistant_optin/browser_proxy.js index 8dde758..7bd1af26 100644 --- a/chrome/browser/resources/chromeos/assistant_optin/browser_proxy.js +++ b/chrome/browser/resources/chromeos/assistant_optin/browser_proxy.js
@@ -7,7 +7,7 @@ * to interact with the browser. */ -// #import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; +// #import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; cr.define('assistant', function() { var requestPrefix = 'login.AssistantOptInFlowScreen.';
diff --git a/chrome/browser/resources/chromeos/chromebox_for_meetings/BUILD.gn b/chrome/browser/resources/chromeos/chromebox_for_meetings/BUILD.gn index fa2845b..9776d23 100644 --- a/chrome/browser/resources/chromeos/chromebox_for_meetings/BUILD.gn +++ b/chrome/browser/resources/chromeos/chromebox_for_meetings/BUILD.gn
@@ -41,7 +41,7 @@ } js_library("cfm_network_settings_browser_proxy") { - deps = [ "//ui/webui/resources/js:cr.m" ] + deps = [ "//ui/webui/resources/js:cr_deprecated" ] } js_type_check("closure_compile") {
diff --git a/chrome/browser/resources/chromeos/chromebox_for_meetings/cfm_network_settings_browser_proxy.js b/chrome/browser/resources/chromeos/chromebox_for_meetings/cfm_network_settings_browser_proxy.js index 78e552a..d81f7445 100644 --- a/chrome/browser/resources/chromeos/chromebox_for_meetings/cfm_network_settings_browser_proxy.js +++ b/chrome/browser/resources/chromeos/chromebox_for_meetings/cfm_network_settings_browser_proxy.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** @interface */ export class CfmNetworkSettingsBrowserProxy {
diff --git a/chrome/browser/resources/chromeos/contact_center_insights/BUILD.gn b/chrome/browser/resources/chromeos/contact_center_insights/BUILD.gn index f89e95c..0b2f9b3 100644 --- a/chrome/browser/resources/chromeos/contact_center_insights/BUILD.gn +++ b/chrome/browser/resources/chromeos/contact_center_insights/BUILD.gn
@@ -16,7 +16,7 @@ "//components/reporting/proto:metric_data_proto", "//components/reporting/proto:record_constants", "//components/reporting/proto:record_proto", - "//components/reporting/util:status_proto", + "//components/reporting/proto:status_proto", ] deps = [ "//third_party/protobuf:js_proto" ] @@ -27,7 +27,7 @@ "${reporting_proto_js_dir}/metric_data.js", "${reporting_proto_js_dir}/record.js", "${reporting_proto_js_dir}/record_constants.js", - "${root_out_dir}/jsproto/components/reporting/util/status.js", + "${reporting_proto_js_dir}/status.js", ] }
diff --git a/chrome/browser/resources/chromeos/crostini_installer/BUILD.gn b/chrome/browser/resources/chromeos/crostini_installer/BUILD.gn index 01529ad..864999d 100644 --- a/chrome/browser/resources/chromeos/crostini_installer/BUILD.gn +++ b/chrome/browser/resources/chromeos/crostini_installer/BUILD.gn
@@ -31,7 +31,7 @@ js_library("browser_proxy") { deps = [ "//chrome/browser/ui/webui/ash/crostini_installer:mojo_bindings_js_library_for_compile", - "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] }
diff --git a/chrome/browser/resources/chromeos/crostini_installer/browser_proxy.js b/chrome/browser/resources/chromeos/crostini_installer/browser_proxy.js index c0edd44..daa1fd1 100644 --- a/chrome/browser/resources/chromeos/crostini_installer/browser_proxy.js +++ b/chrome/browser/resources/chromeos/crostini_installer/browser_proxy.js
@@ -6,7 +6,7 @@ import './crostini_types.mojom-lite.js'; import './crostini_installer.mojom-lite.js'; -import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; export class BrowserProxy { constructor() {
diff --git a/chrome/browser/resources/chromeos/crostini_upgrader/BUILD.gn b/chrome/browser/resources/chromeos/crostini_upgrader/BUILD.gn index f0767a9..3626acc1 100644 --- a/chrome/browser/resources/chromeos/crostini_upgrader/BUILD.gn +++ b/chrome/browser/resources/chromeos/crostini_upgrader/BUILD.gn
@@ -30,7 +30,7 @@ js_library("browser_proxy") { deps = [ "//chrome/browser/ui/webui/ash/crostini_upgrader:mojo_bindings_js_library_for_compile", - "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] }
diff --git a/chrome/browser/resources/chromeos/crostini_upgrader/browser_proxy.js b/chrome/browser/resources/chromeos/crostini_upgrader/browser_proxy.js index 14b38abe..501836c 100644 --- a/chrome/browser/resources/chromeos/crostini_upgrader/browser_proxy.js +++ b/chrome/browser/resources/chromeos/crostini_upgrader/browser_proxy.js
@@ -6,7 +6,7 @@ import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js'; import './crostini_upgrader.mojom-lite.js'; -import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; export class BrowserProxy { constructor() {
diff --git a/chrome/browser/resources/chromeos/edu_coexistence/edu_coexistence_browser_proxy.js b/chrome/browser/resources/chromeos/edu_coexistence/edu_coexistence_browser_proxy.js index 10fe1841..d75817e 100644 --- a/chrome/browser/resources/chromeos/edu_coexistence/edu_coexistence_browser_proxy.js +++ b/chrome/browser/resources/chromeos/edu_coexistence/edu_coexistence_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; import {AuthCompletedCredentials} from '../../gaia_auth_host/authenticator.js';
diff --git a/chrome/browser/resources/chromeos/emoji_picker/BUILD.gn b/chrome/browser/resources/chromeos/emoji_picker/BUILD.gn index a8706b7..56a8b3a 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/BUILD.gn +++ b/chrome/browser/resources/chromeos/emoji_picker/BUILD.gn
@@ -209,7 +209,7 @@ js_library("emoji_picker_api_proxy") { deps = [ "//chrome/browser/ui/webui/ash/emoji:mojo_bindings_webui_js", - "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] }
diff --git a/chrome/browser/resources/chromeos/emoji_picker/emoji_picker_api_proxy.js b/chrome/browser/resources/chromeos/emoji_picker/emoji_picker_api_proxy.js index 4dfe4c3..b285335 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/emoji_picker_api_proxy.js +++ b/chrome/browser/resources/chromeos/emoji_picker/emoji_picker_api_proxy.js
@@ -1,7 +1,7 @@ // Copyright 2021 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; import {Feature, PageHandlerFactory, PageHandlerRemote} from './emoji_picker.mojom-webui.js';
diff --git a/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn b/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn index 6e49416..583aa6d 100644 --- a/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn +++ b/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn
@@ -99,7 +99,8 @@ } js_library("internet_detail_dialog_browser_proxy") { - deps = [ "//ui/webui/resources/js:cr.m" ] + deps = [ "//ui/webui/resources/js:cr_deprecated" ] + externs_list = [ "$externs_path/chrome_send.js" ] } html_to_js("web_components") {
diff --git a/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog_browser_proxy.js b/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog_browser_proxy.js index 59ad1de8..3725b072 100644 --- a/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog_browser_proxy.js +++ b/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog_browser_proxy.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** * @fileoverview A helper object used from the internet detail dialog @@ -51,4 +51,4 @@ // The singleton instance_ is replaced with a test version of this wrapper // during testing. -addSingletonGetter(InternetDetailDialogBrowserProxyImpl); \ No newline at end of file +addSingletonGetter(InternetDetailDialogBrowserProxyImpl);
diff --git a/chrome/browser/resources/chromeos/login/BUILD.gn b/chrome/browser/resources/chromeos/login/BUILD.gn index 66808896..e6378ea 100644 --- a/chrome/browser/resources/chromeos/login/BUILD.gn +++ b/chrome/browser/resources/chromeos/login/BUILD.gn
@@ -381,6 +381,7 @@ deps = [ ":display_manager.m", "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", "//ui/webui/resources/js:load_time_data.m", ] extra_deps = [ ":modulize" ]
diff --git a/chrome/browser/resources/chromeos/login/components/test_util.js b/chrome/browser/resources/chromeos/login/components/test_util.js index e85a7120..a6afdb66 100644 --- a/chrome/browser/resources/chromeos/login/components/test_util.js +++ b/chrome/browser/resources/chromeos/login/components/test_util.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// #import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; +// #import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; class ErrorStore { constructor() {
diff --git a/chrome/browser/resources/chromeos/login/cr_ui.js b/chrome/browser/resources/chromeos/login/cr_ui.js index 47b4b86..3ee2c78 100644 --- a/chrome/browser/resources/chromeos/login/cr_ui.js +++ b/chrome/browser/resources/chromeos/login/cr_ui.js
@@ -10,7 +10,8 @@ // #import {assert} from 'chrome://resources/js/assert.js'; // #import {$} from 'chrome://resources/js/util.js'; -// #import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +// #import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +// #import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; // #import {DisplayManager} from './display_manager.m.js'; // #import {DISPLAY_TYPE} from './components/display_manager_types.m.js';
diff --git a/chrome/browser/resources/chromeos/login/debug/debug.js b/chrome/browser/resources/chromeos/login/debug/debug.js index f36dece..efaf93c0 100644 --- a/chrome/browser/resources/chromeos/login/debug/debug.js +++ b/chrome/browser/resources/chromeos/login/debug/debug.js
@@ -6,7 +6,7 @@ * @fileoverview Root element of the OOBE UI Debugger. */ -// #import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; +// #import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; // #import {loadTimeData} from '../i18n_setup.js'; // #import {Oobe} from '../cr_ui.m.js' // #import {$} from 'chrome://resources/js/util.js';
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/BUILD.gn b/chrome/browser/resources/chromeos/multidevice_internals/BUILD.gn index 20db57bd..a3bae870 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/BUILD.gn +++ b/chrome/browser/resources/chromeos/multidevice_internals/BUILD.gn
@@ -125,7 +125,7 @@ js_library("multidevice_phonehub_browser_proxy") { deps = [ ":types", - "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] } @@ -162,6 +162,7 @@ deps = [ ":types", "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] }
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/multidevice_logs_browser_proxy.js b/chrome/browser/resources/chromeos/multidevice_internals/multidevice_logs_browser_proxy.js index 94c51dc2..3b1358d1 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/multidevice_logs_browser_proxy.js +++ b/chrome/browser/resources/chromeos/multidevice_internals/multidevice_logs_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; import {LogMessage} from './types.js'; /**
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/multidevice_phonehub_browser_proxy.js b/chrome/browser/resources/chromeos/multidevice_internals/multidevice_phonehub_browser_proxy.js index 98cb6dd..93ac534 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/multidevice_phonehub_browser_proxy.js +++ b/chrome/browser/resources/chromeos/multidevice_internals/multidevice_phonehub_browser_proxy.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import { addSingletonGetter } from 'chrome://resources/js/cr.m.js'; +import { addSingletonGetter } from 'chrome://resources/js/cr_deprecated.js'; import { BrowserTabsModel, CameraRollManager, FeatureStatus, FindMyDeviceStatus, Notification, PhoneStatusModel, TetherStatus } from './types.js';
diff --git a/chrome/browser/resources/chromeos/multidevice_setup/BUILD.gn b/chrome/browser/resources/chromeos/multidevice_setup/BUILD.gn index 3a556a0..2be1783 100644 --- a/chrome/browser/resources/chromeos/multidevice_setup/BUILD.gn +++ b/chrome/browser/resources/chromeos/multidevice_setup/BUILD.gn
@@ -28,8 +28,8 @@ "chrome://resources/mojo/mojo/public/mojom/base/time.mojom-lite.js", "chrome://resources/mojo/chromeos/ash/components/multidevice/mojom/multidevice_types.mojom-lite.js", "chrome://resources/mojo/chromeos/ash/components/multidevice/mojom/multidevice_types.mojom-webui.js", - "chrome://resources/mojo/ash/services/device_sync/public/mojom/device_sync.mojom-lite.js", - "chrome://resources/mojo/ash/services/device_sync/public/mojom/device_sync.mojom-webui.js", + "chrome://resources/mojo/chromeos/ash/services/device_sync/public/mojom/device_sync.mojom-lite.js", + "chrome://resources/mojo/chromeos/ash/services/device_sync/public/mojom/device_sync.mojom-webui.js", "chrome://resources/mojo/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom-lite.js", "chrome://resources/mojo/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom-webui.js", ]
diff --git a/chrome/browser/resources/chromeos/network_ui/BUILD.gn b/chrome/browser/resources/chromeos/network_ui/BUILD.gn index 0833a758..47f7d496 100644 --- a/chrome/browser/resources/chromeos/network_ui/BUILD.gn +++ b/chrome/browser/resources/chromeos/network_ui/BUILD.gn
@@ -119,7 +119,10 @@ } js_library("network_ui_browser_proxy") { - deps = [ "//ui/webui/resources/js:cr.m" ] + deps = [ + "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", + ] } html_to_js("web_components") {
diff --git a/chrome/browser/resources/chromeos/network_ui/network_ui_browser_proxy.js b/chrome/browser/resources/chromeos/network_ui/network_ui_browser_proxy.js index 91f98a9..ff49cef 100644 --- a/chrome/browser/resources/chromeos/network_ui/network_ui_browser_proxy.js +++ b/chrome/browser/resources/chromeos/network_ui/network_ui_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** @interface */ export class NetworkUIBrowserProxy {
diff --git a/chrome/browser/resources/chromeos/set_time_dialog/BUILD.gn b/chrome/browser/resources/chromeos/set_time_dialog/BUILD.gn index f9daecf..0e7dc01 100644 --- a/chrome/browser/resources/chromeos/set_time_dialog/BUILD.gn +++ b/chrome/browser/resources/chromeos/set_time_dialog/BUILD.gn
@@ -27,7 +27,7 @@ } js_library("set_time_browser_proxy") { - deps = [ "//ui/webui/resources/js:cr.m" ] + deps = [ "//ui/webui/resources/js:cr_deprecated" ] externs_list = [ "$externs_path/chrome_send.js" ] }
diff --git a/chrome/browser/resources/chromeos/set_time_dialog/set_time_browser_proxy.js b/chrome/browser/resources/chromeos/set_time_dialog/set_time_browser_proxy.js index 0f2cda04..e0dbf0e 100644 --- a/chrome/browser/resources/chromeos/set_time_dialog/set_time_browser_proxy.js +++ b/chrome/browser/resources/chromeos/set_time_dialog/set_time_browser_proxy.js
@@ -4,7 +4,7 @@ /** @fileoverview A helper object used by the "Set Time" dialog. */ -import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** @interface */ export class SetTimeBrowserProxy {
diff --git a/chrome/browser/resources/internals/lens/BUILD.gn b/chrome/browser/resources/internals/lens/BUILD.gn index 369a8a8a..69c4a9df 100644 --- a/chrome/browser/resources/internals/lens/BUILD.gn +++ b/chrome/browser/resources/internals/lens/BUILD.gn
@@ -33,5 +33,8 @@ } js_library("lens_internals_browser_proxy") { - deps = [ "//ui/webui/resources/js:cr.m" ] + deps = [ + "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", + ] }
diff --git a/chrome/browser/resources/internals/lens/lens_internals_browser_proxy.js b/chrome/browser/resources/internals/lens/lens_internals_browser_proxy.js index 1537d2f..1843c82 100644 --- a/chrome/browser/resources/internals/lens/lens_internals_browser_proxy.js +++ b/chrome/browser/resources/internals/lens/lens_internals_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** @interface */ export class LensInternalsBrowserProxy {
diff --git a/chrome/browser/resources/internals/query_tiles/BUILD.gn b/chrome/browser/resources/internals/query_tiles/BUILD.gn index a45a4b6c..42cb2d5 100644 --- a/chrome/browser/resources/internals/query_tiles/BUILD.gn +++ b/chrome/browser/resources/internals/query_tiles/BUILD.gn
@@ -22,5 +22,8 @@ } js_library("query_tiles_internals_browser_proxy") { - deps = [ "//ui/webui/resources/js:cr.m" ] + deps = [ + "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", + ] }
diff --git a/chrome/browser/resources/internals/query_tiles/query_tiles_internals_browser_proxy.js b/chrome/browser/resources/internals/query_tiles/query_tiles_internals_browser_proxy.js index beed2d18..dbc7fb5 100644 --- a/chrome/browser/resources/internals/query_tiles/query_tiles_internals_browser_proxy.js +++ b/chrome/browser/resources/internals/query_tiles/query_tiles_internals_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** * @typedef {{
diff --git a/chrome/browser/resources/nearby_internals/BUILD.gn b/chrome/browser/resources/nearby_internals/BUILD.gn index 35f4224..cbcb8461 100644 --- a/chrome/browser/resources/nearby_internals/BUILD.gn +++ b/chrome/browser/resources/nearby_internals/BUILD.gn
@@ -144,13 +144,14 @@ deps = [ ":types", "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] } js_library("nearby_prefs_browser_proxy") { deps = [ ":types", - "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] } @@ -158,6 +159,7 @@ deps = [ ":types", "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] } @@ -182,6 +184,7 @@ deps = [ ":types", "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] } @@ -229,6 +232,7 @@ deps = [ ":types", "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", ] }
diff --git a/chrome/browser/resources/nearby_internals/nearby_contact_browser_proxy.js b/chrome/browser/resources/nearby_internals/nearby_contact_browser_proxy.js index 1953ddf4..73235843 100644 --- a/chrome/browser/resources/nearby_internals/nearby_contact_browser_proxy.js +++ b/chrome/browser/resources/nearby_internals/nearby_contact_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; import {ContactUpdate} from './types.js'; /**
diff --git a/chrome/browser/resources/nearby_internals/nearby_http_browser_proxy.js b/chrome/browser/resources/nearby_internals/nearby_http_browser_proxy.js index 3fd2882..d9d7a9a9 100644 --- a/chrome/browser/resources/nearby_internals/nearby_http_browser_proxy.js +++ b/chrome/browser/resources/nearby_internals/nearby_http_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; import {HttpMessage} from './types.js'; /**
diff --git a/chrome/browser/resources/nearby_internals/nearby_logs_browser_proxy.js b/chrome/browser/resources/nearby_internals/nearby_logs_browser_proxy.js index b576c99..7deddc6 100644 --- a/chrome/browser/resources/nearby_internals/nearby_logs_browser_proxy.js +++ b/chrome/browser/resources/nearby_internals/nearby_logs_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; import {LogMessage} from './types.js'; /**
diff --git a/chrome/browser/resources/nearby_internals/nearby_prefs_browser_proxy.js b/chrome/browser/resources/nearby_internals/nearby_prefs_browser_proxy.js index 0b6fc55..ea409cf 100644 --- a/chrome/browser/resources/nearby_internals/nearby_prefs_browser_proxy.js +++ b/chrome/browser/resources/nearby_internals/nearby_prefs_browser_proxy.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** * JavaScript hooks into the native WebUI handler to communicate with C++ about
diff --git a/chrome/browser/resources/nearby_internals/nearby_ui_trigger_browser_proxy.js b/chrome/browser/resources/nearby_internals/nearby_ui_trigger_browser_proxy.js index a5fbeba..288dc12 100644 --- a/chrome/browser/resources/nearby_internals/nearby_ui_trigger_browser_proxy.js +++ b/chrome/browser/resources/nearby_internals/nearby_ui_trigger_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; import {NearbyShareStates, StatusCode} from './types.js'; /**
diff --git a/chrome/browser/resources/net_internals/browser_bridge.js b/chrome/browser/resources/net_internals/browser_bridge.js index 3ee30a3..d1a0e78 100644 --- a/chrome/browser/resources/net_internals/browser_bridge.js +++ b/chrome/browser/resources/net_internals/browser_bridge.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** * This class provides a "bridge" for communicating between the javascript and
diff --git a/chrome/browser/resources/offline_pages/BUILD.gn b/chrome/browser/resources/offline_pages/BUILD.gn index 4c099ca..89224e4e 100644 --- a/chrome/browser/resources/offline_pages/BUILD.gn +++ b/chrome/browser/resources/offline_pages/BUILD.gn
@@ -20,5 +20,8 @@ } js_library("offline_internals_browser_proxy") { - deps = [ "//ui/webui/resources/js:cr.m" ] + deps = [ + "//ui/webui/resources/js:cr.m", + "//ui/webui/resources/js:cr_deprecated", + ] }
diff --git a/chrome/browser/resources/offline_pages/offline_internals_browser_proxy.js b/chrome/browser/resources/offline_pages/offline_internals_browser_proxy.js index f53b7c5..8ccda0de 100644 --- a/chrome/browser/resources/offline_pages/offline_internals_browser_proxy.js +++ b/chrome/browser/resources/offline_pages/offline_internals_browser_proxy.js
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; /** * @typedef {{
diff --git a/chrome/browser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_summary.js b/chrome/browser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_summary.js index bb6e829..b37ff0a58 100644 --- a/chrome/browser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_summary.js +++ b/chrome/browser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_summary.js
@@ -125,9 +125,6 @@ /** @private */ onSystemPropertiesChanged_() { - if (this.isToggleDisabled_()) { - return; - } this.isBluetoothToggleOn_ = this.systemProperties.systemState === BluetoothSystemState.kEnabled || this.systemProperties.systemState === BluetoothSystemState.kEnabling; @@ -144,6 +141,12 @@ if (oldValue === undefined) { return; } + // If the toggle value changed but the toggle is disabled, the change came + // from CrosBluetoothConfig, not the user. Don't attempt to update the + // enabled state. + if (this.isToggleDisabled_()) { + return; + } getBluetoothConfig().setBluetoothEnabledState(this.isBluetoothToggleOn_); }
diff --git a/chrome/browser/resources/settings/chromeos/os_printing_page/cups_edit_printer_dialog.js b/chrome/browser/resources/settings/chromeos/os_printing_page/cups_edit_printer_dialog.js index 86541b4..b4cea0e 100644 --- a/chrome/browser/resources/settings/chromeos/os_printing_page/cups_edit_printer_dialog.js +++ b/chrome/browser/resources/settings/chromeos/os_printing_page/cups_edit_printer_dialog.js
@@ -17,11 +17,12 @@ import './cups_printer_dialog_error.js'; import './cups_printer_shared_css.js'; +import {I18nBehavior, I18nBehaviorInterface} from 'chrome://resources/ash/common/i18n_behavior.js'; import {MojoInterfaceProvider, MojoInterfaceProviderImpl} from 'chrome://resources/ash/common/network/mojo_interface_provider.js'; import {NetworkListenerBehavior, NetworkListenerBehaviorInterface} from 'chrome://resources/ash/common/network/network_listener_behavior.js'; import {OncMojo} from 'chrome://resources/ash/common/network/onc_mojo.js'; -import {I18nBehavior, I18nBehaviorInterface} from 'chrome://resources/ash/common/i18n_behavior.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; +import {HTMLEscape} from 'chrome://resources/js/util.js'; import {CrosNetworkConfigRemote, FilterType, NetworkStateProperties, NO_LIMIT} from 'chrome://resources/mojo/chromeos/services/network_config/public/mojom/cros_network_config.mojom-webui.js'; import {NetworkType} from 'chrome://resources/mojo/chromeos/services/network_config/public/mojom/network_types.mojom-webui.js'; import {html, mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -465,7 +466,8 @@ const htmlText = '<!DOCTYPE html><html><body><h1>' + loadTimeData.getStringF('cupsPrintersPpdFor', ppdInfo.printerName) + - '</h1>' + eulaHtml + '<p><pre>' + ppdInfo.ppd + '</pre></p>'; + '</h1>' + eulaHtml + '<p><pre>' + HTMLEscape(ppdInfo.ppd) + + '</pre></p>'; const win = window.open(''); win.document.title = ppdInfo.printerName;
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc index e91b8cb..d9d2d8d 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc
@@ -4,7 +4,6 @@ #include "chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.h" -#include <algorithm> #include <iterator> #include <memory> #include <utility> @@ -15,6 +14,7 @@ #include "base/callback_helpers.h" #include "base/memory/ref_counted.h" #include "base/metrics/histogram_macros.h" +#include "base/ranges/algorithm.h" #include "base/sequence_checker.h" #include "base/synchronization/lock.h" #include "base/win/registry.h" @@ -58,9 +58,8 @@ bool CopyProfilesToReset(const std::vector<Profile*>& profiles, std::vector<Profile*>* profiles_to_reset) { - std::copy_if(profiles.begin(), profiles.end(), - std::back_inserter(*profiles_to_reset), - [](Profile* profile) -> bool { return ResetPending(profile); }); + base::ranges::copy_if(profiles, std::back_inserter(*profiles_to_reset), + &ResetPending); return !profiles_to_reset->empty(); }
diff --git a/chrome/browser/sessions/session_restore_browsertest.cc b/chrome/browser/sessions/session_restore_browsertest.cc index aadcb23..f509e45 100644 --- a/chrome/browser/sessions/session_restore_browsertest.cc +++ b/chrome/browser/sessions/session_restore_browsertest.cc
@@ -70,6 +70,7 @@ #include "chrome/browser/web_applications/test/web_app_install_test_utils.h" #include "chrome/browser/web_applications/user_display_mode.h" #include "chrome/browser/web_applications/web_app_provider.h" +#include "chrome/browser/web_applications/web_app_tab_helper.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" @@ -4079,6 +4080,10 @@ EXPECT_EQ(browser->tab_strip_model()->count(), 2); EXPECT_TRUE(browser->tab_strip_model()->IsTabPinned(0)); EXPECT_FALSE(browser->tab_strip_model()->IsTabPinned(1)); + + EXPECT_TRUE(web_app::WebAppTabHelper::FromWebContents( + browser->tab_strip_model()->GetWebContentsAt(0)) + ->is_pinned_home_tab()); app_checked = true; } }
diff --git a/chrome/browser/sharesheet/sharesheet_service.cc b/chrome/browser/sharesheet/sharesheet_service.cc index a23c158..9e82405 100644 --- a/chrome/browser/sharesheet/sharesheet_service.cc +++ b/chrome/browser/sharesheet/sharesheet_service.cc
@@ -19,7 +19,6 @@ #include "chrome/grit/generated_resources.h" #include "components/services/app_service/public/cpp/app_launch_util.h" #include "components/services/app_service/public/cpp/app_types.h" -#include "components/services/app_service/public/cpp/features.h" #include "components/services/app_service/public/cpp/intent_util.h" #include "content/public/browser/web_contents.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -390,23 +389,13 @@ void SharesheetService::LaunchApp(const std::u16string& target_name, apps::IntentPtr intent) { - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - app_service_proxy_->LaunchAppWithIntent( - base::UTF16ToUTF8(target_name), - apps::GetEventFlags(WindowOpenDisposition::NEW_WINDOW, - /*prefer_container=*/true), - std::move(intent), apps::LaunchSource::kFromSharesheet, - std::make_unique<apps::WindowInfo>(display::kDefaultDisplayId), - base::DoNothing()); - } else { - app_service_proxy_->LaunchAppWithIntent( - base::UTF16ToUTF8(target_name), - apps::GetEventFlags(WindowOpenDisposition::NEW_WINDOW, - /*prefer_container=*/true), - apps::ConvertIntentToMojomIntent(intent), - apps::mojom::LaunchSource::kFromSharesheet, - apps::MakeWindowInfo(display::kDefaultDisplayId), {}); - } + app_service_proxy_->LaunchAppWithIntent( + base::UTF16ToUTF8(target_name), + apps::GetEventFlags(WindowOpenDisposition::NEW_WINDOW, + /*prefer_container=*/true), + std::move(intent), apps::LaunchSource::kFromSharesheet, + std::make_unique<apps::WindowInfo>(display::kDefaultDisplayId), + base::DoNothing()); } SharesheetServiceDelegator* SharesheetService::GetOrCreateDelegator(
diff --git a/chrome/browser/speech/extension_api/tts_extension_api_ash_browsertest.cc b/chrome/browser/speech/extension_api/tts_extension_api_ash_browsertest.cc index b11cc7f..e6e0eb7 100644 --- a/chrome/browser/speech/extension_api/tts_extension_api_ash_browsertest.cc +++ b/chrome/browser/speech/extension_api/tts_extension_api_ash_browsertest.cc
@@ -118,7 +118,7 @@ // TTS Engine tests. // -IN_PROC_BROWSER_TEST_F(AshTtsApiTest, RegisterEngine) { +IN_PROC_BROWSER_TEST_F(AshTtsApiTest, RegisterAshEngine) { if (!ash_starter_.HasLacrosArgument()) return;
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 9cbf15f..30e2d5a 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -2791,12 +2791,74 @@ "webui/ash/login/local_state_error_screen_handler.h", "webui/ash/login/locale_switch_screen_handler.cc", "webui/ash/login/locale_switch_screen_handler.h", + "webui/ash/login/management_transition_screen_handler.cc", + "webui/ash/login/management_transition_screen_handler.h", + "webui/ash/login/marketing_opt_in_screen_handler.cc", + "webui/ash/login/marketing_opt_in_screen_handler.h", + "webui/ash/login/multidevice_setup_screen_handler.cc", + "webui/ash/login/multidevice_setup_screen_handler.h", + "webui/ash/login/network_dropdown_handler.cc", + "webui/ash/login/network_dropdown_handler.h", + "webui/ash/login/network_screen_handler.cc", + "webui/ash/login/network_screen_handler.h", + "webui/ash/login/network_state_informer.cc", + "webui/ash/login/network_state_informer.h", + "webui/ash/login/offline_login_screen_handler.cc", + "webui/ash/login/offline_login_screen_handler.h", + "webui/ash/login/online_login_helper.cc", + "webui/ash/login/online_login_helper.h", "webui/ash/login/oobe_display_chooser.cc", "webui/ash/login/oobe_display_chooser.h", "webui/ash/login/oobe_ui.cc", "webui/ash/login/oobe_ui.h", + "webui/ash/login/os_install_screen_handler.cc", + "webui/ash/login/os_install_screen_handler.h", + "webui/ash/login/os_trial_screen_handler.cc", + "webui/ash/login/os_trial_screen_handler.h", + "webui/ash/login/packaged_license_screen_handler.cc", + "webui/ash/login/packaged_license_screen_handler.h", + "webui/ash/login/parental_handoff_screen_handler.cc", + "webui/ash/login/parental_handoff_screen_handler.h", + "webui/ash/login/pin_setup_screen_handler.cc", + "webui/ash/login/pin_setup_screen_handler.h", + "webui/ash/login/quick_start_screen_handler.cc", + "webui/ash/login/quick_start_screen_handler.h", + "webui/ash/login/recommend_apps_screen_handler.cc", + "webui/ash/login/recommend_apps_screen_handler.h", + "webui/ash/login/reset_screen_handler.cc", + "webui/ash/login/reset_screen_handler.h", + "webui/ash/login/saml_challenge_key_handler.cc", + "webui/ash/login/saml_challenge_key_handler.h", + "webui/ash/login/saml_confirm_password_handler.cc", + "webui/ash/login/saml_confirm_password_handler.h", + "webui/ash/login/signin_fatal_error_screen_handler.cc", + "webui/ash/login/signin_fatal_error_screen_handler.h", + "webui/ash/login/signin_screen_handler.cc", + "webui/ash/login/signin_screen_handler.h", + "webui/ash/login/smart_privacy_protection_screen_handler.cc", + "webui/ash/login/smart_privacy_protection_screen_handler.h", + "webui/ash/login/ssh_configured_handler.cc", + "webui/ash/login/ssh_configured_handler.h", + "webui/ash/login/sync_consent_screen_handler.cc", + "webui/ash/login/sync_consent_screen_handler.h", + "webui/ash/login/terms_of_service_screen_handler.cc", + "webui/ash/login/terms_of_service_screen_handler.h", "webui/ash/login/testapi/oobe_test_api_handler.cc", "webui/ash/login/testapi/oobe_test_api_handler.h", + "webui/ash/login/theme_selection_screen_handler.cc", + "webui/ash/login/theme_selection_screen_handler.h", + "webui/ash/login/tpm_error_screen_handler.cc", + "webui/ash/login/tpm_error_screen_handler.h", + "webui/ash/login/update_required_screen_handler.cc", + "webui/ash/login/update_required_screen_handler.h", + "webui/ash/login/update_screen_handler.cc", + "webui/ash/login/update_screen_handler.h", + "webui/ash/login/user_creation_screen_handler.cc", + "webui/ash/login/user_creation_screen_handler.h", + "webui/ash/login/welcome_screen_handler.cc", + "webui/ash/login/welcome_screen_handler.h", + "webui/ash/login/wrong_hwid_screen_handler.cc", + "webui/ash/login/wrong_hwid_screen_handler.h", "webui/ash/manage_mirrorsync/manage_mirrorsync_dialog.cc", "webui/ash/manage_mirrorsync/manage_mirrorsync_dialog.h", "webui/ash/manage_mirrorsync/manage_mirrorsync_page_handler.cc", @@ -2865,68 +2927,6 @@ "webui/chromeos/assistant_optin/assistant_optin_ui.h", "webui/chromeos/assistant_optin/assistant_optin_utils.cc", "webui/chromeos/assistant_optin/assistant_optin_utils.h", - "webui/chromeos/login/management_transition_screen_handler.cc", - "webui/chromeos/login/management_transition_screen_handler.h", - "webui/chromeos/login/marketing_opt_in_screen_handler.cc", - "webui/chromeos/login/marketing_opt_in_screen_handler.h", - "webui/chromeos/login/multidevice_setup_screen_handler.cc", - "webui/chromeos/login/multidevice_setup_screen_handler.h", - "webui/chromeos/login/network_dropdown_handler.cc", - "webui/chromeos/login/network_dropdown_handler.h", - "webui/chromeos/login/network_screen_handler.cc", - "webui/chromeos/login/network_screen_handler.h", - "webui/chromeos/login/network_state_informer.cc", - "webui/chromeos/login/network_state_informer.h", - "webui/chromeos/login/offline_login_screen_handler.cc", - "webui/chromeos/login/offline_login_screen_handler.h", - "webui/chromeos/login/online_login_helper.cc", - "webui/chromeos/login/online_login_helper.h", - "webui/chromeos/login/os_install_screen_handler.cc", - "webui/chromeos/login/os_install_screen_handler.h", - "webui/chromeos/login/os_trial_screen_handler.cc", - "webui/chromeos/login/os_trial_screen_handler.h", - "webui/chromeos/login/packaged_license_screen_handler.cc", - "webui/chromeos/login/packaged_license_screen_handler.h", - "webui/chromeos/login/parental_handoff_screen_handler.cc", - "webui/chromeos/login/parental_handoff_screen_handler.h", - "webui/chromeos/login/pin_setup_screen_handler.cc", - "webui/chromeos/login/pin_setup_screen_handler.h", - "webui/chromeos/login/quick_start_screen_handler.cc", - "webui/chromeos/login/quick_start_screen_handler.h", - "webui/chromeos/login/recommend_apps_screen_handler.cc", - "webui/chromeos/login/recommend_apps_screen_handler.h", - "webui/chromeos/login/reset_screen_handler.cc", - "webui/chromeos/login/reset_screen_handler.h", - "webui/chromeos/login/saml_challenge_key_handler.cc", - "webui/chromeos/login/saml_challenge_key_handler.h", - "webui/chromeos/login/saml_confirm_password_handler.cc", - "webui/chromeos/login/saml_confirm_password_handler.h", - "webui/chromeos/login/signin_fatal_error_screen_handler.cc", - "webui/chromeos/login/signin_fatal_error_screen_handler.h", - "webui/chromeos/login/signin_screen_handler.cc", - "webui/chromeos/login/signin_screen_handler.h", - "webui/chromeos/login/smart_privacy_protection_screen_handler.cc", - "webui/chromeos/login/smart_privacy_protection_screen_handler.h", - "webui/chromeos/login/ssh_configured_handler.cc", - "webui/chromeos/login/ssh_configured_handler.h", - "webui/chromeos/login/sync_consent_screen_handler.cc", - "webui/chromeos/login/sync_consent_screen_handler.h", - "webui/chromeos/login/terms_of_service_screen_handler.cc", - "webui/chromeos/login/terms_of_service_screen_handler.h", - "webui/chromeos/login/theme_selection_screen_handler.cc", - "webui/chromeos/login/theme_selection_screen_handler.h", - "webui/chromeos/login/tpm_error_screen_handler.cc", - "webui/chromeos/login/tpm_error_screen_handler.h", - "webui/chromeos/login/update_required_screen_handler.cc", - "webui/chromeos/login/update_required_screen_handler.h", - "webui/chromeos/login/update_screen_handler.cc", - "webui/chromeos/login/update_screen_handler.h", - "webui/chromeos/login/user_creation_screen_handler.cc", - "webui/chromeos/login/user_creation_screen_handler.h", - "webui/chromeos/login/welcome_screen_handler.cc", - "webui/chromeos/login/welcome_screen_handler.h", - "webui/chromeos/login/wrong_hwid_screen_handler.cc", - "webui/chromeos/login/wrong_hwid_screen_handler.h", "webui/extensions/ash/kiosk_apps_handler.cc", "webui/extensions/ash/kiosk_apps_handler.h", "webui/help/help_utils_chromeos.cc",
diff --git a/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.cc b/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.cc index 8c3da3a..2f9bab18 100644 --- a/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.cc +++ b/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.cc
@@ -19,6 +19,7 @@ #include "chrome/browser/ssl/security_state_tab_helper.h" #include "chrome/browser/vr/vr_tab_helper.h" #include "chrome/common/url_constants.h" +#include "components/permissions/permission_util.h" #include "components/security_state/core/security_state.h" #include "components/url_formatter/elide_url.h" #include "content/public/browser/render_frame_host.h" @@ -27,11 +28,44 @@ #include "ui/android/window_android.h" #include "url/gurl.h" +namespace { + +UsbChooserDialogAndroid::CreateJavaDialogCallback +GetCreateJavaUsbChooserDialogCallback() { + return base::BindOnce(&Java_UsbChooserDialog_create); +} + +} // namespace + // static std::unique_ptr<UsbChooserDialogAndroid> UsbChooserDialogAndroid::Create( content::RenderFrameHost* render_frame_host, std::unique_ptr<permissions::ChooserController> controller, base::OnceClosure on_close) { + return CreateInternal(render_frame_host, std::move(controller), + std::move(on_close), + GetCreateJavaUsbChooserDialogCallback()); +} + +// static +std::unique_ptr<UsbChooserDialogAndroid> +UsbChooserDialogAndroid::CreateForTesting( + content::RenderFrameHost* render_frame_host, + std::unique_ptr<permissions::ChooserController> controller, + base::OnceClosure on_close, + CreateJavaDialogCallback create_java_dialog_callback) { + return CreateInternal(render_frame_host, std::move(controller), + std::move(on_close), + std::move(create_java_dialog_callback)); +} + +// static +std::unique_ptr<UsbChooserDialogAndroid> +UsbChooserDialogAndroid::CreateInternal( + content::RenderFrameHost* render_frame_host, + std::unique_ptr<permissions::ChooserController> controller, + base::OnceClosure on_close, + CreateJavaDialogCallback create_java_dialog_callback) { content::WebContents* web_contents = content::WebContents::FromRenderFrameHost(render_frame_host); @@ -46,10 +80,14 @@ base::android::ScopedJavaLocalRef<jobject> window_android = web_contents->GetNativeView()->GetWindowAndroid()->GetJavaObject(); JNIEnv* env = base::android::AttachCurrentThread(); + // Permission delegation means the permission request should be + // attributed to the main frame. + const auto origin = url::Origin::Create( + permissions::PermissionUtil::GetLastCommittedOriginAsURL( + render_frame_host->GetMainFrame())); base::android::ScopedJavaLocalRef<jstring> origin_string = base::android::ConvertUTF16ToJavaString( - env, url_formatter::FormatOriginForSecurityDisplay( - render_frame_host->GetLastCommittedOrigin())); + env, url_formatter::FormatOriginForSecurityDisplay(origin)); SecurityStateTabHelper* helper = SecurityStateTabHelper::FromWebContents(web_contents); DCHECK(helper); @@ -64,9 +102,11 @@ auto dialog = std::make_unique<UsbChooserDialogAndroid>(std::move(controller), std::move(on_close)); - dialog->java_dialog_.Reset(Java_UsbChooserDialog_create( - env, window_android, origin_string, helper->GetSecurityLevel(), - j_profile_android, reinterpret_cast<intptr_t>(dialog.get()))); + + dialog->java_dialog_.Reset( + std::move(create_java_dialog_callback) + .Run(env, window_android, origin_string, helper->GetSecurityLevel(), + j_profile_android, reinterpret_cast<intptr_t>(dialog.get()))); if (dialog->java_dialog_.is_null()) return nullptr;
diff --git a/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.h b/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.h index da26628..fbc17d53 100644 --- a/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.h +++ b/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.h
@@ -9,6 +9,9 @@ #include <string> #include <vector> +#include "base/android/jni_android.h" +#include "base/android/jni_int_wrapper.h" +#include "base/android/jni_string.h" #include "base/android/scoped_java_ref.h" #include "base/callback.h" #include "components/permissions/chooser_controller.h" @@ -21,6 +24,16 @@ // options. class UsbChooserDialogAndroid : public permissions::ChooserController::View { public: + // The callback type for creating the java dialog object. + using CreateJavaDialogCallback = + base::OnceCallback<base::android::ScopedJavaLocalRef<jobject>( + JNIEnv*, + const base::android::JavaRef<jobject>&, + const base::android::JavaRef<jstring>&, + JniIntWrapper, + const base::android::JavaRef<jobject>&, + jlong)>; + // Creates and shows the dialog. Will return nullptr if the dialog was not // displayed. Otherwise |on_close| will be called when the user closes the // dialog. @@ -29,6 +42,13 @@ std::unique_ptr<permissions::ChooserController> controller, base::OnceClosure on_close); + static std::unique_ptr<UsbChooserDialogAndroid> CreateForTesting( + content::RenderFrameHost* render_frame_host, + std::unique_ptr<permissions::ChooserController> controller, + base::OnceClosure on_close, + UsbChooserDialogAndroid::CreateJavaDialogCallback + create_java_dialog_callback); + explicit UsbChooserDialogAndroid( std::unique_ptr<permissions::ChooserController> controller, base::OnceClosure on_close); @@ -56,6 +76,13 @@ // Called when the chooser dialog is closed. void Cancel(); + static std::unique_ptr<UsbChooserDialogAndroid> CreateInternal( + content::RenderFrameHost* render_frame_host, + std::unique_ptr<permissions::ChooserController> controller, + base::OnceClosure on_close, + UsbChooserDialogAndroid::CreateJavaDialogCallback + create_java_dialog_callback); + std::unique_ptr<permissions::ChooserController> controller_; base::OnceClosure on_close_;
diff --git a/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android_unittest.cc b/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android_unittest.cc new file mode 100644 index 0000000..c7aed7a --- /dev/null +++ b/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android_unittest.cc
@@ -0,0 +1,63 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.h" + +#include <string> + +#include "base/test/bind.h" +#include "base/test/mock_callback.h" +#include "chrome/browser/ssl/security_state_tab_helper.h" +#include "chrome/browser/usb/usb_chooser_controller.h" +#include "chrome/test/base/chrome_render_view_host_test_harness.h" +#include "content/public/browser/web_contents.h" +#include "content/public/test/navigation_simulator.h" +#include "services/device/public/mojom/usb_enumeration_options.mojom.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/android/window_android.h" + +namespace { + +using UsbChooserDialogAndroidTest = ChromeRenderViewHostTestHarness; +using testing::_; + +TEST_F(UsbChooserDialogAndroidTest, FrameTree) { + NavigateAndCommit(GURL("https://main-frame.com")); + content::RenderFrameHost* subframe = + content::NavigationSimulator::NavigateAndCommitFromDocument( + GURL("https://sub-frame.com"), + content::RenderFrameHostTester::For(main_rfh()) + ->AppendChild("subframe")); + + auto controller = std::make_unique<UsbChooserController>( + main_rfh(), std::vector<device::mojom::UsbDeviceFilterPtr>(), + base::BindLambdaForTesting( + [](device::mojom::UsbDeviceInfoPtr usb_device_info) {})); + + content::WebContents* web_contents = + content::WebContents::FromRenderFrameHost(main_rfh()); + std::unique_ptr<ui::WindowAndroid::ScopedWindowAndroidForTesting> window = + ui::WindowAndroid::CreateForTesting(); + window.get()->get()->AddChild(web_contents->GetNativeView()); + SecurityStateTabHelper::CreateForWebContents(web_contents); + + base::MockCallback<UsbChooserDialogAndroid::CreateJavaDialogCallback> + mock_callback; + auto origin_predicate = + [&](const base::android::JavaRef<jstring>& java_string) { + return base::android::ConvertJavaStringToUTF16( + base::android::AttachCurrentThread(), java_string) == + u"https://main-frame.com"; + }; + EXPECT_CALL(mock_callback, Run(/*env=*/_, /*window_android=*/_, + testing::Truly(origin_predicate), + /*security_level=*/_, /*profile=*/_, + /*native_usb_chooser_dialog_ptr=*/_)); + UsbChooserDialogAndroid::CreateForTesting(subframe, std::move(controller), + base::BindLambdaForTesting([]() {}), + mock_callback.Get()); +} + +} // namespace
diff --git a/chrome/browser/ui/app_list/arc/arc_app_launcher.cc b/chrome/browser/ui/app_list/arc/arc_app_launcher.cc index 0cf15c3..3284c4d 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_launcher.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_launcher.cc
@@ -121,17 +121,9 @@ Observe(nullptr); if (launch_intent_) { - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - proxy->LaunchAppWithIntent( - app_id_, ui::EF_NONE, std::move(launch_intent_), launch_source_, - std::make_unique<apps::WindowInfo>(display_id_), base::DoNothing()); - } else { - proxy->LaunchAppWithIntent( - app_id_, ui::EF_NONE, - apps::ConvertIntentToMojomIntent(launch_intent_), - apps::ConvertLaunchSourceToMojomLaunchSource(launch_source_), - apps::MakeWindowInfo(display_id_), {}); - } + proxy->LaunchAppWithIntent( + app_id_, ui::EF_NONE, std::move(launch_intent_), launch_source_, + std::make_unique<apps::WindowInfo>(display_id_), base::DoNothing()); } else { if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { proxy->Launch(app_id_, ui::EF_NONE, launch_source_,
diff --git a/chrome/browser/ui/app_list/arc/arc_app_utils.cc b/chrome/browser/ui/app_list/arc/arc_app_utils.cc index 96a0b7f..727bb08 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_utils.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_utils.cc
@@ -315,6 +315,9 @@ if (window_info) window_info->display_id = GetValidDisplayId(window_info->display_id); + // Activate ARC in case still not active. + ArcSessionManager::Get()->AllowActivation(); + ArcAppListPrefs* const prefs = ArcAppListPrefs::Get(context); std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = prefs->GetApp(app_id); absl::optional<std::string> launch_intent_to_send = launch_intent;
diff --git a/chrome/browser/ui/app_list/search/games/game_result.cc b/chrome/browser/ui/app_list/search/games/game_result.cc index 84a39ce..973f351 100644 --- a/chrome/browser/ui/app_list/search/games/game_result.cc +++ b/chrome/browser/ui/app_list/search/games/game_result.cc
@@ -24,7 +24,6 @@ #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" #include "chrome/browser/ui/app_list/search/common/icon_constants.h" #include "chrome/browser/ui/app_list/search/common/search_result_util.h" -#include "components/services/app_service/public/cpp/features.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/page_transition_types.h" #include "ui/base/window_open_disposition_utils.h" @@ -107,13 +106,8 @@ /*exclude_browser_tab_apps=*/true); for (const auto& app_id : app_ids) { if (kAllowedLaunchAppIds.contains(app_id)) { - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - proxy->LaunchAppWithUrl(app_id, event_flags, launch_url_, - apps::LaunchSource::kFromAppListQuery); - } else { - proxy->LaunchAppWithUrl(app_id, event_flags, launch_url_, - apps::mojom::LaunchSource::kFromAppListQuery); - } + proxy->LaunchAppWithUrl(app_id, event_flags, launch_url_, + apps::LaunchSource::kFromAppListQuery); return; } }
diff --git a/chrome/browser/ui/ash/arc_open_url_delegate_impl.cc b/chrome/browser/ui/ash/arc_open_url_delegate_impl.cc index 91044ad..0413e48 100644 --- a/chrome/browser/ui/ash/arc_open_url_delegate_impl.cc +++ b/chrome/browser/ui/ash/arc_open_url_delegate_impl.cc
@@ -48,12 +48,10 @@ #include "components/arc/intent_helper/custom_tab.h" #include "components/services/app_service/public/cpp/app_launch_util.h" #include "components/services/app_service/public/cpp/app_update.h" -#include "components/services/app_service/public/cpp/features.h" #include "components/services/app_service/public/cpp/intent.h" #include "components/services/app_service/public/cpp/intent_filter_util.h" #include "components/services/app_service/public/cpp/intent_util.h" #include "components/services/app_service/public/cpp/types_util.h" -#include "components/services/app_service/public/mojom/types.mojom.h" #include "components/user_manager/user_manager.h" #include "content/public/common/url_constants.h" #include "mojo/public/cpp/bindings/pending_remote.h" @@ -357,13 +355,8 @@ } }); - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - proxy->LaunchAppWithUrl(*app_id, event_flags, url, - apps::LaunchSource::kFromArc); - } else { - proxy->LaunchAppWithUrl(*app_id, event_flags, url, - apps::mojom::LaunchSource::kFromArc); - } + proxy->LaunchAppWithUrl(*app_id, event_flags, url, + apps::LaunchSource::kFromArc); ash::ApkWebAppService* apk_web_app_service = ash::ApkWebAppService::Get(profile); @@ -505,13 +498,7 @@ int event_flags = apps::GetEventFlags(disposition, /*prefer_container=*/false); - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - proxy->LaunchAppWithIntent(app_id, event_flags, std::move(intent), - apps::LaunchSource::kFromArc, nullptr, - base::DoNothing()); - } else { - proxy->LaunchAppWithIntent( - app_id, event_flags, apps::ConvertIntentToMojomIntent(intent), - apps::mojom::LaunchSource::kFromArc, nullptr, {}); - } + proxy->LaunchAppWithIntent(app_id, event_flags, std::move(intent), + apps::LaunchSource::kFromArc, nullptr, + base::DoNothing()); }
diff --git a/chrome/browser/ui/ash/chrome_new_window_client.cc b/chrome/browser/ui/ash/chrome_new_window_client.cc index ce51184a..fca2e61 100644 --- a/chrome/browser/ui/ash/chrome_new_window_client.cc +++ b/chrome/browser/ui/ash/chrome_new_window_client.cc
@@ -452,23 +452,13 @@ return; } - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - std::vector<base::FilePath> launch_files; - launch_files.push_back(downloads_path); - proxy->LaunchAppWithFiles( - update.AppId(), - apps::GetEventFlags(WindowOpenDisposition::NEW_FOREGROUND_TAB, - /*prefer_container=*/true), - apps::LaunchSource::kFromKeyboard, std::move(launch_files)); - } else { - apps::mojom::FilePathsPtr launch_files = apps::mojom::FilePaths::New(); - launch_files->file_paths.push_back(downloads_path); - proxy->LaunchAppWithFiles( - update.AppId(), - apps::GetEventFlags(WindowOpenDisposition::NEW_FOREGROUND_TAB, - /*prefer_container=*/true), - apps::mojom::LaunchSource::kFromKeyboard, std::move(launch_files)); - } + std::vector<base::FilePath> launch_files; + launch_files.push_back(downloads_path); + proxy->LaunchAppWithFiles( + update.AppId(), + apps::GetEventFlags(WindowOpenDisposition::NEW_FOREGROUND_TAB, + /*prefer_container=*/true), + apps::LaunchSource::kFromKeyboard, std::move(launch_files)); }; bool result = proxy->AppRegistryCache().ForOneApp(
diff --git a/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.cc b/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.cc index 6304372..745c5fe 100644 --- a/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.cc +++ b/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_shelf_controller.cc
@@ -524,9 +524,8 @@ std::vector<aura::Window*> AppServiceAppWindowShelfController::GetArcWindows() { std::vector<aura::Window*> arc_windows; - std::copy_if(window_list_.begin(), window_list_.end(), - std::inserter(arc_windows, arc_windows.end()), - [](aura::Window* w) { return ash::IsArcWindow(w); }); + base::ranges::copy_if(window_list_, std::back_inserter(arc_windows), + &ash::IsArcWindow); return arc_windows; }
diff --git a/chrome/browser/ui/ash/system_tray_client_impl.cc b/chrome/browser/ui/ash/system_tray_client_impl.cc index fb91b44..ed2d85f8 100644 --- a/chrome/browser/ui/ash/system_tray_client_impl.cc +++ b/chrome/browser/ui/ash/system_tray_client_impl.cc
@@ -762,19 +762,10 @@ } // Launch web app. - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - proxy->LaunchAppWithUrl( - web_app::kGoogleCalendarAppId, - apps::GetEventFlags(WindowOpenDisposition::NEW_WINDOW, - /*prefer_container=*/true), - official_url, apps::LaunchSource::kFromShelf); - } else { - proxy->LaunchAppWithUrl( - web_app::kGoogleCalendarAppId, - apps::GetEventFlags(WindowOpenDisposition::NEW_WINDOW, - /*prefer_container=*/true), - official_url, apps::mojom::LaunchSource::kFromShelf); - } + proxy->LaunchAppWithUrl(web_app::kGoogleCalendarAppId, + apps::GetEventFlags(WindowOpenDisposition::NEW_WINDOW, + /*prefer_container=*/true), + official_url, apps::LaunchSource::kFromShelf); opened_pwa = true; }
diff --git a/chrome/browser/ui/ash/system_web_apps/system_web_app_ui_utils.cc b/chrome/browser/ui/ash/system_web_apps/system_web_app_ui_utils.cc index 176c7ad..dd226f9 100644 --- a/chrome/browser/ui/ash/system_web_apps/system_web_app_ui_utils.cc +++ b/chrome/browser/ui/ash/system_web_apps/system_web_app_ui_utils.cc
@@ -163,30 +163,15 @@ if (!params.launch_paths.empty()) { DCHECK(!params.url.has_value()) << "Launch URL can't be used with launch_paths."; - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - app_service->LaunchAppWithFiles( - *app_id, event_flags, params.launch_source, params.launch_paths); - } else { - app_service->LaunchAppWithFiles( - *app_id, event_flags, - apps::ConvertLaunchSourceToMojomLaunchSource(params.launch_source), - apps::mojom::FilePaths::New(params.launch_paths)); - } + app_service->LaunchAppWithFiles(*app_id, event_flags, params.launch_source, + params.launch_paths); return; } if (params.url) { DCHECK(params.url->is_valid()); - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - app_service->LaunchAppWithUrl(*app_id, event_flags, *params.url, - params.launch_source, - std::move(window_info)); - } else { - app_service->LaunchAppWithUrl( - *app_id, event_flags, *params.url, - apps::ConvertLaunchSourceToMojomLaunchSource(params.launch_source), - apps::ConvertWindowInfoToMojomWindowInfo(window_info)); - } + app_service->LaunchAppWithUrl(*app_id, event_flags, *params.url, + params.launch_source, std::move(window_info)); return; }
diff --git a/chrome/browser/ui/hung_renderer/hung_renderer_core.cc b/chrome/browser/ui/hung_renderer/hung_renderer_core.cc index 12a74ce9..f73e52e 100644 --- a/chrome/browser/ui/hung_renderer/hung_renderer_core.cc +++ b/chrome/browser/ui/hung_renderer/hung_renderer_core.cc
@@ -79,8 +79,8 @@ return IsWebContentsHung(web_contents, hung_process) && !web_contents->IsCrashed(); }; - std::copy_if(AllTabContentses().begin(), AllTabContentses().end(), - std::back_inserter(result), is_hung); + base::ranges::copy_if(AllTabContentses(), std::back_inserter(result), + is_hung); // Move |hung_web_contents| to the front. It might be missing from the // initial |results| when it hasn't yet committed a navigation into the hung
diff --git a/chrome/browser/ui/side_search/side_search_side_contents_helper.cc b/chrome/browser/ui/side_search/side_search_side_contents_helper.cc index e77b257..2e5b19b4 100644 --- a/chrome/browser/ui/side_search/side_search_side_contents_helper.cc +++ b/chrome/browser/ui/side_search/side_search_side_contents_helper.cc
@@ -61,6 +61,20 @@ } // namespace +void SideSearchSideContentsHelper::DidOpenRequestedURL( + content::WebContents* new_contents, + content::RenderFrameHost* source_render_frame_host, + const GURL& url, + const content::Referrer& referrer, + WindowOpenDisposition disposition, + ui::PageTransition transition, + bool started_from_context_menu, + bool renderer_initiated) { + DCHECK(delegate_); + delegate_->CarryOverSideSearchStateToNewTab(web_contents()->GetVisibleURL(), + new_contents); +} + bool SideSearchSideContentsHelper::Delegate::HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) {
diff --git a/chrome/browser/ui/side_search/side_search_side_contents_helper.h b/chrome/browser/ui/side_search/side_search_side_contents_helper.h index 1c3c42d..ea12055 100644 --- a/chrome/browser/ui/side_search/side_search_side_contents_helper.h +++ b/chrome/browser/ui/side_search/side_search_side_contents_helper.h
@@ -52,6 +52,12 @@ // Get the WebContents of the associated tab. virtual content::WebContents* GetTabWebContents() = 0; + + // When a new tab/window is opened from SRP or side search panel, + // this function carries over the side search state to the new tab. + virtual void CarryOverSideSearchStateToNewTab( + const GURL& search_url, + content::WebContents* new_web_contents) = 0; }; // Will call MaybeRecordMetricsPerJourney(). @@ -62,6 +68,14 @@ content::NavigationHandle* handle); // content::WebContentsObserver: + void DidOpenRequestedURL(content::WebContents* new_contents, + content::RenderFrameHost* source_render_frame_host, + const GURL& url, + const content::Referrer& referrer, + WindowOpenDisposition disposition, + ui::PageTransition transition, + bool started_from_context_menu, + bool renderer_initiated) override; void PrimaryPageChanged(content::Page& page) override; void PrimaryMainFrameRenderProcessGone( base::TerminationStatus status) override;
diff --git a/chrome/browser/ui/side_search/side_search_side_contents_helper_unittest.cc b/chrome/browser/ui/side_search/side_search_side_contents_helper_unittest.cc index c59ccb9b..6a18ad15 100644 --- a/chrome/browser/ui/side_search/side_search_side_contents_helper_unittest.cc +++ b/chrome/browser/ui/side_search/side_search_side_contents_helper_unittest.cc
@@ -42,6 +42,9 @@ } void SidePanelProcessGone() override {} content::WebContents* GetTabWebContents() override { return nullptr; } + void CarryOverSideSearchStateToNewTab( + const GURL& search_url, + content::WebContents* new_web_contents) override {} const GURL& tab_contents_url() const { return tab_contents_url_; }
diff --git a/chrome/browser/ui/side_search/side_search_tab_contents_helper.cc b/chrome/browser/ui/side_search/side_search_tab_contents_helper.cc index 6156322..1f8b771 100644 --- a/chrome/browser/ui/side_search/side_search_tab_contents_helper.cc +++ b/chrome/browser/ui/side_search/side_search_tab_contents_helper.cc
@@ -69,6 +69,24 @@ return web_contents(); } +void SideSearchTabContentsHelper::CarryOverSideSearchStateToNewTab( + const GURL& search_url, + content::WebContents* new_web_contents) { + DCHECK(new_web_contents); + + // Ensure this function is called on a search result page. + if (GetConfig()->ShouldNavigateInSidePanel(search_url)) { + auto* new_helper = + SideSearchTabContentsHelper::FromWebContents(new_web_contents); + + // "Open link in incognito window" yields a null new_helper. + if (new_helper) { + new_helper->last_search_url_ = search_url; + new_helper->GetConfig()->set_is_side_panel_srp_available(true); + } + } +} + content::WebContents* SideSearchTabContentsHelper::OpenURLFromTab( content::WebContents* source, const content::OpenURLParams& params) { @@ -84,21 +102,8 @@ ui::PageTransition transition, bool started_from_context_menu, bool renderer_initiated) { - DCHECK(new_contents); - DCHECK_NE(new_contents, GetTabWebContents()); const GURL& current_url = GetTabWebContents()->GetLastCommittedURL(); - - // Ensure current_url is a search URL. - if (GetConfig()->ShouldNavigateInSidePanel(current_url)) { - auto* new_helper = - SideSearchTabContentsHelper::FromWebContents(new_contents); - - // "Open link in incognito window" yields a null new_helper. - if (new_helper) { - new_helper->last_search_url_ = current_url; - new_helper->GetConfig()->set_is_side_panel_srp_available(true); - } - } + CarryOverSideSearchStateToNewTab(current_url, new_contents); } void SideSearchTabContentsHelper::DidStartNavigation(
diff --git a/chrome/browser/ui/side_search/side_search_tab_contents_helper.h b/chrome/browser/ui/side_search/side_search_tab_contents_helper.h index 7a1bb6f..83bee03 100644 --- a/chrome/browser/ui/side_search/side_search_tab_contents_helper.h +++ b/chrome/browser/ui/side_search/side_search_tab_contents_helper.h
@@ -73,6 +73,9 @@ content::WebContents* source, const content::OpenURLParams& params) override; content::WebContents* GetTabWebContents() override; + void CarryOverSideSearchStateToNewTab( + const GURL& search_url, + content::WebContents* new_web_contents) override; // content::WebContentsObserver: void DidOpenRequestedURL(content::WebContents* new_contents,
diff --git a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl_unittest.cc b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl_unittest.cc index 99d9e71..fe6af9e 100644 --- a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl_unittest.cc +++ b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.h" +#include "base/ranges/algorithm.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/share/share_features.h" #include "chrome/browser/ui/sharing_hub/fake_sharing_hub_bubble_controller.h" @@ -35,9 +36,8 @@ std::vector<views::View*> result; EnumerateDescendants(root, descendants); - std::copy_if(descendants.begin(), descendants.end(), - std::back_inserter(result), - [=](views::View* view) { return predicate.Run(view); }); + base::ranges::copy_if(descendants, std::back_inserter(result), + [=](views::View* view) { return predicate.Run(view); }); return result; }
diff --git a/chrome/browser/ui/views/side_search/side_search_browser_controller_interactive_uitest.cc b/chrome/browser/ui/views/side_search/side_search_browser_controller_interactive_uitest.cc index 6ad5ea2..379543b 100644 --- a/chrome/browser/ui/views/side_search/side_search_browser_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/side_search/side_search_browser_controller_interactive_uitest.cc
@@ -470,6 +470,146 @@ } IN_PROC_BROWSER_TEST_P(SideSearchBrowserControllerTest, + CarryOverSideSearchToNewTabFromSideSearchPanel) { + ui_test_utils::AllBrowserTabAddedWaiter add_tab; + + // Set up srp tab. + const GURL srp_tab_url(GetMatchingSearchUrl()); + + // Set up a mock search result on side search panel. + const GURL new_tab_url(GetNonMatchingUrl()); + + NavigateActiveTab(browser(), srp_tab_url); + + // Navigate current tab to a random non-srp page. + NavigateActiveTab(browser(), GetNonMatchingUrl()); + + // Toggle the side panel. + NotifyButtonClick(browser()); + ASSERT_TRUE(GetSidePanelFor(browser())->GetVisible()); + + content::WebContents* active_side_contents = + GetActiveSidePanelWebContents(browser()); + + // Set up menu with link URL. + content::ContextMenuParams context_menu_params; + context_menu_params.link_url = new_tab_url; + + // Select "Open Link in New Tab" and wait for the new tab to be added. + TestRenderViewContextMenu menu(*active_side_contents->GetPrimaryMainFrame(), + context_menu_params); + menu.Init(); + menu.ExecuteCommand(IDC_CONTENT_CONTEXT_OPENLINKNEWTAB, 0); + + content::WebContents* new_tab = add_tab.Wait(); + EXPECT_TRUE(content::WaitForLoadStop(new_tab)); + + // Verify that the new tab is correct. + ASSERT_EQ(new_tab_url, new_tab->GetLastCommittedURL()); + + // Verify that new tab has page action icon displayed. + ActivateTabAt(browser(), 1); + EXPECT_TRUE(GetSidePanelButtonFor(browser())->GetVisible()); + + // Verify new_tab_helper has correct last_search_url_. + auto* new_tab_helper = SideSearchTabContentsHelper::FromWebContents(new_tab); + ASSERT_TRUE(new_tab_helper); + EXPECT_EQ(new_tab_helper->last_search_url(), srp_tab_url); +} + +IN_PROC_BROWSER_TEST_P(SideSearchBrowserControllerTest, + CarryOverSideSearchToNewWindowFromSideSearchPanel) { + ui_test_utils::AllBrowserTabAddedWaiter add_tab; + + // Set up srp tab. + const GURL srp_tab_url(GetMatchingSearchUrl()); + + // Set up a mock search result on side search panel. + const GURL new_tab_url(GetNonMatchingUrl()); + + NavigateActiveTab(browser(), srp_tab_url); + + // Navigate current tab to a random non-srp page. + NavigateActiveTab(browser(), GetNonMatchingUrl()); + + // Toggle the side panel. + NotifyButtonClick(browser()); + ASSERT_TRUE(GetSidePanelFor(browser())->GetVisible()); + + content::WebContents* active_side_contents = + GetActiveSidePanelWebContents(browser()); + + // Set up menu with link URL. + content::ContextMenuParams context_menu_params; + context_menu_params.link_url = new_tab_url; + + // Select "Open Link in New Tab" and wait for the new tab to be added. + TestRenderViewContextMenu menu(*active_side_contents->GetPrimaryMainFrame(), + context_menu_params); + menu.Init(); + menu.ExecuteCommand(IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW, 0); + + content::WebContents* new_tab = add_tab.Wait(); + EXPECT_TRUE(content::WaitForLoadStop(new_tab)); + + // Verify that the new tab is correct. + ASSERT_EQ(new_tab_url, new_tab->GetLastCommittedURL()); + + // Verify that new window has page action icon displayed. + EXPECT_TRUE(GetSidePanelButtonFor(chrome::FindBrowserWithWebContents(new_tab)) + ->GetVisible()); + + // Verify new_tab_helper has correct last_search_url_. + auto* new_tab_helper = SideSearchTabContentsHelper::FromWebContents(new_tab); + ASSERT_TRUE(new_tab_helper); + EXPECT_EQ(new_tab_helper->last_search_url(), srp_tab_url); +} + +IN_PROC_BROWSER_TEST_P( + SideSearchBrowserControllerTest, + SideSearchNotCarriedOverToIncognitoWindowFromSideSearchPanel) { + ui_test_utils::AllBrowserTabAddedWaiter add_tab; + + // Set up srp tab. + const GURL srp_tab_url(GetMatchingSearchUrl()); + + // Set up a mock search result on side search panel. + const GURL new_tab_url(GetNonMatchingUrl()); + + NavigateActiveTab(browser(), srp_tab_url); + + // Navigate current tab to a random non-srp page. + NavigateActiveTab(browser(), GetNonMatchingUrl()); + + // Toggle the side panel. + NotifyButtonClick(browser()); + ASSERT_TRUE(GetSidePanelFor(browser())->GetVisible()); + + content::WebContents* active_side_contents = + GetActiveSidePanelWebContents(browser()); + + // Set up menu with link URL. + content::ContextMenuParams context_menu_params; + context_menu_params.link_url = new_tab_url; + + // Select "Open Link in New Tab" and wait for the new tab to be added. + TestRenderViewContextMenu menu(*active_side_contents->GetPrimaryMainFrame(), + context_menu_params); + menu.Init(); + menu.ExecuteCommand(IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD, 0); + + content::WebContents* new_tab = add_tab.Wait(); + EXPECT_TRUE(content::WaitForLoadStop(new_tab)); + + // Verify that the new tab is correct. + ASSERT_EQ(new_tab_url, new_tab->GetLastCommittedURL()); + + // Verify that new window has page action icon displayed. + EXPECT_FALSE( + GetSidePanelButtonFor(chrome::FindBrowserWithWebContents(new_tab))); +} + +IN_PROC_BROWSER_TEST_P(SideSearchBrowserControllerTest, DisplayPageActionIconInNewTab) { ui_test_utils::AllBrowserTabAddedWaiter add_tab;
diff --git a/chrome/browser/ui/views/side_search/unified_side_search_controller_interactive_uitest.cc b/chrome/browser/ui/views/side_search/unified_side_search_controller_interactive_uitest.cc index 12ce6ac9..0f88ad7e 100644 --- a/chrome/browser/ui/views/side_search/unified_side_search_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/side_search/unified_side_search_controller_interactive_uitest.cc
@@ -50,6 +50,146 @@ base::test::ScopedFeatureList scoped_feature_list_; }; +IN_PROC_BROWSER_TEST_F(SideSearchV2Test, + CarryOverSideSearchToNewTabFromSideSearchPanel) { + ui_test_utils::AllBrowserTabAddedWaiter add_tab; + + // Set up srp tab. + const GURL srp_tab_url(GetMatchingSearchUrl()); + + // Set up a mock search result on side search panel. + const GURL new_tab_url(GetNonMatchingUrl()); + + NavigateActiveTab(browser(), srp_tab_url); + + // Navigate current tab to a random non-srp page. + NavigateActiveTab(browser(), GetNonMatchingUrl()); + + // Toggle the side panel. + NotifyButtonClick(browser()); + ASSERT_TRUE(GetSidePanelFor(browser())->GetVisible()); + + content::WebContents* active_side_contents = + GetActiveSidePanelWebContents(browser()); + + // Set up menu with link URL. + content::ContextMenuParams context_menu_params; + context_menu_params.link_url = new_tab_url; + + // Select "Open Link in New Tab" and wait for the new tab to be added. + TestRenderViewContextMenu menu(*active_side_contents->GetPrimaryMainFrame(), + context_menu_params); + menu.Init(); + menu.ExecuteCommand(IDC_CONTENT_CONTEXT_OPENLINKNEWTAB, 0); + + content::WebContents* new_tab = add_tab.Wait(); + EXPECT_TRUE(content::WaitForLoadStop(new_tab)); + + // Verify that the new tab is correct. + ASSERT_EQ(new_tab_url, new_tab->GetLastCommittedURL()); + + // Verify that new tab has page action icon displayed. + ActivateTabAt(browser(), 1); + EXPECT_TRUE(GetSidePanelButtonFor(browser())->GetVisible()); + + // Verify new_tab_helper has correct last_search_url_. + auto* new_tab_helper = SideSearchTabContentsHelper::FromWebContents(new_tab); + ASSERT_TRUE(new_tab_helper); + EXPECT_EQ(new_tab_helper->last_search_url(), srp_tab_url); +} + +IN_PROC_BROWSER_TEST_F(SideSearchV2Test, + CarryOverSideSearchToNewWindowFromSideSearchPanel) { + ui_test_utils::AllBrowserTabAddedWaiter add_tab; + + // Set up srp tab. + const GURL srp_tab_url(GetMatchingSearchUrl()); + + // Set up a mock search result on side search panel. + const GURL new_tab_url(GetNonMatchingUrl()); + + NavigateActiveTab(browser(), srp_tab_url); + + // Navigate current tab to a random non-srp page. + NavigateActiveTab(browser(), GetNonMatchingUrl()); + + // Toggle the side panel. + NotifyButtonClick(browser()); + ASSERT_TRUE(GetSidePanelFor(browser())->GetVisible()); + + content::WebContents* active_side_contents = + GetActiveSidePanelWebContents(browser()); + + // Set up menu with link URL. + content::ContextMenuParams context_menu_params; + context_menu_params.link_url = new_tab_url; + + // Select "Open Link in New Tab" and wait for the new tab to be added. + TestRenderViewContextMenu menu(*active_side_contents->GetPrimaryMainFrame(), + context_menu_params); + menu.Init(); + menu.ExecuteCommand(IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW, 0); + + content::WebContents* new_tab = add_tab.Wait(); + EXPECT_TRUE(content::WaitForLoadStop(new_tab)); + + // Verify that the new tab is correct. + ASSERT_EQ(new_tab_url, new_tab->GetLastCommittedURL()); + + // Verify that new window has page action icon displayed. + EXPECT_TRUE(GetSidePanelButtonFor(chrome::FindBrowserWithWebContents(new_tab)) + ->GetVisible()); + + // Verify new_tab_helper has correct last_search_url_. + auto* new_tab_helper = SideSearchTabContentsHelper::FromWebContents(new_tab); + ASSERT_TRUE(new_tab_helper); + EXPECT_EQ(new_tab_helper->last_search_url(), srp_tab_url); +} + +IN_PROC_BROWSER_TEST_F( + SideSearchV2Test, + SideSearchNotCarriedOverToIncognitoWindowFromSideSearchPanel) { + ui_test_utils::AllBrowserTabAddedWaiter add_tab; + + // Set up srp tab. + const GURL srp_tab_url(GetMatchingSearchUrl()); + + // Set up a mock search result on side search panel. + const GURL new_tab_url(GetNonMatchingUrl()); + + NavigateActiveTab(browser(), srp_tab_url); + + // Navigate current tab to a random non-srp page. + NavigateActiveTab(browser(), GetNonMatchingUrl()); + + // Toggle the side panel. + NotifyButtonClick(browser()); + ASSERT_TRUE(GetSidePanelFor(browser())->GetVisible()); + + content::WebContents* active_side_contents = + GetActiveSidePanelWebContents(browser()); + + // Set up menu with link URL. + content::ContextMenuParams context_menu_params; + context_menu_params.link_url = new_tab_url; + + // Select "Open Link in New Tab" and wait for the new tab to be added. + TestRenderViewContextMenu menu(*active_side_contents->GetPrimaryMainFrame(), + context_menu_params); + menu.Init(); + menu.ExecuteCommand(IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD, 0); + + content::WebContents* new_tab = add_tab.Wait(); + EXPECT_TRUE(content::WaitForLoadStop(new_tab)); + + // Verify that the new tab is correct. + ASSERT_EQ(new_tab_url, new_tab->GetLastCommittedURL()); + + // Verify that new window has page action icon displayed. + EXPECT_FALSE( + GetSidePanelButtonFor(chrome::FindBrowserWithWebContents(new_tab))); +} + IN_PROC_BROWSER_TEST_F(SideSearchV2Test, DisplayPageActionIconInNewTab) { ui_test_utils::AllBrowserTabAddedWaiter add_tab;
diff --git a/chrome/browser/ui/web_applications/web_app_browser_controller.cc b/chrome/browser/ui/web_applications/web_app_browser_controller.cc index 6355832..69d27f3b 100644 --- a/chrome/browser/ui/web_applications/web_app_browser_controller.cc +++ b/chrome/browser/ui/web_applications/web_app_browser_controller.cc
@@ -21,6 +21,7 @@ #include "chrome/browser/ui/tabs/tab_menu_model_factory.h" #include "chrome/browser/ui/web_applications/web_app_dialog_manager.h" #include "chrome/browser/ui/web_applications/web_app_launch_utils.h" +#include "chrome/browser/ui/web_applications/web_app_tabbed_utils.h" #include "chrome/browser/ui/web_applications/web_app_ui_manager_impl.h" #include "chrome/browser/web_applications/commands/callback_command.h" #include "chrome/browser/web_applications/locks/app_lock.h" @@ -497,6 +498,12 @@ // tabbed browser window (e.g. via "Open in Chrome" menu item), it is still // considered "appy". WebAppTabHelper::FromWebContents(contents)->set_acting_as_app(true); + + if (registrar().IsTabbedWindowModeEnabled(app_id()) && + IsPinnedHomeTabUrl(registrar(), app_id(), + contents->GetLastCommittedURL())) { + WebAppTabHelper::FromWebContents(contents)->set_is_pinned_home_tab(true); + } } void WebAppBrowserController::OnTabRemoved(content::WebContents* contents) {
diff --git a/chrome/browser/ui/webui/app_management/app_management_page_handler.cc b/chrome/browser/ui/webui/app_management/app_management_page_handler.cc index e2aa2a84..0cf5cfd 100644 --- a/chrome/browser/ui/webui/app_management/app_management_page_handler.cc +++ b/chrome/browser/ui/webui/app_management/app_management_page_handler.cc
@@ -554,22 +554,12 @@ if (update.InstallSource() == apps::InstallSource::kPlayStore) { GURL url("https://play.google.com/store/apps/details?id=" + update.PublisherId()); - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - proxy->LaunchAppWithUrl(arc::kPlayStoreAppId, ui::EF_NONE, url, - apps::LaunchSource::kFromChromeInternal); - } else { - proxy->LaunchAppWithUrl(arc::kPlayStoreAppId, ui::EF_NONE, url, - apps::mojom::LaunchSource::kFromChromeInternal); - } + proxy->LaunchAppWithUrl(arc::kPlayStoreAppId, ui::EF_NONE, url, + apps::LaunchSource::kFromChromeInternal); } else if (update.InstallSource() == apps::InstallSource::kChromeWebStore) { GURL url("https://chrome.google.com/webstore/detail/" + update.AppId()); - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - proxy->LaunchAppWithUrl(extensions::kWebStoreAppId, ui::EF_NONE, url, - apps::LaunchSource::kFromChromeInternal); - } else { - proxy->LaunchAppWithUrl(extensions::kWebStoreAppId, ui::EF_NONE, url, - apps::mojom::LaunchSource::kFromChromeInternal); - } + proxy->LaunchAppWithUrl(extensions::kWebStoreAppId, ui::EF_NONE, url, + apps::LaunchSource::kFromChromeInternal); } }); #endif
diff --git a/chrome/browser/ui/webui/ash/cryptohome_ui.h b/chrome/browser/ui/webui/ash/cryptohome_ui.h index 1158050..61be785 100644 --- a/chrome/browser/ui/webui/ash/cryptohome_ui.h +++ b/chrome/browser/ui/webui/ash/cryptohome_ui.h
@@ -5,10 +5,23 @@ #ifndef CHROME_BROWSER_UI_WEBUI_ASH_CRYPTOHOME_UI_H_ #define CHROME_BROWSER_UI_WEBUI_ASH_CRYPTOHOME_UI_H_ +#include "chrome/common/webui_url_constants.h" #include "content/public/browser/web_ui_controller.h" +#include "content/public/browser/webui_config.h" +#include "content/public/common/url_constants.h" namespace ash { +class CryptohomeUI; + +// WebUIConfig for chrome://cryptohome +class CryptohomeUIConfig : public content::DefaultWebUIConfig<CryptohomeUI> { + public: + CryptohomeUIConfig() + : DefaultWebUIConfig(content::kChromeUIScheme, + chrome::kChromeUICryptohomeHost) {} +}; + // WebUIController for chrome://cryptohome. class CryptohomeUI : public content::WebUIController { public:
diff --git a/chrome/browser/ui/webui/ash/drive_internals_ui.h b/chrome/browser/ui/webui/ash/drive_internals_ui.h index 21411b88..76ea398 100644 --- a/chrome/browser/ui/webui/ash/drive_internals_ui.h +++ b/chrome/browser/ui/webui/ash/drive_internals_ui.h
@@ -5,10 +5,24 @@ #ifndef CHROME_BROWSER_UI_WEBUI_ASH_DRIVE_INTERNALS_UI_H_ #define CHROME_BROWSER_UI_WEBUI_ASH_DRIVE_INTERNALS_UI_H_ +#include "chrome/common/webui_url_constants.h" #include "content/public/browser/web_ui_controller.h" +#include "content/public/browser/webui_config.h" +#include "content/public/common/url_constants.h" namespace ash { +class DriveInternalsUI; + +// WebUIConfig for chrome://drive-internals +class DriveInternalsUIConfig + : public content::DefaultWebUIConfig<DriveInternalsUI> { + public: + DriveInternalsUIConfig() + : DefaultWebUIConfig(content::kChromeUIScheme, + chrome::kChromeUIDriveInternalsHost) {} +}; + // The WebUI controller for chrome::drive-internals, that is used for // diagnosing issues of Drive on Chrome OS. class DriveInternalsUI : public content::WebUIController {
diff --git a/chrome/browser/ui/webui/ash/edu_account_login_handler.h b/chrome/browser/ui/webui/ash/edu_account_login_handler.h index 4f4863c..9ac7355 100644 --- a/chrome/browser/ui/webui/ash/edu_account_login_handler.h +++ b/chrome/browser/ui/webui/ash/edu_account_login_handler.h
@@ -15,7 +15,7 @@ #include "base/values.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/supervised_user/child_accounts/family_info_fetcher.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" #include "components/image_fetcher/core/image_fetcher.h" #include "components/signin/public/identity_manager/access_token_info.h" #include "components/signin/public/identity_manager/primary_account_access_token_fetcher.h"
diff --git a/chrome/browser/ui/webui/ash/edu_coexistence/edu_coexistence_login_handler.h b/chrome/browser/ui/webui/ash/edu_coexistence/edu_coexistence_login_handler.h index 96bf1c1a..2c07ba0 100644 --- a/chrome/browser/ui/webui/ash/edu_coexistence/edu_coexistence_login_handler.h +++ b/chrome/browser/ui/webui/ash/edu_coexistence/edu_coexistence_login_handler.h
@@ -9,7 +9,7 @@ #include "base/memory/scoped_refptr.h" #include "base/values.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" #include "components/signin/public/identity_manager/access_token_info.h" #include "components/signin/public/identity_manager/identity_manager.h" #include "components/signin/public/identity_manager/primary_account_access_token_fetcher.h"
diff --git a/chrome/browser/ui/webui/ash/in_session_password_change/lock_screen_reauth_dialogs.h b/chrome/browser/ui/webui/ash/in_session_password_change/lock_screen_reauth_dialogs.h index 8806ca0..a560008 100644 --- a/chrome/browser/ui/webui/ash/in_session_password_change/lock_screen_reauth_dialogs.h +++ b/chrome/browser/ui/webui/ash/in_session_password_change/lock_screen_reauth_dialogs.h
@@ -11,7 +11,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" #include "chrome/browser/ui/webui/ash/in_session_password_change/base_lock_dialog.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" #include "chromeos/ash/components/network/network_state_handler.h" #include "chromeos/ash/components/network/network_state_handler_observer.h" #include "components/web_modal/web_contents_modal_dialog_host.h"
diff --git a/chrome/browser/ui/webui/ash/in_session_password_change/lock_screen_reauth_handler.h b/chrome/browser/ui/webui/ash/in_session_password_change/lock_screen_reauth_handler.h index 1bc6076..b17f9ef 100644 --- a/chrome/browser/ui/webui/ash/in_session_password_change/lock_screen_reauth_handler.h +++ b/chrome/browser/ui/webui/ash/in_session_password_change/lock_screen_reauth_handler.h
@@ -10,7 +10,7 @@ #include "base/memory/weak_ptr.h" #include "base/values.h" #include "chrome/browser/ui/webui/ash/login/check_passwords_against_cryptohome_helper.h" -#include "chrome/browser/ui/webui/chromeos/login/online_login_helper.h" +#include "chrome/browser/ui/webui/ash/login/online_login_helper.h" #include "content/public/browser/web_ui_message_handler.h" #include "net/cookies/cookie_access_result.h"
diff --git a/chrome/browser/ui/webui/ash/login/DEPS b/chrome/browser/ui/webui/ash/login/DEPS index 02fe519..43557a0 100644 --- a/chrome/browser/ui/webui/ash/login/DEPS +++ b/chrome/browser/ui/webui/ash/login/DEPS
@@ -1,6 +1,3 @@ -# TODO(https://crbug.com/1164001): When this file is edited, same file in -# //chrome/browser/ui/webui/chromeos/login should be updated as well. We need -# to sync both files until the migration is done. specific_include_rules = { "core_oobe_handler\.cc": [ "+ash/shell.h",
diff --git a/chrome/browser/ui/webui/ash/login/DIR_METADATA b/chrome/browser/ui/webui/ash/login/DIR_METADATA index 9f695433..ad3c5e1 100644 --- a/chrome/browser/ui/webui/ash/login/DIR_METADATA +++ b/chrome/browser/ui/webui/ash/login/DIR_METADATA
@@ -1,6 +1,3 @@ -# TODO(https://crbug.com/1164001): When this file is edited, same file in -# //chrome/browser/ui/webui/chromeos/login should be updated as well. We need -# to sync both files until the migration is done. monorail { component: "UI>Shell>OOBE" }
diff --git a/chrome/browser/ui/webui/ash/login/app_launch_splash_screen_handler.h b/chrome/browser/ui/webui/ash/login/app_launch_splash_screen_handler.h index e19d12c1..0bf62a0 100644 --- a/chrome/browser/ui/webui/ash/login/app_launch_splash_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/app_launch_splash_screen_handler.h
@@ -12,7 +12,7 @@ #include "chrome/browser/ash/app_mode/kiosk_app_manager_base.h" #include "chrome/browser/ash/login/screens/error_screen.h" #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace chromeos {
diff --git a/chrome/browser/ui/webui/ash/login/core_oobe_handler.cc b/chrome/browser/ui/webui/ash/login/core_oobe_handler.cc index 12db8186..6e3138dc 100644 --- a/chrome/browser/ui/webui/ash/login/core_oobe_handler.cc +++ b/chrome/browser/ui/webui/ash/login/core_oobe_handler.cc
@@ -34,7 +34,7 @@ #include "chrome/browser/ui/webui/ash/login/demo_setup_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/eula_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include "chrome/common/channel_info.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/pref_names.h"
diff --git a/chrome/browser/ui/webui/ash/login/enrollment_screen_handler.h b/chrome/browser/ui/webui/ash/login/enrollment_screen_handler.h index 9bf81c7..78eae57 100644 --- a/chrome/browser/ui/webui/ash/login/enrollment_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/enrollment_screen_handler.h
@@ -20,7 +20,7 @@ #include "chrome/browser/ash/login/screens/error_screen.h" #include "chrome/browser/ash/policy/enrollment/enrollment_config.h" #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" #include "net/cookies/canonical_cookie.h" namespace chromeos {
diff --git a/chrome/browser/ui/webui/ash/login/fake_update_required_screen_handler.h b/chrome/browser/ui/webui/ash/login/fake_update_required_screen_handler.h index fbc3d0f..2a25787 100644 --- a/chrome/browser/ui/webui/ash/login/fake_update_required_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/fake_update_required_screen_handler.h
@@ -8,7 +8,7 @@ #include <string> #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_required_screen_handler.h" namespace chromeos {
diff --git a/chrome/browser/ui/webui/ash/login/gaia_screen_handler.cc b/chrome/browser/ui/webui/ash/login/gaia_screen_handler.cc index b501e528..326227a 100644 --- a/chrome/browser/ui/webui/ash/login/gaia_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/gaia_screen_handler.cc
@@ -68,12 +68,12 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/ash/login/cookie_waiter.h" #include "chrome/browser/ui/webui/ash/login/enrollment_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/online_login_helper.h" -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/online_login_helper.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "chrome/browser/ui/webui/signin/signin_utils.h" #include "chrome/common/channel_info.h" #include "chrome/common/chrome_features.h"
diff --git a/chrome/browser/ui/webui/ash/login/gaia_screen_handler.h b/chrome/browser/ui/webui/ash/login/gaia_screen_handler.h index 75c366b2..f7855972 100644 --- a/chrome/browser/ui/webui/ash/login/gaia_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/gaia_screen_handler.h
@@ -19,8 +19,8 @@ #include "chrome/browser/ash/login/saml/public_saml_url_fetcher.h" #include "chrome/browser/certificate_provider/security_token_pin_dialog_host.h" #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/online_login_helper.h" -#include "chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.h" +#include "chrome/browser/ui/webui/ash/login/online_login_helper.h" +#include "chrome/browser/ui/webui/ash/login/saml_challenge_key_handler.h" #include "chromeos/components/security_token_pin/constants.h" #include "components/user_manager/user_type.h" #include "net/base/net_errors.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.cc b/chrome/browser/ui/webui/ash/login/management_transition_screen_handler.cc similarity index 95% rename from chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/management_transition_screen_handler.cc index e816f29b..a6be8ad 100644 --- a/chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/management_transition_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/management_transition_screen_handler.h" #include "ash/components/arc/session/arc_management_transition.h" #include "chrome/browser/ash/login/oobe_screen.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.h b/chrome/browser/ui/webui/ash/login/management_transition_screen_handler.h similarity index 89% rename from chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.h rename to chrome/browser/ui/webui/ash/login/management_transition_screen_handler.h index 9d2d65d4..0b303df 100644 --- a/chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/management_transition_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_MANAGEMENT_TRANSITION_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_MANAGEMENT_TRANSITION_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_MANAGEMENT_TRANSITION_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_MANAGEMENT_TRANSITION_SCREEN_HANDLER_H_ #include "ash/components/arc/session/arc_management_transition.h" #include "base/memory/weak_ptr.h" @@ -70,4 +70,4 @@ using ::chromeos::ManagementTransitionScreenView; } // namespace ash -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_MANAGEMENT_TRANSITION_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_MANAGEMENT_TRANSITION_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.cc b/chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.cc similarity index 97% rename from chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.cc index b60b092..0b46436 100644 --- a/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h" #include <utility>
diff --git a/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h b/chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h similarity index 90% rename from chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h rename to chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h index 68d6af2..5722977f 100644 --- a/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_MARKETING_OPT_IN_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_MARKETING_OPT_IN_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_MARKETING_OPT_IN_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_MARKETING_OPT_IN_SCREEN_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" @@ -76,4 +76,4 @@ using ::chromeos::MarketingOptInScreenView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_MARKETING_OPT_IN_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_MARKETING_OPT_IN_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/multidevice_setup_screen_handler.cc b/chrome/browser/ui/webui/ash/login/multidevice_setup_screen_handler.cc similarity index 93% rename from chrome/browser/ui/webui/chromeos/login/multidevice_setup_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/multidevice_setup_screen_handler.cc index 068a257..83f0b653 100644 --- a/chrome/browser/ui/webui/chromeos/login/multidevice_setup_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/multidevice_setup_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/multidevice_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/multidevice_setup_screen_handler.h" #include "ash/constants/ash_features.h" #include "base/values.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/multidevice_setup_screen_handler.h b/chrome/browser/ui/webui/ash/login/multidevice_setup_screen_handler.h similarity index 87% rename from chrome/browser/ui/webui/chromeos/login/multidevice_setup_screen_handler.h rename to chrome/browser/ui/webui/ash/login/multidevice_setup_screen_handler.h index 859f6dd..ec88ccb 100644 --- a/chrome/browser/ui/webui/chromeos/login/multidevice_setup_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/multidevice_setup_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_MULTIDEVICE_SETUP_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_MULTIDEVICE_SETUP_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_MULTIDEVICE_SETUP_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_MULTIDEVICE_SETUP_SCREEN_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "base/values.h" @@ -56,4 +56,4 @@ using ::chromeos::MultiDeviceSetupScreenView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_MULTIDEVICE_SETUP_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_MULTIDEVICE_SETUP_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.cc b/chrome/browser/ui/webui/ash/login/network_dropdown_handler.cc similarity index 97% rename from chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.cc rename to chrome/browser/ui/webui/ash/login/network_dropdown_handler.cc index 27581421..7aa61c64 100644 --- a/chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.cc +++ b/chrome/browser/ui/webui/ash/login/network_dropdown_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_dropdown_handler.h" #include "chrome/browser/ash/login/ui/login_display_host.h" #include "chrome/browser/ui/webui/ash/internet_config_dialog.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.h b/chrome/browser/ui/webui/ash/login/network_dropdown_handler.h similarity index 83% rename from chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.h rename to chrome/browser/ui/webui/ash/login/network_dropdown_handler.h index 0eca9a22..bdeb3483 100644 --- a/chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.h +++ b/chrome/browser/ui/webui/ash/login/network_dropdown_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_NETWORK_DROPDOWN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_NETWORK_DROPDOWN_HANDLER_H_ #include "chrome/browser/ui/webui/ash/login/base_webui_handler.h" @@ -35,4 +35,5 @@ }; } // namespace chromeos -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_DROPDOWN_HANDLER_H_ + +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_NETWORK_DROPDOWN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc b/chrome/browser/ui/webui/ash/login/network_screen_handler.cc similarity index 97% rename from chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/network_screen_handler.cc index 00c0e97..823cbed 100644 --- a/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/network_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" #include <stddef.h>
diff --git a/chrome/browser/ui/webui/chromeos/login/network_screen_handler.h b/chrome/browser/ui/webui/ash/login/network_screen_handler.h similarity index 89% rename from chrome/browser/ui/webui/chromeos/login/network_screen_handler.h rename to chrome/browser/ui/webui/ash/login/network_screen_handler.h index 52ee40c..1964977 100644 --- a/chrome/browser/ui/webui/chromeos/login/network_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/network_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_NETWORK_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_NETWORK_SCREEN_HANDLER_H_ #include <string> @@ -66,4 +66,4 @@ using ::chromeos::NetworkScreenView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_NETWORK_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/network_state_informer.cc b/chrome/browser/ui/webui/ash/login/network_state_informer.cc similarity index 98% rename from chrome/browser/ui/webui/chromeos/login/network_state_informer.cc rename to chrome/browser/ui/webui/ash/login/network_state_informer.cc index f8e0546..1d81d23 100644 --- a/chrome/browser/ui/webui/chromeos/login/network_state_informer.cc +++ b/chrome/browser/ui/webui/ash/login/network_state_informer.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" #include "base/bind.h" #include "base/notreached.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/network_state_informer.h b/chrome/browser/ui/webui/ash/login/network_state_informer.h similarity index 93% rename from chrome/browser/ui/webui/chromeos/login/network_state_informer.h rename to chrome/browser/ui/webui/ash/login/network_state_informer.h index c616e18..b4bb477 100644 --- a/chrome/browser/ui/webui/chromeos/login/network_state_informer.h +++ b/chrome/browser/ui/webui/ash/login/network_state_informer.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_STATE_INFORMER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_STATE_INFORMER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_NETWORK_STATE_INFORMER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_NETWORK_STATE_INFORMER_H_ #include <map> #include <memory> @@ -108,4 +108,4 @@ using ::chromeos::NetworkStateInformer; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_STATE_INFORMER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_NETWORK_STATE_INFORMER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.cc b/chrome/browser/ui/webui/ash/login/offline_login_screen_handler.cc similarity index 96% rename from chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/offline_login_screen_handler.cc index f316fd2..fed2d68 100644 --- a/chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/offline_login_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/offline_login_screen_handler.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.h b/chrome/browser/ui/webui/ash/login/offline_login_screen_handler.h similarity index 90% rename from chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.h rename to chrome/browser/ui/webui/ash/login/offline_login_screen_handler.h index a50dc16..340eb9a 100644 --- a/chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/offline_login_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OFFLINE_LOGIN_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OFFLINE_LOGIN_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_OFFLINE_LOGIN_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_OFFLINE_LOGIN_SCREEN_HANDLER_H_ #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" @@ -77,4 +77,4 @@ using ::chromeos::OfflineLoginView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OFFLINE_LOGIN_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_OFFLINE_LOGIN_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/online_login_helper.cc b/chrome/browser/ui/webui/ash/login/online_login_helper.cc similarity index 98% rename from chrome/browser/ui/webui/chromeos/login/online_login_helper.cc rename to chrome/browser/ui/webui/ash/login/online_login_helper.cc index 82c41072..82105b0 100644 --- a/chrome/browser/ui/webui/chromeos/login/online_login_helper.cc +++ b/chrome/browser/ui/webui/ash/login/online_login_helper.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/online_login_helper.h" +#include "chrome/browser/ui/webui/ash/login/online_login_helper.h" #include "chrome/browser/ash/login/signin_partition_manager.h" #include "chrome/browser/ash/login/ui/login_display_host_webui.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/online_login_helper.h b/chrome/browser/ui/webui/ash/login/online_login_helper.h similarity index 95% rename from chrome/browser/ui/webui/chromeos/login/online_login_helper.h rename to chrome/browser/ui/webui/ash/login/online_login_helper.h index 487cc35..ab9e2ea6 100644 --- a/chrome/browser/ui/webui/chromeos/login/online_login_helper.h +++ b/chrome/browser/ui/webui/ash/login/online_login_helper.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ONLINE_LOGIN_HELPER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ONLINE_LOGIN_HELPER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_ONLINE_LOGIN_HELPER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_ONLINE_LOGIN_HELPER_H_ #include <memory> #include <string> @@ -151,4 +151,4 @@ } // namespace login } // namespace ash -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ONLINE_LOGIN_HELPER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_ONLINE_LOGIN_HELPER_H_
diff --git a/chrome/browser/ui/webui/ash/login/oobe_ui.cc b/chrome/browser/ui/webui/ash/login/oobe_ui.cc index 9c4d3e8..8bc94585 100644 --- a/chrome/browser/ui/webui/ash/login/oobe_ui.cc +++ b/chrome/browser/ui/webui/ash/login/oobe_ui.cc
@@ -73,38 +73,38 @@ #include "chrome/browser/ui/webui/ash/login/lacros_data_migration_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/local_state_error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/locale_switch_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/management_transition_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/multidevice_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_dropdown_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/offline_login_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/oobe_display_chooser.h" +#include "chrome/browser/ui/webui/ash/login/os_install_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_trial_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/packaged_license_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/parental_handoff_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/smart_privacy_protection_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/ssh_configured_handler.h" +#include "chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/testapi/oobe_test_api_handler.h" +#include "chrome/browser/ui/webui/ash/login/theme_selection_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_required_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.h" #include "chrome/browser/ui/webui/ash/user_image_source.h" -#include "chrome/browser/ui/webui/chromeos/login/management_transition_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/multidevice_setup_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" -#include "chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/packaged_license_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/quick_start_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/smart_privacy_protection_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/ssh_configured_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/theme_selection_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h" #include "chrome/browser/ui/webui/metrics_handler.h" #include "chrome/browser/ui/webui/test_files_request_filter.h" #include "chrome/browser/ui/webui/theme_source.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.cc b/chrome/browser/ui/webui/ash/login/os_install_screen_handler.cc similarity index 98% rename from chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/os_install_screen_handler.cc index 32cc1fa..6290682 100644 --- a/chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/os_install_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_install_screen_handler.h" #include <string>
diff --git a/chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.h b/chrome/browser/ui/webui/ash/login/os_install_screen_handler.h similarity index 90% rename from chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.h rename to chrome/browser/ui/webui/ash/login/os_install_screen_handler.h index c077e0fb..cd3184d 100644 --- a/chrome/browser/ui/webui/chromeos/login/os_install_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/os_install_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OS_INSTALL_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OS_INSTALL_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_OS_INSTALL_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_OS_INSTALL_SCREEN_HANDLER_H_ #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" #include "chromeos/ash/components/dbus/os_install/os_install_client.h" @@ -75,4 +75,4 @@ using ::chromeos::OsInstallScreenView; } // namespace ash -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OS_INSTALL_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_OS_INSTALL_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.cc b/chrome/browser/ui/webui/ash/login/os_trial_screen_handler.cc similarity index 94% rename from chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/os_trial_screen_handler.cc index 7eb4e9c..a336f410 100644 --- a/chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/os_trial_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/os_trial_screen_handler.h" #include "chrome/browser/ash/login/oobe_screen.h" #include "chrome/grit/chromium_strings.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.h b/chrome/browser/ui/webui/ash/login/os_trial_screen_handler.h similarity index 86% rename from chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.h rename to chrome/browser/ui/webui/ash/login/os_trial_screen_handler.h index c9f8fa5..c3176139 100644 --- a/chrome/browser/ui/webui/chromeos/login/os_trial_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/os_trial_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OS_TRIAL_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OS_TRIAL_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_OS_TRIAL_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_OS_TRIAL_SCREEN_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" @@ -55,4 +55,4 @@ using ::chromeos::OsTrialScreenView; } // namespace ash -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OS_TRIAL_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_OS_TRIAL_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/packaged_license_screen_handler.cc b/chrome/browser/ui/webui/ash/login/packaged_license_screen_handler.cc similarity index 93% rename from chrome/browser/ui/webui/chromeos/login/packaged_license_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/packaged_license_screen_handler.cc index 20545196..0b6cd5a 100644 --- a/chrome/browser/ui/webui/chromeos/login/packaged_license_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/packaged_license_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/packaged_license_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/packaged_license_screen_handler.h" #include "chrome/browser/ash/login/screens/packaged_license_screen.h" #include "chrome/grit/generated_resources.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/packaged_license_screen_handler.h b/chrome/browser/ui/webui/ash/login/packaged_license_screen_handler.h similarity index 87% rename from chrome/browser/ui/webui/chromeos/login/packaged_license_screen_handler.h rename to chrome/browser/ui/webui/ash/login/packaged_license_screen_handler.h index 30f0b7b1..531d363 100644 --- a/chrome/browser/ui/webui/chromeos/login/packaged_license_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/packaged_license_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_PACKAGED_LICENSE_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_PACKAGED_LICENSE_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_PACKAGED_LICENSE_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_PACKAGED_LICENSE_SCREEN_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" @@ -52,4 +52,4 @@ using ::chromeos::PackagedLicenseView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_PACKAGED_LICENSE_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_PACKAGED_LICENSE_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.cc b/chrome/browser/ui/webui/ash/login/parental_handoff_screen_handler.cc similarity index 93% rename from chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/parental_handoff_screen_handler.cc index b4aba9c..4ba6ccd 100644 --- a/chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/parental_handoff_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/parental_handoff_screen_handler.h" #include "chrome/browser/ash/login/screens/parental_handoff_screen.h" #include "chrome/grit/chromium_strings.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.h b/chrome/browser/ui/webui/ash/login/parental_handoff_screen_handler.h similarity index 87% rename from chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.h rename to chrome/browser/ui/webui/ash/login/parental_handoff_screen_handler.h index bb77faa1..a721b5763 100644 --- a/chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/parental_handoff_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_PARENTAL_HANDOFF_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_PARENTAL_HANDOFF_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_PARENTAL_HANDOFF_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_PARENTAL_HANDOFF_SCREEN_HANDLER_H_ #include <string> @@ -59,4 +59,4 @@ using ::chromeos::ParentalHandoffScreenView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_PARENTAL_HANDOFF_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_PARENTAL_HANDOFF_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.cc b/chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.cc similarity index 97% rename from chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.cc index 8b1647e..9f78dac 100644 --- a/chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.h" #include <string> #include <utility>
diff --git a/chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.h b/chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.h similarity index 88% rename from chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.h rename to chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.h index 8ed2c78..38c411d 100644 --- a/chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/pin_setup_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_PIN_SETUP_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_PIN_SETUP_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_PIN_SETUP_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_PIN_SETUP_SCREEN_HANDLER_H_ #include <string> @@ -59,4 +59,4 @@ using ::chromeos::PinSetupScreenView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_PIN_SETUP_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_PIN_SETUP_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/quick_start_screen_handler.cc b/chrome/browser/ui/webui/ash/login/quick_start_screen_handler.cc similarity index 93% rename from chrome/browser/ui/webui/chromeos/login/quick_start_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/quick_start_screen_handler.cc index 7db7c27..6354fe6 100644 --- a/chrome/browser/ui/webui/chromeos/login/quick_start_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/quick_start_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/quick_start_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h" #include "base/values.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/quick_start_screen_handler.h b/chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h similarity index 87% rename from chrome/browser/ui/webui/chromeos/login/quick_start_screen_handler.h rename to chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h index 2a6051d..97a431b5 100644 --- a/chrome/browser/ui/webui/chromeos/login/quick_start_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_QUICK_START_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_QUICK_START_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_QUICK_START_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_QUICK_START_SCREEN_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "base/values.h" @@ -59,4 +59,4 @@ using chromeos::QuickStartView; } // namespace ash -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_QUICK_START_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_QUICK_START_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.cc b/chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.cc similarity index 97% rename from chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.cc index 43c561c..24b0fb4 100644 --- a/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.h" #include "ash/constants/ash_features.h" #include "base/metrics/histogram_functions.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h b/chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.h similarity index 90% rename from chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h rename to chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.h index 45494c5..7ab54f6 100644 --- a/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/recommend_apps_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RECOMMEND_APPS_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RECOMMEND_APPS_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_RECOMMEND_APPS_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_RECOMMEND_APPS_SCREEN_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "base/values.h" @@ -79,4 +79,4 @@ using ::chromeos::RecommendAppsScreenView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RECOMMEND_APPS_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_RECOMMEND_APPS_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/reset_screen_handler.cc b/chrome/browser/ui/webui/ash/login/reset_screen_handler.cc similarity index 98% rename from chrome/browser/ui/webui/chromeos/login/reset_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/reset_screen_handler.cc index 72b9b646..3cf1957 100644 --- a/chrome/browser/ui/webui/chromeos/login/reset_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/reset_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" #include <string>
diff --git a/chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h b/chrome/browser/ui/webui/ash/login/reset_screen_handler.h similarity index 93% rename from chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h rename to chrome/browser/ui/webui/ash/login/reset_screen_handler.h index 384bfab..72a9fdda 100644 --- a/chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/reset_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RESET_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RESET_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_RESET_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_RESET_SCREEN_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/tpm_firmware_update.h" @@ -98,4 +98,4 @@ using ::chromeos::ResetView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RESET_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_RESET_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.cc b/chrome/browser/ui/webui/ash/login/saml_challenge_key_handler.cc similarity index 98% rename from chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.cc rename to chrome/browser/ui/webui/ash/login/saml_challenge_key_handler.cc index 0e7530c..10b1878 100644 --- a/chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.cc +++ b/chrome/browser/ui/webui/ash/login/saml_challenge_key_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.h" +#include "chrome/browser/ui/webui/ash/login/saml_challenge_key_handler.h" #include "base/base64.h" #include "base/bind.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.h b/chrome/browser/ui/webui/ash/login/saml_challenge_key_handler.h similarity index 91% rename from chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.h rename to chrome/browser/ui/webui/ash/login/saml_challenge_key_handler.h index 5c59499..34ce083 100644 --- a/chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.h +++ b/chrome/browser/ui/webui/ash/login/saml_challenge_key_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SAML_CHALLENGE_KEY_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SAML_CHALLENGE_KEY_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SAML_CHALLENGE_KEY_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SAML_CHALLENGE_KEY_HANDLER_H_ #include <memory> #include <string> @@ -73,4 +73,4 @@ using ::chromeos::SamlChallengeKeyHandler; } // namespace ash -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SAML_CHALLENGE_KEY_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SAML_CHALLENGE_KEY_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.cc b/chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.cc similarity index 95% rename from chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.cc rename to chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.cc index 6b96dc7..3562cd5 100644 --- a/chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.cc +++ b/chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.cc
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.h" +#include "chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.h" + #include "base/values.h" #include "chrome/browser/ash/login/screens/saml_confirm_password_screen.h" #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.h b/chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.h similarity index 87% rename from chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.h rename to chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.h index 5dc6ef8b..a54abd0 100644 --- a/chrome/browser/ui/webui/chromeos/login/saml_confirm_password_handler.h +++ b/chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SAML_CONFIRM_PASSWORD_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SAML_CONFIRM_PASSWORD_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SAML_CONFIRM_PASSWORD_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SAML_CONFIRM_PASSWORD_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/oobe_screen.h" @@ -56,4 +56,4 @@ using ::chromeos::SamlConfirmPasswordView; } // namespace ash -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SAML_CONFIRM_PASSWORD_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SAML_CONFIRM_PASSWORD_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.cc b/chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.cc similarity index 95% rename from chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.cc index 4d627f9..9892638 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h" #include <string>
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h b/chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h similarity index 87% rename from chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h rename to chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h index 82278bb8..7a1ae03 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_FATAL_ERROR_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_FATAL_ERROR_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SIGNIN_FATAL_ERROR_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SIGNIN_FATAL_ERROR_SCREEN_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "base/values.h" @@ -55,4 +55,4 @@ using ::chromeos::SignInFatalErrorView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_FATAL_ERROR_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SIGNIN_FATAL_ERROR_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/ash/login/signin_screen_handler.cc similarity index 98% rename from chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/signin_screen_handler.cc index 91cb54c..c3378e7 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/signin_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/signin_screen_handler.h" #include <stddef.h> @@ -23,7 +23,7 @@ #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h b/chrome/browser/ui/webui/ash/login/signin_screen_handler.h similarity index 94% rename from chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h rename to chrome/browser/ui/webui/ash/login/signin_screen_handler.h index d162d20e..3cfb6fb 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/signin_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SIGNIN_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SIGNIN_SCREEN_HANDLER_H_ #include <map> #include <memory> @@ -19,7 +19,7 @@ #include "chrome/browser/ash/login/screens/error_screen.h" #include "chrome/browser/ash/login/signin_specifics.h" #include "chrome/browser/ui/webui/ash/login/base_webui_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" +#include "chrome/browser/ui/webui/ash/login/network_state_informer.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/web_ui.h" @@ -151,4 +151,4 @@ using ::chromeos::SigninScreenHandler; } // namespace ash -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SIGNIN_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_userlist_unittest.cc b/chrome/browser/ui/webui/ash/login/signin_userlist_unittest.cc similarity index 100% rename from chrome/browser/ui/webui/chromeos/login/signin_userlist_unittest.cc rename to chrome/browser/ui/webui/ash/login/signin_userlist_unittest.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/smart_privacy_protection_screen_handler.cc b/chrome/browser/ui/webui/ash/login/smart_privacy_protection_screen_handler.cc similarity index 94% rename from chrome/browser/ui/webui/chromeos/login/smart_privacy_protection_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/smart_privacy_protection_screen_handler.cc index 1af582d4..7319ffc 100644 --- a/chrome/browser/ui/webui/chromeos/login/smart_privacy_protection_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/smart_privacy_protection_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/smart_privacy_protection_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/smart_privacy_protection_screen_handler.h" #include "ash/constants/ash_features.h" #include "base/values.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/smart_privacy_protection_screen_handler.h b/chrome/browser/ui/webui/ash/login/smart_privacy_protection_screen_handler.h similarity index 87% rename from chrome/browser/ui/webui/chromeos/login/smart_privacy_protection_screen_handler.h rename to chrome/browser/ui/webui/ash/login/smart_privacy_protection_screen_handler.h index dc5b65a..6479414 100644 --- a/chrome/browser/ui/webui/chromeos/login/smart_privacy_protection_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/smart_privacy_protection_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SMART_PRIVACY_PROTECTION_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SMART_PRIVACY_PROTECTION_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SMART_PRIVACY_PROTECTION_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SMART_PRIVACY_PROTECTION_SCREEN_HANDLER_H_ #include "base/values.h" #include "chrome/browser/ash/login/oobe_screen.h" @@ -62,4 +62,4 @@ using ::chromeos::SmartPrivacyProtectionView; } // namespace ash -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SMART_PRIVACY_PROTECTION_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SMART_PRIVACY_PROTECTION_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/ssh_configured_handler.cc b/chrome/browser/ui/webui/ash/login/ssh_configured_handler.cc similarity index 97% rename from chrome/browser/ui/webui/chromeos/login/ssh_configured_handler.cc rename to chrome/browser/ui/webui/ash/login/ssh_configured_handler.cc index e98302cc..ac7ab24 100644 --- a/chrome/browser/ui/webui/chromeos/login/ssh_configured_handler.cc +++ b/chrome/browser/ui/webui/ash/login/ssh_configured_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/ssh_configured_handler.h" +#include "chrome/browser/ui/webui/ash/login/ssh_configured_handler.h" #include "chrome/browser/ui/webui/ash/login/base_webui_handler.h" #include "chrome/grit/generated_resources.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/ssh_configured_handler.h b/chrome/browser/ui/webui/ash/login/ssh_configured_handler.h similarity index 84% rename from chrome/browser/ui/webui/chromeos/login/ssh_configured_handler.h rename to chrome/browser/ui/webui/ash/login/ssh_configured_handler.h index 4723fe8..960e714 100644 --- a/chrome/browser/ui/webui/chromeos/login/ssh_configured_handler.h +++ b/chrome/browser/ui/webui/ash/login/ssh_configured_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SSH_CONFIGURED_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SSH_CONFIGURED_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SSH_CONFIGURED_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SSH_CONFIGURED_HANDLER_H_ #include <string> #include <vector> @@ -42,4 +42,4 @@ } // namespace chromeos -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SSH_CONFIGURED_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SSH_CONFIGURED_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.cc b/chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.cc similarity index 98% rename from chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.cc index d7da8337..03644169 100644 --- a/chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.h" #include <string> #include <unordered_map>
diff --git a/chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h b/chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.h similarity index 93% rename from chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h rename to chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.h index a9cc7e9..79bc47ab 100644 --- a/chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SYNC_CONSENT_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SYNC_CONSENT_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SYNC_CONSENT_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SYNC_CONSENT_SCREEN_HANDLER_H_ #include <string> #include <unordered_map> @@ -96,4 +96,4 @@ using ::chromeos::SyncConsentScreenView; } // namespace ash -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SYNC_CONSENT_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_SYNC_CONSENT_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc b/chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.cc similarity index 96% rename from chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.cc index ecfd0bb..ba462c5d 100644 --- a/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h" #include <memory> #include <vector>
diff --git a/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h b/chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h similarity index 90% rename from chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h rename to chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h index 12b1cd6c..f759be8 100644 --- a/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/terms_of_service_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H_ #include <string> @@ -76,4 +76,4 @@ using ::chromeos::TermsOfServiceScreenView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/ash/login/testapi/oobe_test_api_browsertest.cc b/chrome/browser/ui/webui/ash/login/testapi/oobe_test_api_browsertest.cc index 7fb4902..a0595e1 100644 --- a/chrome/browser/ui/webui/ash/login/testapi/oobe_test_api_browsertest.cc +++ b/chrome/browser/ui/webui/ash/login/testapi/oobe_test_api_browsertest.cc
@@ -20,8 +20,8 @@ #include "chrome/browser/ash/policy/enrollment/enrollment_requisition_manager.h" #include "chrome/browser/ui/webui/ash/login/consolidated_consent_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/gaia_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/marketing_opt_in_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/sync_consent_screen_handler.h" #include "content/public/test/browser_test.h" namespace chromeos {
diff --git a/chrome/browser/ui/webui/chromeos/login/theme_selection_screen_handler.cc b/chrome/browser/ui/webui/ash/login/theme_selection_screen_handler.cc similarity index 95% rename from chrome/browser/ui/webui/chromeos/login/theme_selection_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/theme_selection_screen_handler.cc index cc3490c..f75a3cd1 100644 --- a/chrome/browser/ui/webui/chromeos/login/theme_selection_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/theme_selection_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/theme_selection_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/theme_selection_screen_handler.h" #include "ash/constants/ash_features.h" #include "chrome/browser/ash/login/oobe_screen.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/theme_selection_screen_handler.h b/chrome/browser/ui/webui/ash/login/theme_selection_screen_handler.h similarity index 88% rename from chrome/browser/ui/webui/chromeos/login/theme_selection_screen_handler.h rename to chrome/browser/ui/webui/ash/login/theme_selection_screen_handler.h index 4a6c569..3f6190ed 100644 --- a/chrome/browser/ui/webui/chromeos/login/theme_selection_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/theme_selection_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_THEME_SELECTION_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_THEME_SELECTION_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_THEME_SELECTION_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_THEME_SELECTION_SCREEN_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/oobe_screen.h" @@ -62,4 +62,4 @@ using ::chromeos::ThemeSelectionScreenView; } // namespace ash -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_THEME_SELECTION_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_THEME_SELECTION_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.cc b/chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.cc similarity index 95% rename from chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.cc index 8e8d032..d510028a 100644 --- a/chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.h" #include "base/values.h" #include "chrome/grit/chromium_strings.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h b/chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.h similarity index 87% rename from chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h rename to chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.h index 94d58cc..1182622 100644 --- a/chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/tpm_error_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TPM_ERROR_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TPM_ERROR_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_TPM_ERROR_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_TPM_ERROR_SCREEN_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" @@ -55,4 +55,4 @@ using ::chromeos::TpmErrorView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TPM_ERROR_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_TPM_ERROR_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.cc b/chrome/browser/ui/webui/ash/login/update_required_screen_handler.cc similarity index 98% rename from chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/update_required_screen_handler.cc index 7b13ca0..999edd7 100644 --- a/chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/update_required_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_required_screen_handler.h" #include <memory>
diff --git a/chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h b/chrome/browser/ui/webui/ash/login/update_required_screen_handler.h similarity index 94% rename from chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h rename to chrome/browser/ui/webui/ash/login/update_required_screen_handler.h index c0993cc0..5ab1212a 100644 --- a/chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/update_required_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_UPDATE_REQUIRED_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_UPDATE_REQUIRED_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_UPDATE_REQUIRED_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_UPDATE_REQUIRED_SCREEN_HANDLER_H_ #include <string> @@ -106,4 +106,4 @@ using ::chromeos::UpdateRequiredView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_UPDATE_REQUIRED_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_UPDATE_REQUIRED_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/update_screen_handler.cc b/chrome/browser/ui/webui/ash/login/update_screen_handler.cc similarity index 98% rename from chrome/browser/ui/webui/chromeos/login/update_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/update_screen_handler.cc index 494bb53..439872e 100644 --- a/chrome/browser/ui/webui/chromeos/login/update_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/update_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/update_screen_handler.h" #include <memory>
diff --git a/chrome/browser/ui/webui/chromeos/login/update_screen_handler.h b/chrome/browser/ui/webui/ash/login/update_screen_handler.h similarity index 92% rename from chrome/browser/ui/webui/chromeos/login/update_screen_handler.h rename to chrome/browser/ui/webui/ash/login/update_screen_handler.h index 68d3822..45433b8 100644 --- a/chrome/browser/ui/webui/chromeos/login/update_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/update_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_UPDATE_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_UPDATE_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_UPDATE_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_UPDATE_SCREEN_HANDLER_H_ #include <memory> #include <string> @@ -91,4 +91,4 @@ using ::chromeos::UpdateView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_UPDATE_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_UPDATE_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.cc b/chrome/browser/ui/webui/ash/login/user_creation_screen_handler.cc similarity index 96% rename from chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/user_creation_screen_handler.cc index cc630d8..7893c84 100644 --- a/chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/user_creation_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h" #include "base/values.h" #include "chrome/browser/ash/login/oobe_screen.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h b/chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h similarity index 87% rename from chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h rename to chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h index d11230d6..f48d79c 100644 --- a/chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/user_creation_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_USER_CREATION_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_USER_CREATION_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_USER_CREATION_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_USER_CREATION_SCREEN_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" @@ -60,4 +60,4 @@ using ::chromeos::UserCreationView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_USER_CREATION_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_USER_CREATION_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.cc b/chrome/browser/ui/webui/ash/login/welcome_screen_handler.cc similarity index 98% rename from chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/welcome_screen_handler.cc index 0f142b2..72af1ad0 100644 --- a/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/welcome_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #include <stddef.h> @@ -29,7 +29,7 @@ #include "chrome/browser/ui/webui/ash/login/core_oobe_handler.h" #include "chrome/browser/ui/webui/ash/login/l10n_util.h" #include "chrome/browser/ui/webui/ash/login/oobe_ui.h" -#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h b/chrome/browser/ui/webui/ash/login/welcome_screen_handler.h similarity index 94% rename from chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h rename to chrome/browser/ui/webui/ash/login/welcome_screen_handler.h index de506ac9..4ddb866 100644 --- a/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/welcome_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_WELCOME_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_WELCOME_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_WELCOME_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_WELCOME_SCREEN_HANDLER_H_ #include <memory> #include <string> @@ -136,4 +136,4 @@ using ::chromeos::WelcomeView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_WELCOME_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_WELCOME_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.cc b/chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.cc similarity index 93% rename from chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.cc rename to chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.cc index 727df24..48a6f7fe 100644 --- a/chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.h" #include "chrome/browser/ash/login/oobe_screen.h" #include "chrome/browser/ash/login/screens/wrong_hwid_screen.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h b/chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.h similarity index 86% rename from chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h rename to chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.h index 191eea7..d7f0fae 100644 --- a/chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/wrong_hwid_screen_handler.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_WRONG_HWID_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_WRONG_HWID_SCREEN_HANDLER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_WRONG_HWID_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_WRONG_HWID_SCREEN_HANDLER_H_ #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" @@ -53,4 +53,4 @@ using ::chromeos::WrongHWIDScreenView; } -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_WRONG_HWID_SCREEN_HANDLER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_WRONG_HWID_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/ash/network_ui.h b/chrome/browser/ui/webui/ash/network_ui.h index f40015f..a937895 100644 --- a/chrome/browser/ui/webui/ash/network_ui.h +++ b/chrome/browser/ui/webui/ash/network_ui.h
@@ -6,15 +6,28 @@ #define CHROME_BROWSER_UI_WEBUI_ASH_NETWORK_UI_H_ #include "base/values.h" +#include "chrome/common/webui_url_constants.h" #include "chromeos/ash/services/cellular_setup/public/mojom/esim_manager.mojom-forward.h" #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h" #include "chromeos/services/network_health/public/mojom/network_diagnostics.mojom-forward.h" #include "chromeos/services/network_health/public/mojom/network_health.mojom-forward.h" +#include "content/public/browser/webui_config.h" +#include "content/public/common/url_constants.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "ui/webui/mojo_web_ui_controller.h" namespace ash { +class NetworkUI; + +// WebUIConfig for chrome://network +class NetworkUIConfig : public content::DefaultWebUIConfig<NetworkUI> { + public: + NetworkUIConfig() + : DefaultWebUIConfig(content::kChromeUIScheme, + chrome::kChromeUINetworkHost) {} +}; + // WebUI controller for chrome://network debugging page. class NetworkUI : public ui::MojoWebUIController { public:
diff --git a/chrome/browser/ui/webui/ash/parent_access/parent_access_ui.h b/chrome/browser/ui/webui/ash/parent_access/parent_access_ui.h index 112318b4..79405a8a 100644 --- a/chrome/browser/ui/webui/ash/parent_access/parent_access_ui.h +++ b/chrome/browser/ui/webui/ash/parent_access/parent_access_ui.h
@@ -9,13 +9,27 @@ #include "chrome/browser/ui/webui/ash/parent_access/parent_access_ui.mojom-forward.h" #include "chrome/browser/ui/webui/ash/parent_access/parent_access_ui_handler_impl.h" +#include "chrome/common/webui_url_constants.h" #include "components/signin/public/identity_manager/identity_manager.h" +#include "content/public/browser/webui_config.h" +#include "content/public/common/url_constants.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "ui/web_dialogs/web_dialog_ui.h" #include "url/gurl.h" namespace ash { +class ParentAccessUI; + +// WebUIConfig for chrome://parent-access +class ParentAccessUIConfig + : public content::DefaultWebUIConfig<ParentAccessUI> { + public: + ParentAccessUIConfig() + : DefaultWebUIConfig(content::kChromeUIScheme, + chrome::kChromeUIParentAccessHost) {} +}; + // Controller for the ParentAccessUI, a WebUI which enables parent verification. // It is hosted at chrome://parent-access. class ParentAccessUI : public ui::MojoWebDialogUI {
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index 269f9a9..4eaee4b 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -995,8 +995,6 @@ } return &NewWebUI<ash::cloud_upload::CloudUploadUI>; } - if (url.host_piece() == chrome::kChromeUIParentAccessHost) - return &NewWebUI<ash::ParentAccessUI>; if (url.host_piece() == chrome::kChromeUIAudioHost && base::FeatureList::IsEnabled(chromeos::features::kAudioUrl)) { return &NewWebUI<ash::AudioUI>; @@ -1007,10 +1005,6 @@ return &NewWebUI<ash::ConnectivityDiagnosticsUI>; if (url.host_piece() == ash::kChromeUIGuestOSInstallerHost) return &NewWebUI<ash::GuestOSInstallerUI>; - if (url.host_piece() == chrome::kChromeUICryptohomeHost) - return &NewWebUI<ash::CryptohomeUI>; - if (url.host_piece() == chrome::kChromeUIDriveInternalsHost) - return &NewWebUI<ash::DriveInternalsUI>; if (url.host_piece() == ash::kChromeUIFilesInternalsHost) return &NewWebUI<ash::FilesInternalsUI>; if (url.host_piece() == chrome::kChromeUILauncherInternalsHost) @@ -1029,8 +1023,6 @@ return &NewWebUI<ash::MultideviceInternalsUI>; if (url.host_piece() == chrome::kChromeUIMultiDeviceSetupHost) return &NewWebUI<ash::multidevice_setup::MultiDeviceSetupDialogUI>; - if (url.host_piece() == chrome::kChromeUINetworkHost) - return &NewWebUI<ash::NetworkUI>; if (url.host_piece() == chrome::kChromeUIOobeHost) { if (ash::ProfileHelper::IsSigninProfile(profile)) { return &NewWebUI<chromeos::OobeUI>;
diff --git a/chrome/browser/ui/webui/chromeos/chrome_web_ui_configs_chromeos.cc b/chrome/browser/ui/webui/chromeos/chrome_web_ui_configs_chromeos.cc index e3dc8cac..be3bb6fa 100644 --- a/chrome/browser/ui/webui/chromeos/chrome_web_ui_configs_chromeos.cc +++ b/chrome/browser/ui/webui/chromeos/chrome_web_ui_configs_chromeos.cc
@@ -17,7 +17,11 @@ #include "chrome/browser/ui/webui/ash/bluetooth_pairing_dialog.h" #include "chrome/browser/ui/webui/ash/crostini_installer/crostini_installer_ui.h" #include "chrome/browser/ui/webui/ash/crostini_upgrader/crostini_upgrader_ui.h" +#include "chrome/browser/ui/webui/ash/cryptohome_ui.h" +#include "chrome/browser/ui/webui/ash/drive_internals_ui.h" +#include "chrome/browser/ui/webui/ash/network_ui.h" #include "chrome/browser/ui/webui/ash/notification_tester/notification_tester_ui.h" +#include "chrome/browser/ui/webui/ash/parent_access/parent_access_ui.h" #if !defined(OFFICIAL_BUILD) #include "ash/webui/sample_system_web_app_ui/sample_system_web_app_ui.h" #endif // !defined(OFFICIAL_BUILD) @@ -50,14 +54,18 @@ map.AddWebUIConfig( MakeComponentConfig<ash::CameraAppUIConfig, ash::CameraAppUI, ChromeCameraAppUIDelegate>()); - map.AddWebUIConfig(std::make_unique<ash::ShortcutCustomizationAppUIConfig>()); - map.AddWebUIConfig(std::make_unique<ash::NotificationTesterUIConfig>()); - map.AddWebUIConfig(std::make_unique<ash::AccountMigrationWelcomeUIConfig>()); map.AddWebUIConfig(std::make_unique<ash::AccountManagerErrorUIConfig>()); - map.AddWebUIConfig(std::make_unique<ash::BluetoothPairingDialogUIConfig>()); + map.AddWebUIConfig(std::make_unique<ash::AccountMigrationWelcomeUIConfig>()); map.AddWebUIConfig(std::make_unique<ash::AddSupervisionUIConfig>()); + map.AddWebUIConfig(std::make_unique<ash::BluetoothPairingDialogUIConfig>()); map.AddWebUIConfig(std::make_unique<ash::CrostiniInstallerUIConfig>()); map.AddWebUIConfig(std::make_unique<ash::CrostiniUpgraderUIConfig>()); + map.AddWebUIConfig(std::make_unique<ash::CryptohomeUIConfig>()); + map.AddWebUIConfig(std::make_unique<ash::DriveInternalsUIConfig>()); + map.AddWebUIConfig(std::make_unique<ash::NetworkUIConfig>()); + map.AddWebUIConfig(std::make_unique<ash::NotificationTesterUIConfig>()); + map.AddWebUIConfig(std::make_unique<ash::ParentAccessUIConfig>()); + map.AddWebUIConfig(std::make_unique<ash::ShortcutCustomizationAppUIConfig>()); #if !defined(OFFICIAL_BUILD) map.AddWebUIConfig(std::make_unique<ash::SampleSystemWebAppUIConfig>()); #endif // !defined(OFFICIAL_BUILD)
diff --git a/chrome/browser/ui/webui/chromeos/login/DEPS b/chrome/browser/ui/webui/chromeos/login/DEPS deleted file mode 100644 index 392d2cf..0000000 --- a/chrome/browser/ui/webui/chromeos/login/DEPS +++ /dev/null
@@ -1,23 +0,0 @@ -# TODO(https://crbug.com/1164001): When this file is edited, same file in -# //chrome/browser/ui/webui/ash/login should be updated as well. We need -# to sync both files until the migration is done. -specific_include_rules = { - "core_oobe_handler\.cc": [ - "+ash/shell.h", - ], - "oobe_ui\.cc": [ - "+ash/shell.h", - ], - # Tests. - "oobe_display_chooser_browsertest\.cc": [ - "+ash/shell.h", - ], - "oobe_display_chooser_unittest.cc": [ - "+ash/display/display_configuration_controller.h", - "+ash/shell.h", - "+ash/test/ash_test_base.h", - ], - "signin_userlist_unittest\.cc": [ - "+ash/test/ash_test_base.h" - ], -}
diff --git a/chrome/browser/ui/webui/chromeos/login/DIR_METADATA b/chrome/browser/ui/webui/chromeos/login/DIR_METADATA deleted file mode 100644 index 48e71f8..0000000 --- a/chrome/browser/ui/webui/chromeos/login/DIR_METADATA +++ /dev/null
@@ -1,6 +0,0 @@ -# TODO(https://crbug.com/1164001): When this file is edited, same file in -# //chrome/browser/ui/webui/ash/login should be updated as well. We need -# to sync both files until the migration is done. -monorail { - component: "UI>Shell>OOBE" -}
diff --git a/chrome/browser/ui/webui/chromeos/login/OWNERS b/chrome/browser/ui/webui/chromeos/login/OWNERS deleted file mode 100644 index 5f0ac0af..0000000 --- a/chrome/browser/ui/webui/chromeos/login/OWNERS +++ /dev/null
@@ -1 +0,0 @@ -file://chrome/browser/ui/webui/ash/login/OWNERS
diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc index 6cf0210f..7c3e836 100644 --- a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc +++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc
@@ -22,6 +22,7 @@ #include "base/metrics/field_trial_params.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" +#include "base/ranges/algorithm.h" #include "base/strings/strcat.h" #include "base/strings/string_piece.h" #include "base/strings/string_split.h" @@ -713,12 +714,11 @@ } // Second, append Finch order for modules _not_ ordered by drag&drop. - std::vector<std::string> finch_module_ids = ntp_features::GetModulesOrder(); - std::copy_if(finch_module_ids.begin(), finch_module_ids.end(), - std::back_inserter(module_ids), - [&module_ids](const std::string& id) { - return !base::Contains(module_ids, id); - }); + base::ranges::copy_if(ntp_features::GetModulesOrder(), + std::back_inserter(module_ids), + [&module_ids](const std::string& id) { + return !base::Contains(module_ids, id); + }); std::move(callback).Run(std::move(module_ids)); }
diff --git a/chrome/browser/ui/webui/print_preview/fake_print_render_frame.cc b/chrome/browser/ui/webui/print_preview/fake_print_render_frame.cc index e942b0b..1b6db8cc 100644 --- a/chrome/browser/ui/webui/print_preview/fake_print_render_frame.cc +++ b/chrome/browser/ui/webui/print_preview/fake_print_render_frame.cc
@@ -47,7 +47,7 @@ void FakePrintRenderFrame::PrintingDone(bool success) {} -void FakePrintRenderFrame::SetPrintingEnabled(bool enabled) {} +void FakePrintRenderFrame::ConnectToPdfRenderer() {} void FakePrintRenderFrame::PrintNodeUnderContextMenu() {}
diff --git a/chrome/browser/ui/webui/print_preview/fake_print_render_frame.h b/chrome/browser/ui/webui/print_preview/fake_print_render_frame.h index 2273775e..7f6faeb 100644 --- a/chrome/browser/ui/webui/print_preview/fake_print_render_frame.h +++ b/chrome/browser/ui/webui/print_preview/fake_print_render_frame.h
@@ -39,7 +39,7 @@ void PrintFrameContent(mojom::PrintFrameContentParamsPtr params, PrintFrameContentCallback callback) override; void PrintingDone(bool success) override; - void SetPrintingEnabled(bool enabled) override; + void ConnectToPdfRenderer() override; void PrintNodeUnderContextMenu() override; #if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS) void SnapshotForContentAnalysis(
diff --git a/chrome/browser/ui/webui/settings/ash/device_stylus_handler.cc b/chrome/browser/ui/webui/settings/ash/device_stylus_handler.cc index cd2bd12b..660b48da 100644 --- a/chrome/browser/ui/webui/settings/ash/device_stylus_handler.cc +++ b/chrome/browser/ui/webui/settings/ash/device_stylus_handler.cc
@@ -16,7 +16,6 @@ #include "chrome/browser/ash/arc/arc_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" -#include "components/services/app_service/public/cpp/features.h" namespace ash::settings { @@ -166,15 +165,9 @@ DCHECK( apps::AppServiceProxyFactory::IsAppServiceAvailableForProfile(profile)); - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - apps::AppServiceProxyFactory::GetForProfile(profile)->LaunchAppWithUrl( - arc::kPlayStoreAppId, ui::EF_NONE, GURL(apps_url), - apps::LaunchSource::kFromChromeInternal); - } else { - apps::AppServiceProxyFactory::GetForProfile(profile)->LaunchAppWithUrl( - arc::kPlayStoreAppId, ui::EF_NONE, GURL(apps_url), - apps::mojom::LaunchSource::kFromChromeInternal); - } + apps::AppServiceProxyFactory::GetForProfile(profile)->LaunchAppWithUrl( + arc::kPlayStoreAppId, ui::EF_NONE, GURL(apps_url), + apps::LaunchSource::kFromChromeInternal); } } // namespace ash::settings
diff --git a/chrome/browser/ui/webui/settings/ash/parental_controls_handler.cc b/chrome/browser/ui/webui/settings/ash/parental_controls_handler.cc index 9e9613f..2a85d7322 100644 --- a/chrome/browser/ui/webui/settings/ash/parental_controls_handler.cc +++ b/chrome/browser/ui/webui/settings/ash/parental_controls_handler.cc
@@ -85,17 +85,10 @@ // No FLH app installed, so try to launch Play Store to FLH app install page. if (registry.GetAppType(arc::kPlayStoreAppId) != apps::AppType::kUnknown) { - if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { - proxy->LaunchAppWithUrl( - arc::kPlayStoreAppId, ui::EF_NONE, - GURL(ChildUserService::kFamilyLinkHelperAppPlayStoreURL), - apps::LaunchSource::kFromChromeInternal); - } else { - proxy->LaunchAppWithUrl( - arc::kPlayStoreAppId, ui::EF_NONE, - GURL(ChildUserService::kFamilyLinkHelperAppPlayStoreURL), - apps::mojom::LaunchSource::kFromChromeInternal); - } + proxy->LaunchAppWithUrl( + arc::kPlayStoreAppId, ui::EF_NONE, + GURL(ChildUserService::kFamilyLinkHelperAppPlayStoreURL), + apps::LaunchSource::kFromChromeInternal); return; }
diff --git a/chrome/browser/ui/webui/webui_webview_browsertest.cc b/chrome/browser/ui/webui/webui_webview_browsertest.cc index 1d8f001..7a0609f 100644 --- a/chrome/browser/ui/webui/webui_webview_browsertest.cc +++ b/chrome/browser/ui/webui/webui_webview_browsertest.cc
@@ -31,7 +31,7 @@ #include "ash/constants/ash_switches.h" #include "chrome/browser/ash/login/test/oobe_screen_waiter.h" #include "chrome/browser/ash/login/ui/login_display_host.h" -#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/welcome_screen_handler.h" #endif // Turn these tests off on Mac while we collect data on windows server crashes
diff --git a/chrome/browser/ui/webui/welcome/helpers.cc b/chrome/browser/ui/webui/welcome/helpers.cc index 4d28d8d6..17fe060 100644 --- a/chrome/browser/ui/webui/welcome/helpers.cc +++ b/chrome/browser/ui/webui/welcome/helpers.cc
@@ -11,6 +11,7 @@ #include "base/feature_list.h" #include "base/metrics/field_trial.h" #include "base/metrics/field_trial_params.h" +#include "base/ranges/algorithm.h" #include "base/strings/string_split.h" #include "base/strings/string_tokenizer.h" #include "base/strings/string_util.h" @@ -245,17 +246,14 @@ std::string FilterModules(const std::string& requested_modules, const std::vector<std::string>& available_modules) { - std::vector<std::string> requested_list = base::SplitString( - requested_modules, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); std::vector<std::string> filtered_modules; - - std::copy_if(requested_list.begin(), requested_list.end(), - std::back_inserter(filtered_modules), - [available_modules](std::string module) { - return !module.empty() && - base::Contains(available_modules, module); - }); - + base::ranges::copy_if( + base::SplitString(requested_modules, ",", base::TRIM_WHITESPACE, + base::SPLIT_WANT_NONEMPTY), + std::back_inserter(filtered_modules), + [&available_modules](const std::string& module) { + return !module.empty() && base::Contains(available_modules, module); + }); return base::JoinString(filtered_modules, ","); }
diff --git a/chrome/browser/web_applications/BUILD.gn b/chrome/browser/web_applications/BUILD.gn index 6e30082..d2429a0 100644 --- a/chrome/browser/web_applications/BUILD.gn +++ b/chrome/browser/web_applications/BUILD.gn
@@ -174,7 +174,6 @@ "web_app_icon_manager.cc", "web_app_icon_manager.h", "web_app_id.h", - "web_app_id_constants.cc", "web_app_id_constants.h", "web_app_install_finalizer.cc", "web_app_install_finalizer.h",
diff --git a/chrome/browser/web_applications/app_service/web_apps.cc b/chrome/browser/web_applications/app_service/web_apps.cc index a745e550..cf4b996 100644 --- a/chrome/browser/web_applications/app_service/web_apps.cc +++ b/chrome/browser/web_applications/app_service/web_apps.cc
@@ -264,34 +264,6 @@ apps::ConvertMojomWindowInfoToWindowInfo(window_info)); } -void WebApps::LaunchAppWithFiles(const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) { - publisher_helper().LaunchAppWithFiles( - app_id, event_flags, - apps::ConvertMojomLaunchSourceToLaunchSource(launch_source), - apps::ConvertMojomFilePathsToFilePaths(std::move(file_paths))); -} - -void WebApps::LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) { - publisher_helper().LaunchAppWithIntent( - app_id, event_flags, apps::ConvertMojomIntentToIntent(intent), - apps::ConvertMojomLaunchSourceToLaunchSource(launch_source), - apps::ConvertMojomWindowInfoToWindowInfo(window_info), - base::BindOnce( - [](LaunchAppWithIntentCallback callback, - apps::LaunchResult&& result) { - std::move(callback).Run(apps::ConvertLaunchResultToBool(result)); - }, - std::move(callback))); -} - void WebApps::OpenNativeSettings(const std::string& app_id) { publisher_helper().OpenNativeSettings(app_id); }
diff --git a/chrome/browser/web_applications/app_service/web_apps.h b/chrome/browser/web_applications/app_service/web_apps.h index 0be225f..fcc5a5d 100644 --- a/chrome/browser/web_applications/app_service/web_apps.h +++ b/chrome/browser/web_applications/app_service/web_apps.h
@@ -137,16 +137,6 @@ int32_t event_flags, apps::mojom::LaunchSource launch_source, apps::mojom::WindowInfoPtr window_info) override; - void LaunchAppWithFiles(const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) override; - void LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) override; void OpenNativeSettings(const std::string& app_id) override; void SetWindowMode(const std::string& app_id, apps::mojom::WindowMode window_mode) override;
diff --git a/chrome/browser/web_applications/web_app_id_constants.cc b/chrome/browser/web_applications/web_app_id_constants.cc deleted file mode 100644 index ddab0a0..0000000 --- a/chrome/browser/web_applications/web_app_id_constants.cc +++ /dev/null
@@ -1,185 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/web_applications/web_app_id_constants.h" - -#include "base/strings/string_piece.h" - -namespace web_app { - -// The URLs used to generate the app IDs MUST match the start_url field of the -// manifest served by the PWA. -// Please maintain the alphabetical order when adding new app IDs. - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://calculator.apps.chrome/")) -const char kCalculatorAppId[] = "oabkinaljpjeilageghcdlnekhphhphl"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome://camera-app/views/main.html")) -const char kCameraAppId[] = "njfbnohfdkmbmnjapinfcopialeghnmh"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://canvas.apps.chrome/")) -const char kCanvasAppId[] = "ieailfmhaghpphfffooibmlghaeopach"; - -// TODO(crbug.com/1334053) -const char kCloudGamingPartnerPlatform[] = "egmafekfmcnknbdlbfbhafbllplmjlhn"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome-untrusted://crosh/")) -const char kCroshAppId[] = "cgfnfgkafmcdkdgilmojlnaadileaach"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://cursive.apps.chrome/")) -const char kCursiveAppId[] = "apignacaigpffemhdbhmnajajaccbckh"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, -// GURL("chrome://diagnostics/")) -const char kDiagnosticsAppId[] = "keejpcfcpecjhmepmpcfgjemkmlicpam"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, -// GURL("chrome://accessory-update/")) -const char kFirmwareUpdateAppId[] = "nedcdcceagjbkiaecmdbpafcmlhkiifa"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://mail.google.com/mail/?usp=installed_webapp")) -const char kGmailAppId[] = "fmgjjmmmlfnkbppncabfkddbjimcfncm"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://calendar.google.com/calendar/r")) -const char kGoogleCalendarAppId[] = "kjbdgfilnfhdoflbpgamdcdgpehopbep"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://mail.google.com/chat/")) -const char kGoogleChatAppId[] = "mdpkiolbdkhdjpekfbkbmhigcaggjagi"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://docs.google.com/document/?usp=installed_webapp")) -const char kGoogleDocsAppId[] = "mpnpojknpmmopombnjdcgaaiekajbnjb"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://drive.google.com/?lfhs=2")) -const char kGoogleDriveAppId[] = "aghbiahbpaijignceidepookljebhfak"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://keep.google.com/?usp=installed_webapp")) -const char kGoogleKeepAppId[] = "eilembjdkfgodjkcjnpgpaenohkicgjd"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://www.google.com/maps?force=tt&source=ttpwa")) -const char kGoogleMapsAppId[] = "mnhkaebcjjhencmpkapnbdaogjamfbcj"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://meet.google.com/landing?lfhs=2")) -const char kGoogleMeetAppId[] = "kjgfgldnnfoeklkmfkjfagphfepbbdan"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://play.google.com/store/movies?usp=installed_webapp")) -const char kGoogleMoviesAppId[] = "aiihaadhfoadjgjcegeomiajkajbjlcn"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://news.google.com/?lfhs=2")) -const char kGoogleNewsAppId[] = "kfgapjallbhpciobgmlhlhokknljkgho"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://docs.google.com/spreadsheets/?usp=installed_webapp")) -const char kGoogleSheetsAppId[] = "fhihpiojkbmbpdjeoajapmgkhlnakfjf"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://docs.google.com/presentation/?usp=installed_webapp")) -const char kGoogleSlidesAppId[] = "kefjledonklijopmnomlcbpllchaibag"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome://help-app/")) -const char kHelpAppId[] = "nbljnnecbjbmifnoehiemkgefbnpoeak"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome://media-app/")) -const char kMediaAppId[] = "jhdjimmaggjajfjphpljagpgkidjilnj"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://messages.google.com/web/")) -const char kMessagesAppId[] = "hpfldicfbfomlpcikngkocigghgafkph"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://messages-web.sandbox.google.com/web/")) -const char kMessagesDogfoodDeprecatedAppId[] = - "gkgiochgbaoelfjibmnaomdepldjceib"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://www.office.com/?from=Homescreen")) -const char kMicrosoftOfficeAppId[] = "ocdlmjhbenodhlknglojajgokahchlkk"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome://test-system-app/pwa.html")) -const char kMockSystemAppId[] = "maphiehpiinjgiaepbljmopkodkadcbh"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome://os-feedback/")) -const char kOsFeedbackAppId[] = "iffgohomcomlpmkfikfffagkkoojjffm"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome://os-settings/")) -const char kOsSettingsAppId[] = "odknhmnlageboeamepcngndbggdpaobj"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome://personalization/")) -const char kPersonalizationAppId[] = "glenkcidjgckcomnliblmkokolehpckn"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://books.google.com/ebooks/app")) -const char kPlayBooksAppId[] = "jglfhlbohpgcbefmhdmpancnijacbbji"; - -// Generated as:web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome://print-management/")) -const char kPrintManagementAppId[] = "fglkccnmnaankjodgccmiodmlkpaiodc"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, -// GURL("chrome://scanning/")) -const char kScanningAppId[] = "cdkahakpgkdaoffdmfgnhgomkelkocfo"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome://settings/")) -const char kSettingsAppId[] = "inogagmajamaleonmanpkpkkigmklfad"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome://shortcut-customization")) -const char kShortcutCustomizationAppId[] = "ihgeegogifolehadhdgelgcnbnmemikp"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome://shimless-rma/")) -const char kShimlessRMAAppId[] = "ijolhdommgkkhpenofmpkkhlepahelcm"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://www.showtime.com/")) -const char kShowtimeAppId[] = "eoccpgmpiempcflglfokeengliildkag"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://stadia.google.com/?lfhs=2")) -const char kStadiaAppId[] = "pnkcfpnngfokcnnijgkllghjlhkailce"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://www.youtube.com/?feature=ytca")) -const char kYoutubeAppId[] = "agimnkijcaahngcdmfeangaknmldooml"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://music.youtube.com/?source=pwa")) -const char kYoutubeMusicAppId[] = "cinhimbnkkaeohfgghhklpknlkffjgod"; - -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "https://tv.youtube.com/")) -const char kYoutubeTVAppId[] = "kiemjbkkegajmpbobdfngbmjccjhnofh"; - -#if !defined(OFFICIAL_BUILD) -// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( -// "chrome://sample-system-web-app")) -const char kSampleSystemWebAppId[] = "jalmdcokfklmaoadompgacjlcomfckcf"; -#endif // !defined(OFFICIAL_BUILD) - -bool IsSystemAppIdWithFileHandlers(base::StringPiece id) { - return id == kMediaAppId; -} - -} // namespace web_app
diff --git a/chrome/browser/web_applications/web_app_id_constants.h b/chrome/browser/web_applications/web_app_id_constants.h index 4a4330c3..289c4d6 100644 --- a/chrome/browser/web_applications/web_app_id_constants.h +++ b/chrome/browser/web_applications/web_app_id_constants.h
@@ -5,57 +5,186 @@ #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_ID_CONSTANTS_H_ #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_ID_CONSTANTS_H_ -#include "base/strings/string_piece_forward.h" - namespace web_app { -extern const char kCalculatorAppId[]; -extern const char kCameraAppId[]; -extern const char kCanvasAppId[]; -extern const char kCloudGamingPartnerPlatform[]; -extern const char kCroshAppId[]; -extern const char kCursiveAppId[]; -extern const char kDiagnosticsAppId[]; -extern const char kFirmwareUpdateAppId[]; -extern const char kGmailAppId[]; -extern const char kGoogleCalendarAppId[]; -extern const char kGoogleChatAppId[]; -extern const char kGoogleDocsAppId[]; -extern const char kGoogleDriveAppId[]; -extern const char kGoogleKeepAppId[]; -extern const char kGoogleMapsAppId[]; -extern const char kGoogleMeetAppId[]; -extern const char kGoogleMoviesAppId[]; -extern const char kGoogleNewsAppId[]; -extern const char kGoogleSheetsAppId[]; -extern const char kGoogleSlidesAppId[]; -extern const char kHelpAppId[]; -extern const char kMediaAppId[]; -extern const char kMessagesAppId[]; -extern const char kMessagesDogfoodDeprecatedAppId[]; -extern const char kMicrosoftOfficeAppId[]; -extern const char kMockSystemAppId[]; -extern const char kOsFeedbackAppId[]; -extern const char kOsSettingsAppId[]; -extern const char kPersonalizationAppId[]; -extern const char kPlayBooksAppId[]; -extern const char kPrintManagementAppId[]; -extern const char kScanningAppId[]; -extern const char kSettingsAppId[]; -extern const char kShortcutCustomizationAppId[]; -extern const char kShimlessRMAAppId[]; -extern const char kShowtimeAppId[]; -extern const char kStadiaAppId[]; -extern const char kYoutubeAppId[]; -extern const char kYoutubeMusicAppId[]; -extern const char kYoutubeTVAppId[]; +// The URLs used to generate the app IDs MUST match the start_url field of the +// manifest served by the PWA. +// Please maintain the alphabetical order when adding new app IDs. + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://calculator.apps.chrome/")) +inline constexpr char kCalculatorAppId[] = "oabkinaljpjeilageghcdlnekhphhphl"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome://camera-app/views/main.html")) +inline constexpr char kCameraAppId[] = "njfbnohfdkmbmnjapinfcopialeghnmh"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://canvas.apps.chrome/")) +inline constexpr char kCanvasAppId[] = "ieailfmhaghpphfffooibmlghaeopach"; + +// TODO(crbug.com/1334053) +inline constexpr char kCloudGamingPartnerPlatform[] = + "egmafekfmcnknbdlbfbhafbllplmjlhn"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome-untrusted://crosh/")) +inline constexpr char kCroshAppId[] = "cgfnfgkafmcdkdgilmojlnaadileaach"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://cursive.apps.chrome/")) +inline constexpr char kCursiveAppId[] = "apignacaigpffemhdbhmnajajaccbckh"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, +// GURL("chrome://diagnostics/")) +inline constexpr char kDiagnosticsAppId[] = "keejpcfcpecjhmepmpcfgjemkmlicpam"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, +// GURL("chrome://accessory-update/")) +inline constexpr char kFirmwareUpdateAppId[] = + "nedcdcceagjbkiaecmdbpafcmlhkiifa"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://mail.google.com/mail/?usp=installed_webapp")) +inline constexpr char kGmailAppId[] = "fmgjjmmmlfnkbppncabfkddbjimcfncm"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://calendar.google.com/calendar/r")) +inline constexpr char kGoogleCalendarAppId[] = + "kjbdgfilnfhdoflbpgamdcdgpehopbep"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://mail.google.com/chat/")) +inline constexpr char kGoogleChatAppId[] = "mdpkiolbdkhdjpekfbkbmhigcaggjagi"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://docs.google.com/document/?usp=installed_webapp")) +inline constexpr char kGoogleDocsAppId[] = "mpnpojknpmmopombnjdcgaaiekajbnjb"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://drive.google.com/?lfhs=2")) +inline constexpr char kGoogleDriveAppId[] = "aghbiahbpaijignceidepookljebhfak"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://keep.google.com/?usp=installed_webapp")) +inline constexpr char kGoogleKeepAppId[] = "eilembjdkfgodjkcjnpgpaenohkicgjd"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://www.google.com/maps?force=tt&source=ttpwa")) +inline constexpr char kGoogleMapsAppId[] = "mnhkaebcjjhencmpkapnbdaogjamfbcj"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://meet.google.com/landing?lfhs=2")) +inline constexpr char kGoogleMeetAppId[] = "kjgfgldnnfoeklkmfkjfagphfepbbdan"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://play.google.com/store/movies?usp=installed_webapp")) +inline constexpr char kGoogleMoviesAppId[] = "aiihaadhfoadjgjcegeomiajkajbjlcn"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://news.google.com/?lfhs=2")) +inline constexpr char kGoogleNewsAppId[] = "kfgapjallbhpciobgmlhlhokknljkgho"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://docs.google.com/spreadsheets/?usp=installed_webapp")) +inline constexpr char kGoogleSheetsAppId[] = "fhihpiojkbmbpdjeoajapmgkhlnakfjf"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://docs.google.com/presentation/?usp=installed_webapp")) +inline constexpr char kGoogleSlidesAppId[] = "kefjledonklijopmnomlcbpllchaibag"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome://help-app/")) +inline constexpr char kHelpAppId[] = "nbljnnecbjbmifnoehiemkgefbnpoeak"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome://media-app/")) +inline constexpr char kMediaAppId[] = "jhdjimmaggjajfjphpljagpgkidjilnj"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://messages.google.com/web/")) +inline constexpr char kMessagesAppId[] = "hpfldicfbfomlpcikngkocigghgafkph"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://messages-web.sandbox.google.com/web/")) +inline constexpr char kMessagesDogfoodDeprecatedAppId[] = + "gkgiochgbaoelfjibmnaomdepldjceib"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://www.office.com/?from=Homescreen")) +inline constexpr char kMicrosoftOfficeAppId[] = + "ocdlmjhbenodhlknglojajgokahchlkk"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome://test-system-app/pwa.html")) +inline constexpr char kMockSystemAppId[] = "maphiehpiinjgiaepbljmopkodkadcbh"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome://os-feedback/")) +inline constexpr char kOsFeedbackAppId[] = "iffgohomcomlpmkfikfffagkkoojjffm"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome://os-settings/")) +inline constexpr char kOsSettingsAppId[] = "odknhmnlageboeamepcngndbggdpaobj"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome://personalization/")) +inline constexpr char kPersonalizationAppId[] = + "glenkcidjgckcomnliblmkokolehpckn"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://books.google.com/ebooks/app")) +inline constexpr char kPlayBooksAppId[] = "jglfhlbohpgcbefmhdmpancnijacbbji"; + +// Generated as:web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome://print-management/")) +inline constexpr char kPrintManagementAppId[] = + "fglkccnmnaankjodgccmiodmlkpaiodc"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, +// GURL("chrome://scanning/")) +inline constexpr char kScanningAppId[] = "cdkahakpgkdaoffdmfgnhgomkelkocfo"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome://settings/")) +inline constexpr char kSettingsAppId[] = "inogagmajamaleonmanpkpkkigmklfad"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome://shortcut-customization")) +inline constexpr char kShortcutCustomizationAppId[] = + "ihgeegogifolehadhdgelgcnbnmemikp"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome://shimless-rma/")) +inline constexpr char kShimlessRMAAppId[] = "ijolhdommgkkhpenofmpkkhlepahelcm"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://www.showtime.com/")) +inline constexpr char kShowtimeAppId[] = "eoccpgmpiempcflglfokeengliildkag"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://stadia.google.com/?lfhs=2")) +inline constexpr char kStadiaAppId[] = "pnkcfpnngfokcnnijgkllghjlhkailce"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://www.youtube.com/?feature=ytca")) +inline constexpr char kYoutubeAppId[] = "agimnkijcaahngcdmfeangaknmldooml"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://music.youtube.com/?source=pwa")) +inline constexpr char kYoutubeMusicAppId[] = "cinhimbnkkaeohfgghhklpknlkffjgod"; + +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "https://tv.youtube.com/")) +inline constexpr char kYoutubeTVAppId[] = "kiemjbkkegajmpbobdfngbmjccjhnofh"; #if !defined(OFFICIAL_BUILD) -extern const char kSampleSystemWebAppId[]; +// Generated as: web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, GURL( +// "chrome://sample-system-web-app")) +inline constexpr char kSampleSystemWebAppId[] = + "jalmdcokfklmaoadompgacjlcomfckcf"; #endif // !defined(OFFICIAL_BUILD) -bool IsSystemAppIdWithFileHandlers(base::StringPiece id); - } // namespace web_app #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_ID_CONSTANTS_H_
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 4ddd3d1..75112de 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1667239187-a0eef9d5877783faed7eb8b9c6494cec8ebfe739.profdata +chrome-linux-main-1667260787-84c8454b7f21b80f8276ba18330e01caf83130e5.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index af314c9b..856e3ab 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1667239187-a19c4512ef9b11c7cd5c006189435ab5b0aefe2a.profdata +chrome-mac-arm-main-1667260787-a4e5f0688c470ece658db631f7eb70d3e5df56e8.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index cad3b859..fd1ff42 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1667239187-fa5e279556aac6d4fe6628facb97ef62b683aad5.profdata +chrome-mac-main-1667260787-a26fdde16255bffa06429320fd6aa208d9236ef9.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 2ccc246..5aae118 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1667239187-8dcfa35bb17bf5aed0c83cfbbc78773bf7931b45.profdata +chrome-win32-main-1667260787-0932ad0da1849cf840a3ccc61331e60516690c58.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 47f4918..b23ed5c 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1667239187-124fbfc4acf6e6a5e59de47366cf650d7484834e.profdata +chrome-win64-main-1667260787-3509323e8ece14e94cd8ff93f36594ec0c528149.profdata
diff --git a/chrome/renderer/cart/commerce_hint_agent.cc b/chrome/renderer/cart/commerce_hint_agent.cc index 73d2726..99dbee91 100644 --- a/chrome/renderer/cart/commerce_hint_agent.cc +++ b/chrome/renderer/cart/commerce_hint_agent.cc
@@ -744,6 +744,30 @@ return button_texts; } +bool CommerceHintAgent::IsAddToCartButton(blink::WebElement& element) { + // Find the first non-null, non-empty element and terminates anytime an + // element with wrong size is found. + std::string button_text; + while (!element.IsNull()) { + gfx::Size client_size = element.GetClientSize(); + if (!commerce_heuristics::IsAddToCartButtonSpec(client_size.height(), + client_size.width())) { + return false; + } + base::TrimWhitespaceASCII(element.TextContent().Ascii(), base::TRIM_ALL, + &button_text); + if (!button_text.empty()) + break; + element = element.ParentNode().To<blink::WebElement>(); + } + if (element.IsNull() || + !commerce_heuristics::IsAddToCartButtonTag(element.TagName().Ascii()) || + !commerce_heuristics::IsAddToCartButtonText(button_text)) { + return false; + } + return true; +} + void CommerceHintAgent::MaybeExtractProducts() { // TODO(crbug/1241582): Add a test for rate control based on whether the // histogram is recorded. @@ -911,6 +935,15 @@ DVLOG(2) << "is_extraction_running_ = " << is_extraction_running_; } +bool CommerceHintAgent::ShouldUseDOMBasedHeuristics() { + if (!should_use_dom_heuristics_.has_value()) { + const GURL& url(render_frame()->GetWebFrame()->GetDocument().Url()); + should_use_dom_heuristics_ = + commerce_heuristics::ShouldUseDOMBasedHeuristics(url); + } + return should_use_dom_heuristics_.value(); +} + void CommerceHintAgent::OnDestruct() { delete this; } @@ -938,9 +971,15 @@ // DidStartNavigation(). Some sites use GET requests though, so special-case // them here. GURL request_url = request.Url(); - if (request.HttpMethod().Equals("POST") || - request_url.DomainIs(kEbayDomain) || - url.DomainIs(kElectronicExpressDomain)) { + bool add_to_cart_active = true; + if (ShouldUseDOMBasedHeuristics()) { + add_to_cart_active = base::Time::Now() - add_to_cart_focus_time_ < + commerce::kAddToCartButtonActiveTime.Get(); + } + if ((request.HttpMethod().Equals("POST") || + request_url.DomainIs(kEbayDomain) || + url.DomainIs(kElectronicExpressDomain)) && + add_to_cart_active) { bool is_add_to_cart = DetectAddToCart(render_frame(), request); OnWillSendRequest(render_frame(), is_add_to_cart); } @@ -964,6 +1003,7 @@ absl::optional<blink::WebNavigationType> navigation_type) { if (!url.SchemeIsHTTPOrHTTPS()) return; + should_use_dom_heuristics_.reset(); has_finished_loading_ = false; starting_url_ = url; mojo::Remote<mojom::CommerceHintObserver> observer = @@ -1006,6 +1046,7 @@ if (!starting_url_.is_valid()) return; DCHECK(starting_url_.SchemeIsHTTPOrHTTPS()); + should_use_dom_heuristics_.reset(); mojo::Remote<mojom::CommerceHintObserver> observer = GetObserver(render_frame()); if (!commerce::kOptimizeRendererSignal.Get()) { @@ -1061,6 +1102,7 @@ // Don't do anything for subframes. if (frame->Parent()) return; + should_use_dom_heuristics_.reset(); const GURL& url(frame->GetDocument().Url()); if (!url.SchemeIs(url::kHttpsScheme)) return; @@ -1167,6 +1209,23 @@ ExtractCartFromCurrentFrame(); } +void CommerceHintAgent::FocusedElementChanged( + const blink::WebElement& focused_element) { + if (!should_skip_.has_value() || should_skip_.value()) { + return; + } + if (!ShouldUseDOMBasedHeuristics()) { + return; + } + base::Time before_check = base::Time::Now(); + blink::WebElement element = focused_element; + if (IsAddToCartButton(element)) { + add_to_cart_focus_time_ = base::Time::Now(); + } + base::UmaHistogramMicrosecondsTimes("Commerce.Carts.AddToCartButtonDetection", + base::Time::Now() - before_check); +} + bool CommerceHintAgent::ShouldSkipAddToCartRequest(const GURL& navigation_url, const GURL& request_url) { const std::string& navigation_domain = eTLDPlusOne(navigation_url);
diff --git a/chrome/renderer/cart/commerce_hint_agent.h b/chrome/renderer/cart/commerce_hint_agent.h index c66eab7..cacecc02 100644 --- a/chrome/renderer/cart/commerce_hint_agent.h +++ b/chrome/renderer/cart/commerce_hint_agent.h
@@ -57,6 +57,8 @@ const GURL& request_url); static const std::vector<std::string> ExtractButtonTexts( const blink::WebFormElement& form); + // Whether the |element| is (or is within) an AddToCart button. + static bool IsAddToCartButton(blink::WebElement& element); private: void MaybeExtractProducts(); @@ -68,15 +70,18 @@ const std::string& cart_extraction_script); void OnProductsExtracted(absl::optional<base::Value> results, base::TimeTicks start_time); + bool ShouldUseDOMBasedHeuristics(); GURL starting_url_; bool has_finished_loading_{false}; int extraction_count_{0}; bool is_extraction_pending_{false}; bool is_extraction_running_{false}; - absl::optional<bool> should_skip_; bool extraction_script_initialized_{false}; + absl::optional<bool> should_skip_; + absl::optional<bool> should_use_dom_heuristics_; std::unique_ptr<ukm::MojoUkmRecorder> ukm_recorder_; + base::Time add_to_cart_focus_time_; base::WeakPtrFactory<CommerceHintAgent> weak_factory_{this}; // content::RenderFrameObserver overrides @@ -90,6 +95,7 @@ void WillSubmitForm(const blink::WebFormElement& form) override; void DidObserveLayoutShift(double score, bool after_input_or_scroll) override; void OnMainFrameIntersectionChanged(const gfx::Rect& intersect_rect) override; + void FocusedElementChanged(const blink::WebElement& focused_element) override; // Callbacks with business logics for handling navigation-related observer // calls. These callbacks are triggered when navigation-related signals are
diff --git a/chrome/renderer/cart/commerce_hint_agent_browsertest.cc b/chrome/renderer/cart/commerce_hint_agent_browsertest.cc index b08ec0c6..29d58cc2 100644 --- a/chrome/renderer/cart/commerce_hint_agent_browsertest.cc +++ b/chrome/renderer/cart/commerce_hint_agent_browsertest.cc
@@ -166,6 +166,8 @@ return nullptr; if (request.relative_url == "/cart-in-portal.html") return nullptr; + if (request.relative_url == "/product-page.html") + return nullptr; auto response = std::make_unique<net::test_server::BasicHttpResponse>(); response->set_content("dummy"); @@ -1696,4 +1698,161 @@ } #endif +class CommerceHintDOMBasedHeuristicsTest : public CommerceHintAgentTest { + public: + void SetUpInProcessBrowserTestFixture() override { + scoped_feature_list_.InitWithFeaturesAndParameters( + {{ +#if !BUILDFLAG(IS_ANDROID) + ntp_features::kNtpChromeCartModule, +#else + commerce::kCommerceHintAndroid, +#endif + {}}, + {commerce::kChromeCartDomBasedHeuristics, + {{"add-to-cart-button-active-time", "2s"}}}}, + {optimization_guide::features::kOptimizationHints}); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(CommerceHintDOMBasedHeuristicsTest, + DetectionRequiresAddToCartActive) { + NavigateToURL("https://www.guitarcenter.com/product-page.html"); + // AddToCart requests without active AddToCart button focus. + SendXHR("/wp-admin/admin-ajax.php", "action: woocommerce_add_to_cart"); + +#if !BUILDFLAG(IS_ANDROID) + WaitForCartCount(kEmptyExpected); +#endif + WaitForUmaCount("Commerce.Carts.AddToCartByPOST", 0); + + // Focus on an AddToCart button and then send AddToCart requests. + EXPECT_EQ(nullptr, + content::EvalJs(web_contents(), "focusElement(\"buttonOne\")")); + SendXHR("/wp-admin/admin-ajax.php", "action: woocommerce_add_to_cart"); + +#if !BUILDFLAG(IS_ANDROID) + WaitForCartCount(kExpectedExampleFallbackCart); +#endif + WaitForUmaCount("Commerce.Carts.AddToCartByPOST", 1); + WaitForUmaCount("Commerce.Carts.AddToCartButtonDetection", 1); +} + +IN_PROC_BROWSER_TEST_F(CommerceHintDOMBasedHeuristicsTest, + DetectionInactiveForWrongButton) { + NavigateToURL("https://www.guitarcenter.com/product-page.html"); + + // Focus on a non-AddToCart button and then send AddToCart requests. + EXPECT_EQ(nullptr, + content::EvalJs(web_contents(), "focusElement(\"buttonTwo\")")); + SendXHR("/wp-admin/admin-ajax.php", "action: woocommerce_add_to_cart"); + +#if !BUILDFLAG(IS_ANDROID) + WaitForCartCount(kEmptyExpected); +#endif + WaitForUmaCount("Commerce.Carts.AddToCartByPOST", 0); + WaitForUmaCount("Commerce.Carts.AddToCartButtonDetection", 1); + + // Focus on an AddToCart button and then send AddToCart requests. + EXPECT_EQ(nullptr, + content::EvalJs(web_contents(), "focusElement(\"buttonOne\")")); + SendXHR("/wp-admin/admin-ajax.php", "action: woocommerce_add_to_cart"); + +#if !BUILDFLAG(IS_ANDROID) + WaitForCartCount(kExpectedExampleFallbackCart); +#endif + WaitForUmaCount("Commerce.Carts.AddToCartByPOST", 1); + WaitForUmaCount("Commerce.Carts.AddToCartButtonDetection", 2); +} + +IN_PROC_BROWSER_TEST_F(CommerceHintDOMBasedHeuristicsTest, + AddToCartActiveExpires) { + NavigateToURL("https://www.guitarcenter.com/product-page.html"); + + // Focus on an AddToCart button, but wait until it's no longer active and then + // send AddToCart requests. + EXPECT_EQ(nullptr, + content::EvalJs(web_contents(), "focusElement(\"buttonOne\")")); + base::PlatformThread::Sleep(base::Seconds(2)); + SendXHR("/wp-admin/admin-ajax.php", "action: woocommerce_add_to_cart"); + +#if !BUILDFLAG(IS_ANDROID) + WaitForCartCount(kEmptyExpected); +#endif + WaitForUmaCount("Commerce.Carts.AddToCartByPOST", 0); + + // Focus on an AddToCart button and then send AddToCart requests. + EXPECT_EQ(nullptr, + content::EvalJs(web_contents(), "focusElement(\"buttonTwo\")")); + EXPECT_EQ(nullptr, + content::EvalJs(web_contents(), "focusElement(\"buttonOne\")")); + SendXHR("/wp-admin/admin-ajax.php", "action: woocommerce_add_to_cart"); + +#if !BUILDFLAG(IS_ANDROID) + WaitForCartCount(kExpectedExampleFallbackCart); +#endif + WaitForUmaCount("Commerce.Carts.AddToCartByPOST", 1); + WaitForUmaCount("Commerce.Carts.AddToCartButtonDetection", 3); +} + +class CommerceHintDOMBasedHeuristicsSkipTest : public CommerceHintAgentTest { + public: + void SetUpInProcessBrowserTestFixture() override { + scoped_feature_list_.InitWithFeaturesAndParameters( + {{ +#if !BUILDFLAG(IS_ANDROID) + ntp_features::kNtpChromeCartModule, +#else + commerce::kCommerceHintAndroid, +#endif + {}}, + {commerce::kChromeCartDomBasedHeuristics, + {{"skip-heuristics-domain-pattern", "guitarcenter"}, + {"add-to-cart-button-active-time", "0s"}}}}, + {optimization_guide::features::kOptimizationHints}); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(CommerceHintDOMBasedHeuristicsSkipTest, + SkipDOMBasedHeuristics) { + // Send AddToCart requests on a skipped domain without active AddToCart + // button. + NavigateToURL("https://www.guitarcenter.com/product-page.html"); + SendXHR("/wp-admin/admin-ajax.php", "action: woocommerce_add_to_cart"); + +#if !BUILDFLAG(IS_ANDROID) + WaitForCartCount(kExpectedExampleFallbackCart); +#endif + WaitForUmaCount("Commerce.Carts.AddToCartByPOST", 1); + + // Send AddToCart requests on a skipped domain after focusing on a invalid + // AddToCart button. + EXPECT_EQ(nullptr, + content::EvalJs(web_contents(), "focusElement(\"buttonTwo\")")); + SendXHR("/wp-admin/admin-ajax.php", "action: woocommerce_add_to_cart"); + +#if !BUILDFLAG(IS_ANDROID) + WaitForCartCount(kExpectedExampleFallbackCart); +#endif + WaitForUmaCount("Commerce.Carts.AddToCartByPOST", 2); + WaitForUmaCount("Commerce.Carts.AddToCartButtonDetection", 0); + + // Send AddToCart requests on a non-skipped domain without active AddToCart + // button. + NavigateToURL("https://www.example.com/product-page.html"); + SendXHR("/wp-admin/admin-ajax.php", "action: woocommerce_add_to_cart"); + +#if !BUILDFLAG(IS_ANDROID) + WaitForCartCount(kExpectedExampleFallbackCart); +#endif + WaitForUmaCount("Commerce.Carts.AddToCartByPOST", 2); + WaitForUmaCount("Commerce.Carts.AddToCartButtonDetection", 0); +} + } // namespace
diff --git a/chrome/renderer/cart/commerce_hint_agent_renderer_browsertest.cc b/chrome/renderer/cart/commerce_hint_agent_renderer_browsertest.cc index 2b248f1..c47519c 100644 --- a/chrome/renderer/cart/commerce_hint_agent_renderer_browsertest.cc +++ b/chrome/renderer/cart/commerce_hint_agent_renderer_browsertest.cc
@@ -61,4 +61,65 @@ } } +TEST_F(CommerceHintAgentRendererTest, IsAddToCartButton) { + const char* html = R"HTML( + <style> + .add-to-cart-button { + height: 50px; + width: 500px; + } + </style> + <body> + <!-- Correct Buttons --> + <button class="add-to-cart-button correct-button"> Add to cart </button> + + <button class="add-to-cart-button"> + <div class="correct-button"> </div> + Add to cart + </button> + + <!-- Wrong Buttons --> + <button class="add-to-cart-button wrong-button"> Add to cat </button> + + <button class="add-to-cart-button wrong-button"> Add to cart </button> + + <button style="height: 50px; width: 1000px" class="wrong-button"> + Add to cart + </button> + + <div class="add-to-cart-button wrong-button"> Add to cart </div> + + <button class="add-to-cart-button"> + <button class="wrong-button"> Test </button> + Add to cart + </button> + + <button style="height: 200px; width: 500px"> + <button class="wrong-button"> </button> + Add to cart + </button> + </body> + )HTML"; + + LoadHTML(html); + + auto correct_buttons = GetMainFrame()->GetDocument().QuerySelectorAll( + blink::WebString("*[class='correct-button']")); + EXPECT_GT(correct_buttons.size(), 0u); + for (auto& element : correct_buttons) { + EXPECT_TRUE(cart::CommerceHintAgent::IsAddToCartButton(element)); + } + + auto wrong_buttons = GetMainFrame()->GetDocument().QuerySelectorAll( + blink::WebString("*[class='wrong-button']")); + EXPECT_GT(wrong_buttons.size(), 0u); + for (auto& element : wrong_buttons) { + EXPECT_FALSE(cart::CommerceHintAgent::IsAddToCartButton(element)); + } + + blink::WebElement empty_element = blink::WebElement(); + EXPECT_TRUE(empty_element.IsNull()); + EXPECT_FALSE(cart::CommerceHintAgent::IsAddToCartButton(empty_element)); +} + } // namespace
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 2e44114..66208d75 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -1845,7 +1845,6 @@ "../browser/media/media_browsertest.h", "../browser/media/media_engagement_autoplay_browsertest.cc", "../browser/media/media_engagement_browsertest.cc", - "../browser/media/router/discovery/access_code/access_code_cast_sink_service_browsertest.cc", "../browser/media/test_license_server.cc", "../browser/media/test_license_server.h", "../browser/media/test_license_server_config.h", @@ -6488,6 +6487,7 @@ "../browser/translate/android/translate_bridge_unittest.cc", "../browser/translate/translate_manager_render_view_host_android_unittest.cc", "../browser/ui/android/autofill/save_card_message_controller_android_unittest.cc", + "../browser/ui/android/device_dialog/usb_chooser_dialog_android_unittest.cc", "../browser/ui/android/fast_checkout/ui_view_android_utils_unittest.cc", "../browser/ui/android/tab_model/tab_model_list_unittest.cc", "../browser/ui/android/toolbar/location_bar_model_android_unittest.cc", @@ -6554,6 +6554,7 @@ "//components/webapk:proto", "//components/webapps/browser", "//content/public/android:content_java", + "//ui/android", "//ui/events/devices:test_support", ] if (use_v8_context_snapshot) { @@ -7515,7 +7516,6 @@ "//ash/public/cpp/assistant/test_support", "//ash/public/cpp/resources:ash_public_unscaled_resources", "//ash/resources/vector_icons", - "//ash/services/device_sync/public/cpp:test_support", "//ash/shortcut_viewer", "//ash/shortcut_viewer/strings:strings_grit", "//ash/strings", @@ -7598,6 +7598,7 @@ "//chromeos/ash/components/string_matching", "//chromeos/ash/components/sync_wifi", "//chromeos/ash/services/assistant/public/cpp", + "//chromeos/ash/services/device_sync/public/cpp:test_support", "//chromeos/ash/services/multidevice_setup/public/cpp:test_support", "//chromeos/ash/services/nearby/public/cpp:tcp_server_socket_port", "//chromeos/ash/services/nearby/public/cpp:test_support", @@ -9446,6 +9447,7 @@ "../browser/extensions/extension_keybinding_apitest.cc", "../browser/extensions/omnibox_focus_interactive_test.cc", "../browser/focus_ring_browsertest.cc", + "../browser/media/router/discovery/access_code/access_code_cast_sink_service_browsertest.cc", "../browser/media/webrtc/media_stream_permission_interactive_uitest.cc", "../browser/media/webrtc/webrtc_interactive_uitest.cc", "../browser/media/webrtc/webrtc_mediadevices_interactive_uitest.cc", @@ -9559,6 +9561,7 @@ "//chrome:strings", "//chrome/app:command_ids", "//chrome/browser", + "//chrome/browser:buildflags", "//chrome/browser:unexpire_flags", "//chrome/browser/devtools", "//chrome/browser/devtools:test_support",
diff --git a/chrome/test/data/cart/product-page.html b/chrome/test/data/cart/product-page.html new file mode 100644 index 0000000..1fdff295 --- /dev/null +++ b/chrome/test/data/cart/product-page.html
@@ -0,0 +1,20 @@ +<!DOCTYPE html> +<title>product-page.html</title> +<style> + .add-to-cart-button { + height: 50px; + width: 500px; + } +</style> +<body> + <script> + function focusElement(id) { + const element = document.getElementById(id); + if (element !== null) { + element.focus(); + } + } + </script> + <button id="buttonOne" class="add-to-cart-button"> Add to cart </button> + <button id="buttonTwo" class="button"> Checkout </button> +</body> \ No newline at end of file
diff --git a/chrome/test/data/extensions/api_test/tts_engine/lacros_tts_support/register_ash_engine/test.js b/chrome/test/data/extensions/api_test/tts_engine/lacros_tts_support/register_ash_engine/test.js index 333db28e..59991d80 100644 --- a/chrome/test/data/extensions/api_test/tts_engine/lacros_tts_support/register_ash_engine/test.js +++ b/chrome/test/data/extensions/api_test/tts_engine/lacros_tts_support/register_ash_engine/test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TTS api test running from ash with lacros.. +// TTS api test running from ash with lacros(lacros_tts_support enabled). // browser_tests --lacros-chrome-path={your_build_path}/lacros_clang_x64 // --gtest_filter="AshTtsApiTest.*" @@ -15,5 +15,42 @@ chrome.ttsEngine.onSpeak.addListener(speakListener); chrome.ttsEngine.onStop.addListener(stopListener); chrome.test.succeed(); + }, + // Test speaking an utterance issued from an ash extension with a voice + // provided by a speech engine registered in ash. + function testSpeakAshUtteranceWithAshTtsEngine() { + var calledOurEngine = false; + + // Register listeners for speech functions, enabling this extension + // to be a TTS engine. + var speakListener = function (utterance, options, sendTtsEvent) { + chrome.test.assertNoLastError(); + chrome.test.assertEq('ash extension speech', utterance); + calledOurEngine = true; + sendTtsEvent({ + 'type': 'end', + 'charIndex': utterance.length + }); + }; + var stopListener = function () {}; + chrome.ttsEngine.onSpeak.addListener(speakListener); + chrome.ttsEngine.onStop.addListener(stopListener); + + // This call should go to our own speech engine loaded in ash. + chrome.tts.speak( + 'ash extension speech', { + 'voiceName': 'Amy', + 'onEvent': function (event) { + if (event.type == 'end') { + chrome.test.assertEq(true, calledOurEngine); + chrome.ttsEngine.onSpeak.removeListener(speakListener); + chrome.ttsEngine.onStop.removeListener(stopListener); + chrome.test.succeed(); + } + } + }, + function () { + chrome.test.assertNoLastError(); + }); } ]);
diff --git a/chrome/test/data/webui/chromeos/diagnostics/keyboard_tester_test.js b/chrome/test/data/webui/chromeos/diagnostics/keyboard_tester_test.js index 90330d0a..d84ab574 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/keyboard_tester_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/keyboard_tester_test.js
@@ -6,6 +6,7 @@ import {TopRightKey as DiagramTopRightKey} from 'chrome://resources/ash/common/keyboard_diagram.js'; import {KeyboardKeyState} from 'chrome://resources/ash/common/keyboard_key.js'; import {flushTasks} from 'chrome://webui-test/polymer_test_util.js'; +import {eventToPromise} from 'chrome://webui-test/test_util.js'; import {assertEquals, assertFalse, assertTrue} from '../../chai_assert.js'; import {MockController} from '../../mock_controller.js'; @@ -193,8 +194,11 @@ 'Press Alt + Esc to close the dialog.'); // Alt + Escape should close the tester - keyboardTesterElement.dispatchEvent( - new KeyboardEvent('keydown', {key: 'Escape', altKey: true})); + const keyDownEvent = eventToPromise('keydown', keyboardTesterElement); + + keyboardTesterElement.dispatchEvent(new KeyboardEvent( + 'keydown', {bubbles: true, key: 'Escape', altKey: true})); + await keyDownEvent; assertFalse(keyboardTesterElement.isOpen()); }); }
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_lookup_manager_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_lookup_manager_test.ts index 8716a34..9404b95c 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_lookup_manager_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_lookup_manager_test.ts
@@ -8,6 +8,7 @@ import {fakeAcceleratorConfig, fakeLayoutInfo} from 'chrome://shortcut-customization/js/fake_data.js'; import {FakeShortcutProvider} from 'chrome://shortcut-customization/js/fake_shortcut_provider.js'; import {Accelerator, AcceleratorInfo, AcceleratorSource, AcceleratorState, Modifier} from 'chrome://shortcut-customization/js/shortcut_types.js'; +import {createEmptyAccelInfoFromAccel} from 'chrome://shortcut-customization/js/shortcut_utils.js'; import {assertDeepEquals, assertEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; suite('acceleratorLookupManagerTest', function() { @@ -39,9 +40,9 @@ function replaceAndVerify( source: AcceleratorSource, action: number, oldAccel: Accelerator, - newAccel: Accelerator) { + newAccelInfo: AcceleratorInfo) { const uuid = getManager().getAcceleratorIdFromReverseLookup(oldAccel); - getManager().replaceAccelerator(source, action, oldAccel, newAccel); + getManager().replaceAccelerator(source, action, oldAccel, newAccelInfo); // Verify that the old accelerator is no longer part of the reverse // lookup. @@ -49,17 +50,21 @@ undefined, getManager().getAcceleratorIdFromReverseLookup(oldAccel)); // Verify the replacement accelerator is in the reverse lookup. assertEquals( - uuid, getManager().getAcceleratorIdFromReverseLookup(newAccel)); + uuid, + getManager().getAcceleratorIdFromReverseLookup( + newAccelInfo.accelerator)); } function addAndVerify( - source: AcceleratorSource, action: number, newAccel: Accelerator) { - getManager().addAccelerator(source, action, newAccel); + source: AcceleratorSource, action: number, + newAccelInfo: AcceleratorInfo) { + getManager().addAccelerator(source, action, newAccelInfo); // Verify that the new accelerator is in the reverse lookup. assertEquals( `${source}-${action}`, - getManager().getAcceleratorIdFromReverseLookup(newAccel)); + getManager().getAcceleratorIdFromReverseLookup( + newAccelInfo.accelerator)); } test('AcceleratorLookupDefaultFake', () => { @@ -78,7 +83,7 @@ continue; } for (const [action, accelInfos] of Object.entries(accelMap)) { - const actualAccels = getManager().getAccelerators(source, action); + const actualAccels = getManager().getAcceleratorInfos(source, action); assertDeepEquals(accelInfos, actualAccels); } } @@ -127,11 +132,12 @@ getManager().getAcceleratorIdFromReverseLookup(expectedNewAccel)); replaceAndVerify( - AcceleratorSource.kAsh, expectedAction, oldAccel, expectedNewAccel); + AcceleratorSource.kAsh, expectedAction, oldAccel, + createEmptyAccelInfoFromAccel(expectedNewAccel)); // Check that the accelerator got updated in the lookup. - let lookup = - getManager().getAccelerators(AcceleratorSource.kAsh, expectedAction); + let lookup = getManager().getAcceleratorInfos( + AcceleratorSource.kAsh, expectedAction); // Replacing a default shortcut should not remove the default. Expect // a new accelerator to be added instead. assertEquals(2, lookup.length); @@ -153,11 +159,11 @@ expectedNewDefaultAccel)); replaceAndVerify( AcceleratorSource.kAsh, expectedAction, expectedNewAccel, - expectedNewDefaultAccel); + createEmptyAccelInfoFromAccel(expectedNewDefaultAccel)); // Check that the accelerator got updated in the lookup. - lookup = - getManager().getAccelerators(AcceleratorSource.kAsh, expectedAction); + lookup = getManager().getAcceleratorInfos( + AcceleratorSource.kAsh, expectedAction); // Expect only one accelerator since the previous accelerator has been // removed but the default accelerator has been re-enabled. assertEquals(1, lookup.length); @@ -188,11 +194,11 @@ replaceAndVerify( AcceleratorSource.kAsh, newDeskAction, oldNewDeskAccel, - overridenAccel); + createEmptyAccelInfoFromAccel(overridenAccel)); // Verify that the New Desk shortcut now has the ALT + ']' accelerator. - const newDeskLookup = - getManager().getAccelerators(AcceleratorSource.kAsh, newDeskAction); + const newDeskLookup = getManager().getAcceleratorInfos( + AcceleratorSource.kAsh, newDeskAction); assertEquals(2, newDeskLookup.length); assertEquals( JSON.stringify(overridenAccel), @@ -200,7 +206,7 @@ // There should still be 1 accelerator for snapWindowRight, but the // default should be disabled. - const snapWindowRightLookup = getManager().getAccelerators( + const snapWindowRightLookup = getManager().getAcceleratorInfos( AcceleratorSource.kAsh, snapWindowRightAction); assertEquals(1, snapWindowRightLookup.length); assertEquals( @@ -229,11 +235,13 @@ undefined, getManager().getAcceleratorIdFromReverseLookup(expectedNewAccel)); - addAndVerify(AcceleratorSource.kAsh, expectedAction, expectedNewAccel); + addAndVerify( + AcceleratorSource.kAsh, expectedAction, + createEmptyAccelInfoFromAccel(expectedNewAccel)); // Check that the accelerator got updated in the lookup. - const lookup = - getManager().getAccelerators(AcceleratorSource.kAsh, expectedAction); + const lookup = getManager().getAcceleratorInfos( + AcceleratorSource.kAsh, expectedAction); assertEquals(2, lookup.length); assertEquals( JSON.stringify(expectedNewAccel), @@ -259,11 +267,13 @@ // Replace New Desk shortcut with Alt+']'. const newDeskAction = 2; - addAndVerify(AcceleratorSource.kAsh, newDeskAction, overridenAccel); + addAndVerify( + AcceleratorSource.kAsh, newDeskAction, + createEmptyAccelInfoFromAccel(overridenAccel)); // Verify that the New Desk shortcut now has the ALT + ']' accelerator. - const newDeskLookup = - getManager().getAccelerators(AcceleratorSource.kAsh, newDeskAction); + const newDeskLookup = getManager().getAcceleratorInfos( + AcceleratorSource.kAsh, newDeskAction); assertEquals(2, newDeskLookup.length); assertEquals( JSON.stringify(overridenAccel), @@ -271,7 +281,7 @@ // Replacing a default accelerator should not remove it but rather disable // it. - const snapWindowRightLookup = getManager().getAccelerators( + const snapWindowRightLookup = getManager().getAcceleratorInfos( AcceleratorSource.kAsh, snapWindowRightAction); assertEquals(1, snapWindowRightLookup.length); assertEquals( @@ -290,8 +300,8 @@ const expectedAction = 1; // Initially there is only one accelerator for Snap Window Right. - const lookup = - getManager().getAccelerators(AcceleratorSource.kAsh, expectedAction); + const lookup = getManager().getAcceleratorInfos( + AcceleratorSource.kAsh, expectedAction); assertEquals(1, lookup.length); // Remove the accelerator. @@ -321,8 +331,8 @@ const expectedAction = 1; // Initially there is only one accelerator for Snap Window Right. - const lookup = - getManager().getAccelerators(AcceleratorSource.kAsh, expectedAction); + const lookup = getManager().getAcceleratorInfos( + AcceleratorSource.kAsh, expectedAction); assertEquals(1, lookup.length); const expectedNewAccel: Accelerator = { @@ -336,7 +346,9 @@ undefined, getManager().getAcceleratorIdFromReverseLookup(expectedNewAccel)); - addAndVerify(AcceleratorSource.kAsh, expectedAction, expectedNewAccel); + addAndVerify( + AcceleratorSource.kAsh, expectedAction, + createEmptyAccelInfoFromAccel(expectedNewAccel)); // Check that the accelerator got updated in the lookup. assertEquals(2, lookup.length);
diff --git a/chrome/test/data/webui/histograms/histograms_internals_ui_browsertest.js b/chrome/test/data/webui/histograms/histograms_internals_ui_browsertest.js index 3d69b4e..b0c6a402 100644 --- a/chrome/test/data/webui/histograms/histograms_internals_ui_browsertest.js +++ b/chrome/test/data/webui/histograms/histograms_internals_ui_browsertest.js
@@ -36,41 +36,56 @@ ], }; +/** + * @returns {Promise} a Promise that will resolve on the histograms tag + * receiving a 'histograms-updated-for-test' event. + */ +async function histogramsUpdated() { + return new Promise((resolve) => { + document.querySelector('#histograms') + .addEventListener('histograms-updated-for-test', resolve); + }); +} + +/** + * @returns {Promise} a Promise that will resolve when there is at least one + * histogram shown on the page. + */ +async function histogramsAreShown() { + return new Promise((resolve) => { + const checkHistograms = () => { + if (document.querySelector('#histograms').childElementCount > 0) { + resolve(); + } else { + setTimeout(checkHistograms, 250); + } + }; + checkHistograms(); + }); +} + TEST_F('HistogramsInternalsUIBrowserTest', 'RefreshHistograms', function() { - test( - 'check refresh button replaces existing histograms', function() { - const whenRefreshed = new Promise((resolve, reject) => { - document.querySelector('#histograms') - .addEventListener('histograms-updated-for-test', resolve); - }); - document.querySelector('#refresh').click(); - return whenRefreshed.then(() => { - const histogramHeader = 'Histogram: HTMLOut recorded 5 samples'; - assertEquals( - document.body.textContent.indexOf(histogramHeader), - document.body.textContent.lastIndexOf(histogramHeader), - 'refresh should replace existing histograms'); - }); - }); + test('check refresh button replaces existing histograms', async function() { + document.querySelector('#refresh').click(); + await histogramsUpdated(); + const histogramHeader = 'Histogram: HTMLOut recorded 5 samples'; + assertEquals( + document.body.textContent.indexOf(histogramHeader), + document.body.textContent.lastIndexOf(histogramHeader), + 'refresh should replace existing histograms'); + }); mocha.run(); }); TEST_F('HistogramsInternalsUIBrowserTest', 'NoDummyHistograms', function() { - test( - 'check no dummy histogram is present', function() { - const whenRefreshed = new Promise((resolve, reject) => { - document.querySelector('#histograms') - .addEventListener('histograms-updated-for-test', resolve); - }); - document.querySelector('#refresh').click(); - return whenRefreshed.then(() => { - document.querySelectorAll('.histogram-header-text') - .forEach(header => { - assertNotEquals(header.textContent, ''); - }); - }); - }); + test('check no dummy histogram is present', async function() { + document.querySelector('#refresh').click(); + await histogramsUpdated(); + document.querySelectorAll('.histogram-header-text').forEach(header => { + assertNotEquals(header.textContent, ''); + }); + }); mocha.run(); }); @@ -99,22 +114,62 @@ TEST_F('HistogramsInternalsUIBrowserTest', 'StopMonitoring', function() { test('check page stops updating', async function() { - // Make sure page is loaded after switching to monitoring mode. - const loaded = new Promise((resolve, reject) => { - document.querySelector('#histograms') - .addEventListener('histograms-updated-for-test', resolve); - }); document.querySelector('#enable_monitoring').click(); - await loaded; + // Wait until histograms are updated in monitoring mode. + await histogramsUpdated(); + const stopButton = document.querySelector('#stop'); - assertEquals(document.monitoringStopped(), false); + assertFalse(document.monitoringStopped()); assertEquals(stopButton.textContent, 'Stop'); - assertEquals(stopButton.disabled, false); + assertFalse(stopButton.disabled); + stopButton.click(); - assertEquals(document.monitoringStopped(), true); + assertTrue(document.monitoringStopped()); assertEquals(stopButton.textContent, 'Stopped'); - assertEquals(stopButton.disabled, true); + assertTrue(stopButton.disabled); }); mocha.run(); }); + +TEST_F('HistogramsInternalsUIBrowserTest', 'SubprocessCheckbox', function() { + test('check refresh histograms from clicking on checkbox', async function() { + await histogramsAreShown(); + const subprocessCheckbox = document.querySelector('#subprocess_checkbox'); + assertFalse(subprocessCheckbox.disabled); + assertFalse(subprocessCheckbox.hasAttribute('title')); + subprocessCheckbox.click(); + await histogramsUpdated(); + }); + + mocha.run(); +}); + +TEST_F( + 'HistogramsInternalsUIBrowserTest', 'SubprocessCheckboxInMonitoringMode', + function() { + test( + 'check refresh histograms from clicking on checkbox', + async function() { + // Enable monitoring mode. + document.querySelector('#enable_monitoring').click(); + await histogramsAreShown(); + const subprocessCheckbox = + document.querySelector('#subprocess_checkbox'); + // Subprocess checkbox will be disabled when monitoring mode is on. + assertTrue(subprocessCheckbox.disabled); + assertTrue(subprocessCheckbox.hasAttribute('title')); + + // Stop monitoring mode. + document.querySelector('#stop').click(); + assertTrue(subprocessCheckbox.disabled); + + // Exit monitoring mode. + document.querySelector('#disable_monitoring').click(); + await histogramsAreShown(); + // Subprocess checkbox should be enabled again. + assertFalse(subprocessCheckbox.disabled); + }); + + mocha.run(); + });
diff --git a/chrome/test/data/webui/js/cr_test.ts b/chrome/test/data/webui/js/cr_test.ts index e210382..e393c27 100644 --- a/chrome/test/data/webui/js/cr_test.ts +++ b/chrome/test/data/webui/js/cr_test.ts
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {addSingletonGetter, addWebUIListener, removeWebUIListener, sendWithPromise, WebUIListener, webUIListenerCallback, webUIResponse} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; +import {addWebUIListener, removeWebUIListener, sendWithPromise, WebUIListener, webUIListenerCallback, webUIResponse} from 'chrome://resources/js/cr.m.js'; import {PromiseResolver} from 'chrome://resources/js/promise_resolver.js'; import {assertEquals, assertFalse, assertNotEquals, assertNotReached, assertTrue} from 'chrome://webui-test/chai_assert.js';
diff --git a/chrome/test/data/webui/settings/chromeos/os_bluetooth_summary_tests.js b/chrome/test/data/webui/settings/chromeos/os_bluetooth_summary_tests.js index 37cf53a..70cc5e27 100644 --- a/chrome/test/data/webui/settings/chromeos/os_bluetooth_summary_tests.js +++ b/chrome/test/data/webui/settings/chromeos/os_bluetooth_summary_tests.js
@@ -14,6 +14,7 @@ import {eventToPromise} from 'chrome://webui-test/test_util.js'; import {assertEquals, assertNotEquals, assertTrue} from '../../../chai_assert.js'; +import {assertFalse} from '../../chai_assert.js'; suite('OsBluetoothSummaryTest', function() { /** @type {!FakeBluetoothConfig} */ @@ -146,6 +147,7 @@ bluetoothConfig.setSystemState(BluetoothSystemState.kUnavailable); await flushAsync(); assertTrue(enableBluetoothToggle.disabled); + assertFalse(enableBluetoothToggle.checked); }); test('UI states test', async function() { @@ -158,13 +160,17 @@ bluetoothSummary.shadowRoot.querySelector('#arrowIconButton'); const getBluetoothStatusIcon = () => bluetoothSummary.shadowRoot.querySelector('#statusIcon'); + const getSecondaryLabel = () => bluetoothSecondaryLabel.textContent.trim(); + const getPairNewDeviceBtn = () => + bluetoothSummary.shadowRoot.querySelector('#pairNewDeviceBtn'); assertFalse(!!getBluetoothArrowIconBtn()); assertTrue(!!getBluetoothStatusIcon()); + assertFalse(!!getPairNewDeviceBtn()); assertTrue(!!bluetoothSecondaryLabel); - let label = bluetoothSecondaryLabel.textContent.trim(); - assertEquals(bluetoothSummary.i18n('bluetoothSummaryPageOff'), label); + assertEquals( + bluetoothSummary.i18n('bluetoothSummaryPageOff'), getSecondaryLabel()); assertEquals( 'os-settings:bluetooth-disabled', getBluetoothStatusIcon().icon); @@ -172,6 +178,7 @@ await flushAsync(); assertTrue(!!getBluetoothArrowIconBtn()); + assertTrue(!!getPairNewDeviceBtn()); // Bluetooth Icon should be default because no devices are connected. assertEquals('cr:bluetooth', getBluetoothStatusIcon().icon); @@ -203,39 +210,46 @@ assertEquals( 'os-settings:bluetooth-connected', getBluetoothStatusIcon().icon); - - label = bluetoothSecondaryLabel.textContent.trim(); assertEquals( bluetoothSummary.i18n( 'bluetoothSummaryPageTwoOrMoreDevicesDescription', device1.nickname, mockPairedBluetoothDeviceProperties.length - 1), - label); + getSecondaryLabel()); // Simulate 2 connected devices. bluetoothConfig.removePairedDevice(device3); await flushAsync(); - label = bluetoothSecondaryLabel.textContent.trim(); assertEquals( bluetoothSummary.i18n( 'bluetoothSummaryPageTwoDevicesDescription', device1.nickname, mojoString16ToString(device2.deviceProperties.publicName)), - label); + getSecondaryLabel()); // Simulate a single connected device. bluetoothConfig.removePairedDevice(device2); await flushAsync(); - label = bluetoothSecondaryLabel.textContent.trim(); - assertEquals(device1.nickname, label); + assertEquals(device1.nickname, getSecondaryLabel()); /// Simulate no connected device. bluetoothConfig.removePairedDevice(device1); await flushAsync(); - label = bluetoothSecondaryLabel.textContent.trim(); - assertEquals(bluetoothSummary.i18n('bluetoothSummaryPageOn'), label); + assertEquals( + bluetoothSummary.i18n('bluetoothSummaryPageOn'), getSecondaryLabel()); assertEquals('cr:bluetooth', getBluetoothStatusIcon().icon); + assertTrue(!!getPairNewDeviceBtn()); + + // Mock systemState becoming unavailable. + bluetoothConfig.setSystemState(BluetoothSystemState.kUnavailable); + await flushAsync(); + assertFalse(!!getBluetoothArrowIconBtn()); + assertFalse(!!getPairNewDeviceBtn()); + assertEquals( + bluetoothSummary.i18n('bluetoothSummaryPageOff'), getSecondaryLabel()); + assertEquals( + 'os-settings:bluetooth-disabled', getBluetoothStatusIcon().icon); }); test('start-pairing is fired on pairNewDeviceBtn click', async function() {
diff --git a/chrome/updater/win/installer/installer.cc b/chrome/updater/win/installer/installer.cc index 258e05f..ab8e29c 100644 --- a/chrome/updater/win/installer/installer.cc +++ b/chrome/updater/win/installer/installer.cc
@@ -313,7 +313,7 @@ : ProcessExitResult(RUN_SETUP_FAILED_COULD_NOT_CREATE_PROCESS, hr); } -ProcessExitResult WMain(HMODULE module) { +ProcessExitResult InstallerMain(HMODULE module) { CHECK(EnableSecureDllLoading()); EnableProcessHeapMetadataProtection(); @@ -446,4 +446,11 @@ return exit_code; } +ProcessExitResult WMain(HMODULE module) { + const updater::ProcessExitResult result = InstallerMain(module); + VLOG(1) << "Metainstaller WMain returned: " << result.exit_code + << ", Windows error: " << result.windows_error; + return result; +} + } // namespace updater
diff --git a/chromeos/ash/components/tether/BUILD.gn b/chromeos/ash/components/tether/BUILD.gn index aec6587..a1ddeb04 100644 --- a/chromeos/ash/components/tether/BUILD.gn +++ b/chromeos/ash/components/tether/BUILD.gn
@@ -118,11 +118,11 @@ deps = [ "//ash/constants", - "//ash/services/device_sync/public/cpp", "//base", "//chromeos/ash/components/multidevice/logging", "//chromeos/ash/components/network", "//chromeos/ash/components/tether/proto", + "//chromeos/ash/services/device_sync/public/cpp", "//chromeos/ash/services/multidevice_setup/public/cpp:cpp", "//chromeos/ash/services/secure_channel/public/cpp/client", "//chromeos/ash/services/secure_channel/public/cpp/shared", @@ -200,13 +200,13 @@ public_deps = [ ":tether" ] deps = [ - "//ash/services/device_sync/public/cpp:test_support", "//base", "//base/test:test_support", "//chromeos/ash/components/multidevice", "//chromeos/ash/components/multidevice:test_support", "//chromeos/ash/components/network:test_support", "//chromeos/ash/components/tether/proto", + "//chromeos/ash/services/device_sync/public/cpp:test_support", "//chromeos/ash/services/secure_channel/public/cpp/client:test_support", "//chromeos/ash/services/secure_channel/public/cpp/shared", "//device/bluetooth", @@ -263,14 +263,14 @@ ":test_support", ":tether", "//ash/services/device_sync:test_support", - "//ash/services/device_sync/public/cpp", - "//ash/services/device_sync/public/cpp:test_support", - "//ash/services/device_sync/public/mojom", "//base/test:test_support", "//chromeos/ash/components/multidevice", "//chromeos/ash/components/multidevice:test_support", "//chromeos/ash/components/network:test_support", "//chromeos/ash/components/tether/proto", + "//chromeos/ash/services/device_sync/public/cpp", + "//chromeos/ash/services/device_sync/public/cpp:test_support", + "//chromeos/ash/services/device_sync/public/mojom", "//chromeos/ash/services/multidevice_setup/public/cpp:test_support", "//chromeos/ash/services/multidevice_setup/public/mojom:mojom", "//chromeos/ash/services/secure_channel:test_support",
diff --git a/chromeos/ash/components/tether/DEPS b/chromeos/ash/components/tether/DEPS index 087e58b5..d104eded 100644 --- a/chromeos/ash/components/tether/DEPS +++ b/chromeos/ash/components/tether/DEPS
@@ -1,7 +1,7 @@ include_rules = [ - "+ash/services/device_sync/public/cpp", "+chromeos/ash/components/multidevice", "+chromeos/ash/components/network", + "+chromeos/ash/services/device_sync/public/cpp", "+chromeos/ash/services/multidevice_setup/public", "+chromeos/ash/services/secure_channel/public", "+device/bluetooth",
diff --git a/chromeos/ash/components/tether/asynchronous_shutdown_object_container_impl.cc b/chromeos/ash/components/tether/asynchronous_shutdown_object_container_impl.cc index 2903b35..13140b08 100644 --- a/chromeos/ash/components/tether/asynchronous_shutdown_object_container_impl.cc +++ b/chromeos/ash/components/tether/asynchronous_shutdown_object_container_impl.cc
@@ -4,11 +4,11 @@ #include "chromeos/ash/components/tether/asynchronous_shutdown_object_container_impl.h" -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/memory/ptr_util.h" #include "chromeos/ash/components/tether/disconnect_tethering_request_sender_impl.h" #include "chromeos/ash/components/tether/network_configuration_remover.h" #include "chromeos/ash/components/tether/wifi_hotspot_disconnector_impl.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/secure_channel_client.h" namespace ash {
diff --git a/chromeos/ash/components/tether/asynchronous_shutdown_object_container_impl_unittest.cc b/chromeos/ash/components/tether/asynchronous_shutdown_object_container_impl_unittest.cc index 7602c400..39182ef 100644 --- a/chromeos/ash/components/tether/asynchronous_shutdown_object_container_impl_unittest.cc +++ b/chromeos/ash/components/tether/asynchronous_shutdown_object_container_impl_unittest.cc
@@ -7,7 +7,6 @@ #include <memory> #include "ash/services/device_sync/fake_remote_device_provider.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "ash/services/device_sync/remote_device_provider_impl.h" #include "base/bind.h" #include "base/memory/ptr_util.h" @@ -16,6 +15,7 @@ #include "chromeos/ash/components/tether/fake_disconnect_tethering_request_sender.h" #include "chromeos/ash/components/tether/fake_tether_host_fetcher.h" #include "chromeos/ash/components/tether/tether_component_impl.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h" #include "components/sync_preferences/testing_pref_service_syncable.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/chromeos/ash/components/tether/connect_tethering_operation_unittest.cc b/chromeos/ash/components/tether/connect_tethering_operation_unittest.cc index 78ec9de0..f36829f 100644 --- a/chromeos/ash/components/tether/connect_tethering_operation_unittest.cc +++ b/chromeos/ash/components/tether/connect_tethering_operation_unittest.cc
@@ -7,7 +7,6 @@ #include <memory> #include <vector> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/memory/ptr_util.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/simple_test_clock.h" @@ -20,6 +19,7 @@ #include "chromeos/ash/components/tether/proto/tether.pb.h" #include "chromeos/ash/components/tether/proto_test_util.h" #include "chromeos/ash/components/tether/test_timer_factory.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_client_channel.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_connection_attempt.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h"
diff --git a/chromeos/ash/components/tether/connection_preserver_impl.h b/chromeos/ash/components/tether/connection_preserver_impl.h index 0c6900a4..50e9b28 100644 --- a/chromeos/ash/components/tether/connection_preserver_impl.h +++ b/chromeos/ash/components/tether/connection_preserver_impl.h
@@ -7,11 +7,11 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/timer/timer.h" #include "base/unguessable_token.h" #include "chromeos/ash/components/tether/active_host.h" #include "chromeos/ash/components/tether/connection_preserver.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/client_channel.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/connection_attempt.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/secure_channel_client.h"
diff --git a/chromeos/ash/components/tether/connection_preserver_impl_unittest.cc b/chromeos/ash/components/tether/connection_preserver_impl_unittest.cc index 3b4a906..d913b93 100644 --- a/chromeos/ash/components/tether/connection_preserver_impl_unittest.cc +++ b/chromeos/ash/components/tether/connection_preserver_impl_unittest.cc
@@ -6,7 +6,6 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/base64.h" #include "base/bind.h" #include "base/memory/ptr_util.h" @@ -19,6 +18,7 @@ #include "chromeos/ash/components/tether/fake_active_host.h" #include "chromeos/ash/components/tether/mock_tether_host_response_recorder.h" #include "chromeos/ash/components/tether/timer_factory.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_client_channel.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_connection_attempt.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h"
diff --git a/chromeos/ash/components/tether/disconnect_tethering_operation_unittest.cc b/chromeos/ash/components/tether/disconnect_tethering_operation_unittest.cc index 870593d..eb4bcb2 100644 --- a/chromeos/ash/components/tether/disconnect_tethering_operation_unittest.cc +++ b/chromeos/ash/components/tether/disconnect_tethering_operation_unittest.cc
@@ -7,7 +7,6 @@ #include <memory> #include <vector> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/containers/flat_map.h" #include "base/memory/ptr_util.h" #include "base/test/metrics/histogram_tester.h" @@ -18,6 +17,7 @@ #include "chromeos/ash/components/tether/message_wrapper.h" #include "chromeos/ash/components/tether/proto/tether.pb.h" #include "chromeos/ash/components/tether/test_timer_factory.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_client_channel.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_connection_attempt.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h"
diff --git a/chromeos/ash/components/tether/disconnect_tethering_request_sender_impl_unittest.cc b/chromeos/ash/components/tether/disconnect_tethering_request_sender_impl_unittest.cc index eafbd1f..a884f5d 100644 --- a/chromeos/ash/components/tether/disconnect_tethering_request_sender_impl_unittest.cc +++ b/chromeos/ash/components/tether/disconnect_tethering_request_sender_impl_unittest.cc
@@ -6,7 +6,6 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/memory/ptr_util.h" #include "base/test/task_environment.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" @@ -14,6 +13,7 @@ #include "chromeos/ash/components/tether/disconnect_tethering_operation.h" #include "chromeos/ash/components/tether/disconnect_tethering_request_sender.h" #include "chromeos/ash/components/tether/fake_tether_host_fetcher.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/secure_channel_client.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromeos/ash/components/tether/host_scanner_impl_unittest.cc b/chromeos/ash/components/tether/host_scanner_impl_unittest.cc index 20a2db04..6a38ea6 100644 --- a/chromeos/ash/components/tether/host_scanner_impl_unittest.cc +++ b/chromeos/ash/components/tether/host_scanner_impl_unittest.cc
@@ -8,7 +8,6 @@ #include <memory> #include <vector> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/test/metrics/histogram_tester.h" @@ -28,6 +27,7 @@ #include "chromeos/ash/components/tether/mock_tether_host_response_recorder.h" #include "chromeos/ash/components/tether/proto_test_util.h" #include "chromeos/ash/components/tether/top_level_host_scan_cache.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/secure_channel_client.h" #include "components/session_manager/core/session_manager.h"
diff --git a/chromeos/ash/components/tether/host_scanner_operation_unittest.cc b/chromeos/ash/components/tether/host_scanner_operation_unittest.cc index 47c2ad7..538a81b7 100644 --- a/chromeos/ash/components/tether/host_scanner_operation_unittest.cc +++ b/chromeos/ash/components/tether/host_scanner_operation_unittest.cc
@@ -8,7 +8,6 @@ #include <memory> #include <vector> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/memory/ptr_util.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/simple_test_clock.h" @@ -21,6 +20,7 @@ #include "chromeos/ash/components/tether/mock_tether_host_response_recorder.h" #include "chromeos/ash/components/tether/proto/tether.pb.h" #include "chromeos/ash/components/tether/proto_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_client_channel.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_connection_attempt.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h"
diff --git a/chromeos/ash/components/tether/keep_alive_operation_unittest.cc b/chromeos/ash/components/tether/keep_alive_operation_unittest.cc index 15dfb67..85ce0b4 100644 --- a/chromeos/ash/components/tether/keep_alive_operation_unittest.cc +++ b/chromeos/ash/components/tether/keep_alive_operation_unittest.cc
@@ -7,7 +7,6 @@ #include <memory> #include <vector> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/memory/ptr_util.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/simple_test_clock.h" @@ -15,6 +14,7 @@ #include "chromeos/ash/components/tether/message_wrapper.h" #include "chromeos/ash/components/tether/proto_test_util.h" #include "chromeos/ash/components/tether/test_timer_factory.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_client_channel.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_connection_attempt.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h"
diff --git a/chromeos/ash/components/tether/keep_alive_scheduler_unittest.cc b/chromeos/ash/components/tether/keep_alive_scheduler_unittest.cc index 22df53c9..006f314 100644 --- a/chromeos/ash/components/tether/keep_alive_scheduler_unittest.cc +++ b/chromeos/ash/components/tether/keep_alive_scheduler_unittest.cc
@@ -7,7 +7,6 @@ #include <memory> #include <vector> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/memory/ptr_util.h" #include "base/timer/mock_timer.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" @@ -15,6 +14,7 @@ #include "chromeos/ash/components/tether/fake_active_host.h" #include "chromeos/ash/components/tether/fake_host_scan_cache.h" #include "chromeos/ash/components/tether/proto_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/secure_channel_client.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromeos/ash/components/tether/message_transfer_operation.h b/chromeos/ash/components/tether/message_transfer_operation.h index c519fce..0de12fb 100644 --- a/chromeos/ash/components/tether/message_transfer_operation.h +++ b/chromeos/ash/components/tether/message_transfer_operation.h
@@ -8,11 +8,11 @@ #include <map> #include <vector> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/timer/timer.h" #include "base/unguessable_token.h" #include "chromeos/ash/components/tether/message_wrapper.h" #include "chromeos/ash/components/tether/proto/tether.pb.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/client_channel.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/connection_attempt.h" #include "chromeos/ash/services/secure_channel/public/cpp/shared/connection_priority.h"
diff --git a/chromeos/ash/components/tether/message_transfer_operation_unittest.cc b/chromeos/ash/components/tether/message_transfer_operation_unittest.cc index b551252..f2a405b2 100644 --- a/chromeos/ash/components/tether/message_transfer_operation_unittest.cc +++ b/chromeos/ash/components/tether/message_transfer_operation_unittest.cc
@@ -6,13 +6,13 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/memory/ptr_util.h" #include "base/timer/mock_timer.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" #include "chromeos/ash/components/tether/message_wrapper.h" #include "chromeos/ash/components/tether/proto_test_util.h" #include "chromeos/ash/components/tether/test_timer_factory.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_client_channel.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_connection_attempt.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h"
diff --git a/chromeos/ash/components/tether/tether_component_impl.cc b/chromeos/ash/components/tether/tether_component_impl.cc index 4942bc1..ec58fcf9 100644 --- a/chromeos/ash/components/tether/tether_component_impl.cc +++ b/chromeos/ash/components/tether/tether_component_impl.cc
@@ -6,7 +6,6 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/memory/ptr_util.h" @@ -21,6 +20,7 @@ #include "chromeos/ash/components/tether/tether_host_response_recorder.h" #include "chromeos/ash/components/tether/tether_session_completion_logger.h" #include "chromeos/ash/components/tether/wifi_hotspot_disconnector_impl.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/secure_channel_client.h" #include "components/pref_registry/pref_registry_syncable.h"
diff --git a/chromeos/ash/components/tether/tether_connector_impl_unittest.cc b/chromeos/ash/components/tether/tether_connector_impl_unittest.cc index 58ee185..449444d 100644 --- a/chromeos/ash/components/tether/tether_connector_impl_unittest.cc +++ b/chromeos/ash/components/tether/tether_connector_impl_unittest.cc
@@ -6,7 +6,6 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/bind.h" #include "base/memory/ptr_util.h" #include "base/test/metrics/histogram_tester.h" @@ -29,6 +28,7 @@ #include "chromeos/ash/components/tether/mock_host_connection_metrics_logger.h" #include "chromeos/ash/components/tether/mock_tether_host_response_recorder.h" #include "chromeos/ash/components/tether/tether_connector.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_secure_channel_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/secure_channel_client.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/chromeos/ash/components/tether/tether_host_fetcher_impl.h b/chromeos/ash/components/tether/tether_host_fetcher_impl.h index 0b984b5..4109459c 100644 --- a/chromeos/ash/components/tether/tether_host_fetcher_impl.h +++ b/chromeos/ash/components/tether/tether_host_fetcher_impl.h
@@ -7,10 +7,10 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/memory/weak_ptr.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" #include "chromeos/ash/components/tether/tether_host_fetcher.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/multidevice_setup_client.h" namespace ash {
diff --git a/chromeos/ash/components/tether/tether_host_fetcher_impl_unittest.cc b/chromeos/ash/components/tether/tether_host_fetcher_impl_unittest.cc index fafcaed..09d77d8 100644 --- a/chromeos/ash/components/tether/tether_host_fetcher_impl_unittest.cc +++ b/chromeos/ash/components/tether/tether_host_fetcher_impl_unittest.cc
@@ -7,7 +7,6 @@ #include <memory> #include <vector> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/bind.h" #include "base/callback.h" #include "chromeos/ash/components/multidevice/remote_device.h" @@ -15,6 +14,7 @@ #include "chromeos/ash/components/multidevice/remote_device_test_util.h" #include "chromeos/ash/components/multidevice/software_feature.h" #include "chromeos/ash/components/multidevice/software_feature_state.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h" #include "chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromeos/ash/resources/BUILD.gn b/chromeos/ash/resources/BUILD.gn index c0429ed..8048047 100644 --- a/chromeos/ash/resources/BUILD.gn +++ b/chromeos/ash/resources/BUILD.gn
@@ -27,13 +27,13 @@ ] deps = [ - "//ash/services/device_sync/public/mojom:mojom_js", "//chromeos/ash/components/human_presence:human_presence_internals_ts", "//chromeos/ash/components/language/public/mojom:mojom_js", "//chromeos/ash/components/multidevice/mojom:mojom_js", "//chromeos/ash/services/auth_factor_config/public/mojom:mojom_js", "//chromeos/ash/services/bluetooth_config/public/mojom:mojom_js", "//chromeos/ash/services/cellular_setup/public/mojom:mojom_js", + "//chromeos/ash/services/device_sync/public/mojom:mojom_js", "//chromeos/ash/services/multidevice_setup/public/mojom:mojom_js", ] }
diff --git a/chromeos/ash/resources/multidevice_resources.grdp b/chromeos/ash/resources/multidevice_resources.grdp index 4decb66..088fd85 100644 --- a/chromeos/ash/resources/multidevice_resources.grdp +++ b/chromeos/ash/resources/multidevice_resources.grdp
@@ -2,13 +2,13 @@ <grit-part> <!-- Mojo JS files. --> <include name="IDR_MULTIDEVICE_DEVICE_SYNC_MOJOM_LITE_JS" - file="${mojom_root}/ash/services/device_sync/public/mojom/device_sync.mojom-lite.js" - resource_path="mojo/ash/services/device_sync/public/mojom/device_sync.mojom-lite.js" + file="${mojom_root}/chromeos/ash/services/device_sync/public/mojom/device_sync.mojom-lite.js" + resource_path="mojo/chromeos/ash/services/device_sync/public/mojom/device_sync.mojom-lite.js" use_base_dir="false" type="BINDATA" /> <include name="IDR_MULTIDEVICE_DEVICE_SYNC_MOJOM_WEBUI_JS" - file="${mojom_root}/mojom-webui/ash/services/device_sync/public/mojom/device_sync.mojom-webui.js" - resource_path="mojo/ash/services/device_sync/public/mojom/device_sync.mojom-webui.js" + file="${mojom_root}/mojom-webui/chromeos/ash/services/device_sync/public/mojom/device_sync.mojom-webui.js" + resource_path="mojo/chromeos/ash/services/device_sync/public/mojom/device_sync.mojom-webui.js" use_base_dir="false" type="BINDATA" /> <include name="IDR_MULTIDEVICE_MULTIDEVICE_SETUP_MOJOM_LITE_JS"
diff --git a/chromeos/ash/services/device_sync/DEPS b/chromeos/ash/services/device_sync/DEPS new file mode 100644 index 0000000..050f96028 --- /dev/null +++ b/chromeos/ash/services/device_sync/DEPS
@@ -0,0 +1,22 @@ +# TODO(https://crbug.com/1164001): When this file is edited, same file in +# //ash/services/device_sync should be updated as well. We need +# to sync both files until the migration is done. +include_rules = [ + "+ash/constants", + "+chromeos/ash/components/multidevice", + "+components/gcm_driver", + "+components/signin/public", + "+components/version_info", + "+crypto", + "+device/bluetooth", + "+google_apis/gaia", + "+mojo/public/cpp", + "+services/network/public", + "+services/network/test", + "+third_party/protobuf/src/google/protobuf/message_lite.h", + "+third_party/securemessage", + + # TODO(https://crbug.com/1164001): This is a temporary deps during + # //{ash=>chromeos/ash}/services/device_sync migration. + "+ash/services/device_sync", +]
diff --git a/chromeos/ash/services/device_sync/DIR_METADATA b/chromeos/ash/services/device_sync/DIR_METADATA new file mode 100644 index 0000000..0144f63 --- /dev/null +++ b/chromeos/ash/services/device_sync/DIR_METADATA
@@ -0,0 +1,7 @@ +# TODO(https://crbug.com/1164001): When this file is edited, same file in +# //ash/services/device_sync should be updated as well. We need +# to sync both files until the migration is done. +buganizer { + component_id: 1108889 +} +team_email: "chromeos-cross-device-eng@google.com "
diff --git a/chromeos/ash/services/device_sync/OWNERS b/chromeos/ash/services/device_sync/OWNERS new file mode 100644 index 0000000..34fbbfb --- /dev/null +++ b/chromeos/ash/services/device_sync/OWNERS
@@ -0,0 +1,4 @@ +file://chromeos/ash/components/multidevice/OWNERS + +per-file *_type_converter*.*=set noparent +per-file *_type_converter*.*=file://ipc/SECURITY_OWNERS
diff --git a/ash/services/device_sync/public/cpp/BUILD.gn b/chromeos/ash/services/device_sync/public/cpp/BUILD.gn similarity index 94% rename from ash/services/device_sync/public/cpp/BUILD.gn rename to chromeos/ash/services/device_sync/public/cpp/BUILD.gn index 310cb758..46510a9e 100644 --- a/ash/services/device_sync/public/cpp/BUILD.gn +++ b/chromeos/ash/services/device_sync/public/cpp/BUILD.gn
@@ -22,10 +22,10 @@ public_deps = [ "//ash/constants", "//ash/services/device_sync:feature_status_change", - "//ash/services/device_sync/public/mojom", "//base", "//chromeos/ash/components/multidevice", "//chromeos/ash/components/multidevice/logging", + "//chromeos/ash/services/device_sync/public/mojom", ] deps = [ "//mojo/public/cpp/bindings" ] @@ -40,10 +40,10 @@ public_deps = [ "//ash/constants", "//ash/services/device_sync:feature_status_change", - "//ash/services/device_sync/public/mojom", "//base", "//chromeos/ash/components/multidevice", "//chromeos/ash/components/multidevice/logging", + "//chromeos/ash/services/device_sync/public/mojom", ] deps = [
diff --git a/ash/services/device_sync/public/cpp/client_app_metadata_provider.h b/chromeos/ash/services/device_sync/public/cpp/client_app_metadata_provider.h similarity index 85% rename from ash/services/device_sync/public/cpp/client_app_metadata_provider.h rename to chromeos/ash/services/device_sync/public/cpp/client_app_metadata_provider.h index 54d4a8f..012c908d 100644 --- a/ash/services/device_sync/public/cpp/client_app_metadata_provider.h +++ b/chromeos/ash/services/device_sync/public/cpp/client_app_metadata_provider.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CLIENT_APP_METADATA_PROVIDER_H_ -#define ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CLIENT_APP_METADATA_PROVIDER_H_ +#ifndef CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CLIENT_APP_METADATA_PROVIDER_H_ +#define CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CLIENT_APP_METADATA_PROVIDER_H_ #include "base/callback_forward.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -48,4 +48,4 @@ using ::ash::device_sync::ClientAppMetadataProvider; } -#endif // ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CLIENT_APP_METADATA_PROVIDER_H_ +#endif // CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CLIENT_APP_METADATA_PROVIDER_H_
diff --git a/ash/services/device_sync/public/cpp/cryptauth_device_id_provider.h b/chromeos/ash/services/device_sync/public/cpp/cryptauth_device_id_provider.h similarity index 76% rename from ash/services/device_sync/public/cpp/cryptauth_device_id_provider.h rename to chromeos/ash/services/device_sync/public/cpp/cryptauth_device_id_provider.h index 733497c..885ceee 100644 --- a/ash/services/device_sync/public/cpp/cryptauth_device_id_provider.h +++ b/chromeos/ash/services/device_sync/public/cpp/cryptauth_device_id_provider.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CRYPTAUTH_DEVICE_ID_PROVIDER_H_ -#define ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CRYPTAUTH_DEVICE_ID_PROVIDER_H_ +#ifndef CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CRYPTAUTH_DEVICE_ID_PROVIDER_H_ +#define CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CRYPTAUTH_DEVICE_ID_PROVIDER_H_ #include <string> @@ -31,4 +31,4 @@ } // namespace ash -#endif // ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CRYPTAUTH_DEVICE_ID_PROVIDER_H_ +#endif // CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CRYPTAUTH_DEVICE_ID_PROVIDER_H_
diff --git a/ash/services/device_sync/public/cpp/device_sync_client.cc b/chromeos/ash/services/device_sync/public/cpp/device_sync_client.cc similarity index 93% rename from ash/services/device_sync/public/cpp/device_sync_client.cc rename to chromeos/ash/services/device_sync/public/cpp/device_sync_client.cc index 5c8ea50..b4f1bae 100644 --- a/ash/services/device_sync/public/cpp/device_sync_client.cc +++ b/chromeos/ash/services/device_sync/public/cpp/device_sync_client.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/services/device_sync/public/cpp/device_sync_client.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/components/multidevice/logging/logging.h"
diff --git a/ash/services/device_sync/public/cpp/device_sync_client.h b/chromeos/ash/services/device_sync/public/cpp/device_sync_client.h similarity index 92% rename from ash/services/device_sync/public/cpp/device_sync_client.h rename to chromeos/ash/services/device_sync/public/cpp/device_sync_client.h index efbd789..1c32b4e 100644 --- a/ash/services/device_sync/public/cpp/device_sync_client.h +++ b/chromeos/ash/services/device_sync/public/cpp/device_sync_client.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_CLIENT_H_ -#define ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_CLIENT_H_ +#ifndef CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_CLIENT_H_ +#define CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_CLIENT_H_ #include <memory> #include <string> @@ -11,12 +11,12 @@ #include "ash/services/device_sync/feature_status_change.h" #include "ash/services/device_sync/proto/cryptauth_common.pb.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "base/callback.h" #include "base/memory/scoped_refptr.h" #include "base/observer_list.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" #include "chromeos/ash/components/multidevice/software_feature.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "mojo/public/cpp/bindings/remote.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -123,4 +123,4 @@ } // namespace ash -#endif // ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_CLIENT_H_ +#endif // CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_CLIENT_H_
diff --git a/ash/services/device_sync/public/cpp/device_sync_client_impl.cc b/chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl.cc similarity index 98% rename from ash/services/device_sync/public/cpp/device_sync_client_impl.cc rename to chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl.cc index 0366a279..ee26c13 100644 --- a/ash/services/device_sync/public/cpp/device_sync_client_impl.cc +++ b/chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl.cc
@@ -2,20 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/services/device_sync/public/cpp/device_sync_client_impl.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl.h" #include <string> #include <utility> #include <vector> #include "ash/constants/ash_features.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "base/base64url.h" #include "base/bind.h" #include "base/metrics/histogram_functions.h" #include "chromeos/ash/components/multidevice/expiring_remote_device_cache.h" #include "chromeos/ash/components/multidevice/logging/logging.h" #include "chromeos/ash/components/multidevice/remote_device.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" namespace ash {
diff --git a/ash/services/device_sync/public/cpp/device_sync_client_impl.h b/chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl.h similarity index 92% rename from ash/services/device_sync/public/cpp/device_sync_client_impl.h rename to chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl.h index 350780c..6af4fa8a 100644 --- a/ash/services/device_sync/public/cpp/device_sync_client_impl.h +++ b/chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_CLIENT_IMPL_H_ -#define ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_CLIENT_IMPL_H_ +#ifndef CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_CLIENT_IMPL_H_ +#define CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_CLIENT_IMPL_H_ #include <memory> #include <string> @@ -11,13 +11,13 @@ #include "ash/services/device_sync/feature_status_change.h" #include "ash/services/device_sync/proto/cryptauth_common.pb.h" -#include "ash/services/device_sync/public/cpp/device_sync_client.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "base/callback.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" #include "chromeos/ash/components/multidevice/software_feature.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" @@ -146,4 +146,4 @@ } // namespace ash -#endif // ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_CLIENT_IMPL_H_ +#endif // CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_CLIENT_IMPL_H_
diff --git a/ash/services/device_sync/public/cpp/device_sync_client_impl_unittest.cc b/chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl_unittest.cc similarity index 98% rename from ash/services/device_sync/public/cpp/device_sync_client_impl_unittest.cc rename to chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl_unittest.cc index c6ec85af..a67660b 100644 --- a/ash/services/device_sync/public/cpp/device_sync_client_impl_unittest.cc +++ b/chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/services/device_sync/public/cpp/device_sync_client_impl.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client_impl.h" #include <algorithm> #include <string> @@ -15,10 +15,6 @@ #include "ash/services/device_sync/fake_device_sync.h" #include "ash/services/device_sync/feature_status_change.h" #include "ash/services/device_sync/proto/cryptauth_common.pb.h" -#include "ash/services/device_sync/public/cpp/device_sync_prefs.h" -#include "ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.h" -#include "ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "base/bind.h" #include "base/memory/scoped_refptr.h" #include "base/no_destructor.h" @@ -29,6 +25,10 @@ #include "base/test/test_simple_task_runner.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" #include "chromeos/ash/components/multidevice/software_feature.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_prefs.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "components/gcm_driver/fake_gcm_driver.h" #include "components/prefs/testing_pref_service.h" #include "components/signin/public/identity_manager/identity_test_environment.h"
diff --git a/ash/services/device_sync/public/cpp/device_sync_prefs.cc b/chromeos/ash/services/device_sync/public/cpp/device_sync_prefs.cc similarity index 95% rename from ash/services/device_sync/public/cpp/device_sync_prefs.cc rename to chromeos/ash/services/device_sync/public/cpp/device_sync_prefs.cc index 4816e0c..b715d655 100644 --- a/ash/services/device_sync/public/cpp/device_sync_prefs.cc +++ b/chromeos/ash/services/device_sync/public/cpp/device_sync_prefs.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/services/device_sync/public/cpp/device_sync_prefs.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_prefs.h" #include "ash/constants/ash_features.h" #include "ash/services/device_sync/attestation_certificates_syncer_impl.h"
diff --git a/ash/services/device_sync/public/cpp/device_sync_prefs.h b/chromeos/ash/services/device_sync/public/cpp/device_sync_prefs.h similarity index 70% rename from ash/services/device_sync/public/cpp/device_sync_prefs.h rename to chromeos/ash/services/device_sync/public/cpp/device_sync_prefs.h index 28efdb7..0ec6e92 100644 --- a/ash/services/device_sync/public/cpp/device_sync_prefs.h +++ b/chromeos/ash/services/device_sync/public/cpp/device_sync_prefs.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_PREFS_H_ -#define ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_PREFS_H_ +#ifndef CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_PREFS_H_ +#define CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_PREFS_H_ class PrefRegistrySimple; @@ -21,4 +21,4 @@ using ::ash::device_sync::RegisterProfilePrefs; } -#endif // ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_PREFS_H_ +#endif // CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_DEVICE_SYNC_PREFS_H_
diff --git a/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.cc b/chromeos/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.cc similarity index 91% rename from ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.cc rename to chromeos/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.cc index e3945e2..842f15b 100644 --- a/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.cc +++ b/chromeos/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.h" namespace ash {
diff --git a/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.h b/chromeos/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.h similarity index 83% rename from ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.h rename to chromeos/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.h index 29d02bd9..d6ef85a 100644 --- a/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.h +++ b/chromeos/ash/services/device_sync/public/cpp/fake_client_app_metadata_provider.h
@@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_CLIENT_APP_METADATA_PROVIDER_H_ -#define ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_CLIENT_APP_METADATA_PROVIDER_H_ +#ifndef CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_CLIENT_APP_METADATA_PROVIDER_H_ +#define CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_CLIENT_APP_METADATA_PROVIDER_H_ #include <string> #include <utility> #include <vector> -#include "ash/services/device_sync/public/cpp/client_app_metadata_provider.h" #include "base/callback.h" +#include "chromeos/ash/services/device_sync/public/cpp/client_app_metadata_provider.h" namespace ash { @@ -65,4 +65,4 @@ using ::ash::device_sync::FakeClientAppMetadataProvider; } -#endif // ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_CLIENT_APP_METADATA_PROVIDER_H_ +#endif // CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_CLIENT_APP_METADATA_PROVIDER_H_
diff --git a/ash/services/device_sync/public/cpp/fake_device_sync_client.cc b/chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.cc similarity index 98% rename from ash/services/device_sync/public/cpp/fake_device_sync_client.cc rename to chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.cc index 9adb5ff4..b4e44f49 100644 --- a/ash/services/device_sync/public/cpp/fake_device_sync_client.cc +++ b/chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/components/multidevice/remote_device.h" #include "chromeos/ash/components/multidevice/remote_device_cache.h"
diff --git a/ash/services/device_sync/public/cpp/fake_device_sync_client.h b/chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h similarity index 94% rename from ash/services/device_sync/public/cpp/fake_device_sync_client.h rename to chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h index ae833f9..11742e91 100644 --- a/ash/services/device_sync/public/cpp/fake_device_sync_client.h +++ b/chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_DEVICE_SYNC_CLIENT_H_ -#define ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_DEVICE_SYNC_CLIENT_H_ +#ifndef CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_DEVICE_SYNC_CLIENT_H_ +#define CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_DEVICE_SYNC_CLIENT_H_ #include <memory> #include <string> @@ -11,12 +11,12 @@ #include "ash/services/device_sync/feature_status_change.h" #include "ash/services/device_sync/proto/cryptauth_common.pb.h" -#include "ash/services/device_sync/public/cpp/device_sync_client.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "base/callback.h" #include "base/containers/circular_deque.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" #include "chromeos/ash/components/multidevice/software_feature.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace ash { @@ -201,4 +201,4 @@ } // namespace ash -#endif // ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_DEVICE_SYNC_CLIENT_H_ +#endif // CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_DEVICE_SYNC_CLIENT_H_
diff --git a/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.cc b/chromeos/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.cc similarity index 86% rename from ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.cc rename to chromeos/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.cc index d22dd29b6..c523ae02 100644 --- a/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.cc +++ b/chromeos/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h" namespace ash {
diff --git a/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h b/chromeos/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h similarity index 75% rename from ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h rename to chromeos/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h index 461d534..1845782 100644 --- a/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h +++ b/chromeos/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_GCM_DEVICE_INFO_PROVIDER_H_ -#define ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_GCM_DEVICE_INFO_PROVIDER_H_ +#ifndef CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_GCM_DEVICE_INFO_PROVIDER_H_ +#define CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_GCM_DEVICE_INFO_PROVIDER_H_ #include "ash/services/device_sync/proto/cryptauth_api.pb.h" -#include "ash/services/device_sync/public/cpp/gcm_device_info_provider.h" +#include "chromeos/ash/services/device_sync/public/cpp/gcm_device_info_provider.h" namespace ash { @@ -40,4 +40,4 @@ using ::ash::device_sync::FakeGcmDeviceInfoProvider; } -#endif // ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_GCM_DEVICE_INFO_PROVIDER_H_ +#endif // CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_FAKE_GCM_DEVICE_INFO_PROVIDER_H_
diff --git a/ash/services/device_sync/public/cpp/gcm_constants.cc b/chromeos/ash/services/device_sync/public/cpp/gcm_constants.cc similarity index 85% rename from ash/services/device_sync/public/cpp/gcm_constants.cc rename to chromeos/ash/services/device_sync/public/cpp/gcm_constants.cc index 82babf6..e8ae3a1 100644 --- a/ash/services/device_sync/public/cpp/gcm_constants.cc +++ b/chromeos/ash/services/device_sync/public/cpp/gcm_constants.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/services/device_sync/public/cpp/gcm_constants.h" +#include "chromeos/ash/services/device_sync/public/cpp/gcm_constants.h" namespace ash {
diff --git a/ash/services/device_sync/public/cpp/gcm_constants.h b/chromeos/ash/services/device_sync/public/cpp/gcm_constants.h similarity index 76% rename from ash/services/device_sync/public/cpp/gcm_constants.h rename to chromeos/ash/services/device_sync/public/cpp/gcm_constants.h index 345dfc8..624e78f 100644 --- a/ash/services/device_sync/public/cpp/gcm_constants.h +++ b/chromeos/ash/services/device_sync/public/cpp/gcm_constants.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_CONSTANTS_H_ -#define ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_CONSTANTS_H_ +#ifndef CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_CONSTANTS_H_ +#define CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_CONSTANTS_H_ namespace ash { @@ -24,4 +24,4 @@ using ::ash::device_sync::kCryptAuthGcmSenderId; } // namespace chromeos::device_sync -#endif // ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_CONSTANTS_H_ +#endif // CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_CONSTANTS_H_
diff --git a/ash/services/device_sync/public/cpp/gcm_device_info_provider.h b/chromeos/ash/services/device_sync/public/cpp/gcm_device_info_provider.h similarity index 80% rename from ash/services/device_sync/public/cpp/gcm_device_info_provider.h rename to chromeos/ash/services/device_sync/public/cpp/gcm_device_info_provider.h index f5d47d83..887c369 100644 --- a/ash/services/device_sync/public/cpp/gcm_device_info_provider.h +++ b/chromeos/ash/services/device_sync/public/cpp/gcm_device_info_provider.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_DEVICE_INFO_PROVIDER_H_ -#define ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_DEVICE_INFO_PROVIDER_H_ +#ifndef CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_DEVICE_INFO_PROVIDER_H_ +#define CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_DEVICE_INFO_PROVIDER_H_ #include "ash/services/device_sync/proto/cryptauth_api.pb.h" @@ -35,4 +35,4 @@ using ::ash::device_sync::GcmDeviceInfoProvider; } -#endif // ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_DEVICE_INFO_PROVIDER_H_ +#endif // CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_DEVICE_INFO_PROVIDER_H_
diff --git a/ash/services/device_sync/public/mojom/BUILD.gn b/chromeos/ash/services/device_sync/public/mojom/BUILD.gn similarity index 94% rename from ash/services/device_sync/public/mojom/BUILD.gn rename to chromeos/ash/services/device_sync/public/mojom/BUILD.gn index f4a0e71..d9b614f 100644 --- a/ash/services/device_sync/public/mojom/BUILD.gn +++ b/chromeos/ash/services/device_sync/public/mojom/BUILD.gn
@@ -16,7 +16,7 @@ ] webui_module_path = - "chrome://resources/mojo/ash/services/device_sync/public/mojom" + "chrome://resources/mojo/chromeos/ash/services/device_sync/public/mojom" cpp_typemaps = [ {
diff --git a/ash/services/device_sync/public/mojom/OWNERS b/chromeos/ash/services/device_sync/public/mojom/OWNERS similarity index 100% rename from ash/services/device_sync/public/mojom/OWNERS rename to chromeos/ash/services/device_sync/public/mojom/OWNERS
diff --git a/ash/services/device_sync/public/mojom/device_sync.mojom b/chromeos/ash/services/device_sync/public/mojom/device_sync.mojom similarity index 100% rename from ash/services/device_sync/public/mojom/device_sync.mojom rename to chromeos/ash/services/device_sync/public/mojom/device_sync.mojom
diff --git a/ash/services/device_sync/public/mojom/device_sync_mojom_traits.cc b/chromeos/ash/services/device_sync/public/mojom/device_sync_mojom_traits.cc similarity index 97% rename from ash/services/device_sync/public/mojom/device_sync_mojom_traits.cc rename to chromeos/ash/services/device_sync/public/mojom/device_sync_mojom_traits.cc index be29f01..d57709f 100644 --- a/ash/services/device_sync/public/mojom/device_sync_mojom_traits.cc +++ b/chromeos/ash/services/device_sync/public/mojom/device_sync_mojom_traits.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/services/device_sync/public/mojom/device_sync_mojom_traits.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync_mojom_traits.h" namespace mojo {
diff --git a/ash/services/device_sync/public/mojom/device_sync_mojom_traits.h b/chromeos/ash/services/device_sync/public/mojom/device_sync_mojom_traits.h similarity index 82% rename from ash/services/device_sync/public/mojom/device_sync_mojom_traits.h rename to chromeos/ash/services/device_sync/public/mojom/device_sync_mojom_traits.h index 4ad8a71..f8bc854 100644 --- a/ash/services/device_sync/public/mojom/device_sync_mojom_traits.h +++ b/chromeos/ash/services/device_sync/public/mojom/device_sync_mojom_traits.h
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SERVICES_DEVICE_SYNC_PUBLIC_MOJOM_DEVICE_SYNC_MOJOM_TRAITS_H_ -#define ASH_SERVICES_DEVICE_SYNC_PUBLIC_MOJOM_DEVICE_SYNC_MOJOM_TRAITS_H_ +#ifndef CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_MOJOM_DEVICE_SYNC_MOJOM_TRAITS_H_ +#define CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_MOJOM_DEVICE_SYNC_MOJOM_TRAITS_H_ #include "ash/services/device_sync/feature_status_change.h" #include "ash/services/device_sync/proto/cryptauth_common.pb.h" #include "ash/services/device_sync/proto/cryptauth_devicesync.pb.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom-shared.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom-shared.h" #include "mojo/public/cpp/bindings/enum_traits.h" namespace mojo { @@ -45,4 +45,4 @@ } // namespace mojo -#endif // ASH_SERVICES_DEVICE_SYNC_PUBLIC_MOJOM_DEVICE_SYNC_MOJOM_TRAITS_H_ +#endif // CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_MOJOM_DEVICE_SYNC_MOJOM_TRAITS_H_
diff --git a/ash/services/device_sync/public/mojom/device_sync_mojom_traits_unittest.cc b/chromeos/ash/services/device_sync/public/mojom/device_sync_mojom_traits_unittest.cc similarity index 94% rename from ash/services/device_sync/public/mojom/device_sync_mojom_traits_unittest.cc rename to chromeos/ash/services/device_sync/public/mojom/device_sync_mojom_traits_unittest.cc index d288d758..01273038 100644 --- a/ash/services/device_sync/public/mojom/device_sync_mojom_traits_unittest.cc +++ b/chromeos/ash/services/device_sync/public/mojom/device_sync_mojom_traits_unittest.cc
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/services/device_sync/public/mojom/device_sync_mojom_traits.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync_mojom_traits.h" #include "ash/services/device_sync/feature_status_change.h" #include "ash/services/device_sync/proto/cryptauth_devicesync.pb.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "mojo/public/cpp/test_support/test_utils.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromeos/ash/services/multidevice_setup/BUILD.gn b/chromeos/ash/services/multidevice_setup/BUILD.gn index 999071e0..29a04c9 100644 --- a/chromeos/ash/services/multidevice_setup/BUILD.gn +++ b/chromeos/ash/services/multidevice_setup/BUILD.gn
@@ -62,11 +62,11 @@ deps = [ "//ash/constants", "//ash/services/device_sync/proto:util", - "//ash/services/device_sync/public/cpp", - "//ash/services/device_sync/public/mojom", "//base", "//chromeos/ash/components/multidevice", "//chromeos/ash/components/multidevice/logging", + "//chromeos/ash/services/device_sync/public/cpp", + "//chromeos/ash/services/device_sync/public/mojom", "//chromeos/ash/services/multidevice_setup/proto", "//chromeos/ash/services/multidevice_setup/public/cpp:android_sms_app_helper_delegate", "//chromeos/ash/services/multidevice_setup/public/cpp:android_sms_pairing_state_tracker", @@ -155,11 +155,11 @@ ":multidevice_setup", ":test_support", "//ash/constants", - "//ash/services/device_sync/public/cpp:test_support", "//base", "//base/test:test_support", "//chromeos/ash/components/multidevice", "//chromeos/ash/components/multidevice:test_support", + "//chromeos/ash/services/device_sync/public/cpp:test_support", "//chromeos/ash/services/multidevice_setup/public/cpp:oobe_completion_tracker", "//chromeos/ash/services/multidevice_setup/public/cpp:prefs", "//chromeos/ash/services/multidevice_setup/public/cpp:test_support",
diff --git a/chromeos/ash/services/multidevice_setup/account_status_change_delegate_notifier_impl_unittest.cc b/chromeos/ash/services/multidevice_setup/account_status_change_delegate_notifier_impl_unittest.cc index 166c40b..6a9c9f0 100644 --- a/chromeos/ash/services/multidevice_setup/account_status_change_delegate_notifier_impl_unittest.cc +++ b/chromeos/ash/services/multidevice_setup/account_status_change_delegate_notifier_impl_unittest.cc
@@ -7,12 +7,12 @@ #include <string> #include <vector> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/test/simple_test_clock.h" #include "base/test/task_environment.h" #include "base/time/time.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/fake_account_status_change_delegate.h" #include "chromeos/ash/services/multidevice_setup/fake_host_device_timestamp_manager.h" #include "chromeos/ash/services/multidevice_setup/fake_host_status_provider.h"
diff --git a/chromeos/ash/services/multidevice_setup/device_with_connectivity_status.h b/chromeos/ash/services/multidevice_setup/device_with_connectivity_status.h index 56890b2..f49eed43 100644 --- a/chromeos/ash/services/multidevice_setup/device_with_connectivity_status.h +++ b/chromeos/ash/services/multidevice_setup/device_with_connectivity_status.h
@@ -9,8 +9,8 @@ #include <string> #include <vector> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/components/multidevice/remote_device.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" namespace ash {
diff --git a/chromeos/ash/services/multidevice_setup/eligible_host_devices_provider_impl.h b/chromeos/ash/services/multidevice_setup/eligible_host_devices_provider_impl.h index ad8f3f7..6c1363f 100644 --- a/chromeos/ash/services/multidevice_setup/eligible_host_devices_provider_impl.h +++ b/chromeos/ash/services/multidevice_setup/eligible_host_devices_provider_impl.h
@@ -5,8 +5,8 @@ #ifndef CHROMEOS_ASH_SERVICES_MULTIDEVICE_SETUP_ELIGIBLE_HOST_DEVICES_PROVIDER_IMPL_H_ #define CHROMEOS_ASH_SERVICES_MULTIDEVICE_SETUP_ELIGIBLE_HOST_DEVICES_PROVIDER_IMPL_H_ -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/eligible_host_devices_provider.h" namespace ash {
diff --git a/chromeos/ash/services/multidevice_setup/eligible_host_devices_provider_impl_unittest.cc b/chromeos/ash/services/multidevice_setup/eligible_host_devices_provider_impl_unittest.cc index 0e0c8b8..aa763c2f 100644 --- a/chromeos/ash/services/multidevice_setup/eligible_host_devices_provider_impl_unittest.cc +++ b/chromeos/ash/services/multidevice_setup/eligible_host_devices_provider_impl_unittest.cc
@@ -8,14 +8,14 @@ #include "ash/constants/ash_features.h" #include "ash/services/device_sync/proto/cryptauth_api.pb.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "base/containers/flat_set.h" #include "base/test/scoped_feature_list.h" #include "base/time/time_override.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" #include "chromeos/ash/components/multidevice/software_feature.h" #include "chromeos/ash/components/multidevice/software_feature_state.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "testing/gtest/include/gtest/gtest.h" namespace ash {
diff --git a/chromeos/ash/services/multidevice_setup/feature_state_manager_impl.h b/chromeos/ash/services/multidevice_setup/feature_state_manager_impl.h index 3e7b9d64..58c44e9 100644 --- a/chromeos/ash/services/multidevice_setup/feature_state_manager_impl.h +++ b/chromeos/ash/services/multidevice_setup/feature_state_manager_impl.h
@@ -5,9 +5,9 @@ #ifndef CHROMEOS_ASH_SERVICES_MULTIDEVICE_SETUP_FEATURE_STATE_MANAGER_IMPL_H_ #define CHROMEOS_ASH_SERVICES_MULTIDEVICE_SETUP_FEATURE_STATE_MANAGER_IMPL_H_ -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/containers/flat_map.h" #include "base/timer/timer.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/feature_state_manager.h" #include "chromeos/ash/services/multidevice_setup/global_state_feature_manager.h" #include "chromeos/ash/services/multidevice_setup/host_status_provider.h"
diff --git a/chromeos/ash/services/multidevice_setup/feature_state_manager_impl_unittest.cc b/chromeos/ash/services/multidevice_setup/feature_state_manager_impl_unittest.cc index a6c493d..4eeaaf5b 100644 --- a/chromeos/ash/services/multidevice_setup/feature_state_manager_impl_unittest.cc +++ b/chromeos/ash/services/multidevice_setup/feature_state_manager_impl_unittest.cc
@@ -8,11 +8,11 @@ #include <vector> #include "ash/constants/ash_features.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/containers/contains.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/fake_feature_state_manager.h" #include "chromeos/ash/services/multidevice_setup/fake_global_state_feature_manager.h" #include "chromeos/ash/services/multidevice_setup/fake_host_status_provider.h"
diff --git a/chromeos/ash/services/multidevice_setup/global_state_feature_manager_impl.cc b/chromeos/ash/services/multidevice_setup/global_state_feature_manager_impl.cc index 605c584..8dc1339c 100644 --- a/chromeos/ash/services/multidevice_setup/global_state_feature_manager_impl.cc +++ b/chromeos/ash/services/multidevice_setup/global_state_feature_manager_impl.cc
@@ -11,8 +11,6 @@ #include "ash/constants/ash_features.h" #include "ash/services/device_sync/feature_status_change.h" -#include "ash/services/device_sync/public/cpp/device_sync_client.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "base/bind.h" #include "base/location.h" #include "base/memory/ptr_util.h" @@ -24,6 +22,8 @@ #include "chromeos/ash/components/multidevice/remote_device_ref.h" #include "chromeos/ash/components/multidevice/software_feature.h" #include "chromeos/ash/components/multidevice/software_feature_state.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "chromeos/ash/services/multidevice_setup/host_status_provider.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/prefs.h" #include "chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h"
diff --git a/chromeos/ash/services/multidevice_setup/global_state_feature_manager_impl.h b/chromeos/ash/services/multidevice_setup/global_state_feature_manager_impl.h index 6d00536d..79ca3a5 100644 --- a/chromeos/ash/services/multidevice_setup/global_state_feature_manager_impl.h +++ b/chromeos/ash/services/multidevice_setup/global_state_feature_manager_impl.h
@@ -8,10 +8,10 @@ #include <memory> #include <string> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "chromeos/ash/services/multidevice_setup/global_state_feature_manager.h" #include "chromeos/ash/services/multidevice_setup/host_status_provider.h" #include "chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h"
diff --git a/chromeos/ash/services/multidevice_setup/global_state_feature_manager_impl_unittest.cc b/chromeos/ash/services/multidevice_setup/global_state_feature_manager_impl_unittest.cc index 86f5a7d8..3210325 100644 --- a/chromeos/ash/services/multidevice_setup/global_state_feature_manager_impl_unittest.cc +++ b/chromeos/ash/services/multidevice_setup/global_state_feature_manager_impl_unittest.cc
@@ -9,7 +9,6 @@ #include <vector> #include "ash/constants/ash_features.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/timer/mock_timer.h" @@ -17,6 +16,7 @@ #include "chromeos/ash/components/multidevice/remote_device_test_util.h" #include "chromeos/ash/components/multidevice/software_feature.h" #include "chromeos/ash/components/multidevice/software_feature_state.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/fake_host_status_provider.h" #include "chromeos/ash/services/multidevice_setup/global_state_feature_manager.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/prefs.h"
diff --git a/chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler.cc b/chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler.cc index 77583335..58c4dec6 100644 --- a/chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler.cc +++ b/chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler.cc
@@ -5,12 +5,12 @@ #include "chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler.h" #include "ash/constants/ash_features.h" -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/bind.h" #include "base/memory/ptr_util.h" #include "base/ranges/algorithm.h" #include "base/timer/timer.h" #include "chromeos/ash/components/multidevice/logging/logging.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h"
diff --git a/chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler.h b/chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler.h index 01a58a7d..720043f 100644 --- a/chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler.h +++ b/chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler.h
@@ -7,8 +7,8 @@ #include <memory> -#include "ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "base/memory/weak_ptr.h" +#include "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom.h" #include "chromeos/ash/services/multidevice_setup/host_backend_delegate.h" class PrefRegistrySimple;
diff --git a/chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler_unittest.cc b/chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler_unittest.cc index 909a8077..c60a38d 100644 --- a/chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler_unittest.cc +++ b/chromeos/ash/services/multidevice_setup/grandfathered_easy_unlock_host_disabler_unittest.cc
@@ -7,9 +7,9 @@ #include <memory> #include "ash/constants/ash_features.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/timer/mock_timer.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/fake_host_backend_delegate.h" #include "components/sync_preferences/testing_pref_service_syncable.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromeos/ash/services/multidevice_setup/host_backend_delegate_impl.h b/chromeos/ash/services/multidevice_setup/host_backend_delegate_impl.h index e0b815d..d027024 100644 --- a/chromeos/ash/services/multidevice_setup/host_backend_delegate_impl.h +++ b/chromeos/ash/services/multidevice_setup/host_backend_delegate_impl.h
@@ -5,10 +5,10 @@ #ifndef CHROMEOS_ASH_SERVICES_MULTIDEVICE_SETUP_HOST_BACKEND_DELEGATE_IMPL_H_ #define CHROMEOS_ASH_SERVICES_MULTIDEVICE_SETUP_HOST_BACKEND_DELEGATE_IMPL_H_ -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/host_backend_delegate.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chromeos/ash/services/multidevice_setup/host_backend_delegate_impl_unittest.cc b/chromeos/ash/services/multidevice_setup/host_backend_delegate_impl_unittest.cc index 3d59ff5..937b1aa 100644 --- a/chromeos/ash/services/multidevice_setup/host_backend_delegate_impl_unittest.cc +++ b/chromeos/ash/services/multidevice_setup/host_backend_delegate_impl_unittest.cc
@@ -7,7 +7,6 @@ #include <memory> #include "ash/constants/ash_features.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/containers/flat_map.h" #include "base/test/scoped_feature_list.h" #include "base/timer/mock_timer.h" @@ -15,6 +14,7 @@ #include "chromeos/ash/components/multidevice/remote_device_test_util.h" #include "chromeos/ash/components/multidevice/software_feature.h" #include "chromeos/ash/components/multidevice/software_feature_state.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/fake_eligible_host_devices_provider.h" #include "chromeos/ash/services/multidevice_setup/fake_host_backend_delegate.h" #include "components/sync_preferences/testing_pref_service_syncable.h"
diff --git a/chromeos/ash/services/multidevice_setup/host_status_provider_impl.h b/chromeos/ash/services/multidevice_setup/host_status_provider_impl.h index 8fcf91a..396c833 100644 --- a/chromeos/ash/services/multidevice_setup/host_status_provider_impl.h +++ b/chromeos/ash/services/multidevice_setup/host_status_provider_impl.h
@@ -5,9 +5,9 @@ #ifndef CHROMEOS_ASH_SERVICES_MULTIDEVICE_SETUP_HOST_STATUS_PROVIDER_IMPL_H_ #define CHROMEOS_ASH_SERVICES_MULTIDEVICE_SETUP_HOST_STATUS_PROVIDER_IMPL_H_ -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/timer/timer.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/host_backend_delegate.h" #include "chromeos/ash/services/multidevice_setup/host_status_provider.h" #include "chromeos/ash/services/multidevice_setup/host_verifier.h"
diff --git a/chromeos/ash/services/multidevice_setup/host_status_provider_impl_unittest.cc b/chromeos/ash/services/multidevice_setup/host_status_provider_impl_unittest.cc index 9aedf6c5..ebfbc9e 100644 --- a/chromeos/ash/services/multidevice_setup/host_status_provider_impl_unittest.cc +++ b/chromeos/ash/services/multidevice_setup/host_status_provider_impl_unittest.cc
@@ -6,9 +6,9 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/test/task_environment.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/fake_eligible_host_devices_provider.h" #include "chromeos/ash/services/multidevice_setup/fake_host_backend_delegate.h" #include "chromeos/ash/services/multidevice_setup/fake_host_status_provider.h"
diff --git a/chromeos/ash/services/multidevice_setup/host_verifier_impl.h b/chromeos/ash/services/multidevice_setup/host_verifier_impl.h index 44a9d52..6b1eed4e 100644 --- a/chromeos/ash/services/multidevice_setup/host_verifier_impl.h +++ b/chromeos/ash/services/multidevice_setup/host_verifier_impl.h
@@ -7,11 +7,11 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/memory/weak_ptr.h" #include "base/time/default_clock.h" #include "base/timer/timer.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/host_backend_delegate.h" #include "chromeos/ash/services/multidevice_setup/host_verifier.h"
diff --git a/chromeos/ash/services/multidevice_setup/host_verifier_impl_unittest.cc b/chromeos/ash/services/multidevice_setup/host_verifier_impl_unittest.cc index 75f993f9..8a48d5c 100644 --- a/chromeos/ash/services/multidevice_setup/host_verifier_impl_unittest.cc +++ b/chromeos/ash/services/multidevice_setup/host_verifier_impl_unittest.cc
@@ -10,13 +10,13 @@ #include "ash/constants/ash_features.h" #include "ash/services/device_sync/proto/cryptauth_common.pb.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/test/scoped_feature_list.h" #include "base/test/simple_test_clock.h" #include "base/timer/mock_timer.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" #include "chromeos/ash/components/multidevice/software_feature.h" #include "chromeos/ash/components/multidevice/software_feature_state.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/fake_host_backend_delegate.h" #include "chromeos/ash/services/multidevice_setup/fake_host_verifier.h" #include "components/sync_preferences/testing_pref_service_syncable.h"
diff --git a/chromeos/ash/services/multidevice_setup/multidevice_setup_impl_unittest.cc b/chromeos/ash/services/multidevice_setup/multidevice_setup_impl_unittest.cc index 5c2e7286..e2cee44 100644 --- a/chromeos/ash/services/multidevice_setup/multidevice_setup_impl_unittest.cc +++ b/chromeos/ash/services/multidevice_setup/multidevice_setup_impl_unittest.cc
@@ -7,14 +7,14 @@ #include <vector> #include "ash/constants/ash_features.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" -#include "ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h" #include "base/bind.h" #include "base/containers/flat_map.h" #include "base/run_loop.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h" #include "chromeos/ash/services/multidevice_setup/account_status_change_delegate_notifier_impl.h" #include "chromeos/ash/services/multidevice_setup/android_sms_app_installing_status_observer.h" #include "chromeos/ash/services/multidevice_setup/eligible_host_devices_provider_impl.h"
diff --git a/chromeos/ash/services/multidevice_setup/multidevice_setup_initializer.h b/chromeos/ash/services/multidevice_setup/multidevice_setup_initializer.h index b830fd7..2a4e04f 100644 --- a/chromeos/ash/services/multidevice_setup/multidevice_setup_initializer.h +++ b/chromeos/ash/services/multidevice_setup/multidevice_setup_initializer.h
@@ -9,7 +9,7 @@ #include <utility> #include <vector> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/multidevice_setup_base.h" #include "chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h" #include "mojo/public/cpp/bindings/pending_remote.h"
diff --git a/chromeos/ash/services/multidevice_setup/multidevice_setup_service_unittest.cc b/chromeos/ash/services/multidevice_setup/multidevice_setup_service_unittest.cc index 46b7a7c8..9c15515 100644 --- a/chromeos/ash/services/multidevice_setup/multidevice_setup_service_unittest.cc +++ b/chromeos/ash/services/multidevice_setup/multidevice_setup_service_unittest.cc
@@ -4,13 +4,13 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" -#include "ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/run_loop.h" #include "base/test/task_environment.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_gcm_device_info_provider.h" #include "chromeos/ash/services/multidevice_setup/fake_account_status_change_delegate.h" #include "chromeos/ash/services/multidevice_setup/fake_feature_state_observer.h" #include "chromeos/ash/services/multidevice_setup/fake_host_status_observer.h"
diff --git a/chromeos/ash/services/multidevice_setup/public/mojom/BUILD.gn b/chromeos/ash/services/multidevice_setup/public/mojom/BUILD.gn index 5bc762a..eb2c73b 100644 --- a/chromeos/ash/services/multidevice_setup/public/mojom/BUILD.gn +++ b/chromeos/ash/services/multidevice_setup/public/mojom/BUILD.gn
@@ -10,7 +10,7 @@ mojom("mojom") { sources = [ "multidevice_setup.mojom" ] - public_deps = [ "//ash/services/device_sync/public/mojom" ] + public_deps = [ "//chromeos/ash/services/device_sync/public/mojom" ] webui_module_path = "chrome://resources/mojo/chromeos/ash/services/multidevice_setup/public/mojom" }
diff --git a/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom b/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom index 6dbaadf..5ea35a2 100644 --- a/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom +++ b/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom
@@ -5,7 +5,7 @@ module ash.multidevice_setup.mojom; import "chromeos/ash/components/multidevice/mojom/multidevice_types.mojom"; -import "ash/services/device_sync/public/mojom/device_sync.mojom"; +import "chromeos/ash/services/device_sync/public/mojom/device_sync.mojom"; // Enumeration of possible opt-in entry points for Phone Hub Camera Roll // feature. This enum is tied directly to a UMA enum defined in
diff --git a/chromeos/ash/services/multidevice_setup/wifi_sync_notification_controller.cc b/chromeos/ash/services/multidevice_setup/wifi_sync_notification_controller.cc index a434e4a..050fcaa3 100644 --- a/chromeos/ash/services/multidevice_setup/wifi_sync_notification_controller.cc +++ b/chromeos/ash/services/multidevice_setup/wifi_sync_notification_controller.cc
@@ -6,13 +6,13 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/memory/ptr_util.h" #include "base/power_monitor/power_monitor.h" #include "chromeos/ash/components/multidevice/logging/logging.h" #include "chromeos/ash/components/multidevice/remote_device_ref.h" #include "chromeos/ash/components/multidevice/software_feature.h" #include "chromeos/ash/components/multidevice/software_feature_state.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/account_status_change_delegate_notifier.h" #include "chromeos/ash/services/multidevice_setup/global_state_feature_manager.h" #include "chromeos/ash/services/multidevice_setup/host_status_provider.h"
diff --git a/chromeos/ash/services/multidevice_setup/wifi_sync_notification_controller.h b/chromeos/ash/services/multidevice_setup/wifi_sync_notification_controller.h index d64d717..9429875 100644 --- a/chromeos/ash/services/multidevice_setup/wifi_sync_notification_controller.h +++ b/chromeos/ash/services/multidevice_setup/wifi_sync_notification_controller.h
@@ -7,9 +7,9 @@ #include <memory> -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/memory/weak_ptr.h" #include "base/power_monitor/power_observer.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "components/session_manager/core/session_manager_observer.h" class PrefRegistrySimple;
diff --git a/chromeos/ash/services/multidevice_setup/wifi_sync_notification_controller_unittest.cc b/chromeos/ash/services/multidevice_setup/wifi_sync_notification_controller_unittest.cc index 48c36f3..942d05d0 100644 --- a/chromeos/ash/services/multidevice_setup/wifi_sync_notification_controller_unittest.cc +++ b/chromeos/ash/services/multidevice_setup/wifi_sync_notification_controller_unittest.cc
@@ -7,12 +7,12 @@ #include <memory> #include "ash/constants/ash_features.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" #include "chromeos/ash/components/multidevice/software_feature.h" #include "chromeos/ash/components/multidevice/software_feature_state.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/fake_account_status_change_delegate.h" #include "chromeos/ash/services/multidevice_setup/fake_account_status_change_delegate_notifier.h" #include "chromeos/ash/services/multidevice_setup/fake_global_state_feature_manager.h"
diff --git a/chromeos/ash/services/secure_channel/public/cpp/client/BUILD.gn b/chromeos/ash/services/secure_channel/public/cpp/client/BUILD.gn index a723a4f..47e73ba 100644 --- a/chromeos/ash/services/secure_channel/public/cpp/client/BUILD.gn +++ b/chromeos/ash/services/secure_channel/public/cpp/client/BUILD.gn
@@ -34,9 +34,9 @@ deps = [ "//ash/constants", - "//ash/services/device_sync/public/cpp", "//base", "//chromeos/ash/components/multidevice/logging", + "//chromeos/ash/services/device_sync/public/cpp", "//chromeos/ash/services/multidevice_setup/public/cpp", "//chromeos/ash/services/secure_channel/public/cpp/shared", "//chromeos/ash/services/secure_channel/public/mojom", @@ -83,11 +83,11 @@ ":client", ":test_support", "//ash/constants", - "//ash/services/device_sync/public/cpp:test_support", "//base", "//base/test:test_support", "//chromeos/ash/components/multidevice", "//chromeos/ash/components/multidevice:test_support", + "//chromeos/ash/services/device_sync/public/cpp:test_support", "//chromeos/ash/services/multidevice_setup/public/cpp:test_support", "//chromeos/ash/services/secure_channel", "//chromeos/ash/services/secure_channel:test_support",
diff --git a/chromeos/ash/services/secure_channel/public/cpp/client/connection_manager_impl.cc b/chromeos/ash/services/secure_channel/public/cpp/client/connection_manager_impl.cc index 8daeed1..b1571f7e 100644 --- a/chromeos/ash/services/secure_channel/public/cpp/client/connection_manager_impl.cc +++ b/chromeos/ash/services/secure_channel/public/cpp/client/connection_manager_impl.cc
@@ -5,7 +5,6 @@ #include "chromeos/ash/services/secure_channel/public/cpp/client/connection_manager_impl.h" #include "ash/constants/ash_features.h" -#include "ash/services/device_sync/public/cpp/device_sync_client.h" #include "base/callback.h" #include "base/callback_helpers.h" #include "base/metrics/histogram_functions.h" @@ -13,6 +12,7 @@ #include "base/time/clock.h" #include "base/time/default_clock.h" #include "base/time/time.h" +#include "chromeos/ash/services/device_sync/public/cpp/device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/multidevice_setup_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/secure_channel_client.h" #include "chromeos/ash/services/secure_channel/public/mojom/secure_channel.mojom-shared.h"
diff --git a/chromeos/ash/services/secure_channel/public/cpp/client/connection_manager_impl_unittest.cc b/chromeos/ash/services/secure_channel/public/cpp/client/connection_manager_impl_unittest.cc index d096ab7a..438b454 100644 --- a/chromeos/ash/services/secure_channel/public/cpp/client/connection_manager_impl_unittest.cc +++ b/chromeos/ash/services/secure_channel/public/cpp/client/connection_manager_impl_unittest.cc
@@ -7,7 +7,6 @@ #include <memory> #include "ash/constants/ash_features.h" -#include "ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "base/callback.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_functions.h" @@ -17,6 +16,7 @@ #include "base/time/time.h" #include "base/timer/mock_timer.h" #include "chromeos/ash/components/multidevice/remote_device_test_util.h" +#include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/ash/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_client_channel.h" #include "chromeos/ash/services/secure_channel/public/cpp/client/fake_connection_attempt.h"
diff --git a/chromeos/ash/services/secure_channel/secure_channel_initializer.cc b/chromeos/ash/services/secure_channel/secure_channel_initializer.cc index e2531830..52cfd21c 100644 --- a/chromeos/ash/services/secure_channel/secure_channel_initializer.cc +++ b/chromeos/ash/services/secure_channel/secure_channel_initializer.cc
@@ -10,6 +10,8 @@ #include "chromeos/ash/services/secure_channel/secure_channel_impl.h" #include "device/bluetooth/bluetooth_adapter_factory.h" #include "device/bluetooth/dbus/bluez_dbus_manager.h" +#include "device/bluetooth/floss/floss_dbus_manager.h" +#include "device/bluetooth/floss/floss_features.h" namespace ash::secure_channel { @@ -55,8 +57,15 @@ SecureChannelInitializer::SecureChannelInitializer( scoped_refptr<base::TaskRunner> task_runner) { + bool is_initialized = false; + if (floss::features::IsFlossEnabled()) { + is_initialized = floss::FlossDBusManager::IsInitialized(); + } else { + is_initialized = bluez::BluezDBusManager::IsInitialized(); + } + // May not be initialized in tests. - if (!bluez::BluezDBusManager::IsInitialized()) + if (!is_initialized) return; PA_LOG(VERBOSE) << "SecureChannelInitializer::SecureChannelInitializer(): "
diff --git a/chromeos/lacros/BUILD.gn b/chromeos/lacros/BUILD.gn index 6abe76a..523dcfc 100644 --- a/chromeos/lacros/BUILD.gn +++ b/chromeos/lacros/BUILD.gn
@@ -99,6 +99,42 @@ tast_disabled_tests = tast_disabled_tests_from_lacros_all } + # This target is run in lacros CQ builder in addition to lacros_all_tast_tests + # on eve board + lacros_tast_tests("lacros_cq_tast_tests_eve") { + # To disable a specific test, comment out the test and + # add the bug number.Please do not just delete it. + tast_tests = [ + "a11y.Smoke.lacros", + "dlp.DataLeakPreventionRulesListClipboardOmni.lacros", + "feedback.SysInfoPII.third_party_site_on_lacros", + "inputs.SpellCheckRemoveWords.lacros", + "policy.AutoOpenAllowedForURLs.lacros", + "policy.ManagedBookmarks.lacros", + "policy.PasswordManagerEnabled.lacros", + "policy.SafeBrowsingProtectionLevel.lacros", + "ui.NotificationClosePerf.clear_all_lacros", + ] + } + + # This target is run in lacros CQ builder in addition to lacros_all_tast_tests + # on jacuzzi board + lacros_tast_tests("lacros_cq_tast_tests_jacuzzi") { + # To disable a specific test, comment out the test and + # add the bug number.Please do not just delete it. + tast_tests = [ + "apps.LacrosWebApps", + "example.Touch.lacros", + "holdingspace.Download.lacros_pause_and_resume", + "policy.AllowCrossOriginAuthPrompt.lacros", + "policy.BasicAuthOverHTTPEnabled", + "policy.NotificationsAllowedForUrls.lacros", + "policy.PrintingBackgroundGraphicsDefault.lacros", + "ui.DragTabInTabletPerf.lacros", + "wmp.OverviewDragWindowToNewDesk.lacros", + ] + } + lacros_tast_tests("lacros_fyi_tast_tests") { tast_tests = [ "lacros.AppLauncherLaunch",
diff --git a/components/BUILD.gn b/components/BUILD.gn index 0a03fed3..f34ac5c 100644 --- a/components/BUILD.gn +++ b/components/BUILD.gn
@@ -555,6 +555,7 @@ deps += [ "//components/commerce/core:commerce_heuristics_data_unittests", "//components/commerce/core:feature_list_unittests", + "//components/commerce/core:heuristics_provider_unittests", "//components/commerce/core/subscriptions:subscriptions_unit_tests", "//components/commerce/core/webui:unit_tests", ]
diff --git a/components/browsing_topics/browsing_topics_service_impl_unittest.cc b/components/browsing_topics/browsing_topics_service_impl_unittest.cc index 4345d892..1a98ed7 100644 --- a/components/browsing_topics/browsing_topics_service_impl_unittest.cc +++ b/components/browsing_topics/browsing_topics_service_impl_unittest.cc
@@ -50,6 +50,7 @@ // tests. constexpr base::TimeDelta kOneTestDay = base::Seconds(1); constexpr base::TimeDelta kEpoch = 7 * kOneTestDay; +constexpr base::TimeDelta kMaxEpochIntroductionDelay = 2 * kOneTestDay; constexpr base::TimeDelta kCalculatorDelay = base::Milliseconds(1); @@ -168,7 +169,11 @@ /*enabled_features=*/ {{blink::features::kBrowsingTopics, {{"time_period_per_epoch", - base::StrCat({base::NumberToString(kEpoch.InSeconds()), "s"})}}}}, + base::StrCat({base::NumberToString(kEpoch.InSeconds()), "s"})}, + {"browsing_topics_max_epoch_introduction_delay", + base::StrCat( + {base::NumberToString(kMaxEpochIntroductionDelay.InSeconds()), + "s"})}}}}, /*disabled_features=*/{}); OverrideHmacKeyForTesting(kTestKey); @@ -890,7 +895,7 @@ EXPECT_FALSE(metrics_entries[0].topic2.IsValid()); // Advance to the time after the epoch switch time. - task_environment()->AdvanceClock(kEpoch - base::Microseconds(1)); + task_environment()->AdvanceClock(kMaxEpochIntroductionDelay); { std::vector<blink::mojom::EpochTopicPtr> result; @@ -927,7 +932,7 @@ NavigateToPage(GURL("https://www.foo.com")); // Advance to the time after the epoch switch time. - task_environment()->AdvanceClock(kEpoch - base::Microseconds(1)); + task_environment()->AdvanceClock(kMaxEpochIntroductionDelay); std::vector<blink::mojom::EpochTopicPtr> result; EXPECT_TRUE(browsing_topics_service_->HandleTopicsWebApi( @@ -984,7 +989,7 @@ } // Advance to the time after the epoch switch time. - task_environment()->AdvanceClock(kEpoch - base::Microseconds(1)); + task_environment()->AdvanceClock(kMaxEpochIntroductionDelay); { std::vector<blink::mojom::EpochTopicPtr> result; @@ -1073,7 +1078,7 @@ } // Advance to the time after the epoch switch time. - task_environment()->AdvanceClock(kEpoch - base::Microseconds(1)); + task_environment()->AdvanceClock(kMaxEpochIntroductionDelay); { std::vector<blink::mojom::EpochTopicPtr> result; @@ -1150,7 +1155,7 @@ } // Advance to the time after the epoch switch time. - task_environment()->AdvanceClock(kEpoch - base::Microseconds(1)); + task_environment()->AdvanceClock(kMaxEpochIntroductionDelay); { std::vector<blink::mojom::EpochTopicPtr> result; @@ -1246,8 +1251,8 @@ InitializeBrowsingTopicsService(std::move(mock_calculator_results)); // Advance to the time after the epoch switch time. - task_environment()->FastForwardBy(kCalculatorDelay + kEpoch - - base::Microseconds(1)); + task_environment()->FastForwardBy(kCalculatorDelay + + kMaxEpochIntroductionDelay); EXPECT_EQ( content::GetBrowsingTopicsApiUsage(topics_site_data_manager()).size(), @@ -1284,8 +1289,8 @@ InitializeBrowsingTopicsService(std::move(mock_calculator_results)); // Advance to the time after the epoch switch time. - task_environment()->FastForwardBy(kCalculatorDelay + kEpoch - - base::Microseconds(1)); + task_environment()->FastForwardBy(kCalculatorDelay + + kMaxEpochIntroductionDelay); EXPECT_EQ( content::GetBrowsingTopicsApiUsage(topics_site_data_manager()).size(), @@ -1318,8 +1323,8 @@ InitializeBrowsingTopicsService(std::move(mock_calculator_results)); // Advance to the time after the epoch switch time. - task_environment()->FastForwardBy(kCalculatorDelay + kEpoch - - base::Microseconds(1)); + task_environment()->FastForwardBy(kCalculatorDelay + + kMaxEpochIntroductionDelay); EXPECT_EQ( content::GetBrowsingTopicsApiUsage(topics_site_data_manager()).size(), @@ -1360,8 +1365,8 @@ InitializeBrowsingTopicsService(std::move(mock_calculator_results)); // Advance to the time after the epoch switch time. - task_environment()->FastForwardBy(kCalculatorDelay + kEpoch - - base::Microseconds(1)); + task_environment()->FastForwardBy(kCalculatorDelay + + kMaxEpochIntroductionDelay); EXPECT_EQ( content::GetBrowsingTopicsApiUsage(topics_site_data_manager()).size(), @@ -1428,7 +1433,7 @@ EXPECT_FALSE(metrics_entries[0].topic2.IsValid()); // Advance to the time after the epoch switch time. - task_environment()->AdvanceClock(kEpoch - base::Microseconds(1)); + task_environment()->AdvanceClock(kMaxEpochIntroductionDelay); { std::vector<blink::mojom::EpochTopicPtr> result; @@ -1497,7 +1502,7 @@ NavigateToPage(GURL("https://www.foo.com")); // Advance to the time after the epoch switch time. - task_environment()->AdvanceClock(kEpoch - base::Microseconds(1)); + task_environment()->AdvanceClock(kMaxEpochIntroductionDelay); std::vector<blink::mojom::EpochTopicPtr> api_call_result; EXPECT_TRUE(browsing_topics_service_->HandleTopicsWebApi(
diff --git a/components/browsing_topics/browsing_topics_state.cc b/components/browsing_topics/browsing_topics_state.cc index 8cea298..4b973c8 100644 --- a/components/browsing_topics/browsing_topics_state.cc +++ b/components/browsing_topics/browsing_topics_state.cc
@@ -152,17 +152,19 @@ DCHECK_GT(kNumberOfEpochsToExpose, 0u); // Derive a per-user per-site time delta in the range of - // [0, kBrowsingTopicsTimePeriodPerEpoch). The latest epoch will be switched - // to use when the current time is within `site_sticky_time_delta` apart from - // the `next_scheduled_calculation_time_`. This way, each site will see a + // [0, `kBrowsingTopicsMaxEpochIntroductionDelay`). The latest epoch will only + // be used after `site_sticky_time_delta` has elapsed since the last + // calculation finish time (i.e. `next_scheduled_calculation_time_` - + // `kBrowsingTopicsTimePeriodPerEpoch`). This way, each site will see a // different epoch switch time. base::TimeDelta site_sticky_time_delta = CalculateSiteStickyTimeDelta(top_domain); size_t end_epoch_index = 0; - - if (base::Time::Now() + site_sticky_time_delta < - next_scheduled_calculation_time_) { + if (base::Time::Now() <= + next_scheduled_calculation_time_ - + blink::features::kBrowsingTopicsTimePeriodPerEpoch.Get() + + site_sticky_time_delta) { if (epochs_.size() < 2) return {}; @@ -196,9 +198,25 @@ uint64_t epoch_switch_time_decision_hash = HashTopDomainForEpochSwitchTimeDecision(hmac_key_, top_domain); + // Currently the browser can only reasonably support configurations where the + // random-over period is less or equal to an epoch, because 1) we only store + // one more epoch in addition to the number to expose to sites, and that would + // not be sufficient. 2) the calculation finish times (i.e. the actual epoch + // delimitation times) for previous epochs aren't stored, so we wouldn't be + // able to know when to use a previous epoch (or we'd need to approximate + // the delimitation time with the calculation start time, or based on its + // position in `epochs_`). + DCHECK_LE(blink::features::kBrowsingTopicsMaxEpochIntroductionDelay.Get(), + blink::features::kBrowsingTopicsTimePeriodPerEpoch.Get()); + + DCHECK_GT(blink::features::kBrowsingTopicsMaxEpochIntroductionDelay.Get() + .InSeconds(), + 0); + return base::Seconds( epoch_switch_time_decision_hash % - blink::features::kBrowsingTopicsTimePeriodPerEpoch.Get().InSeconds()); + blink::features::kBrowsingTopicsMaxEpochIntroductionDelay.Get() + .InSeconds()); } base::ImportantFileWriter::BackgroundDataProducerCallback
diff --git a/components/browsing_topics/browsing_topics_state_unittest.cc b/components/browsing_topics/browsing_topics_state_unittest.cc index 611ad47..7361a25f 100644 --- a/components/browsing_topics/browsing_topics_state_unittest.cc +++ b/components/browsing_topics/browsing_topics_state_unittest.cc
@@ -275,8 +275,9 @@ state.AddEpoch(CreateTestEpochTopics(kTime1)); state.UpdateNextScheduledCalculationTime(); - ASSERT_LT(state.CalculateSiteStickyTimeDelta("foo.com") + base::Hours(1), - base::Days(7)); + // The random per-site delay happens to be between (one hour, one day). + ASSERT_GT(state.CalculateSiteStickyTimeDelta("foo.com"), base::Hours(1)); + ASSERT_LT(state.CalculateSiteStickyTimeDelta("foo.com"), base::Days(1)); task_environment_->FastForwardBy(base::Hours(1)); EXPECT_TRUE(state.EpochsForSite(/*top_domain=*/"foo.com").empty()); @@ -289,8 +290,9 @@ state.AddEpoch(CreateTestEpochTopics(kTime1)); state.UpdateNextScheduledCalculationTime(); - ASSERT_GT(state.CalculateSiteStickyTimeDelta("foo.com") + base::Days(1), - base::Days(7)); + // The random per-site delay happens to be between (one hour, one day). + ASSERT_GT(state.CalculateSiteStickyTimeDelta("foo.com"), base::Hours(1)); + ASSERT_LT(state.CalculateSiteStickyTimeDelta("foo.com"), base::Days(1)); task_environment_->FastForwardBy(base::Days(1));
diff --git a/components/commerce/core/BUILD.gn b/components/commerce/core/BUILD.gn index da284a3..0e35e061 100644 --- a/components/commerce/core/BUILD.gn +++ b/components/commerce/core/BUILD.gn
@@ -150,6 +150,21 @@ ] } +source_set("heuristics_provider_unittests") { + testonly = true + sources = [ "heuristics/commerce_heuristics_provider_unittest.cc" ] + deps = [ + ":feature_list", + ":heuristics_provider", + "//base", + "//base/test:test_support", + "//components/prefs:test_support", + "//testing/gtest", + "//third_party/re2:re2", + "//url:url", + ] +} + static_library("shopping_service") { sources = [ "bookmark_update_manager.cc",
diff --git a/components/commerce/core/commerce_feature_list.cc b/components/commerce/core/commerce_feature_list.cc index a9db3d53..0d94bbc7 100644 --- a/components/commerce/core/commerce_feature_list.cc +++ b/components/commerce/core/commerce_feature_list.cc
@@ -137,6 +137,10 @@ BASE_FEATURE(kCodeBasedRBD, "CodeBasedRBD", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kChromeCartDomBasedHeuristics, + "ChromeCartDomBasedHeuristics", + base::FEATURE_DISABLED_BY_DEFAULT); + // Params for Discount Consent V2 in the NTP Cart module. const char kNtpChromeCartModuleDiscountConsentNtpVariationParam[] = "discount-consent-ntp-variation";
diff --git a/components/commerce/core/commerce_feature_list.h b/components/commerce/core/commerce_feature_list.h index 5c6c7d75..1e2a26d 100644 --- a/components/commerce/core/commerce_feature_list.h +++ b/components/commerce/core/commerce_feature_list.h
@@ -88,6 +88,9 @@ // Feature flag for Code-based RBD. BASE_DECLARE_FEATURE(kCodeBasedRBD); +// Feature flag for DOM-based heuristics for ChromeCart. +BASE_DECLARE_FEATURE(kChromeCartDomBasedHeuristics); + // Shopping list update interval. constexpr base::FeatureParam<base::TimeDelta> kShoppingListBookmarkpdateIntervalParam( @@ -193,6 +196,31 @@ "" }; +// The following are Feature parameters for DOM-based heuristics for ChromeCart. +constexpr base::FeatureParam<std::string> kAddToCartButtonTextPattern{ + &kChromeCartDomBasedHeuristics, "add-to-cart-text-pattern", + "(add(ed|ing)?( \\w+)* (to (shopping )?(cart|bag|basket))|(for " + "shipping))|(^add$)|(buy now)"}; + +constexpr base::FeatureParam<std::string> kAddToCartButtonTagPattern{ + &kChromeCartDomBasedHeuristics, "add-to-cart-tag-pattern", + "BUTTON, INPUT, A, SPAN"}; + +constexpr base::FeatureParam<int> kAddToCartButtonWidthLimit{ + &kChromeCartDomBasedHeuristics, "add-to-cart-button-width", 700}; + +constexpr base::FeatureParam<int> kAddToCartButtonHeightLimit{ + &kChromeCartDomBasedHeuristics, "add-to-cart-button-height", 100}; + +constexpr base::FeatureParam<base::TimeDelta> kAddToCartButtonActiveTime{ + &kChromeCartDomBasedHeuristics, "add-to-cart-button-active-time", + base::Seconds(5)}; + +constexpr base::FeatureParam<std::string> kSkipHeuristicsDomainPattern{ + &kChromeCartDomBasedHeuristics, "skip-heuristics-domain-pattern", + // This regex does not match anything. + "\\b\\B"}; + // The following are Feature params for Discount user consent v2. // This indicates the Discount Consent v2 variation on the NTP Cart module. enum class DiscountConsentNtpVariation {
diff --git a/components/commerce/core/flag_descriptions.cc b/components/commerce/core/flag_descriptions.cc index ffeb5ff..a8d9a8b9 100644 --- a/components/commerce/core/flag_descriptions.cc +++ b/components/commerce/core/flag_descriptions.cc
@@ -13,4 +13,9 @@ const char kShoppingListName[] = "Shopping List"; const char kShoppingListDescription[] = "Enable shopping list in bookmarks."; +const char kChromeCartDomBasedHeuristicsName[] = + "ChromeCart DOM-based heuristics"; +const char kChromeCartDomBasedHeuristicsDescription[] = + "Enable DOM-based heuristics for ChromeCart."; + } // namespace commerce::flag_descriptions
diff --git a/components/commerce/core/flag_descriptions.h b/components/commerce/core/flag_descriptions.h index 0a44de9..16d7352e 100644 --- a/components/commerce/core/flag_descriptions.h +++ b/components/commerce/core/flag_descriptions.h
@@ -16,6 +16,9 @@ extern const char kShoppingListName[]; extern const char kShoppingListDescription[]; +extern const char kChromeCartDomBasedHeuristicsName[]; +extern const char kChromeCartDomBasedHeuristicsDescription[]; + } // namespace commerce::flag_descriptions #endif // COMPONENTS_COMMERCE_CORE_FLAG_DESCRIPTIONS_H_
diff --git a/components/commerce/core/heuristics/commerce_heuristics_provider.cc b/components/commerce/core/heuristics/commerce_heuristics_provider.cc index aa46f3f..a97768d0 100644 --- a/components/commerce/core/heuristics/commerce_heuristics_provider.cc +++ b/components/commerce/core/heuristics/commerce_heuristics_provider.cc
@@ -4,10 +4,13 @@ #include "components/commerce/core/heuristics/commerce_heuristics_provider.h" +#include <set> + #include "base/feature_list.h" #include "base/json/json_reader.h" #include "base/metrics/field_trial_params.h" #include "base/no_destructor.h" +#include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "build/buildflag.h" #include "components/commerce/core/commerce_feature_list.h" @@ -173,4 +176,48 @@ return PartialMatch(CanonicalURL(url).substr(0, kLengthLimit), *pattern); } +bool IsAddToCartButtonSpec(int height, int width) { + if (height > width) + return false; + int limit_height = commerce::kAddToCartButtonHeightLimit.Get(); + int limit_width = commerce::kAddToCartButtonWidthLimit.Get(); + if (width > limit_width || height > limit_height) { + return false; + } + return true; +} + +bool IsAddToCartButtonTag(const std::string& tag) { + static re2::RE2::Options options; + options.set_case_sensitive(false); + static base::NoDestructor<std::set<std::string>> set([] { + std::vector<std::string> tags = + base::SplitString(commerce::kAddToCartButtonTagPattern.Get(), ",", + base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + std::set<std::string> set(tags.begin(), tags.end()); + return set; + }()); + + return set->find(tag) != set->end(); +} + +bool IsAddToCartButtonText(const std::string& text) { + static re2::RE2::Options options; + options.set_case_sensitive(false); + static base::NoDestructor<re2::RE2> instance( + commerce::kAddToCartButtonTextPattern.Get(), options); + return PartialMatch(text.substr(0, kLengthLimit), *instance); +} + +bool ShouldUseDOMBasedHeuristics(const GURL& url) { + if (!base::FeatureList::IsEnabled(commerce::kChromeCartDomBasedHeuristics)) { + return false; + } + static re2::RE2::Options options; + options.set_case_sensitive(false); + static base::NoDestructor<re2::RE2> instance( + commerce::kSkipHeuristicsDomainPattern.Get(), options); + return !PartialMatch(eTLDPlusOne(url), *instance); +} + } // namespace commerce_heuristics
diff --git a/components/commerce/core/heuristics/commerce_heuristics_provider.h b/components/commerce/core/heuristics/commerce_heuristics_provider.h index e1c21c2..862beb8 100644 --- a/components/commerce/core/heuristics/commerce_heuristics_provider.h +++ b/components/commerce/core/heuristics/commerce_heuristics_provider.h
@@ -13,6 +13,15 @@ bool IsVisitCart(const GURL& url); // Check if a URL is a checkout page URL. bool IsVisitCheckout(const GURL& url); +// Check if the `width` and `height` could be the spec of an AddToCart button. +bool IsAddToCartButtonSpec(int height, int width); +// Check if the `tag` of a web element could be the tag of an AddToCart button. +bool IsAddToCartButtonTag(const std::string& tag); +// Check if the `text` of a web element could be the text of an AddToCart +// button. +bool IsAddToCartButtonText(const std::string& text); +// Check if we should use DOM-based heuristics for `url`. +bool ShouldUseDOMBasedHeuristics(const GURL& url); } // namespace commerce_heuristics
diff --git a/components/commerce/core/heuristics/commerce_heuristics_provider_unittest.cc b/components/commerce/core/heuristics/commerce_heuristics_provider_unittest.cc new file mode 100644 index 0000000..083cbdd --- /dev/null +++ b/components/commerce/core/heuristics/commerce_heuristics_provider_unittest.cc
@@ -0,0 +1,76 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/commerce/core/heuristics/commerce_heuristics_provider.h" +#include "base/test/scoped_feature_list.h" +#include "components/commerce/core/commerce_feature_list.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace commerce { +namespace { + +const char* kAddToCartButtons[] = { + "Add to cart", + "Add 1 item to Cart", + "Add nike shoes to Cart", + "Add to Bag", + "Add all 4 item to Cart", + "Add for shipping", + "Add", + "Buy Now", +}; + +const char* kNonAddToCartButtons[] = {"Checkout", "Add up", "Move to bag", + "Move to cart", "Add to wishlist"}; + +class CommerceHeuristicsProviderTest : public testing::Test { + public: + void TearDown() override { features_.Reset(); } + + protected: + base::test::ScopedFeatureList features_; +}; + +TEST_F(CommerceHeuristicsProviderTest, TestIsAddToCartButtonSpec) { + features_.InitWithFeaturesAndParameters( + {{kChromeCartDomBasedHeuristics, + {{"add-to-cart-button-width", "100"}, + {"add-to-cart-button-height", "50"}}}}, + {}); + + EXPECT_TRUE(commerce_heuristics::IsAddToCartButtonSpec(50, 100)); + // Wrong shape because height > width. + EXPECT_FALSE(commerce_heuristics::IsAddToCartButtonSpec(10, 5)); + // Too wide. + EXPECT_FALSE(commerce_heuristics::IsAddToCartButtonSpec(50, 120)); + // Too tall. + EXPECT_FALSE(commerce_heuristics::IsAddToCartButtonSpec(60, 100)); +} + +TEST_F(CommerceHeuristicsProviderTest, TestIsAddToCartButtonTag) { + features_.InitAndEnableFeature(kChromeCartDomBasedHeuristics); + + EXPECT_TRUE(commerce_heuristics::IsAddToCartButtonTag("BUTTON")); + EXPECT_TRUE(commerce_heuristics::IsAddToCartButtonTag("INPUT")); + EXPECT_TRUE(commerce_heuristics::IsAddToCartButtonTag("A")); + EXPECT_TRUE(commerce_heuristics::IsAddToCartButtonTag("SPAN")); + + EXPECT_FALSE(commerce_heuristics::IsAddToCartButtonTag("DIV")); + EXPECT_FALSE(commerce_heuristics::IsAddToCartButtonTag("S")); +} + +TEST_F(CommerceHeuristicsProviderTest, TestIsAddToCartButtonText) { + features_.InitAndEnableFeature(kChromeCartDomBasedHeuristics); + + for (auto* str : kAddToCartButtons) { + EXPECT_TRUE(commerce_heuristics::IsAddToCartButtonText(str)); + } + + for (auto* str : kNonAddToCartButtons) { + EXPECT_FALSE(commerce_heuristics::IsAddToCartButtonText(str)); + } +} + +} // namespace +} // namespace commerce
diff --git a/components/metrics/call_stack_profile_metrics_provider.cc b/components/metrics/call_stack_profile_metrics_provider.cc index 120a2e96..01a9e12a 100644 --- a/components/metrics/call_stack_profile_metrics_provider.cc +++ b/components/metrics/call_stack_profile_metrics_provider.cc
@@ -11,6 +11,7 @@ #include "base/check.h" #include "base/feature_list.h" #include "base/no_destructor.h" +#include "base/ranges/algorithm.h" #include "base/synchronization/lock.h" #include "base/thread_annotations.h" #include "base/time/time.h" @@ -78,6 +79,17 @@ void MaybeCollectSerializedProfile(base::TimeTicks profile_start_time, std::string&& serialized_profile); +#if BUILDFLAG(IS_CHROMEOS) + // Returns all the serialized profiles that have been collected but not yet + // retrieved. For thread-safety reasons, returns a copy, so this is an + // expensive function. Fortunately, it's only called during ChromeOS tast + // integration tests. + std::vector<std::string> GetUnretrievedProfiles() { + base::AutoLock scoped_lock(lock_); + return serialized_profiles_; + } +#endif // BUILDFLAG(IS_CHROMEOS) + // Allows testing against the initial state multiple times. void ResetToDefaultStateForTesting(); @@ -225,6 +237,117 @@ PendingProfiles::PendingProfiles() = default; +#if BUILDFLAG(IS_CHROMEOS) +// A class that records the number of minimally-successful profiles received +// over time. In ChromeOS, this is used by the ui.StackSampledMetrics tast +// integration test to confirm that stack-sampled metrics are working on +// all the various ChromeOS boards. +class ReceivedProfileCounter { + public: + static ReceivedProfileCounter* GetInstance(); + + ReceivedProfileCounter(const ReceivedProfileCounter&) = delete; + ReceivedProfileCounter& operator=(const ReceivedProfileCounter&) = delete; + ~ReceivedProfileCounter() = delete; + + // Gets the counts of all successfully collected profiles, broken down by + // process type and thread type. "Successfully collected" is defined pretty + // minimally (we got a couple of frames). + CallStackProfileMetricsProvider::ProcessThreadCount + GetSuccessfullyCollectedCounts(); + + // Given a list of profiles returned from PendingProfiles::RetrieveProfiles(), + // add counts from all the successful profiles in the list to our counts for + // later. + void OnRetrieveProfiles(const std::vector<SampledProfile>& profiles); + + // Allows testing against the initial state multiple times. + void ResetToDefaultStateForTesting(); // IN-TEST + + private: + friend class base::NoDestructor<ReceivedProfileCounter>; + + ReceivedProfileCounter() = default; + + // Returns true if the given profile was success enough to be counted in + // retrieved_successful_counts_. + static bool WasMinimallySuccessful(const SampledProfile& profile); + + mutable base::Lock lock_; + + // Count of successfully-stack-walked SampledProfiles retrieved since startup. + // "success" is defined by WasMinimallySuccessful(). + CallStackProfileMetricsProvider::ProcessThreadCount + retrieved_successful_counts_ GUARDED_BY(lock_); +}; + +// static +ReceivedProfileCounter* ReceivedProfileCounter::GetInstance() { + static base::NoDestructor<ReceivedProfileCounter> instance; + return instance.get(); +} + +// static +bool ReceivedProfileCounter::WasMinimallySuccessful( + const SampledProfile& profile) { + // If we don't have a process or thread, we don't understand the profile. + if (!profile.has_process() || !profile.has_thread()) { + return false; + } + + // Since we can't symbolize the stacks, "successful" here just means that the + // stack has at least 2 frames. (The current instruction pointer should always + // count as one, so two means we had some luck walking the stack.) + const auto& stacks = profile.call_stack_profile().stack(); + return base::ranges::find_if(stacks, + [](const CallStackProfile::Stack& stack) { + return stack.frame_size() >= 2; + }) != stacks.end(); +} + +void ReceivedProfileCounter::OnRetrieveProfiles( + const std::vector<SampledProfile>& profiles) { + base::AutoLock scoped_lock(lock_); + for (const auto& profile : profiles) { + if (WasMinimallySuccessful(profile)) { + ++retrieved_successful_counts_[profile.process()][profile.thread()]; + } + } +} + +CallStackProfileMetricsProvider::ProcessThreadCount +ReceivedProfileCounter::GetSuccessfullyCollectedCounts() { + CallStackProfileMetricsProvider::ProcessThreadCount successful_counts; + + { + base::AutoLock scoped_lock(lock_); + // Start with count of profiles we've already sent + successful_counts = retrieved_successful_counts_; + } + + // And then add in any pending ones. Copying and then deserializing all the + // profiles is expensive, but again, this should only be called during tast + // integration tests. + std::vector<std::string> unretrieved_profiles( + PendingProfiles::GetInstance()->GetUnretrievedProfiles()); + for (const std::string& serialized_profile : unretrieved_profiles) { + SampledProfile profile; + if (profile.ParseFromString(serialized_profile)) { + if (WasMinimallySuccessful(profile)) { + ++successful_counts[profile.process()][profile.thread()]; + } + } + } + + return successful_counts; +} + +void ReceivedProfileCounter::ResetToDefaultStateForTesting() { + base::AutoLock scoped_lock(lock_); + retrieved_successful_counts_.clear(); +} + +#endif // BUILDFLAG(IS_CHROMEOS) } // namespace // CallStackProfileMetricsProvider -------------------------------------------- @@ -292,6 +415,15 @@ GetCpuInterceptorCallbackInstance() = std::move(callback); } +#if BUILDFLAG(IS_CHROMEOS) +// static +CallStackProfileMetricsProvider::ProcessThreadCount +CallStackProfileMetricsProvider::GetSuccessfullyCollectedCounts() { + return ReceivedProfileCounter::GetInstance() + ->GetSuccessfullyCollectedCounts(); +} +#endif + void CallStackProfileMetricsProvider::OnRecordingEnabled() { PendingProfiles::GetInstance()->SetCollectionEnabled(true); } @@ -304,6 +436,9 @@ ChromeUserMetricsExtension* uma_proto) { std::vector<SampledProfile> profiles = PendingProfiles::GetInstance()->RetrieveProfiles(); +#if BUILDFLAG(IS_CHROMEOS) + ReceivedProfileCounter::GetInstance()->OnRetrieveProfiles(profiles); +#endif for (auto& profile : profiles) { // Only heap samples should ever be received if SamplingProfilerReporting is @@ -317,6 +452,10 @@ // static void CallStackProfileMetricsProvider::ResetStaticStateForTesting() { PendingProfiles::GetInstance()->ResetToDefaultStateForTesting(); +#if BUILDFLAG(IS_CHROMEOS) + ReceivedProfileCounter::GetInstance() + ->ResetToDefaultStateForTesting(); // IN-TEST +#endif } } // namespace metrics
diff --git a/components/metrics/call_stack_profile_metrics_provider.h b/components/metrics/call_stack_profile_metrics_provider.h index cf3318d9..fddc5f2 100644 --- a/components/metrics/call_stack_profile_metrics_provider.h +++ b/components/metrics/call_stack_profile_metrics_provider.h
@@ -5,12 +5,15 @@ #ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ #define COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ +#include <map> #include <string> #include "base/callback.h" #include "base/feature_list.h" #include "base/time/time.h" +#include "build/buildflag.h" #include "components/metrics/metrics_provider.h" +#include "third_party/metrics_proto/execution_context.pb.h" #include "third_party/metrics_proto/sampled_profile.pb.h" namespace metrics { @@ -28,6 +31,13 @@ using InterceptorCallback = base::RepeatingCallback<void(SampledProfile profile)>; +#if BUILDFLAG(IS_CHROMEOS) + // Count of profiles, brokens down by the Process and Thread type of the + // profile. + using ProcessThreadCount = + std::map<::metrics::Process, std::map<::metrics::Thread, int>>; +#endif + CallStackProfileMetricsProvider(); CallStackProfileMetricsProvider(const CallStackProfileMetricsProvider&) = @@ -57,6 +67,15 @@ // profiling thread. static void SetCpuInterceptorCallbackForTesting(InterceptorCallback callback); +#if BUILDFLAG(IS_CHROMEOS) + // Gets the counts of all successfully collected profiles, broken down by + // process type and thread type. "Successfully collected" is defined pretty + // minimally (we got a couple of frames). Expensive function; intended only + // to be run during ChromeOS tast integration testing, not to be run on end- + // user machines. + static ProcessThreadCount GetSuccessfullyCollectedCounts(); +#endif + // MetricsProvider: void OnRecordingEnabled() override; void OnRecordingDisabled() override;
diff --git a/components/metrics/call_stack_profile_metrics_provider_unittest.cc b/components/metrics/call_stack_profile_metrics_provider_unittest.cc index 190953a..ec9090b 100644 --- a/components/metrics/call_stack_profile_metrics_provider_unittest.cc +++ b/components/metrics/call_stack_profile_metrics_provider_unittest.cc
@@ -8,11 +8,17 @@ #include <utility> #include "base/test/scoped_feature_list.h" +#include "execution_context.pb.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h" namespace metrics { +using ::testing::Eq; +using ::testing::Pair; +using ::testing::UnorderedElementsAre; + // This test fixture enables the feature that // CallStackProfileMetricsProvider depends on to report a profile. class CallStackProfileMetricsProviderTest : public testing::Test { @@ -292,4 +298,166 @@ uma_proto.sampled_profile(1).trigger_event()); } +#if BUILDFLAG(IS_CHROMEOS) + +namespace { + +// Sets |call_stack_profile| up enough to pass WasMinimallySuccessful() +void MakeMinimallySuccessfulCallStackProfile( + CallStackProfile* call_stack_profile) { + CallStackProfile::Stack* stack = call_stack_profile->add_stack(); + CallStackProfile::Location* frame = stack->add_frame(); + frame->set_address(123); + frame->set_module_id_index(1); + frame = stack->add_frame(); + frame->set_address(456); + frame->set_module_id_index(0); +} + +// Makes a minimally successful SampledProfile and sends it to ReceiveProfile. +void RecieveProfile(metrics::Process process, metrics::Thread thread) { + SampledProfile profile; + profile.set_trigger_event(SampledProfile::PERIODIC_COLLECTION); + profile.set_process(process); + profile.set_thread(thread); + MakeMinimallySuccessfulCallStackProfile(profile.mutable_call_stack_profile()); + CallStackProfileMetricsProvider::ReceiveProfile(base::TimeTicks::Now(), + profile); +} + +// Makes a minimally successful SampledProfile and sends it to +// ReceiveSerializedProfile. +void ReceiveSerializedProfile(metrics::Process process, + metrics::Thread thread) { + SampledProfile profile; + profile.set_trigger_event(SampledProfile::PERIODIC_COLLECTION); + profile.set_process(process); + profile.set_thread(thread); + MakeMinimallySuccessfulCallStackProfile(profile.mutable_call_stack_profile()); + std::string serialized_profile; + profile.SerializeToString(&serialized_profile); + CallStackProfileMetricsProvider::ReceiveSerializedProfile( + base::TimeTicks::Now(), /*is_heap_profile=*/false, + std::move(serialized_profile)); +} + +} // namespace + +// Checks that profiles which have been received but not send out are listed +// as successfully collected. +TEST_F(CallStackProfileMetricsProviderTest, + SuccessfullyCollectedOnReceivedNotSent) { + CallStackProfileMetricsProvider provider; + provider.OnRecordingEnabled(); + RecieveProfile(metrics::GPU_PROCESS, metrics::IO_THREAD); + ReceiveSerializedProfile(metrics::GPU_PROCESS, metrics::MAIN_THREAD); + + EXPECT_THAT( + CallStackProfileMetricsProvider::GetSuccessfullyCollectedCounts(), + UnorderedElementsAre( + Pair(Eq(metrics::GPU_PROCESS), + UnorderedElementsAre(Pair(Eq(metrics::IO_THREAD), Eq(1)), + Pair(Eq(metrics::MAIN_THREAD), Eq(1)))))); +} + +// Checks that profiles which have been send out are listed as successfully +// collected. +TEST_F(CallStackProfileMetricsProviderTest, SuccessfullyCollectedOnSent) { + CallStackProfileMetricsProvider provider; + provider.OnRecordingEnabled(); + RecieveProfile(metrics::GPU_PROCESS, metrics::IO_THREAD); + ReceiveSerializedProfile(metrics::BROWSER_PROCESS, metrics::IO_THREAD); + + ChromeUserMetricsExtension uma_proto; + provider.ProvideCurrentSessionData(&uma_proto); + EXPECT_EQ(2, uma_proto.sampled_profile().size()); + + EXPECT_THAT( + CallStackProfileMetricsProvider::GetSuccessfullyCollectedCounts(), + UnorderedElementsAre( + Pair(Eq(metrics::GPU_PROCESS), + UnorderedElementsAre(Pair(Eq(metrics::IO_THREAD), Eq(1)))), + Pair(Eq(metrics::BROWSER_PROCESS), + UnorderedElementsAre(Pair(Eq(metrics::IO_THREAD), Eq(1)))))); +} + +// Checks that profiles which are send and profiles which are unsent are +// correctly summed together. +TEST_F(CallStackProfileMetricsProviderTest, + SuccessfullyCollectedMixedSentUnsent) { + CallStackProfileMetricsProvider provider; + provider.OnRecordingEnabled(); + RecieveProfile(metrics::GPU_PROCESS, metrics::IO_THREAD); + ReceiveSerializedProfile(metrics::BROWSER_PROCESS, metrics::IO_THREAD); + + // Send the first 2 metrics. + ChromeUserMetricsExtension uma_proto; + provider.ProvideCurrentSessionData(&uma_proto); + EXPECT_EQ(2, uma_proto.sampled_profile().size()); + + RecieveProfile(metrics::GPU_PROCESS, metrics::IO_THREAD); + ReceiveSerializedProfile(metrics::BROWSER_PROCESS, metrics::MAIN_THREAD); + + EXPECT_THAT( + CallStackProfileMetricsProvider::GetSuccessfullyCollectedCounts(), + UnorderedElementsAre( + Pair(Eq(metrics::GPU_PROCESS), + UnorderedElementsAre(Pair(Eq(metrics::IO_THREAD), Eq(2)))), + Pair(Eq(metrics::BROWSER_PROCESS), + UnorderedElementsAre(Pair(Eq(metrics::IO_THREAD), Eq(1)), + Pair(Eq(metrics::MAIN_THREAD), Eq(1)))))); +} + +// Checks that "unsuccessful" profiles (profiles with 1 or no stack) are not +// counted. +TEST_F(CallStackProfileMetricsProviderTest, + SuccessfullyCollectedIgnoresUnsuccessful) { + CallStackProfileMetricsProvider provider; + provider.OnRecordingEnabled(); + RecieveProfile(metrics::GPU_PROCESS, metrics::IO_THREAD); + ReceiveSerializedProfile(metrics::GPU_PROCESS, metrics::IO_THREAD); + + { + SampledProfile no_stack_profile; + no_stack_profile.set_trigger_event(SampledProfile::PERIODIC_COLLECTION); + no_stack_profile.set_process(metrics::BROWSER_PROCESS); + no_stack_profile.set_thread(metrics::MAIN_THREAD); + CallStackProfileMetricsProvider::ReceiveProfile(base::TimeTicks::Now(), + no_stack_profile); + std::string serialized_no_stack_profile; + no_stack_profile.SerializeToString(&serialized_no_stack_profile); + CallStackProfileMetricsProvider::ReceiveSerializedProfile( + base::TimeTicks::Now(), /*is_heap_profile=*/false, + std::move(serialized_no_stack_profile)); + } + + { + SampledProfile one_frame_profile; + one_frame_profile.set_trigger_event(SampledProfile::PERIODIC_COLLECTION); + one_frame_profile.set_process(metrics::BROWSER_PROCESS); + one_frame_profile.set_thread(metrics::MAIN_THREAD); + CallStackProfile::Stack* stack = + one_frame_profile.mutable_call_stack_profile()->add_stack(); + CallStackProfile::Location* frame = stack->add_frame(); + frame->set_address(123); + frame->set_module_id_index(1); + CallStackProfileMetricsProvider::ReceiveProfile(base::TimeTicks::Now(), + one_frame_profile); + std::string serialized_one_frame_profile; + one_frame_profile.SerializeToString(&serialized_one_frame_profile); + CallStackProfileMetricsProvider::ReceiveSerializedProfile( + base::TimeTicks::Now(), /*is_heap_profile=*/false, + std::move(serialized_one_frame_profile)); + } + + // All the BROWSER_PROCESS profiles were unsuccessful, so only the GPU_PROCESS + // profiles should be counted. + + EXPECT_THAT(CallStackProfileMetricsProvider::GetSuccessfullyCollectedCounts(), + UnorderedElementsAre(Pair( + Eq(metrics::GPU_PROCESS), + UnorderedElementsAre(Pair(Eq(metrics::IO_THREAD), Eq(2)))))); +} +#endif // BUILDFLAG(IS_CHROMEOS) + } // namespace metrics
diff --git a/components/metrics/structured/external_metrics.cc b/components/metrics/structured/external_metrics.cc index c06d405..4fc868ee 100644 --- a/components/metrics/structured/external_metrics.cc +++ b/components/metrics/structured/external_metrics.cc
@@ -15,6 +15,7 @@ #include "base/task/thread_pool.h" #include "base/threading/scoped_blocking_call.h" #include "base/threading/sequenced_task_runner_handle.h" +#include "components/metrics/structured/histogram_util.h" #include "components/metrics/structured/storage.pb.h" #include "components/metrics/structured/structured_metrics_features.h" @@ -27,18 +28,18 @@ google::protobuf::RepeatedPtrField<metrics::StructuredEventProto>* events) { // Event name hashes of all bluetooth events listed in // src/platform2/metrics/structured/structured.xml. - static constexpr auto kBluetoothEventHashes = base::MakeFixedFlatSet<uint64_t>({ - // BluetoothAdapterStateChanged - UINT64_C(959829856916771459), - // BluetoothPairingStateChanged - UINT64_C(11839023048095184048), - // BluetoothAclConnectionStateChanged - UINT64_C(1880220404408566268), - // BluetoothProfileConnectionStateChanged - UINT64_C(7217682640379679663), - // BluetoothDeviceInfoReport - UINT64_C(1506471670382892394) - }); + static constexpr auto kBluetoothEventHashes = + base::MakeFixedFlatSet<uint64_t>( + {// BluetoothAdapterStateChanged + UINT64_C(959829856916771459), + // BluetoothPairingStateChanged + UINT64_C(11839023048095184048), + // BluetoothAclConnectionStateChanged + UINT64_C(1880220404408566268), + // BluetoothProfileConnectionStateChanged + UINT64_C(7217682640379679663), + // BluetoothDeviceInfoReport + UINT64_C(1506471670382892394)}); if (base::FeatureList::IsEnabled(kBluetoothSessionizedMetrics)) return; @@ -63,11 +64,39 @@ base::FileEnumerator enumerator(directory, false, base::FileEnumerator::FILES); + int file_counter = 0; + for (base::FilePath path = enumerator.Next(); !path.empty(); path = enumerator.Next()) { std::string proto_str; + int64_t file_size; EventsProto proto; + ++file_counter; + + // There may be too many messages in the directory to hold in-memory. This + // could happen if the process in which Structured metrics resides is either + // crash-looping or taking too long to process externally recorded events. + // + // Events will be dropped in that case so that more recent events can be + // processed. + if (file_counter > GetFileLimitPerScan()) { + base::DeleteFile(path); + continue; + } + + // If an event is abnormally large, ignore it to prevent OOM. + bool fs_ok = base::GetFileSize(path, &file_size); + + // If file size get is successful, log the file size. + if (fs_ok) + LogEventFileSizeKB(static_cast<int>(file_size / 1024)); + + if (!fs_ok || file_size > GetFileSizeByteLimit()) { + base::DeleteFile(path); + continue; + } + bool read_ok = base::ReadFileToString(path, &proto_str) && proto.ParseFromString(proto_str); base::DeleteFile(path); @@ -81,6 +110,8 @@ result.mutable_non_uma_events()->MergeFrom(proto.non_uma_events()); } + LogNumFilesPerExternalMetricsScan(file_counter); + MaybeFilterBluetoothEvents(result.mutable_uma_events()); MaybeFilterBluetoothEvents(result.mutable_non_uma_events()); return result;
diff --git a/components/metrics/structured/external_metrics_unittest.cc b/components/metrics/structured/external_metrics_unittest.cc index 4be61595..92089d7 100644 --- a/components/metrics/structured/external_metrics_unittest.cc +++ b/components/metrics/structured/external_metrics_unittest.cc
@@ -10,6 +10,7 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/logging.h" +#include "base/strings/string_number_conversions.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "components/metrics/structured/storage.pb.h" @@ -197,6 +198,31 @@ AssertEqualsTestingProto(proto_.value(), {1, 2, 3}); } +TEST_F(ExternalMetricsTest, FileNumberReadCappedAndDiscarded) { + // Setup feature. + base::test::ScopedFeatureList feature_list; + const int file_limit = 2; + feature_list.InitAndEnableFeatureWithParameters( + kStructuredMetrics, {{"file_limit", base::NumberToString(file_limit)}}); + + Init(); + + // File limit is set to 2. Include third file to test that it is omitted and + // deleted. + WriteToDisk("first", MakeTestingProto({111})); + WriteToDisk("second", MakeTestingProto({222})); + WriteToDisk("third", MakeTestingProto({333})); + + CollectEvents(); + + // Number of events should be capped to the file limit since above records one + // event per file. + ASSERT_EQ(proto_.value().uma_events().size(), file_limit); + + // And the directory should be empty too. + ASSERT_TRUE(base::IsDirectoryEmpty(temp_dir_.GetPath())); +} + // TODO(crbug.com/1148168): Add a test for concurrent reading and writing here // once we know the specifics of how the lock in cros is performed.
diff --git a/components/metrics/structured/histogram_util.cc b/components/metrics/structured/histogram_util.cc index fd5cda4f..0ce0cf8b 100644 --- a/components/metrics/structured/histogram_util.cc +++ b/components/metrics/structured/histogram_util.cc
@@ -4,6 +4,7 @@ #include "components/metrics/structured/histogram_util.h" +#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" namespace metrics { @@ -36,5 +37,15 @@ num_events); } +void LogNumFilesPerExternalMetricsScan(int num_files) { + base::UmaHistogramCounts1000( + "UMA.StructuredMetrics.NumFilesPerExternalMetricsScan", num_files); +} + +void LogEventFileSizeKB(int64_t file_size_kb) { + base::UmaHistogramMemoryKB("UMA.StructuredMetrics.EventFileSize", + file_size_kb); +} + } // namespace structured } // namespace metrics
diff --git a/components/metrics/structured/histogram_util.h b/components/metrics/structured/histogram_util.h index bf60c0a..f8192abd 100644 --- a/components/metrics/structured/histogram_util.h +++ b/components/metrics/structured/histogram_util.h
@@ -73,6 +73,12 @@ // in memory. void LogNumEventsRecordedBeforeInit(int num_events); +// Logs the number of files processed per external metrics scan. +void LogNumFilesPerExternalMetricsScan(int num_files); + +// Logs the file size of an event. +void LogEventFileSizeKB(int64_t file_size_kb); + } // namespace structured } // namespace metrics
diff --git a/components/metrics/structured/structured_metrics_features.cc b/components/metrics/structured/structured_metrics_features.cc index f3a5463..f8c1f40 100644 --- a/components/metrics/structured/structured_metrics_features.cc +++ b/components/metrics/structured/structured_metrics_features.cc
@@ -26,10 +26,23 @@ "DelayUploadUntilHwid", base::FEATURE_DISABLED_BY_DEFAULT); +constexpr base::FeatureParam<int> kLimitFilesPerScanParam{&kStructuredMetrics, + "file_limit", 50}; +constexpr base::FeatureParam<int> kFileSizeByteLimitParam{ + &kStructuredMetrics, "file_byte_limit", 50000}; + bool IsIndependentMetricsUploadEnabled() { return base::GetFieldTrialParamByFeatureAsBool( kStructuredMetrics, "enable_independent_metrics_upload", true); } +int GetFileLimitPerScan() { + return kLimitFilesPerScanParam.Get(); +} + +int GetFileSizeByteLimit() { + return kFileSizeByteLimitParam.Get(); +} + } // namespace structured } // namespace metrics
diff --git a/components/metrics/structured/structured_metrics_features.h b/components/metrics/structured/structured_metrics_features.h index 2d82a4e..7ff8086 100644 --- a/components/metrics/structured/structured_metrics_features.h +++ b/components/metrics/structured/structured_metrics_features.h
@@ -32,6 +32,17 @@ // Once we are comfortable with this change, this parameter can be removed. bool IsIndependentMetricsUploadEnabled(); +// Returns the parameter used to control how many files will be read into memory +// before events start being discarded. +// +// This is to prevent too many files to be read into memory, causing Chrome to +// OOM. +int GetFileLimitPerScan(); + +// Returns the parameter used to control the max size of an event. Any event +// exceeding this memory limit will be discarded. Defaults to 50KB. +int GetFileSizeByteLimit(); + } // namespace structured } // namespace metrics
diff --git a/components/net_log/resources/net_export.js b/components/net_log/resources/net_export.js index 80542c73..cf42c49 100644 --- a/components/net_log/resources/net_export.js +++ b/components/net_log/resources/net_export.js
@@ -7,7 +7,8 @@ import 'chrome://resources/js/ios/web_ui.js'; // </if> -import {addSingletonGetter, addWebUIListener} from 'chrome://resources/js/cr.m.js'; +import {addWebUIListener} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; import {$} from 'chrome://resources/js/util.js'; /**
diff --git a/components/performance_manager/test_support/performance_manager_browsertest_harness.cc b/components/performance_manager/test_support/performance_manager_browsertest_harness.cc index bdf784bd..24424d74 100644 --- a/components/performance_manager/test_support/performance_manager_browsertest_harness.cc +++ b/components/performance_manager/test_support/performance_manager_browsertest_harness.cc
@@ -99,10 +99,9 @@ base::StringPiece console_pattern) { content::WebContentsConsoleObserver console_observer(contents); console_observer.SetPattern(std::string(console_pattern)); - if (!NavigateToURL(contents, url)) - return ::testing::AssertionFailure(); - console_observer.Wait(); - return ::testing::AssertionSuccess(); + if (NavigateToURL(contents, url) && console_observer.Wait()) + return ::testing::AssertionSuccess(); + return ::testing::AssertionFailure(); } namespace {
diff --git a/components/permissions/BUILD.gn b/components/permissions/BUILD.gn index f40a741..ec24ee3c0 100644 --- a/components/permissions/BUILD.gn +++ b/components/permissions/BUILD.gn
@@ -277,8 +277,11 @@ ] } if (is_android) { - sources += - [ "android/permission_prompt/permission_dialog_delegate_unittest.cc" ] + sources += [ + "android/bluetooth_chooser_android_unittest.cc", + "android/bluetooth_scanning_prompt_android_unittest.cc", + "android/permission_prompt/permission_dialog_delegate_unittest.cc", + ] } deps = [ ":permissions", @@ -291,6 +294,7 @@ "//components/content_settings/core/browser", "//components/keyed_service/content", "//components/prefs:test_support", + "//components/security_state/core", "//components/strings:components_strings_grit", "//components/sync_preferences:test_support", "//components/ukm:test_support", @@ -310,6 +314,7 @@ "//components/location/android:location_settings_dialog_enums_java", "//components/location/android:test_support", "//components/permissions/android:test_support", + "//ui/android", ] } }
diff --git a/components/permissions/android/bluetooth_chooser_android.cc b/components/permissions/android/bluetooth_chooser_android.cc index f177106e2..769a3a2e 100644 --- a/components/permissions/android/bluetooth_chooser_android.cc +++ b/components/permissions/android/bluetooth_chooser_android.cc
@@ -6,10 +6,12 @@ #include "base/android/jni_android.h" #include "base/android/jni_string.h" +#include "base/functional/bind.h" #include "base/strings/utf_string_conversions.h" #include "components/permissions/android/bluetooth_chooser_android_delegate.h" #include "components/permissions/android/jni_headers/BluetoothChooserDialog_jni.h" #include "components/permissions/constants.h" +#include "components/permissions/permission_util.h" #include "components/url_formatter/elide_url.h" #include "content/public/browser/render_frame_host.h" #include "ui/android/window_android.h" @@ -22,14 +24,28 @@ namespace permissions { +namespace { + +BluetoothChooserAndroid::CreateJavaDialogCallback +GetCreateJavaBluetoothChooserDialogCallback() { + return base::BindOnce(&Java_BluetoothChooserDialog_create); +} + +} // namespace + BluetoothChooserAndroid::BluetoothChooserAndroid( content::RenderFrameHost* frame, const EventHandler& event_handler, - std::unique_ptr<BluetoothChooserAndroidDelegate> delegate) + std::unique_ptr<BluetoothChooserAndroidDelegate> delegate, + CreateJavaDialogCallback create_java_dialog_callback) : web_contents_(content::WebContents::FromRenderFrameHost(frame)), event_handler_(event_handler), delegate_(std::move(delegate)) { - const url::Origin origin = frame->GetLastCommittedOrigin(); + // Permission delegation means the permission request should be attributed to + // the main frame. + const url::Origin origin = url::Origin::Create( + permissions::PermissionUtil::GetLastCommittedOriginAsURL( + frame->GetMainFrame())); DCHECK(!origin.opaque()); ScopedJavaLocalRef<jobject> window_android = @@ -40,12 +56,22 @@ ScopedJavaLocalRef<jstring> origin_string = base::android::ConvertUTF16ToJavaString( env, url_formatter::FormatOriginForSecurityDisplay(origin)); - java_dialog_.Reset(Java_BluetoothChooserDialog_create( - env, window_android, origin_string, - delegate_->GetSecurityLevel(web_contents_), delegate_->GetJavaObject(), - reinterpret_cast<intptr_t>(this))); + java_dialog_.Reset(std::move(create_java_dialog_callback) + .Run(env, window_android, origin_string, + delegate_->GetSecurityLevel(web_contents_), + delegate_->GetJavaObject(), + reinterpret_cast<intptr_t>(this))); } +BluetoothChooserAndroid::BluetoothChooserAndroid( + content::RenderFrameHost* frame, + const EventHandler& event_handler, + std::unique_ptr<BluetoothChooserAndroidDelegate> delegate) + : BluetoothChooserAndroid(frame, + event_handler, + std::move(delegate), + GetCreateJavaBluetoothChooserDialogCallback()) {} + BluetoothChooserAndroid::~BluetoothChooserAndroid() { if (!java_dialog_.is_null()) { Java_BluetoothChooserDialog_closeDialog(AttachCurrentThread(),
diff --git a/components/permissions/android/bluetooth_chooser_android.h b/components/permissions/android/bluetooth_chooser_android.h index ff5ba2ee..68c9f12 100644 --- a/components/permissions/android/bluetooth_chooser_android.h +++ b/components/permissions/android/bluetooth_chooser_android.h
@@ -7,7 +7,11 @@ #include <memory> +#include "base/android/jni_android.h" +#include "base/android/jni_int_wrapper.h" +#include "base/android/jni_string.h" #include "base/android/scoped_java_ref.h" +#include "base/memory/ptr_util.h" #include "base/memory/raw_ptr.h" #include "content/public/browser/bluetooth_chooser.h" #include "content/public/browser/web_contents.h" @@ -20,6 +24,16 @@ // options. class BluetoothChooserAndroid : public content::BluetoothChooser { public: + // The callback type for creating the java dialog object. + using CreateJavaDialogCallback = + base::OnceCallback<base::android::ScopedJavaLocalRef<jobject>( + JNIEnv*, + const base::android::JavaRef<jobject>&, + const base::android::JavaRef<jstring>&, + JniIntWrapper, + const base::android::JavaRef<jobject>&, + jlong)>; + // Both frame and event_handler must outlive the BluetoothChooserAndroid. BluetoothChooserAndroid( content::RenderFrameHost* frame, @@ -52,8 +66,26 @@ void ShowBluetoothAdapterOffLink(JNIEnv* env); void ShowNeedLocationPermissionLink(JNIEnv* env); + static std::unique_ptr<BluetoothChooserAndroid> CreateForTesting( + content::RenderFrameHost* frame, + const EventHandler& event_handler, + std::unique_ptr<BluetoothChooserAndroidDelegate> delegate, + CreateJavaDialogCallback create_java_dialog_callback) { + // Using `new` to access a non-public constructor. + return base::WrapUnique( + new BluetoothChooserAndroid(frame, event_handler, std::move(delegate), + std::move(create_java_dialog_callback))); + } + private: + BluetoothChooserAndroid( + content::RenderFrameHost* frame, + const EventHandler& event_handler, + std::unique_ptr<BluetoothChooserAndroidDelegate> delegate, + CreateJavaDialogCallback create_java_dialog_callback); + void OpenURL(const char* url); + base::android::ScopedJavaGlobalRef<jobject> java_dialog_; raw_ptr<content::WebContents> web_contents_;
diff --git a/components/permissions/android/bluetooth_chooser_android_unittest.cc b/components/permissions/android/bluetooth_chooser_android_unittest.cc new file mode 100644 index 0000000..4eb6b6f --- /dev/null +++ b/components/permissions/android/bluetooth_chooser_android_unittest.cc
@@ -0,0 +1,75 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/permissions/android/bluetooth_chooser_android.h" + +#include <string> + +#include "base/test/bind.h" +#include "base/test/mock_callback.h" +#include "components/permissions/android/bluetooth_chooser_android_delegate.h" +#include "components/security_state/core/security_state.h" +#include "content/public/browser/web_contents.h" +#include "content/public/test/navigation_simulator.h" +#include "content/public/test/test_renderer_host.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/android/window_android.h" + +namespace permissions { + +namespace { + +using BluetoothChooserAndroidTest = content::RenderViewHostTestHarness; +using testing::_; + +class FakeBluetoothChooserAndroidDelegate + : public BluetoothChooserAndroidDelegate { + base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override { + return base::android::ScopedJavaLocalRef<jobject>(); + } + security_state::SecurityLevel GetSecurityLevel( + content::WebContents* web_contents) override { + return security_state::NONE; + } +}; + +TEST_F(BluetoothChooserAndroidTest, FrameTree) { + NavigateAndCommit(GURL("https://main-frame.com")); + content::RenderFrameHost* subframe = + content::NavigationSimulator::NavigateAndCommitFromDocument( + GURL("https://sub-frame.com"), + content::RenderFrameHostTester::For(main_rfh()) + ->AppendChild("subframe")); + + content::WebContents* web_contents = + content::WebContents::FromRenderFrameHost(main_rfh()); + std::unique_ptr<ui::WindowAndroid::ScopedWindowAndroidForTesting> window = + ui::WindowAndroid::CreateForTesting(); + window.get()->get()->AddChild(web_contents->GetNativeView()); + + base::MockCallback<BluetoothChooserAndroid::CreateJavaDialogCallback> + mock_callback; + auto origin_predicate = + [&](const base::android::JavaRef<jstring>& java_string) { + return base::android::ConvertJavaStringToUTF16( + base::android::AttachCurrentThread(), java_string) == + u"https://main-frame.com"; + }; + EXPECT_CALL(mock_callback, Run(/*env=*/_, /*window_android=*/_, + testing::Truly(origin_predicate), + /*security_level=*/_, /*delegate=*/_, + /*native_bluetooth_chooser_dialog_ptr=*/_)); + + BluetoothChooserAndroid::CreateForTesting( + subframe, + base::BindLambdaForTesting([](content::BluetoothChooserEvent evt, + const std::string& opt_device_id) {}), + std::make_unique<FakeBluetoothChooserAndroidDelegate>(), + mock_callback.Get()); +} + +} // namespace + +} // namespace permissions
diff --git a/components/permissions/android/bluetooth_scanning_prompt_android.cc b/components/permissions/android/bluetooth_scanning_prompt_android.cc index b77beff8..ad4bc952 100644 --- a/components/permissions/android/bluetooth_scanning_prompt_android.cc +++ b/components/permissions/android/bluetooth_scanning_prompt_android.cc
@@ -9,6 +9,7 @@ #include "base/strings/utf_string_conversions.h" #include "components/permissions/android/bluetooth_scanning_prompt_android_delegate.h" #include "components/permissions/android/jni_headers/BluetoothScanningPermissionDialog_jni.h" +#include "components/permissions/permission_util.h" #include "components/url_formatter/elide_url.h" #include "content/public/browser/render_frame_host.h" #include "ui/android/window_android.h" @@ -22,14 +23,28 @@ namespace permissions { +namespace { + +BluetoothScanningPromptAndroid::CreateJavaDialogCallback +GetCreateJavaBluetoothScanningPromptCallback() { + return base::BindOnce(&Java_BluetoothScanningPermissionDialog_create); +} + +} // namespace + BluetoothScanningPromptAndroid::BluetoothScanningPromptAndroid( content::RenderFrameHost* frame, const content::BluetoothScanningPrompt::EventHandler& event_handler, - std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate) + std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate, + CreateJavaDialogCallback create_java_dialog_callback) : web_contents_(content::WebContents::FromRenderFrameHost(frame)), event_handler_(event_handler), delegate_(std::move(delegate)) { - const url::Origin origin = frame->GetLastCommittedOrigin(); + // Permission delegation means the permission request should be attributed to + // the main frame. + const url::Origin origin = url::Origin::Create( + permissions::PermissionUtil::GetLastCommittedOriginAsURL( + frame->GetMainFrame())); DCHECK(!origin.opaque()); ScopedJavaLocalRef<jobject> window_android = @@ -39,12 +54,23 @@ JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jstring> origin_string = ConvertUTF16ToJavaString( env, url_formatter::FormatUrlForSecurityDisplay(origin.GetURL())); - java_dialog_.Reset(Java_BluetoothScanningPermissionDialog_create( - env, window_android, origin_string, - delegate_->GetSecurityLevel(web_contents_), delegate_->GetJavaObject(), - reinterpret_cast<intptr_t>(this))); + java_dialog_.Reset(std::move(create_java_dialog_callback) + .Run(env, window_android, origin_string, + delegate_->GetSecurityLevel(web_contents_), + delegate_->GetJavaObject(), + reinterpret_cast<intptr_t>(this))); } +BluetoothScanningPromptAndroid::BluetoothScanningPromptAndroid( + content::RenderFrameHost* frame, + const content::BluetoothScanningPrompt::EventHandler& event_handler, + std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate) + : BluetoothScanningPromptAndroid( + frame, + event_handler, + std::move(delegate), + GetCreateJavaBluetoothScanningPromptCallback()) {} + BluetoothScanningPromptAndroid::~BluetoothScanningPromptAndroid() { if (!java_dialog_.is_null()) { Java_BluetoothScanningPermissionDialog_closeDialog(AttachCurrentThread(),
diff --git a/components/permissions/android/bluetooth_scanning_prompt_android.h b/components/permissions/android/bluetooth_scanning_prompt_android.h index fc3c89c..5843bf50 100644 --- a/components/permissions/android/bluetooth_scanning_prompt_android.h +++ b/components/permissions/android/bluetooth_scanning_prompt_android.h
@@ -5,6 +5,9 @@ #ifndef COMPONENTS_PERMISSIONS_ANDROID_BLUETOOTH_SCANNING_PROMPT_ANDROID_H_ #define COMPONENTS_PERMISSIONS_ANDROID_BLUETOOTH_SCANNING_PROMPT_ANDROID_H_ +#include "base/android/jni_android.h" +#include "base/android/jni_int_wrapper.h" +#include "base/android/jni_string.h" #include "base/android/scoped_java_ref.h" #include "base/memory/raw_ptr.h" #include "content/public/browser/bluetooth_scanning_prompt.h" @@ -19,6 +22,16 @@ // devices. This implementation is for Android. class BluetoothScanningPromptAndroid : public content::BluetoothScanningPrompt { public: + // The callback type for creating the java dialog object. + using CreateJavaDialogCallback = + base::OnceCallback<base::android::ScopedJavaLocalRef<jobject>( + JNIEnv*, + const base::android::JavaRef<jobject>&, + const base::android::JavaRef<jstring>&, + JniIntWrapper, + const base::android::JavaRef<jobject>&, + jlong)>; + BluetoothScanningPromptAndroid( content::RenderFrameHost* frame, const content::BluetoothScanningPrompt::EventHandler& event_handler, @@ -39,7 +52,24 @@ // Report the dialog's result. void OnDialogFinished(JNIEnv* env, jint event_type); + static std::unique_ptr<BluetoothScanningPromptAndroid> CreateForTesting( + content::RenderFrameHost* frame, + const EventHandler& event_handler, + std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate, + CreateJavaDialogCallback create_java_dialog_callback) { + // Using `new` to access a non-public constructor. + return base::WrapUnique(new BluetoothScanningPromptAndroid( + frame, event_handler, std::move(delegate), + std::move(create_java_dialog_callback))); + } + private: + BluetoothScanningPromptAndroid( + content::RenderFrameHost* frame, + const content::BluetoothScanningPrompt::EventHandler& event_handler, + std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate, + CreateJavaDialogCallback create_java_dialog_callback); + base::android::ScopedJavaGlobalRef<jobject> java_dialog_; raw_ptr<content::WebContents> web_contents_;
diff --git a/components/permissions/android/bluetooth_scanning_prompt_android_unittest.cc b/components/permissions/android/bluetooth_scanning_prompt_android_unittest.cc new file mode 100644 index 0000000..9e2c645 --- /dev/null +++ b/components/permissions/android/bluetooth_scanning_prompt_android_unittest.cc
@@ -0,0 +1,77 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/permissions/android/bluetooth_scanning_prompt_android.h" + +#include <string> + +#include "base/test/bind.h" +#include "base/test/mock_callback.h" +#include "components/permissions/android/bluetooth_scanning_prompt_android_delegate.h" +#include "components/security_state/core/security_state.h" +#include "content/public/browser/bluetooth_scanning_prompt.h" +#include "content/public/browser/web_contents.h" +#include "content/public/test/navigation_simulator.h" +#include "content/public/test/test_renderer_host.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/android/window_android.h" + +namespace permissions { + +namespace { + +using BluetoothScanningPromptAndroidTest = content::RenderViewHostTestHarness; +using testing::_; + +class FakeBluetoothChooserAndroidDelegate + : public BluetoothScanningPromptAndroidDelegate { + base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override { + return base::android::ScopedJavaLocalRef<jobject>(); + } + security_state::SecurityLevel GetSecurityLevel( + content::WebContents* web_contents) override { + return security_state::NONE; + } +}; + +TEST_F(BluetoothScanningPromptAndroidTest, FrameTree) { + NavigateAndCommit(GURL("https://main-frame.com")); + content::RenderFrameHost* subframe = + content::NavigationSimulator::NavigateAndCommitFromDocument( + GURL("https://sub-frame.com"), + content::RenderFrameHostTester::For(main_rfh()) + ->AppendChild("subframe")); + + content::WebContents* web_contents = + content::WebContents::FromRenderFrameHost(main_rfh()); + std::unique_ptr<ui::WindowAndroid::ScopedWindowAndroidForTesting> window = + ui::WindowAndroid::CreateForTesting(); + window.get()->get()->AddChild(web_contents->GetNativeView()); + + base::MockCallback<BluetoothScanningPromptAndroid::CreateJavaDialogCallback> + mock_callback; + auto origin_predicate = + [&](const base::android::JavaRef<jstring>& java_string) { + return base::android::ConvertJavaStringToUTF16( + base::android::AttachCurrentThread(), java_string) == + u"https://main-frame.com"; + }; + EXPECT_CALL( + mock_callback, + Run(/*env=*/_, /*window_android=*/_, testing::Truly(origin_predicate), + /*security_level=*/_, /*delegate=*/_, + /*native_bluetooth_scanning_prompt_dialog_ptr=*/_)); + + BluetoothScanningPromptAndroid::CreateForTesting( + subframe, + base::BindLambdaForTesting( + [](content::BluetoothScanningPrompt::Event evt) {}), + std::make_unique<FakeBluetoothChooserAndroidDelegate>(), + mock_callback.Get()); +} + +} // namespace + +} // namespace permissions
diff --git a/components/policy/resources/webui/policy_base.js b/components/policy/resources/webui/policy_base.js index 822d00e1..80ed2dc 100644 --- a/components/policy/resources/webui/policy_base.js +++ b/components/policy/resources/webui/policy_base.js
@@ -11,7 +11,8 @@ import './status_box.js'; import './policy_table.js'; -import {addSingletonGetter, addWebUIListener, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addWebUIListener, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {addSingletonGetter} from 'chrome://resources/js/cr_deprecated.js'; import {FocusOutlineManager} from 'chrome://resources/js/focus_outline_manager.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {$} from 'chrome://resources/js/util.js';
diff --git a/components/printing/browser/print_manager.cc b/components/printing/browser/print_manager.cc index f6a0e125..e04e6897 100644 --- a/components/printing/browser/print_manager.cc +++ b/components/printing/browser/print_manager.cc
@@ -42,6 +42,11 @@ std::move(callback).Run(false); } +void PrintManager::IsPrintingEnabled(IsPrintingEnabledCallback callback) { + // Assume printing is enabled by default. + std::move(callback).Run(true); +} + void PrintManager::ShowInvalidPrinterSettingsError() {} void PrintManager::PrintingFailed(int32_t cookie,
diff --git a/components/printing/browser/print_manager.h b/components/printing/browser/print_manager.h index 109c945..a4699e1 100644 --- a/components/printing/browser/print_manager.h +++ b/components/printing/browser/print_manager.h
@@ -46,6 +46,7 @@ void DidGetPrintedPagesCount(int32_t cookie, uint32_t number_pages) override; void DidPrintDocument(mojom::DidPrintDocumentParamsPtr params, DidPrintDocumentCallback callback) override; + void IsPrintingEnabled(IsPrintingEnabledCallback callback) override; void DidShowPrintDialog() override; void ShowInvalidPrinterSettingsError() override; void PrintingFailed(int32_t cookie,
diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom index 72a4e93..42d9af1 100644 --- a/components/printing/common/print.mojom +++ b/components/printing/common/print.mojom
@@ -332,8 +332,11 @@ PrintFrameContent(PrintFrameContentParams params) => (int32 document_cookie, DidPrintContentParams params); - // Tells the RenderFrame whether printing is enabled or not. - SetPrintingEnabled(bool enabled); + // Message with no arguments and no reply that is used to simply ensure the + // communication channel between the browser and renderer exists. Without the + // connection, PrintViewManager cannot correctly keep track of associated PDF + // renderers. See crbug.com/1251431 for context. + ConnectToPdfRenderer(); // Tells the RenderFrame that printing is done so it can clean up. PrintingDone(bool success); @@ -357,7 +360,7 @@ // rendered pages according to the specified settings. DidGetPrintedPagesCount(int32 cookie, uint32 number_pages); - // Request the default print settings. + // Requests the default print settings. [Sync] GetDefaultPrintSettings() => (PrintParams default_settings); @@ -370,7 +373,11 @@ [Sync] DidPrintDocument(DidPrintDocumentParams params) => (bool completed); - // Request the print settings from the user. This step is about showing + // Asks the browser whether printing is enabled or not. + [Sync] + IsPrintingEnabled() => (bool printing_enabled); + + // Requests the print settings from the user. This step is about showing // UI to the user to select the final print settings. [Sync] ScriptedPrint(ScriptedPrintParams params) => (PrintPagesParams settings); @@ -381,7 +388,7 @@ // Tells the browser printing failed. PrintingFailed(int32 cookie, PrintFailureReason reason); - // Update the current print settings with new |job_settings|. + // Updates the current print settings with new |job_settings|. [EnableIf=enable_print_preview, Sync] UpdatePrintSettings( int32 cookie,
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc index 96c1116ec..27fd729 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -1250,7 +1250,12 @@ bool PrintRenderFrameHelper::IsScriptInitiatedPrintAllowed( blink::WebLocalFrame* frame, bool user_initiated) { - if (!is_printing_enabled_ || !delegate_->IsScriptedPrintEnabled()) + if (!delegate_->IsScriptedPrintEnabled()) + return false; + + bool printing_enabled = false; + GetPrintManagerHost()->IsPrintingEnabled(&printing_enabled); + if (!printing_enabled) return false; // If preview is enabled, then the print dialog is tab modal, and the user @@ -1623,9 +1628,8 @@ DidFinishPrinting(success ? OK : FAIL_PRINT); } -void PrintRenderFrameHelper::SetPrintingEnabled(bool enabled) { - ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr()); - is_printing_enabled_ = enabled; +void PrintRenderFrameHelper::ConnectToPdfRenderer() { + // Deliberately do nothing. } void PrintRenderFrameHelper::PrintNodeUnderContextMenu() {
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h index 51a5497..97151df 100644 --- a/components/printing/renderer/print_render_frame_helper.h +++ b/components/printing/renderer/print_render_frame_helper.h
@@ -269,7 +269,7 @@ void PrintFrameContent(mojom::PrintFrameContentParamsPtr params, PrintFrameContentCallback callback) override; void PrintingDone(bool success) override; - void SetPrintingEnabled(bool enabled) override; + void ConnectToPdfRenderer() override; void PrintNodeUnderContextMenu() override; #if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS) void SnapshotForContentAnalysis( @@ -478,8 +478,6 @@ bool is_print_ready_metafile_sent_ = false; bool ignore_css_margins_ = false; - bool is_printing_enabled_ = true; - // Let the browser process know of a printing failure. Only set to false when // the failure came from the browser in the first place. bool notify_browser_of_print_failure_ = true;
diff --git a/components/printing/test/print_render_frame_helper_browsertest.cc b/components/printing/test/print_render_frame_helper_browsertest.cc index 6c1bb49..f69c5c4 100644 --- a/components/printing/test/print_render_frame_helper_browsertest.cc +++ b/components/printing/test/print_render_frame_helper_browsertest.cc
@@ -314,6 +314,9 @@ std::move(callback).Run(true); is_printed_ = true; } + void IsPrintingEnabled(IsPrintingEnabledCallback callback) override { + std::move(callback).Run(is_printing_enabled_); + } void GetDefaultPrintSettings( GetDefaultPrintSettingsCallback callback) override { printing::mojom::PrintParamsPtr params = @@ -458,6 +461,8 @@ run_loop.Run(); } + void SetPrintingEnabled(bool enabled) { is_printing_enabled_ = enabled; } + // Call with |response| set to true if the user wants to print. // False if the user decides to cancel. void SetPrintDialogUserResponse(bool response) { @@ -500,6 +505,7 @@ raw_ptr<FakePrintPreviewUI> preview_ui_; #endif base::OnceClosure quit_closure_; + bool is_printing_enabled_ = true; // True to simulate user clicking print. False to cancel. bool print_dialog_user_response_ = true; #if BUILDFLAG(ENABLE_TAGGED_PDF) @@ -1150,13 +1156,11 @@ TEST_F(PrintRenderFrameHelperPreviewTest, BlockScriptInitiatedPrinting) { LoadHTML(kHelloWorldHTML); - PrintRenderFrameHelper* print_render_frame_helper = - GetPrintRenderFrameHelper(); - print_render_frame_helper->SetPrintingEnabled(false); + print_manager()->SetPrintingEnabled(false); PrintWithJavaScript(); VerifyPreviewRequest(false); - print_render_frame_helper->SetPrintingEnabled(true); + print_manager()->SetPrintingEnabled(true); PrintWithJavaScript(); VerifyPreviewRequest(true);
diff --git a/components/reporting/proto/BUILD.gn b/components/reporting/proto/BUILD.gn index ccaa7821..8003d08 100644 --- a/components/reporting/proto/BUILD.gn +++ b/components/reporting/proto/BUILD.gn
@@ -41,7 +41,7 @@ proto_deps = [ ":record_constants", ":record_proto", - "//components/reporting/util:status_proto", + "//components/reporting/proto:status_proto", ] } @@ -55,7 +55,7 @@ deps = [ ":record_constants", - "//components/reporting/util:status_proto", + "//components/reporting/proto:status_proto", ] } @@ -89,3 +89,11 @@ sources = [ "synced/pipeline_id.proto" ] } + +proto_library("status_proto") { + # Generate JS so it can be used by chrome extensions + generate_javascript = true + + proto_in_dir = "//" + sources = [ "synced/status.proto" ] +}
diff --git a/components/reporting/proto/synced/health.proto b/components/reporting/proto/synced/health.proto index dc74c33..4f27bde 100644 --- a/components/reporting/proto/synced/health.proto +++ b/components/reporting/proto/synced/health.proto
@@ -9,7 +9,7 @@ package reporting; import "components/reporting/proto/synced/record_constants.proto"; -import "components/reporting/util/status.proto"; +import "components/reporting/proto/synced/status.proto"; // Information about records being removed from a storage queue. message StorageDequeue {
diff --git a/components/reporting/proto/synced/interface.proto b/components/reporting/proto/synced/interface.proto index c72d0635..5d9fac6 100644 --- a/components/reporting/proto/synced/interface.proto +++ b/components/reporting/proto/synced/interface.proto
@@ -10,7 +10,7 @@ import "components/reporting/proto/synced/record_constants.proto"; import "components/reporting/proto/synced/record.proto"; -import "components/reporting/util/status.proto"; +import "components/reporting/proto/synced/status.proto"; // ------------ CLIENT/USER REQUEST AND RESPONSES ----------------- // EnqueueRecordRequest enqueues records for encryption,
diff --git a/components/reporting/storage/BUILD.gn b/components/reporting/storage/BUILD.gn index de56333..0c79a50 100644 --- a/components/reporting/storage/BUILD.gn +++ b/components/reporting/storage/BUILD.gn
@@ -27,9 +27,9 @@ "//base", "//components/reporting/proto:record_constants", "//components/reporting/proto:record_proto", + "//components/reporting/proto:status_proto", "//components/reporting/resources:resource_interface", "//components/reporting/util:status", - "//components/reporting/util:status_proto", ] }
diff --git a/components/reporting/storage/storage.cc b/components/reporting/storage/storage.cc index 6aa76d9..32aca65 100644 --- a/components/reporting/storage/storage.cc +++ b/components/reporting/storage/storage.cc
@@ -66,12 +66,13 @@ // Factory method. static void AsyncProvideUploader( Priority priority, - Storage* storage, + UploaderInterface::AsyncStartUploaderCb async_start_upload_cb, + scoped_refptr<EncryptionModuleInterface> encryption_module, UploaderInterface::UploadReason reason, UploaderInterfaceResultCb start_uploader_cb) { - storage->async_start_upload_cb_.Run( + async_start_upload_cb.Run( (/*need_encryption_key=*/EncryptionModuleInterface::is_enabled() && - storage->encryption_module_->need_encryption_key()) + encryption_module->need_encryption_key()) ? UploaderInterface::UploadReason::KEY_DELIVERY : reason, base::BindOnce(&QueueUploaderInterface::WrapInstantiatedUploader, @@ -696,10 +697,11 @@ StorageQueue::Create( /*options=*/queue_options.second, // Note: the callback below belongs to the Queue and does not - // outlive Storage. + // outlive Storage, so it cannot refer to `storage_` itself! base::BindRepeating(&QueueUploaderInterface::AsyncProvideUploader, /*priority=*/queue_options.first, - base::Unretained(storage_.get())), + storage_->async_start_upload_cb_, + storage_->encryption_module_), storage_->encryption_module_, storage_->compression_module_, base::BindOnce(&StorageInitContext::ScheduleAddQueue, base::Unretained(this),
diff --git a/components/reporting/storage/storage_queue.cc b/components/reporting/storage/storage_queue.cc index 7a65c15..beda370 100644 --- a/components/reporting/storage/storage_queue.cc +++ b/components/reporting/storage/storage_queue.cc
@@ -150,7 +150,7 @@ scoped_refptr<EncryptionModuleInterface> encryption_module, scoped_refptr<CompressionModule> compression_module) : base::RefCountedDeleteOnSequence<StorageQueue>(sequenced_task_runner), - sequenced_task_runner_(std::move(sequenced_task_runner)), + sequenced_task_runner_(sequenced_task_runner), low_priority_task_runner_(base::ThreadPool::CreateSequencedTaskRunner( {base::TaskPriority::BEST_EFFORT, base::MayBlock()})), options_(options), @@ -995,12 +995,9 @@ } void UploadingCompleted(Status status) { - if (!storage_queue_) { - Response(Status(error::UNAVAILABLE, "StorageQueue shut down")); - return; - } - DCHECK_CALLED_ON_VALID_SEQUENCE( - storage_queue_->storage_queue_sequence_checker_); + // Release all files. + files_.clear(); + current_file_ = files_.end(); // If uploader was created, notify it about completion. if (uploader_) { uploader_->Completed(status); @@ -1008,7 +1005,8 @@ // If retry delay is specified, check back after the delay. // If the status was error, or if any events are still there, // retry the upload. - if (!storage_queue_->options_.upload_retry_delay().is_zero()) { + if (storage_queue_ && + !storage_queue_->options_.upload_retry_delay().is_zero()) { ScheduleAfter(storage_queue_->options_.upload_retry_delay(), base::BindOnce( &StorageQueue::CheckBackUpload, storage_queue_, status, @@ -1018,7 +1016,10 @@ void OnCompletion(const Status& status) override { if (!storage_queue_) { - std::move(completion_cb_).Run(Status(error::UNAVAILABLE, "StorageQueue shut down")); + std::move(completion_cb_) + .Run(Status(error::UNAVAILABLE, "StorageQueue shut down")); + files_.clear(); + current_file_ = files_.end(); return; } DCHECK_CALLED_ON_VALID_SEQUENCE( @@ -1027,6 +1028,8 @@ if (!files_.empty()) { const auto count = --(storage_queue_->active_read_operations_); DCHECK_GE(count, 0); + files_.clear(); + current_file_ = files_.end(); } // Respond with the result. std::move(completion_cb_).Run(status); @@ -2048,16 +2051,16 @@ } void StorageQueue::SingleFile::Close() { - if (!handle_) { - // TODO(b/157943192): Restart auto-closing timer. - return; - } - handle_.reset(); is_readonly_ = absl::nullopt; if (buffer_) { buffer_.reset(); memory_resource_->Discard(buffer_size_); } + if (!handle_) { + // TODO(b/157943192): Restart auto-closing timer. + return; + } + handle_.reset(); } void StorageQueue::SingleFile::DeleteWarnIfFailed() { @@ -2088,16 +2091,19 @@ // Empty file, return EOF right away. return Status(error::OUT_OF_RANGE, "End of file"); } - buffer_size_ = std::min(max_buffer_size, RoundUpToFrameSize(size_)); // If no buffer yet, allocate. // TODO(b/157943192): Add buffer management - consider adding an UMA for // tracking the average + peak memory the Storage module is consuming. if (!buffer_) { + const auto buffer_size = + std::min(max_buffer_size, RoundUpToFrameSize(size_)); // Register with resource management. - if (!memory_resource_->Reserve(buffer_size_)) { + if (!memory_resource_->Reserve(buffer_size)) { return Status(error::RESOURCE_EXHAUSTED, "Not enough memory for the read buffer"); } + // Commit memory reservation. + buffer_size_ = buffer_size; buffer_ = std::make_unique<char[]>(buffer_size_); data_start_ = data_end_ = 0; file_position_ = 0;
diff --git a/components/reporting/storage/storage_queue_stress_test.cc b/components/reporting/storage/storage_queue_stress_test.cc index 786367b..b01d03b 100644 --- a/components/reporting/storage/storage_queue_stress_test.cc +++ b/components/reporting/storage/storage_queue_stress_test.cc
@@ -135,10 +135,10 @@ void TearDown() override { ResetTestStorageQueue(); // Make sure all memory is deallocated. - ASSERT_THAT(options_.memory_resource()->GetUsed(), Eq(0u)); + EXPECT_THAT(options_.memory_resource()->GetUsed(), Eq(0u)); // Make sure all disk is not reserved (files remain, but Storage is not // responsible for them anymore). - ASSERT_THAT(options_.disk_space_resource()->GetUsed(), Eq(0u)); + EXPECT_THAT(options_.disk_space_resource()->GetUsed(), Eq(0u)); } void CreateTestStorageQueueOrDie(const QueueOptions& options) {
diff --git a/components/reporting/storage/storage_queue_unittest.cc b/components/reporting/storage/storage_queue_unittest.cc index 8b3013d..8fd048c1 100644 --- a/components/reporting/storage/storage_queue_unittest.cc +++ b/components/reporting/storage/storage_queue_unittest.cc
@@ -106,10 +106,10 @@ void TearDown() override { ResetTestStorageQueue(); // Make sure all memory is deallocated. - ASSERT_THAT(options_.memory_resource()->GetUsed(), Eq(0u)); + EXPECT_THAT(options_.memory_resource()->GetUsed(), Eq(0u)); // Make sure all disk is not reserved (files remain, but Storage is not // responsible for them anymore). - ASSERT_THAT(options_.disk_space_resource()->GetUsed(), Eq(0u)); + EXPECT_THAT(options_.disk_space_resource()->GetUsed(), Eq(0u)); // Log next uploader id for possible verification. LOG(ERROR) << "Next uploader id=" << next_uploader_id.load(); }
diff --git a/components/reporting/storage/storage_unittest.cc b/components/reporting/storage/storage_unittest.cc index 4c13a32..612cf64a 100644 --- a/components/reporting/storage/storage_unittest.cc +++ b/components/reporting/storage/storage_unittest.cc
@@ -831,12 +831,14 @@ // so we need to wait for all queues to destruct. task_environment_.RunUntilIdle(); } + // Key has already been loaded, no need to redo it next time + // (unless explicitly requested). expect_to_need_key_ = false; // Make sure all memory is deallocated. - ASSERT_THAT(options_.memory_resource()->GetUsed(), Eq(0u)); + EXPECT_THAT(options_.memory_resource()->GetUsed(), Eq(0u)); // Make sure all disk is not reserved (files remain, but Storage is not // responsible for them anymore). - ASSERT_THAT(options_.disk_space_resource()->GetUsed(), Eq(0u)); + EXPECT_THAT(options_.disk_space_resource()->GetUsed(), Eq(0u)); // Handle and reject INIT_RESUME (optionally), in case the storage is // recreated. EXPECT_CALL(set_mock_uploader_expectations_, @@ -2057,18 +2059,29 @@ // Reserve the remaining space to have none available and trigger Records // Shedding - uint64_t temp_used = options_.disk_space_resource()->GetUsed(); - uint64_t temp_total = options_.disk_space_resource()->GetTotal(); - uint64_t to_reserve = temp_total - temp_used; + const uint64_t temp_used = options_.disk_space_resource()->GetUsed(); + const uint64_t temp_total = options_.disk_space_resource()->GetTotal(); + const uint64_t to_reserve = temp_total - temp_used; options_.disk_space_resource()->Reserve(to_reserve); // Write records on a higher priority queue to see if records shedding has any // effect. - const Status write_result_immediate = WriteString(IMMEDIATE, kData[2]); - if (!base::FeatureList::IsEnabled(kReportingStorageDegradationFeature)) { - ASSERT_FALSE(write_result_immediate.ok()); + if (base::FeatureList::IsEnabled(kReportingStorageDegradationFeature)) { + // Write and expect immediate upload. + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::IMMEDIATE_FLUSH))) + .WillOnce( + Invoke([&waiter, this](UploaderInterface::UploadReason reason) { + return TestUploader::SetUp(IMMEDIATE, &waiter, this) + .Required(0, kData[2]) + .Complete(); + })) + .RetiresOnSaturation(); + WriteStringOrDie(IMMEDIATE, kData[2]); } else { - ASSERT_OK(write_result_immediate) << write_result_immediate; + const Status write_result_immediate = WriteString(IMMEDIATE, kData[2]); + ASSERT_FALSE(write_result_immediate.ok()); } // Discard the space reserved @@ -2078,27 +2091,55 @@ // Test Security queue cant_shed_records option TEST_P(StorageTest, RecordsSheddingSecurityCantShedRecords) { // The test will try to write this amount of records. - static constexpr size_t kAmountOfBigRecords = 10; + static constexpr size_t kAmountOfBigRecords = 3u; CreateTestStorageOrDie(BuildTestStorageOptions()); - // This writes enough records to create `kAmountOfBigRecords` files in each - // queue: FAST_BATCH and MANUAL_BATCH + // This writes enough records to create `kAmountOfBigRecords` files in + // SECURITY queue that does not permit shedding. for (size_t i = 0; i < kAmountOfBigRecords; i++) { + // Write and expect immediate uploads. + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::IMMEDIATE_FLUSH))) + .WillOnce( + Invoke([&waiter, i, this](UploaderInterface::UploadReason reason) { + auto uploader = TestUploader::SetUp(SECURITY, &waiter, this); + for (size_t j = 0; j <= i; j++) { + uploader.Required(j, xBigData); + } + return uploader.Complete(); + })) + .RetiresOnSaturation(); WriteStringOrDie(SECURITY, xBigData); } // Reserve the remaining space to have none available and trigger Records - // Shedding + // Shedding. const uint64_t temp_used = options_.disk_space_resource()->GetUsed(); const uint64_t temp_total = options_.disk_space_resource()->GetTotal(); const uint64_t to_reserve = temp_total - temp_used; options_.disk_space_resource()->Reserve(to_reserve); // Write records on a higher priority queue to see if records shedding has no - // effect. - const Status write_result = WriteString(SECURITY, xBigData); - ASSERT_FALSE(write_result.ok()); + // effect. Expect upload even with failure, since there are other records in + // the queue. + { + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::IMMEDIATE_FLUSH))) + .WillOnce( + Invoke([&waiter, this](UploaderInterface::UploadReason reason) { + auto uploader = TestUploader::SetUp(SECURITY, &waiter, this); + for (size_t j = 0; j < kAmountOfBigRecords; j++) { + uploader.Required(j, xBigData); + } + return uploader.Complete(); + })) + .RetiresOnSaturation(); + const Status write_result = WriteString(SECURITY, xBigData); + ASSERT_FALSE(write_result.ok()); + } // Discard the space reserved options_.disk_space_resource()->Discard(to_reserve);
diff --git a/components/reporting/util/BUILD.gn b/components/reporting/util/BUILD.gn index 50f5ab0..b84eaa4b 100644 --- a/components/reporting/util/BUILD.gn +++ b/components/reporting/util/BUILD.gn
@@ -26,14 +26,6 @@ ] } -proto_library("status_proto") { - # Generate JS so it can be used by chrome extensions - generate_javascript = true - - proto_in_dir = "//" - sources = [ "status.proto" ] -} - static_library("status") { sources = [ "status.cc", @@ -41,7 +33,7 @@ "statusor.cc", "statusor.h", ] - public_deps = [ ":status_proto" ] + public_deps = [ "//components/reporting/proto:status_proto" ] deps = [ "//base" ] } @@ -100,11 +92,11 @@ ":file", ":status", ":status_macros", - ":status_proto", ":task_runner_context", ":test_callbacks_support", "//base", "//base/test:test_support", + "//components/reporting/proto:status_proto", "//testing/gmock", "//testing/gtest", ]
diff --git a/components/reporting/util/status.cc b/components/reporting/util/status.cc index 0b2fddb..f3e4e53b 100644 --- a/components/reporting/util/status.cc +++ b/components/reporting/util/status.cc
@@ -11,7 +11,7 @@ #include "base/no_destructor.h" #include "base/strings/strcat.h" -#include "components/reporting/util/status.pb.h" +#include "components/reporting/proto/synced/status.pb.h" namespace reporting { namespace error {
diff --git a/components/reporting/util/status.h b/components/reporting/util/status.h index 0a64a16..da771ad6 100644 --- a/components/reporting/util/status.h +++ b/components/reporting/util/status.h
@@ -10,7 +10,7 @@ #include <string> #include "base/strings/string_piece.h" -#include "components/reporting/util/status.pb.h" +#include "components/reporting/proto/synced/status.pb.h" namespace reporting { namespace error {
diff --git a/components/reporting/util/status_unittest.cc b/components/reporting/util/status_unittest.cc index c5b735b..6f867fa0 100644 --- a/components/reporting/util/status_unittest.cc +++ b/components/reporting/util/status_unittest.cc
@@ -8,7 +8,7 @@ #include <utility> #include "base/logging.h" -#include "components/reporting/util/status.pb.h" +#include "components/reporting/proto/synced/status.pb.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/safe_browsing/core/common/features.cc b/components/safe_browsing/core/common/features.cc index 9a266de7..6abf03c 100644 --- a/components/safe_browsing/core/common/features.cc +++ b/components/safe_browsing/core/common/features.cc
@@ -152,6 +152,10 @@ "SafeBrowsingRealTimeUrlLookupForEnterpriseAllowlistBypass", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kSafeBrowsingCsbrrNewDownloadTrigger, + "SafeBrowsingCsbrrNewDownloadTrigger", + base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kSafeBrowsingCsbrrWithToken, "SafeBrowsingCsbrrWithToken", base::FEATURE_DISABLED_BY_DEFAULT); @@ -242,6 +246,7 @@ {&kNestedArchives, true}, {&kOmitNonUserGesturesFromReferrerChain, true}, {&kRealTimeUrlLookupForEnterpriseAllowlistBypass, true}, + {&kSafeBrowsingCsbrrNewDownloadTrigger, true}, {&kSafeBrowsingCsbrrWithToken, true}, {&kSafeBrowsingDisableConsumerCsdForEnterprise, true}, {&kSafeBrowsingEnterpriseCsd, true},
diff --git a/components/safe_browsing/core/common/features.h b/components/safe_browsing/core/common/features.h index 576c2d2..ab09133c 100644 --- a/components/safe_browsing/core/common/features.h +++ b/components/safe_browsing/core/common/features.h
@@ -139,6 +139,10 @@ // Bypass RealTime URL Lookup allowlist for enterprise users. BASE_DECLARE_FEATURE(kRealTimeUrlLookupForEnterpriseAllowlistBypass); +// Controls whether download Client Safe Browsing Reports are sent under the +// new triggers +BASE_DECLARE_FEATURE(kSafeBrowsingCsbrrNewDownloadTrigger); + // Controls whether Client Safe Browsing Reports are sent with a GAIA-tied token // for Enhanced Safe Browsing users BASE_DECLARE_FEATURE(kSafeBrowsingCsbrrWithToken);
diff --git a/components/services/app_service/app_service_mojom_impl.cc b/components/services/app_service/app_service_mojom_impl.cc index 9fde9b82..500c94a 100644 --- a/components/services/app_service/app_service_mojom_impl.cc +++ b/components/services/app_service/app_service_mojom_impl.cc
@@ -91,38 +91,7 @@ iter->second->Launch(app_id, event_flags, launch_source, std::move(window_info)); } -void AppServiceMojomImpl::LaunchAppWithFiles( - apps::mojom::AppType app_type, - const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) { - CHECK(file_paths); - auto iter = publishers_.find(app_type); - if (iter == publishers_.end()) { - return; - } - iter->second->LaunchAppWithFiles(app_id, event_flags, launch_source, - std::move(file_paths)); -} -void AppServiceMojomImpl::LaunchAppWithIntent( - apps::mojom::AppType app_type, - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) { - auto iter = publishers_.find(app_type); - if (iter == publishers_.end()) { - std::move(callback).Run(/*success=*/false); - return; - } - iter->second->LaunchAppWithIntent(app_id, event_flags, std::move(intent), - launch_source, std::move(window_info), - std::move(callback)); -} void AppServiceMojomImpl::PauseApp(apps::mojom::AppType app_type, const std::string& app_id) { auto iter = publishers_.find(app_type);
diff --git a/components/services/app_service/app_service_mojom_impl.h b/components/services/app_service/app_service_mojom_impl.h index 1b38f97..5e2e5f2 100644 --- a/components/services/app_service/app_service_mojom_impl.h +++ b/components/services/app_service/app_service_mojom_impl.h
@@ -54,18 +54,6 @@ int32_t event_flags, apps::mojom::LaunchSource launch_source, apps::mojom::WindowInfoPtr window_info) override; - void LaunchAppWithFiles(apps::mojom::AppType app_type, - const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) override; - void LaunchAppWithIntent(apps::mojom::AppType app_type, - const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) override; void PauseApp(apps::mojom::AppType app_type, const std::string& app_id) override; void UnpauseApp(apps::mojom::AppType app_type,
diff --git a/components/services/app_service/public/cpp/publisher_base.cc b/components/services/app_service/public/cpp/publisher_base.cc index 204a95d4..11fbf0e 100644 --- a/components/services/app_service/public/cpp/publisher_base.cc +++ b/components/services/app_service/public/cpp/publisher_base.cc
@@ -102,23 +102,6 @@ } } -void PublisherBase::LaunchAppWithFiles(const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) { - NOTIMPLEMENTED(); -} - -void PublisherBase::LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) { - NOTIMPLEMENTED(); - std::move(callback).Run(/*success=*/false); -} - void PublisherBase::PauseApp(const std::string& app_id) { NOTIMPLEMENTED(); }
diff --git a/components/services/app_service/public/cpp/publisher_base.h b/components/services/app_service/public/cpp/publisher_base.h index 603779a..14b3ed3 100644 --- a/components/services/app_service/public/cpp/publisher_base.h +++ b/components/services/app_service/public/cpp/publisher_base.h
@@ -58,20 +58,6 @@ mojo::Receiver<apps::mojom::Publisher>& receiver() { return receiver_; } private: - // apps::mojom::Publisher overrides. - // DEPRECATED. Prefer passing the files in an Intent through - // LaunchAppWithIntent. - // TODO(crbug.com/1264164): Remove this method. - void LaunchAppWithFiles(const std::string& app_id, - int32_t event_flags, - apps::mojom::LaunchSource launch_source, - apps::mojom::FilePathsPtr file_paths) override; - void LaunchAppWithIntent(const std::string& app_id, - int32_t event_flags, - apps::mojom::IntentPtr intent, - apps::mojom::LaunchSource launch_source, - apps::mojom::WindowInfoPtr window_info, - LaunchAppWithIntentCallback callback) override; void PauseApp(const std::string& app_id) override; void UnpauseApp(const std::string& app_id) override; void StopApp(const std::string& app_id) override;
diff --git a/components/services/app_service/public/mojom/app_service.mojom b/components/services/app_service/public/mojom/app_service.mojom index 14d9ae55..1e1d1b1 100644 --- a/components/services/app_service/public/mojom/app_service.mojom +++ b/components/services/app_service/public/mojom/app_service.mojom
@@ -37,27 +37,6 @@ LaunchSource launch_source, WindowInfo? window_info); - // Launches an app with |app_id| and |file_path|. - // DEPRECATED. Prefer passing the files in an Intent through - // LaunchAppWithIntent. - // TODO(crbug.com/1264164): Remove this method. - LaunchAppWithFiles( - AppType app_type, - string app_id, - int32 event_flags, - LaunchSource launch_source, - FilePaths file_paths); - - // Launches an app with |app_id| and Chrome OS generic |intent| irrespective - // of app platform. Returns whether the app was successfully launched. - LaunchAppWithIntent( - AppType app_type, - string app_id, - int32 event_flags, - Intent intent, - LaunchSource launch_source, - WindowInfo? window_info) => (bool success); - // Pauses an app to stop the current running app, and apply the icon effect. PauseApp( AppType app_type, @@ -128,28 +107,6 @@ LaunchSource launch_source, WindowInfo? window_info); - // Launches an app identified by |app_id| and |file_path|, parameterised by - // |event_flags|. - // DEPRECATED. Prefer passing the files in an Intent through - // LaunchAppWithIntent. - // TODO(crbug.com/1264164): Remove this method. - LaunchAppWithFiles( - string app_id, - int32 event_flags, - LaunchSource launch_source, - FilePaths file_paths); - - // Launches an app identified by |app_id|, with |intent| as a parameter. - // |event_flags| contains launch options (e.g. window disposition). - // |launch_source| contains the source of the launch. - // Returns whether the app was successfully launched. - LaunchAppWithIntent( - string app_id, - int32 event_flags, - Intent intent, - LaunchSource launch_source, - WindowInfo? window_info) => (bool success); - // Requests that the app identified by |app_id| is marked as paused. Paused // apps cannot be launched. Implemented if the publisher supports the pausing // of apps, and otherwise should do nothing.
diff --git a/components/services/screen_ai/proto/proto_convertor_unittest.cc b/components/services/screen_ai/proto/proto_convertor_unittest.cc index ebc8ec5..a740c6cb3 100644 --- a/components/services/screen_ai/proto/proto_convertor_unittest.cc +++ b/components/services/screen_ai/proto/proto_convertor_unittest.cc
@@ -280,11 +280,8 @@ const std::string expected_update( "id=1 dialog (0, 0)-(800, 900) child_ids=2,3\n" - " id=2 button offset_container_id=1 (0, 1)-(2, 3) transform=[ +0.0000 " - "-1.0000 +0.0000 +0.0000 \n" - " +1.0000 +0.0000 +0.0000 +0.0000 \n" - " +0.0000 +0.0000 +1.0000 +0.0000 \n" - " +0.0000 +0.0000 +0.0000 +1.0000 ]\n" + " id=2 button offset_container_id=1 (0, 1)-(2, 3)" + " transform=[ 0 -1 0 0\n 1 0 0 0\n 0 0 1 0\n 0 0 0 1 ]\n" "\n" " id=3 genericContainer offset_container_id=1 (0, 0)-(5, 5) " "role_description=Signature\n");
diff --git a/components/url_formatter/android/BUILD.gn b/components/url_formatter/android/BUILD.gn index 17b9683..f1174a7f 100644 --- a/components/url_formatter/android/BUILD.gn +++ b/components/url_formatter/android/BUILD.gn
@@ -38,7 +38,7 @@ "//third_party/androidx:androidx_core_core_java", "//third_party/androidx:androidx_test_runner_java", "//third_party/junit", - "//url:gurl_android_test_helper_java", + "//url:android_test_helper_java", "//url:gurl_java", ] }
diff --git a/content/browser/browser_interface_binders.cc b/content/browser/browser_interface_binders.cc index 8f915872..68678c0 100644 --- a/content/browser/browser_interface_binders.cc +++ b/content/browser/browser_interface_binders.cc
@@ -1216,7 +1216,6 @@ RenderFrameHost* rfh = RenderFrameHost::FromID(host->GetAncestorRenderFrameHostId()); - CHECK(rfh); map->Add<blink::mojom::NotificationService>(BindNotificationService( rfh, RenderProcessHost::NotificationServiceCreatorType::kDedicatedWorker, host));
diff --git a/content/browser/metrics/histograms_internals_ui.cc b/content/browser/metrics/histograms_internals_ui.cc index bab9359..3bd2298 100644 --- a/content/browser/metrics/histograms_internals_ui.cc +++ b/content/browser/metrics/histograms_internals_ui.cc
@@ -38,6 +38,7 @@ struct JsParams { std::string callback_id; std::string query; + bool include_subprocesses; }; WebUIDataSource* CreateHistogramsHTMLSource() { @@ -72,6 +73,10 @@ // Calls AllowJavascript() and unpacks the passed params. JsParams AllowJavascriptAndUnpackParams(const base::Value::List& args); + // Import histograms, and those from subprocesses if |include_subprocesses| is + // true. + void ImportHistograms(bool include_subprocesses); + HistogramsMonitor histogram_monitor_; }; @@ -87,14 +92,21 @@ params.callback_id = args_list[0].GetString(); if (args_list.size() > 1u && args_list[1].is_string()) params.query = args_list[1].GetString(); + if (args_list.size() > 2u && args_list[2].is_bool()) + params.include_subprocesses = args_list[2].GetBool(); return params; } +void HistogramsMessageHandler::ImportHistograms(bool include_subprocesses) { + base::StatisticsRecorder::ImportProvidedHistograms(); + if (include_subprocesses) + HistogramSynchronizer::FetchHistograms(); +} + void HistogramsMessageHandler::HandleRequestHistograms( const base::Value::List& args) { - base::StatisticsRecorder::ImportProvidedHistograms(); - HistogramSynchronizer::FetchHistograms(); JsParams params = AllowJavascriptAndUnpackParams(args); + ImportHistograms(params.include_subprocesses); base::Value::List histograms_list; for (base::HistogramBase* histogram : base::StatisticsRecorder::Sort(base::StatisticsRecorder::WithName( @@ -110,6 +122,7 @@ void HistogramsMessageHandler::HandleStartMoninoring( const base::Value::List& args) { JsParams params = AllowJavascriptAndUnpackParams(args); + ImportHistograms(params.include_subprocesses); histogram_monitor_.StartMonitoring(params.query); ResolveJavascriptCallback(base::Value(params.callback_id), base::Value("Success")); @@ -117,6 +130,7 @@ void HistogramsMessageHandler::HandleFetchDiff(const base::Value::List& args) { JsParams params = AllowJavascriptAndUnpackParams(args); + ImportHistograms(params.include_subprocesses); base::Value::List histograms_list = histogram_monitor_.GetDiff(); ResolveJavascriptCallback(base::Value(params.callback_id), std::move(histograms_list));
diff --git a/content/browser/metrics/histograms_monitor.cc b/content/browser/metrics/histograms_monitor.cc index ffa777c..cb16102 100644 --- a/content/browser/metrics/histograms_monitor.cc +++ b/content/browser/metrics/histograms_monitor.cc
@@ -6,7 +6,6 @@ #include "base/metrics/histogram_samples.h" #include "base/metrics/statistics_recorder.h" -#include "content/browser/metrics/histogram_synchronizer.h" namespace content { @@ -16,7 +15,6 @@ void HistogramsMonitor::StartMonitoring(const std::string& query) { query_ = query; - FetchHistograms(); histograms_snapshot_.clear(); // Save a snapshot of all current histograms that will be used as a baseline. for (const auto* const histogram : base::StatisticsRecorder::WithName( @@ -27,18 +25,12 @@ } base::Value::List HistogramsMonitor::GetDiff() { - FetchHistograms(); base::StatisticsRecorder::Histograms histograms = base::StatisticsRecorder::Sort(base::StatisticsRecorder::WithName( base::StatisticsRecorder::GetHistograms(), query_)); return GetDiffInternal(histograms); } -void HistogramsMonitor::FetchHistograms() { - base::StatisticsRecorder::ImportProvidedHistograms(); - HistogramSynchronizer::FetchHistograms(); -} - base::Value::List HistogramsMonitor::GetDiffInternal( const base::StatisticsRecorder::Histograms& histograms) { base::Value::List histograms_list;
diff --git a/content/browser/metrics/histograms_monitor.h b/content/browser/metrics/histograms_monitor.h index 7adef63..8dd73a7 100644 --- a/content/browser/metrics/histograms_monitor.h +++ b/content/browser/metrics/histograms_monitor.h
@@ -16,6 +16,11 @@ // This class handles the monitoring feature of chrome://histograms page, // which allows the page to be updated with histograms logged since // the monitoring started. +// +// Note that this class does not handle merging histograms from any +// |HistogramProvider| instances. It also does not handle synchronizing +// histograms from subprocesses. The caller has the responsibility for these +// beforehand. class CONTENT_EXPORT HistogramsMonitor { public: HistogramsMonitor(); @@ -33,11 +38,6 @@ base::Value::List GetDiff(); private: - // Imports histograms from the StatisticsRecorder. - // Also contacts all processes, and gets them to upload to the browser any/all - // changes to histograms. - void FetchHistograms(); - // Gets the difference between the histograms argument and the stored snapshot // recorded in StartMonitoring(). base::Value::List GetDiffInternal(
diff --git a/content/browser/renderer_host/back_forward_cache_impl.cc b/content/browser/renderer_host/back_forward_cache_impl.cc index 1815787..cd1fb6f0 100644 --- a/content/browser/renderer_host/back_forward_cache_impl.cc +++ b/content/browser/renderer_host/back_forward_cache_impl.cc
@@ -1433,6 +1433,15 @@ features::kEnableBackForwardCacheForScreenReader); } +// static +void BackForwardCacheImpl::VlogUnexpectedRendererToBrowserMessage( + const char* interface_name, + uint32_t message_name) { + VLOG(1) << "BackForwardCacheMessageFilter::WillDispatch bad_message" + << "interface_name" << interface_name << "message_name" + << message_name; +} + BackForwardCache::DisabledReason::DisabledReason( content::BackForwardCache::DisabledSource source, content::BackForwardCache::DisabledReasonType id,
diff --git a/content/browser/renderer_host/back_forward_cache_impl.h b/content/browser/renderer_host/back_forward_cache_impl.h index 4e7a1d3e..53c5e57 100644 --- a/content/browser/renderer_host/back_forward_cache_impl.h +++ b/content/browser/renderer_host/back_forward_cache_impl.h
@@ -200,6 +200,15 @@ // Returns whether back/forward cache is enabled for screen reader users. static bool IsScreenReaderAllowed(); + // Log an unexpected message from the renderer. Doing it here so that it is + // grouped with other back/forward cache vlogging and e.g. will show up in + // test logs. `message_name` varies in each build however when a test failure + // occurs, it should be possible to recreate the build and find which message + // corresponds to this the value. + static void VlogUnexpectedRendererToBrowserMessage( + const char* interface_name_, + uint32_t message_name); + // Returns the reasons (if any) why this document and its children cannot // enter the back/forward cache. Depends on the |render_frame_host| and its // children's state. Should only be called after we've navigated away from
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc index 20720259..aba15165 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -539,8 +539,8 @@ return true; } - DLOG(ERROR) << "Received message " << message->name() << " on interface " - << interface_name_ << " from frame in bfcache."; + BackForwardCacheImpl::VlogUnexpectedRendererToBrowserMessage( + interface_name_, message->name()); TRACE_EVENT2( "content", "BackForwardCacheMessageFilter::WillDispatch bad_message",
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h index 7f13a9f5..4616d50e 100644 --- a/content/browser/renderer_host/render_process_host_impl.h +++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -660,7 +660,7 @@ mojo::PendingReceiver<payments::mojom::PaymentManager> receiver) override; // Binds `creator_type`, `origin`, `receiver` and the information obtained - // from the `rfh` to the NotificationService instance owned by + // from the (possibly null) `rfh` to the NotificationService instance owned by // `storage_partition_impl_`, and is used by documents and workers via // BrowserInterfaceBroker. void CreateNotificationService(
diff --git a/content/browser/resources/histograms/histograms_internals.css b/content/browser/resources/histograms/histograms_internals.css index e3d6e7b..f1bc1293 100644 --- a/content/browser/resources/histograms/histograms_internals.css +++ b/content/browser/resources/histograms/histograms_internals.css
@@ -23,6 +23,10 @@ padding-inline-start: 15px; } +#subprocess_checkbox_container { + margin: 16px 0; +} + @media (prefers-color-scheme: dark) { .histogram-header { background-color: rgba(255, 255, 255, 0.1);
diff --git a/content/browser/resources/histograms/histograms_internals.html b/content/browser/resources/histograms/histograms_internals.html index b0cc10d..62e5c8a 100644 --- a/content/browser/resources/histograms/histograms_internals.html +++ b/content/browser/resources/histograms/histograms_internals.html
@@ -27,6 +27,12 @@ Monitoring mode. The page will automatically refresh every 1 second unless you click stop.</p> </div> +<div id="subprocess_checkbox_container"> + <label> + <input type="checkbox" id="subprocess_checkbox" checked> + Include histograms from subprocesses + </label> +</div> <div id="histograms"></div> <template id="histogram-template"> <div>
diff --git a/content/browser/resources/histograms/histograms_internals.ts b/content/browser/resources/histograms/histograms_internals.ts index 9a24e305..bfde103 100644 --- a/content/browser/resources/histograms/histograms_internals.ts +++ b/content/browser/resources/histograms/histograms_internals.ts
@@ -16,10 +16,44 @@ let inMonitoringMode: boolean = false; /** + * Returns a boolean that will be true when histogram from subprocesses should + * be included. + */ +function includeSubprocessMetrics(): boolean { + const checkbox = $('subprocess_checkbox') as HTMLInputElement; + return checkbox.checked; +} + +/** Sends a request to the given handler. */ +function sendRequest(handlerName: string): Promise<any> { + return sendWithPromise(handlerName, getQuery(), includeSubprocessMetrics()); +} + +/** * Initiates the request for histograms. */ function requestHistograms() { - sendWithPromise('requestHistograms', getQuery()).then(addHistograms); + sendRequest('requestHistograms').then(addHistograms); +} + +/** Clears all loaded histograms on the webpage. */ +function clearHistograms(): void { + $('histograms').innerHTML = window.trustedTypes!.emptyHTML; +} + +/** Makes the subprocess checkbox disabled, and sets a tooltip. */ +function disableSubprocessCheckbox(): void { + const subprocessCheckbox = $('subprocess_checkbox') as HTMLInputElement; + subprocessCheckbox.disabled = true; + subprocessCheckbox.title = 'Checkbox is disabled in Monitoring Mode. ' + + 'To enable, switch to Histogram Mode first.'; +} + +/** Makes the subprocess checkbox enabled. */ +function enableSubprocessCheckbox(): void { + const subprocessCheckbox = $('subprocess_checkbox') as HTMLInputElement; + subprocessCheckbox.disabled = false; + subprocessCheckbox.removeAttribute('title'); } /** @@ -27,19 +61,22 @@ * This will get a histogram snapshot as the base to be diffed against. */ function startMonitoring() { - sendWithPromise('startMonitoring', getQuery()).then(fetchDiff); + const stopButton = $('stop') as HTMLButtonElement; + stopButton.disabled = false; + stopButton.textContent = 'Stop'; + disableSubprocessCheckbox(); + clearHistograms(); + sendRequest('startMonitoring').then(fetchDiff); } /** * Schedules the fetching of histogram diff (after 1000ms) and rendering it. - * This will also recursively call the next fetchDiff() to periodically updtate + * This will also recursively call the next fetchDiff() to periodically update * the page. */ function fetchDiff() { fetchDiffScheduler = setTimeout(function() { - sendWithPromise('fetchDiff', getQuery()) - .then(addHistograms) - .then(fetchDiff); + sendRequest('fetchDiff').then(addHistograms).then(fetchDiff); }, 1000); } @@ -73,10 +110,7 @@ inMonitoringMode = true; $('accumulating_section').style.display = 'none'; $('monitoring_section').style.display = 'block'; - $('histograms').innerHTML = window.trustedTypes!.emptyHTML; expandedEntries.clear(); - ($('stop') as HTMLButtonElement).disabled = false; - $('stop').textContent = 'Stop'; startMonitoring(); } @@ -91,7 +125,8 @@ } $('accumulating_section').style.display = 'block'; $('monitoring_section').style.display = 'none'; - $('histograms').innerHTML = window.trustedTypes!.emptyHTML; + clearHistograms(); + enableSubprocessCheckbox(); expandedEntries.clear(); requestHistograms(); } @@ -104,8 +139,9 @@ clearTimeout(fetchDiffScheduler); fetchDiffScheduler = null; } - ($('stop') as HTMLButtonElement).disabled = true; - $('stop').textContent = 'Stopped'; + const stopButton = $('stop') as HTMLButtonElement; + stopButton.disabled = true; + stopButton.textContent = 'Stopped'; } /** @@ -156,7 +192,7 @@ * histograms. */ function addHistograms(histograms: Histogram[]) { - $('histograms').innerHTML = window.trustedTypes!.emptyHTML; + clearHistograms(); // TBD(jar) Write a nice HTML bar chart, with divs an mouse-overs etc. for (const histogram of histograms) { const {name, header, body} = histogram; @@ -219,6 +255,8 @@ $('enable_monitoring').onclick = enableMonitoring; $('disable_monitoring').onclick = disableMonitoring; $('stop').onclick = stopMonitoring; + $('subprocess_checkbox').onclick = requestHistograms; + // Enable calling generateHistogramsAsText() from // histograms_internals_ui_browsertest.js for testing purposes. (document as any).generateHistogramsForTest = generateHistogramsAsText;
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc index bc992f3..15c39148 100644 --- a/content/browser/service_worker/service_worker_version.cc +++ b/content/browser/service_worker/service_worker_version.cc
@@ -23,6 +23,7 @@ #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/observer_list.h" +#include "base/strings/strcat.h" #include "base/strings/utf_string_conversions.h" #include "base/task/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" @@ -201,6 +202,18 @@ return base::Milliseconds(kUpdateDelayParam.Get()); } +const char* FetchHandlerTypeToSuffix( + ServiceWorkerVersion::FetchHandlerType type) { + switch (type) { + case ServiceWorkerVersion::FetchHandlerType::kNoHandler: + return "_NO_HANDLER"; + case ServiceWorkerVersion::FetchHandlerType::kNotSkippable: + return "_NOT_SKIPPABLE"; + case ServiceWorkerVersion::FetchHandlerType::kEmptyFetchHandler: + return "_EMPTY_FETCH_HANDLER"; + } +} + } // namespace constexpr base::TimeDelta ServiceWorkerVersion::kTimeoutTimerDelay; @@ -1252,6 +1265,11 @@ base::UmaHistogramEnumeration( "ServiceWorker.OnStarted.UpdatedFetchHandlerType", fetch_handler_type); + base::UmaHistogramEnumeration( + base::StrCat( + {"ServiceWorker.OnStarted.UpdatedFetchHandlerTypeBySourceType", + FetchHandlerTypeToSuffix(*fetch_handler_type_)}), + fetch_handler_type); } if (!fetch_handler_type_) { set_fetch_handler_type(fetch_handler_type);
diff --git a/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt index 79ca40c..92bea6d 100644 --- a/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt
@@ -150,20 +150,12 @@ ################### # Non-"Skip" expectations go here to suppress regular flakes/failures. -# Flaking on Windows / Intel - # Flaking on Mac / Linux crbug.com/1284424 [ mac ] ContextLost_WebGPUStressRequestDeviceAndRemoveLoop [ RetryOnFailure ] -# Flaking on Nexus 5X - # Flakily not getting WebGL blocked on context loss crbug.com/1143774 [ chromeos chromeos-board-kevin ] ContextLost_WebGLUnblockedAfterUserInitiatedReload [ RetryOnFailure ] -# Flaky for LaCrOS - -# Flaky on Fuchsia - # Failing on android N5 crbug.com/1340755 [ android android-nexus-5 no-passthrough ] ContextLost_WebGL2UnpackImageHeight [ Failure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/gpu_process_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/gpu_process_expectations.txt index cdf6bc4d..5586888 100644 --- a/content/test/gpu/gpu_tests/test_expectations/gpu_process_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/gpu_process_expectations.txt
@@ -121,18 +121,8 @@ crbug.com/1099576 [ mac amd ] GpuProcess_mac_webgl_backgrounded_high_performance [ Failure ] crbug.com/1099576 [ mac intel ] GpuProcess_mac_webgl_backgrounded_high_performance [ Failure ] -# Flakey/slow tests using clang_rt. - -# Flaky Vulkan Loader Timeout - -# Flakey on Lacros FYI bot - crbug.com/1321145 [ fuchsia fuchsia-board-qemu-x64 ] * [ Failure ] -# Flaking on Linux FYI Release - - - ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here # #######################################################################
diff --git a/content/test/gpu/gpu_tests/test_expectations/hardware_accelerated_feature_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/hardware_accelerated_feature_expectations.txt index 46eb81e..d75d99c 100644 --- a/content/test/gpu/gpu_tests/test_expectations/hardware_accelerated_feature_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/hardware_accelerated_feature_expectations.txt
@@ -81,8 +81,6 @@ ################### # Non-"Skip" expectations go here to suppress regular flakes/failures. -# Flakes on Linux Release - ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here # #######################################################################
diff --git a/content/test/gpu/gpu_tests/test_expectations/info_collection_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/info_collection_expectations.txt index 5046a0d4..8b91a1e 100644 --- a/content/test/gpu/gpu_tests/test_expectations/info_collection_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/info_collection_expectations.txt
@@ -84,13 +84,9 @@ # Incorrectly reporting SCALING instead of DIRECT on Win10 w/ UHD 630 GPUs. crbug.com/1079393 [ win intel-0x3e92 ] InfoCollection_direct_composition [ Failure ] -# NVIDIA bots need 456.38+ drivers to use SOFTWARE overlays. - # InfoCollection_basic is flaky on Fuchsia. crbug.com/1154597 [ fuchsia ] InfoCollection_basic [ RetryOnFailure ] -# Flakes on Linux Release - ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here # #######################################################################
diff --git a/content/test/gpu/gpu_tests/test_expectations/maps_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/maps_expectations.txt index 98e2749..152c7866d 100644 --- a/content/test/gpu/gpu_tests/test_expectations/maps_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/maps_expectations.txt
@@ -81,12 +81,9 @@ ################### # Non-"Skip" expectations go here to suppress regular flakes/failures. - # Flaking frequently on Fuchsia and nobody has triaged why. crbug.com/1288217 [ fuchsia ] Maps_maps [ Failure ] -# Flaking frequently on Mac Nvidia. - ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here # #######################################################################
diff --git a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt index 2f2d69d..adc28fb 100644 --- a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt
@@ -271,8 +271,6 @@ # Fails on Nexus 5 - old hardware, won't fix. crbug.com/883500 [ android android-nexus-5 ] Pixel_BackgroundImage [ Failure ] -# Flakes on Nexus 5X. - # Mark all webview tests as RetryOnFailure due to Nexus 5x driver bug. crbug.com/950932 [ android-webview-instrumentation android-nexus-5x ] * [ RetryOnFailure ] @@ -291,9 +289,6 @@ # Producing blank images on Macmini and Macbook Pro crbug.com/974380 [ mac ] Pixel_OffscreenCanvasUnaccelerated2DGPUCompositingWorker [ Failure ] -# Producing incorrect image on Win10 Intel HD 630 and UHD 630 w/ 26.20.100.6912 -# or later drivers. - # Times out on Pixel 4s in webview. crbug.com/1176918 [ android android-pixel-4 android-webview-instrumentation renderer-skia-gl ] Pixel_Video_Context_Loss_VP9 [ Failure ] @@ -302,8 +297,6 @@ # always run on Windows RS3 or above. crbug.com/1066979 [ win ] Pixel_Canvas2DRedBoxHdr10 [ Failure ] -# Failure on win10 capturing a VideoFrame from unaccelerated OffscreenCanvas clears the source canvas - # Flakes on gpu-fyi-try-chromeos-kevin and fuchsia-x64, produces notably different image. crbug.com/1086687 [ chromeos chromeos-board-kevin ] Pixel_PrecisionRoundedCorner [ Failure ] @@ -324,20 +317,6 @@ # Fails on Fuchsia emulators crbug.com/1302427 [ fuchsia fuchsia-board-qemu-x64 ] Pixel_CanvasLowLatencyWebGLAlphaFalse [ Failure ] -# Flaky blank output on ChromeOS - -# Flakes on Mac dual-GPU - -# Failures on Mac FYI arm64 Release (Apple DTK) - -# Flaky timeout on Linux Intel - -# Flakily crashes on Lacros-like Linux configuration. - -# Flaky on Pixel 4 - -# Pixel tests failing to create SwapChains on SkiaRenderer/Vulkan - # WebGPU pixel tests flakily hang in the metal shader compiler on Mac. crbug.com/1268120 [ mac asan ] Pixel_WebGPUToDataURL [ Failure ] @@ -348,13 +327,9 @@ crbug.com/1268144 [ fuchsia fuchsia-board-sherlock renderer-skia-vulkan ] Pixel_BackgroundImage [ Skip ] crbug.com/1268144 [ fuchsia fuchsia-board-sherlock renderer-skia-vulkan ] Pixel_SolidColorBackground [ Skip ] -# Failures in fuchsia-chrome browser - # Pixel_Video_Media_Stream_Incompatible_Stride flakes with SkiaRenderer GL crbug.com/1213542 [ renderer-skia-gl linux nvidia-0x2184 passthrough ] Pixel_Video_Media_Stream_Incompatible_Stride [ RetryOnFailure ] -# Flaky on Pixel 4 Android WebView - # Flaky failures on Win10 AMD RX 5500 XT crbug.com/1288134 [ win10 amd-0x7340 renderer-skia-gl ] Pixel_DirectComposition_Video_VP9_YUY2 [ Failure ] @@ -375,10 +350,6 @@ crbug.com/1290953 [ android android-pixel-4 android-webview-instrumentation ] Pixel_CanvasLowLatency2DDrawImage [ Failure ] crbug.com/1290953 [ android android-pixel-4 android-webview-instrumentation ] Pixel_CanvasLowLatency2DImageData [ Failure ] -# Flaky incorrect rendering on Windows Nvidia 1660 - -# Green images produced on Mac FYI Release (Apple M1) - # Vulkan Swiftshader WebGPU interop - flipped destination image crbug.com/1307787 [ linux renderer-skia-vulkan ] Pixel_VulkanSwiftShader_WebGPUCopyExternalImage* [ Failure ] @@ -392,24 +363,11 @@ # Vulkan Swiftshader WebGPU interop - missing source image crbug.com/1307787 [ linux renderer-skia-vulkan ] Pixel_VulkanSwiftShader_WebGPUImportVideoFrameUnacceleratedOffscreenCanvas [ Failure ] -# Flakes on Android - - -# Flaking on Linux FYI Release (AMD RX 5500 XT) - -# Flakes on Mac Release (Intel) - -# Flakes on Mac (Nvidia) - crbug.com/1345777 [ android ] Pixel_VideoStreamFromWebGLCanvas [ Skip ] # Pixel_VideoStreamFromWebGL* tests sporadically fail on Linux FYI Release (NVIDIA) bot crbug.com/1348002 [ linux nvidia ] Pixel_VideoStreamFromWebGLAlphaCanvas [ Failure ] -# Currently expected to fail on non-rooted devices since minidump collection -# does not work yet, meaning that we can't verify that we crashed exactly once -# as expected. - crbug.com/1372144 [ android android-sm-a135m ] Pixel_CanvasDisplaySRGBAccelerated2D [ Failure ] crbug.com/1372144 [ android android-sm-a135m ] Pixel_CanvasLowLatencyWebGLAlphaFalse [ Failure ] crbug.com/1372141 [ android android-sm-a235m ] Pixel_CanvasLowLatencyWebGLAlphaFalse [ Failure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/power_measurement_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/power_measurement_expectations.txt index 843f0a04..40962c7 100644 --- a/content/test/gpu/gpu_tests/test_expectations/power_measurement_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/power_measurement_expectations.txt
@@ -94,8 +94,6 @@ #crbug.com/941163 [ win10 intel-0x5912 ] Video_720_MP4_Fullscreen [ RetryOnFailure ] #crbug.com/941163 [ win10 intel-0x5912 ] Video_720_MP4_Underlay_Fullscreen [ RetryOnFailure ] -# Flaky on Win10 UHD 630 - ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here # #######################################################################
diff --git a/content/test/gpu/gpu_tests/test_expectations/screenshot_sync_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/screenshot_sync_expectations.txt index 70b4cd7..d75d99c 100644 --- a/content/test/gpu/gpu_tests/test_expectations/screenshot_sync_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/screenshot_sync_expectations.txt
@@ -81,7 +81,6 @@ ################### # Non-"Skip" expectations go here to suppress regular flakes/failures. - ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here # #######################################################################
diff --git a/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt index cd537cd..f7db4e8 100644 --- a/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt
@@ -196,8 +196,6 @@ # Flakes on linux-rel. crbug.com/1216377 [ linux ] TraceTest_Video_Media_Stream_Incompatible_Stride [ RetryOnFailure ] -# New flakes seen on Nexus 5X bot. - # WebGL's accelerated canvas capture is currently only supported on Win, Mac, ChromeOS. crbug.com/1345777 [ android ] WebGLCanvasCaptureTraceTest_VideoStreamFromWebGLCanvas* [ Skip ] crbug.com/1201009 [ linux ] WebGLCanvasCaptureTraceTest_VideoStreamFromWebGLCanvas_OneCopy [ Failure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/webcodecs_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webcodecs_expectations.txt index 83f7191..3550096 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webcodecs_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webcodecs_expectations.txt
@@ -84,11 +84,9 @@ ################### # Non-"Skip" expectations go here to suppress regular flakes/failures. -crbug.com/1208827 [ chromeos-board-amd64-generic ] WebCodecs_Encode_capture_avc1.42001E_prefer-hardware [ RetryOnFailure ] crbug.com/1311091 WebCodecs_WebRTCPeerConnection_* [ Skip ] -crbug.com/1338968 [ android android-nexus-5x ] WebCodecs_TexImage2d_hw_decoder [ Failure ] crbug.com/1371749 [ mac-x86_64 ] WebCodecs_EncodeDecode_offscreen_avc1.42001E_prefer-hardware [ Failure ] #######################################################################
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt index e03a62e..b6566bb 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt
@@ -251,8 +251,6 @@ # New validation was not implemented on the validating command decoder. crbug.com/angleproject/6358 [ no-passthrough ] conformance/programs/program-test.html [ Failure ] -# Flaky timeouts on multiple platforms - at least Linux/Mac/Win - #################### # Win failures # #################### @@ -277,7 +275,6 @@ # Win / AMD - # Recently many tests have become flaky on this configuration, returning # (72, 72, 72) when reading back pixels, rather than the expected values. # Going to try to skip the individual failing tests, rather than adding a @@ -285,8 +282,6 @@ crbug.com/483282 [ angle-d3d11 win amd ] conformance2/rendering/blitframebuffer-stencil-only.html [ Failure ] crbug.com/828984 [ angle-d3d11 win amd ] conformance/renderbuffers/depth-renderbuffer-initialization.html [ RetryOnFailure ] -# AMD texture handling has become flaky. - # Failing on AMD RX 5500 XT crbug.com/1152597 [ win amd-0x7340 angle-d3d11 ] conformance/renderbuffers/framebuffer-state-restoration.html [ Failure ] crbug.com/1152599 [ win amd-0x7340 angle-d3d11 ] conformance/rendering/polygon-offset.html [ Failure ] @@ -388,8 +383,6 @@ crbug.com/angleproject/4242 [ mac passthrough angle-opengl ] conformance2/glsl3/matrix-row-major-dynamic-indexing.html [ Failure ] -# Flakes heavily on many OpenGL configurations - # Regressed in 10.13, still fails in 10.14 crbug.com/774827 [ mojave nvidia-0xfe9 ] deqp/functional/gles3/fborender/resize_03.html [ Failure ] crbug.com/774827 [ mojave nvidia-0xfe9 ] deqp/functional/gles3/shaderindexing/mat_00.html [ Failure ] @@ -445,7 +438,6 @@ crbug.com/1338004 [ mac nvidia-0xfe9 passthrough ] deqp/functional/gles3/multisample/fbo_4_samples.html [ RetryOnFailure ] - # Mac AMD Retina # AMD Radeon HD 8870M (1002:6821) # TODO(kbr): uncomment the following two exepectations after test @@ -467,10 +459,6 @@ crbug.com/642822 [ mac amd ] conformance2/rendering/clipping-wide-points.html [ Failure ] - - - - crbug.com/1278935 [ monterey amd renderer-skia-gl angle-opengl ] deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_00.html [ Failure ] crbug.com/1278935 [ monterey amd renderer-skia-gl angle-opengl ] deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_01.html [ Failure ] crbug.com/1278935 [ monterey amd renderer-skia-gl angle-opengl ] deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_00.html [ Failure ] @@ -572,8 +560,6 @@ # Driver tag doesn't work on the passthrough command decoder because the detected driver version is ANGLE's version. crbug.com/1081978 [ linux intel angle-opengl passthrough ] conformance2/textures/misc/tex-3d-size-limit.html [ Failure ] -# Linux INTEL - # Linux NVIDIA crbug.com/angleproject/5783 [ linux nvidia angle-opengl passthrough ] conformance2/textures/misc/immutable-tex-render-feedback.html [ Failure ] crbug.com/1115314 [ linux nvidia-0x2184 angle-opengl passthrough ] deqp/functional/gles3/fbocompleteness.html [ Failure ] @@ -633,12 +619,8 @@ crbug.com/1175229 [ android android-pixel-4 angle-opengles passthrough ] conformance2/textures/webgl_canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html [ Failure ] crbug.com/1175232 [ android android-pixel-4 angle-opengles passthrough ] conformance2/reading/read-pixels-from-fbo-test.html [ Failure ] - - - crbug.com/1239079 [ android no-passthrough ] conformance2/transform_feedback/too-small-buffers.html [ Failure ] - crbug.com/angleproject/3684 [ android angle-opengles ] conformance2/renderbuffers/multisample-with-full-sample-counts.html [ Failure ] crbug.com/angleproject/3685 [ android angle-opengles ] conformance2/transform_feedback/simultaneous_binding.html [ Failure ] crbug.com/angleproject/3686 [ android angle-opengles ] deqp/functional/gles3/multisample/fbo_4_samples.html [ Failure ] @@ -650,7 +632,6 @@ crbug.com/1215700 [ chromeos no-passthrough ] deqp/functional/gles3/negativetextureapi.html [ Failure ] - crbug.com/1210240 [ chromeos chromeos-board-amd64-generic no-passthrough ] conformance2/textures/canvas_sub_rectangle/tex-2d-r8ui-red_integer-unsigned_byte.html [ Failure ] crbug.com/1210240 [ chromeos chromeos-board-amd64-generic no-passthrough ] conformance2/textures/webgl_canvas/tex-2d-r8ui-red_integer-unsigned_byte.html [ Failure ] crbug.com/1213198 [ chromeos chromeos-board-amd64-generic ] WebglExtension_OVR_multiview2 [ Failure ] @@ -744,7 +725,6 @@ crbug.com/1328444 [ chromeos chromeos-board-kevin ] conformance2/textures/misc/tex-input-validation.html [ Failure ] - crbug.com/1373277 [ chromeos chromeos-board-kevin ] conformance2/textures/video/tex-3d-srgb8-rgb-unsigned_byte.html [ Failure ] # Must investigate ChromeOS failures with passthrough command decoder.
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt index 5ae2c6d..148e77e 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt
@@ -278,13 +278,9 @@ ################### # Non-"Skip" expectations go here to suppress regular flakes/failures. -# Fails on Android Nvidia Tegra driver version 343, passes on 361 -# We don't have tags for specific driver version so just fail all. - # ======================== # Conformance expectations # ======================== -# Fails on all platforms # The validating command decoder suppressions here will not be fixed. crbug.com/angleproject/6245 [ no-passthrough ] conformance/extensions/ext-texture-compression-bptc.html [ Failure ] @@ -318,14 +314,11 @@ crbug.com/951628 [ passthrough ] conformance/rendering/blending.html [ Failure ] - crbug.com/953120 conformance/programs/program-handling.html [ Failure ] # New validation was not implemented on the validating command decoder. crbug.com/angleproject/6358 [ no-passthrough ] conformance/programs/program-test.html [ Failure ] -# Win / AMD / Passthrough command decoder / D3D11 - # Win / Intel / Vulkan / Passthrough command decoder # Technically flaky, but flake rate is too high for RetryOnFailure. # TODO(crbug.com/1276153) uncomment after fix for updated part of test applies @@ -379,17 +372,11 @@ # Possible HLSL compiler bug. crbug.com/478572 [ win angle-d3d9 passthrough ] deqp/data/gles2/shaders/functions.html [ Failure ] -# Win / AMD D3D11 (default) failures - -# Win / AMD D3D9 failures - # Win / AMD RX 5500 XT failures crbug.com/1152597 [ win amd-0x7340 angle-d3d11 ] conformance/renderbuffers/framebuffer-state-restoration.html [ Failure ] crbug.com/1152599 [ win amd-0x7340 angle-d3d11 ] conformance/rendering/polygon-offset.html [ Failure ] crbug.com/1152602 [ win amd-0x7340 angle-d3d11 ] conformance/canvas/drawingbuffer-static-canvas-test.html [ RetryOnFailure ] -# Win / D3D9 failures - # The functions test have been persistently flaky on D3D9 crbug.com/956134 [ win angle-d3d9 ] conformance/extensions/webgl-depth-texture.html [ Failure ] @@ -404,8 +391,6 @@ crbug.com/1362937 [ win amd-0x7340 angle-d3d9 passthrough ] deqp/data/gles2/shaders/conditionals.html [ Failure ] crbug.com/1362937 [ win amd-0x7340 angle-d3d9 passthrough ] deqp/data/gles2/shaders/conversions_matrix_combine.html [ Failure ] -# Vulkan / Win (32-bit) / Passthrough command decoder - # win10 / angle-d3d11 / Passthrough command decoder failures. crbug.com/1378372 [ win10 angle-d3d11 passthrough ] conformance/glsl/bugs/complex-glsl-does-not-crash.html [ Failure ] crbug.com/1378372 [ win10 angle-d3d11 passthrough ] conformance/glsl/misc/shader-uniform-packing-restrictions.html [ Failure ] @@ -419,13 +404,9 @@ crbug.com/1291276 [ win nvidia angle-vulkan passthrough ] conformance/ogles/GL/mod/mod_001_to_008.html [ Failure ] -# Flaky on Win / Passthrough command decoder (both GL and D3D11 backends) - # Fail when ANGLE GLES3 is requested for OOPR and SkiaRenderer. crbug.com/1336736 [ win angle-d3d11 ] conformance/textures/misc/texture-video-transparent.html [ Failure ] - - #################### # Mac failures # #################### @@ -443,8 +424,6 @@ # been made more robust. # crbug.com/735483 [ mac amd release ] conformance/rendering/texture-switch-performance.html [ Failure ] -# Mac Intel ANGLE and native OpenGL - # Mac Retina NVidia failures / flakes crbug.com/996344 [ mac nvidia-0xfe9 ] conformance/glsl/bugs/vector-scalar-arithmetic-inside-loop.html [ Failure ] crbug.com/1321312 [ mac nvidia-0xfe9 no-passthrough ] conformance/glsl/bugs/gl-fragcoord-multisampling-bug.html [ Skip ] @@ -459,8 +438,6 @@ # Mac / Passthrough command decoder / Metal crbug.com/angleproject/6489 [ mac angle-metal passthrough ] conformance/ogles/GL/build/build_009_to_016.html [ Failure ] -# Mac / Passthrough command decoder / Metal / Intel - # Mac / M1 / OpenGL crbug.com/1130703 [ mac apple-apple-m1 passthrough angle-opengl ] conformance/textures/misc/texture-copying-feedback-loops.html [ Failure ] # No active browser window, but no crash stack. @@ -507,7 +484,6 @@ crbug.com/1165751 [ android-marshmallow ] conformance/glsl/bugs/vector-matrix-constructor-scalarization.html [ Failure ] crbug.com/1165751 [ android-nougat ] conformance/glsl/bugs/vector-matrix-constructor-scalarization.html [ Failure ] - # Also flaky on nexus9 non-webview (bug=834933) but can't specify both. crbug.com/352645 [ android ] conformance/textures/video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html [ Failure ] @@ -535,7 +511,6 @@ crbug.com/678850 [ android android-nexus-5 ] conformance/more/functions/vertexAttribPointerBadArgs.html [ Failure ] crbug.com/678850 [ android android-nexus-5 ] conformance/attribs/gl-vertexattribpointer.html [ Failure ] - crbug.com/1357064 [ android android-nexus-5 no-passthrough ] conformance/rendering/blending.html [ Failure ] crbug.com/1359027 [ android android-nexus-5 ] conformance/attribs/gl-enable-vertex-attrib.html [ Failure ] crbug.com/1359027 [ android android-nexus-5 ] conformance/extensions/angle-instanced-arrays.html [ Failure ] @@ -659,8 +634,6 @@ crbug.com/1357064 [ linux intel display-server-wayland no-passthrough ] conformance/rendering/blending.html [ Failure ] -# Flaky tests on Android Nexus 5 - ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here # #######################################################################
diff --git a/content/web_test/browser/web_test_tts_platform.cc b/content/web_test/browser/web_test_tts_platform.cc index 9157598c..99b3239 100644 --- a/content/web_test/browser/web_test_tts_platform.cc +++ b/content/web_test/browser/web_test_tts_platform.cc
@@ -4,7 +4,9 @@ #include "content/web_test/browser/web_test_tts_platform.h" +#include "base/bind.h" #include "base/callback.h" +#include "base/task/sequenced_task_runner.h" #include "content/public/browser/tts_controller.h" // static @@ -29,12 +31,23 @@ const std::string& lang, const content::VoiceData& voice, const content::UtteranceContinuousParameters& params, - base::OnceCallback<void(bool)> on_speak_finished) { - std::move(on_speak_finished).Run(true); + OnSpeakFinishedCallback on_speak_finished) { content::TtsController* controller = content::TtsController::GetInstance(); int len = static_cast<int>(utterance.size()); controller->OnTtsEvent(utterance_id, content::TTS_EVENT_START, 0, len, std::string()); + base::SequencedTaskRunner::GetCurrentDefault()->PostTask( + FROM_HERE, base::BindOnce(&WebTestTtsPlatform::SimulateEndEvent, + base::Unretained(this), utterance_id, len, + std::move(on_speak_finished))); +} + +void WebTestTtsPlatform::SimulateEndEvent( + int utterance_id, + int len, + OnSpeakFinishedCallback on_speak_finished) { + std::move(on_speak_finished).Run(true); + content::TtsController* controller = content::TtsController::GetInstance(); controller->OnTtsEvent(utterance_id, content::TTS_EVENT_END, len, 0, std::string()); }
diff --git a/content/web_test/browser/web_test_tts_platform.h b/content/web_test/browser/web_test_tts_platform.h index c00a4185..7371dd2b 100644 --- a/content/web_test/browser/web_test_tts_platform.h +++ b/content/web_test/browser/web_test_tts_platform.h
@@ -13,6 +13,8 @@ // detailed testing. class WebTestTtsPlatform : public content::TtsPlatform { public: + using OnSpeakFinishedCallback = base::OnceCallback<void(bool)>; + static WebTestTtsPlatform* GetInstance(); WebTestTtsPlatform(const WebTestTtsPlatform&) = delete; @@ -27,7 +29,7 @@ const std::string& lang, const content::VoiceData& voice, const content::UtteranceContinuousParameters& params, - base::OnceCallback<void(bool)> on_speak_finished) override; + OnSpeakFinishedCallback on_speak_finished) override; bool StopSpeaking() override; bool IsSpeaking() override; void GetVoices(std::vector<content::VoiceData>* out_voices) override; @@ -47,6 +49,9 @@ private: WebTestTtsPlatform(); virtual ~WebTestTtsPlatform(); + void SimulateEndEvent(int utterance_id, + int len, + OnSpeakFinishedCallback on_speak_finished); friend struct base::DefaultSingletonTraits<WebTestTtsPlatform>; };
diff --git a/device/bluetooth/floss/bluetooth_device_floss.cc b/device/bluetooth/floss/bluetooth_device_floss.cc index c375fd5..5eedc1d 100644 --- a/device/bluetooth/floss/bluetooth_device_floss.cc +++ b/device/bluetooth/floss/bluetooth_device_floss.cc
@@ -29,6 +29,21 @@ namespace { +// Connection intervals for LE connections. +// The unit for connection interval values are in multiples of 1.25ms. +const int32_t kMinConnectionIntervalLow = 6; +const int32_t kMaxConnectionIntervalLow = 6; +const int32_t kMinConnectionIntervalMedium = 40; +const int32_t kMaxConnectionIntervalMedium = 56; +const int32_t kMinConnectionIntervalHigh = 80; +const int32_t kMaxConnectionIntervalHigh = 100; + +// Default connection latency for LE connections. +const int32_t kDefaultConnectionLatency = 0; + +// Link supervision timeout for LE connections. +const int32_t kDefaultConnectionTimeout = 2000; + void OnCreateBond(DBusResult<bool> ret) { if (ret.has_value() && !*ret) { BLUETOOTH_LOG(ERROR) << "CreateBond returned failure"; @@ -184,7 +199,59 @@ ConnectionLatency connection_latency, base::OnceClosure callback, ErrorCallback error_callback) { - NOTIMPLEMENTED(); + int32_t min_connection_interval = kMinConnectionIntervalMedium; + int32_t max_connection_interval = kMaxConnectionIntervalMedium; + + switch (connection_latency) { + case ConnectionLatency::CONNECTION_LATENCY_LOW: + min_connection_interval = kMinConnectionIntervalLow; + max_connection_interval = kMaxConnectionIntervalLow; + break; + case ConnectionLatency::CONNECTION_LATENCY_MEDIUM: + min_connection_interval = kMinConnectionIntervalMedium; + max_connection_interval = kMaxConnectionIntervalMedium; + break; + case ConnectionLatency::CONNECTION_LATENCY_HIGH: + min_connection_interval = kMinConnectionIntervalHigh; + max_connection_interval = kMaxConnectionIntervalHigh; + break; + default: + NOTREACHED(); + break; + } + + BLUETOOTH_LOG(EVENT) << "Setting LE connection parameters: min=" + << min_connection_interval + << ", max=" << max_connection_interval; + + FlossDBusManager::Get()->GetGattClient()->UpdateConnectionParameters( + base::BindOnce(&BluetoothDeviceFloss::OnSetConnectionLatency, + weak_ptr_factory_.GetWeakPtr(), std::move(callback), + std::move(error_callback)), + GetAddress(), min_connection_interval, max_connection_interval, + kDefaultConnectionLatency, kDefaultConnectionTimeout, + /*min_ce_len=*/min_connection_interval * 2, + /*max_ce_len=*/max_connection_interval * 2); +} + +void BluetoothDeviceFloss::OnSetConnectionLatency(base::OnceClosure callback, + ErrorCallback error_callback, + DBusResult<Void> ret) { + if (!ret.has_value()) { + std::move(error_callback).Run(); + return; + } + + // If we already had a pending call, fail it. + if (pending_set_connection_latency_.has_value()) { + auto& [pending_cb, pending_error_cb] = + pending_set_connection_latency_.value(); + std::move(pending_error_cb).Run(); + pending_set_connection_latency_ = absl::nullopt; + } + + pending_set_connection_latency_ = + std::make_pair(std::move(callback), std::move(error_callback)); } void BluetoothDeviceFloss::Connect( @@ -657,6 +724,9 @@ svc_resolved_ = true; + // Replace the previous gatt services. + gatt_services_.clear(); + for (const auto& service : services) { BLUETOOTH_LOG(EVENT) << "Adding new remote GATT service for device: " << address_; @@ -675,4 +745,28 @@ adapter()->NotifyGattServicesDiscovered(this); } +void BluetoothDeviceFloss::GattConnectionUpdated(std::string address, + int32_t interval, + int32_t latency, + int32_t timeout, + GattStatus status) { + if (address != GetAddress()) + return; + + VLOG(1) << "Gatt connection updated on " << GetAddress() + << " with status=" << static_cast<uint32_t>(status); + + if (pending_set_connection_latency_.has_value()) { + auto& [pending_cb, pending_error_cb] = + pending_set_connection_latency_.value(); + if (status == GattStatus::kSuccess) { + std::move(pending_cb).Run(); + } else { + std::move(pending_error_cb).Run(); + } + + pending_set_connection_latency_ = absl::nullopt; + } +} + } // namespace floss
diff --git a/device/bluetooth/floss/bluetooth_device_floss.h b/device/bluetooth/floss/bluetooth_device_floss.h index 6856097f..7e93916 100644 --- a/device/bluetooth/floss/bluetooth_device_floss.h +++ b/device/bluetooth/floss/bluetooth_device_floss.h
@@ -131,6 +131,11 @@ void GattSearchComplete(std::string address, const std::vector<GattService>& services, GattStatus status) override; + void GattConnectionUpdated(std::string address, + int32_t interval, + int32_t latency, + int32_t timeout, + GattStatus status) override; // Returns the adapter which owns this device instance. BluetoothAdapterFloss* adapter() const { @@ -159,6 +164,9 @@ void TriggerInitDevicePropertiesCallback(); void OnConnectGatt(DBusResult<Void> ret); + void OnSetConnectionLatency(base::OnceClosure callback, + ErrorCallback error_callback, + DBusResult<Void> ret); absl::optional<ConnectCallback> pending_callback_on_connect_profiles_ = absl::nullopt; @@ -166,6 +174,10 @@ absl::optional<base::OnceClosure> pending_callback_on_init_props_ = absl::nullopt; + // Callbacks for a pending |SetConnectionLatency|. + absl::optional<std::pair<base::OnceClosure, ErrorCallback>> + pending_set_connection_latency_ = absl::nullopt; + // Number of pending device properties to initialize int num_pending_properties_ = 0;
diff --git a/device/bluetooth/floss/bluetooth_gatt_connection_floss.cc b/device/bluetooth/floss/bluetooth_gatt_connection_floss.cc index 156d8b5..280b5c44 100644 --- a/device/bluetooth/floss/bluetooth_gatt_connection_floss.cc +++ b/device/bluetooth/floss/bluetooth_gatt_connection_floss.cc
@@ -48,7 +48,23 @@ if (device.address != id_.address) return; + VLOG(2) << "BluetoothGattConnection disconnected for " << device.address; + connected_ = false; } +void BluetoothGattConnectionFloss::GattClientConnectionState( + GattStatus status, + int32_t client_id, + bool connected, + std::string address) { + if (address != id_.address) { + return; + } + + VLOG(2) << "BluetoothGattConnection state change " << address << ": " + << (connected ? "CONNECTED" : "DISCONNECTED"); + connected_ = connected; +} + } // namespace floss
diff --git a/device/bluetooth/floss/bluetooth_gatt_connection_floss.h b/device/bluetooth/floss/bluetooth_gatt_connection_floss.h index 35647e6..50a54a8 100644 --- a/device/bluetooth/floss/bluetooth_gatt_connection_floss.h +++ b/device/bluetooth/floss/bluetooth_gatt_connection_floss.h
@@ -10,6 +10,7 @@ #include "device/bluetooth/bluetooth_gatt_connection.h" #include "device/bluetooth/floss/floss_adapter_client.h" #include "device/bluetooth/floss/floss_dbus_client.h" +#include "device/bluetooth/floss/floss_gatt_client.h" namespace device { class BluetoothAdapter; @@ -20,9 +21,9 @@ // BluetoothGattConnectionFloss is the Floss implementation tracking a Gatt // connection. It observes the adapter client directly to keep track of // connection status. -class BluetoothGattConnectionFloss - : public device::BluetoothGattConnection, - public floss::FlossAdapterClient::Observer { +class BluetoothGattConnectionFloss : public device::BluetoothGattConnection, + public floss::FlossAdapterClient::Observer, + public floss::FlossGattClientObserver { public: explicit BluetoothGattConnectionFloss( scoped_refptr<device::BluetoothAdapter> adapter, @@ -42,6 +43,12 @@ // floss::FlossAdapterClient::Observer overrides. void AdapterDeviceDisconnected(const FlossDeviceId& device) override; + // floss::FlossGattClientObserver overrides. + void GattClientConnectionState(GattStatus status, + int32_t client_id, + bool connected, + std::string address) override; + /// Cached identity of this connection. FlossDeviceId id_;
diff --git a/device/bluetooth/floss/bluetooth_remote_gatt_characteristic_floss.cc b/device/bluetooth/floss/bluetooth_remote_gatt_characteristic_floss.cc index 913650a..6067638 100644 --- a/device/bluetooth/floss/bluetooth_remote_gatt_characteristic_floss.cc +++ b/device/bluetooth/floss/bluetooth_remote_gatt_characteristic_floss.cc
@@ -43,6 +43,7 @@ BluetoothRemoteGattCharacteristicFloss:: ~BluetoothRemoteGattCharacteristicFloss() { + descriptors_.clear(); service_->RemoveObserverForHandle(characteristic_->instance_id); } @@ -75,10 +76,6 @@ return static_cast<device::BluetoothRemoteGattService*>(service_.get()); } -bool BluetoothRemoteGattCharacteristicFloss::IsNotifying() const { - return has_notify_session_; -} - void BluetoothRemoteGattCharacteristicFloss::ReadRemoteCharacteristic( ValueCallback callback) { DCHECK_GE(num_of_reads_in_progress_, 0);
diff --git a/device/bluetooth/floss/bluetooth_remote_gatt_characteristic_floss.h b/device/bluetooth/floss/bluetooth_remote_gatt_characteristic_floss.h index 00ed9d4..4a457e3 100644 --- a/device/bluetooth/floss/bluetooth_remote_gatt_characteristic_floss.h +++ b/device/bluetooth/floss/bluetooth_remote_gatt_characteristic_floss.h
@@ -44,7 +44,6 @@ // device::BluetoothRemoteGattCharacteristic overrides. const std::vector<uint8_t>& GetValue() const override; device::BluetoothRemoteGattService* GetService() const override; - bool IsNotifying() const override; void ReadRemoteCharacteristic(ValueCallback callback) override; void WriteRemoteCharacteristic( const std::vector<uint8_t>& value, @@ -131,9 +130,6 @@ // |service_| so we keep a pointer to it only here. raw_ptr<GattCharacteristic> characteristic_; - // True if there exists a notify session on this handle. - bool has_notify_session_ = false; - // Number of gatt read requests in progress. int num_of_reads_in_progress_ = 0;
diff --git a/device/bluetooth/floss/bluetooth_remote_gatt_service_floss.cc b/device/bluetooth/floss/bluetooth_remote_gatt_service_floss.cc index 046f824..bcc990b 100644 --- a/device/bluetooth/floss/bluetooth_remote_gatt_service_floss.cc +++ b/device/bluetooth/floss/bluetooth_remote_gatt_service_floss.cc
@@ -40,7 +40,10 @@ } } -BluetoothRemoteGattServiceFloss::~BluetoothRemoteGattServiceFloss() = default; +BluetoothRemoteGattServiceFloss::~BluetoothRemoteGattServiceFloss() { + characteristics_.clear(); + included_services_.clear(); +} std::string BluetoothRemoteGattServiceFloss::GetIdentifier() const { return base::StringPrintf("%s/%d", device_->GetAddress().c_str(),
diff --git a/device/bluetooth/floss/floss_gatt_client.cc b/device/bluetooth/floss/floss_gatt_client.cc index dc28151..285fd97 100644 --- a/device/bluetooth/floss/floss_gatt_client.cc +++ b/device/bluetooth/floss/floss_gatt_client.cc
@@ -319,6 +319,20 @@ remote_device, mtu); } +void FlossGattClient::UpdateConnectionParameters( + ResponseCallback<Void> callback, + const std::string& remote_device, + const int32_t min_interval, + const int32_t max_interval, + const int32_t latency, + const int32_t timeout, + const uint16_t min_ce_len, + const uint16_t max_ce_len) { + CallGattMethod<Void>(std::move(callback), gatt::kConnectionParameterUpdate, + client_id_, remote_device, min_interval, max_interval, + latency, timeout, min_ce_len, max_ce_len); +} + void FlossGattClient::Init(dbus::Bus* bus, const std::string& service_name, const int adapter_index) {
diff --git a/device/bluetooth/floss/floss_gatt_client.h b/device/bluetooth/floss/floss_gatt_client.h index 328c8458..196f2dca 100644 --- a/device/bluetooth/floss/floss_gatt_client.h +++ b/device/bluetooth/floss/floss_gatt_client.h
@@ -313,6 +313,16 @@ const std::string& remote_device, const int32_t mtu); + // Update the connection parameters for the given device. + virtual void UpdateConnectionParameters(ResponseCallback<Void> callback, + const std::string& remote_device, + const int32_t min_interval, + const int32_t max_interval, + const int32_t latency, + const int32_t timeout, + const uint16_t min_ce_len, + const uint16_t max_ce_len); + // Initialize the gatt client for the given adapter. void Init(dbus::Bus* bus, const std::string& service_name,
diff --git a/extensions/browser/api/web_request/web_request_permissions.cc b/extensions/browser/api/web_request/web_request_permissions.cc index f9a0c85..bcdf0a8 100644 --- a/extensions/browser/api/web_request/web_request_permissions.cc +++ b/extensions/browser/api/web_request/web_request_permissions.cc
@@ -316,13 +316,19 @@ // Safebrowsing and Chrome Webstore URLs are always protected, i.e. also // for requests from common renderers. + // TODO(crbug.com/1355623): it would be nice to be able to just use + // extension_urls::IsWebstoreDomain for the last two checks here, but the old + // webstore check specifically requires the path to be checked, not just the + // domain. However once the old webstore is turned down we can change it over + // during that cleanup. if (extension_urls::IsWebstoreUpdateUrl(url) || extension_urls::IsBlocklistUpdateUrl(url) || extension_urls::IsSafeBrowsingUrl(url::Origin::Create(url), url.path_piece()) || (url.DomainIs("chrome.google.com") && base::StartsWith(url.path_piece(), "/webstore", - base::CompareCase::SENSITIVE))) { + base::CompareCase::SENSITIVE)) || + url.DomainIs(extension_urls::GetNewWebstoreLaunchURL().host())) { return true; }
diff --git a/extensions/browser/api/web_request/web_request_permissions_unittest.cc b/extensions/browser/api/web_request/web_request_permissions_unittest.cc index 6e04fe0..d39fb613 100644 --- a/extensions/browser/api/web_request/web_request_permissions_unittest.cc +++ b/extensions/browser/api/web_request/web_request_permissions_unittest.cc
@@ -90,6 +90,11 @@ {"https://chrome.google.com/webstore", HIDE_ALL}, {"https://chrome.google.com./webstore", HIDE_ALL}, {"https://chrome.google.com./webstore/", HIDE_ALL}, + {"https://webstore.google.com", HIDE_ALL}, + {"https://webstore.google.com/", HIDE_ALL}, + {"https://webstore.google.com./", HIDE_ALL}, + {"https://webstore.google.com:80/", HIDE_ALL}, + {"https://webstore.google.com/?query", HIDE_ALL}, // Unsupported scheme. {"blob:https://chrome.google.com/fc3f440b-78ed-469f-8af8-7a1717ff39ae", HIDE_ALL},
diff --git a/infra/config/generated/builders/ci/android-pie-x86-fyi-rel-reviver/properties.json b/infra/config/generated/builders/ci/android-pie-x86-fyi-rel-reviver/properties.json deleted file mode 100644 index 9ac5be9..0000000 --- a/infra/config/generated/builders/ci/android-pie-x86-fyi-rel-reviver/properties.json +++ /dev/null
@@ -1,67 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "ci", - "builder": "android-pie-x86-fyi-rel-reviver", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-android-archive", - "builder_group": "chromium.android.fyi", - "execution_mode": "COMPILE_AND_TEST", - "legacy_android_config": { - "config": "x86_builder" - }, - "legacy_chromium_config": { - "apply_configs": [ - "mb" - ], - "build_config": "Release", - "config": "android", - "target_bits": 32, - "target_platform": "android" - }, - "legacy_gclient_config": { - "apply_configs": [ - "android" - ], - "config": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "ci", - "builder": "android-pie-x86-fyi-rel-reviver", - "project": "chromium" - } - ], - "mirroring_builder_group_and_names": [ - { - "builder": "android-pie-x86-fyi-rel-reviver", - "group": "tryserver.chromium.android" - } - ] - } - }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "jobs": 250, - "metrics_project": "chromium-reclient-metrics" - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "chromium.android.fyi", - "recipe": "chromium" -} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/android-pie-x86-fyi-rel-reviver/properties.json b/infra/config/generated/builders/try/android-pie-x86-fyi-rel-reviver/properties.json deleted file mode 100644 index 9fcdec6..0000000 --- a/infra/config/generated/builders/try/android-pie-x86-fyi-rel-reviver/properties.json +++ /dev/null
@@ -1,62 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "ci", - "builder": "android-pie-x86-fyi-rel-reviver", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-android-archive", - "builder_group": "chromium.android.fyi", - "execution_mode": "COMPILE_AND_TEST", - "legacy_android_config": { - "config": "x86_builder" - }, - "legacy_chromium_config": { - "apply_configs": [ - "mb" - ], - "build_config": "Release", - "config": "android", - "target_bits": 32, - "target_platform": "android" - }, - "legacy_gclient_config": { - "apply_configs": [ - "android" - ], - "config": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "ci", - "builder": "android-pie-x86-fyi-rel-reviver", - "project": "chromium" - } - ] - } - }, - "$build/goma": { - "enable_ats": true, - "jobs": 150, - "rpc_extra_params": "?prod", - "server_host": "goma.chromium.org" - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "tryserver.chromium.android", - "recipe": "chromium_trybot" -} \ No newline at end of file
diff --git a/infra/config/generated/luci/commit-queue.cfg b/infra/config/generated/luci/commit-queue.cfg index e124a35..71ab097 100644 --- a/infra/config/generated/luci/commit-queue.cfg +++ b/infra/config/generated/luci/commit-queue.cfg
@@ -754,10 +754,6 @@ includable_only: true } builders { - name: "chromium/try/android-pie-x86-fyi-rel-reviver" - includable_only: true - } - builders { name: "chromium/try/android-pie-x86-rel" includable_only: true }
diff --git a/infra/config/generated/luci/cr-buildbucket.cfg b/infra/config/generated/luci/cr-buildbucket.cfg index 14feb5ba..ae6a8131 100644 --- a/infra/config/generated/luci/cr-buildbucket.cfg +++ b/infra/config/generated/luci/cr-buildbucket.cfg
@@ -29739,95 +29739,6 @@ } } builders { - name: "android-pie-x86-fyi-rel-reviver" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "free_space:standard" - dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.chromium.ci" - dimensions: "ssd:0" - exe { - cipd_package: "infra/chromium/bootstrapper/${platform}" - cipd_version: "latest" - cmd: "bootstrapper" - } - properties: - '{' - ' "$bootstrap/exe": {' - ' "exe": {' - ' "cipd_package": "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",' - ' "cipd_version": "refs/heads/main",' - ' "cmd": [' - ' "luciexe"' - ' ]' - ' }' - ' },' - ' "$bootstrap/properties": {' - ' "properties_file": "infra/config/generated/builders/ci/android-pie-x86-fyi-rel-reviver/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "chromium.android.fyi",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium"' - '}' - priority: 35 - execution_timeout_secs: 18000 - build_numbers: YES - service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" - experiments { - key: "chromium_swarming.expose_merge_script_failures" - value: 100 - } - experiments { - key: "luci.buildbucket.omit_python2" - value: 100 - } - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "ci_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_ci_test_results" - test_results { - predicate { - test_id_regexp: "ninja://chrome/test:telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_ci_test_results" - test_results { - predicate { - test_id_regexp: "(ninja://[^/]*blink_web_tests/.+)|(ninja://[^/]*blink_wpt_tests/.+)" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { name: "android-pie-x86-rel" swarming_host: "chromium-swarm.appspot.com" dimensions: "builderless:1" @@ -54365,6 +54276,13 @@ ' {' ' "builder_id": {' ' "bucket": "ci",' + ' "builder": "android-pie-x86-rel",' + ' "project": "chromium"' + ' }' + ' },' + ' {' + ' "builder_id": {' + ' "bucket": "ci",' ' "builder": "android-12-x64-rel",' ' "project": "chromium"' ' }' @@ -59604,116 +59522,6 @@ } } builders { - name: "android-pie-x86-fyi-rel-reviver" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.chromium.try" - dimensions: "ssd:0" - exe { - cipd_package: "infra/chromium/bootstrapper/${platform}" - cipd_version: "latest" - cmd: "bootstrapper" - } - properties: - '{' - ' "$bootstrap/exe": {' - ' "exe": {' - ' "cipd_package": "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",' - ' "cipd_version": "refs/heads/main",' - ' "cmd": [' - ' "luciexe"' - ' ]' - ' }' - ' },' - ' "$bootstrap/properties": {' - ' "properties_file": "infra/config/generated/builders/try/android-pie-x86-fyi-rel-reviver/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "tryserver.chromium.android",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium_trybot"' - '}' - execution_timeout_secs: 14400 - expiration_secs: 7200 - grace_period { - seconds: 120 - } - caches { - name: "win_toolchain" - path: "win_toolchain" - } - build_numbers: YES - service_account: "chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com" - task_template_canary_percentage { - value: 5 - } - experiments { - key: "chromium_swarming.expose_merge_script_failures" - value: 100 - } - experiments { - key: "enable_weetbix_queries" - value: 100 - } - experiments { - key: "luci.buildbucket.omit_python2" - value: 0 - } - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - experiments { - key: "weetbix.enable_weetbix_exonerations" - value: 100 - } - experiments { - key: "weetbix.retry_weak_exonerations" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "try_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_try_test_results" - test_results { - predicate { - test_id_regexp: "ninja://chrome/test:telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_try_test_results" - test_results { - predicate { - test_id_regexp: "(ninja://[^/]*blink_web_tests/.+)|(ninja://[^/]*blink_wpt_tests/.+)" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { name: "android-pie-x86-rel" swarming_host: "chromium-swarm.appspot.com" dimensions: "builderless:1"
diff --git a/infra/config/generated/luci/luci-milo.cfg b/infra/config/generated/luci/luci-milo.cfg index 38d8ed6a..f88b9b2 100644 --- a/infra/config/generated/luci/luci-milo.cfg +++ b/infra/config/generated/luci/luci-milo.cfg
@@ -4590,11 +4590,6 @@ short_name: "and" } builders { - name: "buildbucket/luci.chromium.ci/android-pie-x86-fyi-rel-reviver" - category: "reviver" - short_name: "P" - } - builders { name: "buildbucket/luci.chromium.ci/android-12-x64-dbg-tests" category: "tester|phone" short_name: "12" @@ -16264,9 +16259,6 @@ name: "buildbucket/luci.chromium.try/android-pie-arm64-wpt-rel-non-cq" } builders { - name: "buildbucket/luci.chromium.try/android-pie-x86-fyi-rel-reviver" - } - builders { name: "buildbucket/luci.chromium.try/android-pie-x86-rel" } builders { @@ -17415,9 +17407,6 @@ name: "buildbucket/luci.chromium.try/android-pie-arm64-wpt-rel-non-cq" } builders { - name: "buildbucket/luci.chromium.try/android-pie-x86-fyi-rel-reviver" - } - builders { name: "buildbucket/luci.chromium.try/android-pie-x86-rel" } builders {
diff --git a/infra/config/generated/luci/luci-scheduler.cfg b/infra/config/generated/luci/luci-scheduler.cfg index 7ffd590c..8371f00 100644 --- a/infra/config/generated/luci/luci-scheduler.cfg +++ b/infra/config/generated/luci/luci-scheduler.cfg
@@ -4708,17 +4708,6 @@ } } job { - id: "android-pie-x86-fyi-rel-reviver" - realm: "ci" - schedule: "0 1,4,7,10,13 * * *" - acl_sets: "ci" - buildbucket { - server: "cr-buildbucket.appspot.com" - bucket: "ci" - builder: "android-pie-x86-fyi-rel-reviver" - } -} -job { id: "android-pie-x86-rel" realm: "ci" acl_sets: "ci"
diff --git a/infra/config/generated/luci/project.cfg b/infra/config/generated/luci/project.cfg index 13c2cd0b..f4df331 100644 --- a/infra/config/generated/luci/project.cfg +++ b/infra/config/generated/luci/project.cfg
@@ -7,7 +7,7 @@ name: "chromium" access: "group:all" lucicfg { - version: "1.33.2" + version: "1.33.4" package_dir: "../.." config_dir: "generated/luci" entry_point: "main.star"
diff --git a/infra/config/subprojects/chromium/ci/chromium.android.fyi.star b/infra/config/subprojects/chromium/ci/chromium.android.fyi.star index 92058ac..eec753fb 100644 --- a/infra/config/subprojects/chromium/ci/chromium.android.fyi.star +++ b/infra/config/subprojects/chromium/ci/chromium.android.fyi.star
@@ -78,42 +78,6 @@ triggered_by = [], ) -ci.builder( - name = "android-pie-x86-fyi-rel-reviver", - builder_spec = builder_config.builder_spec( - gclient_config = builder_config.gclient_config( - config = "chromium", - apply_configs = [ - "android", - ], - ), - chromium_config = builder_config.chromium_config( - config = "android", - apply_configs = [ - "mb", - ], - build_config = builder_config.build_config.RELEASE, - target_bits = 32, - target_platform = builder_config.target_platform.ANDROID, - ), - android_config = builder_config.android_config( - config = "x86_builder", - ), - build_gs_bucket = "chromium-android-archive", - ), - console_view_entry = consoles.console_view_entry( - category = "reviver", - short_name = "P", - ), - execution_timeout = 5 * time.hour, - # To avoid peak hours, we run it at 1 AM, 4 AM, 7 AM, 10AM, 1 PM UTC. - schedule = "0 1,4,7,10,13 * * *", - # Set to an empty list to avoid chromium-gitiles-trigger triggering new - # builds. Also we don't set any `schedule` since this builder is for - # reference only and should not run any new builds. - triggered_by = [], -) - # TODO(crbug.com/1137474): This and android-12-x64-fyi-rel # are being kept around so that build links in the related # bugs are accessible
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.android.star b/infra/config/subprojects/chromium/try/tryserver.chromium.android.star index 4acb1c6a..73649d9e 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.android.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.android.star
@@ -411,14 +411,6 @@ goma_jobs = goma.jobs.J150, ) -try_.builder( - name = "android-pie-x86-fyi-rel-reviver", - mirrors = [ - "ci/android-pie-x86-fyi-rel-reviver", - ], - goma_jobs = goma.jobs.J150, -) - # TODO(crbug/1182468) Remove when coverage is enabled on CQ. try_.builder( name = "android-pie-arm64-coverage-rel",
diff --git a/infra/config/subprojects/reviver/reviver.star b/infra/config/subprojects/reviver/reviver.star index 0925b9a..10a65fe 100644 --- a/infra/config/subprojects/reviver/reviver.star +++ b/infra/config/subprojects/reviver/reviver.star
@@ -48,6 +48,7 @@ runner = "reviver/runner", target_builders = [ "ci/android-nougat-x86-rel", + "ci/android-pie-x86-rel", "ci/android-12-x64-rel", ], os = os.LINUX_DEFAULT,
diff --git a/media/base/data_source.cc b/media/base/data_source.cc index 90aef55..a434a26 100644 --- a/media/base/data_source.cc +++ b/media/base/data_source.cc
@@ -20,4 +20,10 @@ return GetSize(&temp) ? temp : 0; } +void DataSource::SetPreload(media::DataSource::Preload preload) {} + +GURL DataSource::GetUrlAfterRedirects() const { + return GURL(); +} + } // namespace media
diff --git a/media/base/data_source.h b/media/base/data_source.h index 0592a1c0..2ca1473 100644 --- a/media/base/data_source.h +++ b/media/base/data_source.h
@@ -9,6 +9,7 @@ #include "base/callback_forward.h" #include "media/base/media_export.h" +#include "url/gurl.h" namespace media { @@ -72,6 +73,14 @@ // By default this just returns GetSize(). virtual int64_t GetMemoryUsage(); + + // Adjusts the buffering algorithm (if there is one) based on the given + // preload value. + virtual void SetPreload(media::DataSource::Preload preload); + + // Gets the url for this data source, if it exists. By default this returns + // an empty GURL. + virtual GURL GetUrlAfterRedirects() const; }; } // namespace media
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc index 6810722..88e06b8 100644 --- a/media/base/video_frame.cc +++ b/media/base/video_frame.cc
@@ -8,11 +8,11 @@ #include <GLES2/gl2ext.h> #include <algorithm> +#include <atomic> #include <climits> #include <numeric> #include <utility> -#include "base/atomic_sequence_num.h" #include "base/bind.h" #include "base/bits.h" #include "base/callback_helpers.h" @@ -37,7 +37,13 @@ namespace { -// Helper to privide gfx::Rect::Intersect() as an expression. +VideoFrame::ID GetNextID() { + static std::atomic_uint64_t counter(1u); + return VideoFrame::ID::FromUnsafeValue( + counter.fetch_add(1u, std::memory_order_relaxed)); +} + +// Helper to provide gfx::Rect::Intersect() as an expression. gfx::Rect Intersection(gfx::Rect a, const gfx::Rect& b) { a.Intersect(b); return a; @@ -59,9 +65,6 @@ } // namespace -// Static constexpr class for generating unique identifiers for each VideoFrame. -static base::AtomicSequenceNumber g_unique_id_generator; - // static std::string VideoFrame::StorageTypeToString( const VideoFrame::StorageType storage_type) { @@ -1414,7 +1417,7 @@ dmabuf_fds_(base::MakeRefCounted<DmabufHolder>()), #endif timestamp_(timestamp), - unique_id_(g_unique_id_generator.GetNext()) { + unique_id_(GetNextID()) { DCHECK(IsValidConfigInternal(format(), frame_control_type, coded_size(), visible_rect_, natural_size_)); DCHECK(visible_rect_ == visible_rect)
diff --git a/media/base/video_frame.h b/media/base/video_frame.h index 1726953..ce17dd5 100644 --- a/media/base/video_frame.h +++ b/media/base/video_frame.h
@@ -23,6 +23,7 @@ #include "base/synchronization/lock.h" #include "base/thread_annotations.h" #include "base/time/time.h" +#include "base/types/id_type.h" #include "base/unguessable_token.h" #include "build/build_config.h" #include "gpu/command_buffer/common/mailbox_holder.h" @@ -628,9 +629,15 @@ // Returns a human-readable string describing |*this|. std::string AsHumanReadableString() const; - // Unique identifier for this video frame; generated at construction time and - // guaranteed to be unique within a single process. - int unique_id() const { return unique_id_; } + // Unique identifier for this video frame generated at construction time. The + // first ID is 1. The identifier is unique within a process % overflows (which + // should be impossible in practice with a 64-bit unsigned integer). + // + // Note: callers may assume that ID will always correspond to a base::IdType + // but should not blindly assume that the underlying type will always be + // uint64_t (this is free to change in the future). + using ID = ::base::IdTypeU64<class VideoFrameIdTag>; + ID unique_id() const { return unique_id_; } // Returns the number of bits per channel. size_t BitDepth() const; @@ -785,7 +792,7 @@ VideoFrameMetadata metadata_; // Generated at construction time. - const int unique_id_; + const ID unique_id_; gfx::ColorSpace color_space_; absl::optional<gfx::HDRMetadata> hdr_metadata_;
diff --git a/media/mojo/clients/mojo_video_encode_accelerator.cc b/media/mojo/clients/mojo_video_encode_accelerator.cc index 5403fc71..00eba20 100644 --- a/media/mojo/clients/mojo_video_encode_accelerator.cc +++ b/media/mojo/clients/mojo_video_encode_accelerator.cc
@@ -11,6 +11,7 @@ #include "base/logging.h" #include "base/memory/raw_ptr.h" #include "base/metrics/histogram_macros.h" +#include "base/threading/thread_restrictions.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" #include "gpu/ipc/client/gpu_channel_host.h" @@ -149,6 +150,7 @@ std::move(media_log_pending_receiver)); bool result = false; + base::ScopedAllowBaseSyncPrimitives allow; vea_->Initialize(config, std::move(vea_client_remote), std::move(media_log_pending_remote), &result); return result;
diff --git a/media/renderers/paint_canvas_video_renderer.cc b/media/renderers/paint_canvas_video_renderer.cc index a2634ad..d6e6c7b 100644 --- a/media/renderers/paint_canvas_video_renderer.cc +++ b/media/renderers/paint_canvas_video_renderer.cc
@@ -1846,7 +1846,8 @@ yuv_cache_.Reset(); } -PaintCanvasVideoRenderer::Cache::Cache(int frame_id) : frame_id(frame_id) {} +PaintCanvasVideoRenderer::Cache::Cache(VideoFrame::ID frame_id) + : frame_id(frame_id) {} PaintCanvasVideoRenderer::Cache::~Cache() = default;
diff --git a/media/renderers/paint_canvas_video_renderer.h b/media/renderers/paint_canvas_video_renderer.h index a4981dd..8e8a126 100644 --- a/media/renderers/paint_canvas_video_renderer.h +++ b/media/renderers/paint_canvas_video_renderer.h
@@ -202,11 +202,11 @@ // not keep a reference to the VideoFrame so necessary data is extracted out // of it. struct Cache { - explicit Cache(int frame_id); + explicit Cache(VideoFrame::ID frame_id); ~Cache(); // VideoFrame::unique_id() of the videoframe used to generate the cache. - int frame_id; + VideoFrame::ID frame_id; // A PaintImage that can be used to draw into a PaintCanvas. This is sized // to the visible size of the VideoFrame. Its contents are generated lazily.
diff --git a/media/renderers/video_resource_updater.cc b/media/renderers/video_resource_updater.cc index 30b6d82..1b8f123 100644 --- a/media/renderers/video_resource_updater.cc +++ b/media/renderers/video_resource_updater.cc
@@ -42,7 +42,6 @@ #include "gpu/command_buffer/common/shared_image_trace_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "media/base/format_utils.h" -#include "media/base/video_frame.h" #include "media/renderers/paint_canvas_video_renderer.h" #include "media/video/half_float_maker.h" #include "third_party/khronos/GLES2/gl2.h" @@ -326,14 +325,14 @@ // Returns true if this resource matches the unique identifiers of another // VideoFrame resource. - bool Matches(int unique_frame_id, size_t plane_index) { + bool Matches(VideoFrame::ID unique_frame_id, size_t plane_index) { return has_unique_frame_id_and_plane_index_ && unique_frame_id_ == unique_frame_id && plane_index_ == plane_index; } // Sets the unique identifiers for this resource, may only be called when // there is a single reference to the resource (i.e. |ref_count_| == 1). - void SetUniqueId(int unique_frame_id, size_t plane_index) { + void SetUniqueId(VideoFrame::ID unique_frame_id, size_t plane_index) { DCHECK_EQ(ref_count_, 1); plane_index_ = plane_index; unique_frame_id_ = unique_frame_id; @@ -363,7 +362,7 @@ // These two members are used for identifying the data stored in this // resource; they uniquely identify a VideoFrame plane. - int unique_frame_id_ = 0; + VideoFrame::ID unique_frame_id_; size_t plane_index_ = 0u; // Indicates if the above two members have been set or not. bool has_unique_frame_id_and_plane_index_ = false; @@ -775,7 +774,7 @@ const gfx::Size& resource_size, viz::ResourceFormat resource_format, const gfx::ColorSpace& color_space, - int unique_id, + VideoFrame::ID unique_id, int plane_index) { PlaneResource* recyclable_resource = nullptr; for (auto& resource : all_resources_) { @@ -839,7 +838,7 @@ constexpr viz::ResourceFormat copy_resource_format = viz::ResourceFormat::RGBA_8888; - const int no_unique_id = 0; + const VideoFrame::ID no_unique_id; const int no_plane_index = -1; // Do not recycle referenced textures. PlaneResource* plane_resource = RecycleOrAllocateResource( output_plane_resource_size, copy_resource_format, resource_color_space,
diff --git a/media/renderers/video_resource_updater.h b/media/renderers/video_resource_updater.h index 76ac7e1..0f2f838 100644 --- a/media/renderers/video_resource_updater.h +++ b/media/renderers/video_resource_updater.h
@@ -22,6 +22,7 @@ #include "components/viz/common/resources/transferable_resource.h" #include "gpu/command_buffer/client/gles2_interface.h" #include "media/base/media_export.h" +#include "media/base/video_frame.h" #include "ui/gfx/buffer_types.h" #include "ui/gfx/geometry/size.h" @@ -44,7 +45,6 @@ namespace media { class PaintCanvasVideoRenderer; -class VideoFrame; // Specifies what type of data is contained in the mailboxes, as well as how // many mailboxes will be present. @@ -163,7 +163,7 @@ PlaneResource* RecycleOrAllocateResource(const gfx::Size& resource_size, viz::ResourceFormat resource_format, const gfx::ColorSpace& color_space, - int unique_id, + VideoFrame::ID unique_id, int plane_index); PlaneResource* AllocateResource(const gfx::Size& plane_size, viz::ResourceFormat format,
diff --git a/net/base/features.cc b/net/base/features.cc index cff8b6d..6e7f392 100644 --- a/net/base/features.cc +++ b/net/base/features.cc
@@ -195,7 +195,12 @@ #if BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) BASE_FEATURE(kChromeRootStoreUsed, "ChromeRootStoreUsed", - base::FEATURE_DISABLED_BY_DEFAULT); +#if BUILDFLAG(IS_MAC) + base::FEATURE_ENABLED_BY_DEFAULT +#else + base::FEATURE_DISABLED_BY_DEFAULT +#endif +); #if BUILDFLAG(IS_MAC) const base::FeatureParam<int> kChromeRootStoreSysImpl{&kChromeRootStoreUsed, "sysimpl", 0};
diff --git a/sql/BUILD.gn b/sql/BUILD.gn index abda4e1..96862dde 100644 --- a/sql/BUILD.gn +++ b/sql/BUILD.gn
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") component("sql") { @@ -141,3 +142,12 @@ "//third_party/sqlite", ] } + +fuzzer_test("sql_recovery_fuzzer") { + sources = [ "recovery_fuzzer.cc" ] + deps = [ + ":sql", + "//base", + "//base/test:test_support", + ] +}
diff --git a/sql/recovery_fuzzer.cc b/sql/recovery_fuzzer.cc new file mode 100644 index 0000000..29a39f62 --- /dev/null +++ b/sql/recovery_fuzzer.cc
@@ -0,0 +1,61 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <stdint.h> + +#include <tuple> + +#include "base/check.h" +#include "base/containers/span.h" +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/test/bind.h" +#include "sql/database.h" +#include "sql/recovery.h" +#include "sql/statement.h" + +namespace { + +// Does initialization and holds state that's shared across all runs. +class Environment { + public: + Environment() { + CHECK(base::CreateTemporaryFile(&data_file_path_)); + logging::SetMinLogLevel(logging::LOG_FATAL); + } + + ~Environment() { base::DeleteFile(data_file_path_); } + + const base::FilePath& data_file_path() const { return data_file_path_; } + + private: + base::FilePath data_file_path_; +}; + +} // namespace + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + static Environment env; + + // Prepare fuzzed data file. + CHECK(base::WriteFile(env.data_file_path(), base::make_span(data, size))); + + // Load database. Check there's no unrecoverable error. + sql::DatabaseOptions options; + sql::Database database(options); + bool should_attempt_recovery = false; + database.set_error_callback( + base::BindLambdaForTesting([&](int extended_error, sql::Statement*) { + should_attempt_recovery = sql::Recovery::ShouldRecover(extended_error); + })); + std::ignore = database.Open(env.data_file_path()); + + // Attempt recovery. + if (should_attempt_recovery) { + database.reset_error_callback(); + sql::Recovery::RecoverDatabase(&database, env.data_file_path()); + } + + return 0; +}
diff --git a/testing/buildbot/OWNERS b/testing/buildbot/OWNERS index 3b129c1..5887d4f 100644 --- a/testing/buildbot/OWNERS +++ b/testing/buildbot/OWNERS
@@ -41,7 +41,6 @@ # For OOBE-related test filters. per-file *oobe*=file://chrome/browser/ui/webui/ash/login/OWNERS -per-file *oobe*=file://chrome/browser/ui/webui/chromeos/login/OWNERS # iOS Owners per-file chromium.clang.json=file://infra/config/groups/ios/OWNERS
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index 7ef1f7c..7ffc102 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -664,4076 +664,6 @@ } ] }, - "android-pie-x86-fyi-rel-reviver": { - "gtest_tests": [ - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "absl_hardening_tests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "absl_hardening_tests", - "test_id_prefix": "ninja://third_party/abseil-cpp:absl_hardening_tests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "android_browsertests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 3 - }, - "test": "android_browsertests", - "test_id_prefix": "ninja://chrome/test:android_browsertests/" - }, - { - "args": [ - "--test-launcher-batch-limit=1", - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "android_sync_integration_tests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "android_sync_integration_tests", - "test_id_prefix": "ninja://chrome/test:android_sync_integration_tests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "android_webview_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "android_webview_unittests", - "test_id_prefix": "ninja://android_webview/test:android_webview_unittests/" - }, - { - "args": [ - "-v", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_unittests", - "test_id_prefix": "ninja://third_party/angle/src/tests:angle_unittests/", - "use_isolated_scripts_api": true - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "base_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "base_unittests", - "test_id_prefix": "ninja://base:base_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "blink_common_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_common_unittests", - "test_id_prefix": "ninja://third_party/blink/common:blink_common_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "blink_heap_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_heap_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform/heap:blink_heap_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "blink_platform_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_platform_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_platform_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "webkit_unit_tests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "name": "webkit_unit_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 - }, - "test": "blink_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/controller:blink_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "boringssl_crypto_tests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "boringssl_crypto_tests", - "test_id_prefix": "ninja://third_party/boringssl:boringssl_crypto_tests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "boringssl_ssl_tests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "boringssl_ssl_tests", - "test_id_prefix": "ninja://third_party/boringssl:boringssl_ssl_tests/" - }, - { - "args": [ - "--gtest_filter=-*UsingRealWebcam*", - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "capture_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "capture_unittests", - "test_id_prefix": "ninja://media/capture:capture_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "cast_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cast_unittests", - "test_id_prefix": "ninja://media/cast:cast_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "cc_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cc_unittests", - "test_id_prefix": "ninja://cc:cc_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "chrome_java_test_pagecontroller_tests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chrome_java_test_pagecontroller_tests", - "test_id_prefix": "ninja://chrome/test/android:chrome_java_test_pagecontroller_tests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "chrome_public_smoke_test" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chrome_public_smoke_test", - "test_id_prefix": "ninja://chrome/android:chrome_public_smoke_test/" - }, - { - "args": [ - "--gtest_filter=-org.chromium.chrome.browser.contextualsearch.ContextualSearchManagerTest.test*ExternalNavigationWithUserGesture*:org.chromium.shape_detection.*", - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests", - "--git-revision=${got_revision}" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "chrome_public_test_apk" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "e2-standard-8", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 30 - }, - "test": "chrome_public_test_apk", - "test_id_prefix": "ninja://chrome/android:chrome_public_test_apk/" - }, - { - "args": [ - "--gtest_filter=org.chromium.chrome.browser.contextualsearch.ContextualSearchManagerTest.test*ExternalNavigationWithUserGesture*:org.chromium.shape_detection.*", - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests", - "--git-revision=${got_revision}", - "--avd-config=../../tools/android/avd/proto/generic_playstore_android28.textpb" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "chrome_public_test_apk_with_playstore" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "name": "chrome_public_test_apk_with_playstore", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_playstore_android28", - "path": ".android_emulator/generic_playstore_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_playstore_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chrome_public_test_apk", - "test_id_prefix": "ninja://chrome/android:chrome_public_test_apk/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests", - "--git-revision=${got_revision}" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "chrome_public_unit_test_apk" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 4 - }, - "test": "chrome_public_unit_test_apk", - "test_id_prefix": "ninja://chrome/android:chrome_public_unit_test_apk/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "components_browsertests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "components_browsertests", - "test_id_prefix": "ninja://components:components_browsertests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "components_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 - }, - "test": "components_unittests", - "test_id_prefix": "ninja://components:components_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "content_browsertests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 30 - }, - "test": "content_browsertests", - "test_id_prefix": "ninja://content/test:content_browsertests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "content_shell_test_apk" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 3 - }, - "test": "content_shell_test_apk", - "test_id_prefix": "ninja://content/shell/android:content_shell_test_apk/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "content_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 3 - }, - "test": "content_unittests", - "test_id_prefix": "ninja://content/test:content_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "crashpad_tests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "crashpad_tests", - "test_id_prefix": "ninja://third_party/crashpad/crashpad:crashpad_tests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "crypto_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "crypto_unittests", - "test_id_prefix": "ninja://crypto:crypto_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "device_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "device_unittests", - "test_id_prefix": "ninja://device:device_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "display_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "display_unittests", - "test_id_prefix": "ninja://ui/display:display_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "events_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "events_unittests", - "test_id_prefix": "ninja://ui/events:events_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "gcm_unit_tests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gcm_unit_tests", - "test_id_prefix": "ninja://google_apis/gcm:gcm_unit_tests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "gfx_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gfx_unittests", - "test_id_prefix": "ninja://ui/gfx:gfx_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "gin_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gin_unittests", - "test_id_prefix": "ninja://gin:gin_unittests/" - }, - { - "args": [ - "--use-cmd-decoder=validating", - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "gl_tests_validating" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "name": "gl_tests_validating", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gl_tests", - "test_id_prefix": "ninja://gpu:gl_tests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "gl_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gl_unittests", - "test_id_prefix": "ninja://ui/gl:gl_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "google_apis_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "google_apis_unittests", - "test_id_prefix": "ninja://google_apis:google_apis_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "gpu_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gpu_unittests", - "test_id_prefix": "ninja://gpu:gpu_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "gwp_asan_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gwp_asan_unittests", - "test_id_prefix": "ninja://components/gwp_asan:gwp_asan_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "ipc_tests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ipc_tests", - "test_id_prefix": "ninja://ipc:ipc_tests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "latency_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "latency_unittests", - "test_id_prefix": "ninja://ui/latency:latency_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "libjingle_xmpp_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "libjingle_xmpp_unittests", - "test_id_prefix": "ninja://third_party/libjingle_xmpp:libjingle_xmpp_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "liburlpattern_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "liburlpattern_unittests", - "test_id_prefix": "ninja://third_party/liburlpattern:liburlpattern_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "media_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "media_unittests", - "test_id_prefix": "ninja://media:media_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "midi_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "midi_unittests", - "test_id_prefix": "ninja://media/midi:midi_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "mojo_test_apk" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "mojo_test_apk", - "test_id_prefix": "ninja://mojo/public/java/system:mojo_test_apk/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "mojo_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "mojo_unittests", - "test_id_prefix": "ninja://mojo:mojo_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "monochrome_public_bundle_smoke_test" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "monochrome_public_bundle_smoke_test", - "test_id_prefix": "ninja://chrome/android:monochrome_public_bundle_smoke_test/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "monochrome_public_smoke_test" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "monochrome_public_smoke_test", - "test_id_prefix": "ninja://chrome/android:monochrome_public_smoke_test/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "net_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 3 - }, - "test": "net_unittests", - "test_id_prefix": "ninja://net:net_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "sandbox_linux_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sandbox_linux_unittests", - "test_id_prefix": "ninja://sandbox/linux:sandbox_linux_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "services_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "services_unittests", - "test_id_prefix": "ninja://services:services_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "shell_dialogs_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "shell_dialogs_unittests", - "test_id_prefix": "ninja://ui/shell_dialogs:shell_dialogs_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "skia_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "skia_unittests", - "test_id_prefix": "ninja://skia:skia_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "sql_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sql_unittests", - "test_id_prefix": "ninja://sql:sql_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "storage_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "storage_unittests", - "test_id_prefix": "ninja://storage:storage_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "system_webview_shell_layout_test_apk" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "system_webview_shell_layout_test_apk", - "test_id_prefix": "ninja://android_webview/tools/system_webview_shell:system_webview_shell_layout_test_apk/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "ui_android_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ui_android_unittests", - "test_id_prefix": "ninja://ui/android:ui_android_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "ui_base_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ui_base_unittests", - "test_id_prefix": "ninja://ui/base:ui_base_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "ui_touch_selection_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ui_touch_selection_unittests", - "test_id_prefix": "ninja://ui/touch_selection:ui_touch_selection_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "unit_tests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "unit_tests", - "test_id_prefix": "ninja://chrome/test:unit_tests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "url_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "url_unittests", - "test_id_prefix": "ninja://url:url_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "viz_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "viz_unittests", - "test_id_prefix": "ninja://components/viz:viz_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "webview_cts_tests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "cipd_packages": [ - { - "cipd_package": "chromium/android_webview/tools/cts_archive", - "location": "android_webview/tools/cts_archive", - "revision": "C4m9-gZKvvtS0-KQ9cMRi6wEfZH_TeWSiXEgsgtGtsMC" - } - ], - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "webview_cts_tests", - "test_id_prefix": "ninja://android_webview/test:webview_cts_tests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "webview_instrumentation_test_apk" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 9 - }, - "test": "webview_instrumentation_test_apk", - "test_id_prefix": "ninja://android_webview/test:webview_instrumentation_test_apk/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "webview_ui_test_app_test_apk" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "webview_ui_test_app_test_apk", - "test_id_prefix": "ninja://android_webview/tools/automated_ui_tests:webview_ui_test_app_test_apk/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "wtf_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "wtf_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform/wtf:wtf_unittests/" - }, - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "zlib_unittests" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "device_os": null, - "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4", - "os": "Ubuntu-18.04", - "pool": "chromium.tests.avd" - } - ], - "named_caches": [ - { - "name": "generic_android28", - "path": ".android_emulator/generic_android28" - } - ], - "optional_dimensions": { - "60": [ - { - "caches": "generic_android28" - } - ] - }, - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "zlib_unittests", - "test_id_prefix": "ninja://third_party/zlib:zlib_unittests/" - } - ], - "scripts": [ - { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android28.textpb", - "--gtest_also_run_disabled_tests" - ], - "name": "check_network_annotations", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "script": "check_network_annotations.py", - "swarming": {} - } - ] - }, "android-webview-12-x64-dbg-tests": { "gtest_tests": [ {
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 92fd0efa..44cb0686 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -23326,7 +23326,7 @@ { "args": [ "--enable-features=BackForwardCache,BackForwardCacheSameSiteForBots,BackForwardCacheNoTimeEviction,ProactivelySwapBrowsingInstance", - "--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_12.chrome_public_test_apk.filter;../../testing/buildbot/testing/buildbot/filters/android.emulator.bf_cache_chrome_public_test_apk.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_12.chrome_public_test_apk.filter;../../testing/buildbot/filters/android.emulator.bf_cache_chrome_public_test_apk.filter", "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android31.textpb", @@ -23526,7 +23526,7 @@ { "args": [ "--enable-features=BackForwardCache,BackForwardCacheSameSiteForBots,BackForwardCacheNoTimeEviction,ProactivelySwapBrowsingInstance", - "--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_12.content_shell_test_apk.filter;../../testing/buildbot/filters/testing/buildbot/filters/android.emulator.bf_cache_content_shell_test_apk.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_12.content_shell_test_apk.filter;../../testing/buildbot/filters/android.emulator.bf_cache_content_shell_test_apk.filter", "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android31.textpb"
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 0d5d47f..1b55b78 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -1401,6 +1401,39 @@ }, { "args": [ + "--board=eve", + "--flash" + ], + "experiment_percentage": 5, + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "lacros_cq_tast_tests_eve eve", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "device_type": "eve", + "os": "ChromeOS" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "lacros_cq_tast_tests_eve", + "test_id_prefix": "ninja://chromeos/lacros:lacros_cq_tast_tests_eve/", + "trigger_script": { + "script": "//testing/trigger_scripts/chromeos_device_trigger.py" + }, + "variant_id": "eve" + }, + { + "args": [ "--board=amd64-generic", "--use-vm" ], @@ -1489,6 +1522,39 @@ "script": "//testing/trigger_scripts/chromeos_device_trigger.py" }, "variant_id": "jacuzzi" + }, + { + "args": [ + "--board=jacuzzi", + "--flash" + ], + "experiment_percentage": 5, + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "lacros_cq_tast_tests_jacuzzi jacuzzi", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "device_type": "jacuzzi", + "os": "ChromeOS" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "lacros_cq_tast_tests_jacuzzi", + "test_id_prefix": "ninja://chromeos/lacros:lacros_cq_tast_tests_jacuzzi/", + "trigger_script": { + "script": "//testing/trigger_scripts/chromeos_device_trigger.py" + }, + "variant_id": "jacuzzi" } ] },
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index d3c2fc1..2e95b93 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -4985,6 +4985,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -5661,6 +5665,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -6079,6 +6087,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": false @@ -6637,6 +6649,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -9556,6 +9572,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -10768,6 +10788,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -11558,6 +11582,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -12428,6 +12456,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -13202,6 +13234,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -14004,6 +14040,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -15227,6 +15267,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -15996,6 +16040,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -18144,6 +18192,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -18928,6 +18980,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true,
diff --git a/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter b/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter index 3bad36a..7b942268 100644 --- a/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter +++ b/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter
@@ -104,4 +104,5 @@ # TODO(b/256212431): Re-enable when linux-lacros-rel support # signin::MakePrimaryAccountAvailable(). --AccessCodeCastHandlerBrowserTest.ExpectProfileSynErrorWhenNoSync \ No newline at end of file +-AccessCodeCastHandlerBrowserTest.ExpectProfileSynErrorWhenNoSync +-AccessCodeCastSinkServiceBrowserTest.* \ No newline at end of file
diff --git a/testing/buildbot/filters/mac.mac12-arm64-rel.browser_tests.filter b/testing/buildbot/filters/mac.mac12-arm64-rel.browser_tests.filter index 644c2ea1..50520062 100644 --- a/testing/buildbot/filters/mac.mac12-arm64-rel.browser_tests.filter +++ b/testing/buildbot/filters/mac.mac12-arm64-rel.browser_tests.filter
@@ -48,6 +48,7 @@ -BackgroundFetchBrowserTest.OfflineItemCollection_VerifyIconReceived -BatterySaverBubbleViewTest.DisableModeForSession -BrowserShutdownBrowserTest.TwoBrowsersClosingShutdownHistograms +-ChromeURLDataManagerWebUITrustedTypesTest.NoTrustedTypesViolation/chrome___net_internals -CrExtensionsA11yTestWithMultipleExensions.WithExtensions_marquee -CrExtensionsA11yTestWithMultipleExensions.WithExtensions_meta_viewport_large -CrExtensionsA11yTestWithMultipleExensions.WithExtensions_list @@ -118,6 +119,7 @@ -MseEncryptedMediaTest.Playback_VideoOnly_MP4_VP9Profile2/0 -NativeMessagingLaunchApiTest.Error -NewTabPageRealboxTest.All +-PasswordManagerUISideBarTest.All -PDFExtensionJSTest.ViewerThumbnailBar -PDFExtensionSaveTest.Save -PDFExtensionSaveWithPolicyTest.SaveWithPolicyUniqueTimeSuffix @@ -125,6 +127,7 @@ -PlatformAppBrowserTest.AllowFileSystemURLNavigation -PersistentBackground/ExtensionWebRequestApiTestWithContextType.WebRequestWithWithheldPermissions/0 -PredictionManagerModelDownloadingBrowserTest.GuestProfileReceivesModel +-PredictionManagerModelDownloadingBrowserTest.TestSwitchProfileDoesntCrash -PreinstalledAppsBrowserTest.TestUninstall -PreinstalledAppsMigrationBrowserTest.TestRollbackCompatibility -PreinstalledAppsMigrationBrowserTest.TestExtensionWasAlreadyUninstalled
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index 40ee7c5..69883bf7 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -1163,6 +1163,20 @@ "label": "//chrome/test:lacros_chrome_unittests", "type": "console_test_launcher", }, + "lacros_cq_tast_tests_eve": { + "label": "//chromeos/lacros:lacros_cq_tast_tests_eve", + "type": "generated_script", + "args": [ + "--logs-dir=${ISOLATED_OUTDIR}", + ], + }, + "lacros_cq_tast_tests_jacuzzi": { + "label": "//chromeos/lacros:lacros_cq_tast_tests_jacuzzi", + "type": "generated_script", + "args": [ + "--logs-dir=${ISOLATED_OUTDIR}", + ], + }, "lacros_fyi_tast_tests": { "label": "//chromeos/lacros:lacros_fyi_tast_tests", "type": "generated_script",
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index 0e810d6..76dbaa3c 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -69,11 +69,6 @@ 'quickrun_shards': 6, }, }, - 'android-pie-x86-fyi-rel-reviver': { - 'swarming': { - 'shards': 3, - }, - }, 'android-pie-x86-rel': { 'args': [ '--gtest_filter=-ImportantSitesUtilBrowserTest.DSENotConsideredImportantInRegularMode', # https://crbug.com/1034001 @@ -1354,12 +1349,6 @@ ], 'ci_only': True, # https://crbug.com/1233700 }, - 'android-pie-x86-fyi-rel-reviver': { - 'swarming': { - # See https://crbug.com/1230192, runs of 40-60 minutes at 20 shards. - 'shards': 30, - }, - }, 'android-pie-x86-rel': { 'args': [ # https://crbug.com/1046059 @@ -1416,27 +1405,6 @@ ], }, }, - 'android-pie-x86-fyi-rel-reviver': { - 'args': [ - '--avd-config=../../tools/android/avd/proto/generic_playstore_android28.textpb', - ], - 'swarming': { - # soft affinity so that bots with caches will be picked first - 'optional_dimensions': { - '60': [ - { - 'caches': 'generic_playstore_android28', - } - ], - }, - 'named_caches': [ - { - 'name': 'generic_playstore_android28', - 'path': '.android_emulator/generic_playstore_android28', - }, - ], - }, - }, 'android-pie-x86-rel': { 'args': [ '--avd-config=../../tools/android/avd/proto/generic_playstore_android28.textpb', @@ -1771,13 +1739,6 @@ 'quickrun_shards': 40 } }, - 'android-pie-x86-fyi-rel-reviver': { - 'swarming': { - # Flaking with only 20 shards with 40-60 minute runs. - # https://crbug.com/1230118 - 'shards': 30, - }, - }, 'android-pie-x86-rel': { 'args': [ '--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_p.content_browsertests.filter', @@ -3017,7 +2978,6 @@ 'android-code-coverage-native', 'android-pie-arm64-coverage-experimental-rel', # Does not generate profraw data. 'android-pie-arm64-rel', - 'android-pie-x86-fyi-rel-reviver', 'android-pie-x86-rel', 'android-11-x86-rel', 'Marshmallow 64 bit Tester', @@ -3676,13 +3636,11 @@ }, 'vr_common_unittests': { 'remove_from': [ - 'android-pie-x86-fyi-rel-reviver', 'android-pie-x86-rel', ], }, 'vr_pixeltests': { 'remove_from': [ - 'android-pie-x86-fyi-rel-reviver', 'android-pie-x86-rel', 'VR Linux', ], @@ -4081,11 +4039,6 @@ 'shards': 9, }, }, - 'android-pie-x86-fyi-rel-reviver': { - 'swarming': { - 'shards': 9, - }, - }, 'android-pie-x86-rel': { 'args': [ '--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator.webview_instrumentation_test_apk.filter',
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 5a283742..0625e8f 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -320,7 +320,7 @@ 'bf_cache_chrome_public_test_apk': { 'args': [ '--enable-features=BackForwardCache,BackForwardCacheSameSiteForBots,BackForwardCacheNoTimeEviction,ProactivelySwapBrowsingInstance', - '--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_12.chrome_public_test_apk.filter;../../testing/buildbot/testing/buildbot/filters/android.emulator.bf_cache_chrome_public_test_apk.filter' + '--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_12.chrome_public_test_apk.filter;../../testing/buildbot/filters/android.emulator.bf_cache_chrome_public_test_apk.filter' ], 'swarming': { 'shards': 20, @@ -343,7 +343,7 @@ 'bf_cache_content_shell_test_apk': { 'args': [ '--enable-features=BackForwardCache,BackForwardCacheSameSiteForBots,BackForwardCacheNoTimeEviction,ProactivelySwapBrowsingInstance', - '--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_12.content_shell_test_apk.filter;../../testing/buildbot/filters/testing/buildbot/filters/android.emulator.bf_cache_content_shell_test_apk.filter' + '--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator_12.content_shell_test_apk.filter;../../testing/buildbot/filters/android.emulator.bf_cache_content_shell_test_apk.filter' ], 'swarming': { 'shards': 5, @@ -3283,6 +3283,9 @@ '--use-weston', '--weston-use-gl', ], + 'mixins': [ + 'has_native_resultdb_integration', + ], }, }, @@ -3305,6 +3308,9 @@ '--use-weston', '--weston-use-gl', ], + 'mixins': [ + 'has_native_resultdb_integration', + ], }, }, @@ -3878,6 +3884,30 @@ }, }, + 'lacros_cq_tast_tests_eve': { + 'lacros_cq_tast_tests_eve': { + 'swarming': { + 'idempotent': False, # https://crbug.com/923426#c27 + }, + 'mixins': [ + 'has_native_resultdb_integration', + ], + 'experiment_percentage': 5, + }, + }, + + 'lacros_cq_tast_tests_jacuzzi': { + 'lacros_cq_tast_tests_jacuzzi': { + 'swarming': { + 'idempotent': False, # https://crbug.com/923426#c27 + }, + 'mixins': [ + 'has_native_resultdb_integration', + ], + 'experiment_percentage': 5, + }, + }, + # TODO(crbug.com/1204231): Re-enable vaapi_unittest. 'lacros_device_or_vm_gtests': { 'aura_unittests': {}, @@ -7024,6 +7054,19 @@ }, }, + 'lacros_device_arm_tests_rel': { + 'lacros_all_tast_tests': { + 'variants': [ + 'LACROS_JACUZZI', + ] + }, + 'lacros_cq_tast_tests_jacuzzi': { + 'variants': [ + 'LACROS_JACUZZI', + ] + }, + }, + 'lacros_device_or_vm_tast_tests': { 'lacros_all_tast_tests': { 'variants': [ @@ -7044,6 +7087,11 @@ 'LACROS_EVE', ] }, + 'lacros_cq_tast_tests_eve': { + 'variants': [ + 'LACROS_EVE', + ] + }, 'lacros_device_or_vm_gtests': { 'variants': [ 'LACROS_AMD64_GENERIC',
diff --git a/testing/buildbot/tryserver.chromium.linux.json b/testing/buildbot/tryserver.chromium.linux.json index 7067b653..a51be46 100644 --- a/testing/buildbot/tryserver.chromium.linux.json +++ b/testing/buildbot/tryserver.chromium.linux.json
@@ -486,6 +486,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests GTX 1660", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -518,6 +522,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests UHD 630", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true,
diff --git a/testing/buildbot/tryserver.chromium.mac.json b/testing/buildbot/tryserver.chromium.mac.json index 1f123e4..828bdcbe 100644 --- a/testing/buildbot/tryserver.chromium.mac.json +++ b/testing/buildbot/tryserver.chromium.mac.json
@@ -1106,6 +1106,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests 1002:6821", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -1141,6 +1145,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests 10de:0fe9", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -1176,6 +1184,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests 8086:3e9b", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true,
diff --git a/testing/buildbot/tryserver.chromium.win.json b/testing/buildbot/tryserver.chromium.win.json index 30ffd20..f78c60c 100644 --- a/testing/buildbot/tryserver.chromium.win.json +++ b/testing/buildbot/tryserver.chromium.win.json
@@ -565,6 +565,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests 10de:2184", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true, @@ -597,6 +601,10 @@ "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, "name": "webcodecs_tests 8086:5912 or 8086:3e92", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "should_retry_with_patch": false, "swarming": { "can_use_on_swarming_builders": true,
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index 691e4ce..b4bc97f 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -1133,24 +1133,6 @@ }, 'os_type': 'android', }, - # A builder for early prototype of test-reviver in Clank. - # TODO(crbug.com/1348392): Remove this builder once we have a way to reuse - # the built binaries or a formal solution for test-reviver. - 'android-pie-x86-fyi-rel-reviver': { - 'mixins': [ - 'has_native_resultdb_integration', - 'pie-x86-emulator', - 'emulator-4-cores', - 'linux-bionic', - 'x86-64', - 'gtest_run_disabled', - ], - 'os_type': 'android', - 'test_suites': { - 'gtest_tests': 'android_pie_rel_emulator_gtests', - 'scripts': 'chromium_android_scripts', - } - }, 'android-webview-12-x64-dbg-tests': { 'mixins': [ '12-x64-emulator', @@ -1438,7 +1420,7 @@ 'chrome', ], 'test_suites': { - 'gtest_tests': 'lacros_device_arm_tests', + 'gtest_tests': 'lacros_device_arm_tests_rel', }, 'os_type': 'chromeos' },
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index f7fb42e..53915675 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -2305,19 +2305,6 @@ "CertVerifierBuiltin": [ { "platforms": [ - "mac" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "ChromeRootStoreUsed" - ] - } - ] - }, - { - "platforms": [ "windows" ], "experiments": [ @@ -2843,20 +2830,29 @@ ], "experiments": [ { - "name": "Enabled_20220926", + "name": "Enabled_20221031", "params": { + "compile-in-parallel": "true", + "compile-strategy": "eager", "default-parser-budget": "10ms", + "inline-script-timeout": "5ms", "long-parser-budget": "50ms", - "num-yields-with-default-budget": "2" + "num-yields-with-default-budget": "2", + "preload-processing-mode": "immediate" }, "enable_features": [ "BatchImageDecoding", "DecodeScriptSourceOffThread", "EstablishGpuChannelAsync", "OptimizeDataUrls", + "PrecompileInlineScripts", "PrefetchFontLookupTables", "SplitCompositorTask", + "ThreadedPreloadScanner", "TimedHTMLParserBudget" + ], + "disable_features": [ + "PretokenizeCSS" ] } ] @@ -2865,18 +2861,21 @@ "platforms": [ "chromeos", "chromeos_lacros", - "fuchsia", "linux", "mac", "windows" ], "experiments": [ { - "name": "Enabled_20220926", + "name": "Enabled_20221031", "params": { - "default-parser-budget": "10ms", + "compile-in-parallel": "true", + "compile-strategy": "eager", + "default-parser-budget": "20ms", + "inline-script-timeout": "5ms", "long-parser-budget": "500ms", - "num-yields-with-default-budget": "6", + "num-yields-with-default-budget": "2", + "preload-processing-mode": "immediate", "prewarm_cursive": "false", "prewarm_fantasy": "false", "prewarm_fixed": "false", @@ -2887,11 +2886,14 @@ "enable_features": [ "DecodeScriptSourceOffThread", "OptimizeDataUrls", + "PrecompileInlineScripts", "PrewarmDefaultFontFamilies", + "ThreadedPreloadScanner", "TimedHTMLParserBudget" ], "disable_features": [ - "EstablishGpuChannelAsync" + "EstablishGpuChannelAsync", + "PretokenizeCSS" ] } ] @@ -2902,18 +2904,27 @@ ], "experiments": [ { - "name": "Enabled_20220929", + "name": "Enabled_20221031", "params": { + "compile-in-parallel": "true", + "compile-strategy": "eager", "default-parser-budget": "10ms", + "inline-script-timeout": "5ms", "long-parser-budget": "50ms", - "num-yields-with-default-budget": "2" + "num-yields-with-default-budget": "2", + "preload-processing-mode": "immediate" }, "enable_features": [ "DecodeScriptSourceOffThread", "EstablishGpuChannelAsync", "OptimizeDataUrls", + "PrecompileInlineScripts", "PrefetchFontLookupTables", + "ThreadedPreloadScanner", "TimedHTMLParserBudget" + ], + "disable_features": [ + "PretokenizeCSS" ] } ] @@ -8527,35 +8538,6 @@ ] } ], - "PrecompileInlineScripts": [ - { - "platforms": [ - "android", - "android_webview", - "chromeos", - "chromeos_lacros", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Eager_20221010", - "params": { - "compile-strategy": "eager", - "inline-script-timeout": "5ms", - "preload-processing-mode": "immediate" - }, - "enable_features": [ - "AvoidEarlyExtensionScriptContextCreation", - "PrecompileInlineScripts", - "PretokenizeCSS", - "ThreadedPreloadScanner" - ] - } - ] - } - ], "PreconnectInNetworkService": [ { "platforms": [
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc index 4f3428c..622903a 100644 --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc
@@ -105,7 +105,7 @@ BASE_FEATURE(kBackForwardCacheNotReachedOnJavaScriptExecution, "BackForwardCacheNotReachedOnJavaScriptExecution", - base::FEATURE_ENABLED_BY_DEFAULT); + base::FEATURE_DISABLED_BY_DEFAULT); // Allows pages with keepalive requests to stay eligible for the back/forward // cache. @@ -993,6 +993,13 @@ // topic instead of one of the top topics. const base::FeatureParam<int> kBrowsingTopicsUseRandomTopicProbabilityPercent{ &kBrowsingTopics, "use_random_topic_probability_percent", 5}; +// Maximum duration between when a epoch is calculated and when a site starts +// using that new epoch's topics. The time chosen is a per-site random point in +// time between [calculation time, calculation time + max duration). +const base::FeatureParam<base::TimeDelta> + kBrowsingTopicsMaxEpochIntroductionDelay{ + &kBrowsingTopics, "browsing_topics_max_epoch_introduction_delay", + base::Days(2)}; // How many epochs (weeks) of API usage data (i.e. topics observations) will be // based off for the filtering of topics for a calling context. const base::FeatureParam<int> @@ -1019,9 +1026,10 @@ kBrowsingTopicsMaxNumberOfApiUsageContextDomainsToStorePerPageLoad{ &kBrowsingTopics, "max_number_of_api_usage_context_domains_to_store_per_page_load", 30}; -// Encodes the configuration parameters above. Each version number should only -// be mapped to one configuration set. In practice, this can be guaranteed by -// always bumping up the version number whenever parameters are updated. +// Encodes the configuration parameters above. A version number can be used for +// multiple configurations as long as they are compatible (from both Chrome's +// and users/websites' perspective). For a configuration that's incompatible +// with previous ones, a new dedicated version number should be used. const base::FeatureParam<int> kBrowsingTopicsConfigVersion{&kBrowsingTopics, "config_version", 1}; // The taxonomy version. This only affects the topics classification that occurs
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h index 4f3696b..eab810e0 100644 --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h
@@ -438,6 +438,8 @@ kBrowsingTopicsNumberOfTopTopicsPerEpoch; BLINK_COMMON_EXPORT extern const base::FeatureParam<int> kBrowsingTopicsUseRandomTopicProbabilityPercent; +BLINK_COMMON_EXPORT extern const base::FeatureParam<base::TimeDelta> + kBrowsingTopicsMaxEpochIntroductionDelay; BLINK_COMMON_EXPORT extern const base::FeatureParam<int> kBrowsingTopicsNumberOfEpochsOfObservationDataToUseForFiltering; BLINK_COMMON_EXPORT extern const base::FeatureParam<int>
diff --git a/third_party/blink/public/platform/web_media_player.h b/third_party/blink/public/platform/web_media_player.h index b095c3f..61cd152 100644 --- a/third_party/blink/public/platform/web_media_player.h +++ b/third_party/blink/public/platform/web_media_player.h
@@ -279,8 +279,7 @@ // Return current video frame unique id from compositor. The query is readonly // and should avoid any extra ops. Function returns absl::nullopt if current // frame is invalid or fails to access current frame. - // TODO(crbug.com/1328005): Change the id into a 64 bit value. - virtual absl::optional<int> CurrentFrameId() const = 0; + virtual absl::optional<media::VideoFrame::ID> CurrentFrameId() const = 0; // Provides a PaintCanvasVideoRenderer instance owned by this WebMediaPlayer. // Useful for ensuring that the paint/texturing operation for current frame is
diff --git a/third_party/blink/public/web/modules/mediastream/webmediaplayer_ms.h b/third_party/blink/public/web/modules/mediastream/webmediaplayer_ms.h index a71efae..605bc5bf 100644 --- a/third_party/blink/public/web/modules/mediastream/webmediaplayer_ms.h +++ b/third_party/blink/public/web/modules/mediastream/webmediaplayer_ms.h
@@ -130,7 +130,7 @@ const gfx::Rect& rect, cc::PaintFlags& flags) override; scoped_refptr<media::VideoFrame> GetCurrentFrameThenUpdate() override; - absl::optional<int> CurrentFrameId() const override; + absl::optional<media::VideoFrame::ID> CurrentFrameId() const override; media::PaintCanvasVideoRenderer* GetPaintCanvasVideoRenderer() override; void ResetCanvasCache();
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index 047f1c1..d4e2456 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -2868,6 +2868,8 @@ } element_animations->RestartAnimationOnCompositor(); } + + data->RemoveAnchorScrollData(); } DetachPrecedingPseudoElements(performing_reattach); @@ -8198,4 +8200,17 @@ return EnsureElementRareData().EnsureToggleMap(this); } +AnchorScrollData& Element::EnsureAnchorScrollData() { + return EnsureElementRareData().EnsureAnchorScrollData(this); +} + +void Element::RemoveAnchorScrollData() { + if (HasRareData()) + GetElementRareData()->RemoveAnchorScrollData(); +} + +AnchorScrollData* Element::GetAnchorScrollData() const { + return HasRareData() ? GetElementRareData()->GetAnchorScrollData() : nullptr; +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/dom/element.h b/third_party/blink/renderer/core/dom/element.h index 5fac0f8..a2419b2 100644 --- a/third_party/blink/renderer/core/dom/element.h +++ b/third_party/blink/renderer/core/dom/element.h
@@ -66,6 +66,7 @@ namespace blink { class AccessibleNode; +class AnchorScrollData; class AriaNotificationOptions; class Attr; class Attribute; @@ -1168,6 +1169,10 @@ PopupData* EnsurePopupData(); PopupData* GetPopupData() const; + AnchorScrollData& EnsureAnchorScrollData(); + void RemoveAnchorScrollData(); + AnchorScrollData* GetAnchorScrollData() const; + protected: const ElementData* GetElementData() const { return element_data_.Get(); } UniqueElementData& EnsureUniqueElementData();
diff --git a/third_party/blink/renderer/core/dom/element_rare_data.cc b/third_party/blink/renderer/core/dom/element_rare_data.cc index c074fee..0dabeb0 100644 --- a/third_party/blink/renderer/core/dom/element_rare_data.cc +++ b/third_party/blink/renderer/core/dom/element_rare_data.cc
@@ -36,6 +36,7 @@ #include "third_party/blink/renderer/core/css/cssom/inline_style_property_map.h" #include "third_party/blink/renderer/core/editing/ime/edit_context.h" #include "third_party/blink/renderer/core/html/custom/element_internals.h" +#include "third_party/blink/renderer/core/layout/anchor_scroll_data.h" #include "third_party/blink/renderer/core/resize_observer/resize_observation.h" #include "third_party/blink/renderer/core/resize_observer/resize_observer.h" #include "third_party/blink/renderer/core/style/computed_style.h" @@ -46,7 +47,7 @@ struct SameSizeAsElementRareData : NodeRareData { gfx::Vector2dF scroll_offset; void* pointers_or_strings[4]; - Member<void*> members[21]; + Member<void*> members[22]; FocusgroupFlags focusgroup_flags; HasInvalidationFlags has_invalidation_flags; bool flags[1]; @@ -121,6 +122,15 @@ return *element_internals_; } +AnchorScrollData& ElementRareData::EnsureAnchorScrollData( + Element* owner_element) { + DCHECK(!anchor_scroll_data_ || + anchor_scroll_data_->OwnerElement() == owner_element); + if (!anchor_scroll_data_) + anchor_scroll_data_ = MakeGarbageCollected<AnchorScrollData>(owner_element); + return *anchor_scroll_data_; +} + void ElementRareData::TraceAfterDispatch(blink::Visitor* visitor) const { visitor->Trace(dataset_); visitor->Trace(shadow_root_); @@ -143,6 +153,7 @@ visitor->Trace(last_intrinsic_size_); visitor->Trace(popup_data_); visitor->Trace(toggle_map_); + visitor->Trace(anchor_scroll_data_); NodeRareData::TraceAfterDispatch(visitor); }
diff --git a/third_party/blink/renderer/core/dom/element_rare_data.h b/third_party/blink/renderer/core/dom/element_rare_data.h index 8e32077..8234b50 100644 --- a/third_party/blink/renderer/core/dom/element_rare_data.h +++ b/third_party/blink/renderer/core/dom/element_rare_data.h
@@ -53,6 +53,7 @@ namespace blink { +class AnchorScrollData; class ContainerQueryData; class Element; class HTMLElement; @@ -276,6 +277,10 @@ CSSToggleMap* GetToggleMap() const { return toggle_map_.Get(); } CSSToggleMap& EnsureToggleMap(Element* owner_element); + AnchorScrollData* GetAnchorScrollData() const { return anchor_scroll_data_; } + void RemoveAnchorScrollData() { anchor_scroll_data_ = nullptr; } + AnchorScrollData& EnsureAnchorScrollData(Element*); + FocusgroupFlags GetFocusgroupFlags() const { return focusgroup_flags_; } void SetFocusgroupFlags(FocusgroupFlags flags) { focusgroup_flags_ = flags; } void ClearFocusgroupFlags() { focusgroup_flags_ = FocusgroupFlags::kNone; } @@ -392,6 +397,7 @@ Member<ResizeObserverSize> last_intrinsic_size_; Member<PopupData> popup_data_; Member<CSSToggleMap> toggle_map_; + Member<AnchorScrollData> anchor_scroll_data_; FocusgroupFlags focusgroup_flags_ = FocusgroupFlags::kNone; HasInvalidationFlags has_invalidation_flags_;
diff --git a/third_party/blink/renderer/core/inspector/inspector_trace_events.cc b/third_party/blink/renderer/core/inspector/inspector_trace_events.cc index bcd9245..7fef7f7 100644 --- a/third_party/blink/renderer/core/inspector/inspector_trace_events.cc +++ b/third_party/blink/renderer/core/inspector/inspector_trace_events.cc
@@ -763,6 +763,7 @@ const char kScrollbarChanged[] = "Scrollbar changed"; const char kDisplayLock[] = "Display lock"; const char kDevtools[] = "Inspected by devtools"; +const char kAnchorPositioning[] = "Anchor positioning"; } // namespace layout_invalidation_reason void inspector_layout_invalidation_tracking_event::Data(
diff --git a/third_party/blink/renderer/core/inspector/inspector_trace_events.h b/third_party/blink/renderer/core/inspector/inspector_trace_events.h index 9a4bd7e..be5b59d 100644 --- a/third_party/blink/renderer/core/inspector/inspector_trace_events.h +++ b/third_party/blink/renderer/core/inspector/inspector_trace_events.h
@@ -298,6 +298,7 @@ extern const char kScrollbarChanged[]; extern const char kDisplayLock[]; extern const char kDevtools[]; +extern const char kAnchorPositioning[]; } // namespace layout_invalidation_reason // LayoutInvalidationReasonForTracing is strictly for tracing. Blink logic must
diff --git a/third_party/blink/renderer/core/layout/anchor_scroll_data.cc b/third_party/blink/renderer/core/layout/anchor_scroll_data.cc new file mode 100644 index 0000000..e85cd75 --- /dev/null +++ b/third_party/blink/renderer/core/layout/anchor_scroll_data.cc
@@ -0,0 +1,170 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/core/layout/anchor_scroll_data.h" + +#include "third_party/blink/renderer/core/dom/document.h" +#include "third_party/blink/renderer/core/dom/node.h" +#include "third_party/blink/renderer/core/frame/local_frame_view.h" +#include "third_party/blink/renderer/core/layout/layout_box.h" +#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/paint/paint_layer.h" +#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" + +namespace blink { + +namespace { + +// Finds the LayoutObject of the anchor element given by anchor-scroll. +const LayoutObject* AnchorScrollObject(const LayoutObject* layout_object) { + if (!layout_object || !layout_object->IsOutOfFlowPositioned()) + return nullptr; + if (!layout_object->StyleRef().AnchorScroll()) + return nullptr; + + LayoutBox::NGPhysicalFragmentList containing_block_fragments = + layout_object->ContainingBlock()->PhysicalFragments(); + if (containing_block_fragments.IsEmpty()) + return nullptr; + + // TODO(crbug.com/1309178): Fix it when the containing block is fragmented or + // an inline box. + const NGPhysicalAnchorQuery* anchor_query = + containing_block_fragments.front().AnchorQuery(); + if (!anchor_query) + return nullptr; + + if (const NGPhysicalFragment* fragment = + anchor_query->Fragment(layout_object->StyleRef().AnchorScroll())) { + return fragment->GetLayoutObject(); + } + return nullptr; +} + +} // namespace + +AnchorScrollData::AnchorScrollData(Element* element) + : ScrollSnapshotClient(element->GetDocument().GetFrame()), + owner_(element) {} + +bool AnchorScrollData::IsActive() const { + return owner_->GetAnchorScrollData() == this; +} + +AnchorScrollData::SnapshotDiff AnchorScrollData::TakeAndCompareSnapshot( + bool update) { + DCHECK(IsActive()); + + HeapVector<Member<const PaintLayer>> new_scroll_container_layers; + gfx::Vector2dF new_accumulated_scroll_offset; + gfx::Vector2d new_accumulated_scroll_origin; + + if (const LayoutObject* anchor = + AnchorScrollObject(owner_->GetLayoutObject())) { + const PaintLayer* starting_layer = + anchor->ContainingScrollContainer()->Layer(); + const PaintLayer* bounding_layer = + owner_->GetLayoutBox()->Layer()->ContainingScrollContainerLayer(); + for (const PaintLayer* layer = starting_layer; layer != bounding_layer; + layer = layer->ContainingScrollContainerLayer()) { + // |bounding_layer| must be an ancestor of |starting_layer|, so we'll + // never reach a null layer here. + DCHECK(layer); + new_scroll_container_layers.push_back(layer); + new_accumulated_scroll_offset += + layer->GetScrollableArea()->GetScrollOffset(); + new_accumulated_scroll_origin += + layer->GetScrollableArea()->ScrollOrigin().OffsetFromOrigin(); + } + } + + SnapshotDiff diff; + if (scroll_container_layers_ != new_scroll_container_layers) { + diff = SnapshotDiff::kScrollers; + } else if (accumulated_scroll_offset_ != new_accumulated_scroll_offset || + accumulated_scroll_origin_ != new_accumulated_scroll_origin) { + // TODO(crbug.com/1309178): An offset-only change may result in a change in + // a different fallback position, which needs a re-layout and must be + // distinguished from a "pure" offset-only change that only needs a repaint. + // Implement that. + diff = SnapshotDiff::kOffsetOnly; + } else { + diff = SnapshotDiff::kNone; + } + + if (update && diff != SnapshotDiff::kNone) { + scroll_container_layers_.swap(new_scroll_container_layers); + accumulated_scroll_offset_ = new_accumulated_scroll_offset; + accumulated_scroll_origin_ = new_accumulated_scroll_origin; + } + + return diff; +} + +void AnchorScrollData::UpdateSnapshot() { + if (!IsActive()) + return; + + SnapshotDiff diff = TakeAndCompareSnapshot(true /* update */); + switch (diff) { + case SnapshotDiff::kNone: + return; + case SnapshotDiff::kOffsetOnly: + InvalidatePaint(); + return; + case SnapshotDiff::kScrollers: + InvalidateLayout(); + return; + } +} + +bool AnchorScrollData::ValidateSnapshot() { + // If this AnchorScrollData is detached in the previous style recalc, we no + // longer need to validate it. + if (!IsActive()) + return true; + + SnapshotDiff diff = TakeAndCompareSnapshot(true /* update */); + switch (diff) { + case SnapshotDiff::kNone: + case SnapshotDiff::kOffsetOnly: + // We don't need to rewind to layout recalc for offset-only diff, as this + // function is called at LayoutClean during lifecycle update, and + // offset-only diff only needs paint update. + return true; + case SnapshotDiff::kScrollers: + InvalidateLayout(); + return false; + } +} + +bool AnchorScrollData::ShouldScheduleNextService() { + return IsActive() && + TakeAndCompareSnapshot(false /*update*/) == SnapshotDiff::kNone; +} + +void AnchorScrollData::InvalidateLayout() { + DCHECK(IsActive()); + DCHECK(owner_->GetLayoutObject()); + owner_->GetLayoutObject()->SetNeedsLayoutAndFullPaintInvalidation( + layout_invalidation_reason::kAnchorPositioning); +} + +void AnchorScrollData::InvalidatePaint() { + DCHECK(IsActive()); + DCHECK(owner_->GetLayoutObject()); + // TODO(crbug.com/1309178): This causes a main frame commit, which is + // unnecessary when there's offset-only changes and compositor has already + // adjusted the element correctly. Try to avoid that. See also + // crbug.com/1378705 as sticky position has the same issue. + owner_->GetLayoutObject()->SetNeedsPaintPropertyUpdate(); +} + +void AnchorScrollData::Trace(Visitor* visitor) const { + visitor->Trace(owner_); + visitor->Trace(scroll_container_layers_); + ScrollSnapshotClient::Trace(visitor); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/core/layout/anchor_scroll_data.h b/third_party/blink/renderer/core/layout/anchor_scroll_data.h new file mode 100644 index 0000000..a6f3087 --- /dev/null +++ b/third_party/blink/renderer/core/layout/anchor_scroll_data.h
@@ -0,0 +1,87 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_ANCHOR_SCROLL_DATA_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_ANCHOR_SCROLL_DATA_H_ + +#include "third_party/blink/renderer/core/layout/geometry/physical_offset.h" +#include "third_party/blink/renderer/core/scroll/scroll_snapshot_client.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" +#include "ui/gfx/geometry/vector2d.h" +#include "ui/gfx/geometry/vector2d_f.h" + +namespace blink { + +class Element; +class PaintLayer; + +// Created for each anchor-positioned element that uses anchor-scroll. +// Stores a snapshot of all the scroll containers of the anchor up to the +// containing block (exclusively) for use by layout, paint and compositing. +// The snapshot is updated once per frame update on top of animation frame to +// avoid layout cycling. +class AnchorScrollData : public GarbageCollected<AnchorScrollData>, + public ScrollSnapshotClient { + public: + explicit AnchorScrollData(Element*); + + Element* OwnerElement() const { return owner_; } + + bool HasTranslation() const { return scroll_container_layers_.size(); } + gfx::Vector2dF AccumulatedScrollOffset() const { + return accumulated_scroll_offset_; + } + gfx::Vector2d AccumulatedScrollOrigin() const { + return accumulated_scroll_origin_; + } + const HeapVector<Member<const PaintLayer>>& ScrollContainerLayers() const { + return scroll_container_layers_; + } + + // Utility function that returns accumulated_scroll_offset_ rounded as a + // PhysicalOffset. + PhysicalOffset TranslationAsPhysicalOffset() const { + return -PhysicalOffset::FromVector2dFFloor(accumulated_scroll_offset_); + } + + // Returns whether |owner_| is still an anchor-positioned element using |this| + // as its AnchroScrollData. + bool IsActive() const; + + // ScrollSnapshotClient: + void UpdateSnapshot() override; + bool ValidateSnapshot() override; + bool ShouldScheduleNextService() override; + + void Trace(Visitor*) const override; + + private: + enum class SnapshotDiff { kNone, kScrollers, kOffsetOnly }; + // Takes an up-to-date snapshot, and compares it with the existing one. + // If |update| is true, also rewrites the existing snapshot. + SnapshotDiff TakeAndCompareSnapshot(bool update); + + void InvalidateLayout(); + void InvalidatePaint(); + + // The anchor-positioned element. + Member<Element> owner_; + + // Paint layers of the ancestor scroll containers of the anchor element, up to + // the containing block of |owner_| (exclusively). + HeapVector<Member<const PaintLayer>> scroll_container_layers_; + + // Sum of the scroll offsets of the above scroll containers. This is the + // offset that the element should be translated in position-fallback choosing + // and paint. + gfx::Vector2dF accumulated_scroll_offset_; + + // Sum of the scroll origins of the above scroll containers. Used by + // compositor to deal with writing modes. + gfx::Vector2d accumulated_scroll_origin_; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_ANCHOR_SCROLL_DATA_H_
diff --git a/third_party/blink/renderer/core/layout/anchor_scroll_data_test.cc b/third_party/blink/renderer/core/layout/anchor_scroll_data_test.cc new file mode 100644 index 0000000..f64952c --- /dev/null +++ b/third_party/blink/renderer/core/layout/anchor_scroll_data_test.cc
@@ -0,0 +1,250 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/core/layout/anchor_scroll_data.h" + +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/renderer/core/animation/animation_clock.h" +#include "third_party/blink/renderer/core/dom/dom_token_list.h" +#include "third_party/blink/renderer/core/page/page_animator.h" +#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" +#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" + +namespace blink { + +class AnchorScrollDataTest : public RenderingTest, + private ScopedCSSAnchorPositioningForTest { + public: + AnchorScrollDataTest() : ScopedCSSAnchorPositioningForTest(true) {} + + void SimulateFrame() { + // Advance time by 100 ms. + auto new_time = GetAnimationClock().CurrentTime() + base::Milliseconds(100); + GetPage().Animator().ServiceScriptedAnimations(new_time); + } + + bool AnimationScheduled() const { + return GetChromeClient().AnimationScheduled(); + } + void UnsetAnimationScheduled() { + GetChromeClient().UnsetAnimationScheduled(); + } + + void ScrollTo(const char* id, int offset) { + auto* scroller = To<LayoutBoxModelObject>(GetLayoutObjectByElementId(id)); + DCHECK(scroller) << id; + DCHECK(scroller->GetScrollableArea()) << id; + scroller->GetScrollableArea()->SetScrollOffset( + ScrollOffset(0, offset), mojom::blink::ScrollType::kProgrammatic); + } +}; + +TEST_F(AnchorScrollDataTest, HasDataAndTranslation) { + // Anchor positioning is NG-only. + if (!RuntimeEnabledFeatures::LayoutNGEnabled()) + return; + + SetBodyInnerHTML(R"HTML( + <div style="position: relative"> + <div style="overflow: scroll; height: 1px;"> + Lorem ipsum + <span id="anchor" style="anchor-name: --a1">anchor</span> + dolor sit amet + </div> + <div id="anchored" style="position: absolute; anchor-scroll: --a1"> + anchored + </div> + <div id="no-anchor" style="position: absolute; anchor-scroll: --b1"> + anchor not found + </div> + <div id="not-anchor-positioned" style="anchor-scroll: --a1"> + not anchor positioned + </div> + </div> + )HTML"); + + const Element* anchored = GetElementById("anchored"); + EXPECT_TRUE(anchored->GetAnchorScrollData()); + EXPECT_TRUE(anchored->GetAnchorScrollData()->HasTranslation()); + + const Element* no_anchor = GetElementById("no-anchor"); + EXPECT_TRUE(no_anchor->GetAnchorScrollData()); + EXPECT_FALSE(no_anchor->GetAnchorScrollData()->HasTranslation()); + + const Element* not_anchor_positioned = + GetElementById("not-anchor-positioned"); + EXPECT_FALSE(not_anchor_positioned->GetAnchorScrollData()); +} + +// Tests that AnchorScrollData should be properly detached if an element changes +// from using anchor-scroll to no longer using anchor-scroll +TEST_F(AnchorScrollDataTest, Detach) { + // Anchor positioning is NG-only. + if (!RuntimeEnabledFeatures::LayoutNGEnabled()) + return; + + SetBodyInnerHTML(R"HTML( + <style>.anchored { position: absolute; anchor-scroll: --a1; }</style> + <div style="position: relative> + <div style="overflow: scroll; height: 1px;"> + Lorem ipsum + <span id="anchor" style="anchor-name: --a1">anchor</span> + dolor sit amet + </div> + + <div class="anchored" id="remove">Will be removed</div> + <div class="anchored" id="display-none">Will be display: none</div> + <div class="anchored" id="in-flow">Will be in flow</div> + </div> + )HTML"); + + Element* remove = GetElementById("remove"); + Element* display_none = GetElementById("display-none"); + Element* in_flow = GetElementById("in-flow"); + + EXPECT_TRUE(remove->GetAnchorScrollData()); + EXPECT_TRUE(display_none->GetAnchorScrollData()); + EXPECT_TRUE(in_flow->GetAnchorScrollData()); + + remove->remove(); + display_none->setAttribute(html_names::kStyleAttr, "display: none"); + in_flow->setAttribute(html_names::kStyleAttr, "position: static"); + + UnsetAnimationScheduled(); + + SimulateFrame(); + UpdateAllLifecyclePhasesForTest(); + + // AnchorScrollData should be detached when element no longer needs it. + EXPECT_FALSE(remove->GetAnchorScrollData()); + EXPECT_FALSE(display_none->GetAnchorScrollData()); + EXPECT_FALSE(in_flow->GetAnchorScrollData()); + + // We shouldn't need a new frame for detached AnchorScrollData. + EXPECT_FALSE(AnimationScheduled()); +} + +// Verifies that a new frame is scheduled if a style update changes the size of +// a scroller, which in turn changes the scroll offset. +TEST_F(AnchorScrollDataTest, ScrollerSizeChange) { + // Anchor positioning is NG-only. + if (!RuntimeEnabledFeatures::LayoutNGEnabled()) + return; + + SetBodyInnerHTML(R"HTML( + <style> + #scroller { overflow: scroll; height: 100px; } + #scroller.changed { height: 200px; } + #spacer { height: 400px; } + #anchor { anchor-name: --a; } + #anchored { + position: absolute; + top: anchor(--a top); + anchor-scroll: --a; + } + </style> + <div style="position: relative"> + <div id="scroller"> + <div id="anchor"></div> + <div id="spacer"></div> + </div> + <div id="anchored"></div> + </div> + )HTML"); + + ScrollTo("scroller", 300); + + SimulateFrame(); + UpdateAllLifecyclePhasesForTest(); + + Element* anchored = GetElementById("anchored"); + EXPECT_TRUE(anchored->GetAnchorScrollData()); + EXPECT_EQ(ScrollOffset(0, 300), + anchored->GetAnchorScrollData()->AccumulatedScrollOffset()); + + GetElementById("scroller")->classList().Add("changed"); + + // This shouldn't update AnchorScrollData, because style isn't updated yet. + SimulateFrame(); + EXPECT_TRUE(anchored->GetAnchorScrollData()); + EXPECT_EQ(ScrollOffset(0, 300), + anchored->GetAnchorScrollData()->AccumulatedScrollOffset()); + + UnsetAnimationScheduled(); + UpdateAllLifecyclePhasesForTest(); + + // Now scroller is resized to 300px height, and the scroll offset is reduced + // to 200 as the result. This makes the AnchorScrollData stale and triggers a + // frame update. + EXPECT_TRUE(AnimationScheduled()); + + // Snapshot is updated in the next frame. + SimulateFrame(); + EXPECT_TRUE(anchored->GetAnchorScrollData()); + EXPECT_EQ(ScrollOffset(0, 200), + anchored->GetAnchorScrollData()->AccumulatedScrollOffset()); +} + +// Verifies that a new frame is scheduled if a style update changes the size of +// the content of a scroller, which in turn changes the scroll offset. +TEST_F(AnchorScrollDataTest, ScrollContentSizeChange) { + // Anchor positioning is NG-only. + if (!RuntimeEnabledFeatures::LayoutNGEnabled()) + return; + + SetBodyInnerHTML(R"HTML( + <style> + #scroller { overflow: scroll; height: 100px; } + #spacer { height: 400px; } + #spacer.changed { height: 300px; } + #anchor { anchor-name: --a; } + #anchored { + position: absolute; + top: anchor(--a top); + anchor-scroll: --a; + } + </style> + <div style="position: relative"> + <div id="scroller"> + <div id="anchor"></div> + <div id="spacer"></div> + </div> + <div id="anchored"></div> + </div> + )HTML"); + + ScrollTo("scroller", 300); + + SimulateFrame(); + UpdateAllLifecyclePhasesForTest(); + + Element* anchored = GetElementById("anchored"); + EXPECT_TRUE(anchored->GetAnchorScrollData()); + EXPECT_EQ(ScrollOffset(0, 300), + anchored->GetAnchorScrollData()->AccumulatedScrollOffset()); + + GetElementById("spacer")->classList().Add("changed"); + + // This shouldn't update AnchorScrollData, because style isn't updated yet. + SimulateFrame(); + EXPECT_TRUE(anchored->GetAnchorScrollData()); + EXPECT_EQ(ScrollOffset(0, 300), + anchored->GetAnchorScrollData()->AccumulatedScrollOffset()); + + UnsetAnimationScheduled(); + UpdateAllLifecyclePhasesForTest(); + + // Now scroll content is resized to 300px height, and the scroll offset is + // reduced to 200 as the result. This makes the AnchorScrollData stale and + // triggers a frame update. + EXPECT_TRUE(AnimationScheduled()); + + // Snapshot is updated in the next frame. + SimulateFrame(); + EXPECT_TRUE(anchored->GetAnchorScrollData()); + EXPECT_EQ(ScrollOffset(0, 200), + anchored->GetAnchorScrollData()->AccumulatedScrollOffset()); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/core/layout/build.gni b/third_party/blink/renderer/core/layout/build.gni index 9d784f68..4dad0a4 100644 --- a/third_party/blink/renderer/core/layout/build.gni +++ b/third_party/blink/renderer/core/layout/build.gni
@@ -27,6 +27,8 @@ ] blink_core_sources_layout = [ + "anchor_scroll_data.cc", + "anchor_scroll_data.h", "api/line_layout_api_shim.h", "api/line_layout_block_flow.h", "api/line_layout_box.h", @@ -839,6 +841,7 @@ } blink_core_tests_layout = [ + "anchor_scroll_data_test.cc", "api/selection_state_test.cc", "collapsed_border_value_test.cc", "deferred_shaping_test.cc",
diff --git a/third_party/blink/renderer/core/layout/layout_box.cc b/third_party/blink/renderer/core/layout/layout_box.cc index 0a62fba1..07d2655 100644 --- a/third_party/blink/renderer/core/layout/layout_box.cc +++ b/third_party/blink/renderer/core/layout/layout_box.cc
@@ -56,6 +56,7 @@ #include "third_party/blink/renderer/core/html/shadow/shadow_element_utils.h" #include "third_party/blink/renderer/core/input/event_handler.h" #include "third_party/blink/renderer/core/input_type_names.h" +#include "third_party/blink/renderer/core/layout/anchor_scroll_data.h" #include "third_party/blink/renderer/core/layout/api/line_layout_block_flow.h" #include "third_party/blink/renderer/core/layout/api/line_layout_box.h" #include "third_party/blink/renderer/core/layout/box_layout_extra_input.h" @@ -3214,8 +3215,8 @@ offset += To<LayoutInline>(o)->OffsetForInFlowPositionedInline(*this); } - if (AnchorScrollObject()) - offset += ComputeAnchorScrollOffset(); + if (HasAnchorScrollTranslation()) + offset += AnchorScrollTranslationOffset(); return offset; } @@ -3849,8 +3850,8 @@ // LayoutObject::setStyle, the relative position flag on the LayoutObject // has been cleared, so use the one on the style(). container_offset += OffsetForInFlowPosition(); - } else if (UNLIKELY(AnchorScrollObject())) { - container_offset += ComputeAnchorScrollOffset(); + } else if (UNLIKELY(HasAnchorScrollTranslation())) { + container_offset += AnchorScrollTranslationOffset(); } if (skip_info.FilterSkipped()) { @@ -7281,8 +7282,8 @@ return false; // In LayoutNG, treat any scrollable container as monolithic. - if (engine == kNGFragmentationEngine && StyleRef().IsScrollContainer()) - return true; + if (engine == kNGFragmentationEngine) + return IsScrollContainer(); // We will paginate as long as we don't scroll overflow in the pagination // direction. @@ -8148,69 +8149,20 @@ return constraining_rect; } -const LayoutObject* LayoutBox::AnchorScrollObject() const { - if (!StyleRef().AnchorScroll()) - return nullptr; - - if (StyleRef().GetPosition() != EPosition::kAbsolute && - StyleRef().GetPosition() != EPosition::kFixed) { - return nullptr; +bool LayoutBox::HasAnchorScrollTranslation() const { + if (Element* element = DynamicTo<Element>(GetNode())) { + return element->GetAnchorScrollData() && + element->GetAnchorScrollData()->HasTranslation(); } - - NGPhysicalFragmentList containing_block_fragments = - ContainingBlock()->PhysicalFragments(); - if (containing_block_fragments.IsEmpty()) - return nullptr; - - // TODO(crbug.com/1309178): Fix it when the containing block is fragmented. - const NGPhysicalAnchorQuery* anchor_query = - containing_block_fragments.front().AnchorQuery(); - if (!anchor_query) - return nullptr; - - if (const NGPhysicalFragment* fragment = - anchor_query->Fragment(StyleRef().AnchorScroll())) { - return fragment->GetLayoutObject(); - } - return nullptr; + return false; } -const LayoutBox* LayoutBox::AnchorScrollContainer() const { - if (const LayoutObject* object = AnchorScrollObject()) { - const LayoutBox* scroller = object->ContainingScrollContainer(); - if (scroller != ContainingScrollContainer()) - return scroller; +PhysicalOffset LayoutBox::AnchorScrollTranslationOffset() const { + if (Element* element = DynamicTo<Element>(GetNode())) { + if (AnchorScrollData* data = element->GetAnchorScrollData()) + return data->TranslationAsPhysicalOffset(); } - return nullptr; -} - -LayoutBox::AnchorScrollData LayoutBox::ComputeAnchorScrollData() const { - if (!AnchorScrollContainer()) - return AnchorScrollData(); - - const PaintLayer* inner_most_scroll_container_layer = - AnchorScrollContainer()->Layer(); - const PaintLayer* outer_most_scroll_container_layer = - inner_most_scroll_container_layer; - gfx::Vector2dF accumulated_scroll_offset(0, 0); - gfx::Vector2d accumulated_scroll_origin(0, 0); - for (const PaintLayer* layer = inner_most_scroll_container_layer; layer; - layer = layer->ContainingScrollContainerLayer()) { - if (layer == Layer()->ContainingScrollContainerLayer()) - break; - accumulated_scroll_offset += layer->GetScrollableArea()->GetScrollOffset(); - accumulated_scroll_origin += - layer->GetScrollableArea()->ScrollOrigin().OffsetFromOrigin(); - outer_most_scroll_container_layer = layer; - } - - return {inner_most_scroll_container_layer, outer_most_scroll_container_layer, - accumulated_scroll_offset, accumulated_scroll_origin}; -} - -PhysicalOffset LayoutBox::ComputeAnchorScrollOffset() const { - return -PhysicalOffset::FromVector2dFFloor( - ComputeAnchorScrollData().accumulated_scroll_offset); + return PhysicalOffset(); } } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/layout_box.h b/third_party/blink/renderer/core/layout/layout_box.h index 20bf54e..05564fe 100644 --- a/third_party/blink/renderer/core/layout/layout_box.h +++ b/third_party/blink/renderer/core/layout/layout_box.h
@@ -2145,29 +2145,8 @@ // See StickyPositionScrollingConstraints::constraining_rect. PhysicalRect ComputeStickyConstrainingRect() const; - // Returns the LayoutObject of the anchor element specified by the CSS - // 'anchor-scroll' property. Returns nullptr if the anchor query is invalid. - const LayoutObject* AnchorScrollObject() const; - - // If the AnchorScrollObject() is non-null and in a different scroll - // container, returns that container, so that at paint time, we can apply an - // offset to this element when the returned scroll container is scrolled. - // Returns nullptr otherwise. - const LayoutBox* AnchorScrollContainer() const; - - struct AnchorScrollData { - const PaintLayer* inner_most_scroll_container_layer = nullptr; - const PaintLayer* outer_most_scroll_container_layer = nullptr; - gfx::Vector2dF accumulated_scroll_offset; - gfx::Vector2d accumulated_scroll_origin; - - STACK_ALLOCATED(); - }; - AnchorScrollData ComputeAnchorScrollData() const; - - // Utility function that returns and rounds accumulated_scroll_offset of - // AnchorScrollData as a PhysicalOffset. - PhysicalOffset ComputeAnchorScrollOffset() const; + bool HasAnchorScrollTranslation() const; + PhysicalOffset AnchorScrollTranslationOffset() const; protected: ~LayoutBox() override;
diff --git a/third_party/blink/renderer/core/layout/layout_box_model_object.cc b/third_party/blink/renderer/core/layout/layout_box_model_object.cc index c933c1f..ba4f05aa 100644 --- a/third_party/blink/renderer/core/layout/layout_box_model_object.cc +++ b/third_party/blink/renderer/core/layout/layout_box_model_object.cc
@@ -355,6 +355,13 @@ if ((IsOutOfFlowPositioned() || IsRelPositioned()) && Parent()) DisallowDeferredShapingIfNegativePositioned(); + + if (Element* element = DynamicTo<Element>(GetNode())) { + if (IsOutOfFlowPositioned() && StyleRef().AnchorScroll()) + element->EnsureAnchorScrollData(); + else + element->RemoveAnchorScrollData(); + } } void LayoutBoxModelObject::InsertedIntoTree() { @@ -1056,8 +1063,8 @@ To<LayoutBox>(offset_parent_object)->PhysicalLocation(); } } else if (UNLIKELY(IsBox() && - To<LayoutBox>(this)->AnchorScrollContainer())) { - reference_point += To<LayoutBox>(this)->ComputeAnchorScrollOffset(); + To<LayoutBox>(this)->HasAnchorScrollTranslation())) { + reference_point += To<LayoutBox>(this)->AnchorScrollTranslationOffset(); } if (offset_parent_object->IsLayoutInline()) {
diff --git a/third_party/blink/renderer/core/layout/layout_box_test.cc b/third_party/blink/renderer/core/layout/layout_box_test.cc index 5fc941fd..186b1fa88 100644 --- a/third_party/blink/renderer/core/layout/layout_box_test.cc +++ b/third_party/blink/renderer/core/layout/layout_box_test.cc
@@ -2005,41 +2005,6 @@ GetDocument().getElementById("textarea"))); } -TEST_P(LayoutBoxTest, AnchorScrollObject) { - // LayoutBox::AnchorScrollObject() calculation is NG-only. - if (!RuntimeEnabledFeatures::LayoutNGEnabled()) - return; - - ScopedCSSAnchorPositioningForTest enabled_scope(true); - - SetBodyInnerHTML(R"HTML( - <div style="position: relative"> - <div> - Lorem ipsum - <span id="anchor" style="anchor-name: --a1">anchor</span> - dolor sit amet - </div> - <div id="anchored" style="position: absolute; anchor-scroll: --a1"> - anchored - </div> - <div id="no-anchor" style="position: absolute; anchor-scroll: --b1"> - anchor not found - </div> - </div> - )HTML"); - - UpdateAllLifecyclePhasesForTest(); - - const LayoutBox* anchored = - To<LayoutBox>(GetLayoutObjectByElementId("anchored")); - EXPECT_EQ(anchored->AnchorScrollObject(), - GetLayoutObjectByElementId("anchor")); - - const LayoutBox* anchor_not_found = - To<LayoutBox>(GetLayoutObjectByElementId("no-anchor")); - EXPECT_FALSE(anchor_not_found->AnchorScrollObject()); -} - class LayoutBoxBackgroundPaintLocationTest : public RenderingTest, public PaintTestConfigurations { protected:
diff --git a/third_party/blink/renderer/core/layout/visual_rect_mapping_test.cc b/third_party/blink/renderer/core/layout/visual_rect_mapping_test.cc index 8525dcc..86baa7fcd 100644 --- a/third_party/blink/renderer/core/layout/visual_rect_mapping_test.cc +++ b/third_party/blink/renderer/core/layout/visual_rect_mapping_test.cc
@@ -5,6 +5,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/core/layout/layout_embedded_content.h" #include "third_party/blink/renderer/core/layout/layout_view.h" +#include "third_party/blink/renderer/core/page/page_animator.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" #include "third_party/blink/renderer/core/paint/paint_property_tree_printer.h" @@ -1385,6 +1386,10 @@ auto* scrollable_area = GetScrollableArea(To<LayoutBlock>(GetLayoutBoxByElementId("scroller"))); scrollable_area->ScrollToAbsolutePosition(gfx::PointF(400, 0)); + + // Simulates a frame to update anchor-scroll snapshots. + GetPage().Animator().ServiceScriptedAnimations( + GetAnimationClock().CurrentTime() + base::Milliseconds(100)); UpdateAllLifecyclePhasesForTest(); // #anchored is moved into view and should have a non-empty visual rect
diff --git a/third_party/blink/renderer/core/paint/compositing/compositing_reason_finder.cc b/third_party/blink/renderer/core/paint/compositing/compositing_reason_finder.cc index 0e8c973..bc64469 100644 --- a/third_party/blink/renderer/core/paint/compositing/compositing_reason_finder.cc +++ b/third_party/blink/renderer/core/paint/compositing/compositing_reason_finder.cc
@@ -248,7 +248,7 @@ reasons |= CompositingReason::kFixedPosition; } - if (box->AnchorScrollContainer()) + if (box->HasAnchorScrollTranslation()) reasons |= CompositingReason::kAnchorScroll; }
diff --git a/third_party/blink/renderer/core/paint/paint_layer.cc b/third_party/blink/renderer/core/paint/paint_layer.cc index 68dd90c7..d4073c1d 100644 --- a/third_party/blink/renderer/core/paint/paint_layer.cc +++ b/third_party/blink/renderer/core/paint/paint_layer.cc
@@ -61,6 +61,7 @@ #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/frame/visual_viewport.h" #include "third_party/blink/renderer/core/html_names.h" +#include "third_party/blink/renderer/core/layout/anchor_scroll_data.h" #include "third_party/blink/renderer/core/layout/fragmentainer_iterator.h" #include "third_party/blink/renderer/core/layout/geometry/transform_state.h" #include "third_party/blink/renderer/core/layout/hit_test_request.h" @@ -310,30 +311,6 @@ UpdateLayerPosition(); } - if (LayoutBox* box = DynamicTo<LayoutBox>(GetLayoutObject()); - box && box->AnchorScrollContainer()) { - LayoutBox::AnchorScrollData anchor_scroll_data = - box->ComputeAnchorScrollData(); - DCHECK(anchor_scroll_data.inner_most_scroll_container_layer); - - bool needs_paint_property_update = false; - for (const PaintLayer* scroller_layer = - anchor_scroll_data.inner_most_scroll_container_layer; - ; scroller_layer = scroller_layer->ContainingScrollContainerLayer()) { - DCHECK(scroller_layer); - bool is_new_entry = - scroller_layer->GetScrollableArea()->AddAnchorPositionedLayer(this); - if (!is_new_entry) - break; - needs_paint_property_update = true; - if (scroller_layer == - anchor_scroll_data.outer_most_scroll_container_layer) - break; - } - if (needs_paint_property_update) - box->SetNeedsPaintPropertyUpdate(); - } - // Display-locked elements always have a PaintLayer, meaning that the // PaintLayer traversal won't skip locked elements. Thus, we don't have to do // an ancestor check, and simply skip iterating children when this element is @@ -817,7 +794,6 @@ for (auto* layer = this; layer; layer = layer->Parent()) { if (auto* scrollable_area = layer->GetScrollableArea()) { scrollable_area->InvalidateAllStickyConstraints(); - scrollable_area->InvalidateAllAnchorPositionedLayers(); } } @@ -1058,8 +1034,8 @@ } else if (layer->GetLayoutObject().IsInFlowPositioned()) { location += layer->GetLayoutObject().OffsetForInFlowPosition(); } else if (layer->GetLayoutObject().IsBox() && - layer->GetLayoutBox()->AnchorScrollObject()) { - location += layer->GetLayoutBox()->ComputeAnchorScrollOffset(); + layer->GetLayoutBox()->HasAnchorScrollTranslation()) { + location += layer->GetLayoutBox()->AnchorScrollTranslationOffset(); } location -= PhysicalOffset(containing_layer->PixelSnappedScrolledContentOffset());
diff --git a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc index 93616f7..c24390df 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc
@@ -126,7 +126,6 @@ void PaintLayerScrollableAreaRareData::Trace(Visitor* visitor) const { visitor->Trace(sticky_layers_); - visitor->Trace(anchor_positioned_layers_); } const int kResizerControlExpandRatioForTouch = 2; @@ -539,7 +538,6 @@ void PaintLayerScrollableArea::InvalidatePaintForScrollOffsetChange() { InvalidatePaintForStickyDescendants(); - InvalidatePaintForAnchorPositionedLayers(); auto* box = GetLayoutBox(); auto* frame_view = box->GetFrameView(); @@ -958,7 +956,6 @@ void PaintLayerScrollableArea::UpdateAfterLayout() { InvalidateAllStickyConstraints(); - InvalidateAllAnchorPositionedLayers(); bool is_horizontal_scrollbar_frozen; bool is_vertical_scrollbar_frozen; @@ -2125,30 +2122,6 @@ } } -bool PaintLayerScrollableArea::AddAnchorPositionedLayer(PaintLayer* layer) { - auto add_result = EnsureRareData().anchor_positioned_layers_.insert(layer); - return add_result.is_new_entry; -} - -void PaintLayerScrollableArea::InvalidateAllAnchorPositionedLayers() { - if (rare_data_) - rare_data_->anchor_positioned_layers_.clear(); -} - -void PaintLayerScrollableArea::InvalidatePaintForAnchorPositionedLayers() { - // If this is called during layout, anchor_positioned_layers_ may contain - // stale pointers. Return because we'll InvalidateAllAnchorPositionedLayers(), - // and we'll SetNeedsPaintPropertyUpdate() when updating anchor positioned - // layers. - if (GetLayoutBox()->NeedsLayout()) - return; - - if (PaintLayerScrollableAreaRareData* d = RareData()) { - for (PaintLayer* anchor_positioned_layer : d->anchor_positioned_layers_) - anchor_positioned_layer->GetLayoutObject().SetNeedsPaintPropertyUpdate(); - } -} - gfx::Vector2d PaintLayerScrollableArea::OffsetFromResizeCorner( const gfx::Point& absolute_point) const { // Currently the resize corner is either the bottom right corner or the bottom
diff --git a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h index 33b6e5a..03fb8f8 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h +++ b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h
@@ -81,7 +81,6 @@ void Trace(Visitor* visitor) const; HeapLinkedHashSet<Member<PaintLayer>> sticky_layers_; - HeapHashSet<Member<PaintLayer>> anchor_positioned_layers_; absl::optional<cc::SnapContainerData> snap_container_data_; bool snap_container_data_needs_update_ = true; bool needs_resnap_ = false; @@ -528,11 +527,6 @@ void InvalidateAllStickyConstraints(); void InvalidatePaintForStickyDescendants(); - // Returns true if the layer is not already added. - bool AddAnchorPositionedLayer(PaintLayer*); - void InvalidateAllAnchorPositionedLayers(); - void InvalidatePaintForAnchorPositionedLayers(); - uint32_t GetNonCompositedMainThreadScrollingReasons() { return non_composited_main_thread_scrolling_reasons_; }
diff --git a/third_party/blink/renderer/core/paint/paint_layer_test.cc b/third_party/blink/renderer/core/paint/paint_layer_test.cc index 1caa44e..bbaa215 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_test.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_test.cc
@@ -9,6 +9,7 @@ #include "third_party/blink/renderer/core/html/html_iframe_element.h" #include "third_party/blink/renderer/core/layout/layout_box_model_object.h" #include "third_party/blink/renderer/core/layout/layout_view.h" +#include "third_party/blink/renderer/core/page/page_animator.h" #include "third_party/blink/renderer/core/paint/paint_controller_paint_test.h" #include "third_party/blink/renderer/core/paint/paint_layer_paint_order_iterator.h" #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" @@ -2718,6 +2719,10 @@ auto* scrollable_area = GetPaintLayerByElementId("scroller")->GetScrollableArea(); scrollable_area->ScrollToAbsolutePosition(gfx::PointF(400, 0)); + + // Similates a frame to update anchor-scroll snapshots. + GetPage().Animator().ServiceScriptedAnimations( + GetAnimationClock().CurrentTime() + base::Milliseconds(100)); UpdateAllLifecyclePhasesForTest(); {
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc index 7c97a9f..4f6937c 100644 --- a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc +++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
@@ -19,6 +19,7 @@ #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/frame/visual_viewport.h" +#include "third_party/blink/renderer/core/layout/anchor_scroll_data.h" #include "third_party/blink/renderer/core/layout/fragmentainer_iterator.h" #include "third_party/blink/renderer/core/layout/geometry/transform_state.h" #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" @@ -466,7 +467,7 @@ static bool NeedsAnchorScrollTranslation(const LayoutObject& object) { if (const LayoutBox* box = DynamicTo<LayoutBox>(object)) - return box->AnchorScrollContainer(); + return box->HasAnchorScrollTranslation(); return false; } @@ -774,12 +775,15 @@ if (NeedsPaintPropertyUpdate()) { if (NeedsAnchorScrollTranslation(object_)) { const auto& box = To<LayoutBox>(object_); - LayoutBox::AnchorScrollData anchor_scroll_data = - box.ComputeAnchorScrollData(); + const AnchorScrollData& anchor_scroll_data = + *To<Element>(box.GetNode())->GetAnchorScrollData(); gfx::Vector2dF translation_offset = - -anchor_scroll_data.accumulated_scroll_offset; + -anchor_scroll_data.AccumulatedScrollOffset(); TransformPaintPropertyNode::State state{translation_offset}; + // TODO(crbug.com/1309178): We should disable composited scrolling if the + // snapshot's scrollers do not match the current scrollers. + DCHECK(full_context_.direct_compositing_reasons & CompositingReason::kAnchorScroll); state.direct_compositing_reasons = CompositingReason::kAnchorScroll; @@ -798,14 +802,16 @@ scoped_refptr<const TransformPaintPropertyNode> inner_most_scroll_container = - anchor_scroll_data.inner_most_scroll_container_layer + anchor_scroll_data.ScrollContainerLayers() + .front() ->GetLayoutObject() .FirstFragment() .PaintProperties() ->ScrollTranslation(); scoped_refptr<const TransformPaintPropertyNode> outer_most_scroll_container = - anchor_scroll_data.outer_most_scroll_container_layer + anchor_scroll_data.ScrollContainerLayers() + .back() ->GetLayoutObject() .FirstFragment() .PaintProperties() @@ -814,7 +820,7 @@ TransformPaintPropertyNode::AnchorScrollContainersData>( std::move(inner_most_scroll_container), std::move(outer_most_scroll_container), - anchor_scroll_data.accumulated_scroll_origin); + anchor_scroll_data.AccumulatedScrollOrigin()); OnUpdateTransform(properties_->UpdateAnchorScrollTranslation( *context_.current.transform, std::move(state)));
diff --git a/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.cc b/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.cc index 27e7fc4..9611a04 100644 --- a/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.cc +++ b/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.cc
@@ -22,13 +22,14 @@ namespace { -int GetFrameId(const scoped_refptr<media::VideoFrame>& video_frame) { +media::VideoFrame::ID GetFrameId( + const scoped_refptr<media::VideoFrame>& video_frame) { return video_frame->unique_id(); } -int GetFrameId(const scoped_refptr<media::AudioBuffer>&) { +media::VideoFrame::ID GetFrameId(const scoped_refptr<media::AudioBuffer>&) { NOTREACHED(); - return -1; + return media::VideoFrame::ID(); } } // namespace @@ -309,7 +310,9 @@ if (!media_frame.has_value()) return; - int frame_id = MustUseMonitor() ? GetFrameId(media_frame.value()) : -1; + media::VideoFrame::ID frame_id = MustUseMonitor() + ? GetFrameId(media_frame.value()) + : media::VideoFrame::ID(); Controller()->Enqueue(MakeBlinkFrame(std::move(media_frame.value()))); // Update the monitor after creating the Blink VideoFrame to avoid // temporarily removing the frame from the monitor. @@ -335,7 +338,7 @@ template <typename NativeFrameType> void FrameQueueUnderlyingSource<NativeFrameType>::MaybeMonitorPopFrameId( - int frame_id) { + media::VideoFrame::ID frame_id) { if (!MustUseMonitor()) return; VideoFrameMonitor::Instance().OnCloseFrame(device_id_, frame_id); @@ -345,7 +348,7 @@ void FrameQueueUnderlyingSource<NativeFrameType>::MonitorPopFrameLocked( const NativeFrameType& media_frame) { DCHECK(MustUseMonitor()); - int frame_id = GetFrameId(media_frame); + media::VideoFrame::ID frame_id = GetFrameId(media_frame); // Note: This is GetMonitorLock(), which is required, but the static checker // doesn't figure it out. VideoFrameMonitor::Instance().GetLock().AssertAcquired(); @@ -356,7 +359,7 @@ void FrameQueueUnderlyingSource<NativeFrameType>::MonitorPushFrameLocked( const NativeFrameType& media_frame) { DCHECK(MustUseMonitor()); - int frame_id = GetFrameId(media_frame); + media::VideoFrame::ID frame_id = GetFrameId(media_frame); VideoFrameMonitor::Instance().GetLock().AssertAcquired(); VideoFrameMonitor::Instance().OnOpenFrameLocked(device_id_, frame_id); } @@ -367,7 +370,7 @@ const NativeFrameType& new_frame, const absl::optional<NativeFrameType>& oldest_frame) { DCHECK(MustUseMonitor()); - absl::optional<int> oldest_frame_id; + absl::optional<media::VideoFrame::ID> oldest_frame_id; if (oldest_frame.has_value()) oldest_frame_id = GetFrameId(oldest_frame.value()); @@ -379,7 +382,7 @@ return NewFrameAction::kPush; } - int new_frame_id = GetFrameId(new_frame); + media::VideoFrame::ID new_frame_id = GetFrameId(new_frame); if (monitor.NumRefsLocked(device_id_, new_frame_id) > 0) { // The new frame is already in another queue or exposed to JS, so adding // it to the queue would not count against the limit.
diff --git a/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.h b/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.h index 93c082b..a9b67b18 100644 --- a/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.h +++ b/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.h
@@ -108,7 +108,7 @@ base::Lock& GetMonitorLock(); - void MaybeMonitorPopFrameId(int frame_id); + void MaybeMonitorPopFrameId(media::VideoFrame::ID frame_id); void MonitorPopFrameLocked(const NativeFrameType& media_frame) EXCLUSIVE_LOCKS_REQUIRED(GetMonitorLock()); void MonitorPushFrameLocked(const NativeFrameType& media_frame)
diff --git a/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_source_test.cc b/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_source_test.cc index 626ab98..608c8de 100644 --- a/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_source_test.cc +++ b/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_source_test.cc
@@ -420,7 +420,7 @@ // These frames are queued, pending to be read. for (size_t i = 0; i < max_frame_count; ++i) { auto video_frame = create_video_frame(); - int frame_id = video_frame->unique_id(); + media::VideoFrame::ID frame_id = video_frame->unique_id(); push_frame_sync(std::move(video_frame)); EXPECT_EQ(monitor.NumFrames(device_id), i + 1); EXPECT_EQ(monitor.NumRefs(device_id, frame_id), 1); @@ -428,7 +428,7 @@ { // Push another video frame with the limit reached. auto video_frame = create_video_frame(); - int frame_id = video_frame->unique_id(); + media::VideoFrame::ID frame_id = video_frame->unique_id(); push_frame_sync(std::move(video_frame)); EXPECT_EQ(monitor.NumFrames(device_id), max_frame_count); EXPECT_EQ(monitor.NumRefs(device_id, frame_id), 1); @@ -455,7 +455,7 @@ // that can be replaced. { auto video_frame = create_video_frame(); - int frame_id = video_frame->unique_id(); + media::VideoFrame::ID frame_id = video_frame->unique_id(); push_frame_sync(std::move(video_frame)); EXPECT_EQ(monitor.NumFrames(device_id), max_frame_count); EXPECT_EQ(monitor.NumRefs(device_id, frame_id), 0);
diff --git a/third_party/blink/renderer/modules/mediacapturefromelement/html_video_element_capturer_source_unittest.cc b/third_party/blink/renderer/modules/mediacapturefromelement/html_video_element_capturer_source_unittest.cc index 1696124..fe22d8b 100644 --- a/third_party/blink/renderer/modules/mediacapturefromelement/html_video_element_capturer_source_unittest.cc +++ b/third_party/blink/renderer/modules/mediacapturefromelement/html_video_element_capturer_source_unittest.cc
@@ -103,7 +103,9 @@ : media::VideoFrame::CreateTransparentFrame(size_); } - absl::optional<int> CurrentFrameId() const override { return absl::nullopt; } + absl::optional<media::VideoFrame::ID> CurrentFrameId() const override { + return absl::nullopt; + } bool IsOpaque() const override { return is_video_opaque_; } bool HasAvailableVideoFrame() const override { return true; }
diff --git a/third_party/blink/renderer/modules/mediastream/low_latency_video_renderer_algorithm_unittest.cc b/third_party/blink/renderer/modules/mediastream/low_latency_video_renderer_algorithm_unittest.cc index 6ff16eb..2ceb2a8 100644 --- a/third_party/blink/renderer/modules/mediastream/low_latency_video_renderer_algorithm_unittest.cc +++ b/third_party/blink/renderer/modules/mediastream/low_latency_video_renderer_algorithm_unittest.cc
@@ -35,10 +35,11 @@ return frame; } - int CreateAndEnqueueFrame(int max_composition_delay_in_frames) { + media::VideoFrame::ID CreateAndEnqueueFrame( + int max_composition_delay_in_frames) { scoped_refptr<media::VideoFrame> frame = CreateFrame(max_composition_delay_in_frames); - int unique_id = frame->unique_id(); + media::VideoFrame::ID unique_id = frame->unique_id(); algorithm_.EnqueueFrame(std::move(frame)); return unique_id; } @@ -84,7 +85,7 @@ void StepUntilJustBeforeNextFrameIsRendered( base::TimeDelta render_interval, - absl::optional<int> expected_id = absl::nullopt) { + absl::optional<media::VideoFrame::ID> expected_id = absl::nullopt) { // No frame will be rendered until the total render time that has passed is // greater than the frame duration of a frame. base::TimeTicks start_time = current_render_time_; @@ -125,7 +126,8 @@ constexpr int kNumberOfFrames = 100; constexpr int kMaxCompositionDelayInFrames = 6; for (int i = 0; i < kNumberOfFrames; ++i) { - int frame_id = CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); + media::VideoFrame::ID frame_id = + CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); size_t frames_dropped = 0u; scoped_refptr<media::VideoFrame> rendered_frame = RenderAndStep(&frames_dropped); @@ -151,7 +153,8 @@ ++expected_frames_dropped; } - int last_id = CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); + media::VideoFrame::ID last_id = + CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); size_t frames_dropped = 0; scoped_refptr<media::VideoFrame> rendered_frame = @@ -202,7 +205,8 @@ constexpr int kMaxCompositionDelayInFrames = 6; // Add one initial frame. - int last_id = CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); + media::VideoFrame::ID last_id = + CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); constexpr size_t kNumberOfFrames = 120; for (size_t i = 0; i < kNumberOfFrames; ++i) { @@ -210,7 +214,7 @@ scoped_refptr<media::VideoFrame> rendered_frame = RenderAndStep(&frames_dropped, kRenderInterval); ASSERT_TRUE(rendered_frame); - int rendered_frame_id = last_id; + media::VideoFrame::ID rendered_frame_id = last_id; EXPECT_EQ(rendered_frame->unique_id(), rendered_frame_id); last_id = CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); @@ -231,7 +235,8 @@ constexpr int kMaxCompositionDelayInFrames = 6; // Add one initial frame. - int last_id = CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); + media::VideoFrame::ID last_id = + CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); constexpr size_t kNumberOfFrames = 120; for (size_t i = 0; i < kNumberOfFrames; ++i) { @@ -239,7 +244,7 @@ scoped_refptr<media::VideoFrame> rendered_frame = RenderAndStep(&frames_dropped, kRenderInterval); ASSERT_TRUE(rendered_frame); - int rendered_frame_id = last_id; + media::VideoFrame::ID rendered_frame_id = last_id; EXPECT_EQ(rendered_frame->unique_id(), rendered_frame_id); last_id = CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); @@ -256,7 +261,7 @@ // Create an initial queue of 60 frames. constexpr int kMaxCompositionDelayInFrames = 6; constexpr size_t kInitialQueueSize = 60; - int last_id = 0; + media::VideoFrame::ID last_id; for (size_t i = 0; i < kInitialQueueSize; ++i) { last_id = CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); } @@ -282,7 +287,7 @@ // Enter drain mode when more than 6 frames are in the queue. constexpr int kMaxCompositionDelayInFrames = 6; constexpr int kNumberOfFramesSubmitted = kMaxCompositionDelayInFrames + 1; - std::queue<int> enqueued_frame_ids; + std::queue<media::VideoFrame::ID> enqueued_frame_ids; for (int i = 0; i < kNumberOfFramesSubmitted; ++i) { enqueued_frame_ids.push( CreateAndEnqueueFrame(kMaxCompositionDelayInFrames)); @@ -316,7 +321,7 @@ // Enter drain mode when more than 6 frames are in the queue. constexpr int kMaxCompositionDelayInFrames = 6; int number_of_frames_submitted = kMaxCompositionDelayInFrames + 1; - std::queue<int> enqueued_frame_ids; + std::queue<media::VideoFrame::ID> enqueued_frame_ids; for (int i = 0; i < number_of_frames_submitted; ++i) { enqueued_frame_ids.push( CreateAndEnqueueFrame(kMaxCompositionDelayInFrames)); @@ -367,7 +372,7 @@ EXPECT_TRUE(RenderAndStep(nullptr, kRenderInterval)); constexpr int kNumberOfFramesSubmitted = kMaxCompositionDelayInFrames + 1; - std::queue<int> enqueued_frame_ids; + std::queue<media::VideoFrame::ID> enqueued_frame_ids; for (int i = 0; i < kNumberOfFramesSubmitted; ++i) { enqueued_frame_ids.push( CreateAndEnqueueFrame(kMaxCompositionDelayInFrames)); @@ -401,7 +406,7 @@ // Create an initial queue of 5 frames. constexpr int kMaxCompositionDelayInFrames = 6; constexpr size_t kInitialQueueSize = 5; - std::queue<int> enqueued_frame_ids; + std::queue<media::VideoFrame::ID> enqueued_frame_ids; for (size_t i = 0; i < kInitialQueueSize; ++i) { enqueued_frame_ids.push( CreateAndEnqueueFrame(kMaxCompositionDelayInFrames)); @@ -512,7 +517,7 @@ scoped_refptr<media::VideoFrame> rendered_frame = RenderAndStep(nullptr, kRenderInterval); ASSERT_TRUE(rendered_frame); - int frame_id_0 = rendered_frame->unique_id(); + media::VideoFrame::ID frame_id_0 = rendered_frame->unique_id(); StepUntilJustBeforeNextFrameIsRendered(kRenderInterval, rendered_frame->unique_id()); @@ -525,8 +530,10 @@ } // Enqueue two frames. - int frame_id_1 = CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); - int frame_id_2 = CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); + media::VideoFrame::ID frame_id_1 = + CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); + media::VideoFrame::ID frame_id_2 = + CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); // The first submitted frame should be rendered. rendered_frame = RenderAndStep(nullptr, kRenderInterval); @@ -549,7 +556,8 @@ constexpr double kDeadlineBeginErrorRate[] = {0.01, 0.03, -0.01, -0.02, 0.02}; constexpr double kDeadlineEndErrorRate[] = {0.02, -0.03, -0.02, 0.03, 0.01}; for (int i = 0; i < kNumberOfFrames; ++i) { - int frame_id = CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); + media::VideoFrame::ID frame_id = + CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); size_t frames_dropped = 0u; scoped_refptr<media::VideoFrame> rendered_frame = RenderWithGlitchAndStep( &frames_dropped, kDeadlineBeginErrorRate[i], kDeadlineEndErrorRate[i]); @@ -570,7 +578,8 @@ constexpr double kDeadlineEndErrorRate[] = {0.02, -0.03, -0.02, 0.03, 0.01}; // Add one initial frame. - int last_id = CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); + media::VideoFrame::ID last_id = + CreateAndEnqueueFrame(kMaxCompositionDelayInFrames); for (size_t i = 0; i < kNumberOfFrames; ++i) { size_t frames_dropped = 0; @@ -578,7 +587,7 @@ &frames_dropped, kRenderInterval, kDeadlineBeginErrorRate[i], kDeadlineEndErrorRate[i]); ASSERT_TRUE(rendered_frame); - int rendered_frame_id = last_id; + media::VideoFrame::ID rendered_frame_id = last_id; EXPECT_EQ(rendered_frame->unique_id(), rendered_frame_id); last_id = CreateAndEnqueueFrame(kMaxCompositionDelayInFrames);
diff --git a/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms.cc b/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms.cc index 2754276..c07502c 100644 --- a/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms.cc +++ b/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms.cc
@@ -191,7 +191,7 @@ #endif // BUILDFLAG(IS_ANDROID) if (!gpu_memory_buffer_pool_) { - int original_frame_id = frame->unique_id(); + const media::VideoFrame::ID original_frame_id = frame->unique_id(); EnqueueFrame(original_frame_id, std::move(frame)); return; } @@ -211,7 +211,7 @@ #endif // BUILDFLAG(IS_WIN) if (skip_creating_gpu_memory_buffer) { - int original_frame_id = frame->unique_id(); + media::VideoFrame::ID original_frame_id = frame->unique_id(); EnqueueFrame(original_frame_id, std::move(frame)); // If there are any existing MaybeCreateHardwareFrame() calls, we do not // want those frames to be placed after the current one, so just drop @@ -220,7 +220,7 @@ return; } - int original_frame_id = frame->unique_id(); + const media::VideoFrame::ID original_frame_id = frame->unique_id(); // |gpu_memory_buffer_pool_| deletion is going to be posted to // |media_task_runner_|. base::Unretained() usage is fine since @@ -279,7 +279,7 @@ } } - void EnqueueFrame(int original_frame_id, + void EnqueueFrame(media::VideoFrame::ID original_frame_id, scoped_refptr<media::VideoFrame> frame) { DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_); @@ -1048,7 +1048,7 @@ return compositor_->GetCurrentFrame(); } -absl::optional<int> WebMediaPlayerMS::CurrentFrameId() const { +absl::optional<media::VideoFrame::ID> WebMediaPlayerMS::CurrentFrameId() const { DVLOG(3) << __func__; DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); return compositor_->GetCurrentFrame()->unique_id();
diff --git a/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_compositor.h b/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_compositor.h index a824973..41de950 100644 --- a/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_compositor.h +++ b/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_compositor.h
@@ -155,7 +155,7 @@ // Struct used to keep information about frames pending in // |rendering_frame_buffer_|. struct PendingFrameInfo { - int unique_id; + media::VideoFrame::ID unique_id; base::TimeDelta timestamp; base::TimeTicks reference_time; bool is_copy;
diff --git a/third_party/blink/renderer/modules/webcodecs/video_frame_monitor.cc b/third_party/blink/renderer/modules/webcodecs/video_frame_monitor.cc index 67159f72..4963c95 100644 --- a/third_party/blink/renderer/modules/webcodecs/video_frame_monitor.cc +++ b/third_party/blink/renderer/modules/webcodecs/video_frame_monitor.cc
@@ -15,13 +15,13 @@ } void VideoFrameMonitor::OnOpenFrame(const std::string& source_id, - int frame_id) { + media::VideoFrame::ID frame_id) { base::AutoLock locker(GetLock()); OnOpenFrameLocked(source_id, frame_id); } void VideoFrameMonitor::OnCloseFrame(const std::string& source_id, - int frame_id) { + media::VideoFrame::ID frame_id) { base::AutoLock locker(GetLock()); OnCloseFrameLocked(source_id, frame_id); } @@ -31,7 +31,8 @@ return NumFramesLocked(source_id); } -int VideoFrameMonitor::NumRefs(const std::string& source_id, int frame_id) { +int VideoFrameMonitor::NumRefs(const std::string& source_id, + media::VideoFrame::ID frame_id) { base::AutoLock locker(GetLock()); return NumRefsLocked(source_id, frame_id); } @@ -42,7 +43,7 @@ } void VideoFrameMonitor::OnOpenFrameLocked(const std::string& source_id, - int frame_id) { + media::VideoFrame::ID frame_id) { DCHECK(!source_id.empty()); lock_.AssertAcquired(); FrameMap& frame_map = map_[source_id]; @@ -56,7 +57,7 @@ } void VideoFrameMonitor::OnCloseFrameLocked(const std::string& source_id, - int frame_id) { + media::VideoFrame::ID frame_id) { DCHECK(!source_id.empty()); lock_.AssertAcquired(); auto it_source = map_.find(source_id); @@ -80,7 +81,7 @@ } int VideoFrameMonitor::NumRefsLocked(const std::string& source_id, - int frame_id) { + media::VideoFrame::ID frame_id) { DCHECK(!source_id.empty()); lock_.AssertAcquired(); auto it = map_.find(source_id);
diff --git a/third_party/blink/renderer/modules/webcodecs/video_frame_monitor.h b/third_party/blink/renderer/modules/webcodecs/video_frame_monitor.h index a276c33..c3c0eae3 100644 --- a/third_party/blink/renderer/modules/webcodecs/video_frame_monitor.h +++ b/third_party/blink/renderer/modules/webcodecs/video_frame_monitor.h
@@ -9,6 +9,7 @@ #include <string> #include "base/synchronization/lock.h" +#include "media/base/video_frame.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/platform/wtf/hash_map.h" @@ -47,16 +48,18 @@ // Report that a new frame with ID |frame_id| associated with the source with // ID |source_id| is being monitored. - void OnOpenFrame(const std::string& source_id, int frame_id); + void OnOpenFrame(const std::string& source_id, + media::VideoFrame::ID frame_id); // Report that a new frame with ID |frame_id| associated with the source with // ID |source_id| is being monitored. - void OnCloseFrame(const std::string& source_id, int frame_id); + void OnCloseFrame(const std::string& source_id, + media::VideoFrame::ID frame_id); // Reports the number of distinct monitored frames associated with // |source_id|. wtf_size_t NumFrames(const std::string& source_id); // Reports the reference count for the frame with ID |frame_id| associated // with the source with ID |source_id|. - int NumRefs(const std::string& source_id, int frame_id); + int NumRefs(const std::string& source_id, media::VideoFrame::ID frame_id); // Reports true if nothing is being monitored, false otherwise. bool IsEmpty(); @@ -74,13 +77,16 @@ // The methods below can be called only when the mutex returned by GetLock() // has been acquired. Other than that, they are equivalent to their // corresponding non-locked version. - void OnOpenFrameLocked(const std::string& source_id, int frame_id) + void OnOpenFrameLocked(const std::string& source_id, + media::VideoFrame::ID frame_id) EXCLUSIVE_LOCKS_REQUIRED(GetLock()); - void OnCloseFrameLocked(const std::string& source_id, int frame_id) + void OnCloseFrameLocked(const std::string& source_id, + media::VideoFrame::ID frame_id) EXCLUSIVE_LOCKS_REQUIRED(GetLock()); wtf_size_t NumFramesLocked(const std::string& source_id) EXCLUSIVE_LOCKS_REQUIRED(GetLock()); - int NumRefsLocked(const std::string& source_id, int frame_id) + int NumRefsLocked(const std::string& source_id, + media::VideoFrame::ID frame_id) EXCLUSIVE_LOCKS_REQUIRED(GetLock()); private: @@ -89,10 +95,37 @@ // key: unique ID of a frame. // value: reference count for the frame (among objects explicitly tracking // the frame with VideoFrameMonitor). - using FrameMap = HashMap<int, + struct VideoFrameIDHashArg { + static unsigned GetHash(media::VideoFrame::ID key) { + static_assert(std::is_same_v<decltype(key.GetUnsafeValue()), uint64_t>); + return WTF::HashInt(key.GetUnsafeValue()); + } + static bool Equal(media::VideoFrame::ID a, media::VideoFrame::ID b) { + return a == b; + } + static const bool safe_to_compare_to_empty_or_deleted = true; + }; + struct VideoFrameIDHashTraits + : WTF::GenericHashTraits<media::VideoFrame::ID> { + static const bool kEmptyValueIsZero = false; + static const bool kHasIsEmptyValueFunction = false; + + static media::VideoFrame::ID EmptyValue() { + return media::VideoFrame::ID(); + } + static void ConstructDeletedValue(media::VideoFrame::ID& slot, bool) { + slot = media::VideoFrame::ID::FromUnsafeValue( + std::numeric_limits<media::VideoFrame::ID::underlying_type>::max()); + } + static bool IsDeletedValue(media::VideoFrame::ID value) { + return value.GetUnsafeValue() == + std::numeric_limits<media::VideoFrame::ID::underlying_type>::max(); + } + }; + using FrameMap = HashMap<media::VideoFrame::ID, int, - WTF::IntHash<int>, - WTF::UnsignedWithZeroKeyHashTraits<int>>; + VideoFrameIDHashArg, + VideoFrameIDHashTraits>; // key: ID of the source of the frames. // value: References to frames associated to that source.
diff --git a/third_party/blink/renderer/modules/webcodecs/video_frame_monitor_test.cc b/third_party/blink/renderer/modules/webcodecs/video_frame_monitor_test.cc index 5a44e13..f327273 100644 --- a/third_party/blink/renderer/modules/webcodecs/video_frame_monitor_test.cc +++ b/third_party/blink/renderer/modules/webcodecs/video_frame_monitor_test.cc
@@ -18,50 +18,65 @@ static void SequenceOfOperations(const std::string& source_id) { VideoFrameMonitor& monitor = VideoFrameMonitor::Instance(); - monitor.OnOpenFrame(source_id, 0); + monitor.OnOpenFrame(source_id, media::VideoFrame::ID::FromUnsafeValue(1)); EXPECT_EQ(monitor.NumFrames(source_id), 1u); - monitor.OnOpenFrame(source_id, 10); + monitor.OnOpenFrame(source_id, media::VideoFrame::ID::FromUnsafeValue(10)); EXPECT_EQ(monitor.NumFrames(source_id), 2u); - monitor.OnOpenFrame(source_id, 20); + monitor.OnOpenFrame(source_id, media::VideoFrame::ID::FromUnsafeValue(20)); EXPECT_EQ(monitor.NumFrames(source_id), 3u); - monitor.OnCloseFrame(source_id, 0); + monitor.OnCloseFrame(source_id, media::VideoFrame::ID::FromUnsafeValue(1)); EXPECT_EQ(monitor.NumFrames(source_id), 2u); - monitor.OnCloseFrame(source_id, 10); + monitor.OnCloseFrame(source_id, media::VideoFrame::ID::FromUnsafeValue(10)); EXPECT_EQ(monitor.NumFrames(source_id), 1u); - monitor.OnOpenFrame(source_id, 30); + monitor.OnOpenFrame(source_id, media::VideoFrame::ID::FromUnsafeValue(30)); EXPECT_EQ(monitor.NumFrames(source_id), 2u); - monitor.OnOpenFrame(source_id, 20); + monitor.OnOpenFrame(source_id, media::VideoFrame::ID::FromUnsafeValue(20)); EXPECT_EQ(monitor.NumFrames(source_id), 2u); - EXPECT_EQ(monitor.NumRefs(source_id, 20), 2); + EXPECT_EQ( + monitor.NumRefs(source_id, media::VideoFrame::ID::FromUnsafeValue(20)), + 2); // JS closes one of its VideoFrames with ID 20 - monitor.OnCloseFrame(source_id, 20); + monitor.OnCloseFrame(source_id, media::VideoFrame::ID::FromUnsafeValue(20)); EXPECT_EQ(monitor.NumFrames(source_id), 2u); - EXPECT_EQ(monitor.NumRefs(source_id, 20), 1); + EXPECT_EQ( + monitor.NumRefs(source_id, media::VideoFrame::ID::FromUnsafeValue(20)), + 1); { base::AutoLock locker(monitor.GetLock()); - monitor.OnOpenFrameLocked(source_id, 30); + monitor.OnOpenFrameLocked(source_id, + media::VideoFrame::ID::FromUnsafeValue(30)); EXPECT_EQ(monitor.NumFramesLocked(source_id), 2u); - EXPECT_EQ(monitor.NumRefsLocked(source_id, 30), 2); + EXPECT_EQ(monitor.NumRefsLocked( + source_id, media::VideoFrame::ID::FromUnsafeValue(30)), + 2); - monitor.OnCloseFrameLocked(source_id, 20); + monitor.OnCloseFrameLocked(source_id, + media::VideoFrame::ID::FromUnsafeValue(20)); EXPECT_EQ(monitor.NumFramesLocked(source_id), 1u); - EXPECT_EQ(monitor.NumRefsLocked(source_id, 20), 0); + EXPECT_EQ(monitor.NumRefsLocked( + source_id, media::VideoFrame::ID::FromUnsafeValue(20)), + 0); - monitor.OnCloseFrameLocked(source_id, 30); + monitor.OnCloseFrameLocked(source_id, + media::VideoFrame::ID::FromUnsafeValue(30)); EXPECT_EQ(monitor.NumFramesLocked(source_id), 1u); - EXPECT_EQ(monitor.NumRefsLocked(source_id, 30), 1); + EXPECT_EQ(monitor.NumRefsLocked( + source_id, media::VideoFrame::ID::FromUnsafeValue(30)), + 1); } - monitor.OnCloseFrame(source_id, 30); - EXPECT_EQ(monitor.NumRefs(source_id, 30), 0); + monitor.OnCloseFrame(source_id, media::VideoFrame::ID::FromUnsafeValue(30)); + EXPECT_EQ( + monitor.NumRefs(source_id, media::VideoFrame::ID::FromUnsafeValue(30)), + 0); EXPECT_EQ(monitor.NumFrames(source_id), 0u); }
diff --git a/third_party/blink/renderer/modules/webgl/webgl_texture.h b/third_party/blink/renderer/modules/webgl/webgl_texture.h index c62b57f..7e24600 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_texture.h +++ b/third_party/blink/renderer/modules/webgl/webgl_texture.h
@@ -27,6 +27,7 @@ #define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_WEBGL_TEXTURE_H_ #include "base/time/time.h" +#include "media/base/video_frame.h" #include "third_party/blink/public/platform/web_media_player.h" #include "third_party/blink/renderer/modules/webgl/webgl_shared_platform_3d_object.h" #include "ui/gfx/geometry/rect.h" @@ -35,7 +36,7 @@ // For last-uploaded-frame-metadata API. https://crbug.com/639174 struct WebGLVideoFrameUploadMetadata { - int frame_id = -1; + media::VideoFrame::ID frame_id; gfx::Rect visible_rect = {}; base::TimeDelta timestamp = {}; base::TimeDelta expected_timestamp = {}; @@ -58,7 +59,7 @@ static GLint ComputeLevelCount(GLsizei width, GLsizei height, GLsizei depth); - int GetLastUploadedVideoFrameId() const { + media::VideoFrame::ID GetLastUploadedVideoFrameId() const { return last_uploaded_video_frame_metadata_.frame_id; }
diff --git a/third_party/blink/renderer/modules/webgl/webgl_video_texture.cc b/third_party/blink/renderer/modules/webgl/webgl_video_texture.cc index ff86cdf..a0fc4f6 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_video_texture.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_video_texture.cc
@@ -5,7 +5,6 @@ #include "third_party/blink/renderer/modules/webgl/webgl_video_texture.h" #include "build/build_config.h" -#include "media/base/video_frame.h" #include "media/renderers/paint_canvas_video_renderer.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_video_frame_metadata.h" #include "third_party/blink/renderer/core/html/media/html_video_element.h" @@ -158,7 +157,7 @@ // static WebGLVideoFrameUploadMetadata WebGLVideoTexture::CreateVideoFrameUploadMetadata( const media::VideoFrame* frame, - int already_uploaded_id) { + media::VideoFrame::ID already_uploaded_id) { DCHECK(frame); WebGLVideoFrameUploadMetadata metadata = {}; if (!RuntimeEnabledFeatures::ExtraWebGLVideoTextureMetadataEnabled())
diff --git a/third_party/blink/renderer/modules/webgl/webgl_video_texture.h b/third_party/blink/renderer/modules/webgl/webgl_video_texture.h index 0b8d320b..13c9ae84 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_video_texture.h +++ b/third_party/blink/renderer/modules/webgl/webgl_video_texture.h
@@ -5,13 +5,10 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_WEBGL_VIDEO_TEXTURE_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_WEBGL_VIDEO_TEXTURE_H_ +#include "media/base/video_frame.h" #include "third_party/blink/renderer/modules/webgl/webgl_extension.h" #include "third_party/blink/renderer/platform/heap/member.h" -namespace media { -class VideoFrame; -} - namespace blink { class ExceptionState; @@ -46,7 +43,7 @@ // initialized (skipped = false) if the metadata API is disabled. static WebGLVideoFrameUploadMetadata CreateVideoFrameUploadMetadata( const media::VideoFrame* frame, - int already_uploaded_id); + media::VideoFrame::ID already_uploaded_id); private: Member<VideoFrameMetadata> current_frame_metadata_;
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc b/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc index 27a42563..1059852 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc
@@ -24,6 +24,7 @@ #include "third_party/blink/renderer/platform/graphics/gpu/webgpu_mailbox_texture.h" #include "third_party/blink/renderer/platform/graphics/gpu/webgpu_texture_alpha_clearer.h" #include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h" +#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h" namespace blink { @@ -262,7 +263,7 @@ transferable_resource.mailbox_holder.texture_target, /* is_origin_top_left = */ kBottomLeft_GrSurfaceOrigin, GetContextProviderWeakPtr(), base::PlatformThread::CurrentRef(), - Thread::Current()->GetDeprecatedTaskRunner(), + ThreadScheduler::Current()->CleanupTaskRunner(), std::move(release_callback), /*supports_display_compositing=*/true, transferable_resource.is_overlay_candidate));
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_external_texture.cc b/third_party/blink/renderer/modules/webgpu/gpu_external_texture.cc index 5ce2b1b..0876b09 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_external_texture.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_external_texture.cc
@@ -4,7 +4,6 @@ #include "third_party/blink/renderer/modules/webgpu/gpu_external_texture.h" -#include "media/base/video_frame.h" #include "media/base/wait_and_replace_sync_token_client.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_external_texture_descriptor.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_texture_view_descriptor.h" @@ -112,7 +111,8 @@ struct ExternalTextureSource { scoped_refptr<media::VideoFrame> media_video_frame = nullptr; media::PaintCanvasVideoRenderer* video_renderer = nullptr; - absl::optional<int> media_video_frame_unique_id = absl::nullopt; + absl::optional<media::VideoFrame::ID> media_video_frame_unique_id = + absl::nullopt; bool valid = false; }; @@ -197,7 +197,7 @@ const GPUExternalTextureDescriptor* webgpu_desc, scoped_refptr<media::VideoFrame> media_video_frame, media::PaintCanvasVideoRenderer* video_renderer, - absl::optional<int> media_video_frame_unique_id, + absl::optional<media::VideoFrame::ID> media_video_frame_unique_id, ExceptionState& exception_state) { DCHECK(media_video_frame); @@ -502,7 +502,7 @@ GPUDevice* device, WGPUExternalTexture external_texture, scoped_refptr<WebGPUMailboxTexture> mailbox_texture, - absl::optional<int> media_video_frame_unique_id) + absl::optional<media::VideoFrame::ID> media_video_frame_unique_id) : DawnObject<WGPUExternalTexture>(device, external_texture), mailbox_texture_(mailbox_texture), media_video_frame_unique_id_(media_video_frame_unique_id) {
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_external_texture.h b/third_party/blink/renderer/modules/webgpu/gpu_external_texture.h index aaf37ce..a6865f88 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_external_texture.h +++ b/third_party/blink/renderer/modules/webgpu/gpu_external_texture.h
@@ -7,6 +7,7 @@ #include <atomic> +#include "media/base/video_frame.h" #include "third_party/blink/renderer/modules/webgpu/dawn_object.h" #include "third_party/blink/renderer/platform/wtf/ref_counted.h" @@ -34,7 +35,7 @@ GPUDevice* device, WGPUExternalTexture external_texture, scoped_refptr<WebGPUMailboxTexture> mailbox_texture, - absl::optional<int> media_video_frame_unique_id); + absl::optional<media::VideoFrame::ID> media_video_frame_unique_id); GPUExternalTexture(const GPUExternalTexture&) = delete; GPUExternalTexture& operator=(const GPUExternalTexture&) = delete; @@ -89,7 +90,7 @@ const GPUExternalTextureDescriptor* webgpu_desc, scoped_refptr<media::VideoFrame> media_video_frame, media::PaintCanvasVideoRenderer* video_renderer, - absl::optional<int> media_video_frame_unique_id, + absl::optional<media::VideoFrame::ID> media_video_frame_unique_id, ExceptionState& exception_state); void setLabelImpl(const String& value) override { @@ -113,7 +114,7 @@ scoped_refptr<WebGPUMailboxTexture> mailbox_texture_; - absl::optional<int> media_video_frame_unique_id_; + absl::optional<media::VideoFrame::ID> media_video_frame_unique_id_; WeakMember<HTMLVideoElement> video_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
diff --git a/third_party/blink/renderer/modules/xr/xr_session.cc b/third_party/blink/renderer/modules/xr/xr_session.cc index 388a80a..e7eabfd 100644 --- a/third_party/blink/renderer/modules/xr/xr_session.cc +++ b/third_party/blink/renderer/modules/xr/xr_session.cc
@@ -806,7 +806,7 @@ auto entity_types = GetEntityTypesForHitTest(options_init); DVLOG(3) << __func__ - << ": native_from_offset = " << native_from_offset.ToString(true); + << ": native_from_offset = " << native_from_offset.ToString(); // Transformation from passed in pose to |space|. @@ -816,11 +816,8 @@ auto space_from_ray = offsetRay->RawMatrix(); auto origin_from_ray = native_from_offset * space_from_ray; - DVLOG(3) << __func__ - << ": space_from_ray = " << space_from_ray.ToString(true); - - DVLOG(3) << __func__ - << ": origin_from_ray = " << origin_from_ray.ToString(true); + DVLOG(3) << __func__ << ": space_from_ray = " << space_from_ray.ToString(); + DVLOG(3) << __func__ << ": origin_from_ray = " << origin_from_ray.ToString(); device::mojom::blink::XRRayPtr ray_mojo = device::mojom::blink::XRRay::New();
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource.cc b/third_party/blink/renderer/platform/graphics/canvas_resource.cc index 4b3bfa3..2989bd8 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource.cc
@@ -32,6 +32,7 @@ #include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h" #include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h" #include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" +#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h" #include "third_party/blink/renderer/platform/wtf/cross_thread_copier_base.h" #include "third_party/blink/renderer/platform/wtf/cross_thread_copier_gpu.h" #include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h" @@ -46,7 +47,8 @@ cc::PaintFlags::FilterQuality filter_quality, const SkColorInfo& info) : owning_thread_ref_(base::PlatformThread::CurrentRef()), - owning_thread_task_runner_(Thread::Current()->GetDeprecatedTaskRunner()), + owning_thread_task_runner_( + ThreadScheduler::Current()->CleanupTaskRunner()), provider_(std::move(provider)), info_(info), filter_quality_(filter_quality) {}
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc index f83d29b..247164f 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
@@ -31,6 +31,7 @@ #include "third_party/blink/renderer/platform/graphics/memory_managed_paint_recorder.h" #include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h" #include "third_party/blink/renderer/platform/instrumentation/canvas_memory_dump_provider.h" +#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/GrDirectContext.h" @@ -1184,7 +1185,7 @@ // post a cleanup task to run after javascript is done running. if (!cleanup_task_pending_) { cleanup_task_pending_ = true; - Thread::Current()->GetDeprecatedTaskRunner()->PostTask( + ThreadScheduler::Current()->CleanupTaskRunner()->PostTask( FROM_HERE, base::BindOnce(&CanvasImageProvider::CleanupLockedImages, weak_factory_.GetWeakPtr())); }
diff --git a/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc b/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc index 0117953..7e778a8 100644 --- a/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc +++ b/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc
@@ -63,6 +63,7 @@ #include "third_party/blink/renderer/platform/graphics/web_graphics_context_3d_provider_wrapper.h" #include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h" +#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h" #include "third_party/blink/renderer/platform/wtf/functional.h" #include "third_party/skia/include/core/SkPixmap.h" #include "third_party/skia/include/core/SkSurface.h" @@ -714,7 +715,8 @@ sk_image_info, transferable_resource.mailbox_holder.texture_target, /* is_origin_top_left = */ opengl_flip_y_extension_, context_provider_->GetWeakPtr(), base::PlatformThread::CurrentRef(), - Thread::Current()->GetDeprecatedTaskRunner(), std::move(release_callback), + ThreadScheduler::Current()->CleanupTaskRunner(), + std::move(release_callback), /*supports_display_compositing=*/true, transferable_resource.is_overlay_candidate); }
diff --git a/third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.cc b/third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.cc index f17302f..b7702b2d 100644 --- a/third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.cc +++ b/third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.cc
@@ -163,7 +163,10 @@ if (!Translation2D().IsZero()) json->SetString("translation2d", String(Translation2D().ToString())); } else { - json->SetString("matrix", Matrix().ToString()); + String matrix(Matrix().ToDecomposedString()); + if (matrix.EndsWith("\n")) + matrix = matrix.Left(matrix.length() - 1); + json->SetString("matrix", matrix.Replace("\n", ", ")); json->SetString("origin", String(Origin().ToString())); } if (!state_.flags.flattens_inherited_transform) @@ -187,7 +190,7 @@ } if (state_.compositor_element_id) { json->SetString("compositorElementId", - state_.compositor_element_id.ToString().c_str()); + String(state_.compositor_element_id.ToString())); } if (state_.scroll) json->SetString("scroll", String::Format("%p", state_.scroll.get()));
diff --git a/third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.cc b/third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.cc index 0cc7b461..ddc6c2c9 100644 --- a/third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.cc +++ b/third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.cc
@@ -14,6 +14,7 @@ #include "third_party/blink/renderer/platform/graphics/web_graphics_context_3d_provider_wrapper.h" #include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" #include "third_party/blink/renderer/platform/scheduler/public/thread.h" +#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h" #include "third_party/blink/renderer/platform/wtf/cross_thread_copier_skia.h" #include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h" #include "third_party/skia/include/core/SkImage.h" @@ -101,7 +102,7 @@ original_skia_image_ = paint_image_.GetSwSkImage(); original_skia_image_task_runner_ = - Thread::Current()->GetDeprecatedTaskRunner(); + ThreadScheduler::Current()->CleanupTaskRunner(); } scoped_refptr<StaticBitmapImage>
diff --git a/third_party/blink/renderer/platform/graphics/video_frame_image_util.cc b/third_party/blink/renderer/platform/graphics/video_frame_image_util.cc index 5f7c135c..6c6c7388 100644 --- a/third_party/blink/renderer/platform/graphics/video_frame_image_util.cc +++ b/third_party/blink/renderer/platform/graphics/video_frame_image_util.cc
@@ -19,6 +19,7 @@ #include "third_party/blink/renderer/platform/graphics/canvas_resource_provider.h" #include "third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.h" #include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h" +#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h" #include "third_party/blink/renderer/platform/wtf/functional.h" #include "third_party/skia/include/core/SkColorSpace.h" #include "third_party/skia/include/core/SkImageInfo.h" @@ -178,7 +179,7 @@ // |is_cross_thread|. base::PlatformThreadRef(), // The task runner is only used for |release_callback|. - Thread::Current()->GetDeprecatedTaskRunner(), + ThreadScheduler::Current()->CleanupTaskRunner(), std::move(release_callback), /*supports_display_compositing=*/true, // TODO(junov): Figure out how to determine whether frame is an
diff --git a/third_party/blink/renderer/platform/graphics/video_frame_submitter.h b/third_party/blink/renderer/platform/graphics/video_frame_submitter.h index c2c76b49..e89edaf 100644 --- a/third_party/blink/renderer/platform/graphics/video_frame_submitter.h +++ b/third_party/blink/renderer/platform/graphics/video_frame_submitter.h
@@ -204,7 +204,7 @@ base::OneShotTimer empty_frame_timer_; - absl::optional<int> last_frame_id_; + absl::optional<media::VideoFrame::ID> last_frame_id_; // We use cc::FrameSorter directly, rather than via // cc::CompositorFrameReportingController because video frames do not progress
diff --git a/third_party/blink/renderer/platform/media/multi_buffer_data_source.h b/third_party/blink/renderer/platform/media/multi_buffer_data_source.h index 83bb5a0..de256be 100644 --- a/third_party/blink/renderer/platform/media/multi_buffer_data_source.h +++ b/third_party/blink/renderer/platform/media/multi_buffer_data_source.h
@@ -18,8 +18,7 @@ #include "media/base/tuneable.h" #include "third_party/blink/public/platform/media/url_index.h" #include "third_party/blink/renderer/platform/platform_export.h" - -class GURL; +#include "url/gurl.h" namespace base { class SingleThreadTaskRunner; @@ -63,7 +62,7 @@ void Initialize(InitializeCB init_cb); // Adjusts the buffering algorithm based on the given preload value. - void SetPreload(media::DataSource::Preload preload); + void SetPreload(media::DataSource::Preload preload) override; // Returns true if the media resource has a single origin, false otherwise. // Only valid to call after Initialize() has completed. @@ -105,7 +104,7 @@ int64_t GetMemoryUsage() override; - GURL GetUrlAfterRedirects() const; + GURL GetUrlAfterRedirects() const override; // media::DataSource implementation. // Called from demuxer thread.
diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc b/third_party/blink/renderer/platform/media/web_media_player_impl.cc index 3ab9ed6f..ed2a0845 100644 --- a/third_party/blink/renderer/platform/media/web_media_player_impl.cc +++ b/third_party/blink/renderer/platform/media/web_media_player_impl.cc
@@ -1218,8 +1218,8 @@ DCHECK(main_task_runner_->BelongsToCurrentThread()); preload_ = static_cast<media::DataSource::Preload>(preload); - if (mb_data_source_) - mb_data_source_->SetPreload(preload_); + if (data_source_) + data_source_->SetPreload(preload_); } bool WebMediaPlayerImpl::HasVideo() const { @@ -1493,7 +1493,8 @@ return GetCurrentFrameFromCompositor(); } -absl::optional<int> WebMediaPlayerImpl::CurrentFrameId() const { +absl::optional<media::VideoFrame::ID> WebMediaPlayerImpl::CurrentFrameId() + const { DCHECK(main_task_runner_->BelongsToCurrentThread()); TRACE_EVENT0("media", "WebMediaPlayerImpl::GetCurrentFrameID"); @@ -2763,10 +2764,8 @@ } // No point in preloading data as we'll probably just throw it away anyways. - if (IsStreaming() && preload_ > media::DataSource::METADATA && - mb_data_source_) { - mb_data_source_->SetPreload(media::DataSource::METADATA); - } + if (IsStreaming() && preload_ > media::DataSource::METADATA) + data_source_->SetPreload(media::DataSource::METADATA); StartPipeline(); }
diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.h b/third_party/blink/renderer/platform/media/web_media_player_impl.h index 36f126e..b6e77d9 100644 --- a/third_party/blink/renderer/platform/media/web_media_player_impl.h +++ b/third_party/blink/renderer/platform/media/web_media_player_impl.h
@@ -189,7 +189,7 @@ const gfx::Rect& rect, cc::PaintFlags& flags) override; scoped_refptr<media::VideoFrame> GetCurrentFrameThenUpdate() override; - absl::optional<int> CurrentFrameId() const override; + absl::optional<media::VideoFrame::ID> CurrentFrameId() const override; media::PaintCanvasVideoRenderer* GetPaintCanvasVideoRenderer() override; // True if the loaded media has a playable video/audio track.
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.cc b/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.cc index 8a957fc8..e8ff566 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.cc +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.cc
@@ -164,6 +164,26 @@ base::OnceClosure reuse_buffer_callback_; }; +struct FrameChunk { + FrameChunk(const webrtc::VideoFrame& input_image, bool force_keyframe) + : video_frame_buffer(input_image.video_frame_buffer()), + timestamp(input_image.timestamp()), + timestamp_us(input_image.timestamp_us()), + render_time_ms(input_image.render_time_ms()), + force_keyframe(force_keyframe) { + DCHECK(video_frame_buffer); + } + + const rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer; + // TODO(b/241349739): timestamp and timestamp_us should be unified as one + // base::TimeDelta. + const uint32_t timestamp; + const uint64_t timestamp_us; + const int64_t render_time_ms; + + const bool force_keyframe; +}; + bool ConvertKbpsToBps(uint32_t bitrate_kbps, uint32_t* bitrate_bps) { if (!base::IsValueInRangeForNumericType<uint32_t>(bitrate_kbps * UINT64_C(1000))) { @@ -192,6 +212,12 @@ }; template <> +struct CrossThreadCopier<FrameChunk> + : public CrossThreadCopierPassThrough<FrameChunk> { + STATIC_ONLY(CrossThreadCopier); +}; + +template <> struct CrossThreadCopier<SignaledValue> { static SignaledValue Copy(SignaledValue sv) { return sv; // this is a move in fact. @@ -383,12 +409,12 @@ return true; } -class PendingFrame { +struct FrameInfo { public: - PendingFrame(const base::TimeDelta& media_timestamp, - int32_t rtp_timestamp, - int64_t capture_time_ms, - const std::vector<gfx::Size>& resolutions) + FrameInfo(const base::TimeDelta& media_timestamp, + int32_t rtp_timestamp, + int64_t capture_time_ms, + const std::vector<gfx::Size>& resolutions) : media_timestamp_(media_timestamp), rtp_timestamp_(rtp_timestamp), capture_time_ms_(capture_time_ms), @@ -504,9 +530,7 @@ // Enqueue a frame from WebRTC for encoding. // RTCVideoEncoder expects to be able to call this function synchronously from // its own thread, hence the |encode_event| argument. - void Enqueue(const webrtc::VideoFrame* input_frame, - bool force_keyframe, - SignaledValue encode_event); + void Enqueue(FrameChunk frame_chunk, SignaledValue encode_event); // RTCVideoEncoder is given a buffer to be passed to WebRTC through the // RTCVideoEncoder::ReturnEncodedImage() function. When that is complete, @@ -546,11 +570,11 @@ media::VideoEncodeAccelerator::Error error); // Perform encoding on an input frame from the input queue. - void EncodeOneFrame(); + void EncodeOneFrame(FrameChunk frame_chunk); // Perform encoding on an input frame from the input queue using VEA native // input mode. The input frame must be backed with GpuMemoryBuffer buffers. - void EncodeOneFrameWithNativeInput(); + void EncodeOneFrameWithNativeInput(FrameChunk frame_chunk); // Creates a GpuMemoryBuffer frame filled with black pixels. Returns true if // the frame is successfully created; false otherwise. @@ -595,19 +619,17 @@ // The underlying VEA to perform encoding on. std::unique_ptr<media::VideoEncodeAccelerator> video_encoder_; - // Metadata for pending frames, matched to encoded frames using timestamps. - WTF::Deque<PendingFrame> pending_frames_; + // Metadata for frames passed to Encode(), matched to encoded frames using + // timestamps. + WTF::Deque<FrameInfo> submitted_frames_; // Indicates that timestamp match failed and we should no longer attempt // matching. bool failed_timestamp_match_{false}; - // Next input frame. Since there is at most one next frame, a single-element - // queue is sufficient. - const webrtc::VideoFrame* input_next_frame_{nullptr}; - - // Whether to encode a keyframe next. - bool input_next_frame_keyframe_{false}; + // Next input frame chunk. Since there is at most one next frame chunk, a + // single-element queue is sufficient. + absl::optional<FrameChunk> next_frame_chunk_; // Frame sizes. gfx::Size input_frame_coded_size_; @@ -828,14 +850,13 @@ encoder_info_ = CopyToWebrtcEncoderInfo(info); } -void RTCVideoEncoder::Impl::Enqueue(const webrtc::VideoFrame* input_frame, - bool force_keyframe, +void RTCVideoEncoder::Impl::Enqueue(FrameChunk frame_chunk, SignaledValue encode_event) { TRACE_EVENT1("webrtc", "RTCVideoEncoder::Impl::Enqueue", "timestamp", - input_frame->timestamp()); + frame_chunk.timestamp); DVLOG(3) << __func__; DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(!input_next_frame_); + DCHECK(!next_frame_chunk_); if (status_ != WEBRTC_VIDEO_CODEC_OK) { encode_event.Set(status_); @@ -868,19 +889,21 @@ encode_event.Signal(); return; } - input_next_frame_ = input_frame; - input_next_frame_keyframe_ = force_keyframe; + next_frame_chunk_.emplace(std::move(frame_chunk)); async_encode_event_ = ScopedSignaledValue(std::move(encode_event)); // If |use_native_input_| is true, then we always queue the frame to the // encoder since no intermediate buffer is needed in RTCVideoEncoder. if (use_native_input_) { - EncodeOneFrameWithNativeInput(); + EncodeOneFrameWithNativeInput(std::move(*next_frame_chunk_)); + next_frame_chunk_.reset(); return; } - if (!input_buffers_free_.empty()) - EncodeOneFrame(); + if (!input_buffers_free_.empty()) { + EncodeOneFrame(std::move(*next_frame_chunk_)); + next_frame_chunk_.reset(); + } } void RTCVideoEncoder::Impl::UseOutputBitstreamBufferId( @@ -1046,8 +1069,8 @@ absl::optional<std::vector<gfx::Size>> expected_resolutions; if (!failed_timestamp_match_) { // Pop timestamps until we have a match. - while (!pending_frames_.empty()) { - auto& front_frame = pending_frames_.front(); + while (!submitted_frames_.empty()) { + auto& front_frame = submitted_frames_.front(); const bool end_of_picture = !metadata.vp9 || metadata.vp9->end_of_picture; if (front_frame.media_timestamp_ == metadata.timestamp) { rtp_timestamp = front_frame.rtp_timestamp_; @@ -1076,19 +1099,19 @@ media::VideoEncodeAccelerator::kPlatformFailureError); return; } - pending_frames_.pop_front(); + submitted_frames_.pop_front(); } break; } // Timestamp does not match front of the pending frames list. if (end_of_picture) - pending_frames_.pop_front(); + submitted_frames_.pop_front(); } DCHECK(rtp_timestamp.has_value()); } if (!rtp_timestamp.has_value() || !capture_timestamp_ms.has_value()) { failed_timestamp_match_ = true; - pending_frames_.clear(); + submitted_frames_.clear(); const int64_t current_time_ms = rtc::TimeMicros() / base::Time::kMicrosecondsPerMillisecond; // RTP timestamp can wrap around. Get the lower 32 bits. @@ -1287,41 +1310,32 @@ NotifyError(error); } -void RTCVideoEncoder::Impl::EncodeOneFrame() { +void RTCVideoEncoder::Impl::EncodeOneFrame(FrameChunk frame_chunk) { DVLOG(3) << "Impl::EncodeOneFrame()"; DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(input_next_frame_); DCHECK(!input_buffers_free_.empty()); TRACE_EVENT1("webrtc", "RTCVideoEncoder::Impl::EncodeOneFrame", "timestamp", - input_next_frame_->timestamp()); + frame_chunk.timestamp); - // EncodeOneFrame() may re-enter InputBufferReleased() if VEA::Encode() fails, - // we receive a VEA::NotifyError(), and the media::VideoFrame we pass to - // Encode() gets destroyed early. Handle this by resetting our - // input_next_frame_* state before we hand off the VideoFrame to the VEA. - const webrtc::VideoFrame* next_frame = input_next_frame_; - const bool next_frame_keyframe = input_next_frame_keyframe_; - input_next_frame_ = nullptr; - input_next_frame_keyframe_ = false; if (!video_encoder_) { async_encode_event_.SetAndReset(WEBRTC_VIDEO_CODEC_ERROR); return; } const base::TimeDelta timestamp = - base::Microseconds(next_frame->timestamp_us()); + base::Microseconds(frame_chunk.timestamp_us); scoped_refptr<media::VideoFrame> frame; - rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer = - next_frame->video_frame_buffer(); + rtc::scoped_refptr<webrtc::VideoFrameBuffer> frame_buffer = + frame_chunk.video_frame_buffer; // All non-native frames require a copy because we can't tell if non-copy // conditions are met. bool requires_copy_or_scale = - buffer->type() != webrtc::VideoFrameBuffer::Type::kNative; + frame_buffer->type() != webrtc::VideoFrameBuffer::Type::kNative; if (!requires_copy_or_scale) { const WebRtcVideoFrameAdapter* frame_adapter = - static_cast<WebRtcVideoFrameAdapter*>(buffer.get()); + static_cast<WebRtcVideoFrameAdapter*>(frame_buffer.get()); frame = frame_adapter->getMediaVideoFrame(); frame->set_timestamp(timestamp); const media::VideoFrame::StorageType storage = frame->storage_type(); @@ -1347,7 +1361,7 @@ // frame that we pass to the encoder fits the input requirements. bool native_buffer_scaling = #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) - buffer->type() == webrtc::VideoFrameBuffer::Type::kNative && + frame_buffer->type() == webrtc::VideoFrameBuffer::Type::kNative && input_frame_coded_size_ == input_visible_size_; #else // TODO(https://crbug.com/1307206): Android (e.g. android-pie-arm64-rel) @@ -1356,9 +1370,9 @@ false; #endif if (native_buffer_scaling) { - DCHECK_EQ(buffer->type(), webrtc::VideoFrameBuffer::Type::kNative); - auto scaled_buffer = buffer->Scale(input_visible_size_.width(), - input_visible_size_.height()); + DCHECK_EQ(frame_buffer->type(), webrtc::VideoFrameBuffer::Type::kNative); + auto scaled_buffer = frame_buffer->Scale(input_visible_size_.width(), + input_visible_size_.height()); auto mapped_buffer = scaled_buffer->GetMappedFrameBuffer(preferred_pixel_formats_); if (!mapped_buffer) { @@ -1414,12 +1428,12 @@ // the input requirements for the encoder. // TODO(magjed): Downscale with an image pyramid instead. rtc::scoped_refptr<webrtc::I420BufferInterface> i420_buffer = - next_frame->video_frame_buffer()->ToI420(); + frame_buffer->ToI420(); if (libyuv::I420Scale( i420_buffer->DataY(), i420_buffer->StrideY(), i420_buffer->DataU(), i420_buffer->StrideU(), - i420_buffer->DataV(), i420_buffer->StrideV(), next_frame->width(), - next_frame->height(), + i420_buffer->DataV(), i420_buffer->StrideV(), + i420_buffer->width(), i420_buffer->height(), frame->GetWritableVisibleData(media::VideoFrame::kYPlane), frame->stride(media::VideoFrame::kYPlane), frame->GetWritableVisibleData(media::VideoFrame::kUPlane), @@ -1444,28 +1458,23 @@ } if (!failed_timestamp_match_) { - DCHECK(!base::Contains(pending_frames_, timestamp, - &PendingFrame::media_timestamp_)); - pending_frames_.emplace_back(timestamp, next_frame->timestamp(), - next_frame->render_time_ms(), - ActiveSpatialResolutions()); + DCHECK(!base::Contains(submitted_frames_, timestamp, + &FrameInfo::media_timestamp_)); + submitted_frames_.emplace_back(timestamp, frame_chunk.timestamp, + frame_chunk.render_time_ms, + ActiveSpatialResolutions()); } - video_encoder_->Encode(frame, next_frame_keyframe); + video_encoder_->Encode(frame, frame_chunk.force_keyframe); async_encode_event_.SetAndReset(WEBRTC_VIDEO_CODEC_OK); } -void RTCVideoEncoder::Impl::EncodeOneFrameWithNativeInput() { +void RTCVideoEncoder::Impl::EncodeOneFrameWithNativeInput( + FrameChunk frame_chunk) { DVLOG(3) << "Impl::EncodeOneFrameWithNativeInput()"; DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(input_buffers_.empty() && input_buffers_free_.empty()); - DCHECK(input_next_frame_); TRACE_EVENT1("webrtc", "RTCVideoEncoder::Impl::EncodeOneFrameWithNativeInput", - "timestamp", input_next_frame_->timestamp()); - - const webrtc::VideoFrame* next_frame = input_next_frame_; - const bool next_frame_keyframe = input_next_frame_keyframe_; - input_next_frame_ = nullptr; - input_next_frame_keyframe_ = false; + "timestamp", frame_chunk.timestamp); if (!video_encoder_) { async_encode_event_.SetAndReset(WEBRTC_VIDEO_CODEC_ERROR); @@ -1473,12 +1482,13 @@ } scoped_refptr<media::VideoFrame> frame; - if (next_frame->video_frame_buffer()->type() != - webrtc::VideoFrameBuffer::Type::kNative) { + rtc::scoped_refptr<webrtc::VideoFrameBuffer> frame_buffer = + frame_chunk.video_frame_buffer; + if (frame_buffer->type() != webrtc::VideoFrameBuffer::Type::kNative) { // If we get a non-native frame it's because the video track is disabled and // WebRTC VideoBroadcaster replaces the camera frame with a black YUV frame. if (!black_gmb_frame_) { - gfx::Size natural_size(next_frame->width(), next_frame->height()); + gfx::Size natural_size(frame_buffer->width(), frame_buffer->height()); if (!CreateBlackGpuMemoryBufferFrame(natural_size)) { DVLOG(2) << "Failed to allocate native buffer for black frame"; async_encode_event_.SetAndReset(WEBRTC_VIDEO_CODEC_ERROR); @@ -1489,11 +1499,10 @@ black_gmb_frame_, black_gmb_frame_->format(), black_gmb_frame_->visible_rect(), black_gmb_frame_->natural_size()); } else { - frame = static_cast<WebRtcVideoFrameAdapter*>( - next_frame->video_frame_buffer().get()) + frame = static_cast<WebRtcVideoFrameAdapter*>(frame_buffer.get()) ->getMediaVideoFrame(); } - frame->set_timestamp(base::Microseconds(next_frame->timestamp_us())); + frame->set_timestamp(base::Microseconds(frame_chunk.timestamp_us)); if (frame->storage_type() != media::VideoFrame::STORAGE_GPU_MEMORY_BUFFER) { LogAndNotifyError(FROM_HERE, "frame isn't GpuMemoryBuffer based VideoFrame", @@ -1502,13 +1511,13 @@ } if (!failed_timestamp_match_) { - DCHECK(!base::Contains(pending_frames_, frame->timestamp(), - &PendingFrame::media_timestamp_)); - pending_frames_.emplace_back(frame->timestamp(), next_frame->timestamp(), - next_frame->render_time_ms(), - ActiveSpatialResolutions()); + DCHECK(!base::Contains(submitted_frames_, frame->timestamp(), + &FrameInfo::media_timestamp_)); + submitted_frames_.emplace_back(frame->timestamp(), frame_chunk.timestamp, + frame_chunk.render_time_ms, + ActiveSpatialResolutions()); } - video_encoder_->Encode(frame, next_frame_keyframe); + video_encoder_->Encode(frame, frame_chunk.force_keyframe); async_encode_event_.SetAndReset(WEBRTC_VIDEO_CODEC_OK); } @@ -1551,8 +1560,10 @@ DCHECK_GE(index, 0); DCHECK_LT(index, static_cast<int>(input_buffers_.size())); input_buffers_free_.push_back(index); - if (input_next_frame_) - EncodeOneFrame(); + if (next_frame_chunk_) { + EncodeOneFrame(std::move(*next_frame_chunk_)); + next_frame_chunk_.reset(); + } } bool RTCVideoEncoder::Impl::RequiresSizeChange( @@ -1581,10 +1592,12 @@ is_constrained_h264_(is_constrained_h264), gpu_factories_(gpu_factories), gpu_task_runner_(gpu_factories->GetTaskRunner()) { + DCHECK_CALLED_ON_VALID_SEQUENCE(webrtc_sequence_checker_); DVLOG(1) << "RTCVideoEncoder(): profile=" << GetProfileName(profile); } RTCVideoEncoder::~RTCVideoEncoder() { + DCHECK_CALLED_ON_VALID_SEQUENCE(webrtc_sequence_checker_); DVLOG(3) << __func__; Release(); DCHECK(!impl_); @@ -1593,6 +1606,7 @@ int32_t RTCVideoEncoder::InitEncode( const webrtc::VideoCodec* codec_settings, const webrtc::VideoEncoder::Settings& settings) { + DCHECK_CALLED_ON_VALID_SEQUENCE(webrtc_sequence_checker_); DVLOG(1) << __func__ << " codecType=" << codec_settings->codecType << ", width=" << codec_settings->width << ", height=" << codec_settings->height @@ -1656,6 +1670,7 @@ int32_t RTCVideoEncoder::Encode( const webrtc::VideoFrame& input_image, const std::vector<webrtc::VideoFrameType>* frame_types) { + DCHECK_CALLED_ON_VALID_SEQUENCE(webrtc_sequence_checker_); TRACE_EVENT1("webrtc", "RTCVideoEncoder::Encode", "timestamp", input_image.timestamp()); DVLOG(3) << __func__; @@ -1675,7 +1690,7 @@ PostCrossThreadTask( *gpu_task_runner_.get(), FROM_HERE, CrossThreadBindOnce(&RTCVideoEncoder::Impl::Enqueue, weak_impl_, - CrossThreadUnretained(&input_image), want_key_frame, + FrameChunk(input_image, want_key_frame), SignaledValue(&encode_waiter, &encode_retval))); // webrtc::VideoEncoder expects this call to be synchronous. @@ -1686,6 +1701,7 @@ int32_t RTCVideoEncoder::RegisterEncodeCompleteCallback( webrtc::EncodedImageCallback* callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(webrtc_sequence_checker_); DVLOG(3) << __func__; if (!impl_) { DVLOG(3) << "Encoder is not initialized"; @@ -1708,6 +1724,7 @@ } int32_t RTCVideoEncoder::Release() { + DCHECK_CALLED_ON_VALID_SEQUENCE(webrtc_sequence_checker_); DVLOG(3) << __func__; if (impl_) gpu_task_runner_->DeleteSoon(FROM_HERE, std::move(impl_)); @@ -1717,6 +1734,7 @@ void RTCVideoEncoder::SetRates( const webrtc::VideoEncoder::RateControlParameters& parameters) { + DCHECK_CALLED_ON_VALID_SEQUENCE(webrtc_sequence_checker_); DVLOG(3) << __func__ << " new_bit_rate=" << parameters.bitrate.ToString() << ", frame_rate=" << parameters.framerate_fps; if (!impl_) {
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.h b/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.h index e754823..6d0962c 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.h +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.h
@@ -50,8 +50,9 @@ RTCVideoEncoder& operator=(const RTCVideoEncoder&) = delete; ~RTCVideoEncoder() override; - // webrtc::VideoEncoder implementation. Tasks are posted to |impl_| using the - // appropriate VEA methods. + // webrtc::VideoEncoder implementation. + // They run on |webrtc_sequence_checker_|. Tasks are posted to |impl_| using + // the appropriate VEA methods. int InitEncode(const webrtc::VideoCodec* codec_settings, const webrtc::VideoEncoder::Settings& settings) override; int32_t Encode( @@ -81,6 +82,9 @@ // Task runner that the video accelerator runs on. const scoped_refptr<base::SequencedTaskRunner> gpu_task_runner_; + // The sequence on which the webrtc::VideoEncoder functions are executed. + SEQUENCE_CHECKER(webrtc_sequence_checker_); + // The RTCVideoEncoder::Impl that does all the work. std::unique_ptr<Impl> impl_;
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index e548522..fc59458 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1231,7 +1231,6 @@ name: "FedCmMultipleIdentityProviders", depends_on: ["FedCm"], public: true, - status: "test", }, { name: "FencedFrames",
diff --git a/third_party/blink/renderer/platform/testing/empty_web_media_player.cc b/third_party/blink/renderer/platform/testing/empty_web_media_player.cc index 998a948e..dd2f58e 100644 --- a/third_party/blink/renderer/platform/testing/empty_web_media_player.cc +++ b/third_party/blink/renderer/platform/testing/empty_web_media_player.cc
@@ -42,7 +42,8 @@ return nullptr; } -absl::optional<int> EmptyWebMediaPlayer::CurrentFrameId() const { +absl::optional<media::VideoFrame::ID> EmptyWebMediaPlayer::CurrentFrameId() + const { return absl::nullopt; }
diff --git a/third_party/blink/renderer/platform/testing/empty_web_media_player.h b/third_party/blink/renderer/platform/testing/empty_web_media_player.h index 44d8892..14d293e 100644 --- a/third_party/blink/renderer/platform/testing/empty_web_media_player.h +++ b/third_party/blink/renderer/platform/testing/empty_web_media_player.h
@@ -70,7 +70,7 @@ void SuspendForFrameClosed() override {} void Paint(cc::PaintCanvas*, const gfx::Rect&, cc::PaintFlags&) override {} scoped_refptr<media::VideoFrame> GetCurrentFrameThenUpdate() override; - absl::optional<int> CurrentFrameId() const override; + absl::optional<media::VideoFrame::ID> CurrentFrameId() const override; bool HasAvailableVideoFrame() const override { return false; } base::WeakPtr<WebMediaPlayer> AsWeakPtr() override { return base::SupportsWeakPtr<EmptyWebMediaPlayer>::AsWeakPtr();
diff --git a/third_party/blink/renderer/platform/transforms/transformation_matrix.cc b/third_party/blink/renderer/platform/transforms/transformation_matrix.cc index 908c0a8..05e0a3e 100644 --- a/third_party/blink/renderer/platform/transforms/transformation_matrix.cc +++ b/third_party/blink/renderer/platform/transforms/transformation_matrix.cc
@@ -1216,21 +1216,21 @@ ClampToFloat(matrix_[2][3]), ClampToFloat(matrix_[3][3])); } -String TransformationMatrix::ToString(bool as_matrix) const { - if (as_matrix) { - // Return as a matrix in row-major order. - return String::Format( - "[%lg,%lg,%lg,%lg,\n%lg,%lg,%lg,%lg,\n%lg,%lg,%lg,%lg,\n%lg,%lg,%lg,%" - "lg]", - matrix_[0][0], matrix_[1][0], matrix_[2][0], matrix_[3][0], - matrix_[0][1], matrix_[1][1], matrix_[2][1], matrix_[3][1], - matrix_[0][2], matrix_[1][2], matrix_[2][2], matrix_[3][2], - matrix_[0][3], matrix_[1][3], matrix_[2][3], matrix_[3][3]); - } +String TransformationMatrix::ToString() const { + // Return as a matrix in row-major order. + return String::Format( + "[%lg,%lg,%lg,%lg,\n%lg,%lg,%lg,%lg,\n" + "%lg,%lg,%lg,%lg,\n%lg,%lg,%lg,%lg]", + matrix_[0][0], matrix_[1][0], matrix_[2][0], matrix_[3][0], // + matrix_[0][1], matrix_[1][1], matrix_[2][1], matrix_[3][1], // + matrix_[0][2], matrix_[1][2], matrix_[2][2], matrix_[3][2], // + matrix_[0][3], matrix_[1][3], matrix_[2][3], matrix_[3][3]); +} +String TransformationMatrix::ToDecomposedString() const { TransformationMatrix::DecomposedType decomposition; if (!Decompose(decomposition)) - return ToString(true) + " (degenerate)"; + return ToString() + " (degenerate)"; if (IsIdentityOrTranslation()) { if (decomposition.translate_x == 0 && decomposition.translate_y == 0 && @@ -1255,7 +1255,7 @@ std::ostream& operator<<(std::ostream& ostream, const TransformationMatrix& transform) { - return ostream << transform.ToString(); + return ostream << transform.ToDecomposedString(); } } // namespace blink
diff --git a/third_party/blink/renderer/platform/transforms/transformation_matrix.h b/third_party/blink/renderer/platform/transforms/transformation_matrix.h index 6360364..d3c4eef 100644 --- a/third_party/blink/renderer/platform/transforms/transformation_matrix.h +++ b/third_party/blink/renderer/platform/transforms/transformation_matrix.h
@@ -411,9 +411,11 @@ // Performs same conversions as ToSkM44. gfx::Transform ToTransform() const; - // If |asMatrix|, return the matrix in row-major order. Otherwise, return - // the transform's decomposition which shows the translation, scale, etc. - String ToString(bool as_matrix = false) const; + // Returns a string in the format of "[ row0\n, row1\n, row2\n, row3 ]\n". + String ToString() const; + + // Returns a string containing decomposed components. + String ToDecomposedString() const; private: // Used internally to construct TransformationMatrix with parameters in
diff --git a/third_party/blink/renderer/platform/transforms/transformation_matrix_test.cc b/third_party/blink/renderer/platform/transforms/transformation_matrix_test.cc index f357d731..eb04062 100644 --- a/third_party/blink/renderer/platform/transforms/transformation_matrix_test.cc +++ b/third_party/blink/renderer/platform/transforms/transformation_matrix_test.cc
@@ -187,10 +187,10 @@ 80, 108, 136, 164); // clang-format on - EXPECT_EQ(expected_a_times_b, a * b) << (a * b).ToString(true); + EXPECT_EQ(expected_a_times_b, a * b); a.PreConcat(b); - EXPECT_EQ(expected_a_times_b, a) << a.ToString(true); + EXPECT_EQ(expected_a_times_b, a); } TEST(TransformationMatrixTest, MultiplicationSelf) { @@ -206,7 +206,7 @@ // clang-format on a.PreConcat(a); - EXPECT_EQ(expected_a_times_a, a) << a.ToString(true); + EXPECT_EQ(expected_a_times_a, a); } TEST(TransformationMatrixTest, ValidRangedMatrix) { @@ -451,18 +451,17 @@ auto zeros = TransformationMatrix::ColMajor(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); EXPECT_EQ("[0,0,0,0,\n0,0,0,0,\n0,0,0,0,\n0,0,0,0] (degenerate)", - zeros.ToString()); - EXPECT_EQ("[0,0,0,0,\n0,0,0,0,\n0,0,0,0,\n0,0,0,0]", zeros.ToString(true)); + zeros.ToDecomposedString()); + EXPECT_EQ("[0,0,0,0,\n0,0,0,0,\n0,0,0,0,\n0,0,0,0]", zeros.ToString()); TransformationMatrix identity; - EXPECT_EQ("identity", identity.ToString()); - EXPECT_EQ("[1,0,0,0,\n0,1,0,0,\n0,0,1,0,\n0,0,0,1]", identity.ToString(true)); + EXPECT_EQ("identity", identity.ToDecomposedString()); + EXPECT_EQ("[1,0,0,0,\n0,1,0,0,\n0,0,1,0,\n0,0,0,1]", identity.ToString()); TransformationMatrix translation; translation.Translate3d(3, 5, 7); - EXPECT_EQ("translation(3,5,7)", translation.ToString()); - EXPECT_EQ("[1,0,0,3,\n0,1,0,5,\n0,0,1,7,\n0,0,0,1]", - translation.ToString(true)); + EXPECT_EQ("translation(3,5,7)", translation.ToDecomposedString()); + EXPECT_EQ("[1,0,0,3,\n0,1,0,5,\n0,0,1,7,\n0,0,0,1]", translation.ToString()); auto column_major_constructor = TransformationMatrix::ColMajor( 1, 1, 1, 6, 2, 2, 0, 7, 3, 3, 3, 8, 4, 4, 4, 9); @@ -471,7 +470,7 @@ // [ 1 0 3 4 ] // [ 6 7 8 9 ] EXPECT_EQ("[1,2,3,4,\n1,2,3,4,\n1,0,3,4,\n6,7,8,9]", - column_major_constructor.ToString(true)); + column_major_constructor.ToString()); } TEST(TransformationMatrix, IsInvertible) {
diff --git a/third_party/blink/web_tests/FlagExpectations/disable-layout-ng b/third_party/blink/web_tests/FlagExpectations/disable-layout-ng index eedbb85..ff841dfa 100644 --- a/third_party/blink/web_tests/FlagExpectations/disable-layout-ng +++ b/third_party/blink/web_tests/FlagExpectations/disable-layout-ng
@@ -369,6 +369,7 @@ crbug.com/1078927 external/wpt/css/css-break/table/break-before-table-cell.html [ Failure ] crbug.com/1078927 external/wpt/css/css-break/table/break-before-table-cell-child.html [ Failure ] crbug.com/1078927 external/wpt/css/css-break/table/caption-margin-002.html [ Failure ] +crbug.com/1078927 external/wpt/css/css-break/table/overflow-scroll-section.html [ Failure ] crbug.com/1078927 external/wpt/css/css-break/table/repeated-section/abspos.tentative.html [ Failure ] crbug.com/1078927 external/wpt/css/css-break/table/repeated-section/abspos-in-monolithic.tentative.html [ Failure ] crbug.com/1078927 external/wpt/css/css-break/table/repeated-section/abspos-uncontained-text.html [ Failure ]
diff --git a/third_party/blink/web_tests/NeverFixTests b/third_party/blink/web_tests/NeverFixTests index 4a5e786..a5fe1f3 100644 --- a/third_party/blink/web_tests/NeverFixTests +++ b/third_party/blink/web_tests/NeverFixTests
@@ -953,7 +953,6 @@ # so these may also be incorrect tests, but probably some real issues too. external/wpt/css/css-color/t32-opacity-offscreen-multiple-boxes-1-c.xht [ Skip ] external/wpt/css/css-color/t32-opacity-offscreen-multiple-boxes-2-c.xht [ Skip ] -external/wpt/css/css-color/t422-rgba-onscreen-b.xht [ Skip ] # https://github.com/web-platform-tests/wpt/issues/8547 external/wpt/css/mediaqueries/device-aspect-ratio-001.html [ Skip ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index a3492d7..b022150 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -2006,9 +2006,6 @@ crbug.com/1068610 [ Linux ] external/wpt/css/css-color/t422-rgba-a0.6-a.xht [ Failure ] crbug.com/1068610 external/wpt/css/css-color/t32-opacity-basic-0.6-a.xht [ Failure ] crbug.com/1068610 [ Linux ] external/wpt/css/css-color/t425-hsla-basic-a.xht [ Failure ] -crbug.com/1068610 [ Linux ] external/wpt/css/css-color/t422-rgba-onscreen-multiple-boxes-c.xht [ Failure ] -crbug.com/1068610 [ Linux ] external/wpt/css/css-color/t425-hsla-onscreen-multiple-boxes-c.xht [ Failure ] -crbug.com/1068610 [ Linux ] external/wpt/css/css-color/t425-hsla-onscreen-b.xht [ Failure ] crbug.com/1068610 external/wpt/css/css-color/at-color-profile-001.html [ Failure ] crbug.com/1068610 external/wpt/css/css-color/color-mix-currentcolor-001.html [ Failure ] crbug.com/1068610 external/wpt/css/css-color/color-mix-currentcolor-002.html [ Failure ] @@ -7283,6 +7280,12 @@ crbug.com/1379180 [ Linux ] fast/events/event-hit-testing-fallback-to-iframe.html [ Failure Pass ] crbug.com/1194961 [ Debug Linux ] fast/events/touch/gesture/touch-gesture-fling-with-page-scale.html [ Failure Pass ] crbug.com/1379156 [ Debug Linux ] compositing/layer-creation/overflow-hidden-scroll-with-fixed-overlap.html [ Timeout ] +crbug.com/1380065 [ Mac11 ] external/wpt/screen-capture/getdisplaymedia-capture-controller.https.window.html [ Timeout ] +crbug.com/1380065 [ Mac10.15 ] external/wpt/screen-capture/getdisplaymedia-capture-controller.https.window.html [ Timeout ] +crbug.com/1380069 [ Mac10.15 ] virtual/pending-beacon/external/wpt/pending-beacon/pending_beacon-sendonhidden.tentative.https.window.html [ Timeout ] +crbug.com/1380069 [ Linux ] virtual/pending-beacon/external/wpt/pending-beacon/pending_beacon-sendonhidden.tentative.https.window.html [ Timeout ] +crbug.com/1380069 [ Mac12 ] virtual/pending-beacon/external/wpt/pending-beacon/pending_post_beacon-cors.tentative.https.window.html [ Timeout ] +crbug.com/1380078 [ Mac11 ] external/wpt/resource-timing/nested-context-navigations-embed.html [ Failure ] # Sheriff 2022-10-07 crbug.com/1372556 [ Linux ] external/wpt/css/css-text/text-transform/text-transform-capitalize-* [ Failure Pass ]
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index ac1dc32..0505e3c0 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -2760,6 +2760,13 @@ null, {} ] + ], + "spelling-error-005-crash.html": [ + "b45fcc754653297e58cf079ff4c8274d1957862f", + [ + null, + {} + ] ] }, "css-scroll-anchoring": { @@ -73591,6 +73598,32 @@ {} ] ], + "anchor-scroll-update-005.tentative.html": [ + "5675507a47702ada4c4a738ca15cd57e432d151e", + [ + null, + [ + [ + "/css/css-anchor-position/reference/anchor-scroll-update-005-ref.html", + "==" + ] + ], + {} + ] + ], + "anchor-scroll-update-006.tentative.html": [ + "7a8e675baa1b8d5aa3f81c0f4b3c291f93ddb279", + [ + null, + [ + [ + "/css/css-anchor-position/reference/anchor-scroll-update-006-ref.html", + "==" + ] + ], + {} + ] + ], "anchor-scroll-vlr.tentative.html": [ "82d167f48d9521348459b67b75e5877616672663", [ @@ -89409,6 +89442,32 @@ {} ] ], + "overflow-scroll-row.html": [ + "8ed379e5dd29681704c63e46b2702b1536f789b8", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], + "overflow-scroll-section.html": [ + "62b3071ae960d0df21353565afb3c51fe3e837c7", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], "repeated-section": { "abspos-in-monolithic.tentative.html": [ "6ec70d030d233a8183bbf281503235e2cb005b66", @@ -94098,32 +94157,6 @@ {} ] ], - "t422-rgba-onscreen-b.xht": [ - "7d1f44203c5bb984bd91480a9c43455f6265c1b2", - [ - null, - [ - [ - "/css/css-color/t422-rgba-onscreen-b-ref.html", - "==" - ] - ], - {} - ] - ], - "t422-rgba-onscreen-multiple-boxes-c.xht": [ - "0ac780eea8e1803924d921c69c21ff6cc5f77b48", - [ - null, - [ - [ - "/css/css-color/t422-rgba-onscreen-multiple-boxes-c-ref.html", - "==" - ] - ], - {} - ] - ], "t422-rgba-values-meaning-b.xht": [ "2149ef398eda4e8d06b404e220fda4b859e49309", [ @@ -94449,32 +94482,6 @@ {} ] ], - "t425-hsla-onscreen-b.xht": [ - "b2dcf5fd89fa54ac86be8dea6ccad7d2312e4ec8", - [ - null, - [ - [ - "/css/css-color/t422-rgba-onscreen-b-ref.html", - "==" - ] - ], - {} - ] - ], - "t425-hsla-onscreen-multiple-boxes-c.xht": [ - "9d2eccd47cdab8cfe7aa9b5315660d50c46d56e5", - [ - null, - [ - [ - "/css/css-color/t422-rgba-onscreen-multiple-boxes-c-ref.html", - "==" - ] - ], - {} - ] - ], "t425-hsla-parsing-f.xht": [ "67ce55f4ac61cbf9b3d103078e6a329316397799", [ @@ -255483,7 +255490,7 @@ ] }, "web-identity": [ - "9c21f7fbe55514676f8b0b2ceda421371784988a", + "425ccef3f7449816d45c1535aa50acf68d223518", [] ] }, @@ -261379,7 +261386,19 @@ [] ], "client_metadata.py": [ - "f08b285259ef2acc26a1a1ae330dcb2ff4c87481", + "d81cd96c67ae149e5e14497378a2b87f3ffd99b9", + [] + ], + "client_metadata.py.headers": [ + "7164e5f81827da39996b033972a508e5b371de11", + [] + ], + "client_metadata_clear_count.py": [ + "3c31bf5077d73ac258f4a96bb6b4f5e95802f184", + [] + ], + "keys.py": [ + "6b7d67e21e7eea7927a40ab094847b7224d49985", [] ], "manifest-not-in-list.json": [ @@ -261390,13 +261409,25 @@ "a125c2e391f26b25bfb50dd13132ae52dd4745c6", [] ], + "manifest_redirect_accounts.json": [ + "590704cfeb169d534199b95c6a582ef31526d5a2", + [] + ], + "manifest_redirect_token.json": [ + "190420736dfbd6aaaa468656c236209c25ed11f5", + [] + ], + "select_manifest_in_root_manifest.py": [ + "d4f1efff6a74c7636f60cba35b4eff010fccfd29", + [] + ], "token.py": [ "2f5e807b6e0d344a761ecca4784684047c2ec777", [] ] }, "fedcm-helper.sub.js": [ - "b67cf72b3683c60802cd3618e16dcecd1cd84c79", + "77ba99d2a0f980eec13acdadbe2f637e92655583", [] ], "fedcm-iframe-level2.html": [ @@ -269314,6 +269345,14 @@ "7935f3823fdda80f0639bbfa7b179b6fc10e3303", [] ], + "anchor-scroll-update-005-ref.html": [ + "b0c3a820f8c73834d863bbc2c595ef66f2535924", + [] + ], + "anchor-scroll-update-006-ref.html": [ + "c7fbb57e762efeb16fa4b9cdd120fb8c2ca79073", + [] + ], "anchor-scroll-vlr-ref.html": [ "cbb249e150db12585c3175b281678a6761cd9295", [] @@ -272353,14 +272392,6 @@ "cdf2cc4d1cd31500a61f9696384eb790ed1b5dd7", [] ], - "t422-rgba-onscreen-b-ref.html": [ - "db97bb638a1975ee9049d463f064d98dd6b5e80e", - [] - ], - "t422-rgba-onscreen-multiple-boxes-c-ref.html": [ - "6de63c626461a64b9181d240def51e493cc0305c", - [] - ], "t422-rgba-values-meaning-b-ref.html": [ "08631f2e4a7c62a7f936382592b1a4ef5437196f", [] @@ -390855,7 +390886,7 @@ ] ], "fedcm-network-requests.https.html": [ - "2bcf2941baace8785ce0588af0fd31a335d5db72", + "46065eb929ffea5d0a9386da1664d1ce1270e4d5", [ null, {} @@ -392494,7 +392525,7 @@ ] ], "anchor-scroll-js-expose.tentative.html": [ - "6dd6b263756ff3c14173f73dcba5ce47c6461024", + "f19d010d35931bba86d39988d3f0d4db385cbd8b", [ null, {} @@ -547812,6 +547843,16 @@ } ] ], + "hidden_document.html": [ + "b78dbb62438b91f45e4298d5855735a10a71bd03", + [ + null, + { + "testdriver": true, + "timeout": "long" + } + ] + ], "idlharness.window.js": [ "115f6ccb1e393586f4076884c01443d4944bb413", [
diff --git a/third_party/blink/web_tests/external/wpt/.well-known/web-identity b/third_party/blink/web_tests/external/wpt/.well-known/web-identity index 9c21f7f..425ccef3 100644 --- a/third_party/blink/web_tests/external/wpt/.well-known/web-identity +++ b/third_party/blink/web_tests/external/wpt/.well-known/web-identity
@@ -1,4 +1,20 @@ +import importlib +keys = importlib.import_module("credential-management.support.fedcm.keys") + def main(request, response): + manifest_url = request.server.stash.take(keys.MANIFEST_URL_IN_MANIFEST_LIST_KEY) + + if manifest_url is None or not len(manifest_url): + port = request.server.config.ports["https"][0] + hostname = request.url_parts.hostname + manifest_url = "https://{0}:{1}/credential-management/support/fedcm/manifest.py".format( + hostname, str(port)) + else: + try: + manifest_url = manifest_url.decode() + except (UnicodeDecodeError, AttributeError): + pass + if len(request.cookies) > 0: return (530, [], "Cookie should not be sent to manifest list endpoint") if request.headers.get(b"Accept") != b"application/json": @@ -8,12 +24,10 @@ if request.headers.get(b"Referer"): return (533, [], "Should not have Referer") - config = request.server.config - host = config.browser_host + ":" + str(config.ports["https"][0]) return """ {{ "provider_urls": [ - "https://{0}/credential-management/support/fedcm/manifest.py" + "{0}" ] }} -""".format(host) +""".format(manifest_url)
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/fedcm-network-requests.https.html b/third_party/blink/web_tests/external/wpt/credential-management/fedcm-network-requests.https.html index 2bcf294..46065eb 100644 --- a/third_party/blink/web_tests/external/wpt/credential-management/fedcm-network-requests.https.html +++ b/third_party/blink/web_tests/external/wpt/credential-management/fedcm-network-requests.https.html
@@ -7,7 +7,10 @@ <body> <script type="module"> -import {default_request_options, fedcm_test, set_fedcm_cookie} from './support/fedcm-helper.sub.js'; +import {default_request_options, + fedcm_test, + select_manifest, + set_fedcm_cookie} from './support/fedcm-helper.sub.js'; fedcm_test(async t => { const cred = await navigator.credentials.get(default_request_options()); @@ -100,4 +103,53 @@ return promise_rejects_dom(t, 'NetworkError', cred); }, 'Test that the promise is rejected if the manifest is not in the manifest list'); +fedcm_test(async t => { + let test_options = default_request_options("manifest_redirect_accounts.json"); + await select_manifest(t, test_options); + + const cred = navigator.credentials.get(test_options); + return promise_rejects_dom(t, 'NetworkError', cred); +}, 'Test that promise is rejected if accounts endpoint redirects'); +// A malicious site might impersonate an IDP, redirecting the accounts endpoint to a +// legitimate IDP in order to get the list of user accounts. + +fedcm_test(async t => { + let test_options = default_request_options("manifest_redirect_token.json"); + await select_manifest(t, test_options); + + const cred = navigator.credentials.get(test_options); + return promise_rejects_dom(t, 'NetworkError', cred); +}, 'Test that token endpoint does not follow redirects'); +// The token endpoint should not follow redirects because the user has not consented +// to share their identity with the redirect destination. + +fedcm_test(async t => { + // Reset the client_metadata fetch count. + const clear_metadata_count_path = `support/fedcm/client_metadata_clear_count.py`; + await fetch(clear_metadata_count_path); + + const cred = await navigator.credentials.get(default_request_options()); + assert_equals(cred.token, "token"); + + await new Promise(resolve => { + let popup_window = window.open('support/fedcm/client_metadata.py?skip_checks=1'); + const popup_window_load_handler = (event) => { + popup_window.removeEventListener('load', popup_window_load_handler); + popup_window.close(); + resolve(); + }; + popup_window.addEventListener('load', popup_window_load_handler); + }); + + const client_metadata_counter = await fetch(clear_metadata_count_path); + const client_metadata_counter_text = await client_metadata_counter.text() + assert_equals(client_metadata_counter_text, "2"); +}, 'Test client_metadata request'); +// Test: +// - Headers sent to client metadata endpoint. (Counter is not incremented if the headers are +// wrong.) +// - That the client metadata response is not cached. If the client metadata response were +// cached, when the user visits the IDP as a first party, the IDP would be able to determine the +// last RP the user visited regardless of whether the user granted consent via the FedCM prompt. + </script>
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm-helper.sub.js b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm-helper.sub.js index b67cf72..77ba99d 100644 --- a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm-helper.sub.js +++ b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm-helper.sub.js
@@ -34,3 +34,27 @@ await test_func(t); }); } + +function select_manifest_impl(manifest_url) { + const url_query = (manifest_url === undefined) + ? '' : '?manifest_url=${manifest_url}'; + + return new Promise(resolve => { + const img = document.createElement('img'); + img.src = 'support/fedcm/select_manifest_in_root_manifest.py?${url_query}'; + img.addEventListener('error', resolve); + document.body.appendChild(img); + }); +} + +// Sets the manifest returned by the next fetch of /.well-known/web_identity +// select_manifest() only affects the next fetch and not any subsequent fetches +// (ex second next fetch). +export function select_manifest(test, test_options) { + // Add cleanup in case that /.well-known/web_identity is not fetched at all. + test.add_cleanup(async () => { + await select_manifest_impl(); + }); + const manifest_url = test_options.identity.providers[0].configURL; + return select_manifest_impl(manifest_url); +}
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/client_metadata.py b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/client_metadata.py index f08b2852..d81cd96c 100644 --- a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/client_metadata.py +++ b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/client_metadata.py
@@ -1,15 +1,28 @@ +# 'import credential-management.support.fedcm.keys' does not work. +import importlib +keys = importlib.import_module("credential-management.support.fedcm.keys") + def main(request, response): - if len(request.cookies) > 0: - return (530, [], "Cookie should not be sent to this endpoint") - if request.headers.get(b"Accept") != b"application/json": - return (531, [], "Wrong Accept") - if request.headers.get(b"Sec-Fetch-Dest") != b"webidentity": - return (532, [], "Wrong Sec-Fetch-Dest header") - if not request.headers.get(b"Referer"): - return (533, [], "Missing Referer") + if (request.GET.get(b'skip_checks', b'0') != b'1'): + if len(request.cookies) > 0: + return (530, [], "Cookie should not be sent to this endpoint") + if request.headers.get(b"Accept") != b"application/json": + return (531, [], "Wrong Accept") + if request.headers.get(b"Sec-Fetch-Dest") != b"webidentity": + return (532, [], "Wrong Sec-Fetch-Dest header") + if not request.headers.get(b"Referer"): + return (533, [], "Missing Referer") + + counter = request.server.stash.take(keys.CLIENT_METADATA_COUNTER_KEY) + try: + counter = int(counter) + 1 + except (TypeError, ValueError): + counter = 1 + + request.server.stash.put(keys.CLIENT_METADATA_COUNTER_KEY, str(counter).encode()) return """ -{ - "privacy_policy_url": "https://privacypolicy.com" -} -""" +{{ + "privacy_policy_url": "https://privacypolicy{0}.com" +}} +""".format(str(counter))
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/client_metadata.py.headers b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/client_metadata.py.headers new file mode 100644 index 0000000..7164e5f8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/client_metadata.py.headers
@@ -0,0 +1 @@ +Cache-Control: public, max-age=86400
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/client_metadata_clear_count.py b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/client_metadata_clear_count.py new file mode 100644 index 0000000..3c31bf50 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/client_metadata_clear_count.py
@@ -0,0 +1,15 @@ +# 'import credential-management.support.fedcm.keys' does not work. +import importlib +keys = importlib.import_module("credential-management.support.fedcm.keys") + +def main(request, response): + client_metadata_url = "/credential-management/support/fedcm/client_metadata.py" + counter = request.server.stash.take(keys.CLIENT_METADATA_COUNTER_KEY, + client_metadata_url) + + try: + counter = counter.decode() + except (UnicodeDecodeError, AttributeError): + pass + + return counter
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/keys.py b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/keys.py new file mode 100644 index 0000000..6b7d67e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/keys.py
@@ -0,0 +1,2 @@ +CLIENT_METADATA_COUNTER_KEY = b"bdc14e3e-b8bc-44a1-8eec-78da5fdacbc3" +MANIFEST_URL_IN_MANIFEST_LIST_KEY = b"7f3f7478-b7f0-41c5-b357-f3ac16f5f25a"
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/manifest_redirect_accounts.json b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/manifest_redirect_accounts.json new file mode 100644 index 0000000..590704cf --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/manifest_redirect_accounts.json
@@ -0,0 +1,5 @@ +{ + "accounts_endpoint": "/common/redirect.py?location=/credential-management/support/fedcm/accounts.py", + "client_metadata_endpoint": "client_metadata.py", + "id_assertion_endpoint": "token.py" +}
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/manifest_redirect_token.json b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/manifest_redirect_token.json new file mode 100644 index 0000000..190420736 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/manifest_redirect_token.json
@@ -0,0 +1,6 @@ +{ + "accounts_endpoint": "accounts.py", + "client_metadata_endpoint": "client_metadata.py", + "id_assertion_endpoint": "/common/redirect.py?location=/credential-management/support/fedcm/token.py&status=308", + "revocation_endpoint": "revoke.py" +}
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/select_manifest_in_root_manifest.py b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/select_manifest_in_root_manifest.py new file mode 100644 index 0000000..d4f1eff --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/select_manifest_in_root_manifest.py
@@ -0,0 +1,17 @@ +import importlib +from urllib.parse import urlsplit + +# 'import credential-management.support.fedcm.keys' does not work. +keys = importlib.import_module("credential-management.support.fedcm.keys") + +def main(request, response): + root_manifest_url = "/.well-known/web-identity" + + # Clear stash so that a new value can be written. + request.server.stash.take(keys.MANIFEST_URL_IN_MANIFEST_LIST_KEY, root_manifest_url) + + request.server.stash.put(keys.MANIFEST_URL_IN_MANIFEST_LIST_KEY, + request.GET.first(b"manifest_url", b""), + root_manifest_url) + + return root_manifest_url
diff --git a/third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-scroll-js-expose.tentative.html b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-scroll-js-expose.tentative.html index 6dd6b26..f19d010d 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-scroll-js-expose.tentative.html +++ b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-scroll-js-expose.tentative.html
@@ -48,18 +48,23 @@ </div> <script> -// Move both the anchor and the anchored elements into the visible area of the -// scroller. -scroller.scrollTop = 300; -scroller.scrollLeft = 1300; +promise_setup(async () => { + // Move both the anchor and the anchored elements into the visible area of the + // scroller. This also runs layout to setup an empty anchor-scroll snapshot. + scroller.scrollTop = 300; + scroller.scrollLeft = 1300; -test(() => { + // Ensure up-to-date anchor-scroll snapshot. + await new Promise(resolve => requestAnimationFrame(resolve)); +}); + +promise_test(async () => { let rect = anchored.getBoundingClientRect(); assert_equals(rect.x, 200); assert_equals(rect.y, 100); }, 'Element.getBoundingClientRect() returns the actual rendered location'); -test(() => { +promise_test(async () => { let range = document.createRange(); let text = anchored.firstChild; range.setStart(text, 0); @@ -69,7 +74,7 @@ assert_equals(rect.y, 100); }, 'Range.getBoundingClientRect() returns the actual rendered location'); -test(() => { +promise_test(async () => { assert_equals(anchored.offsetLeft, 200); assert_equals(anchored.offsetTop, 100); }, 'Element.offset* return adjusted offsets');
diff --git a/third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-scroll-update-005.tentative.html b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-scroll-update-005.tentative.html new file mode 100644 index 0000000..5675507 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-scroll-update-005.tentative.html
@@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html class="reftest-wait"> +<title>Tests that anchored element should update location after scroll offset changes caused by scroller resizing</title> +<link rel="author" href="mailto:xiaochengh@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-anchor-1/"> +<link rel="match" href="reference/anchor-scroll-update-005-ref.html"> +<style> + #cb { + position: absolute; + inset: 0; + } + #scroller { + margin-top: 300px; + overflow-y: scroll; + height: 100px; + } + #scroller.changed { height: 200px; } + #spacer { height: 400px; } + #anchor { anchor-name: --a; } + #anchored { + position: absolute; + width: 100px; + height: 100px; + background-color: green; + top: anchor(--a top); + left: 0; + anchor-scroll: --a; + } +</style> +<div id="cb"> + <div id="scroller"> + <div id="anchor"></div> + <div id="spacer"></div> + </div> + <div id="anchored"></div> +</div> +<script> +function raf() { + return new Promise(resolve => requestAnimationFrame(resolve)); +} + +async function runTest() { + const scroller = document.getElementById('scroller'); + scroller.scrollTop = 300; + + await raf(); + await raf(); + + scroller.classList.add('changed'); + document.documentElement.classList.remove('reftest-wait'); + + // Should change scroll offset and anchor-scroll adjustment to 200. +} +runTest(); +</script> +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-scroll-update-006.tentative.html b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-scroll-update-006.tentative.html new file mode 100644 index 0000000..7a8e675 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-scroll-update-006.tentative.html
@@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html class="reftest-wait"> +<title>Tests that anchored element should update location after scroll offset changes caused by scroll content resizing</title> +<link rel="author" href="mailto:xiaochengh@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-anchor-1/"> +<link rel="match" href="reference/anchor-scroll-update-006-ref.html"> +<style> + #cb { + position: absolute; + inset: 0; + } + #scroller { + margin-top: 300px; + overflow-y: scroll; + height: 100px; + } + #spacer { height: 400px; } + #spacer.changed { height: 300px; } + #anchor { anchor-name: --a; } + #anchored { + position: absolute; + width: 100px; + height: 100px; + background-color: green; + top: anchor(--a top); + left: 0; + anchor-scroll: --a; + } +</style> +<div id="cb"> + <div id="scroller"> + <div id="anchor"></div> + <div id="spacer"></div> + </div> + <div id="anchored"></div> +</div> +<script> +function raf() { + return new Promise(resolve => requestAnimationFrame(resolve)); +} + +async function runTest() { + const scroller = document.getElementById('scroller'); + scroller.scrollTop = 300; + + await raf(); + await raf(); + + document.getElementById('spacer').classList.add('changed'); + document.documentElement.classList.remove('reftest-wait'); + + // Should change scroll offset and anchor-scroll adjustment to 200. +} +runTest(); +</script> +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-anchor-position/reference/anchor-scroll-update-005-ref.html b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/reference/anchor-scroll-update-005-ref.html new file mode 100644 index 0000000..b0c3a82 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/reference/anchor-scroll-update-005-ref.html
@@ -0,0 +1,34 @@ +<!DOCTYPE html> +<style> + #cb { + position: absolute; + inset: 0; + } + #scroller { + margin-top: 300px; + overflow-y: scroll; + height: 200px; + } + #spacer { height: 400px; } + #anchor { anchor-name: --a; } + #anchored { + position: absolute; + width: 100px; + height: 100px; + background-color: green; + top: 100px; + left: 0; + } +</style> +<div id="cb"> + <div id="scroller"> + <div id="anchor"></div> + <div id="spacer"></div> + </div> + <div id="anchored"></div> +</div> +<script> +const scroller = document.getElementById('scroller'); +scroller.scrollTop = 200; +</script> +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-anchor-position/reference/anchor-scroll-update-006-ref.html b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/reference/anchor-scroll-update-006-ref.html new file mode 100644 index 0000000..c7fbb57e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/reference/anchor-scroll-update-006-ref.html
@@ -0,0 +1,34 @@ +<!DOCTYPE html> +<style> + #cb { + position: absolute; + inset: 0; + } + #scroller { + margin-top: 300px; + overflow-y: scroll; + height: 100px; + } + #spacer { height: 300px; } + #anchor { anchor-name: --a; } + #anchored { + position: absolute; + width: 100px; + height: 100px; + background-color: green; + top: 100px; + left: 0; + } +</style> +<div id="cb"> + <div id="scroller"> + <div id="anchor"></div> + <div id="spacer"></div> + </div> + <div id="anchored"></div> +</div> +<script> +const scroller = document.getElementById('scroller'); +scroller.scrollTop = 200; +</script> +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-break/table/overflow-scroll-row.html b/third_party/blink/web_tests/external/wpt/css/css-break/table/overflow-scroll-row.html new file mode 100644 index 0000000..8ed379e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-break/table/overflow-scroll-row.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1365306"> +<link rel="help" href="https://www.w3.org/TR/css-overflow-3/#overflow-properties"> +<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> +<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> +<div style="columns:2; column-fill:auto; gap:0; width:100px; height:100px; background:red;"> + <div style="height:30px; background:green;"></div> + <div style="display:table; width:100%;"> + <!-- The overflow property doesn't apply to table rows. --> + <div style="display:table-row; overflow:scroll; height:170px; background:green;"> + <br> + </div> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-break/table/overflow-scroll-section.html b/third_party/blink/web_tests/external/wpt/css/css-break/table/overflow-scroll-section.html new file mode 100644 index 0000000..62b3071 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-break/table/overflow-scroll-section.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1365306"> +<link rel="help" href="https://www.w3.org/TR/css-overflow-3/#overflow-properties"> +<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> +<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> +<div style="columns:2; column-fill:auto; gap:0; width:100px; height:100px; background:red;"> + <div style="height:30px; background:green;"></div> + <div style="display:table; width:100%;"> + <!-- The overflow property doesn't apply to table sections. --> + <div style="display:table-row-group; overflow:scroll; height:170px; background:green;"> + <br> + </div> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/t422-rgba-onscreen-b-ref.html b/third_party/blink/web_tests/external/wpt/css/css-color/t422-rgba-onscreen-b-ref.html deleted file mode 100644 index db97bb63..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-color/t422-rgba-onscreen-b-ref.html +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Reference</title> -<link rel="author" title="Intel" href="http://www.intel.com"> -<style> - html, body { background: white; } - table { border-spacing: 0 2px; padding: 0; border: none; } - td { border: none; padding: 0; } - td, div { height: 1.2em; } -</style> -<body> - <p>Every row in this table should have both columns the same color:</p> - <table> - <tr> - <th style="background:white; color: black">Column 1</th> - <th style="background:black; color: white">Column 2</th> - </tr> - <tr> - <td colspan='2' style="background: rgb(204, 204, 255)"> </td> - </tr> - <tr> - <td colspan='2' style="background: rgb(163, 163, 255)"> </td> - </tr> - <tr> - <td colspan='2' style="background: rgb(153, 153, 255)"> </td> - </tr> - <tr> - <td colspan='2' style="background: rgb(92, 92, 255)"> </td> - </tr> - <tr> - <td colspan='2' style="background: rgb(102, 102, 255)"> </td> - </tr> - <tr> - <td colspan='2' style="background: rgb(41, 41, 255)"> </td> - </tr> - <tr> - <td colspan='2' style="background: rgb(51, 51, 255)"> </td> - </tr> - <tr> - <td colspan='2' style="background: rgb(10, 10, 255)"> </td> - </tr> - </table> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/t422-rgba-onscreen-b.xht b/third_party/blink/web_tests/external/wpt/css/css-color/t422-rgba-onscreen-b.xht deleted file mode 100644 index 7d1f4420..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-color/t422-rgba-onscreen-b.xht +++ /dev/null
@@ -1,62 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>CSS Test: rgba() overpainting</title> - <link rel="author" title="L. David Baron" href="https://dbaron.org/" /> - <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" /> - <link rel="help" href="http://www.w3.org/TR/css3-color/#rgba-color" /> - <link rel="match" href="t422-rgba-onscreen-b-ref.html" /> - <meta name="assert" content="Test that rgba() does not behave like opacity and draw in an offscreen buffer." /> - <style type="text/css"><![CDATA[ - html, body { background: white; } - table { border-spacing: 0 2px; padding: 0; border: none; } - td { border: none; padding: 0; } - - td, div { height: 1.2em; } - ]]></style> - </head> - <body> - - <p>Every row in this table should have both columns the same color:</p> - - <table> - <tr> - <th style="background:white; color: black">Column 1</th> - <th style="background:black; color: white">Column 2</th> - </tr> - <tr> - <td style="background: rgba(0, 0, 255, 0.2)"> </td> - <td style="background: rgb(204, 204, 255)"> </td> - </tr> - <tr> - <td style="background: rgba(0, 0, 255, 0.2)"><div style="background: inherit"> </div></td> - <td style="background: rgb(163, 163, 255)"> </td> - </tr> - <tr> - <td style="background: rgba(0, 0, 255, 0.4)"> </td> - <td style="background: rgb(153, 153, 255)"> </td> - </tr> - <tr> - <td style="background: rgba(0, 0, 255, 0.4)"><div style="background: inherit"> </div></td> - <td style="background: rgb(92, 92, 255)"> </td> - </tr> - <tr> - <td style="background: rgba(0, 0, 255, 0.6)"> </td> - <td style="background: rgb(102, 102, 255)"> </td> - </tr> - <tr> - <td style="background: rgba(0, 0, 255, 0.6)"><div style="background: inherit"> </div></td> - <td style="background: rgb(41, 41, 255)"> </td> - </tr> - <tr> - <td style="background: rgba(0, 0, 255, 0.8)"> </td> - <td style="background: rgb(51, 51, 255)"> </td> - </tr> - <tr> - <td style="background: rgba(0, 0, 255, 0.8)"><div style="background: inherit"> </div></td> - <td style="background: rgb(10, 10, 255)"> </td> - </tr> - </table> - - </body> -</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/t422-rgba-onscreen-multiple-boxes-c-ref.html b/third_party/blink/web_tests/external/wpt/css/css-color/t422-rgba-onscreen-multiple-boxes-c-ref.html deleted file mode 100644 index 6de63c6..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-color/t422-rgba-onscreen-multiple-boxes-c-ref.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Reference</title> -<link rel="author" title="Intel" href="http://www.intel.com"> -<style> - body { background: white; } - div.test { margin: 1em; line-height: 0; font-family: monospace; } - div.test span { background: rgb(92, 92, 255); color: rgb(92, 92, 255); } - div.ref { height: 1em; width: 5em; background: rgb(92, 92, 255); } -</style> -<body> - <p>These two rectangles should be the same color:</p> - <div class="test"><span>XXXXX<br/>XXXXX</span></div> - <div class="ref"></div> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/t422-rgba-onscreen-multiple-boxes-c.xht b/third_party/blink/web_tests/external/wpt/css/css-color/t422-rgba-onscreen-multiple-boxes-c.xht deleted file mode 100644 index 0ac780ee..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-color/t422-rgba-onscreen-multiple-boxes-c.xht +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>CSS Test: rgba() overpainting</title> - <link rel="author" title="L. David Baron" href="https://dbaron.org/" /> - <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" /> - <link rel="help" href="http://www.w3.org/TR/css3-color/#rgba-color" /> - <link rel="match" href="t422-rgba-onscreen-multiple-boxes-c-ref.html" /> - <meta name="assert" content="Test that rgba() does not behave like opacity and draw in an offscreen buffer." /> - <style type="text/css"><![CDATA[ - - body { background: white; } - - div.test { margin: 1em; line-height: 0; font-family: monospace; } - div.test span { background: rgba(0, 0, 255, 0.4); color: rgba(255, 0, 0, 0); } - - div.ref { height: 1em; width: 5em; background: rgb(92, 92, 255); } - - ]]></style> - </head> - <body> - - <p>These two rectangles should be the same color:</p> - - <div class="test"><span>XXXXX<br/>XXXXX</span></div> - - <div class="ref"></div> - - </body> -</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/t425-hsla-onscreen-b.xht b/third_party/blink/web_tests/external/wpt/css/css-color/t425-hsla-onscreen-b.xht deleted file mode 100644 index b2dcf5f..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-color/t425-hsla-onscreen-b.xht +++ /dev/null
@@ -1,62 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>CSS Test: hsla() overpainting</title> - <link rel="author" title="L. David Baron" href="https://dbaron.org/" /> - <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" /> - <link rel="help" href="http://www.w3.org/TR/css3-color/#hsla-color" /> - <link rel="match" href="t422-rgba-onscreen-b-ref.html" /> - <meta name="assert" content="Test that hsla() does not behave like opacity and draw in an offscreen buffer." /> - <style type="text/css"><![CDATA[ - html, body { background: white; } - table { border-spacing: 0 2px; padding: 0; border: none; } - td { border: none; padding: 0; } - - td, div { height: 1.2em; } - ]]></style> - </head> - <body> - - <p>Every row in this table should have both columns the same color:</p> - - <table> - <tr> - <th style="background:white; color: black">Column 1</th> - <th style="background:black; color: white">Column 2</th> - </tr> - <tr> - <td style="background: hsla(240, 100%, 50%, 0.2)"> </td> - <td style="background: rgb(204, 204, 255)"> </td> - </tr> - <tr> - <td style="background: hsla(240, 100%, 50%, 0.2)"><div style="background: inherit"> </div></td> - <td style="background: rgb(163, 163, 255)"> </td> - </tr> - <tr> - <td style="background: hsla(240, 100%, 50%, 0.4)"> </td> - <td style="background: rgb(153, 153, 255)"> </td> - </tr> - <tr> - <td style="background: hsla(240, 100%, 50%, 0.4)"><div style="background: inherit"> </div></td> - <td style="background: rgb(92, 92, 255)"> </td> - </tr> - <tr> - <td style="background: hsla(240, 100%, 50%, 0.6)"> </td> - <td style="background: rgb(102, 102, 255)"> </td> - </tr> - <tr> - <td style="background: hsla(240, 100%, 50%, 0.6)"><div style="background: inherit"> </div></td> - <td style="background: rgb(41, 41, 255)"> </td> - </tr> - <tr> - <td style="background: hsla(240, 100%, 50%, 0.8)"> </td> - <td style="background: rgb(51, 51, 255)"> </td> - </tr> - <tr> - <td style="background: hsla(240, 100%, 50%, 0.8)"><div style="background: inherit"> </div></td> - <td style="background: rgb(10, 10, 255)"> </td> - </tr> - </table> - - </body> -</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/t425-hsla-onscreen-multiple-boxes-c.xht b/third_party/blink/web_tests/external/wpt/css/css-color/t425-hsla-onscreen-multiple-boxes-c.xht deleted file mode 100644 index 9d2eccd4..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-color/t425-hsla-onscreen-multiple-boxes-c.xht +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>CSS Test: hsla() overpainting</title> - <link rel="author" title="L. David Baron" href="https://dbaron.org/" /> - <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" /> - <link rel="help" href="http://www.w3.org/TR/css3-color/#hsla-color" /> - <link rel="match" href="t422-rgba-onscreen-multiple-boxes-c-ref.html" /> - <meta name="assert" content="Test that hsla() does not behave like opacity and draw in an offscreen buffer." /> - <style type="text/css"><![CDATA[ - - body { background: white; } - - div.test { margin: 1em; line-height: 0; font-family: monospace; } - div.test span { background: hsla(240, 100%, 50%, 0.4); color: hsla(0, 100%, 50%, 0); } - - div.ref { height: 1em; width: 5em; background: rgb(92, 92, 255); } - - ]]></style> - </head> - <body> - - <p>These two rectangles should be the same color:</p> - - <div class="test"><span>XXXXX<br/>XXXXX</span></div> - - <div class="ref"></div> - - </body> -</html>
diff --git a/third_party/blink/web_tests/external/wpt/screen-orientation/hidden_document.html b/third_party/blink/web_tests/external/wpt/screen-orientation/hidden_document.html new file mode 100644 index 0000000..b78dbb62 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/screen-orientation/hidden_document.html
@@ -0,0 +1,64 @@ +<!DOCTYPE html> +<meta name="timeout" content="long" /> +<title> + Prevent hidden documents from locking orientation +</title> +<link rel="help" href="https://github.com/w3c/screen-orientation/pull/232" /> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script src="/screen-visibility/resources/window_state_context.js"></script> +<script src="/screen-orientation/resources/orientation_.js"></script> +<script> + promise_test(async (t) => { + const { minimize, restore } = window_state_context(t); + t.add_cleanup(restore); + + await minimize(); + + assert_equals(document.visibilityState, "hidden", "Document must be hidden"); + await promise_rejects_dom(t, "SecurityError", screen.orientation.lock("landscape") ); + }, "hidden documents must reject went trying to call lock or unlock"); + + promise_test(async (t) => { + const { minimize, restore } = window_state_context(t); + t.add_cleanup(restore); + + await minimize(); + + assert_equals(document.visibilityState, "hidden", "Document must be hidden"); + await promise_rejects_dom(t, "SecurityError", screen.orientation.unlock() ); + }, "hidden documents must reject went trying to call unlock"); + + promise_test(async (t) => { + const { minimize, restore } = window_state_context(t); + t.add_cleanup(restore); + t.add_cleanup(make_cleanup()); + await screen.orientation.lock(getOppositeOrientation()); + + await minimize(); + + assert_equals(document.visibilityState, "hidden", "Document must be hidden"); + await promise_rejects_dom(t, "SecurityError", screen.orientation.unlock() ); + }, "hidden documents must not unlock the screen orientation"); + + promise_test(async (t) => { + const { minimize, restore } = window_state_context(t); + t.add_cleanup(restore); + t.add_cleanup(make_cleanup()); + await screen.orientation.lock(getOppositeOrientation()); + + await minimize(); + + assert_equals(document.visibilityState, "hidden"); + await promise_rejects_dom(t, "SecurityError", screen.orientation.lock(getOppositeOrientation())); + + // Maximize, now everything should work as expected. + await restore(); + + assert_equals(document.visibilityState, "visible"); + await screen.orientation.lock(getOppositeOrientation()); + await screen.orientation.unlock(); + }, "Once maximized, a minimized window can lock or unlock the screen orientation again"); +</script>
diff --git a/third_party/blink/web_tests/platform/linux/external/wpt/screen-orientation/hidden_document-expected.txt b/third_party/blink/web_tests/platform/linux/external/wpt/screen-orientation/hidden_document-expected.txt new file mode 100644 index 0000000..e1aa609 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/external/wpt/screen-orientation/hidden_document-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +FAIL hidden documents must reject went trying to call lock or unlock promise_test: Unhandled rejection with value: object "ReferenceError: window_state_context is not defined" +FAIL hidden documents must reject went trying to call unlock promise_test: Unhandled rejection with value: object "ReferenceError: window_state_context is not defined" +FAIL hidden documents must not unlock the screen orientation promise_test: Unhandled rejection with value: object "ReferenceError: window_state_context is not defined" +FAIL Once maximized, a minimized window can lock or unlock the screen orientation again promise_test: Unhandled rejection with value: object "ReferenceError: window_state_context is not defined" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/screen-orientation/hidden_document-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/screen-orientation/hidden_document-expected.txt new file mode 100644 index 0000000..e1aa609 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/external/wpt/screen-orientation/hidden_document-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +FAIL hidden documents must reject went trying to call lock or unlock promise_test: Unhandled rejection with value: object "ReferenceError: window_state_context is not defined" +FAIL hidden documents must reject went trying to call unlock promise_test: Unhandled rejection with value: object "ReferenceError: window_state_context is not defined" +FAIL hidden documents must not unlock the screen orientation promise_test: Unhandled rejection with value: object "ReferenceError: window_state_context is not defined" +FAIL Once maximized, a minimized window can lock or unlock the screen orientation again promise_test: Unhandled rejection with value: object "ReferenceError: window_state_context is not defined" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/win10/external/wpt/screen-orientation/hidden_document-expected.txt b/third_party/blink/web_tests/platform/win10/external/wpt/screen-orientation/hidden_document-expected.txt new file mode 100644 index 0000000..e1aa609 --- /dev/null +++ b/third_party/blink/web_tests/platform/win10/external/wpt/screen-orientation/hidden_document-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +FAIL hidden documents must reject went trying to call lock or unlock promise_test: Unhandled rejection with value: object "ReferenceError: window_state_context is not defined" +FAIL hidden documents must reject went trying to call unlock promise_test: Unhandled rejection with value: object "ReferenceError: window_state_context is not defined" +FAIL hidden documents must not unlock the screen orientation promise_test: Unhandled rejection with value: object "ReferenceError: window_state_context is not defined" +FAIL Once maximized, a minimized window can lock or unlock the screen orientation again promise_test: Unhandled rejection with value: object "ReferenceError: window_state_context is not defined" +Harness: the test ran to completion. +
diff --git a/third_party/instrumented_libraries/focal/BUILD.gn b/third_party/instrumented_libraries/focal/BUILD.gn index 04144ee..a43ccca 100644 --- a/third_party/instrumented_libraries/focal/BUILD.gn +++ b/third_party/instrumented_libraries/focal/BUILD.gn
@@ -52,6 +52,7 @@ ":librtmp1", ":libsasl2-2", ":libsecret", + ":libssl1.1", ":libtasn1-6", ":libudev1", ":libunity9", @@ -644,6 +645,10 @@ pre_build = "scripts/pre-build/autoreconf.sh" } +instrumented_library("libssl1.1") { + build_method = "debian" +} + instrumented_library("libtasn1-3") { extra_configure_flags = [ "--disable-static",
diff --git a/third_party/instrumented_libraries/focal/scripts/install-build-deps.sh b/third_party/instrumented_libraries/focal/scripts/install-build-deps.sh index 3db0a4c7..024cf9d 100755 --- a/third_party/instrumented_libraries/focal/scripts/install-build-deps.sh +++ b/third_party/instrumented_libraries/focal/scripts/install-build-deps.sh
@@ -53,6 +53,7 @@ libmicrohttpd \ libpng1.6 \ libsasl2-2 \ +libssl1.1 \ libunity \ libx11 \ libxau \
diff --git a/third_party/wayland/README.chromium b/third_party/wayland/README.chromium index 48b8a53..e5ebba3 100644 --- a/third_party/wayland/README.chromium +++ b/third_party/wayland/README.chromium
@@ -19,6 +19,7 @@ - Added "include/" include_dirs for the wayland_server target - Added automatic generation of protocol marshalling code. - Made server/client generated with wayland_protocol template. +- Using a custom branch that includes a fix to a buffer size overflow bug. To import a new snapshot of wayland: - Checkout the latest release tag.
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index f82cb65c..07f8455e 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -128,7 +128,6 @@ 'android-chrome-pie-x86-wpt-fyi-rel': 'android_release_bot_minimal_symbols_x86_fastbuild_webview_monochrome_reclient', 'android-cronet-asan-x86-rel': 'android_cronet_release_bot_minimal_symbols_x86_clang_asan_reclient', 'android-pie-arm64-wpt-rel-non-cq': 'android_release_bot_minimal_symbols_arm64_webview_monochrome_reclient', - 'android-pie-x86-fyi-rel-reviver': 'android_release_bot_minimal_symbols_x86_fastbuild_webview_monochrome_reclient', 'android-weblayer-with-aosp-webview-x86-fyi-rel': 'android_release_bot_minimal_symbols_x86_fastbuild_resource_allowlisting_disable_proguard_chrome_google_reclient', 'android-webview-pie-x86-wpt-fyi-rel': 'android_release_bot_minimal_symbols_x86_fastbuild_webview_monochrome_reclient', }, @@ -1000,7 +999,6 @@ 'android-pie-arm64-dbg': 'android_debug_trybot_arm64', 'android-pie-arm64-rel': 'android_release_trybot_arm64_webview_monochrome_expectations_fastbuild', 'android-pie-arm64-wpt-rel-non-cq': 'android_release_trybot_arm64_webview_monochrome', - 'android-pie-x86-fyi-rel-reviver': 'android_release_trybot_x86_fastbuild_webview_monochrome', 'android-pie-x86-rel': 'android_release_trybot_x86_fastbuild_webview_monochrome', 'android-weblayer-10-x86-rel-tests': 'android_release_trybot_minimal_symbols_x86_fastbuild_disable_proguard_chrome_google', 'android-weblayer-marshmallow-x86-rel-tests': 'android_release_trybot_minimal_symbols_x86_fastbuild_disable_proguard_chrome_google',
diff --git a/tools/mb/mb_config_expectations/chromium.android.fyi.json b/tools/mb/mb_config_expectations/chromium.android.fyi.json index f376385..0fd803a 100644 --- a/tools/mb/mb_config_expectations/chromium.android.fyi.json +++ b/tools/mb/mb_config_expectations/chromium.android.fyi.json
@@ -109,24 +109,6 @@ "use_remoteexec": true } }, - "android-pie-x86-fyi-rel-reviver": { - "gn_args": { - "android_static_analysis": "off", - "dcheck_always_on": false, - "debuggable_apks": false, - "ffmpeg_branding": "Chrome", - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "strip_debug_info": true, - "symbol_level": 1, - "system_webview_package_name": "com.google.android.apps.chrome", - "system_webview_shell_package_name": "org.chromium.my_webview_shell", - "target_cpu": "x86", - "target_os": "android", - "use_remoteexec": true - } - }, "android-weblayer-with-aosp-webview-x86-fyi-rel": { "gn_args": { "android_static_analysis": "off",
diff --git a/tools/mb/mb_config_expectations/tryserver.chromium.android.json b/tools/mb/mb_config_expectations/tryserver.chromium.android.json index 6a05df2..ee8131db 100644 --- a/tools/mb/mb_config_expectations/tryserver.chromium.android.json +++ b/tools/mb/mb_config_expectations/tryserver.chromium.android.json
@@ -776,24 +776,6 @@ "use_goma": true } }, - "android-pie-x86-fyi-rel-reviver": { - "gn_args": { - "android_static_analysis": "off", - "dcheck_always_on": true, - "debuggable_apks": false, - "ffmpeg_branding": "Chrome", - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "strip_debug_info": true, - "symbol_level": 0, - "system_webview_package_name": "com.google.android.apps.chrome", - "system_webview_shell_package_name": "org.chromium.my_webview_shell", - "target_cpu": "x86", - "target_os": "android", - "use_goma": true - } - }, "android-pie-x86-rel": { "gn_args": { "android_static_analysis": "off",
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 9581289..b658a63 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -59839,6 +59839,7 @@ <int value="-706733351" label="enable-floating-virtual-keyboard:enabled"/> <int value="-706159808" label="QuickAnswersOnEditableText:disabled"/> <int value="-705746939" label="ChromeDuet:enabled"/> + <int value="-705464246" label="ChromeCartDomBasedHeuristics:enabled"/> <int value="-705212373" label="IncognitoNtpRevamp:disabled"/> <int value="-704459022" label="ContinuousSearch:enabled"/> <int value="-704232562" label="UseMonitorColorSpace:enabled"/> @@ -60104,6 +60105,7 @@ <int value="-541611402" label="OfflinePagesPrefetching:enabled"/> <int value="-540972085" label="ManagedConfiguration:enabled"/> <int value="-540150399" label="TapVisualizerApp:enabled"/> + <int value="-538728016" label="ChromeCartDomBasedHeuristics:disabled"/> <int value="-538448229" label="MaxUnthrottledTimeoutNestingLevel:enabled"/> <int value="-538141684" label="SafetyTip:enabled"/> <int value="-536289234" label="ssl-interstitial-v2-colorful"/>
diff --git a/tools/metrics/histograms/metadata/blink/histograms.xml b/tools/metrics/histograms/metadata/blink/histograms.xml index 9af8f88..dc7c8a3 100644 --- a/tools/metrics/histograms/metadata/blink/histograms.xml +++ b/tools/metrics/histograms/metadata/blink/histograms.xml
@@ -892,7 +892,7 @@ <histogram name="Blink.FedCm.ApprovedClientsExistence" enum="Boolean" expires_after="2023-03-12"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records whether an IDP returns an approved clients list in the response. Records at most one sample per API call. @@ -900,9 +900,9 @@ </histogram> <histogram name="Blink.FedCm.ApprovedClientsSize" units="clients" - expires_after="2023-03-26"> + expires_after="2023-03-12"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the size of the approved clients list returned by IDP if applicable. Records at most one sample per API call. @@ -910,9 +910,9 @@ </histogram> <histogram name="Blink.FedCm.CancelReason" enum="FedCmCancelReason" - expires_after="M110"> + expires_after="2023-03-12"> <owner>pkotwicz@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the reason that the FedCM dialog was closed (ex user clicked the dialog close button). Recorded when the FedCM dialog is closed without the @@ -923,9 +923,9 @@ </histogram> <histogram name="Blink.FedCm.CloseVerifySheet.Android" enum="Boolean" - expires_after="M110"> + expires_after="2023-03-12"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records whether the UI that a user is closing is the verify sheet or not on Android. Records at most one sample per API call. @@ -933,9 +933,9 @@ </histogram> <histogram name="Blink.FedCm.CloseVerifySheet.Desktop" enum="Boolean" - expires_after="M110"> + expires_after="2023-03-12"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records whether the UI that a user is closing is the verify sheet or not on desktop. Records at most one sample per API call. @@ -945,7 +945,7 @@ <histogram name="Blink.FedCm.IsSignInUser" enum="Boolean" expires_after="2023-03-12"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records whether the user selected account is for sign-in or not. Records at most one sample per API call. @@ -955,14 +955,14 @@ <histogram name="Blink.FedCm.Status.Csp" enum="FedCmCspStatus" expires_after="M120"> <owner>cbiesinger@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary>Records the result of CSP checks in the FedCM API.</summary> </histogram> <histogram name="Blink.FedCm.Status.RequestIdToken" enum="FedCmRequestIdTokenStatus" expires_after="2023-03-12"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the status of a request token call to the FedCM API. </summary> @@ -974,14 +974,14 @@ Revoke is deprecated. Removed in June 2022. </obsolete> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary>Records the status of a revoke call to the FedCM API.</summary> </histogram> <histogram name="Blink.FedCm.Status.SignInStateMatch" - enum="FedCmSignInStateMatchStatus" expires_after="M110"> + enum="FedCmSignInStateMatchStatus" expires_after="2023-03-12"> <owner>tanzachary@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records whether user sign-in states between IDP and browser match. Records a sample after browser receives an account list from IDP prior to showing UI. @@ -989,9 +989,9 @@ </histogram> <histogram name="Blink.FedCm.Timing.CancelOnDialog" units="ms" - expires_after="2023-03-26"> + expires_after="2023-03-12"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the time from when the accounts dialog is shown to when the user explicitly closes the dialog without selecting any account. Only records a @@ -1005,7 +1005,7 @@ <histogram name="Blink.FedCm.Timing.ContinueOnDialog" units="ms" expires_after="2023-03-12"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the time from when the accounts dialog is shown to when the user presses the Continue button. Only records a sample when the user sees and @@ -1014,9 +1014,9 @@ </histogram> <histogram name="Blink.FedCm.Timing.IdTokenResponse" units="ms" - expires_after="M110"> + expires_after="2023-03-12"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the time from when the user presses the Continue button to when the token response is received. Only records a sample when the token response is @@ -1027,7 +1027,7 @@ <histogram name="Blink.FedCm.Timing.ShowAccountsDialog" units="ms" expires_after="2023-03-12"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the time from when a call to the API was made to when the accounts dialog is shown. Only records a sample when the dialog is shown. @@ -1037,7 +1037,7 @@ <histogram name="Blink.FedCm.Timing.TurnaroundTime" units="ms" expires_after="2023-03-12"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the overall time from when the API is called to when the token response is received. Only records a sample when the token response is @@ -1048,7 +1048,7 @@ <histogram name="Blink.FedCm.WebContentsVisible" enum="Boolean" expires_after="2023-03-12"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records whether the WebContents is visible when the browser is ready to show the accounts dialog to the user. Records at most one sample per API call. @@ -2518,7 +2518,7 @@ <histogram name="Blink.Sms.BackendAvailability" enum="WebOTPBackendAvailability" expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records how often the verification backend is unavailable for the WebOTP API and the corresponding reason. This is recorded once per OTP request. @@ -2528,7 +2528,7 @@ <histogram name="Blink.Sms.PendingOriginCount" units="origins" expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> SmsFetcher subscribes to incoming SMSes with origins from SmsProvider. This metric records the number of pending origins that are not unsubscribed when @@ -2539,7 +2539,7 @@ <histogram name="Blink.Sms.Receive.CrossDeviceFailure" enum="WebOTPCrossDeviceFailure" expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the reason why using the WebOTP API on desktop failed on the sharing path. It records one sample per invocation of the API. @@ -2550,7 +2550,7 @@ expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> <owner>goto@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records how many times the infobar was called and how many times the infobar replaced a keyboard. @@ -2561,14 +2561,14 @@ expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> <owner>goto@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary>Records the result of a call to the WebOTP API.</summary> </histogram> <histogram name="Blink.Sms.Receive.SmsParsingStatus" enum="SmsParsingStatus" expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the status of parsing an incoming SMS when using the WebOTP API. It records one sample per incoming SMS. @@ -2581,7 +2581,7 @@ expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> <owner>goto@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the duration from when the API is called to when the request is cancelled by the service due to duplicated requests or lack of delegate. @@ -2592,7 +2592,7 @@ expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> <owner>goto@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the duration from when the keyboard was replaced with an infobar until when the user clicked the cancel button. @@ -2603,7 +2603,7 @@ expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> <owner>goto@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the time from when a successful SMS was retrieved to when the user presses the Cancel button. @@ -2614,7 +2614,7 @@ expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> <owner>goto@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the time from when a successful SMS was retrieved to when the user presses the Continue button. @@ -2625,7 +2625,7 @@ expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> <owner>goto@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the duration from when the API is called to when an SMS has been successfully received. @@ -2636,7 +2636,7 @@ expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> <owner>goto@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the duration from when the API is called to when the user successfully receives the SMS and presses continue to pass the incoming SMS @@ -2648,7 +2648,7 @@ expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> <owner>goto@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records the duration from when the API is called to when the user successfully receives the SMS and presses "Deny" to terminate the @@ -2659,7 +2659,7 @@ <histogram name="Blink.Sms.WebContentsVisibleOnReceive" enum="Boolean" expires_after="2023-03-05"> <owner>yigu@chromium.org</owner> - <owner>fedcm-core@google.com</owner> + <owner>web-identity-eng@google.com</owner> <summary> Records whether the web contents that receives the OTP is visible or not for the UserConsent backend. Recorded at most once per API call when Chrome sees
diff --git a/tools/metrics/histograms/metadata/commerce/histograms.xml b/tools/metrics/histograms/metadata/commerce/histograms.xml index 9c17aba..66d6576 100644 --- a/tools/metrics/histograms/metadata/commerce/histograms.xml +++ b/tools/metrics/histograms/metadata/commerce/histograms.xml
@@ -41,6 +41,18 @@ summary="Tabs between 1 and 90 days since last usage."/> </variants> +<histogram name="Commerce.Carts.AddToCartButtonDetection" units="ms" + expires_after="2023-06-30"> + <owner>yuezhanggg@chromium.org</owner> + <owner>wychen@chromium.org</owner> + <owner>chrome-shopping@google.com</owner> + <summary> + Records how long it takes to decide if a focused element is an AddToCart + button. This is recorded everytime an element is focused on an eligible + website when the DOM-based heuristic is enabled. + </summary> +</histogram> + <histogram name="Commerce.Carts.ExtractionElapsedTime" units="ms" expires_after="2023-03-19"> <owner>wychen@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/memory/histograms.xml b/tools/metrics/histograms/metadata/memory/histograms.xml index d6fc597..b74ab02 100644 --- a/tools/metrics/histograms/metadata/memory/histograms.xml +++ b/tools/metrics/histograms/metadata/memory/histograms.xml
@@ -2456,7 +2456,7 @@ </histogram> <histogram name="Memory.StackSamplingProfiler.StackSampleSize" units="KB" - expires_after="M110"> + expires_after="M119"> <owner>iby@chromium.org</owner> <owner>cros-telemetry@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/service/histograms.xml b/tools/metrics/histograms/metadata/service/histograms.xml index 878ab115..8179139 100644 --- a/tools/metrics/histograms/metadata/service/histograms.xml +++ b/tools/metrics/histograms/metadata/service/histograms.xml
@@ -789,9 +789,36 @@ updated when it is read from the database next time. This metrics records the name of the new fetch handler detected. + ServiceWorker.OnStarted.UpdatedFetchHandlerTypeBySourceType_* for the + breakdown by the source fetch handler type. </summary> </histogram> +<histogram + name="ServiceWorker.OnStarted.UpdatedFetchHandlerTypeBySourceType_{SourceType}" + enum="ServiceWorkerFetchHandlerType" expires_after="2023-06-30"> + <owner>yyanagisawa@chromium.org</owner> + <owner>chrome-worker@google.com</owner> + <summary> + The type of the fetch handler type to be stored in the database for update + per the source fetch handler type {SourceType} (See + ServiceWorker.OnStarted.UpdatedFetchHandlerType for all attenpts). + + During the start of ServiceWorker, the fetch handler type is decided, and + sent via OnStarted. If the fetch handler type is different from the fetch + handler type already recognized and stored before, it will eventually be + updated when it is read from the database next time. + + This metrics records the name of the new fetch handler detected. + </summary> + <token key="SourceType"> + <variant name="EMPTY_FETCH_HANDLER" + summary="skippable empty fetch handler"/> + <variant name="NO_HANDLER" summary="no fetch handler"/> + <variant name="NOT_SKIPPABLE" summary="not skippable fetch handler"/> + </token> +</histogram> + <histogram name="ServiceWorker.PaymentRequestEvent.Time" units="ms" expires_after="2023-10-18"> <owner>rouslan@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/uma/histograms.xml b/tools/metrics/histograms/metadata/uma/histograms.xml index c8c45977..b4d5da9 100644 --- a/tools/metrics/histograms/metadata/uma/histograms.xml +++ b/tools/metrics/histograms/metadata/uma/histograms.xml
@@ -782,6 +782,18 @@ </summary> </histogram> +<histogram name="UMA.StructuredMetrics.EventFileSize" units="KB" + expires_after="2023-04-25"> + <owner>tby@chromium.org</owner> + <owner>jongahn@chromium.org</owner> + <summary> + File size of events recorded outside of Chrome. This metric is recorded for + every file processed by an external metrics scan, which reads the events + into memory to be appended to an UMA log. This external metrics scan happens + roughly every 45 minutes. + </summary> +</histogram> + <histogram name="UMA.StructuredMetrics.EventRecordingState" enum="StructuredMetricsEventRecordingState" expires_after="2023-03-19"> <owner>tby@chromium.org</owner> @@ -848,6 +860,17 @@ </summary> </histogram> +<histogram name="UMA.StructuredMetrics.NumFilesPerExternalMetricsScan" + units="count" expires_after="2023-04-25"> + <owner>tby@chromium.org</owner> + <owner>jongahn@chromium.org</owner> + <summary> + How many files in the external Structured metrics directory before an + external metrics scan is triggered. The external metrics scan will read the + events into memory and delete ALL files in the directory. + </summary> +</histogram> + <histogram name="UMA.TruncatedEvents.Omnibox" units="events" expires_after="M85"> <owner>rkaplow@chromium.org</owner>
diff --git a/ui/file_manager/file_manager/common/js/dialog_type.js b/ui/file_manager/file_manager/common/js/dialog_type.js index c2d5d7f..95c76c3 100644 --- a/ui/file_manager/file_manager/common/js/dialog_type.js +++ b/ui/file_manager/file_manager/common/js/dialog_type.js
@@ -11,7 +11,7 @@ * @enum {string} * @const */ -const DialogType = { +export const DialogType = { SELECT_FOLDER: 'folder', SELECT_UPLOAD_FOLDER: 'upload-folder', SELECT_SAVEAS_FILE: 'saveas-file', @@ -24,41 +24,19 @@ * @param {DialogType} type Dialog type. * @return {boolean} Whether the type is modal. */ -DialogType.isModal = type => { +export function isModal(type) { return type == DialogType.SELECT_FOLDER || type == DialogType.SELECT_UPLOAD_FOLDER || type == DialogType.SELECT_SAVEAS_FILE || type == DialogType.SELECT_OPEN_FILE || type == DialogType.SELECT_OPEN_MULTI_FILE; -}; - -/** - * @param {DialogType} type Dialog type. - * @return {boolean} Whether the type is open dialog. - */ -DialogType.isOpenDialog = type => { - return type == DialogType.SELECT_OPEN_FILE || - type == DialogType.SELECT_OPEN_MULTI_FILE || - type == DialogType.SELECT_FOLDER || - type == DialogType.SELECT_UPLOAD_FOLDER; -}; - -/** - * @param {DialogType} type Dialog type. - * @return {boolean} Whether the type is open dialog for file(s). - */ -DialogType.isOpenFileDialog = type => { - return type == DialogType.SELECT_OPEN_FILE || - type == DialogType.SELECT_OPEN_MULTI_FILE; -}; +} /** * @param {DialogType} type Dialog type. * @return {boolean} Whether the type is folder selection dialog. */ -DialogType.isFolderDialog = type => { +export function isFolderDialogType(type) { return type == DialogType.SELECT_FOLDER || type == DialogType.SELECT_UPLOAD_FOLDER; -}; - -export {DialogType}; +}
diff --git a/ui/file_manager/file_manager/common/js/filtered_volume_manager.js b/ui/file_manager/file_manager/common/js/filtered_volume_manager.js index 2ebcb4ef..f2d5aea9 100644 --- a/ui/file_manager/file_manager/common/js/filtered_volume_manager.js +++ b/ui/file_manager/file_manager/common/js/filtered_volume_manager.js
@@ -14,7 +14,7 @@ import {ArrayDataModel} from './array_data_model.js'; import {util} from './util.js'; -import {AllowedPaths, VolumeManagerCommon} from './volume_manager_types.js'; +import {AllowedPaths, isNative, VolumeManagerCommon} from './volume_manager_types.js'; /** * Implementation of VolumeInfoList for FilteredVolumeManager. @@ -189,7 +189,7 @@ case AllowedPaths.ANY_PATH_OR_URL: return true; case AllowedPaths.NATIVE_PATH: - return VolumeManagerCommon.VolumeType.isNative(assert(volumeType)); + return isNative(assert(volumeType)); } return false; } @@ -247,7 +247,7 @@ // SelectFileAsh requires native volumes. Note: DocumentsProvider and // FSPs return false here, until they are implemented in the fusebox. return this.isFuseBoxFileSystem_(volumeInfo.diskFileSystemType) || - VolumeManagerCommon.VolumeType.isNative(volumeInfo.volumeType); + isNative(volumeInfo.volumeType); } else if (this.isFuseBoxFileSystem_(volumeInfo.diskFileSystemType)) { // Normal Files app: remove fusebox volumes. return false;
diff --git a/ui/file_manager/file_manager/common/js/volume_manager_types.js b/ui/file_manager/file_manager/common/js/volume_manager_types.js index b35a6083..7723368 100644 --- a/ui/file_manager/file_manager/common/js/volume_manager_types.js +++ b/ui/file_manager/file_manager/common/js/volume_manager_types.js
@@ -247,7 +247,7 @@ * @param {VolumeManagerCommon.VolumeType} type * @return {boolean} */ -VolumeManagerCommon.VolumeType.isNative = type => { +export function isNative(type) { return type === VolumeManagerCommon.VolumeType.DOWNLOADS || type === VolumeManagerCommon.VolumeType.DRIVE || type === VolumeManagerCommon.VolumeType.ANDROID_FILES || @@ -256,7 +256,7 @@ type === VolumeManagerCommon.VolumeType.REMOVABLE || type === VolumeManagerCommon.VolumeType.ARCHIVE || type === VolumeManagerCommon.VolumeType.SMB; -}; +} Object.freeze(VolumeManagerCommon.VolumeType);
diff --git a/ui/file_manager/file_manager/common/js/volume_manager_types_unittest.js b/ui/file_manager/file_manager/common/js/volume_manager_types_unittest.js index 8159ee9..fd19ac8 100644 --- a/ui/file_manager/file_manager/common/js/volume_manager_types_unittest.js +++ b/ui/file_manager/file_manager/common/js/volume_manager_types_unittest.js
@@ -14,13 +14,6 @@ const volumeType = VolumeManagerCommon.VolumeType[key]; assertTrue(volumeType !== undefined); - // The enum is decorated with an isNative() helper. Skip it for the purposes - // of this test, since it is not a valid enum value. (This helper breaks the - // ability to iterate over enum values, so should probably be removed). - if (volumeType === VolumeManagerCommon.VolumeType.isNative) { - return; - } - // System Internal volumes do not have a corresponding root. if (volumeType == VolumeManagerCommon.VolumeType.SYSTEM_INTERNAL) { return;
diff --git a/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js b/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js index 7e2ebd2..21672ef 100644 --- a/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js +++ b/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js
@@ -3,10 +3,9 @@ // found in the LICENSE file. import {assert, assertNotReached} from 'chrome://resources/js/assert.js'; -import {Command} from './ui/command.js'; import {$} from 'chrome://resources/js/util.js'; -import {DialogType} from '../../common/js/dialog_type.js'; +import {DialogType, isFolderDialogType} from '../../common/js/dialog_type.js'; import {metrics} from '../../common/js/metrics.js'; import {str, UserCanceledError, util} from '../../common/js/util.js'; import {AllowedPaths, VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; @@ -18,6 +17,7 @@ import {LaunchParam} from './launch_param.js'; import {MetadataModel} from './metadata/metadata_model.js'; import {NamingController} from './naming_controller.js'; +import {Command} from './ui/command.js'; import {DialogFooter} from './ui/dialog_footer.js'; /** @@ -162,8 +162,7 @@ const selectedIndexes = this.directoryModel_.getFileListSelection().selectedIndexes; - if (DialogType.isFolderDialog(this.dialogType_) && - selectedIndexes.length === 0) { + if (isFolderDialogType(this.dialogType_) && selectedIndexes.length === 0) { const url = this.directoryModel_.getCurrentDirEntry().toURL(); const singleSelection = { urls: [url], @@ -209,7 +208,7 @@ const selectedEntry = dm.item(selectedIndexes[0]); - if (DialogType.isFolderDialog(this.dialogType_)) { + if (isFolderDialogType(this.dialogType_)) { if (!selectedEntry.isDirectory) { throw new Error('Selected entry is not a folder!'); } @@ -398,7 +397,7 @@ return; } - if (DialogType.isFolderDialog(this.dialogType_)) { + if (isFolderDialogType(this.dialogType_)) { // In SELECT_FOLDER mode, we allow to select current directory // when nothing is selected. this.dialogFooter_.okButton.disabled =
diff --git a/ui/file_manager/file_manager/foreground/js/directory_model.js b/ui/file_manager/file_manager/foreground/js/directory_model.js index 06ffd70..80329285 100644 --- a/ui/file_manager/file_manager/foreground/js/directory_model.js +++ b/ui/file_manager/file_manager/foreground/js/directory_model.js
@@ -10,7 +10,7 @@ import {GuestOsPlaceholder} from '../../common/js/files_app_entry_types.js'; import {metrics} from '../../common/js/metrics.js'; import {util} from '../../common/js/util.js'; -import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; +import {isNative, VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {FileOperationManager} from '../../externs/background/file_operation_manager.js'; import {EntriesChangedEvent} from '../../externs/entries_changed_event.js'; import {FakeEntry, FilesAppDirEntry, FilesAppEntry} from '../../externs/files_app_entry_interfaces.js'; @@ -308,8 +308,7 @@ isOnNative() { const rootType = this.getCurrentRootType(); return rootType != null && !util.isRecentRootType(rootType) && - VolumeManagerCommon.VolumeType.isNative( - VolumeManagerCommon.getVolumeTypeFromRootType(rootType)); + isNative(VolumeManagerCommon.getVolumeTypeFromRootType(rootType)); } /**
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager.js b/ui/file_manager/file_manager/foreground/js/file_manager.js index 98195cad6..53641c7 100644 --- a/ui/file_manager/file_manager/foreground/js/file_manager.js +++ b/ui/file_manager/file_manager/foreground/js/file_manager.js
@@ -9,7 +9,7 @@ import {getDialogCaller, getDlpBlockedComponents, getPreferences} from '../../common/js/api.js'; import {ArrayDataModel} from '../../common/js/array_data_model.js'; -import {DialogType} from '../../common/js/dialog_type.js'; +import {DialogType, isFolderDialogType} from '../../common/js/dialog_type.js'; import {getKeyModifiers, queryDecoratedElement, queryRequiredElement} from '../../common/js/dom_utils.js'; import {FakeEntryImpl} from '../../common/js/files_app_entry_types.js'; import {FilesAppState} from '../../common/js/files_app_state.js'; @@ -1219,8 +1219,7 @@ directoryTree.dataModel = new NavigationListModel( assert(this.volumeManager_), assert(this.folderShortcutsModel_), - fakeEntriesVisible && - !DialogType.isFolderDialog(this.launchParams_.type) ? + fakeEntriesVisible && !isFolderDialogType(this.launchParams_.type) ? new NavigationModelFakeItem( str('RECENT_ROOT_LABEL'), NavigationModelItemType.RECENT, assert(this.recentEntry_)) : @@ -1594,7 +1593,7 @@ // non-native files. But it does not work for folders (e.g., dialog for // loading unpacked extensions). if (allowedPaths === AllowedPaths.NATIVE_PATH && - !DialogType.isFolderDialog(this.launchParams_.type)) { + !isFolderDialogType(this.launchParams_.type)) { if (this.launchParams_.type == DialogType.SELECT_SAVEAS_FILE) { allowedPaths = AllowedPaths.NATIVE_PATH; } else {
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js index 4999e38..250316e 100644 --- a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js +++ b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
@@ -9,7 +9,7 @@ import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {getDlpRestrictionDetails, getHoldingSpaceState, startIOTask} from '../../common/js/api.js'; -import {DialogType} from '../../common/js/dialog_type.js'; +import {DialogType, isModal} from '../../common/js/dialog_type.js'; import {FileType} from '../../common/js/file_type.js'; import {EntryList} from '../../common/js/files_app_entry_types.js'; import {metrics} from '../../common/js/metrics.js'; @@ -215,7 +215,7 @@ CommandUtil.canExecuteVisibleOnDriveInNormalAppModeOnly = (event, fileManager) => { const enabled = fileManager.directoryModel.isOnDrive() && - !DialogType.isModal(fileManager.dialogType); + !isModal(fileManager.dialogType); event.canExecute = enabled; event.command.setHidden(!enabled); }; @@ -1767,7 +1767,7 @@ // besides that the help page is about the Files app as an app, not about // the dialog mode itself. It can also lead to hard-to-fix bug // crbug.com/339089. - const hideHelp = DialogType.isModal(fileManager.dialogType); + const hideHelp = isModal(fileManager.dialogType); event.canExecute = !hideHelp; event.command.setHidden(hideHelp); }
diff --git a/ui/file_manager/file_manager/foreground/js/main_window_component.js b/ui/file_manager/file_manager/foreground/js/main_window_component.js index 28c2aaf..708e0f2 100644 --- a/ui/file_manager/file_manager/foreground/js/main_window_component.js +++ b/ui/file_manager/file_manager/foreground/js/main_window_component.js
@@ -4,7 +4,7 @@ import {assertInstanceof} from 'chrome://resources/js/assert.js'; -import {DialogType} from '../../common/js/dialog_type.js'; +import {DialogType, isFolderDialogType} from '../../common/js/dialog_type.js'; import {getKeyModifiers} from '../../common/js/dom_utils.js'; import {metrics} from '../../common/js/metrics.js'; import {TrashEntry} from '../../common/js/trash.js'; @@ -457,7 +457,7 @@ case 'Enter': // Enter => Change directory or perform default action. const selection = this.selectionHandler_.selection; if (selection.totalCount === 1 && selection.entries[0].isDirectory && - !DialogType.isFolderDialog(this.dialogType_) && + !isFolderDialogType(this.dialogType_) && !selection.entries.some(util.isTrashEntry)) { const item = this.ui_.listContainer.currentList.getListItemByIndex( selection.indexes[0]);
diff --git a/ui/file_manager/file_manager/foreground/js/quick_view_controller.js b/ui/file_manager/file_manager/foreground/js/quick_view_controller.js index 89b2a87..d11ce07 100644 --- a/ui/file_manager/file_manager/foreground/js/quick_view_controller.js +++ b/ui/file_manager/file_manager/foreground/js/quick_view_controller.js
@@ -6,7 +6,7 @@ import {LoadImageRequest, LoadImageResponse, LoadImageResponseStatus} from 'chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/load_image_request.js'; import {assert} from 'chrome://resources/js/assert.js'; -import {DialogType} from '../../common/js/dialog_type.js'; +import {DialogType, isModal} from '../../common/js/dialog_type.js'; import {FileType} from '../../common/js/file_type.js'; import {str, util} from '../../common/js/util.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; @@ -156,7 +156,7 @@ */ init_(quickView) { this.quickView_ = quickView; - this.quickView_.isModal = DialogType.isModal(this.dialogType_); + this.quickView_.isModal = isModal(this.dialogType_); this.quickView_.setAttribute('files-ng', '');
diff --git a/ui/gfx/geometry/decomposed_transform.cc b/ui/gfx/geometry/decomposed_transform.cc index 89a0bbe..572e74295 100644 --- a/ui/gfx/geometry/decomposed_transform.cc +++ b/ui/gfx/geometry/decomposed_transform.cc
@@ -12,11 +12,11 @@ std::string DecomposedTransform::ToString() const { return base::StringPrintf( - "translate: %+0.4f %+0.4f %+0.4f\n" - "scale: %+0.4f %+0.4f %+0.4f\n" - "skew: %+0.4f %+0.4f %+0.4f\n" - "perspective: %+0.4f %+0.4f %+0.4f %+0.4f\n" - "quaternion: %+0.4f %+0.4f %+0.4f %+0.4f\n", + "translate: %+lg %+lg %+lg\n" + "scale: %+lg %+lg %+lg\n" + "skew: %+lg %+lg %+lg\n" + "perspective: %+lg %+lg %+lg %+lg\n" + "quaternion: %+lg %+lg %+lg %+lg\n", translate[0], translate[1], translate[2], scale[0], scale[1], scale[2], skew[0], skew[1], skew[2], perspective[0], perspective[1], perspective[2], perspective[3], quaternion.x(), quaternion.y(), quaternion.z(),
diff --git a/ui/gfx/geometry/transform.cc b/ui/gfx/geometry/transform.cc index 8f0394b..e3c0080e 100644 --- a/ui/gfx/geometry/transform.cc +++ b/ui/gfx/geometry/transform.cc
@@ -900,13 +900,29 @@ std::string Transform::ToString() const { return base::StringPrintf( - "[ %+0.4f %+0.4f %+0.4f %+0.4f \n" - " %+0.4f %+0.4f %+0.4f %+0.4f \n" - " %+0.4f %+0.4f %+0.4f %+0.4f \n" - " %+0.4f %+0.4f %+0.4f %+0.4f ]\n", + "[ %lg %lg %lg %lg\n" + " %lg %lg %lg %lg\n" + " %lg %lg %lg %lg\n" + " %lg %lg %lg %lg ]\n", rc(0, 0), rc(0, 1), rc(0, 2), rc(0, 3), rc(1, 0), rc(1, 1), rc(1, 2), rc(1, 3), rc(2, 0), rc(2, 1), rc(2, 2), rc(2, 3), rc(3, 0), rc(3, 1), rc(3, 2), rc(3, 3)); } +std::string Transform::ToDecomposedString() const { + absl::optional<gfx::DecomposedTransform> decomp = Decompose(); + if (!decomp) + return ToString() + "(degenerate)"; + + if (IsIdentity()) + return "identity"; + + if (IsIdentityOrTranslation()) { + return base::StringPrintf("translate: %lg,%lg,%lg", decomp->translate[0], + decomp->translate[1], decomp->translate[2]); + } + + return decomp->ToString(); +} + } // namespace gfx
diff --git a/ui/gfx/geometry/transform.h b/ui/gfx/geometry/transform.h index f9a11769..6861d12 100644 --- a/ui/gfx/geometry/transform.h +++ b/ui/gfx/geometry/transform.h
@@ -486,8 +486,12 @@ void EnsureFullMatrixForTesting() { EnsureFullMatrix(); } + // Returns a string in the format of "[ row0\n, row1\n, row2\n, row3 ]\n". std::string ToString() const; + // Returns a string containing decomposed components. + std::string ToDecomposedString() const; + private: // Used internally to construct Transform with parameters in col-major order. Transform(double r0c0,
diff --git a/ui/gfx/geometry/transform_unittest.cc b/ui/gfx/geometry/transform_unittest.cc index 8d94c95..d23edb7 100644 --- a/ui/gfx/geometry/transform_unittest.cc +++ b/ui/gfx/geometry/transform_unittest.cc
@@ -3334,6 +3334,39 @@ } } +TEST(XFormTest, ToString) { + auto zeros = + Transform::ColMajor(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + EXPECT_EQ("[ 0 0 0 0\n 0 0 0 0\n 0 0 0 0\n 0 0 0 0 ]\n", zeros.ToString()); + EXPECT_EQ("[ 0 0 0 0\n 0 0 0 0\n 0 0 0 0\n 0 0 0 0 ]\n(degenerate)", + zeros.ToDecomposedString()); + + Transform identity; + EXPECT_EQ("[ 1 0 0 0\n 0 1 0 0\n 0 0 1 0\n 0 0 0 1 ]\n", + identity.ToString()); + EXPECT_EQ("identity", identity.ToDecomposedString()); + + Transform translation; + translation.Translate3d(3, 5, 7); + EXPECT_EQ("[ 1 0 0 3\n 0 1 0 5\n 0 0 1 7\n 0 0 0 1 ]\n", + translation.ToString()); + EXPECT_EQ("translate: 3,5,7", translation.ToDecomposedString()); + + auto transform = Transform::ColMajor(1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, + 1e20, 1e-20, 1.0 / 3.0, 0, 0, 0, 0, 1); + EXPECT_EQ( + "[ 1.1 5.5 1e+20 0\n 2.2 6.6 1e-20 0\n 3.3 7.7 0.333333 0\n" + " 4.4 8.8 0 1 ]\n", + transform.ToString()); + EXPECT_EQ( + "translate: +0 +0 +0\n" + "scale: -4.11582 -2.88048 -4.08248e+19\n" + "skew: +3.87836 +0.654654 +2.13809\n" + "perspective: -6.66667e-21 -1 +2 +1\n" + "quaternion: -0.582925 +0.603592 +0.518949 +0.162997\n", + transform.ToDecomposedString()); +} + } // namespace } // namespace gfx
diff --git a/ui/webui/resources/PRESUBMIT.py b/ui/webui/resources/PRESUBMIT.py index 1b0e0d0..b4a3aef 100644 --- a/ui/webui/resources/PRESUBMIT.py +++ b/ui/webui/resources/PRESUBMIT.py
@@ -78,6 +78,44 @@ sys.path = old_sys_path return results +def _CheckNoDisallowedJS(input_api, output_api): + # Ignore legacy files from the js/ subfolder along with tools/. + EXCLUDE_PATH_PREFIXES = [ + 'ui/webui/resources/js/assert.js', + 'ui/webui/resources/js/dom_automation_controller.js', + 'ui/webui/resources/js/cr', + 'ui/webui/resources/js/ios/', + 'ui/webui/resources/js/load_time_data.m.js', + 'ui/webui/resources/js/load_time_data_deprecated.js', + 'ui/webui/resources/js/promise_resolver.js', + 'ui/webui/resources/js/util.js', + 'ui/webui/resources/js/util_deprecated.js', + 'ui/webui/resources/tools/', + ] + + normalized_excluded_prefixes = [] + for path in EXCLUDE_PATH_PREFIXES: + normalized_excluded_prefixes.append(input_api.os_path.normpath(path)) + + # Also exempt any externs or eslint files, which must be in JS. + EXCLUDE_PATH_SUFFIXES = [ + '_externs.js', + '.eslintrc.js', + ] + + def allow_js(f): + path = f.LocalPath() + for prefix in normalized_excluded_prefixes: + if path.startswith(prefix): + return True + for suffix in EXCLUDE_PATH_SUFFIXES: + if path.endswith(suffix): + return True + return False + + from web_dev_style import presubmit_support + return presubmit_support.DisallowNewJsFiles(input_api, output_api, + lambda f: not allow_js(f)) def _CheckJsModulizer(input_api, output_api): affected = input_api.AffectedFiles() @@ -113,6 +151,7 @@ results += _CheckForTranslations(input_api, output_api) results += _CheckSvgsOptimized(input_api, output_api) results += _CheckWebDevStyle(input_api, output_api) + results += _CheckNoDisallowedJS(input_api, output_api) results += _CheckJsModulizer(input_api, output_api) results += _CheckGenerateGrd(input_api, output_api) results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api,
diff --git a/ui/webui/resources/cr_elements/cr_slider/cr_slider.ts b/ui/webui/resources/cr_elements/cr_slider/cr_slider.ts index e14cfd4..68b447ce 100644 --- a/ui/webui/resources/cr_elements/cr_slider/cr_slider.ts +++ b/ui/webui/resources/cr_elements/cr_slider/cr_slider.ts
@@ -6,7 +6,6 @@ * @fileoverview 'cr-slider' is a slider component used to select a number from * a continuous or discrete range of numbers. */ -import '../../js/cr.m.js'; import '../cr_hidden_style.css.js'; import '../cr_shared_vars.css.js';
diff --git a/ui/webui/resources/cr_elements/cr_toast/cr_toast_manager.ts b/ui/webui/resources/cr_elements/cr_toast/cr_toast_manager.ts index d0ceb179..c51e8722 100644 --- a/ui/webui/resources/cr_elements/cr_toast/cr_toast_manager.ts +++ b/ui/webui/resources/cr_elements/cr_toast/cr_toast_manager.ts
@@ -4,8 +4,6 @@ /** @fileoverview Element which shows toasts with optional undo button. */ -import '../../js/cr.m.js'; -import '../../js/event_tracker.js'; import '../cr_hidden_style.css.js'; import './cr_toast.js';
diff --git a/ui/webui/resources/js/cr.m.js b/ui/webui/resources/js/cr.m.js index 3684bfd..b79bce92 100644 --- a/ui/webui/resources/js/cr.m.js +++ b/ui/webui/resources/js/cr.m.js
@@ -2,13 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview This file is not auto-generated from cr.js, because it's a - * special case. cr.js holds a lot of functionality that is unnecessary in the - * JS Module world, and auto-generating cr.m.js would require adding a lot of - * logic in js_modulizer.py only to address the cr.js case, which is not worth - * it. - */ import {assert} from './assert.js'; import {PromiseResolver} from './promise_resolver.js'; @@ -29,20 +22,6 @@ } /** - * Adds a {@code getInstance} static method that always return the same - * instance object. Do not use in new code; does not work with TypeScript. - * @param {!Function} ctor The constructor for the class to add the static - * method to. - * TODO (rbpotter): Remove this once all callers have been moved to - * cr_deprecated. - */ -export function addSingletonGetter(ctor) { - ctor.getInstance = function() { - return ctor.instance_ || (ctor.instance_ = new ctor()); - }; -} - -/** * The mapping used by the sendWithPromise mechanism to tie the Promise * returned to callers with the corresponding WebUI response. The mapping is * from ID to the PromiseResolver helper; the ID is generated by
diff --git a/url/BUILD.gn b/url/BUILD.gn index be2cfbf..eedb03f7 100644 --- a/url/BUILD.gn +++ b/url/BUILD.gn
@@ -139,10 +139,10 @@ sources = [ "android/origin_android.cc" ] deps = [ + ":gurl_android", ":url", ":url_jni_headers", "//base", - "//url/mojom:url_mojom_origin", ] } } @@ -173,11 +173,14 @@ android_library("origin_java") { sources = [ "android/java/src/org/chromium/url/Origin.java" ] deps = [ + ":gurl_java", "//base:jni_java", + "//build/android:build_java", "//mojo/public/java:bindings_java", "//mojo/public/mojom/base:base_java", "//url/mojom:url_mojom_origin_java", ] + annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] } } @@ -284,24 +287,30 @@ } if (is_android) { - source_set("gurl_android_test_helper") { + source_set("android_test_helper") { testonly = true - sources = [ "android/gurl_java_test_helper.cc" ] + sources = [ + "android/gurl_java_test_helper.cc", + "android/origin_java_test_helper.cc", + ] deps = [ ":gurl_android", - ":gurl_j_test_jni_headers", + ":j_test_jni_headers", + ":origin_android", ":url", "//base/test:test_support", - "//testing/gtest", ] } - android_library("gurl_android_test_helper_java") { + android_library("android_test_helper_java") { testonly = true - sources = - [ "android/javatests/src/org/chromium/url/GURLJavaTestHelper.java" ] + sources = [ + "android/javatests/src/org/chromium/url/GURLJavaTestHelper.java", + "android/javatests/src/org/chromium/url/OriginJavaTestHelper.java", + ] deps = [ ":gurl_java", + ":origin_java", "//base:base_java_test_support", "//base:jni_java", ] @@ -325,20 +334,23 @@ ] } - android_library("gurl_java_unit_tests") { + android_library("url_java_unit_tests") { testonly = true sources = [ "android/javatests/src/org/chromium/url/GURLJavaTest.java", "android/javatests/src/org/chromium/url/JUnitTestGURLsTest.java", + "android/javatests/src/org/chromium/url/OriginJavaTest.java", ] deps = [ - ":gurl_android_test_helper_java", + ":android_test_helper_java", ":gurl_java", ":gurl_junit_test_support", + ":origin_java", "//base:base_java", "//base:base_java_test_support", "//base:jni_java", "//content/public/test/android:content_java_test_support", + "//mojo/public/mojom/base:base_java", "//third_party/android_support_test_runner:rules_java", "//third_party/android_support_test_runner:runner_java", "//third_party/androidx:androidx_core_core_java", @@ -346,16 +358,19 @@ "//third_party/junit", "//third_party/mockito:mockito_java", "//url/mojom:url_mojom_gurl_java", + "//url/mojom:url_mojom_origin_java", ] annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] } # See https://bugs.chromium.org/p/chromium/issues/detail?id=908819 for why we # can't put 'java' in the name here. - generate_jni("gurl_j_test_jni_headers") { + generate_jni("j_test_jni_headers") { testonly = true - sources = - [ "android/javatests/src/org/chromium/url/GURLJavaTestHelper.java" ] + sources = [ + "android/javatests/src/org/chromium/url/GURLJavaTestHelper.java", + "android/javatests/src/org/chromium/url/OriginJavaTestHelper.java", + ] } robolectric_library("gurl_junit_tests") {
diff --git a/url/android/gurl_java_test_helper.cc b/url/android/gurl_java_test_helper.cc index 4f9f6dd..5ad1b44 100644 --- a/url/android/gurl_java_test_helper.cc +++ b/url/android/gurl_java_test_helper.cc
@@ -7,10 +7,9 @@ #include "base/android/jni_android.h" #include "base/android/jni_string.h" #include "base/test/icu_test_util.h" -#include "testing/gtest/include/gtest/gtest.h" #include "url/android/gurl_android.h" #include "url/gurl.h" -#include "url/gurl_j_test_jni_headers/GURLJavaTestHelper_jni.h" +#include "url/j_test_jni_headers/GURLJavaTestHelper_jni.h" using base::android::AttachCurrentThread; @@ -60,7 +59,13 @@ Java_GURLJavaTestHelper_createGURL( env, base::android::ConvertUTF8ToJavaString(env, uri)); std::unique_ptr<GURL> gurl2 = GURLAndroid::ToNativeGURL(env, j_gurl); - EXPECT_EQ(gurl, *gurl2); + if (gurl != *gurl2) { + std::stringstream ss; + ss << "GURL not equivalent: " << gurl << ", " << *gurl2; + env->ThrowNew(env->FindClass("java/lang/AssertionError"), + ss.str().data()); + return; + } } }
diff --git a/url/android/java/src/org/chromium/url/Origin.java b/url/android/java/src/org/chromium/url/Origin.java index 30ae0a8..87ce8706 100644 --- a/url/android/java/src/org/chromium/url/Origin.java +++ b/url/android/java/src/org/chromium/url/Origin.java
@@ -6,59 +6,109 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; - -import java.nio.ByteBuffer; +import org.chromium.base.annotations.NativeMethods; /** An origin is either a (scheme, host, port) tuple or is opaque. */ @JNINamespace("url") public class Origin { - // The internal representation of the origin that should never be used directly. - private final org.chromium.url.internal.mojom.Origin mInternal; + private final String mScheme; + private final String mHost; + private final short mPort; + + private final boolean mIsOpaque; + + // Serialization of the Unguessable Token. Do not use directly. + private final long mTokenHighBits; + private final long mTokenLowBits; /** - * This convenience constructor provides a way to wrap - * `org.chromium.url.internal.mojom.Origin`s, which are provided by Mojo-generated - * code but not intended for direct use (see crbug.com/1156866). + * Constructs an opaque origin. + */ + public static Origin createOpaqueOrigin() { + return OriginJni.get().createOpaque(); + } + + /** + * See origin.h for many warnings about this method. * - * @return An `Origin` providing user-friendly access to the origin represented by - * `mojoOrigin`. + * Constructs an Origin from a GURL. + */ + public static Origin create(GURL gurl) { + return OriginJni.get().createFromGURL(gurl); + } + + /** + * Parses a mojo Origin into a Java analogue of the c++ Origin class. + * + * `org.chromium.url.internal.mojom.Origin`s, are provided by Mojo-generated code but not + * intended for direct use (see crbug.com/1156866). + * + * @return A Java equivalent of the c++ Origin represented by the provided mojo Origin. */ public Origin(org.chromium.url.internal.mojom.Origin mojoOrigin) { - mInternal = mojoOrigin; + mScheme = mojoOrigin.scheme; + mHost = mojoOrigin.host; + mPort = mojoOrigin.port; + if (mojoOrigin.nonceIfOpaque != null) { + mIsOpaque = true; + mTokenHighBits = mojoOrigin.nonceIfOpaque.high; + mTokenLowBits = mojoOrigin.nonceIfOpaque.low; + } else { + mIsOpaque = false; + mTokenHighBits = 0; + mTokenLowBits = 0; + } + } + + @CalledByNative + private Origin(String scheme, String host, short port, boolean isOpaque, long tokenHighBits, + long tokenLowBits) { + mScheme = scheme; + mHost = host; + mPort = port; + mIsOpaque = isOpaque; + mTokenHighBits = tokenHighBits; + mTokenLowBits = tokenLowBits; } /** @return The scheme of the origin. Returns an empty string for an opaque origin. */ public String getScheme() { - return !isOpaque() ? mInternal.scheme : ""; + return !isOpaque() ? mScheme : ""; } /** @return The host of the origin. Returns an empty string for an opaque origin. */ public String getHost() { - return !isOpaque() ? mInternal.host : ""; + return !isOpaque() ? mHost : ""; } /** @return The port of the origin. Returns 0 for an opaque origin. */ public int getPort() { - return !isOpaque() ? Short.toUnsignedInt(mInternal.port) : 0; + return !isOpaque() ? Short.toUnsignedInt(mPort) : 0; } /** @return Whether the origin is opaque. */ public boolean isOpaque() { - return mInternal.nonceIfOpaque != null; - } - - /** Protected constructor, used for testing purposes only. */ - protected Origin() { - mInternal = null; + return mIsOpaque; } @CalledByNative - private static ByteBuffer serialize(Origin origin) { - return origin.mInternal.serialize(); + private long toNativeOrigin() { + return OriginJni.get().createNative( + mScheme, mHost, mPort, mIsOpaque, mTokenHighBits, mTokenLowBits); } - @CalledByNative - private Origin(ByteBuffer byteBuffer) { - mInternal = org.chromium.url.internal.mojom.Origin.deserialize(byteBuffer); + @NativeMethods + interface Natives { + /** Constructs a new Opaque origin. */ + Origin createOpaque(); + + /** Constructs an Origin from a GURL. */ + Origin createFromGURL(GURL gurl); + + /** + * Reconstructs the native Origin for this Java Origin, returning its native pointer. + */ + long createNative(String scheme, String host, short port, boolean isOpaque, + long tokenHighBits, long tokenLowBits); } }
diff --git a/url/android/javatests/src/org/chromium/url/OriginJavaTest.java b/url/android/javatests/src/org/chromium/url/OriginJavaTest.java new file mode 100644 index 0000000..d32318f --- /dev/null +++ b/url/android/javatests/src/org/chromium/url/OriginJavaTest.java
@@ -0,0 +1,99 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.url; + +import androidx.test.filters.SmallTest; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.test.BaseJUnit4ClassRunner; +import org.chromium.base.test.util.Batch; +import org.chromium.content_public.browser.test.NativeLibraryTestUtils; +import org.chromium.mojo_base.mojom.UnguessableToken; + +/** + * Tests for {@link Origin}. Origin relies heavily on the native implementation, and the lion's + * share of the logic is tested there. This test is primarily to make sure everything is plumbed + * through correctly. + */ +@RunWith(BaseJUnit4ClassRunner.class) +@Batch(Batch.UNIT_TESTS) +public class OriginJavaTest { + @Before + public void setUp() { + NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess(); + } + + @SmallTest + @Test + public void testOriginEquivalence() { + OriginJavaTestHelper.nativeTestOriginEquivalence(); + } + + @SmallTest + @Test + public void testCreateOpaqueOrigin() { + Origin opaque = Origin.createOpaqueOrigin(); + Assert.assertTrue(opaque.isOpaque()); + Assert.assertEquals("", opaque.getScheme()); + Assert.assertEquals("", opaque.getHost()); + Assert.assertEquals(0, opaque.getPort()); + } + + @SmallTest + @Test + public void testNonOpaqueMojomConstructor() { + String scheme = "http"; + String host = "host.name"; + short port = 42; + org.chromium.url.internal.mojom.Origin mojom = new org.chromium.url.internal.mojom.Origin(); + mojom.scheme = scheme; + mojom.host = host; + mojom.port = port; + Origin origin = new Origin(mojom); + + Assert.assertEquals(scheme, origin.getScheme()); + Assert.assertEquals(host, origin.getHost()); + Assert.assertEquals(port, origin.getPort()); + Assert.assertFalse(origin.isOpaque()); + } + + @SmallTest + @Test + public void testOpaqueMojomConstructor() { + String scheme = "http"; + String host = "host.name"; + short port = 42; + org.chromium.url.internal.mojom.Origin mojom = new org.chromium.url.internal.mojom.Origin(); + mojom.scheme = scheme; + mojom.host = host; + mojom.port = port; + UnguessableToken token = new UnguessableToken(); + token.high = 3; + token.low = 4; + mojom.nonceIfOpaque = token; + + Origin origin = new Origin(mojom); + + Assert.assertEquals("", origin.getScheme()); + Assert.assertEquals("", origin.getHost()); + Assert.assertEquals(0, origin.getPort()); + Assert.assertTrue(origin.isOpaque()); + } + + @SmallTest + @Test + public void testCreateFromGURL() { + GURL gurl = new GURL("https://host.name:61234/path"); + Origin opaque = Origin.create(gurl); + Assert.assertFalse(opaque.isOpaque()); + Assert.assertEquals("https", opaque.getScheme()); + Assert.assertEquals("host.name", opaque.getHost()); + Assert.assertEquals(61234, opaque.getPort()); + } +}
diff --git a/url/android/javatests/src/org/chromium/url/OriginJavaTestHelper.java b/url/android/javatests/src/org/chromium/url/OriginJavaTestHelper.java new file mode 100644 index 0000000..d6a361e --- /dev/null +++ b/url/android/javatests/src/org/chromium/url/OriginJavaTestHelper.java
@@ -0,0 +1,15 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.url; + +import org.chromium.base.annotations.JNINamespace; + +/** + * Helpers for OriginJavaTest that need to call into native code. + */ +@JNINamespace("url") +public class OriginJavaTestHelper { + public static native void nativeTestOriginEquivalence(); +}
diff --git a/url/android/origin_android.cc b/url/android/origin_android.cc index 354f7ad5..989fd30 100644 --- a/url/android/origin_android.cc +++ b/url/android/origin_android.cc
@@ -5,40 +5,82 @@ #include "url/origin.h" #include <cstdint> -#include <vector> #include "base/android/jni_android.h" #include "base/android/jni_string.h" #include "base/android/scoped_java_ref.h" -#include "url/mojom/origin.mojom.h" -#include "url/mojom/origin_mojom_traits.h" +#include "base/memory/ptr_util.h" +#include "url/android/gurl_android.h" #include "url/url_jni_headers/Origin_jni.h" namespace url { base::android::ScopedJavaLocalRef<jobject> Origin::CreateJavaObject() const { - std::vector<uint8_t> byte_vector = mojom::Origin::Serialize(this); JNIEnv* env = base::android::AttachCurrentThread(); - base::android::ScopedJavaLocalRef<jobject> byte_buffer = - base::android::ScopedJavaLocalRef<jobject>( - env, - env->NewDirectByteBuffer(byte_vector.data(), byte_vector.size())); - base::android::CheckException(env); - return Java_Origin_Constructor(env, byte_buffer); + const base::UnguessableToken* token = Origin::GetNonceForSerialization(); + return Java_Origin_Constructor( + env, base::android::ConvertUTF8ToJavaString(env, tuple_.scheme()), + base::android::ConvertUTF8ToJavaString(env, tuple_.host()), tuple_.port(), + opaque(), token ? token->GetHighForSerialization() : 0, + token ? token->GetLowForSerialization() : 0); } // static Origin Origin::FromJavaObject( const base::android::JavaRef<jobject>& java_origin) { JNIEnv* env = base::android::AttachCurrentThread(); - base::android::ScopedJavaLocalRef<jobject> byte_buffer = - Java_Origin_serialize(env, java_origin); - Origin result; - bool success = mojom::Origin::Deserialize( - static_cast<jbyte*>(env->GetDirectBufferAddress(byte_buffer.obj())), - env->GetDirectBufferCapacity(byte_buffer.obj()), &result); - DCHECK(success); - return result; + std::unique_ptr<Origin> origin = base::WrapUnique<Origin>( + reinterpret_cast<Origin*>(Java_Origin_toNativeOrigin(env, java_origin))); + return std::move(*origin); +} + +// static +jlong Origin::CreateNative(JNIEnv* env, + const base::android::JavaRef<jstring>& java_scheme, + const base::android::JavaRef<jstring>& java_host, + uint16_t port, + bool is_opaque, + uint64_t token_high_bits, + uint64_t token_low_bits) { + const std::string& scheme = ConvertJavaStringToUTF8(env, java_scheme); + const std::string& host = ConvertJavaStringToUTF8(env, java_host); + + bool has_nonce = token_high_bits != 0 && token_low_bits != 0; + CHECK(has_nonce == is_opaque); + Origin::Nonce nonce; + if (has_nonce) { + nonce = Origin::Nonce( + base::UnguessableToken::Deserialize(token_high_bits, token_low_bits)); + } + Origin origin = is_opaque + ? Origin::CreateOpaqueFromNormalizedPrecursorTuple( + scheme, host, port, nonce) + : Origin::CreateFromNormalizedTuple(scheme, host, port); + return reinterpret_cast<intptr_t>(new Origin(origin)); +} + +static base::android::ScopedJavaLocalRef<jobject> JNI_Origin_CreateOpaque( + JNIEnv* env) { + return Origin().CreateJavaObject(); +} + +static base::android::ScopedJavaLocalRef<jobject> JNI_Origin_CreateFromGURL( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& j_gurl) { + return Origin::Create(*GURLAndroid::ToNativeGURL(env, j_gurl)) + .CreateJavaObject(); +} + +static jlong JNI_Origin_CreateNative( + JNIEnv* env, + const base::android::JavaParamRef<jstring>& java_scheme, + const base::android::JavaParamRef<jstring>& java_host, + jshort port, + jboolean is_opaque, + jlong token_high_bits, + jlong token_low_bits) { + return Origin::CreateNative(env, java_scheme, java_host, port, is_opaque, + token_high_bits, token_low_bits); } } // namespace url
diff --git a/url/android/origin_java_test_helper.cc b/url/android/origin_java_test_helper.cc new file mode 100644 index 0000000..62554d8 --- /dev/null +++ b/url/android/origin_java_test_helper.cc
@@ -0,0 +1,37 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <stddef.h> + +#include "base/android/jni_android.h" +#include "base/android/jni_string.h" +#include "url/gurl.h" +#include "url/j_test_jni_headers/OriginJavaTestHelper_jni.h" +#include "url/origin.h" + +namespace url { + +static void JNI_OriginJavaTestHelper_TestOriginEquivalence(JNIEnv* env) { + Origin cases[] = { + Origin(), + Origin::Create(GURL("http://a.com")), + Origin::Create(GURL("http://a.com:8000")), + Origin::Create(GURL("scheme:host")), + Origin::Create(GURL("http://a.com:8000")).DeriveNewOpaqueOrigin(), + }; + for (const Origin& origin : cases) { + base::android::ScopedJavaLocalRef<jobject> j_origin = + origin.CreateJavaObject(); + Origin sameOrigin = Origin::FromJavaObject(j_origin); + if (origin != sameOrigin) { + std::stringstream ss; + ss << "Origin not equivalent: " << origin << ", " << sameOrigin; + env->ThrowNew(env->FindClass("java/lang/AssertionError"), + ss.str().data()); + return; + } + } +} + +} // namespace url
diff --git a/url/origin.h b/url/origin.h index 02a7bf6e..8681db8 100644 --- a/url/origin.h +++ b/url/origin.h
@@ -311,6 +311,13 @@ base::android::ScopedJavaLocalRef<jobject> CreateJavaObject() const; static Origin FromJavaObject( const base::android::JavaRef<jobject>& java_origin); + static jlong CreateNative(JNIEnv* env, + const base::android::JavaRef<jstring>& java_scheme, + const base::android::JavaRef<jstring>& java_host, + uint16_t port, + bool is_opaque, + uint64_t tokenHighBits, + uint64_t tokenLowBits); #endif // BUILDFLAG(IS_ANDROID) void WriteIntoTrace(perfetto::TracedValue context) const;