diff --git a/.gitignore b/.gitignore index 9bef949..c71ddf7 100644 --- a/.gitignore +++ b/.gitignore
@@ -223,6 +223,7 @@ /components/resources/default_300_percent/google_chrome /components/search_engines/prepopulated_engines.xml /components/site_isolation/internal +/components/test/data/autofill/heuristics-json/internal /components/suggestions.xml /components/variations.xml /components/vector_icons/google_chrome/
diff --git a/DEPS b/DEPS index 6bdc9db0..226f054 100644 --- a/DEPS +++ b/DEPS
@@ -318,15 +318,15 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '68700a1a2be99ffad639f6cb8023e5256f98bff5', + 'skia_revision': 'b17ee34f337883f45840d16927eb9eb799df8768', # 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': 'c2dd92816971fd8cdb8db15d9ac1e0ffb5ca5858', + 'v8_revision': 'f413feb63b48498dac02e21626efdf3be938862a', # 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': 'feb0d11b45ddc7f9ce854de0a1756191c0efdafe', + 'angle_revision': 'b8d5a423d57d4cb139ce0289cea685eca338828f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -369,7 +369,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling freetype # and whatever else without interference from each other. - 'freetype_revision': '97251fd5aa2a90041cf4f397a5e887b8d60ab0c2', + 'freetype_revision': '00b07598d96f7c6c96d2d32dbbb9cd11b3adeacd', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling freetype # and whatever else without interference from each other. @@ -409,7 +409,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '13d80cf6f85e8e1e9468dfffce45f00e0d5487c5', + 'devtools_frontend_revision': 'c9f204731633fd2e2b6999a2543e99b7cc489b4b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -449,7 +449,7 @@ # 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': '259455654c3439348c7b3c8be68909f6864d5ae1', + 'dawn_revision': 'd0ff6fbab11a8c0f5ef0c003015d66fd5be7dfb2', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -845,7 +845,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - 'c9d02456a8a6a34037e743fdd98407fe056ae1bf', + 'b1f20bfe98979ff601530c192b42ead80cddddf1', 'condition': 'checkout_android and checkout_src_internal', }, @@ -1036,6 +1036,17 @@ 'dep_type': 'cipd', }, + 'src/third_party/android_toolchain_canary/ndk': { + 'packages': [ + { + 'package': 'chromium/third_party/android_toolchain_canary/android_toolchain_canary', + 'version': 'soBOaEK-tZV5GhAwchsmh9uarWMa7_WpGAw6eVpEVF0C', + }, + ], + 'condition': 'checkout_android_native_support', + 'dep_type': 'cipd', + }, + 'src/third_party/androidx': { 'packages': [ { @@ -1111,7 +1122,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_build_tools/manifest_merger', - 'version': 'Nc9kYyTsw69N7yKSw_Sc2fJtUJ2zXUhSGjXbIkDVXuIC', + 'version': 'QDllfYz3THjUjNuyymOQipNyZu7mRksO75QB6_0hP-gC', }, ], 'condition': 'checkout_android', @@ -1249,7 +1260,7 @@ # Tools used when building Chrome for Chrome OS. This affects both the Simple # Chrome workflow, as well as the chromeos-chrome ebuild. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'c4b0ff08d3975d0d7a8170c2014504d81d778288', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '9e7986f9a469c985d8a1ad6e764497af190e0e77', 'condition': 'checkout_chromeos', }, @@ -1284,13 +1295,13 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'caeef7ba32da0a782b5b719d038a9dcab7104d6d', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '65c49b18b964400859c1f3eb4cd4ad809da3f90c', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), 'src/third_party/devtools-frontend-internal': { - 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '39c34c4aa41e7091119a306f650506a56b1cc42e', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + 'e78fd89a185f656935b000b459af1099ef8062bd', 'condition': 'checkout_src_internal', }, @@ -1759,7 +1770,7 @@ Var('pdfium_git') + '/pdfium.git' + '@' + Var('pdfium_revision'), 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'c9dd257f3c87a3058a92897950fa9fb4c18f5bfb', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '10b980190fea75c5472eee93fc42a8c4a3eaadd3', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1944,7 +1955,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '2ee990a4cb91b41491f83b52c9520476b18a9fd8', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '43a5dd86c20df887496979acf5041f9920b1b501', + Var('webrtc_git') + '/src.git' + '@' + '66bf3f472c3cbf3872b77ff15c2b02bd1b3d88db', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -2067,7 +2078,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': '7Pv3IiWWwVGb6vPaFlKnOg9zxKXyZZWJ3GhcXXDsadEC', + 'version': '27JGhK2P3PGzvgCv-4VBPkVt3Wo3P6r7J8zkeC98qfgC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -2078,7 +2089,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': '8JfGQyGu_dGtxyN-dyzekMSCAT30HJLjqBItt-TzB4sC', + 'version': '221iebgk9z20RzL2ePBzHMWg3gADuks4Wj47gGLY9xIC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -4207,6 +4218,12 @@ 'condition': 'checkout_src_internal', }, + 'src/components/test/data/autofill/heuristics-json/internal': { + 'url': Var('chrome_git') + '/chrome/test/autofill/structured_forms.git' + '@' + + 'fc9323141d970c474cb466c32c9be6cfcf20e549', + 'condition': 'checkout_chromium_autofill_test_dependencies', + }, + 'src/components/vector_icons/google_chrome': { 'url': Var('chrome_git') + '/chrome/vector_icons/google_chrome.git' + '@' + 'dbf059ca9ed5a4da6ae628042a2797e822a53d79', @@ -4227,7 +4244,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - '6a51cc6934837120dc3cd3eab35e745cc8950e8e', + '395eebb2cf8df3529abc75b898367d14de84978b', 'condition': 'checkout_ios and checkout_src_internal', },
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 36f104c2..19fb13f 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -1645,6 +1645,23 @@ '^tools/', ), ), + BanRule( + pattern = r'ContentSettingsType::COOKIES', + explanation = ( + 'Do not use ContentSettingsType::COOKIES to check whether cookies are ' + 'supported in the provided context. Instead rely on the ' + 'content_settings::CookieSettings API. If you are using ' + 'ContentSettingsType::COOKIES to check the user preference setting ' + 'specifically, disregard this warning.', + ), + treat_as_error = False, + excluded_paths = ( + '^chrome/browser/ui/content_settings/', + '^components/content_settings/', + '^services/network/cookie_settings/', + 'test.cc', + ), + ), ) _BANNED_MOJOM_PATTERNS : Sequence[BanRule] = (
diff --git a/WATCHLISTS b/WATCHLISTS index 5689b4c..3f5300d 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -707,6 +707,7 @@ 'filepath': 'history_clusters'\ '|image_service'\ '|ios/chrome/browser/text_selection'\ + '|manta'\ '|optimization_guide'\ '|optimization_hints'\ '|third_party/eigen3'\
diff --git a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java index 80f1488f..127b138 100644 --- a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java +++ b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java
@@ -505,6 +505,11 @@ "Enables PartitionAlloc's MemoryReclaimer, which tries decommitting unused " + "system pages as much as possible so that other applications can " + "reuse the memory pages."), + Flag.baseFeature( + VizFeatures.EVICT_SUBTREE, "Enables evicting entire tree of surfaces."), + Flag.baseFeature(ContentFeatures.NAVIGATION_UPDATES_CHILD_VIEWS_VISIBILITY, + "Enables notifying children of the top-most RenderWidgetHostView that they " + + "were hidden during a navigation."), // Add new commandline switches and features above. The final entry should have a // trailing comma for cleaner diffs. };
diff --git a/ash/accelerators/ash_accelerator_configuration.cc b/ash/accelerators/ash_accelerator_configuration.cc index 0002bffd..939d777 100644 --- a/ash/accelerators/ash_accelerator_configuration.cc +++ b/ash/accelerators/ash_accelerator_configuration.cc
@@ -221,6 +221,8 @@ // Store a copy of the pref overrides. accelerator_overrides_ = pref_service->GetDict(prefs::kShortcutCustomizationOverrides).Clone(); + // Reset to default first. + ResetAllAccelerators(); ApplyPrefOverrides(); } @@ -372,17 +374,7 @@ } AcceleratorConfigResult AshAcceleratorConfiguration::RestoreAllDefaults() { - accelerators_.clear(); - id_to_accelerators_.clear(); - accelerator_to_id_.Clear(); - deprecated_accelerators_to_id_.Clear(); - actions_with_deprecations_.clear(); - - id_to_accelerators_ = default_id_to_accelerators_cache_; - accelerator_to_id_ = default_accelerators_to_id_cache_; - - deprecated_accelerators_to_id_ = default_deprecated_accelerators_to_id_cache_; - actions_with_deprecations_ = default_actions_with_deprecations_cache_; + ResetAllAccelerators(); // Clear the prefs to be back to default. accelerator_overrides_.clear(); @@ -818,4 +810,18 @@ return true; } +void AshAcceleratorConfiguration::ResetAllAccelerators() { + accelerators_.clear(); + id_to_accelerators_.clear(); + accelerator_to_id_.Clear(); + deprecated_accelerators_to_id_.Clear(); + actions_with_deprecations_.clear(); + + id_to_accelerators_ = default_id_to_accelerators_cache_; + accelerator_to_id_ = default_accelerators_to_id_cache_; + + deprecated_accelerators_to_id_ = default_deprecated_accelerators_to_id_cache_; + actions_with_deprecations_ = default_actions_with_deprecations_cache_; +} + } // namespace ash
diff --git a/ash/accelerators/ash_accelerator_configuration.h b/ash/accelerators/ash_accelerator_configuration.h index ede6581..4429607 100644 --- a/ash/accelerators/ash_accelerator_configuration.h +++ b/ash/accelerators/ash_accelerator_configuration.h
@@ -174,6 +174,9 @@ // the default state and clear the override prefs. bool AreAcceleratorsValid(); + // Resets all accelerator mappings to the the system default. + void ResetAllAccelerators(); + // A local copy of the pref overrides, allows modifying the overrides before // updating the override pref. base::Value::Dict accelerator_overrides_;
diff --git a/ash/accelerators/ash_accelerator_configuration_unittest.cc b/ash/accelerators/ash_accelerator_configuration_unittest.cc index 0acd190..566f4a5 100644 --- a/ash/accelerators/ash_accelerator_configuration_unittest.cc +++ b/ash/accelerators/ash_accelerator_configuration_unittest.cc
@@ -2454,4 +2454,75 @@ ExpectAllAcceleratorsEqual(updated_test_data, config_->GetAllAccelerators()); } +TEST_F(AshAcceleratorConfigurationTest, SwitchUserPrefsAreSeparate) { + SimulateNewUserFirstLogin(kFakeUserEmail); + const AcceleratorData test_data[] = { + {/*trigger_on_press=*/true, ui::VKEY_D, + ui::EF_COMMAND_DOWN | ui::EF_CONTROL_DOWN, + AcceleratorAction::kMagnifierZoomIn}, + }; + + config_->Initialize(test_data); + + // Expect that there are no entries stored in the override pref. + const base::Value::Dict& pref_overrides = GetOverridePref(); + EXPECT_TRUE(pref_overrides.empty()); + + const ui::Accelerator new_accelerator(ui::VKEY_A, ui::EF_COMMAND_DOWN); + AcceleratorConfigResult result = config_->AddUserAccelerator( + AcceleratorAction::kMagnifierZoomIn, new_accelerator); + EXPECT_EQ(AcceleratorConfigResult::kSuccess, result); + + const base::Value::Dict& updated_overrides = GetOverridePref(); + // There should now be an entry in the pref overrides. + EXPECT_EQ(1u, updated_overrides.size()); + // Expect the pref to have one entry that has the key of + // `AcceleratorAction::kSwitchToLastUsedIme`. + const base::Value::List* accelerator_overrides = updated_overrides.FindList( + base::NumberToString(AcceleratorAction::kMagnifierZoomIn)); + // Expect 1 override accelerator for + // `AcceleratorAction::kSwitchToLastUsedIme`. + EXPECT_EQ(1u, accelerator_overrides->size()); + + const AcceleratorData updated_test_data[] = { + {/*trigger_on_press=*/true, ui::VKEY_D, + ui::EF_COMMAND_DOWN | ui::EF_CONTROL_DOWN, + AcceleratorAction::kMagnifierZoomIn}, + {/*trigger_on_press=*/true, ui::VKEY_A, ui::EF_COMMAND_DOWN, + AcceleratorAction::kMagnifierZoomIn}, + }; + + AcceleratorModificationData override_data = + ValueToAcceleratorModificationData( + accelerator_overrides->front().GetDict()); + EXPECT_TRUE(CompareAccelerators( + {/*trigger_on_press=*/true, ui::VKEY_A, ui::EF_COMMAND_DOWN, + AcceleratorAction::kMagnifierZoomIn}, + override_data.accelerator)); + EXPECT_EQ(AcceleratorModificationAction::kAdd, override_data.action); + + ExpectAllAcceleratorsEqual(updated_test_data, config_->GetAllAccelerators()); + + // Simulate login on another account, expect the pref to not be present. + GetSessionControllerClient()->LockScreen(); + SimulateNewUserFirstLogin(kFakeUserEmail2); + const base::Value::Dict& other_user_pref_overrides = GetOverridePref(); + EXPECT_TRUE(other_user_pref_overrides.empty()); + + // Expect the second user to have all defaults. + ExpectAllAcceleratorsEqual(test_data, config_->GetAllAccelerators()); + + // Now re-login to the original profile. + GetSessionControllerClient()->LockScreen(); + config_->Initialize(test_data); + SimulateUserLogin(kFakeUserEmail); + const base::Value::Dict& original_pref_overrides = GetOverridePref(); + EXPECT_FALSE(original_pref_overrides.empty()); + + const base::Value::Dict& relogin_overrides = GetOverridePref(); + EXPECT_EQ(1u, relogin_overrides.size()); + // Verify pref overrides were loaded correctly. + ExpectAllAcceleratorsEqual(updated_test_data, config_->GetAllAccelerators()); +} + } // namespace ash
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index d4f3436..90efef1 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -6958,6 +6958,12 @@ <message name="IDS_GLANCEABLES_TASKS_SELECTED_LIST_EMPTY_ACCESSIBLE_NAME" desc="The glanceable displays tasks items fetched from Google Tasks API. This is the text announced by ChromeVox in case the selected tasks list is empty."> Selected list empty, navigate down to add a new task </message> + <message name="IDS_GLANCEABLES_CLASSROOM_HEADER_ICON_ACCESSIBLE_NAME" desc="The glanceable displays classroom items fetched from Google Classroom API. This is the a11y name announced by ChromeVox for the top left corner header icon that opens Google Classroom website (home page)."> + Google Classroom website + </message> + <message name="IDS_GLANCEABLES_TASKS_HEADER_ICON_ACCESSIBLE_NAME" desc="The glanceable displays tasks items fetched from Google Tasks API. This is the a11y name announced by ChromeVox for the top left corner header icon that opens Google Calendar website with the companion app panel open."> + Google tasks on web + </message> <!-- Do Not Disturb notification --> <message name="IDS_ASH_DO_NOT_DISTURB_NOTIFICATION_TITLE" desc="Label used for the notification that shows up when the 'Do Not Disturb' feature is enabled.">
diff --git a/ash/ash_strings_grd/IDS_GLANCEABLES_CLASSROOM_HEADER_ICON_ACCESSIBLE_NAME.png.sha1 b/ash/ash_strings_grd/IDS_GLANCEABLES_CLASSROOM_HEADER_ICON_ACCESSIBLE_NAME.png.sha1 new file mode 100644 index 0000000..2528795 --- /dev/null +++ b/ash/ash_strings_grd/IDS_GLANCEABLES_CLASSROOM_HEADER_ICON_ACCESSIBLE_NAME.png.sha1
@@ -0,0 +1 @@ +18306df17874f019c85ab10b7ec7d026f0cb4655 \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_GLANCEABLES_TASKS_HEADER_ICON_ACCESSIBLE_NAME.png.sha1 b/ash/ash_strings_grd/IDS_GLANCEABLES_TASKS_HEADER_ICON_ACCESSIBLE_NAME.png.sha1 new file mode 100644 index 0000000..9b9bfac --- /dev/null +++ b/ash/ash_strings_grd/IDS_GLANCEABLES_TASKS_HEADER_ICON_ACCESSIBLE_NAME.png.sha1
@@ -0,0 +1 @@ +d6b24b5b72e988c479223db12b9dc802275993b3 \ No newline at end of file
diff --git a/ash/capture_mode/capture_mode_camera_unittests.cc b/ash/capture_mode/capture_mode_camera_unittests.cc index 420c24a6..82844425 100644 --- a/ash/capture_mode/capture_mode_camera_unittests.cc +++ b/ash/capture_mode/capture_mode_camera_unittests.cc
@@ -40,6 +40,7 @@ #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" #include "ash/style/ash_color_id.h" +#include "ash/style/tab_slider_button.h" #include "ash/system/accessibility/autoclick_menu_bubble_controller.h" #include "ash/system/notification_center/notification_center_test_api.h" #include "ash/system/notification_center/notification_center_tray.h"
diff --git a/ash/capture_mode/capture_mode_session_focus_cycler.cc b/ash/capture_mode/capture_mode_session_focus_cycler.cc index 10d07a0..e63ff4a 100644 --- a/ash/capture_mode/capture_mode_session_focus_cycler.cc +++ b/ash/capture_mode/capture_mode_session_focus_cycler.cc
@@ -23,6 +23,7 @@ #include "ash/style/icon_button.h" #include "ash/style/pill_button.h" #include "ash/style/style_util.h" +#include "ash/style/tab_slider_button.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/window_state.h" #include "base/containers/flat_map.h"
diff --git a/ash/capture_mode/capture_mode_source_view.cc b/ash/capture_mode/capture_mode_source_view.cc index ab5a9b0..1d2a617 100644 --- a/ash/capture_mode/capture_mode_source_view.cc +++ b/ash/capture_mode/capture_mode_source_view.cc
@@ -12,8 +12,8 @@ #include "ash/capture_mode/capture_mode_session_focus_cycler.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/strings/grit/ash_strings.h" -#include "ash/style/icon_button.h" -#include "ash/style/icon_switch.h" +#include "ash/style/tab_slider.h" +#include "ash/style/tab_slider_button.h" #include "base/functional/bind.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" @@ -22,23 +22,28 @@ namespace ash { CaptureModeSourceView::CaptureModeSourceView() - : capture_source_switch_(AddChildView( - std::make_unique<IconSwitch>(/*has_background=*/false, - /*inside_border_insets=*/gfx::Insets(), - capture_mode::kBetweenChildSpacing))), - fullscreen_toggle_button_(capture_source_switch_->AddButton( - base::BindRepeating(&CaptureModeSourceView::OnFullscreenToggle, - base::Unretained(this)), - &kCaptureModeFullscreenIcon, - // Tooltip text will be set in `OnCaptureTypeChanged`. - /*tooltip_text=*/u"")), - region_toggle_button_(capture_source_switch_->AddButton( + : capture_source_switch_(AddChildView(std::make_unique<TabSlider>( + /*max_tab_num=*/3, + TabSlider::InitParams{ + /*internal_border_padding=*/0, + /*between_child_spacing=*/capture_mode::kBetweenChildSpacing, + /*has_background=*/false, + /*has_selector_animation=*/false, + /*distribute_space_evenly=*/true}))), + fullscreen_toggle_button_( + capture_source_switch_->AddButton<IconSliderButton>( + base::BindRepeating(&CaptureModeSourceView::OnFullscreenToggle, + base::Unretained(this)), + &kCaptureModeFullscreenIcon, + // Tooltip text will be set in `OnCaptureTypeChanged`. + /*tooltip_text=*/u"")), + region_toggle_button_(capture_source_switch_->AddButton<IconSliderButton>( base::BindRepeating(&CaptureModeSourceView::OnRegionToggle, base::Unretained(this)), &kCaptureModeRegionIcon, // Tooltip text will be set in `OnCaptureTypeChanged`. /*tooltip_text=*/u"")), - window_toggle_button_(capture_source_switch_->AddButton( + window_toggle_button_(capture_source_switch_->AddButton<IconSliderButton>( base::BindRepeating(&CaptureModeSourceView::OnWindowToggle, base::Unretained(this)), &kCaptureModeWindowIcon, @@ -66,13 +71,13 @@ CaptureModeSource new_source) { switch (new_source) { case CaptureModeSource::kFullscreen: - fullscreen_toggle_button_->SetToggled(true); + fullscreen_toggle_button_->SetSelected(true); break; case CaptureModeSource::kRegion: - region_toggle_button_->SetToggled(true); + region_toggle_button_->SetSelected(true); break; case CaptureModeSource::kWindow: - window_toggle_button_->SetToggled(true); + window_toggle_button_->SetSelected(true); break; } }
diff --git a/ash/capture_mode/capture_mode_source_view.h b/ash/capture_mode/capture_mode_source_view.h index 77887a5..26f3d082 100644 --- a/ash/capture_mode/capture_mode_source_view.h +++ b/ash/capture_mode/capture_mode_source_view.h
@@ -13,8 +13,8 @@ namespace ash { -class IconButton; -class IconSwitch; +class TabSlider; +class TabSliderButton; // A view that is part of the CaptureBar view, from which the user can toggle // between the three available capture sources (fullscreen, region, and window). @@ -28,11 +28,15 @@ CaptureModeSourceView& operator=(const CaptureModeSourceView&) = delete; ~CaptureModeSourceView() override; - IconButton* fullscreen_toggle_button() const { + TabSliderButton* fullscreen_toggle_button() const { return fullscreen_toggle_button_; } - IconButton* region_toggle_button() const { return region_toggle_button_; } - IconButton* window_toggle_button() const { return window_toggle_button_; } + TabSliderButton* region_toggle_button() const { + return region_toggle_button_; + } + TabSliderButton* window_toggle_button() const { + return window_toggle_button_; + } // Called when the capture source changes. void OnCaptureSourceChanged(CaptureModeSource new_source); @@ -47,12 +51,12 @@ // Owned by the view hierarchy. Contains fullscreen, region, and window toggle // buttons. - raw_ptr<IconSwitch, ExperimentalAsh> capture_source_switch_; + raw_ptr<TabSlider, ExperimentalAsh> capture_source_switch_; // Owned by the `capture_source_switch_`. - raw_ptr<IconButton, ExperimentalAsh> fullscreen_toggle_button_; - raw_ptr<IconButton, ExperimentalAsh> region_toggle_button_; - raw_ptr<IconButton, ExperimentalAsh> window_toggle_button_; + raw_ptr<TabSliderButton, ExperimentalAsh> fullscreen_toggle_button_; + raw_ptr<TabSliderButton, ExperimentalAsh> region_toggle_button_; + raw_ptr<TabSliderButton, ExperimentalAsh> window_toggle_button_; }; } // namespace ash
diff --git a/ash/capture_mode/capture_mode_test_util.cc b/ash/capture_mode/capture_mode_test_util.cc index 41ed5db01a..aa388705 100644 --- a/ash/capture_mode/capture_mode_test_util.cc +++ b/ash/capture_mode/capture_mode_test_util.cc
@@ -23,6 +23,7 @@ #include "ash/shell.h" #include "ash/style/icon_button.h" #include "ash/style/pill_button.h" +#include "ash/style/tab_slider.h" #include "ash/system/accessibility/autoclick_menu_bubble_controller.h" #include "ash/wm/tablet_mode/tablet_mode_controller_test_api.h" #include "base/files/file_path.h" @@ -297,21 +298,21 @@ return image; } -IconButton* GetImageToggleButton() { +TabSliderButton* GetImageToggleButton() { auto* controller = CaptureModeController::Get(); DCHECK(controller->IsActive()); auto* capture_type_view = GetCaptureModeBarView()->GetCaptureTypeView(); return capture_type_view ? capture_type_view->image_toggle_button() : nullptr; } -IconButton* GetVideoToggleButton() { +TabSliderButton* GetVideoToggleButton() { auto* controller = CaptureModeController::Get(); DCHECK(controller->IsActive()); auto* capture_type_view = GetCaptureModeBarView()->GetCaptureTypeView(); return capture_type_view ? capture_type_view->video_toggle_button() : nullptr; } -IconButton* GetFullscreenToggleButton() { +TabSliderButton* GetFullscreenToggleButton() { auto* controller = CaptureModeController::Get(); DCHECK(controller->IsActive()); auto* capture_source_view = GetCaptureModeBarView()->GetCaptureSourceView(); @@ -319,7 +320,7 @@ : nullptr; } -IconButton* GetRegionToggleButton() { +TabSliderButton* GetRegionToggleButton() { auto* controller = CaptureModeController::Get(); DCHECK(controller->IsActive()); auto* capture_source_view = GetCaptureModeBarView()->GetCaptureSourceView(); @@ -327,7 +328,7 @@ : nullptr; } -IconButton* GetWindowToggleButton() { +TabSliderButton* GetWindowToggleButton() { auto* controller = CaptureModeController::Get(); DCHECK(controller->IsActive()); auto* capture_source_view = GetCaptureModeBarView()->GetCaptureSourceView();
diff --git a/ash/capture_mode/capture_mode_test_util.h b/ash/capture_mode/capture_mode_test_util.h index ddfde30..754ec6e 100644 --- a/ash/capture_mode/capture_mode_test_util.h +++ b/ash/capture_mode/capture_mode_test_util.h
@@ -48,6 +48,7 @@ class IconButton; class CaptureModeController; class CaptureModeBarView; +class TabSliderButton; // Fake camera info used for testing. constexpr char kDefaultCameraDeviceId[] = "/dev/videoX"; @@ -144,11 +145,11 @@ gfx::Image ReadAndDecodeImageFile(const base::FilePath& image_path); // Gets the buttons inside the capture bar view. -IconButton* GetImageToggleButton(); -IconButton* GetVideoToggleButton(); -IconButton* GetFullscreenToggleButton(); -IconButton* GetRegionToggleButton(); -IconButton* GetWindowToggleButton(); +TabSliderButton* GetImageToggleButton(); +TabSliderButton* GetVideoToggleButton(); +TabSliderButton* GetFullscreenToggleButton(); +TabSliderButton* GetRegionToggleButton(); +TabSliderButton* GetWindowToggleButton(); PillButton* GetStartRecordingButton(); IconButton* GetSettingsButton(); IconButton* GetCloseButton();
diff --git a/ash/capture_mode/capture_mode_type_view.cc b/ash/capture_mode/capture_mode_type_view.cc index 2e79fad..ea9da88 100644 --- a/ash/capture_mode/capture_mode_type_view.cc +++ b/ash/capture_mode/capture_mode_type_view.cc
@@ -16,8 +16,8 @@ #include "ash/strings/grit/ash_strings.h" #include "ash/style/ash_color_id.h" #include "ash/style/ash_color_provider.h" -#include "ash/style/icon_button.h" -#include "ash/style/icon_switch.h" +#include "ash/style/tab_slider.h" +#include "ash/style/tab_slider_button.h" #include "base/functional/bind.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" @@ -26,12 +26,18 @@ namespace ash { CaptureModeTypeView::CaptureModeTypeView(CaptureModeBehavior* active_behavior) - : capture_type_switch_(AddChildView(std::make_unique<IconSwitch>())) { + : capture_type_switch_(AddChildView(std::make_unique<TabSlider>( + /*max_tab_num=*/2, + TabSlider::InitParams{/*internal_border_padding=*/2, + /*between_child_spacing=*/0, + /*has_background=*/true, + /*has_selector_animation=*/true, + /*distribute_space_evenly=*/false}))) { CHECK(active_behavior); // Only add the image toggle button if the active behavior allows. if (active_behavior->ShouldImageCaptureTypeBeAllowed()) { - image_toggle_button_ = capture_type_switch_->AddButton( + image_toggle_button_ = capture_type_switch_->AddButton<IconSliderButton>( base::BindRepeating(&CaptureModeTypeView::OnImageToggle, base::Unretained(this)), &kCaptureModeImageIcon, @@ -43,7 +49,7 @@ } // Add video toggle button. - video_toggle_button_ = capture_type_switch_->AddButton( + video_toggle_button_ = capture_type_switch_->AddButton<IconSliderButton>( base::BindRepeating(&CaptureModeTypeView::OnVideoToggle, base::Unretained(this)), &kCaptureModeVideoIcon, @@ -69,10 +75,10 @@ DCHECK(!controller->is_recording_in_progress() || !is_video); - video_toggle_button_->SetToggled(is_video); + video_toggle_button_->SetSelected(is_video); if (image_toggle_button_) - image_toggle_button_->SetToggled(!is_video); + image_toggle_button_->SetSelected(!is_video); } void CaptureModeTypeView::OnImageToggle() {
diff --git a/ash/capture_mode/capture_mode_type_view.h b/ash/capture_mode/capture_mode_type_view.h index f105af2..b998d5a0 100644 --- a/ash/capture_mode/capture_mode_type_view.h +++ b/ash/capture_mode/capture_mode_type_view.h
@@ -14,8 +14,8 @@ namespace ash { -class IconButton; -class IconSwitch; +class TabSlider; +class TabSliderButton; // A view that is part of the CaptureBarView, from which the user can toggle // between the two available capture types (image, and video). @@ -29,8 +29,8 @@ CaptureModeTypeView& operator=(const CaptureModeTypeView&) = delete; ~CaptureModeTypeView() override; - IconButton* image_toggle_button() const { return image_toggle_button_; } - IconButton* video_toggle_button() const { return video_toggle_button_; } + TabSliderButton* image_toggle_button() const { return image_toggle_button_; } + TabSliderButton* video_toggle_button() const { return video_toggle_button_; } // Called when the capture type changes. void OnCaptureTypeChanged(CaptureModeType new_type); @@ -41,13 +41,13 @@ // Owned by the views hierarchy. The capture type switch contains image and // video capture type toggle buttons. - raw_ptr<IconSwitch, ExperimentalAsh> capture_type_switch_; + raw_ptr<TabSlider, ExperimentalAsh> capture_type_switch_; // Image and video toggle buttons are owned by `capture_type_switch_` which // will be created based on the active behavior of the current capture mode // session. - raw_ptr<IconButton, ExperimentalAsh> image_toggle_button_ = nullptr; - raw_ptr<IconButton, ExperimentalAsh> video_toggle_button_; + raw_ptr<TabSliderButton, ExperimentalAsh> image_toggle_button_ = nullptr; + raw_ptr<TabSliderButton, ExperimentalAsh> video_toggle_button_; }; } // namespace ash
diff --git a/ash/capture_mode/capture_mode_unittests.cc b/ash/capture_mode/capture_mode_unittests.cc index fbcd2cb..b577e79 100644 --- a/ash/capture_mode/capture_mode_unittests.cc +++ b/ash/capture_mode/capture_mode_unittests.cc
@@ -50,6 +50,7 @@ #include "ash/root_window_controller.h" #include "ash/shell.h" #include "ash/style/icon_button.h" +#include "ash/style/tab_slider_button.h" #include "ash/system/status_area_widget.h" #include "ash/test/ash_test_base.h" #include "ash/test/test_widget_builder.h" @@ -462,11 +463,11 @@ controller->Start(CaptureModeEntryType::kQuickSettings); EXPECT_TRUE(controller->IsActive()); - EXPECT_FALSE(GetImageToggleButton()->toggled()); - EXPECT_TRUE(GetVideoToggleButton()->toggled()); - EXPECT_TRUE(GetFullscreenToggleButton()->toggled()); - EXPECT_FALSE(GetRegionToggleButton()->toggled()); - EXPECT_FALSE(GetWindowToggleButton()->toggled()); + EXPECT_FALSE(GetImageToggleButton()->selected()); + EXPECT_TRUE(GetVideoToggleButton()->selected()); + EXPECT_TRUE(GetFullscreenToggleButton()->selected()); + EXPECT_FALSE(GetRegionToggleButton()->selected()); + EXPECT_FALSE(GetWindowToggleButton()->selected()); ClickOnView(GetCloseButton(), GetEventGenerator()); EXPECT_FALSE(controller->IsActive()); @@ -477,24 +478,24 @@ controller->Start(CaptureModeEntryType::kQuickSettings); EXPECT_TRUE(controller->IsActive()); - EXPECT_TRUE(GetImageToggleButton()->toggled()); - EXPECT_FALSE(GetVideoToggleButton()->toggled()); + EXPECT_TRUE(GetImageToggleButton()->selected()); + EXPECT_FALSE(GetVideoToggleButton()->selected()); auto* event_generator = GetEventGenerator(); ClickOnView(GetVideoToggleButton(), event_generator); - EXPECT_FALSE(GetImageToggleButton()->toggled()); - EXPECT_TRUE(GetVideoToggleButton()->toggled()); + EXPECT_FALSE(GetImageToggleButton()->selected()); + EXPECT_TRUE(GetVideoToggleButton()->selected()); EXPECT_EQ(controller->type(), CaptureModeType::kVideo); ClickOnView(GetWindowToggleButton(), event_generator); - EXPECT_FALSE(GetFullscreenToggleButton()->toggled()); - EXPECT_FALSE(GetRegionToggleButton()->toggled()); - EXPECT_TRUE(GetWindowToggleButton()->toggled()); + EXPECT_FALSE(GetFullscreenToggleButton()->selected()); + EXPECT_FALSE(GetRegionToggleButton()->selected()); + EXPECT_TRUE(GetWindowToggleButton()->selected()); EXPECT_EQ(controller->source(), CaptureModeSource::kWindow); ClickOnView(GetFullscreenToggleButton(), event_generator); - EXPECT_TRUE(GetFullscreenToggleButton()->toggled()); - EXPECT_FALSE(GetRegionToggleButton()->toggled()); - EXPECT_FALSE(GetWindowToggleButton()->toggled()); + EXPECT_TRUE(GetFullscreenToggleButton()->selected()); + EXPECT_FALSE(GetRegionToggleButton()->selected()); + EXPECT_FALSE(GetWindowToggleButton()->selected()); EXPECT_EQ(controller->source(), CaptureModeSource::kFullscreen); } @@ -4337,14 +4338,14 @@ controller->Start(CaptureModeEntryType::kQuickSettings); EXPECT_TRUE(controller->IsActive()); EXPECT_EQ(CaptureModeType::kImage, controller->type()); - EXPECT_TRUE(GetImageToggleButton()->toggled()); - EXPECT_FALSE(GetVideoToggleButton()->toggled()); + EXPECT_TRUE(GetImageToggleButton()->selected()); + EXPECT_FALSE(GetVideoToggleButton()->selected()); EXPECT_FALSE(GetVideoToggleButton()->GetEnabled()); // Clicking on the video button should do nothing. ClickOnView(GetVideoToggleButton(), GetEventGenerator()); - EXPECT_TRUE(GetImageToggleButton()->toggled()); - EXPECT_FALSE(GetVideoToggleButton()->toggled()); + EXPECT_TRUE(GetImageToggleButton()->selected()); + EXPECT_FALSE(GetVideoToggleButton()->selected()); EXPECT_EQ(CaptureModeType::kImage, controller->type()); // Things should go back to normal when there's no recording going on. @@ -4352,8 +4353,8 @@ controller->EndVideoRecording(EndRecordingReason::kStopRecordingButton); StartCaptureSession(CaptureModeSource::kFullscreen, CaptureModeType::kVideo); EXPECT_EQ(CaptureModeType::kVideo, controller->type()); - EXPECT_FALSE(GetImageToggleButton()->toggled()); - EXPECT_TRUE(GetVideoToggleButton()->toggled()); + EXPECT_FALSE(GetImageToggleButton()->selected()); + EXPECT_TRUE(GetVideoToggleButton()->selected()); EXPECT_TRUE(GetVideoToggleButton()->GetEnabled()); } @@ -5421,7 +5422,7 @@ // button should be enabled and active. EXPECT_FALSE(GetImageToggleButton()); EXPECT_TRUE(GetVideoToggleButton()->GetEnabled()); - EXPECT_TRUE(GetVideoToggleButton()->toggled()); + EXPECT_TRUE(GetVideoToggleButton()->selected()); } TEST_F(ProjectorCaptureModeIntegrationTests, StartEndRecording) {
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index b8fe752b..1f84d01 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -1007,12 +1007,18 @@ const base::FeatureParam<double> kFastPairDeviceLostNotificationTimeoutMinutes{ &kFastPair, "fast-pair-device-lost-notification-timeout-minutes", 5}; -// Enabled Fast Pair sub feature to prevent notifications for recently lost +// Enables Fast Pair sub feature to prevent notifications for recently lost // devices for |kFastPairDeviceLostNotificationTimeout|. BASE_FEATURE(kFastPairPreventNotificationsForRecentlyLostDevice, "FastPairPreventNotificationsForRecentlyLostDevice", base::FEATURE_ENABLED_BY_DEFAULT); +// Enables link to Progressive Web Application companion app to configure +// device after Fast Pair. +BASE_FEATURE(kFastPairPwaCompanion, + "FastPairPwaCompanion", + base::FEATURE_DISABLED_BY_DEFAULT); + // Sets Fast Pair scanning to low power mode. BASE_FEATURE(kFastPairLowPower, "FastPairLowPower", @@ -1931,6 +1937,12 @@ "OverviewScrollLayoutForClamshell", base::FEATURE_DISABLED_BY_DEFAULT); +// Enables Jelly colors and components to appear in the Parent Access Widget +// if jelly-colors is also enabled. +BASE_FEATURE(kParentAccessJelly, + "ParentAccessJelly", + base::FEATURE_DISABLED_BY_DEFAULT); + // Enables user to provision PasspointARCSupport credentials. BASE_FEATURE(kPasspointARCSupport, "PasspointARCSupport", @@ -3182,6 +3194,10 @@ return base::FeatureList::IsEnabled(kFastPairLowPower); } +bool IsFastPairPwaCompanionEnabled() { + return base::FeatureList::IsEnabled(kFastPairPwaCompanion); +} + bool IsFastPairPreventNotificationsForRecentlyLostDeviceEnabled() { return base::FeatureList::IsEnabled( kFastPairPreventNotificationsForRecentlyLostDevice); @@ -3278,8 +3294,11 @@ } bool AreGlanceablesV2Enabled() { - return base::FeatureList::IsEnabled(kGlanceablesV2) || - base::FeatureList::IsEnabled(kGlanceablesV2TrustedTesters); + return base::FeatureList::IsEnabled(kGlanceablesV2); +} + +bool AreGlanceablesV2EnabledForTrustedTesters() { + return base::FeatureList::IsEnabled(kGlanceablesV2TrustedTesters); } bool IsGlanceablesV2ClassroomTeacherViewEnabled() { @@ -3679,6 +3698,11 @@ base::FeatureList::IsEnabled(kPasspointARCSupport); } +bool IsParentAccessJellyEnabled() { + return chromeos::features::IsJellyEnabled() && + base::FeatureList::IsEnabled(kParentAccessJelly); +} + bool IsPasswordlessGaiaEnabledForConsumers() { return base::FeatureList::IsEnabled(kPasswordlessGaiaForConsumers); }
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index de77a59..54679e1a 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -294,6 +294,7 @@ BASE_DECLARE_FEATURE(kFastPairSavedDevicesNicknames); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kFastPairPreventNotificationsForRecentlyLostDevice); +COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kFastPairPwaCompanion); COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::FeatureParam<double> kFastPairDeviceLostNotificationTimeoutMinutes; @@ -569,6 +570,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kOverviewDeskNavigation); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kOverviewScrollLayoutForClamshell); +COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kParentAccessJelly); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kPasspointARCSupport); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kPasspointSettings); COMPONENT_EXPORT(ASH_CONSTANTS) @@ -898,6 +900,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFastPairLowPowerEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFastPairPreventNotificationsForRecentlyLostDeviceEnabled(); +COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFastPairPwaCompanionEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFastPairSoftwareScanningEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFastPairSavedDevicesEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFastPairSavedDevicesStrictOptInEnabled(); @@ -929,6 +932,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsGifRenderingEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool AreGlanceablesEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool AreGlanceablesV2Enabled(); +COMPONENT_EXPORT(ASH_CONSTANTS) bool AreGlanceablesV2EnabledForTrustedTesters(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsGlanceablesV2ClassroomTeacherViewEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsHibernateEnabled(); @@ -1023,6 +1027,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsOverviewDeskNavigationEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsOverviewScrollLayoutForClamshellEnabled(); +COMPONENT_EXPORT(ASH_CONSTANTS) bool IsParentAccessJellyEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPasswordlessGaiaEnabledForConsumers(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPasswordSelectionEnabledInOobe(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsPasspointARCSupportEnabled();
diff --git a/ash/glanceables/glanceables_v2_controller.cc b/ash/glanceables/glanceables_v2_controller.cc index 9a5b56e..e3fe10d4 100644 --- a/ash/glanceables/glanceables_v2_controller.cc +++ b/ash/glanceables/glanceables_v2_controller.cc
@@ -37,8 +37,7 @@ } bool GlanceablesV2Controller::AreGlanceablesAvailable() const { - return features::AreGlanceablesV2Enabled() && - (GetClassroomClient() != nullptr || GetTasksClient() != nullptr); + return GetClassroomClient() != nullptr || GetTasksClient() != nullptr; } void GlanceablesV2Controller::UpdateClientsRegistration(
diff --git a/ash/glanceables/tasks/glanceables_task_view.cc b/ash/glanceables/tasks/glanceables_task_view.cc index d69b7c07..45d2d10b 100644 --- a/ash/glanceables/tasks/glanceables_task_view.cc +++ b/ash/glanceables/tasks/glanceables_task_view.cc
@@ -44,10 +44,10 @@ constexpr auto kSingleRowButtonMargin = gfx::Insets::VH(13, 18); constexpr auto kDoubleRowButtonMargin = gfx::Insets::VH(16, 18); -constexpr auto kSingleRowTextMargins = gfx::Insets::VH(13, 0); -constexpr auto kDoubleRowTextMargins = gfx::Insets::VH(7, 0); +constexpr auto kSingleRowTextMargins = gfx::Insets::TLBR(13, 0, 13, 16); +constexpr auto kDoubleRowTextMargins = gfx::Insets::TLBR(7, 0, 7, 16); -views::Label* SetupLabel(views::FlexLayoutView* parent) { +views::Label* SetupLabel(views::View* parent) { views::Label* label = parent->AddChildView(std::make_unique<views::Label>()); label->SetHorizontalAlignment(gfx::ALIGN_LEFT); // Views should not be individually selected for accessibility. Accessible @@ -160,11 +160,11 @@ contents_view_->SetOrientation(views::LayoutOrientation::kVertical); contents_view_->SetProperty( views::kFlexBehaviorKey, - views::FlexSpecification(views::MinimumFlexSizeRule::kPreferred, + views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToZero, views::MaximumFlexSizeRule::kUnbounded)); tasks_title_view_ = - contents_view_->AddChildView(std::make_unique<views::FlexLayoutView>()); + contents_view_->AddChildView(std::make_unique<views::BoxLayoutView>()); tasks_details_view_ = contents_view_->AddChildView(std::make_unique<views::FlexLayoutView>()); tasks_details_view_->SetCrossAxisAlignment(views::LayoutAlignment::kCenter);
diff --git a/ash/glanceables/tasks/glanceables_task_view.h b/ash/glanceables/tasks/glanceables_task_view.h index 0bbf69eb..73b876a 100644 --- a/ash/glanceables/tasks/glanceables_task_view.h +++ b/ash/glanceables/tasks/glanceables_task_view.h
@@ -15,6 +15,7 @@ #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/label.h" #include "ui/views/layout/flex_layout_view.h" +#include "ui/views/layout/box_layout_view.h" #include "ui/views/metadata/view_factory.h" namespace ash { @@ -58,7 +59,7 @@ // Owned by views hierarchy. raw_ptr<CheckButton> button_ = nullptr; raw_ptr<views::FlexLayoutView, ExperimentalAsh> contents_view_ = nullptr; - raw_ptr<views::FlexLayoutView, ExperimentalAsh> tasks_title_view_ = nullptr; + raw_ptr<views::BoxLayoutView, ExperimentalAsh> tasks_title_view_ = nullptr; raw_ptr<views::FlexLayoutView, ExperimentalAsh> tasks_details_view_ = nullptr; raw_ptr<views::Label, ExperimentalAsh> tasks_label_ = nullptr;
diff --git a/ash/login/ui/lock_contents_view_test_api.cc b/ash/login/ui/lock_contents_view_test_api.cc index 807510a..43b49299 100644 --- a/ash/login/ui/lock_contents_view_test_api.cc +++ b/ash/login/ui/lock_contents_view_test_api.cc
@@ -49,6 +49,10 @@ return view_->media_controls_view_; } +LockScreenMediaView* LockContentsViewTestApi::media_view() const { + return view_->media_view_; +} + views::View* LockContentsViewTestApi::note_action() const { return view_->note_action_; }
diff --git a/ash/login/ui/lock_contents_view_test_api.h b/ash/login/ui/lock_contents_view_test_api.h index dc87665..89a30e99 100644 --- a/ash/login/ui/lock_contents_view_test_api.h +++ b/ash/login/ui/lock_contents_view_test_api.h
@@ -34,6 +34,7 @@ AccountId focused_user() const; ScrollableUsersListView* users_list() const; LockScreenMediaControlsView* media_controls_view() const; + LockScreenMediaView* media_view() const; views::View* note_action() const; views::View* tooltip_bubble() const; views::View* management_bubble() const;
diff --git a/ash/login/ui/lock_screen_media_view.cc b/ash/login/ui/lock_screen_media_view.cc index 907c60f51..267af5a 100644 --- a/ash/login/ui/lock_screen_media_view.cc +++ b/ash/login/ui/lock_screen_media_view.cc
@@ -83,6 +83,23 @@ // Media controls have not been dismissed initially. Shell::Get()->media_controller()->SetMediaControlsDismissed(false); + SetLayoutManager(std::make_unique<views::FillLayout>()); + const auto media_color_theme = GetCrosMediaColorTheme(); + + auto dismiss_button = std::make_unique<DismissButton>( + base::BindRepeating(&LockScreenMediaView::Hide, base::Unretained(this)), + media_color_theme.primary_foreground_color_id, + media_color_theme.secondary_foreground_color_id, + media_color_theme.focus_ring_color_id); + dismiss_button_ = dismiss_button.get(); + + view_ = AddChildView( + std::make_unique<global_media_controls::MediaNotificationViewAshImpl>( + this, /*item=*/nullptr, /*footer_view=*/nullptr, + /*device_selector_view=*/nullptr, std::move(dismiss_button), + media_color_theme, + global_media_controls::MediaDisplayPage::kLockScreenMediaView)); + // |service| can be null in tests. media_session::MediaSessionService* service = Shell::Get()->shell_delegate()->GetMediaSessionService(); @@ -109,22 +126,6 @@ global_media_controls::kMediaItemArtworkMinSize, global_media_controls::kMediaItemArtworkDesiredSize, artwork_observer_receiver_.BindNewPipeAndPassRemote()); - - SetLayoutManager(std::make_unique<views::FillLayout>()); - const auto media_color_theme = GetCrosMediaColorTheme(); - - auto dismiss_button = std::make_unique<DismissButton>( - base::BindRepeating(&LockScreenMediaView::Hide, base::Unretained(this)), - media_color_theme.primary_foreground_color_id, - media_color_theme.secondary_foreground_color_id, - media_color_theme.focus_ring_color_id); - - view_ = AddChildView( - std::make_unique<global_media_controls::MediaNotificationViewAshImpl>( - this, /*item=*/nullptr, /*footer_view=*/nullptr, - /*device_selector_view=*/nullptr, std::move(dismiss_button), - media_color_theme, - global_media_controls::MediaDisplayPage::kLockScreenMediaView)); } LockScreenMediaView::~LockScreenMediaView() { @@ -272,6 +273,27 @@ } /////////////////////////////////////////////////////////////////////////////// +// Helper functions for testing: + +void LockScreenMediaView::FlushForTesting() { + media_controller_remote_.FlushForTesting(); // IN-TEST +} + +void LockScreenMediaView::SetMediaControllerForTesting( + mojo::Remote<media_session::mojom::MediaController> media_controller) { + media_controller_remote_ = std::move(media_controller); +} + +views::Button* LockScreenMediaView::GetDismissButtonForTesting() { + return dismiss_button_; +} + +global_media_controls::MediaNotificationViewAshImpl* +LockScreenMediaView::GetMediaNotificationViewForTesting() { + return view_; +} + +/////////////////////////////////////////////////////////////////////////////// // LockScreenMediaView implementations: void LockScreenMediaView::Show() {
diff --git a/ash/login/ui/lock_screen_media_view.h b/ash/login/ui/lock_screen_media_view.h index 35b9dcf1..d86b1ca 100644 --- a/ash/login/ui/lock_screen_media_view.h +++ b/ash/login/ui/lock_screen_media_view.h
@@ -19,6 +19,10 @@ namespace ash { +namespace { +class DismissButton; +} + // View for media controls that appear on the lock screen if it is enabled. This // replaces the old LockScreenMediaControlsView if the flag // media::kGlobalMediaControlsCrOSUpdatedUI is enabled. It registers for media @@ -84,6 +88,17 @@ // base::PowerSuspendObserver: void OnSuspend() override; + // Helper functions for testing: + void FlushForTesting(); + + void SetMediaControllerForTesting( + mojo::Remote<media_session::mojom::MediaController> media_controller); + + views::Button* GetDismissButtonForTesting(); + + global_media_controls::MediaNotificationViewAshImpl* + GetMediaNotificationViewForTesting(); + private: friend class LockScreenMediaViewTest; @@ -118,6 +133,7 @@ const base::RepeatingClosure show_media_view_callback_; const base::RepeatingClosure hide_media_view_callback_; + raw_ptr<DismissButton> dismiss_button_; raw_ptr<global_media_controls::MediaNotificationViewAshImpl> view_; base::WeakPtrFactory<LockScreenMediaView> weak_ptr_factory_{this};
diff --git a/ash/login/ui/lock_screen_media_view_unittest.cc b/ash/login/ui/lock_screen_media_view_unittest.cc index 0760cf9..bdf51b3 100644 --- a/ash/login/ui/lock_screen_media_view_unittest.cc +++ b/ash/login/ui/lock_screen_media_view_unittest.cc
@@ -4,4 +4,188 @@ #include "ash/login/ui/lock_screen_media_view.h" -// TODO(crbug.com/1448702): add tests. +#include "ash/login/ui/fake_login_detachable_base_model.h" +#include "ash/login/ui/lock_contents_view.h" +#include "ash/login/ui/lock_contents_view_test_api.h" +#include "ash/login/ui/login_test_base.h" +#include "base/test/power_monitor_test.h" +#include "base/test/scoped_feature_list.h" +#include "media/base/media_switches.h" +#include "services/media_session/public/cpp/test/test_media_controller.h" +#include "ui/events/base_event_utils.h" +#include "ui/views/test/button_test_api.h" + +namespace ash { + +using media_session::mojom::MediaSessionAction; +using media_session::test::TestMediaController; + +class LockScreenMediaViewTest : public LoginTestBase { + public: + LockScreenMediaViewTest() = default; + LockScreenMediaViewTest(const LockScreenMediaViewTest&) = delete; + LockScreenMediaViewTest& operator=(const LockScreenMediaViewTest&) = delete; + ~LockScreenMediaViewTest() override = default; + + void SetUp() override { + feature_list_.InitAndEnableFeature( + media::kGlobalMediaControlsCrOSUpdatedUI); + + set_start_session(true); + LoginTestBase::SetUp(); + + LockContentsView* lock_contents_view = new LockContentsView( + mojom::TrayActionState::kAvailable, LockScreen::ScreenType::kLock, + DataDispatcher(), + std::make_unique<FakeLoginDetachableBaseModel>(DataDispatcher())); + LockContentsViewTestApi lock_contents(lock_contents_view); + SetWidget(CreateWidgetWithContent(lock_contents_view)); + SetUserCount(1); + media_view_ = lock_contents.media_view(); + + media_controller_ = std::make_unique<TestMediaController>(); + media_view_->SetMediaControllerForTesting( + media_controller_->CreateMediaControllerRemote()); + } + + void TearDown() override { + media_view_ = nullptr; + LoginTestBase::TearDown(); + } + + void SimulateMediaSessionChanged( + media_session::mojom::MediaPlaybackState playback_state = + media_session::mojom::MediaPlaybackState::kPlaying) { + media_view_->MediaSessionChanged(base::UnguessableToken::Create()); + + media_session::mojom::MediaSessionInfoPtr session_info( + media_session::mojom::MediaSessionInfo::New()); + session_info->playback_state = playback_state; + session_info->is_controllable = true; + media_view_->MediaSessionInfoChanged(session_info.Clone()); + } + + LockScreenMediaView* media_view() { return media_view_; } + + global_media_controls::MediaNotificationViewAshImpl* + media_notification_view() { + return media_view_->GetMediaNotificationViewForTesting(); + } + + bool IsActionButtonVisible(MediaSessionAction action) { + views::Button* button = + media_notification_view()->GetActionButtonForTesting(action); + return button && button->GetVisible(); + } + + void Suspend() { power_monitor_source_.GenerateSuspendEvent(); } + + TestMediaController* media_controller() const { + return media_controller_.get(); + } + + private: + base::test::ScopedFeatureList feature_list_; + raw_ptr<LockScreenMediaView> media_view_ = nullptr; + base::test::ScopedPowerMonitorTestSource power_monitor_source_; + std::unique_ptr<TestMediaController> media_controller_; +}; + +TEST_F(LockScreenMediaViewTest, DoNotUpdateMetadataBetweenSessions) { + media_session::MediaMetadata metadata; + metadata.source_title = u"source title"; + metadata.title = u"title"; + metadata.artist = u"artist"; + SimulateMediaSessionChanged(); + media_view()->MediaSessionMetadataChanged(metadata); + + metadata.source_title = u"source title2"; + metadata.title = u"title2"; + metadata.artist = u"artist2"; + SimulateMediaSessionChanged(); + media_view()->MediaSessionMetadataChanged(metadata); + + EXPECT_EQ(u"source title", + media_notification_view()->GetSourceLabelForTesting()->GetText()); + EXPECT_EQ(u"title", + media_notification_view()->GetTitleLabelForTesting()->GetText()); + EXPECT_EQ(u"artist", + media_notification_view()->GetArtistLabelForTesting()->GetText()); +} + +TEST_F(LockScreenMediaViewTest, DoNotUpdateActionsBetweenSessions) { + std::set<MediaSessionAction> actions; + actions.insert(MediaSessionAction::kPlay); + actions.insert(MediaSessionAction::kPause); + actions.insert(MediaSessionAction::kEnterPictureInPicture); + actions.insert(MediaSessionAction::kExitPictureInPicture); + SimulateMediaSessionChanged(); + media_view()->MediaSessionActionsChanged( + std::vector<MediaSessionAction>(actions.begin(), actions.end())); + + EXPECT_TRUE(IsActionButtonVisible(MediaSessionAction::kPause)); + EXPECT_FALSE( + IsActionButtonVisible(MediaSessionAction::kEnterPictureInPicture)); + EXPECT_FALSE( + IsActionButtonVisible(MediaSessionAction::kExitPictureInPicture)); + EXPECT_FALSE(IsActionButtonVisible(MediaSessionAction::kPreviousTrack)); + + actions.insert(MediaSessionAction::kPreviousTrack); + SimulateMediaSessionChanged(); + media_view()->MediaSessionActionsChanged( + std::vector<MediaSessionAction>(actions.begin(), actions.end())); + EXPECT_FALSE(IsActionButtonVisible(MediaSessionAction::kPreviousTrack)); +} + +TEST_F(LockScreenMediaViewTest, DoNotUpdatePositionBetweenSessions) { + media_session::MediaPosition media_position( + /*playback_rate=*/1, /*duration=*/base::Seconds(600), + /*position=*/base::Seconds(300), /*end_of_media=*/false); + SimulateMediaSessionChanged(); + media_view()->MediaSessionPositionChanged(media_position); + + media_session::MediaPosition media_position_paused( + /*playback_rate=*/0, /*duration=*/base::Seconds(600), + /*position=*/base::Seconds(300), /*end_of_media=*/false); + SimulateMediaSessionChanged(); + media_view()->MediaSessionPositionChanged(media_position_paused); + EXPECT_EQ(media_position.playback_rate(), + media_notification_view()->GetPositionForTesting().playback_rate()); +} + +TEST_F(LockScreenMediaViewTest, DoNotUpdateArtworkBetweenSessions) { + SimulateMediaSessionChanged(); + + SkBitmap image; + image.allocN32Pixels(10, 10); + image.eraseColor(SK_ColorGREEN); + SimulateMediaSessionChanged(); + media_view()->MediaControllerImageChanged( + media_session::mojom::MediaSessionImageType::kArtwork, image); + + EXPECT_TRUE(media_notification_view() + ->GetArtworkViewForTesting() + ->GetImage() + .isNull()); +} + +TEST_F(LockScreenMediaViewTest, DismissButtonCheck) { + SimulateMediaSessionChanged(); + EXPECT_TRUE(media_view()->GetVisible()); + + views::test::ButtonTestApi(media_view()->GetDismissButtonForTesting()) + .NotifyClick(ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(), + gfx::Point(), ui::EventTimeForNow(), 0, 0)); + media_view()->FlushForTesting(); + EXPECT_EQ(1, media_controller()->stop_count()); + EXPECT_FALSE(media_view()->GetVisible()); +} + +TEST_F(LockScreenMediaViewTest, PowerSuspendState) { + SimulateMediaSessionChanged(); + EXPECT_TRUE(media_view()->GetVisible()); + Suspend(); + EXPECT_FALSE(media_view()->GetVisible()); +} + +} // namespace ash
diff --git a/ash/shelf/desk_button_widget.cc b/ash/shelf/desk_button_widget.cc index 9dbe575..e9bf9b12 100644 --- a/ash/shelf/desk_button_widget.cc +++ b/ash/shelf/desk_button_widget.cc
@@ -196,6 +196,10 @@ } void DeskButtonWidget::SetExpanded(bool expanded) { + if (is_expanded_ == expanded) { + return; + } + is_expanded_ = expanded; if (is_horizontal_shelf_ && ShouldBeVisible()) { @@ -222,10 +226,9 @@ delegate_view_->SetForceExpandedState(is_horizontal_shelf_); is_expanded_ = is_horizontal_shelf_; delegate_view_->OnExpandedStateUpdate(is_expanded_); - // Even if the expanded state changed, do not update the widget bounds. - // `PrepareForAlignmentChange()` is bound to be followed by the shelf - // layout, at which point desk button widget bounds will be updated to - // match the current expanded state. + + // Hide the widget first to avoid unneeded animation. + Hide(); } void DeskButtonWidget::CalculateTargetBounds() { @@ -238,21 +241,24 @@ } void DeskButtonWidget::UpdateLayout(bool animate) { - // Having a window which is visible but does not have an opacity is an - // illegal state. - if (shelf_->shelf_layout_manager()->GetOpacity() == 1.0f && - ShouldBeVisible()) { - ShowInactive(); - } else { - Hide(); - } - - if (!animate) { - SetBounds(target_bounds_); + const gfx::Rect initial_bounds = GetWindowBoundsInScreen(); + const bool visibility = GetVisible(); + const bool target_visibility = ShouldBeVisible(); + if (initial_bounds == target_bounds_ && visibility == target_visibility) { return; } - const gfx::Rect initial_bounds = GetNativeView()->layer()->bounds(); + if (!animate || visibility != target_visibility) { + if (target_visibility) { + SetBounds(target_bounds_); + ShowInactive(); + } else { + Hide(); + } + + return; + } + const bool animate_transform = initial_bounds.size() == target_bounds_.size(); if (animate_transform) { @@ -310,6 +316,9 @@ delegate_view_->Init(this); delegate_view_->SetForceExpandedState(is_horizontal_shelf_); + + CalculateTargetBounds(); + UpdateLayout(/*animate=*/false); } DeskButton* DeskButtonWidget::GetDeskButton() const {
diff --git a/ash/shell.cc b/ash/shell.cc index 02c6caaf..0cef845 100644 --- a/ash/shell.cc +++ b/ash/shell.cc
@@ -1658,7 +1658,8 @@ glanceables_controller_.get())); } - if (features::AreGlanceablesV2Enabled()) { + if (features::AreGlanceablesV2Enabled() || + features::AreGlanceablesV2EnabledForTrustedTesters()) { glanceables_v2_controller_ = std::make_unique<GlanceablesV2Controller>(); }
diff --git a/ash/system/time/calendar_view.cc b/ash/system/time/calendar_view.cc index e8e1642..503c193 100644 --- a/ash/system/time/calendar_view.cc +++ b/ash/system/time/calendar_view.cc
@@ -436,8 +436,9 @@ BEGIN_METADATA(CalendarHeaderView, views::View) END_METADATA -CalendarView::CalendarView(DetailedViewDelegate* delegate) - : GlanceableTrayChildBubble(delegate), +CalendarView::CalendarView(DetailedViewDelegate* delegate, + bool for_glanceables_container) + : GlanceableTrayChildBubble(delegate, for_glanceables_container), calendar_view_controller_(std::make_unique<CalendarViewController>()), scrolling_settled_timer_( FROM_HERE,
diff --git a/ash/system/time/calendar_view.h b/ash/system/time/calendar_view.h index 3cfd8fd..613a6320 100644 --- a/ash/system/time/calendar_view.h +++ b/ash/system/time/calendar_view.h
@@ -80,7 +80,10 @@ public: METADATA_HEADER(CalendarView); - explicit CalendarView(DetailedViewDelegate* delegate); + // `for_glanceables_container` - Whether the calendar view is shown as a + // bubble in glanceables container, or a `UnifiedSystemTrayBubble` (which is + // the case if glanceables feature is not enabled). + CalendarView(DetailedViewDelegate* delegate, bool for_glanceables_container); CalendarView(const CalendarView& other) = delete; CalendarView& operator=(const CalendarView& other) = delete; ~CalendarView() override;
diff --git a/ash/system/time/calendar_view_unittest.cc b/ash/system/time/calendar_view_unittest.cc index 76b3ec4f..f1cc37a 100644 --- a/ash/system/time/calendar_view_unittest.cc +++ b/ash/system/time/calendar_view_unittest.cc
@@ -141,7 +141,8 @@ AccountId user_account = AccountId::FromUserEmail(kTestUser); GetSessionControllerClient()->SwitchActiveUser(user_account); - auto calendar_view = std::make_unique<CalendarView>(delegate_.get()); + auto calendar_view = std::make_unique<CalendarView>( + delegate_.get(), /*for_glanceables_container=*/false); calendar_view_ = widget_->SetContentsView(std::move(calendar_view)); } @@ -1425,8 +1426,8 @@ } void CreateCalendarView() { - calendar_view_ = widget_->SetContentsView( - std::make_unique<CalendarView>(delegate_.get())); + calendar_view_ = widget_->SetContentsView(std::make_unique<CalendarView>( + delegate_.get(), /*for_glanceables_container=*/false)); } // Gets date cell of a given CalendarMonthView and numerical `day`.
diff --git a/ash/system/time/unified_calendar_view_controller.cc b/ash/system/time/unified_calendar_view_controller.cc index 76e20887d..92fd948 100644 --- a/ash/system/time/unified_calendar_view_controller.cc +++ b/ash/system/time/unified_calendar_view_controller.cc
@@ -27,7 +27,8 @@ std::unique_ptr<views::View> UnifiedCalendarViewController::CreateView() { DCHECK(!view_); const base::Time start_time = base::Time::Now(); - auto view = std::make_unique<CalendarView>(detailed_view_delegate_.get()); + auto view = std::make_unique<CalendarView>( + detailed_view_delegate_.get(), /*for_glanceables_container=*/false); base::UmaHistogramTimes("Ash.CalendarView.ConstructionTime", base::Time::Now() - start_time); view_ = view.get();
diff --git a/ash/system/unified/classroom_bubble_base_view.cc b/ash/system/unified/classroom_bubble_base_view.cc index 1e802b3..9e346db 100644 --- a/ash/system/unified/classroom_bubble_base_view.cc +++ b/ash/system/unified/classroom_bubble_base_view.cc
@@ -17,19 +17,18 @@ #include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" +#include "ash/style/icon_button.h" #include "ash/style/typography.h" #include "base/functional/bind.h" #include "base/types/cxx23_to_underlying.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/combobox_model.h" -#include "ui/base/models/image_model.h" #include "ui/chromeos/styles/cros_tokens_color_mappings.h" +#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/size.h" #include "ui/views/accessibility/view_accessibility.h" -#include "ui/views/background.h" #include "ui/views/controls/combobox/combobox.h" -#include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/flex_layout_view.h" @@ -40,15 +39,17 @@ namespace { constexpr int kInteriorGlanceableBubbleMargin = 16; - +constexpr auto kHeaderIconButtonMargins = gfx::Insets::TLBR(0, 0, 0, 4); constexpr size_t kMaxAssignments = 3; +constexpr char kClassroomHomePage[] = "https://classroom.google.com/u/0/h"; + } // namespace ClassroomBubbleBaseView::ClassroomBubbleBaseView( DetailedViewDelegate* delegate, std::unique_ptr<ui::ComboboxModel> combobox_model) - : GlanceableTrayChildBubble(delegate) { + : GlanceableTrayChildBubble(delegate, /*for_glanceables_container=*/true) { auto* layout_manager = SetLayoutManager(std::make_unique<views::FlexLayout>()); layout_manager @@ -66,13 +67,13 @@ views::MaximumFlexSizeRule::kPreferred)); auto* const header_icon = - header_view_->AddChildView(std::make_unique<views::ImageView>()); - header_icon->SetBackground(views::CreateThemedRoundedRectBackground( - cros_tokens::kCrosSysBaseElevated, 16)); - header_icon->SetImage(ui::ImageModel::FromVectorIcon( - kGlanceablesClassroomIcon, cros_tokens::kCrosSysOnSurface, 20)); - header_icon->SetPreferredSize(gfx::Size(32, 32)); - header_icon->SetProperty(views::kMarginsKey, gfx::Insets::TLBR(0, 0, 0, 4)); + header_view_->AddChildView(std::make_unique<IconButton>( + base::BindRepeating(&ClassroomBubbleBaseView::OpenUrl, + base::Unretained(this), GURL(kClassroomHomePage)), + IconButton::Type::kMedium, &kGlanceablesClassroomIcon, + IDS_GLANCEABLES_CLASSROOM_HEADER_ICON_ACCESSIBLE_NAME)); + header_icon->SetBackgroundColorId(cros_tokens::kCrosSysBaseElevated); + header_icon->SetProperty(views::kMarginsKey, kHeaderIconButtonMargins); combo_box_view_ = header_view_->AddChildView( std::make_unique<views::Combobox>(std::move(combobox_model)));
diff --git a/ash/system/unified/date_tray.cc b/ash/system/unified/date_tray.cc index c19e8af..da25b51 100644 --- a/ash/system/unified/date_tray.cc +++ b/ash/system/unified/date_tray.cc
@@ -82,9 +82,10 @@ return; } - if (ash::Shell::Get() - ->glanceables_v2_controller() - ->AreGlanceablesAvailable()) { + GlanceablesV2Controller* const glanceables_controller = + ash::Shell::Get()->glanceables_v2_controller(); + if (glanceables_controller && + glanceables_controller->AreGlanceablesAvailable()) { ShowGlanceableBubble(); } } @@ -133,9 +134,10 @@ return; } - if (ash::Shell::Get() - ->glanceables_v2_controller() - ->AreGlanceablesAvailable()) { + GlanceablesV2Controller* const glanceables_controller = + ash::Shell::Get()->glanceables_v2_controller(); + if (glanceables_controller && + glanceables_controller->AreGlanceablesAvailable()) { // Hide the unified_system_tray_ bubble. unified_system_tray_->CloseBubble(); // Open the glanceables bubble.
diff --git a/ash/system/unified/glanceable_tray_bubble_view.cc b/ash/system/unified/glanceable_tray_bubble_view.cc index 5ec1eef..490ed56 100644 --- a/ash/system/unified/glanceable_tray_bubble_view.cc +++ b/ash/system/unified/glanceable_tray_bubble_view.cc
@@ -151,8 +151,9 @@ } if (!calendar_view_) { - calendar_view_ = child_glanceable_container->AddChildView( - std::make_unique<CalendarView>(detailed_view_delegate_.get())); + calendar_view_ = + child_glanceable_container->AddChildView(std::make_unique<CalendarView>( + detailed_view_delegate_.get(), /*for_glanceables_container=*/true)); // TODO(b:277268122): Update with glanceable spec. calendar_view_->SetPreferredSize(gfx::Size(kRevampedTrayMenuWidth, 400)); }
diff --git a/ash/system/unified/glanceable_tray_child_bubble.cc b/ash/system/unified/glanceable_tray_child_bubble.cc index 5a7a744..bc5066d1 100644 --- a/ash/system/unified/glanceable_tray_child_bubble.cc +++ b/ash/system/unified/glanceable_tray_child_bubble.cc
@@ -26,12 +26,10 @@ } // namespace GlanceableTrayChildBubble::GlanceableTrayChildBubble( - DetailedViewDelegate* delegate) + DetailedViewDelegate* delegate, + bool for_glanceables_container) : TrayDetailedView(delegate) { - // `CalendarView` also extends from this view. If the glanceblae view flag is - // not enabled, the calendar view will be added to the - // `UnifiedSystemTrayBubble` which also has its own style settings. - if (features::AreGlanceablesV2Enabled()) { + if (for_glanceables_container) { SetAccessibleRole(ax::mojom::Role::kGroup); SetPaintToLayer();
diff --git a/ash/system/unified/glanceable_tray_child_bubble.h b/ash/system/unified/glanceable_tray_child_bubble.h index 8b9db7d..c36316d 100644 --- a/ash/system/unified/glanceable_tray_child_bubble.h +++ b/ash/system/unified/glanceable_tray_child_bubble.h
@@ -17,7 +17,13 @@ public: METADATA_HEADER(GlanceableTrayChildBubble); - explicit GlanceableTrayChildBubble(DetailedViewDelegate* delegate); + // `for_glanceables_container` - whether the bubble should be styled as a + // bubble in the glanceables container. `CalendarView` is a + // `GlanceablesTrayChildBubble` and if the glanceblae view flag is + // not enabled, the calendar view will be added to the + // `UnifiedSystemTrayBubble` which has its own styling. + GlanceableTrayChildBubble(DetailedViewDelegate* delegate, + bool for_glanceables_container); GlanceableTrayChildBubble(const GlanceableTrayChildBubble&) = delete; GlanceableTrayChildBubble& operator-(const GlanceableTrayChildBubble&) = delete;
diff --git a/ash/system/unified/tasks_bubble_view.cc b/ash/system/unified/tasks_bubble_view.cc index cbfcfc66..6e90be8c 100644 --- a/ash/system/unified/tasks_bubble_view.cc +++ b/ash/system/unified/tasks_bubble_view.cc
@@ -17,13 +17,12 @@ #include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" -#include "ash/style/ash_color_id.h" #include "ash/style/combobox.h" +#include "ash/style/icon_button.h" #include "ash/system/unified/glanceable_tray_child_bubble.h" #include "ash/system/unified/tasks_combobox_model.h" #include "base/strings/utf_string_conversions.h" #include "base/types/cxx23_to_underlying.h" -#include "chromeos/constants/chromeos_features.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" @@ -34,17 +33,17 @@ #include "ui/views/background.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/controls/image_view.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/flex_layout_view.h" +#include "ui/views/view_class_properties.h" +#include "url/gurl.h" namespace { constexpr int kMaximumTasks = 5; -constexpr int kTasksIconRightPadding = 14; -constexpr int kTasksIconViewSize = 32; constexpr int kInteriorGlanceableBubbleMargin = 16; constexpr auto kAddNewTaskButtonMargins = gfx::Insets::TLBR(0, 0, 16, 0); +constexpr auto kHeaderIconButtonMargins = gfx::Insets::TLBR(0, 0, 0, 4); constexpr char kTasksManagementPage[] = "https://calendar.google.com/calendar/u/0/r/week?opentasks=1"; @@ -54,7 +53,7 @@ namespace ash { TasksBubbleView::TasksBubbleView(DetailedViewDelegate* delegate) - : GlanceableTrayChildBubble(delegate) { + : GlanceableTrayChildBubble(delegate, /*for_glanceables_container=*/true) { if (Shell::Get()->glanceables_v2_controller()->GetTasksClient()) { Shell::Get()->glanceables_v2_controller()->GetTasksClient()->GetTaskLists( base::BindOnce(&TasksBubbleView::InitViews, @@ -132,21 +131,14 @@ add_new_task_button_->SetProperty(views::kMarginsKey, kAddNewTaskButtonMargins); - task_icon_view_ = - tasks_header_view_->AddChildView(std::make_unique<views::ImageView>()); - task_icon_view_->SetPreferredSize( - gfx::Size(kTasksIconViewSize, kTasksIconViewSize)); - task_icon_view_->SetBackground(views::CreateThemedRoundedRectBackground( - cros_tokens::kCrosSysBaseElevated, kTasksIconViewSize / 2)); - if (chromeos::features::IsJellyEnabled()) { - task_icon_view_->SetImage(ui::ImageModel::FromVectorIcon( - kGlanceablesTasksIcon, cros_tokens::kCrosSysOnSurface)); - } else { - task_icon_view_->SetImage(ui::ImageModel::FromVectorIcon( - kGlanceablesTasksIcon, kColorAshTextColorPrimary)); - } - task_icon_view_->SetProperty( - views::kMarginsKey, gfx::Insets::TLBR(0, 0, 0, kTasksIconRightPadding)); + auto* const header_icon = + tasks_header_view_->AddChildView(std::make_unique<IconButton>( + base::BindRepeating(&TasksBubbleView::ActionButtonPressed, + base::Unretained(this)), + IconButton::Type::kMedium, &kGlanceablesTasksIcon, + IDS_GLANCEABLES_TASKS_HEADER_ICON_ACCESSIBLE_NAME)); + header_icon->SetBackgroundColorId(cros_tokens::kCrosSysBaseElevated); + header_icon->SetProperty(views::kMarginsKey, kHeaderIconButtonMargins); tasks_combobox_model_ = std::make_unique<TasksComboboxModel>(task_list); task_list_combo_box_view_ = tasks_header_view_->AddChildView(
diff --git a/ash/system/unified/tasks_bubble_view.h b/ash/system/unified/tasks_bubble_view.h index 42f4c00..928eb09 100644 --- a/ash/system/unified/tasks_bubble_view.h +++ b/ash/system/unified/tasks_bubble_view.h
@@ -16,7 +16,6 @@ #include "ui/views/view_observer.h" namespace views { -class ImageView; class LabelButton; } // namespace views @@ -51,7 +50,7 @@ // +----------------------------------------------+ // |`tasks_header_view_` | // |+---------------+ +-------------------------+ | -// ||task_icon_view_| |task_list_combo_box_view_| | +// ||`IconButton` | |task_list_combo_box_view_| | // |+---------------+ +-------------------------+ | // +----------------------------------------------+ // @@ -110,7 +109,6 @@ // Owned by views hierarchy. raw_ptr<views::FlexLayoutView, ExperimentalAsh> tasks_header_view_ = nullptr; - raw_ptr<views::ImageView, ExperimentalAsh> task_icon_view_ = nullptr; raw_ptr<Combobox, ExperimentalAsh> task_list_combo_box_view_ = nullptr; raw_ptr<views::FlexLayoutView, ExperimentalAsh> button_container_ = nullptr; raw_ptr<views::View, ExperimentalAsh> task_items_container_view_ = nullptr;
diff --git a/ash/user_education/user_education_controller.cc b/ash/user_education/user_education_controller.cc index 15fbd17..8ebbeaa 100644 --- a/ash/user_education/user_education_controller.cc +++ b/ash/user_education/user_education_controller.cc
@@ -112,6 +112,12 @@ session_observation_.Reset(); + // User education services are not currently supported for irregular profiles. + if (user_education_util::GetUserType(account_id) != + user_manager::USER_TYPE_REGULAR) { + return; + } + // TODO(http://b/289292432): Move to `UserEducationTutorialController`. // Register all tutorials with user education services in the browser. for (auto& feature_controller : feature_controllers_) {
diff --git a/ash/user_education/user_education_controller_unittest.cc b/ash/user_education/user_education_controller_unittest.cc index 39b95be..5c8b556 100644 --- a/ash/user_education/user_education_controller_unittest.cc +++ b/ash/user_education/user_education_controller_unittest.cc
@@ -39,45 +39,63 @@ } // namespace -// UserEducationControllerTest ------------------------------------------------- +// UserEducationControllerTestBase --------------------------------------------- -// Base class for tests of the `UserEducationController` parameterized by -// whether user education features are enabled. -class UserEducationControllerTest - : public UserEducationAshTestBase, - public testing::WithParamInterface< - std::tuple</*capture_mode_tour_enabled=*/bool, - /*holding_space_tour_enabled=*/bool, - /*welcome_tour_enabled=*/bool>> { +// Base class for tests of the `UserEducationController`. +class UserEducationControllerTestBase : public UserEducationAshTestBase { public: - UserEducationControllerTest() { + UserEducationControllerTestBase(bool capture_mode_tour_enabled, + bool holding_space_tour_enabled, + bool welcome_tour_enabled) + : capture_mode_tour_enabled_(capture_mode_tour_enabled), + holding_space_tour_enabled_(holding_space_tour_enabled), + welcome_tour_enabled_(welcome_tour_enabled) { scoped_feature_list_.InitWithFeatureStates( {{features::kCaptureModeTour, IsCaptureModeTourEnabled()}, {features::kHoldingSpaceTour, IsHoldingSpaceTourEnabled()}, {features::kWelcomeTour, IsWelcomeTourEnabled()}}); } - // Returns whether the Capture Mode Tour is enabled given test - // parameterization. - bool IsCaptureModeTourEnabled() const { return std::get<0>(GetParam()); } + // Returns whether the Capture Mode Tour is enabled. + bool IsCaptureModeTourEnabled() const { return capture_mode_tour_enabled_; } - // Returns whether the Holding Space Tour is enabled given test - // parameterization. - bool IsHoldingSpaceTourEnabled() const { return std::get<1>(GetParam()); } + // Returns whether the Holding Space Tour is enabled. + bool IsHoldingSpaceTourEnabled() const { return holding_space_tour_enabled_; } - // Returns whether the Welcome Tour is enabled given test parameterization. - bool IsWelcomeTourEnabled() const { return std::get<2>(GetParam()); } + // Returns whether the Welcome Tour is enabled. + bool IsWelcomeTourEnabled() const { return welcome_tour_enabled_; } private: base::test::ScopedFeatureList scoped_feature_list_; + const bool capture_mode_tour_enabled_; + const bool holding_space_tour_enabled_; + const bool welcome_tour_enabled_; }; -INSTANTIATE_TEST_SUITE_P( - All, - UserEducationControllerTest, - testing::Combine(/*capture_mode_tour_enabled=*/testing::Bool(), - /*holding_space_tour_enabled=*/testing::Bool(), - /*welcome_tour_enabled=*/testing::Bool())); +// UserEducationControllerTest ------------------------------------------------- + +// Base class for tests of the `UserEducationController` parameterized by +// whether user education features are enabled. +class UserEducationControllerTest + : public UserEducationControllerTestBase, + public testing::WithParamInterface< + std::tuple</*capture_mode_tour_enabled=*/bool, + /*holding_space_tour_enabled=*/bool, + /*welcome_tour_enabled=*/bool>> { + public: + UserEducationControllerTest() + : UserEducationControllerTestBase( + /*capture_mode_tour_enabled=*/std::get<0>(GetParam()), + /*holding_space_tour_enabled=*/std::get<1>(GetParam()), + /*welcome_tour_enabled=*/std::get<2>(GetParam())) {} +}; + +INSTANTIATE_TEST_SUITE_P(All, + UserEducationControllerTest, + testing::Combine( + /*capture_mode_tour_enabled=*/testing::Bool(), + /*holding_space_tour_enabled=*/testing::Bool(), + /*welcome_tour_enabled=*/testing::Bool())); // Tests ----------------------------------------------------------------------- @@ -151,9 +169,43 @@ testing::Mock::VerifyAndClearExpectations(delegate); } +// UserEducationControllerUserTypeTest ----------------------------------------- + +// Base class for tests of the `UserEducationController` parameterized by user +// type and whether user education features are enabled. +class UserEducationControllerUserTypeTest + : public UserEducationControllerTestBase, + public testing::WithParamInterface< + std::tuple</*capture_mode_tour_enabled=*/bool, + /*holding_space_tour_enabled=*/bool, + /*welcome_tour_enabled=*/bool, + /*user_type=*/user_manager::UserType>> { + public: + UserEducationControllerUserTypeTest() + : UserEducationControllerTestBase( + /*capture_mode_tour_enabled=*/std::get<0>(GetParam()), + /*holding_space_tour_enabled=*/std::get<1>(GetParam()), + /*welcome_tour_enabled=*/std::get<2>(GetParam())) {} + + // Returns user type given test parameterization. + user_manager::UserType GetUserType() const { return std::get<3>(GetParam()); } +}; + +INSTANTIATE_TEST_SUITE_P(All, + UserEducationControllerUserTypeTest, + testing::Combine( + /*capture_mode_tour_enabled=*/testing::Bool(), + /*holding_space_tour_enabled=*/testing::Bool(), + /*welcome_tour_enabled=*/testing::Bool(), + /*user_type=*/ + testing::Values(user_manager::USER_TYPE_GUEST, + user_manager::USER_TYPE_REGULAR))); + +// Tests ----------------------------------------------------------------------- + // Verifies that tutorials are registered when the primary user session is // added. Note that this test is skipped if the controller does not exist. -TEST_P(UserEducationControllerTest, RegistersTutorials) { +TEST_P(UserEducationControllerUserTypeTest, RegistersTutorials) { auto* user_education_controller = UserEducationController::Get(); if (!user_education_controller) { GTEST_SKIP(); @@ -167,57 +219,59 @@ // Create and cache an account ID for the primary user. AccountId primary_user_account_id = AccountId::FromUserEmail("primary@test"); - // Expect Capture Mode Tour tutorials to be registered with user education - // services in the browser if and only if the Capture Mode Tour feature is - // enabled. - if (IsCaptureModeTourEnabled()) { - auto* capture_mode_tour_controller = CaptureModeTourController::Get(); - ASSERT_TRUE(capture_mode_tour_controller); - for (const auto& [tutorial_id, ignore] : - static_cast<UserEducationFeatureController*>( - capture_mode_tour_controller) - ->GetTutorialDescriptions()) { - EXPECT_CALL( - *user_education_delegate, - RegisterTutorial(Eq(primary_user_account_id), Eq(tutorial_id), _)) - .RetiresOnSaturation(); + // Expect tutorials to be registered with user education services in the + // browser if and only if the user is associated with a regular profile. + if (GetUserType() == user_manager::USER_TYPE_REGULAR) { + // Expect Capture Mode Tour tutorials to be registered with user education + // services in the browser iff the Capture Mode Tour feature is enabled. + if (IsCaptureModeTourEnabled()) { + auto* capture_mode_tour_controller = CaptureModeTourController::Get(); + ASSERT_TRUE(capture_mode_tour_controller); + for (const auto& [tutorial_id, ignore] : + static_cast<UserEducationFeatureController*>( + capture_mode_tour_controller) + ->GetTutorialDescriptions()) { + EXPECT_CALL( + *user_education_delegate, + RegisterTutorial(Eq(primary_user_account_id), Eq(tutorial_id), _)) + .RetiresOnSaturation(); + } } - } - // Expect Holding Space Tour tutorials to be registered with user education - // services in the browser if and only if the Holding Space Tour feature is - // enabled. - if (IsHoldingSpaceTourEnabled()) { - auto* holding_space_tour_controller = HoldingSpaceTourController::Get(); - ASSERT_TRUE(holding_space_tour_controller); - for (const auto& [tutorial_id, ignore] : - static_cast<UserEducationFeatureController*>( - holding_space_tour_controller) - ->GetTutorialDescriptions()) { - EXPECT_CALL( - *user_education_delegate, - RegisterTutorial(Eq(primary_user_account_id), Eq(tutorial_id), _)) - .RetiresOnSaturation(); + // Expect Holding Space Tour tutorials to be registered with user education + // services in the browser iff the Holding Space Tour feature is enabled. + if (IsHoldingSpaceTourEnabled()) { + auto* holding_space_tour_controller = HoldingSpaceTourController::Get(); + ASSERT_TRUE(holding_space_tour_controller); + for (const auto& [tutorial_id, ignore] : + static_cast<UserEducationFeatureController*>( + holding_space_tour_controller) + ->GetTutorialDescriptions()) { + EXPECT_CALL( + *user_education_delegate, + RegisterTutorial(Eq(primary_user_account_id), Eq(tutorial_id), _)) + .RetiresOnSaturation(); + } } - } - // Expect Welcome Tour tutorials to be registered with user education services - // in the browser if and only if the Welcome Tour feature is enabled. - if (IsWelcomeTourEnabled()) { - auto* welcome_tour_controller = WelcomeTourController::Get(); - ASSERT_TRUE(welcome_tour_controller); - for (const auto& [tutorial_id, ignore] : - static_cast<UserEducationFeatureController*>(welcome_tour_controller) - ->GetTutorialDescriptions()) { - EXPECT_CALL( - *user_education_delegate, - RegisterTutorial(Eq(primary_user_account_id), Eq(tutorial_id), _)) - .RetiresOnSaturation(); + // Expect Welcome Tour tutorials to be registered with user education + // services in the browser iff the Welcome Tour feature is enabled. + if (IsWelcomeTourEnabled()) { + auto* welcome_tour_controller = WelcomeTourController::Get(); + ASSERT_TRUE(welcome_tour_controller); + for (const auto& [tutorial_id, ignore] : + static_cast<UserEducationFeatureController*>(welcome_tour_controller) + ->GetTutorialDescriptions()) { + EXPECT_CALL( + *user_education_delegate, + RegisterTutorial(Eq(primary_user_account_id), Eq(tutorial_id), _)) + .RetiresOnSaturation(); + } } } // Add the primary user session and verify expectations. - SimulateUserLogin(primary_user_account_id); + SimulateUserLogin(primary_user_account_id, GetUserType()); testing::Mock::VerifyAndClearExpectations(user_education_delegate); // Abort any tutorials that started automatically when the primary user @@ -228,7 +282,7 @@ // Add a secondary user session and verify that *no* tutorials are registered // with user education services in the browser. EXPECT_CALL(*user_education_delegate, RegisterTutorial).Times(0); - SimulateUserLogin(AccountId::FromUserEmail("secondary@test")); + SimulateUserLogin(AccountId::FromUserEmail("secondary@test"), GetUserType()); } } // namespace ash
diff --git a/ash/user_education/user_education_util.cc b/ash/user_education/user_education_util.cc index e2cfbb2a..79be2e9 100644 --- a/ash/user_education/user_education_util.cc +++ b/ash/user_education/user_education_util.cc
@@ -185,6 +185,16 @@ return nullptr; } +absl::optional<user_manager::UserType> GetUserType( + const AccountId& account_id) { + if (const auto* ctrlr = Shell::Get()->session_controller()) { + if (const auto* session = ctrlr->GetUserSessionByAccountId(account_id)) { + return session->user_info.type; + } + } + return absl::nullopt; +} + bool IsPrimaryAccountActive() { const auto* session_controller = Shell::Get()->session_controller(); return IsPrimaryAccountId(GetActiveAccountId(session_controller)) &&
diff --git a/ash/user_education/user_education_util.h b/ash/user_education/user_education_util.h index e5ab4be..8e07937f 100644 --- a/ash/user_education/user_education_util.h +++ b/ash/user_education/user_education_util.h
@@ -11,6 +11,7 @@ #include "ash/ash_export.h" #include "base/values.h" #include "components/user_education/common/help_bubble_params.h" +#include "components/user_manager/user_type.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/interaction/element_tracker.h" #include "ui/base/ui_base_types.h" @@ -116,6 +117,11 @@ int64_t display_id, ui::ElementIdentifier element_id); +// Returns the user type associated with the specified `account_id`, or +// `absl::nullopt` if type cannot be determined. +ASH_EXPORT absl::optional<user_manager::UserType> GetUserType( + const AccountId& account_id); + // Returns whether the primary user account is active. ASH_EXPORT bool IsPrimaryAccountActive();
diff --git a/ash/user_education/user_education_util_unittest.cc b/ash/user_education/user_education_util_unittest.cc index eeb61bce..9be5a7e1 100644 --- a/ash/user_education/user_education_util_unittest.cc +++ b/ash/user_education/user_education_util_unittest.cc
@@ -235,6 +235,28 @@ AnyOf(Eq(secondary_display_view), Eq(another_secondary_display_view))); } +// Verifies that `GetUserType()` is working as intended. +TEST_F(UserEducationUtilAshTest, GetUserType) { + AccountId guest_account_id = AccountId::FromUserEmail("guest@test"); + AccountId regular_account_id = AccountId::FromUserEmail("regular@test"); + + // Case: no user sessions added. + EXPECT_FALSE(GetUserType(AccountId())); + EXPECT_FALSE(GetUserType(guest_account_id)); + EXPECT_FALSE(GetUserType(regular_account_id)); + + auto* session_controller = GetSessionControllerClient(); + session_controller->AddUserSession(guest_account_id.GetUserEmail(), + user_manager::USER_TYPE_GUEST); + session_controller->AddUserSession(regular_account_id.GetUserEmail(), + user_manager::USER_TYPE_REGULAR); + + // Case: multiple user sessions added. + EXPECT_FALSE(GetUserType(AccountId())); + EXPECT_EQ(GetUserType(guest_account_id), user_manager::USER_TYPE_GUEST); + EXPECT_EQ(GetUserType(regular_account_id), user_manager::USER_TYPE_REGULAR); +} + // Verifies that `IsPrimaryAccountActive()` is working as intended. TEST_F(UserEducationUtilAshTest, IsPrimaryAccountActive) { AccountId primary_account_id = AccountId::FromUserEmail("primary@test");
diff --git a/ash/webui/common/resources/bluetooth/bluetooth_device_battery_info.d.ts b/ash/webui/common/resources/bluetooth/bluetooth_device_battery_info.d.ts index 53cc21a..4dc2e32b 100644 --- a/ash/webui/common/resources/bluetooth/bluetooth_device_battery_info.d.ts +++ b/ash/webui/common/resources/bluetooth/bluetooth_device_battery_info.d.ts
@@ -3,8 +3,11 @@ // found in the LICENSE file. import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {BluetoothDeviceProperties} from 'chrome://resources/mojo/chromeos/ash/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom-webui.js'; -export class BluetoothDeviceBatteryInfoElement extends PolymerElement {} +export class BluetoothDeviceBatteryInfoElement extends PolymerElement { + device: BluetoothDeviceProperties; +} declare global { interface HTMLElementTagNameMap {
diff --git a/ash/webui/scanning/resources/scanning_browser_proxy.js b/ash/webui/scanning/resources/scanning_browser_proxy.js index d6ccb2d..c430c2eec 100644 --- a/ash/webui/scanning/resources/scanning_browser_proxy.js +++ b/ash/webui/scanning/resources/scanning_browser_proxy.js
@@ -9,7 +9,6 @@ */ import {sendWithPromise} from 'chrome://resources/ash/common/cr.m.js'; -import {addSingletonGetter} from 'chrome://resources/ash/common/cr_deprecated.js'; import {ScanCompleteAction} from './scanning_app_types.js'; @@ -182,8 +181,17 @@ recordNumCompletedScans(numCompletedScans) { chrome.send('recordNumCompletedScans', [numCompletedScans]); } + + /** @return {!ScanningBrowserProxy} */ + static getInstance() { + return instance || (instance = new ScanningBrowserProxyImpl()); + } + + /** @param {!ScanningBrowserProxy} obj */ + static setInstance(obj) { + instance = obj; + } } -// The singleton instance_ can be replaced with a test version of this wrapper -// during testing. -addSingletonGetter(ScanningBrowserProxyImpl); +/** @type {?ScanningBrowserProxy} */ +let instance = null;
diff --git a/ash/wm/desks/desk_button/desk_button.cc b/ash/wm/desks/desk_button/desk_button.cc index 4ff761e5..5890278 100644 --- a/ash/wm/desks/desk_button/desk_button.cc +++ b/ash/wm/desks/desk_button/desk_button.cc
@@ -67,10 +67,14 @@ DeskSwitchButton::~DeskSwitchButton() = default; void DeskSwitchButton::SetShown(bool show) { - layer()->SetOpacity(show ? 1.f : 0.f); + layer()->SetOpacity(show ? 1.0f : 0.0f); SetEnabled(show); } +bool DeskSwitchButton::GetShown() const { + return GetEnabled() && layer()->GetTargetOpacity() == 1.0f; +} + void DeskSwitchButton::OnMouseEntered(const ui::MouseEvent& event) { if (hovered_) { return; @@ -342,7 +346,8 @@ // We override this function so that the tooltip manager ignores disabled desk // switch buttons when creating tooltips. views::View* tooltip_handler = Button::GetTooltipHandlerForPoint(point); - return tooltip_handler->GetEnabled() ? tooltip_handler : this; + return tooltip_handler && tooltip_handler->GetEnabled() ? tooltip_handler + : this; } void DeskButton::OnDeskAdded(const Desk* desk, bool from_undo) {
diff --git a/ash/wm/desks/desk_button/desk_button.h b/ash/wm/desks/desk_button/desk_button.h index 3d7e577..8860d75 100644 --- a/ash/wm/desks/desk_button/desk_button.h +++ b/ash/wm/desks/desk_button/desk_button.h
@@ -21,7 +21,7 @@ class DeskButtonWidget; // Buttons that can be clicked to switch to the left or right desk. -class DeskSwitchButton : public views::ImageButton { +class ASH_EXPORT DeskSwitchButton : public views::ImageButton { public: METADATA_HEADER(DeskSwitchButton); @@ -34,6 +34,7 @@ // Sets opacity and enabled state based on the input `show` state. void SetShown(bool show); + bool GetShown() const; private: // views::ImageButton:
diff --git a/ash/wm/desks/desks_unittests.cc b/ash/wm/desks/desks_unittests.cc index c42cc14..9ae83e3 100644 --- a/ash/wm/desks/desks_unittests.cc +++ b/ash/wm/desks/desks_unittests.cc
@@ -10853,11 +10853,11 @@ DeskButton* GetDeskButton() { return GetDeskButtonWidget()->GetDeskButton(); } - views::ImageButton* GetPrevDeskButton() { + DeskSwitchButton* GetPrevDeskButton() { return GetDeskButton()->prev_desk_button(); } - views::ImageButton* GetNextDeskButton() { + DeskSwitchButton* GetNextDeskButton() { return GetDeskButton()->next_desk_button(); } @@ -11112,41 +11112,51 @@ // in each phase of the desk button's desk switch process. TEST_P(DeskButtonTest, ValidateDeskButtonPosition) { NewDesk(); + NewDesk(); auto* desk_button = GetDeskButton(); - ASSERT_TRUE(desk_button); - auto* prev_desk_button = GetPrevDeskButton(); auto* next_desk_button = GetNextDeskButton(); auto* desk_name_label = desk_button->desk_name_label_for_test(); + auto* desk_controller = DesksController::Get(); + const int desk_count = desk_controller->GetNumberOfDesks(); - if (GetParam().alignment == ShelfAlignment::kBottom) { - EXPECT_EQ(gfx::Rect(0, 0, 96, 36), desk_button->bounds()); - EXPECT_EQ(gfx::Rect(0, 0, 20, 36), prev_desk_button->bounds()); - EXPECT_EQ(gfx::Rect(76, 0, 20, 36), next_desk_button->bounds()); - EXPECT_EQ(gfx::Rect(20, 0, 56, 36), desk_name_label->bounds()); - } else { - EXPECT_EQ(gfx::Rect(0, 0, 36, 36), desk_button->bounds()); - EXPECT_EQ(gfx::Rect(0, 0, 20, 36), prev_desk_button->bounds()); - EXPECT_EQ(gfx::Rect(76, 0, 20, 36), next_desk_button->bounds()); - EXPECT_EQ(gfx::Rect(0, 0, 36, 36), desk_name_label->bounds()); + for (int i = desk_count - 1; i >= 0; i--) { + ActivateDesk(desk_controller->desks()[i].get()); + + const bool should_show_prev_desk_button = i > 0; + const bool should_show_next_desk_button = i < desk_count - 1; + + // Check the desk button when *not* hovered. + auto* event_generator = GetEventGenerator(); + event_generator->MoveMouseTo(gfx::Point(0, 0)); + ASSERT_FALSE(desk_button->is_hovered()); + EXPECT_EQ(desk_button->bounds(), + GetParam().alignment == ShelfAlignment::kBottom + ? gfx::Rect(0, 0, 96, 36) + : gfx::Rect(0, 0, 36, 36)); + EXPECT_EQ(desk_name_label->bounds(), + GetParam().alignment == ShelfAlignment::kBottom + ? gfx::Rect(20, 0, 56, 36) + : gfx::Rect(0, 0, 36, 36)); + EXPECT_FALSE(prev_desk_button->GetShown()); + EXPECT_FALSE(next_desk_button->GetShown()); + + // Check the desk button when hovered. + event_generator->MoveMouseTo( + desk_button->GetBoundsInScreen().CenterPoint()); + ASSERT_TRUE(desk_button->is_hovered()); + EXPECT_EQ(desk_button->bounds(), gfx::Rect(0, 0, 96, 36)); + EXPECT_EQ(prev_desk_button->GetShown(), should_show_prev_desk_button); + EXPECT_EQ(next_desk_button->GetShown(), should_show_next_desk_button); + if (should_show_prev_desk_button) { + EXPECT_EQ(gfx::Rect(76, 0, 20, 36), next_desk_button->bounds()); + } + if (should_show_next_desk_button) { + EXPECT_EQ(prev_desk_button->bounds(), gfx::Rect(0, 0, 20, 36)); + } + EXPECT_EQ(desk_name_label->bounds(), gfx::Rect(20, 0, 56, 36)); } - - auto* event_generator = GetEventGenerator(); - event_generator->MoveMouseTo(desk_button->GetBoundsInScreen().CenterPoint()); - ASSERT_TRUE(next_desk_button->GetEnabled()); - event_generator->MoveMouseTo( - next_desk_button->GetBoundsInScreen().CenterPoint()); - EXPECT_EQ(gfx::Rect(0, 0, 96, 36), desk_button->bounds()); - EXPECT_EQ(gfx::Rect(0, 0, 20, 36), prev_desk_button->bounds()); - EXPECT_EQ(gfx::Rect(76, 0, 20, 36), next_desk_button->bounds()); - EXPECT_EQ(gfx::Rect(20, 0, 56, 36), desk_name_label->bounds()); - - ClickDeskSwitchButton(/*next=*/true); - EXPECT_EQ(gfx::Rect(0, 0, 96, 36), desk_button->bounds()); - EXPECT_EQ(gfx::Rect(0, 0, 20, 36), prev_desk_button->bounds()); - EXPECT_EQ(gfx::Rect(76, 0, 20, 36), next_desk_button->bounds()); - EXPECT_EQ(gfx::Rect(20, 0, 56, 36), desk_name_label->bounds()); } // Tests that desk button press metrics are correctly recorded.
diff --git a/base/allocator/partition_allocator/partition_alloc_base/strings/cstring_builder.cc b/base/allocator/partition_allocator/partition_alloc_base/strings/cstring_builder.cc index 91fa0e0..2643cda 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/strings/cstring_builder.cc +++ b/base/allocator/partition_allocator/partition_alloc_base/strings/cstring_builder.cc
@@ -147,7 +147,7 @@ } void CStringBuilder::PutFloatingPoint(double value, unsigned num_digits10) { - switch (fpclassify(value)) { + switch (std::fpclassify(value)) { case FP_INFINITE: PutText(value < 0 ? "-inf" : "inf"); break;
diff --git a/base/profiler/native_unwinder_android_unittest.cc b/base/profiler/native_unwinder_android_unittest.cc index 29124ae..adfdf18 100644 --- a/base/profiler/native_unwinder_android_unittest.cc +++ b/base/profiler/native_unwinder_android_unittest.cc
@@ -365,8 +365,7 @@ } // Checks that java frames can be unwound through. -// Disabled, see: https://crbug.com/1076997 -TEST(NativeUnwinderAndroidTest, DISABLED_JavaFunction) { +TEST(NativeUnwinderAndroidTest, JavaFunction) { auto* build_info = base::android::BuildInfo::GetInstance(); // Due to varying availability of compiled java unwind tables, unwinding is // only expected to succeed on > SDK_VERSION_MARSHMALLOW.
diff --git a/base/test/android/javatests/src/org/chromium/base/test/BaseChromiumAndroidJUnitRunner.java b/base/test/android/javatests/src/org/chromium/base/test/BaseChromiumAndroidJUnitRunner.java index caa226d..5439ebc 100644 --- a/base/test/android/javatests/src/org/chromium/base/test/BaseChromiumAndroidJUnitRunner.java +++ b/base/test/android/javatests/src/org/chromium/base/test/BaseChromiumAndroidJUnitRunner.java
@@ -736,9 +736,6 @@ if (file.getName().equals("lib")) { continue; } - if (file.getName().equals("chromium_tests_root")) { - continue; - } if (file.getName().equals("incremental-install-files")) { continue; }
diff --git a/base/win/registry.cc b/base/win/registry.cc index 7f8e734..454423a 100644 --- a/base/win/registry.cc +++ b/base/win/registry.cc
@@ -257,12 +257,15 @@ ERROR_SUCCESS; } -DWORD RegKey::GetValueCount() const { +base::expected<DWORD, LONG> RegKey::GetValueCount() const { DWORD count = 0; LONG result = RegQueryInfoKey(key_, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, &count, nullptr, nullptr, nullptr, nullptr); - return (result == ERROR_SUCCESS) ? count : 0; + if (result == ERROR_SUCCESS) { + return base::ok(count); + } + return base::unexpected(result); } FILETIME RegKey::GetLastWriteTime() const { @@ -302,38 +305,6 @@ return RegDelRecurse(key_, name, wow64access_); } -LONG RegKey::DeleteEmptyKey(const wchar_t* name) { - DCHECK(name); - - if (!Valid()) { - return ERROR_INVALID_HANDLE; - } - RegKey target_key; - LONG result = target_key.Open(key_, name, REG_OPTION_OPEN_LINK, - wow64access_ | KEY_QUERY_VALUE | DELETE); - if (result != ERROR_SUCCESS) { - return result; - } - - // A symbolic link has one REG_LINK value identifying the target and no - // subkeys, so it satisfies the criteria of being an "empty" key. - if (auto deleted_link = target_key.DeleteIfLink(); deleted_link.has_value()) { - return deleted_link.value(); - } - - // The key is not a symbolic link, so see if it has any values. - DWORD value_count = 0; - result = RegQueryInfoKey(target_key.key_, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, &value_count, nullptr, nullptr, - nullptr, nullptr); - if (result != ERROR_SUCCESS) { - return result; - } - target_key.Close(); - return value_count == 0 ? RegDeleteKeyEx(key_, name, wow64access_, 0) - : ERROR_DIR_NOT_EMPTY; -} - LONG RegKey::DeleteValue(const wchar_t* value_name) { // `RegDeleteValue()` will return an error if `key_` is invalid. LONG result = RegDeleteValue(key_, value_name);
diff --git a/base/win/registry.h b/base/win/registry.h index 78ce1d6..a1b6534 100644 --- a/base/win/registry.h +++ b/base/win/registry.h
@@ -80,9 +80,9 @@ // occurrs while attempting to access it. bool HasValue(const wchar_t* value_name) const; - // Returns the number of values for this key, or 0 if the number cannot be - // determined. - DWORD GetValueCount() const; + // Returns the number of values for this key, or an error code if the number + // cannot be determined. + base::expected<DWORD, LONG> GetValueCount() const; // Returns the last write time or 0 on failure. FILETIME GetLastWriteTime() const; @@ -97,10 +97,6 @@ // using it. LONG DeleteKey(const wchar_t* name); - // Deletes an empty subkey. If the subkey has subkeys or values then this - // will fail. - LONG DeleteEmptyKey(const wchar_t* name); - // Deletes a single value within the key. LONG DeleteValue(const wchar_t* name);
diff --git a/base/win/registry_unittest.cc b/base/win/registry_unittest.cc index aae8b71..1e125e7 100644 --- a/base/win/registry_unittest.cc +++ b/base/win/registry_unittest.cc
@@ -21,6 +21,7 @@ #include "base/run_loop.h" #include "base/strings/strcat.h" #include "base/test/bind.h" +#include "base/test/gmock_expected_support.h" #include "base/test/mock_callback.h" #include "base/test/task_environment.h" #include "base/test/test_mock_time_task_runner.h" @@ -88,7 +89,7 @@ ASSERT_EQ(ERROR_SUCCESS, key.WriteValue(kDWORDValueName, kDWORDData)); ASSERT_EQ(ERROR_SUCCESS, key.WriteValue(kInt64ValueName, &kInt64Data, sizeof(kInt64Data), REG_QWORD)); - EXPECT_EQ(3U, key.GetValueCount()); + EXPECT_THAT(key.GetValueCount(), base::test::ValueIs(3U)); EXPECT_TRUE(key.HasValue(kStringValueName)); EXPECT_TRUE(key.HasValue(kDWORDValueName)); EXPECT_TRUE(key.HasValue(kInt64ValueName)); @@ -117,7 +118,7 @@ ASSERT_EQ(ERROR_SUCCESS, key.DeleteValue(kStringValueName)); ASSERT_EQ(ERROR_SUCCESS, key.DeleteValue(kDWORDValueName)); ASSERT_EQ(ERROR_SUCCESS, key.DeleteValue(kInt64ValueName)); - EXPECT_EQ(0U, key.GetValueCount()); + EXPECT_THAT(key.GetValueCount(), base::test::ValueIs(0U)); EXPECT_FALSE(key.HasValue(kStringValueName)); EXPECT_FALSE(key.HasValue(kDWORDValueName)); EXPECT_FALSE(key.HasValue(kInt64ValueName)); @@ -229,13 +230,6 @@ key.Open(HKEY_CURRENT_USER, key_path.c_str(), KEY_READ)); ASSERT_EQ(ERROR_SUCCESS, - key.Open(HKEY_CURRENT_USER, root_key().c_str(), KEY_WRITE)); - ASSERT_NE(ERROR_SUCCESS, key.DeleteEmptyKey(L"")); - ASSERT_NE(ERROR_SUCCESS, key.DeleteEmptyKey(L"Bar\\Foo")); - ASSERT_NE(ERROR_SUCCESS, key.DeleteEmptyKey(L"Bar")); - ASSERT_EQ(ERROR_SUCCESS, key.DeleteEmptyKey(L"Foo")); - - ASSERT_EQ(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, key_path.c_str(), KEY_CREATE_SUB_KEY)); ASSERT_EQ(ERROR_SUCCESS, key.CreateKey(L"Bar", KEY_WRITE)); ASSERT_EQ(ERROR_SUCCESS, key.CreateKey(L"Foo", KEY_WRITE)); @@ -464,7 +458,6 @@ static const wchar_t kFooName[] = L"foo"; EXPECT_EQ(key.DeleteKey(kFooName), ERROR_INVALID_HANDLE); - EXPECT_EQ(key.DeleteEmptyKey(kFooName), ERROR_INVALID_HANDLE); EXPECT_EQ(key.DeleteValue(kFooName), ERROR_INVALID_HANDLE); }
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py index 46cca1d1..75bc28e 100644 --- a/build/android/pylib/instrumentation/instrumentation_test_instance.py +++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py
@@ -607,7 +607,6 @@ self._data_deps = None self._data_deps_delegate = None self._runtime_deps_path = None - self._store_data_in_app_directory = False self._variations_test_seed_path = args.variations_test_seed_path self._initializeDataDependencyAttributes(args, data_deps_delegate) @@ -791,7 +790,7 @@ self._data_deps = [] self._data_deps_delegate = data_deps_delegate self._runtime_deps_path = args.runtime_deps_path - self._store_data_in_app_directory = args.store_data_in_app_directory + if not self._runtime_deps_path: logging.warning('No data dependencies will be pushed.') @@ -1023,10 +1022,6 @@ return self._skia_gold_properties @property - def store_data_in_app_directory(self): - return self._store_data_in_app_directory - - @property def store_tombstones(self): return self._store_tombstones
diff --git a/build/android/pylib/local/device/local_device_environment.py b/build/android/pylib/local/device/local_device_environment.py index 5651d5a..4493946 100644 --- a/build/android/pylib/local/device/local_device_environment.py +++ b/build/android/pylib/local/device/local_device_environment.py
@@ -86,7 +86,7 @@ return decorator -def place_nomedia_on_device(dev, device_root, run_as=None, as_root=False): +def place_nomedia_on_device(dev, device_root): """Places .nomedia file in test data root. This helps to prevent system from scanning media files inside test data. @@ -96,14 +96,8 @@ device_root: Base path on device to place .nomedia file. """ - dev.RunShellCommand(['mkdir', '-p', device_root], - run_as=run_as, - as_root=as_root, - check_return=True) - dev.WriteFile('%s/.nomedia' % device_root, - 'https://crbug.com/796640', - run_as=run_as, - as_root=as_root) + dev.RunShellCommand(['mkdir', '-p', device_root], check_return=True) + dev.WriteFile('%s/.nomedia' % device_root, 'https://crbug.com/796640') # TODO(1262303): After Telemetry is supported by python3 we can re-add
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py index 2b8f96f..81c9e598 100644 --- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py +++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
@@ -202,22 +202,14 @@ self._shared_prefs_to_restore = [] self._skia_gold_session_manager = None self._skia_gold_work_dir = None - self._target_package = _GetTargetPackageName(test_instance.test_apk) #override def TestPackage(self): return self._test_instance.suite - def _GetDataStorageRootDirectory(self, device): - if self._test_instance.store_data_in_app_directory: - # TODO(rmhasan): Add check to makes sure api level > 27. Selinux - # policy on Oreo does not allow app to read files from app data dir - # that were not put there by the app. - return device.GetApplicationDataDirectory(self._target_package) - return device.GetExternalStoragePath() - #override def SetUp(self): + target_package = _GetTargetPackageName(self._test_instance.test_apk) @local_device_environment.handle_shard_failures_with( self._env.DenylistDevice) @@ -415,7 +407,7 @@ cmd = ['am', 'set-debug-app', '--persistent'] if self._test_instance.wait_for_java_debugger: cmd.append('-w') - cmd.append(self._target_package) + cmd.append(target_package) dev.RunShellCommand(cmd, check_return=True) @trace_event.traced @@ -450,39 +442,28 @@ @instrumentation_tracing.no_tracing def push_test_data(dev): - test_data_root_dir = posixpath.join( - self._GetDataStorageRootDirectory(dev), 'chromium_tests_root') + device_root = posixpath.join(dev.GetExternalStoragePath(), + 'chromium_tests_root') host_device_tuples_substituted = [ - (h, - local_device_test_run.SubstituteDeviceRoot(d, test_data_root_dir)) + (h, local_device_test_run.SubstituteDeviceRoot(d, device_root)) for h, d in host_device_tuples ] logging.info('Pushing data dependencies.') for h, d in host_device_tuples_substituted: logging.debug(' %r -> %r', h, d) - - as_root = self._test_instance.store_data_in_app_directory - local_device_environment.place_nomedia_on_device(dev, - test_data_root_dir, - as_root=as_root) + local_device_environment.place_nomedia_on_device(dev, device_root) dev.PushChangedFiles(host_device_tuples_substituted, - delete_device_stale=True, - as_root=as_root) - + delete_device_stale=True) if not host_device_tuples_substituted: - dev.RunShellCommand(['rm', '-rf', test_data_root_dir], - check_return=True, - as_root=as_root) - dev.RunShellCommand(['mkdir', '-p', test_data_root_dir], - check_return=True, - as_root=as_root) + dev.RunShellCommand(['rm', '-rf', device_root], check_return=True) + dev.RunShellCommand(['mkdir', '-p', device_root], check_return=True) @trace_event.traced def create_flag_changer(dev): flags = self._test_instance.flags[:] if self._test_instance.variations_test_seed_path: - test_data_root_dir = posixpath.join( - self._GetDataStorageRootDirectory(dev), 'chromium_tests_root') + test_data_root_dir = posixpath.join(dev.GetExternalStoragePath(), + 'chromium_tests_root') seed_path_components = DevicePathComponentsFor( self._test_instance.variations_test_seed_path) test_seed_path = local_device_test_run.SubstituteDeviceRoot( @@ -551,7 +532,7 @@ if self._test_instance.wait_for_java_debugger: logging.warning('*' * 80) logging.warning('Waiting for debugger to attach to process: %s', - self._target_package) + target_package) logging.warning('*' * 80) #override @@ -905,9 +886,6 @@ self._CreateFlagChangerIfNeeded(device) self._flag_changers[str(device)].PushFlags(add=flags_to_add) - if self._test_instance.store_data_in_app_directory: - extras.update({'fetchTestDataFromAppDataDir': 'true'}) - time_ms = lambda: int(time.time() * 1e3) start_ms = time_ms() @@ -1225,15 +1203,11 @@ logging.info('Could not get tests from pickle: %s', e) logging.info('Getting tests by having %s list them.', self._test_instance.junit4_runner_class) - # We need to use GetAppWritablePath instead of GetExternalStoragePath - # here because we will not have applied legacy storage workarounds on R+ - # yet. - # TODO(rmhasan): Figure out how to create the temp file inside the test - # app's data directory. Currently when the temp file is created read - # permissions are only given to the app's user id. Therefore we can't - # pull the file from the device. def list_tests(d): def _run(dev): + # We need to use GetAppWritablePath instead of GetExternalStoragePath + # here because we will not have applied legacy storage workarounds on R+ + # yet. with device_temp_file.DeviceTempFile( dev.adb, suffix='.json', dir=dev.GetAppWritablePath()) as dev_test_list_json:
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run_test.py b/build/android/pylib/local/device/local_device_instrumentation_test_run_test.py index fb41572..acf25a0 100755 --- a/build/android/pylib/local/device/local_device_instrumentation_test_run_test.py +++ b/build/android/pylib/local/device/local_device_instrumentation_test_run_test.py
@@ -9,7 +9,6 @@ import unittest -import mock # pylint: disable=import-error from pylib.base import base_test_result from pylib.base import mock_environment @@ -165,33 +164,6 @@ with self.assertRaises(ValueError): local_device_instrumentation_test_run._ReplaceUncommonChars(original) - def testStoreDataInAppDir(self): - env = mock.MagicMock() - test_instance = mock.MagicMock() - test_instance.store_data_in_app_directory = True - device = mock.MagicMock() - - device.GetApplicationDataDirectory.return_value = 'app_dir' - device.GetExternalStoragePath.return_value = 'external_dir' - test_run = ( - local_device_instrumentation_test_run.LocalDeviceInstrumentationTestRun( - env, test_instance)) - self.assertEqual(test_run._GetDataStorageRootDirectory(device), 'app_dir') - - def testStoreDataInExternalDir(self): - env = mock.MagicMock() - test_instance = mock.MagicMock() - test_instance.store_data_in_app_directory = False - device = mock.MagicMock() - - device.GetApplicationDataDirectory.return_value = 'app_dir' - device.GetExternalStoragePath.return_value = 'external_dir' - test_run = ( - local_device_instrumentation_test_run.LocalDeviceInstrumentationTestRun( - env, test_instance)) - self.assertEqual(test_run._GetDataStorageRootDirectory(device), - 'external_dir') - if __name__ == '__main__': unittest.main(verbosity=2)
diff --git a/build/android/test_runner.py b/build/android/test_runner.py index e57fc28..3a1ea39 100755 --- a/build/android/test_runner.py +++ b/build/android/test_runner.py
@@ -500,11 +500,6 @@ '--apk-under-test', help='Path or name of the apk under test.') parser.add_argument( - '--store-data-in-app-directory', - action='store_true', - help='Store test data in the application\'s data directory. By default ' - 'the test data is stored in the external storage folder.') - parser.add_argument( '--module', action='append', dest='modules',
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerMediator.java index db1f08d..4bfb7117 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerMediator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerMediator.java
@@ -811,6 +811,12 @@ preserveFolderBookmarksOnEmptySearch = true; } + // Search states should only be the top most state. Back button should not restore them. + if (getCurrentUiMode() == BookmarkUiMode.SEARCHING && state.mUiMode == BookmarkUiMode.FOLDER + && BookmarkFeatures.isAndroidImprovedBookmarksEnabled()) { + mStateStack.pop(); + } + mStateStack.push(state); notifyUi(state, preserveFolderBookmarksOnEmptySearch); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbar.java index e30f33c..1366087 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbar.java
@@ -1351,6 +1351,9 @@ public void showUrlBarCursorWithoutFocusAnimations() {} @Override + public void clearUrlBarCursorWithoutFocusAnimations() {} + + @Override public void selectAll() {} @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ChromePaymentResponseHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ChromePaymentResponseHelper.java index 6dabfac8..cc70e0c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ChromePaymentResponseHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ChromePaymentResponseHelper.java
@@ -6,10 +6,11 @@ import androidx.annotation.Nullable; +import org.chromium.chrome.browser.autofill.AddressNormalizerFactory; import org.chromium.chrome.browser.autofill.AutofillAddress; import org.chromium.chrome.browser.autofill.PersonalDataManager; -import org.chromium.chrome.browser.autofill.PersonalDataManager.NormalizedAddressRequestDelegate; import org.chromium.chrome.browser.autofill.PhoneNumberUtil; +import org.chromium.components.autofill.AddressNormalizer.NormalizedAddressRequestDelegate; import org.chromium.components.autofill.AutofillProfile; import org.chromium.components.autofill.EditableOption; import org.chromium.components.payments.PayerData; @@ -83,7 +84,7 @@ // The shipping address needs to be normalized before sending the response to the // merchant. mIsWaitingForShippingNormalization = true; - PersonalDataManager.getInstance().normalizeAddress( + AddressNormalizerFactory.getInstance().normalizeAddress( mSelectedShippingAddress.getProfile(), this); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentUiService.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentUiService.java index 7c7a7ca8..927c8534 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentUiService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentUiService.java
@@ -13,9 +13,9 @@ import org.chromium.base.Callback; import org.chromium.chrome.R; +import org.chromium.chrome.browser.autofill.AddressNormalizerFactory; import org.chromium.chrome.browser.autofill.AutofillAddress; import org.chromium.chrome.browser.autofill.PersonalDataManager; -import org.chromium.chrome.browser.autofill.PersonalDataManager.NormalizedAddressRequestDelegate; import org.chromium.chrome.browser.layouts.LayoutManagerProvider; import org.chromium.chrome.browser.layouts.LayoutStateProvider; import org.chromium.chrome.browser.layouts.LayoutStateProvider.LayoutStateObserver; @@ -40,6 +40,7 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; import org.chromium.chrome.browser.ui.favicon.FaviconHelper; +import org.chromium.components.autofill.AddressNormalizer.NormalizedAddressRequestDelegate; import org.chromium.components.autofill.AutofillProfile; import org.chromium.components.autofill.Completable; import org.chromium.components.autofill.EditableOption; @@ -1136,7 +1137,8 @@ String countryCode = AutofillAddress.getCountryCode(addresses.get(i).getProfile()); if (!uniqueCountryCodes.contains(countryCode)) { uniqueCountryCodes.add(countryCode); - PersonalDataManager.getInstance().loadRulesForAddressNormalization(countryCode); + AddressNormalizerFactory.getInstance().loadRulesForAddressNormalization( + countryCode); } } @@ -1431,7 +1433,8 @@ private void startShippingAddressChangeNormalization(AutofillAddress address) { // Will call back into either onAddressNormalized or onCouldNotNormalize which will send the // result to the merchant. - PersonalDataManager.getInstance().normalizeAddress(address.getProfile(), /*delegate=*/this); + AddressNormalizerFactory.getInstance().normalizeAddress( + address.getProfile(), /*delegate=*/this); } /** @return Whether at least one payment app is available. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java index 429d327..5921f1b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java
@@ -78,7 +78,6 @@ import org.chromium.chrome.browser.layouts.LayoutType; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.merchant_viewer.MerchantTrustSignalsCoordinator; -import org.chromium.chrome.browser.ntp.IncognitoNewTabPage; import org.chromium.chrome.browser.ntp.NewTabPage; import org.chromium.chrome.browser.ntp.NewTabPageUma; import org.chromium.chrome.browser.offlinepages.OfflinePageTabData; @@ -854,7 +853,7 @@ mLocationBarModel.notifyContentChanged(); checkIfNtpLoaded(); mToolbar.onTabContentViewChanged(); - maybeShowCursorInLocationBar(); + maybeShowOrClearCursorInLocationBar(); // Paint preview status might have been changed. Update the omnibox chip. mLocationBarModel.notifySecurityStateChanged(); onBackPressStateChanged(); @@ -1060,7 +1059,7 @@ if (DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)) { checkIfNtpLoaded(); - maybeShowCursorInLocationBar(); + maybeShowOrClearCursorInLocationBar(); } } } @@ -2089,7 +2088,7 @@ // Place the cursor in the Omnibox if applicable. We always clear the focus above to // ensure the shield placed over the content is dismissed when switching tabs. But if // needed, we will refocus the omnibox and make the cursor visible here. - maybeShowCursorInLocationBar(); + maybeShowOrClearCursorInLocationBar(); } updateButtonStatus(); @@ -2206,28 +2205,37 @@ } /** - * Called whenever the NTP could have been entered (e.g. tab content changed, tab navigated to - * from the tab strip/tab switcher, etc.). If the user is on a tablet and indeed entered the - * NTP, we will check two cases: - * 1. If a11y is enabled, we will request a11y focus on the omnibox (e.g. for TalkBack). - * 2. If a keyboard is plugged in, we will show the URL bar cursor (without focus animations). + * Called whenever the NTP could have been entered or exited (e.g. tab content changed, tab + * navigated to from the tab strip/tab switcher, etc.). If the user is on a tablet and indeed + * entered or exited from the NTP, we will check the following cases: + * 1. If a11y is enabled, we will request a11y focus on the omnibox (e.g. for TalkBack) on the + * NTP. + * 2. If a keyboard is plugged in, we will show the URL bar cursor (without focus animations) + * on entering the NTP. + * 3. If a keyboard is plugged in, we will clear focus established in #2 above on exiting + * from the NTP. */ - private void maybeShowCursorInLocationBar() { + private void maybeShowOrClearCursorInLocationBar() { if (!DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)) return; Tab tab = mLocationBarModel.getTab(); if (tab == null) return; NativePage nativePage = tab.getNativePage(); - if (!(nativePage instanceof NewTabPage) && !(nativePage instanceof IncognitoNewTabPage)) { - return; - } + boolean onNtp = UrlUtilities.isNTPUrl(tab.getUrl()); if (ChromeAccessibilityUtil.get().isAccessibilityEnabled() && nativePage instanceof NewTabPage) { mLocationBar.requestUrlBarAccessibilityFocus(); } + // While a hardware keyboard is connected, loading the NTP should cause the URL bar to gain + // focus with a blinking cursor and without focus animations. Loading a non-NTP URL should + // clear such focus if it exists. if (mActivity.getResources().getConfiguration().keyboard == Configuration.KEYBOARD_QWERTY) { - mLocationBar.showUrlBarCursorWithoutFocusAnimations(); + if (onNtp) { + mLocationBar.showUrlBarCursorWithoutFocusAnimations(); + } else { + mLocationBar.clearUrlBarCursorWithoutFocusAnimations(); + } } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/locale/LocaleManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/locale/LocaleManagerTest.java index e668e1bd..fbe9170 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/locale/LocaleManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/locale/LocaleManagerTest.java
@@ -5,78 +5,69 @@ package org.chromium.chrome.browser.locale; import androidx.test.filters.SmallTest; -import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Assert; -import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; -import org.chromium.base.Callback; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.base.test.util.DisabledTest; import org.chromium.chrome.browser.flags.ChromeSwitches; -import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.chrome.browser.search_engines.SearchEnginePromoType; -import org.chromium.chrome.browser.searchwidget.SearchActivity; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; -import org.chromium.chrome.test.util.ActivityTestUtils; +import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.components.policy.test.annotations.Policies; import org.chromium.content_public.browser.test.util.TestThreadUtils; -import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; /** * Integration tests for {@link LocaleManager}. */ @RunWith(ChromeJUnit4ClassRunner.class) +@Batch(Batch.PER_CLASS) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) public class LocaleManagerTest { - @Before - public void setUp() throws ExecutionException { - TestThreadUtils.runOnUiThreadBlocking(new Callable<Void>() { - @Override - public Void call() { - ChromeBrowserInitializer.getInstance().handleSynchronousStartup(); - return null; - } - }); + public @Rule MockitoRule mockitoRule = MockitoJUnit.rule(); + public static @ClassRule ChromeTabbedActivityTestRule sActivityTestRule = + new ChromeTabbedActivityTestRule(); + + @BeforeClass + public static void setUpClass() throws ExecutionException { + // Launch any activity as an Activity ref is required to attempt to show the activity. + sActivityTestRule.startMainActivityOnBlankPage(); + sActivityTestRule.waitForActivityNativeInitializationComplete(); + sActivityTestRule.waitForDeferredStartup(); } @Policies.Add({ @Policies.Item(key = "DefaultSearchProviderEnabled", string = "false") }) @SmallTest @Test - @DisabledTest(message = "https://crbug.com/1170670") - public void testShowSearchEnginePromoDseDisabled() throws TimeoutException { + public void testShowSearchEnginePromoDseDisabled() throws Exception { final CallbackHelper getShowTypeCallback = new CallbackHelper(); - TestThreadUtils.runOnUiThreadBlocking(() -> { - LocaleManager.getInstance().setDelegateForTest(new LocaleManagerDelegate() { - @Override - public int getSearchEnginePromoShowType() { - getShowTypeCallback.notifyCalled(); - return SearchEnginePromoType.DONT_SHOW; - } - }); - }); - - // Launch any activity as an Activity ref is required to attempt to show the activity. - final SearchActivity searchActivity = ActivityTestUtils.waitForActivity( - InstrumentationRegistry.getInstrumentation(), SearchActivity.class); + TestThreadUtils.runOnUiThreadBlocking( + () -> LocaleManager.getInstance().setDelegateForTest(new LocaleManagerDelegate() { + @Override + public int getSearchEnginePromoShowType() { + getShowTypeCallback.notifyCalled(); + return SearchEnginePromoType.DONT_SHOW; + } + })); final CallbackHelper searchEnginesFinalizedCallback = new CallbackHelper(); - TestThreadUtils.runOnUiThreadBlocking(() -> { - LocaleManager.getInstance().showSearchEnginePromoIfNeeded( - searchActivity, new Callback<Boolean>() { - @Override - public void onResult(Boolean result) { - Assert.assertTrue(result); - searchEnginesFinalizedCallback.notifyCalled(); - } - }); - }); + TestThreadUtils.runOnUiThreadBlocking( + () + -> LocaleManager.getInstance().showSearchEnginePromoIfNeeded( + sActivityTestRule.getActivity(), result -> { + Assert.assertTrue(result); + searchEnginesFinalizedCallback.notifyCalled(); + })); searchEnginesFinalizedCallback.waitForCallback(0); Assert.assertEquals(0, getShowTypeCallback.getCallCount()); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesTest.java index 47ff614..6014ff7 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesTest.java
@@ -312,8 +312,7 @@ CriteriaHelper.pollUiThread(() -> { return manager.getCurrentDialogForTest() == null; }); verify(mAutocompleteControllerJniMock, times(1)) - .deleteMatchElement( - anyLong(), eq(MV_TILE_CAROUSEL_MATCH_POSITION), eq(tileToDelete)); + .deleteMatchElement(anyLong(), eq(0L), eq(tileToDelete)); } @Test
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/ToolbarTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/ToolbarTest.java index 33dfb23..bbc1595 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/ToolbarTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/ToolbarTest.java
@@ -9,6 +9,8 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import android.content.res.Configuration; + import androidx.test.core.app.ApplicationProvider; import androidx.test.filters.MediumTest; import androidx.test.platform.app.InstrumentationRegistry; @@ -21,12 +23,14 @@ import org.junit.runner.RunWith; import org.chromium.base.ThreadUtils; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Criteria; import org.chromium.base.test.util.CriteriaHelper; import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Restriction; +import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.app.ChromeActivity; import org.chromium.chrome.browser.findinpage.FindToolbar; import org.chromium.chrome.browser.flags.ChromeSwitches; @@ -49,6 +53,7 @@ */ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) +@Batch(Batch.PER_CLASS) public class ToolbarTest { @Rule public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); @@ -150,4 +155,37 @@ omnibox.requestFocus(); waitForFindInPageVisibility(false); } + + @Test + @MediumTest + @Restriction(UiRestriction.RESTRICTION_TYPE_TABLET) + @Feature({"Omnibox"}) + public void testNtpOmniboxFocusAndUnfocusWithHardwareKeyboardConnected() { + ChromeTabbedActivity activity = mActivityTestRule.getActivity(); + // Simulate availability of a hardware keyboard. + activity.getResources().getConfiguration().keyboard = Configuration.KEYBOARD_QWERTY; + + // Open a new tab. + ChromeTabUtils.newTabFromMenu( + InstrumentationRegistry.getInstrumentation(), activity, false, true); + // Verify that the omnibox is focused when the NTP is loaded. + CriteriaHelper.pollUiThread(() -> { + Criteria.checkThat(activity.getToolbarManager() + .getLocationBarForTesting() + .getOmniboxStub() + .isUrlBarFocused(), + Matchers.is(true)); + }); + + // Navigate away from the NTP. + mActivityTestRule.loadUrl(UrlConstants.GOOGLE_URL); + // Verify that the omnibox is unfocused on exit from the NTP. + CriteriaHelper.pollUiThread(() -> { + Criteria.checkThat(activity.getToolbarManager() + .getLocationBarForTesting() + .getOmniboxStub() + .isUrlBarFocused(), + Matchers.is(false)); + }); + } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrGvrPermissionTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrGvrPermissionTest.java index 28f85fa..0b054968 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrGvrPermissionTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrGvrPermissionTest.java
@@ -24,7 +24,6 @@ import org.chromium.base.test.params.ParameterizedRunner; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.DisableIf; -import org.chromium.base.test.util.DisabledTest; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.vr.rules.XrActivityRestriction; import org.chromium.chrome.browser.vr.util.GvrTestRuleUtils; @@ -131,7 +130,6 @@ @Test @MediumTest @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) - @DisabledTest(message = "crbug.com/1429697") public void testPermissionPersistsAfterReload() { mWebXrVrPermissionTestFramework.loadFileAndAwaitInitialization( "generic_webxr_page", PAGE_LOAD_TIMEOUT_S);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardPermissionTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardPermissionTest.java index 6201453..98d467e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardPermissionTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrVrCardboardPermissionTest.java
@@ -22,7 +22,6 @@ import org.chromium.base.test.params.ParameterSet; import org.chromium.base.test.params.ParameterizedRunner; import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.vr.rules.XrActivityRestriction; @@ -134,7 +133,6 @@ @MediumTest @Restriction({RESTRICTION_TYPE_VIEWER_NON_DAYDREAM}) @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) - @DisabledTest(message = "crbug.com/1429697") public void testPermissionPersistsAfterReload() { mWebXrVrPermissionTestFramework.loadFileAndAwaitInitialization( "generic_webxr_page", PAGE_LOAD_TIMEOUT_S);
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerMediatorTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerMediatorTest.java index d9efff9..bdf3dc2 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerMediatorTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerMediatorTest.java
@@ -1410,4 +1410,27 @@ clearSearchTextRunnable.run(); assertEquals("", propertyModel.get(BookmarkSearchBoxRowProperties.SEARCH_TEXT)); } + + @Test + @EnableFeatures(ChromeFeatureList.ANDROID_IMPROVED_BOOKMARKS) + public void testBackNavigationDoesNotRestoreSearch() { + finishLoading(); + mMediator.openFolder(mFolderId1); + assertEquals(BookmarkUiMode.FOLDER, mMediator.getCurrentUiMode()); + verifyCurrentBookmarkIds(null, mFolderId2, mFolderId3); + + Callback<String> searchTextChangeCallback = mModelList.get(0).model.get( + BookmarkSearchBoxRowProperties.SEARCH_TEXT_CHANGE_CALLBACK); + searchTextChangeCallback.onResult("foo"); + assertEquals(BookmarkUiMode.SEARCHING, mMediator.getCurrentUiMode()); + + mMediator.openFolder(mFolderId2); + assertEquals(BookmarkUiMode.FOLDER, mMediator.getCurrentUiMode()); + verifyCurrentBookmarkIds(null, mBookmarkId21); + + assertTrue(mMediator.onBackPressed()); + // Should have gone back to mFolderId1. + assertEquals(BookmarkUiMode.FOLDER, mMediator.getCurrentUiMode()); + verifyCurrentBookmarkIds(null, mFolderId2, mFolderId3); + } }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/omaha/ExponentialBackoffSchedulerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/omaha/ExponentialBackoffSchedulerTest.java index 1942dbf..2f33c75c 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/omaha/ExponentialBackoffSchedulerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/omaha/ExponentialBackoffSchedulerTest.java
@@ -12,10 +12,12 @@ import org.chromium.base.FakeTimeTestRule; import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; /** Tests the ExponentialBackoffScheduler. */ @RunWith(BaseRobolectricTestRunner.class) +@Batch(Batch.UNIT_TESTS) @Config(manifest = Config.NONE) public class ExponentialBackoffSchedulerTest { private static final String PREFERENCE_NAME = "scheduler";
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/omaha/OmahaBaseTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/omaha/OmahaBaseTest.java index 704263b6..ab142cb3 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/omaha/OmahaBaseTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/omaha/OmahaBaseTest.java
@@ -21,6 +21,7 @@ import org.chromium.base.FeatureList; import org.chromium.base.ThreadUtils; import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.omaha.MockRequestGenerator.DeviceType; @@ -46,6 +47,7 @@ * system, such as whether Chrome was installed through the system image. */ @RunWith(BaseRobolectricTestRunner.class) +@Batch(Batch.UNIT_TESTS) @Config(manifest = Config.NONE) public class OmahaBaseTest { private static class TimestampPair {
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/omaha/RequestGeneratorTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/omaha/RequestGeneratorTest.java index 1b71cec..ca752bbde 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/omaha/RequestGeneratorTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/omaha/RequestGeneratorTest.java
@@ -16,6 +16,7 @@ import org.robolectric.annotation.Config; import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.omaha.MockRequestGenerator.DeviceType; import org.chromium.chrome.browser.signin.services.IdentityServicesProvider; @@ -29,6 +30,7 @@ * Unit tests for the RequestGenerator class. */ @RunWith(BaseRobolectricTestRunner.class) +@Batch(Batch.UNIT_TESTS) @Config(manifest = Config.NONE) public class RequestGeneratorTest { private static final String INSTALL_SOURCE = "install_source";
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/omaha/ResponseParserTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/omaha/ResponseParserTest.java index c366d64..5f3b8c91 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/omaha/ResponseParserTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/omaha/ResponseParserTest.java
@@ -13,6 +13,7 @@ import org.xmlpull.v1.XmlSerializer; import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; import java.io.IOException; @@ -22,6 +23,7 @@ * Unit tests for the Omaha ResponseParser. */ @RunWith(BaseRobolectricTestRunner.class) +@Batch(Batch.UNIT_TESTS) @Config(manifest = Config.NONE) public class ResponseParserTest { // Note that the Omaha server appends "/" to the end of the URL codebase.
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/omaha/StringSanitizerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/omaha/StringSanitizerTest.java index 42422593a..e08fa53d 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/omaha/StringSanitizerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/omaha/StringSanitizerTest.java
@@ -9,10 +9,12 @@ import org.junit.runner.RunWith; import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; /** Tests the Omaha StringSanitizer. */ @RunWith(BaseRobolectricTestRunner.class) +@Batch(Batch.UNIT_TESTS) public class StringSanitizerTest { @Test @Feature({"Omaha"})
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/omaha/VersionNumberTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/omaha/VersionNumberTest.java index fd175ac..366ff04 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/omaha/VersionNumberTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/omaha/VersionNumberTest.java
@@ -9,12 +9,14 @@ import org.junit.runner.RunWith; import org.junit.runners.BlockJUnit4ClassRunner; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; /** * Unit tests for VersionNumber. */ @RunWith(BlockJUnit4ClassRunner.class) +@Batch(Batch.UNIT_TESTS) public class VersionNumberTest { private static final String DEVELOPER_BUILD = "0.1 Developer Build"; private static final String BUILD_BOGUS_1_2_3_4 = "Bogus-1.2.3.4";
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index 8f1514a6..ef21acb 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -1593,20 +1593,26 @@ <message name="IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_HEADER" desc="Heading for the exceptions list for tab discarding in the performance settings. Tabs will not be discarded by memory saver mode if on a site matching a rule in this list."> Always keep these sites active </message> + <message name="IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_DESCRIPTION" desc="Description for the exceptions list for tab discarding in the performance settings. Tabs will not be discarded by memory saver mode if on a site matching a rule in this list."> + Sites you add will always stay active and memory won't be freed up from them + </message> <message name="IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADDITIONAL_SITES" desc="Label for button that expands the tab discarding exceptions list to show all entries. Sites added to the list will not be discarded by memory saver."> Additional sites </message> <message name="IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_CURRENT_TABS" desc="Label for the first tab of the tab discarding exception list add dialog, that allows users to pick sites from currently opened tabs to add to the list."> Add current sites </message> + <message name="IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_CURRENT_TABS_EMPTY" desc="Message shown in the first tab of the tab discarding exception list add dialog, when the list of sites from currently opened tabs is empty."> + No sites currently available. Visit a site to add it to this list. + </message> <message name="IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_MANUAL" desc="Label for the second tab of the tab discarding exception list add dialog, where users can manually input a site to be added to the list."> Add sites manually </message> <message name="IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ACTIVE_SITE_ARIA_DESCRIPTION" desc="Accessibilty description which will be read by screen readers when focusing a currently opened site in the list under the first tab of the add exception dialog."> Active site </message> - <message name="IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_HELP" desc="Label for button that expands the tab discarding exceptions list to show all entries. Sites added to the list will not be discarded by memory saver."> - Sites you add will always stay active and memory won't be freed up from them. <ph name="BEGIN_LINK"><a href="$1" target="_blank"></ph>Learn more about site exclusion<ph name="END_LINK"></a></ph> + <message name="IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_HELP" desc="Help text shown on the second tab of the tab discarding exception list add dialog. Explains how to use the filter format to add an exclusion rule to the list."> + Sites you add will always stay active and memory won't be freed up from them. <ph name="BEGIN_LINK"><a href="$1" target="_blank"></ph>Learn more about keeping specific sites active<ph name="END_LINK"></a></ph> </message> <message name="IDS_SETTINGS_BATTERY_PAGE_TITLE" desc="Title of the power section of the performance settings page"> Power
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_CURRENT_TABS_EMPTY.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_CURRENT_TABS_EMPTY.png.sha1 new file mode 100644 index 0000000..570c9a4 --- /dev/null +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_CURRENT_TABS_EMPTY.png.sha1
@@ -0,0 +1 @@ +6122fd4e97db0099402ddad8ead1f6e99fcd2f0c \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_HELP.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_HELP.png.sha1 index c6888f5..cbdc8fd8 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_HELP.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_HELP.png.sha1
@@ -1 +1 @@ -0e408a985d2ea88335dcdfbc1b489df202e628a2 \ No newline at end of file +4d55ebc23d6713d4d8821e032d026e9d34561441 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_DESCRIPTION.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..7dfbc14d --- /dev/null +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +6a44e4ee7fa4aee7a5393db124ed66e96fcf7117 \ No newline at end of file
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index f2155f3a..cfd5433 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -2273,6 +2273,7 @@ "//components/reporting/encryption:encryption_module", "//components/reporting/encryption:encryption_module_interface", "//components/reporting/encryption:verification", + "//components/reporting/proto:configuration_file_proto", "//components/reporting/proto:record_constants", "//components/reporting/proto:record_proto", "//components/reporting/proto:status_proto", @@ -3711,7 +3712,6 @@ "enterprise/connectors/analysis/analysis_settings.h", "enterprise/connectors/analysis/content_analysis_delegate.cc", "enterprise/connectors/analysis/content_analysis_delegate.h", - "enterprise/connectors/analysis/content_analysis_delegate_base.cc", "enterprise/connectors/analysis/content_analysis_delegate_base.h", "enterprise/connectors/analysis/content_analysis_dialog.cc", "enterprise/connectors/analysis/content_analysis_dialog.h",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 2eb30f3..1ed206cd 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -4593,6 +4593,11 @@ flag_descriptions::kPullToRefreshDescription, kOsAura, MULTI_VALUE_TYPE(kPullToRefreshChoices)}, #endif // USE_AURA + {"overscroll-history-navigation-setting", + flag_descriptions::kOverscrollHistoryNavigationSettingName, + flag_descriptions::kOverscrollHistoryNavigationSettingDescription, + kOsDesktop, + FEATURE_VALUE_TYPE(features::kOverscrollHistoryNavigationSetting)}, {"enable-touch-drag-drop", flag_descriptions::kTouchDragDropName, flag_descriptions::kTouchDragDropDescription, kOsWin | kOsCrOS, ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop, @@ -5874,6 +5879,13 @@ kOmniboxModernizeVisualUpdateVariations, "OmniboxModernizeVisualUpdate")}, + {"omnibox-most-visited-tiles-horizontal-render-group", + flag_descriptions::kOmniboxMostVisitedTilesHorizontalRenderGroupName, + flag_descriptions:: + kOmniboxMostVisitedTilesHorizontalRenderGroupDescription, + kOsAndroid, + FEATURE_VALUE_TYPE(omnibox::kMostVisitedTilesHorizontalRenderGroup)}, + {"omnibox-suppress-clipboard-suggestion-after-first-used", flag_descriptions::kOmniboxSuppressClipboardSuggestionAfterFirstUsedName, flag_descriptions:: @@ -7573,6 +7585,10 @@ flag_descriptions::kFastPairLowPowerDescription, kOsCrOS, FEATURE_VALUE_TYPE(ash::features::kFastPairLowPower)}, + {"fast-pair-pwa-companion", flag_descriptions::kFastPairPwaCompanionName, + flag_descriptions::kFastPairPwaCompanionDescription, kOsCrOS, + FEATURE_VALUE_TYPE(ash::features::kFastPairPwaCompanion)}, + {"fast-pair-saved-devices", flag_descriptions::kFastPairSavedDevicesName, flag_descriptions::kFastPairSavedDevicesDescription, kOsCrOS, FEATURE_VALUE_TYPE(ash::features::kFastPairSavedDevices)},
diff --git a/chrome/browser/android/customtabs/branding/OWNERS b/chrome/browser/android/customtabs/branding/OWNERS index 54c4baf5..e32eb1f 100644 --- a/chrome/browser/android/customtabs/branding/OWNERS +++ b/chrome/browser/android/customtabs/branding/OWNERS
@@ -1 +1,3 @@ +kgrosu@google.com +sinansahin@google.com wenyufu@chromium.org
diff --git a/chrome/browser/android/omnibox/autocomplete_controller_android.cc b/chrome/browser/android/omnibox/autocomplete_controller_android.cc index 0fabfa7..67c6c20 100644 --- a/chrome/browser/android/omnibox/autocomplete_controller_android.cc +++ b/chrome/browser/android/omnibox/autocomplete_controller_android.cc
@@ -393,18 +393,21 @@ return false; } -void AutocompleteControllerAndroid::DeleteMatch(JNIEnv* env, jint match_index) { - const auto& match = autocomplete_controller_->result().match_at(match_index); - if (match.SupportsDeletion()) - autocomplete_controller_->DeleteMatch(match); +void AutocompleteControllerAndroid::DeleteMatch(JNIEnv* env, + uintptr_t match_ptr) { + const auto* match = reinterpret_cast<AutocompleteMatch*>(match_ptr); + if (match->SupportsDeletion()) { + autocomplete_controller_->DeleteMatch(*match); + } } void AutocompleteControllerAndroid::DeleteMatchElement(JNIEnv* env, - jint match_index, + uintptr_t match_ptr, jint element_index) { - const auto& match = autocomplete_controller_->result().match_at(match_index); - if (match.SupportsDeletion()) - autocomplete_controller_->DeleteMatchElement(match, element_index); + const auto* match = reinterpret_cast<AutocompleteMatch*>(match_ptr); + if (match->SupportsDeletion()) { + autocomplete_controller_->DeleteMatchElement(*match, element_index); + } } ScopedJavaLocalRef<jobject> AutocompleteControllerAndroid::
diff --git a/chrome/browser/android/omnibox/autocomplete_controller_android.h b/chrome/browser/android/omnibox/autocomplete_controller_android.h index 1c93a75..77d4bce6 100644 --- a/chrome/browser/android/omnibox/autocomplete_controller_android.h +++ b/chrome/browser/android/omnibox/autocomplete_controller_android.h
@@ -70,8 +70,8 @@ JNIEnv* env, jint match_index, const base::android::JavaParamRef<jobject>& j_web_contents); - void DeleteMatch(JNIEnv* env, jint match_index); - void DeleteMatchElement(JNIEnv* env, jint match_index, jint element_index); + void DeleteMatch(JNIEnv* env, uintptr_t match_ptr); + void DeleteMatchElement(JNIEnv* env, uintptr_t match_ptr, jint element_index); base::android::ScopedJavaLocalRef<jobject> UpdateMatchDestinationURLWithAdditionalAssistedQueryStats( JNIEnv* env,
diff --git a/chrome/browser/ash/dbus/encrypted_reporting_service_provider.cc b/chrome/browser/ash/dbus/encrypted_reporting_service_provider.cc index 3814a2b9..59c21537 100644 --- a/chrome/browser/ash/dbus/encrypted_reporting_service_provider.cc +++ b/chrome/browser/ash/dbus/encrypted_reporting_service_provider.cc
@@ -140,6 +140,23 @@ missive_client->GetWeakPtr())); } +// static +::reporting::UploadClient::UpdateConfigInMissiveCallback +EncryptedReportingServiceProvider::GetUpdateConfigInMissiveCallback() { + chromeos::MissiveClient* const missive_client = + chromeos::MissiveClient::Get(); + return base::BindPostTask( + missive_client->origin_task_runner(), + base::BindRepeating( + [](base::WeakPtr<chromeos::MissiveClient> missive_client, + ::reporting::ListOfBlockedDestinations destinations) { + if (missive_client) { + missive_client->UpdateConfigInMissive(std::move(destinations)); + } + }, + missive_client->GetWeakPtr())); +} + void EncryptedReportingServiceProvider::RequestUploadEncryptedRecords( dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender) {
diff --git a/chrome/browser/ash/dbus/encrypted_reporting_service_provider.h b/chrome/browser/ash/dbus/encrypted_reporting_service_provider.h index b09074b..8e0bc9a7 100644 --- a/chrome/browser/ash/dbus/encrypted_reporting_service_provider.h +++ b/chrome/browser/ash/dbus/encrypted_reporting_service_provider.h
@@ -66,6 +66,8 @@ GetReportSuccessUploadCallback(); static ::reporting::UploadClient::EncryptionKeyAttachedCallback GetEncryptionKeyAttachedCallback(); + static ::reporting::UploadClient::UpdateConfigInMissiveCallback + GetUpdateConfigInMissiveCallback(); // Returns true if called on the origin thread. bool OnOriginThread() const;
diff --git a/chrome/browser/autofill/address_normalizer_factory.cc b/chrome/browser/autofill/address_normalizer_factory.cc index 83eb3c3a..62d3969 100644 --- a/chrome/browser/autofill/address_normalizer_factory.cc +++ b/chrome/browser/autofill/address_normalizer_factory.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "build/build_config.h" #include "chrome/browser/autofill/validation_rules_storage_factory.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/net/system_network_context_manager.h" @@ -13,6 +14,11 @@ #include "third_party/libaddressinput/chromium/chrome_metadata_source.h" #include "third_party/libaddressinput/chromium/chrome_storage_impl.h" +#if BUILDFLAG(IS_ANDROID) +#include "base/android/scoped_java_ref.h" +#include "chrome/browser/autofill/android/jni_headers/AddressNormalizerFactory_jni.h" +#endif // BUILDFLAG(IS_ANDROID) + namespace autofill { // static @@ -36,4 +42,11 @@ AddressNormalizerFactory::~AddressNormalizerFactory() {} +#if BUILDFLAG(IS_ANDROID) +static base::android::ScopedJavaLocalRef<jobject> +JNI_AddressNormalizerFactory_GetInstance(JNIEnv* env) { + return AddressNormalizerFactory::GetInstance()->GetJavaObject(); +} +#endif // BUILDFLAG(IS_ANDROID) + } // namespace autofill
diff --git a/chrome/browser/autofill/android/BUILD.gn b/chrome/browser/autofill/android/BUILD.gn index d3acdbc..94dcc87 100644 --- a/chrome/browser/autofill/android/BUILD.gn +++ b/chrome/browser/autofill/android/BUILD.gn
@@ -12,6 +12,7 @@ android_library("java") { sources = [ + "java/src/org/chromium/chrome/browser/autofill/AddressNormalizerFactory.java", "java/src/org/chromium/chrome/browser/autofill/AutofillAddress.java", "java/src/org/chromium/chrome/browser/autofill/AutofillEditorBase.java", "java/src/org/chromium/chrome/browser/autofill/AutofillProfileBridge.java", @@ -117,6 +118,7 @@ generate_jni("jni_headers") { sources = [ + "java/src/org/chromium/chrome/browser/autofill/AddressNormalizerFactory.java", "java/src/org/chromium/chrome/browser/autofill/AutofillProfileBridge.java", "java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java", "java/src/org/chromium/chrome/browser/autofill/PhoneNumberUtil.java",
diff --git a/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/AddressNormalizerFactory.java b/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/AddressNormalizerFactory.java new file mode 100644 index 0000000..1279bff --- /dev/null +++ b/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/AddressNormalizerFactory.java
@@ -0,0 +1,26 @@ +// Copyright 2023 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.chrome.browser.autofill; + +import org.chromium.base.annotations.JNINamespace; +import org.chromium.base.annotations.NativeMethods; +import org.chromium.components.autofill.AddressNormalizer; + +/** + * Provides access to AddressNormalizer with the necessary //chrome dependencies. + */ +@JNINamespace("autofill") +public class AddressNormalizerFactory { + private AddressNormalizerFactory() {} + + public static AddressNormalizer getInstance() { + return AddressNormalizerFactoryJni.get().getInstance(); + } + + @NativeMethods + interface Natives { + AddressNormalizer getInstance(); + } +}
diff --git a/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java b/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java index 2c7025b..fd7bbe5b 100644 --- a/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java +++ b/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java
@@ -74,27 +74,6 @@ } /** - * Callback for normalized addresses. - */ - public interface NormalizedAddressRequestDelegate { - /** - * Called when the address has been sucessfully normalized. - * - * @param profile The profile with the normalized address. - */ - @CalledByNative("NormalizedAddressRequestDelegate") - void onAddressNormalized(AutofillProfile profile); - - /** - * Called when the address could not be normalized. - * - * @param profile The non normalized profile. - */ - @CalledByNative("NormalizedAddressRequestDelegate") - void onCouldNotNormalize(AutofillProfile profile); - } - - /** * Autofill credit card information. */ public static class CreditCard { @@ -741,17 +720,6 @@ } /** - * Starts loading the address validation rules for the specified {@code regionCode}. - * - * @param regionCode The code of the region for which to load the rules. - */ - public void loadRulesForAddressNormalization(String regionCode) { - ThreadUtils.assertOnUiThread(); - PersonalDataManagerJni.get().loadRulesForAddressNormalization( - mPersonalDataManagerAndroid, PersonalDataManager.this, regionCode); - } - - /** * Starts loading the sub-key request rules for the specified {@code regionCode}. * * @param regionCode The code of the region for which to load the rules. @@ -785,23 +753,6 @@ } /** - * Normalizes the address of the profile associated with the {@code guid} if the rules - * associated with the profile's region are done loading. Otherwise sets up the callback to - * start normalizing the address when the rules are loaded. The normalized profile will be sent - * to the {@code delegate}. If the profile is not normalized in the specified - * {@code sRequestTimeoutSeconds}, the {@code delegate} will be notified. - * - * @param profile The profile to normalize. - * @param delegate The object requesting the normalization. - */ - public void normalizeAddress( - AutofillProfile profile, NormalizedAddressRequestDelegate delegate) { - ThreadUtils.assertOnUiThread(); - PersonalDataManagerJni.get().startAddressNormalization(mPersonalDataManagerAndroid, - PersonalDataManager.this, profile, sRequestTimeoutSeconds, delegate); - } - - /** * Checks whether the Autofill PersonalDataManager has profiles. * * @return True If there are profiles. @@ -1078,13 +1029,8 @@ long nativePersonalDataManagerAndroid, PersonalDataManager caller); void clearUnmaskedCache( long nativePersonalDataManagerAndroid, PersonalDataManager caller, String guid); - void loadRulesForAddressNormalization(long nativePersonalDataManagerAndroid, - PersonalDataManager caller, String regionCode); void loadRulesForSubKeys(long nativePersonalDataManagerAndroid, PersonalDataManager caller, String regionCode); - void startAddressNormalization(long nativePersonalDataManagerAndroid, - PersonalDataManager caller, AutofillProfile profile, int timeoutSeconds, - NormalizedAddressRequestDelegate delegate); void startRegionSubKeysRequest(long nativePersonalDataManagerAndroid, PersonalDataManager caller, String regionCode, int timeoutSeconds, GetSubKeysRequestDelegate delegate);
diff --git a/chrome/browser/autofill/android/personal_data_manager_android.cc b/chrome/browser/autofill/android/personal_data_manager_android.cc index b02777f..0506ae0 100644 --- a/chrome/browser/autofill/android/personal_data_manager_android.cc +++ b/chrome/browser/autofill/android/personal_data_manager_android.cc
@@ -18,7 +18,6 @@ #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" #include "chrome/browser/android/resource_mapper.h" -#include "chrome/browser/autofill/address_normalizer_factory.h" #include "chrome/browser/autofill/android/jni_headers/PersonalDataManager_jni.h" #include "chrome/browser/autofill/autofill_popup_controller_utils.h" #include "chrome/browser/autofill/personal_data_manager_factory.h" @@ -28,7 +27,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/pref_names.h" -#include "components/autofill/core/browser/address_normalizer.h" #include "components/autofill/core/browser/autofill_data_util.h" #include "components/autofill/core/browser/autofill_experiments.h" #include "components/autofill/core/browser/autofill_type.h" @@ -79,21 +77,6 @@ base::android::ToJavaArrayOfStrings(env, subkeys_names)); } -void OnAddressNormalized(ScopedJavaGlobalRef<jobject> jdelegate, - bool success, - const AutofillProfile& profile) { - JNIEnv* env = base::android::AttachCurrentThread(); - if (success) { - Java_NormalizedAddressRequestDelegate_onAddressNormalized( - env, jdelegate, - profile.CreateJavaObject(g_browser_process->GetApplicationLocale())); - } else { - Java_NormalizedAddressRequestDelegate_onCouldNotNormalize( - env, jdelegate, - profile.CreateJavaObject(g_browser_process->GetApplicationLocale())); - } -} - } // namespace PersonalDataManagerAndroid::PersonalDataManagerAndroid(JNIEnv* env, jobject obj) @@ -604,14 +587,6 @@ personal_data_manager_->NotifyPersonalDataObserver(); } -void PersonalDataManagerAndroid::LoadRulesForAddressNormalization( - JNIEnv* env, - const base::android::JavaParamRef<jobject>& unused_obj, - const base::android::JavaParamRef<jstring>& jregion_code) { - AddressNormalizer* normalizer = AddressNormalizerFactory::GetInstance(); - normalizer->LoadRulesForRegion(ConvertJavaStringToUTF8(env, jregion_code)); -} - void PersonalDataManagerAndroid::LoadRulesForSubKeys( JNIEnv* env, const base::android::JavaParamRef<jobject>& unused_obj, @@ -620,23 +595,6 @@ ConvertJavaStringToUTF8(env, jregion_code)); } -void PersonalDataManagerAndroid::StartAddressNormalization( - JNIEnv* env, - const JavaParamRef<jobject>& unused_obj, - const JavaParamRef<jobject>& jprofile, - jint jtimeout_seconds, - const JavaParamRef<jobject>& jdelegate) { - AutofillProfile profile = AutofillProfile::CreateFromJavaObject( - jprofile, g_browser_process->GetApplicationLocale()); - - // Start the normalization. - AddressNormalizer* normalizer = AddressNormalizerFactory::GetInstance(); - normalizer->NormalizeAddressAsync( - profile, jtimeout_seconds, - base::BindOnce(&OnAddressNormalized, - ScopedJavaGlobalRef<jobject>(jdelegate))); -} - jboolean PersonalDataManagerAndroid::HasProfiles(JNIEnv* env) { return !personal_data_manager_->GetProfiles().empty(); }
diff --git a/chrome/browser/autofill/android/personal_data_manager_android.h b/chrome/browser/autofill/android/personal_data_manager_android.h index 812b677..e681c76 100644 --- a/chrome/browser/autofill/android/personal_data_manager_android.h +++ b/chrome/browser/autofill/android/personal_data_manager_android.h
@@ -312,16 +312,6 @@ JNIEnv* env, const base::android::JavaParamRef<jobject>& unused_obj); - // These functions help address normalization. - // -------------------- - - // Starts loading the address validation rules for the specified - // |region_code|. - void LoadRulesForAddressNormalization( - JNIEnv* env, - const base::android::JavaParamRef<jobject>& unused_obj, - const base::android::JavaParamRef<jstring>& region_code); - // Starts loading the rules for the specified |region_code| for the further // subkey request. void LoadRulesForSubKeys( @@ -329,19 +319,6 @@ const base::android::JavaParamRef<jobject>& unused_obj, const base::android::JavaParamRef<jstring>& region_code); - // Normalizes the address of the |jprofile| synchronously if the region rules - // have finished loading. Otherwise sets up the task to start the address - // normalization when the rules have finished loading. Also defines a time - // limit for the normalization, in which case the the |jdelegate| will be - // notified. If the rules are loaded before the timeout, |jdelegate| will - // receive the normalized profile. - void StartAddressNormalization( - JNIEnv* env, - const base::android::JavaParamRef<jobject>& unused_obj, - const base::android::JavaParamRef<jobject>& jprofile, - jint jtimeout_seconds, - const base::android::JavaParamRef<jobject>& jdelegate); - // Checks whether the Autofill PersonalDataManager has profiles. jboolean HasProfiles(JNIEnv* env);
diff --git a/chrome/browser/autofill/credit_card_accessory_controller_impl.cc b/chrome/browser/autofill/credit_card_accessory_controller_impl.cc index 05e08865..7f3726f 100644 --- a/chrome/browser/autofill/credit_card_accessory_controller_impl.cc +++ b/chrome/browser/autofill/credit_card_accessory_controller_impl.cc
@@ -328,8 +328,7 @@ void CreditCardAccessoryControllerImpl::OnCreditCardFetched( CreditCardFetchResult result, - const CreditCard* credit_card, - const std::u16string& cvc) { + const CreditCard* credit_card) { if (result != CreditCardFetchResult::kSuccess) return; content::RenderFrameHost* rfh = GetWebContents().GetFocusedFrame();
diff --git a/chrome/browser/autofill/credit_card_accessory_controller_impl.h b/chrome/browser/autofill/credit_card_accessory_controller_impl.h index aec86f48..93e3a33 100644 --- a/chrome/browser/autofill/credit_card_accessory_controller_impl.h +++ b/chrome/browser/autofill/credit_card_accessory_controller_impl.h
@@ -43,8 +43,7 @@ // CreditCardAccessManager::Accessor: void OnCreditCardFetched(CreditCardFetchResult result, - const CreditCard* credit_card, - const std::u16string& cvc) override; + const CreditCard* credit_card) override; static void CreateForWebContentsForTesting( content::WebContents* web_contents,
diff --git a/chrome/browser/autofill/credit_card_accessory_controller_impl_unittest.cc b/chrome/browser/autofill/credit_card_accessory_controller_impl_unittest.cc index 29585db1..323cab5 100644 --- a/chrome/browser/autofill/credit_card_accessory_controller_impl_unittest.cc +++ b/chrome/browser/autofill/credit_card_accessory_controller_impl_unittest.cc
@@ -69,7 +69,7 @@ void FetchCreditCard(const CreditCard* card, base::WeakPtr<Accessor> accessor) override { - accessor->OnCreditCardFetched(CreditCardFetchResult::kSuccess, card, u""); + accessor->OnCreditCardFetched(CreditCardFetchResult::kSuccess, card); } };
diff --git a/chrome/browser/autofill/mock_credit_card_accessory_controller.h b/chrome/browser/autofill/mock_credit_card_accessory_controller.h index a955cab..e2748db 100644 --- a/chrome/browser/autofill/mock_credit_card_accessory_controller.h +++ b/chrome/browser/autofill/mock_credit_card_accessory_controller.h
@@ -41,9 +41,7 @@ MOCK_METHOD(void, OnPersonalDataChanged, (), (override)); MOCK_METHOD(void, OnCreditCardFetched, - (autofill::CreditCardFetchResult, - const autofill::CreditCard*, - const std::u16string&), + (autofill::CreditCardFetchResult, const autofill::CreditCard*), (override)); };
diff --git a/chrome/browser/autofill/test/android/java/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java b/chrome/browser/autofill/test/android/java/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java index 1aa0d0e..ad32283 100644 --- a/chrome/browser/autofill/test/android/java/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java +++ b/chrome/browser/autofill/test/android/java/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java
@@ -11,6 +11,7 @@ import org.chromium.base.annotations.NativeMethods; import org.chromium.base.test.util.CallbackHelper; import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; +import org.chromium.components.autofill.AddressNormalizer; import org.chromium.components.autofill.AutofillProfile; import org.chromium.components.autofill.VirtualCardEnrollmentState; import org.chromium.content_public.browser.WebContents; @@ -34,7 +35,10 @@ } void setRequestTimeoutForTesting() { - runOnUiThreadBlocking(() -> PersonalDataManager.setRequestTimeoutForTesting(0)); + runOnUiThreadBlocking(() -> { + PersonalDataManager.setRequestTimeoutForTesting(0); + AddressNormalizer.setRequestTimeoutForTesting(0); + }); } void setSyncServiceForTesting() {
diff --git a/chrome/browser/chrome_browser_interface_binders.cc b/chrome/browser/chrome_browser_interface_binders.cc index 278973a..8e07bd8c 100644 --- a/chrome/browser/chrome_browser_interface_binders.cc +++ b/chrome/browser/chrome_browser_interface_binders.cc
@@ -1084,7 +1084,7 @@ ash::InternetConfigDialogUI, ash::InternetDetailDialogUI, ash::SetTimeUI, ash::BluetoothPairingDialogUI, nearby_share::NearbyShareDialogUI, ash::cloud_upload::CloudUploadUI, ash::office_fallback::OfficeFallbackUI, - ash::multidevice_setup::MultiDeviceSetupDialogUI, + ash::multidevice_setup::MultiDeviceSetupDialogUI, ash::ParentAccessUI, #endif NewTabPageUI, OmniboxPopupUI, BookmarksSidePanelUI, CustomizeChromeUI, InternalsUI, ReadingListUI, TabSearchUI, WebuiGalleryUI,
diff --git a/chrome/browser/companion/core/companion_url_builder.cc b/chrome/browser/companion/core/companion_url_builder.cc index 81faa1f..fbcaf63 100644 --- a/chrome/browser/companion/core/companion_url_builder.cc +++ b/chrome/browser/companion/core/companion_url_builder.cc
@@ -4,7 +4,7 @@ #include "chrome/browser/companion/core/companion_url_builder.h" -#include "base/base64.h" +#include "base/base64url.h" #include "chrome/browser/companion/core/companion_permission_utils.h" #include "chrome/browser/companion/core/constants.h" #include "chrome/browser/companion/core/proto/companion_url_params.pb.h" @@ -133,7 +133,9 @@ signin_delegate_->ShouldShowRegionSearchIPH()); std::string base64_encoded_proto; - base::Base64Encode(url_params.SerializeAsString(), &base64_encoded_proto); + base::Base64UrlEncode(url_params.SerializeAsString(), + base::Base64UrlEncodePolicy::OMIT_PADDING, + &base64_encoded_proto); return base64_encoded_proto; }
diff --git a/chrome/browser/companion/core/companion_url_builder_unittest.cc b/chrome/browser/companion/core/companion_url_builder_unittest.cc index bd80f4a..8911bf7 100644 --- a/chrome/browser/companion/core/companion_url_builder_unittest.cc +++ b/chrome/browser/companion/core/companion_url_builder_unittest.cc
@@ -4,7 +4,7 @@ #include "chrome/browser/companion/core/companion_url_builder.h" -#include "base/base64.h" +#include "base/base64url.h" #include "base/logging.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/companion/core/constants.h" @@ -92,10 +92,12 @@ // Deserialize the query param into proto::CompanionUrlParams. proto::CompanionUrlParams DeserializeCompanionRequest( const std::string& companion_url_param) { + std::string serialized_proto; + EXPECT_TRUE(base::Base64UrlDecode( + companion_url_param, base::Base64UrlDecodePolicy::DISALLOW_PADDING, + &serialized_proto)); + companion::proto::CompanionUrlParams proto; - auto base64_decoded = base::Base64Decode(companion_url_param); - auto serialized_proto = std::string(base64_decoded.value().begin(), - base64_decoded.value().end()); EXPECT_TRUE(proto.ParseFromString(serialized_proto)); return proto; }
diff --git a/chrome/browser/companion/core/features.cc b/chrome/browser/companion/core/features.cc index a3b21fbc..9b73d8b 100644 --- a/chrome/browser/companion/core/features.cc +++ b/chrome/browser/companion/core/features.cc
@@ -41,6 +41,12 @@ BASE_FEATURE(kCompanionEnableSearchWebInNewTabContextMenuItem, "CompanionEnableSearchWebInNewTabContextMenuItem", base::FEATURE_ENABLED_BY_DEFAULT); + +// When search companion is enabled, show new badges on the context menu items +// that open the companion. +BASE_FEATURE(kCompanionEnableNewBadgesInContextMenu, + "CompanionEnableNewBadgesInContextMenu", + base::FEATURE_ENABLED_BY_DEFAULT); } // namespace features namespace switches {
diff --git a/chrome/browser/companion/core/features.h b/chrome/browser/companion/core/features.h index 0a11c873..4ea2fcd 100644 --- a/chrome/browser/companion/core/features.h +++ b/chrome/browser/companion/core/features.h
@@ -20,6 +20,7 @@ } // namespace internal BASE_DECLARE_FEATURE(kCompanionEnableSearchWebInNewTabContextMenuItem); +BASE_DECLARE_FEATURE(kCompanionEnableNewBadgesInContextMenu); } // namespace features namespace switches {
diff --git a/chrome/browser/download/bubble/download_bubble_ui_controller.cc b/chrome/browser/download/bubble/download_bubble_ui_controller.cc index d3e00826..68a6959 100644 --- a/chrome/browser/download/bubble/download_bubble_ui_controller.cc +++ b/chrome/browser/download/bubble/download_bubble_ui_controller.cc
@@ -274,6 +274,8 @@ case DownloadCommands::ALWAYS_OPEN_TYPE: case DownloadCommands::CANCEL_DEEP_SCAN: case DownloadCommands::LEARN_MORE_SCANNING: + case DownloadCommands::LEARN_MORE_DOWNLOAD_BLOCKED: + case DownloadCommands::OPEN_SAFE_BROWSING_SETTING: return true; case DownloadCommands::DEEP_SCAN: return !base::FeatureList::IsEnabled(
diff --git a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc index 1adac63..0257b1e7 100644 --- a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc +++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
@@ -227,9 +227,6 @@ } bool ContentAnalysisDelegate::BypassRequiresJustification() const { - if (!base::FeatureList::IsEnabled(kBypassJustificationEnabled)) - return false; - return data_.settings.tags.count(final_result_tag_) && data_.settings.tags.at(final_result_tag_).requires_justification; }
diff --git a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_base.cc b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_base.cc deleted file mode 100644 index bf03042..0000000 --- a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_base.cc +++ /dev/null
@@ -1,13 +0,0 @@ -// 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/enterprise/connectors/analysis/content_analysis_delegate_base.h" - -namespace enterprise_connectors { - -BASE_FEATURE(kBypassJustificationEnabled, - "kBypassJustificationEnabled", - base::FEATURE_ENABLED_BY_DEFAULT); - -} // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_base.h b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_base.h index e2156f6..605b1c8 100644 --- a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_base.h +++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_base.h
@@ -11,8 +11,6 @@ namespace enterprise_connectors { -BASE_DECLARE_FEATURE(kBypassJustificationEnabled); - class ContentAnalysisDelegateBase { public: virtual ~ContentAnalysisDelegateBase() = default;
diff --git a/chrome/browser/enterprise/connectors/analysis/content_analysis_dialog_browsertest.cc b/chrome/browser/enterprise/connectors/analysis/content_analysis_dialog_browsertest.cc index 15b66319..8d46556b 100644 --- a/chrome/browser/enterprise/connectors/analysis/content_analysis_dialog_browsertest.cc +++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_dialog_browsertest.cc
@@ -776,7 +776,6 @@ class ContentAnalysisDialogPlainTests : public InProcessBrowserTest { public: ContentAnalysisDialogPlainTests() { - scoped_feature_list_.InitAndEnableFeature(kBypassJustificationEnabled); ContentAnalysisDialog::SetShowDialogDelayForTesting(kNoDelay); } void OpenCallback() { ++times_open_called_; } @@ -873,7 +872,6 @@ private: raw_ptr<ContentAnalysisDialog, DanglingUntriaged> dialog_; - base::test::ScopedFeatureList scoped_feature_list_; }; IN_PROC_BROWSER_TEST_F(ContentAnalysisDialogPlainTests, TestCustomMessage) {
diff --git a/chrome/browser/enterprise/connectors/analysis/content_analysis_downloads_delegate.cc b/chrome/browser/enterprise/connectors/analysis/content_analysis_downloads_delegate.cc index 618e016..c5ead23c 100644 --- a/chrome/browser/enterprise/connectors/analysis/content_analysis_downloads_delegate.cc +++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_downloads_delegate.cc
@@ -82,9 +82,6 @@ } bool ContentAnalysisDownloadsDelegate::BypassRequiresJustification() const { - if (!base::FeatureList::IsEnabled(kBypassJustificationEnabled)) - return false; - return bypass_justification_required_; }
diff --git a/chrome/browser/extensions/api/scripting/scripting_api.cc b/chrome/browser/extensions/api/scripting/scripting_api.cc index 5d440d99..ced4382 100644 --- a/chrome/browser/extensions/api/scripting/scripting_api.cc +++ b/chrome/browser/extensions/api/scripting/scripting_api.cc
@@ -918,7 +918,8 @@ // Create script ids for dynamic content scripts. std::string error; - std::set<std::string> existing_script_ids = loader->GetDynamicScriptIDs(); + std::set<std::string> existing_script_ids = + loader->GetDynamicScriptIDs(UserScript::Source::kDynamicContentScript); std::set<std::string> new_script_ids = scripting::CreateDynamicScriptIds( scripts, UserScript::Source::kDynamicContentScript, existing_script_ids, &error); @@ -1098,6 +1099,7 @@ // the list of scripts ids to remove. if (!filter || !filter->ids || filter->ids->empty()) { loader->ClearDynamicScripts( + UserScript::Source::kDynamicContentScript, base::BindOnce(&ScriptingUnregisterContentScriptsFunction:: OnContentScriptsUnregistered, this)); @@ -1105,7 +1107,8 @@ } std::set<std::string> ids_to_remove; - std::set<std::string> existing_script_ids = loader->GetDynamicScriptIDs(); + std::set<std::string> existing_script_ids = + loader->GetDynamicScriptIDs(UserScript::Source::kDynamicContentScript); std::string error; for (const auto& provided_id : *filter->ids) { @@ -1175,8 +1178,10 @@ loaded_scripts_metadata; const UserScriptList& dynamic_scripts = loader->GetLoadedDynamicScripts(); for (const std::unique_ptr<UserScript>& script : dynamic_scripts) { - loaded_scripts_metadata.emplace(script->id(), - CreateRegisteredContentScriptInfo(*script)); + if (script->GetSource() == UserScript::Source::kDynamicContentScript) { + loaded_scripts_metadata.emplace( + script->id(), CreateRegisteredContentScriptInfo(*script)); + } } std::set<std::string> ids_to_update;
diff --git a/chrome/browser/extensions/api/scripting/scripting_apitest.cc b/chrome/browser/extensions/api/scripting/scripting_apitest.cc index abe0c43..2f86e914 100644 --- a/chrome/browser/extensions/api/scripting/scripting_apitest.cc +++ b/chrome/browser/extensions/api/scripting/scripting_apitest.cc
@@ -21,6 +21,7 @@ #include "extensions/browser/api_test_utils.h" #include "extensions/browser/background_script_executor.h" #include "extensions/browser/disable_reason.h" +#include "extensions/common/extension_features.h" #include "extensions/common/features/feature_channel.h" #include "extensions/common/utils/content_script_utils.h" #include "extensions/test/extension_test_message_listener.h" @@ -550,4 +551,30 @@ ASSERT_TRUE(RunExtensionTest("scripting/prerendering")) << message_; } +class ScriptingAndUserScriptsAPITest : public ScriptingAPITest { + public: + ScriptingAndUserScriptsAPITest() { + scoped_feature_list_.InitAndEnableFeature( + extensions_features::kApiUserScripts); + } + ScriptingAndUserScriptsAPITest(const ScriptingAndUserScriptsAPITest&) = + delete; + ScriptingAndUserScriptsAPITest& operator=( + const ScriptingAndUserScriptsAPITest&) = delete; + ~ScriptingAndUserScriptsAPITest() override = default; + + private: + // The userScripts API is currently behind a channel and feature restriction. + // TODO(crbug.com/1472902): Remove channel override when user scripts API goes + // to stable. + ScopedCurrentChannel current_channel_override_{ + version_info::Channel::UNKNOWN}; + base::test::ScopedFeatureList scoped_feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(ScriptingAndUserScriptsAPITest, + ScriptingAPIDoesNotAffectUserScripts) { + ASSERT_TRUE(RunExtensionTest("scripting/dynamic_user_scripts")) << message_; +} + } // namespace extensions
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index f46b918a..05f0adc6 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -2039,7 +2039,7 @@ { "name": "enable-android-gamepad-vibration", "owners": [ "deviceapi-team@google.com" ], - "expiry_milestone": 115 + "expiry_milestone": 130 }, { "name": "enable-app-service-in-kiosk", @@ -4192,6 +4192,14 @@ "expiry_milestone": 116 }, { + "name": "fast-pair-pwa-companion", + "owners": [ + "//ash/quick_pair/OWNERS", + "gschen" + ], + "expiry_milestone": 125 + }, + { "name": "fast-pair-saved-devices", "owners": [ "//ash/quick_pair/OWNERS", @@ -6118,6 +6126,11 @@ "expiry_milestone": 120 }, { + "name": "omnibox-most-visited-tiles-horizontal-render-group", + "owners": [ "ender", "chrome-mobile-search@google.com"], + "expiry_milestone": 130 + }, + { "name": "omnibox-most-visited-tiles-on-srp", "owners": [ "stkhapugin", "ender", "chrome-omnibox-team@google.com" ], "expiry_milestone": 120 @@ -6426,6 +6439,11 @@ "expiry_milestone": 118 }, { + "name": "overscroll-history-navigation-setting", + "owners": [ "charlesmeng" ], + "expiry_milestone": 120 + }, + { // Suggests the Ozone platform to use (desktop Linux only). Can be set on // chrome://flags. See https://crbug.com/1246928. "name": "ozone-platform-hint",
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 652ec88..37efccd 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -2380,6 +2380,12 @@ "Display a list of frequently visited pages from history as a single row " "with a carousel instead of one URL per line."; +const char kOmniboxMostVisitedTilesHorizontalRenderGroupName[] = + "Omnibox MV Tiles Horizontal Render Group"; +const char kOmniboxMostVisitedTilesHorizontalRenderGroupDescription[] = + "Updates the logic constructing MV tiles to use horizontal render group. " + "No user-facing changes expected."; + const char kOmniboxRedoCurrentMatchName[] = "Omnibox redo current match"; const char kOmniboxRedoCurrentMatchDescription[] = "Use an alternative implementation of calculating the cached omnibox " @@ -2649,6 +2655,11 @@ const char kOverscrollHistoryNavigationName[] = "Overscroll history navigation"; const char kOverscrollHistoryNavigationDescription[] = "History navigation in response to horizontal overscroll."; +const char kOverscrollHistoryNavigationSettingName[] = + "Overscroll history navigation setting"; +const char kOverscrollHistoryNavigationSettingDescription[] = + "Whether to show a setting in chrome://settings/accessibility that " + "controls whether horizontal overscroll triggers history navigation."; const char kOverviewButtonName[] = "Overview button at the status area"; const char kOverviewButtonDescription[] = @@ -5808,6 +5819,10 @@ "continously. This results in lower power usage, but also higher latency " "for device discovery."; +const char kFastPairPwaCompanionName[] = "Enable Fast Pair Web Companion"; +const char kFastPairPwaCompanionDescription[] = + "Enables Fast Pair Web Companion link after device pairing."; + const char kFastPairSoftwareScanningName[] = "Enable Fast Pair Software Scanning"; const char kFastPairSoftwareScanningDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index d0b4344a..1e04dac 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1370,6 +1370,9 @@ extern const char kOmniboxMostVisitedTilesName[]; extern const char kOmniboxMostVisitedTilesDescription[]; +extern const char kOmniboxMostVisitedTilesHorizontalRenderGroupName[]; +extern const char kOmniboxMostVisitedTilesHorizontalRenderGroupDescription[]; + extern const char kOmniboxMostVisitedTilesTitleWrapAroundName[]; extern const char kOmniboxMostVisitedTilesTitleWrapAroundDescription[]; @@ -1514,6 +1517,8 @@ extern const char kOverscrollHistoryNavigationName[]; extern const char kOverscrollHistoryNavigationDescription[]; +extern const char kOverscrollHistoryNavigationSettingName[]; +extern const char kOverscrollHistoryNavigationSettingDescription[]; extern const char kPageContentAnnotationsName[]; extern const char kPageContentAnnotationsDescription[]; @@ -3349,6 +3354,9 @@ extern const char kFastPairLowPowerName[]; extern const char kFastPairLowPowerDescription[]; +extern const char kFastPairPwaCompanionName[]; +extern const char kFastPairPwaCompanionDescription[]; + extern const char kFastPairSoftwareScanningName[]; extern const char kFastPairSoftwareScanningDescription[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc index 4addcd5..e05cf0a1 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -350,6 +350,7 @@ &offline_pages::kOfflinePagesDescriptiveFailStatusFeature, &offline_pages::kOfflinePagesDescriptivePendingStatusFeature, &offline_pages::kOfflinePagesLivePageSharingFeature, + &omnibox::kMostVisitedTilesHorizontalRenderGroup, &omnibox::kOmniboxMatchToolbarAndStatusBarColor, &omnibox::kOmniboxModernizeVisualUpdate, &omnibox::kOmniboxOnClobberFocusTypeOnContent,
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 2be94780..4e9005f7 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
@@ -334,7 +334,8 @@ public static final String OMNIBOX_MATCH_TOOLBAR_AND_STATUS_BAR_COLOR = "OmniboxMatchToolbarAndStatusBarColor"; public static final String OMNIBOX_MODERNIZE_VISUAL_UPDATE = "OmniboxModernizeVisualUpdate"; - + public static final String OMNIBOX_MOST_VISITED_TILES_HORIZONTAL_RENDER_GROUP = + "OmniboxMostVisitedTilesHorizontalRenderGroup"; public static final String OMNIBOX_NOOP_EDIT_URL_SUGGESTION_CLICKS = "OmniboxNoopEditUrlSuggestionClicks"; public static final String AVOID_RELAYOUT_DURING_FOCUS_ANIMATION =
diff --git a/chrome/browser/net/dns_probe_service_factory.cc b/chrome/browser/net/dns_probe_service_factory.cc index 6979742..a51d4185 100644 --- a/chrome/browser/net/dns_probe_service_factory.cc +++ b/chrome/browser/net/dns_probe_service_factory.cc
@@ -406,9 +406,10 @@ DnsProbeServiceFactory::~DnsProbeServiceFactory() = default; -KeyedService* DnsProbeServiceFactory::BuildServiceInstanceFor( +std::unique_ptr<KeyedService> +DnsProbeServiceFactory::BuildServiceInstanceForBrowserContext( content::BrowserContext* context) const { - return new DnsProbeServiceImpl(context); + return std::make_unique<DnsProbeServiceImpl>(context); } // static
diff --git a/chrome/browser/net/dns_probe_service_factory.h b/chrome/browser/net/dns_probe_service_factory.h index a4fa505..53850d8d 100644 --- a/chrome/browser/net/dns_probe_service_factory.h +++ b/chrome/browser/net/dns_probe_service_factory.h
@@ -63,7 +63,7 @@ ~DnsProbeServiceFactory() override; // BrowserContextKeyedServiceFactory implementation: - KeyedService* BuildServiceInstanceFor( + std::unique_ptr<KeyedService> BuildServiceInstanceForBrowserContext( content::BrowserContext* context) const override; };
diff --git a/chrome/browser/notifications/notification_platform_bridge_mac.cc b/chrome/browser/notifications/notification_platform_bridge_mac.cc index 4558fe36..21daa99d 100644 --- a/chrome/browser/notifications/notification_platform_bridge_mac.cc +++ b/chrome/browser/notifications/notification_platform_bridge_mac.cc
@@ -88,18 +88,33 @@ dispatcher = is_alert ? alert_dispatcher_.get() : banner_dispatcher_.get(); } dispatcher->DisplayNotification(notification_type, profile, notification); + CloseImpl(profile, notification.id(), dispatcher); } void NotificationPlatformBridgeMac::Close(Profile* profile, const std::string& notification_id) { + CloseImpl(profile, notification_id); +} + +void NotificationPlatformBridgeMac::CloseImpl( + Profile* profile, + const std::string& notification_id, + NotificationDispatcherMac* excluded_dispatcher) { std::string profile_id = GetProfileId(profile); bool incognito = profile->IsOffTheRecord(); - banner_dispatcher_->CloseNotificationWithId( - {notification_id, profile_id, incognito}); - alert_dispatcher_->CloseNotificationWithId( - {notification_id, profile_id, incognito}); + if (banner_dispatcher_.get() != excluded_dispatcher) { + banner_dispatcher_->CloseNotificationWithId( + {notification_id, profile_id, incognito}); + } + if (alert_dispatcher_.get() != excluded_dispatcher) { + alert_dispatcher_->CloseNotificationWithId( + {notification_id, profile_id, incognito}); + } for (auto& [app_id, dispatcher] : app_specific_dispatchers_) { + if (dispatcher.get() == excluded_dispatcher) { + continue; + } dispatcher->CloseNotificationWithId( {notification_id, profile_id, incognito}); }
diff --git a/chrome/browser/notifications/notification_platform_bridge_mac.h b/chrome/browser/notifications/notification_platform_bridge_mac.h index 66e6ec7..0daa927 100644 --- a/chrome/browser/notifications/notification_platform_bridge_mac.h +++ b/chrome/browser/notifications/notification_platform_bridge_mac.h
@@ -48,6 +48,13 @@ void DisplayServiceShutDown(Profile* profile) override; private: + // Closes the notification with the given `notification_id` and `profile` in + // every dispatcher except `excluded_dispatcher`. Pass nullptr to + // `excluded_dispatcher` to close the notification everywhere. + void CloseImpl(Profile* profile, + const std::string& notification_id, + NotificationDispatcherMac* excluded_dispatcher = nullptr); + // Closes all notifications for the given |profile|. void CloseAllNotificationsForProfile(Profile* profile);
diff --git a/chrome/browser/notifications/notification_platform_bridge_mac_unittest.cc b/chrome/browser/notifications/notification_platform_bridge_mac_unittest.cc index 21cb2d60..e2b21b5 100644 --- a/chrome/browser/notifications/notification_platform_bridge_mac_unittest.cc +++ b/chrome/browser/notifications/notification_platform_bridge_mac_unittest.cc
@@ -292,6 +292,53 @@ EXPECT_EQ(expected, delivered_notification->title); } +TEST_F(NotificationPlatformBridgeMacTest, + TestDisplayUpdatesExistingNotification) { + std::unique_ptr<Notification> notification = CreateNotification( + "Title", "Context", "https://gmail.com", nullptr, nullptr, + /*require_interaction=*/false, /*show_settings_button=*/false); + + auto bridge = std::make_unique<NotificationPlatformBridgeMac>( + CreateBannerDispatcher(), CreateAlertDispatcher(), + CreateWebAppDispatcherFactory()); + bridge->Display(NotificationHandler::Type::WEB_PERSISTENT, profile(), + *notification, nullptr); + + { + const auto& notifications = banner_dispatcher()->notifications(); + ASSERT_EQ(1u, notifications.size()); + EXPECT_TRUE(alert_dispatcher()->notifications().empty()); + const auto& delivered_notification = notifications[0]; + EXPECT_EQ(u"Title", delivered_notification->title); + } + + notification = CreateNotification( + "New Title", "Context", "https://gmail.com", nullptr, nullptr, + /*require_interaction=*/false, /*show_settings_button=*/false); + bridge->Display(NotificationHandler::Type::WEB_PERSISTENT, profile(), + *notification, nullptr); + { + const auto& notifications = banner_dispatcher()->notifications(); + ASSERT_EQ(1u, notifications.size()); + EXPECT_TRUE(alert_dispatcher()->notifications().empty()); + const auto& delivered_notification = notifications[0]; + EXPECT_EQ(u"New Title", delivered_notification->title); + } + + notification = CreateNotification( + "New Title", "Context", "https://gmail.com", nullptr, nullptr, + /*require_interaction=*/true, /*show_settings_button=*/false); + bridge->Display(NotificationHandler::Type::WEB_PERSISTENT, profile(), + *notification, nullptr); + { + const auto& notifications = alert_dispatcher()->notifications(); + ASSERT_EQ(1u, notifications.size()); + EXPECT_TRUE(banner_dispatcher()->notifications().empty()); + const auto& delivered_notification = notifications[0]; + EXPECT_EQ(u"New Title", delivered_notification->title); + } +} + TEST_F(NotificationPlatformBridgeMacTest, TestCloseNotification) { std::unique_ptr<Notification> notification = CreateBanner( "Title", "Context", "https://gmail.com", "Button 1", nullptr); @@ -546,3 +593,31 @@ bridge->Close(profile(), "notification_id1"); EXPECT_EQ(0u, app_dispatcher->notifications().size()); } + +TEST_F(NotificationPlatformBridgeMacTestWithNotificationAttribution, + DisplayMovesNotificationToWebApp) { + const char* const kWebAppId = "webappid"; + std::unique_ptr<Notification> banner = + CreateBanner("Title", "Context", "https://gmail.com", "Button 1", nullptr, + /*web_app_id=*/nullptr); + auto bridge = std::make_unique<NotificationPlatformBridgeMac>( + CreateBannerDispatcher(), CreateAlertDispatcher(), + CreateWebAppDispatcherFactory()); + bridge->Display(NotificationHandler::Type::WEB_PERSISTENT, profile(), + Notification("notification_id1", *banner), nullptr); + + EXPECT_FALSE(dispatcher_for_web_app(kWebAppId)); + EXPECT_TRUE(alert_dispatcher()->notifications().empty()); + EXPECT_EQ(1u, banner_dispatcher()->notifications().size()); + + banner = CreateBanner("Title", "Context", "https://gmail.com", "Button 1", + nullptr, kWebAppId); + bridge->Display(NotificationHandler::Type::WEB_PERSISTENT, profile(), + Notification("notification_id1", *banner), nullptr); + + auto* app_dispatcher = dispatcher_for_web_app(kWebAppId); + ASSERT_TRUE(app_dispatcher); + EXPECT_EQ(1u, app_dispatcher->notifications().size()); + EXPECT_TRUE(alert_dispatcher()->notifications().empty()); + EXPECT_TRUE(banner_dispatcher()->notifications().empty()); +}
diff --git a/chrome/browser/notifications/stub_notification_dispatcher_mac.cc b/chrome/browser/notifications/stub_notification_dispatcher_mac.cc index 3e27eed..6325183c 100644 --- a/chrome/browser/notifications/stub_notification_dispatcher_mac.cc +++ b/chrome/browser/notifications/stub_notification_dispatcher_mac.cc
@@ -12,7 +12,9 @@ #include "base/containers/flat_set.h" #include "base/functional/callback.h" +#include "chrome/browser/notifications/notification_platform_bridge.h" #include "chrome/browser/notifications/notification_platform_bridge_mac_utils.h" +#include "chrome/browser/profiles/profile.h" StubNotificationDispatcherMac::StubNotificationDispatcherMac() = default; @@ -22,6 +24,9 @@ NotificationHandler::Type notification_type, Profile* profile, const message_center::Notification& notification) { + CloseNotificationWithId({notification.id(), + NotificationPlatformBridge::GetProfileId(profile), + profile->IsOffTheRecord()}); notifications_.push_back( CreateMacNotification(notification_type, profile, notification)); }
diff --git a/chrome/browser/picture_in_picture/auto_pip_setting_helper.cc b/chrome/browser/picture_in_picture/auto_pip_setting_helper.cc index 7c015e9c..8e6c2d2 100644 --- a/chrome/browser/picture_in_picture/auto_pip_setting_helper.cc +++ b/chrome/browser/picture_in_picture/auto_pip_setting_helper.cc
@@ -4,17 +4,44 @@ #include "chrome/browser/picture_in_picture/auto_pip_setting_helper.h" +#include "chrome/browser/content_settings/host_content_settings_map_factory.h" +#include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings.h" +#include "content/public/browser/web_contents.h" -AutoPipSettingHelper::AutoPipSettingHelper(GURL origin, +// static +std::unique_ptr<AutoPipSettingHelper> +AutoPipSettingHelper::CreateForWebContents(content::WebContents* web_contents, + base::OnceClosure close_pip_cb) { + auto* settings_map = HostContentSettingsMapFactory::GetForProfile( + web_contents->GetBrowserContext()); + return std::make_unique<AutoPipSettingHelper>( + web_contents->GetLastCommittedURL(), settings_map, + std::move(close_pip_cb)); +} + +AutoPipSettingHelper::AutoPipSettingHelper(const GURL& origin, + HostContentSettingsMap* settings_map, base::OnceClosure close_pip_cb) - : origin_(origin), close_pip_cb_(std::move(close_pip_cb)) {} + : origin_(origin), + settings_map_(settings_map), + close_pip_cb_(std::move(close_pip_cb)) {} AutoPipSettingHelper::~AutoPipSettingHelper() = default; ContentSetting AutoPipSettingHelper::GetEffectiveContentSetting() { - // TODO(crbug.com/1464065): Fetch the content setting. - return content_setting_override_.value_or(CONTENT_SETTING_ASK); + return settings_map_->GetContentSetting( + origin_, /*secondary_url=*/GURL(), + ContentSettingsType::AUTO_PICTURE_IN_PICTURE); +} + +void AutoPipSettingHelper::UpdateContentSetting(ContentSetting new_setting) { + content_settings::ContentSettingConstraints constraints; + constraints.set_session_model(content_settings::SessionModel::Durable); + + settings_map_->SetContentSettingDefaultScope( + origin_, /*secondary_url=*/GURL(), + ContentSettingsType::AUTO_PICTURE_IN_PICTURE, new_setting, constraints); } std::unique_ptr<views::View> AutoPipSettingHelper::CreateOverlayViewIfNeeded() { @@ -39,10 +66,17 @@ void AutoPipSettingHelper::OnUiResult( AutoPipSettingOverlayView::UiResult result) { - // TODO(crbug.com/1464065): Update the content setting. - - // If the user selected 'Block', then also close the pip window. - if (result == AutoPipSettingOverlayView::UiResult::kBlock) { - std::move(close_pip_cb_).Run(); + switch (result) { + case AutoPipSettingOverlayView::UiResult::kBlock: + UpdateContentSetting(CONTENT_SETTING_BLOCK); + // Also close the pip window. + std::move(close_pip_cb_).Run(); + break; + case AutoPipSettingOverlayView::UiResult::kAllow: + UpdateContentSetting(CONTENT_SETTING_ALLOW); + break; + case AutoPipSettingOverlayView::UiResult::kDismissed: + // Leave at 'ASK'. + break; } }
diff --git a/chrome/browser/picture_in_picture/auto_pip_setting_helper.h b/chrome/browser/picture_in_picture/auto_pip_setting_helper.h index 0b2db2c..9da9f22d 100644 --- a/chrome/browser/picture_in_picture/auto_pip_setting_helper.h +++ b/chrome/browser/picture_in_picture/auto_pip_setting_helper.h
@@ -11,17 +11,31 @@ #include "components/content_settings/core/common/content_settings.h" #include "url/gurl.h" +namespace content { +class WebContents; +} // namespace content + namespace views { class View; } // namespace views +class HostContentSettingsMap; + // Helper class to manage the content setting for AutoPiP, including the // permissions embargo. class AutoPipSettingHelper { public: + // Convenience function. + static std::unique_ptr<AutoPipSettingHelper> CreateForWebContents( + content::WebContents* web_contents, + base::OnceClosure close_pip_cb); + // We'll use `close_pip_cb` to close the pip window as needed. It should be - // safe to call at any time. - AutoPipSettingHelper(GURL origin, base::OnceClosure close_pip_cb); + // safe to call at any time. It is up to our caller to make sure that we are + // destroyed if `settings_map` is. + AutoPipSettingHelper(const GURL& origin, + HostContentSettingsMap* settings_map, + base::OnceClosure close_pip_cb); ~AutoPipSettingHelper(); AutoPipSettingHelper(const AutoPipSettingHelper&) = delete; @@ -33,26 +47,21 @@ // call `close_pip_cb_` if AutoPiP is blocked. std::unique_ptr<views::View> CreateOverlayViewIfNeeded(); - // If called, pretend that the content setting is `setting`. This is - // temporary until we actually check content settings. - void override_content_setting_for_testing(ContentSetting setting) { - content_setting_override_ = setting; - } - private: // Returns the content setting, modified as needed by any embargo. ContentSetting GetEffectiveContentSetting(); + // Update the content setting to `new_setting`, and clear any embargo. + void UpdateContentSetting(ContentSetting new_setting); + // Notify us that the user has interacted with the content settings UI that's // displayed in the pip window. void OnUiResult(AutoPipSettingOverlayView::UiResult result); GURL origin_; + const raw_ptr<HostContentSettingsMap> settings_map_ = nullptr; base::OnceClosure close_pip_cb_; - // Set for testing. - absl::optional<ContentSetting> content_setting_override_; - base::WeakPtrFactory<AutoPipSettingHelper> weak_factory_{this}; };
diff --git a/chrome/browser/picture_in_picture/auto_pip_setting_helper_unittest.cc b/chrome/browser/picture_in_picture/auto_pip_setting_helper_unittest.cc index b194400..16a26e05 100644 --- a/chrome/browser/picture_in_picture/auto_pip_setting_helper_unittest.cc +++ b/chrome/browser/picture_in_picture/auto_pip_setting_helper_unittest.cc
@@ -10,6 +10,8 @@ #include "base/memory/raw_ptr.h" #include "base/test/mock_callback.h" #include "chrome/browser/picture_in_picture/auto_pip_setting_overlay_view.h" +#include "components/content_settings/core/browser/host_content_settings_map.h" +#include "components/sync_preferences/testing_pref_service_syncable.h" #include "testing/gmock/include/gmock/gmock.h" #include "ui/events/test/event_generator.h" #include "ui/views/test/views_test_base.h" @@ -25,8 +27,13 @@ widget_ = CreateTestWidget(); widget_->Show(); - setting_helper_ = - std::make_unique<AutoPipSettingHelper>(GURL(), close_cb_.Get()); + HostContentSettingsMap::RegisterProfilePrefs(prefs_.registry()); + settings_map_ = base::MakeRefCounted<HostContentSettingsMap>( + &prefs_, false /* is_off_the_record */, false /* store_last_modified */, + false /* restore_session */, true /* should_record_metrics */); + + setting_helper_ = std::make_unique<AutoPipSettingHelper>( + origin_, settings_map_.get(), close_cb_.Get()); event_generator_ = std::make_unique<ui::test::EventGenerator>( views::GetRootWindow(widget_.get())); @@ -37,6 +44,7 @@ widget_.reset(); setting_helper_.reset(); ViewsTestBase::TearDown(); + settings_map_->ShutdownOnUIThread(); } void click_allow() const { @@ -68,48 +76,72 @@ } } + void set_content_setting(ContentSetting new_setting) { + settings_map_->SetContentSettingDefaultScope( + origin_, GURL(), ContentSettingsType::AUTO_PICTURE_IN_PICTURE, + new_setting); + } + + ContentSetting get_content_setting() { + return settings_map_->GetContentSetting( + origin_, GURL(), ContentSettingsType::AUTO_PICTURE_IN_PICTURE); + } + private: base::MockOnceCallback<void()> close_cb_; - std::unique_ptr<AutoPipSettingHelper> setting_helper_; std::unique_ptr<views::Widget> widget_; raw_ptr<AutoPipSettingOverlayView> setting_overlay_ = nullptr; std::unique_ptr<ui::test::EventGenerator> event_generator_; + + const GURL origin_{"https://example.com"}; + + // Used by the HostContentSettingsMap instance. + sync_preferences::TestingPrefServiceSyncable prefs_; + + // Used by the AutoPipSettingHelper instance. + scoped_refptr<HostContentSettingsMap> settings_map_; + + std::unique_ptr<AutoPipSettingHelper> setting_helper_; }; TEST_F(AutoPipSettingHelperTest, NoUiIfContentSettingIsAllow) { - setting_helper()->override_content_setting_for_testing(CONTENT_SETTING_ALLOW); + set_content_setting(CONTENT_SETTING_ALLOW); EXPECT_CALL(close_cb(), Run()).Times(0); AttachOverlayView(); EXPECT_FALSE(setting_overlay()); + EXPECT_EQ(get_content_setting(), CONTENT_SETTING_ALLOW); } TEST_F(AutoPipSettingHelperTest, NoUiButCallbackIsCalledIfContentSettingIsBlock) { - setting_helper()->override_content_setting_for_testing(CONTENT_SETTING_BLOCK); + set_content_setting(CONTENT_SETTING_BLOCK); EXPECT_CALL(close_cb(), Run()).Times(1); AttachOverlayView(); EXPECT_FALSE(setting_overlay()); + EXPECT_EQ(get_content_setting(), CONTENT_SETTING_BLOCK); } TEST_F(AutoPipSettingHelperTest, AllowDoesNotCallCloseCb) { - setting_helper()->override_content_setting_for_testing(CONTENT_SETTING_ASK); + set_content_setting(CONTENT_SETTING_DEFAULT); AttachOverlayView(); EXPECT_TRUE(setting_overlay()); // Click allow. Nothing should happen. EXPECT_CALL(close_cb(), Run()).Times(0); click_allow(); + EXPECT_EQ(get_content_setting(), CONTENT_SETTING_ALLOW); } TEST_F(AutoPipSettingHelperTest, BlockDoesCallCloseCb) { - setting_helper()->override_content_setting_for_testing(CONTENT_SETTING_ASK); + set_content_setting(CONTENT_SETTING_DEFAULT); AttachOverlayView(); EXPECT_TRUE(setting_overlay()); // Click block. The close cb should be called. EXPECT_CALL(close_cb(), Run()).Times(1); click_block(); + EXPECT_EQ(get_content_setting(), CONTENT_SETTING_BLOCK); }
diff --git a/chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc b/chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc index 123bf75..dbf7fedc 100644 --- a/chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc +++ b/chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc
@@ -298,6 +298,8 @@ // contents, so we only need to forget the controller here when user closes // the parent web contents with the PiP window open. document_web_contents_observer_.reset(); + // `setting_helper_` depends on the opener's WebContents. + auto_pip_setting_helper_.reset(); if (pip_window_controller_) pip_window_controller_ = nullptr; } @@ -317,8 +319,8 @@ return nullptr; } - auto auto_pip_setting_helper = std::make_unique<AutoPipSettingHelper>( - pip_window_controller_->GetWebContents()->GetURL(), + auto auto_pip_setting_helper = AutoPipSettingHelper::CreateForWebContents( + pip_window_controller_->GetWebContents(), base::BindOnce(&PictureInPictureWindowManager::ExitPictureInPictureSoon)); auto overlay_view = auto_pip_setting_helper->CreateOverlayViewIfNeeded();
diff --git a/chrome/browser/policy/messaging_layer/upload/dm_server_uploader.h b/chrome/browser/policy/messaging_layer/upload/dm_server_uploader.h index 80ae15588..3bcfc84 100644 --- a/chrome/browser/policy/messaging_layer/upload/dm_server_uploader.h +++ b/chrome/browser/policy/messaging_layer/upload/dm_server_uploader.h
@@ -37,6 +37,12 @@ using EncryptionKeyAttachedCallback = base::RepeatingCallback<void(SignedEncryptionInfo)>; +// UpdateConfigInMissiveCallback is called if the configuration file obtained +// from the server is different from the one that was sent previously using +// this callback. +using UpdateConfigInMissiveCallback = + base::RepeatingCallback<void(ListOfBlockedDestinations)>; + // Successful response consists of Sequence information that may be // accompanied with force_confirm flag. struct SuccessfulUploadResponse {
diff --git a/chrome/browser/policy/messaging_layer/upload/record_handler_impl.cc b/chrome/browser/policy/messaging_layer/upload/record_handler_impl.cc index fc04be3..e85643fe 100644 --- a/chrome/browser/policy/messaging_layer/upload/record_handler_impl.cc +++ b/chrome/browser/policy/messaging_layer/upload/record_handler_impl.cc
@@ -33,11 +33,13 @@ #include "chrome/browser/policy/messaging_layer/upload/file_upload_job.h" #include "chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.h" #include "chrome/browser/policy/messaging_layer/util/reporting_server_connector.h" +#include "components/reporting/proto/synced/configuration_file.pb.h" #include "components/reporting/proto/synced/record.pb.h" #include "components/reporting/proto/synced/record_constants.pb.h" #include "components/reporting/proto/synced/upload_tracker.pb.h" #include "components/reporting/resources/resource_manager.h" #include "components/reporting/util/status.h" +#include "components/reporting/util/status_macros.h" #include "components/reporting/util/statusor.h" #include "components/reporting/util/task_runner_context.h" #include "content/public/browser/browser_task_traits.h" @@ -204,6 +206,80 @@ } return std::make_tuple(seq_id, gen_id); } + +// Destination comes back as a string from the server, transform it into a +// proto. +StatusOr<Destination> GetDestinationProto( + const std::string& destination_string) { + if (destination_string == "") { + return Status(error::NOT_FOUND, + "Field destination is missing from ConfigFile"); + } + + Destination destination; + if (!Destination_Parse(destination_string, &destination)) { + return Status(error::INVALID_ARGUMENT, + "Unable to parse destination from ConfigFile"); + } + + // Reject undefined destination. + if (destination == UNDEFINED_DESTINATION) { + return Status(error::INVALID_ARGUMENT, "Received UNDEFINED_DESTINATION"); + } + + return destination; +} + +StatusOr<ConfigFile> GetConfigurationProtoFromDict( + const base::Value::Dict& file) { + ConfigFile config_file; + + // Handle the signature. + const std::string* config_file_signature = + file.FindString("configFileSignature"); + if (config_file_signature->empty()) { + return Status( + error::INVALID_ARGUMENT, + "Field configFileSignature is missing from configurationFile"); + } + config_file.set_config_file_signature(*config_file_signature); + + auto* const event_config_result = file.FindList("eventConfigs"); + if (!event_config_result) { + return Status(error::INVALID_ARGUMENT, + "Field eventConfigs is missing from configurationFile"); + } + + // Parse the list of event configs. + for (auto& entry : *event_config_result) { + auto* const current_config = config_file.add_event_configs(); + auto* const dict = entry.GetIfDict(); + if (dict->empty()) { + return Status(error::INVALID_ARGUMENT, + "Empty event config in configurationFile"); + } + + // Find destination and turn it into a proto. + auto* const destination = dict->FindString("destination"); + ASSIGN_OR_RETURN(const auto proto_destination, + GetDestinationProto(*destination)); + current_config->set_destination(proto_destination); + + // Check if there are minimum and/or maximum release versions + // specified, if there are then we parse them and add them to the proto. + // This fields are optional so if they are not present it is okay. + const auto min_version = dict->FindInt("minimumReleaseVersion"); + if (min_version.has_value()) { + current_config->set_minimum_release_version(min_version.value()); + } + const auto max_version = dict->FindInt("maximumReleaseVersion"); + if (max_version.has_value()) { + current_config->set_maximum_release_version(max_version.value()); + } + } + + return config_file; +} } // namespace // static @@ -510,6 +586,7 @@ // "encryptionSettings": ... // EncryptionSettings proto // "forceConfirm": true, // if present, flag that lastSucceedUploadedRecord // // is to be accepted unconditionally by client + // "configurationFile": ... // ConfigurationFile proto // // Internal control // "enableUploadSizeAdjustment": true, // If present, upload size // // adjustment is enabled. @@ -574,17 +651,37 @@ } } + // Handle the configuration file. + // The server attaches the configuration file if it was requested + // by the client. Adding a check to make sure to only process it if the + // feature is enabled on the client side. + const base::Value::Dict* signed_configuration_file_record = + last_response.FindDict("configurationFile"); + if (signed_configuration_file_record != nullptr && + base::FeatureList::IsEnabled(kShouldRequestConfigurationFile)) { + auto seq_info_result = + GetConfigurationProtoFromDict(*signed_configuration_file_record); + if (seq_info_result.ok()) { + // TODO(b/289117140): Call the callback when it is in place. + } else { + base::UmaHistogramEnumeration("Browser.ERP.ConfigFileParsingError", + seq_info_result.status().code(), + error::Code::MAX_VALUE); + } + } + // Check if a record was unprocessable on the server. const base::Value::Dict* failed_uploaded_record = last_response.FindDictByDottedPath( "firstFailedUploadedRecord.failedUploadedRecord"); if (!force_confirm_ && failed_uploaded_record != nullptr) { - // The record we uploaded previously was unprocessable by the server, if - // the record was after the current |highest_sequence_information_| we - // should return a gap record. A gap record consists of an EncryptedRecord - // with just SequenceInformation. The server will report success for the - // gap record and |highest_sequence_information_| will be updated in the - // next response. In the future there may be recoverable |failureStatus|, + // The record we uploaded previously was unprocessable by the server, + // if the record was after the current |highest_sequence_information_| + // we should return a gap record. A gap record consists of an + // EncryptedRecord with just SequenceInformation. The server will + // report success for the gap record and + // |highest_sequence_information_| will be updated in the next + // response. In the future there may be recoverable |failureStatus|, // but for now all the device can do is delete the record. auto gap_record_result = HandleFailedUploadedSequenceInformation(*failed_uploaded_record); @@ -601,8 +698,8 @@ return; } - // No more records to process. Return the highest_sequence_information_ if - // available. + // No more records to process. Return the highest_sequence_information_ + // if available. if (highest_sequence_information_.has_value()) { Complete(SuccessfulUploadResponse{ .sequence_information = @@ -633,8 +730,9 @@ SequenceInformation& seq_info = seq_info_result.ValueOrDie(); - // |seq_info| should be of the same generation, generation guid, and priority - // as highest_sequence_information_, and have the next sequencing_id. + // |seq_info| should be of the same generation, generation guid, and + // priority as highest_sequence_information_, and have the next + // sequencing_id. if (seq_info.generation_id() != highest_sequence_information_->generation_id() || seq_info.generation_guid() !=
diff --git a/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.cc b/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.cc index 7642116..ffccb1a 100644 --- a/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.cc +++ b/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.cc
@@ -9,6 +9,7 @@ #include <utility> #include "base/base64.h" +#include "base/feature_list.h" #include "base/strings/string_number_conversions.h" #include "base/token.h" #include "base/values.h" @@ -23,6 +24,7 @@ // UploadEncryptedReportingRequestBuilder list key constexpr char kEncryptedRecordListKey[] = "encryptedRecord"; constexpr char kAttachEncryptionSettingsKey[] = "attachEncryptionSettings"; +constexpr char kAttachConfigurationFile[] = "attachConfigurationFile"; // EncryptedRecordDictionaryBuilder strings constexpr char kEncryptedWrappedRecord[] = "encryptedWrappedRecord"; @@ -41,12 +43,25 @@ } // namespace +// Feature that controls if the configuration file should be requested +// from the server. +BASE_FEATURE(kShouldRequestConfigurationFile, + "ShouldRequestConfigurationFile", + base::FEATURE_DISABLED_BY_DEFAULT); + UploadEncryptedReportingRequestBuilder::UploadEncryptedReportingRequestBuilder( bool attach_encryption_settings) { result_.emplace(); if (attach_encryption_settings) { result_->Set(GetAttachEncryptionSettingsPath(), true); } + + // Only request the configuration file from the server if the feature is + // enabled. The server will only return the configuration file if there is + // something to be blocked at that point.s + if (base::FeatureList::IsEnabled(kShouldRequestConfigurationFile)) { + result_->Set(GetAttachConfigurationFilePath(), true); + } } UploadEncryptedReportingRequestBuilder:: @@ -122,6 +137,12 @@ return kAttachEncryptionSettingsKey; } +// static +std::string_view +UploadEncryptedReportingRequestBuilder::GetAttachConfigurationFilePath() { + return kAttachConfigurationFile; +} + EncryptedRecordDictionaryBuilder::EncryptedRecordDictionaryBuilder( EncryptedRecord record, ScopedReservation& scoped_reservation) {
diff --git a/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.h b/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.h index 63eae83..10358e9 100644 --- a/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.h +++ b/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.h
@@ -7,6 +7,7 @@ #include <string_view> +#include "base/feature_list.h" #include "base/values.h" #include "components/reporting/proto/synced/record.pb.h" @@ -62,7 +63,10 @@ // // optional field, corresponding to |need_encryption_keys| in // // components/reporting/proto/interface.proto // "attachEncryptionSettings": true, -// "requestId": "SomeString" +// "requestId": "SomeString", +// // optional field, corresponding to the configuration file that the +// // server provides to the client. +// "attachConfigurationFile": true // } // // This payload is added to the common payload of all reporting jobs, which @@ -82,6 +86,8 @@ // dictionary that represents a record. The details of each record is documented // in record.proto. +BASE_DECLARE_FEATURE(kShouldRequestConfigurationFile); + class UploadEncryptedReportingRequestBuilder { public: // SequenceInformationDictionaryBuilder strings @@ -113,6 +119,7 @@ static std::string_view GetEncryptedRecordListPath(); static std::string_view GetAttachEncryptionSettingsPath(); + static std::string_view GetAttachConfigurationFilePath(); absl::optional<base::Value::Dict> result_; };
diff --git a/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder_unittest.cc b/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder_unittest.cc index 43bce4d4..f7f7877 100644 --- a/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder_unittest.cc +++ b/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder_unittest.cc
@@ -10,10 +10,12 @@ #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" +#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/token.h" #include "base/uuid.h" #include "chrome/browser/enterprise/browser_management/management_service_factory.h" +#include "chrome/browser/policy/messaging_layer/upload/record_handler_impl.h" #include "chrome/browser/policy/messaging_layer/util/test_request_payload.h" #include "components/policy/core/common/management/management_service.h" #include "components/policy/core/common/management/scoped_management_service_override_for_testing.h" @@ -333,6 +335,24 @@ .Build()); } +TEST_P(RecordUploadRequestBuilderTest, ConfigFileRequestExperimentEnabled) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeature(kShouldRequestConfigurationFile); + UploadEncryptedReportingRequestBuilder builder(need_encryption_key()); + + EXPECT_THAT(builder.Build().value(), + IsConfigurationFileRequestUploadRequestValid(true)); +} + +TEST_P(RecordUploadRequestBuilderTest, ConfigFileRequestExperimentDisabled) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndDisableFeature(kShouldRequestConfigurationFile); + UploadEncryptedReportingRequestBuilder builder(need_encryption_key()); + + EXPECT_THAT(builder.Build().value(), + IsConfigurationFileRequestUploadRequestValid(false)); +} + INSTANTIATE_TEST_SUITE_P(NeedOrNoNeedKey, RecordUploadRequestBuilderTest, testing::Bool());
diff --git a/chrome/browser/policy/messaging_layer/upload/upload_client.h b/chrome/browser/policy/messaging_layer/upload/upload_client.h index 6b560f1..9bfd57af1 100644 --- a/chrome/browser/policy/messaging_layer/upload/upload_client.h +++ b/chrome/browser/policy/messaging_layer/upload/upload_client.h
@@ -31,6 +31,12 @@ using EncryptionKeyAttachedCallback = ::reporting::EncryptionKeyAttachedCallback; + // UpdateConfigInMissiveCallback is called if the configuration file obtained + // from the server is different from the one that was sent previously using + // this callback. + using UpdateConfigInMissiveCallback = + ::reporting::UpdateConfigInMissiveCallback; + // CreatedCallback gets a result of Upload client creation (unique pointer or // error status). using CreatedCallback =
diff --git a/chrome/browser/policy/messaging_layer/util/test_request_payload.cc b/chrome/browser/policy/messaging_layer/util/test_request_payload.cc index a723f62..3f38e8c 100644 --- a/chrome/browser/policy/messaging_layer/util/test_request_payload.cc +++ b/chrome/browser/policy/messaging_layer/util/test_request_payload.cc
@@ -92,6 +92,59 @@ return "no-attach-encryption-settings-matcher"; } +bool AttachConfigurationFileMatcher::MatchAndExplain( + const base::Value::Dict& arg, + MatchResultListener* listener) const { + const auto attach_configuration_file = + arg.FindBool("attachConfigurationFile"); + if (!attach_configuration_file) { + *listener << "No key named \"attachConfigurationFile\" in the argument or " + "the value is not of bool type."; + return false; + } + if (!attach_configuration_file.value()) { + *listener << "The value of \"attachConfigurationFile\" is false."; + return false; + } + return true; +} + +void AttachConfigurationFileMatcher::DescribeTo(std::ostream* os) const { + *os << "has a valid attachConfigurationFile field."; +} + +void AttachConfigurationFileMatcher::DescribeNegationTo( + std::ostream* os) const { + *os << "has an invalid attachConfigurationFile field."; +} + +std::string AttachConfigurationFileMatcher::Name() const { + return "attach-configuration-file-matcher"; +} + +bool NoAttachConfigurationFileMatcher::MatchAndExplain( + const base::Value::Dict& arg, + MatchResultListener* listener) const { + if (arg.Find("attachConfigurationFile") != nullptr) { + *listener << "Found \"attachConfigurationFile\" in the argument."; + return false; + } + return true; +} + +void NoAttachConfigurationFileMatcher::DescribeTo(std::ostream* os) const { + *os << "expectedly has no attachConfigurationFile field."; +} + +void NoAttachConfigurationFileMatcher::DescribeNegationTo( + std::ostream* os) const { + *os << "unexpectedly has an attachConfigurationFile field."; +} + +std::string NoAttachConfigurationFileMatcher::Name() const { + return "no-attach-configuration-file-matcher"; +} + void CompressionInformationMatcher::DescribeTo(std::ostream* os) const { *os << "has a valid compression information field."; }
diff --git a/chrome/browser/policy/messaging_layer/util/test_request_payload.h b/chrome/browser/policy/messaging_layer/util/test_request_payload.h index 762f9624..8b473645 100644 --- a/chrome/browser/policy/messaging_layer/util/test_request_payload.h +++ b/chrome/browser/policy/messaging_layer/util/test_request_payload.h
@@ -61,6 +61,27 @@ std::string Name() const override; }; +// attachConfigurationFile must be of bool type and true. +class AttachConfigurationFileMatcher : public RequestValidityMatcherInterface { + public: + bool MatchAndExplain(const base::Value::Dict& arg, + MatchResultListener* listener) const override; + void DescribeTo(std::ostream* os) const override; + void DescribeNegationTo(std::ostream* os) const override; + std::string Name() const override; +}; + +// attachConfigurationFile must be absent. +class NoAttachConfigurationFileMatcher + : public RequestValidityMatcherInterface { + public: + bool MatchAndExplain(const base::Value::Dict& arg, + MatchResultListener* listener) const override; + void DescribeTo(std::ostream* os) const override; + void DescribeNegationTo(std::ostream* os) const override; + std::string Name() const override; +}; + // encryptedRecord must be a list. This matcher is recommended to be applies // before verifying the details of any record (e.g., via |RecordMatcher|) to // generate more readable error messages. @@ -226,6 +247,22 @@ } // Creates and returns a |RequestValidityMatcherBuilder| instance that + // contains a matcher that is suited for verifying a configuration file + // request. If need_config_file is false the matcher will ensure the + // request does not request the configuration file. + static RequestValidityMatcherBuilder<T> CreateConfigurationFileRequestUpload( + bool need_config_file) { + auto builder = RequestValidityMatcherBuilder<T>::CreateEmpty(); + builder.AppendMatcher(RequestIdMatcher()); + if (need_config_file) { + builder.AppendMatcher(AttachConfigurationFileMatcher()); + } else { + builder.AppendMatcher(NoAttachConfigurationFileMatcher()); + } + return builder; + } + + // Creates and returns a |RequestValidityMatcherBuilder| instance that // contains a matcher that is suited for verifying a single record. static RequestValidityMatcherBuilder<T> CreateRecord() { return std::move(RequestValidityMatcherBuilder<T>::CreateEmpty() @@ -337,6 +374,17 @@ .Build(); } +// Match a configuration file request upload request that is valid. If +// need_config_file is false, this matcher will ensure the request does not +// request a configuration file. +template <class T = base::Value::Dict> +Matcher<T> IsConfigurationFileRequestUploadRequestValid( + bool need_config_file = false) { + return RequestValidityMatcherBuilder<T>::CreateConfigurationFileRequestUpload( + need_config_file) + .Build(); +} + // Match a gap upload request that is valid. template <class T = base::Value::Dict> Matcher<T> IsGapUploadRequestValid() {
diff --git a/chrome/browser/policy/messaging_layer/util/test_response_payload.cc b/chrome/browser/policy/messaging_layer/util/test_response_payload.cc index 98251505..fe2ed68 100644 --- a/chrome/browser/policy/messaging_layer/util/test_response_payload.cc +++ b/chrome/browser/policy/messaging_layer/util/test_response_payload.cc
@@ -103,6 +103,32 @@ response.Set("encryptionSettings", std::move(encryption_settings)); } + // If attach_configuration_file is true, process that. + const auto attach_configuration_file = + request_.FindBool("attachConfigurationFile"); + if (attach_configuration_file.has_value() && + attach_configuration_file.value()) { + base::Value::Dict configuration_file; + base::Value::List event_configs; + base::Value::Dict heartbeat; + heartbeat.Set("destination", "HEARTBEAT_EVENTS"); + heartbeat.Set("minimumReleaseVersion", 11111); + event_configs.Append(std::move(heartbeat)); + base::Value::Dict login; + login.Set("destination", "LOGIN_LOGOUT_EVENTS"); + login.Set("minimumReleaseVersion", 22222); + login.Set("maximumReleaseVersion", 33333); + event_configs.Append(std::move(login)); + base::Value::Dict lock; + lock.Set("destination", "LOCK_UNLOCK_EVENTS"); + event_configs.Append(std::move(lock)); + std::string encoded; + base::Base64Encode("Fake signature", &encoded); + configuration_file.Set("configurationFileSignature", std::move(encoded)); + configuration_file.Set("eventConfigs", std::move(event_configs)); + response.Set("configurationFile", std::move(configuration_file)); + } + return response; }
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc index ec6eeb7..47262be 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -1874,7 +1874,7 @@ } menu_model_.AddItem(GetSearchForImageIdc(), menu_string); - if (companion::IsSearchImageInCompanionSidePanelSupported(GetBrowser())) { + if (companion::IsNewBadgeEnabledForSearchImageMenuItem(GetBrowser())) { menu_model_.SetIsNewFeatureAt(menu_model_.GetItemCount() - 1, true); } @@ -2170,7 +2170,9 @@ default_provider->short_name(), printable_selection_text)); if (companion::IsSearchWebInCompanionSidePanelSupported(GetBrowser())) { - menu_model_.SetIsNewFeatureAt(menu_model_.GetItemCount() - 1, true); + if (companion::IsNewBadgeEnabledForSearchWebMenuItem(GetBrowser())) { + menu_model_.SetIsNewFeatureAt(menu_model_.GetItemCount() - 1, true); + } // Add an "in new tab" item performing the non-side panel behavior. if (base::FeatureList::IsEnabled( companion::features:: @@ -2469,7 +2471,7 @@ menu_model_.AddItem(GetRegionSearchIdc(), l10n_util::GetStringFUTF16( resource_id, GetImageSearchProviderName(provider))); - if (companion::IsSearchImageInCompanionSidePanelSupported(GetBrowser())) { + if (companion::IsNewBadgeEnabledForSearchImageMenuItem(GetBrowser())) { menu_model_.SetIsNewFeatureAt(menu_model_.GetItemCount() - 1, true); } }
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc b/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc index 3df4738..173ced6 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc
@@ -13,6 +13,7 @@ #include "build/build_config.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/autofill/personal_data_manager_factory.h" +#include "chrome/browser/companion/core/features.h" #include "chrome/browser/download/chrome_download_manager_delegate.h" #include "chrome/browser/download/download_core_service.h" #include "chrome/browser/download/download_core_service_factory.h" @@ -1639,6 +1640,120 @@ EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_LENS_REGION_SEARCH)); } +// Verify that the new badge is added to region search context menu items if +// appropriate feature is enabled. +TEST_F(RenderViewContextMenuPrefsTest, + CompanionNewBadgeEnabledForRegionSearchContextMenuItem) { + base::test::ScopedFeatureList features; + features.InitWithFeaturesAndParameters( + {{companion::features::internal::kSidePanelCompanion, + {{"open-companion-for-image-search", "true"}}}, + {companion::features::kCompanionEnableNewBadgesInContextMenu, {}}}, + {}); + SetUserSelectedDefaultSearchProvider("https://www.google.com", + /*supports_image_search=*/true); + content::ContextMenuParams params = CreateParams(MenuItem::PAGE); + TestRenderViewContextMenu menu(*web_contents()->GetPrimaryMainFrame(), + params); + menu.SetBrowser(GetBrowser()); + menu.Init(); + + size_t index = 0; + ui::MenuModel* model = nullptr; + + ASSERT_TRUE(menu.GetMenuModelAndItemIndex( + IDC_CONTENT_CONTEXT_LENS_REGION_SEARCH, &model, &index)); + EXPECT_TRUE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_LENS_REGION_SEARCH)); + EXPECT_TRUE(model->IsNewFeatureAt(index)); +} + +// Verify that the new badge is NOT added to region search context menu items if +// appropriate feature is disabled. +TEST_F(RenderViewContextMenuPrefsTest, + CompanionNewBadgeDisabledForRegionSearchContextMenuItem) { + base::test::ScopedFeatureList features; + features.InitWithFeaturesAndParameters( + {{companion::features::internal::kSidePanelCompanion, + {{"open-companion-for-image-search", "true"}}}}, + {companion::features::kCompanionEnableNewBadgesInContextMenu}); + SetUserSelectedDefaultSearchProvider("https://www.google.com", + /*supports_image_search=*/true); + content::ContextMenuParams params = CreateParams(MenuItem::PAGE); + TestRenderViewContextMenu menu(*web_contents()->GetPrimaryMainFrame(), + params); + menu.SetBrowser(GetBrowser()); + menu.Init(); + + size_t index = 0; + ui::MenuModel* model = nullptr; + + ASSERT_TRUE(menu.GetMenuModelAndItemIndex( + IDC_CONTENT_CONTEXT_LENS_REGION_SEARCH, &model, &index)); + EXPECT_TRUE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_LENS_REGION_SEARCH)); + EXPECT_FALSE(model->IsNewFeatureAt(index)); +} + +// Verify that the new badge is added to image search context menu items if +// appropriate feature is enabled. +TEST_F(RenderViewContextMenuPrefsTest, + CompanionNewBadgeEnabledForImageSearchContextMenuItems) { + base::test::ScopedFeatureList features; + features.InitWithFeaturesAndParameters( + {{companion::features::internal::kSidePanelCompanion, + {{"open-companion-for-image-search", "true"}}}, + {companion::features::kCompanionEnableNewBadgesInContextMenu, {}}}, + {}); + SetUserSelectedDefaultSearchProvider("https://www.google.com", + /*supports_image_search=*/true); + content::ContextMenuParams params = CreateParams(MenuItem::IMAGE); + params.has_image_contents = true; + TestRenderViewContextMenu menu(*web_contents()->GetPrimaryMainFrame(), + params); + menu.SetBrowser(GetBrowser()); + menu.Init(); + + size_t index = 0; + ui::MenuModel* model = nullptr; + + ASSERT_TRUE(menu.GetMenuModelAndItemIndex( + IDC_CONTENT_CONTEXT_SEARCHLENSFORIMAGE, &model, &index)); + EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_SEARCHWEBFORIMAGE)); + EXPECT_TRUE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_SEARCHLENSFORIMAGE)); + EXPECT_TRUE(model->IsNewFeatureAt(index)); + EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_TRANSLATEIMAGEWITHWEB)); + EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_TRANSLATEIMAGEWITHLENS)); +} + +// Verify that the new badge is NOT added to image search context menu items if +// appropriate feature is disabled. +TEST_F(RenderViewContextMenuPrefsTest, + CompanionNewBadgeDisabledForImageSearchContextMenuItems) { + base::test::ScopedFeatureList features; + features.InitWithFeaturesAndParameters( + {{companion::features::internal::kSidePanelCompanion, + {{"open-companion-for-image-search", "true"}}}}, + {companion::features::kCompanionEnableNewBadgesInContextMenu}); + SetUserSelectedDefaultSearchProvider("https://www.google.com", + /*supports_image_search=*/true); + content::ContextMenuParams params = CreateParams(MenuItem::IMAGE); + params.has_image_contents = true; + TestRenderViewContextMenu menu(*web_contents()->GetPrimaryMainFrame(), + params); + menu.SetBrowser(GetBrowser()); + menu.Init(); + + size_t index = 0; + ui::MenuModel* model = nullptr; + + ASSERT_TRUE(menu.GetMenuModelAndItemIndex( + IDC_CONTENT_CONTEXT_SEARCHLENSFORIMAGE, &model, &index)); + EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_SEARCHWEBFORIMAGE)); + EXPECT_TRUE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_SEARCHLENSFORIMAGE)); + EXPECT_FALSE(model->IsNewFeatureAt(index)); + EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_TRANSLATEIMAGEWITHWEB)); + EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_TRANSLATEIMAGEWITHLENS)); +} + // Verify that the Lens Region Search menu item is enabled for Progressive Web // Apps. Region Search on PWAs is currently broken and therefore disabled on // Mac. b/250074889
diff --git a/chrome/browser/resources/ash/settings/lazy_load.ts b/chrome/browser/resources/ash/settings/lazy_load.ts index 5a283df..9784be5 100644 --- a/chrome/browser/resources/ash/settings/lazy_load.ts +++ b/chrome/browser/resources/ash/settings/lazy_load.ts
@@ -88,6 +88,7 @@ import './os_apps_page/app_management_page/sub_apps_item.js'; import './os_bluetooth_page/os_bluetooth_change_device_name_dialog.js'; import './os_bluetooth_page/os_paired_bluetooth_list.js'; +import './os_bluetooth_page/os_paired_bluetooth_list_item.js'; import './os_files_page/google_drive_subpage.js'; import './os_files_page/google_drive_confirmation_dialog.js'; import './os_files_page/google_drive_subpage.js'; @@ -201,6 +202,7 @@ export {AppNotificationsSubpage} from './os_apps_page/app_notifications_page/app_notifications_subpage.js'; export {SettingsBluetoothChangeDeviceNameDialogElement} from './os_bluetooth_page/os_bluetooth_change_device_name_dialog.js'; export {SettingsPairedBluetoothListElement} from './os_bluetooth_page/os_paired_bluetooth_list.js'; +export {SettingsPairedBluetoothListItemElement} from './os_bluetooth_page/os_paired_bluetooth_list_item.js'; export {SettingsGoogleDriveSubpageElement} from './os_files_page/google_drive_subpage.js'; export {SettingsOfficePageElement} from './os_files_page/office_page.js'; export {OneDriveConnectionState, SettingsOneDriveSubpageElement} from './os_files_page/one_drive_subpage.js';
diff --git a/chrome/browser/resources/ash/settings/os_bluetooth_page/os_bluetooth_summary.ts b/chrome/browser/resources/ash/settings/os_bluetooth_page/os_bluetooth_summary.ts index 9a20103..5767d22 100644 --- a/chrome/browser/resources/ash/settings/os_bluetooth_page/os_bluetooth_summary.ts +++ b/chrome/browser/resources/ash/settings/os_bluetooth_page/os_bluetooth_summary.ts
@@ -38,7 +38,7 @@ const SettingsBluetoothSummaryElementBase = RouteOriginMixin(I18nMixin(PolymerElement)); -class SettingsBluetoothSummaryElement extends +export class SettingsBluetoothSummaryElement extends SettingsBluetoothSummaryElementBase { static get is() { return 'os-settings-bluetooth-summary' as const;
diff --git a/chrome/browser/resources/ash/settings/os_bluetooth_page/os_paired_bluetooth_list_item.ts b/chrome/browser/resources/ash/settings/os_bluetooth_page/os_paired_bluetooth_list_item.ts index 9cea338..c843c75 100644 --- a/chrome/browser/resources/ash/settings/os_bluetooth_page/os_paired_bluetooth_list_item.ts +++ b/chrome/browser/resources/ash/settings/os_bluetooth_page/os_paired_bluetooth_list_item.ts
@@ -30,7 +30,7 @@ const SettingsPairedBluetoothListItemElementBase = FocusRowMixin(I18nMixin(PolymerElement)); -class SettingsPairedBluetoothListItemElement extends +export class SettingsPairedBluetoothListItemElement extends SettingsPairedBluetoothListItemElementBase { static get is() { return 'os-settings-paired-bluetooth-list-item' as const;
diff --git a/chrome/browser/resources/ash/settings/os_settings.ts b/chrome/browser/resources/ash/settings/os_settings.ts index 82bf926..688cfee 100644 --- a/chrome/browser/resources/ash/settings/os_settings.ts +++ b/chrome/browser/resources/ash/settings/os_settings.ts
@@ -65,7 +65,6 @@ import './os_bluetooth_page/os_bluetooth_pairing_dialog.js'; import './os_bluetooth_page/os_bluetooth_page.js'; import './os_bluetooth_page/os_bluetooth_summary.js'; -import './os_bluetooth_page/os_paired_bluetooth_list_item.js'; import './os_bluetooth_page/os_saved_devices_list.js'; import './os_bluetooth_page/os_saved_devices_list_item.js'; import './os_bluetooth_page/settings_fast_pair_constants.js'; @@ -116,6 +115,7 @@ export {OpenWindowProxy, OpenWindowProxyImpl} from 'chrome://resources/js/open_window_proxy.js'; export {IronCollapseElement} from 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; export {IronDropdownElement} from 'chrome://resources/polymer/v3_0/iron-dropdown/iron-dropdown.js'; +export {IronIconElement} from 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; export {IronListElement} from 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; export {IronSelectorElement} from 'chrome://resources/polymer/v3_0/iron-selector/iron-selector.js'; export {PaperTooltipElement} from 'chrome://resources/polymer/v3_0/paper-tooltip/paper-tooltip.js'; @@ -192,6 +192,7 @@ export {OsBluetoothDevicesSubpageBrowserProxy, OsBluetoothDevicesSubpageBrowserProxyImpl} from './os_bluetooth_page/os_bluetooth_devices_subpage_browser_proxy.js'; export {SettingsBluetoothPageElement} from './os_bluetooth_page/os_bluetooth_page.js'; export {SettingsBluetoothPairingDialogElement} from './os_bluetooth_page/os_bluetooth_pairing_dialog.js'; +export {SettingsBluetoothSummaryElement} from './os_bluetooth_page/os_bluetooth_summary.js'; export {FastPairSavedDevice, FastPairSavedDevicesOptInStatus} from './os_bluetooth_page/settings_fast_pair_constants.js'; export {GoogleDriveBrowserProxy, GoogleDrivePageCallbackRouter, GoogleDrivePageHandlerRemote, GoogleDrivePageRemote, Stage} from './os_files_page/google_drive_browser_proxy.js'; export {ConfirmationDialogType, SettingsGoogleDriveSubpageElement} from './os_files_page/google_drive_subpage.js';
diff --git a/chrome/browser/resources/chromeos/parent_access/BUILD.gn b/chrome/browser/resources/chromeos/parent_access/BUILD.gn index 4de0f94..91553df 100644 --- a/chrome/browser/resources/chromeos/parent_access/BUILD.gn +++ b/chrome/browser/resources/chromeos/parent_access/BUILD.gn
@@ -89,6 +89,8 @@ } js_library("parent_access_app") { + extra_deps = + [ "//ui/webui/resources/cr_components/color_change_listener:build_ts" ] deps = [ ":parent_access_after", ":parent_access_before",
diff --git a/chrome/browser/resources/chromeos/parent_access/parent_access_after.html b/chrome/browser/resources/chromeos/parent_access/parent_access_after.html index 721b108..cf13492 100644 --- a/chrome/browser/resources/chromeos/parent_access/parent_access_after.html +++ b/chrome/browser/resources/chromeos/parent_access/parent_access_after.html
@@ -1,4 +1,4 @@ -<style> +<style include="cros-color-overrides"> .action-button { margin-inline-start: 8px; }
diff --git a/chrome/browser/resources/chromeos/parent_access/parent_access_after.js b/chrome/browser/resources/chromeos/parent_access/parent_access_after.js index 9dacc28..018c8682 100644 --- a/chrome/browser/resources/chromeos/parent_access/parent_access_after.js +++ b/chrome/browser/resources/chromeos/parent_access/parent_access_after.js
@@ -4,6 +4,7 @@ import './flows/local_web_approvals_after.js'; import './parent_access_template.js'; +import 'chrome://resources/cr_elements/chromeos/cros_color_overrides.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/chromeos/parent_access/parent_access_app.html b/chrome/browser/resources/chromeos/parent_access/parent_access_app.html index 946b6c5..1bcc681b 100644 --- a/chrome/browser/resources/chromeos/parent_access/parent_access_app.html +++ b/chrome/browser/resources/chromeos/parent_access/parent_access_app.html
@@ -1,3 +1,4 @@ +<style include="cros-color-overrides"></style> <cr-view-manager id="viewManager"> <parent-access-before id="parent-access-before" slot="view"> </parent-access-before>
diff --git a/chrome/browser/resources/chromeos/parent_access/parent_access_app.js b/chrome/browser/resources/chromeos/parent_access/parent_access_app.js index 3cfb2ab..bf014ae 100644 --- a/chrome/browser/resources/chromeos/parent_access/parent_access_app.js +++ b/chrome/browser/resources/chromeos/parent_access/parent_access_app.js
@@ -12,8 +12,11 @@ import './parent_access_error.js'; import './parent_access_offline.js'; import './parent_access_ui.js'; +import 'chrome://resources/cr_elements/chromeos/cros_color_overrides.css.js'; import 'chrome://resources/cr_elements/cr_view_manager/cr_view_manager.js'; +import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js'; +import {ColorChangeUpdater} from 'chrome://resources/cr_components/color_change_listener/colors_css_updater.js'; import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {ParentAccessParams_FlowType, ParentAccessResult} from './parent_access_ui.mojom-webui.js'; @@ -57,12 +60,37 @@ currentScreen_: { type: Screens, }, + /** + * Returns true if the Parent Access Jelly feature flag is enabled. + * @private + */ + isParentAccessJellyEnabled: { + type: Boolean, + readOnly: true, + value() { + return loadTimeData.valueExists('isParentAccessJellyEnabled') && + loadTimeData.getBoolean('isParentAccessJellyEnabled'); + }, + }, }; } /** @override */ ready() { super.ready(); + + if (this.isParentAccessJellyEnabled) { + const link = document.createElement('link'); + link.rel = 'stylesheet'; + link.href = 'chrome://theme/colors.css?sets=legacy,sys'; + document.head.appendChild(link); + document.body.classList.add('jelly-enabled'); + /** @suppress {checkTypes} */ + (function() { + ColorChangeUpdater.forDocument().start(); + })(); + } + this.addEventListeners_(); this.getInitialScreen_().then((initialScreen) => { this.switchScreen_(navigator.onLine ? initialScreen : Screens.OFFLINE);
diff --git a/chrome/browser/resources/chromeos/parent_access/parent_access_before.html b/chrome/browser/resources/chromeos/parent_access/parent_access_before.html index f4c3638b4..0dc6098 100644 --- a/chrome/browser/resources/chromeos/parent_access/parent_access_before.html +++ b/chrome/browser/resources/chromeos/parent_access/parent_access_before.html
@@ -1,4 +1,4 @@ -<style> +<style include="cros-color-overrides"> .action-button { margin-inline-start: 8px; }
diff --git a/chrome/browser/resources/chromeos/parent_access/parent_access_before.js b/chrome/browser/resources/chromeos/parent_access/parent_access_before.js index f8f9a61..1168e53 100644 --- a/chrome/browser/resources/chromeos/parent_access/parent_access_before.js +++ b/chrome/browser/resources/chromeos/parent_access/parent_access_before.js
@@ -3,6 +3,7 @@ // found in the LICENSE file. import './parent_access_template.js'; +import 'chrome://resources/cr_elements/chromeos/cros_color_overrides.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/chromeos/parent_access/parent_access_disabled.html b/chrome/browser/resources/chromeos/parent_access/parent_access_disabled.html index 78d163fb..6d7cc84 100644 --- a/chrome/browser/resources/chromeos/parent_access/parent_access_disabled.html +++ b/chrome/browser/resources/chromeos/parent_access/parent_access_disabled.html
@@ -1,4 +1,4 @@ -<style> +<style include="cros-color-overrides"> .action-button { margin-inline-start: 8px; }
diff --git a/chrome/browser/resources/chromeos/parent_access/parent_access_disabled.js b/chrome/browser/resources/chromeos/parent_access/parent_access_disabled.js index 302481e..313ce43 100644 --- a/chrome/browser/resources/chromeos/parent_access/parent_access_disabled.js +++ b/chrome/browser/resources/chromeos/parent_access/parent_access_disabled.js
@@ -3,6 +3,7 @@ // found in the LICENSE file. import './parent_access_template.js'; +import 'chrome://resources/cr_elements/chromeos/cros_color_overrides.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/chromeos/parent_access/parent_access_template.html b/chrome/browser/resources/chromeos/parent_access/parent_access_template.html index 1863f10..baa156b 100644 --- a/chrome/browser/resources/chromeos/parent_access/parent_access_template.html +++ b/chrome/browser/resources/chromeos/parent_access/parent_access_template.html
@@ -1,4 +1,4 @@ -<style include="cr-icons"> +<style include="cr-icons cros-color-overrides"> .template-container { display: flex; flex-direction: column;
diff --git a/chrome/browser/resources/chromeos/parent_access/parent_access_template.js b/chrome/browser/resources/chromeos/parent_access/parent_access_template.js index bd125c80..089b4ba 100644 --- a/chrome/browser/resources/chromeos/parent_access/parent_access_template.js +++ b/chrome/browser/resources/chromeos/parent_access/parent_access_template.js
@@ -3,6 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_icons.css.js'; +import 'chrome://resources/cr_elements/chromeos/cros_color_overrides.css.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/chromeos/parent_access/parent_access_ui.html b/chrome/browser/resources/chromeos/parent_access/parent_access_ui.html index 65e1e5e9..39736c5 100644 --- a/chrome/browser/resources/chromeos/parent_access/parent_access_ui.html +++ b/chrome/browser/resources/chromeos/parent_access/parent_access_ui.html
@@ -1,4 +1,4 @@ -<style> +<style include="cros-color-overrides"> html, body { height: 100%;
diff --git a/chrome/browser/resources/chromeos/parent_access/parent_access_ui.js b/chrome/browser/resources/chromeos/parent_access/parent_access_ui.js index 07e9a1c..58082bf4 100644 --- a/chrome/browser/resources/chromeos/parent_access/parent_access_ui.js +++ b/chrome/browser/resources/chromeos/parent_access/parent_access_ui.js
@@ -3,6 +3,7 @@ // found in the LICENSE file. import './parent_access_template.js'; +import 'chrome://resources/cr_elements/chromeos/cros_color_overrides.css.js'; import 'chrome://resources/polymer/v3_0/paper-spinner/paper-spinner-lite.js'; import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js';
diff --git a/chrome/browser/resources/new_tab_page/modules/v2/modules.html b/chrome/browser/resources/new_tab_page/modules/v2/modules.html index 754d74f..4c6886b 100644 --- a/chrome/browser/resources/new_tab_page/modules/v2/modules.html +++ b/chrome/browser/resources/new_tab_page/modules/v2/modules.html
@@ -7,6 +7,10 @@ margin-top: 8px; max-width: var(--container-max-width, inherit); } + + #undoToastMessage { + flex-grow: 1; + } </style> <div id="container"> </div>
diff --git a/chrome/browser/resources/settings/performance_page/tab_discard_exception_current_sites_list.html b/chrome/browser/resources/settings/performance_page/tab_discard_exception_current_sites_list.html index 1f41e55..5a444fa 100644 --- a/chrome/browser/resources/settings/performance_page/tab_discard_exception_current_sites_list.html +++ b/chrome/browser/resources/settings/performance_page/tab_discard_exception_current_sites_list.html
@@ -1,3 +1,14 @@ +<style> + /* + * adds horizontal padding to account for the removed padding from the dialog + * body + */ + #emptyText { + padding-inline-end: 20px; + padding-inline-start: 20px; + padding-top: 20px; + } +</style> <div id="container" scrollable> <iron-list id="list" scroll-target="container" role="listbox" items="[[currentSites_]]" selected-items="{{selectedSites_}}" @@ -11,4 +22,7 @@ </tab-discard-exception-current-sites-entry> </template> </iron-list> + <div id="emptyText" hidden="[[currentSites_.length]]"> + $i18n{tabDiscardingExceptionsAddDialogCurrentTabsEmpty} + </div> </div>
diff --git a/chrome/browser/resources/settings/performance_page/tab_discard_exception_list.html b/chrome/browser/resources/settings/performance_page/tab_discard_exception_list.html index cc8f6981..ff419e16 100644 --- a/chrome/browser/resources/settings/performance_page/tab_discard_exception_list.html +++ b/chrome/browser/resources/settings/performance_page/tab_discard_exception_list.html
@@ -18,7 +18,10 @@ } </style> <div class="cr-row"> - <div class="cr-padded-text">$i18n{tabDiscardingExceptionsHeader}</div> + <div class="cr-padded-text"> + $i18n{tabDiscardingExceptionsHeader} + <div class="secondary">$i18n{tabDiscardingExceptionsDescription}</div> + </div> <cr-button id="addButton" on-click="onAddClick_" aria-label="$i18n{tabDiscardingExceptionsAddButtonAriaLabel}"> $i18n{add}
diff --git a/chrome/browser/resources/side_panel/commerce/history_graph.ts b/chrome/browser/resources/side_panel/commerce/history_graph.ts index e46eeea..e4ee1266 100644 --- a/chrome/browser/resources/side_panel/commerce/history_graph.ts +++ b/chrome/browser/resources/side_panel/commerce/history_graph.ts
@@ -265,12 +265,16 @@ const ticks: number[] = []; const formattedTicks: string[] = []; - const minPrice = this.points.reduce((min, value) => { + let minPrice = this.points.reduce((min, value) => { return Math.min(min, value.price); }, this.points[0].price); - const maxPrice = this.points.reduce((max, value) => { + let maxPrice = this.points.reduce((max, value) => { return Math.max(max, value.price); }, this.points[0].price); + + // Ensure the line is in the middle of the graph. + minPrice = Math.max(minPrice - 1, 0); + maxPrice = maxPrice + 1; const valueRange = maxPrice - minPrice; let tickInterval = valueRange / (TICK_COUNT_Y - 1);
diff --git a/chrome/browser/resources/side_panel/read_anything/icons.html b/chrome/browser/resources/side_panel/read_anything/icons.html index 0b061d8..bb22b54e 100644 --- a/chrome/browser/resources/side_panel/read_anything/icons.html +++ b/chrome/browser/resources/side_panel/read_anything/icons.html
@@ -6,13 +6,13 @@ </g> <g id="font-size-increase" viewBox="0 0 20 20"> <path - d="M3.38333 14L6.46667 6H8.06667L11.1333 14H9.53333L8.83333 12.0167H5.66667L4.93333 14H3.38333ZM6.08333 10.8H8.4L7.28333 7.58333H7.21667L6.08333 10.8ZM13.3833 12.4667V10.6667H11.5833V9.33333H13.3833V7.53333H14.7V9.33333H16.5V10.6667H14.7V12.4667H13.3833Z" - fill="#3C4043"></path> + d="M3.38333 14L6.46667 6H8.06667L11.1333 14H9.53333L8.83333 12.0167H5.66667L4.93333 14H3.38333ZM6.08333 10.8H8.4L7.28333 7.58333H7.21667L6.08333 10.8ZM13.3833 12.4667V10.6667H11.5833V9.33333H13.3833V7.53333H14.7V9.33333H16.5V10.6667H14.7V12.4667H13.3833Z"> + </path> </g> <g id="font-size-decrease" viewBox="0 0 20 20"> <path - d="M3.38333 14L6.46667 6H8.06667L11.1333 14H9.53333L8.83333 12.0167H5.66667L4.93333 14H3.38333ZM6.08333 10.8H8.4L7.28333 7.58333H7.21667L6.08333 10.8ZM11.6167 10.6667V9.33333H16.5V10.6667H11.6167Z" - fill="#3C4043"></path> + d="M3.38333 14L6.46667 6H8.06667L11.1333 14H9.53333L8.83333 12.0167H5.66667L4.93333 14H3.38333ZM6.08333 10.8H8.4L7.28333 7.58333H7.21667L6.08333 10.8ZM11.6167 10.6667V9.33333H16.5V10.6667H11.6167Z"> + </path> </g> <g id="font"> <path fill-rule="evenodd" clip-rule="evenodd" d="M2.66683 1.33301H13.3335C14.0668 1.33301 14.6668 1.93301 14.6668 2.66634V13.333C14.6668 14.0663 14.0668 14.6663 13.3335 14.6663H2.66683C1.9335 14.6663 1.3335 14.0663 1.3335 13.333V2.66634C1.3335 1.93301 1.9335 1.33301 2.66683 1.33301ZM2.66683 13.333H13.3335V2.66634H2.66683V13.333ZM7.12683 3.99967H8.86016L11.8668 11.9997H10.2002L9.52683 10.0863H6.46683L5.80016 11.9997H4.1335L7.12683 3.99967ZM8.3335 6.69301L9.04016 8.70634H6.9535L7.66683 6.69301L7.96016 5.73301H8.04683L8.3335 6.69301Z"></path> @@ -55,37 +55,37 @@ <path d="M6.97021 11.6666L8.84221 6.70236H9.70888L11.5878 11.6666H10.7489L10.2913 10.3909H8.26674L7.80914 11.6666H6.97021ZM10.0347 9.68369L9.48701 8.16529L9.29981 7.59676H9.25821L9.07101 8.16529L8.52328 9.68369H10.0347Z" fill="#3C4043"></path> </g> <g id="line-spacing-standard" viewBox="0 0 20 20"> - <path d="M16.9998 5H2.99951V7.00003H16.9998V5Z" fill="#3C4043"></path> - <path d="M16.9998 9H2.99951V11H16.9998V9Z" fill="#3C4043"></path> - <path d="M16.9998 13H2.99951V15H16.9998V13Z" fill="#3C4043"></path> + <path d="M16.9998 5H2.99951V7.00003H16.9998V5Z"></path> + <path d="M16.9998 9H2.99951V11H16.9998V9Z"></path> + <path d="M16.9998 13H2.99951V15H16.9998V13Z"></path> </g> <g id="line-spacing-loose" viewBox="0 0 20 20"> - <path d="M16.9998 4H2.99951V6.00003H16.9998V4Z" fill="#3C4043"></path> - <path d="M16.9998 9H2.99951V11H16.9998V9Z" fill="#3C4043"></path> - <path d="M16.9998 14H2.99951V16H16.9998V14Z" fill="#3C4043"></path> + <path d="M16.9998 4H2.99951V6.00003H16.9998V4Z"></path> + <path d="M16.9998 9H2.99951V11H16.9998V9Z"></path> + <path d="M16.9998 14H2.99951V16H16.9998V14Z"></path> </g> <g id="line-spacing-very-loose" viewBox="0 0 20 20"> - <path d="M16.9998 3H2.99951V5.00003H16.9998V3Z" fill="#3C4043"></path> - <path d="M16.9998 9H2.99951V11H16.9998V9Z" fill="#3C4043"></path> - <path d="M16.9998 15H2.99951V17H16.9998V15Z" fill="#3C4043"></path> + <path d="M16.9998 3H2.99951V5.00003H16.9998V3Z"></path> + <path d="M16.9998 9H2.99951V11H16.9998V9Z"></path> + <path d="M16.9998 15H2.99951V17H16.9998V15Z"></path> </g> <g id="letter-spacing-standard" viewBox="0 0 20 20"> - <path fill-rule="evenodd" clip-rule="evenodd" d="M2 0H0V2V10V12H2V10V2V0ZM12 0H10V2V10V12H12V10V2V0ZM6.16199 2.5H6.53606L9.21365 9.66648H7.6386L7.14159 8.15542H4.56589L4.07013 9.66648H2.5L5.16282 2.5H5.52705H6.16199ZM4.94538 6.99874H6.76114L5.85211 4.23502L4.94538 6.99874Z" fill="#3C4043"></path> + <path fill-rule="evenodd" clip-rule="evenodd" d="M2 0H0V2V10V12H2V10V2V0ZM12 0H10V2V10V12H12V10V2V0ZM6.16199 2.5H6.53606L9.21365 9.66648H7.6386L7.14159 8.15542H4.56589L4.07013 9.66648H2.5L5.16282 2.5H5.52705H6.16199ZM4.94538 6.99874H6.76114L5.85211 4.23502L4.94538 6.99874Z"></path> </g> <g id="letter-spacing-wide" viewBox="0 0 20 20"> - <path fill-rule="evenodd" clip-rule="evenodd" d="M5 4H3V6V14V16H5V14V6V4ZM17 4H15V6V14V16H17V14V6V4ZM10.162 6.5H10.5361L13.2136 13.6665H11.6386L11.1416 12.1554H8.56589L8.07013 13.6665H6.5L9.16282 6.5H9.52705H10.162ZM8.94538 10.9987H10.7611L9.85211 8.23502L8.94538 10.9987Z" fill="#3C4043"></path> + <path fill-rule="evenodd" clip-rule="evenodd" d="M5 4H3V6V14V16H5V14V6V4ZM17 4H15V6V14V16H17V14V6V4ZM10.162 6.5H10.5361L13.2136 13.6665H11.6386L11.1416 12.1554H8.56589L8.07013 13.6665H6.5L9.16282 6.5H9.52705H10.162ZM8.94538 10.9987H10.7611L9.85211 8.23502L8.94538 10.9987Z"></path> </g> <g id="letter-spacing-very-wide" viewBox="0 0 20 20"> - <path fill-rule="evenodd" clip-rule="evenodd" d="M4 4H2V6V14V16H4V14V6V4ZM18 4H16V6V14V16H18V14V6V4ZM10.162 6.5H10.5361L13.2136 13.6665H11.6386L11.1416 12.1554H8.56589L8.07013 13.6665H6.5L9.16282 6.5H9.52705H10.162ZM8.94538 10.9987H10.7611L9.85211 8.23502L8.94538 10.9987Z" fill="#3C4043"></path> + <path fill-rule="evenodd" clip-rule="evenodd" d="M4 4H2V6V14V16H4V14V6V4ZM18 4H16V6V14V16H18V14V6V4ZM10.162 6.5H10.5361L13.2136 13.6665H11.6386L11.1416 12.1554H8.56589L8.07013 13.6665H6.5L9.16282 6.5H9.52705H10.162ZM8.94538 10.9987H10.7611L9.85211 8.23502L8.94538 10.9987Z"></path> </g> <g id="play" viewBox="0 0 28 28" clip-path="url(#clip0_4781_260503)"> - <path fill_rule="evenodd" clip-rule="evenodd" d="M13.45 20.575L20.575 16L13.45 11.425V20.575ZM16 26.2C14.5833 26.2 13.25 25.9333 12 25.4C10.7667 24.8667 9.69167 24.1417 8.775 23.225C7.85833 22.3083 7.13333 21.2333 6.6 20C6.06667 18.75 5.8 17.4167 5.8 16C5.8 14.5833 6.06667 13.2583 6.6 12.025C7.13333 10.775 7.85833 9.69167 8.775 8.775C9.69167 7.85833 10.7667 7.13333 12 6.6C13.25 6.06667 14.5833 5.8 16 5.8C17.4167 5.8 18.7417 6.06667 19.975 6.6C21.225 7.13333 22.3083 7.85833 23.225 8.775C24.1417 9.69167 24.8667 10.775 25.4 12.025C25.9333 13.2583 26.2 14.5833 26.2 16C26.2 17.4167 25.9333 18.75 25.4 20C24.8667 21.2333 24.1417 22.3083 23.225 23.225C22.3083 24.1417 21.225 24.8667 19.975 25.4C18.7417 25.9333 17.4167 26.2 16 26.2Z" fill="#0B57D0"></path> + <path fill_rule="evenodd" clip-rule="evenodd" d="M13.45 20.575L20.575 16L13.45 11.425V20.575ZM16 26.2C14.5833 26.2 13.25 25.9333 12 25.4C10.7667 24.8667 9.69167 24.1417 8.775 23.225C7.85833 22.3083 7.13333 21.2333 6.6 20C6.06667 18.75 5.8 17.4167 5.8 16C5.8 14.5833 6.06667 13.2583 6.6 12.025C7.13333 10.775 7.85833 9.69167 8.775 8.775C9.69167 7.85833 10.7667 7.13333 12 6.6C13.25 6.06667 14.5833 5.8 16 5.8C17.4167 5.8 18.7417 6.06667 19.975 6.6C21.225 7.13333 22.3083 7.85833 23.225 8.775C24.1417 9.69167 24.8667 10.775 25.4 12.025C25.9333 13.2583 26.2 14.5833 26.2 16C26.2 17.4167 25.9333 18.75 25.4 20C24.8667 21.2333 24.1417 22.3083 23.225 23.225C22.3083 24.1417 21.225 24.8667 19.975 25.4C18.7417 25.9333 17.4167 26.2 16 26.2Z"></path> </g> <clipPath id="clip0_4781_260503"> <rect width="24" height="24" fill="white" transform="translate(4 4)"></rect> </clipPath> <g id="pause" clip-path="url(#clip0_4756_68262)" viewBox="0 0 28 28"> - <path fill_rule="evenodd" clip-rule="evenodd" d="M12.9 20.05H15V11.95H12.9V20.05ZM17 20.05H19.1V11.95H17V20.05ZM16 26.2C14.5833 26.2 13.25 25.9333 12 25.4C10.7667 24.8667 9.69167 24.1417 8.775 23.225C7.85833 22.3083 7.13333 21.2333 6.6 20C6.06667 18.75 5.8 17.4167 5.8 16C5.8 14.5833 6.06667 13.2583 6.6 12.025C7.13333 10.775 7.85833 9.69167 8.775 8.775C9.69167 7.85833 10.7667 7.13333 12 6.6C13.25 6.06667 14.5833 5.8 16 5.8C17.4167 5.8 18.7417 6.06667 19.975 6.6C21.225 7.13333 22.3083 7.85833 23.225 8.775C24.1417 9.69167 24.8667 10.775 25.4 12.025C25.9333 13.2583 26.2 14.5833 26.2 16C26.2 17.4167 25.9333 18.75 25.4 20C24.8667 21.2333 24.1417 22.3083 23.225 23.225C22.3083 24.1417 21.225 24.8667 19.975 25.4C18.7417 25.9333 17.4167 26.2 16 26.2Z" fill="#0B57D0"></path> + <path fill_rule="evenodd" clip-rule="evenodd" d="M12.9 20.05H15V11.95H12.9V20.05ZM17 20.05H19.1V11.95H17V20.05ZM16 26.2C14.5833 26.2 13.25 25.9333 12 25.4C10.7667 24.8667 9.69167 24.1417 8.775 23.225C7.85833 22.3083 7.13333 21.2333 6.6 20C6.06667 18.75 5.8 17.4167 5.8 16C5.8 14.5833 6.06667 13.2583 6.6 12.025C7.13333 10.775 7.85833 9.69167 8.775 8.775C9.69167 7.85833 10.7667 7.13333 12 6.6C13.25 6.06667 14.5833 5.8 16 5.8C17.4167 5.8 18.7417 6.06667 19.975 6.6C21.225 7.13333 22.3083 7.85833 23.225 8.775C24.1417 9.69167 24.8667 10.775 25.4 12.025C25.9333 13.2583 26.2 14.5833 26.2 16C26.2 17.4167 25.9333 18.75 25.4 20C24.8667 21.2333 24.1417 22.3083 23.225 23.225C22.3083 24.1417 21.225 24.8667 19.975 25.4C18.7417 25.9333 17.4167 26.2 16 26.2Z"></path> </g> <clipPath id="lip0_4756_68262"> <rect width="24" height="24" fill="white" transform="translate(4 4)"></rect>
diff --git a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html index 3b6ddeb..c29f9c5 100644 --- a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html +++ b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html
@@ -21,9 +21,7 @@ /* TODO(b/1465029): Investigate why chrome refresh colors don't always work on first launch. */ :host-context([chrome-refresh-2023]) cr-action-menu { - --cr-menu-background-color: var(--color-side-panel-menu-background, white); --cr-menu-border-radius: 8px; - --cr-primary-text-color: var(--color-side-panel-menu-foreground); } .floating-button { --cr-icon-button-icon-size: 20px;
diff --git a/chrome/browser/safe_browsing/BUILD.gn b/chrome/browser/safe_browsing/BUILD.gn index 32a8fcc..76afc98a 100644 --- a/chrome/browser/safe_browsing/BUILD.gn +++ b/chrome/browser/safe_browsing/BUILD.gn
@@ -306,6 +306,10 @@ "extension_telemetry/remote_host_contacted_signal.h", "extension_telemetry/remote_host_contacted_signal_processor.cc", "extension_telemetry/remote_host_contacted_signal_processor.h", + "extension_telemetry/tabs_api_signal.cc", + "extension_telemetry/tabs_api_signal.h", + "extension_telemetry/tabs_api_signal_processor.cc", + "extension_telemetry/tabs_api_signal_processor.h", "extension_telemetry/tabs_execute_script_signal.cc", "extension_telemetry/tabs_execute_script_signal.h", "extension_telemetry/tabs_execute_script_signal_processor.cc",
diff --git a/chrome/browser/safe_browsing/extension_telemetry/extension_signal.h b/chrome/browser/safe_browsing/extension_telemetry/extension_signal.h index 690e1a4e..93095fe 100644 --- a/chrome/browser/safe_browsing/extension_telemetry/extension_signal.h +++ b/chrome/browser/safe_browsing/extension_telemetry/extension_signal.h
@@ -20,7 +20,8 @@ kPotentialPasswordTheft = 4, kCookiesGet = 5, kDeclarativeNetRequest = 6, - kMaxValue = kDeclarativeNetRequest, + kTabsApi = 7, + kMaxValue = kTabsApi, }; // An abstract signal. Subclasses provide type-specific functionality to
diff --git a/chrome/browser/safe_browsing/extension_telemetry/extension_signal_util.cc b/chrome/browser/safe_browsing/extension_telemetry/extension_signal_util.cc index 6ae17d30..603c0394 100644 --- a/chrome/browser/safe_browsing/extension_telemetry/extension_signal_util.cc +++ b/chrome/browser/safe_browsing/extension_telemetry/extension_signal_util.cc
@@ -7,7 +7,7 @@ namespace safe_browsing { -std::string SanitizeURLWithoutFilename(const std::string url) { +std::string SanitizeURLWithoutFilename(std::string url) { return GURL(url).GetWithoutFilename().spec(); }
diff --git a/chrome/browser/safe_browsing/extension_telemetry/extension_signal_util.h b/chrome/browser/safe_browsing/extension_telemetry/extension_signal_util.h index 9279c60..ec44cc94 100644 --- a/chrome/browser/safe_browsing/extension_telemetry/extension_signal_util.h +++ b/chrome/browser/safe_browsing/extension_telemetry/extension_signal_util.h
@@ -9,7 +9,7 @@ namespace safe_browsing { // Strips the filename from the |url|. -std::string SanitizeURLWithoutFilename(const std::string url); +std::string SanitizeURLWithoutFilename(std::string url); } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal.cc b/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal.cc new file mode 100644 index 0000000..40655d39 --- /dev/null +++ b/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal.cc
@@ -0,0 +1,37 @@ +// Copyright 2023 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/safe_browsing/extension_telemetry/tabs_api_signal.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_util.h" +#include "chrome/browser/safe_browsing/extension_telemetry/extension_signal_util.h" + +namespace safe_browsing { + +TabsApiSignal::TabsApiSignal(const extensions::ExtensionId& extension_id, + TabsApiInfo::ApiMethod api_method, + const std::string& current_url, + const std::string& new_url) + : ExtensionSignal(extension_id), api_method_(api_method) { + if (!current_url.empty()) { + current_url_ = SanitizeURLWithoutFilename(current_url); + } + if (!new_url.empty()) { + new_url_ = SanitizeURLWithoutFilename(new_url); + } +} + +TabsApiSignal::~TabsApiSignal() = default; + +ExtensionSignalType TabsApiSignal::GetType() const { + return ExtensionSignalType::kTabsApi; +} + +std::string TabsApiSignal::GetUniqueCallDetailsId() const { + return base::JoinString({base::NumberToString(static_cast<int>(api_method_)), + current_url_, new_url_}, + ","); +} + +} // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal.h b/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal.h new file mode 100644 index 0000000..f3f930fe --- /dev/null +++ b/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal.h
@@ -0,0 +1,45 @@ +// Copyright 2023 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_SAFE_BROWSING_EXTENSION_TELEMETRY_TABS_API_SIGNAL_H_ +#define CHROME_BROWSER_SAFE_BROWSING_EXTENSION_TELEMETRY_TABS_API_SIGNAL_H_ + +#include <string> + +#include "chrome/browser/safe_browsing/extension_telemetry/extension_signal.h" +#include "components/safe_browsing/core/common/proto/csd.pb.h" + +namespace safe_browsing { + +using TabsApiInfo = ExtensionTelemetryReportRequest::SignalInfo::TabsApiInfo; + +// A signal that is created when an extension invokes chrome.tabs API methods. +class TabsApiSignal : public ExtensionSignal { + public: + TabsApiSignal(const extensions::ExtensionId& extension_id, + TabsApiInfo::ApiMethod api_method, + const std::string& current_url, + const std::string& new_url); + ~TabsApiSignal() override; + + // ExtensionSignal: + ExtensionSignalType GetType() const override; + + // Returns a unique id, which can be used to compare API arguments and as a + // key for storage (e.g., in a map). + std::string GetUniqueCallDetailsId() const; + + TabsApiInfo::ApiMethod api_method() const { return api_method_; } + const std::string& current_url() const { return current_url_; } + const std::string& new_url() const { return new_url_; } + + protected: + TabsApiInfo::ApiMethod api_method_; + std::string current_url_; + std::string new_url_; +}; + +} // namespace safe_browsing + +#endif // CHROME_BROWSER_SAFE_BROWSING_EXTENSION_TELEMETRY_TABS_EXECUTE_SCRIPT_SIGNAL_H_
diff --git a/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal_processor.cc b/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal_processor.cc new file mode 100644 index 0000000..2e80c97 --- /dev/null +++ b/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal_processor.cc
@@ -0,0 +1,102 @@ +// Copyright 2023 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/safe_browsing/extension_telemetry/tabs_api_signal_processor.h" +#include <string> + +#include "base/check_op.h" +#include "chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal.h" +#include "components/safe_browsing/core/common/proto/csd.pb.h" + +namespace safe_browsing { + +namespace { + +// Used to limit the number of unique API call details stored for each +// extension. +constexpr size_t kMaxUniqueCallDetails = 100; + +} // namespace + +TabsApiSignalProcessor::TabsApiInfoStoreEntry::TabsApiInfoStoreEntry() = + default; +TabsApiSignalProcessor::TabsApiInfoStoreEntry::~TabsApiInfoStoreEntry() = + default; +TabsApiSignalProcessor::TabsApiInfoStoreEntry::TabsApiInfoStoreEntry( + const TabsApiInfoStoreEntry& src) = default; +TabsApiSignalProcessor::TabsApiSignalProcessor() + : max_unique_call_details_(kMaxUniqueCallDetails) {} +TabsApiSignalProcessor::~TabsApiSignalProcessor() = default; + +void TabsApiSignalProcessor::ProcessSignal(const ExtensionSignal& signal) { + // Validate TabsApi signal. + DCHECK_EQ(ExtensionSignalType::kTabsApi, signal.GetType()); + const auto& tabs_api_signal = static_cast<const TabsApiSignal&>(signal); + // Ignore the signal if both URL (current and new) are empty (sanity check). + if (tabs_api_signal.current_url().empty() && + tabs_api_signal.new_url().empty()) { + return; + } + + // Retrieve the signal info store entry for this extension from the store. If + // this is the first signal for an extension, a new entry is created in the + // store. + TabsApiInfoStoreEntry& info_store_entry = + tabs_api_info_store_[tabs_api_signal.extension_id()]; + TabsApiCallDetailsMap& call_details_map = + info_store_entry.tabs_api_call_details_map; + + const std::string call_details_id = tabs_api_signal.GetUniqueCallDetailsId(); + auto call_details_it = call_details_map.find(call_details_id); + if (call_details_it != call_details_map.end()) { + // If a tabs API call with the same arguments has been invoked + // before, simply increment the count for the corresponding record. + auto count = call_details_it->second.count(); + call_details_it->second.set_count(count + 1); + } else if (call_details_map.size() < max_unique_call_details_) { + // For new call details, process the signal only if under max limit, i.e, + // add a new TabsApiCallDetails object to the call details map. + TabsApiCallDetails call_details; + call_details.set_method(tabs_api_signal.api_method()); + call_details.set_current_url(tabs_api_signal.current_url()); + call_details.set_new_url(tabs_api_signal.new_url()); + call_details.set_count(1); + call_details_map.emplace(call_details_id, call_details); + } +} + +std::unique_ptr<ExtensionTelemetryReportRequest_SignalInfo> +TabsApiSignalProcessor::GetSignalInfoForReport( + const extensions::ExtensionId& extension_id) { + auto tabs_api_info_store_entry = tabs_api_info_store_.find(extension_id); + if (tabs_api_info_store_entry == tabs_api_info_store_.end()) { + return nullptr; + } + + // Create the signal info protobuf. + auto signal_info = + std::make_unique<ExtensionTelemetryReportRequest_SignalInfo>(); + TabsApiInfo* tabs_api_info = signal_info->mutable_tabs_api_info(); + + for (auto& call_details : + tabs_api_info_store_entry->second.tabs_api_call_details_map) { + *tabs_api_info->add_call_details() = std::move(call_details.second); + } + + // Finally, clear the data in the info store. + tabs_api_info_store_.erase(tabs_api_info_store_entry); + + return signal_info; +} + +bool TabsApiSignalProcessor::HasDataToReportForTest() const { + return !tabs_api_info_store_.empty(); +} + +void TabsApiSignalProcessor::SetMaxUniqueCallDetailsForTest( + size_t max_unique_call_details) { + max_unique_call_details_ = max_unique_call_details; +} + +} // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal_processor.h b/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal_processor.h new file mode 100644 index 0000000..b3f59dfa --- /dev/null +++ b/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal_processor.h
@@ -0,0 +1,71 @@ +// Copyright 2023 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_SAFE_BROWSING_EXTENSION_TELEMETRY_TABS_API_SIGNAL_PROCESSOR_H_ +#define CHROME_BROWSER_SAFE_BROWSING_EXTENSION_TELEMETRY_TABS_API_SIGNAL_PROCESSOR_H_ + +#include <memory> +#include <string> + +#include "base/containers/flat_map.h" +#include "chrome/browser/safe_browsing/extension_telemetry/extension_signal_processor.h" +#include "components/safe_browsing/core/common/proto/csd.pb.h" + +namespace safe_browsing { + +class ExtensionSignal; +class ExtensionTelemetryReportRequest_SignalInfo; + +using TabsApiCallDetails = + ExtensionTelemetryReportRequest::SignalInfo::TabsApiInfo::CallDetails; + +// A class that processes chrome.tabs API signal data to generate telemetry +// reports. +class TabsApiSignalProcessor : public ExtensionSignalProcessor { + public: + TabsApiSignalProcessor(); + ~TabsApiSignalProcessor() override; + + TabsApiSignalProcessor(TabsApiSignalProcessor&) = delete; + TabsApiSignalProcessor& operator=(const TabsApiSignalProcessor&) = delete; + + // ExtensionSignalProcessor: + void ProcessSignal(const ExtensionSignal& signal) override; + std::unique_ptr<ExtensionTelemetryReportRequest_SignalInfo> + GetSignalInfoForReport(const extensions::ExtensionId& extension_id) override; + bool HasDataToReportForTest() const override; + + void SetMaxUniqueCallDetailsForTest(size_t max_unique_call_details); + + protected: + // Max number of unique API call details stored per extension. + // The signal processor only stores up to this number of unique API call + // details. + size_t max_unique_call_details_; + + // Stores a map of unique API call details. The key used is a string + // concatenation of the call arguments stored. + using TabsApiCallDetailsMap = base::flat_map<std::string, TabsApiCallDetails>; + + // Stores chrome.tabs API signal info for a single extension. If + // `max_unique_call_details_` is exceeded, no more call details will be + // recorded. + struct TabsApiInfoStoreEntry { + TabsApiInfoStoreEntry(); + ~TabsApiInfoStoreEntry(); + TabsApiInfoStoreEntry(const TabsApiInfoStoreEntry&); + + TabsApiCallDetailsMap tabs_api_call_details_map; + }; + + // Stores chrome.tabs API signal for multiple extensions, keyed by extension + // id. + using TabsApiInfoStore = + base::flat_map<extensions::ExtensionId, TabsApiInfoStoreEntry>; + TabsApiInfoStore tabs_api_info_store_; +}; + +} // namespace safe_browsing + +#endif // CHROME_BROWSER_SAFE_BROWSING_EXTENSION_TELEMETRY_TABS_API_SIGNAL_PROCESSOR_H_
diff --git a/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal_processor_unittest.cc b/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal_processor_unittest.cc new file mode 100644 index 0000000..0646ba8 --- /dev/null +++ b/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal_processor_unittest.cc
@@ -0,0 +1,199 @@ +// Copyright 2023 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/safe_browsing/extension_telemetry/tabs_api_signal_processor.h" +#include "chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal.h" +#include "components/safe_browsing/core/common/proto/csd.pb.h" +#include "extensions/common/extension_id.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace safe_browsing { + +namespace { + +using SignalInfo = ExtensionTelemetryReportRequest_SignalInfo; +using CallDetails = + ExtensionTelemetryReportRequest_SignalInfo_TabsApiInfo_CallDetails; + +constexpr const char* kExtensionIds[] = {"aaaaaaaabbbbbbbbccccccccdddddddd", + "eeeeeeeeffffffffgggggggghhhhhhhh", + "aaaaeeeebbbbffffccccggggddddhhhh"}; +constexpr TabsApiInfo::ApiMethod kApiMethods[] = { + TabsApiInfo::CREATE, TabsApiInfo::UPDATE, TabsApiInfo::REMOVE}; +constexpr const char* kUrls[] = {"http://www.example1.com/", + "https://www.example2.com/"}; + +class TabsApiSignalProcessorTest : public ::testing::Test { + protected: + TabsApiSignalProcessorTest() = default; + + TabsApiSignalProcessor processor_; +}; + +TEST_F(TabsApiSignalProcessorTest, EmptyProcessorWithNoData) { + EXPECT_FALSE(processor_.HasDataToReportForTest()); +} + +TEST_F(TabsApiSignalProcessorTest, IgnoresInvalidSignal) { + auto invalid_signal = TabsApiSignal(kExtensionIds[0], kApiMethods[0], + /*current_url=*/"", /*new_url=*/""); + processor_.ProcessSignal(invalid_signal); + // Verify that processor ignores the signal, i.e., it does not have any data + // to report. + EXPECT_FALSE(processor_.HasDataToReportForTest()); +} + +TEST_F(TabsApiSignalProcessorTest, StoresDataAfterProcessingSignal) { + auto signal = TabsApiSignal(kExtensionIds[0], kApiMethods[0], + /*current_url=*/"", kUrls[0]); + processor_.ProcessSignal(signal); + + // Verify that processor now has some data to report. + EXPECT_TRUE(processor_.HasDataToReportForTest()); + + // Verify that there is signal info only for the correct + // extension id. + EXPECT_TRUE(processor_.GetSignalInfoForReport(kExtensionIds[0])); + EXPECT_FALSE(processor_.GetSignalInfoForReport(kExtensionIds[1])); +} + +TEST_F(TabsApiSignalProcessorTest, + ReportsSignalInfoCorrectlyWithMultipleUniqueCallDetails) { + // Process 3 signals for extension 0, each containing the same call details. + for (int i = 0; i < 3; i++) { + auto signal = TabsApiSignal(kExtensionIds[0], kApiMethods[0], + /*current_url=*/"", kUrls[0]); + processor_.ProcessSignal(signal); + } + + // Process 3 signals for extension 1. Two signals contain the same + // call details as above, and the third contains a second (different) call + // details. + for (int i = 0; i < 2; i++) { + auto signal = TabsApiSignal(kExtensionIds[1], kApiMethods[0], + /*current_url=*/"", kUrls[0]); + processor_.ProcessSignal(signal); + } + { + auto signal = + TabsApiSignal(kExtensionIds[1], kApiMethods[1], kUrls[0], kUrls[1]); + processor_.ProcessSignal(signal); + } + + // Process 1 signal for extension 2. This signal contains different call + // details from the above. + { + auto signal = TabsApiSignal(kExtensionIds[2], kApiMethods[2], kUrls[0], + /*new_url=*/""); + processor_.ProcessSignal(signal); + } + + // Retrieve signal info for extension 0. + std::unique_ptr<SignalInfo> extension_0_signal_info = + processor_.GetSignalInfoForReport(kExtensionIds[0]); + ASSERT_NE(extension_0_signal_info, nullptr); + + // Verify that processor still has some data to report (for the other two + // extensions). + EXPECT_TRUE(processor_.HasDataToReportForTest()); + + // Retrieve signal info for extension 1. + std::unique_ptr<SignalInfo> extension_1_signal_info = + processor_.GetSignalInfoForReport(kExtensionIds[1]); + ASSERT_NE(extension_1_signal_info, nullptr); + + // Verify that processor still has some data to report (for the third + // extension). + EXPECT_TRUE(processor_.HasDataToReportForTest()); + + // Retrieve signal info for extension 2. + std::unique_ptr<SignalInfo> extension_2_signal_info = + processor_.GetSignalInfoForReport(kExtensionIds[2]); + ASSERT_NE(extension_2_signal_info, nullptr); + + // Verify that processor no longer has data to report. + EXPECT_FALSE(processor_.HasDataToReportForTest()); + + // Verify signal info contents for extension 0. + { + const TabsApiInfo& tabs_api_info = extension_0_signal_info->tabs_api_info(); + + // Verify data stored: only 1 unique call detail (3 API invocations). + ASSERT_EQ(tabs_api_info.call_details_size(), 1); + const CallDetails& call_details = tabs_api_info.call_details(0); + EXPECT_EQ(call_details.method(), kApiMethods[0]); + EXPECT_EQ(call_details.current_url(), ""); + EXPECT_EQ(call_details.new_url(), kUrls[0]); + EXPECT_EQ(call_details.count(), static_cast<uint32_t>(3)); + } + + // Verify signal info contents for extension 1. + { + const TabsApiInfo& tabs_api_info = extension_1_signal_info->tabs_api_info(); + + // Verify data stored: 2 unique call details (2 API invocations for the 1st, + // 1 for the 2nd). + ASSERT_EQ(tabs_api_info.call_details_size(), 2); + { + const CallDetails& call_details = tabs_api_info.call_details(0); + EXPECT_EQ(call_details.method(), kApiMethods[0]); + EXPECT_EQ(call_details.current_url(), ""); + EXPECT_EQ(call_details.new_url(), kUrls[0]); + EXPECT_EQ(call_details.count(), static_cast<uint32_t>(2)); + } + { + const CallDetails& call_details = tabs_api_info.call_details(1); + EXPECT_EQ(call_details.method(), kApiMethods[1]); + EXPECT_EQ(call_details.current_url(), kUrls[0]); + EXPECT_EQ(call_details.new_url(), kUrls[1]); + EXPECT_EQ(call_details.count(), static_cast<uint32_t>(1)); + } + } + + // Verify signal info contents for extension 2. + { + const TabsApiInfo& tabs_api_info = extension_2_signal_info->tabs_api_info(); + + // Verify data stored: only 1 unique call detail (1 API invocation). + ASSERT_EQ(tabs_api_info.call_details_size(), 1); + const CallDetails& call_details = tabs_api_info.call_details(0); + EXPECT_EQ(call_details.method(), kApiMethods[2]); + EXPECT_EQ(call_details.current_url(), kUrls[0]); + EXPECT_EQ(call_details.new_url(), ""); + EXPECT_EQ(call_details.count(), static_cast<uint32_t>(1)); + } +} + +TEST_F(TabsApiSignalProcessorTest, EnforcesMaxUniqueCallDetails) { + processor_.SetMaxUniqueCallDetailsForTest(1); + + // Process 3 signals for extension 0: + // - signals 1,2 have the same call details. + // - signals 3 has different call details. + for (int i = 0; i < 2; i++) { + auto signal = TabsApiSignal(kExtensionIds[0], kApiMethods[0], + /*current_url=*/"", kUrls[0]); + processor_.ProcessSignal(signal); + } + { + auto signal = + TabsApiSignal(kExtensionIds[0], kApiMethods[1], kUrls[0], kUrls[1]); + processor_.ProcessSignal(signal); + } + + // Retrieve signal info. + std::unique_ptr<SignalInfo> extension_signal_info = + processor_.GetSignalInfoForReport(kExtensionIds[0]); + const TabsApiInfo& tabs_api_info = extension_signal_info->tabs_api_info(); + + // Verify there is only 1 call details present with invocation count of 2. + // The 2nd call details is ignored because of the limit of 1. + ASSERT_EQ(tabs_api_info.call_details_size(), 1); + const CallDetails& call_details = tabs_api_info.call_details(0); + EXPECT_EQ(call_details.count(), static_cast<uint32_t>(2)); +} + +} // namespace + +} // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal_unittest.cc b/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal_unittest.cc new file mode 100644 index 0000000..b6bf14c --- /dev/null +++ b/chrome/browser/safe_browsing/extension_telemetry/tabs_api_signal_unittest.cc
@@ -0,0 +1,53 @@ +// Copyright 2023 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/safe_browsing/extension_telemetry/tabs_api_signal.h" +#include "components/safe_browsing/core/common/proto/csd.pb.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace safe_browsing { + +namespace { + +constexpr const char kUrl1[] = + "http://www.example.com/path1/index.html?q=test&id=5"; +constexpr const char kSanitizedUrl1[] = "http://www.example.com/path1/"; +constexpr const char kUrl2[] = + "http://www.example.com/path1/path2/index.html?q=test&id=5"; +constexpr const char kSanitizedUrl2[] = "http://www.example.com/path1/path2/"; + +TEST(TabsApiSignalTest, SanitizesUrls) { + TabsApiSignal signal = TabsApiSignal( + /*extension_id=*/"ext-0", + /*api_method=*/TabsApiInfo::UPDATE, + /*current_url=*/kUrl1, + /*new_url=*/kUrl2); + EXPECT_EQ(signal.current_url(), kSanitizedUrl1); + EXPECT_EQ(signal.new_url(), kSanitizedUrl2); +} + +TEST(TabsApiSignalTest, GeneratesIdWithAllArgsPresent) { + TabsApiSignal signal = TabsApiSignal( + /*extension_id=*/"ext-0", + /*api_method=*/TabsApiInfo::UPDATE, + /*current_url=*/kUrl1, + /*new_url=*/kUrl2); + std::string expected_id = + "2," + std::string(kSanitizedUrl1) + "," + std::string(kSanitizedUrl2); + EXPECT_EQ(signal.GetUniqueCallDetailsId(), expected_id); +} + +TEST(TabsApiSignalTest, GeneratesIdWithDefaultArgs) { + TabsApiSignal signal = TabsApiSignal( + /*extension_id=*/"ext-0", + /*api_method=*/TabsApiInfo::CREATE, + /*current_url=*/"", + /*new_url=*/kUrl2); + std::string expected_id = "1,," + std::string(kSanitizedUrl2); + EXPECT_EQ(signal.GetUniqueCallDetailsId(), expected_id); +} + +} // namespace + +} // namespace safe_browsing
diff --git a/chrome/browser/ssl/https_first_mode_settings_tracker.cc b/chrome/browser/ssl/https_first_mode_settings_tracker.cc index 493186b..7985743 100644 --- a/chrome/browser/ssl/https_first_mode_settings_tracker.cc +++ b/chrome/browser/ssl/https_first_mode_settings_tracker.cc
@@ -225,6 +225,11 @@ constexpr char kTimestampKey[] = "timestamp"; base::Time now = clock_->Now(); + if (!base::FeatureList::IsEnabled( + features::kHttpsFirstModeV2ForTypicallySecureUsers)) { + return false; + } + const base::Value::Dict& base_pref = profile_->GetPrefs()->GetDict(prefs::kHttpsUpgradeFallbacks);
diff --git a/chrome/browser/ssl/https_first_mode_settings_tracker_unittest.cc b/chrome/browser/ssl/https_first_mode_settings_tracker_unittest.cc index fbb76f1..cbf33f6 100644 --- a/chrome/browser/ssl/https_first_mode_settings_tracker_unittest.cc +++ b/chrome/browser/ssl/https_first_mode_settings_tracker_unittest.cc
@@ -4,11 +4,13 @@ #include "chrome/browser/ssl/https_first_mode_settings_tracker.h" #include "base/test/metrics/histogram_tester.h" +#include "base/test/scoped_feature_list.h" #include "base/test/simple_test_clock.h" #include "chrome/browser/safe_browsing/advanced_protection_status_manager.h" #include "chrome/browser/safe_browsing/advanced_protection_status_manager_factory.h" #include "chrome/browser/signin/identity_test_environment_profile_adaptor.h" #include "chrome/browser/ssl/stateful_ssl_host_state_delegate_factory.h" +#include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_profile.h" #include "components/security_interstitials/content/stateful_ssl_host_state_delegate.h" @@ -63,6 +65,9 @@ ASSERT_TRUE(service); base::HistogramTester histograms; + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + features::kHttpsFirstModeV2ForTypicallySecureUsers); site_engagement::SiteEngagementService* engagement_service = site_engagement::SiteEngagementService::Get(profile()); @@ -290,11 +295,54 @@ service->Shutdown(); } +// Tests the Typically Secure User heuristic to ensure that it respects the +// finch flag. See TypicallySecureUserPref for more details. +// Regression test for crbug.com/1475747. +TEST_F(HttpsFirstModeSettingsTrackerTest, + TypicallySecureUserDisabledByDefault) { + base::test::ScopedFeatureList feature_list; + + feature_list.InitAndDisableFeature( + features::kHttpsFirstModeV2ForTypicallySecureUsers); + + HttpsFirstModeService* service = + HttpsFirstModeServiceFactory::GetForProfile(profile()); + ASSERT_TRUE(service); + + // Typically Secure User heuristic requires a minimum total site engagement + // score. + site_engagement::SiteEngagementService* engagement_service = + site_engagement::SiteEngagementService::Get(profile()); + ASSERT_TRUE(engagement_service); + engagement_service->ResetBaseScoreForURL(GURL("https://google.com"), 90); + + base::SimpleTestClock clock; + base::Time now = base::Time::NowFromSystemTime(); + clock.SetNow(now); + service->SetClockForTesting(&clock); + // Move the clock so that the profile is old enough. + clock.SetNow(now + base::Days(10)); + + // This situation would normally qualify for enabling HFM, but it should stay + // disabled since the feature is disabled. + EXPECT_FALSE( + service->MaybeEnableHttpsFirstModeForUser(/*add_fallback_entry=*/true)); + EXPECT_FALSE( + service->MaybeEnableHttpsFirstModeForUser(/*add_fallback_entry=*/false)); + EXPECT_FALSE(profile()->GetPrefs()->GetBoolean(prefs::kHttpsOnlyModeEnabled)); + EXPECT_FALSE( + profile()->GetPrefs()->GetBoolean(prefs::kHttpsOnlyModeAutoEnabled)); +} + // Tests for the Typically Secure User heuristic. This test repeatedly calls // MaybeEnableHttpsFirstModeForUser which is normally called from HTTPS-Upgrade // fallbacks in production code. It then checks if the HTTPS-First Mode pref // is enabled. TEST_F(HttpsFirstModeSettingsTrackerTest, TypicallySecureUserPref) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + features::kHttpsFirstModeV2ForTypicallySecureUsers); + HttpsFirstModeService* service = HttpsFirstModeServiceFactory::GetForProfile(profile()); ASSERT_TRUE(service);
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBar.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBar.java index a7a95685..645946dd 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBar.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBar.java
@@ -46,6 +46,14 @@ */ void showUrlBarCursorWithoutFocusAnimations(); + /** + * Notifies the LocationBar to take necessary action after exiting from the NTP, while a + * hardware keyboard is connected. If the URL bar was previously focused on the NTP due to a + * connected keyboard, a navigation away from the NTP should clear this focus before filling the + * current tab's URL. + */ + void clearUrlBarCursorWithoutFocusAnimations(); + /** Selects all of the editable text in the {@link UrlBar}. */ void selectAll();
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java index 1ac4e2f..841fe07 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
@@ -365,6 +365,11 @@ } @Override + public void clearUrlBarCursorWithoutFocusAnimations() { + mLocationBarMediator.clearUrlBarCursorWithoutFocusAnimations(); + } + + @Override public void selectAll() { mUrlCoordinator.selectAll(); }
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java index 073d712a8..997e59b 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java
@@ -403,6 +403,19 @@ OmniboxFocusReason.DEFAULT_WITH_HARDWARE_KEYBOARD); } + /** + * If the URL bar was previously focused on the NTP due to a connected keyboard, an navigation + * away from the NTP should clear this focus before filling the current tab's URL. + */ + /*package */ void clearUrlBarCursorWithoutFocusAnimations() { + if (mUrlCoordinator.hasFocus() && mUrlFocusedWithoutAnimations) { + // If we did not run the focus animations, then the user has not typed any text. + // So, clear the focus and accept whatever URL the page is currently attempting to + // display, given that the current tab is not displaying the NTP. + setUrlBarFocus(false, null, OmniboxFocusReason.UNFOCUS); + } + } + /*package */ void revertChanges() { if (mUrlHasFocus) { GURL currentUrl = mLocationBarDataProvider.getCurrentGurl(); @@ -547,14 +560,7 @@ // If the URL is currently focused, do not replace the text they have entered with the URL. // Once they stop editing the URL, the current tab's URL will automatically be filled in. if (mUrlCoordinator.hasFocus()) { - if (mUrlFocusedWithoutAnimations && !UrlUtilities.isNTPUrl(currentUrl)) { - // If we did not run the focus animations, then the user has not typed any text. - // So, clear the focus and accept whatever URL the page is currently attempting to - // display. If the NTP is showing, the current page's URL should not be displayed. - setUrlBarFocus(false, null, OmniboxFocusReason.UNFOCUS); - } else { - return; - } + return; } mOriginalUrl = currentUrl;
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediatorTest.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediatorTest.java index be6d2829..f3fba6b 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediatorTest.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediatorTest.java
@@ -697,15 +697,19 @@ UrlBarData urlBarData = UrlBarData.forUrl(url); mMediator.setUrl(JUnitTestGURLs.getGURL(url), urlBarData); - verify(mUrlCoordinator) - .setUrlBarData( - urlBarData, UrlBar.ScrollType.SCROLL_TO_TLD, SelectionState.SELECT_ALL); - + // Assume that the URL bar is now focused without focus animations. doReturn(true).when(mUrlCoordinator).hasFocus(); mMediator.setIsUrlBarFocusedWithoutAnimationsForTesting(true); mMediator.setUrl(JUnitTestGURLs.getGURL(url), urlBarData); - verify(mUrlCoordinator).clearFocus(); + // Verify that setUrl() never clears focus when the URL bar is focused without animations. + verify(mUrlCoordinator, never()).clearFocus(); + + // Verify that setUrlBarData() was invoked exactly once, after the first invocation of + // setUrl() when the URL bar was not focused. + verify(mUrlCoordinator, times(1)) + .setUrlBarData( + urlBarData, UrlBar.ScrollType.SCROLL_TO_TLD, SelectionState.SELECT_ALL); } @Test @@ -1146,6 +1150,17 @@ .recordNavigationOnNtp(TEST_URL, PageTransition.GENERATED, true); } + @Test + public void testNotifyNtpExitedWithHardwareKeyboardConnected() { + // Assume that the URL bar is focused without animations on the NTP. + doReturn(true).when(mUrlCoordinator).hasFocus(); + mMediator.setIsUrlBarFocusedWithoutAnimationsForTesting(true); + + mMediator.clearUrlBarCursorWithoutFocusAnimations(); + // Verify that the omnibox focus is cleared on an exit from the NTP. + verify(mUrlCoordinator).clearFocus(); + } + private ArgumentMatcher<UrlBarData> matchesUrlBarDataForQuery(String query) { return actual -> { UrlBarData expected = UrlBarData.forNonUrlText(query);
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteController.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteController.java index a3c9b3cc..4b236f9 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteController.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteController.java
@@ -188,30 +188,32 @@ * Partially deletes an omnibox suggestion. * This call should be used by compound suggestion types (such as carousel) that host multiple * components inside (eg. MostVisitedTiles). - * @param matchIndex The position at which the match is located. - * @param elementIndex The element within the match that needs to be deleted. + * @param match the match to delete elements of + * @param elementIndex the element within the match that needs to be deleted */ @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) - public void deleteMatchElement(int matchIndex, int elementIndex) { + public void deleteMatchElement(AutocompleteMatch match, int elementIndex) { if (mNativeController == 0) return; - if (!mAutocompleteResult.verifyCoherency(matchIndex, VerificationPoint.DELETE_MATCH)) { + if (!mAutocompleteResult.verifyCoherency( + AutocompleteResult.NO_SUGGESTION_INDEX, VerificationPoint.DELETE_MATCH)) { return; } AutocompleteControllerJni.get().deleteMatchElement( - mNativeController, matchIndex, elementIndex); + mNativeController, match.getNativeObjectRef(), elementIndex); } /** * Deletes an omnibox suggestion, if possible. - * @param matchIndex The position at which the match is located. + * @param match the match to delete */ @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) - public void deleteMatch(int matchIndex) { + public void deleteMatch(AutocompleteMatch match) { if (mNativeController == 0) return; - if (!mAutocompleteResult.verifyCoherency(matchIndex, VerificationPoint.DELETE_MATCH)) { + if (!mAutocompleteResult.verifyCoherency( + AutocompleteResult.NO_SUGGESTION_INDEX, VerificationPoint.DELETE_MATCH)) { return; } - AutocompleteControllerJni.get().deleteMatch(mNativeController, matchIndex); + AutocompleteControllerJni.get().deleteMatch(mNativeController, match.getNativeObjectRef()); } @CalledByNative @@ -380,9 +382,9 @@ long nativeAutocompleteControllerAndroid, int matchIndex, WebContents webContents); void onOmniboxFocused(long nativeAutocompleteControllerAndroid, String omniboxText, String currentUrl, int pageClassification, String currentTitle); - void deleteMatchElement( - long nativeAutocompleteControllerAndroid, int matchIndex, int elementIndex); - void deleteMatch(long nativeAutocompleteControllerAndroid, int matchIndex); + void deleteMatchElement(long nativeAutocompleteControllerAndroid, + long nativeAutocompleteMatch, int elementIndex); + void deleteMatch(long nativeAutocompleteControllerAndroid, long nativeAutocompleteMatch); GURL updateMatchDestinationURLWithAdditionalAssistedQueryStats( long nativeAutocompleteControllerAndroid, int matchIndex, long elapsedTimeSinceInputChange, String newQueryText, String[] newQueryParams);
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java index b3ba622a..26d1f4c 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java
@@ -547,26 +547,23 @@ * Triggered when the user long presses the omnibox suggestion. * @param suggestion The suggestion selected. * @param titleText The title to display in the delete dialog. - * @param matchIndex The position of the suggestion. */ @Override - public void onDeleteMatch( - @NonNull AutocompleteMatch suggestion, @NonNull String titleText, int matchIndex) { - showDeleteDialog(suggestion, titleText, () -> mAutocomplete.deleteMatch(matchIndex)); + public void onDeleteMatch(@NonNull AutocompleteMatch suggestion, @NonNull String titleText) { + showDeleteDialog(suggestion, titleText, () -> mAutocomplete.deleteMatch(suggestion)); } /** * Triggered when the user long presses the omnibox suggestion element (eg. a tile). * @param suggestion The suggestion selected. * @param titleText The title to display in the delete dialog. - * @param matchIndex The position of the suggestion. * @param elementIndex The element of the suggestion to be deleted. */ @Override - public void onDeleteMatchElement(@NonNull AutocompleteMatch suggestion, - @NonNull String titleText, int matchIndex, int elementIndex) { + public void onDeleteMatchElement( + @NonNull AutocompleteMatch suggestion, @NonNull String titleText, int elementIndex) { showDeleteDialog(suggestion, titleText, - () -> mAutocomplete.deleteMatchElement(matchIndex, elementIndex)); + () -> mAutocomplete.deleteMatchElement(suggestion, elementIndex)); } /**
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionHost.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionHost.java index abf75b6..f6b9fdf 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionHost.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionHost.java
@@ -52,10 +52,8 @@ * * @param suggestion Long-pressed Suggestion. * @param titleText The title to display in the delete dialog. - * @param position The position of the suggestion on the list. */ - void onDeleteMatch( - @NonNull AutocompleteMatch suggestion, @NonNull String titleText, int position); + void onDeleteMatch(@NonNull AutocompleteMatch suggestion, @NonNull String titleText); /** * Triggered when the user long presses the omnibox suggestion element (eg. tile). @@ -64,11 +62,10 @@ * * @param suggestion Long-pressed Suggestion. * @param titleText The title to display in the delete dialog. - * @param position The position of the suggestion on the list. * @param element Element of the suggestion to be deleted. */ - void onDeleteMatchElement(@NonNull AutocompleteMatch suggestion, @NonNull String titleText, - int position, int element); + void onDeleteMatchElement( + @NonNull AutocompleteMatch suggestion, @NonNull String titleText, int element); /** * Triggered when the user selects a switch to tab action.
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionViewProcessor.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionViewProcessor.java index 3d28d32..f015fd3f 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionViewProcessor.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionViewProcessor.java
@@ -167,10 +167,9 @@ * Process the long-click event. * * @param suggestion Selected suggestion. - * @param position Position of the suggestion on the list. */ - protected void onSuggestionLongClicked(@NonNull AutocompleteMatch suggestion, int position) { - mSuggestionHost.onDeleteMatch(suggestion, suggestion.getDisplayText(), position); + protected void onSuggestionLongClicked(@NonNull AutocompleteMatch suggestion) { + mSuggestionHost.onDeleteMatch(suggestion, suggestion.getDisplayText()); } /** @@ -190,7 +189,7 @@ model.set(BaseSuggestionViewProperties.ON_CLICK, () -> onSuggestionClicked(suggestion, position)); model.set(BaseSuggestionViewProperties.ON_LONG_CLICK, - () -> onSuggestionLongClicked(suggestion, position)); + () -> onSuggestionLongClicked(suggestion)); model.set(BaseSuggestionViewProperties.ON_FOCUS_VIA_SELECTION, () -> mSuggestionHost.setOmniboxEditingText(suggestion.getFillIntoEdit())); setActionButtons(model, null);
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesProcessor.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesProcessor.java index a5d074b..f0909b9 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesProcessor.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesProcessor.java
@@ -118,8 +118,7 @@ final int elementIndexForDeletion = elementIndex; tileModel.set(TileViewProperties.ON_LONG_CLICK, v -> { - mSuggestionHost.onDeleteMatchElement( - suggestion, title, matchIndex, elementIndexForDeletion); + mSuggestionHost.onDeleteMatchElement(suggestion, title, elementIndexForDeletion); return true; });
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesProcessorUnitTest.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesProcessorUnitTest.java index 39c6efe..941fef2f 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesProcessorUnitTest.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesProcessorUnitTest.java
@@ -236,15 +236,15 @@ // element that is getting removed. tileList.get(1).model.get(TileViewProperties.ON_LONG_CLICK).onLongClick(null); ordered.verify(mSuggestionHost, times(1)) - .onDeleteMatchElement(eq(mMatch), eq("nav1"), eq(1), eq(1)); + .onDeleteMatchElement(eq(mMatch), eq("nav1"), eq(1)); tileList.get(2).model.get(TileViewProperties.ON_LONG_CLICK).onLongClick(null); ordered.verify(mSuggestionHost, times(1)) - .onDeleteMatchElement(eq(mMatch), eq("nav2"), eq(1), eq(2)); + .onDeleteMatchElement(eq(mMatch), eq("nav2"), eq(2)); tileList.get(0).model.get(TileViewProperties.ON_LONG_CLICK).onLongClick(null); ordered.verify(mSuggestionHost, times(1)) - .onDeleteMatchElement(eq(mMatch), eq("search1"), eq(1), eq(0)); + .onDeleteMatchElement(eq(mMatch), eq("search1"), eq(0)); verifyNoMoreInteractions(mSuggestionHost); verifyNoMoreInteractions(mImageSupplier);
diff --git a/chrome/browser/ui/ash/glanceables/glanceables_keyed_service.cc b/chrome/browser/ui/ash/glanceables/glanceables_keyed_service.cc index 0c05d43..841be46f 100644 --- a/chrome/browser/ui/ash/glanceables/glanceables_keyed_service.cc +++ b/chrome/browser/ui/ash/glanceables/glanceables_keyed_service.cc
@@ -49,18 +49,30 @@ pref_change_registrar_.Init(pref_service); pref_change_registrar_.Add( prefs::kGlanceablesEnabled, - base::BindRepeating(&GlanceablesKeyedService::UpdateRegistrationInAsh, + base::BindRepeating(&GlanceablesKeyedService::UpdateRegistration, base::Unretained(this))); - CreateClients(); + UpdateRegistration(); } GlanceablesKeyedService::~GlanceablesKeyedService() = default; void GlanceablesKeyedService::Shutdown() { - classroom_client_.reset(); - tasks_client_.reset(); - UpdateRegistrationInAsh(); + ClearClients(); +} + +bool GlanceablesKeyedService::AreGlanceablesEnabled() const { + PrefService* const prefs = profile_->GetPrefs(); + if (features::AreGlanceablesV2Enabled()) { + return prefs->GetBoolean(prefs::kGlanceablesEnabled); + } + + if (features::AreGlanceablesV2EnabledForTrustedTesters()) { + return prefs->IsManagedPreference(prefs::kGlanceablesEnabled) && + prefs->GetBoolean(prefs::kGlanceablesEnabled); + } + + return false; } std::unique_ptr<google_apis::RequestSender> @@ -84,7 +96,7 @@ /*custom_user_agent=*/std::string(), traffic_annotation_tag); } -void GlanceablesKeyedService::CreateClients() { +void GlanceablesKeyedService::RegisterClients() { const auto create_request_sender_callback = base::BindRepeating( &GlanceablesKeyedService::CreateRequestSenderForClient, base::Unretained(this)); @@ -94,10 +106,23 @@ tasks_client_ = std::make_unique<GlanceablesTasksClientImpl>( create_request_sender_callback); - UpdateRegistrationInAsh(); + Shell::Get()->glanceables_v2_controller()->UpdateClientsRegistration( + account_id_, GlanceablesV2Controller::ClientsRegistration{ + .classroom_client = classroom_client_.get(), + .tasks_client = tasks_client_.get()}); } -void GlanceablesKeyedService::UpdateRegistrationInAsh() const { +void GlanceablesKeyedService::ClearClients() { + classroom_client_.reset(); + tasks_client_.reset(); + if (Shell::HasInstance()) { + Shell::Get()->glanceables_v2_controller()->UpdateClientsRegistration( + account_id_, GlanceablesV2Controller::ClientsRegistration{ + .classroom_client = nullptr, .tasks_client = nullptr}); + } +} + +void GlanceablesKeyedService::UpdateRegistration() { if (!Shell::HasInstance()) { return; } @@ -108,17 +133,14 @@ CHECK(prefs); - if (!prefs->GetBoolean(prefs::kGlanceablesEnabled)) { - Shell::Get()->glanceables_v2_controller()->UpdateClientsRegistration( - account_id_, GlanceablesV2Controller::ClientsRegistration{ - .classroom_client = nullptr, .tasks_client = nullptr}); + if (!AreGlanceablesEnabled()) { + ClearClients(); return; } - Shell::Get()->glanceables_v2_controller()->UpdateClientsRegistration( - account_id_, GlanceablesV2Controller::ClientsRegistration{ - .classroom_client = classroom_client_.get(), - .tasks_client = tasks_client_.get()}); + if (!classroom_client_ || !tasks_client_) { + RegisterClients(); + } } } // namespace ash
diff --git a/chrome/browser/ui/ash/glanceables/glanceables_keyed_service.h b/chrome/browser/ui/ash/glanceables/glanceables_keyed_service.h index 593832a..093ec2f99 100644 --- a/chrome/browser/ui/ash/glanceables/glanceables_keyed_service.h +++ b/chrome/browser/ui/ash/glanceables/glanceables_keyed_service.h
@@ -53,6 +53,10 @@ void Shutdown() override; private: + // Returns whether glanceables are enabled for the profile that owns the + // GlanceablesKeyedService. + bool AreGlanceablesEnabled() const; + // Helper method that creates a `google_apis::RequestSender` instance. // `scopes` - OAuth 2 scopes needed for a client. // `traffic_annotation_tag` - describes requests issued by a client (for more @@ -62,11 +66,17 @@ const std::vector<std::string>& scopes, const net::NetworkTrafficAnnotationTag& traffic_annotation_tag) const; - // Creates clients needed to communicate with different Google services. - void CreateClients(); + // Creates clients needed to communicate with different Google services, and + // registers them with glanceables v2 controller in ash. + void RegisterClients(); - // Notifies `ash/` about created clients for `account_id_`. - void UpdateRegistrationInAsh() const; + // Resets clients needed to communicate with different Google services, and + // clears any existing registrations with glanceables v2 controller in ash. + void ClearClients(); + + // Creates or clear clients that communicated with Google services, and + // notifies `ash/` about created clients for `account_id_`. + void UpdateRegistration(); // The profile for which this keyed service was created. const raw_ptr<Profile, ExperimentalAsh> profile_;
diff --git a/chrome/browser/ui/ash/glanceables/glanceables_keyed_service_factory.cc b/chrome/browser/ui/ash/glanceables/glanceables_keyed_service_factory.cc index 2e70467..33ccf17 100644 --- a/chrome/browser/ui/ash/glanceables/glanceables_keyed_service_factory.cc +++ b/chrome/browser/ui/ash/glanceables/glanceables_keyed_service_factory.cc
@@ -29,7 +29,8 @@ content::BrowserContext* context) { return static_cast<GlanceablesKeyedService*>( GetInstance()->GetServiceForBrowserContext( - context, /*create=*/features::AreGlanceablesV2Enabled())); + context, /*create=*/features::AreGlanceablesV2Enabled() || + features::AreGlanceablesV2EnabledForTrustedTesters())); } std::unique_ptr<KeyedService>
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc index 9cdd6f05..f5d8be1 100644 --- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc +++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
@@ -22,7 +22,6 @@ #include "chrome/browser/feature_engagement/tracker_factory.h" #include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h" #include "chrome/browser/ui/autofill/autofill_popup_view.h" -#include "components/autofill/content/browser/content_autofill_driver.h" #include "components/autofill/core/browser/metrics/autofill_metrics.h" #include "components/autofill/core/browser/ui/autofill_popup_delegate.h" #include "components/autofill/core/browser/ui/popup_item_ids.h" @@ -30,7 +29,6 @@ #include "components/autofill/core/common/autofill_features.h" #include "components/feature_engagement/public/feature_constants.h" #include "components/feature_engagement/public/tracker.h" -#include "components/password_manager/content/browser/content_password_manager_driver.h" #include "components/strings/grit/components_strings.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_widget_host_view.h" @@ -615,25 +613,6 @@ (rwhv = rfh->GetView()) && rwhv->IsMouseLocked(); } -absl::variant<ContentAutofillDriver*, - password_manager::ContentPasswordManagerDriver*> -AutofillPopupControllerImpl::GetDriver() { - using PasswordManagerDriver = password_manager::PasswordManagerDriver; - using ContentPasswordManagerDriver = - password_manager::ContentPasswordManagerDriver; - absl::variant<AutofillDriver*, PasswordManagerDriver*> driver = - delegate_->GetDriver(); - DCHECK(absl::holds_alternative<AutofillDriver*>(driver) || - absl::holds_alternative<PasswordManagerDriver*>(driver)); - if (absl::holds_alternative<AutofillDriver*>(driver)) { - return static_cast<ContentAutofillDriver*>( - absl::get<AutofillDriver*>(driver)); - } else { - return static_cast<ContentPasswordManagerDriver*>( - absl::get<PasswordManagerDriver*>(driver)); - } -} - void AutofillPopupControllerImpl::SetViewForTesting( base::WeakPtr<AutofillPopupView> view) { view_ = std::move(view); @@ -645,8 +624,10 @@ return; // Retrieve the ax tree id associated with the current web contents. - ui::AXTreeID tree_id = absl::visit( - [](auto* driver) { return driver->GetAxTreeId(); }, GetDriver()); + ui::AXTreeID tree_id; + if (content::RenderFrameHost* rfh = web_contents_->GetFocusedFrame()) { + tree_id = rfh->GetAXTreeID(); + } // Retrieve the ax node id associated with the current web contents' element // that has a controller relation to the current autofill popup.
diff --git a/chrome/browser/ui/color/chrome_color_id.h b/chrome/browser/ui/color/chrome_color_id.h index 0780513..be36aa0 100644 --- a/chrome/browser/ui/color/chrome_color_id.h +++ b/chrome/browser/ui/color/chrome_color_id.h
@@ -513,6 +513,7 @@ E_CPONLY(kColorTabGroupDialogPurple) \ E_CPONLY(kColorTabGroupDialogCyan) \ E_CPONLY(kColorTabGroupDialogOrange) \ + E_CPONLY(kColorTabGroupDialogIconEnabled) \ /* The colors used for tab groups in the context submenu. */ \ E_CPONLY(kColorTabGroupContextMenuBlue) \ E_CPONLY(kColorTabGroupContextMenuCyan) \
diff --git a/chrome/browser/ui/color/material_chrome_color_mixer.cc b/chrome/browser/ui/color/material_chrome_color_mixer.cc index fd06204..ce592b5 100644 --- a/chrome/browser/ui/color/material_chrome_color_mixer.cc +++ b/chrome/browser/ui/color/material_chrome_color_mixer.cc
@@ -94,6 +94,9 @@ // Side Panel colors. mixer[kColorSidePanelBackground] = {ui::kColorSysBaseContainer}; + // Tab Group Dialog colors. + mixer[kColorTabGroupDialogIconEnabled] = {ui::kColorSysOnSurfaceSubtle}; + if (!ShouldApplyChromeMaterialOverrides(key)) { return; }
diff --git a/chrome/browser/ui/hats/trust_safety_sentiment_service.cc b/chrome/browser/ui/hats/trust_safety_sentiment_service.cc index 7b3df17..4b55c687 100644 --- a/chrome/browser/ui/hats/trust_safety_sentiment_service.cc +++ b/chrome/browser/ui/hats/trust_safety_sentiment_service.cc
@@ -8,6 +8,7 @@ #include "base/metrics/histogram_functions.h" #include "base/rand_util.h" #include "base/task/sequenced_task_runner.h" +#include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/ui/hats/hats_service.h" #include "chrome/browser/ui/hats/hats_service_factory.h" @@ -365,16 +366,16 @@ std::map<std::string, bool> product_specific_data; product_specific_data["Stable channel"] = (chrome::GetChannel() == version_info::Channel::STABLE) ? true : false; - bool blockCookies = - HostContentSettingsMapFactory::GetForProfile(profile_) - ->GetDefaultContentSetting(ContentSettingsType::COOKIES) == - ContentSetting::CONTENT_SETTING_BLOCK; - blockCookies = - blockCookies || + scoped_refptr<content_settings::CookieSettings> cookie_settings = + CookieSettingsFactory::GetForProfile(profile_); + bool block_cookies = cookie_settings->GetDefaultCookieSetting() == + ContentSetting::CONTENT_SETTING_BLOCK; + block_cookies = + block_cookies || (static_cast<content_settings::CookieControlsMode>( profile_->GetPrefs()->GetInteger(prefs::kCookieControlsMode)) == content_settings::CookieControlsMode::kBlockThirdParty); - product_specific_data["3P cookies blocked"] = blockCookies ? true : false; + product_specific_data["3P cookies blocked"] = block_cookies ? true : false; product_specific_data["Privacy Sandbox enabled"] = profile_->GetPrefs()->GetBoolean(prefs::kPrivacySandboxApisEnabledV2) ? true
diff --git a/chrome/browser/ui/side_panel/companion/companion_utils.cc b/chrome/browser/ui/side_panel/companion/companion_utils.cc index 05f36cd..cbb3a59 100644 --- a/chrome/browser/ui/side_panel/companion/companion_utils.cc +++ b/chrome/browser/ui/side_panel/companion/companion_utils.cc
@@ -111,6 +111,24 @@ ShouldEnableOpenCompanionForImageSearch(); } +bool IsNewBadgeEnabledForSearchWebMenuItem(const Browser* browser) { + if (!browser) { + return false; + } + return IsSearchWebInCompanionSidePanelSupported(browser) && + base::FeatureList::IsEnabled( + features::kCompanionEnableNewBadgesInContextMenu); +} + +bool IsNewBadgeEnabledForSearchImageMenuItem(const Browser* browser) { + if (!browser) { + return false; + } + return IsSearchImageInCompanionSidePanelSupported(browser) && + base::FeatureList::IsEnabled( + features::kCompanionEnableNewBadgesInContextMenu); +} + void UpdateCompanionDefaultPinnedToToolbarState(PrefService* pref_service) { absl::optional<bool> should_force_pin = switches::ShouldForceOverrideCompanionPinState();
diff --git a/chrome/browser/ui/side_panel/companion/companion_utils.h b/chrome/browser/ui/side_panel/companion/companion_utils.h index aa1a61df..2aaccbca 100644 --- a/chrome/browser/ui/side_panel/companion/companion_utils.h +++ b/chrome/browser/ui/side_panel/companion/companion_utils.h
@@ -46,6 +46,11 @@ // Google. bool IsSearchImageInCompanionSidePanelSupported(const Browser* browser); +// Return true if companion feature is enabled and feature for enabling "new" +// badges on context menu items is enabled. +bool IsNewBadgeEnabledForSearchImageMenuItem(const Browser* browser); +bool IsNewBadgeEnabledForSearchWebMenuItem(const Browser* browser); + // Updated the default value for the pref used to determine whether companion // should be pinned to the toolbar by default. void UpdateCompanionDefaultPinnedToToolbarState(PrefService* pref_service);
diff --git a/chrome/browser/ui/ui_features.cc b/chrome/browser/ui/ui_features.cc index 5aa67c3a..7820800 100644 --- a/chrome/browser/ui/ui_features.cc +++ b/chrome/browser/ui/ui_features.cc
@@ -9,6 +9,7 @@ #include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "components/flags_ui/feature_entry.h" +#include "ui/base/ui_base_features.h" namespace features { @@ -220,6 +221,15 @@ const char kTabHoverCardAdditionalMaxWidthDelay[] = "additional_max_width_delay"; +BASE_FEATURE(kTabOrganization, + "TabOrganization", + base::FEATURE_DISABLED_BY_DEFAULT); + +bool IsTabOrganization() { + return IsChromeRefresh2023() && + base::FeatureList::IsEnabled(features::kTabOrganization); +} + BASE_FEATURE(kTabSearchChevronIcon, "TabSearchChevronIcon", base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/chrome/browser/ui/ui_features.h b/chrome/browser/ui/ui_features.h index 457335a8..9080d5a 100644 --- a/chrome/browser/ui/ui_features.h +++ b/chrome/browser/ui/ui_features.h
@@ -127,6 +127,9 @@ // typically when there are less than 5 or 6 tabs in a browser window. extern const char kTabHoverCardAdditionalMaxWidthDelay[]; +BASE_DECLARE_FEATURE(kTabOrganization); +bool IsTabOrganization(); + BASE_DECLARE_FEATURE(kTabSearchChevronIcon); BASE_DECLARE_FEATURE(kTabSearchFeedback);
diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_contents_view.cc b/chrome/browser/ui/views/download/bubble/download_bubble_contents_view.cc index 94a15c7..de4fb6c 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_contents_view.cc +++ b/chrome/browser/ui/views/download/bubble/download_bubble_contents_view.cc
@@ -9,6 +9,7 @@ #include "chrome/browser/download/bubble/download_bubble_prefs.h" #include "chrome/browser/download/bubble/download_bubble_ui_controller.h" #include "chrome/browser/download/download_item_warning_data.h" +#include "chrome/browser/safe_browsing/download_protection/download_protection_service.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/views/download/bubble/download_bubble_partial_view.h" #include "chrome/browser/ui/views/download/bubble/download_bubble_primary_view.h" @@ -128,6 +129,34 @@ } } +void DownloadBubbleContentsView::ProcessDeepScanPress( + const ContentId& id, + const std::string& password) { + if (DownloadUIModel* model = GetDownloadModel(id); model) { + safe_browsing::DownloadProtectionService::UploadForConsumerDeepScanning( + model->GetDownloadItem(), password); + } +} + +bool DownloadBubbleContentsView::IsEncryptedArchive(const ContentId& id) { + if (DownloadUIModel* model = GetDownloadModel(id); model) { + return DownloadItemWarningData::IsEncryptedArchive( + model->GetDownloadItem()); + } + + return false; +} + +bool DownloadBubbleContentsView::HasPreviousIncorrectPassword( + const ContentId& id) { + if (DownloadUIModel* model = GetDownloadModel(id); model) { + return DownloadItemWarningData::HasIncorrectPassword( + model->GetDownloadItem()); + } + + return false; +} + void DownloadBubbleContentsView::SwitchToCurrentPage( absl::optional<ContentId> id) { primary_view_->SetVisible(false);
diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_contents_view.h b/chrome/browser/ui/views/download/bubble/download_bubble_contents_view.h index abf9ebdf..f0845560 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_contents_view.h +++ b/chrome/browser/ui/views/download/bubble/download_bubble_contents_view.h
@@ -76,6 +76,10 @@ void AddSecuritySubpageWarningActionEvent( const offline_items_collection::ContentId& id, DownloadItemWarningData::WarningAction action) override; + void ProcessDeepScanPress(const ContentId& id, + const std::string& password) override; + bool IsEncryptedArchive(const ContentId& id) override; + bool HasPreviousIncorrectPassword(const ContentId& id) override; // Gets the row view at the given index. DownloadBubbleRowView* GetPrimaryViewRowForTesting(size_t index);
diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_security_view.cc b/chrome/browser/ui/views/download/bubble/download_bubble_security_view.cc index 317803ba..126f182f 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_security_view.cc +++ b/chrome/browser/ui/views/download/bubble/download_bubble_security_view.cc
@@ -7,12 +7,14 @@ #include "base/containers/fixed_flat_map.h" #include "base/metrics/histogram_functions.h" #include "base/strings/strcat.h" +#include "base/strings/utf_string_conversions.h" #include "chrome/browser/download/download_commands.h" #include "chrome/browser/download/download_item_model.h" #include "chrome/browser/download/download_ui_model.h" #include "chrome/browser/download/offline_item_utils.h" #include "chrome/browser/ui/layout_constants.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" +#include "chrome/browser/ui/views/download/bubble/download_bubble_password_prompt_view.h" #include "chrome/browser/ui/views/download/bubble/download_bubble_row_view.h" #include "chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h" #include "chrome/grit/generated_resources.h" @@ -401,7 +403,7 @@ secondary_styled_label_->PreferredSizeChanged(); } -void DownloadBubbleSecurityView::AddIconAndText() { +void DownloadBubbleSecurityView::AddIconAndContents() { const int side_margin = ChromeLayoutProvider::Get()->GetDistanceMetric( views::DISTANCE_RELATED_CONTROL_VERTICAL); const int icon_label_spacing = ChromeLayoutProvider::Get()->GetDistanceMetric( @@ -495,6 +497,8 @@ // paragraph spacing between them. learn_more_link_->SetProperty(views::kMarginsKey, gfx::Insets().set_top(kAfterParagraphSpacing)); + + AddPasswordPrompt(wrapper); } void DownloadBubbleSecurityView::AddSecondaryIconAndText() { @@ -581,6 +585,23 @@ progress_bar_->SetVisible(false); } +void DownloadBubbleSecurityView::AddPasswordPrompt(views::View* parent) { + password_prompt_ = parent->AddChildView( + std::make_unique<DownloadBubblePasswordPromptView>()); + password_prompt_->SetVisible(false); + password_prompt_->SetProperty( + views::kFlexBehaviorKey, + views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToMinimum, + views::MaximumFlexSizeRule::kUnbounded, + /*adjust_height_for_width=*/false)); + password_prompt_->SetProperty( + views::kMarginsKey, + gfx::Insets::VH(ChromeLayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL), + 0)); + UpdatePasswordPrompt(); +} + bool DownloadBubbleSecurityView::ProcessButtonClick( DownloadCommands::Command command, bool is_secondary_button) { @@ -592,6 +613,12 @@ return true; } + if (command == DownloadCommands::DEEP_SCAN && + base::FeatureList::IsEnabled( + safe_browsing::kDeepScanningEncryptedArchives)) { + return ProcessDeepScanClick(); + } + // Record metrics only if we are actually processing the command. RecordWarningActionTime(is_secondary_button); base::UmaHistogramEnumeration( @@ -679,6 +706,25 @@ progress_bar_->SetValue(-1); } +void DownloadBubbleSecurityView::UpdatePasswordPrompt() { + if (!base::FeatureList::IsEnabled( + safe_browsing::kDeepScanningEncryptedArchives)) { + return; + } + + bool should_show = + danger_type_ == download::DOWNLOAD_DANGER_TYPE_PROMPT_FOR_SCANNING && + delegate_->IsEncryptedArchive(content_id_); + + DownloadBubblePasswordPromptView::State state = + delegate_->HasPreviousIncorrectPassword(content_id_) + ? DownloadBubblePasswordPromptView::State::kInvalid + : DownloadBubblePasswordPromptView::State::kValid; + + password_prompt_->SetVisible(should_show); + password_prompt_->SetState(state); +} + void DownloadBubbleSecurityView::ClearWideFields() { bubble_delegate_->set_fixed_width(0); bubble_delegate_->SetButtonLabel(ui::DIALOG_BUTTON_CANCEL, std::u16string()); @@ -793,6 +839,7 @@ UpdateIconAndText(); UpdateSecondaryIconAndText(); UpdateProgressBar(); + UpdatePasswordPrompt(); bubble_delegate_->SizeToContents(); } @@ -832,7 +879,7 @@ SetProperty(views::kMarginsKey, GetLayoutInsets(DOWNLOAD_ROW)); } AddHeader(); - AddIconAndText(); + AddIconAndContents(); AddSecondaryIconAndText(); AddProgressBar(); } @@ -867,5 +914,19 @@ GetLayoutInsets(DOWNLOAD_ICON).width() - icon_label_spacing; } +bool DownloadBubbleSecurityView::ProcessDeepScanClick() { + if (delegate_->IsEncryptedArchive(content_id_) && + password_prompt_->GetText().empty()) { + password_prompt_->SetState( + DownloadBubblePasswordPromptView::State::kInvalidEmpty); + bubble_delegate_->SizeToContents(); + } else { + delegate_->ProcessDeepScanPress( + content_id_, base::UTF16ToUTF8(password_prompt_->GetText())); + } + + return false; +} + BEGIN_METADATA(DownloadBubbleSecurityView, views::View) END_METADATA
diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_security_view.h b/chrome/browser/ui/views/download/bubble/download_bubble_security_view.h index 2ffdeb4..d6875e3 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_security_view.h +++ b/chrome/browser/ui/views/download/bubble/download_bubble_security_view.h
@@ -29,6 +29,7 @@ class DownloadBubbleNavigationHandler; class ParagraphsView; +class DownloadBubblePasswordPromptView; class DownloadBubbleSecurityView : public views::View, public download::DownloadItem::Observer { @@ -47,6 +48,21 @@ virtual void AddSecuritySubpageWarningActionEvent( const offline_items_collection::ContentId& id, DownloadItemWarningData::WarningAction action) = 0; + + // Processes the deep scan being pressed, when the given password is + // provided. + virtual void ProcessDeepScanPress( + const offline_items_collection::ContentId& id, + const std::string& password) = 0; + + // Return whether the download item is an encrypted archive. + virtual bool IsEncryptedArchive( + const offline_items_collection::ContentId& id) = 0; + + // Return whether the download item has a previously provided invalid + // password. + virtual bool HasPreviousIncorrectPassword( + const offline_items_collection::ContentId& id) = 0; }; METADATA_HEADER(DownloadBubbleSecurityView); @@ -105,9 +121,10 @@ void AddHeader(); void CloseBubble(); void OnCheckboxClicked(); - void AddIconAndText(); + void AddIconAndContents(); void AddSecondaryIconAndText(); void AddProgressBar(); + void AddPasswordPrompt(views::View* parent); void UpdateViews(); void UpdateHeader(); @@ -120,6 +137,7 @@ bool has_checkbox); void UpdateButtons(); void UpdateProgressBar(); + void UpdatePasswordPrompt(); // Reset fields that increase the width of the bubble. void ClearWideFields(); @@ -132,6 +150,10 @@ // Minimum width for the subpage summary. int GetMinimumLabelWidth() const; + // Deep scanning is complicated enough that this button click is separate from + // the others. + bool ProcessDeepScanClick(); + // Must outlive this. const raw_ptr<Delegate> delegate_; @@ -168,6 +190,7 @@ raw_ptr<views::StyledLabel> deep_scanning_link_ = nullptr; raw_ptr<views::StyledLabel> learn_more_link_ = nullptr; raw_ptr<views::ProgressBar> progress_bar_ = nullptr; + raw_ptr<DownloadBubblePasswordPromptView> password_prompt_ = nullptr; // Records the last time this was shown or updated for a new download. Used // for metrics.
diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_security_view_unittest.cc b/chrome/browser/ui/views/download/bubble/download_bubble_security_view_unittest.cc index 6d35d65..9ea4bd5 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_security_view_unittest.cc +++ b/chrome/browser/ui/views/download/bubble/download_bubble_security_view_unittest.cc
@@ -106,6 +106,10 @@ item, WarningSurface::BUBBLE_SUBPAGE, action); } + void ProcessDeepScanPress(const ContentId&, const std::string&) override {} + bool IsEncryptedArchive(const ContentId&) override { return false; } + bool HasPreviousIncorrectPassword(const ContentId&) override { return false; } + void set_should_close(bool should_close) { should_close_ = should_close; } private:
diff --git a/chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc b/chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc index a2e8550..f25a314a 100644 --- a/chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc +++ b/chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc
@@ -9,6 +9,7 @@ #include "chrome/browser/ui/views/frame/browser_frame_view_linux.h" #include "chrome/browser/ui/views/frame/browser_frame_view_paint_utils_linux.h" #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h" +#include "ui/base/ui_base_features.h" namespace { @@ -65,5 +66,7 @@ } int BrowserFrameViewLayoutLinux::NonClientExtraTopThickness() const { - return kExtraTopBorder; + return (features::IsChromeRefresh2023() && delegate_->IsTabStripVisible()) + ? 0 + : kExtraTopBorder; }
diff --git a/chrome/browser/ui/views/location_bar/cookie_controls/cookie_controls_bubble_view_pixel_test.cc b/chrome/browser/ui/views/location_bar/cookie_controls/cookie_controls_bubble_view_pixel_test.cc index 2bce298..ccc6daa 100644 --- a/chrome/browser/ui/views/location_bar/cookie_controls/cookie_controls_bubble_view_pixel_test.cc +++ b/chrome/browser/ui/views/location_bar/cookie_controls/cookie_controls_bubble_view_pixel_test.cc
@@ -89,12 +89,6 @@ scoped_feature_list_.InitAndEnableFeatureWithParameters( content_settings::features::kUserBypassUI, {{"expiration", std::get<1>(GetParam())}}); - - // Overriding `base::Time::Now()` to obtain a consistent X days until - // exception expiration calculation regardless of the time the test runs. - base::subtle::ScopedTimeClockOverrides time_override( - &CookieControlsBubbleViewPixelTest::GetReferenceTime, - /*time_ticks_override=*/nullptr, /*thread_ticks_override=*/nullptr); } void TearDownOnMainThread() override { @@ -161,7 +155,7 @@ static base::Time GetReferenceTime() { base::Time time; - EXPECT_TRUE(base::Time::FromString("Sat, 1 Sep 2023 11:00:00", &time)); + EXPECT_TRUE(base::Time::FromString("Sat, 1 Sep 2023 11:00:00 UTC", &time)); return time; } @@ -198,19 +192,18 @@ net::EmbeddedTestServer* https_test_server() { return https_server_.get(); } private: + // Overriding `base::Time::Now()` to obtain a consistent X days until + // exception expiration calculation regardless of the time the test runs. + base::subtle::ScopedTimeClockOverrides time_override_{ + &CookieControlsBubbleViewPixelTest::GetReferenceTime, + /*time_ticks_override=*/nullptr, /*thread_ticks_override=*/nullptr}; std::unique_ptr<net::EmbeddedTestServer> https_server_; base::test::ScopedFeatureList scoped_feature_list_; raw_ptr<CookieControlsIconView> cookie_controls_icon_; raw_ptr<CookieControlsBubbleCoordinator> cookie_controls_coordinator_; }; -// Disabled on Windows due to flakes; see https://crbug.com/1472744. -#if BUILDFLAG(IS_WIN) -#define MAYBE_InvokeUi DISABLED_InvokeUi -#else -#define MAYBE_InvokeUi InvokeUi -#endif -IN_PROC_BROWSER_TEST_P(CookieControlsBubbleViewPixelTest, MAYBE_InvokeUi) { +IN_PROC_BROWSER_TEST_P(CookieControlsBubbleViewPixelTest, InvokeUi) { ShowAndVerifyUi(); }
diff --git a/chrome/browser/ui/views/location_bar/cookie_controls/cookie_controls_interactive_uitest.cc b/chrome/browser/ui/views/location_bar/cookie_controls/cookie_controls_interactive_uitest.cc index e9400d7d..57e56040 100644 --- a/chrome/browser/ui/views/location_bar/cookie_controls/cookie_controls_interactive_uitest.cc +++ b/chrome/browser/ui/views/location_bar/cookie_controls/cookie_controls_interactive_uitest.cc
@@ -49,12 +49,6 @@ CookieControlsInteractiveUiTest() { https_server_ = std::make_unique<net::EmbeddedTestServer>( net::EmbeddedTestServer::TYPE_HTTPS); - - // Overriding `base::Time::Now()` to obtain a consistent X days until - // exception expiration calculation regardless of the time the test runs. - base::subtle::ScopedTimeClockOverrides time_override( - &CookieControlsInteractiveUiTest::GetReferenceTime, - /*time_ticks_override=*/nullptr, /*thread_ticks_override=*/nullptr); } ~CookieControlsInteractiveUiTest() override = default; @@ -180,10 +174,16 @@ static base::Time GetReferenceTime() { base::Time time; - EXPECT_TRUE(base::Time::FromString("Sat, 1 Sep 2023 11:00:00", &time)); + EXPECT_TRUE(base::Time::FromString("Sat, 1 Sep 2023 11:00:00 UTC", &time)); return time; } + // Overriding `base::Time::Now()` to obtain a consistent X days until + // exception expiration calculation regardless of the time the test runs. + base::subtle::ScopedTimeClockOverrides time_override_{ + &CookieControlsInteractiveUiTest::GetReferenceTime, + /*time_ticks_override=*/nullptr, /*thread_ticks_override=*/nullptr}; + base::UserActionTester user_actions_; feature_engagement::test::ScopedIphFeatureList iph_feature_list_; std::unique_ptr<net::EmbeddedTestServer> https_server_;
diff --git a/chrome/browser/ui/views/side_panel/search_companion/companion_page_browsertest.cc b/chrome/browser/ui/views/side_panel/search_companion/companion_page_browsertest.cc index f079664..de6eefd 100644 --- a/chrome/browser/ui/views/side_panel/search_companion/companion_page_browsertest.cc +++ b/chrome/browser/ui/views/side_panel/search_companion/companion_page_browsertest.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 "base/base64.h" +#include "base/base64url.h" #include "base/base_paths.h" #include "base/feature_list.h" #include "base/files/file_path.h" @@ -434,10 +434,12 @@ companion::proto::CompanionUrlParams DeserializeCompanionRequest( const std::string& companion_url_param) { + std::string serialized_proto; + EXPECT_TRUE(base::Base64UrlDecode( + companion_url_param, base::Base64UrlDecodePolicy::DISALLOW_PADDING, + &serialized_proto)); + companion::proto::CompanionUrlParams proto; - auto base64_decoded = base::Base64Decode(companion_url_param); - auto serialized_proto = std::string(base64_decoded.value().begin(), - base64_decoded.value().end()); EXPECT_TRUE(proto.ParseFromString(serialized_proto)); return proto; }
diff --git a/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc b/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc index d0c66733..aa2086d2 100644 --- a/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc +++ b/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc
@@ -443,8 +443,13 @@ enabled ? views::Button::STATE_NORMAL : views::Button::STATE_DISABLED; const SkColor text_color = menu_item->GetCurrentTextColor(); - const SkColor icon_color = - enabled ? color_utils::DeriveDefaultIconColor(text_color) : text_color; + + const auto* const color_provider = GetColorProvider(); + const SkColor enabled_icon_color = + features::IsChromeRefresh2023() + ? color_provider->GetColor(kColorTabGroupDialogIconEnabled) + : color_utils::DeriveDefaultIconColor(text_color); + const SkColor icon_color = enabled ? enabled_icon_color : text_color; const ui::ImageModel& old_image_model = menu_item->GetImageModel(button_state);
diff --git a/chrome/browser/ui/views/tabs/tab_strip_control_button.cc b/chrome/browser/ui/views/tabs/tab_strip_control_button.cc index 22b158b..f17189b 100644 --- a/chrome/browser/ui/views/tabs/tab_strip_control_button.cc +++ b/chrome/browser/ui/views/tabs/tab_strip_control_button.cc
@@ -139,6 +139,12 @@ } void TabStripControlButton::UpdateBackground() { + const auto* const color_provider = GetColorProvider(); + + if (!color_provider) { + return; + } + const absl::optional<int> bg_id = tab_strip_->GetCustomBackgroundId(BrowserFrameActiveState::kUseCurrent); @@ -148,7 +154,8 @@ } else { SetBackground(views::CreateBackgroundFromPainter( views::Painter::CreateSolidRoundRectPainter( - GetBackgroundColor(), GetCornerRadius(), GetInsets()))); + color_provider->GetColor(GetBackgroundColor()), GetCornerRadius(), + GetInsets()))); } }
diff --git a/chrome/browser/ui/webui/ash/parent_access/parent_access_ui.cc b/chrome/browser/ui/webui/ash/parent_access/parent_access_ui.cc index 94dd4a1..a68686e 100644 --- a/chrome/browser/ui/webui/ash/parent_access/parent_access_ui.cc +++ b/chrome/browser/ui/webui/ash/parent_access/parent_access_ui.cc
@@ -8,6 +8,7 @@ #include <string> #include <utility> +#include "ash/constants/ash_features.h" #include "ash/webui/common/trusted_types_util.h" #include "base/strings/stringprintf.h" #include "chrome/browser/profiles/profile.h" @@ -25,6 +26,7 @@ #include "content/public/browser/web_ui_data_source.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "services/network/public/mojom/content_security_policy.mojom.h" +#include "ui/webui/color_change_listener/color_change_handler.h" namespace ash { @@ -58,6 +60,12 @@ std::move(receiver), identity_manager, ParentAccessDialog::GetInstance()); } +void ParentAccessUI::BindInterface( + mojo::PendingReceiver<color_change_listener::mojom::PageHandler> receiver) { + color_provider_handler_ = std::make_unique<ui::ColorChangeHandler>( + web_ui()->GetWebContents(), std::move(receiver)); +} + parent_access_ui::mojom::ParentAccessUIHandler* ParentAccessUI::GetHandlerForTest() { return mojo_api_handler_.get(); @@ -114,6 +122,8 @@ IDR_PARENT_ACCESS_REQUEST_APPROVAL_DARK_SVG); source->UseStringsJs(); + source->AddBoolean("isParentAccessJellyEnabled", + features::IsParentAccessJellyEnabled()); source->SetDefaultResource(IDR_PARENT_ACCESS_HTML); static constexpr webui::LocalizedString kLocalizedStrings[] = {
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 e8d00de..7ec213c6 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
@@ -14,6 +14,11 @@ #include "content/public/common/url_constants.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "ui/web_dialogs/web_dialog_ui.h" +#include "ui/webui/resources/cr_components/color_change_listener/color_change_listener.mojom.h" + +namespace ui { +class ColorChangeHandler; +} namespace ash { @@ -47,11 +52,19 @@ mojo::PendingReceiver<parent_access_ui::mojom::ParentAccessUIHandler> receiver); + // Instantiates the implementor of the mojom::PageHandler mojo interface + // passing the pending receiver that will be internally bound. + void BindInterface( + mojo::PendingReceiver<color_change_listener::mojom::PageHandler> + receiver); + parent_access_ui::mojom::ParentAccessUIHandler* GetHandlerForTest(); private: void SetUpResources(); + std::unique_ptr<ui::ColorChangeHandler> color_provider_handler_; + std::unique_ptr<parent_access_ui::mojom::ParentAccessUIHandler> mojo_api_handler_;
diff --git a/chrome/browser/ui/webui/commerce/shopping_ui_handler_delegate.cc b/chrome/browser/ui/webui/commerce/shopping_ui_handler_delegate.cc index dd306b5..0aa2e38 100644 --- a/chrome/browser/ui/webui/commerce/shopping_ui_handler_delegate.cc +++ b/chrome/browser/ui/webui/commerce/shopping_ui_handler_delegate.cc
@@ -38,7 +38,7 @@ ShoppingUiHandlerDelegate::~ShoppingUiHandlerDelegate() = default; absl::optional<GURL> ShoppingUiHandlerDelegate::GetCurrentTabUrl() { - auto* browser = chrome::FindLastActive(); + auto* browser = chrome::FindTabbedBrowser(profile_, false); if (!browser) { return absl::nullopt; }
diff --git a/chrome/browser/ui/webui/discards/graph_dump_impl_unittest.cc b/chrome/browser/ui/webui/discards/graph_dump_impl_unittest.cc index ceac761..7efd3658 100644 --- a/chrome/browser/ui/webui/discards/graph_dump_impl_unittest.cc +++ b/chrome/browser/ui/webui/discards/graph_dump_impl_unittest.cc
@@ -225,11 +225,16 @@ task_environment.RunUntilIdle(); // Validate that the initial graph state dump is complete. Note that there is - // an update for each node as part of the initial state dump. - EXPECT_EQ(8u, change_stream.num_changes()); - EXPECT_EQ(8u, change_stream.id_set().size()); + // an update for each node as part of the initial state dump, except the + // system node. + size_t expected_changes = + graph_.GetAllFrameNodes().size() + graph_.GetAllPageNodes().size() + + graph_.GetAllProcessNodes().size() + graph_.GetAllWorkerNodes().size(); + EXPECT_EQ(expected_changes, change_stream.num_changes()); + EXPECT_EQ(expected_changes, change_stream.id_set().size()); - EXPECT_EQ(2u, change_stream.process_map().size()); + EXPECT_EQ(graph_.GetAllProcessNodes().size(), + change_stream.process_map().size()); for (const auto& kv : change_stream.process_map()) { const auto* process_info = kv.second.get(); EXPECT_NE(0u, process_info->id); @@ -237,12 +242,13 @@ base::JSONReader::Read(process_info->description_json)); } - EXPECT_EQ(3u, change_stream.frame_map().size()); + EXPECT_EQ(graph_.GetAllFrameNodes().size(), change_stream.frame_map().size()); for (const auto& kv : change_stream.frame_map()) { EXPECT_EQ(base::JSONReader::Read("{\"test\":{\"type\":\"frame\"}}"), base::JSONReader::Read(kv.second->description_json)); } - EXPECT_EQ(1u, change_stream.worker_map().size()); + EXPECT_EQ(graph_.GetAllWorkerNodes().size(), + change_stream.worker_map().size()); for (const auto& kv : change_stream.worker_map()) { EXPECT_EQ(base::JSONReader::Read("{\"test\":{\"type\":\"worker\"}}"), base::JSONReader::Read(kv.second->description_json)); @@ -269,7 +275,7 @@ // Make sure we have one top-level frame per page. EXPECT_EQ(change_stream.page_map().size(), top_level_frames); - EXPECT_EQ(2u, change_stream.page_map().size()); + EXPECT_EQ(graph_.GetAllPageNodes().size(), change_stream.page_map().size()); for (const auto& kv : change_stream.page_map()) { const auto& page = kv.second; EXPECT_NE(0u, page->id); @@ -290,7 +296,8 @@ task_environment.RunUntilIdle(); // Main frame navigation results in a notification for the url. - EXPECT_EQ(9u, change_stream.num_changes()); + expected_changes += 1; + EXPECT_EQ(expected_changes, change_stream.num_changes()); EXPECT_FALSE(base::Contains(change_stream.id_set(), child_frame_id)); const auto main_page_it = change_stream.page_map().find(
diff --git a/chrome/browser/ui/webui/realbox/realbox_handler.cc b/chrome/browser/ui/webui/realbox/realbox_handler.cc index 11e2956..0149b744 100644 --- a/chrome/browser/ui/webui/realbox/realbox_handler.cc +++ b/chrome/browser/ui/webui/realbox/realbox_handler.cc
@@ -125,6 +125,8 @@ constexpr char kGoogleSitesIconResourceName[] = "//resources/cr_components/omnibox/icons/sites.svg"; #endif +constexpr char kHistoryIconResourceName[] = + "//resources/images/icon_history.svg"; constexpr char kIncognitoIconResourceName[] = "//resources/cr_components/omnibox/icons/incognito.svg"; constexpr char kJourneysIconResourceName[] = @@ -651,6 +653,9 @@ return kDriveVideoIconResourceName; } else if (icon.name == omnibox::kExtensionAppIcon.name) { return kExtensionAppIconResourceName; + } else if (icon.name == vector_icons::kHistoryIcon.name || + icon.name == vector_icons::kHistoryChromeRefreshIcon.name) { + return kHistoryIconResourceName; } else if (icon.name == omnibox::kJourneysIcon.name || icon.name == omnibox::kJourneysChromeRefreshIcon.name) { return kJourneysIconResourceName;
diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc index d6ebdaf..ddbe0455 100644 --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -719,10 +719,14 @@ IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_SAVE_BUTTON_ARIA_LABEL}, {"tabDiscardingExceptionsHeader", IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_HEADER}, + {"tabDiscardingExceptionsDescription", + IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_DESCRIPTION}, {"tabDiscardingExceptionsAdditionalSites", IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADDITIONAL_SITES}, {"tabDiscardingExceptionsAddDialogCurrentTabs", IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_CURRENT_TABS}, + {"tabDiscardingExceptionsAddDialogCurrentTabsEmpty", + IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_CURRENT_TABS_EMPTY}, {"tabDiscardingExceptionsAddDialogManual", IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_MANUAL}, {"tabDiscardingExceptionsActiveSiteAriaDescription",
diff --git a/chrome/browser/usb/chrome_usb_delegate_unittest.cc b/chrome/browser/usb/chrome_usb_delegate_unittest.cc index 7699c36b..50caf7b 100644 --- a/chrome/browser/usb/chrome_usb_delegate_unittest.cc +++ b/chrome/browser/usb/chrome_usb_delegate_unittest.cc
@@ -87,8 +87,8 @@ } #if BUILDFLAG(ENABLE_EXTENSIONS) -// Creates a FakeUsbDeviceInfo with HID class code. -scoped_refptr<device::FakeUsbDeviceInfo> CreateFakeHidDeviceInfo() { +// Creates a FakeUsbDeviceInfo with USB class code. +scoped_refptr<device::FakeUsbDeviceInfo> CreateFakeUsbDeviceInfo() { auto alternate_setting = device::mojom::UsbAlternateInterfaceInfo::New(); alternate_setting->alternate_setting = 0; alternate_setting->class_code = device::mojom::kUsbHidClass; @@ -442,6 +442,8 @@ device_manager()->SetMockForDevice(device_info->guid, &mock_device); // Call GetDevices and expect the device to be returned. + MockDeviceManagerClient mock_client; + service->SetClient(mock_client.CreateInterfacePtrAndBind()); GetDevicesBlocking(service.get(), {device_info->guid}); // Call GetDevice to get the device. The WebContents should not indicate we @@ -494,6 +496,8 @@ device_manager()->SetMockForDevice(device_info->guid, &mock_device); // Call GetDevices and expect the device to be returned. + MockDeviceManagerClient mock_client; + service->SetClient(mock_client.CreateInterfacePtrAndBind()); GetDevicesBlocking(service.get(), {device_info->guid}); // Call GetDevice to get the device. The WebContents should not indicate we @@ -550,12 +554,13 @@ void TestAllowlistedImprivataExtension(content::WebContents* web_contents) { auto imprivata_origin = url::Origin::Create(origin_url_); auto* context = GetChooserContext(); - auto device_info = device_manager()->AddDevice(CreateFakeHidDeviceInfo()); + auto device_info = device_manager()->AddDevice(CreateFakeUsbDeviceInfo()); context->GrantDevicePermission(imprivata_origin, *device_info); mojo::Remote<blink::mojom::WebUsbService> service; ConnectToService(service.BindNewPipeAndPassReceiver()); - + MockDeviceManagerClient mock_client; + service->SetClient(mock_client.CreateInterfacePtrAndBind()); GetDevicesBlocking(service.get(), {device_info->guid}); mojo::Remote<device::mojom::UsbDevice> device; @@ -595,14 +600,16 @@ // that access is not automatically granted to it. auto ccid_device_info = device_manager()->AddDevice(CreateFakeSmartCardDeviceInfo()); - auto hid_device_info = - device_manager()->AddDevice(CreateFakeHidDeviceInfo()); + auto usb_device_info = + device_manager()->AddDevice(CreateFakeUsbDeviceInfo()); // No need to grant permission. It is granted automatically for smart // card device. mojo::Remote<blink::mojom::WebUsbService> service; ConnectToService(service.BindNewPipeAndPassReceiver()); + MockDeviceManagerClient mock_client; + service->SetClient(mock_client.CreateInterfacePtrAndBind()); // Check that the extensions is automatically granted access to the CCID // device and can claim its interfaces. @@ -633,16 +640,16 @@ device::mojom::UsbClaimInterfaceResult::kSuccess); } - // Check that the extension, if granted permission to a HID device can't + // Check that the extension, if granted permission to a USB device can't // claim its interfaces. { GetChooserContext()->GrantDevicePermission(extension_origin, - *hid_device_info); + *usb_device_info); GetDevicesBlocking(service.get(), - {ccid_device_info->guid, hid_device_info->guid}); + {ccid_device_info->guid, usb_device_info->guid}); mojo::Remote<device::mojom::UsbDevice> device; - service->GetDevice(hid_device_info->guid, + service->GetDevice(usb_device_info->guid, device.BindNewPipeAndPassReceiver()); TestFuture<device::mojom::UsbOpenDeviceResultPtr> open_future; @@ -689,7 +696,7 @@ NavigateAndCommit(origin_url_); } - // ChromeHidTestHelper: + // ChromeUsbTestHelper: void ConnectToService( mojo::PendingReceiver<blink::mojom::WebUsbService> receiver) override { SetUpFakeDeviceManager(); @@ -759,7 +766,7 @@ content::EmbeddedWorkerInstanceTestHarness::TearDown(); } - // ChromeHidTestHelper: + // ChromeUsbTestHelper: void ConnectToService( mojo::PendingReceiver<blink::mojom::WebUsbService> receiver) override { SetUpFakeDeviceManager();
diff --git a/chrome/browser/usb/usb_chooser_context.cc b/chrome/browser/usb/usb_chooser_context.cc index ad5e171..1dcb161 100644 --- a/chrome/browser/usb/usb_chooser_context.cc +++ b/chrome/browser/usb/usb_chooser_context.cc
@@ -690,7 +690,12 @@ void UsbChooserContext::SetDeviceManagerForTesting( mojo::PendingRemote<device::mojom::UsbDeviceManager> fake_device_manager) { - DCHECK(!device_manager_); + // `device_manager_` can be bound in some test scenarios, in that case, just + // reset the connection. + if (device_manager_) { + device_manager_.reset(); + client_receiver_.reset(); + } DCHECK(fake_device_manager); device_manager_.Bind(std::move(fake_device_manager)); SetUpDeviceManagerConnection();
diff --git a/chrome/browser/webauthn/authenticator_request_dialog_model.cc b/chrome/browser/webauthn/authenticator_request_dialog_model.cc index f3feb9f..cb46c95 100644 --- a/chrome/browser/webauthn/authenticator_request_dialog_model.cc +++ b/chrome/browser/webauthn/authenticator_request_dialog_model.cc
@@ -398,7 +398,7 @@ #endif PopulateMechanisms(); - priority_mechanism_index_ = IndexOfPriorityMechanism(); + ephemeral_state_.priority_mechanism_index_ = IndexOfPriorityMechanism(); if (use_conditional_mediation_) { // This is a conditional mediation request. @@ -443,8 +443,9 @@ } else { SetCurrentStep(Step::kErrorNoAvailableTransports); } - } else if (priority_mechanism_index_) { - Mechanism& mechanism = mechanisms_[*priority_mechanism_index_]; + } else if (ephemeral_state_.priority_mechanism_index_) { + Mechanism& mechanism = + mechanisms_[*ephemeral_state_.priority_mechanism_index_]; const Mechanism::Credential* cred = absl::get_if<Mechanism::Credential>(&mechanism.type); if (cred != nullptr && @@ -774,14 +775,15 @@ // authenticator. if (transport_availability_.request_type == device::FidoRequestType::kMakeCredential && - priority_mechanism_index_.has_value() && + ephemeral_state_.priority_mechanism_index_.has_value() && absl::holds_alternative<Mechanism::ICloudKeychain>( - mechanisms_[*priority_mechanism_index_].type)) { + mechanisms_[*ephemeral_state_.priority_mechanism_index_].type)) { StartOver(); - return; + } else { + // Otherwise, respect the "Cancel" button in macOS UI as if it were our + // own. + Cancel(); } - // Otherwise, respect the "Cancel" button in macOS UI as if it were our own. - Cancel(); return; } @@ -802,18 +804,17 @@ // dialog) then start the request over (once) if the user cancels the Windows // UI and there are other options in Chrome's UI. But if Windows supports // hybrid then we've nothing more to offer in practice. - if (!have_restarted_due_to_windows_cancel_ && !WebAuthnApiSupportsHybrid()) { + if (!WebAuthnApiSupportsHybrid()) { bool have_other_option = base::ranges::any_of(mechanisms_, [](const Mechanism& m) -> bool { return absl::holds_alternative<Mechanism::Phone>(m.type) || absl::holds_alternative<Mechanism::AddPhone>(m.type); }); bool windows_was_priority = - priority_mechanism_index_ && + ephemeral_state_.priority_mechanism_index_ && absl::holds_alternative<Mechanism::WindowsAPI>( - mechanisms_[*priority_mechanism_index_].type); + mechanisms_[*ephemeral_state_.priority_mechanism_index_].type); if (have_other_option && windows_was_priority) { - have_restarted_due_to_windows_cancel_ = true; StartOver(); return true; }
diff --git a/chrome/browser/webauthn/authenticator_request_dialog_model.h b/chrome/browser/webauthn/authenticator_request_dialog_model.h index 1bafb26a..ecadf6e1 100644 --- a/chrome/browser/webauthn/authenticator_request_dialog_model.h +++ b/chrome/browser/webauthn/authenticator_request_dialog_model.h
@@ -529,7 +529,7 @@ virtual base::span<const Mechanism> mechanisms() const; absl::optional<int> priority_mechanism_index() const { - return priority_mechanism_index_; + return ephemeral_state_.priority_mechanism_index_; } // Contacts the "priority" paired phone. This is only valid to call when there @@ -661,6 +661,10 @@ EphemeralState& operator=(EphemeralState&&); ~EphemeralState(); + // priority_mechanism_index_ contains an index in `mechanisms_` for the + // mechanism that should immediately be triggered, if any. + absl::optional<size_t> priority_mechanism_index_; + // Represents the id of the Bluetooth authenticator that the user is trying // to connect to or conduct WebAuthN request to via the WebAuthN UI. absl::optional<std::string> selected_authenticator_id_; @@ -821,19 +825,10 @@ // extension. bool cable_extension_provided_ = false; - // have_restarted_due_to_windows_cancel_ is set to true if the request was - // restarted because the UI jumped directly to the Windows UI but the user - // hit cancel. - bool have_restarted_due_to_windows_cancel_ = false; - // mechanisms contains the entries that appear in the "transport" selection // sheet and the drop-down menu. std::vector<Mechanism> mechanisms_; - // priority_mechanism_index_ contains an index in `mechanisms_` for the - // mechanism that should immediately be triggered, if any. - absl::optional<size_t> priority_mechanism_index_; - // cable_ui_type_ contains the type of UI to display for a caBLE transaction. absl::optional<CableUIType> cable_ui_type_;
diff --git a/chrome/browser/webauthn/authenticator_request_dialog_model_unittest.cc b/chrome/browser/webauthn/authenticator_request_dialog_model_unittest.cc index 2a735ff..d7011c0 100644 --- a/chrome/browser/webauthn/authenticator_request_dialog_model_unittest.cc +++ b/chrome/browser/webauthn/authenticator_request_dialog_model_unittest.cc
@@ -2121,14 +2121,16 @@ account_preselected_callback.Callback()); model.StartFlow(std::move(transports_info), /*is_conditional_mediation=*/false); - ASSERT_EQ(model.priority_mechanism_index_.has_value(), + ASSERT_EQ(model.ephemeral_state_.priority_mechanism_index_.has_value(), test.type_of_priority_mechanism.has_value()); if (!test.type_of_priority_mechanism.has_value()) { continue; } - EXPECT_EQ(*test.type_of_priority_mechanism, - model.mechanisms_[*model.priority_mechanism_index_].type); + EXPECT_EQ( + *test.type_of_priority_mechanism, + model.mechanisms_[*model.ephemeral_state_.priority_mechanism_index_] + .type); } } @@ -2199,14 +2201,8 @@ if (!platform_attachment) { // Dispatch to iCloud Keychain to check that canceling doesn't show // a Chrome error dialog. - base::ranges::find_if( - model.mechanisms(), - [](const AuthenticatorRequestDialogModel::Mechanism& m) -> bool { - return absl::holds_alternative< - AuthenticatorRequestDialogModel::Mechanism::ICloudKeychain>( - m.type); - }) - ->callback.Run(); + model.HideDialogAndDispatchToPlatformAuthenticator( + device::AuthenticatorType::kICloudKeychain); } model.OnUserConsentDenied(); @@ -2218,12 +2214,25 @@ ? AuthenticatorRequestDialogModel::Step::kMechanismSelection : AuthenticatorRequestDialogModel::Step:: kErrorInternalUnrecognized); - } else { - // Canceling after a non-automatic dispatch to iCloud Keychain should - // end the request. - EXPECT_EQ(model.current_step(), - AuthenticatorRequestDialogModel::Step::kNotStarted); + + model.saved_authenticators().AddAuthenticator(AuthenticatorReference( + kProfileAuthenticatorId, AuthenticatorTransport::kInternal, + device::AuthenticatorType::kTouchID)); + model.saved_authenticators().AddAuthenticator(AuthenticatorReference( + kICloudKeychainId, AuthenticatorTransport::kInternal, + device::AuthenticatorType::kICloudKeychain)); + + // Dispatch and cancel again to confirm that canceling the non-automatic + // dispatch cancels the whole request. + model.HideDialogAndDispatchToPlatformAuthenticator( + device::AuthenticatorType::kICloudKeychain); + model.OnUserConsentDenied(); } + + // Canceling after a non-automatic dispatch to iCloud Keychain should + // end the request. + EXPECT_EQ(model.current_step(), + AuthenticatorRequestDialogModel::Step::kNotStarted); } } }
diff --git a/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc b/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc index 8f24d9b..69f6d1f 100644 --- a/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc +++ b/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
@@ -684,7 +684,10 @@ device::WinWebAuthnApi* const webauthn_api = device::WinWebAuthnApi::GetDefault(); const bool system_handles_cable = - webauthn_api && webauthn_api->SupportsHybrid(); + webauthn_api && webauthn_api->SupportsHybrid() && + // For now, Chrome handles hybrid even if Windows supports it for synced + // GPM passkeys. + !base::FeatureList::IsEnabled(device::kWebAuthnListSyncedPasskeys); #else constexpr bool system_handles_cable = false; #endif
diff --git a/chrome/browser/webauthn/chrome_authenticator_request_delegate_unittest.cc b/chrome/browser/webauthn/chrome_authenticator_request_delegate_unittest.cc index a4d88f5..246c86dd 100644 --- a/chrome/browser/webauthn/chrome_authenticator_request_delegate_unittest.cc +++ b/chrome/browser/webauthn/chrome_authenticator_request_delegate_unittest.cc
@@ -367,11 +367,16 @@ &fake_win_webauthn_api); #endif - for (const bool windows_has_hybrid : { - false + enum WinHybridExpectation { + kNoWinHybrid, + kWinHybridPasskeySyncing, + kWinHybridNoPasskeySyncing, + }; + + for (const WinHybridExpectation windows_has_hybrid : { + kNoWinHybrid, #if BUILDFLAG(IS_WIN) - , - true + kWinHybridPasskeySyncing, kWinHybridNoPasskeySyncing, #endif }) { unsigned test_case = 0; @@ -380,7 +385,16 @@ test_case++; #if BUILDFLAG(IS_WIN) - fake_win_webauthn_api.set_version(windows_has_hybrid ? 6 : 4); + fake_win_webauthn_api.set_version(windows_has_hybrid == kNoWinHybrid ? 4 + : 7); + base::test::ScopedFeatureList scoped_feature_list; + if (windows_has_hybrid == kWinHybridNoPasskeySyncing) { + scoped_feature_list.InitWithFeatures( + {}, {device::kWebAuthnListSyncedPasskeys}); + } else if (windows_has_hybrid == kWinHybridPasskeySyncing) { + scoped_feature_list.InitWithFeatures( + {device::kWebAuthnListSyncedPasskeys}, {}); + } SCOPED_TRACE(windows_has_hybrid); #endif @@ -395,8 +409,9 @@ test.request_type, test.resident_key_requirement, test.extensions, &discovery_factory); - switch (windows_has_hybrid ? test.expected_result_with_system_hybrid - : test.expected_result) { + switch (windows_has_hybrid == kWinHybridNoPasskeySyncing + ? test.expected_result_with_system_hybrid + : test.expected_result) { case Result::kNone: EXPECT_FALSE(discovery_factory.qr_key.has_value()); EXPECT_TRUE(discovery_factory.cable_data.empty());
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index 06b2e81..a5cae3a 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1692884437-470f6f7af05cae9721d92d3960101476f561e8b4.profdata +chrome-mac-arm-main-1692899922-39accd6dcbf5777a09d1413e0d33cf1608cd0d90.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 534665f..65f03c2b 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1692878161-bbed88c0f6ad70ebb34a82f19a513e39a7f33264.profdata +chrome-win32-main-1692889175-ebb4266a9c886dda80bc87623994404428d77cac.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index d00a241..4a37a8e 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1692878161-c17082e534e4b6e8cb6693f31e8ccdd8549f72bf.profdata +chrome-win64-main-1692889175-5dc9216af9c8027c05783a940a8d3a9815e900d5.profdata
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc index 285c1e39..93ede29 100644 --- a/chrome/installer/setup/setup_util.cc +++ b/chrome/installer/setup/setup_util.cc
@@ -756,7 +756,7 @@ base::win::RegKey key; auto result = key.Open(HKEY_LOCAL_MACHINE, key_path.c_str(), - KEY_SET_VALUE | wow_access); + KEY_QUERY_VALUE | KEY_SET_VALUE | wow_access); if (result == ERROR_FILE_NOT_FOUND) { // The registry key which stores the DMToken value was not found, so // deletion is not necessary. @@ -781,8 +781,9 @@ } // Else ignore the failure to write to the best-effort location. // Delete the key if no other values are present. - base::win::RegKey(HKEY_LOCAL_MACHINE, L"", KEY_QUERY_VALUE | wow_access) - .DeleteEmptyKey(key_path.c_str()); + if (key.GetValueCount().value_or(1) == 0) { + key.DeleteKey(L""); + } } VLOG(1) << "Successfully deleted DMToken from the registry.";
diff --git a/chrome/installer/util/create_reg_key_work_item.cc b/chrome/installer/util/create_reg_key_work_item.cc index 74f595e3..97871b0 100644 --- a/chrome/installer/util/create_reg_key_work_item.cc +++ b/chrome/installer/util/create_reg_key_work_item.cc
@@ -89,13 +89,12 @@ if (!key_created_) return; - std::wstring key_path; // To delete keys, we iterate from front to back. - std::vector<std::wstring>::iterator itr; - for (itr = key_list_.begin(); itr != key_list_.end(); ++itr) { - key_path.assign(*itr); - RegKey key(predefined_root_, L"", KEY_WRITE | wow64_access_); - if (key.DeleteEmptyKey(key_path.c_str()) == ERROR_SUCCESS) { + for (const auto& key_path : key_list_) { + RegKey key(predefined_root_, key_path.c_str(), + KEY_QUERY_VALUE | wow64_access_); + if (key.GetValueCount().value_or(1) == 0 && + key.DeleteKey(L"") == ERROR_SUCCESS) { VLOG(1) << "rollback: delete " << key_path; } else { VLOG(1) << "rollback: can not delete " << key_path;
diff --git a/chrome/services/util_win/OWNERS b/chrome/services/util_win/OWNERS index 9e9a68c..5cb5fef 100644 --- a/chrome/services/util_win/OWNERS +++ b/chrome/services/util_win/OWNERS
@@ -1 +1,2 @@ pmonette@chromium.org +wfh@chromium.org
diff --git a/chrome/services/util_win/processor_metrics.cc b/chrome/services/util_win/processor_metrics.cc index 4852a75..da0551a 100644 --- a/chrome/services/util_win/processor_metrics.cc +++ b/chrome/services/util_win/processor_metrics.cc
@@ -7,6 +7,7 @@ #include <objbase.h> #include <sysinfoapi.h> #include <wbemidl.h> +#include <winbase.h> #include <wrl/client.h> #include "base/metrics/histogram_functions.h" @@ -125,15 +126,34 @@ } } +void RecordEnclaveAvailability() { + base::UmaHistogramBoolean("Windows.Enclave.SGX.Available", + ::IsEnclaveTypeSupported(ENCLAVE_TYPE_SGX)); + base::UmaHistogramBoolean("Windows.Enclave.SGX2.Available", + ::IsEnclaveTypeSupported(ENCLAVE_TYPE_SGX2)); + base::UmaHistogramBoolean("Windows.Enclave.VBS.Available", + ::IsEnclaveTypeSupported(ENCLAVE_TYPE_VBS)); + // This one is less documented, but appears to be used "when attestation + // evidence does not include VBS data.". This was added in Windows 19H1. + base::UmaHistogramBoolean("Windows.Enclave.VBSBasic.Available", + ::IsEnclaveTypeSupported(ENCLAVE_TYPE_VBS_BASIC)); +} + void RecordProcessorMetrics() { - base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, - base::BlockingType::MAY_BLOCK); - ComPtr<IWbemServices> wmi_services; - if (!base::win::CreateLocalWmiConnection(true, &wmi_services)) - return; - RecordProcessorMetricsFromWMI(wmi_services); - RecordHypervStatusFromWMI(wmi_services); + // These metrics do not require a WMI connection. RecordCetAvailability(); + RecordEnclaveAvailability(); + + { + base::ScopedBlockingCall scoped_blocking_call( + FROM_HERE, base::BlockingType::MAY_BLOCK); + ComPtr<IWbemServices> wmi_services; + if (!base::win::CreateLocalWmiConnection(true, &wmi_services)) { + return; + } + RecordProcessorMetricsFromWMI(wmi_services); + RecordHypervStatusFromWMI(wmi_services); + } } } // namespace
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index c3273ae..11995909 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -9032,6 +9032,8 @@ "../browser/safe_browsing/extension_telemetry/extension_telemetry_uploader_unittest.cc", "../browser/safe_browsing/extension_telemetry/potential_password_theft_signal_processor_unittest.cc", "../browser/safe_browsing/extension_telemetry/remote_host_contacted_signal_processor_unittest.cc", + "../browser/safe_browsing/extension_telemetry/tabs_api_signal_processor_unittest.cc", + "../browser/safe_browsing/extension_telemetry/tabs_api_signal_unittest.cc", "../browser/safe_browsing/extension_telemetry/tabs_execute_script_signal_processor_unittest.cc", "../browser/safe_browsing/hash_realtime_service_factory_unittest.cc", "../browser/safe_browsing/incident_reporting/binary_integrity_incident_unittest.cc",
diff --git a/chrome/test/base/chromeos/crosier/demo_integration_test.cc b/chrome/test/base/chromeos/crosier/demo_integration_test.cc index 879ecab..7d1aa59 100644 --- a/chrome/test/base/chromeos/crosier/demo_integration_test.cc +++ b/chrome/test/base/chromeos/crosier/demo_integration_test.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <vector> + #include "base/run_loop.h" #include "base/test/gtest_tags.h" #include "base/test/test_switches.h" @@ -94,7 +96,10 @@ // manager, but AttemptUserExit() uses session manager to kill the chrome // binary. // TODO(b/292067979): Find a better way to work around this issue. - for (Browser* browser : *BrowserList::GetInstance()) { + auto* browser_list = BrowserList::GetInstance(); + // Copy the browser list to avoid mutating it during iteration. + std::vector<Browser*> browsers(browser_list->begin(), browser_list->end()); + for (Browser* browser : browsers) { CloseBrowserSynchronously(browser); }
diff --git a/chrome/test/data/extensions/api_test/scripting/dynamic_scripts/worker.js b/chrome/test/data/extensions/api_test/scripting/dynamic_scripts/worker.js index f3a07d9..12bd018 100644 --- a/chrome/test/data/extensions/api_test/scripting/dynamic_scripts/worker.js +++ b/chrome/test/data/extensions/api_test/scripting/dynamic_scripts/worker.js
@@ -403,6 +403,110 @@ chrome.test.succeed(); }, + // Test that unregisterContentScripts with no given filter unregisters all + // content scripts. + async function unregisterScript_NoFilter() { + await chrome.scripting.unregisterContentScripts(); + + const contentScripts = [ + { + id: 'contentScript1', + matches: ['*://*/*'], + js: ['inject_element.js'], + runAt: 'document_end' + }, + { + id: 'contentScript2', + matches: ['*://*/*'], + js: ['inject_element_2.js'], + runAt: 'document_end' + } + ]; + + await chrome.scripting.registerContentScripts(contentScripts); + + // Navigate to a requested url. + const config = await chrome.test.getConfig(); + const url = `http://hostperms.com:${config.testServer.port}/simple.html`; + let tab = await openTab(url); + let results = await chrome.scripting.executeScript( + {target: {tabId: tab.id}, func: getInjectedElementIds}); + + // Verify content scripts are injected. + chrome.test.assertEq(1, results.length); + chrome.test.assertEq(['injected', 'injected_2'], results[0].result); + + // Unregister all content scripts. + await chrome.scripting.unregisterContentScripts(); + + // Verify all content scripts are removed. + let registeredContentScripts = + await chrome.scripting.getRegisteredContentScripts(); + chrome.test.assertEq(0, registeredContentScripts.length); + + // Re-navigate to the requested url, and verify no script is injected. + tab = await openTab(url); + results = await chrome.scripting.executeScript( + {target: {tabId: tab.id}, func: getInjectedElementIds}); + chrome.test.assertEq(1, results.length); + chrome.test.assertEq([], results[0].result); + + chrome.test.succeed(); + }, + + // Test that unregisterContentScripts with empty filter ids unregisters all + // content scripts. + // TODO(crbug.com/1300657): This is incorrect, when filter ids is empty it + // should not unregister any script. + async function unregisterScript_EmptyFilterIds() { + await chrome.scripting.unregisterContentScripts(); + + const contentScripts = [ + { + id: 'contentScript1', + matches: ['*://*/*'], + js: ['inject_element.js'], + runAt: 'document_end' + }, + { + id: 'contentScript2', + matches: ['*://*/*'], + js: ['inject_element_2.js'], + runAt: 'document_end' + } + ]; + + await chrome.scripting.registerContentScripts(contentScripts); + + // Navigate to a requested url. + const config = await chrome.test.getConfig(); + const url = `http://hostperms.com:${config.testServer.port}/simple.html`; + let tab = await openTab(url); + let results = await chrome.scripting.executeScript( + { target: { tabId: tab.id }, func: getInjectedElementIds }); + + // Verify content scripts are injected. + chrome.test.assertEq(1, results.length); + chrome.test.assertEq(['injected', 'injected_2'], results[0].result); + + // Unregister all content scripts. + await chrome.scripting.unregisterContentScripts({ ids: [] }); + + // Verify all content scripts are removed. + let registeredContentScripts = + await chrome.scripting.getRegisteredContentScripts(); + chrome.test.assertEq(0, registeredContentScripts.length); + + // Re-navigate to the requested url, and verify no script is injected. + tab = await openTab(url); + results = await chrome.scripting.executeScript( + { target: { tabId: tab.id }, func: getInjectedElementIds }); + chrome.test.assertEq(1, results.length); + chrome.test.assertEq([], results[0].result); + + chrome.test.succeed(); + }, + // Test that an error is returned when attempting to specify an invalid ID // for unregisterContentScripts. async function unregisterScriptsWithInvalidID() {
diff --git a/chrome/test/data/extensions/api_test/scripting/dynamic_user_scripts/content_script.js b/chrome/test/data/extensions/api_test/scripting/dynamic_user_scripts/content_script.js new file mode 100644 index 0000000..eb1f9f4 --- /dev/null +++ b/chrome/test/data/extensions/api_test/scripting/dynamic_user_scripts/content_script.js
@@ -0,0 +1,7 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +var div = document.createElement('div'); +div.id = 'injected_content_script'; +document.body.appendChild(div);
diff --git a/chrome/test/data/extensions/api_test/scripting/dynamic_user_scripts/manifest.json b/chrome/test/data/extensions/api_test/scripting/dynamic_user_scripts/manifest.json new file mode 100644 index 0000000..27d7c08 --- /dev/null +++ b/chrome/test/data/extensions/api_test/scripting/dynamic_user_scripts/manifest.json
@@ -0,0 +1,18 @@ +{ + "manifest_version": 3, + "name": "Dynamic user script test extension", + "version": "0.1", + "description": "Tests a variety of dynamic content scripts API calls when the extension also has user scripts registered.", + "background": { + "service_worker": "worker.js", + "type": "module" + }, + "permissions": [ + "scripting", + "tabs", + "userScripts" + ], + "host_permissions": [ + "*://hostperms.com/*" + ] +} \ No newline at end of file
diff --git a/chrome/test/data/extensions/api_test/scripting/dynamic_user_scripts/user_script.js b/chrome/test/data/extensions/api_test/scripting/dynamic_user_scripts/user_script.js new file mode 100644 index 0000000..e84222c --- /dev/null +++ b/chrome/test/data/extensions/api_test/scripting/dynamic_user_scripts/user_script.js
@@ -0,0 +1,7 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +var div = document.createElement('div'); +div.id = 'injected_user_script'; +document.body.appendChild(div);
diff --git a/chrome/test/data/extensions/api_test/scripting/dynamic_user_scripts/worker.js b/chrome/test/data/extensions/api_test/scripting/dynamic_user_scripts/worker.js new file mode 100644 index 0000000..58d638c --- /dev/null +++ b/chrome/test/data/extensions/api_test/scripting/dynamic_user_scripts/worker.js
@@ -0,0 +1,92 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {openTab} from '/_test_resources/test_util/tabs_util.js'; + +function getInjectedElementIds() { + let childIds = []; + for (const child of document.body.children) + childIds.push(child.id); + return childIds.sort(); +}; + +chrome.test.runTests([ + // Test that unregisterContentScripts unregisters only content scripts and + // not user scripts. + async function unregisterScript_CannotUnregisterUserScripts() { + await chrome.scripting.unregisterContentScripts(); + + const contentScripts = [{ + id: 'contentScript', + matches: ['*://*/*'], + js: ['content_script.js'], + runAt: 'document_end' + }]; + + const userScripts = [{ + id: 'userScript', + matches: ['*://*/*'], + js: [{file: 'user_script.js'}], + runAt: 'document_end' + }]; + + + await chrome.scripting.registerContentScripts(contentScripts); + await chrome.userScripts.register(userScripts); + + // Navigate to a requested url. + const config = await chrome.test.getConfig(); + const url = `http://hostperms.com:${config.testServer.port}/simple.html`; + let tab = await openTab(url); + let results = await chrome.scripting.executeScript( + {target: {tabId: tab.id}, func: getInjectedElementIds}); + + // Both content and user scripts should be injected. + chrome.test.assertEq(1, results.length); + chrome.test.assertEq( + ['injected_content_script', 'injected_user_script'], results[0].result); + + // Try to unregister user script's id using the scripting API. It should + // fail because it's not a content script. + await chrome.test.assertPromiseRejects( + chrome.scripting.unregisterContentScripts({ids: ['userScript']}), + `Error: Nonexistent script ID 'userScript'`); + + // Verify all scripts are still registered. + let registeredContentScripts = + await chrome.scripting.getRegisteredContentScripts(); + chrome.test.assertEq(1, registeredContentScripts.length); + let registeredUserScripts = await chrome.userScripts.getScripts(); + chrome.test.assertEq(1, registeredUserScripts.length); + + // Re-navigate to the requested url, and verify both scripts are injected. + tab = await openTab(url); + results = await chrome.scripting.executeScript( + {target: {tabId: tab.id}, func: getInjectedElementIds}); + chrome.test.assertEq(1, results.length); + chrome.test.assertEq( + ['injected_content_script', 'injected_user_script'], results[0].result); + + // Unregister all content scripts using the scripting API. + await chrome.scripting.unregisterContentScripts(); + + // Verify content script is removed, but user script is still registered. + registeredContentScripts = + await chrome.scripting.getRegisteredContentScripts(); + chrome.test.assertEq(0, registeredContentScripts.length); + registeredUserScripts = await chrome.userScripts.getScripts(); + chrome.test.assertEq(1, registeredUserScripts.length); + + // Re-navigate to the requested url, and verify only the user script is + // injected. + tab = await openTab(url); + results = await chrome.scripting.executeScript( + {target: {tabId: tab.id}, func: getInjectedElementIds}); + chrome.test.assertEq(1, results.length); + chrome.test.assertEq(['injected_user_script'], results[0].result); + + chrome.test.succeed(); + }, + +]);
diff --git a/chrome/test/data/webui/chromeos/scanning/multi_page_scan_test.js b/chrome/test/data/webui/chromeos/scanning/multi_page_scan_test.js index 1403451f..8c2a0da 100644 --- a/chrome/test/data/webui/chromeos/scanning/multi_page_scan_test.js +++ b/chrome/test/data/webui/chromeos/scanning/multi_page_scan_test.js
@@ -23,7 +23,7 @@ setup(() => { scanningBrowserProxy = new TestScanningBrowserProxy(); - ScanningBrowserProxyImpl.instance_ = scanningBrowserProxy; + ScanningBrowserProxyImpl.setInstance(scanningBrowserProxy); multiPageScan = /** @type {!MultiPageScanElement} */ ( document.createElement('multi-page-scan'));
diff --git a/chrome/test/data/webui/chromeos/scanning/scan_done_section_test.js b/chrome/test/data/webui/chromeos/scanning/scan_done_section_test.js index 34f8cb54..9a080a7 100644 --- a/chrome/test/data/webui/chromeos/scanning/scan_done_section_test.js +++ b/chrome/test/data/webui/chromeos/scanning/scan_done_section_test.js
@@ -21,7 +21,7 @@ setup(() => { scanningBrowserProxy = new TestScanningBrowserProxy(); - ScanningBrowserProxyImpl.instance_ = scanningBrowserProxy; + ScanningBrowserProxyImpl.setInstance(scanningBrowserProxy); scanDoneSection = /** @type {!ScanDoneSectionElement} */ ( document.createElement('scan-done-section'));
diff --git a/chrome/test/data/webui/chromeos/scanning/scan_preview_test.js b/chrome/test/data/webui/chromeos/scanning/scan_preview_test.js index 0b8f476..b429e175 100644 --- a/chrome/test/data/webui/chromeos/scanning/scan_preview_test.js +++ b/chrome/test/data/webui/chromeos/scanning/scan_preview_test.js
@@ -108,7 +108,7 @@ scanPreview = /** @type {!ScanPreviewElement} */ ( document.createElement('scan-preview')); assertTrue(!!scanPreview); - ScanningBrowserProxyImpl.instance_ = new TestScanningBrowserProxy(); + ScanningBrowserProxyImpl.setInstance(new TestScanningBrowserProxy()); // Setup mock for matchMedia. mockController = new MockController();
diff --git a/chrome/test/data/webui/chromeos/scanning/scan_to_select_test.js b/chrome/test/data/webui/chromeos/scanning/scan_to_select_test.js index 301db0b..37531cad 100644 --- a/chrome/test/data/webui/chromeos/scanning/scan_to_select_test.js +++ b/chrome/test/data/webui/chromeos/scanning/scan_to_select_test.js
@@ -23,7 +23,7 @@ setup(() => { scanningBrowserProxy = new TestScanningBrowserProxy(); - ScanningBrowserProxyImpl.instance_ = scanningBrowserProxy; + ScanningBrowserProxyImpl.setInstance(scanningBrowserProxy); scanToSelect = /** @type {!ScanToSelectElement} */ ( document.createElement('scan-to-select'));
diff --git a/chrome/test/data/webui/chromeos/scanning/scanning_app_test.js b/chrome/test/data/webui/chromeos/scanning/scanning_app_test.js index c5f2949..f02c2512 100644 --- a/chrome/test/data/webui/chromeos/scanning/scanning_app_test.js +++ b/chrome/test/data/webui/chromeos/scanning/scanning_app_test.js
@@ -484,7 +484,7 @@ setScanServiceForTesting(fakeScanService_); fakeMultiPageScanController_ = new FakeMultiPageScanController(); testBrowserProxy = new TestScanningBrowserProxy(); - ScanningBrowserProxyImpl.instance_ = testBrowserProxy; + ScanningBrowserProxyImpl.setInstance(testBrowserProxy); testBrowserProxy.setMyFilesPath(MY_FILES_PATH); });
diff --git a/chrome/test/data/webui/settings/chromeos/BUILD.gn b/chrome/test/data/webui/settings/chromeos/BUILD.gn index 4a2b72d..7449f41 100644 --- a/chrome/test/data/webui/settings/chromeos/BUILD.gn +++ b/chrome/test/data/webui/settings/chromeos/BUILD.gn
@@ -55,7 +55,6 @@ "network_device_info_dialog_test.js", "onc_mojo_test.ts", "os_about_page_tests.js", - "os_paired_bluetooth_list_item_tests.js", "os_page_availability_test.ts", "os_reset_page_test.js", "os_saved_devices_list_tests.js", @@ -208,9 +207,10 @@ "os_bluetooth_page/os_bluetooth_devices_subpage_tests.js", "os_bluetooth_page/os_bluetooth_page_test.ts", "os_bluetooth_page/os_bluetooth_pairing_dialog_test.ts", - "os_bluetooth_page/os_bluetooth_summary_tests.js", + "os_bluetooth_page/os_bluetooth_summary_test.ts", "os_bluetooth_page/os_bluetooth_true_wireless_images_tests.js", "os_bluetooth_page/os_paired_bluetooth_list_test.ts", + "os_bluetooth_page/os_paired_bluetooth_list_item_test.ts", "os_bluetooth_page/test_os_bluetooth_subpage_browser_proxy.ts", "os_files_page/google_drive_page_test.ts",
diff --git a/chrome/test/data/webui/settings/chromeos/os_bluetooth_page/os_bluetooth_summary_tests.js b/chrome/test/data/webui/settings/chromeos/os_bluetooth_page/os_bluetooth_summary_test.ts similarity index 70% rename from chrome/test/data/webui/settings/chromeos/os_bluetooth_page/os_bluetooth_summary_tests.js rename to chrome/test/data/webui/settings/chromeos/os_bluetooth_page/os_bluetooth_summary_test.ts index a8c4a531..1dbdf1b 100644 --- a/chrome/test/data/webui/settings/chromeos/os_bluetooth_page/os_bluetooth_summary_tests.js +++ b/chrome/test/data/webui/settings/chromeos/os_bluetooth_page/os_bluetooth_summary_test.ts
@@ -2,41 +2,39 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://os-settings/strings.m.js'; +import 'chrome://os-settings/os_settings.js'; -import {OsBluetoothDevicesSubpageBrowserProxyImpl, Router, routes} from 'chrome://os-settings/os_settings.js'; +import {CrToggleElement, IronIconElement, OsBluetoothDevicesSubpageBrowserProxyImpl, Router, routes, SettingsBluetoothSummaryElement} from 'chrome://os-settings/os_settings.js'; import {setBluetoothConfigForTesting} from 'chrome://resources/ash/common/bluetooth/cros_bluetooth_config.js'; +import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {mojoString16ToString} from 'chrome://resources/js/mojo_type_util.js'; import {BluetoothSystemProperties, BluetoothSystemState, DeviceConnectionState, SystemPropertiesObserverInterface} from 'chrome://resources/mojo/chromeos/ash/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom-webui.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {assertEquals, assertFalse, assertNotEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; +import {assertEquals, assertFalse, assertNotEquals, assertNull, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {createDefaultBluetoothDevice, FakeBluetoothConfig} from 'chrome://webui-test/cr_components/chromeos/bluetooth/fake_bluetooth_config.js'; -import {waitAfterNextRender} from 'chrome://webui-test/polymer_test_util.js'; +import {flushTasks, waitAfterNextRender} from 'chrome://webui-test/polymer_test_util.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; import {TestOsBluetoothDevicesSubpageBrowserProxy} from './test_os_bluetooth_subpage_browser_proxy.js'; -suite('OsBluetoothSummaryTest', function() { - /** @type {!FakeBluetoothConfig} */ - let bluetoothConfig; +suite('<os-settings-bluetooth-summary>', () => { + let bluetoothConfig: FakeBluetoothConfig; + let bluetoothSummary: SettingsBluetoothSummaryElement; + let propertiesObserver: SystemPropertiesObserverInterface; + let browserProxy: TestOsBluetoothDevicesSubpageBrowserProxy; - /** @type {!SettingsBluetoothSummaryElement|undefined} */ - let bluetoothSummary; - - /** - * @type {!SystemPropertiesObserverInterface} - */ - let propertiesObserver; - - /** @type {?OsBluetoothDevicesSubpageBrowserProxy} */ - let browserProxy = null; - - setup(function() { + setup(() => { bluetoothConfig = new FakeBluetoothConfig(); setBluetoothConfigForTesting(bluetoothConfig); }); - function init() { + teardown(() => { + bluetoothSummary.remove(); + browserProxy.reset(); + Router.getInstance().resetRouteForTesting(); + }); + + function init(): void { browserProxy = new TestOsBluetoothDevicesSubpageBrowserProxy(); OsBluetoothDevicesSubpageBrowserProxyImpl.setInstanceForTesting( browserProxy); @@ -46,34 +44,28 @@ propertiesObserver = { /** - * SystemPropertiesObserverInterface override - * @param {!BluetoothSystemProperties} - * properties + * SystemPropertiesObserverInterface override properties */ - onPropertiesUpdated(properties) { + onPropertiesUpdated(properties: BluetoothSystemProperties) { bluetoothSummary.systemProperties = properties; }, }; bluetoothConfig.observeSystemProperties(propertiesObserver); } - function flushAsync() { - flush(); - return new Promise(resolve => setTimeout(resolve)); - } - test('Button is focused after returning from devices subpage', async () => { init(); bluetoothConfig.setBluetoothEnabledState(/*enabled=*/ true); - await flushAsync(); + await flushTasks(); const iconButton = - bluetoothSummary.shadowRoot.querySelector('#arrowIconButton'); + bluetoothSummary.shadowRoot!.querySelector<HTMLButtonElement>( + '#arrowIconButton'); assertTrue(!!iconButton); iconButton.click(); - assertEquals(Router.getInstance().currentRoute, routes.BLUETOOTH_DEVICES); + assertEquals(routes.BLUETOOTH_DEVICES, Router.getInstance().currentRoute); assertNotEquals( - iconButton, bluetoothSummary.shadowRoot.activeElement, + iconButton, bluetoothSummary.shadowRoot!.activeElement, 'subpage icon should not be focused'); // Navigate back to the top-level page. @@ -84,19 +76,20 @@ // Check that |iconButton| has been focused. assertEquals( - iconButton, bluetoothSummary.shadowRoot.activeElement, + iconButton, bluetoothSummary.shadowRoot!.activeElement, 'subpage icon should be focused'); }); - test('Toggle button creation and a11y', async function() { + test('Toggle button creation and a11y', async () => { bluetoothConfig.setSystemState(BluetoothSystemState.kEnabled); - await flushAsync(); + await flushTasks(); init(); let a11yMessagesEventPromise = eventToPromise('cr-a11y-announcer-messages-sent', document.body); - const toggle = - bluetoothSummary.shadowRoot.querySelector('#enableBluetoothToggle'); + const toggle = bluetoothSummary.shadowRoot!.querySelector<CrToggleElement>( + '#enableBluetoothToggle'); + assertTrue(!!toggle); assertTrue(toggle.checked); toggle.click(); @@ -113,18 +106,19 @@ bluetoothSummary.i18n('bluetoothEnabledA11YLabel'))); }); - test('Toggle button states', async function() { + test('Toggle button states', async () => { init(); assertEquals(0, browserProxy.getShowBluetoothRevampHatsSurveyCount()); const enableBluetoothToggle = - bluetoothSummary.shadowRoot.querySelector('#enableBluetoothToggle'); + bluetoothSummary.shadowRoot!.querySelector<CrToggleElement>( + '#enableBluetoothToggle'); assertTrue(!!enableBluetoothToggle); assertFalse(enableBluetoothToggle.checked); // Simulate clicking toggle. enableBluetoothToggle.click(); - await flushAsync(); + await flushTasks(); // Toggle should be on since systemState is enabling. assertTrue(enableBluetoothToggle.checked); @@ -134,7 +128,7 @@ // Mock operation failing. bluetoothConfig.completeSetBluetoothEnabledState(/*success=*/ false); - await flushAsync(); + await flushTasks(); // Toggle should be off again. assertFalse(enableBluetoothToggle.checked); @@ -144,7 +138,7 @@ // Click again. enableBluetoothToggle.click(); - await flushAsync(); + await flushTasks(); // Toggle should be on since systemState is enabling. assertTrue(enableBluetoothToggle.checked); @@ -154,7 +148,7 @@ // Mock operation success. bluetoothConfig.completeSetBluetoothEnabledState(/*success=*/ true); - await flushAsync(); + await flushTasks(); // Toggle should still be on. assertTrue(enableBluetoothToggle.checked); @@ -164,7 +158,7 @@ // Mock systemState becoming unavailable. bluetoothConfig.setSystemState(BluetoothSystemState.kUnavailable); - await flushAsync(); + await flushTasks(); assertTrue(enableBluetoothToggle.disabled); assertFalse(enableBluetoothToggle.checked); assertEquals( @@ -172,24 +166,29 @@ 'Count failed to remain the same'); }); - test('UI states test', async function() { + test('UI states test', async () => { init(); // Simulate device state is disabled. const bluetoothSecondaryLabel = - bluetoothSummary.shadowRoot.querySelector('#bluetoothSecondaryLabel'); - const getBluetoothArrowIconBtn = () => - 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()); + bluetoothSummary.shadowRoot!.querySelector('#bluetoothSecondaryLabel'); assertTrue(!!bluetoothSecondaryLabel); + const getBluetoothArrowIconBtn = () => + bluetoothSummary.shadowRoot!.querySelector('#arrowIconButton'); + const getBluetoothStatusIcon = () => { + const statusIcon = + bluetoothSummary.shadowRoot!.querySelector<IronIconElement>( + '#statusIcon'); + assertTrue(!!statusIcon); + return statusIcon; + }; + const getSecondaryLabel = () => bluetoothSecondaryLabel.textContent?.trim(); + const getPairNewDeviceBtn = () => + bluetoothSummary.shadowRoot!.querySelector('#pairNewDeviceBtn'); + + assertNull(getBluetoothArrowIconBtn()); + assertTrue(!!getBluetoothStatusIcon()); + assertNull(getPairNewDeviceBtn()); assertEquals( bluetoothSummary.i18n('bluetoothSummaryPageOff'), getSecondaryLabel()); @@ -197,7 +196,7 @@ 'os-settings:bluetooth-disabled', getBluetoothStatusIcon().icon); bluetoothConfig.setBluetoothEnabledState(/*enabled=*/ true); - await flushAsync(); + await flushTasks(); assertTrue(!!getBluetoothArrowIconBtn()); assertTrue(!!getPairNewDeviceBtn()); @@ -228,35 +227,35 @@ // Simulate 3 connected devices. bluetoothConfig.appendToPairedDeviceList( mockPairedBluetoothDeviceProperties); - await flushAsync(); + await flushTasks(); assertEquals( 'os-settings:bluetooth-connected', getBluetoothStatusIcon().icon); assertEquals( bluetoothSummary.i18n( - 'bluetoothSummaryPageTwoOrMoreDevicesDescription', device1.nickname, - mockPairedBluetoothDeviceProperties.length - 1), + 'bluetoothSummaryPageTwoOrMoreDevicesDescription', + device1.nickname!, mockPairedBluetoothDeviceProperties.length - 1), getSecondaryLabel()); // Simulate 2 connected devices. bluetoothConfig.removePairedDevice(device3); - await flushAsync(); + await flushTasks(); assertEquals( bluetoothSummary.i18n( - 'bluetoothSummaryPageTwoDevicesDescription', device1.nickname, + 'bluetoothSummaryPageTwoDevicesDescription', device1.nickname!, mojoString16ToString(device2.deviceProperties.publicName)), getSecondaryLabel()); // Simulate a single connected device. bluetoothConfig.removePairedDevice(device2); - await flushAsync(); + await flushTasks(); assertEquals(device1.nickname, getSecondaryLabel()); /// Simulate no connected device. bluetoothConfig.removePairedDevice(device1); - await flushAsync(); + await flushTasks(); assertEquals( bluetoothSummary.i18n('bluetoothSummaryPageOn'), getSecondaryLabel()); @@ -265,32 +264,35 @@ // Mock systemState becoming unavailable. bluetoothConfig.setSystemState(BluetoothSystemState.kUnavailable); - await flushAsync(); - assertFalse(!!getBluetoothArrowIconBtn()); - assertFalse(!!getPairNewDeviceBtn()); + await flushTasks(); + assertNull(getBluetoothArrowIconBtn()); + assertNull(getPairNewDeviceBtn()); assertEquals( bluetoothSummary.i18n('bluetoothSummaryPageOff'), getSecondaryLabel()); assertEquals( 'os-settings:bluetooth-disabled', getBluetoothStatusIcon().icon); }); - test('start-pairing is fired on pairNewDeviceBtn click', async function() { + test('start-pairing is fired on pairNewDeviceBtn click', async () => { init(); bluetoothConfig.setBluetoothEnabledState(/*enabled=*/ true); - await flushAsync(); + await flushTasks(); const toggleBluetoothPairingUiPromise = eventToPromise('start-pairing', bluetoothSummary); - const getPairNewDeviceBtn = () => - bluetoothSummary.shadowRoot.querySelector('#pairNewDeviceBtn'); - - assertTrue(!!getPairNewDeviceBtn()); + const getPairNewDeviceBtn = () => { + const button = + bluetoothSummary.shadowRoot!.querySelector<HTMLButtonElement>( + '#pairNewDeviceBtn'); + assertTrue(!!button); + return button; + }; getPairNewDeviceBtn().click(); await toggleBluetoothPairingUiPromise; }); - test('Secondary user', async function() { + test('Secondary user', async () => { const primaryUserEmail = 'test@gmail.com'; loadTimeData.overrideValues({ isSecondaryUser: true, @@ -299,25 +301,26 @@ init(); bluetoothConfig.setBluetoothEnabledState(/*enabled=*/ true); - await flushAsync(); + await flushTasks(); const bluetoothSummaryPrimary = - bluetoothSummary.shadowRoot.querySelector('#bluetoothSummary'); + bluetoothSummary.shadowRoot!.querySelector('#bluetoothSummary'); const bluetoothSummarySecondary = - bluetoothSummary.shadowRoot.querySelector('#bluetoothSummarySeconday'); + bluetoothSummary.shadowRoot!.querySelector('#bluetoothSummarySeconday'); const bluetoothSummarySecondaryText = - bluetoothSummary.shadowRoot.querySelector( + bluetoothSummary.shadowRoot!.querySelector( '#bluetoothSummarySecondayText'); - assertFalse(!!bluetoothSummaryPrimary); + assertNull(bluetoothSummaryPrimary); assertTrue(!!bluetoothSummarySecondary); + assertTrue(!!bluetoothSummarySecondaryText); assertEquals( bluetoothSummary.i18n( 'bluetoothPrimaryUserControlled', primaryUserEmail), - bluetoothSummarySecondaryText.textContent.trim()); + bluetoothSummarySecondaryText.textContent?.trim()); }); - test('Route to summary page', function() { + test('Route to summary page', () => { init(); assertEquals(0, browserProxy.getShowBluetoothRevampHatsSurveyCount()); Router.getInstance().navigateTo(routes.BLUETOOTH);
diff --git a/chrome/test/data/webui/settings/chromeos/os_bluetooth_page/os_paired_bluetooth_list_item_test.ts b/chrome/test/data/webui/settings/chromeos/os_bluetooth_page/os_paired_bluetooth_list_item_test.ts new file mode 100644 index 0000000..92a1c4e --- /dev/null +++ b/chrome/test/data/webui/settings/chromeos/os_bluetooth_page/os_paired_bluetooth_list_item_test.ts
@@ -0,0 +1,321 @@ +// 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 'chrome://os-settings/lazy_load.js'; + +import {SettingsPairedBluetoothListItemElement} from 'chrome://os-settings/lazy_load.js'; +import {Router, routes} from 'chrome://os-settings/os_settings.js'; +import {AudioOutputCapability, DeviceConnectionState, DeviceType} from 'chrome://resources/mojo/chromeos/ash/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom-webui.js'; +import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {assertEquals, assertFalse, assertNull, assertTrue} from 'chrome://webui-test/chai_assert.js'; +import {createDefaultBluetoothDevice} from 'chrome://webui-test/cr_components/chromeos/bluetooth/fake_bluetooth_config.js'; +import {flushTasks} from 'chrome://webui-test/polymer_test_util.js'; +import {eventToPromise, isVisible} from 'chrome://webui-test/test_util.js'; + +suite('<os-settings-paired-bluetooth-list-item>', () => { + let pairedBluetoothListItem: SettingsPairedBluetoothListItemElement; + + setup(() => { + pairedBluetoothListItem = + document.createElement('os-settings-paired-bluetooth-list-item'); + document.body.appendChild(pairedBluetoothListItem); + flush(); + }); + + teardown(() => { + pairedBluetoothListItem.remove(); + }); + + async function setBatteryPercentage(batteryPercentage: number): + Promise<void> { + pairedBluetoothListItem.set('device.deviceProperties.batteryInfo', { + defaultProperties: {batteryPercentage}, + leftBudInfo: undefined, + rightBudInfo: undefined, + caseInfo: undefined, + }); + await flushTasks(); + } + + test( + 'Device name, type, connection state, battery info and a11y labels', + async () => { + // Device with no nickname, battery info, not connected and unknown + // device type. + const publicName = 'BeatsX'; + const device = createDefaultBluetoothDevice( + /*id=*/ '123456789', /*publicName=*/ publicName, + /*connectionState=*/ + DeviceConnectionState.kNotConnected); + pairedBluetoothListItem.set('device', device); + + const itemIndex = 3; + const listSize = 15; + pairedBluetoothListItem.set('itemIndex', itemIndex); + pairedBluetoothListItem.set('listSize', listSize); + await flushTasks(); + + const getDeviceName = () => { + const deviceName = + pairedBluetoothListItem.shadowRoot!.querySelector<HTMLElement>( + '#deviceName'); + assertTrue(!!deviceName); + return deviceName; + }; + const isShowingSubtitle = () => { + const subtitle = + pairedBluetoothListItem.shadowRoot!.querySelector<HTMLElement>( + '#subtitle'); + assertTrue(!!subtitle); + return isVisible(subtitle); + }; + const getBatteryInfo = () => { + return pairedBluetoothListItem.shadowRoot!.querySelector( + 'bluetooth-device-battery-info'); + }; + const getDeviceTypeIcon = () => { + return pairedBluetoothListItem.shadowRoot!.querySelector( + 'bluetooth-icon'); + }; + const getItemA11yLabel = () => { + const listItem = + pairedBluetoothListItem.shadowRoot!.querySelector('.list-item'); + assertTrue(!!listItem); + return listItem.ariaLabel; + }; + + assertTrue(!!getDeviceName()); + assertEquals(publicName, getDeviceName().innerText); + assertFalse(isShowingSubtitle()); + assertNull(getBatteryInfo()); + assertTrue(!!getDeviceTypeIcon()); + + let expectedA11yLabel = [ + pairedBluetoothListItem.i18n( + 'bluetoothA11yDeviceName', itemIndex + 1, listSize, publicName), + pairedBluetoothListItem.i18n( + 'bluetoothA11yDeviceConnectionStateNotConnected'), + pairedBluetoothListItem.i18n('bluetoothA11yDeviceTypeUnknown'), + ].join(' '); + + assertEquals(expectedA11yLabel, getItemA11yLabel()); + + // Set device to connecting. + device.deviceProperties.connectionState = + DeviceConnectionState.kConnecting; + pairedBluetoothListItem.set('device', {...device}); + await flushTasks(); + + assertTrue(!!getDeviceName()); + assertEquals(publicName, getDeviceName().innerText); + assertTrue(isShowingSubtitle()); + assertNull(getBatteryInfo()); + assertTrue(!!getDeviceTypeIcon()); + + expectedA11yLabel = [ + pairedBluetoothListItem.i18n( + 'bluetoothA11yDeviceName', itemIndex + 1, listSize, publicName), + pairedBluetoothListItem.i18n( + 'bluetoothA11yDeviceConnectionStateConnecting'), + pairedBluetoothListItem.i18n('bluetoothA11yDeviceTypeUnknown'), + ].join(' '); + + assertEquals(expectedA11yLabel, getItemA11yLabel()); + + // Set device nickname, connection state, type and battery info. + const nickname = 'nickname'; + device.nickname = nickname; + device.deviceProperties.connectionState = + DeviceConnectionState.kConnected; + device.deviceProperties.deviceType = DeviceType.kComputer; + const batteryPercentage = 60; + device.deviceProperties.batteryInfo = { + defaultProperties: {batteryPercentage}, + leftBudInfo: undefined, + rightBudInfo: undefined, + caseInfo: undefined, + }; + pairedBluetoothListItem.set('device', {...device}); + await flushTasks(); + + let expectedA11yBatteryLabel = pairedBluetoothListItem.i18n( + 'bluetoothA11yDeviceBatteryInfo', batteryPercentage); + + assertTrue(!!getDeviceName()); + assertEquals(nickname, getDeviceName().innerText); + assertFalse(isShowingSubtitle()); + assertTrue(!!getBatteryInfo()); + assertEquals( + pairedBluetoothListItem.get('device.deviceProperties'), + getBatteryInfo()!.device); + + expectedA11yLabel = [ + pairedBluetoothListItem.i18n( + 'bluetoothA11yDeviceName', itemIndex + 1, listSize, nickname), + pairedBluetoothListItem.i18n( + 'bluetoothA11yDeviceConnectionStateConnected'), + pairedBluetoothListItem.i18n('bluetoothA11yDeviceTypeComputer'), + ].join(' '); + + assertEquals( + [expectedA11yLabel, expectedA11yBatteryLabel].join(' '), + getItemA11yLabel()); + + // Add True Wireless battery information and make sure that it takes + // precedence over default battery information. + const leftBudBatteryPercentage = 19; + const caseBatteryPercentage = 29; + const rightBudBatteryPercentage = 39; + device.deviceProperties.batteryInfo!.leftBudInfo = { + batteryPercentage: leftBudBatteryPercentage, + }; + device.deviceProperties.batteryInfo!.caseInfo = { + batteryPercentage: caseBatteryPercentage, + }; + device.deviceProperties.batteryInfo!.rightBudInfo = { + batteryPercentage: rightBudBatteryPercentage, + }; + pairedBluetoothListItem.set('device', {...device}); + await flushTasks(); + + expectedA11yBatteryLabel = [ + pairedBluetoothListItem.i18n( + 'bluetoothA11yDeviceNamedBatteryInfoLeftBud', + leftBudBatteryPercentage), + pairedBluetoothListItem.i18n( + 'bluetoothA11yDeviceNamedBatteryInfoCase', caseBatteryPercentage), + pairedBluetoothListItem.i18n( + 'bluetoothA11yDeviceNamedBatteryInfoRightBud', + rightBudBatteryPercentage), + ].join(' '); + + assertEquals( + [expectedA11yLabel, expectedA11yBatteryLabel].join(' '), + getItemA11yLabel()); + }); + + test('Battery percentage out of bounds', async () => { + const device = createDefaultBluetoothDevice( + /*id=*/ '123456789', /*publicName=*/ 'BeatsX', + /*connectionState=*/ + DeviceConnectionState.kConnected); + pairedBluetoothListItem.set('device', device); + + const getBatteryInfo = () => { + return pairedBluetoothListItem.shadowRoot!.querySelector( + 'bluetooth-device-battery-info'); + }; + + await setBatteryPercentage(-10); + assertNull(getBatteryInfo()); + + await setBatteryPercentage(101); + assertNull(getBatteryInfo()); + }); + + test('Selecting item routes to detail subpage', async () => { + const id = '123456789'; + const device = createDefaultBluetoothDevice( + id, /*publicName=*/ 'BeatsX', + /*connectionState=*/ + DeviceConnectionState.kConnected); + pairedBluetoothListItem.set('device', device); + await flushTasks(); + + const getItemContainer = () => { + const listItem = + pairedBluetoothListItem.shadowRoot!.querySelector<HTMLElement>( + '.list-item'); + assertTrue(!!listItem); + return listItem; + }; + const assertInDetailSubpage = async () => { + await flushTasks(); + assertEquals( + routes.BLUETOOTH_DEVICE_DETAIL, Router.getInstance().currentRoute); + assertEquals(id, Router.getInstance().getQueryParameters().get('id')); + + Router.getInstance().resetRouteForTesting(); + assertEquals(routes.BASIC, Router.getInstance().currentRoute); + }; + + // Simulate clicking item. + assertEquals(routes.BASIC, Router.getInstance().currentRoute); + getItemContainer().click(); + await assertInDetailSubpage(); + + // Simulate pressing enter on the item. + getItemContainer().dispatchEvent( + new KeyboardEvent('keydown', {'key': 'Enter'})); + await assertInDetailSubpage(); + + // Simulate pressing space on the item. + getItemContainer().dispatchEvent( + new KeyboardEvent('keydown', {'key': ' '})); + await assertInDetailSubpage(); + + // Simulate clicking the item's subpage button. + const button = + pairedBluetoothListItem.shadowRoot!.querySelector<HTMLButtonElement>( + '#subpageButton'); + assertTrue(!!button); + button.click(); + await assertInDetailSubpage(); + }); + + test('Enterprise-managed icon UI state', async () => { + const getManagedIcon = () => { + return pairedBluetoothListItem.shadowRoot!.querySelector('#managedIcon'); + }; + assertNull(getManagedIcon()); + + const device = createDefaultBluetoothDevice( + /*id=*/ '12//345&6789', + /*publicName=*/ 'BeatsX', + /*connectionState=*/ + DeviceConnectionState.kConnected, + /*opt_nickname=*/ 'device1', + /*opt_audioCapability=*/ + AudioOutputCapability.kCapableOfAudioOutput, + /*opt_deviceType=*/ DeviceType.kMouse, + /*opt_isBlockedByPolicy=*/ true); + + pairedBluetoothListItem.set('device', {...device}); + await flushTasks(); + + // The icon should now be showing. + assertTrue(!!getManagedIcon()); + + // Simulate hovering over the icon. + const showTooltipPromise = + eventToPromise('managed-tooltip-state-change', pairedBluetoothListItem); + getManagedIcon()!.dispatchEvent(new Event('mouseenter')); + + // The managed-tooltip-state-changed event should have been fired. + const showTooltipEvent = await showTooltipPromise; + assertEquals(true, showTooltipEvent.detail.show); + assertEquals(getManagedIcon(), showTooltipEvent.detail.element); + assertEquals( + device.deviceProperties.address, showTooltipEvent.detail.address); + + // Simulate the device being unblocked by policy. + const hideTooltipPromise = + eventToPromise('managed-tooltip-state-change', pairedBluetoothListItem); + const device1 = {...device}; + device1.deviceProperties.isBlockedByPolicy = false; + pairedBluetoothListItem.set('device', device1); + + await flushTasks(); + + // The icon should now be hidden. + assertNull(getManagedIcon()); + + // The managed-tooltip-state-changed event should have been fired again. + const hideTooltipEvent = await hideTooltipPromise; + assertFalse(hideTooltipEvent.detail.show); + assertEquals(undefined, hideTooltipEvent.detail.element); + assertEquals( + device.deviceProperties.address, hideTooltipEvent.detail.address); + }); +});
diff --git a/chrome/test/data/webui/settings/chromeos/os_paired_bluetooth_list_item_tests.js b/chrome/test/data/webui/settings/chromeos/os_paired_bluetooth_list_item_tests.js deleted file mode 100644 index b6faed04..0000000 --- a/chrome/test/data/webui/settings/chromeos/os_paired_bluetooth_list_item_tests.js +++ /dev/null
@@ -1,304 +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. - -import 'chrome://os-settings/strings.m.js'; - -import {Router, routes} from 'chrome://os-settings/os_settings.js'; -import {AudioOutputCapability, DeviceConnectionState, DeviceType} from 'chrome://resources/mojo/chromeos/ash/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom-webui.js'; -import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {assertEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; -import {createDefaultBluetoothDevice} from 'chrome://webui-test/cr_components/chromeos/bluetooth/fake_bluetooth_config.js'; -import {eventToPromise} from 'chrome://webui-test/test_util.js'; - -suite('OsPairedBluetoothListItemTest', function() { - /** @type {!SettingsPairedBluetoothListItemElement|undefined} */ - let pairedBluetoothListItem; - - setup(function() { - pairedBluetoothListItem = - document.createElement('os-settings-paired-bluetooth-list-item'); - document.body.appendChild(pairedBluetoothListItem); - flush(); - }); - - function flushAsync() { - flush(); - return new Promise(resolve => setTimeout(resolve)); - } - - /** - * @param {number} batteryPercentage - */ - async function setBatteryPercentage(batteryPercentage) { - pairedBluetoothListItem.device.deviceProperties.batteryInfo = { - defaultProperties: {batteryPercentage: batteryPercentage}, - }; - pairedBluetoothListItem.device = {...pairedBluetoothListItem.device}; - return flushAsync(); - } - - test( - 'Device name, type, connection state, battery info and a11y labels', - async function() { - // Device with no nickname, battery info, not connected and unknown - // device type. - const publicName = 'BeatsX'; - const device = createDefaultBluetoothDevice( - /*id=*/ '123456789', /*publicName=*/ publicName, - /*connectionState=*/ - DeviceConnectionState.kNotConnected); - pairedBluetoothListItem.device = device; - - const itemIndex = 3; - const listSize = 15; - pairedBluetoothListItem.itemIndex = itemIndex; - pairedBluetoothListItem.listSize = listSize; - await flushAsync(); - - const getDeviceName = () => { - return pairedBluetoothListItem.$.deviceName; - }; - const isShowingSubtitle = () => { - return !pairedBluetoothListItem.$.subtitle.hidden; - }; - const getBatteryInfo = () => { - return pairedBluetoothListItem.shadowRoot.querySelector( - 'bluetooth-device-battery-info'); - }; - const getDeviceTypeIcon = () => { - return pairedBluetoothListItem.shadowRoot.querySelector( - 'bluetooth-icon'); - }; - const getItemA11yLabel = () => { - return pairedBluetoothListItem.shadowRoot.querySelector('.list-item') - .ariaLabel; - }; - const getSubpageButtonA11yLabel = () => { - return pairedBluetoothListItem.$.subpageButton.ariaLabel; - }; - assertTrue(!!getDeviceName()); - assertEquals(getDeviceName().innerText, publicName); - assertFalse(!!isShowingSubtitle()); - assertFalse(!!getBatteryInfo()); - assertTrue(!!getDeviceTypeIcon()); - - let expectedA11yLabel = pairedBluetoothListItem.i18n( - 'bluetoothA11yDeviceName', itemIndex + 1, - listSize, publicName) + - ' ' + - pairedBluetoothListItem.i18n( - 'bluetoothA11yDeviceConnectionStateNotConnected') + - ' ' + - pairedBluetoothListItem.i18n('bluetoothA11yDeviceTypeUnknown'); - assertEquals(getItemA11yLabel(), expectedA11yLabel); - - // Set device to connecting. - device.deviceProperties.connectionState = - DeviceConnectionState.kConnecting; - pairedBluetoothListItem.device = {...device}; - await flushAsync(); - - assertTrue(!!getDeviceName()); - assertEquals(getDeviceName().innerText, publicName); - assertTrue(!!isShowingSubtitle()); - assertFalse(!!getBatteryInfo()); - assertTrue(!!getDeviceTypeIcon()); - - expectedA11yLabel = pairedBluetoothListItem.i18n( - 'bluetoothA11yDeviceName', itemIndex + 1, - listSize, publicName) + - ' ' + - pairedBluetoothListItem.i18n( - 'bluetoothA11yDeviceConnectionStateConnecting') + - ' ' + - pairedBluetoothListItem.i18n('bluetoothA11yDeviceTypeUnknown'); - assertEquals(getItemA11yLabel(), expectedA11yLabel); - - // Set device nickname, connection state, type and battery info. - const nickname = 'nickname'; - device.nickname = nickname; - device.deviceProperties.connectionState = - DeviceConnectionState.kConnected; - device.deviceProperties.deviceType = DeviceType.kComputer; - const batteryPercentage = 60; - device.deviceProperties.batteryInfo = { - defaultProperties: {batteryPercentage: batteryPercentage}, - }; - pairedBluetoothListItem.device = {...device}; - await flushAsync(); - - let expectedA11yBatteryLabel = pairedBluetoothListItem.i18n( - 'bluetoothA11yDeviceBatteryInfo', batteryPercentage); - - assertTrue(!!getDeviceName()); - assertEquals(getDeviceName().innerText, nickname); - assertFalse(!!isShowingSubtitle()); - assertTrue(!!getBatteryInfo()); - assertEquals( - getBatteryInfo().device, - pairedBluetoothListItem.device.deviceProperties); - - expectedA11yLabel = - pairedBluetoothListItem.i18n( - 'bluetoothA11yDeviceName', itemIndex + 1, listSize, nickname) + - ' ' + - pairedBluetoothListItem.i18n( - 'bluetoothA11yDeviceConnectionStateConnected') + - ' ' + - pairedBluetoothListItem.i18n('bluetoothA11yDeviceTypeComputer'); - assertEquals( - getItemA11yLabel(), - expectedA11yLabel + ' ' + expectedA11yBatteryLabel); - - // Add True Wireless battery information and make sure that it takes - // precedence over default battery information. - const leftBudBatteryPercentage = 19; - const caseBatteryPercentage = 29; - const rightBudBatteryPercentage = 39; - device.deviceProperties.batteryInfo.leftBudInfo = { - batteryPercentage: leftBudBatteryPercentage, - }; - device.deviceProperties.batteryInfo.caseInfo = { - batteryPercentage: caseBatteryPercentage, - }; - device.deviceProperties.batteryInfo.rightBudInfo = { - batteryPercentage: rightBudBatteryPercentage, - }; - pairedBluetoothListItem.device = {...device}; - await flushAsync(); - - expectedA11yBatteryLabel = - pairedBluetoothListItem.i18n( - 'bluetoothA11yDeviceNamedBatteryInfoLeftBud', - leftBudBatteryPercentage) + - ' ' + - pairedBluetoothListItem.i18n( - 'bluetoothA11yDeviceNamedBatteryInfoCase', - caseBatteryPercentage) + - ' ' + - pairedBluetoothListItem.i18n( - 'bluetoothA11yDeviceNamedBatteryInfoRightBud', - rightBudBatteryPercentage); - - assertEquals( - getItemA11yLabel(), - expectedA11yLabel + ' ' + expectedA11yBatteryLabel); - }); - - test('Battery percentage out of bounds', async function() { - const device = createDefaultBluetoothDevice( - /*id=*/ '123456789', /*publicName=*/ 'BeatsX', - /*connectionState=*/ - DeviceConnectionState.kConnected); - pairedBluetoothListItem.device = device; - - const getBatteryInfo = () => { - return pairedBluetoothListItem.shadowRoot.querySelector( - 'bluetooth-device-battery-info'); - }; - - await setBatteryPercentage(-10); - assertFalse(!!getBatteryInfo()); - - await setBatteryPercentage(101); - assertFalse(!!getBatteryInfo()); - }); - - test('Selecting item routes to detail subpage', async function() { - const id = '123456789'; - const device = createDefaultBluetoothDevice( - id, /*publicName=*/ 'BeatsX', - /*connectionState=*/ - DeviceConnectionState.kConnected); - pairedBluetoothListItem.device = device; - await flushAsync(); - - const getItemContainer = () => { - return pairedBluetoothListItem.shadowRoot.querySelector('.list-item'); - }; - const assertInDetailSubpage = async () => { - await flushAsync(); - assertEquals( - Router.getInstance().currentRoute, routes.BLUETOOTH_DEVICE_DETAIL); - assertEquals(id, Router.getInstance().getQueryParameters().get('id')); - - Router.getInstance().resetRouteForTesting(); - assertEquals(Router.getInstance().currentRoute, routes.BASIC); - }; - - // Simulate clicking item. - assertEquals(Router.getInstance().currentRoute, routes.BASIC); - getItemContainer().click(); - await assertInDetailSubpage(); - - // Simulate pressing enter on the item. - getItemContainer().dispatchEvent( - new KeyboardEvent('keydown', {'key': 'Enter'})); - await assertInDetailSubpage(); - - // Simulate pressing space on the item. - getItemContainer().dispatchEvent( - new KeyboardEvent('keydown', {'key': ' '})); - await assertInDetailSubpage(); - - // Simulate clicking the item's subpage button. - pairedBluetoothListItem.$.subpageButton.click(); - await assertInDetailSubpage(); - }); - - test('Enterprise-managed icon UI state', async function() { - const getManagedIcon = () => { - return pairedBluetoothListItem.shadowRoot.querySelector('#managedIcon'); - }; - assertFalse(!!getManagedIcon()); - - const device = createDefaultBluetoothDevice( - /*id=*/ '12//345&6789', - /*publicName=*/ 'BeatsX', - /*connectionState=*/ - DeviceConnectionState.kConnected, - /*opt_nickname=*/ 'device1', - /*opt_audioCapability=*/ - AudioOutputCapability.kCapableOfAudioOutput, - /*opt_deviceType=*/ DeviceType.kMouse, - /*opt_isBlockedByPolicy=*/ true); - - pairedBluetoothListItem.device = Object.assign({}, device); - await flushAsync(); - - // The icon should now be showing. - assertTrue(!!getManagedIcon()); - - // Simulate hovering over the icon. - const showTooltipPromise = - eventToPromise('managed-tooltip-state-change', pairedBluetoothListItem); - getManagedIcon().dispatchEvent(new Event('mouseenter')); - - // The managed-tooltip-state-changed event should have been fired. - const showTooltipEvent = await showTooltipPromise; - assertEquals(showTooltipEvent.detail.show, true); - assertEquals(showTooltipEvent.detail.element, getManagedIcon()); - assertEquals( - showTooltipEvent.detail.address, device.deviceProperties.address); - - // Simulate the device being unblocked by policy. - const hideTooltipPromise = - eventToPromise('managed-tooltip-state-change', pairedBluetoothListItem); - const device1 = Object.assign({}, device); - device1.deviceProperties.isBlockedByPolicy = false; - pairedBluetoothListItem.device = Object.assign({}, device1); - - await flushAsync(); - - // The icon should now be hidden. - assertFalse(!!getManagedIcon()); - - // The managed-tooltip-state-changed event should have been fired again. - const hideTooltipEvent = await hideTooltipPromise; - assertEquals(hideTooltipEvent.detail.show, false); - assertEquals(hideTooltipEvent.detail.element, undefined); - assertEquals( - hideTooltipEvent.detail.address, device.deviceProperties.address); - }); -});
diff --git a/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.js b/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.js index e77a2a6..d98eea8 100644 --- a/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.js +++ b/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.js
@@ -625,7 +625,7 @@ ], [ 'OsBluetoothPageOsBluetoothSummary', - 'os_bluetooth_page/os_bluetooth_summary_tests.js' + 'os_bluetooth_page/os_bluetooth_summary_test.js' ], [ 'OsBluetoothPageOsBluetoothTrueWirelessImages', @@ -635,6 +635,10 @@ 'OsBluetoothPageOsPairedBluetoothList', 'os_bluetooth_page/os_paired_bluetooth_list_test.js' ], + [ + 'OsBluetoothPageOsPairedBluetoothListItem', + 'os_bluetooth_page/os_paired_bluetooth_list_item_test.js' + ], ['OsFilesPage', 'os_files_page/os_files_page_test.js'], ['OsFilesPageGoogleDrivePage', 'os_files_page/google_drive_page_test.js'], ['OsFilesPageOneDrivePage', 'os_files_page/one_drive_page_test.js'], @@ -670,7 +674,6 @@ 'OsLanguagesPageSmartInputsPage', 'os_languages_page/smart_inputs_page_test.js' ], - ['OsPairedBluetoothListItem', 'os_paired_bluetooth_list_item_tests.js'], [ 'OsPageAvailability', 'os_page_availability_test.js',
diff --git a/chrome/updater/crash_reporter.cc b/chrome/updater/crash_reporter.cc index 6e608a8..413a713b 100644 --- a/chrome/updater/crash_reporter.cc +++ b/chrome/updater/crash_reporter.cc
@@ -96,13 +96,20 @@ ->set_gather_indirectly_referenced_memory(crashpad::TriState::kEnabled, kIndirectMemoryLimit); crashpad::CrashpadClient& client = GetCrashpadClient(); + std::vector<base::FilePath> attachments; +#if !BUILDFLAG(IS_MAC) // Crashpad does not support attachments on macOS. + absl::optional<base::FilePath> log_file = GetLogFilePath(updater_scope); + if (log_file) { + attachments.push_back(*log_file); + } +#endif if (!client.StartHandler( handler_path, *database_path, /*metrics_dir=*/base::FilePath(), CreateExternalConstants()->CrashUploadURL().possibly_invalid_spec(), annotations, MakeCrashHandlerArgs(updater_scope), /*restartable=*/true, - /*asynchronous_start=*/false)) { + /*asynchronous_start=*/false, attachments)) { VLOG(1) << "Failed to start handler."; return; }
diff --git a/chrome/updater/device_management/dm_storage_win.cc b/chrome/updater/device_management/dm_storage_win.cc index 04fa2ae..39ab47d4 100644 --- a/chrome/updater/device_management/dm_storage_win.cc +++ b/chrome/updater/device_management/dm_storage_win.cc
@@ -113,7 +113,7 @@ bool TokenService::DeleteDmToken() { base::win::RegKey key; auto result = key.Open(HKEY_LOCAL_MACHINE, kRegKeyCompanyEnrollment, - Wow6432(KEY_SET_VALUE)); + Wow6432(KEY_QUERY_VALUE | KEY_SET_VALUE)); // The registry key which stores the DMToken value was not found, so deletion // is not necessary. @@ -129,8 +129,9 @@ } // Delete the key if no other values are present. - base::win::RegKey(HKEY_LOCAL_MACHINE, L"", Wow6432(KEY_WRITE)) - .DeleteEmptyKey(kRegKeyCompanyEnrollment); + if (key.GetValueCount().value_or(1) == 0) { + key.DeleteKey(L""); + } VLOG(1) << "DM token is deleted."; return true; }
diff --git a/chrome/updater/test/integration_tests_impl.cc b/chrome/updater/test/integration_tests_impl.cc index 6e380159..23cb8c9b 100644 --- a/chrome/updater/test/integration_tests_impl.cc +++ b/chrome/updater/test/integration_tests_impl.cc
@@ -751,7 +751,7 @@ absl::optional<base::FilePath> log = GetLogFilePath(scope); ASSERT_TRUE(log); std::string data = "This test string is used to fill up log space.\n"; - for (int i = 0; i < 1024 * 1024 * 6; i += data.length()) { + for (int i = 0; i < 1024 * 1024 * 3; i += data.length()) { ASSERT_TRUE(base::AppendToFile(*log, data)); } }
diff --git a/chrome/updater/test/integration_tests_win.cc b/chrome/updater/test/integration_tests_win.cc index 0d1c56d2..8b36619 100644 --- a/chrome/updater/test/integration_tests_win.cc +++ b/chrome/updater/test/integration_tests_win.cc
@@ -40,6 +40,7 @@ #include "base/task/task_traits.h" #include "base/task/thread_pool.h" #include "base/test/bind.h" +#include "base/test/gmock_expected_support.h" #include "base/test/test_timeouts.h" #include "base/threading/platform_thread.h" #include "base/time/time.h" @@ -76,6 +77,7 @@ #include "chrome/updater/win/ui/resources/updater_installer_strings.h" #include "chrome/updater/win/win_constants.h" #include "components/crx_file/crx_verifier.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "url/gurl.h" @@ -182,9 +184,9 @@ EXPECT_EQ(updater_key_iter.SubkeyCount(), 1u); EXPECT_STREQ(updater_key_iter.Name(), L"ClientState"); - EXPECT_EQ(base::win::RegKey(root, CLIENT_STATE_KEY, Wow6432(KEY_READ)) - .GetValueCount(), - 0u); + EXPECT_THAT(base::win::RegKey(root, CLIENT_STATE_KEY, Wow6432(KEY_READ)) + .GetValueCount(), + base::test::ValueIs(0u)); const std::vector<std::wstring> allowed_values = {kDidRun, L"lastrun"}; for (base::win::RegistryKeyIterator client_state_iter(root, CLIENT_STATE_KEY, KEY_WOW64_32KEY);
diff --git a/chrome/updater/util/util.cc b/chrome/updater/util/util.cc index 8f08c21..974f32c9 100644 --- a/chrome/updater/util/util.cc +++ b/chrome/updater/util/util.cc
@@ -57,7 +57,7 @@ namespace updater { namespace { -constexpr int64_t kLogRotateAtSize = 1024 * 1024 * 5; // 5 MiB. +constexpr int64_t kLogRotateAtSize = 1024 * 1024 * 2; // 2 MiB. const char kHexString[] = "0123456789ABCDEF"; inline char IntToHex(int i) {
diff --git a/chrome/updater/win/setup/uninstall.cc b/chrome/updater/win/setup/uninstall.cc index 37c75e3..7b5dd04 100644 --- a/chrome/updater/win/setup/uninstall.cc +++ b/chrome/updater/win/setup/uninstall.cc
@@ -118,7 +118,12 @@ } // Finally, delete `UPDATER_KEY` if it is empty. - base::win::RegKey(root, L"", Wow6432(KEY_WRITE)).DeleteEmptyKey(UPDATER_KEY); + base::win::RegKey updater_key; + if (updater_key.Open(root, UPDATER_KEY, Wow6432(KEY_QUERY_VALUE)) == + ERROR_SUCCESS && + updater_key.GetValueCount().value_or(1) == 0) { + updater_key.DeleteKey(L""); + } } void DeleteGoogleUpdateFilesAndKeys(UpdaterScope scope) {
diff --git a/chromeos/dbus/missive/fake_missive_client.cc b/chromeos/dbus/missive/fake_missive_client.cc index 0f49d6c..5058305 100644 --- a/chromeos/dbus/missive/fake_missive_client.cc +++ b/chromeos/dbus/missive/fake_missive_client.cc
@@ -48,6 +48,11 @@ return; } +void FakeMissiveClient::UpdateConfigInMissive( + const reporting::ListOfBlockedDestinations& destinations) { + return; +} + void FakeMissiveClient::UpdateEncryptionKey( const reporting::SignedEncryptionInfo& encryption_info) { return;
diff --git a/chromeos/dbus/missive/fake_missive_client.h b/chromeos/dbus/missive/fake_missive_client.h index e6f0857a..d8123ab 100644 --- a/chromeos/dbus/missive/fake_missive_client.h +++ b/chromeos/dbus/missive/fake_missive_client.h
@@ -41,6 +41,8 @@ base::OnceCallback<void(reporting::Status)> completion_callback) override; void UpdateEncryptionKey( const reporting::SignedEncryptionInfo& encryption_info) override; + void UpdateConfigInMissive( + const reporting::ListOfBlockedDestinations& destinations) override; void ReportSuccess(const reporting::SequenceInformation& sequence_information, bool force_confirm) override; TestInterface* GetTestInterface() override;
diff --git a/chromeos/dbus/missive/missive_client.cc b/chromeos/dbus/missive/missive_client.cc index 8aeb50f7..fb096d5 100644 --- a/chromeos/dbus/missive/missive_client.cc +++ b/chromeos/dbus/missive/missive_client.cc
@@ -29,6 +29,7 @@ #include "dbus/message.h" #include "dbus/object_proxy.h" #include "google_apis/google_api_keys.h" +#include "third_party/cros_system_api/dbus/missive/dbus-constants.h" #include "third_party/cros_system_api/dbus/service_constants.h" namespace chromeos { @@ -116,6 +117,17 @@ client_.MaybeMakeCall(std::move(delegate)); } + void UpdateConfigInMissive( + const reporting::ListOfBlockedDestinations& destinations) override { + DCHECK_CALLED_ON_VALID_SEQUENCE(origin_checker_); + if (is_disabled()) { + return; + } + auto delegate = + std::make_unique<UpdateConfigInMissiveDelegate>(destinations, this); + client_.MaybeMakeCall(std::move(delegate)); + } + void UpdateEncryptionKey( const reporting::SignedEncryptionInfo& encryption_info) override { DCHECK_CALLED_ON_VALID_SEQUENCE(origin_checker_); @@ -295,6 +307,25 @@ reporting::FlushPriorityRequest request_; }; + class UpdateConfigInMissiveDelegate : public DBusDelegate { + public: + UpdateConfigInMissiveDelegate( + const reporting::ListOfBlockedDestinations& destinations, + MissiveClientImpl* owner) + : DBusDelegate(missive::kUpdateConfigInMissive, + owner, + base::DoNothing()) { + *request_.mutable_list_of_blocked_destinations() = destinations; + } + + bool WriteRequest(dbus::MessageWriter* writer) override { + return writer->AppendProtoAsArrayOfBytes(request_); + } + + private: + reporting::UpdateConfigInMissiveRequest request_; + }; + class UpdateEncryptionKeyDelegate : public DBusDelegate { public: UpdateEncryptionKeyDelegate(
diff --git a/chromeos/dbus/missive/missive_client.h b/chromeos/dbus/missive/missive_client.h index 2e21f5a..c75a2f8 100644 --- a/chromeos/dbus/missive/missive_client.h +++ b/chromeos/dbus/missive/missive_client.h
@@ -74,6 +74,8 @@ virtual void Flush( const reporting::Priority priority, base::OnceCallback<void(reporting::Status)> completion_callback) = 0; + virtual void UpdateConfigInMissive( + const reporting::ListOfBlockedDestinations& destinations) = 0; virtual void UpdateEncryptionKey( const reporting::SignedEncryptionInfo& encryption_info) = 0; virtual void ReportSuccess(
diff --git a/clank b/clank index c9d0245..b1f20bf 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit c9d02456a8a6a34037e743fdd98407fe056ae1bf +Subproject commit b1f20bfe98979ff601530c192b42ead80cddddf1
diff --git a/components/autofill/android/BUILD.gn b/components/autofill/android/BUILD.gn index d82f7bc..432701d 100644 --- a/components/autofill/android/BUILD.gn +++ b/components/autofill/android/BUILD.gn
@@ -159,6 +159,7 @@ deps = [ ":autofill_java_resources", ":payments_autofill_java", + "//base:base_java", "//base:jni_java", "//content/public/android:content_java", "//third_party/androidx:androidx_annotation_annotation_java", @@ -168,18 +169,25 @@ "//url:gurl_java", ] sources = [ + "java/src/org/chromium/components/autofill/AddressNormalizer.java", "java/src/org/chromium/components/autofill/AutofillDelegate.java", "java/src/org/chromium/components/autofill/AutofillDropdownAdapter.java", "java/src/org/chromium/components/autofill/AutofillPopup.java", "java/src/org/chromium/components/autofill/AutofillProfile.java", "java/src/org/chromium/components/autofill/AutofillSuggestion.java", ] - srcjar_deps = [ ":autofill_core_browser_java_enums" ] + srcjar_deps = [ + ":autofill_core_browser_java_enums", + ":main_autofill_jni_headers", + ] resources_package = "org.chromium.components.autofill" } generate_jni("main_autofill_jni_headers") { - sources = [ "java/src/org/chromium/components/autofill/AutofillProfile.java" ] + sources = [ + "java/src/org/chromium/components/autofill/AddressNormalizer.java", + "java/src/org/chromium/components/autofill/AutofillProfile.java", + ] deps = [ "//base:jni_java" ] }
diff --git a/components/autofill/android/java/src/org/chromium/components/autofill/AddressNormalizer.java b/components/autofill/android/java/src/org/chromium/components/autofill/AddressNormalizer.java new file mode 100644 index 0000000..2174744 --- /dev/null +++ b/components/autofill/android/java/src/org/chromium/components/autofill/AddressNormalizer.java
@@ -0,0 +1,86 @@ +// Copyright 2023 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.components.autofill; + +import org.chromium.base.ResettersForTesting; +import org.chromium.base.ThreadUtils; +import org.chromium.base.annotations.CalledByNative; +import org.chromium.base.annotations.JNINamespace; +import org.chromium.base.annotations.NativeMethods; + +/** + * A class used to normalize addresses. + */ +@JNINamespace("autofill") +public class AddressNormalizer { + /** + * Callback for normalized addresses. + */ + public interface NormalizedAddressRequestDelegate { + /** + * Called when the address has been successfully normalized. + * + * @param profile The profile with the normalized address. + */ + @CalledByNative("NormalizedAddressRequestDelegate") + void onAddressNormalized(AutofillProfile profile); + + /** + * Called when the address could not be normalized. + * + * @param profile The non normalized profile. + */ + @CalledByNative("NormalizedAddressRequestDelegate") + void onCouldNotNormalize(AutofillProfile profile); + } + + private static int sRequestTimeoutSeconds = 5; + private final long mNativePtr; + + @CalledByNative + private AddressNormalizer(long nativePtr) { + mNativePtr = nativePtr; + } + + /** + * Starts loading the address validation rules for the specified {@code regionCode}. + * + * @param regionCode The code of the region for which to load the rules. + */ + public void loadRulesForAddressNormalization(String regionCode) { + ThreadUtils.assertOnUiThread(); + AddressNormalizerJni.get().loadRulesForAddressNormalization(mNativePtr, regionCode); + } + + /** + * Normalizes the address of the profile associated with the {@code guid} if the rules + * associated with the profile's region are done loading. Otherwise sets up the callback to + * start normalizing the address when the rules are loaded. The normalized profile will be sent + * to the {@code delegate}. If the profile is not normalized in the specified + * {@code sRequestTimeoutSeconds}, the {@code delegate} will be notified. + * + * @param profile The profile to normalize. + * @param delegate The object requesting the normalization. + */ + public void normalizeAddress( + AutofillProfile profile, NormalizedAddressRequestDelegate delegate) { + ThreadUtils.assertOnUiThread(); + AddressNormalizerJni.get().startAddressNormalization( + mNativePtr, profile, sRequestTimeoutSeconds, delegate); + } + + public static void setRequestTimeoutForTesting(int timeout) { + var oldValue = sRequestTimeoutSeconds; + sRequestTimeoutSeconds = timeout; + ResettersForTesting.register(() -> sRequestTimeoutSeconds = oldValue); + } + + @NativeMethods + interface Natives { + void loadRulesForAddressNormalization(long nativeAddressNormalizerImpl, String regionCode); + void startAddressNormalization(long nativeAddressNormalizerImpl, AutofillProfile profile, + int timeoutSeconds, NormalizedAddressRequestDelegate delegate); + } +}
diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/components/autofill/content/browser/content_autofill_driver.cc index 46c4f562..5ec1554 100644 --- a/components/autofill/content/browser/content_autofill_driver.cc +++ b/components/autofill/content/browser/content_autofill_driver.cc
@@ -177,10 +177,6 @@ return render_frame_host_->IsActive(); } -ui::AXTreeID ContentAutofillDriver::GetAxTreeId() const { - return render_frame_host_->GetAXTreeID(); -} - bool ContentAutofillDriver::RendererIsAvailable() { return render_frame_host_->GetRenderViewHost() != nullptr; }
diff --git a/components/autofill/content/browser/content_autofill_driver.h b/components/autofill/content/browser/content_autofill_driver.h index 96e498a..f28e88b3 100644 --- a/components/autofill/content/browser/content_autofill_driver.h +++ b/components/autofill/content/browser/content_autofill_driver.h
@@ -163,7 +163,6 @@ bool IsPrerendering() const override; bool HasSharedAutofillPermission() const override; bool CanShowAutofillUi() const override; - ui::AXTreeID GetAxTreeId() const override; bool RendererIsAvailable() override; void HandleParsedForms(const std::vector<FormData>& forms) override {} void PopupHidden() override;
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc index 5874ac3..124a089 100644 --- a/components/autofill/content/renderer/autofill_agent.cc +++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -1354,10 +1354,6 @@ focused_node_was_last_clicked_ = false; - if (password_generation_agent_) { - password_generation_agent_->NotifyFocusChangeComplete(focused_element); - } - SendPotentiallySubmittedFormToBrowser(); }
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc index 75db92e..ba368fb 100644 --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -828,8 +828,7 @@ void PasswordAutofillAgent::FillPasswordSuggestion( const std::u16string& username, const std::u16string& password) { - auto element = - autofill_agent_->focused_element().DynamicTo<WebInputElement>(); + auto element = focused_element().DynamicTo<WebInputElement>(); if (element.IsNull()) return; @@ -887,8 +886,7 @@ void PasswordAutofillAgent::FillIntoFocusedField( bool is_password, const std::u16string& credential) { - auto focused_input_element = - autofill_agent_->focused_element().DynamicTo<WebInputElement>(); + auto focused_input_element = focused_element().DynamicTo<WebInputElement>(); if (focused_input_element.IsNull()) { return; } @@ -1565,8 +1563,7 @@ bool show_virtual_keyboard) { keyboard_replacing_surface_state_ = KeyboardReplacingSurfaceState::kWasShown; - auto focused_input_element = - autofill_agent_->focused_element().DynamicTo<WebInputElement>(); + auto focused_input_element = focused_element().DynamicTo<WebInputElement>(); if (focused_input_element.IsNull()) { return; }
diff --git a/components/autofill/content/renderer/password_autofill_agent.h b/components/autofill/content/renderer/password_autofill_agent.h index 8fb35db..6a3a94c9 100644 --- a/components/autofill/content/renderer/password_autofill_agent.h +++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -30,6 +30,7 @@ #include "mojo/public/cpp/bindings/associated_remote.h" #include "mojo/public/cpp/bindings/pending_associated_receiver.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" +#include "third_party/blink/public/web/web_form_control_element.h" #include "third_party/blink/public/web/web_input_element.h" #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) @@ -248,6 +249,11 @@ // Check if the given element is a username input field. bool IsUsernameInputField(const blink::WebInputElement& input_element) const; + const blink::WebFormControlElement& focused_element() const { + CHECK(autofill_agent_); + return autofill_agent_->focused_element(); + } + private: using OnPasswordField = base::StrongAlias<class OnPasswordFieldTag, bool>;
diff --git a/components/autofill/content/renderer/password_generation_agent.cc b/components/autofill/content/renderer/password_generation_agent.cc index 3724e9b..64309e03 100644 --- a/components/autofill/content/renderer/password_generation_agent.cc +++ b/components/autofill/content/renderer/password_generation_agent.cc
@@ -262,7 +262,6 @@ } } current_generation_item_.reset(); - last_focused_password_element_.Reset(); generation_enabled_fields_.clear(); } @@ -447,17 +446,24 @@ } bool PasswordGenerationAgent::SetUpTriggeredGeneration() { - if (last_focused_password_element_.IsNull() || !render_frame()) + if (!render_frame()) { return false; + } + const WebInputElement last_focused_password_element = + password_agent_->focused_element().DynamicTo<WebInputElement>(); + if (last_focused_password_element.IsNull() || + !last_focused_password_element.IsPasswordFieldForAutofill()) { + return false; + } FieldRendererId last_focused_password_element_id( - last_focused_password_element_.UniqueRendererFormControlId()); + last_focused_password_element.UniqueRendererFormControlId()); bool is_automatic_generation_available = base::Contains( generation_enabled_fields_, last_focused_password_element_id); if (!is_automatic_generation_available) { - WebFormElement form = last_focused_password_element_.Form(); + WebFormElement form = last_focused_password_element.Form(); std::vector<WebFormControlElement> control_elements; if (!form.IsNull()) { control_elements = form_util::ExtractAutofillableElementsInForm(form); @@ -470,13 +476,13 @@ } MaybeCreateCurrentGenerationItem( - last_focused_password_element_, + last_focused_password_element, FindConfirmationPasswordFieldId(control_elements, - last_focused_password_element_)); + last_focused_password_element)); } else { auto it = generation_enabled_fields_.find(last_focused_password_element_id); MaybeCreateCurrentGenerationItem( - last_focused_password_element_, + last_focused_password_element, it->second.confirmation_password_renderer_id); } @@ -484,7 +490,7 @@ return false; if (current_generation_item_->generation_element_ != - last_focused_password_element_) { + last_focused_password_element) { return false; } @@ -493,23 +499,6 @@ return true; } -void PasswordGenerationAgent::NotifyFocusChangeComplete( - const blink::WebNode& node) { - if (node.IsNull() || !node.IsElementNode()) { - return; - } - - const blink::WebElement web_element = node.To<blink::WebElement>(); - if (!web_element.GetDocument().GetFrame()) { - return; - } - - const WebInputElement element = web_element.DynamicTo<WebInputElement>(); - if (!element.IsNull() && element.IsPasswordFieldForAutofill()) { - last_focused_password_element_ = element; - } -} - bool PasswordGenerationAgent::ShowPasswordGenerationSuggestions( const WebInputElement& element) { CHECK(!element.IsNull());
diff --git a/components/autofill/content/renderer/password_generation_agent.h b/components/autofill/content/renderer/password_generation_agent.h index 3e091d1..e56c7a9 100644 --- a/components/autofill/content/renderer/password_generation_agent.h +++ b/components/autofill/content/renderer/password_generation_agent.h
@@ -68,9 +68,6 @@ // is being offered. Updates the state of the popup if necessary. bool TextDidChangeInTextField(const blink::WebInputElement& element); - // Receives the currently focused element. - void NotifyFocusChangeComplete(const blink::WebNode& node); - // Returns true if the newly focused node caused the generation UI to show. bool ShowPasswordGenerationSuggestions(const blink::WebInputElement& element); @@ -169,11 +166,6 @@ // can be either automatic or manual password generation. std::unique_ptr<GenerationItemInfo> current_generation_item_; - // Password element that had focus last. Since Javascript could change focused - // element after the user triggered a generation request, it is better to save - // the last focused password element. - blink::WebInputElement last_focused_password_element_; - // Contains correspondence between generation enabled element and data for // generation. std::map<FieldRendererId, PasswordFormGenerationData>
diff --git a/components/autofill/core/browser/address_normalizer.h b/components/autofill/core/browser/address_normalizer.h index 8ded291..2aeef4b 100644 --- a/components/autofill/core/browser/address_normalizer.h +++ b/components/autofill/core/browser/address_normalizer.h
@@ -8,8 +8,13 @@ #include <string> #include "base/functional/callback_forward.h" +#include "build/build_config.h" #include "third_party/libaddressinput/chromium/chrome_address_validator.h" +#if BUILDFLAG(IS_ANDROID) +#include "base/android/scoped_java_ref.h" +#endif + namespace autofill { class AutofillProfile; @@ -40,6 +45,11 @@ // Normalizes |profile| and returns whether it was successful. Callers should // call |AreRulesLoadedForRegion| to ensure success. virtual bool NormalizeAddressSync(AutofillProfile* profile) = 0; + +#if BUILDFLAG(IS_ANDROID) + // Return the java object that provides access to the AddressNormalizer. + virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; +#endif // BUILDFLAG(IS_ANDROID) }; } // namespace autofill
diff --git a/components/autofill/core/browser/address_normalizer_impl.cc b/components/autofill/core/browser/address_normalizer_impl.cc index 7d5f896..b0cf8d5 100644 --- a/components/autofill/core/browser/address_normalizer_impl.cc +++ b/components/autofill/core/browser/address_normalizer_impl.cc
@@ -26,6 +26,12 @@ #include "third_party/libaddressinput/src/cpp/include/libaddressinput/source.h" #include "third_party/libaddressinput/src/cpp/include/libaddressinput/storage.h" +#if BUILDFLAG(IS_ANDROID) +#include "base/android/jni_android.h" +#include "base/android/jni_string.h" +#include "components/autofill/android/main_autofill_jni_headers/AddressNormalizer_jni.h" +#endif // BUILDFLAG(IS_ANDROID) + namespace autofill { namespace { @@ -81,6 +87,22 @@ load_rules_listener); } +#if BUILDFLAG(IS_ANDROID) +void OnAddressNormalized(base::android::ScopedJavaGlobalRef<jobject> jdelegate, + const std::string& app_locale, + bool success, + const AutofillProfile& profile) { + JNIEnv* env = base::android::AttachCurrentThread(); + if (success) { + Java_NormalizedAddressRequestDelegate_onAddressNormalized( + env, jdelegate, profile.CreateJavaObject(app_locale)); + } else { + Java_NormalizedAddressRequestDelegate_onCouldNotNormalize( + env, jdelegate, profile.CreateJavaObject(app_locale)); + } +} +#endif // BUILDFLAG(IS_ANDROID) + } // namespace class AddressNormalizerImpl::NormalizationRequest { @@ -238,6 +260,40 @@ address_validator_.get()); } +#if BUILDFLAG(IS_ANDROID) +base::android::ScopedJavaLocalRef<jobject> +AddressNormalizerImpl::GetJavaObject() { + if (!java_ref_) { + java_ref_.Reset( + Java_AddressNormalizer_Constructor(base::android::AttachCurrentThread(), + reinterpret_cast<intptr_t>(this))); + } + return base::android::ScopedJavaLocalRef<jobject>(java_ref_); +} + +void AddressNormalizerImpl::LoadRulesForAddressNormalization( + JNIEnv* env, + const base::android::JavaParamRef<jstring>& jregion_code) { + LoadRulesForRegion(base::android::ConvertJavaStringToUTF8(env, jregion_code)); +} + +void AddressNormalizerImpl::StartAddressNormalization( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& jprofile, + jint jtimeout_seconds, + const base::android::JavaParamRef<jobject>& jdelegate) { + AutofillProfile profile = + AutofillProfile::CreateFromJavaObject(jprofile, app_locale_); + + // Start the normalization. + NormalizeAddressAsync( + profile, jtimeout_seconds, + base::BindOnce(&OnAddressNormalized, + base::android::ScopedJavaGlobalRef<jobject>(jdelegate), + app_locale_)); +} +#endif // BUILDFLAG(IS_ANDROID) + bool AddressNormalizerImpl::AreRulesLoadedForRegion( const std::string& region_code) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/components/autofill/core/browser/address_normalizer_impl.h b/components/autofill/core/browser/address_normalizer_impl.h index a41a3584..b7c0816 100644 --- a/components/autofill/core/browser/address_normalizer_impl.h +++ b/components/autofill/core/browser/address_normalizer_impl.h
@@ -14,12 +14,14 @@ #include "base/sequence_checker.h" #include "components/autofill/core/browser/address_normalizer.h" -namespace i18n { -namespace addressinput { +#if BUILDFLAG(IS_ANDROID) +#include "base/android/scoped_java_ref.h" +#endif // BUILDFLAG(IS_ANDROID) + +namespace i18n::addressinput { class Source; class Storage; -} // namespace addressinput -} // namespace i18n +} // namespace i18n::addressinput namespace autofill { @@ -46,6 +48,19 @@ AddressNormalizer::NormalizationCallback callback) override; bool NormalizeAddressSync(AutofillProfile* profile) override; +#if BUILDFLAG(IS_ANDROID) + base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; + + void LoadRulesForAddressNormalization( + JNIEnv* env, + const base::android::JavaParamRef<jstring>& region_code); + void StartAddressNormalization( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& jprofile, + jint jtimeout_seconds, + const base::android::JavaParamRef<jobject>& jdelegate); +#endif // BUILDFLAG(IS_ANDROID) + private: friend class AddressNormalizerTest; bool AreRulesLoadedForRegion(const std::string& region_code); @@ -71,6 +86,11 @@ std::unique_ptr<AddressValidator> address_validator_; const std::string app_locale_; +#if BUILDFLAG(IS_ANDROID) + // Java-side version of the AddressNormalizer. + base::android::ScopedJavaGlobalRef<jobject> java_ref_; +#endif // BUILDFLAG(IS_ANDROID) + SEQUENCE_CHECKER(sequence_checker_); base::WeakPtrFactory<AddressNormalizerImpl> weak_ptr_factory_{this};
diff --git a/components/autofill/core/browser/autofill_driver.h b/components/autofill/core/browser/autofill_driver.h index 887f4dd..bfec468 100644 --- a/components/autofill/core/browser/autofill_driver.h +++ b/components/autofill/core/browser/autofill_driver.h
@@ -112,9 +112,6 @@ base::OnceCallback<void(bool success)> form_extraction_finished_callback) = 0; - // Returns the ax tree id associated with this driver. - virtual ui::AXTreeID GetAxTreeId() const = 0; - // Returns true iff the renderer is available for communication. virtual bool RendererIsAvailable() = 0;
diff --git a/components/autofill/core/browser/autofill_test_utils.cc b/components/autofill/core/browser/autofill_test_utils.cc index 5673113..08c50d4 100644 --- a/components/autofill/core/browser/autofill_test_utils.cc +++ b/components/autofill/core/browser/autofill_test_utils.cc
@@ -402,6 +402,12 @@ return credit_card; } +CreditCard GetMaskedServerCardWithCvc() { + CreditCard credit_card = GetMaskedServerCard(); + credit_card.set_cvc(u"123"); + return credit_card; +} + CreditCard GetMaskedServerCardWithLegacyId() { CreditCard credit_card(CreditCard::RecordType::kMaskedServerCard, "a123"); test::SetCreditCardInfo(&credit_card, "Bonnie Parker", @@ -731,11 +737,13 @@ const char* card_number, const char* expiration_month, const char* expiration_year, - const std::string& billing_address_id) { + const std::string& billing_address_id, + const std::u16string& cvc) { check_and_set(credit_card, CREDIT_CARD_NAME_FULL, name_on_card); check_and_set(credit_card, CREDIT_CARD_NUMBER, card_number); check_and_set(credit_card, CREDIT_CARD_EXP_MONTH, expiration_month); check_and_set(credit_card, CREDIT_CARD_EXP_4_DIGIT_YEAR, expiration_year); + credit_card->set_cvc(cvc); credit_card->set_billing_address_id(billing_address_id); }
diff --git a/components/autofill/core/browser/autofill_test_utils.h b/components/autofill/core/browser/autofill_test_utils.h index 8f8c909..ee852cb9 100644 --- a/components/autofill/core/browser/autofill_test_utils.h +++ b/components/autofill/core/browser/autofill_test_utils.h
@@ -167,6 +167,7 @@ // Returns a masked server card full of dummy info. CreditCard GetMaskedServerCard(); CreditCard GetMaskedServerCard2(); +CreditCard GetMaskedServerCardWithCvc(); CreditCard GetMaskedServerCardWithNonLegacyId(); CreditCard GetMaskedServerCardWithLegacyId(); CreditCard GetMaskedServerCardVisa(); @@ -278,7 +279,8 @@ const char* card_number, const char* expiration_month, const char* expiration_year, - const std::string& billing_address_id); + const std::string& billing_address_id, + const std::u16string& cvc = u""); // TODO(isherman): We should do this automatically for all tests, not manually // on a per-test basis: http://crbug.com/57221
diff --git a/components/autofill/core/browser/browser_autofill_manager.cc b/components/autofill/core/browser/browser_autofill_manager.cc index a84f2ad3..1732208 100644 --- a/components/autofill/core/browser/browser_autofill_manager.cc +++ b/components/autofill/core/browser/browser_autofill_manager.cc
@@ -1964,9 +1964,10 @@ client().PropagateAutofillPredictionsDeprecated(&driver(), forms); } -void BrowserAutofillManager::OnCreditCardFetched(CreditCardFetchResult result, - const CreditCard* credit_card, - const std::u16string& cvc) { +void BrowserAutofillManager::OnCreditCardFetched( + CreditCardFetchResult result, + const CreditCard* credit_card) { + const std::u16string& cvc = credit_card->cvc(); if (result != CreditCardFetchResult::kSuccess) { driver().RendererShouldClearPreviewedForm(); return; @@ -1993,6 +1994,8 @@ options.masked_card_number_last_four = credit_card_.ObfuscatedNumberWithVisibleLastFourDigits(); options.virtual_card = *credit_card; + // TODO(crbug.com/1473481): Remove CVC from + // VirtualCardManualFallbackBubbleOptions. options.virtual_card_cvc = cvc; options.card_image = GetCardImage(*credit_card); client().OnVirtualCardDataAvailable(options);
diff --git a/components/autofill/core/browser/browser_autofill_manager.h b/components/autofill/core/browser/browser_autofill_manager.h index 920b1d2..997875ab 100644 --- a/components/autofill/core/browser/browser_autofill_manager.h +++ b/components/autofill/core/browser/browser_autofill_manager.h
@@ -477,8 +477,7 @@ // CreditCardAccessManager::Accessor void OnCreditCardFetched(CreditCardFetchResult result, - const CreditCard* credit_card, - const std::u16string& cvc) override; + const CreditCard* credit_card) override; // Returns false if Autofill is disabled or if no Autofill data is available. bool RefreshDataModels();
diff --git a/components/autofill/core/browser/browser_autofill_manager_test_api.h b/components/autofill/core/browser/browser_autofill_manager_test_api.h index cffe7fe..0c8568db 100644 --- a/components/autofill/core/browser/browser_autofill_manager_test_api.h +++ b/components/autofill/core/browser/browser_autofill_manager_test_api.h
@@ -90,9 +90,8 @@ } void OnCreditCardFetched(CreditCardFetchResult result, - const CreditCard* credit_card = nullptr, - const std::u16string& cvc = std::u16string()) { - manager_->OnCreditCardFetched(result, credit_card, cvc); + const CreditCard* credit_card = nullptr) { + manager_->OnCreditCardFetched(result, credit_card); } bool WillFillCreditCardNumber(const FormData& form,
diff --git a/components/autofill/core/browser/browser_autofill_manager_unittest.cc b/components/autofill/core/browser/browser_autofill_manager_unittest.cc index 80dfedd..9b1d642 100644 --- a/components/autofill/core/browser/browser_autofill_manager_unittest.cc +++ b/components/autofill/core/browser/browser_autofill_manager_unittest.cc
@@ -2654,14 +2654,13 @@ TEST_F(BrowserAutofillManagerTest, OnCreditCardFetched_StoreInstrumentId) { FormData form = CreateTestCreditCardFormData(true, false); FormsSeen({form}); - CreditCard credit_card = test::GetMaskedServerCard(); + CreditCard credit_card = test::GetMaskedServerCardWithCvc(); browser_autofill_manager_->FillOrPreviewCreditCardForm( mojom::AutofillActionPersistence::kFill, form, form.fields[0], &credit_card, {.trigger_source = AutofillTriggerSource::kPopup}); test_api(*browser_autofill_manager_) - .OnCreditCardFetched(CreditCardFetchResult::kSuccess, &credit_card, - /*cvc=*/u"123"); + .OnCreditCardFetched(CreditCardFetchResult::kSuccess, &credit_card); ASSERT_TRUE(form_data_importer().fetched_card_instrument_id().has_value()); EXPECT_EQ(form_data_importer().fetched_card_instrument_id().value(),
diff --git a/components/autofill/core/browser/metrics/autofill_metrics_test_base.cc b/components/autofill/core/browser/metrics/autofill_metrics_test_base.cc index 8d88681..9e6905f 100644 --- a/components/autofill/core/browser/metrics/autofill_metrics_test_base.cc +++ b/components/autofill/core/browser/metrics/autofill_metrics_test_base.cc
@@ -191,16 +191,13 @@ ? CreditCard::RecordType::kVirtualCard : CreditCard::RecordType::kMaskedServerCard); credit_card_.SetNumber(real_pan); - test_api(autofill_manager()) - .OnCreditCardFetched(CreditCardFetchResult::kSuccess, &credit_card_, - u"123"); + .OnCreditCardFetched(CreditCardFetchResult::kSuccess, &credit_card_); } void AutofillMetricsBaseTest::OnCreditCardFetchingFailed() { test_api(autofill_manager()) - .OnCreditCardFetched(CreditCardFetchResult::kPermanentError, nullptr, - u""); + .OnCreditCardFetched(CreditCardFetchResult::kPermanentError, nullptr); } void AutofillMetricsBaseTest::RecreateCreditCards(
diff --git a/components/autofill/core/browser/metrics/autofill_metrics_test_base.h b/components/autofill/core/browser/metrics/autofill_metrics_test_base.h index 49f2797..2d5f45c 100644 --- a/components/autofill/core/browser/metrics/autofill_metrics_test_base.h +++ b/components/autofill/core/browser/metrics/autofill_metrics_test_base.h
@@ -231,7 +231,7 @@ void CreateTestAutofillProfiles(); base::test::ScopedFeatureList scoped_feature_list_async_parse_form_; - CreditCard credit_card_ = test::GetMaskedServerCard(); + CreditCard credit_card_ = test::GetMaskedServerCardWithCvc(); }; } // namespace autofill::autofill_metrics
diff --git a/components/autofill/core/browser/metrics/payments/card_metadata_metrics_unittest.cc b/components/autofill/core/browser/metrics/payments/card_metadata_metrics_unittest.cc index 6d1cd3bb..d5941063 100644 --- a/components/autofill/core/browser/metrics/payments/card_metadata_metrics_unittest.cc +++ b/components/autofill/core/browser/metrics/payments/card_metadata_metrics_unittest.cc
@@ -59,7 +59,7 @@ .action = ""}); // Add a masked server card. - card_ = test::GetMaskedServerCard(); + card_ = test::GetMaskedServerCardWithCvc(); card_.set_guid(kCardGuid); if (registered_card_issuer_available()) { card_.set_issuer_id(kCapitalOneCardIssuerId); @@ -259,7 +259,7 @@ Suggestion::BackendId(kCardGuid), {.trigger_source = AutofillTriggerSource::kPopup}); test_api(autofill_manager()) - .OnCreditCardFetched(CreditCardFetchResult::kSuccess, &card(), u"123"); + .OnCreditCardFetched(CreditCardFetchResult::kSuccess, &card()); // Verify that: // 1. if the card suggestion filled had metadata, @@ -302,7 +302,7 @@ // Fill the suggestion again. test_api(autofill_manager()) - .OnCreditCardFetched(CreditCardFetchResult::kSuccess, &card(), u"123"); + .OnCreditCardFetched(CreditCardFetchResult::kSuccess, &card()); EXPECT_THAT( histogram_tester.GetAllSamples("Autofill.FormEvents.CreditCard"), @@ -335,7 +335,7 @@ Suggestion::BackendId(kCardGuid), {.trigger_source = AutofillTriggerSource::kPopup}); test_api(autofill_manager()) - .OnCreditCardFetched(CreditCardFetchResult::kSuccess, &card(), u"123"); + .OnCreditCardFetched(CreditCardFetchResult::kSuccess, &card()); SubmitForm(form()); // Verify that:
diff --git a/components/autofill/core/browser/payments/credit_card_access_manager.cc b/components/autofill/core/browser/payments/credit_card_access_manager.cc index 710e909..71e79dc 100644 --- a/components/autofill/core/browser/payments/credit_card_access_manager.cc +++ b/components/autofill/core/browser/payments/credit_card_access_manager.cc
@@ -270,14 +270,14 @@ // status. if (is_authentication_in_progress_) { accessor->OnCreditCardFetched(CreditCardFetchResult::kTransientError, - nullptr, u""); + nullptr); return; } // If card is nullptr we reset all states and return error. if (!card) { accessor->OnCreditCardFetched(CreditCardFetchResult::kTransientError, - nullptr, u""); + nullptr); Reset(); return; } @@ -298,9 +298,9 @@ std::unordered_map<std::string, CachedServerCardInfo>::iterator it = unmasked_card_cache_.find(GetKeyForUnmaskedCardsCache(*card)); if (it != unmasked_card_cache_.end()) { // key is in cache + it->second.card.set_cvc(it->second.cvc); accessor->OnCreditCardFetched(CreditCardFetchResult::kSuccess, - /*credit_card=*/&it->second.card, - /*cvc=*/it->second.cvc); + /*credit_card=*/&it->second.card); std::string metrics_name = record_type == CreditCard::RecordType::kVirtualCard ? "Autofill.UsedCachedVirtualCard" @@ -416,7 +416,7 @@ virtual_card_unmask_response_details_.card_unmask_challenge_options; if (challenge_options.empty()) { accessor_->OnCreditCardFetched(CreditCardFetchResult::kTransientError, - nullptr, u""); + nullptr); client_->ShowAutofillErrorDialog( AutofillErrorDialogContext::WithVirtualCardPermanentOrTemporaryError( /*is_permanent_error=*/true)); @@ -582,6 +582,16 @@ is_authentication_in_progress_ = false; can_fetch_unmask_details_ = true; + // Save credit card for caching purpose. CVC is also saved if response + // contains CVC. `response.card` can be nullptr in the case of an error in the + // response. If the response has an error, the `ShouldRespondImmediately()` + // call below will return true and we will safely pass nullptr and that it is + // an error into `accessor_->OnCreditCardFetched()`, and end the flow. + if (response.card) { + card_ = std::make_unique<CreditCard>(*response.card); + card_->set_cvc(response.cvc); + } + // Log completed CVC authentication if auth was successful. Do not log for // kCvcThenFido flow since that is yet to be completed. if (response.did_succeed && @@ -598,7 +608,7 @@ accessor_->OnCreditCardFetched(response.did_succeed ? CreditCardFetchResult::kSuccess : CreditCardFetchResult::kTransientError, - response.card, response.cvc); + card_.get()); unmask_auth_flow_type_ = UnmaskAuthFlowType::kNone; } else if (should_register_card_with_fido) { #if !BUILDFLAG(IS_IOS) @@ -613,10 +623,6 @@ request_options = response.request_options->Clone(); } - // Save credit card for after authorization. - card_ = std::make_unique<CreditCard>(*(response.card)); - cvc_ = response.cvc; - // Additionally authorizes the card with FIDO. It also delays the form // filling. GetOrCreateFidoAuthenticator()->Authorize(weak_ptr_factory_.GetWeakPtr(), @@ -707,10 +713,6 @@ #endif if (response.did_succeed) { - accessor_->OnCreditCardFetched(response.did_succeed - ? CreditCardFetchResult::kSuccess - : CreditCardFetchResult::kTransientError, - response.card, response.cvc); form_event_logger_->LogCardUnmaskAuthenticationPromptCompleted( unmask_auth_flow_type_); if (card_->record_type() == CreditCard::RecordType::kVirtualCard) { @@ -719,6 +721,18 @@ AutofillClient::PaymentsRpcCardType::kVirtualCard, autofill_metrics::VirtualCardUnmaskFlowType::kFidoOnly); } + + // Save credit card for caching purpose. CVC is also saved if response + // contains CVC. `response.card` can be nullptr in the case of an error in + // the response. If the response has an error, we will safely pass nullptr + // and that it is an error into `accessor_->OnCreditCardFetched()`, and end + // the flow. + if (response.card) { + card_ = std::make_unique<CreditCard>(*response.card); + card_->set_cvc(response.cvc); + } + accessor_->OnCreditCardFetched(CreditCardFetchResult::kSuccess, + card_.get()); Reset(); } else if ( response.failure_type == @@ -738,7 +752,7 @@ /*is_permanent_error=*/response.failure_type == payments::FullCardRequest:: VIRTUAL_CARD_RETRIEVAL_PERMANENT_FAILURE)); - accessor_->OnCreditCardFetched(result, nullptr, u""); + accessor_->OnCreditCardFetched(result, nullptr); if (card_->record_type() == CreditCard::RecordType::kVirtualCard) { autofill_metrics::LogServerCardUnmaskResult( @@ -761,8 +775,8 @@ void CreditCardAccessManager::OnFidoAuthorizationComplete(bool did_succeed) { if (did_succeed) { - accessor_->OnCreditCardFetched(CreditCardFetchResult::kSuccess, card_.get(), - cvc_); + accessor_->OnCreditCardFetched(CreditCardFetchResult::kSuccess, + card_.get()); form_event_logger_->LogCardUnmaskAuthenticationPromptCompleted( unmask_auth_flow_type_); } @@ -772,12 +786,21 @@ void CreditCardAccessManager::OnOtpAuthenticationComplete( const CreditCardOtpAuthenticator::OtpAuthenticationResponse& response) { + // Save credit card for caching purpose. CVC is also saved if response + // contains CVC. `response.card` can be nullptr in the case of an error in the + // response. If the response has an error, we will safely pass nullptr and + // that it is an error into `accessor_->OnCreditCardFetched()`, and end the + // flow. + if (response.card) { + card_ = std::make_unique<CreditCard>(*response.card); + card_->set_cvc(response.cvc); + } accessor_->OnCreditCardFetched( response.result == CreditCardOtpAuthenticator::OtpAuthenticationResponse:: Result::kSuccess ? CreditCardFetchResult::kSuccess : CreditCardFetchResult::kTransientError, - response.card, response.cvc); + card_.get()); autofill_metrics::ServerCardUnmaskResult result; switch (response.result) { @@ -1075,7 +1098,7 @@ client_->GetLastCommittedPrimaryMainFrameURL().DeprecatedGetOriginAsURL(); if (!last_committed_primary_main_frame_origin.has_value()) { accessor_->OnCreditCardFetched(CreditCardFetchResult::kTransientError, - nullptr, u""); + nullptr); autofill_metrics::LogServerCardUnmaskResult( autofill_metrics::ServerCardUnmaskResult::kUnexpectedError, AutofillClient::PaymentsRpcCardType::kVirtualCard, @@ -1121,8 +1144,8 @@ } else { // Fill immediately if local card, and we do not need to authenticate // the user. - accessor_->OnCreditCardFetched(CreditCardFetchResult::kSuccess, card_.get(), - /*cvc=*/u""); + accessor_->OnCreditCardFetched(CreditCardFetchResult::kSuccess, + card_.get()); // This local card autofill flow did not have any interactive // authentication, so notify the FormDataImporter of this. @@ -1188,9 +1211,9 @@ } else { client_->CloseAutofillProgressDialog( /*show_confirmation_before_closing=*/true); - accessor_->OnCreditCardFetched( - CreditCardFetchResult::kSuccess, card_.get(), - base::UTF8ToUTF16(response_details.dcvv)); + card_->set_cvc(base::UTF8ToUTF16(response_details.dcvv)); + accessor_->OnCreditCardFetched(CreditCardFetchResult::kSuccess, + card_.get()); // If the server responded with success and the real pan, no interactive // authentication happened. It's also possible that the server does not @@ -1234,7 +1257,7 @@ client_->CloseAutofillProgressDialog( /*show_confirmation_before_closing=*/false); accessor_->OnCreditCardFetched(CreditCardFetchResult::kTransientError, - nullptr, u""); + nullptr); autofill_metrics::ServerCardUnmaskResult unmask_result; if (result == @@ -1306,7 +1329,7 @@ virtual_card_unmask_response_details_.context_token.empty()) { NOTREACHED(); accessor_->OnCreditCardFetched(CreditCardFetchResult::kTransientError, - nullptr, u""); + nullptr); client_->ShowAutofillErrorDialog( AutofillErrorDialogContext::WithVirtualCardPermanentOrTemporaryError( /*is_permanent_error=*/false)); @@ -1335,7 +1358,7 @@ void CreditCardAccessManager::OnVirtualCardUnmaskCancelled() { accessor_->OnCreditCardFetched(CreditCardFetchResult::kTransientError, - nullptr, u""); + nullptr); if (unmask_auth_flow_type_ == UnmaskAuthFlowType::kOtp || unmask_auth_flow_type_ == UnmaskAuthFlowType::kOtpFallbackFromFido) { @@ -1393,7 +1416,6 @@ ready_to_start_authentication_.Reset(); can_fetch_unmask_details_ = true; card_.reset(); - cvc_ = std::u16string(); unmask_details_request_in_progress_ = false; } @@ -1509,10 +1531,13 @@ kFlowSucceeded : autofill_metrics::MandatoryReauthAuthenticationFlowEvent:: kFlowFailed); + CHECK(card); + CreditCard card_with_cvc = *card; + card_with_cvc.set_cvc(cvc); accessor->OnCreditCardFetched(successful_auth ? CreditCardFetchResult::kSuccess : CreditCardFetchResult::kTransientError, - card, cvc); + &card_with_cvc); // TODO(crbug.com/1427216): Add logging for the payments autofill device // authentication flow. // `accessor->OnCreditCardFetched()` makes a copy of `card` and `cvc` before
diff --git a/components/autofill/core/browser/payments/credit_card_access_manager.h b/components/autofill/core/browser/payments/credit_card_access_manager.h index fc8a987..3798337 100644 --- a/components/autofill/core/browser/payments/credit_card_access_manager.h +++ b/components/autofill/core/browser/payments/credit_card_access_manager.h
@@ -74,6 +74,7 @@ kMaxValue = kPermanentError, }; +// TODO(crbug.com/1473481): Remove CVC from CachedServerCardInfo. struct CachedServerCardInfo { public: // An unmasked CreditCard. @@ -97,8 +98,7 @@ public: virtual ~Accessor() = default; virtual void OnCreditCardFetched(CreditCardFetchResult result, - const CreditCard* credit_card, - const std::u16string& cvc) = 0; + const CreditCard* credit_card) = 0; }; CreditCardAccessManager(AutofillDriver* driver, @@ -494,13 +494,12 @@ bool can_fetch_unmask_details_ = true; // The credit card being accessed. + // It will be set when user preview or select the card. Before authentication, + // the card is the masked server card which is retrieved from webdatabase. + // After FIDO, CVC, OTP authentication, it will be override by a new card + // constructed by the server response. std::unique_ptr<CreditCard> card_; - // When authorizing a new card, the CVC will be temporarily stored after the - // first CVC check, and then will be used to fill the form after FIDO - // authentication is complete. - std::u16string cvc_ = std::u16string(); - // Set to true only if user has a verifying platform authenticator. // e.g. Touch/Face ID, Windows Hello, Android fingerprint, etc., is available // and enabled.
diff --git a/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc b/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc index a70ecd36..952c597 100644 --- a/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc +++ b/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc
@@ -124,13 +124,12 @@ } void OnCreditCardFetched(CreditCardFetchResult result, - const CreditCard* card, - const std::u16string& cvc) override { + const CreditCard* card) override { result_ = result; if (result == CreditCardFetchResult::kSuccess) { DCHECK(card); number_ = card->number(); - cvc_ = cvc; + cvc_ = card->cvc(); expiry_month_ = card->Expiration2DigitMonthAsString(); expiry_year_ = card->Expiration4DigitYearAsString(); } @@ -235,7 +234,7 @@ CreditCard local_card = CreditCard(); test::SetCreditCardInfo(&local_card, "Elvis Presley", number.c_str(), test::NextMonth().c_str(), test::NextYear().c_str(), - "1"); + "1", kTestCvc16); local_card.set_guid(guid); local_card.set_record_type(CreditCard::RecordType::kLocalCard); @@ -831,6 +830,7 @@ EXPECT_EQ(accessor_->result(), CreditCardFetchResult::kSuccess); EXPECT_EQ(kTestNumber16, accessor_->number()); + EXPECT_EQ(kTestCvc16, accessor_->cvc()); // There was no interactive authentication in this flow, so check that this // is signaled correctly. @@ -2639,7 +2639,7 @@ .with_result(CreditCardOtpAuthenticator::OtpAuthenticationResponse:: Result::kSuccess) .with_card(&card) - .with_cvc(u"123")); + .with_cvc(kTestCvc16)); // Expect that we did not signal that there was no interactive authentication. EXPECT_FALSE( @@ -2647,6 +2647,9 @@ ->GetCardIdentifierIfNonInteractiveAuthenticationFlowCompleted() .has_value()); + // Expect accessor to successfully retrieve the CVC. + EXPECT_EQ(kTestCvc16, accessor_->cvc()); + // Expect the metrics are logged correctly. histogram_tester.ExpectUniqueSample( "Autofill.ServerCardUnmask.VirtualCard.Attempt", true, 1);
diff --git a/components/autofill/core/browser/payments/credit_card_cvc_authenticator.h b/components/autofill/core/browser/payments/credit_card_cvc_authenticator.h index 8ba0c87..5ab33c4 100644 --- a/components/autofill/core/browser/payments/credit_card_cvc_authenticator.h +++ b/components/autofill/core/browser/payments/credit_card_cvc_authenticator.h
@@ -55,6 +55,7 @@ } bool did_succeed = false; raw_ptr<const CreditCard> card = nullptr; + // TODO(crbug.com/1475052): Remove CVC. std::u16string cvc = std::u16string(); absl::optional<base::Value::Dict> request_options; std::string card_authorization_token = std::string();
diff --git a/components/autofill/core/browser/payments/credit_card_otp_authenticator.h b/components/autofill/core/browser/payments/credit_card_otp_authenticator.h index bc96751..edf3cd2 100644 --- a/components/autofill/core/browser/payments/credit_card_otp_authenticator.h +++ b/components/autofill/core/browser/payments/credit_card_otp_authenticator.h
@@ -58,6 +58,7 @@ } Result result = kUnknown; raw_ptr<const CreditCard> card; + // TODO(crbug.com/1475052): Remove CVC. std::u16string cvc; };
diff --git a/components/autofill/core/browser/test_address_normalizer.cc b/components/autofill/core/browser/test_address_normalizer.cc index df52bc9..5fefd4a 100644 --- a/components/autofill/core/browser/test_address_normalizer.cc +++ b/components/autofill/core/browser/test_address_normalizer.cc
@@ -29,6 +29,13 @@ return true; } +#if BUILDFLAG(IS_ANDROID) +base::android::ScopedJavaLocalRef<jobject> +TestAddressNormalizer::GetJavaObject() { + return base::android::ScopedJavaLocalRef<jobject>(); +} +#endif // BUILDFLAG(IS_ANDROID) + void TestAddressNormalizer::DelayNormalization() { instantaneous_normalization_ = false; }
diff --git a/components/autofill/core/browser/test_address_normalizer.h b/components/autofill/core/browser/test_address_normalizer.h index 81ac368..311ff6c5 100644 --- a/components/autofill/core/browser/test_address_normalizer.h +++ b/components/autofill/core/browser/test_address_normalizer.h
@@ -8,9 +8,14 @@ #include <string> #include "base/functional/callback.h" +#include "build/build_config.h" #include "components/autofill/core/browser/address_normalizer.h" #include "components/autofill/core/browser/data_model/autofill_profile.h" +#if BUILDFLAG(IS_ANDROID) +#include "base/android/scoped_java_ref.h" +#endif + namespace autofill { // A simpler version of the address normalizer to be used in tests. Can be set @@ -27,6 +32,9 @@ int timeout_seconds, AddressNormalizer::NormalizationCallback callback) override; bool NormalizeAddressSync(AutofillProfile* profile) override; +#if BUILDFLAG(IS_ANDROID) + base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; +#endif // BUILDFLAG(IS_ANDROID) void OnAddressValidationRulesLoaded(const std::string& region_code, bool success) override {}
diff --git a/components/autofill/core/browser/test_autofill_driver.h b/components/autofill/core/browser/test_autofill_driver.h index bcc0d7c4..053e7c1 100644 --- a/components/autofill/core/browser/test_autofill_driver.h +++ b/components/autofill/core/browser/test_autofill_driver.h
@@ -52,10 +52,6 @@ bool IsPrerendering() const override { return false; } bool HasSharedAutofillPermission() const override { return false; } bool CanShowAutofillUi() const override { return true; } - ui::AXTreeID GetAxTreeId() const override { - NOTIMPLEMENTED() << "See https://crbug.com/985933"; - return ui::AXTreeIDUnknown(); - } bool RendererIsAvailable() override { return true; } void HandleParsedForms(const std::vector<FormData>& forms) override {} void SendAutofillTypePredictionsToRenderer(
diff --git a/components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc b/components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc index 07f29e09..8d674cd2 100644 --- a/components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc +++ b/components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc
@@ -5,8 +5,10 @@ #include "components/autofill/core/browser/webdata/autofill_sync_bridge_util.h" #include "base/base64.h" +#include "base/check.h" #include "base/pickle.h" #include "base/ranges/algorithm.h" +#include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" @@ -542,6 +544,22 @@ return wallet_credential_specifics; } +ServerCvc AutofillWalletCvcStructDataFromWalletCredentialSpecifics( + const sync_pb::AutofillWalletCredentialSpecifics& + wallet_credential_specifics) { + CHECK(IsAutofillWalletCredentialDataSpecificsValid( + wallet_credential_specifics)); + int64_t instrument_id; + base::StringToInt64(wallet_credential_specifics.instrument_id(), + &instrument_id); + + return ServerCvc( + instrument_id, base::UTF8ToUTF16(wallet_credential_specifics.cvc()), + base::Time::UnixEpoch() + + base::Milliseconds(wallet_credential_specifics + .last_updated_time_unix_epoch_millis())); +} + VirtualCardUsageData VirtualCardUsageDataFromUsageSpecifics( const sync_pb::AutofillWalletUsageSpecifics& usage_specifics) { const sync_pb::AutofillWalletUsageSpecifics::VirtualCardUsageData @@ -777,4 +795,17 @@ !virtual_card_usage_data.virtual_card_last_four()->empty(); } +bool IsAutofillWalletCredentialDataSpecificsValid( + const sync_pb::AutofillWalletCredentialSpecifics& + wallet_credential_specifics) { + int64_t temp_instrument_id; + return !wallet_credential_specifics.instrument_id().empty() && + base::StringToInt64(wallet_credential_specifics.instrument_id(), + &temp_instrument_id) && + !wallet_credential_specifics.cvc().empty() && + wallet_credential_specifics + .has_last_updated_time_unix_epoch_millis() && + wallet_credential_specifics.last_updated_time_unix_epoch_millis() != 0; +} + } // namespace autofill
diff --git a/components/autofill/core/browser/webdata/autofill_sync_bridge_util.h b/components/autofill/core/browser/webdata/autofill_sync_bridge_util.h index eae85246..adb01d87 100644 --- a/components/autofill/core/browser/webdata/autofill_sync_bridge_util.h +++ b/components/autofill/core/browser/webdata/autofill_sync_bridge_util.h
@@ -81,6 +81,14 @@ sync_pb::AutofillWalletCredentialSpecifics AutofillWalletCredentialSpecificsFromStructData(const ServerCvc& server_cvc); +// Returns a ServerCvc struct data based on the specified +// `wallet_credential_specifics` data. +// The passed-in specifics must be valid (as per +// IsAutofillWalletCredentialDataSpecificsValid). +ServerCvc AutofillWalletCvcStructDataFromWalletCredentialSpecifics( + const sync_pb::AutofillWalletCredentialSpecifics& + wallet_credential_specifics); + // Creates a VirtualCardUsageData from the specified |usage_specifics|. // |usage_specifics| must be valid (as per // IsVirtualCardUsageDataSpecificsValid()). @@ -131,6 +139,11 @@ bool IsVirtualCardUsageDataSet( const VirtualCardUsageData& virtual_card_usage_data); +// Returns true if the `wallet_credential_specifics` is valid, otherwise false. +bool IsAutofillWalletCredentialDataSpecificsValid( + const sync_pb::AutofillWalletCredentialSpecifics& + wallet_credential_specifics); + } // namespace autofill #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_SYNC_BRIDGE_UTIL_H_
diff --git a/components/autofill/core/browser/webdata/autofill_sync_bridge_util_unittest.cc b/components/autofill/core/browser/webdata/autofill_sync_bridge_util_unittest.cc index 4e53ed2..a8bc8ac3 100644 --- a/components/autofill/core/browser/webdata/autofill_sync_bridge_util_unittest.cc +++ b/components/autofill/core/browser/webdata/autofill_sync_bridge_util_unittest.cc
@@ -509,5 +509,84 @@ 25000); } +TEST_F(AutofillSyncBridgeUtilTest, AutofillWalletStructDataFromUsageSpecifics) { + sync_pb::AutofillWalletCredentialSpecifics wallet_credential_specifics; + wallet_credential_specifics.set_instrument_id("123"); + wallet_credential_specifics.set_cvc("890"); + wallet_credential_specifics.set_last_updated_time_unix_epoch_millis( + base::Milliseconds(25000).InMilliseconds()); + + ServerCvc server_cvc = + AutofillWalletCvcStructDataFromWalletCredentialSpecifics( + wallet_credential_specifics); + + EXPECT_EQ(base::NumberToString(server_cvc.instrument_id), + wallet_credential_specifics.instrument_id()); + EXPECT_EQ(base::UTF16ToUTF8(server_cvc.cvc), + wallet_credential_specifics.cvc()); + EXPECT_EQ((server_cvc.last_updated_timestamp - base::Time::UnixEpoch()) + .InMilliseconds(), + wallet_credential_specifics.last_updated_time_unix_epoch_millis()); + EXPECT_EQ((server_cvc.last_updated_timestamp - base::Time::UnixEpoch()) + .InMilliseconds(), + 25000); +} + +// Round trip test to ensure that WalletCredential struct data for CVV storage +// is correctly converted to AutofillWalletCredentialSpecifics and then from +// the converted AutofillWalletCredentialSpecifics to WalletCredential struct +// data. In the end we compare the original and the converted struct data. +TEST_F(AutofillSyncBridgeUtilTest, + AutofillWalletCredentialStructDataRoundTripTest) { + // Step 1 - Convert WalletCredential struct data to + // AutofillWalletCredentialSpecifics. + std::unique_ptr<ServerCvc> server_cvc = std::make_unique<ServerCvc>( + 1234, u"890", base::Time::UnixEpoch() + base::Milliseconds(25000)); + + sync_pb::AutofillWalletCredentialSpecifics + wallet_credential_specifics_from_conversion = + AutofillWalletCredentialSpecificsFromStructData(*server_cvc); + + EXPECT_EQ(base::NumberToString(server_cvc->instrument_id), + wallet_credential_specifics_from_conversion.instrument_id()); + EXPECT_EQ(base::UTF16ToUTF8(server_cvc->cvc), + wallet_credential_specifics_from_conversion.cvc()); + EXPECT_EQ((server_cvc->last_updated_timestamp - base::Time::UnixEpoch()) + .InMilliseconds(), + wallet_credential_specifics_from_conversion + .last_updated_time_unix_epoch_millis()); + EXPECT_EQ((server_cvc->last_updated_timestamp - base::Time::UnixEpoch()) + .InMilliseconds(), + 25000); + + // Step 2 - Convert AutofillWalletCredentialSpecifics to WalletCredential + // struct data. + ServerCvc server_cvc_from_conversion = + AutofillWalletCvcStructDataFromWalletCredentialSpecifics( + wallet_credential_specifics_from_conversion); + + EXPECT_EQ(base::NumberToString(server_cvc_from_conversion.instrument_id), + wallet_credential_specifics_from_conversion.instrument_id()); + EXPECT_EQ(base::UTF16ToUTF8(server_cvc_from_conversion.cvc), + wallet_credential_specifics_from_conversion.cvc()); + EXPECT_EQ((server_cvc_from_conversion.last_updated_timestamp - + base::Time::UnixEpoch()) + .InMilliseconds(), + wallet_credential_specifics_from_conversion + .last_updated_time_unix_epoch_millis()); + EXPECT_EQ((server_cvc_from_conversion.last_updated_timestamp - + base::Time::UnixEpoch()) + .InMilliseconds(), + 25000); + + // Step 3 - Compare the original WalletCredential struct data to the + // converted WalletCredential struct data. + EXPECT_EQ(server_cvc_from_conversion.instrument_id, + server_cvc->instrument_id); + EXPECT_EQ(server_cvc_from_conversion.cvc, server_cvc->cvc); + EXPECT_EQ(server_cvc_from_conversion.last_updated_timestamp, + server_cvc->last_updated_timestamp); +} + } // namespace } // namespace autofill
diff --git a/components/autofill/core/browser/webdata/autofill_wallet_credential_sync_bridge.cc b/components/autofill/core/browser/webdata/autofill_wallet_credential_sync_bridge.cc index 4baaf3c..ff1028c 100644 --- a/components/autofill/core/browser/webdata/autofill_wallet_credential_sync_bridge.cc +++ b/components/autofill/core/browser/webdata/autofill_wallet_credential_sync_bridge.cc
@@ -7,7 +7,8 @@ #include <utility> #include "base/check.h" -#include "components/autofill/core/browser/webdata/autofill_table.h" +#include "base/strings/string_number_conversions.h" +#include "components/autofill/core/browser/webdata/autofill_sync_bridge_util.h" #include "components/autofill/core/browser/webdata/autofill_webdata_backend.h" #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" #include "components/sync/base/model_type.h" @@ -75,16 +76,67 @@ AutofillWalletCredentialSyncBridge::MergeFullSyncData( std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, syncer::EntityChangeList entity_data) { - NOTIMPLEMENTED(); - return absl::nullopt; + // When this data type is disabled, all the local data gets deleted, so there + // is never anything to merge. + return ApplyIncrementalSyncChanges(std::move(metadata_change_list), + std::move(entity_data)); } absl::optional<syncer::ModelError> AutofillWalletCredentialSyncBridge::ApplyIncrementalSyncChanges( std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, syncer::EntityChangeList entity_data) { - NOTIMPLEMENTED(); - return absl::nullopt; + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + AutofillTable* table = GetAutofillTable(); + + for (const std::unique_ptr<syncer::EntityChange>& change : entity_data) { + sync_pb::AutofillWalletCredentialSpecifics wallet_credential_specifics = + change->data().specifics.autofill_wallet_credential(); + switch (change->type()) { + case syncer::EntityChange::ACTION_DELETE: + int64_t storage_key; + if (!table || change->storage_key().empty() || + !base::StringToInt64(change->storage_key(), &storage_key) || + !table->RemoveServerCvc(storage_key)) { + return syncer::ModelError( + FROM_HERE, + "Failed to delete the Wallet credential data from the table"); + } + break; + // TODO(crbug/1472122): Merge the Add and Update APIs for AutofillTable. + case syncer::EntityChange::ACTION_ADD: + if (!table || + !table->AddServerCvc( + AutofillWalletCvcStructDataFromWalletCredentialSpecifics( + wallet_credential_specifics))) { + return syncer::ModelError( + FROM_HERE, + "Failed to add the Wallet credential data to the table"); + } + break; + case syncer::EntityChange::ACTION_UPDATE: + if (!table || + !table->UpdateServerCvc( + AutofillWalletCvcStructDataFromWalletCredentialSpecifics( + wallet_credential_specifics))) { + return syncer::ModelError( + FROM_HERE, + "Failed to update the Wallet credential data to the table"); + } + break; + } + } + // Commit the transaction to make sure the data and the metadata with the + // new progress marker is written down. + web_data_backend_->CommitChanges(); + + // There can be cases where `ApplyIncrementalSyncChanges` is called with + // empty `entity_data`, where only the metadata needs to be updated. This + // check helps check that and prevent any false positives. + if (!entity_data.empty()) { + web_data_backend_->NotifyOfMultipleAutofillChanges(); + } + return change_processor()->GetError(); } void AutofillWalletCredentialSyncBridge::GetData(StorageKeyList storage_keys, @@ -121,17 +173,11 @@ bool AutofillWalletCredentialSyncBridge::IsEntityDataValid( const syncer::EntityData& entity_data) const { return entity_data.specifics.has_autofill_wallet_credential() && - !entity_data.specifics.autofill_wallet_credential() - .instrument_id() - .empty() && - !entity_data.specifics.autofill_wallet_credential().cvc().empty() && - entity_data.specifics.autofill_wallet_credential() - .has_last_updated_time_unix_epoch_millis() && - entity_data.specifics.autofill_wallet_credential() - .last_updated_time_unix_epoch_millis() != 0; + IsAutofillWalletCredentialDataSpecificsValid( + entity_data.specifics.autofill_wallet_credential()); } -AutofillTable* AutofillWalletCredentialSyncBridge::GetAutofillTable() { +AutofillTable* AutofillWalletCredentialSyncBridge::GetAutofillTable() const { return AutofillTable::FromWebDatabase(web_data_backend_->GetDatabase()); }
diff --git a/components/autofill/core/browser/webdata/autofill_wallet_credential_sync_bridge.h b/components/autofill/core/browser/webdata/autofill_wallet_credential_sync_bridge.h index 0f8c98d2..58ccd72 100644 --- a/components/autofill/core/browser/webdata/autofill_wallet_credential_sync_bridge.h +++ b/components/autofill/core/browser/webdata/autofill_wallet_credential_sync_bridge.h
@@ -11,6 +11,7 @@ #include "base/memory/raw_ptr.h" #include "base/sequence_checker.h" #include "base/supports_user_data.h" +#include "components/autofill/core/browser/webdata/autofill_table.h" #include "components/sync/model/metadata_change_list.h" #include "components/sync/model/model_error.h" #include "components/sync/model/model_type_change_processor.h" @@ -71,7 +72,7 @@ const raw_ptr<AutofillWebDataBackend> web_data_backend_; // Returns the table associated with the `web_data_backend_`. - AutofillTable* GetAutofillTable(); + AutofillTable* GetAutofillTable() const; // Synchronously load sync metadata from the autofill table and pass it to the // processor so that it can start tracking changes.
diff --git a/components/autofill/core/browser/webdata/autofill_wallet_credential_sync_bridge_unittest.cc b/components/autofill/core/browser/webdata/autofill_wallet_credential_sync_bridge_unittest.cc index b7a3c38..c40e448 100644 --- a/components/autofill/core/browser/webdata/autofill_wallet_credential_sync_bridge_unittest.cc +++ b/components/autofill/core/browser/webdata/autofill_wallet_credential_sync_bridge_unittest.cc
@@ -13,6 +13,7 @@ #include "components/autofill/core/browser/webdata/autofill_sync_bridge_util.h" #include "components/autofill/core/browser/webdata/autofill_table.h" #include "components/autofill/core/browser/webdata/mock_autofill_webdata_backend.h" +#include "components/os_crypt/sync/os_crypt_mocker.h" #include "components/sync/protocol/autofill_specifics.pb.h" #include "components/sync/protocol/autofill_wallet_credential_specifics.pb.h" #include "components/sync/protocol/entity_data.h" @@ -37,6 +38,7 @@ class AutofillWalletCredentialSyncBridgeTest : public testing::Test { public: void SetUp() override { + OSCryptMocker::SetUp(); db_.AddTable(&table_); db_.Init(base::FilePath(WebDatabase::kInMemoryPath)); ON_CALL(backend_, GetDatabase()).WillByDefault(Return(&db_)); @@ -44,6 +46,17 @@ mock_processor_.CreateForwardingProcessor(), &backend_); } + void TearDown() override { OSCryptMocker::TearDown(); } + + std::vector<ServerCvc> GetAllServerCvcDataFromTable() { + // In tests, it's more convenient to work without `std::unique_ptr`. + std::vector<ServerCvc> server_cvc_data; + for (const std::unique_ptr<ServerCvc>& data : table()->GetAllServerCvcs()) { + server_cvc_data.push_back(std::move(*data)); + } + return server_cvc_data; + } + EntityData SpecificsToEntity( const AutofillWalletCredentialSpecifics& specifics) { EntityData data; @@ -51,8 +64,32 @@ return data; } + void AddCvcDataViaMergeFullSync(const ServerCvc& server_cvc) { + syncer::EntityChangeList entity_change_list; + entity_change_list.push_back(syncer::EntityChange::CreateAdd( + base::NumberToString(server_cvc.instrument_id), + SpecificsToEntity( + AutofillWalletCredentialSpecificsFromStructData(server_cvc)))); + AddCvcDataViaMergeFullSync(entity_change_list); + } + + void AddCvcDataViaMergeFullSync( + syncer::EntityChangeList& entity_change_list) { + EXPECT_EQ(bridge()->MergeFullSyncData(bridge()->CreateMetadataChangeList(), + std::move(entity_change_list)), + absl::nullopt); + } + AutofillWalletCredentialSyncBridge* bridge() { return bridge_.get(); } + AutofillTable* table() { return &table_; } + + MockAutofillWebDataBackend& backend() { return backend_; } + + syncer::MockModelTypeChangeProcessor& mock_processor() { + return mock_processor_; + } + private: NiceMock<MockAutofillWebDataBackend> backend_; AutofillTable table_; @@ -118,4 +155,119 @@ SpecificsToEntity(wallet_credential_specifics))); } +// Test to verify full merge sync for the server cvc data. +// There is no existing server cvc data on the local storage. +TEST_F(AutofillWalletCredentialSyncBridgeTest, MergeFullSyncData) { + const ServerCvc server_cvc = + ServerCvc(1, u"123", base::Time::UnixEpoch() + base::Milliseconds(25000)); + + AddCvcDataViaMergeFullSync(server_cvc); + + EXPECT_THAT(GetAllServerCvcDataFromTable(), + testing::UnorderedElementsAre(server_cvc)); +} + +// Test to verify incremental sync to add a server cvc. +// A server cvc on the local storage is added via MergeFullSync and then +// incremental sync is called with new unique server cvc data. +TEST_F(AutofillWalletCredentialSyncBridgeTest, + ApplyIncrementalSyncChanges_AddCvc) { + const ServerCvc server_cvc1 = + ServerCvc(1, u"123", base::Time::UnixEpoch() + base::Milliseconds(25000)); + + AddCvcDataViaMergeFullSync(server_cvc1); + + EXPECT_THAT(GetAllServerCvcDataFromTable(), + testing::UnorderedElementsAre(server_cvc1)); + + // Add a new server cvc. + syncer::EntityChangeList entity_change_list; + const ServerCvc server_cvc2 = + ServerCvc(2, u"999", base::Time::UnixEpoch() + base::Milliseconds(50000)); + entity_change_list.push_back(syncer::EntityChange::CreateAdd( + base::NumberToString(server_cvc2.instrument_id), + SpecificsToEntity( + AutofillWalletCredentialSpecificsFromStructData(server_cvc2)))); + + // Expect no changes to the remote server credential data. + EXPECT_CALL(mock_processor(), Delete).Times(0); + EXPECT_CALL(mock_processor(), Put).Times(0); + EXPECT_CALL(backend(), CommitChanges()); + EXPECT_CALL(backend(), NotifyOfMultipleAutofillChanges()); + + EXPECT_EQ( + bridge()->ApplyIncrementalSyncChanges( + bridge()->CreateMetadataChangeList(), std::move(entity_change_list)), + absl::nullopt); + EXPECT_THAT(GetAllServerCvcDataFromTable(), + testing::UnorderedElementsAre(server_cvc1, server_cvc2)); +} + +// Test to verify incremental sync to delete a server cvc. +// A server cvc on the local storage is added via MergeFullSync and then +// incremental sync is called to delete the existing server cvc. +TEST_F(AutofillWalletCredentialSyncBridgeTest, + ApplyIncrementalSyncChanges_DeleteCvc) { + const ServerCvc server_cvc1 = + ServerCvc(1, u"123", base::Time::UnixEpoch() + base::Milliseconds(25000)); + + AddCvcDataViaMergeFullSync(server_cvc1); + + EXPECT_THAT(GetAllServerCvcDataFromTable(), + testing::UnorderedElementsAre(server_cvc1)); + + // Delete an existing server cvc. + syncer::EntityChangeList entity_change_list; + entity_change_list.push_back(syncer::EntityChange::CreateDelete( + base::NumberToString(server_cvc1.instrument_id))); + + // Expect no changes to the remote server credential data. + EXPECT_CALL(mock_processor(), Delete).Times(0); + EXPECT_CALL(mock_processor(), Put).Times(0); + EXPECT_CALL(backend(), CommitChanges()); + EXPECT_CALL(backend(), NotifyOfMultipleAutofillChanges()); + + EXPECT_EQ( + bridge()->ApplyIncrementalSyncChanges( + bridge()->CreateMetadataChangeList(), std::move(entity_change_list)), + absl::nullopt); + EXPECT_THAT(GetAllServerCvcDataFromTable(), testing::IsEmpty()); +} + +// Test to verify incremental sync to update a server cvc. +// A server cvc on the local storage is added via MergeFullSync and then +// incremental sync is called to update the existing server cvc. +TEST_F(AutofillWalletCredentialSyncBridgeTest, + ApplyIncrementalSyncChanges_UpdateCvc) { + const ServerCvc server_cvc1 = + ServerCvc(1, u"123", base::Time::UnixEpoch() + base::Milliseconds(25000)); + + AddCvcDataViaMergeFullSync(server_cvc1); + + EXPECT_THAT(GetAllServerCvcDataFromTable(), + testing::UnorderedElementsAre(server_cvc1)); + + // Update the above CVC with new data and later timestamp. + syncer::EntityChangeList entity_change_list; + const ServerCvc server_cvc2 = + ServerCvc(1, u"999", base::Time::UnixEpoch() + base::Milliseconds(50000)); + entity_change_list.push_back(syncer::EntityChange::CreateUpdate( + base::NumberToString(server_cvc2.instrument_id), + SpecificsToEntity( + AutofillWalletCredentialSpecificsFromStructData(server_cvc2)))); + + // Expect no changes to the remote server credential data. + EXPECT_CALL(mock_processor(), Delete).Times(0); + EXPECT_CALL(mock_processor(), Put).Times(0); + EXPECT_CALL(backend(), CommitChanges()); + EXPECT_CALL(backend(), NotifyOfMultipleAutofillChanges()); + + EXPECT_EQ( + bridge()->ApplyIncrementalSyncChanges( + bridge()->CreateMetadataChangeList(), std::move(entity_change_list)), + absl::nullopt); + EXPECT_THAT(GetAllServerCvcDataFromTable(), + testing::UnorderedElementsAre(server_cvc2)); +} + } // namespace autofill
diff --git a/components/autofill/core/common/autofill_payments_features.cc b/components/autofill/core/common/autofill_payments_features.cc index 63aee464..1bfc017 100644 --- a/components/autofill/core/common/autofill_payments_features.cc +++ b/components/autofill/core/common/autofill_payments_features.cc
@@ -96,7 +96,7 @@ // autofill dialogs and bubbles on desktop. BASE_FEATURE(kAutofillEnableMovingGPayLogoToTheRightOnDesktop, "AutofillEnableMovingGPayLogoToTheRightOnDesktop", - base::FEATURE_ENABLED_BY_DEFAULT); + base::FEATURE_DISABLED_BY_DEFAULT); // When enabled, the GPay logo will be moved to the right side in payments // autofill dialogs and bubbles on clank.
diff --git a/components/autofill/ios/browser/autofill_driver_ios.h b/components/autofill/ios/browser/autofill_driver_ios.h index b8fc7a44..aadf591 100644 --- a/components/autofill/ios/browser/autofill_driver_ios.h +++ b/components/autofill/ios/browser/autofill_driver_ios.h
@@ -52,7 +52,6 @@ bool IsPrerendering() const override; bool HasSharedAutofillPermission() const override; bool CanShowAutofillUi() const override; - ui::AXTreeID GetAxTreeId() const override; bool RendererIsAvailable() override; std::vector<FieldGlobalId> FillOrPreviewForm( mojom::AutofillActionPersistence action_persistence,
diff --git a/components/autofill/ios/browser/autofill_driver_ios.mm b/components/autofill/ios/browser/autofill_driver_ios.mm index 053a273a..0248780 100644 --- a/components/autofill/ios/browser/autofill_driver_ios.mm +++ b/components/autofill/ios/browser/autofill_driver_ios.mm
@@ -79,11 +79,6 @@ return true; } -ui::AXTreeID AutofillDriverIOS::GetAxTreeId() const { - NOTIMPLEMENTED() << "See https://crbug.com/985933"; - return ui::AXTreeIDUnknown(); -} - bool AutofillDriverIOS::RendererIsAvailable() { return true; }
diff --git a/components/bookmarks/browser/bookmark_client.cc b/components/bookmarks/browser/bookmark_client.cc index 55cda60..70b54c6 100644 --- a/components/bookmarks/browser/bookmark_client.cc +++ b/components/bookmarks/browser/bookmark_client.cc
@@ -10,6 +10,10 @@ void BookmarkClient::Init(BookmarkModel* model) {} +const BookmarkNode* BookmarkClient::GetSuggestedSaveLocation(const GURL& url) { + return nullptr; +} + base::CancelableTaskTracker::TaskId BookmarkClient::GetFaviconImageForPageURL( const GURL& page_url, favicon_base::FaviconImageCallback callback,
diff --git a/components/bookmarks/browser/bookmark_client.h b/components/bookmarks/browser/bookmark_client.h index 3bd0d0f..80d3212 100644 --- a/components/bookmarks/browser/bookmark_client.h +++ b/components/bookmarks/browser/bookmark_client.h
@@ -43,6 +43,12 @@ // Called during initialization of BookmarkModel. virtual void Init(BookmarkModel* model); + // Gets a bookmark folder that the provided URL can be saved to. If nullptr is + // returned, the bookmark is saved to the default location (usually this is + // the last modified folder). This affords features the option to override the + // default folder if relevant for the URL. + virtual const BookmarkNode* GetSuggestedSaveLocation(const GURL& url); + // Requests a favicon from the history cache for the web page at |page_url| // for icon type favicon_base::IconType::kFavicon. |callback| is run when the // favicon has been fetched, which returns gfx::Image is a multi-resolution
diff --git a/components/bookmarks/browser/bookmark_utils.cc b/components/bookmarks/browser/bookmark_utils.cc index 26defe9..b6e92296 100644 --- a/components/bookmarks/browser/bookmark_utils.cc +++ b/components/bookmarks/browser/bookmark_utils.cc
@@ -545,7 +545,8 @@ base::RecordAction(base::UserMetricsAction("BookmarkAdded")); - const auto* parent_to_use = parent ? parent : GetParentForNewNodes(model); + const auto* parent_to_use = + parent ? parent : GetParentForNewNodes(model, url); return model->AddNewURL(parent_to_use, parent_to_use->children().size(), title, url); } @@ -623,11 +624,17 @@ return false; } -const BookmarkNode* GetParentForNewNodes(BookmarkModel* model) { +const BookmarkNode* GetParentForNewNodes(BookmarkModel* model, + const GURL& url) { #if BUILDFLAG(IS_ANDROID) if (!HasUserCreatedBookmarks(model)) return model->mobile_node(); #endif + const BookmarkNode* parent = model->client()->GetSuggestedSaveLocation(url); + if (parent) { + return parent; + } + std::vector<const BookmarkNode*> nodes = GetMostRecentlyModifiedUserFolders(model, 1); DCHECK(!nodes.empty()); // This list is always padded with default folders.
diff --git a/components/bookmarks/browser/bookmark_utils.h b/components/bookmarks/browser/bookmark_utils.h index 91b5c0b5..90305916 100644 --- a/components/bookmarks/browser/bookmark_utils.h +++ b/components/bookmarks/browser/bookmark_utils.h
@@ -203,8 +203,10 @@ const BookmarkNode* root); // Returns the parent to add new nodes to, never returns null (as long as -// the model is loaded). -const BookmarkNode* GetParentForNewNodes(BookmarkModel* model); +// the model is loaded). If |url| is non-empty, features will have the +// opportunity to suggest contextually relevant folders. +const BookmarkNode* GetParentForNewNodes(BookmarkModel* model, + const GURL& url = GURL()); } // namespace bookmarks
diff --git a/components/bookmarks/browser/bookmark_utils_unittest.cc b/components/bookmarks/browser/bookmark_utils_unittest.cc index d035b81..67f816ce 100644 --- a/components/bookmarks/browser/bookmark_utils_unittest.cc +++ b/components/bookmarks/browser/bookmark_utils_unittest.cc
@@ -17,6 +17,7 @@ #include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "components/bookmarks/browser/base_bookmark_model_observer.h" +#include "components/bookmarks/browser/bookmark_client.h" #include "components/bookmarks/browser/bookmark_model.h" #include "components/bookmarks/browser/bookmark_model_observer.h" #include "components/bookmarks/browser/bookmark_node_data.h" @@ -87,6 +88,26 @@ base::HistogramTester histogram_; }; +// A bookmark client that suggests a save location for new nodes. +class SuggestFolderClient : public TestBookmarkClient { + public: + SuggestFolderClient() = default; + SuggestFolderClient(const SuggestFolderClient&) = delete; + SuggestFolderClient& operator=(const SuggestFolderClient&) = delete; + ~SuggestFolderClient() override = default; + + const BookmarkNode* GetSuggestedSaveLocation(const GURL& url) override { + return suggested_save_location_.get(); + } + + void SetSuggestedSaveLocation(const BookmarkNode* node) { + suggested_save_location_ = node; + } + + private: + raw_ptr<const BookmarkNode> suggested_save_location_; +}; + TEST_F(BookmarkUtilsTest, GetBookmarksMatchingPropertiesWordPhraseQuery) { std::unique_ptr<BookmarkModel> model(TestBookmarkClient::CreateModel()); const BookmarkNode* node1 = model->AddURL(model->other_node(), 0, u"foo bar", @@ -485,6 +506,28 @@ EXPECT_EQ(2u, index); } +// Ensures the BookmarkClient has the power to suggest the parent for new nodes. +TEST_F(BookmarkUtilsTest, GetParentForNewNodes_ClientOverride) { + std::unique_ptr<SuggestFolderClient> client = + std::make_unique<SuggestFolderClient>(); + SuggestFolderClient* client_ptr = client.get(); + std::unique_ptr<BookmarkModel> model( + TestBookmarkClient::CreateModelWithClient(std::move(client))); + + const BookmarkNode* folder_to_suggest = + model->AddFolder(model->bookmark_bar_node(), 0, u"Suggested"); + const BookmarkNode* folder1 = + model->AddFolder(model->bookmark_bar_node(), 1, u"Folder 1"); + + ASSERT_EQ(folder1, GetParentForNewNodes(model.get(), GURL())); + + client_ptr->SetSuggestedSaveLocation(folder_to_suggest); + + ASSERT_EQ(folder_to_suggest, GetParentForNewNodes(model.get(), GURL())); + + client_ptr = nullptr; +} + // Verifies that meta info is copied when nodes are cloned. TEST_F(BookmarkUtilsTest, CloneMetaInfo) { std::unique_ptr<BookmarkModel> model(TestBookmarkClient::CreateModel());
diff --git a/components/client_hints/browser/client_hints.cc b/components/client_hints/browser/client_hints.cc index ae23f55..de29e5d2 100644 --- a/components/client_hints/browser/client_hints.cc +++ b/components/client_hints/browser/client_hints.cc
@@ -129,8 +129,9 @@ url, GURL(), ContentSettingsType::CLIENT_HINTS, nullptr), client_hints); - for (auto hint : additional_hints_) + for (auto hint : additional_hints_) { client_hints->SetIsEnabled(hint, true); + } } bool ClientHints::IsJavaScriptAllowed(const GURL& url, @@ -145,9 +146,7 @@ bool ClientHints::AreThirdPartyCookiesBlocked(const GURL& url, content::RenderFrameHost* rfh) { - return settings_map_->GetContentSetting( - url, url, ContentSettingsType::COOKIES) == CONTENT_SETTING_BLOCK || - cookie_settings_->ShouldBlockThirdPartyCookies(); + return !cookie_settings_->IsThirdPartyAccessAllowed(url); } blink::UserAgentMetadata ClientHints::GetUserAgentMetadata() { @@ -165,11 +164,13 @@ // TODO(tbansal): crbug.com/735518. Consider killing the renderer that sent // the malformed IPC. if (!primary_url.is_valid() || - !network::IsUrlPotentiallyTrustworthy(primary_url)) + !network::IsUrlPotentiallyTrustworthy(primary_url)) { return; + } - if (!IsJavaScriptAllowed(primary_url, parent_rfh)) + if (!IsJavaScriptAllowed(primary_url, parent_rfh)) { return; + } DCHECK_LE( client_hints.size(),
diff --git a/components/content_settings/core/common/content_settings_types.h b/components/content_settings/core/common/content_settings_types.h index d2faa07..9b2546f 100644 --- a/components/content_settings/core/common/content_settings_types.h +++ b/components/content_settings/core/common/content_settings_types.h
@@ -18,6 +18,10 @@ // "DEFAULT" is only used as an argument to the Content Settings Window // opener; there it means "whatever was last shown". DEFAULT = -1, + // This setting governs whether cookies are enabled by the user in the + // provided context. However, it may be overridden by other settings. This + // enum should NOT be read directly to determine whether cookies are enabled; + // the client should instead rely on the CookieSettings API. COOKIES = 0, IMAGES, JAVASCRIPT,
diff --git a/components/embedder_support/user_agent_utils_unittest.cc b/components/embedder_support/user_agent_utils_unittest.cc index 8e82abe..8148138f 100644 --- a/components/embedder_support/user_agent_utils_unittest.cc +++ b/components/embedder_support/user_agent_utils_unittest.cc
@@ -1163,11 +1163,11 @@ GetProductAndVersion(UserAgentReductionEnterprisePolicyState::kDefault); EXPECT_TRUE(re2::RE2::FullMatch(product, kChromeProductVersionRegex, &major_version, &minor_version, - &build_version, &patch_version)); + &build_version)); EXPECT_EQ(major_version, version_info::GetMajorVersionNumber()); EXPECT_EQ(minor_version, "0"); EXPECT_NE(build_version, "0"); - EXPECT_EQ(patch_version, "0"); + // Patch version cannot be tested as it would be set in a release branch. // (1b) Policies: UserAgentReduction force enabled. product = GetProductAndVersion( @@ -1180,6 +1180,17 @@ EXPECT_EQ(build_version, "0"); EXPECT_EQ(patch_version, "0"); + // (1c) Policies:: UserAgentReduction force disabled. + product = GetProductAndVersion( + UserAgentReductionEnterprisePolicyState::kForceDisabled); + EXPECT_TRUE(re2::RE2::FullMatch(product, kChromeProductVersionRegex, + &major_version, &minor_version, + &build_version)); + EXPECT_EQ(major_version, version_info::GetMajorVersionNumber()); + EXPECT_EQ(minor_version, "0"); + EXPECT_NE(build_version, "0"); + // Patch version cannot be tested as it would be set in a release branch. + // (2) Features: UserAgentReduction enabled with version. scoped_feature_list.Reset(); scoped_feature_list.InitWithFeaturesAndParameters(
diff --git a/components/feature_engagement/public/event_constants.cc b/components/feature_engagement/public/event_constants.cc index d536275..4d0d5d54 100644 --- a/components/feature_engagement/public/event_constants.cc +++ b/components/feature_engagement/public/event_constants.cc
@@ -77,6 +77,12 @@ "overflow_menu_no_horizontal_scroll_or_action"; const char kPriceNotificationsUsed[] = "price_notifications_used"; const char kDefaultBrowserPromoShown[] = "default_browser_promo_shown"; +const char kPasswordManagerWidgetPromoTriggered[] = + "password_manager_widget_promo_trigger"; +const char kPasswordManagerWidgetPromoUsed[] = + "password_manager_widget_promo_used"; +const char kPasswordManagerWidgetPromoClosed[] = + "password_manager_widget_promo_closed"; // Default browser blue dot promo. const char kBlueDotPromoCriterionMet[] = "blue_dot_promo_criterion_met";
diff --git a/components/feature_engagement/public/event_constants.h b/components/feature_engagement/public/event_constants.h index ebdc8ecc..ce56f92c 100644 --- a/components/feature_engagement/public/event_constants.h +++ b/components/feature_engagement/public/event_constants.h
@@ -134,6 +134,15 @@ // The user has been shown a default browser promo. extern const char kDefaultBrowserPromoShown[]; +// The Password Manager widget promo was triggered. +extern const char kPasswordManagerWidgetPromoTriggered[]; + +// The Password Manager widget was used. +extern const char kPasswordManagerWidgetPromoUsed[]; + +// The Password Manager widget promo was closed. +extern const char kPasswordManagerWidgetPromoClosed[]; + // The user has taken an action that is a criterion towards becoming eligible to // be shown the blue dot default browser promo. extern const char kBlueDotPromoCriterionMet[];
diff --git a/components/feature_engagement/public/feature_configurations.cc b/components/feature_engagement/public/feature_configurations.cc index 1b587b9..3fc2f133 100644 --- a/components/feature_engagement/public/feature_configurations.cc +++ b/components/feature_engagement/public/feature_configurations.cc
@@ -1644,6 +1644,33 @@ return config; } + if (kIPHiOSPromoPasswordManagerWidgetFeature.name == feature->name) { + // A config to allow a user to be shown the Password Manager widget promo in + // the Password Manager. The promo will be shown for a maximum of three + // subsequent Password Manager visits to users who have not yet installed + // and used the widget. This FET feature is non-blocking because it is a + // passive promo that appears alongside the rest of the UI, and does not + // interrupt the user's flow. + + absl::optional<FeatureConfig> config = FeatureConfig(); + config->valid = true; + config->availability = Comparator(ANY, 0); + config->session_rate = Comparator(ANY, 0); + config->session_rate_impact.type = SessionRateImpact::Type::NONE; + config->trigger = EventConfig( + feature_engagement::events::kPasswordManagerWidgetPromoTriggered, + Comparator(LESS_THAN, 3), 360, 360); + config->used = + EventConfig(feature_engagement::events::kPasswordManagerWidgetPromoUsed, + Comparator(EQUAL, 0), 360, 360); + config->event_configs.insert(EventConfig( + feature_engagement::events::kPasswordManagerWidgetPromoClosed, + Comparator(EQUAL, 0), 360, 360)); + config->blocked_by.type = BlockedBy::Type::NONE; + config->blocking.type = Blocking::Type::NONE; + return config; + } + // iOS Promo Configs are split out into a separate file, so check that too. if (absl::optional<FeatureConfig> ios_promo_feature_config = GetClientSideiOSPromoFeatureConfig(feature)) {
diff --git a/components/feature_engagement/public/feature_constants.cc b/components/feature_engagement/public/feature_constants.cc index 987b34b..7a583b6c 100644 --- a/components/feature_engagement/public/feature_constants.cc +++ b/components/feature_engagement/public/feature_constants.cc
@@ -467,7 +467,7 @@ base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kIPHPriceNotificationsWhileBrowsingFeature, "IPH_PriceNotificationsWhileBrowsing", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kIPHiOSDefaultBrowserBadgeEligibilityFeature, "IPH_iOSDefaultBrowserBadgeEligibility", base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/components/global_media_controls/public/views/media_notification_view_ash_impl.cc b/components/global_media_controls/public/views/media_notification_view_ash_impl.cc index d116c83..606b1001 100644 --- a/components/global_media_controls/public/views/media_notification_view_ash_impl.cc +++ b/components/global_media_controls/public/views/media_notification_view_ash_impl.cc
@@ -602,6 +602,11 @@ return (i == action_buttons_.end()) ? nullptr : *i; } +media_session::MediaPosition +MediaNotificationViewAshImpl::GetPositionForTesting() { + return position_; +} + views::Button* MediaNotificationViewAshImpl::GetStartCastingButtonForTesting() { return start_casting_button_; }
diff --git a/components/global_media_controls/public/views/media_notification_view_ash_impl.h b/components/global_media_controls/public/views/media_notification_view_ash_impl.h index 8766b3f0..e2daf29 100644 --- a/components/global_media_controls/public/views/media_notification_view_ash_impl.h +++ b/components/global_media_controls/public/views/media_notification_view_ash_impl.h
@@ -98,6 +98,7 @@ views::ImageView* GetChevronIconForTesting(); views::Button* GetActionButtonForTesting( media_session::mojom::MediaSessionAction action); + media_session::MediaPosition GetPositionForTesting(); views::Button* GetStartCastingButtonForTesting(); MediaItemUIFooter* GetFooterForTesting(); MediaItemUIDeviceSelector* GetDeviceSelectorForTesting();
diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc index 735d7b8..6d14162 100644 --- a/components/metrics/metrics_service.cc +++ b/components/metrics/metrics_service.cc
@@ -1181,12 +1181,6 @@ ->MarkUnloggedSamplesAsLogged(); StoreFinalizedLog(log_type, reason, std::move(done_callback), std::move(finalized_log)); - - // Call OnDidCreateMetricsLog() after storing a log instead of directly after - // opening a log. Otherwise, the async log that was created would potentially - // have mistakenly snapshotted the histograms intended for the newly opened - // log. - delegating_provider_.OnDidCreateMetricsLog(); } void MetricsService::PushPendingLogsToPersistentStorage( @@ -1291,7 +1285,7 @@ pending_ongoing_log_ = true; base::OnceClosure log_stored_callback = - base::BindOnce(&MetricsService::OnPeriodicOngoingLogStored, + base::BindOnce(&MetricsService::OnAsyncPeriodicOngoingLogStored, self_ptr_factory_.GetWeakPtr()); CloseCurrentLog(/*async=*/true, MetricsLogsEventManager::CreateReason::kPeriodic, @@ -1299,9 +1293,15 @@ OpenNewLog(/*call_providers=*/false); } -void MetricsService::OnPeriodicOngoingLogStored() { +void MetricsService::OnAsyncPeriodicOngoingLogStored() { pending_ongoing_log_ = false; + // Call OnDidCreateMetricsLog() after storing a log instead of directly after + // opening a log. Otherwise, the async log that was created would potentially + // have mistakenly snapshotted the histograms intended for the newly opened + // log. + delegating_provider_.OnDidCreateMetricsLog(); + // Trim and store unsent logs, including the log that was just closed, so that // they're not lost in case of a crash before upload time. However, the // in-memory log store is unchanged. I.e., logs that are trimmed will still be
diff --git a/components/metrics/metrics_service.h b/components/metrics/metrics_service.h index 86d637c..dd8133e 100644 --- a/components/metrics/metrics_service.h +++ b/components/metrics/metrics_service.h
@@ -538,7 +538,7 @@ // Called via a callback after a periodic ongoing log (created through the // MetricsRotationScheduler) was stored in |log_store()|. - void OnPeriodicOngoingLogStored(); + void OnAsyncPeriodicOngoingLogStored(); // Prepares the initial stability log, which is only logged when the previous // run of Chrome crashed. This log contains any stability metrics left over
diff --git a/components/omnibox/browser/autocomplete_match.cc b/components/omnibox/browser/autocomplete_match.cc index a07a579..dcd5688 100644 --- a/components/omnibox/browser/autocomplete_match.cc +++ b/components/omnibox/browser/autocomplete_match.cc
@@ -541,8 +541,8 @@ case Type::SEARCH_HISTORY: case Type::SEARCH_SUGGEST_PERSONALIZED: { DCHECK(IsSearchHistoryType(type)); - return use_chrome_refresh_icons ? omnibox::kClockChromeRefreshIcon - : omnibox::kClockIcon; + return use_chrome_refresh_icons ? vector_icons::kHistoryChromeRefreshIcon + : vector_icons::kHistoryIcon; } case Type::EXTENSION_APP_DEPRECATED:
diff --git a/components/omnibox/common/omnibox_features.cc b/components/omnibox/common/omnibox_features.cc index 25f41bb..85aefc43 100644 --- a/components/omnibox/common/omnibox_features.cc +++ b/components/omnibox/common/omnibox_features.cc
@@ -319,6 +319,14 @@ "OmniboxMostVisitedTiles", base::FEATURE_ENABLED_BY_DEFAULT); +// If enabled, makes Most Visited Tiles a Horizontal render group. +// Horizontal render group decomposes aggregate suggestions (such as old Most +// Visited Tiles), expecting individual AutocompleteMatch entry for every +// element in the carousel. +BASE_FEATURE(kMostVisitedTilesHorizontalRenderGroup, + "OmniboxMostVisitedTilesHorizontalRenderGroup", + base::FEATURE_DISABLED_BY_DEFAULT); + // If enabled, expands autocompletion to possibly (depending on params) include // suggestion titles and non-prefixes as opposed to be restricted to URL // prefixes. Will also adjust the location bar UI and omnibox text selection to
diff --git a/components/omnibox/common/omnibox_features.h b/components/omnibox/common/omnibox_features.h index e3d353c..f2c8200 100644 --- a/components/omnibox/common/omnibox_features.h +++ b/components/omnibox/common/omnibox_features.h
@@ -83,6 +83,7 @@ BASE_DECLARE_FEATURE(kCr2023ActionChipsIcons); BASE_DECLARE_FEATURE(kSuggestionAnswersColorReverse); BASE_DECLARE_FEATURE(kMostVisitedTiles); +BASE_DECLARE_FEATURE(kMostVisitedTilesHorizontalRenderGroup); BASE_DECLARE_FEATURE(kRichAutocompletion); BASE_DECLARE_FEATURE(kNtpRealboxPedals); BASE_DECLARE_FEATURE(kOmniboxActionsUISimplification);
diff --git a/components/optimization_guide/core/optimization_guide_features.cc b/components/optimization_guide/core/optimization_guide_features.cc index 1133b37..801d5e1 100644 --- a/components/optimization_guide/core/optimization_guide_features.cc +++ b/components/optimization_guide/core/optimization_guide_features.cc
@@ -45,6 +45,13 @@ false; #endif +constexpr auto enabled_by_default_ios_only = +#if BUILDFLAG(IS_IOS) + base::FEATURE_ENABLED_BY_DEFAULT; +#else + base::FEATURE_DISABLED_BY_DEFAULT; +#endif + // Returns whether |locale| is a supported locale for |feature|. // // This matches |locale| with the "supported_locales" feature param value in @@ -160,7 +167,7 @@ // Enables push notification of hints. BASE_FEATURE(kPushNotifications, "OptimizationGuidePushNotifications", - base::FEATURE_DISABLED_BY_DEFAULT); + enabled_by_default_ios_only); // This feature flag does not turn off any behavior, it is only used for // experiment parameters.
diff --git a/components/password_manager/content/browser/content_password_manager_driver.cc b/components/password_manager/content/browser/content_password_manager_driver.cc index cc3f6a0..c162675 100644 --- a/components/password_manager/content/browser/content_password_manager_driver.cc +++ b/components/password_manager/content/browser/content_password_manager_driver.cc
@@ -252,10 +252,6 @@ return render_frame_host_->IsActive(); } -::ui::AXTreeID ContentPasswordManagerDriver::GetAxTreeId() const { - return render_frame_host_->GetAXTreeID(); -} - const GURL& ContentPasswordManagerDriver::GetLastCommittedURL() const { return render_frame_host_->GetLastCommittedURL(); }
diff --git a/components/password_manager/content/browser/content_password_manager_driver.h b/components/password_manager/content/browser/content_password_manager_driver.h index ce9a9e8a..a50f648 100644 --- a/components/password_manager/content/browser/content_password_manager_driver.h +++ b/components/password_manager/content/browser/content_password_manager_driver.h
@@ -89,7 +89,6 @@ void SendLoggingAvailability() override; bool IsInPrimaryMainFrame() const override; bool CanShowAutofillUi() const override; - ::ui::AXTreeID GetAxTreeId() const override; int GetFrameId() const override; const GURL& GetLastCommittedURL() const override; void AnnotateFieldsWithParsingResult(
diff --git a/components/password_manager/core/browser/password_form.cc b/components/password_manager/core/browser/password_form.cc index d4976fa..3dac412 100644 --- a/components/password_manager/core/browser/password_form.cc +++ b/components/password_manager/core/browser/password_form.cc
@@ -227,6 +227,9 @@ const AlternativeElement::Name& name) : value(value), field_renderer_id(field_renderer_id), name(name) {} +AlternativeElement::AlternativeElement(const AlternativeElement::Value& value) + : value(value) {} + AlternativeElement::AlternativeElement(const AlternativeElement& rhs) = default; AlternativeElement::AlternativeElement(AlternativeElement&& rhs) = default;
diff --git a/components/password_manager/core/browser/password_form.h b/components/password_manager/core/browser/password_form.h index cdda6015..a27301f 100644 --- a/components/password_manager/core/browser/password_form.h +++ b/components/password_manager/core/browser/password_form.h
@@ -38,6 +38,7 @@ AlternativeElement(const Value& value, autofill::FieldRendererId field_renderer_id, const Name& name); + explicit AlternativeElement(const Value& value); AlternativeElement(const AlternativeElement& rhs); AlternativeElement(AlternativeElement&& rhs); AlternativeElement& operator=(const AlternativeElement& rhs); @@ -49,9 +50,11 @@ // The value of the field. std::u16string value; - // The renderer id of the field. + // The renderer id of the field. May be not set if the value is + // not present in the submitted form. autofill::FieldRendererId field_renderer_id; - // The name attribute of the field. + // The name attribute of the field. May be empty if the value is + // not present in the submitted form. std::u16string name; }; @@ -294,9 +297,9 @@ // has implemented some form of autofill. std::u16string username_value; - // This member is populated in cases where we there are multiple input - // elements that could possibly be the username. Used when our heuristics for - // determining the username are incorrect. Optional. + // This member is populated in cases where we there are multiple possible + // username values. Used to populate a dropdown for possible usernames. + // Optional. AlternativeElementVector all_alternative_usernames; // This member is populated in cases where we there are multiple possible
diff --git a/components/password_manager/core/browser/password_manager_driver.h b/components/password_manager/core/browser/password_manager_driver.h index 18d4d2b..7e6809b 100644 --- a/components/password_manager/core/browser/password_manager_driver.h +++ b/components/password_manager/core/browser/password_manager_driver.h
@@ -140,9 +140,6 @@ // frame. virtual bool CanShowAutofillUi() const = 0; - // Returns the ax tree id associated with this driver. - virtual ::ui::AXTreeID GetAxTreeId() const = 0; - // Returns the frame ID of the frame associated with this driver. virtual int GetFrameId() const = 0;
diff --git a/components/password_manager/core/browser/password_save_manager_impl.cc b/components/password_manager/core/browser/password_save_manager_impl.cc index acac876..e8a9206e 100644 --- a/components/password_manager/core/browser/password_save_manager_impl.cc +++ b/components/password_manager/core/browser/password_save_manager_impl.cc
@@ -254,6 +254,27 @@ return result; } +bool AlternativeElementsContainValue(const AlternativeElementVector& elements, + const std::u16string& value) { + return base::ranges::any_of(elements, + [&value](const AlternativeElement& element) { + return element.value == value; + }); +} + +void PopulateAlternativeUsernames( + const std::vector<const PasswordForm*>& best_matches, + PasswordForm& form) { + for (const PasswordForm* match : best_matches) { + if ((match->username_value != form.username_value) && + !AlternativeElementsContainValue(form.all_alternative_usernames, + match->username_value)) { + form.all_alternative_usernames.emplace_back( + AlternativeElement::Value(match->username_value)); + } + } +} + } // namespace PasswordSaveManagerImpl::PasswordSaveManagerImpl( @@ -637,6 +658,10 @@ pending_credentials.signon_realm = parsed_submitted_form.signon_realm; } + // Add previously saved usernames as alternatives. + PopulateAlternativeUsernames(form_fetcher_->GetBestMatches(), + pending_credentials); + if (HasGeneratedPassword()) { pending_credentials.type = PasswordForm::Type::kGenerated; }
diff --git a/components/password_manager/core/browser/password_save_manager_impl_unittest.cc b/components/password_manager/core/browser/password_save_manager_impl_unittest.cc index 5a610b4..2f69d72 100644 --- a/components/password_manager/core/browser/password_save_manager_impl_unittest.cc +++ b/components/password_manager/core/browser/password_save_manager_impl_unittest.cc
@@ -74,6 +74,8 @@ EXPECT_EQ(expected.username_element, actual.username_element); EXPECT_EQ(expected.password_element, actual.password_element); EXPECT_EQ(expected.blocked_by_user, actual.blocked_by_user); + EXPECT_EQ(expected.all_alternative_usernames, + actual.all_alternative_usernames); EXPECT_TRUE( autofill::FormData::DeepEqual(expected.form_data, actual.form_data)); } @@ -438,7 +440,7 @@ const base::Time kNow = base::Time::Now(); password_save_manager_impl()->CreatePendingCredentials( - Parse(submitted_form_), &observed_form_, submitted_form_, + parsed_submitted_form_, &observed_form_, submitted_form_, /*is_http_auth=*/false, /*is_credential_api_save=*/false); @@ -453,12 +455,15 @@ TEST_P(PasswordSaveManagerImplTest, CreatePendingCredentialsNewCredentials) { SetNonFederatedAndNotifyFetchCompleted({&saved_match_}); password_save_manager_impl()->CreatePendingCredentials( - Parse(submitted_form_), &observed_form_, submitted_form_, + parsed_submitted_form_, &observed_form_, submitted_form_, /*is_http_auth=*/false, /*is_credential_api_save=*/false); + PasswordForm expected_credentials = parsed_submitted_form_; + expected_credentials.all_alternative_usernames.emplace_back( + AlternativeElement::Value(saved_match_.username_value)); CheckPendingCredentials( - parsed_submitted_form_, + expected_credentials, password_save_manager_impl()->GetPendingCredentials()); } @@ -562,6 +567,9 @@ PasswordForm expected = saved_match_; expected.password_value = u"verystrongpassword"; + expected.all_alternative_usernames.emplace_back( + AlternativeElement::Value(another_saved_match.username_value)); + password_save_manager_impl()->CreatePendingCredentials( Parse(submitted_form), &observed_form_, submitted_form, /*is_http_auth=*/false, @@ -571,6 +579,36 @@ expected, password_save_manager_impl()->GetPendingCredentials()); } +// Tests creating pending credentials when there are multiple saved credentials, +// ensuring that there are no duplicates in the alternative usernames vector. +TEST_P(PasswordSaveManagerImplTest, + CreatePendingCredentialsMultipleSavedNoDuplicatedAlternatives) { + PasswordForm another_saved_match = saved_match_; + another_saved_match.username_value = u"last_name"; + SetNonFederatedAndNotifyFetchCompleted({&saved_match_, &another_saved_match}); + + // Create submitted form, that has one of the previously saved usernames in + // it. + FormData submitted_form = observed_form_; + submitted_form.fields[0].value = another_saved_match.username_value; + submitted_form.fields[1].value = u"new_username"; + submitted_form.fields[2].value = u"verystrongpassword"; + + PasswordForm parsed_form = Parse(submitted_form); + password_save_manager_impl()->CreatePendingCredentials( + parsed_form, &observed_form_, submitted_form, + /*is_http_auth=*/false, + /*is_credential_api_save=*/false); + + // Only the match that wasn't present in the submitted form should be added. + PasswordForm expected = parsed_form; + expected.all_alternative_usernames.emplace_back( + AlternativeElement::Value(saved_match_.username_value)); + + CheckPendingCredentials( + expected, password_save_manager_impl()->GetPendingCredentials()); +} + // Tests creating pending credentials when the password field has an empty name. TEST_P(PasswordSaveManagerImplTest, CreatePendingCredentialsEmptyName) { fetcher()->NotifyFetchCompleted();
diff --git a/components/password_manager/core/browser/stub_password_manager_driver.cc b/components/password_manager/core/browser/stub_password_manager_driver.cc index 8458233..0dbc7a9 100644 --- a/components/password_manager/core/browser/stub_password_manager_driver.cc +++ b/components/password_manager/core/browser/stub_password_manager_driver.cc
@@ -65,10 +65,6 @@ return true; } -::ui::AXTreeID StubPasswordManagerDriver::GetAxTreeId() const { - return {}; -} - int StubPasswordManagerDriver::GetFrameId() const { return GetId(); }
diff --git a/components/password_manager/core/browser/stub_password_manager_driver.h b/components/password_manager/core/browser/stub_password_manager_driver.h index 652499ac..06878d0 100644 --- a/components/password_manager/core/browser/stub_password_manager_driver.h +++ b/components/password_manager/core/browser/stub_password_manager_driver.h
@@ -44,7 +44,6 @@ PasswordAutofillManager* GetPasswordAutofillManager() override; bool IsInPrimaryMainFrame() const override; bool CanShowAutofillUi() const override; - ::ui::AXTreeID GetAxTreeId() const override; int GetFrameId() const override; const GURL& GetLastCommittedURL() const override; };
diff --git a/components/password_manager/core/browser/votes_uploader.cc b/components/password_manager/core/browser/votes_uploader.cc index 1af034e7..46cf7b3 100644 --- a/components/password_manager/core/browser/votes_uploader.cc +++ b/components/password_manager/core/browser/votes_uploader.cc
@@ -309,7 +309,7 @@ base::TrimWhitespace(username_value, base::TrimPositions::TRIM_ALL, &username_candidate_value); value_type = GetValueType(username_candidate_value, stored_credentials); - prompt_edit = autofill::AutofillUploadContents::EDIT_UNSPECIFIED; + prompt_edit = AutofillUploadContents::EDIT_UNSPECIFIED; } SingleUsernameVoteData::SingleUsernameVoteData( @@ -671,43 +671,11 @@ #if !BUILDFLAG(IS_ANDROID) void VotesUploader::CalculateUsernamePromptEditState( const std::u16string& saved_username) { - if (!single_username_vote_data_ || - single_username_vote_data_->username_candidate_value.empty()) { - return; + if (single_username_vote_data_ && + !single_username_vote_data_->username_candidate_value.empty()) { + single_username_vote_data_->prompt_edit = CalculateUsernamePromptEdit( + saved_username, single_username_vote_data_->username_candidate_value); } - const auto& single_username_value = - single_username_vote_data_->username_candidate_value; - - autofill::AutofillUploadContents::SingleUsernamePromptEdit prompt_edit = - autofill::AutofillUploadContents::EDIT_UNSPECIFIED; - if (saved_username != suggested_username_) { - // In this branch, the user edited the username in a prompt before accepting - // it. - - // The user removed some suggested username and that username wasn't the - // possible single username (|single_username_value|) => this is neither - // negative nor positive vote. If the user removes |single_username_value|, - // then it is a negative signal and will be reported below. - if (saved_username.empty() && - suggested_username_ != single_username_value) { - return; - } - - if (saved_username == single_username_value) - prompt_edit = autofill::AutofillUploadContents::EDITED_POSITIVE; - else - prompt_edit = autofill::AutofillUploadContents::EDITED_NEGATIVE; - - } else { // saved_username == suggested_username - // In this branch the user did NOT edit the username in prompt and accepted - // it as it is. - - if (saved_username == single_username_value) - prompt_edit = autofill::AutofillUploadContents::NOT_EDITED_POSITIVE; - else - prompt_edit = autofill::AutofillUploadContents::NOT_EDITED_NEGATIVE; - } - single_username_vote_data_->prompt_edit = prompt_edit; } #endif // !BUILDFLAG(IS_ANDROID) @@ -960,4 +928,41 @@ form_structure.set_single_username_data(single_username_data); } +AutofillUploadContents::SingleUsernamePromptEdit +VotesUploader::CalculateUsernamePromptEdit( + const std::u16string& saved_username, + const std::u16string& potential_username) { + AutofillUploadContents::SingleUsernamePromptEdit prompt_edit = + AutofillUploadContents::EDIT_UNSPECIFIED; + if (saved_username != suggested_username_) { + // In this branch, the user edited the username in a prompt before accepting + // it. + + // The user removed some suggested username and that username wasn't the + // |potential_username| => this is neither negative nor positive vote. If + // the user removes |potential_username|, then it is a negative signal and + // will be reported below. + if (saved_username.empty() && suggested_username_ != potential_username) { + return prompt_edit; + } + + if (saved_username == potential_username) { + prompt_edit = AutofillUploadContents::EDITED_POSITIVE; + } else { + prompt_edit = AutofillUploadContents::EDITED_NEGATIVE; + } + + } else { // saved_username == suggested_username + // In this branch the user did NOT edit the username in prompt and accepted + // it as it is. + + if (saved_username == potential_username) { + prompt_edit = AutofillUploadContents::NOT_EDITED_POSITIVE; + } else { + prompt_edit = AutofillUploadContents::NOT_EDITED_NEGATIVE; + } + } + return prompt_edit; +} + } // namespace password_manager
diff --git a/components/password_manager/core/browser/votes_uploader.h b/components/password_manager/core/browser/votes_uploader.h index 22729380..4d3cde17 100644 --- a/components/password_manager/core/browser/votes_uploader.h +++ b/components/password_manager/core/browser/votes_uploader.h
@@ -266,6 +266,14 @@ void SetSingleUsernameVoteOnPasswordForm( autofill::FormStructure& form_structure); + // Calculates whether the |saved_username| (the value actually saved in the + // Password Manager) confirms or contradicts |potential_username| (Password + // Manager's guess based on preceding text fields that the user has interacted + // with). + autofill::AutofillUploadContents::SingleUsernamePromptEdit + CalculateUsernamePromptEdit(const std::u16string& saved_username, + const std::u16string& potential_username); + // The client which implements embedder-specific PasswordManager operations. raw_ptr<PasswordManagerClient> client_ = nullptr;
diff --git a/components/password_manager/ios/ios_password_manager_driver.h b/components/password_manager/ios/ios_password_manager_driver.h index 29eca67..af927bd 100644 --- a/components/password_manager/ios/ios_password_manager_driver.h +++ b/components/password_manager/ios/ios_password_manager_driver.h
@@ -57,7 +57,6 @@ password_manager::PasswordManagerInterface* GetPasswordManager() override; password_manager::PasswordAutofillManager* GetPasswordAutofillManager() override; - ::ui::AXTreeID GetAxTreeId() const override; int GetFrameId() const override; bool IsInPrimaryMainFrame() const override; bool CanShowAutofillUi() const override;
diff --git a/components/password_manager/ios/ios_password_manager_driver.mm b/components/password_manager/ios/ios_password_manager_driver.mm index c4df768..552b898 100644 --- a/components/password_manager/ios/ios_password_manager_driver.mm +++ b/components/password_manager/ios/ios_password_manager_driver.mm
@@ -122,10 +122,6 @@ return true; } -::ui::AXTreeID IOSPasswordManagerDriver::GetAxTreeId() const { - return {}; -} - int IOSPasswordManagerDriver::GetFrameId() const { return cached_frame_id_; }
diff --git a/components/performance_manager/BUILD.gn b/components/performance_manager/BUILD.gn index 8316ec5e..4059465 100644 --- a/components/performance_manager/BUILD.gn +++ b/components/performance_manager/BUILD.gn
@@ -320,6 +320,7 @@ "performance_manager_unittest.cc", "registered_objects_unittest.cc", "render_process_host_id_unittest.cc", + "test_support/mock_graphs_unittest.cc", "user_tuning/prefs_unittest.cc", "v8_memory/v8_context_tracker_helpers_unittest.cc", "v8_memory/v8_context_tracker_internal_unittest.cc",
diff --git a/components/performance_manager/graph/graph_impl_unittest.cc b/components/performance_manager/graph/graph_impl_unittest.cc index ec78f13..07631cb 100644 --- a/components/performance_manager/graph/graph_impl_unittest.cc +++ b/components/performance_manager/graph/graph_impl_unittest.cc
@@ -91,8 +91,11 @@ MockMultiplePagesInSingleProcessGraph mock_graph(graph()); std::vector<ProcessNodeImpl*> processes = graph()->GetAllProcessNodeImpls(); - ASSERT_EQ(1u, processes.size()); + + // Graph contains a browser process and 1 renderer process. + ASSERT_EQ(2u, processes.size()); EXPECT_NE(nullptr, processes[0]); + EXPECT_NE(nullptr, processes[1]); std::vector<FrameNodeImpl*> frames = graph()->GetAllFrameNodeImpls(); ASSERT_EQ(2u, frames.size());
diff --git a/components/performance_manager/test_support/mock_graphs.cc b/components/performance_manager/test_support/mock_graphs.cc index bfc7c97..b7d27267 100644 --- a/components/performance_manager/test_support/mock_graphs.cc +++ b/components/performance_manager/test_support/mock_graphs.cc
@@ -8,17 +8,45 @@ #include <utility> #include "base/process/process.h" +#include "base/process/process_handle.h" #include "base/time/time.h" #include "components/performance_manager/graph/frame_node_impl.h" #include "components/performance_manager/graph/node_base.h" #include "components/performance_manager/graph/page_node_impl.h" #include "components/performance_manager/graph/process_node_impl.h" #include "components/performance_manager/graph/system_node_impl.h" +#include "components/performance_manager/public/browser_child_process_host_id.h" +#include "components/performance_manager/public/browser_child_process_host_proxy.h" +#include "components/performance_manager/public/render_process_host_id.h" +#include "components/performance_manager/public/render_process_host_proxy.h" +#include "content/public/common/process_type.h" namespace performance_manager { +namespace { + +// Returns a new RenderProcessHostProxy with a unique RenderProcessHostId. +RenderProcessHostProxy CreateRenderProcessHostProxy() { + static RenderProcessHostId::Generator id_generator; + return RenderProcessHostProxy::CreateForTesting( + id_generator.GenerateNextId()); +} + +// Returns a new BrowserChildProcessHostProxy with a unique +// BrowserChildProcessHostId. +BrowserChildProcessHostProxy CreateBrowserChildProcessHostProxy() { + static BrowserChildProcessHostId::Generator id_generator; + return BrowserChildProcessHostProxy::CreateForTesting( + id_generator.GenerateNextId()); +} + +} // namespace + TestProcessNodeImpl::TestProcessNodeImpl() - : ProcessNodeImpl(RenderProcessHostProxy()) {} + : ProcessNodeImpl(CreateRenderProcessHostProxy()) {} + +TestProcessNodeImpl::TestProcessNodeImpl(content::ProcessType process_type) + : ProcessNodeImpl(process_type, CreateBrowserChildProcessHostProxy()) {} void TestProcessNodeImpl::SetProcessWithPid(base::ProcessId pid, base::Process process, @@ -29,11 +57,14 @@ MockSinglePageInSingleProcessGraph::MockSinglePageInSingleProcessGraph( TestGraphImpl* graph) : system(TestNodeWrapper<SystemNodeImpl>::Create(graph)), + browser_process(TestNodeWrapper<TestProcessNodeImpl>::Create( + graph, + BrowserProcessNodeTag{})), process(TestNodeWrapper<TestProcessNodeImpl>::Create(graph)), page(TestNodeWrapper<PageNodeImpl>::Create(graph)), frame(graph->CreateFrameNodeAutoId(process.get(), page.get())) { - process->SetProcessWithPid(1, base::Process::Current(), - /* launch_time=*/base::TimeTicks::Now()); + browser_process->SetProcessWithPid(1); + process->SetProcessWithPid(2); } MockSinglePageInSingleProcessGraph::~MockSinglePageInSingleProcessGraph() { @@ -63,8 +94,7 @@ child_frame(graph->CreateFrameNodeAutoId(other_process.get(), page.get(), frame.get())) { - other_process->SetProcessWithPid(2, base::Process::Current(), - /* launch_time=*/base::TimeTicks::Now()); + other_process->SetProcessWithPid(3); } MockSinglePageWithMultipleProcessesGraph:: @@ -77,8 +107,7 @@ child_frame(graph->CreateFrameNodeAutoId(other_process.get(), other_page.get(), other_frame.get())) { - other_process->SetProcessWithPid(2, base::Process::Current(), - /* launch_time=*/base::TimeTicks::Now()); + other_process->SetProcessWithPid(3); } MockMultiplePagesWithMultipleProcessesGraph:: @@ -127,4 +156,16 @@ worker->RemoveClientFrame(frame.get()); } +MockUtilityAndMultipleRenderProcessesGraph:: + MockUtilityAndMultipleRenderProcessesGraph(TestGraphImpl* graph) + : MockMultiplePagesAndWorkersWithMultipleProcessesGraph(graph), + utility_process(TestNodeWrapper<TestProcessNodeImpl>::Create( + graph, + content::ProcessType::PROCESS_TYPE_UTILITY)) { + utility_process->SetProcessWithPid(4); +} + +MockUtilityAndMultipleRenderProcessesGraph:: + ~MockUtilityAndMultipleRenderProcessesGraph() = default; + } // namespace performance_manager
diff --git a/components/performance_manager/test_support/mock_graphs.h b/components/performance_manager/test_support/mock_graphs.h index c9eca6e..d4c61aec 100644 --- a/components/performance_manager/test_support/mock_graphs.h +++ b/components/performance_manager/test_support/mock_graphs.h
@@ -5,8 +5,12 @@ #ifndef COMPONENTS_PERFORMANCE_MANAGER_TEST_SUPPORT_MOCK_GRAPHS_H_ #define COMPONENTS_PERFORMANCE_MANAGER_TEST_SUPPORT_MOCK_GRAPHS_H_ +#include "base/process/process.h" +#include "base/process/process_handle.h" +#include "base/time/time.h" #include "components/performance_manager/graph/process_node_impl.h" #include "components/performance_manager/test_support/graph_test_harness.h" +#include "content/public/common/process_type.h" namespace performance_manager { @@ -18,28 +22,40 @@ // process' PID. class TestProcessNodeImpl : public ProcessNodeImpl { public: + // Default to creating a renderer process node. TestProcessNodeImpl(); + // Create a non-renderer child process node with the given `process_type`. + explicit TestProcessNodeImpl(content::ProcessType process_type); + + // Inherit the default constructors so that tests can create browser process + // nodes or assign explicit RenderProcessHostProxy or + // BrowserChildProcessHostProxy objects. + using ProcessNodeImpl::ProcessNodeImpl; + + // Assigns the given `pid`, `process` and `launch_time` to the process node. void SetProcessWithPid(base::ProcessId pid, - base::Process process, - base::TimeTicks launch_time); + base::Process process = base::Process::Current(), + base::TimeTicks launch_time = base::TimeTicks::Now()); }; // The following graph topology is created to emulate a scenario when a single // page executes in a single process: // -// Pr Pg +// Pr Pg BPr // \ / // F // // Where: // F: frame(frame_tree_id:0) -// Pr: process(pid:1) +// BPr: browser_process(pid:1) +// Pr: process(pid:2) // Pg: page struct MockSinglePageInSingleProcessGraph { explicit MockSinglePageInSingleProcessGraph(TestGraphImpl* graph); ~MockSinglePageInSingleProcessGraph(); TestNodeWrapper<SystemNodeImpl> system; + TestNodeWrapper<TestProcessNodeImpl> browser_process; TestNodeWrapper<TestProcessNodeImpl> process; TestNodeWrapper<PageNodeImpl> page; TestNodeWrapper<FrameNodeImpl> frame; @@ -48,7 +64,7 @@ // The following graph topology is created to emulate a scenario where multiple // pages are executing in a single process: // -// Pg Pr OPg +// Pg Pr OPg BPr // \ / \ / // F OF // @@ -57,7 +73,8 @@ // OF: other_frame(frame_tree_id:1) // Pg: page // OPg: other_page -// Pr: process(pid:1) +// BPr: browser_process(pid:1) +// Pr: process(pid:2) struct MockMultiplePagesInSingleProcessGraph : public MockSinglePageInSingleProcessGraph { explicit MockMultiplePagesInSingleProcessGraph(TestGraphImpl* graph); @@ -74,14 +91,15 @@ // |\ / // | F OPr // | \ / -// |__CF +// |__CF BPr // // Where: // F: frame(frame_tree_id:0) // CF: child_frame(frame_tree_id:2) // Pg: page -// Pr: process(pid:1) -// OPr: other_process(pid:2) +// BPr: browser_proces(pid:1) +// Pr: process(pid:2) +// OPr: other_process(pid:3) struct MockSinglePageWithMultipleProcessesGraph : public MockSinglePageInSingleProcessGraph { explicit MockSinglePageWithMultipleProcessesGraph(TestGraphImpl* graph); @@ -98,7 +116,7 @@ // \ / \ / | // F OF OPr | // \ / | -// CF___| +// BPr CF___| // // Where: // F: frame(frame_tree_id:0) @@ -106,8 +124,9 @@ // CF: child_frame(frame_tree_id:3) // Pg: page // OPg: other_page -// Pr: process(pid:1) -// OPr: other_process(pid:2) +// BPr: browser_process(pid:1) +// Pr: process(pid:2) +// OPr: other_process(pid:3) struct MockMultiplePagesWithMultipleProcessesGraph : public MockMultiplePagesInSingleProcessGraph { explicit MockMultiplePagesWithMultipleProcessesGraph(TestGraphImpl* graph); @@ -119,7 +138,7 @@ // The following graph topology is created to emulate a scenario where a page // contains a single frame that creates a single dedicated worker. // -// Pg Pr_ +// Pg Pr_ BPr // \ / | // F | // \ | @@ -129,7 +148,8 @@ // Pg: page // F: frame(frame_tree_id:0) // W: worker -// Pr: process(pid:1) +// BPr: browser_process(pid:1) +// Pr: process(pid:2) struct MockSinglePageWithFrameAndWorkerInSingleProcessGraph : public MockSinglePageInSingleProcessGraph { explicit MockSinglePageWithFrameAndWorkerInSingleProcessGraph( @@ -152,7 +172,7 @@ // \ | / | \ // Pr | OW // | / -// OPr +// BPr OPr // // Where: // Pg: page @@ -162,8 +182,9 @@ // CF: child_frame(frame_tree_id:3) // W: worker // OW: other_worker -// Pr: process(pid:1) -// OPr: other_process(pid:2) +// BPr: browser_process(pid:1) +// Pr: process(pid:2) +// OPr: other_process(pid:3) struct MockMultiplePagesAndWorkersWithMultipleProcessesGraph : public MockMultiplePagesWithMultipleProcessesGraph { explicit MockMultiplePagesAndWorkersWithMultipleProcessesGraph( @@ -173,6 +194,40 @@ TestNodeWrapper<WorkerNodeImpl> other_worker; }; +// The following graph topology is created to emulate a scenario where a utility +// process is running, plus multiple pages making use of workers are hosted in +// multiple renderer processes (e.g. out-of-process iFrames and multiple pages +// in a process): +// +// Pg OPg +// | | +// F OF +// /\ / \ +// W \ / CF +// \ | / | \ +// Pr | OW +// | / +// BPr OPr UPr +// +// Where: +// Pg: page +// OPg: other_page +// F: frame(frame_tree_id:0) +// OF: other_frame(frame_tree_id:1) +// CF: child_frame(frame_tree_id:3) +// W: worker +// OW: other_worker +// BPr: browser_process(pid:1) +// Pr: process(pid:2) +// OPr: other_process(pid:3) +// UPr: utility_process(pid:4) +struct MockUtilityAndMultipleRenderProcessesGraph + : public MockMultiplePagesAndWorkersWithMultipleProcessesGraph { + explicit MockUtilityAndMultipleRenderProcessesGraph(TestGraphImpl* graph); + ~MockUtilityAndMultipleRenderProcessesGraph(); + TestNodeWrapper<TestProcessNodeImpl> utility_process; +}; + } // namespace performance_manager #endif // COMPONENTS_PERFORMANCE_MANAGER_TEST_SUPPORT_MOCK_GRAPHS_H_
diff --git a/components/performance_manager/test_support/mock_graphs_unittest.cc b/components/performance_manager/test_support/mock_graphs_unittest.cc new file mode 100644 index 0000000..14575aa --- /dev/null +++ b/components/performance_manager/test_support/mock_graphs_unittest.cc
@@ -0,0 +1,70 @@ +// Copyright 2023 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/performance_manager/test_support/mock_graphs.h" + +#include "base/process/process_handle.h" +#include "components/performance_manager/graph/process_node_impl.h" +#include "components/performance_manager/public/browser_child_process_host_id.h" +#include "components/performance_manager/public/browser_child_process_host_proxy.h" +#include "components/performance_manager/public/graph/graph.h" +#include "components/performance_manager/public/render_process_host_id.h" +#include "components/performance_manager/public/render_process_host_proxy.h" +#include "components/performance_manager/test_support/graph_test_harness.h" +#include "components/performance_manager/test_support/mock_graphs.h" +#include "content/public/common/process_type.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace performance_manager { + +namespace { + +using MockGraphsTest = GraphTestHarness; + +TEST_F(MockGraphsTest, ProcessNodes) { + MockUtilityAndMultipleRenderProcessesGraph mock_graph(graph()); + + EXPECT_EQ(mock_graph.browser_process->process_type(), + content::ProcessType::PROCESS_TYPE_BROWSER); + EXPECT_EQ(mock_graph.process->process_type(), + content::ProcessType::PROCESS_TYPE_RENDERER); + EXPECT_EQ(mock_graph.other_process->process_type(), + content::ProcessType::PROCESS_TYPE_RENDERER); + EXPECT_EQ(mock_graph.utility_process->process_type(), + content::ProcessType::PROCESS_TYPE_UTILITY); + + // Make sure the ProcessNodes have the PID's documented in mock_graphs.h. + EXPECT_EQ(mock_graph.browser_process->process_id(), base::ProcessId(1)); + EXPECT_EQ(mock_graph.process->process_id(), base::ProcessId(2)); + EXPECT_EQ(mock_graph.other_process->process_id(), base::ProcessId(3)); + EXPECT_EQ(mock_graph.utility_process->process_id(), base::ProcessId(4)); + + // Make sure the ProcessNodes have valid RenderProcessHostId's or + // BrowserChildProcessHostId's. + const RenderProcessHostProxy& process_proxy = + mock_graph.process->render_process_host_proxy(); + const RenderProcessHostProxy& other_process_proxy = + mock_graph.other_process->render_process_host_proxy(); + const BrowserChildProcessHostProxy& utility_process_proxy = + mock_graph.utility_process->browser_child_process_host_proxy(); + EXPECT_FALSE(process_proxy.render_process_host_id().is_null()); + EXPECT_FALSE(other_process_proxy.render_process_host_id().is_null()); + EXPECT_NE(process_proxy.render_process_host_id(), + other_process_proxy.render_process_host_id()); + EXPECT_FALSE(utility_process_proxy.browser_child_process_host_id().is_null()); + + // Add a custom node to the graph. + const auto custom_process = TestNodeWrapper<TestProcessNodeImpl>::Create( + graph(), content::ProcessType::PROCESS_TYPE_GPU); + const BrowserChildProcessHostProxy& custom_process_proxy = + custom_process->browser_child_process_host_proxy(); + EXPECT_FALSE(custom_process_proxy.browser_child_process_host_id().is_null()); + EXPECT_NE(utility_process_proxy.browser_child_process_host_id(), + custom_process_proxy.browser_child_process_host_id()); +} + +} // namespace + +} // namespace performance_manager
diff --git a/components/plus_addresses/BUILD.gn b/components/plus_addresses/BUILD.gn index d19445f..86f822d 100644 --- a/components/plus_addresses/BUILD.gn +++ b/components/plus_addresses/BUILD.gn
@@ -4,6 +4,8 @@ source_set("plus_addresses") { sources = [ + "plus_address_client.cc", + "plus_address_client.h", "plus_address_service.cc", "plus_address_service.h", ] @@ -35,7 +37,10 @@ source_set("unit_tests") { testonly = true - sources = [ "plus_address_service_unittest.cc" ] + sources = [ + "plus_address_client_unittest.cc", + "plus_address_service_unittest.cc", + ] deps = [ ":features",
diff --git a/components/plus_addresses/features.cc b/components/plus_addresses/features.cc index b0a979d..485b2c1 100644 --- a/components/plus_addresses/features.cc +++ b/components/plus_addresses/features.cc
@@ -13,9 +13,13 @@ const char kEnterprisePlusAddressLabelOverrideName[] = "suggestion-label"; const char kEnterprisePlusAddressOAuthScopeName[] = "oauth-scope"; +const char kEnterprisePlusAddressServerUrlName[] = "server-url"; const base::FeatureParam<std::string> kEnterprisePlusAddressLabelOverride{ &kFeature, kEnterprisePlusAddressLabelOverrideName, "Lorem Ipsum"}; const base::FeatureParam<std::string> kEnterprisePlusAddressOAuthScope{ &kFeature, kEnterprisePlusAddressOAuthScopeName, ""}; +const base::FeatureParam<std::string> kEnterprisePlusAddressServerUrl{ + &kFeature, kEnterprisePlusAddressServerUrlName, ""}; + } // namespace plus_addresses
diff --git a/components/plus_addresses/features.h b/components/plus_addresses/features.h index 803a7cc..9d2cbed 100644 --- a/components/plus_addresses/features.h +++ b/components/plus_addresses/features.h
@@ -23,6 +23,11 @@ // Used to control the enterprise plus address feature's OAuth scope. COMPONENT_EXPORT(PLUS_ADDRESSES_FEATURES) extern const base::FeatureParam<std::string> kEnterprisePlusAddressOAuthScope; + +// The url that the enterprise uses to create plus addresses. Must be a valid +// GURL, such as `https://foo.example/`. +COMPONENT_EXPORT(PLUS_ADDRESSES_FEATURES) +extern const base::FeatureParam<std::string> kEnterprisePlusAddressServerUrl; } // namespace plus_addresses #endif // COMPONENTS_PLUS_ADDRESSES_FEATURES_H_
diff --git a/components/plus_addresses/plus_address_client.cc b/components/plus_addresses/plus_address_client.cc new file mode 100644 index 0000000..f9e01ae --- /dev/null +++ b/components/plus_addresses/plus_address_client.cc
@@ -0,0 +1,22 @@ +// Copyright 2023 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/plus_addresses/plus_address_client.h" +#include "components/plus_addresses/features.h" +#include "url/gurl.h" + +namespace plus_addresses { + +namespace { +absl::optional<GURL> ValidateAndGetUrl() { + GURL maybe_url = GURL(kEnterprisePlusAddressServerUrl.Get()); + return maybe_url.is_valid() ? absl::make_optional(maybe_url) : absl::nullopt; +} +} // namespace + +PlusAddressClient::PlusAddressClient() : server_url_(ValidateAndGetUrl()) {} + +PlusAddressClient::~PlusAddressClient() = default; + +} // namespace plus_addresses
diff --git a/components/plus_addresses/plus_address_client.h b/components/plus_addresses/plus_address_client.h new file mode 100644 index 0000000..6c55ed6b6 --- /dev/null +++ b/components/plus_addresses/plus_address_client.h
@@ -0,0 +1,27 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_CLIENT_H_ +#define COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_CLIENT_H_ + +#include "third_party/abseil-cpp/absl/types/optional.h" +#include "url/gurl.h" + +namespace plus_addresses { + +// Responsible for communicating with a remote plus-address server. +class PlusAddressClient { + public: + PlusAddressClient(); + ~PlusAddressClient(); + + absl::optional<GURL> GetServerUrlForTesting() const { return server_url_; } + + private: + const absl::optional<GURL> server_url_; +}; + +} // namespace plus_addresses + +#endif // COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_CLIENT_H_
diff --git a/components/plus_addresses/plus_address_client_unittest.cc b/components/plus_addresses/plus_address_client_unittest.cc new file mode 100644 index 0000000..694519a --- /dev/null +++ b/components/plus_addresses/plus_address_client_unittest.cc
@@ -0,0 +1,30 @@ +// Copyright 2023 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/plus_addresses/plus_address_client.h" + +#include "base/test/scoped_feature_list.h" +#include "components/plus_addresses/features.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace plus_addresses { +TEST(PlusAddressClientTest, ChecksUrlParamIsValidGurl) { + std::string server_url = "https://foo.com/"; + base::test::ScopedFeatureList feature; + feature.InitAndEnableFeatureWithParameters( + kFeature, {{kEnterprisePlusAddressServerUrl.name, server_url}}); + PlusAddressClient client; + ASSERT_TRUE(client.GetServerUrlForTesting().has_value()); + EXPECT_EQ(client.GetServerUrlForTesting().value(), server_url); +} + +TEST(PlusAddressClientTest, RejectsNonUrlStrings) { + base::test::ScopedFeatureList feature; + feature.InitAndEnableFeatureWithParameters( + kFeature, {{kEnterprisePlusAddressServerUrl.name, "kirubeldotcom"}}); + PlusAddressClient client; + EXPECT_FALSE(client.GetServerUrlForTesting().has_value()); +} + +} // namespace plus_addresses
diff --git a/components/plus_addresses/plus_address_service.cc b/components/plus_addresses/plus_address_service.cc index 01c6d02..e0ec5496 100644 --- a/components/plus_addresses/plus_address_service.cc +++ b/components/plus_addresses/plus_address_service.cc
@@ -100,7 +100,7 @@ } void PlusAddressService::OfferPlusAddressCreation( - url::Origin origin, + const url::Origin& origin, PlusAddressCallback callback) { if (!identity_manager_ || !identity_manager_->HasPrimaryAccount(signin::ConsentLevel::kSignin)) {
diff --git a/components/plus_addresses/plus_address_service.h b/components/plus_addresses/plus_address_service.h index 601b3c98..971f88f 100644 --- a/components/plus_addresses/plus_address_service.h +++ b/components/plus_addresses/plus_address_service.h
@@ -9,6 +9,7 @@ #include <unordered_set> #include "base/functional/callback_forward.h" #include "components/keyed_service/core/keyed_service.h" +#include "components/plus_addresses/plus_address_client.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "url/origin.h" @@ -54,16 +55,10 @@ // Check whether the passed-in string is a known plus address. bool IsPlusAddress(std::string potential_plus_address); - // Eventually, will orchestrate UI elements to inform the user of the plus - // address being created on their behalf, calling `PlusAddressCallback` on - // confirmation. For now, however, simply generates a fake plus address and - // runs `callback` with it immediately. - // Virtual to allow overriding the behavior in tests. This is a - // future-proofing mechanism for when UI elements (and possibly other side - // effects) are added. This way, the tests external to this directory can stay - // the same. - virtual void OfferPlusAddressCreation(url::Origin origin, - PlusAddressCallback callback); + // For now, simply generates a fake plus address and runs `callback` with it + // immediately. + void OfferPlusAddressCreation(const url::Origin& origin, + PlusAddressCallback callback); // The label for an autofill suggestion offering to create a new plus address. // While only debatably relevant to this class, this function allows for @@ -81,6 +76,9 @@ // Stores pointer to IdentityManager instance. It must outlive the // PlusAddressService and can be null during tests. const raw_ptr<signin::IdentityManager> identity_manager_; + + // Handles requests to a remote server that this service uses. + const PlusAddressClient plus_address_client_; }; } // namespace plus_addresses
diff --git a/components/policy/core/common/cloud/encrypted_reporting_job_configuration.cc b/components/policy/core/common/cloud/encrypted_reporting_job_configuration.cc index 3dce73e..766b8f4 100644 --- a/components/policy/core/common/cloud/encrypted_reporting_job_configuration.cc +++ b/components/policy/core/common/cloud/encrypted_reporting_job_configuration.cc
@@ -24,6 +24,7 @@ constexpr char kSequenceId[] = "sequencingId"; constexpr char kGenerationId[] = "generationId"; constexpr char kPriority[] = "priority"; +constexpr char kAttachConfigurationFileKey[] = "attachConfigurationFile"; constexpr char kAttachEncryptionSettingsKey[] = "attachEncryptionSettings"; constexpr char kDeviceKey[] = "device"; constexpr char kBrowserKey[] = "browser"; @@ -321,8 +322,12 @@ std::set<std::string> EncryptedReportingJobConfiguration::GetTopLevelKeyAllowList() { static std::set<std::string> kTopLevelKeyAllowList{ - kEncryptedRecordListKey, kAttachEncryptionSettingsKey, kDeviceKey, - kBrowserKey, kRequestId}; + kAttachConfigurationFileKey, + kAttachEncryptionSettingsKey, + kBrowserKey, + kDeviceKey, + kEncryptedRecordListKey, + kRequestId}; return kTopLevelKeyAllowList; }
diff --git a/components/policy/core/common/cloud/encrypted_reporting_job_configuration.h b/components/policy/core/common/cloud/encrypted_reporting_job_configuration.h index e7f0e71a..dc043e37 100644 --- a/components/policy/core/common/cloud/encrypted_reporting_job_configuration.h +++ b/components/policy/core/common/cloud/encrypted_reporting_job_configuration.h
@@ -57,6 +57,7 @@ // } // ], // "attachEncryptionSettings": true, // optional field +// "attachConfigurationFile": true, // optional field // "requestId": "SomeString", // "device": { // "client_id": "abcdef1234",
diff --git a/components/policy/core/common/cloud/encrypted_reporting_job_configuration_unittest.cc b/components/policy/core/common/cloud/encrypted_reporting_job_configuration_unittest.cc index 980c5ca..cddd873 100644 --- a/components/policy/core/common/cloud/encrypted_reporting_job_configuration_unittest.cc +++ b/components/policy/core/common/cloud/encrypted_reporting_job_configuration_unittest.cc
@@ -63,6 +63,9 @@ // Encryption settings request key constexpr char kAttachEncryptionSettingsKey[] = "attachEncryptionSettings"; +// Configuration file request key +constexpr char kAttachConfigurationFileKey[] = "attachConfigurationFile"; + // Keys for EncryptedRecord constexpr char kEncryptedWrappedRecordKey[] = "encryptedWrappedRecord"; constexpr char kSequenceInformationKey[] = "sequenceInformation"; @@ -96,10 +99,14 @@ class RequestPayloadBuilder { public: - explicit RequestPayloadBuilder(bool attach_encryption_settings = false) { + explicit RequestPayloadBuilder(bool attach_encryption_settings = false, + bool attach_configuration_file = false) { if (attach_encryption_settings) { payload_.Set(kAttachEncryptionSettingsKey, true); } + if (attach_configuration_file) { + payload_.Set(kAttachConfigurationFileKey, true); + } payload_.Set(kEncryptedRecordListKey, base::Value::List()); } @@ -270,6 +277,15 @@ ASSERT_TRUE(*record_list); } + bool GetAttachConfigurationFile( + EncryptedReportingJobConfiguration* configuration) { + base::Value* const payload = GetPayload(configuration); + const auto attach_configuration_file = + payload->GetDict().FindBool(kAttachConfigurationFileKey); + return attach_configuration_file.has_value() && + attach_configuration_file.value(); + } + bool GetAttachEncryptionSettings( EncryptedReportingJobConfiguration* configuration) { base::Value* const payload = GetPayload(configuration); @@ -512,6 +528,79 @@ EXPECT_TRUE(GetAttachEncryptionSettings(&configuration)); } +TEST_F(EncryptedReportingJobConfigurationTest, + AllowsAttachConfigurationFileAlone) { + RequestPayloadBuilder builder{/*attach_encryption_settings=*/false, + /*attach_configuration_file=*/true}; + StrictMock<MockCompleteCb> completion_cb; + EXPECT_CALL(completion_cb, Call(_, _, _, _)).Times(1); + EncryptedReportingJobConfiguration configuration( + shared_url_loader_factory_, DMAuth::FromDMToken(client_.dm_token()), + kServerUrl, builder.Build(), &client_, + base::BindOnce(&MockCompleteCb::Call, base::Unretained(&completion_cb))); + + base::Value::List* record_list = nullptr; + GetRecordList(&configuration, &record_list); + + EXPECT_TRUE(record_list->empty()); + + EXPECT_TRUE(GetAttachConfigurationFile(&configuration)); +} + +TEST_F(EncryptedReportingJobConfigurationTest, + AllowsAttachConfigurationFileAndEncryptionSettingsWithoutRecords) { + RequestPayloadBuilder builder{/*attach_encryption_settings=*/true, + /*attach_configuration_file=*/true}; + StrictMock<MockCompleteCb> completion_cb; + EXPECT_CALL(completion_cb, Call(_, _, _, _)).Times(1); + EncryptedReportingJobConfiguration configuration( + shared_url_loader_factory_, DMAuth::FromDMToken(client_.dm_token()), + kServerUrl, builder.Build(), &client_, + base::BindOnce(&MockCompleteCb::Call, base::Unretained(&completion_cb))); + + base::Value::List* record_list = nullptr; + GetRecordList(&configuration, &record_list); + + EXPECT_TRUE(record_list->empty()); + + EXPECT_TRUE(GetAttachEncryptionSettings(&configuration)); + EXPECT_TRUE(GetAttachConfigurationFile(&configuration)); +} + +TEST_F( + EncryptedReportingJobConfigurationTest, + CorrectlyAddsMultipleRecordsWithAttachConfigurationFileAndAttachEncryptionKey) { + const std::vector<std::string> kEncryptedWrappedRecords{ + "T", "E", "S", "T", "_", "I", "N", "F", "O"}; + base::Value::List records; + RequestPayloadBuilder builder{/*attach_encryption_settings=*/true, + /*attach_configuration_file=*/true}; + for (auto value : kEncryptedWrappedRecords) { + records.Append(GenerateSingleRecord(value)); + builder.AddRecord(records.back()); + } + + StrictMock<MockCompleteCb> completion_cb; + EXPECT_CALL(completion_cb, Call(_, _, _, _)).Times(1); + EncryptedReportingJobConfiguration configuration( + shared_url_loader_factory_, DMAuth::FromDMToken(client_.dm_token()), + kServerUrl, builder.Build(), &client_, + base::BindOnce(&MockCompleteCb::Call, base::Unretained(&completion_cb))); + + base::Value::List* record_list = nullptr; + GetRecordList(&configuration, &record_list); + + EXPECT_EQ(record_list->size(), records.size()); + + size_t counter = 0; + for (const auto& record : records) { + EXPECT_EQ((*record_list)[counter++], record); + } + + EXPECT_TRUE(GetAttachEncryptionSettings(&configuration)); + EXPECT_TRUE(GetAttachConfigurationFile(&configuration)); +} + // Ensures that the context can be updated. TEST_F(EncryptedReportingJobConfigurationTest, CorrectlyAddsAndUpdatesContext) { StrictMock<MockCompleteCb> completion_cb; @@ -777,6 +866,7 @@ base::Value::Dict request; request.Set(kEncryptedRecordListKey, base::Value::List()); + request.Set(kAttachConfigurationFileKey, true); request.Set(kAttachEncryptionSettingsKey, true); request.Set(kDeviceKey, base::Value::Dict()); request.Set(kBrowserKey, base::Value::Dict()); @@ -794,6 +884,7 @@ ASSERT_TRUE(payload->is_dict()); EXPECT_TRUE(payload->GetDict().FindList(kEncryptedRecordListKey)); EXPECT_TRUE(payload->GetDict().FindBool(kAttachEncryptionSettingsKey)); + EXPECT_TRUE(payload->GetDict().FindBool(kAttachConfigurationFileKey)); EXPECT_TRUE(payload->GetDict().FindDict(kDeviceKey)); EXPECT_TRUE(payload->GetDict().FindDict(kBrowserKey)); EXPECT_FALSE(payload->GetDict().FindDict(kInvalidKey));
diff --git a/components/policy/resources/templates/policies.yaml b/components/policy/resources/templates/policies.yaml index b3751245..0223faf 100644 --- a/components/policy/resources/templates/policies.yaml +++ b/components/policy/resources/templates/policies.yaml
@@ -1098,7 +1098,7 @@ 1097: DeviceReportNetworkEvents 1098: SafeBrowsingExtensionProtectionAllowed 1099: ShowDisplaySizeScreenEnabled - 1100: AnonymousSearchEnabled + 1100: EssentialSearchEnabled 1101: LegacyTechReportAllowlist 1102: ReportAppInventory 1103: ReportAppUsage
diff --git a/components/policy/resources/templates/policy_definitions/Miscellaneous/AnonymousSearchEnabled.yaml b/components/policy/resources/templates/policy_definitions/Miscellaneous/AnonymousSearchEnabled.yaml deleted file mode 100644 index ba19a90..0000000 --- a/components/policy/resources/templates/policy_definitions/Miscellaneous/AnonymousSearchEnabled.yaml +++ /dev/null
@@ -1,25 +0,0 @@ -caption: Enable search in a anonymous mode -default: false -desc: |- - This policy lets admins control how Google processes user data sent to Search through <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph> features. - When the policy is enabled, the user will be able to use the <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph> Launcher search box, and the <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> Browser address box in <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph>, such that the user's search history won't be linked to their identity. - When the policy is unset or disabled, the user's data from these searches will be linked to their identity. -example_value: false -features: - dynamic_refresh: true - per_profile: true -future_on: -- chrome_os -items: -- caption: Use search in anonymous mode. - value: true -- caption: Use search in non-anonymous mode. - value: false -owners: -- ayag@chromium.org -- mohammedabdon@chromium.org -- dp-chromeos-eng@google.com -schema: - type: boolean -tags: [] -type: main \ No newline at end of file
diff --git a/components/policy/resources/templates/policy_definitions/Miscellaneous/EssentialSearchEnabled.yaml b/components/policy/resources/templates/policy_definitions/Miscellaneous/EssentialSearchEnabled.yaml new file mode 100644 index 0000000..19b9fbc --- /dev/null +++ b/components/policy/resources/templates/policy_definitions/Miscellaneous/EssentialSearchEnabled.yaml
@@ -0,0 +1,25 @@ +caption: Enable only essential cookies and data in search +default: false +desc: |- + This policy lets admins control how Google processes cookies and data sent to Search through <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph>. + When the policy is enabled, the user will be able to use the <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph> Launcher search box, and the <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> Browser address box in <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph>, the cookies and data may be used only for essential purposes. + When the policy is unset or disabled, the cookies and data may be used for non-essential purposes. +example_value: false +features: + dynamic_refresh: true + per_profile: true +future_on: +- chrome_os +items: +- caption: Use only essential cookies and data in search. + value: true +- caption: Use essential and non-essential cookies in search. + value: false +owners: +- ayag@chromium.org +- mohammedabdon@chromium.org +- dp-chromeos-eng@google.com +schema: + type: boolean +tags: [] +type: main \ No newline at end of file
diff --git a/components/policy/test/data/policy_test_cases.json b/components/policy/test/data/policy_test_cases.json index 67ab66736..8f3b301 100644 --- a/components/policy/test/data/policy_test_cases.json +++ b/components/policy/test/data/policy_test_cases.json
@@ -23553,7 +23553,7 @@ } ] }, - "AnonymousSearchEnabled": { + "EssentialSearchEnabled": { "reason_for_missing_test": "TODO(b/275929724): Feature not yet implemented" }, "ReportAppInventory": {
diff --git a/components/sync/engine/model_type_worker.cc b/components/sync/engine/model_type_worker.cc index 06b83d7..4816ff9 100644 --- a/components/sync/engine/model_type_worker.cc +++ b/components/sync/engine/model_type_worker.cc
@@ -596,6 +596,12 @@ } specifics_were_encrypted = true; } else if (specifics.has_incoming_password_sharing_invitation()) { + // IncomingPasswordSharingInvitationSpecifics contains a mix of encrypted + // and unencrypted fields. We start by copying over everything to make sure + // all unecrypted fields are carried over to the UpdateResponseData, and + // then decrypt the encrypted part. + *data.specifics.mutable_incoming_password_sharing_invitation() = + specifics.incoming_password_sharing_invitation(); // Password sharing invitations use their own encryption scheme. // DECRYPTION_PENDING is not used for sharing invitations since the password // should be encrypted using recipient's public key (i.e. it's committed to @@ -606,6 +612,8 @@ ->mutable_client_only_unencrypted_data())) { return FAILED_TO_DECRYPT; } + data.specifics.mutable_incoming_password_sharing_invitation() + ->clear_encrypted_password_sharing_invitation_data(); } else if (specifics.has_encrypted()) { DCHECK(!update_entity.deleted()) << "Tombstones shouldn't be encrypted"; if (!cryptographer.CanDecrypt(specifics.encrypted())) {
diff --git a/components/sync/engine/model_type_worker_unittest.cc b/components/sync/engine/model_type_worker_unittest.cc index 5de0ad1..9f4eff3 100644 --- a/components/sync/engine/model_type_worker_unittest.cc +++ b/components/sync/engine/model_type_worker_unittest.cc
@@ -30,6 +30,7 @@ #include "components/sync/protocol/autofill_specifics.pb.h" #include "components/sync/protocol/entity_specifics.pb.h" #include "components/sync/protocol/model_type_state.pb.h" +#include "components/sync/protocol/password_sharing_invitation_specifics.pb.h" #include "components/sync/protocol/password_specifics.pb.h" #include "components/sync/protocol/sync.pb.h" #include "components/sync/protocol/sync_entity.pb.h" @@ -97,9 +98,27 @@ return output; } -sync_pb::EntitySpecifics EncryptIncomingPasswordSharingInvitation( - const sync_pb::PasswordSharingInvitationData& password_data, - FakeCryptographer* cryptographer) { +sync_pb::IncomingPasswordSharingInvitationSpecifics +CreateIncomingPasswordSharingInvitation(const std::string& invitation_guid, + const std::string& signon_realm, + const std::string& username_value, + const std::string& password_value, + const std::string& sender_name, + uint32_t recipient_key_version, + FakeCryptographer* cryptographer) { + sync_pb::IncomingPasswordSharingInvitationSpecifics invitation; + // Set the unencrypted fields: + invitation.set_guid(invitation_guid); + invitation.set_recipient_key_version(recipient_key_version); + invitation.mutable_sender_info() + ->mutable_user_display_info() + ->set_display_name(sender_name); + + // Set the encrypted fields and the encryption key version: + sync_pb::PasswordSharingInvitationData password_data; + password_data.mutable_password_data()->set_signon_realm(signon_realm); + password_data.mutable_password_data()->set_username_value(username_value); + password_data.mutable_password_data()->set_password_value(password_value); std::string serialized_data; bool success = password_data.SerializeToString(&serialized_data); CHECK(success); @@ -112,15 +131,12 @@ key_pair.GetRawPublicKey()); CHECK(encrypted_data); - sync_pb::EntitySpecifics encrypted_specifics; - encrypted_specifics.mutable_incoming_password_sharing_invitation() - ->set_encrypted_password_sharing_invitation_data(encrypted_data->data(), - encrypted_data->size()); - encrypted_specifics.mutable_incoming_password_sharing_invitation() - ->mutable_sender_info() + invitation.set_encrypted_password_sharing_invitation_data( + encrypted_data->data(), encrypted_data->size()); + invitation.mutable_sender_info() ->mutable_cross_user_sharing_public_key() ->CopyFrom(PublicKeyToProto(key_pair, /*version=*/0)); - return encrypted_specifics; + return invitation; } ClientTagHash GeneratePreferenceTagHash(const std::string& tag) { @@ -3075,17 +3091,24 @@ TEST_F(ModelTypeWorkerIncomingPasswordSharingInvitationTest, ShouldDecryptIncomingPasswordSharingInvitation) { + const std::string kSignonRealm = "http://www.example.com"; + const std::string kUsernameValue = "good username"; + const std::string kPasswordValue = "very strong password"; + const std::string kInvitationGUID = "some guid"; + const std::string kSenderName = "Sender Name"; + const uint32_t kRecipientKeyVersion = 0; NormalInitialize(); - sync_pb::PasswordSharingInvitationData password_data; - password_data.mutable_password_data()->set_signon_realm("signon_realm"); - password_data.mutable_password_data()->set_password_value("password"); - sync_pb::EntitySpecifics encrypted_specifics = - EncryptIncomingPasswordSharingInvitation(password_data, cryptographer()); + sync_pb::EntitySpecifics invitation_with_encrypted_data; + *invitation_with_encrypted_data + .mutable_incoming_password_sharing_invitation() = + CreateIncomingPasswordSharingInvitation( + kInvitationGUID, kSignonRealm, kUsernameValue, kPasswordValue, + kSenderName, kRecipientKeyVersion, cryptographer()); // Receive an encrypted password sharing invitation. SyncEntity entity = server()->UpdateFromServer( - /*version_offset=*/10, kHash1, encrypted_specifics); + /*version_offset=*/10, kHash1, invitation_with_encrypted_data); worker()->ProcessGetUpdatesResponse(server()->GetProgress(), server()->GetContext(), {&entity}, status_controller()); @@ -3094,31 +3117,47 @@ ASSERT_TRUE(processor()->HasUpdateResponse(kHash1)); const UpdateResponseData& update = processor()->GetUpdateResponse(kHash1); - // The data should have been decrypted by the worker. + // The encrypted fields should have been decrypted by the worker, and + // unencrypted fields should have been carried over. EXPECT_FALSE(update.entity.specifics.incoming_password_sharing_invitation() .has_encrypted_password_sharing_invitation_data()); EXPECT_FALSE(update.entity.specifics.has_encrypted()); - EXPECT_TRUE(update.entity.specifics.incoming_password_sharing_invitation() - .has_client_only_unencrypted_data()); + const sync_pb::IncomingPasswordSharingInvitationSpecifics& + invitation_with_unencrypted_data = + update.entity.specifics.incoming_password_sharing_invitation(); + EXPECT_EQ(invitation_with_unencrypted_data.guid(), kInvitationGUID); + EXPECT_EQ(invitation_with_unencrypted_data.recipient_key_version(), + kRecipientKeyVersion); + EXPECT_EQ(invitation_with_unencrypted_data.sender_info() + .user_display_info() + .display_name(), + kSenderName); + EXPECT_TRUE( + invitation_with_unencrypted_data.has_client_only_unencrypted_data()); const sync_pb::PasswordSharingInvitationData& received_password_data = - update.entity.specifics.incoming_password_sharing_invitation() - .client_only_unencrypted_data(); + invitation_with_unencrypted_data.client_only_unencrypted_data(); + EXPECT_EQ(received_password_data.password_data().username_value(), + kUsernameValue); EXPECT_EQ(received_password_data.password_data().password_value(), - "password"); + kPasswordValue); EXPECT_EQ(received_password_data.password_data().signon_realm(), - "signon_realm"); + kSignonRealm); } TEST_F(ModelTypeWorkerIncomingPasswordSharingInvitationTest, ShouldIgnoreCorruptedInvitation) { NormalInitialize(); - sync_pb::EntitySpecifics encrypted_specifics = - EncryptIncomingPasswordSharingInvitation( - sync_pb::PasswordSharingInvitationData(), cryptographer()); - encrypted_specifics.mutable_incoming_password_sharing_invitation() - ->set_encrypted_password_sharing_invitation_data("corrupted blob"); + sync_pb::IncomingPasswordSharingInvitationSpecifics invitation = + CreateIncomingPasswordSharingInvitation( + "guid", "signon_realm", "username_value", "password_value", + "sender_name", /*recipient_key_version=*/0, cryptographer()); + invitation.set_encrypted_password_sharing_invitation_data("corrupted blob"); + + sync_pb::EntitySpecifics encrypted_specifics; + *encrypted_specifics.mutable_incoming_password_sharing_invitation() = + invitation; // Receive an invalid encrypted password sharing invitation. SyncEntity entity = server()->UpdateFromServer(
diff --git a/components/variations/cros_evaluate_seed/BUILD.gn b/components/variations/cros_evaluate_seed/BUILD.gn index 7842c0a..8b7900d 100644 --- a/components/variations/cros_evaluate_seed/BUILD.gn +++ b/components/variations/cros_evaluate_seed/BUILD.gn
@@ -19,6 +19,8 @@ "cros_safe_seed_manager.h", "cros_variations_field_trial_creator.cc", "cros_variations_field_trial_creator.h", + "early_boot_seed_store.cc", + "early_boot_seed_store.h", "evaluate_seed.cc", "evaluate_seed.h", ] @@ -41,6 +43,7 @@ testonly = true sources = [ "cros_safe_seed_manager_unittest.cc", + "early_boot_seed_store_unittest.cc", "evaluate_seed_unittest.cc", ] deps = [ @@ -50,6 +53,7 @@ "//build:branding_buildflags", "//build/config/chromebox_for_meetings:buildflags", "//chromeos/ash/components/dbus/featured:proto", + "//components/prefs:test_support", "//components/test:test_support", "//components/variations", "//components/variations/service:service",
diff --git a/components/variations/cros_evaluate_seed/README.md b/components/variations/cros_evaluate_seed/README.md index e03ef734..7729a288 100644 --- a/components/variations/cros_evaluate_seed/README.md +++ b/components/variations/cros_evaluate_seed/README.md
@@ -12,16 +12,23 @@ experiment. It lives here so that it is trivial to keep the code in sync between ChromeOS's platform layer and chrome. -It will be built alongside ash, and use the same seed it uses in `Local State` -in normal operation. +It will be built alongside ash. It will be executed primarily by `featured`, which lives in `//platform2/featured/`. -In safe seed cases, the **platform** code (featured) will determine whether to -use the safe (or null) seed, and pass that information along with the value of -the safe seed to use along to this code. - `evaluate_seed` will write a serialized version of the computed state to stdout, along with a representation of the seed used for computation (for purposes of determining whether the seed can be marked as "safe"). + +## Seed usage + +When the device starts up, `featured` will exec `evaluate_seed`, which will by +default use whatever the latest seed in `/home/chronos/Local State` is. The +state computed by `evaluate_seed` will be cached in a tmpfs until the next +reboot, so even if ash later downloads and applies different seeds, +`evaluate_seed` will not re-evaluate the seed until the next device reboot. + +For disaster recovery, featured will determine whether to use the safe (or null) +seed, and pass that information along with the value of the safe seed to use +along to `evaluate_seed`.
diff --git a/components/variations/cros_evaluate_seed/early_boot_seed_store.cc b/components/variations/cros_evaluate_seed/early_boot_seed_store.cc new file mode 100644 index 0000000..fcd8e75 --- /dev/null +++ b/components/variations/cros_evaluate_seed/early_boot_seed_store.cc
@@ -0,0 +1,45 @@ +// Copyright 2023 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/variations/cros_evaluate_seed/early_boot_seed_store.h" + +#include "base/logging.h" +#include "base/time/time.h" +#include "components/variations/client_filterable_state.h" +#include "third_party/abseil-cpp/absl/types/optional.h" + +namespace variations::cros_early_boot::evaluate_seed { + +EarlyBootSeedStore::EarlyBootSeedStore( + PrefService* local_state, + const absl::optional<featured::SeedDetails>& safe_seed_details) + : VariationsSeedStore(local_state), safe_seed_details_(safe_seed_details) {} + +EarlyBootSeedStore::~EarlyBootSeedStore() = default; + +bool EarlyBootSeedStore::LoadSafeSeed(VariationsSeed* seed, + ClientFilterableState* client_state) { + // We require that evaluate_seed's command line specified a safe seed in order + // to use the safe seed. + CHECK(safe_seed_details_.has_value()); + absl::optional<VerifySignatureResult> verify_signature_result; + if (VerifyAndParseSeed(seed, safe_seed_details_->compressed_data(), + safe_seed_details_->signature(), + &verify_signature_result) != + LoadSeedResult::kSuccess) { + return false; + } + + client_state->reference_date = + base::Time::FromJavaTime(safe_seed_details_->date()); + client_state->locale = safe_seed_details_->locale(); + client_state->permanent_consistency_country = + safe_seed_details_->permanent_consistency_country(); + client_state->session_consistency_country = + safe_seed_details_->session_consistency_country(); + + return true; +} + +} // namespace variations::cros_early_boot::evaluate_seed
diff --git a/components/variations/cros_evaluate_seed/early_boot_seed_store.h b/components/variations/cros_evaluate_seed/early_boot_seed_store.h new file mode 100644 index 0000000..8e2c39a --- /dev/null +++ b/components/variations/cros_evaluate_seed/early_boot_seed_store.h
@@ -0,0 +1,51 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VARIATIONS_CROS_EVALUATE_SEED_EARLY_BOOT_SEED_STORE_H_ +#define COMPONENTS_VARIATIONS_CROS_EVALUATE_SEED_EARLY_BOOT_SEED_STORE_H_ + +#include "base/time/time.h" +#include "chromeos/ash/components/dbus/featured/featured.pb.h" +#include "components/variations/client_filterable_state.h" +#include "components/variations/proto/variations_seed.pb.h" +#include "components/variations/variations_seed_store.h" + +class PrefService; + +namespace variations::cros_early_boot::evaluate_seed { + +// VariationsSeedStore that uses a safe seed specific to early-boot ChromeOS. +// +// While early-boot experiments share a seed with non-early-boot experiments and +// use the same code to load them from |local_state|, they do *not* share a safe +// seed, since a seed could be safe for Chromium without being safe for +// early-boot ChromeOS. +class EarlyBootSeedStore : public VariationsSeedStore { + public: + // Construct an EarlyBootSeedStore, using |local_state| for the normal + // seed and |safe_seed_details| (which may be nullopt if we are not in safe + // seed mode) for the safe seed. + EarlyBootSeedStore( + PrefService* local_state, + const absl::optional<featured::SeedDetails>& safe_seed_details); + + EarlyBootSeedStore(const EarlyBootSeedStore&) = delete; + EarlyBootSeedStore& operator=(const EarlyBootSeedStore&) = delete; + + ~EarlyBootSeedStore() override; + + // Populate the given |seed| and |client_state| with the safe seed state as + // specified in the constructor. + // Unlike the base class version, DOES NOT modify local state or have any side + // effects. + bool LoadSafeSeed(VariationsSeed* seed, + ClientFilterableState* client_state) override; + + private: + const absl::optional<featured::SeedDetails> safe_seed_details_; +}; + +} // namespace variations::cros_early_boot::evaluate_seed + +#endif // COMPONENTS_VARIATIONS_CROS_EVALUATE_SEED_EARLY_BOOT_SEED_STORE_H_
diff --git a/components/variations/cros_evaluate_seed/early_boot_seed_store_unittest.cc b/components/variations/cros_evaluate_seed/early_boot_seed_store_unittest.cc new file mode 100644 index 0000000..b5578108 --- /dev/null +++ b/components/variations/cros_evaluate_seed/early_boot_seed_store_unittest.cc
@@ -0,0 +1,124 @@ +// Copyright 2023 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/variations/cros_evaluate_seed/early_boot_seed_store.h" + +#include <string> + +#include "base/test/scoped_command_line.h" +#include "base/time/time.h" +#include "chromeos/ash/components/dbus/featured/featured.pb.h" +#include "components/prefs/testing_pref_service.h" +#include "components/variations/client_filterable_state.h" +#include "components/variations/proto/variations_seed.pb.h" +#include "components/variations/variations_switches.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace variations::cros_early_boot::evaluate_seed { + +namespace { + +MATCHER_P(EqualsProto, + message, + "Match a proto Message equal to the matcher's argument.") { + std::string expected_serialized, actual_serialized; + message.SerializeToString(&expected_serialized); + arg.SerializeToString(&actual_serialized); + return expected_serialized == actual_serialized; +} + +// Populates |seed| with simple test data. The resulting seed will contain one +// study called "test", which contains one experiment called "abc" with +// probability weight 100. +VariationsSeed CreateTestSeed() { + VariationsSeed seed; + Study* study = seed.add_study(); + study->set_name("test"); + study->set_default_experiment_name("abc"); + Study_Experiment* experiment = study->add_experiment(); + experiment->set_name("abc"); + experiment->set_probability_weight(100); + seed.set_serial_number("123"); + return seed; +} + +TEST(EarlyBootSeedStoreTest, LoadSafeSeed) { + const VariationsSeed safe_seed = CreateTestSeed(); + + featured::SeedDetails safe_seed_details; + safe_seed_details.set_date(123456789); + safe_seed_details.set_locale("xx-YY"); + safe_seed_details.set_permanent_consistency_country("us"); + safe_seed_details.set_session_consistency_country("ca"); + + std::string serialized_seed; + ASSERT_TRUE(safe_seed.SerializeToString(&serialized_seed)); + safe_seed_details.set_compressed_data(serialized_seed); + + TestingPrefServiceSimple prefs; + VariationsSeedStore::RegisterPrefs(prefs.registry()); + + // Allow empty signature. + base::test::ScopedCommandLine scoped_command_line; + scoped_command_line.GetProcessCommandLine()->AppendSwitch( + switches::kAcceptEmptySeedSignatureForTesting); + + EarlyBootSeedStore store(&prefs, safe_seed_details); + + VariationsSeed actual_seed; + ClientFilterableState actual_client_state( + /*is_enterprise_function=*/base::BindOnce([] { return false; }), + /*google_groups_function=*/base::BindOnce( + [] { return base::flat_set<uint64_t>(); })); + EXPECT_TRUE(store.LoadSafeSeed(&actual_seed, &actual_client_state)); + + EXPECT_THAT(actual_seed, EqualsProto(safe_seed)); + EXPECT_EQ(base::Time::FromJavaTime(safe_seed_details.date()), + actual_client_state.reference_date); + EXPECT_EQ(safe_seed_details.locale(), actual_client_state.locale); + EXPECT_EQ(safe_seed_details.permanent_consistency_country(), + actual_client_state.permanent_consistency_country); + EXPECT_EQ(safe_seed_details.session_consistency_country(), + actual_client_state.session_consistency_country); +} + +TEST(EarlyBootSeedStoreTest, LoadSafeSeed_Unspecified) { + TestingPrefServiceSimple prefs; + VariationsSeedStore::RegisterPrefs(prefs.registry()); + + EarlyBootSeedStore store(&prefs, absl::nullopt); + VariationsSeed actual_seed; + ClientFilterableState actual_client_state( + /*is_enterprise_function=*/base::BindOnce([] { return false; }), + /*google_groups_function=*/base::BindOnce( + [] { return base::flat_set<uint64_t>(); })); + EXPECT_DEATH(store.LoadSafeSeed(&actual_seed, &actual_client_state), + "safe_seed_details_"); +} + +TEST(EarlyBootSeedStoreTest, LoadSafeSeed_Invalid) { + featured::SeedDetails safe_seed_details; + safe_seed_details.set_compressed_data("bad"); + + TestingPrefServiceSimple prefs; + VariationsSeedStore::RegisterPrefs(prefs.registry()); + + // Allow empty signature. + base::test::ScopedCommandLine scoped_command_line; + scoped_command_line.GetProcessCommandLine()->AppendSwitch( + switches::kAcceptEmptySeedSignatureForTesting); + + EarlyBootSeedStore store(&prefs, safe_seed_details); + + VariationsSeed actual_seed; + ClientFilterableState actual_client_state( + /*is_enterprise_function=*/base::BindOnce([] { return false; }), + /*google_groups_function=*/base::BindOnce( + [] { return base::flat_set<uint64_t>(); })); + EXPECT_FALSE(store.LoadSafeSeed(&actual_seed, &actual_client_state)); +} + +} // namespace +} // namespace variations::cros_early_boot::evaluate_seed
diff --git a/components/variations/variations_seed_store.cc b/components/variations/variations_seed_store.cc index 823d77d7..b12dd017 100644 --- a/components/variations/variations_seed_store.cc +++ b/components/variations/variations_seed_store.cc
@@ -485,44 +485,67 @@ } #endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) +LoadSeedResult VariationsSeedStore::VerifyAndParseSeed( + VariationsSeed* seed, + const std::string& seed_data, + const std::string& base64_seed_signature, + absl::optional<VerifySignatureResult>* verify_signature_result) { + // TODO(crbug/1335082): get rid of |signature_verification_enabled_| and only + // support switches::kAcceptEmptySeedSignatureForTesting. + if (signature_verification_enabled_ && + !AcceptEmptySeedSignatureForTesting(base64_seed_signature)) { + *verify_signature_result = + VerifySeedSignature(seed_data, base64_seed_signature); + if (*verify_signature_result != VerifySignatureResult::VALID_SIGNATURE) { + return LoadSeedResult::kInvalidSignature; + } + } + + if (!seed->ParseFromString(seed_data)) { + return LoadSeedResult::kCorruptProtobuf; + } + + return LoadSeedResult::kSuccess; +} + LoadSeedResult VariationsSeedStore::LoadSeedImpl( SeedType seed_type, VariationsSeed* seed, std::string* seed_data, std::string* base64_seed_signature) { LoadSeedResult read_result = ReadSeedData(seed_type, seed_data); - if (read_result != LoadSeedResult::kSuccess) + if (read_result != LoadSeedResult::kSuccess) { return read_result; + } *base64_seed_signature = local_state_->GetString( seed_type == SeedType::LATEST ? prefs::kVariationsSeedSignature : prefs::kVariationsSafeSeedSignature); - // TODO(crbug/1335082): get rid of |signature_verification_enabled_| and only - // support switches::kAcceptEmptySeedSignatureForTesting. - if (signature_verification_enabled_ && - !AcceptEmptySeedSignatureForTesting(*base64_seed_signature)) { - const VerifySignatureResult result = - VerifySeedSignature(*seed_data, *base64_seed_signature); + + absl::optional<VerifySignatureResult> verify_signature_result; + LoadSeedResult result = VerifyAndParseSeed( + seed, *seed_data, *base64_seed_signature, &verify_signature_result); + if (verify_signature_result.has_value()) { + VerifySignatureResult signature_result = verify_signature_result.value(); if (seed_type == SeedType::LATEST) { - UMA_HISTOGRAM_ENUMERATION("Variations.LoadSeedSignature", result, + UMA_HISTOGRAM_ENUMERATION("Variations.LoadSeedSignature", + signature_result, VerifySignatureResult::ENUM_SIZE); } else { UMA_HISTOGRAM_ENUMERATION( - "Variations.SafeMode.LoadSafeSeed.SignatureValidity", result, - VerifySignatureResult::ENUM_SIZE); + "Variations.SafeMode.LoadSafeSeed.SignatureValidity", + signature_result, VerifySignatureResult::ENUM_SIZE); } - if (result != VerifySignatureResult::VALID_SIGNATURE) { + if (signature_result != VerifySignatureResult::VALID_SIGNATURE) { ClearPrefs(seed_type); - return LoadSeedResult::kInvalidSignature; } } - if (!seed->ParseFromString(*seed_data)) { + if (result == LoadSeedResult::kCorruptProtobuf) { ClearPrefs(seed_type); - return LoadSeedResult::kCorruptProtobuf; } - return LoadSeedResult::kSuccess; + return result; } LoadSeedResult VariationsSeedStore::ReadSeedData(SeedType seed_type,
diff --git a/components/variations/variations_seed_store.h b/components/variations/variations_seed_store.h index 78b6a38..7d2d194 100644 --- a/components/variations/variations_seed_store.h +++ b/components/variations/variations_seed_store.h
@@ -17,6 +17,7 @@ #include "components/variations/metrics.h" #include "components/variations/proto/variations_seed.pb.h" #include "components/variations/seed_response.h" +#include "third_party/abseil-cpp/absl/types/optional.h" class PrefService; class PrefRegistrySimple; @@ -101,7 +102,8 @@ // Side effect: Upon failing to read or validate the safe seed, clears all // of the safe seed pref values. // - // Virtual for testing. + // Virtual for testing and for early-boot CrOS experiments to use a different + // safe seed. [[nodiscard]] virtual bool LoadSafeSeed(VariationsSeed* seed, ClientFilterableState* client_state); @@ -154,6 +156,15 @@ const std::string& seed_bytes, const std::string& base64_seed_signature); + protected: + // Verify an already-loaded |seed_data| along with its |base64_seed_signature| + // and, if verification passes, parse it into |*seed|. + [[nodiscard]] LoadSeedResult VerifyAndParseSeed( + VariationsSeed* seed, + const std::string& seed_data, + const std::string& base64_seed_signature, + absl::optional<VerifySignatureResult>* verify_signature_result); + private: FRIEND_TEST_ALL_PREFIXES(VariationsSeedStoreTest, VerifySeedSignature); FRIEND_TEST_ALL_PREFIXES(VariationsSeedStoreTest, ApplyDeltaPatch);
diff --git a/components/variations/variations_seed_store_unittest.cc b/components/variations/variations_seed_store_unittest.cc index e45ef31..7ab17df 100644 --- a/components/variations/variations_seed_store_unittest.cc +++ b/components/variations/variations_seed_store_unittest.cc
@@ -345,6 +345,31 @@ CheckSafeSeedPrefsAreSet(prefs); } +TEST(VariationsSeedStoreTest, LoadSeed_InvalidProto) { + const std::string base64_seed = GzipAndBase64Encode("Not a proto"); + + TestingPrefServiceSimple prefs; + VariationsSeedStore::RegisterPrefs(prefs.registry()); + SetAllSeedPrefsToNonDefaultValues(&prefs); + prefs.SetString(prefs::kVariationsCompressedSeed, base64_seed); + + // Loading a valid seed with an invalid signature should return false and + // clear all associated prefs when signature verification is enabled. + TestVariationsSeedStore seed_store(&prefs); + base::HistogramTester histogram_tester; + VariationsSeed loaded_seed; + std::string loaded_seed_data; + std::string loaded_base64_seed_signature; + EXPECT_FALSE(seed_store.LoadSeed(&loaded_seed, &loaded_seed_data, + &loaded_base64_seed_signature)); + + // Verify metrics and prefs. + histogram_tester.ExpectUniqueSample("Variations.SeedLoadResult", + LoadSeedResult::kCorruptProtobuf, 1); + CheckRegularSeedPrefsAreCleared(prefs); + CheckSafeSeedPrefsAreSet(prefs); +} + TEST(VariationsSeedStoreTest, LoadSeed_RejectEmptySignature) { const VariationsSeed seed = CreateTestSeed(); const std::string base64_seed = SerializeSeedBase64(seed);
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 29c782e..878067e5 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -3251,6 +3251,10 @@ "service_worker/service_worker_hid_delegate_observer.cc", "service_worker/service_worker_hid_delegate_observer.h", + # WebUSB on extension service workers is non-Android + "service_worker/service_worker_usb_delegate_observer.cc", + "service_worker/service_worker_usb_delegate_observer.h", + # Most speech code is non-Android. "speech/endpointer/endpointer.cc", "speech/endpointer/endpointer.h",
diff --git a/content/browser/accessibility/accessibility_win_browsertest.cc b/content/browser/accessibility/accessibility_win_browsertest.cc index d3d0944..d0d6855 100644 --- a/content/browser/accessibility/accessibility_win_browsertest.cc +++ b/content/browser/accessibility/accessibility_win_browsertest.cc
@@ -1190,7 +1190,10 @@ document_checker.CheckAccessible(GetRendererAccessible()); } -IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, FocusEventOnPageLoad) { +// TODO(accessibility): re-enable after fixing it to work withi +// kSerializeAccessibilityPostLifecycle. +IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, + DISABLED_FocusEventOnPageLoad) { // Some screen readers, such as older versions of Jaws, require a focus event // on the top document after the page loads, if there is no focused element on // the page.
diff --git a/content/browser/accessibility/dump_accessibility_browsertest_base.cc b/content/browser/accessibility/dump_accessibility_browsertest_base.cc index 1ba1a96..d281be3 100644 --- a/content/browser/accessibility/dump_accessibility_browsertest_base.cc +++ b/content/browser/accessibility/dump_accessibility_browsertest_base.cc
@@ -291,14 +291,26 @@ // calling SignalEndOfTest on each frame and waiting for a kEndOfTest event // in response. auto hosts = content::CollectAllRenderFrameHosts(GetWebContents()); - for (auto* host : hosts) { - ui::AXActionData action_data; - action_data.action = ax::mojom::Action::kSignalEndOfTest; - host->AccessibilityPerformAction(action_data); + + // URLS listed in a @NO-LOAD-EXPECTED directive will never fire a kEndOfTest + // event. So we'll only wait for frames we expect to load. + std::set<GURL> urls_to_listen_to; + for (const auto& [url, ignored] : + CollectAllFrameUrls(scenario_.no_load_expected)) { + urls_to_listen_to.insert(GURL(url)); } - AccessibilityNotificationWaiter waiter(GetWebContents(), mode, - ax::mojom::Event::kEndOfTest); + AccessibilityNotificationWaiter waiter( + GetWebContents(), mode, ax::mojom::Event::kEndOfTest, urls_to_listen_to); + + for (auto* host : hosts) { + if (urls_to_listen_to.contains(host->GetLastCommittedURL())) { + ui::AXActionData action_data; + action_data.action = ax::mojom::Action::kSignalEndOfTest; + host->AccessibilityPerformAction(action_data); + } + } + ASSERT_TRUE(waiter.WaitForNotification(true)); } @@ -380,11 +392,17 @@ if (scenario_.wait_for.size()) { // Wait for expected text from @WAIT-FOR. WaitForExpectedText(mode); - } else { - // Wait until all accessibility events and dirty objects have been - // processed. - WaitForEndOfTest(mode); } + + // Wait until all accessibility events and dirty objects have been + // processed. + WaitForEndOfTest(mode); + + const ui::AXTree* tree = GetAXTree(); + DCHECK(tree); + DCHECK(!tree->GetTreeUpdateInProgressState()) + << "The accessibility tree should be clean, but there are still updates " + "to be made."; } void DumpAccessibilityTestBase::RunTestForPlatform( @@ -510,7 +528,7 @@ } std::map<std::string, unsigned> DumpAccessibilityTestBase::CollectAllFrameUrls( - const std::vector<std::string>& skip_urls) { + const std::vector<std::string>& skip_urls) const { std::map<std::string, unsigned> all_frame_urls; // Get the url of every frame in the frame tree. for (FrameTreeNode* node : GetWebContents()->GetPrimaryFrameTree().Nodes()) { @@ -601,6 +619,15 @@ return static_cast<WebContentsImpl*>(shell()->web_contents()); } +const ui::AXTree* DumpAccessibilityTestBase::GetAXTree() const { + BrowserAccessibilityManager* manager = GetManager(); + if (!manager) { + return nullptr; + } + + return manager->ax_tree(); +} + std::unique_ptr<AXTreeFormatter> DumpAccessibilityTestBase::CreateFormatter() const { return AXInspectFactory::CreateFormatter(GetParam().first);
diff --git a/content/browser/accessibility/dump_accessibility_browsertest_base.h b/content/browser/accessibility/dump_accessibility_browsertest_base.h index d16f03c..aadaeac 100644 --- a/content/browser/accessibility/dump_accessibility_browsertest_base.h +++ b/content/browser/accessibility/dump_accessibility_browsertest_base.h
@@ -175,6 +175,8 @@ // contents. BrowserAccessibilityManager* GetManager() const; + const ui::AXTree* GetAXTree() const; + std::unique_ptr<ui::AXTreeFormatter> CreateFormatter() const; // Returns a list of captured events fired after the invoked action. @@ -247,7 +249,7 @@ // e.g., in support of the @NO-LOAD-EXPECTED directive, when an element has an // invalid src attribute. std::map<std::string, unsigned> CollectAllFrameUrls( - const std::vector<std::string>& skip_urls); + const std::vector<std::string>& skip_urls) const; // Wait until all initial content is completely loaded, included within // subframes, objects and portals with given AXMode.
diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 0148fa86..61708653 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
@@ -2783,12 +2783,10 @@ RunHtmlTest(FILE_PATH_LITERAL("object-image.html")); } -#if BUILDFLAG(IS_LINUX) IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityObjectImageError) { RunHtmlTest(FILE_PATH_LITERAL("object-image-error.html")); } -#endif IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityOffscreen) { RunHtmlTest(FILE_PATH_LITERAL("offscreen.html")); @@ -3538,9 +3536,7 @@ FILE_PATH_LITERAL("frozen-ancestor-cannot-change-descendants.html")); } -// TODO(crbug.com/1454778) Flaky on ChromeOS, Linux, Mac, Windows for parameter -// "blink". -IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, DISABLED_HiddenTable) { +IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, HiddenTable) { RunRegressionTest(FILE_PATH_LITERAL("hidden-table.html")); }
diff --git a/content/browser/interest_group/auction_runner_unittest.cc b/content/browser/interest_group/auction_runner_unittest.cc index eab2c294..9161bc5 100644 --- a/content/browser/interest_group/auction_runner_unittest.cc +++ b/content/browser/interest_group/auction_runner_unittest.cc
@@ -17504,7 +17504,7 @@ /*report_post_auction_signals=*/true, /*debug_loss_report_url=*/"https://component1-loss-reporting.test/", /*debug_win_report_url=*/"https://component1-win-reporting.test/", - /*report_top_level_post_auction_signals*/ true)); + /*report_top_level_post_auction_signals=*/true)); auction_worklet::AddJavascriptResponse( &url_loader_factory_, kBidder1Url, MakeBidScript(kComponentSeller1, "1", "https://ad1.com/", @@ -17530,7 +17530,7 @@ /*report_post_auction_signals=*/true, /*debug_loss_report_url=*/"https://component2-loss-reporting.test/", /*debug_win_report_url=*/"https://component2-win-reporting.test/", - /*report_top_level_post_auction_signals*/ true)); + /*report_top_level_post_auction_signals=*/true)); auction_worklet::AddJavascriptResponse( &url_loader_factory_, kBidder2Url, MakeBidScript(kComponentSeller2, "2", "https://ad2.com/", @@ -17678,7 +17678,7 @@ /*report_post_auction_signals=*/true, /*debug_loss_report_url=*/"https://component2-loss-reporting.test/", /*debug_win_report_url=*/"https://component2-win-reporting.test/", - /*report_top_level_post_auction_signals*/ true)); + /*report_top_level_post_auction_signals=*/true)); auction_worklet::AddJavascriptResponse( &url_loader_factory_, kBidder2Url, MakeBidScript(kComponentSeller2, "2", "https://ad2.com/", @@ -17785,7 +17785,7 @@ /*report_post_auction_signals=*/true, /*debug_loss_report_url=*/"https://component-loss-reporting.test/", /*debug_win_report_url=*/"https://component-win-reporting.test/", - /*report_top_level_post_auction_signals*/ true)); + /*report_top_level_post_auction_signals=*/true)); auction_worklet::AddJavascriptResponse( &url_loader_factory_, kBidder1Url, MakeBidScript(kComponentSeller1, "1", "https://ad1.com/", @@ -17905,14 +17905,14 @@ MakeBidScript(kSeller, "1", "https://ad1.com/", /*num_ad_components=*/2, kBidder1, kBidder1Name, /*has_signals=*/false, "k1", "a", - /*report_post_auction_signals*/ false, + /*report_post_auction_signals=*/false, kBidder1DebugLossReportUrl, kBidder1DebugWinReportUrl)); auction_worklet::AddJavascriptResponse( &url_loader_factory_, kBidder2Url, MakeBidScript(kSeller, "2", "https://ad2.com/", /*num_ad_components=*/2, kBidder2, kBidder2Name, /*has_signals=*/false, "l2", "b", - /*report_post_auction_signals*/ false, + /*report_post_auction_signals=*/false, kBidder2DebugLossReportUrl, kBidder2DebugWinReportUrl)); StartStandardAuction();
diff --git a/content/browser/interest_group/interest_group_browsertest.cc b/content/browser/interest_group/interest_group_browsertest.cc index 5a9fbead6..fc56185 100644 --- a/content/browser/interest_group/interest_group_browsertest.cc +++ b/content/browser/interest_group/interest_group_browsertest.cc
@@ -1056,6 +1056,20 @@ return EvalJs(execution_target ? *execution_target : shell(), base::StringPrintf( R"( +// Helper for setting up additional bids. seller and nonce will be needed once +// we switch to header-based approach. +function provideAdditionalBids(seller, nonce, bidStringList) { + let additionalBids = [] + for (bidString of bidStringList) { + let bidObj = { + bid: bidString, + signatures: [{key: new Uint8Array(32), signature: new Uint8Array(64)}] + }; + additionalBids.push(bidObj); + } + return additionalBids; +} + (async function() { try { return await navigator.runAdAuction(%s); @@ -2732,8 +2746,7 @@ } return 'done'; })())", - test_origin.Serialize().c_str(), - url.spec().c_str()))); + test_origin, url))); WaitForAccessObserved({ {TestInterestGroupObserver::kJoin, test_origin, "cars"}, }); @@ -2744,15 +2757,13 @@ IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, JoinInterestGroupMissingLifetimeMs) { GURL url = https_server_->GetURL("a.test", "/echo"); - url::Origin test_origin = url::Origin::Create(url); ASSERT_TRUE(NavigateToURL(shell(), url)); AttachInterestGroupObserver(); EXPECT_EQ( "TypeError: Failed to execute 'joinAdInterestGroup' on 'Navigator': " "Missing required field lifetimeMs", - EvalJs(shell(), - JsReplace(R"( + EvalJs(shell(), JsReplace(R"( (async function() { try { await navigator.joinAdInterestGroup( @@ -2765,7 +2776,7 @@ } return 'done'; })())", - test_origin.Serialize().c_str(), url.spec().c_str()))); + url::Origin::Create(url)))); WaitForAccessObserved({}); } @@ -2789,8 +2800,7 @@ } return 'done'; })())", - test_origin.Serialize().c_str(), - url.spec().c_str()))); + test_origin))); WaitForAccessObserved({ {TestInterestGroupObserver::kJoin, test_origin, "cars"}, }); @@ -2823,8 +2833,7 @@ } return 'done'; })())", - test_origin.Serialize().c_str(), - url.spec().c_str()))); + test_origin))); WaitForAccessObserved({ {TestInterestGroupObserver::kJoin, test_origin, "cars"}, }); @@ -3023,7 +3032,6 @@ JoinInterestGroupValidSellerCapabilities) { GURL url = https_server_->GetURL("a.test", "/echo"); auto origin = url::Origin::Create(url); - std::string origin_string = origin.Serialize(); ASSERT_TRUE(NavigateToURL(shell(), url)); EXPECT_EQ(kSuccess, @@ -3056,7 +3064,6 @@ JoinInterestGroupValidSizeFields) { GURL url = https_server_->GetURL("a.test", "/echo"); auto origin = url::Origin::Create(url); - std::string origin_string = origin.Serialize(); ASSERT_TRUE(NavigateToURL(shell(), url)); EXPECT_EQ( @@ -3103,7 +3110,6 @@ JoinInterestGroupWithAuctionServerRequestFlags) { GURL url = https_server_->GetURL("a.test", "/echo"); auto origin = url::Origin::Create(url); - std::string origin_string = origin.Serialize(); ASSERT_TRUE(NavigateToURL(shell(), url)); EXPECT_EQ(kSuccess, @@ -3129,7 +3135,6 @@ JoinInterestGroupValidReportingIds) { GURL url = https_server_->GetURL("a.test", "/echo"); auto origin = url::Origin::Create(url); - std::string origin_string = origin.Serialize(); ASSERT_TRUE(NavigateToURL(shell(), url)); EXPECT_EQ( @@ -3169,7 +3174,6 @@ JoinInterestGroupValidAdRenderId) { GURL url = https_server_->GetURL("a.test", "/echo"); auto origin = url::Origin::Create(url); - std::string origin_string = origin.Serialize(); ASSERT_TRUE(NavigateToURL(shell(), url)); EXPECT_EQ(kSuccess, @@ -3277,7 +3281,7 @@ } return 'done'; })())", - origin.Serialize().c_str()))); + origin))); WaitForAccessObserved({ {TestInterestGroupObserver::kJoin, origin, "cars"}, }); @@ -5565,12 +5569,12 @@ directFromSellerSignals: $4 }); })())", - seller_origin.Serialize().c_str(), + seller_origin, https_server_->GetURL( kSellerHost, "/interest_group/" "decision_no_direct_from_seller_signals_validator.js"), - bidder_origin.Serialize().c_str(), + bidder_origin, https_server_->GetURL(kSellerHost, "/direct_from_seller_signals"))) .ExtractString()), @@ -5647,12 +5651,12 @@ directFromSellerSignals: $4 }); })())", - seller_origin.Serialize().c_str(), + seller_origin, https_server_->GetURL( kSellerHost, "/interest_group/" "decision_no_direct_from_seller_signals_validator.js"), - bidder_origin.Serialize().c_str(), + bidder_origin, https_server_->GetURL(kSellerHost, "/direct_from_seller_signals"))) .ExtractString()), @@ -5733,12 +5737,12 @@ directFromSellerSignals: $4 }); })())", - seller_origin.Serialize().c_str(), + seller_origin, https_server_->GetURL( kSellerHost, "/interest_group/" "decision_no_direct_from_seller_signals_validator.js"), - bidder_origin.Serialize().c_str(), + bidder_origin, https_server_->GetURL(kSellerHost, "/direct_from_seller_signals"))) .ExtractString()), @@ -5821,12 +5825,12 @@ directFromSellerSignals: maybePromise($4) }); })())", - seller_origin.Serialize().c_str(), + seller_origin, https_server_->GetURL(kSellerHost, "/interest_group/" "decision_simple_direct_from_" "seller_signals_validator.js"), - bidder_origin.Serialize().c_str(), + bidder_origin, https_server_->GetURL(kSellerHost, "/direct_from_seller_signals"))) .ExtractString()), @@ -5907,12 +5911,12 @@ directFromSellerSignalsHeaderAdSlot: "adSlot1" }); })())", - seller_origin.Serialize().c_str(), + seller_origin, https_server_->GetURL(kSellerHost, "/interest_group/" "decision_simple_direct_from_" "seller_signals_validator.js"), - bidder_origin.Serialize().c_str())) + bidder_origin)) .ExtractString()), &observer); EXPECT_EQ(GURL("https://example.com/render"), observer.mapped_url()); @@ -5980,12 +5984,12 @@ directFromSellerSignalsHeaderAdSlot: "adSlot1" }); })())", - seller_origin.Serialize().c_str(), + seller_origin, https_server_->GetURL(kSellerHost, "/interest_group/" "decision_simple_direct_from_" "seller_signals_validator.js"), - bidder_origin.Serialize().c_str())); + bidder_origin)); // Navigate away without waiting for the auction to complete. Nothing should // crash. @@ -15905,8 +15909,7 @@ decisionLogicUrl: $2, interestGroupBuyers: [$1], auctionNonce: $3, - additionalBids: Promise.resolve([{ - bid: JSON.stringify({ + additionalBids: provideAdditionalBids($1, $3, [JSON.stringify({ interestGroup: { name: 'campaign123', biddingLogicURL: $5, @@ -15919,9 +15922,7 @@ }, auctionNonce: $3, seller: $1, - }), - signatures: [{key: new Uint8Array(32), signature: new Uint8Array(64)}] - }])})", + })])})", test_origin, https_server_->GetURL("a.test", "/interest_group/decision_logic.js"), auction_nonce, additional_bid_url, additional_bid_logic_url, @@ -15974,8 +15975,8 @@ perBuyerCurrencies: { $6: 'CAD' }, - additionalBids: Promise.resolve([{ - bid: JSON.stringify({ + additionalBids: provideAdditionalBids($1, $3, [ + JSON.stringify({ interestGroup: { name: 'campaign123', biddingLogicURL: $5, @@ -15990,8 +15991,7 @@ auctionNonce: $3, seller: $1, }), - signatures: [{key: new Uint8Array(32), signature: new Uint8Array(64)}] - }])})", + ])})", test_origin, https_server_->GetURL("a.test", "/interest_group/decision_logic.js"), auction_nonce, additional_bid_url, additional_bid_logic_url, @@ -16044,10 +16044,8 @@ decisionLogicUrl: $2, interestGroupBuyers: [$1], auctionNonce: $3, - additionalBids: Promise.resolve([{ - bid: '"boo', - signatures: [{key: new Uint8Array(32), signature: new Uint8Array(64)}] - }])})", + additionalBids: provideAdditionalBids($1, $3, ['"boo']) + })", test_origin, https_server_->GetURL("a.test", "/interest_group/decision_logic.js"), auction_nonce, additional_bid_url, additional_bid_logic_url, @@ -16086,7 +16084,7 @@ decisionLogicUrl: $2, interestGroupBuyers: [$1], auctionNonce: $3, - additionalBids: Promise.resolve([])})", + additionalBids: provideAdditionalBids($1, $3, [])})", test_origin, https_server_->GetURL("a.test", "/interest_group/decision_logic.js"), auction_nonce, additional_bid_url, additional_bid_logic_url,
diff --git a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc index df149dd..33fe630 100644 --- a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc +++ b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc
@@ -4944,10 +4944,10 @@ // violation due to eval. EXPECT_THAT(EvalJs(main_document, "document.querySelector('info-view').shadowRoot" - ".querySelector('h3').textContent", + ".querySelector('#used-only-by-test').text", EXECUTE_SCRIPT_DEFAULT_OPTIONS, /*world_id=*/1) .ExtractString(), - testing::StartsWith("Graphics Feature Status")); + testing::StartsWith("GPU Info")); } // Start with A(B), navigate A to C. By emulating a slow unload handler B, check @@ -8016,7 +8016,8 @@ std::vector<base::test::FeatureRefAndParams> enabled_features = GetDefaultEnabledBackForwardCacheFeaturesForTesting( /*ignore_outstanding_network_request=*/false); - enabled_features.push_back({kNavigationUpdatesChildViewsVisibility, {{}}}); + enabled_features.push_back( + {features::kNavigationUpdatesChildViewsVisibility, {{}}}); enabled_features.push_back({features::kEvictSubtree, {{}}}); scoped_feature_list_.InitWithFeaturesAndParameters( enabled_features,
diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc index 4a5f71d..32c41886 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc
@@ -59,7 +59,6 @@ #include "content/browser/site_instance_impl.h" #include "content/browser/webui/web_ui_controller_factory_registry.h" #include "content/common/content_navigation_policy.h" -#include "content/common/features.h" #include "content/common/navigation_params_utils.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_host.h" @@ -4509,7 +4508,8 @@ // not affect the visibility of the blink::WidgetBase. We should unify these // two visibility states to prevent them from drifting. old_view->Hide(); - if (base::FeatureList::IsEnabled(kNavigationUpdatesChildViewsVisibility) && + if (base::FeatureList::IsEnabled( + features::kNavigationUpdatesChildViewsVisibility) && old_render_frame_host->child_count()) { old_render_frame_host->SetVisibilityForChildViews(false); } @@ -4726,7 +4726,7 @@ if (!frame_tree_node_->frame_tree().IsHidden()) { new_view->Show(); if (base::FeatureList::IsEnabled( - kNavigationUpdatesChildViewsVisibility) && + features::kNavigationUpdatesChildViewsVisibility) && render_frame_host_->child_count()) { render_frame_host_->SetVisibilityForChildViews(true); }
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index f57fb45..8fc94f84 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -340,6 +340,12 @@ ns_view_ = remote_ns_view_.get(); + // New remote NSViews start out as visible, make sure we hide it if it is + // supposed to be hidden already. + if (!is_visible_) { + remote_ns_view_->SetVisible(false); + } + // End local display::Screen observation via `in_process_ns_view_bridge_`; // the remote NSWindow's display::Screen information will be sent by Mojo. // TODO(crbug.com/1204273): Maybe just destroy `in_process_ns_view_bridge_`?
diff --git a/content/browser/resources/gpu/info_view.html b/content/browser/resources/gpu/info_view.html index 7d25830..a6d8689 100644 --- a/content/browser/resources/gpu/info_view.html +++ b/content/browser/resources/gpu/info_view.html
@@ -117,99 +117,5 @@ <button id="download-to-file">Download Report to File</button> </div> <div id="content"> -<div> - <h3>Graphics Feature Status</h3> - <ul class="feature-status-list"></ul> -</div> - -<div class='workarounds-div'> - <h3>Driver Bug Workarounds</h3> - <ul class="workarounds-list"></ul> -</div> - -<div class='problems-div'> - <h3>Problems Detected</h3> - <ul class="problems-list"></ul> -</div> - -<div class='angle-features-div'> - <h3>ANGLE Features</h3> - <ul class="angle-features-list"></ul> -</div> - -<div class='dawn-info-div'> - <h3>DAWN Info</h3> - <ul class="dawn-info-list"></ul> -</div> - -<div> - <h3>Version Information</h3> - <div id="client-info"></div> -</div> - -<div> - <h3>Driver Information</h3> - <div id="basic-info"></div> -</div> - -<div> - <h3>Compositor Information</h3> - <div id="compositor-info"></div> -</div> - -<div> - <h3>GpuMemoryBuffers Status</h3> - <div id="gpu-memory-buffer-info"></div> -</div> - -<div> - <h3>Display(s) Information</h3> - <div id="display-info"></div> -</div> - -<div> - <h3>Video Acceleration Information</h3> - <div id="video-acceleration-info"></div> -</div> - -<div> - <h3>Vulkan Information</h3> - <div id="vulkan-info"></div> -</div> - -<div> - <h3>Device Performance Information</h3> - <div id="device-perf-info"></div> -</div> - -<div class="diagnostics"> - <h3>Diagnostics</h3> - <div class="diagnostics-loading">... loading ...</div> - <div id="diagnostics-table">None</div> -</div> - -<div class='basic-info-for-hardware-gpu-div'> - <h3>Driver Information for Hardware GPU</h3> - <div id="basic-info-for-hardware-gpu"></div> -</div> - -<div class='feature-status-for-hardware-gpu-div'> - <h3>Graphics Feature Status for Hardware GPU</h3> - <ul class="feature-status-for-hardware-gpu-list"></ul> -</div> - -<div class='workarounds-for-hardware-gpu-div'> - <h3>Driver Bug Workarounds for Hardware GPU</h3> - <ul class="workarounds-for-hardware-gpu-list"></ul> -</div> - -<div class='problems-for-hardware-gpu-div'> - <h3>Problems Detected for Hardware GPU</h3> - <ul class="problems-for-hardware-gpu-list"></ul> -</div> - -<div id="log-messages"> - <h3>Log Messages</h3> - <ul></ul> -</div> + <script type="not-js" id="used-only-by-test">GPU Info</script> </div> \ No newline at end of file
diff --git a/content/browser/resources/gpu/info_view.ts b/content/browser/resources/gpu/info_view.ts index 0492ab76..918bf8b4 100644 --- a/content/browser/resources/gpu/info_view.ts +++ b/content/browser/resources/gpu/info_view.ts
@@ -270,17 +270,6 @@ } /** - * Adds hidden spans to an existing heading. Used when the text is - * copied to make the heading appear like markdown - */ -function addMarkdownHeading(padChar: string) { - return function(el: Element) { - el.appendChild( - createHidden(`\n${''.padEnd(el.textContent!.length, padChar)}`)); - }; -} - -/** * Get a string data value */ function getDataValue(data: Data|ArrayData): string { @@ -318,6 +307,39 @@ return typeof value === 'undefined' || value === null ? '' : value.toString(); } +const kSections = { + featureStatus: ['Graphics Feature Status', 'ul'], + workarounds: ['Driver Bug Workarounds', 'ul'], + problems: ['Problems Detected', 'ul'], + angleFeatures: ['ANGLE Features', 'ul'], + dawnInfo: ['DAWN Info', 'ul'], + clientInfo: ['Version Information', 'div'], + basicInfo: ['Driver Information', 'div'], + compositorInfo: ['Compositor Information', 'div'], + gpuMemoryBufferInfo: ['GpuMemoryBuffers Status', 'div'], + displayInfo: ['Display(s) Information', 'div'], + videoAccelerationInfo: ['Video Acceleration Information', 'div'], + vulkanInfo: ['Vulkan Information', 'div'], + devicePerfInfo: ['Device Performance Information', 'div'], + diagnostics: ['Diagnostics', 'div'], + basicInfoForHardwareGpu: ['Driver Information for Hardware GPU', 'div'], + featureStatusForHardwareGpu: + ['Graphics Feature Status for Hardware GPU', 'ul'], + workaroundsForHardwareGpu: ['Driver Bug Workarounds for Hardware GPU', 'ul'], + problemsForHardwareGpu: ['Problems Detected for Hardware GPU', 'ul'], + logMessages: ['Log Messages', 'ul'], +} as const; + +interface Section { + div: HTMLElement; + list: HTMLElement; + wrap: HTMLElement; +} + +type Sections = { + [key in keyof typeof kSections]: Section +}; + /** * @fileoverview This view displays information on the current GPU * hardware. Its primary usefulness is to allow users to copy-paste @@ -325,6 +347,7 @@ */ export class InfoViewElement extends CustomElement { browserBridge?: BrowserBridge; + sections?: Sections; static override get template() { return getTemplate(); @@ -455,10 +478,18 @@ event.preventDefault(); }); - this.shadowRoot!.querySelectorAll('h1, h2, h3') - .forEach(addMarkdownHeading('=')); - this.shadowRoot!.querySelectorAll('h4, h5, h6') - .forEach(addMarkdownHeading('-')); + const contentDiv = this.getRequiredElement('#content')!; + this.sections = Object.fromEntries(Object.entries(kSections).map( + ([propName, [title, tag]]) => { + const div = createHeading('h3', '=', title); + const list = createElem(tag); + const wrap = createElem('div', {}, [ + div, + list, + ]); + contentDiv.appendChild(wrap); + return [propName, {div, list, wrap}]; + })) as Sections; } /** @@ -478,11 +509,13 @@ revisionIdentifier}/${filepath}`; } + const sections = this.sections!; + // Client info if (browserBridge.clientInfo) { clientInfo = browserBridge.clientInfo; - this.setTable_('client-info', [ + this.setTable_(sections.clientInfo, [ {description: 'Data exported', value: (new Date()).toISOString()}, {description: 'Chrome version', value: clientInfo.version}, {description: 'Operating system', value: clientInfo.operating_system}, @@ -506,118 +539,61 @@ {description: 'Command Line', value: clientInfo.command_line}, ]); } else { - this.setText_('client-info', '... loading...'); + sections.clientInfo.list.textContent = '... loading ...'; } - - // GPU info, basic - const diagnosticsDiv = this.getRequiredElement('.diagnostics'); - const diagnosticsLoadingDiv = - this.getRequiredElement('.diagnostics-loading'); - const featureStatusList = this.getRequiredElement('.feature-status-list'); - const problemsDiv = this.getRequiredElement('.problems-div'); - const problemsList = this.getRequiredElement('.problems-list'); - const workaroundsDiv = this.getRequiredElement('.workarounds-div'); - const workaroundsList = this.getRequiredElement('.workarounds-list'); - const angleFeaturesDiv = this.getRequiredElement('.angle-features-div'); - const angleFeaturesList = this.getRequiredElement('.angle-features-list'); - const dawnInfoDiv = this.getRequiredElement('.dawn-info-div'); - const dawnInfoList = this.getRequiredElement('.dawn-info-list'); - - - - const basicInfoForHardwareGpuDiv = - this.getRequiredElement('.basic-info-for-hardware-gpu-div'); - const featureStatusForHardwareGpuDiv = - this.getRequiredElement('.feature-status-for-hardware-gpu-div'); - const featureStatusForHardwareGpuList = - this.getRequiredElement('.feature-status-for-hardware-gpu-list'); - const problemsForHardwareGpuDiv = - this.getRequiredElement('.problems-for-hardware-gpu-div'); - const problemsForHardwareGpuList = - this.getRequiredElement('.problems-for-hardware-gpu-list'); - const workaroundsForHardwareGpuDiv = - this.getRequiredElement('.workarounds-for-hardware-gpu-div'); - const workaroundsForHardwareGpuList = - this.getRequiredElement('.workarounds-for-hardware-gpu-list'); - const gpuInfo = browserBridge.gpuInfo; if (gpuInfo) { // Not using jstemplate here for blocklist status because we construct // href from data, which jstemplate can't seem to do. if (gpuInfo.featureStatus) { this.appendFeatureInfo_( - gpuInfo.featureStatus, featureStatusList, problemsDiv, problemsList, - workaroundsDiv, workaroundsList); + gpuInfo.featureStatus, sections.featureStatus.list, + sections.problems, sections.workarounds); } else { - featureStatusList.textContent = ''; - problemsList.hidden = true; - workaroundsList.hidden = true; + sections.featureStatus.list.textContent = ''; + sections.problems.list.hidden = true; + sections.workarounds.list.hidden = true; } - if (gpuInfo.featureStatusForHardwareGpu) { - basicInfoForHardwareGpuDiv.hidden = false; - featureStatusForHardwareGpuDiv.hidden = false; - problemsForHardwareGpuDiv.hidden = false; - workaroundsForHardwareGpuDiv.hidden = false; + const hideHardware = !gpuInfo.featureStatusForHardwareGpu; + sections.basicInfoForHardwareGpu.div.hidden = hideHardware; + sections.featureStatusForHardwareGpu.div.hidden = hideHardware; + sections.problemsForHardwareGpu.div.hidden = hideHardware; + sections.workaroundsForHardwareGpu.div.hidden = hideHardware; + if (!hideHardware) { this.appendFeatureInfo_( gpuInfo.featureStatusForHardwareGpu, - featureStatusForHardwareGpuList, problemsForHardwareGpuDiv, - problemsForHardwareGpuList, workaroundsForHardwareGpuDiv, - workaroundsForHardwareGpuList); + sections.featureStatusForHardwareGpu.list, + sections.problemsForHardwareGpu, + sections.workaroundsForHardwareGpu); this.setTable_( - 'basic-info-for-hardware-gpu', gpuInfo.basicInfoForHardwareGpu); - } else { - basicInfoForHardwareGpuDiv.hidden = true; - featureStatusForHardwareGpuDiv.hidden = true; - problemsForHardwareGpuDiv.hidden = true; - workaroundsForHardwareGpuDiv.hidden = true; + sections.basicInfoForHardwareGpu, gpuInfo.basicInfoForHardwareGpu); } - this.setTable_('basic-info', gpuInfo.basicInfo); - this.setTable_('compositor-info', gpuInfo.compositorInfo); - this.setTable_('gpu-memory-buffer-info', gpuInfo.gpuMemoryBufferInfo); - this.setTable_('display-info', gpuInfo.displayInfo); - this.setTable_('video-acceleration-info', gpuInfo.videoAcceleratorsInfo); + this.setTable_(sections.basicInfo, gpuInfo.basicInfo); + this.setTable_(sections.compositorInfo, gpuInfo.compositorInfo); + this.setTable_(sections.gpuMemoryBufferInfo, gpuInfo.gpuMemoryBufferInfo); + this.setTable_(sections.displayInfo, gpuInfo.displayInfo); + this.setTable_( + sections.videoAccelerationInfo, gpuInfo.videoAcceleratorsInfo); - if (gpuInfo.ANGLEFeatures) { - if (gpuInfo.ANGLEFeatures.length) { - angleFeaturesDiv.hidden = false; - angleFeaturesList.textContent = ''; - for (const angleFeature of gpuInfo.ANGLEFeatures) { - angleFeaturesList.appendChild( - this.createAngleFeatureEl_(angleFeature)); - } - } else { - angleFeaturesDiv.hidden = true; + this.updateSectionList_( + sections.angleFeatures, gpuInfo.ANGLEFeatures, + angleFeature => this.createAngleFeatureEl_(angleFeature)); + + this.updateSection_(sections.dawnInfo, () => { + const show = !!gpuInfo.dawnInfo && gpuInfo.dawnInfo.length > 0; + if (show) { + this.createDawnInfoEl_(sections.dawnInfo.list, gpuInfo.dawnInfo!); } - } + return show; + }); - if (gpuInfo.dawnInfo) { - if (gpuInfo.dawnInfo.length) { - dawnInfoDiv.hidden = false; - this.createDawnInfoEl_(dawnInfoList, gpuInfo.dawnInfo); - } else { - dawnInfoDiv.hidden = true; - } - } - - if (gpuInfo.diagnostics) { - diagnosticsDiv.hidden = false; - diagnosticsLoadingDiv.hidden = true; - this.getRequiredElement('#diagnostics-table').hidden = false; - this.setTable_('diagnostics-table', gpuInfo.diagnostics); - } else if (gpuInfo.diagnostics === null) { - // gpu_internals.cc sets diagnostics to null when it is being loaded - diagnosticsDiv.hidden = false; - diagnosticsLoadingDiv.hidden = false; - this.getRequiredElement('#diagnostics-table').hidden = true; - } else { - diagnosticsDiv.hidden = true; - } + this.updateSectionTable_(sections.diagnostics, gpuInfo.diagnostics); this.setTable_( - 'vulkan-info', + sections.vulkanInfo, gpuInfo.vulkanInfo ? [{ 'description': 'info', 'value': new VulkanInfo(gpuInfo.vulkanInfo).toString(), @@ -625,28 +601,61 @@ }] : []); - this.setTable_('device-perf-info', gpuInfo.devicePerfInfo); + this.setTable_(sections.devicePerfInfo, gpuInfo.devicePerfInfo); } else { - this.setText_('basic-info', '... loading ...'); - diagnosticsDiv.hidden = true; - featureStatusList.textContent = ''; - problemsDiv.hidden = true; - dawnInfoDiv.hidden = true; + sections.basicInfo.list.textContent = '... loading ...'; + sections.diagnostics.div.hidden = true; + sections.featureStatus.list.textContent = ''; + sections.problems.div.hidden = true; + sections.dawnInfo.div.hidden = true; } // Log messages - const messageList = this.getRequiredElement('#log-messages > ul'); - messageList.innerHTML = window.trustedTypes!.emptyHTML; + sections.logMessages.list.textContent = ''; browserBridge.logMessages.forEach(messageObj => { - messageList.appendChild( + sections.logMessages.list.appendChild( createElem('li', `${messageObj.header}: ${messageObj.message}`)); }); } + /** + * Clears a section and then updates it by calling fn. If fn returns false + * it hides the section. + */ + private updateSection_(section: Section, fn: () => boolean) { + section.list.textContent = ''; + const show = fn(); + section.div.hidden = !show; + } + + /** + * Clears and and updates a section from a list. If the list is empty it + * hides the section + */ + private updateSectionList_<T>( + section: Section, list: T[]|undefined, fn: (item: T) => HTMLElement) { + this.updateSection_(section, () => { + if (list) { + for (const item of list) { + section.list.appendChild(fn(item)); + } + } + return !!list && list.length > 0; + }); + } + + /** Update a table, hiding it of the table has no elements */ + private updateSectionTable_( + section: Section, inputData: Data[]|ArrayData[]|undefined) { + this.updateSection_(section, () => { + this.setTable_(section, inputData); + return !!inputData && inputData.length > 0; + }); + } + private appendFeatureInfo_( featureInfo: FeatureStatus, featureStatusList: HTMLElement, - problemsDiv: HTMLElement, problemsList: HTMLElement, - workaroundsDiv: HTMLElement, workaroundsList: HTMLElement) { + problems: Section, workarounds: Section) { // Feature map const featureLabelMap: Record<string, string> = { '2d_canvas': 'Canvas', @@ -736,26 +745,14 @@ } // problems list - if (featureInfo.problems.length) { - problemsDiv.hidden = false; - problemsList.textContent = ''; - for (const problem of featureInfo.problems) { - problemsList.appendChild(this.createProblemEl_(problem)); - } - } else { - problemsDiv.hidden = true; - } + this.updateSectionList_( + problems, featureInfo.problems, + problem => this.createProblemEl_(problem)); // driver bug workarounds list - if (featureInfo.workarounds.length) { - workaroundsDiv.hidden = false; - workaroundsList.textContent = ''; - for (const workaround of featureInfo.workarounds) { - workaroundsList.appendChild(createLi(workaround)); - } - } else { - workaroundsDiv.hidden = true; - } + this.updateSectionList_( + workarounds, featureInfo.workarounds, + workaround => createLi(workaround)); } private createProblemEl_(problem: Problem): HTMLElement { @@ -873,21 +870,9 @@ ]); } - private setText_(outputElementId: string, text: string) { - this.getRequiredElement(`#${outputElementId}`).textContent = text; - } - - private setTable_( - outputElementId: string, inputData: Data[]|ArrayData[]|undefined) { - const table = createInfoTable(inputData || []); - - const peg = this.$(`#${outputElementId}`); - if (!peg) { - throw new Error('Node ' + outputElementId + ' not found'); - } - - peg.textContent = ''; - peg.appendChild(table); + private setTable_(section: Section, inputData: Data[]|ArrayData[]|undefined) { + section.list.textContent = ''; + section.list.appendChild(createInfoTable(inputData || [])); } private createDawnInfoEl_(dawnInfoList: HTMLElement, gpuDawnInfo: string[]) {
diff --git a/content/browser/service_worker/OWNERS b/content/browser/service_worker/OWNERS index 94f60f1..f531cd5 100644 --- a/content/browser/service_worker/OWNERS +++ b/content/browser/service_worker/OWNERS
@@ -27,3 +27,5 @@ per-file *_type_converter*.*=file://ipc/SECURITY_OWNERS per-file service_worker_hid_*=file://content/browser/hid/OWNERS per-file service_worker_device_*=file://content/browser/hid/OWNERS +per-file service_worker_usb_*=file://content/browser/usb/OWNERS +per-file service_worker_device_*=file://content/browser/usb/OWNERS
diff --git a/content/browser/service_worker/service_worker_context_core.cc b/content/browser/service_worker/service_worker_context_core.cc index 4863ebd..0e0c7e5 100644 --- a/content/browser/service_worker/service_worker_context_core.cc +++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -35,6 +35,7 @@ #include "content/browser/service_worker/service_worker_register_job.h" #include "content/browser/service_worker/service_worker_registration.h" #include "content/browser/service_worker/service_worker_security_utils.h" +#include "content/browser/service_worker/service_worker_usb_delegate_observer.h" #include "content/browser/service_worker/service_worker_version.h" #include "content/browser/storage_partition_impl.h" #include "content/common/content_navigation_policy.h" @@ -1314,6 +1315,19 @@ std::unique_ptr<ServiceWorkerHidDelegateObserver> hid_delegate_observer) { hid_delegate_observer_ = std::move(hid_delegate_observer); } -#endif // !BUILDFLAG(IS_ANDROID) +ServiceWorkerUsbDelegateObserver* +ServiceWorkerContextCore::usb_delegate_observer() { + if (!usb_delegate_observer_) { + usb_delegate_observer_ = + std::make_unique<ServiceWorkerUsbDelegateObserver>(this); + } + return usb_delegate_observer_.get(); +} + +void ServiceWorkerContextCore::SetServiceWorkerUsbDelegateObserverForTesting( + std::unique_ptr<ServiceWorkerUsbDelegateObserver> usb_delegate_observer) { + usb_delegate_observer_ = std::move(usb_delegate_observer); +} +#endif // !BUILDFLAG(IS_ANDROID) } // namespace content
diff --git a/content/browser/service_worker/service_worker_context_core.h b/content/browser/service_worker/service_worker_context_core.h index 60bad44de..f73c85f7 100644 --- a/content/browser/service_worker/service_worker_context_core.h +++ b/content/browser/service_worker/service_worker_context_core.h
@@ -50,6 +50,7 @@ class ServiceWorkerRegistration; #if !BUILDFLAG(IS_ANDROID) class ServiceWorkerHidDelegateObserver; +class ServiceWorkerUsbDelegateObserver; #endif // !BUILDFLAG(IS_ANDROID) // This class manages data associated with service workers. @@ -413,6 +414,14 @@ void SetServiceWorkerHidDelegateObserverForTesting( std::unique_ptr<ServiceWorkerHidDelegateObserver> hid_delegate_observer); + + // In the service worker case, WebUSB is only available in extension service + // workers. Since extension isn't available in ANDROID, guard + // ServiceWorkerUsbDelegateObserver within non-android platforms. + ServiceWorkerUsbDelegateObserver* usb_delegate_observer(); + + void SetServiceWorkerUsbDelegateObserverForTesting( + std::unique_ptr<ServiceWorkerUsbDelegateObserver> usb_delegate_observer); #endif // !BUILDFLAG(IS_ANDROID) private: @@ -549,6 +558,7 @@ #if !BUILDFLAG(IS_ANDROID) std::unique_ptr<ServiceWorkerHidDelegateObserver> hid_delegate_observer_; + std::unique_ptr<ServiceWorkerUsbDelegateObserver> usb_delegate_observer_; #endif // !BUILDFLAG(IS_ANDROID) base::WeakPtrFactory<ServiceWorkerContextCore> weak_factory_{this};
diff --git a/content/browser/service_worker/service_worker_usb_delegate_observer.cc b/content/browser/service_worker/service_worker_usb_delegate_observer.cc new file mode 100644 index 0000000..f6f9ef7d --- /dev/null +++ b/content/browser/service_worker/service_worker_usb_delegate_observer.cc
@@ -0,0 +1,127 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/service_worker/service_worker_usb_delegate_observer.h" + +#include <cstdint> + +#include "base/functional/bind.h" +#include "base/memory/weak_ptr.h" +#include "content/browser/service_worker/embedded_worker_status.h" +#include "content/browser/service_worker/service_worker_context_core.h" +#include "content/browser/service_worker/service_worker_context_wrapper.h" +#include "content/browser/service_worker/service_worker_registration.h" +#include "content/browser/service_worker/service_worker_version.h" +#include "content/browser/usb/web_usb_service_impl.h" +#include "content/public/common/content_client.h" + +namespace content { + +ServiceWorkerUsbDelegateObserver::ServiceWorkerUsbDelegateObserver( + ServiceWorkerContextCore* context) + : ServiceWorkerDeviceDelegateObserver(context) {} + +ServiceWorkerUsbDelegateObserver::~ServiceWorkerUsbDelegateObserver() = default; + +void ServiceWorkerUsbDelegateObserver::OnDeviceAdded( + const device::mojom::UsbDeviceInfo& device_info) { + DispatchUsbDeviceEventToWorkers( + device_info, + base::BindRepeating([](const device::mojom::UsbDeviceInfo& device_info, + WebUsbServiceImpl* service) { + service->OnDeviceAdded(device_info); + })); +} + +void ServiceWorkerUsbDelegateObserver::OnDeviceRemoved( + const device::mojom::UsbDeviceInfo& device_info) { + DispatchUsbDeviceEventToWorkers( + device_info, + base::BindRepeating([](const device::mojom::UsbDeviceInfo& device_info, + WebUsbServiceImpl* service) { + service->OnDeviceRemoved(device_info); + })); +} + +void ServiceWorkerUsbDelegateObserver::OnDeviceManagerConnectionError() { + for (auto const& [id, info] : registration_id_map()) { + auto* usb_service = GetUsbService(id); + if (usb_service) { + usb_service->OnDeviceManagerConnectionError(); + } + } +} + +void ServiceWorkerUsbDelegateObserver::OnPermissionRevoked( + const url::Origin& origin) { + for (auto const& [id, info] : registration_id_map()) { + auto* usb_service = GetUsbService(id); + if (usb_service) { + usb_service->OnPermissionRevoked(origin); + } + } +} + +void ServiceWorkerUsbDelegateObserver::RegisterUsbService( + int64_t registration_id, + base::WeakPtr<WebUsbServiceImpl> usb_service) { + Register(registration_id); + // `usb_services_` may already have an entry for `registration_id` in a case + // where the service worker went to sleep and now is worken up. In that + // case, the WebUsbServiceImpl from `usb_services_[registration_id]` is the + // weak ptr of previous WebUsbServiceImpl before the service worker went to + // sleep. We don't care about the previous WebUsbServiceImpl, so here just + // overwrite it with `usb_service`, which is the latest one. + usb_services_[registration_id] = usb_service; +} + +void ServiceWorkerUsbDelegateObserver::RegistrationAdded( + int64_t registration_id) { + if (registration_id_map().size() == 1) { + UsbDelegate* delegate = GetContentClient()->browser()->GetUsbDelegate(); + if (delegate) { + usb_delegate_observation.Observe(delegate); + } + } +} + +void ServiceWorkerUsbDelegateObserver::RegistrationRemoved( + int64_t registration_id) { + if (registration_id_map().empty()) { + usb_delegate_observation.Reset(); + } +} + +void ServiceWorkerUsbDelegateObserver::DispatchUsbDeviceEventToWorkers( + const device::mojom::UsbDeviceInfo& device_info, + UsbServiceDeviceEventCallback callback) { + for (auto const& [id, info] : registration_id_map()) { + // No need to proceed if the registration doesn't have any event listeners. + if (!info.has_event_handlers) { + continue; + } + // Forward it to UsbService if the service worker is running, UsbService is + // available, and it has clients registered. + auto* usb_service = GetUsbService(id); + if (usb_service) { + auto version = usb_service->service_worker_version(); + if (version && + version->running_status() == EmbeddedWorkerStatus::RUNNING) { + callback.Run(device_info, usb_service); + continue; + } + } + } +} + +WebUsbServiceImpl* ServiceWorkerUsbDelegateObserver::GetUsbService( + int64_t registration_id) { + auto it = usb_services_.find(registration_id); + if (it == usb_services_.end()) { + return nullptr; + } + return it->second.get(); +} + +} // namespace content
diff --git a/content/browser/service_worker/service_worker_usb_delegate_observer.h b/content/browser/service_worker/service_worker_usb_delegate_observer.h new file mode 100644 index 0000000..a89c6a3 --- /dev/null +++ b/content/browser/service_worker/service_worker_usb_delegate_observer.h
@@ -0,0 +1,101 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_USB_DELEGATE_OBSERVER_H_ +#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_USB_DELEGATE_OBSERVER_H_ + +#include "base/memory/weak_ptr.h" +#include "base/scoped_observation_traits.h" +#include "content/browser/service_worker/service_worker_device_delegate_observer.h" +#include "content/browser/usb/web_usb_service_impl.h" +#include "content/public/browser/usb_delegate.h" + +namespace content { + +class ServiceWorkerContextCore; + +// ServiceWorkerUsbDelegateObserver acts as a broker between the +// content::WebUsbService and content::UsbDelegate when the WebUsbService is +// created for a service worker. Each ServiceWorkerContextCore has one +// ServiceWorkerUsbDelegateObserver, which is used to track all of the +// ServiceWorkerRegistration objects whose script uses the WebUSB API. +// Furthermore, when a device event happens, the +// ServiceWorkerUsbDelegateObserver's UsbDelegate::Observer methods will be +// invoked and deliver the device events to the service worker that has a device +// event handler registered. +// For more information, please see go/usb-usb-extension-access. +class CONTENT_EXPORT ServiceWorkerUsbDelegateObserver + : public ServiceWorkerDeviceDelegateObserver, + public UsbDelegate::Observer { + public: + explicit ServiceWorkerUsbDelegateObserver(ServiceWorkerContextCore* context); + ServiceWorkerUsbDelegateObserver(const ServiceWorkerUsbDelegateObserver&) = + delete; + ServiceWorkerUsbDelegateObserver& operator=( + const ServiceWorkerUsbDelegateObserver&) = delete; + ~ServiceWorkerUsbDelegateObserver() override; + + // UsbDelegate::Observer: + void OnDeviceAdded(const device::mojom::UsbDeviceInfo& device_info) override; + void OnDeviceRemoved( + const device::mojom::UsbDeviceInfo& device_info) override; + void OnDeviceManagerConnectionError() override; + void OnPermissionRevoked(const url::Origin& origin) override; + + // Register the `usb_service` to be the latest WebUsbService for + // `registraiton_id`. + void RegisterUsbService(int64_t registration_id, + base::WeakPtr<WebUsbServiceImpl> usb_service); + + WebUsbServiceImpl* GetUsbServiceForTesting(int64_t registration_id) { + return GetUsbService(registration_id); + } + + private: + using UsbServiceCallback = base::OnceCallback<void(WebUsbServiceImpl*)>; + using UsbServiceDeviceEventCallback = + base::RepeatingCallback<void(const device::mojom::UsbDeviceInfo&, + WebUsbServiceImpl*)>; + + // ServiceWorkerDeviceDelegateObserver: + void RegistrationAdded(int64_t registration_id) override; + void RegistrationRemoved(int64_t registration_id) override; + + // Dispatch the device event to all registered service workers. + void DispatchUsbDeviceEventToWorkers( + const device::mojom::UsbDeviceInfo& device_info, + UsbServiceDeviceEventCallback callback); + + // Get UsbService for the `registration_id`. It can be null if no live + // UsbService for the `registration_id`. + WebUsbServiceImpl* GetUsbService(int64_t registration_id); + + // The map for registration id to the latest registered UsbService. + base::flat_map<int64_t, base::WeakPtr<WebUsbServiceImpl>> usb_services_; + + base::ScopedObservation<UsbDelegate, ServiceWorkerUsbDelegateObserver> + usb_delegate_observation{this}; +}; + +} // namespace content + +namespace base { + +template <> +struct ScopedObservationTraits<content::UsbDelegate, + content::ServiceWorkerUsbDelegateObserver> { + static void AddObserver(content::UsbDelegate* source, + content::ServiceWorkerUsbDelegateObserver* observer) { + source->AddObserver(observer->GetBrowserContext(), observer); + } + static void RemoveObserver( + content::UsbDelegate* source, + content::ServiceWorkerUsbDelegateObserver* observer) { + source->RemoveObserver(observer->GetBrowserContext(), observer); + } +}; + +} // namespace base + +#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_USB_DELEGATE_OBSERVER_H_
diff --git a/content/browser/service_worker/service_worker_usb_delegate_observer_unittest.cc b/content/browser/service_worker/service_worker_usb_delegate_observer_unittest.cc new file mode 100644 index 0000000..dbe871ce --- /dev/null +++ b/content/browser/service_worker/service_worker_usb_delegate_observer_unittest.cc
@@ -0,0 +1,443 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <cstddef> +#include <memory> +#include <vector> + +#include "base/memory/scoped_refptr.h" +#include "base/run_loop.h" +#include "base/strings/stringprintf.h" +#include "base/test/gmock_callback_support.h" +#include "base/test/test_future.h" +#include "content/browser/service_worker/embedded_worker_test_helper.h" +#include "content/browser/service_worker/service_worker_device_delegate_observer_unittest.h" +#include "content/browser/service_worker/service_worker_registration.h" +#include "content/browser/service_worker/service_worker_test_utils.h" +#include "content/browser/service_worker/service_worker_usb_delegate_observer.h" +#include "content/browser/service_worker/service_worker_version.h" +#include "content/browser/usb/usb_test_utils.h" +#include "content/browser/usb/web_usb_service_impl.h" +#include "content/public/browser/content_browser_client.h" +#include "content/public/browser/usb_delegate.h" +#include "content/public/test/navigation_simulator.h" +#include "content/public/test/test_utils.h" +#include "content/test/test_web_contents.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "services/device/public/cpp/test/fake_usb_device_manager.h" +#include "services/device/public/mojom/usb_manager_client.mojom.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/service_worker/service_worker_status_code.h" +#include "third_party/blink/public/mojom/usb/web_usb_service.mojom.h" +#include "url/origin.h" + +namespace content { + +namespace { + +using ::base::test::RunClosure; +using ::base::test::TestFuture; +using ::testing::_; +using ::testing::Ref; +using ::testing::Return; + +const char kTestUrl[] = "https://www.google.com"; + +class ServiceWorkerUsbDelegateObserverTest + : public content::ServiceWorkerDeviceDelegateObserverTest { + public: + ServiceWorkerUsbDelegateObserverTest() = default; + ServiceWorkerUsbDelegateObserverTest(ServiceWorkerUsbDelegateObserverTest&) = + delete; + ServiceWorkerUsbDelegateObserverTest& operator=( + ServiceWorkerUsbDelegateObserverTest&) = delete; + ~ServiceWorkerUsbDelegateObserverTest() override = default; + + void SetUp() override { + content::ServiceWorkerDeviceDelegateObserverTest::SetUp(); + + // Connect with the FakeUsbDeviceManager. + mojo::PendingRemote<device::mojom::UsbDeviceManager> pending_device_manager; + usb_device_manager_.AddReceiver( + pending_device_manager.InitWithNewPipeAndPassReceiver()); + + // For tests, all devices are permitted by default. + ON_CALL(usb_delegate(), HasDevicePermission).WillByDefault(Return(true)); + ON_CALL(usb_delegate(), PageMayUseUsb).WillByDefault(Return(true)); + + // Forward calls to the fake device manager. + ON_CALL(usb_delegate(), GetDevices) + .WillByDefault( + [this]( + auto* browser_context, + device::mojom::UsbDeviceManager::GetDevicesCallback callback) { + usb_device_manager_.GetDevices(nullptr, std::move(callback)); + }); + ON_CALL(usb_delegate(), GetDevice) + .WillByDefault( + [this]( + auto* browser_context, const std::string& guid, + base::span<const uint8_t> blocked_interface_classes, + mojo::PendingReceiver<device::mojom::UsbDevice> device_receiver, + mojo::PendingRemote<device::mojom::UsbDeviceClient> + device_client) { + usb_device_manager_.GetDevice( + guid, + std::vector<uint8_t>(blocked_interface_classes.begin(), + blocked_interface_classes.end()), + std::move(device_receiver), std::move(device_client)); + }); + ON_CALL(usb_delegate(), GetDeviceInfo) + .WillByDefault([this](auto* browser_context, const std::string& guid) { + return usb_device_manager_.GetDeviceInfo(guid); + }); + } + + void RegisterUsbManagerClient( + const mojo::Remote<blink::mojom::WebUsbService>& service, + MockDeviceManagerClient& device_manager_client) { + service->SetClient(device_manager_client.CreateInterfacePtrAndBind()); + FlushUsbServicePipe(service); + } + + device::mojom::UsbDeviceInfoPtr ConnectDevice( + scoped_refptr<device::FakeUsbDeviceInfo> device, + device::MockUsbMojoDevice* mock_device) { + auto device_info = usb_device_manager_.AddDevice(std::move(device)); + if (mock_device) { + usb_device_manager_.SetMockForDevice(device_info->guid, mock_device); + } + usb_delegate().OnDeviceAdded(*device_info); + return device_info; + } + + void DisconnectDevice(scoped_refptr<device::FakeUsbDeviceInfo> device) { + auto device_info = device->GetDeviceInfo().Clone(); + usb_device_manager_.RemoveDevice(std::move(device)); + usb_delegate().OnDeviceRemoved(*device_info); + } + + scoped_refptr<device::FakeUsbDeviceInfo> CreateFakeDevice() { + return base::MakeRefCounted<device::FakeUsbDeviceInfo>( + 0x1234, 0x5678, "ACME", "Frobinator", "ABCDEF"); + } + + device::mojom::UsbOpenDeviceResultPtr NewUsbOpenDeviceSuccess() { + return device::mojom::UsbOpenDeviceResult::NewSuccess( + device::mojom::UsbOpenDeviceSuccess::OK); + } + + mojo::Remote<blink::mojom::WebUsbService> CreateUsbService( + ServiceWorkerVersion* version) { + auto const& origin = version->key().origin(); + mojo::Remote<blink::mojom::WebUsbService> service; + EXPECT_CALL(usb_delegate(), IsServiceWorkerAllowedForOrigin(origin)) + .Times(2) + .WillRepeatedly(Return(true)); + auto* embedded_worker = version->embedded_worker(); + embedded_worker->BindUsbService(origin, + service.BindNewPipeAndPassReceiver()); + return service; + } + + void FlushUsbServicePipe( + const mojo::Remote<blink::mojom::WebUsbService>& usb_service) { + // Run GetDevices to flush mojo request. + TestFuture<std::vector<device::mojom::UsbDeviceInfoPtr>> devices_future; + usb_service->GetDevices(devices_future.GetCallback()); + EXPECT_TRUE(devices_future.Wait()); + } + + MockUsbDelegate& usb_delegate() { return test_client_.delegate(); } + + device::FakeUsbDeviceManager& usb_device_manager() { + return usb_device_manager_; + } + + MockDeviceManagerClient& device_manager_client() { + return device_manager_client_; + } + + std::tuple<blink::ServiceWorkerStatusCode, + scoped_refptr<ServiceWorkerRegistration>> + FindRegistration(int64_t registration_id, const blink::StorageKey& key) { + TestFuture<blink::ServiceWorkerStatusCode, + scoped_refptr<ServiceWorkerRegistration>> + future; + registry()->FindRegistrationForId(registration_id, key, + future.GetCallback()); + return future.Take(); + } + + void ServiceWorkerInstalling( + scoped_refptr<ServiceWorkerVersion> version) override { + // This simulates the scenario where the service worker script has an USB + // event handler. + version->set_has_usb_event_handlers(true); + } + + protected: + MockDeviceManagerClient device_manager_client_; + UsbTestContentBrowserClient test_client_; + device::FakeUsbDeviceManager usb_device_manager_; + ScopedContentBrowserClientSetting setting{&test_client_}; +}; + +} // namespace + +TEST_F(ServiceWorkerUsbDelegateObserverTest, OnDeviceAdded) { + size_t num_workers = 10; + std::vector<const GURL> origins; + std::vector<scoped_refptr<ServiceWorkerRegistration>> registrations; + std::vector<int64_t> version_ids; + std::vector<mojo::Remote<blink::mojom::WebUsbService>> usb_services( + num_workers); + std::vector<MockDeviceManagerClient> device_manager_clients(num_workers); + for (size_t idx = 0; idx < num_workers; ++idx) { + origins.push_back( + GURL(base::StringPrintf("https://www.example%zu.com", idx))); + registrations.push_back(InstallServiceWorker(origins[idx])); + auto* version = registrations[idx]->newest_installed_version(); + ASSERT_NE(version, nullptr); + version_ids.push_back(version->version_id()); + StartServiceWorker(version); + usb_services[idx] = CreateUsbService(version); + RegisterUsbManagerClient(usb_services[idx], device_manager_clients[idx]); + } + + mojo::Remote<device::mojom::UsbDevice> device; + device::MockUsbMojoDevice mock_device; + auto fake_device_info = CreateFakeDevice(); + + // DeviceAdded event when the service worker is running. + { + std::vector<TestFuture<device::mojom::UsbDeviceInfoPtr>> + device_added_futures(num_workers); + for (size_t idx = 0; idx < num_workers; ++idx) { + auto& device_added_future = device_added_futures[idx]; + auto* version = context()->GetLiveVersion(version_ids[idx]); + ASSERT_NE(version, nullptr); + EXPECT_EQ(version->running_status(), EmbeddedWorkerStatus::RUNNING); + EXPECT_CALL(device_manager_clients[idx], OnDeviceAdded) + .WillOnce( + [&](auto d) { device_added_future.SetValue(std::move(d)); }); + } + auto device_info = ConnectDevice(fake_device_info, &mock_device); + for (size_t idx = 0; idx < num_workers; ++idx) { + EXPECT_EQ(device_added_futures[idx].Get()->guid, device_info->guid); + } + } +} + +TEST_F(ServiceWorkerUsbDelegateObserverTest, OnDeviceRemoved) { + size_t num_workers = 10; + std::vector<const GURL> origins; + std::vector<scoped_refptr<ServiceWorkerRegistration>> registrations; + std::vector<int64_t> version_ids; + std::vector<mojo::Remote<blink::mojom::WebUsbService>> usb_services( + num_workers); + std::vector<MockDeviceManagerClient> device_manager_clients(num_workers); + for (size_t idx = 0; idx < num_workers; ++idx) { + origins.push_back( + GURL(base::StringPrintf("https://www.example%zu.com", idx))); + registrations.push_back(InstallServiceWorker(origins[idx])); + auto* version = registrations[idx]->newest_installed_version(); + ASSERT_NE(version, nullptr); + version_ids.push_back(version->version_id()); + StartServiceWorker(version); + usb_services[idx] = CreateUsbService(version); + RegisterUsbManagerClient(usb_services[idx], device_manager_clients[idx]); + } + + auto fake_device_info = CreateFakeDevice(); + usb_device_manager_.AddDevice(fake_device_info); + // DeviceRemoved event when the service worker is running. + { + std::vector<TestFuture<device::mojom::UsbDeviceInfoPtr>> + device_removed_futures(num_workers); + for (size_t idx = 0; idx < num_workers; ++idx) { + auto& device_removed_future = device_removed_futures[idx]; + auto* version = context()->GetLiveVersion(version_ids[idx]); + ASSERT_NE(version, nullptr); + EXPECT_EQ(version->running_status(), EmbeddedWorkerStatus::RUNNING); + EXPECT_CALL(device_manager_clients[idx], OnDeviceRemoved) + .WillOnce( + [&](auto d) { device_removed_future.SetValue(std::move(d)); }); + } + DisconnectDevice(fake_device_info); + for (size_t idx = 0; idx < num_workers; ++idx) { + EXPECT_EQ(device_removed_futures[idx].Get()->guid, + fake_device_info->guid()); + } + } +} + +TEST_F(ServiceWorkerUsbDelegateObserverTest, OnDeviceManagerConnectionError) { + size_t num_workers = 10; + std::vector<const GURL> origins; + std::vector<scoped_refptr<ServiceWorkerRegistration>> registrations; + std::vector<int64_t> version_ids; + std::vector<mojo::Remote<blink::mojom::WebUsbService>> usb_services( + num_workers); + std::vector<MockDeviceManagerClient> device_manager_clients(num_workers); + for (size_t idx = 0; idx < num_workers; ++idx) { + origins.push_back( + GURL(base::StringPrintf("https://www.example%zu.com", idx))); + registrations.push_back(InstallServiceWorker(origins[idx])); + auto* version = registrations[idx]->newest_installed_version(); + ASSERT_NE(version, nullptr); + version_ids.push_back(version->version_id()); + StartServiceWorker(version); + usb_services[idx] = CreateUsbService(version); + RegisterUsbManagerClient(usb_services[idx], device_manager_clients[idx]); + } + + for (size_t idx = 0; idx < num_workers; ++idx) { + auto* version = context()->GetLiveVersion(version_ids[idx]); + ASSERT_NE(version, nullptr); + EXPECT_EQ(version->running_status(), EmbeddedWorkerStatus::RUNNING); + EXPECT_EQ(context() + ->usb_delegate_observer() + ->GetUsbServiceForTesting(registrations[idx]->id()) + ->clients() + .size(), + 1u); + } + usb_delegate().OnDeviceManagerConnectionError(); + for (size_t idx = 0; idx < num_workers; ++idx) { + EXPECT_TRUE(context() + ->usb_delegate_observer() + ->GetUsbServiceForTesting(registrations[idx]->id()) + ->clients() + .empty()); + } +} + +TEST_F(ServiceWorkerUsbDelegateObserverTest, OnPermissionRevoked) { + device::MockUsbMojoDevice mock_device; + auto fake_device_info = CreateFakeDevice(); + auto device_info = ConnectDevice(fake_device_info, &mock_device); + + size_t num_workers = 10; + std::vector<const GURL> origins; + std::vector<scoped_refptr<ServiceWorkerRegistration>> registrations; + std::vector<int64_t> version_ids; + std::vector<mojo::Remote<blink::mojom::WebUsbService>> usb_services( + num_workers); + std::vector<MockDeviceManagerClient> device_manager_clients(num_workers); + for (size_t idx = 0; idx < num_workers; ++idx) { + origins.push_back( + GURL(base::StringPrintf("https://www.example%zu.com", idx))); + registrations.push_back(InstallServiceWorker(origins[idx])); + auto* version = registrations[idx]->newest_installed_version(); + ASSERT_NE(version, nullptr); + version_ids.push_back(version->version_id()); + StartServiceWorker(version); + usb_services[idx] = CreateUsbService(version); + RegisterUsbManagerClient(usb_services[idx], device_manager_clients[idx]); + } + + for (size_t idx = 0; idx < num_workers; ++idx) { + auto* version = registrations[idx]->GetNewestVersion(); + ASSERT_NE(version, nullptr); + StartServiceWorker(version); + EXPECT_EQ(version->running_status(), EmbeddedWorkerStatus::RUNNING); + + mojo::Remote<device::mojom::UsbDevice> device; + usb_services[idx]->GetDevice(device_info->guid, + device.BindNewPipeAndPassReceiver()); + EXPECT_CALL(mock_device, Open) + .WillOnce(base::test::RunOnceCallback<0>(NewUsbOpenDeviceSuccess())); + TestFuture<device::mojom::UsbOpenDeviceResultPtr> open_future; + device->Open(open_future.GetCallback()); + EXPECT_TRUE(open_future.Get()->is_success()); + + auto origin = url::Origin::Create(origins[idx]); + base::RunLoop run_loop; + EXPECT_CALL(usb_delegate(), GetDeviceInfo) + .WillOnce(Return(device_info.get())); + EXPECT_CALL(usb_delegate(), + HasDevicePermission(_, origin, Ref(*device_info))) + .WillOnce(Return(false)); + EXPECT_CALL(mock_device, Close) + .WillOnce(RunClosure(run_loop.QuitClosure())); + usb_delegate().OnPermissionRevoked(origin); + run_loop.Run(); + + testing::Mock::VerifyAndClearExpectations(&usb_delegate()); + } +} + +TEST_F(ServiceWorkerUsbDelegateObserverTest, + RemovedFromUsbDelegateObserverWhenNoRegistration) { + const GURL origin(kTestUrl); + EXPECT_TRUE(usb_delegate().observer_list().empty()); + auto registration = InstallServiceWorker(origin); + auto* version = registration->newest_installed_version(); + ASSERT_NE(version, nullptr); + StartServiceWorker(version); + auto usb_service = CreateUsbService(version); + EXPECT_FALSE(usb_delegate().observer_list().empty()); + + TestFuture<blink::ServiceWorkerStatusCode> unregister_future; + context()->UnregisterServiceWorker(registration->scope(), registration->key(), + /*is_immediate=*/true, + unregister_future.GetCallback()); + EXPECT_EQ(unregister_future.Get<0>(), blink::ServiceWorkerStatusCode::kOk); + // Wait until all of the + // ServiceWorkerDeviceDelegateObserver::OnRegistrationDeleted are called. + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(usb_delegate().observer_list().empty()); +} + +TEST_F(ServiceWorkerUsbDelegateObserverTest, + HasLatestUsbServiceAfterServiceWorkerStopThenStart) { + device::MockUsbMojoDevice mock_device; + auto fake_device_info = CreateFakeDevice(); + auto device_info = ConnectDevice(fake_device_info, &mock_device); + + const GURL origin(kTestUrl); + auto registration = InstallServiceWorker(origin); + auto* version = registration->newest_installed_version(); + ASSERT_NE(version, nullptr); + StartServiceWorker(version); + auto usb_service = CreateUsbService(version); + EXPECT_TRUE(context()->usb_delegate_observer()->GetUsbServiceForTesting( + registration->id())); + + // Create a connection so that we can get to the point when the UsbService is + // destroyed by expecting DecrementConnectionCount being called. + mojo::Remote<device::mojom::UsbDevice> device; + usb_service->GetDevice(device_info->guid, + device.BindNewPipeAndPassReceiver()); + EXPECT_CALL(mock_device, Open) + .WillOnce(base::test::RunOnceCallback<0>(NewUsbOpenDeviceSuccess())); + TestFuture<device::mojom::UsbOpenDeviceResultPtr> open_future; + device->Open(open_future.GetCallback()); + EXPECT_TRUE(open_future.Get()->is_success()); + + // Simulate the scenario of stopping the worker, the UsbService will be + // destroyed. + base::RunLoop run_loop; + usb_service.set_disconnect_handler(run_loop.QuitClosure()); + EXPECT_CALL( + usb_delegate(), + DecrementConnectionCount(_, url::Origin::Create(origin))) // never called + .WillOnce(RunClosure(run_loop.QuitClosure())); + StopServiceWorker(version); + usb_service.reset(); + run_loop.Run(); + EXPECT_FALSE(context()->usb_delegate_observer()->GetUsbServiceForTesting( + registration->id())); + + // Then start the worker and create a new UsbService. + StartServiceWorker(version); + usb_service = CreateUsbService(version); + EXPECT_TRUE(context()->usb_delegate_observer()->GetUsbServiceForTesting( + registration->id())); +} + +} // namespace content
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc index 6c977f9..c52cebb 100644 --- a/content/browser/service_worker/service_worker_version.cc +++ b/content/browser/service_worker/service_worker_version.cc
@@ -43,6 +43,7 @@ #include "content/browser/service_worker/service_worker_host.h" #include "content/browser/service_worker/service_worker_installed_scripts_sender.h" #include "content/browser/service_worker/service_worker_security_utils.h" +#include "content/browser/service_worker/service_worker_usb_delegate_observer.h" #include "content/common/content_navigation_policy.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" @@ -427,6 +428,11 @@ // event handlers. context_->hid_delegate_observer()->UpdateHasEventHandlers( registration_id_, has_hid_event_handlers_); + + // Notify the usb delegate observer if the active service worker has any usb + // event handlers. + context_->usb_delegate_observer()->UpdateHasEventHandlers( + registration_id_, has_usb_event_handlers_); #endif // !BUILDFLAG(IS_ANDROID) } else if (status == REDUNDANT) { embedded_worker_->OnWorkerVersionDoomed();
diff --git a/content/browser/usb/usb_test_utils.cc b/content/browser/usb/usb_test_utils.cc index 97ae045..6c382d9 100644 --- a/content/browser/usb/usb_test_utils.cc +++ b/content/browser/usb/usb_test_utils.cc
@@ -10,6 +10,10 @@ namespace content { +MockDeviceManagerClient::MockDeviceManagerClient() = default; + +MockDeviceManagerClient::~MockDeviceManagerClient() = default; + MockUsbDelegate::MockUsbDelegate() = default; MockUsbDelegate::~MockUsbDelegate() = default; @@ -49,4 +53,10 @@ observer.OnPermissionRevoked(origin); } +void MockUsbDelegate::OnDeviceManagerConnectionError() { + for (auto& observer : observer_list_) { + observer.OnDeviceManagerConnectionError(); + } +} + } // namespace content
diff --git a/content/browser/usb/usb_test_utils.h b/content/browser/usb/usb_test_utils.h index 5cd67f5..aaf5d5c 100644 --- a/content/browser/usb/usb_test_utils.h +++ b/content/browser/usb/usb_test_utils.h
@@ -13,11 +13,13 @@ #include "content/public/browser/content_browser_client.h" #include "content/public/browser/usb_chooser.h" #include "content/public/browser/usb_delegate.h" +#include "mojo/public/cpp/bindings/associated_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "services/device/public/mojom/usb_device.mojom-forward.h" #include "services/device/public/mojom/usb_enumeration_options.mojom-forward.h" #include "services/device/public/mojom/usb_manager.mojom-forward.h" +#include "services/device/public/mojom/usb_manager_client.mojom.h" #include "testing/gmock/include/gmock/gmock.h" #include "third_party/blink/public/mojom/usb/web_usb_service.mojom.h" #include "url/origin.h" @@ -26,6 +28,43 @@ class RenderFrameHost; +// A mock UsbDeviceManagerClient implementation that can be used to listen for +// USB device connection events. +class MockDeviceManagerClient : public device::mojom::UsbDeviceManagerClient { + public: + MockDeviceManagerClient(); + MockDeviceManagerClient(MockDeviceManagerClient&) = delete; + MockDeviceManagerClient& operator=(MockDeviceManagerClient&) = delete; + ~MockDeviceManagerClient() override; + + void Bind( + mojo::PendingAssociatedReceiver<device::mojom::UsbDeviceManagerClient> + receiver) { + receiver_.Bind(std::move(receiver)); + } + + mojo::PendingAssociatedRemote<device::mojom::UsbDeviceManagerClient> + CreateInterfacePtrAndBind() { + auto client = receiver_.BindNewEndpointAndPassRemote(); + receiver_.set_disconnect_handler(base::BindOnce( + &MockDeviceManagerClient::OnConnectionError, base::Unretained(this))); + return client; + } + + MOCK_METHOD(void, OnDeviceAdded, (device::mojom::UsbDeviceInfoPtr)); + MOCK_METHOD(void, OnDeviceRemoved, (device::mojom::UsbDeviceInfoPtr)); + + MOCK_METHOD(void, ConnectionError, ()); + void OnConnectionError() { + receiver_.reset(); + ConnectionError(); + } + + private: + mojo::AssociatedReceiver<device::mojom::UsbDeviceManagerClient> receiver_{ + this}; +}; + // A UsbDelegate implementation that can be mocked for tests. class MockUsbDelegate : public UsbDelegate { public: @@ -51,6 +90,7 @@ void OnDeviceAdded(const device::mojom::UsbDeviceInfo& device); void OnDeviceRemoved(const device::mojom::UsbDeviceInfo& device); void OnPermissionRevoked(const url::Origin& origin); + void OnDeviceManagerConnectionError(); MOCK_METHOD0(RunChooserInternal, device::mojom::UsbDeviceInfoPtr()); MOCK_METHOD4(AdjustProtectedInterfaceClasses, @@ -91,6 +131,8 @@ MOCK_METHOD2(DecrementConnectionCount, void(BrowserContext*, const url::Origin&)); + const base::ObserverList<Observer>& observer_list() { return observer_list_; } + private: base::ObserverList<UsbDelegate::Observer> observer_list_; };
diff --git a/content/browser/usb/web_usb_service_impl.cc b/content/browser/usb/web_usb_service_impl.cc index 2e946aca..eaa9773c 100644 --- a/content/browser/usb/web_usb_service_impl.cc +++ b/content/browser/usb/web_usb_service_impl.cc
@@ -12,6 +12,7 @@ #include "base/functional/bind.h" #include "base/memory/raw_ptr.h" #include "content/browser/renderer_host/render_frame_host_impl.h" +#include "content/browser/service_worker/service_worker_usb_delegate_observer.h" #include "content/browser/service_worker/service_worker_version.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/browser/browser_thread.h" @@ -135,14 +136,29 @@ service_worker_version_(std::move(service_worker_version)), origin_(origin) { auto* delegate = GetContentClient()->browser()->GetUsbDelegate(); - if (delegate) + if (delegate && render_frame_host_) { delegate->AddObserver(GetBrowserContext(), this); + } else if (service_worker_version_) { +#if !BUILDFLAG(IS_ANDROID) + // For service worker case, it relies on ServiceWorkerUsbDelegateObserver to + // be the broker between UsbDelegate and UsbService. + auto context = service_worker_version_->context(); + if (context) { + context->usb_delegate_observer()->RegisterUsbService( + service_worker_version_->registration_id(), + weak_factory_.GetWeakPtr()); + } +#else + NOTREACHED_NORETURN(); +#endif // !BUILDFLAG(IS_ANDROID) + } } WebUsbServiceImpl::~WebUsbServiceImpl() { auto* delegate = GetContentClient()->browser()->GetUsbDelegate(); - if (delegate) + if (delegate && render_frame_host_) { delegate->RemoveObserver(GetBrowserContext(), this); + } } // static
diff --git a/content/browser/usb/web_usb_service_impl.h b/content/browser/usb/web_usb_service_impl.h index add9008..a344fee 100644 --- a/content/browser/usb/web_usb_service_impl.h +++ b/content/browser/usb/web_usb_service_impl.h
@@ -67,6 +67,22 @@ mojo::PendingAssociatedRemote<device::mojom::UsbDeviceManagerClient> client) override; + // UsbDelegate::Observer implementation: + void OnDeviceAdded(const device::mojom::UsbDeviceInfo& device_info) override; + void OnDeviceRemoved( + const device::mojom::UsbDeviceInfo& device_info) override; + void OnDeviceManagerConnectionError() override; + void OnPermissionRevoked(const url::Origin& origin) override; + + const mojo::AssociatedRemoteSet<device::mojom::UsbDeviceManagerClient>& + clients() const { + return clients_; + } + + base::WeakPtr<content::ServiceWorkerVersion> service_worker_version() { + return service_worker_version_; + } + private: class UsbDeviceClient; @@ -80,13 +96,6 @@ GetDevicesCallback callback, std::vector<device::mojom::UsbDeviceInfoPtr> device_info_list); - // UsbDelegate::Observer implementation: - void OnDeviceAdded(const device::mojom::UsbDeviceInfo& device_info) override; - void OnDeviceRemoved( - const device::mojom::UsbDeviceInfo& device_info) override; - void OnDeviceManagerConnectionError() override; - void OnPermissionRevoked(const url::Origin& origin) override; - void IncrementConnectionCount(); void DecrementConnectionCount(); void RemoveDeviceClient(const UsbDeviceClient* client);
diff --git a/content/browser/usb/web_usb_service_impl_unittest.cc b/content/browser/usb/web_usb_service_impl_unittest.cc index 1533368..c84a1eb 100644 --- a/content/browser/usb/web_usb_service_impl_unittest.cc +++ b/content/browser/usb/web_usb_service_impl_unittest.cc
@@ -361,7 +361,11 @@ INSTANTIATE_TEST_SUITE_P(WebUsbServiceImplTests, WebUsbServiceImplTest, - Values(kCreateForFrame, kCreateForServiceWorker), + #if !BUILDFLAG(IS_ANDROID) + Values(kCreateForFrame, kCreateForServiceWorker), + #else + Values(kCreateForFrame), + #endif [](const auto& info) { return ServiceCreationTypeToString(info.param); }); @@ -510,7 +514,11 @@ INSTANTIATE_TEST_SUITE_P( WebUsbServiceImplProtectedInterfaceTests, WebUsbServiceImplProtectedInterfaceTest, +#if !BUILDFLAG(IS_ANDROID) Combine(Values(kCreateForFrame, kCreateForServiceWorker), +#else + Combine(Values(kCreateForFrame), +#endif Values(device::mojom::kUsbAudioClass, device::mojom::kUsbHidClass, device::mojom::kUsbMassStorageClass,
diff --git a/content/browser/webid/federated_auth_request_impl_unittest.cc b/content/browser/webid/federated_auth_request_impl_unittest.cc index 25042ba..6c720ca 100644 --- a/content/browser/webid/federated_auth_request_impl_unittest.cc +++ b/content/browser/webid/federated_auth_request_impl_unittest.cc
@@ -3157,7 +3157,12 @@ base::BindOnce(&NavigateToUrl, web_contents(), GURL(kRpOtherUrl)))); RequestExpectations expectations = { - /*return_status=*/absl::nullopt, FederatedAuthRequestResult::kError, + /*return_status=*/absl::nullopt, + // When the RenderFrameHost changes on navigation, no console message is + // received, so pass FederatedAuthRequestResult::kSuccess. + main_rfh()->ShouldChangeRenderFrameHostOnSameSiteNavigation() + ? FederatedAuthRequestResult::kSuccess + : FederatedAuthRequestResult::kError, /*standalone_console_message=*/absl::nullopt, /*selected_idp_config_url=*/absl::nullopt}; RunAuthTest(kDefaultRequestParameters, expectations, kConfigurationValid);
diff --git a/content/browser/webid/webid_browsertest.cc b/content/browser/webid/webid_browsertest.cc index 04861db..cb6b1b0 100644 --- a/content/browser/webid/webid_browsertest.cc +++ b/content/browser/webid/webid_browsertest.cc
@@ -811,6 +811,14 @@ idp_server()->SetConfigResponseDetails(config_details); + // Create a WebContents that represents the modal dialog, specifically + // the structure that the Identity Registry hangs to. + Shell* modal = CreateBrowser(); + auto config_url = GURL(BaseIdpUrl()); + + modal->LoadURL(config_url); + EXPECT_TRUE(WaitForLoadStop(modal->web_contents())); + auto mock = std::make_unique< ::testing::NiceMock<MockIdentityRequestDialogController>>(); test_browser_client_->SetIdentityRequestDialogController(std::move(mock)); @@ -819,8 +827,6 @@ static_cast<MockIdentityRequestDialogController*>( test_browser_client_->GetIdentityRequestDialogControllerForTests()); - auto config_url = GURL(BaseIdpUrl()); - // Expects the account chooser to be opened. Selects the first account. EXPECT_CALL(*controller, ShowAccountsDialog(_, _, _, _, _, _, _)) .WillOnce(::testing::WithArg<5>([&config_url](auto on_selected) { @@ -830,11 +836,6 @@ /* is_sign_in= */ true); })); - // Create a WebContents that represents the modal dialog, specifically - // the structure that the Identity Registry hangs to. - Shell* modal = CreateBrowser(); - modal->LoadURL(config_url); - base::RunLoop run_loop; EXPECT_CALL(*controller, ShowModalDialog(_, _)) .WillOnce(::testing::WithArg<0>(
diff --git a/content/common/features.cc b/content/common/features.cc index 41726e8..52443a0 100644 --- a/content/common/features.cc +++ b/content/common/features.cc
@@ -15,10 +15,6 @@ "BeforeUnloadBrowserResponseQueue", base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kNavigationUpdatesChildViewsVisibility, - "NavigationUpdatesChildViewsVisibility", - base::FEATURE_ENABLED_BY_DEFAULT); - #if BUILDFLAG(IS_ANDROID) BASE_FEATURE(kOptimizeImmHideCalls, "OptimizeImmHideCalls",
diff --git a/content/common/features.h b/content/common/features.h index 09988d68..5b5feb19 100644 --- a/content/common/features.h +++ b/content/common/features.h
@@ -18,10 +18,6 @@ // navigation network responses in a kHigh priority queue. BASE_DECLARE_FEATURE(kBeforeUnloadBrowserResponseQueue); -// When enabled, RenderFrameHostManager::CommitPending will also update the -// visibility of all child views, not just that of the main frame. -CONTENT_EXPORT BASE_DECLARE_FEATURE(kNavigationUpdatesChildViewsVisibility); - #if BUILDFLAG(IS_ANDROID) // Enables skipping of calls to hideSoftInputFromWindow when there is not a // keyboard currently visible.
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index a628646..2a74c42 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -766,6 +766,12 @@ "NavigationNetworkResponseQueue", base::FEATURE_DISABLED_BY_DEFAULT); +// When enabled, RenderFrameHostManager::CommitPending will also update the +// visibility of all child views, not just that of the main frame. +BASE_FEATURE(kNavigationUpdatesChildViewsVisibility, + "NavigationUpdatesChildViewsVisibility", + base::FEATURE_ENABLED_BY_DEFAULT); + // If the network service is enabled, runs it in process. BASE_FEATURE(kNetworkServiceInProcess, "NetworkServiceInProcess2",
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index d5f60a85..27bb011 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -175,6 +175,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kMojoVideoCapture); CONTENT_EXPORT BASE_DECLARE_FEATURE(kMojoVideoCaptureSecondary); CONTENT_EXPORT BASE_DECLARE_FEATURE(kNavigationNetworkResponseQueue); +CONTENT_EXPORT BASE_DECLARE_FEATURE(kNavigationUpdatesChildViewsVisibility); CONTENT_EXPORT BASE_DECLARE_FEATURE(kNetworkQualityEstimatorWebHoldback); CONTENT_EXPORT BASE_DECLARE_FEATURE(kNetworkServiceInProcess); CONTENT_EXPORT BASE_DECLARE_FEATURE(kNotificationContentImage);
diff --git a/content/public/test/accessibility_notification_waiter.cc b/content/public/test/accessibility_notification_waiter.cc index 8a8654cf..9d57299 100644 --- a/content/public/test/accessibility_notification_waiter.cc +++ b/content/public/test/accessibility_notification_waiter.cc
@@ -33,7 +33,7 @@ generated_event_to_wait_for_(absl::nullopt), loop_runner_(std::make_unique<base::RunLoop>()), loop_runner_quit_closure_(loop_runner_->QuitClosure()) { - ListenToAllFrames(web_contents); + Setup(web_contents); } AccessibilityNotificationWaiter::AccessibilityNotificationWaiter( @@ -45,14 +45,7 @@ generated_event_to_wait_for_(absl::nullopt), loop_runner_(std::make_unique<base::RunLoop>()), loop_runner_quit_closure_(loop_runner_->QuitClosure()) { - ListenToAllFrames(web_contents); - static_cast<WebContentsImpl*>(web_contents) - ->AddAccessibilityMode(accessibility_mode); - // Add the the accessibility mode on BrowserAccessibilityState so it can be - // also be added to AXPlatformNode, auralinux uses this to determine if it - // should enable accessibility or not. - BrowserAccessibilityState::GetInstance()->AddAccessibilityModeFlags( - accessibility_mode); + Setup(web_contents, accessibility_mode); } AccessibilityNotificationWaiter::AccessibilityNotificationWaiter( @@ -64,30 +57,51 @@ generated_event_to_wait_for_(event_type), loop_runner_(std::make_unique<base::RunLoop>()), loop_runner_quit_closure_(loop_runner_->QuitClosure()) { - ListenToAllFrames(web_contents); - static_cast<WebContentsImpl*>(web_contents) - ->AddAccessibilityMode(accessibility_mode); - // Add the the accessibility mode on BrowserAccessibilityState so it can be - // also be added to AXPlatformNode, auralinux uses this to determine if it - // should enable accessibility or not. - BrowserAccessibilityState::GetInstance()->AddAccessibilityModeFlags( - accessibility_mode); + Setup(web_contents, accessibility_mode); +} + +AccessibilityNotificationWaiter::AccessibilityNotificationWaiter( + WebContents* web_contents, + ui::AXMode accessibility_mode, + ax::mojom::Event event_type, + std::set<GURL> urls_to_listen_to) + : WebContentsObserver(web_contents), + event_to_wait_for_(event_type), + generated_event_to_wait_for_(absl::nullopt), + urls_to_listen_to(urls_to_listen_to), + loop_runner_(std::make_unique<base::RunLoop>()), + loop_runner_quit_closure_(loop_runner_->QuitClosure()) { + Setup(web_contents, accessibility_mode); +} + +void AccessibilityNotificationWaiter::Setup(WebContents* web_contents, + ui::AXMode accessibility_mode) { + DCHECK(web_contents); + ListenToFrames(web_contents); + if (accessibility_mode != ui::AXMode::kNone) { + static_cast<WebContentsImpl*>(web_contents) + ->AddAccessibilityMode(accessibility_mode); + // Add the the accessibility mode on BrowserAccessibilityState so it can be + // also be added to AXPlatformNode, auralinux uses this to determine if it + // should enable accessibility or not. + BrowserAccessibilityState::GetInstance()->AddAccessibilityModeFlags( + accessibility_mode); + } } AccessibilityNotificationWaiter::~AccessibilityNotificationWaiter() = default; -void AccessibilityNotificationWaiter::ListenToAllFrames( +void AccessibilityNotificationWaiter::ListenToFrames( WebContents* web_contents) { if (event_to_wait_for_) VLOG(1) << "Waiting for AccessibilityEvent " << *event_to_wait_for_; WebContentsImpl* web_contents_impl = static_cast<WebContentsImpl*>(web_contents); - FrameTree::NodeRange nodes = - web_contents_impl->GetPrimaryFrameTree().NodesIncludingInnerTreeNodes(); - for (FrameTreeNode* node : nodes) { + auto frames = GetFramesToListenTo(web_contents_impl); + for (RenderFrameHostImpl* frame : frames) { frame_count_++; - ListenToFrame(node->current_frame_host()); + ListenToFrame(frame); } BrowserPluginGuestManager* guest_manager = web_contents_impl->GetBrowserContext()->GetGuestManager(); @@ -100,9 +114,30 @@ } } +std::vector<RenderFrameHostImpl*> +AccessibilityNotificationWaiter::GetFramesToListenTo( + WebContentsImpl* web_contents_impl) const { + FrameTree::NodeRange all_frames = + web_contents_impl->GetPrimaryFrameTree().NodesIncludingInnerTreeNodes(); + std::vector<RenderFrameHostImpl*> frames_to_listen_to; + + for (auto* frame : all_frames) { + // A consumer might want to specify the exact list of URLs to listen to. + // For example, we might have a test scenario where there is a broken frame + // that is never expected to load, but we want to listen to all other URLs. + if (urls_to_listen_to.size() > 0 && + !urls_to_listen_to.contains(frame->current_url())) { + continue; + } + frames_to_listen_to.push_back(frame->current_frame_host()); + } + + return frames_to_listen_to; +} + bool AccessibilityNotificationWaiter::ListenToGuestWebContents( WebContents* web_contents) { - ListenToAllFrames(web_contents); + ListenToFrames(web_contents); return true; }
diff --git a/content/public/test/accessibility_notification_waiter.h b/content/public/test/accessibility_notification_waiter.h index 15a3b26..aef72ab 100644 --- a/content/public/test/accessibility_notification_waiter.h +++ b/content/public/test/accessibility_notification_waiter.h
@@ -41,6 +41,10 @@ AccessibilityNotificationWaiter(WebContents* web_contents, ui::AXMode accessibility_mode, ui::AXEventGenerator::Event event); + AccessibilityNotificationWaiter(WebContents* web_contents, + ui::AXMode accessibility_mode, + ax::mojom::Event event, + std::set<GURL> urls_to_listen_to); AccessibilityNotificationWaiter(const AccessibilityNotificationWaiter&) = delete; @@ -87,8 +91,17 @@ void Quit(); private: - // Listen to all frames within the frame tree of this WebContents. - void ListenToAllFrames(WebContents* web_contents); + void Setup(WebContents* web_contents, + ui::AXMode accessibility_mode = ui::AXMode::kNone); + + // Listens to the frames specified by the consumer. + void ListenToFrames(WebContents* web_contents); + + // Returns the frames having URLs specified by the consumer in + // `urls_to_listen_to`, or all frames within the frame tree of this + // WebContents by default. + std::vector<RenderFrameHostImpl*> GetFramesToListenTo( + WebContentsImpl* web_contents) const; // Called when iterating over guest web contents so we can listen to // all frames within guests. @@ -133,6 +146,7 @@ absl::optional<ax::mojom::Event> event_to_wait_for_; absl::optional<ui::AXEventGenerator::Event> generated_event_to_wait_for_; + std::set<GURL> urls_to_listen_to; std::unique_ptr<base::RunLoop> loop_runner_; base::RepeatingClosure loop_runner_quit_closure_; int event_target_id_ = 0;
diff --git a/content/public/test/embedded_worker_instance_test_harness.cc b/content/public/test/embedded_worker_instance_test_harness.cc index 5e968f0..fd969eb 100644 --- a/content/public/test/embedded_worker_instance_test_harness.cc +++ b/content/public/test/embedded_worker_instance_test_harness.cc
@@ -12,6 +12,7 @@ #include "content/browser/service_worker/embedded_worker_test_helper.h" #include "content/browser/service_worker/service_worker_hid_delegate_observer.h" #include "content/browser/service_worker/service_worker_test_utils.h" +#include "content/browser/service_worker/service_worker_usb_delegate_observer.h" #include "content/public/test/test_browser_context.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" @@ -61,6 +62,12 @@ hid_delegate && hid_delegate->IsServiceWorkerAllowedForOrigin( url::Origin::Create(origin))); + content::UsbDelegate* usb_delegate = + content::GetContentClientForTesting()->browser()->GetUsbDelegate(); + worker_version_->set_has_usb_event_handlers( + usb_delegate && usb_delegate->IsServiceWorkerAllowedForOrigin( + url::Origin::Create(origin))); + worker_version_->SetStatus(ServiceWorkerVersion::Status::ACTIVATED); pair.first->SetActiveVersion(worker_version_);
diff --git a/content/services/auction_worklet/bidder_worklet_unittest.cc b/content/services/auction_worklet/bidder_worklet_unittest.cc index 54fb06f6..6c20ee7 100644 --- a/content/services/auction_worklet/bidder_worklet_unittest.cc +++ b/content/services/auction_worklet/bidder_worklet_unittest.cc
@@ -5079,10 +5079,10 @@ TEST_F(BidderWorkletTest, ReportWin) { RunReportWinWithFunctionBodyExpectingResult( - "", /*expected_report_url =*/absl::nullopt); + "", /*expected_report_url=*/absl::nullopt); RunReportWinWithFunctionBodyExpectingResult( R"(return "https://ignored.test/")", - /*expected_report_url =*/absl::nullopt); + /*expected_report_url=*/absl::nullopt); RunReportWinWithFunctionBodyExpectingResult( R"(sendReportTo("https://foo.test"))", GURL("https://foo.test/")); @@ -5091,7 +5091,7 @@ RunReportWinWithFunctionBodyExpectingResult( R"(sendReportTo("http://http.not.allowed.test"))", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, @@ -5099,7 +5099,7 @@ "valid HTTPS url."}); RunReportWinWithFunctionBodyExpectingResult( R"(sendReportTo("file:///file.not.allowed.test"))", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, @@ -5107,7 +5107,7 @@ "valid HTTPS url."}); RunReportWinWithFunctionBodyExpectingResult( - R"(sendReportTo(""))", /*expected_report_url =*/absl::nullopt, + R"(sendReportTo(""))", /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, @@ -5116,7 +5116,7 @@ RunReportWinWithFunctionBodyExpectingResult( R"(sendReportTo("https://foo.test");sendReportTo("https://foo.test"))", - /*expected_report_url =*/absl::nullopt, /*expected_ad_beacon_map=*/{}, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, {"https://url.test/:11 Uncaught TypeError: sendReportTo may be called at " @@ -5126,7 +5126,7 @@ R"(sendReportTo({ toString:() => {while(true) {}} }))", - /*expected_report_url =*/absl::nullopt, /*expected_ad_beacon_map=*/{}, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, {"https://url.test/ execution of `reportWin` timed out."}); @@ -5315,7 +5315,7 @@ TEST_F(BidderWorkletTest, ReportWinDateNotAvailable) { RunReportWinWithFunctionBodyExpectingResult( R"(sendReportTo("https://foo.test/" + Date().toString()))", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, @@ -6818,7 +6818,7 @@ 'click': "https://click.example.com/", 'view': "https://view.example.com/", }))", - /*expected_report_url =*/absl::nullopt, expected_ad_beacon_map); + /*expected_report_url=*/absl::nullopt, expected_ad_beacon_map); // Don't call twice. RunReportWinWithFunctionBodyExpectingResult( @@ -6827,7 +6827,7 @@ 'view': "https://view.example.com/", }); registerAdBeacon())", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, @@ -6842,7 +6842,7 @@ }); try { registerAdBeacon() } catch (e) {})", - /*expected_report_url =*/absl::nullopt, expected_ad_beacon_map); + /*expected_report_url=*/absl::nullopt, expected_ad_beacon_map); // If error on first call, can be called again. RunReportWinWithFunctionBodyExpectingResult( @@ -6852,12 +6852,12 @@ 'click': "https://click.example.com/", 'view': "https://view.example.com/", }))", - /*expected_report_url =*/absl::nullopt, expected_ad_beacon_map); + /*expected_report_url=*/absl::nullopt, expected_ad_beacon_map); // Error if no parameters RunReportWinWithFunctionBodyExpectingResult( R"(registerAdBeacon())", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, @@ -6867,7 +6867,7 @@ // Error if parameter is not an object RunReportWinWithFunctionBodyExpectingResult( R"(registerAdBeacon("foo"))", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, @@ -6880,7 +6880,7 @@ 'click': "https://click.example.com/", 1: "https://view.example.com/", }))", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/ {{"click", GURL("https://click.example.com/")}, {"1", GURL("https://view.example.com/")}}, @@ -6894,7 +6894,7 @@ } map[Symbol('a')] = "https://view.example.com/"; registerAdBeacon(map))", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, @@ -6907,7 +6907,7 @@ 'click': "https://click.example.com/", 'view': "gopher://view.example.com/", }))", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, @@ -6920,7 +6920,7 @@ 'click': "https://127.0.0.1/", 'view': "http://view.example.com/", }))", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, @@ -6932,7 +6932,7 @@ R"(registerAdBeacon({ '\ud835': "http://127.0.0.1/", }))", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, @@ -6972,7 +6972,7 @@ R"( sharedStorage.clear(); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, /*expected_errors=*/ @@ -7106,7 +7106,7 @@ sharedStorage.delete('a'); sharedStorage.clear(); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, /*expected_errors=*/{}); @@ -7156,7 +7156,7 @@ R"( sharedStorage.clear(); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, /*expected_errors=*/ @@ -7181,7 +7181,7 @@ } }); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, /*expected_errors=*/ @@ -7655,7 +7655,7 @@ R"( privateAggregation.contributeToHistogram({bucket: 123n, value: 45}); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, std::move(expected_pa_requests), /*expected_errors=*/{}); @@ -7672,7 +7672,7 @@ R"( privateAggregation.contributeToHistogram({bucket: 123n, value: 45}); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, /*expected_errors=*/ @@ -7695,7 +7695,7 @@ privateAggregation.contributeToHistogram( {bucket: 18446744073709551616n, value: 1}); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, std::move(expected_pa_requests), /*expected_errors=*/{}); @@ -7719,7 +7719,7 @@ privateAggregation.contributeToHistogramOnEvent( "reserved.win", {bucket: 18446744073709551616n, value: 2}); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, std::move(expected_pa_requests), /*expected_errors=*/{}); @@ -7736,7 +7736,7 @@ privateAggregation.contributeToHistogram({bucket: 123n, value: 45}); error; )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, std::move(expected_pa_requests), /*expected_errors=*/ @@ -7814,7 +7814,7 @@ privateAggregation.contributeToHistogramOnEvent( "reserved.win", {bucket: 234n, value: 56}); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, std::move(expected_pa_requests), /*expected_errors=*/{}); @@ -7855,7 +7855,7 @@ R"( privateAggregation.contributeToHistogram({bucket: 123n, value: 45}); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_ad_macro_map=*/{}, /*expected_pa_requests=*/{}, /*expected_errors=*/ @@ -9072,24 +9072,24 @@ registerAdMacro('', '111'); registerAdMacro('empty_value', ''); )", - /*expected_report_url =*/absl::nullopt, /*expected_ad_beacon_map=*/{}, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, {{"campaign", "111"}, {"", "111"}, {"empty_value", ""}}); // Any additional arguments after the first 2 are ignored. RunReportWinWithFunctionBodyExpectingResult( R"(registerAdMacro('campaign', '111', ['https://test.example'], 'a');)", - /*expected_report_url =*/absl::nullopt, /*expected_ad_beacon_map=*/{}, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, {{"campaign", "111"}}); // Type conversions happen. RunReportWinWithFunctionBodyExpectingResult( R"(registerAdMacro('campaign', 111);)", - /*expected_report_url =*/absl::nullopt, /*expected_ad_beacon_map=*/{}, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, {{"campaign", "111"}}); RunReportWinWithFunctionBodyExpectingResult( R"(registerAdMacro(null, 234);)", - /*expected_report_url =*/absl::nullopt, /*expected_ad_beacon_map=*/{}, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, {{"null", "234"}}); // Key is case sensitive. @@ -9097,7 +9097,7 @@ R"(registerAdMacro('campaign', '111'); registerAdMacro('CAMPAIGN', '111'); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, {{"campaign", "111"}, {"CAMPAIGN", "111"}}); @@ -9106,7 +9106,7 @@ R"(registerAdMacro('uppercase', 'ABC'); registerAdMacro('lowercase', 'abc'); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, {{"uppercase", "ABC"}, {"lowercase", "abc"}}); @@ -9117,7 +9117,7 @@ registerAdMacro('campaign', '111'); registerAdMacro('publisher', 'abc'); )", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, {{"campaign", "111"}, {"publisher", "abc"}});
diff --git a/content/services/auction_worklet/seller_worklet_unittest.cc b/content/services/auction_worklet/seller_worklet_unittest.cc index f8d6377..df70c36 100644 --- a/content/services/auction_worklet/seller_worklet_unittest.cc +++ b/content/services/auction_worklet/seller_worklet_unittest.cc
@@ -2769,7 +2769,7 @@ 'view': "https://view.example.com/", }))", /*expected_signals_for_winner=*/"5", - /*expected_report_url =*/absl::nullopt, expected_ad_beacon_map); + /*expected_report_url=*/absl::nullopt, expected_ad_beacon_map); browser_signal_render_url_ = GURL("https://foo/"); RunReportResultCreatedScriptExpectingResult( @@ -2780,7 +2780,7 @@ }); sendReportTo(browserSignals.renderURL))", /*expected_signals_for_winner=*/"5", - /*expected_report_url =*/browser_signal_render_url_, + /*expected_report_url=*/browser_signal_render_url_, expected_ad_beacon_map); RunReportResultCreatedScriptExpectingResult( @@ -2791,7 +2791,7 @@ 'view': "https://view.example.com/", }))", /*expected_signals_for_winner=*/"5", - /*expected_report_url =*/browser_signal_render_url_, + /*expected_report_url=*/browser_signal_render_url_, expected_ad_beacon_map); // Don't call twice. @@ -2803,7 +2803,7 @@ }); registerAdBeacon())", /*expected_signals_for_winner=*/{}, - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_pa_requests=*/{}, {"https://url.test/:14 Uncaught TypeError: registerAdBeacon may be " @@ -2819,7 +2819,7 @@ try { registerAdBeacon() } catch (e) {})", /*expected_signals_for_winner=*/"5", - /*expected_report_url =*/absl::nullopt, expected_ad_beacon_map); + /*expected_report_url=*/absl::nullopt, expected_ad_beacon_map); // If error on first call, can be called again. RunReportResultCreatedScriptExpectingResult( @@ -2831,13 +2831,13 @@ 'view': "https://view.example.com/", }))", /*expected_signals_for_winner=*/"5", - /*expected_report_url =*/absl::nullopt, expected_ad_beacon_map); + /*expected_report_url=*/absl::nullopt, expected_ad_beacon_map); // Error if no parameters RunReportResultCreatedScriptExpectingResult( R"(5)", R"(registerAdBeacon())", /*expected_signals_for_winner=*/{}, - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_pa_requests=*/{}, {"https://url.test/:10 Uncaught TypeError: registerAdBeacon(): at least " @@ -2847,7 +2847,7 @@ RunReportResultCreatedScriptExpectingResult( R"(5)", R"(registerAdBeacon("foo"))", /*expected_signals_for_winner=*/{}, - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_pa_requests=*/{}, {"https://url.test/:10 Uncaught TypeError: registerAdBeacon(): Cannot " @@ -2861,7 +2861,7 @@ 1: "https://view.example.com/", }))", /*expected_signals_for_winner=*/"5", - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/ { {"click", GURL("https://click.example.com/")}, @@ -2878,7 +2878,7 @@ map[Symbol('a')] = "https://view.example.com/"; registerAdBeacon(map))", /*expected_signals_for_winner=*/{}, - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_pa_requests=*/{}, {"https://url.test/:14 Uncaught TypeError: Cannot convert a Symbol value " @@ -2892,7 +2892,7 @@ 'view': "gopher://view.example.com/", }))", /*expected_signals_for_winner=*/{}, - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_pa_requests=*/{}, {"https://url.test/:10 Uncaught TypeError: registerAdBeacon(): invalid " @@ -2906,7 +2906,7 @@ 'view': "http://view.example.com/", }))", /*expected_signals_for_winner=*/{}, - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_pa_requests=*/{}, {"https://url.test/:10 Uncaught TypeError: registerAdBeacon(): invalid " @@ -2919,7 +2919,7 @@ '\ud835': "http://127.0.0.1/", }))", /*expected_signals_for_winner=*/{}, - /*expected_report_url =*/absl::nullopt, + /*expected_report_url=*/absl::nullopt, /*expected_ad_beacon_map=*/{}, /*expected_pa_requests=*/{}, {"https://url.test/:10 Uncaught TypeError: registerAdBeacon(): invalid "
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 4c2cf61..cd31e42 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -3233,6 +3233,7 @@ sources += [ "../browser/hid/hid_service_unittest.cc", "../browser/service_worker/service_worker_hid_delegate_observer_unittest.cc", + "../browser/service_worker/service_worker_usb_delegate_observer_unittest.cc", "../browser/webauth/authenticator_impl_unittest.cc", "../browser/webauth/authenticator_mojom_traits_unittest.cc", "../browser/webauth/webauth_request_security_checker_unittest.cc",
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 e30023d..cc9d92d 100644 --- a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt
@@ -214,6 +214,9 @@ crbug.com/1356246 [ mac intel release asan ] Pixel_SVGHuge [ Skip ] # Mac Nvidia laptops are quite old and the test times out on release builds too. crbug.com/1356246 [ mac nvidia ] Pixel_SVGHuge [ Skip ] +# Test flakily times out on Win10 and Linux Debug +crbug.com/1474637 [ win10 nvidia debug ] Pixel_SVGHuge [ RetryOnFailure ] +crbug.com/1474637 [ linux nvidia debug ] Pixel_SVGHuge [ RetryOnFailure ] # Fuchsia devices do not have enough memory for this test. crbug.com/1441056 [ fuchsia ] Pixel_SVGHuge [ Skip ]
diff --git a/device/fido/mac/fake_icloud_keychain_sys.h b/device/fido/mac/fake_icloud_keychain_sys.h index 3aae0ee..fe29580 100644 --- a/device/fido/mac/fake_icloud_keychain_sys.h +++ b/device/fido/mac/fake_icloud_keychain_sys.h
@@ -35,6 +35,9 @@ // `AuthorizeAndContinue`. void set_next_auth_state(AuthState next_auth_state); + // cancel_count returns the number of times that `Cancel` has been called. + unsigned cancel_count() const { return cancel_count_; } + // SetMakeCredentialResult sets the values that will be returned from the next // call to `MakeCredential`. If not set, `MakeCredential` will return an // error. @@ -79,6 +82,8 @@ CtapGetAssertionRequest request, base::OnceCallback<void(ASAuthorization*, NSError*)> callback) override; + void Cancel() override; + protected: friend class base::RefCounted<SystemInterface>; friend class base::RefCounted<FakeSystemInterface>; @@ -97,6 +102,8 @@ absl::optional<std::vector<uint8_t>> get_assertion_user_id_; absl::optional<std::vector<uint8_t>> get_assertion_credential_id_; + unsigned cancel_count_ = 0; + std::vector<DiscoverableCredentialMetadata> creds_; };
diff --git a/device/fido/mac/fake_icloud_keychain_sys.mm b/device/fido/mac/fake_icloud_keychain_sys.mm index 8aed5b9..8454e10 100644 --- a/device/fido/mac/fake_icloud_keychain_sys.mm +++ b/device/fido/mac/fake_icloud_keychain_sys.mm
@@ -259,6 +259,10 @@ std::move(callback).Run(authorization, nullptr); } +void FakeSystemInterface::Cancel() { + cancel_count_++; +} + FakeSystemInterface::~FakeSystemInterface() = default; } // namespace device::fido::icloud_keychain
diff --git a/device/fido/mac/icloud_keychain.mm b/device/fido/mac/icloud_keychain.mm index 4e97624..211d1d4 100644 --- a/device/fido/mac/icloud_keychain.mm +++ b/device/fido/mac/icloud_keychain.mm
@@ -184,7 +184,12 @@ sys_interface->GetPlatformCredentials(rp_id, handler); } - void Cancel() override {} + void Cancel() override { + cancelled_ = true; + GetSystemInterface()->Cancel(); + // If a request was outstanding, `OnMakeCredentialComplete` or + // `OnGetAssertionComplete` will be called with a generic error. + } AuthenticatorType GetType() const override { return AuthenticatorType::kICloudKeychain; @@ -212,6 +217,13 @@ void OnMakeCredentialComplete(MakeCredentialCallback callback, ASAuthorization* authorization, NSError* error) { + if (cancelled_) { + cancelled_ = false; + std::move(callback).Run(CtapDeviceResponseCode::kCtap2ErrKeepAliveCancel, + {}); + return; + } + if (error) { const std::string domain = base::SysNSStringToUTF8(error.domain); FIDO_LOG(ERROR) << "iCKC: makeCredential failed, domain: " << domain @@ -285,6 +297,13 @@ void OnGetAssertionComplete(GetAssertionCallback callback, ASAuthorization* authorization, NSError* error) { + if (cancelled_) { + cancelled_ = false; + std::move(callback).Run(CtapDeviceResponseCode::kCtap2ErrKeepAliveCancel, + {}); + return; + } + if (error) { FIDO_LOG(ERROR) << "iCKC: getAssertion failed, domain: " << base::SysNSStringToUTF8(error.domain) @@ -339,6 +358,7 @@ } NSWindow* __strong window_; + bool cancelled_ = false; base::WeakPtrFactory<Authenticator> weak_factory_{this}; };
diff --git a/device/fido/mac/icloud_keychain_sys.h b/device/fido/mac/icloud_keychain_sys.h index 4b2f615..f0d89ac 100644 --- a/device/fido/mac/icloud_keychain_sys.h +++ b/device/fido/mac/icloud_keychain_sys.h
@@ -66,6 +66,8 @@ CtapGetAssertionRequest request, base::OnceCallback<void(ASAuthorization*, NSError*)> callback) = 0; + virtual void Cancel() = 0; + protected: friend class base::RefCounted<SystemInterface>; virtual ~SystemInterface();
diff --git a/device/fido/mac/icloud_keychain_sys.mm b/device/fido/mac/icloud_keychain_sys.mm index 3b1878bd..281999f9 100644 --- a/device/fido/mac/icloud_keychain_sys.mm +++ b/device/fido/mac/icloud_keychain_sys.mm
@@ -334,6 +334,17 @@ [get_controller_ performRequests]; } + void Cancel() override { + // Sending `cancel` will cause the controller to resolve the delegate with + // an error. That will end up calling `Cleanup` to drop these references. + if (create_controller_) { + [create_controller_ cancel]; + } + if (get_controller_) { + [get_controller_ cancel]; + } + } + protected: ~NativeSystemInterface() override = default;
diff --git a/device/fido/mac/icloud_keychain_unittest.mm b/device/fido/mac/icloud_keychain_unittest.mm index 70a7d1f..6f4d902 100644 --- a/device/fido/mac/icloud_keychain_unittest.mm +++ b/device/fido/mac/icloud_keychain_unittest.mm
@@ -270,6 +270,20 @@ } { + // This is a little odd because we call `Cancel` before `MakeCredential` + // rather than during it, but our fake doesn't support blocking + // operations. + fake_->SetMakeCredentialError(1001 /* generic error */); + EXPECT_EQ(fake_->cancel_count(), 0u); + authenticator_->Cancel(); + EXPECT_EQ(fake_->cancel_count(), 1u); + auto result = make_credential(); + EXPECT_EQ(std::get<0>(result), + CtapDeviceResponseCode::kCtap2ErrKeepAliveCancel); + EXPECT_FALSE(std::get<1>(result).has_value()); + } + + { static const uint8_t kWrongCredentialID[] = {1, 2, 3, 4}; fake_->SetMakeCredentialResult(kAttestationObjectBytes, kWrongCredentialID); @@ -355,6 +369,20 @@ } { + // This is a little odd because we call `Cancel` before `GetAssertion` + // rather than during it, but our fake doesn't support blocking + // operations. + fake_->SetMakeCredentialError(1001 /* generic error */); + EXPECT_EQ(fake_->cancel_count(), 0u); + authenticator_->Cancel(); + EXPECT_EQ(fake_->cancel_count(), 1u); + auto result = get_assertion(); + EXPECT_EQ(std::get<0>(result), + CtapDeviceResponseCode::kCtap2ErrKeepAliveCancel); + EXPECT_TRUE(std::get<1>(result).empty()); + } + + { static const uint8_t kInvalidAuthenticatorData[] = {1, 2, 3, 4}; fake_->SetGetAssertionResult(kInvalidAuthenticatorData, kSignature, kUserID, kCredentialID);
diff --git a/docs/clang_tidy.md b/docs/clang_tidy.md index ada6112..f62a234 100644 --- a/docs/clang_tidy.md +++ b/docs/clang_tidy.md
@@ -104,7 +104,7 @@ --out_dir out/Linux \ --findings_file all_findings.json \ --clang_tidy_binary $PWD/third_party/llvm-build/Release+Asserts/bin/clang-tidy \ - --tidy_checks '-*,YOUR-NEW-CHECK-NAME-HERE' + --tidy_checks='-*,YOUR-NEW-CHECK-NAME-HERE' --all ```
diff --git a/docs/git_submodules.md b/docs/git_submodules.md index 3ea0b53..b0f08b15 100644 --- a/docs/git_submodules.md +++ b/docs/git_submodules.md
@@ -98,6 +98,21 @@ git commit -v -m "Fix foo/bar" ``` +NOTE: due to a bug in gclient (crbug.com/1475448), it's possible that gclient +left unmanaged git repository. You may need to manually remove those unmanaged +repositories. + +``` +# Inside chromium/src checkout: +# This ensures that all managed dependencies are in sync: +gclient sync -D +# This moves all unused dependencies to ../unused directory in gclient root +# (just outside of src directory). It then tells git to restore gitlink. +for f in $( git status | grep '(new commits)' | awk '{print $2}' ); do mkdir -p "../unused/`dirname $f`" && mv $f "../unused/$f" && git checkout -- $f; done +# inspect ../unused/ if you'd like, and remove it there's nothing useful there, +# e.g. no non-uploaded commits. +``` + If a submodule has uncommitted changes (i.e. you made some manual changes to the affected submodule), running `git status` in its parent repo will show them as unstaged changes:
diff --git a/extensions/browser/api/user_scripts/user_scripts_api.cc b/extensions/browser/api/user_scripts/user_scripts_api.cc index a9a2b20..2675af8 100644 --- a/extensions/browser/api/user_scripts/user_scripts_api.cc +++ b/extensions/browser/api/user_scripts/user_scripts_api.cc
@@ -14,6 +14,7 @@ #include "extensions/browser/user_script_manager.h" #include "extensions/common/api/extension_types.h" #include "extensions/common/api/user_scripts.h" +#include "extensions/common/user_script.h" #include "extensions/common/utils/content_script_utils.h" #include "extensions/common/utils/extension_types_utils.h" @@ -153,7 +154,8 @@ // Create script ids for dynamic user scripts. std::string error; - std::set<std::string> existing_script_ids = loader->GetDynamicScriptIDs(); + std::set<std::string> existing_script_ids = + loader->GetDynamicScriptIDs(UserScript::Source::kDynamicUserScript); std::set<std::string> new_script_ids = scripting::CreateDynamicScriptIds( scripts, UserScript::Source::kDynamicUserScript, existing_script_ids, &error);
diff --git a/extensions/browser/extension_user_script_loader.cc b/extensions/browser/extension_user_script_loader.cc index c732fa6..e101e975 100644 --- a/extensions/browser/extension_user_script_loader.cc +++ b/extensions/browser/extension_user_script_loader.cc
@@ -652,17 +652,26 @@ } void ExtensionUserScriptLoader::ClearDynamicScripts( + UserScript::Source source, DynamicScriptsModifiedCallback callback) { - RemoveDynamicScripts(GetDynamicScriptIDs(), std::move(callback)); + RemoveDynamicScripts(GetDynamicScriptIDs(source), std::move(callback)); } -std::set<std::string> ExtensionUserScriptLoader::GetDynamicScriptIDs() const { +std::set<std::string> ExtensionUserScriptLoader::GetDynamicScriptIDs( + UserScript::Source source) const { std::set<std::string> dynamic_script_ids; - dynamic_script_ids.insert(pending_dynamic_script_ids_.begin(), - pending_dynamic_script_ids_.end()); - for (const std::unique_ptr<UserScript>& script : loaded_dynamic_scripts_) - dynamic_script_ids.insert(script->id()); + for (std::string pending_id : pending_dynamic_script_ids_) { + if (UserScript::GetSourceForScriptID(pending_id) == source) { + dynamic_script_ids.insert(pending_id); + } + } + + for (const std::unique_ptr<UserScript>& script : loaded_dynamic_scripts_) { + if (script->GetSource() == source) { + dynamic_script_ids.insert(script->id()); + } + } return dynamic_script_ids; }
diff --git a/extensions/browser/extension_user_script_loader.h b/extensions/browser/extension_user_script_loader.h index f301cb2..97869ec 100644 --- a/extensions/browser/extension_user_script_loader.h +++ b/extensions/browser/extension_user_script_loader.h
@@ -85,13 +85,14 @@ void RemoveDynamicScripts(const std::set<std::string>& ids_to_remove, DynamicScriptsModifiedCallback callback); - // Removes all dynamic scripts for the extension, including loaded and - // pending scripts. - void ClearDynamicScripts(DynamicScriptsModifiedCallback callback); + // Removes all dynamic scripts with `source` for the extension, including + // loaded and pending scripts. + void ClearDynamicScripts(UserScript::Source source, + DynamicScriptsModifiedCallback callback); - // Returns the IDs of all dynamic scripts for the extension, which includes - // the IDs of all pending and loaded dynamic scripts. - std::set<std::string> GetDynamicScriptIDs() const; + // Returns the IDs of all dynamic scripts with `source` for the extension, + // which includes the IDs of all pending and loaded dynamic scripts. + std::set<std::string> GetDynamicScriptIDs(UserScript::Source source) const; const UserScriptList& GetLoadedDynamicScripts() const;
diff --git a/extensions/common/user_script.cc b/extensions/common/user_script.cc index bc5bbf41..9f53ae0 100644 --- a/extensions/common/user_script.cc +++ b/extensions/common/user_script.cc
@@ -84,6 +84,26 @@ } // static +UserScript::Source UserScript::GetSourceForScriptID( + const std::string& script_id) { + if (base::StartsWith(script_id, kManifestContentScriptPrefix)) { + return Source::kStaticContentScript; + } + + if (base::StartsWith(script_id, kDynamicContentScriptPrefix)) { + return Source::kDynamicContentScript; + } + + if (base::StartsWith(script_id, kDynamicUserScriptPrefix)) { + return Source::kDynamicUserScript; + } + + // TODO(crbug.com/1475409): Handle gracefully when a new source is handed, + // specially when user has different Chrome versions. + NOTREACHED_NORETURN(); +} + +// static bool UserScript::IsURLUserScript(const GURL& url, const std::string& mime_type) { return base::EndsWith(url.ExtractFileName(), kFileExtension, @@ -103,10 +123,6 @@ return valid_schemes; } -// namespace { - -// } // namespace - UserScript::File::File(const base::FilePath& extension_root, const base::FilePath& relative_path, const GURL& url) @@ -180,20 +196,7 @@ return Source::kWebUIScript; } - if (base::StartsWith(user_script_id_, kManifestContentScriptPrefix)) { - return Source::kStaticContentScript; - } - - if (base::StartsWith(user_script_id_, kDynamicContentScriptPrefix)) { - return Source::kDynamicContentScript; - } - - if (base::StartsWith(user_script_id_, kDynamicUserScriptPrefix)) { - return Source::kDynamicUserScript; - } - - NOTREACHED(); - return Source::kStaticContentScript; + return GetSourceForScriptID(user_script_id_); } bool UserScript::MatchesURL(const GURL& url) const {
diff --git a/extensions/common/user_script.h b/extensions/common/user_script.h index 32ccd8f..2af7671 100644 --- a/extensions/common/user_script.h +++ b/extensions/common/user_script.h
@@ -30,6 +30,21 @@ // extension. class UserScript { public: + // Denotes the type/origin of this script. + enum class Source { + // The script was parsed from an extension's manifest entry. + kStaticContentScript, + + // The script was created through the scripting API. + kDynamicContentScript, + + // The script was created through the userScripts API. + kDynamicUserScript, + + // The script was created for a webUI. + kWebUIScript, + }; + // The file extension for standalone user scripts. static constexpr const char kFileExtension[] = "user.js"; @@ -53,6 +68,10 @@ // Removes any appended prefix from the given `script_id`. static std::string TrimPrefixFromScriptID(const std::string& script_id); + // Returns the source of `script_id`. This can only be called if `script_id` + // already has its source prefix appended. + static Source GetSourceForScriptID(const std::string& script_id); + // Check if a URL should be treated as a user script and converted to an // extension. static bool IsURLUserScript(const GURL& url, const std::string& mime_type); @@ -61,21 +80,6 @@ // `can_execute_script_everywhere` is true, this will return ALL_SCHEMES. static int ValidUserScriptSchemes(bool can_execute_script_everywhere = false); - // Denotes the type/origin of this script. - enum class Source { - // The script was parsed from an extension's manifest entry. - kStaticContentScript, - - // The script was created through the scripting API. - kDynamicContentScript, - - // The script was created through the userScripts API. - kDynamicUserScript, - - // The script was created for a webUI. - kWebUIScript, - }; - // Holds script file info. class File { public:
diff --git a/extensions/common/user_script_unittest.cc b/extensions/common/user_script_unittest.cc index 04d6d59..be9b5ee 100644 --- a/extensions/common/user_script_unittest.cc +++ b/extensions/common/user_script_unittest.cc
@@ -257,4 +257,18 @@ ASSERT_EQ(mojom::RunLocation::kDocumentIdle, script.run_location()); } +// Verifies the correct source is returned for a script id with source prefix. +TEST(ExtensionUserScriptTest, GetSourceForScriptID) { + std::string manifest_script_id = "_mc_manifest_script"; + std::string content_script_id = "_dc_content_script"; + std::string user_script_id = "_du_user_script"; + + EXPECT_EQ(UserScript::GetSourceForScriptID(manifest_script_id), + UserScript::Source::kStaticContentScript); + EXPECT_EQ(UserScript::GetSourceForScriptID(content_script_id), + UserScript::Source::kDynamicContentScript); + EXPECT_EQ(UserScript::GetSourceForScriptID(user_script_id), + UserScript::Source::kDynamicUserScript); +} + } // namespace extensions
diff --git a/infra/config/generated/testing/variants.pyl b/infra/config/generated/testing/variants.pyl index 360505ab..8cfd538 100644 --- a/infra/config/generated/testing/variants.pyl +++ b/infra/config/generated/testing/variants.pyl
@@ -16,16 +16,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 118.0.5967.0', + 'description': 'Run with ash-chrome version 118.0.5968.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v118.0.5967.0', - 'revision': 'version:118.0.5967.0', + 'location': 'lacros_version_skew_tests_v118.0.5968.0', + 'revision': 'version:118.0.5968.0', }, ], },
diff --git a/infra/config/targets/lacros-version-skew-variants.json b/infra/config/targets/lacros-version-skew-variants.json index c9b684f..f225916 100644 --- a/infra/config/targets/lacros-version-skew-variants.json +++ b/infra/config/targets/lacros-version-skew-variants.json
@@ -1,16 +1,16 @@ { "LACROS_VERSION_SKEW_CANARY": { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "identifier": "Lacros version skew testing ash canary", "swarming": { "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ] }
diff --git a/ios/chrome/app/BUILD.gn b/ios/chrome/app/BUILD.gn index 5132a46..d104fc75 100644 --- a/ios/chrome/app/BUILD.gn +++ b/ios/chrome/app/BUILD.gn
@@ -258,7 +258,6 @@ "//components/prefs", "//components/variations", "//components/variations/service", - "//components/version_info", "//ios/chrome/app/application_delegate:app_state_header", "//ios/chrome/app/application_delegate:observing_app_state_agent", "//ios/chrome/browser/shared/model/application_context",
diff --git a/ios/chrome/app/main_application_delegate.mm b/ios/chrome/app/main_application_delegate.mm index dbb9aff..e573463b 100644 --- a/ios/chrome/app/main_application_delegate.mm +++ b/ios/chrome/app/main_application_delegate.mm
@@ -413,7 +413,7 @@ // delegate which enables the application to display push notifications that // were received while Chrome was open. - (void)registerDeviceForPushNotifications { - if (!_didRegisterDeviceWithAPNS && IsPriceNotificationsEnabled()) { + if (!_didRegisterDeviceWithAPNS) { [PushNotificationUtil registerDeviceWithAPNS]; } }
diff --git a/ios/chrome/app/strings/ios_strings.grd b/ios/chrome/app/strings/ios_strings.grd index c891843b..da88f32 100644 --- a/ios/chrome/app/strings/ios_strings.grd +++ b/ios/chrome/app/strings/ios_strings.grd
@@ -4319,7 +4319,7 @@ </message> <message name="IDS_IOS_TAB_GRID_SUPERVISED_INCOGNITO_MESSAGE" desc="Message shown in the Incognito Tabs page of the tab grid when a supervised user tries to access incognito mode. [iOS only]"> Your account is managed by your parent. -<ph name="BEGIN_LINK">BEGIN_LINK</ph>Learn more<ph name="END_LINK">END_LINK</ph> +<ph name="BEGIN_LINK">BEGIN_LINK</ph>Learn More<ph name="END_LINK">END_LINK</ph> </message> <message name="IDS_IOS_TAB_GRID_INCOGNITO_TABS_UNAVAILABLE_TITLE" desc="Title shown above a message in the Incognito Tabs page of the tab grid when the IncognitoModeAvailability enterprise policy is set to disabled. [iOS only]"> Incognito Mode is Unavailable
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_TAB_GRID_SUPERVISED_INCOGNITO_MESSAGE.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_TAB_GRID_SUPERVISED_INCOGNITO_MESSAGE.png.sha1 index f3559334..a82d386 100644 --- a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_TAB_GRID_SUPERVISED_INCOGNITO_MESSAGE.png.sha1 +++ b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_TAB_GRID_SUPERVISED_INCOGNITO_MESSAGE.png.sha1
@@ -1 +1 @@ -e74f1bccd731fb8d64c6a2fe81048373ecf86248 \ No newline at end of file +914a443e9d07679dcc51ef10ea93876e4b8dfadb \ No newline at end of file
diff --git a/ios/chrome/app/variations_app_state_agent.mm b/ios/chrome/app/variations_app_state_agent.mm index 1d7340a..98d68fa 100644 --- a/ios/chrome/app/variations_app_state_agent.mm +++ b/ios/chrome/app/variations_app_state_agent.mm
@@ -15,7 +15,6 @@ #import "components/variations/service/variations_field_trial_creator.h" #import "components/variations/service/variations_service_utils.h" #import "components/variations/variations_seed_store.h" -#import "components/version_info/version_info.h" #import "ios/chrome/app/application_delegate/app_state.h" #import "ios/chrome/app/application_delegate/startup_information.h" #import "ios/chrome/app/launch_screen_view_controller.h" @@ -24,7 +23,6 @@ #import "ios/chrome/browser/ui/first_run/first_run_util.h" #import "ios/chrome/browser/variations/ios_chrome_variations_seed_fetcher.h" #import "ios/chrome/browser/variations/ios_chrome_variations_seed_store.h" -#import "ios/chrome/common/channel_info.h" // Name of trial and experiment groups. const char kIOSChromeVariationsTrialName[] = "kIOSChromeVariationsTrial"; @@ -40,7 +38,6 @@ using ::variations::SeedApplicationStage; using ::variations::VariationsSeedExpiry; using ::variations::VariationsSeedStore; -using ::version_info::Channel; // The NSUserDefault key to store the time the last seed is fetched. NSString* kLastVariationsSeedFetchTimeKey = @"kLastVariationsSeedFetchTime"; @@ -61,20 +58,6 @@ #pragma mark - Helpers -// Group weight for both enabled and control experiment groups. -// NOTE: The value will be updated during the incremental rollout period. -int GetGroupWeight() { - switch (GetChannel()) { - case Channel::UNKNOWN: - case Channel::CANARY: - case Channel::DEV: - case Channel::BETA: - return 50; - case Channel::STABLE: - return 50; - } -} - // Returns the fetch time of the variations seed store fetched by a previous // run, and null if such seed doesn't exist. base::Time GetLastVariationsSeedFetchTime() { @@ -196,16 +179,14 @@ @implementation VariationsAppStateAgent - (instancetype)init { - int groupWeight = GetGroupWeight(); - DCHECK_LE(groupWeight, 50); // Note: `ShouldPresentFirstRunExperience()` will return YES as long as the // user has not completed a first run experience. return [self initWithFirstRunExperience:ShouldPresentFirstRunExperience() lastSeedFetchTime:GetLastVariationsSeedFetchTime() fetcher:[[IOSChromeVariationsSeedFetcher alloc] init] - enabledGroupWeight:groupWeight - controlGroupWeight:groupWeight]; + enabledGroupWeight:100 + controlGroupWeight:0]; } - (instancetype)initWithFirstRunExperience:(BOOL)shouldPresentFRE
diff --git a/ios/chrome/browser/commerce/push_notification/BUILD.gn b/ios/chrome/browser/commerce/push_notification/BUILD.gn index d506fd3..b0141a90 100644 --- a/ios/chrome/browser/commerce/push_notification/BUILD.gn +++ b/ios/chrome/browser/commerce/push_notification/BUILD.gn
@@ -17,6 +17,7 @@ "//components/commerce/core:proto", "//components/commerce/core:shopping_service", "//components/optimization_guide/proto:optimization_guide_proto", + "//components/variations/service", "//ios/chrome/browser/bookmarks/model:model", "//ios/chrome/browser/commerce:shopping_service", "//ios/chrome/browser/optimization_guide",
diff --git a/ios/chrome/browser/commerce/push_notification/push_notification_feature.mm b/ios/chrome/browser/commerce/push_notification/push_notification_feature.mm index 2c828bed..0c38032 100644 --- a/ios/chrome/browser/commerce/push_notification/push_notification_feature.mm +++ b/ios/chrome/browser/commerce/push_notification/push_notification_feature.mm
@@ -5,15 +5,14 @@ #import "ios/chrome/browser/commerce/push_notification/push_notification_feature.h" #import "base/metrics/field_trial_params.h" +#import "base/strings/string_util.h" +#import "base/strings/sys_string_conversions.h" #import "components/commerce/core/commerce_feature_list.h" #import "components/commerce/core/shopping_service.h" #import "ios/chrome/browser/commerce/shopping_service_factory.h" +#import "ios/chrome/browser/shared/model/application_context/application_context.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" -namespace { -const char kPriceTrackingNotifications[] = "enable_price_notification"; -} // namespace - bool IsPriceTrackingEnabled(ChromeBrowserState* browser_state) { if (!IsPriceNotificationsEnabled()) { return false; @@ -28,7 +27,15 @@ } bool IsPriceNotificationsEnabled() { - return base::GetFieldTrialParamByFeatureAsBool( - commerce::kCommercePriceTracking, kPriceTrackingNotifications, - /** default_value */ false); + std::string country = base::ToLowerASCII(commerce::GetCurrentCountryCode( + GetApplicationContext()->GetVariationsService())); + std::string current_locale = base::ToLowerASCII( + base::SysNSStringToUTF8([NSLocale currentLocale].localeIdentifier)); + + // commerce::IsEnabledForCountryAndLocale expectes format with "-", not "_" + // (as observed locally). E.g. "en-US", not "en_US". + // https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html + base::ReplaceChars(current_locale, "_", "-", ¤t_locale); + return commerce::IsEnabledForCountryAndLocale( + commerce::kCommercePriceTrackingRegionLaunched, country, current_locale); }
diff --git a/ios/chrome/browser/feature_engagement/feature_engagement_unittest.mm b/ios/chrome/browser/feature_engagement/feature_engagement_unittest.mm index 91600a47..f1636789 100644 --- a/ios/chrome/browser/feature_engagement/feature_engagement_unittest.mm +++ b/ios/chrome/browser/feature_engagement/feature_engagement_unittest.mm
@@ -32,6 +32,10 @@ // that can allow the history IPH to be triggered. const int kMaxHistoryUsedForHistoryIPH = 2; +// The maximum number of times the Password Manager widget promo can be +// triggered. +const int kMaxPasswordManagerWidgetPromoIPH = 3; + } // namespace // Unittests related to the triggering of In Product Help features. Anything @@ -144,6 +148,19 @@ return params; } + std::map<std::string, std::string> PasswordManagerWidgetPromoParams() { + std::map<std::string, std::string> params; + params["availability"] = "any"; + params["session_rate"] = "any"; + params["event_trigger"] = "name:password_manager_widget_promo_trigger;" + "comparator:<3;window:360;storage:360"; + params["event_used"] = "name:password_manager_widget_promo_used;comparator:" + "==0;window:360;storage:360"; + params["event_1"] = "name:password_manager_widget_promo_closed;comparator:=" + "=0;window:360;storage:360"; + return params; + } + base::RepeatingCallback<void(bool)> BoolArgumentQuitClosure() { return base::IgnoreArgs<bool>(run_loop_.QuitClosure()); } @@ -541,3 +558,81 @@ feature_engagement::kIPHDefaultSiteViewFeature)); } +// Verifies that the Password Manager widget promo IPH can't be triggered again +// after being triggered three times. +TEST_F(FeatureEngagementTest, TestPasswordManagerPromoIPHReachedTriggerLimit) { + feature_engagement::test::ScopedIphFeatureList list; + list.InitAndEnableFeaturesWithParameters( + {{feature_engagement::kIPHiOSPromoPasswordManagerWidgetFeature, + PasswordManagerWidgetPromoParams()}}); + + std::unique_ptr<feature_engagement::Tracker> tracker = + feature_engagement::CreateTestTracker(); + // Make sure tracker is initialized. + tracker->AddOnInitializedCallback(BoolArgumentQuitClosure()); + run_loop_.Run(); + + // Ensure that the Password Manager widget promo has been triggered three + // times. + for (int index = 0; index < kMaxPasswordManagerWidgetPromoIPH; index++) { + tracker->NotifyEvent( + feature_engagement::events::kPasswordManagerWidgetPromoTriggered); + } + + EXPECT_FALSE(tracker->ShouldTriggerHelpUI( + feature_engagement::kIPHiOSPromoPasswordManagerWidgetFeature)); +} + +// Verifies that the Password Manager widget promo IPH is not triggered again +// after the widget was used at least once. +TEST_F(FeatureEngagementTest, TestPasswordManagerPromoIPHReachedUsedLimit) { + feature_engagement::test::ScopedIphFeatureList list; + list.InitAndEnableFeaturesWithParameters( + {{feature_engagement::kIPHiOSPromoPasswordManagerWidgetFeature, + PasswordManagerWidgetPromoParams()}}); + + std::unique_ptr<feature_engagement::Tracker> tracker = + feature_engagement::CreateTestTracker(); + // Make sure tracker is initialized. + tracker->AddOnInitializedCallback(BoolArgumentQuitClosure()); + run_loop_.Run(); + + EXPECT_TRUE(tracker->ShouldTriggerHelpUI( + feature_engagement::kIPHiOSPromoPasswordManagerWidgetFeature)); + tracker->Dismissed( + feature_engagement::kIPHiOSPromoPasswordManagerWidgetFeature); + + // Interact with the Password Manager widget. + tracker->NotifyEvent( + feature_engagement::events::kPasswordManagerWidgetPromoUsed); + + EXPECT_FALSE(tracker->ShouldTriggerHelpUI( + feature_engagement::kIPHiOSPromoPasswordManagerWidgetFeature)); +} + +// Verifies that the Password Manager widget promo IPH is not triggered again +// after the promo was closed by the user. +TEST_F(FeatureEngagementTest, TestPasswordManagerPromoIPHWasClosed) { + feature_engagement::test::ScopedIphFeatureList list; + list.InitAndEnableFeaturesWithParameters( + {{feature_engagement::kIPHiOSPromoPasswordManagerWidgetFeature, + PasswordManagerWidgetPromoParams()}}); + + std::unique_ptr<feature_engagement::Tracker> tracker = + feature_engagement::CreateTestTracker(); + // Make sure tracker is initialized. + tracker->AddOnInitializedCallback(BoolArgumentQuitClosure()); + run_loop_.Run(); + + EXPECT_TRUE(tracker->ShouldTriggerHelpUI( + feature_engagement::kIPHiOSPromoPasswordManagerWidgetFeature)); + tracker->Dismissed( + feature_engagement::kIPHiOSPromoPasswordManagerWidgetFeature); + + // Close the Password Manager widget promo. + tracker->NotifyEvent( + feature_engagement::events::kPasswordManagerWidgetPromoClosed); + + EXPECT_FALSE(tracker->ShouldTriggerHelpUI( + feature_engagement::kIPHiOSPromoPasswordManagerWidgetFeature)); +}
diff --git a/ios/chrome/browser/shared/public/features/features.mm b/ios/chrome/browser/shared/public/features/features.mm index 800aa6e1..346aa258 100644 --- a/ios/chrome/browser/shared/public/features/features.mm +++ b/ios/chrome/browser/shared/public/features/features.mm
@@ -204,7 +204,7 @@ BASE_FEATURE(kNotificationSettingsMenuItem, "NotificationSettingsMenuItem", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kSpotlightOpenTabsSource, "SpotlightOpenTabsSource",
diff --git a/ios/chrome/browser/supervised_user/supervised_user_incognito_mode_egtest.mm b/ios/chrome/browser/supervised_user/supervised_user_incognito_mode_egtest.mm index 78fc7ee..c88f131 100644 --- a/ios/chrome/browser/supervised_user/supervised_user_incognito_mode_egtest.mm +++ b/ios/chrome/browser/supervised_user/supervised_user_incognito_mode_egtest.mm
@@ -29,8 +29,8 @@ NSString* const kTestSupervisedIncognitoMessage = @"Your account is managed by your parent."; -// Label used to find the 'Learn more' link. -NSString* const kTestLearnMoreLabel = @"Learn more"; +// Label used to find the 'Learn More' link. +NSString* const kTestLearnMoreLabel = @"Learn More"; } // namespace @@ -131,7 +131,7 @@ kTestSupervisedIncognitoMessage)] assertWithMatcher:grey_notNil()]; - // Check that the "Learn more" link works. + // Check that the "Learn More" link works. [[EarlGrey selectElementWithMatcher:grey_allOf( grey_accessibilityLabel(kTestLearnMoreLabel),
diff --git a/ios/chrome/browser/ui/browser_container/BUILD.gn b/ios/chrome/browser/ui/browser_container/BUILD.gn index aa3e587..46fd21e 100644 --- a/ios/chrome/browser/ui/browser_container/BUILD.gn +++ b/ios/chrome/browser/ui/browser_container/BUILD.gn
@@ -72,6 +72,16 @@ ] } +source_set("edit_menu_utils") { + sources = [ + "browser_edit_menu_constants.h", + "browser_edit_menu_constants.mm", + "browser_edit_menu_utils.h", + "browser_edit_menu_utils.mm", + ] + deps = [ "//base" ] +} + source_set("edit_menu_alert_delegate") { sources = [ "edit_menu_alert_delegate.h",
diff --git a/ios/chrome/browser/ui/browser_container/browser_edit_menu_constants.h b/ios/chrome/browser/ui/browser_container/browser_edit_menu_constants.h new file mode 100644 index 0000000..65e536df --- /dev/null +++ b/ios/chrome/browser/ui/browser_container/browser_edit_menu_constants.h
@@ -0,0 +1,17 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_BROWSER_CONTAINER_BROWSER_EDIT_MENU_CONSTANTS_H_ +#define IOS_CHROME_BROWSER_UI_BROWSER_CONTAINER_BROWSER_EDIT_MENU_CONSTANTS_H_ + +#import <Foundation/Foundation.h> + +namespace edit_menu { + +// The ID for the Chrome menu. +extern NSString* const kBrowserEditMenuChromeMenuId; + +} // namespace edit_menu + +#endif // IOS_CHROME_BROWSER_UI_BROWSER_CONTAINER_BROWSER_EDIT_MENU_CONSTANTS_H_
diff --git a/ios/chrome/browser/ui/browser_container/browser_edit_menu_constants.mm b/ios/chrome/browser/ui/browser_container/browser_edit_menu_constants.mm new file mode 100644 index 0000000..1924596 --- /dev/null +++ b/ios/chrome/browser/ui/browser_container/browser_edit_menu_constants.mm
@@ -0,0 +1,12 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/ui/browser_container/browser_edit_menu_constants.h" + +namespace edit_menu { + +// The ID for the Chrome menu. +NSString* const kBrowserEditMenuChromeMenuId = @"chromecommand.menu"; + +} // namespace edit_menu
diff --git a/ios/chrome/browser/ui/browser_container/browser_edit_menu_handler.mm b/ios/chrome/browser/ui/browser_container/browser_edit_menu_handler.mm index 398b3a7..2b1cca5 100644 --- a/ios/chrome/browser/ui/browser_container/browser_edit_menu_handler.mm +++ b/ios/chrome/browser/ui/browser_container/browser_edit_menu_handler.mm
@@ -12,8 +12,8 @@ - (void)buildMenuWithBuilder:(id<UIMenuBuilder>)builder { [self.linkToTextDelegate buildMenuWithBuilder:builder]; - [self.partialTranslateDelegate buildMenuWithBuilder:builder]; [self.searchWithDelegate buildMenuWithBuilder:builder]; + [self.partialTranslateDelegate buildMenuWithBuilder:builder]; } @end
diff --git a/ios/chrome/browser/ui/browser_container/browser_edit_menu_handler_unittest.mm b/ios/chrome/browser/ui/browser_container/browser_edit_menu_handler_unittest.mm index 946b275..8ea0a17 100644 --- a/ios/chrome/browser/ui/browser_container/browser_edit_menu_handler_unittest.mm +++ b/ios/chrome/browser/ui/browser_container/browser_edit_menu_handler_unittest.mm
@@ -165,8 +165,17 @@ // Modify the expected menu for partial translate void AddPartialTranslate(NSMutableArray* menu) { for (unsigned int i = 0; i < menu.count; i++) { + if ([menu[i] isEqualToString:@"0:m:com.apple.menu.lookup"]) { + [menu insertObject:@"0:m:chromecommand.menu" atIndex:i]; + // Deferred action. + [menu insertObject:@"1:d" atIndex:i + 1]; + break; + } + } + for (unsigned int i = 0; i < menu.count; i++) { if ([menu[i] isEqualToString:@"1:c:_translate:"]) { - menu[i] = @"1:d"; + [menu removeObjectAtIndex:i]; + break; } } }
diff --git a/ios/chrome/browser/ui/browser_container/browser_edit_menu_utils.h b/ios/chrome/browser/ui/browser_container/browser_edit_menu_utils.h new file mode 100644 index 0000000..d863b49 --- /dev/null +++ b/ios/chrome/browser/ui/browser_container/browser_edit_menu_utils.h
@@ -0,0 +1,18 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_BROWSER_CONTAINER_BROWSER_EDIT_MENU_UTILS_H_ +#define IOS_CHROME_BROWSER_UI_BROWSER_CONTAINER_BROWSER_EDIT_MENU_UTILS_H_ + +#import <UIKit/UIKit.h> + +namespace edit_menu { + +// Adds an element at the end of the Chrome menu. +// Chrome menu is added between format menu and lookup menu. +void AddElementToChromeMenu(id<UIMenuBuilder> builder, UIMenuElement* element); + +} // namespace edit_menu + +#endif // IOS_CHROME_BROWSER_UI_BROWSER_CONTAINER_BROWSER_EDIT_MENU_UTILS_H_
diff --git a/ios/chrome/browser/ui/browser_container/browser_edit_menu_utils.mm b/ios/chrome/browser/ui/browser_container/browser_edit_menu_utils.mm new file mode 100644 index 0000000..d6c71c2 --- /dev/null +++ b/ios/chrome/browser/ui/browser_container/browser_edit_menu_utils.mm
@@ -0,0 +1,56 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/ui/browser_container/browser_edit_menu_utils.h" + +#import "ios/chrome/browser/ui/browser_container/browser_edit_menu_constants.h" + +namespace { +// Creates the Chrome sub menu if needed. +void EnsureChromeMenuCreated(id<UIMenuBuilder> builder) { + UIMenu* chrome_menu = + [builder menuForIdentifier:edit_menu::kBrowserEditMenuChromeMenuId]; + if (chrome_menu) { + return; + } + chrome_menu = [UIMenu menuWithTitle:@"" + image:nil + identifier:edit_menu::kBrowserEditMenuChromeMenuId + options:UIMenuOptionsDisplayInline + children:@[]]; + // By default, try to add it before the lookup menu. + // Test if lookup menu exists. + if ([builder menuForIdentifier:UIMenuLookup]) { + [builder insertSiblingMenu:chrome_menu + beforeMenuForIdentifier:UIMenuLookup]; + return; + } + // Otherwise, put the menu after the following submenus. + NSArray* put_menu_after = + @[ UIMenuFormat, UIMenuReplace, UIMenuStandardEdit ]; + for (NSString* menu_id : put_menu_after) { + if ([builder menuForIdentifier:menu_id]) { + [builder insertSiblingMenu:chrome_menu afterMenuForIdentifier:menu_id]; + return; + } + } + + // Last possibility, put the menu first + [builder insertChildMenu:chrome_menu atStartOfMenuForIdentifier:UIMenuRoot]; + return; +} +} // namespace + +namespace edit_menu { + +void AddElementToChromeMenu(id<UIMenuBuilder> builder, UIMenuElement* element) { + EnsureChromeMenuCreated(builder); + [builder replaceChildrenOfMenuForIdentifier:kBrowserEditMenuChromeMenuId + fromChildrenBlock:^NSArray<UIMenuElement*>*( + NSArray<UIMenuElement*>* oldElements) { + return [oldElements arrayByAddingObject:element]; + }]; +} + +} // namespace edit_menu
diff --git a/ios/chrome/browser/ui/content_suggestions/BUILD.gn b/ios/chrome/browser/ui/content_suggestions/BUILD.gn index e068f86..8483f79 100644 --- a/ios/chrome/browser/ui/content_suggestions/BUILD.gn +++ b/ios/chrome/browser/ui/content_suggestions/BUILD.gn
@@ -126,6 +126,7 @@ "//ios/chrome/browser/ui/ntp/metrics", "//ios/chrome/browser/ui/overscroll_actions", "//ios/chrome/browser/ui/reading_list", + "//ios/chrome/browser/ui/settings/safety_check", "//ios/chrome/browser/ui/settings/utils:utils", "//ios/chrome/browser/ui/sharing", "//ios/chrome/browser/ui/start_surface",
diff --git a/ios/chrome/browser/ui/content_suggestions/DEPS b/ios/chrome/browser/ui/content_suggestions/DEPS index 8442ef8..97ec53f0 100644 --- a/ios/chrome/browser/ui/content_suggestions/DEPS +++ b/ios/chrome/browser/ui/content_suggestions/DEPS
@@ -8,6 +8,7 @@ "+ios/chrome/browser/ui/toolbar/buttons", "+ios/chrome/browser/ui/menu", "+ios/chrome/browser/ui/favicon", + "+ios/chrome/browser/ui/settings/safety_check/safety_check_constants.h", "+ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h", "+ios/chrome/browser/ui/lens", "+ios/chrome/browser/ui/sharing",
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm index 45dd4c3..f71b27f 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm
@@ -16,6 +16,7 @@ #import "base/metrics/user_metrics.h" #import "base/metrics/user_metrics_action.h" #import "base/strings/sys_string_conversions.h" +#import "base/time/time.h" #import "components/favicon/ios/web_favicon_driver.h" #import "components/feed/core/v2/public/ios/pref_names.h" #import "components/history/core/browser/features.h" @@ -93,6 +94,7 @@ #import "ios/chrome/browser/ui/ntp/feed_delegate.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_feature.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_metrics_delegate.h" +#import "ios/chrome/browser/ui/settings/safety_check/safety_check_constants.h" #import "ios/chrome/browser/ui/start_surface/start_surface_util.h" #import "ios/chrome/browser/ui/whats_new/whats_new_util.h" #import "ios/chrome/browser/url_loading/url_loading_browser_agent.h" @@ -711,6 +713,15 @@ // Last run time. state.lastRunTime = safetyCheckManager->GetLastSafetyCheckRunTime(); + // Last run time (from the Safety Check via Settings). + base::Time lastRunTimeViaSettings = + base::Time::FromDoubleT([[NSUserDefaults standardUserDefaults] + doubleForKey:kTimestampOfLastIssueFoundKey]); + + if (lastRunTimeViaSettings > state.lastRunTime) { + state.lastRunTime = lastRunTimeViaSettings; + } + state.runningState = CanRunSafetyCheck(state.lastRunTime) ? RunningSafetyCheckState::kRunning : RunningSafetyCheckState::kDefault;
diff --git a/ios/chrome/browser/ui/link_to_text/BUILD.gn b/ios/chrome/browser/ui/link_to_text/BUILD.gn index bc6726a..1019d23 100644 --- a/ios/chrome/browser/ui/link_to_text/BUILD.gn +++ b/ios/chrome/browser/ui/link_to_text/BUILD.gn
@@ -53,6 +53,7 @@ "//base/test:test_support", "//components/shared_highlighting/core/common", "//ios/chrome/browser/shared/public/features", + "//ios/chrome/browser/ui/browser_container:eg_test_support+eg2", "//ios/chrome/test:eg_test_support+eg2", "//ios/chrome/test/earl_grey:eg_test_support+eg2", "//ios/testing/earl_grey:eg_test_support+eg2",
diff --git a/ios/chrome/browser/ui/link_to_text/link_to_text_egtest.mm b/ios/chrome/browser/ui/link_to_text/link_to_text_egtest.mm index a01c9f0..c7f3ec85 100644 --- a/ios/chrome/browser/ui/link_to_text/link_to_text_egtest.mm +++ b/ios/chrome/browser/ui/link_to_text/link_to_text_egtest.mm
@@ -11,6 +11,7 @@ #import "components/shared_highlighting/core/common/fragment_directives_utils.h" #import "components/shared_highlighting/core/common/text_fragment.h" #import "ios/chrome/browser/shared/public/features/features.h" +#import "ios/chrome/browser/ui/browser_container/edit_menu_app_interface.h" #import "ios/chrome/test/earl_grey/chrome_actions.h" #import "ios/chrome/test/earl_grey/chrome_actions_app_interface.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" @@ -285,13 +286,9 @@ selectorWithElementID:kSimpleTextElementId], true)]; - // TODO(crbug.com/1233056): Xcode 13 gesture recognizers seem to get stuck - // when the user longs presses on plain text. For this test, disable EG - // synchronization. - ScopedSynchronizationDisabler disabler; - id<GREYMatcher> copyButton = - chrome_test_util::SystemSelectionCalloutCopyButton(); - [ChromeEarlGrey waitForSufficientlyVisibleElementWithMatcher:copyButton]; + [ChromeEarlGrey + waitForSufficientlyVisibleElementWithMatcher:[EditMenuAppInterface + editMenuMatcher]]; // Make sure the Link to Text button is not visible. [[EarlGrey selectElementWithMatcher:
diff --git a/ios/chrome/browser/ui/partial_translate/BUILD.gn b/ios/chrome/browser/ui/partial_translate/BUILD.gn index fa98cf05..f9fb4f57 100644 --- a/ios/chrome/browser/ui/partial_translate/BUILD.gn +++ b/ios/chrome/browser/ui/partial_translate/BUILD.gn
@@ -18,6 +18,7 @@ "//ios/chrome/browser/shared/public/features", "//ios/chrome/browser/shared/ui/symbols", "//ios/chrome/browser/ui/browser_container:edit_menu_alert_delegate", + "//ios/chrome/browser/ui/browser_container:edit_menu_utils", "//ios/chrome/browser/ui/fullscreen", "//ios/chrome/browser/web_selection", "//ios/public/provider/chrome/browser/partial_translate:partial_translate_api",
diff --git a/ios/chrome/browser/ui/partial_translate/partial_translate_mediator.mm b/ios/chrome/browser/ui/partial_translate/partial_translate_mediator.mm index 143695c..dd24633 100644 --- a/ios/chrome/browser/ui/partial_translate/partial_translate_mediator.mm +++ b/ios/chrome/browser/ui/partial_translate/partial_translate_mediator.mm
@@ -14,6 +14,7 @@ #import "ios/chrome/browser/shared/public/commands/browser_coordinator_commands.h" #import "ios/chrome/browser/shared/public/features/features.h" #import "ios/chrome/browser/shared/ui/symbols/symbols.h" +#import "ios/chrome/browser/ui/browser_container/browser_edit_menu_utils.h" #import "ios/chrome/browser/ui/browser_container/edit_menu_alert_delegate.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_controller.h" #import "ios/chrome/browser/web_selection/web_selection_response.h" @@ -328,9 +329,6 @@ if (![self shouldInstallPartialTranslate]) { return; } - NSString* title = - l10n_util::GetNSString(IDS_IOS_PARTIAL_TRANSLATE_EDIT_MENU_ENTRY); - NSString* partialTranslateId = @"chromecommand.menu.partialTranslate"; __weak __typeof(self) weakSelf = self; ProceduralBlockWithBlockWithItemArray provider = @@ -341,51 +339,24 @@ // selection and updated on selection change. UIDeferredMenuElement* deferredMenuElement = [UIDeferredMenuElement elementWithProvider:provider]; + edit_menu::AddElementToChromeMenu(builder, deferredMenuElement); - // Translate command is in the lookup menu. - // Retrieve the menu so it can be replaced with partial translate. - UIMenu* lookupMenu = [builder menuForIdentifier:UIMenuLookup]; - NSArray* children = lookupMenu.children; - NSInteger translateIndex = -1; - for (NSUInteger index = 0; index < children.count; index++) { - UIMenuElement* element = children[index]; - // Translate is a command. - if (![element isKindOfClass:[UICommand class]]) { - continue; - } - UICommand* command = base::apple::ObjCCast<UICommand>(element); - if (command.action != NSSelectorFromString(@"_translate:")) { - continue; - } - translateIndex = index; - break; - } + auto childrenTransformBlock = + ^NSArray<UIMenuElement*>*(NSArray<UIMenuElement*>* oldElements) { + return [oldElements + filteredArrayUsingPredicate: + [NSPredicate predicateWithBlock:^BOOL( + id object, NSDictionary<NSString*, id>* bindings) { + if (![object isKindOfClass:[UICommand class]]) { + return YES; + } + UICommand* command = base::apple::ObjCCast<UICommand>(object); + return command.action != NSSelectorFromString(@"_translate:"); + }]]; + }; - if (translateIndex == -1) { - // Translate command not found. Fallback adding the partial translate before - // the lookup menu. - // TODO(crbug.com/1417639): Catch this so it can be fixed. - UIMenu* partialTranslateMenu = - [UIMenu menuWithTitle:title - image:nil - identifier:partialTranslateId - options:UIMenuOptionsDisplayInline - children:@[ deferredMenuElement ]]; - [builder insertSiblingMenu:partialTranslateMenu - beforeMenuForIdentifier:UIMenuLookup]; - return; - } - - // Rebuild the lookup menu with partial translate - NSMutableArray* newChildren = [NSMutableArray arrayWithArray:children]; - newChildren[translateIndex] = deferredMenuElement; - UIMenu* newPartialTranslate = [UIMenu menuWithTitle:lookupMenu.title - image:lookupMenu.image - identifier:lookupMenu.identifier - options:lookupMenu.options - children:newChildren]; - - [builder replaceMenuForIdentifier:UIMenuLookup withMenu:newPartialTranslate]; + [builder replaceChildrenOfMenuForIdentifier:UIMenuLookup + fromChildrenBlock:childrenTransformBlock]; } @end
diff --git a/ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h b/ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h index cd25c05..e55876a14 100644 --- a/ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h +++ b/ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.h
@@ -26,10 +26,6 @@ // Whether or not the NewOverflowMenuReorderSettings feature is enabled. bool IsNewOverflowMenuReorderSettingsEnabled(); -// Whether the Price Tracking destination (with Smart Sorting) is added to the -// new overflow menu. -bool IsSmartSortingPriceTrackingDestinationEnabled(); - // Whether or not the NewOverflowMenuShareChromeAction is enabled. bool IsNewOverflowMenuShareChromeActionEnabled();
diff --git a/ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.mm b/ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.mm index a8d65c5..eb1de53 100644 --- a/ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.mm +++ b/ios/chrome/browser/ui/popup_menu/overflow_menu/feature_flags.mm
@@ -31,10 +31,6 @@ return false; } -bool IsSmartSortingPriceTrackingDestinationEnabled() { - return base::FeatureList::IsEnabled(kSmartSortingPriceTrackingDestination); -} - bool IsNewOverflowMenuShareChromeActionEnabled() { return IsNewOverflowMenuEnabled() && base::FeatureList::IsEnabled(kNewOverflowMenuShareChromeAction);
diff --git a/ios/chrome/browser/ui/popup_menu/overflow_menu/overflow_menu_mediator.mm b/ios/chrome/browser/ui/popup_menu/overflow_menu/overflow_menu_mediator.mm index 1594c82..366b3f1 100644 --- a/ios/chrome/browser/ui/popup_menu/overflow_menu/overflow_menu_mediator.mm +++ b/ios/chrome/browser/ui/popup_menu/overflow_menu/overflow_menu_mediator.mm
@@ -971,8 +971,7 @@ overflow_menu::Destination::Settings, }; - if (IsPriceNotificationsEnabled() && - IsSmartSortingPriceTrackingDestinationEnabled()) { + if (IsPriceNotificationsEnabled()) { destinations.push_back(overflow_menu::Destination::PriceNotifications); }
diff --git a/ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator.mm b/ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator.mm index a672753d..bfdc857 100644 --- a/ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator.mm +++ b/ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator.mm
@@ -207,6 +207,12 @@ } - (void)showHistorySyncOptInAfterDedicatedSignIn:(BOOL)dedicatedSignInDone { + // Stop the previous coordinator since the user can tap on the promo button + // to open a new History Sync Page while the dismiss animation of the previous + // one is in progress. + _historySyncPopupCoordinator.delegate = nil; + [_historySyncPopupCoordinator stop]; + _historySyncPopupCoordinator = nil; // Show the History Sync Opt-In screen. The coordinator will dismiss itself // if there is no signed-in account (eg. if sign-in unsuccessful) or if sync // is disabled by policies.
diff --git a/ios/chrome/browser/ui/search_with/BUILD.gn b/ios/chrome/browser/ui/search_with/BUILD.gn index 1e1c385..3a017e8 100644 --- a/ios/chrome/browser/ui/search_with/BUILD.gn +++ b/ios/chrome/browser/ui/search_with/BUILD.gn
@@ -16,6 +16,7 @@ "//ios/chrome/browser/shared/public/commands", "//ios/chrome/browser/shared/public/features", "//ios/chrome/browser/shared/ui/symbols", + "//ios/chrome/browser/ui/browser_container:edit_menu_utils", "//ios/chrome/browser/web_selection", "//ios/web/public", ]
diff --git a/ios/chrome/browser/ui/search_with/DEPS b/ios/chrome/browser/ui/search_with/DEPS new file mode 100644 index 0000000..4f6dfe0 --- /dev/null +++ b/ios/chrome/browser/ui/search_with/DEPS
@@ -0,0 +1,3 @@ +include_rules = [ + "+ios/chrome/browser/ui/browser_container", +]
diff --git a/ios/chrome/browser/ui/search_with/search_with_mediator.mm b/ios/chrome/browser/ui/search_with/search_with_mediator.mm index ecc5c358..4a9dd3d3f 100644 --- a/ios/chrome/browser/ui/search_with/search_with_mediator.mm +++ b/ios/chrome/browser/ui/search_with/search_with_mediator.mm
@@ -17,6 +17,7 @@ #import "ios/chrome/browser/shared/public/commands/open_new_tab_command.h" #import "ios/chrome/browser/shared/public/features/features.h" #import "ios/chrome/browser/shared/ui/symbols/symbols.h" +#import "ios/chrome/browser/ui/browser_container/browser_edit_menu_utils.h" #import "ios/chrome/browser/web_selection/web_selection_response.h" #import "ios/chrome/browser/web_selection/web_selection_tab_helper.h" #import "ios/chrome/grit/ios_strings.h" @@ -215,7 +216,6 @@ if (![self canPerformSearch]) { return; } - NSString* searchWithMenuId = @"chromeMenu.searchWith"; __weak __typeof(self) weakSelf = self; ProceduralBlockWithBlockWithItemArray provider = @@ -224,14 +224,7 @@ }; UIDeferredMenuElement* deferredMenuElement = [UIDeferredMenuElement elementWithProvider:provider]; - - UIMenu* searchWithMenu = [UIMenu menuWithTitle:@"" - image:nil - identifier:searchWithMenuId - options:UIMenuOptionsDisplayInline - children:@[ deferredMenuElement ]]; - [builder insertSiblingMenu:searchWithMenu - afterMenuForIdentifier:UIMenuLookup]; + edit_menu::AddElementToChromeMenu(builder, deferredMenuElement); } @end
diff --git a/ios/chrome/browser/ui/settings/settings_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/settings_table_view_controller_unittest.mm index bc146b5b..69bfaf1 100644 --- a/ios/chrome/browser/ui/settings/settings_table_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/settings/settings_table_view_controller_unittest.mm
@@ -25,6 +25,7 @@ #import "ios/chrome/browser/shared/model/application_context/application_context.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h" +#import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state_manager.h" #import "ios/chrome/browser/shared/model/prefs/pref_names.h" #import "ios/chrome/browser/shared/public/commands/application_commands.h" #import "ios/chrome/browser/shared/public/commands/browsing_data_commands.h" @@ -46,7 +47,9 @@ #import "ios/chrome/browser/ui/settings/settings_table_view_controller_constants.h" #import "ios/chrome/grit/ios_chromium_strings.h" #import "ios/chrome/grit/ios_strings.h" +#import "ios/chrome/test/ios_chrome_scoped_testing_chrome_browser_state_manager.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" +#import "ios/chrome/test/testing_application_context.h" #import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" @@ -79,6 +82,16 @@ web::BrowserState, password_manager::TestPasswordStore>)); chrome_browser_state_ = builder.Build(); + // Prepare mocks for PushNotificationClient dependency + TestingApplicationContext::GetGlobal()->SetLocalState(nullptr); + test_manager_ = + std::make_unique<TestChromeBrowserStateManager>(base::FilePath()); + test_manager_pref_service_ = + TestingApplicationContext::GetGlobal()->GetLocalState(); + TestingApplicationContext::GetGlobal()->SetLocalState(GetLocalState()); + TestingApplicationContext::GetGlobal()->SetChromeBrowserStateManager( + test_manager_.get()); + browser_ = std::make_unique<TestBrowser>(chrome_browser_state_.get()); browser_state_ = TestChromeBrowserState::Builder().Build(); @@ -119,6 +132,11 @@ [[NSUserDefaults standardUserDefaults] removeObjectForKey:kPolicyLoaderIOSConfigurationKey]; + TestingApplicationContext::GetGlobal()->SetLocalState( + test_manager_pref_service_); + test_manager_.reset(); + TestingApplicationContext::GetGlobal()->SetLocalState(GetLocalState()); + [static_cast<SettingsTableViewController*>(controller()) settingsWillBeDismissed]; ChromeTableViewControllerTest::TearDown(); @@ -186,6 +204,7 @@ // Needed for test browser state created by TestChromeBrowserState(). web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; + PrefService* test_manager_pref_service_; FakeSystemIdentity* fake_identity_ = nullptr; AuthenticationService* auth_service_ = nullptr; @@ -193,6 +212,7 @@ scoped_refptr<password_manager::TestPasswordStore> password_store_mock_; std::unique_ptr<TestChromeBrowserState> chrome_browser_state_; + std::unique_ptr<ios::ChromeBrowserStateManager> test_manager_; std::unique_ptr<TestBrowser> browser_; std::unique_ptr<TestChromeBrowserState> browser_state_; SceneState* scene_state_;
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.mm index 9931e944..658e1423 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.mm
@@ -1232,6 +1232,12 @@ } - (void)showHistorySyncOptInAfterDedicatedSignIn:(BOOL)dedicatedSignInDone { + // Stop the previous coordinator since the user can tap on the promo button + // to open a new History Sync Page while the dismiss animation of the previous + // one is in progress. + _historySyncPopupCoordinator.delegate = nil; + [_historySyncPopupCoordinator stop]; + _historySyncPopupCoordinator = nil; // Show the History Sync Opt-In screen. The coordinator will dismiss itself // if there is no signed-in account (eg. if sign-in unsuccessful) or if sync // is disabled by policies.
diff --git a/ios/web/navigation/navigation_manager_impl.mm b/ios/web/navigation/navigation_manager_impl.mm index 5a305d7..921ef92 100644 --- a/ios/web/navigation/navigation_manager_impl.mm +++ b/ios/web/navigation/navigation_manager_impl.mm
@@ -15,6 +15,7 @@ #import "base/ios/ios_util.h" #import "base/logging.h" #import "base/memory/ptr_util.h" +#import "base/metrics/histogram_functions.h" #import "base/metrics/histogram_macros.h" #import "base/numerics/checked_math.h" #import "base/strings/string_util.h" @@ -51,18 +52,41 @@ navigationItem]; } +void RecordSessionRestorationHasFetchers(bool has_fetchers) { + base::UmaHistogramBoolean("Session.WebStates.NativeRestoreHasFetchers", + has_fetchers); +} + // Records metrics about session restoration `success` from `source`. void RecordSessionRestorationResultForSource( bool success, web::NavigationManagerImpl::SessionDataBlobSource source) { switch (source) { case web::NavigationManagerImpl::SessionDataBlobSource::kSessionCache: - UMA_HISTOGRAM_BOOLEAN("Session.WebStates.NativeRestoreSessionFromCache", - success); + base::UmaHistogramBoolean( + "Session.WebStates.NativeRestoreSessionFromCache", success); break; case web::NavigationManagerImpl::SessionDataBlobSource::kSynthesized: - UMA_HISTOGRAM_BOOLEAN("Session.WebStates.NativeRestoreSession", success); + base::UmaHistogramBoolean("Session.WebStates.NativeRestoreSession", + success); + break; + } +} + +void RecordSessionRestorationFetcherHasDataForSource( + web::NavigationManagerImpl::SessionDataBlobSource source, + bool fetcher_has_data) { + switch (source) { + case web::NavigationManagerImpl::SessionDataBlobSource::kSessionCache: + base::UmaHistogramBoolean( + "Session.WebStates.NativeRestoreSessionFromCacheHasData", + fetcher_has_data); + break; + + case web::NavigationManagerImpl::SessionDataBlobSource::kSynthesized: + base::UmaHistogramBoolean("Session.WebStates.NativeRestoreSessionHasData", + fetcher_has_data); break; } } @@ -512,13 +536,17 @@ void NavigationManagerImpl::RestoreNativeSession() { DCHECK(is_restore_session_in_progress_); + RecordSessionRestorationHasFetchers(!session_data_blob_fetchers_.empty()); // Try to load session data blob from each registered source in order, // stopping at the first that is successfully loaded. bool success = false; for (auto& [fetcher, source] : session_data_blob_fetchers_) { NSData* data = std::move(fetcher).Run(); - if (data.length != 0) { + + bool fetcher_has_data = data.length != 0; + RecordSessionRestorationFetcherHasDataForSource(source, fetcher_has_data); + if (fetcher_has_data) { success = GetWebState()->SetSessionStateData(data); RecordSessionRestorationResultForSource(success, source); if (success) {
diff --git a/ios/web_view/BUILD.gn b/ios/web_view/BUILD.gn index e110a67e..9946c599 100644 --- a/ios/web_view/BUILD.gn +++ b/ios/web_view/BUILD.gn
@@ -58,6 +58,7 @@ "public/cwv_defines.h", "public/cwv_export.h", "public/cwv_favicon.h", + "public/cwv_find_in_page_controller.h", "public/cwv_flags.h", "public/cwv_html_element.h", "public/cwv_identity.h", @@ -139,6 +140,8 @@ "internal/cwv_download_task_internal.h", "internal/cwv_favicon.mm", "internal/cwv_favicon_internal.h", + "internal/cwv_find_in_page_controller.mm", + "internal/cwv_find_in_page_controller_internal.h", "internal/cwv_flags.mm", "internal/cwv_flags_internal.h", "internal/cwv_html_element.mm", @@ -388,6 +391,7 @@ "//ios/web/public", "//ios/web/public/browsing_data", "//ios/web/public/deprecated", + "//ios/web/public/find_in_page", "//ios/web/public/init", "//ios/web/public/js_messaging", "//ios/web/public/security",
diff --git a/ios/web_view/internal/cwv_find_in_page_controller.mm b/ios/web_view/internal/cwv_find_in_page_controller.mm new file mode 100644 index 0000000..0e5db24 --- /dev/null +++ b/ios/web_view/internal/cwv_find_in_page_controller.mm
@@ -0,0 +1,79 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/web_view/internal/cwv_find_in_page_controller_internal.h" + +#import "ios/web/public/find_in_page/find_in_page_manager.h" +#import "ios/web/public/web_state.h" +#import "ios/web/public/web_state_observer_bridge.h" + +@interface CWVFindInPageController () <CRWWebStateObserver> +@end + +@implementation CWVFindInPageController { + // Object that manages searches and match traversals. + web::FindInPageManager* _findInPageManager; + + // The WebState this instance is observing. Will be null after + // -webStateDestroyed: has been called. + base::WeakPtr<web::WebState> _webState; + std::unique_ptr<web::WebStateObserverBridge> _webStateObserverBridge; +} + +- (instancetype)initWithWebState:(web::WebState*)webState { + self = [super init]; + if (self) { + DCHECK(webState); + DCHECK(webState->IsRealized()); + + // The Find in Page manager should not be attached yet. + DCHECK(!web::FindInPageManager::FromWebState(webState)); + web::FindInPageManager::CreateForWebState(webState); + _findInPageManager = web::FindInPageManager::FromWebState(webState); + + _webState = webState->GetWeakPtr(); + } + return self; +} + +- (void)dealloc { + if (_webState) { + _webState->RemoveObserver(_webStateObserverBridge.get()); + } +} + +- (void)startFindInPage { + _findInPageManager->Find(@"", web::FindInPageOptions::FindInPageSearch); +} + +- (void)findStringInPage:(NSString*)query { + _findInPageManager->Find(query, web::FindInPageOptions::FindInPageSearch); +} + +- (void)findNextStringInPage { + _findInPageManager->Find(nil, web::FindInPageOptions::FindInPageNext); +} + +- (void)findPreviousStringInPage { + _findInPageManager->Find(nil, web::FindInPageOptions::FindInPagePrevious); +} + +- (void)stopFindInPage { + _findInPageManager->StopFinding(); +} + +- (BOOL)canFindInPage { + return _findInPageManager->CanSearchContent(); +} + +- (void)webStateDestroyed:(web::WebState*)webState { + DCHECK_EQ(_webState.get(), webState); + _findInPageManager = nullptr; + + _webState->RemoveObserver(_webStateObserverBridge.get()); + _webStateObserverBridge.reset(); + _webState = nullptr; +} + +@end
diff --git a/ios/web_view/internal/cwv_find_in_page_controller_internal.h b/ios/web_view/internal/cwv_find_in_page_controller_internal.h new file mode 100644 index 0000000..b531c5d --- /dev/null +++ b/ios/web_view/internal/cwv_find_in_page_controller_internal.h
@@ -0,0 +1,25 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_WEB_VIEW_INTERNAL_CWV_FIND_IN_PAGE_CONTROLLER_INTERNAL_H_ +#define IOS_WEB_VIEW_INTERNAL_CWV_FIND_IN_PAGE_CONTROLLER_INTERNAL_H_ + +#import "ios/web_view/public/cwv_find_in_page_controller.h" + +namespace web { +class WebState; +} // namespace web + +NS_ASSUME_NONNULL_BEGIN + +@interface CWVFindInPageController () + +- (instancetype)initWithWebState:(web::WebState*)webState + NS_DESIGNATED_INITIALIZER; + +@end + +NS_ASSUME_NONNULL_END + +#endif // IOS_WEB_VIEW_INTERNAL_CWV_FIND_IN_PAGE_CONTROLLER_INTERNAL_H_
diff --git a/ios/web_view/internal/cwv_web_view.mm b/ios/web_view/internal/cwv_web_view.mm index b476306..42a0153 100644 --- a/ios/web_view/internal/cwv_web_view.mm +++ b/ios/web_view/internal/cwv_web_view.mm
@@ -53,6 +53,7 @@ #import "ios/web_view/internal/autofill/web_view_autofill_client_ios.h" #import "ios/web_view/internal/cwv_back_forward_list_internal.h" #import "ios/web_view/internal/cwv_favicon_internal.h" +#import "ios/web_view/internal/cwv_find_in_page_controller_internal.h" #import "ios/web_view/internal/cwv_html_element_internal.h" #import "ios/web_view/internal/cwv_navigation_action_internal.h" #import "ios/web_view/internal/cwv_ssl_status_internal.h" @@ -462,6 +463,7 @@ @synthesize canGoForward = _canGoForward; @synthesize configuration = _configuration; @synthesize estimatedProgress = _estimatedProgress; +@synthesize findInPageController = _findInPageController; @synthesize lastCommittedURL = _lastCommittedURL; @synthesize loading = _loading; @synthesize navigationDelegate = _navigationDelegate; @@ -1017,6 +1019,16 @@ ->GetApplicationLocale()]; } +#pragma mark - Find In Page + +- (CWVFindInPageController*)findInPageController { + if (!_findInPageController) { + _findInPageController = + [[CWVFindInPageController alloc] initWithWebState:_webState.get()]; + } + return _findInPageController; +} + #pragma mark - Preserving and Restoring State - (void)encodeRestorableStateWithCoder:(NSCoder*)coder {
diff --git a/ios/web_view/public/cwv_defines.h b/ios/web_view/public/cwv_defines.h index a483503..cae30346 100644 --- a/ios/web_view/public/cwv_defines.h +++ b/ios/web_view/public/cwv_defines.h
@@ -91,4 +91,7 @@ // Supports -[CWVUserScript initWithSource:forMainFrameOnly:]. #define IOS_WEB_VIEW_SUPPORTS_INSTALLING_USER_SCRIPTS_INTO_ALL_FRAMES 1 +// Allows the usage of CWVFindInPageController for find in page sessions. +#define IOS_WEB_VIEW_SUPPORTS_FIND_IN_PAGE_SESSIONS 1 + #endif // IOS_WEB_VIEW_PUBLIC_CWV_DEFINES_H_
diff --git a/ios/web_view/public/cwv_find_in_page_controller.h b/ios/web_view/public/cwv_find_in_page_controller.h new file mode 100644 index 0000000..53c6b46 --- /dev/null +++ b/ios/web_view/public/cwv_find_in_page_controller.h
@@ -0,0 +1,50 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_WEB_VIEW_PUBLIC_CWV_FIND_IN_PAGE_CONTROLLER_H_ +#define IOS_WEB_VIEW_PUBLIC_CWV_FIND_IN_PAGE_CONTROLLER_H_ + +#import <Foundation/Foundation.h> + +#import "cwv_export.h" + +NS_ASSUME_NONNULL_BEGIN + +@class CWVFindInPageManager; + +// Object that manages presentation of `UIFindInteraction` for iOS 16+. +CWV_EXPORT +@interface CWVFindInPageController : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +// Whether a Find in Page session can begin for the current web page. +- (BOOL)canFindInPage; + +// Displays the Native `UIFindInteraction` FiP interface for query entry. +- (void)startFindInPage; + +// Start a Find operation on the web state in a `UIFindInteraction` +// with the given `query`. Check `canFindInPage` before calling +// `findStringInPage`. +- (void)findStringInPage:(NSString*)query; + +// Selects and scrolls to the next result if there is one. Otherwise, nothing +// will change. Loop back to the first result if currently on last result. +- (void)findNextStringInPage; + +// Selects and scrolls to the previous result if there is one. Otherwise, +// nothing will change. Loop back to the first result if currently on last +// result. +- (void)findPreviousStringInPage; + +// Stop any ongoing Find session. If called before `findStringInPage` nothing +// occurs. +- (void)stopFindInPage; + +@end + +NS_ASSUME_NONNULL_END + +#endif // IOS_WEB_VIEW_PUBLIC_CWV_FIND_IN_PAGE_CONTROLLER_H_
diff --git a/ios/web_view/public/cwv_web_view.h b/ios/web_view/public/cwv_web_view.h index 62ecf0d..34aa84d 100644 --- a/ios/web_view/public/cwv_web_view.h +++ b/ios/web_view/public/cwv_web_view.h
@@ -15,6 +15,7 @@ @class CWVAutofillController; @class CWVBackForwardList; @class CWVBackForwardListItem; +@class CWVFindInPageController; @class CWVScriptCommand; @class CWVTranslationController; @class CWVWebViewConfiguration; @@ -120,6 +121,10 @@ // The web view's autofill controller. @property(nonatomic, readonly) CWVAutofillController* autofillController; +// The web view's find in page controller. +@property(nonatomic, readonly) + CWVFindInPageController* findInPageController API_AVAILABLE(ios(16.0)); + // An equivalent of // https://developer.apple.com/documentation/webkit/wkwebview/1414977-backforwardlist @property(nonatomic, readonly, nonnull) CWVBackForwardList* backForwardList;
diff --git a/ios/web_view/shell/shell_view_controller.m b/ios/web_view/shell/shell_view_controller.m index d441398..a0c60816 100644 --- a/ios/web_view/shell/shell_view_controller.m +++ b/ios/web_view/shell/shell_view_controller.m
@@ -867,6 +867,17 @@ }]]; } + // Using native FiP through is only available for 16.0, otherwise fallback + // to iGA JS FiP. + if (@available(iOS 16.0, *)) { + [alertController + addAction:[UIAlertAction actionWithTitle:@"Start Find In Page" + style:UIAlertActionStyleDefault + handler:^(UIAlertAction* action) { + [weakSelf startFindInPageSession]; + }]]; + } + [self presentViewController:alertController animated:YES completion:nil]; } @@ -1111,6 +1122,16 @@ self.webView = [self createWebViewWithConfiguration:newConfiguration]; } +- (void)startFindInPageSession { + // Using native FiP through is only available for 16.0, otherwise fallback + // to iGA JS FiP. + if (@available(iOS 16.0, *)) { + if ([_webView.findInPageController canFindInPage]) { + [_webView.findInPageController startFindInPage]; + } + } +} + - (CWVWebView*)createWebViewWithConfiguration: (CWVWebViewConfiguration*)configuration { // Set a non empty CGRect to avoid DCHECKs that occur when a load happens
diff --git a/ios_internal b/ios_internal index 6a51cc6..395eebb 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit 6a51cc6934837120dc3cd3eab35e745cc8950e8e +Subproject commit 395eebb2cf8df3529abc75b898367d14de84978b
diff --git a/media/gpu/v4l2/v4l2_queue.cc b/media/gpu/v4l2/v4l2_queue.cc index 742e046..a67e14cb 100644 --- a/media/gpu/v4l2/v4l2_queue.cc +++ b/media/gpu/v4l2/v4l2_queue.cc
@@ -91,6 +91,7 @@ TRACE_EVENT_INSTANT1(kTracingCategory, name, TRACE_EVENT_SCOPE_THREAD, "type", v4l2_buffer->type); + // TODO(mcasas): Consider using TimeValToTimeDelta(). const int64_t timestamp = V4L2BufferTimestampInMilliseconds(v4l2_buffer); if (timestamp <= 0) { return;
diff --git a/media/gpu/v4l2/v4l2_stateful_video_decoder.cc b/media/gpu/v4l2/v4l2_stateful_video_decoder.cc index fd22273..0a19461 100644 --- a/media/gpu/v4l2/v4l2_stateful_video_decoder.cc +++ b/media/gpu/v4l2/v4l2_stateful_video_decoder.cc
@@ -744,6 +744,9 @@ scoped_refptr<VideoFrame> video_frame = dequeued_buffer->GetVideoFrame(); CHECK(video_frame); + video_frame->set_timestamp( + TimeValToTimeDelta(dequeued_buffer->GetTimeStamp())); + // For a V4L2_MEMORY_MMAP |CAPTURE_queue_| we wrap |video_frame| to // return |dequeued_buffer| to |CAPTURE_queue_|, where they are "pooled". // For a V4L2_MEMORY_DMABUF |CAPTURE_queue_|, we don't do that because @@ -927,6 +930,7 @@ CHECK_GE(v4l2_buffer->GetPlaneSize(/*plane=*/0), media_buffer->data_size()); memcpy(dst, media_buffer->data(), media_buffer->data_size()); v4l2_buffer->SetPlaneBytesUsed(0, media_buffer->data_size()); + v4l2_buffer->SetTimeStamp(TimeDeltaToTimeVal(media_buffer->timestamp())); if (!std::move(*v4l2_buffer).QueueMMap()) { LOG(ERROR) << "Error while queuing input |media_buffer|!";
diff --git a/media/gpu/v4l2/v4l2_utils.cc b/media/gpu/v4l2/v4l2_utils.cc index 2703e9f..165be2e9 100644 --- a/media/gpu/v4l2/v4l2_utils.cc +++ b/media/gpu/v4l2/v4l2_utils.cc
@@ -462,4 +462,15 @@ return slice_based ? v4l2_pix_fmt.first : v4l2_pix_fmt.second; } +base::TimeDelta TimeValToTimeDelta(const struct timeval& timeval) { + struct timespec ts; + const struct timeval temp_timeval = timeval; + TIMEVAL_TO_TIMESPEC(&temp_timeval, &ts); + return base::TimeDelta::FromTimeSpec(ts); +} + +struct timeval TimeDeltaToTimeVal(base::TimeDelta time_delta) { + return base::Time::FromTimeSpec(time_delta.ToTimeSpec()).ToTimeVal(); +} + } // namespace media
diff --git a/media/gpu/v4l2/v4l2_utils.h b/media/gpu/v4l2/v4l2_utils.h index 4e8f089..f823ebc 100644 --- a/media/gpu/v4l2/v4l2_utils.h +++ b/media/gpu/v4l2/v4l2_utils.h
@@ -11,6 +11,7 @@ #include <sys/mman.h> #include "base/functional/callback.h" +#include "base/time/time.h" #include "media/base/video_codecs.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -110,6 +111,13 @@ // V4L2_PIX_FMT_INVALID otherwise. uint32_t VideoCodecProfileToV4L2PixFmt(VideoCodecProfile profile, bool slice_based); + +// Translates a POSIX |timeval| to Chrome's base::TimeDelta. +base::TimeDelta TimeValToTimeDelta(const struct timeval& timeval); + +// Translates a Chrome |time_delta| to a POSIX struct timeval. +struct timeval TimeDeltaToTimeVal(base::TimeDelta time_delta); + } // namespace media #endif // MEDIA_GPU_V4L2_V4L2_UTILS_H_
diff --git a/media/gpu/v4l2/v4l2_video_decoder_backend_stateful.cc b/media/gpu/v4l2/v4l2_video_decoder_backend_stateful.cc index 685bd9c..f04663b 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_backend_stateful.cc +++ b/media/gpu/v4l2/v4l2_video_decoder_backend_stateful.cc
@@ -212,6 +212,7 @@ // Record timestamp of the input buffer so it propagates to the decoded // frames. + // TODO(mcasas): Consider using TimeDeltaToTimeVal(). const struct timespec timespec = current_decode_request_->buffer->timestamp().ToTimeSpec(); struct timeval timestamp = { @@ -439,6 +440,7 @@ // Zero-bytes buffers are returned as part of a flush and can be dismissed. if (buffer->GetPlaneBytesUsed(0) > 0) { + // TODO(mcasas): Consider using TimeValToTimeDelta(). const struct timeval timeval = buffer->GetTimeStamp(); const struct timespec timespec = { .tv_sec = timeval.tv_sec,
diff --git a/remoting/host/pairing_registry_delegate_win.cc b/remoting/host/pairing_registry_delegate_win.cc index ad3f7986..7875e70 100644 --- a/remoting/host/pairing_registry_delegate_win.cc +++ b/remoting/host/pairing_registry_delegate_win.cc
@@ -128,7 +128,7 @@ base::Value::List pairings; // Enumerate and parse all values under the unprivileged key. - DWORD count = unprivileged_.GetValueCount(); + DWORD count = unprivileged_.GetValueCount().value_or(0); for (DWORD index = 0; index < count; ++index) { // presubmit: allow wstring std::wstring value_name; @@ -157,7 +157,7 @@ // Enumerate and delete the values in the privileged and unprivileged keys // separately in case they get out of sync. bool success = true; - DWORD count = unprivileged_.GetValueCount(); + DWORD count = unprivileged_.GetValueCount().value_or(0); while (count > 0) { // presubmit: allow wstring std::wstring value_name; @@ -167,10 +167,10 @@ } success = success && (result == ERROR_SUCCESS); - count = unprivileged_.GetValueCount(); + count = unprivileged_.GetValueCount().value_or(0); } - count = privileged_.GetValueCount(); + count = privileged_.GetValueCount().value_or(0); while (count > 0) { // presubmit: allow wstring std::wstring value_name; @@ -180,7 +180,7 @@ } success = success && (result == ERROR_SUCCESS); - count = privileged_.GetValueCount(); + count = privileged_.GetValueCount().value_or(0); } return success;
diff --git a/services/metrics/ukm_api.md b/services/metrics/ukm_api.md index 5c8c3bf..b737ae8 100644 --- a/services/metrics/ukm_api.md +++ b/services/metrics/ukm_api.md
@@ -273,6 +273,8 @@ To avoid having UKM report becoming unbounded in size, an upper limit is placed on the number of events recorded for each event type. Events that are recorded too frequently may be subject to downsampling (see [go/ukm-downsampling](http://go/ukm-downsampling)). As a rule of thumb, it is recommended that most entries be recorded at most once per 100 page loads on average to limit data volume. +For data quality purposes, if you have the option to record an event from either the browser process or a renderer process, prefer the former. Because renderer processes are not trusted, events recorded in them are more complex to attribute to the corresponding the browser-side navigations using the `DocumentCreated` event (see [go/ukm-readable-guide](http://go/ukm-readable-guide#processing-events-attached-to-blink-document-sources)). Joining using the `DocumentCreated` method also has limitations, such as partial availability of the event due to downsampling, and query performance impacted by the additional join operation. + ### Singular UKM Events The Singular UKM Entry provides a type safe API for updating metric fields of an event where only the latest metric values are recorded. The Singular UKM Entry must be used and destroyed on the same sequence it was created. Currently, only recording from the browser process is supported.
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 9620484c..fc10d5125 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -4827,9 +4827,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4839,8 +4839,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": { @@ -4974,9 +4974,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4986,8 +4986,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": { @@ -5106,9 +5106,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5118,8 +5118,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.coverage.json b/testing/buildbot/chromium.coverage.json index a00ad2f..3832643 100644 --- a/testing/buildbot/chromium.coverage.json +++ b/testing/buildbot/chromium.coverage.json
@@ -25055,9 +25055,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -25067,8 +25067,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": { @@ -25202,9 +25202,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -25214,8 +25214,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": { @@ -25334,9 +25334,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -25346,8 +25346,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 2dcd7708..c505e24 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -4979,6 +4979,54 @@ "15a5229h", "--xctest" ], + "isolate_name": "env_chromium_unittests", + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "env_chromium_unittests iPhone 14 17.0", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "cipd_packages": [ + { + "cipd_package": "infra/tools/mac_toolchain/${platform}", + "location": ".", + "revision": "git_revision:59ddedfe3849abf560cbe0b41bb8e431041cd2bb" + } + ], + "dimensions": { + "cpu": "arm64", + "os": "Mac-13.4" + }, + "named_caches": [ + { + "name": "xcode_ios_15a5229h", + "path": "Xcode.app" + }, + { + "name": "runtime_ios_17_0", + "path": "Runtime-ios-17.0" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://third_party/leveldatabase:env_chromium_unittests/", + "variant_id": "iPhone 14 17.0" + }, + { + "args": [ + "--platform", + "iPhone 14", + "--version", + "17.0", + "--out-dir", + "${ISOLATED_OUTDIR}", + "--xcode-build-version", + "15a5229h", + "--xctest" + ], "isolate_name": "events_unittests", "merge": { "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -5459,6 +5507,54 @@ "15a5229h", "--xctest" ], + "isolate_name": "leveldb_unittests", + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "leveldb_unittests iPhone 14 17.0", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "cipd_packages": [ + { + "cipd_package": "infra/tools/mac_toolchain/${platform}", + "location": ".", + "revision": "git_revision:59ddedfe3849abf560cbe0b41bb8e431041cd2bb" + } + ], + "dimensions": { + "cpu": "arm64", + "os": "Mac-13.4" + }, + "named_caches": [ + { + "name": "xcode_ios_15a5229h", + "path": "Xcode.app" + }, + { + "name": "runtime_ios_17_0", + "path": "Runtime-ios-17.0" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://third_party/leveldatabase:leveldb_unittests/", + "variant_id": "iPhone 14 17.0" + }, + { + "args": [ + "--platform", + "iPhone 14", + "--version", + "17.0", + "--out-dir", + "${ISOLATED_OUTDIR}", + "--xcode-build-version", + "15a5229h", + "--xctest" + ], "isolate_name": "libjingle_xmpp_unittests", "merge": { "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -42683,9 +42779,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -42694,8 +42790,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": { @@ -42830,9 +42926,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -42841,8 +42937,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": { @@ -42962,9 +43058,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -42973,8 +43069,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": { @@ -44208,9 +44304,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -44219,8 +44315,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": { @@ -44355,9 +44451,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -44366,8 +44462,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": { @@ -44487,9 +44583,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -44498,8 +44594,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": { @@ -45130,9 +45226,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45141,8 +45237,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index 4f7654b..bb08c96 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -16118,12 +16118,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16133,8 +16133,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": { @@ -16285,12 +16285,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16300,8 +16300,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": { @@ -16432,12 +16432,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 118.0.5967.0", + "description": "Run with ash-chrome version 118.0.5968.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16447,8 +16447,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v118.0.5967.0", - "revision": "version:118.0.5967.0" + "location": "lacros_version_skew_tests_v118.0.5968.0", + "revision": "version:118.0.5968.0" } ], "dimensions": {
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 3c49246a..c4bf37af 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -4109,6 +4109,7 @@ 'crypto_unittests': {}, 'device_unittests': {}, 'display_unittests': {}, + 'env_chromium_unittests': {}, 'events_unittests': {}, 'gcm_unit_tests': {}, 'gfx_unittests': {}, @@ -4119,6 +4120,7 @@ 'gwp_asan_unittests': {}, 'ipc_tests': {}, 'latency_unittests': {}, + 'leveldb_unittests': {}, 'libjingle_xmpp_unittests': {}, 'liburlpattern_unittests': {}, 'media_unittests': {},
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 360505ab..8cfd538 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -16,16 +16,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 118.0.5967.0', + 'description': 'Run with ash-chrome version 118.0.5968.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5967.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v118.0.5968.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v118.0.5967.0', - 'revision': 'version:118.0.5967.0', + 'location': 'lacros_version_skew_tests_v118.0.5968.0', + 'revision': 'version:118.0.5968.0', }, ], },
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 83dbafc..8eb3cba 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -14344,6 +14344,27 @@ ] } ], + "SharingOfferKeyPairBootstrap": [ + { + "platforms": [ + "android", + "chromeos", + "chromeos_lacros", + "ios", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "SharingOfferKeyPairBootstrap" + ] + } + ] + } + ], "ShoppingListTrackByDefault": [ { "platforms": [ @@ -17012,26 +17033,6 @@ ] } ], - "WebProtectBypassJustification": [ - { - "platforms": [ - "chromeos", - "chromeos_lacros", - "fuchsia", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "kBypassJustificationEnabled" - ] - } - ] - } - ], "WebProtectPrint": [ { "platforms": [
diff --git a/third_party/angle b/third_party/angle index feb0d11b..b8d5a42 160000 --- a/third_party/angle +++ b/third_party/angle
@@ -1 +1 @@ -Subproject commit feb0d11b45ddc7f9ce854de0a1756191c0efdafe +Subproject commit b8d5a423d57d4cb139ce0289cea685eca338828f
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index d491eba..f812fac 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -4730,6 +4730,14 @@ } void Element::ChildrenChanged(const ChildrenChange& change) { + // ContainerNode::ChildrenChanged may run SynchronousMutationObservers which + // want to do flat tree traversals. If we SetNeedsAssignmentRecalc after those + // mutation observers, then they won't get to see an up to date version of the + // flat tree. + if (ShadowRoot* shadow_root = GetShadowRoot()) { + shadow_root->SetNeedsAssignmentRecalc(); + } + ContainerNode::ChildrenChanged(change); CheckForEmptyStyleChange(change.sibling_before_change, @@ -4760,10 +4768,6 @@ .ScheduleInvalidationsForHasPseudoWhenAllChildrenRemoved(*this); } } - - if (ShadowRoot* shadow_root = GetShadowRoot()) { - shadow_root->SetNeedsAssignmentRecalc(); - } } void Element::FinishParsingChildren() {
diff --git a/third_party/blink/renderer/core/events/pop_state_event.cc b/third_party/blink/renderer/core/events/pop_state_event.cc index 2115046b..7e1e498 100644 --- a/third_party/blink/renderer/core/events/pop_state_event.cc +++ b/third_party/blink/renderer/core/events/pop_state_event.cc
@@ -53,7 +53,8 @@ PopStateEvent::PopStateEvent(ScriptState* script_state, const AtomicString& type, const PopStateEventInit* initializer) - : Event(type, initializer) { + : Event(type, initializer), + has_ua_visual_transition_(initializer->hasUAVisualTransition()) { v8::Isolate* isolate = script_state->GetIsolate(); if (initializer->hasState()) { state_.Set(isolate, initializer->state().V8Value());
diff --git a/third_party/blink/renderer/core/events/pop_state_event_init.idl b/third_party/blink/renderer/core/events/pop_state_event_init.idl index 8ca38ca..5f34e1c 100644 --- a/third_party/blink/renderer/core/events/pop_state_event_init.idl +++ b/third_party/blink/renderer/core/events/pop_state_event_init.idl
@@ -6,4 +6,5 @@ dictionary PopStateEventInit : EventInit { any state = null; + boolean hasUAVisualTransition = false; };
diff --git a/third_party/blink/renderer/core/html/forms/html_select_list_element.cc b/third_party/blink/renderer/core/html/forms/html_select_list_element.cc index 9f2b75db..ada5634 100644 --- a/third_party/blink/renderer/core/html/forms/html_select_list_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_select_list_element.cc
@@ -255,7 +255,8 @@ DCHECK(RuntimeEnabledFeatures::HTMLSelectListElementEnabled()); UseCounter::Count(document, WebFeature::kSelectListElement); - EnsureUserAgentShadowRoot(); + EnsureUserAgentShadowRoot().SetSlotAssignmentMode( + SlotAssignmentMode::kManual); select_mutation_callback_ = MakeGarbageCollected<HTMLSelectListElement::SelectMutationCallback>( *this); @@ -266,6 +267,38 @@ IncrementImplicitlyAnchoredElementCount(); } +void HTMLSelectListElement::ManuallyAssignSlots() { + Element* button = nullptr; + Element* listbox = nullptr; + Element* selected_value = nullptr; + Element* marker = nullptr; + VectorOf<Node> options; + for (Node& node : NodeTraversal::ChildrenOf(*this)) { + if (auto* element = DynamicTo<Element>(node)) { + if (!button && element->SlotName() == kButtonPartName) { + button = element; + } else if (!listbox && element->SlotName() == kListboxPartName) { + listbox = element; + } else if (!selected_value && + element->SlotName() == kSelectedValuePartName) { + selected_value = element; + } else if (!marker && element->SlotName() == kMarkerPartName) { + marker = element; + } + if (element->SlotName() == g_empty_atom) { + options.push_back(node); + } + } else if (node.IsSlotable()) { + options.push_back(node); + } + } + button_slot_->Assign(button); + listbox_slot_->Assign(listbox); + selected_value_slot_->Assign(selected_value); + marker_slot_->Assign(marker); + options_slot_->Assign(options); +} + // static HTMLSelectListElement* HTMLSelectListElement::OwnerSelectList(Node* node) { // Do some quick checks in order to avoid, in most cases, walking up the @@ -365,7 +398,7 @@ new_popover->SetShadowPseudoId(AtomicString("-internal-selectlist-listbox")); SetListboxPart(new_popover); - auto* options_slot = MakeGarbageCollected<HTMLSlotElement>(document); + options_slot_ = MakeGarbageCollected<HTMLSlotElement>(document); button_part_->AppendChild(selected_value_slot_); button_part_->AppendChild(marker_slot_); @@ -376,7 +409,7 @@ button_slot_->AppendChild(button_part_); - listbox_part_->appendChild(options_slot); + listbox_part_->appendChild(options_slot_); listbox_slot_->appendChild(listbox_part_); root.AppendChild(button_slot_); @@ -1458,6 +1491,7 @@ visitor->Trace(listbox_slot_); visitor->Trace(marker_slot_); visitor->Trace(selected_value_slot_); + visitor->Trace(options_slot_); visitor->Trace(selected_option_); visitor->Trace(selected_option_when_listbox_opened_); visitor->Trace(suggested_option_);
diff --git a/third_party/blink/renderer/core/html/forms/html_select_list_element.h b/third_party/blink/renderer/core/html/forms/html_select_list_element.h index fc7e2ce..44dd15eb 100644 --- a/third_party/blink/renderer/core/html/forms/html_select_list_element.h +++ b/third_party/blink/renderer/core/html/forms/html_select_list_element.h
@@ -34,6 +34,8 @@ public: explicit HTMLSelectListElement(Document&); + void ManuallyAssignSlots() override; + // LocalFrameView::LifecycleNotificationObserver void DidFinishLifecycleUpdate(const LocalFrameView&) override; @@ -232,6 +234,7 @@ Member<HTMLSlotElement> listbox_slot_; Member<HTMLSlotElement> marker_slot_; Member<HTMLSlotElement> selected_value_slot_; + Member<HTMLSlotElement> options_slot_; Member<HTMLOptionElement> selected_option_; Member<HTMLOptionElement> selected_option_when_listbox_opened_; Member<HTMLOptionElement> suggested_option_;
diff --git a/third_party/blink/renderer/core/html/html_slot_element.cc b/third_party/blink/renderer/core/html/html_slot_element.cc index 7300d36..a4b57a7 100644 --- a/third_party/blink/renderer/core/html/html_slot_element.cc +++ b/third_party/blink/renderer/core/html/html_slot_element.cc
@@ -228,6 +228,14 @@ } } +void HTMLSlotElement::Assign(Node* node) { + VectorOf<Node> nodes; + if (node) { + nodes.push_back(node); + } + Assign(nodes); +} + void HTMLSlotElement::AppendAssignedNode(Node& host_child) { DCHECK(host_child.IsSlotable()); assigned_nodes_.push_back(&host_child);
diff --git a/third_party/blink/renderer/core/html/html_slot_element.h b/third_party/blink/renderer/core/html/html_slot_element.h index 56decdd..c93d368 100644 --- a/third_party/blink/renderer/core/html/html_slot_element.h +++ b/third_party/blink/renderer/core/html/html_slot_element.h
@@ -122,6 +122,7 @@ void assign(HeapVector<Member<V8UnionElementOrText>>& nodes, ExceptionState&); // assign() c++ implementation. void Assign(const HeapVector<Member<Node>>& nodes); + void Assign(Node* node); const HeapLinkedHashSet<WeakMember<Node>>& ManuallyAssignedNodes() const { return manually_assigned_nodes_;
diff --git a/third_party/blink/renderer/core/navigation_api/navigate_event.cc b/third_party/blink/renderer/core/navigation_api/navigate_event.cc index 90ff627..b148e013 100644 --- a/third_party/blink/renderer/core/navigation_api/navigate_event.cc +++ b/third_party/blink/renderer/core/navigation_api/navigate_event.cc
@@ -69,7 +69,8 @@ info_(init->hasInfo() ? init->info() : ScriptValue(context->GetIsolate(), - v8::Undefined(context->GetIsolate()))) { + v8::Undefined(context->GetIsolate()))), + has_ua_visual_transition_(init->hasUAVisualTransition()) { CHECK(IsA<LocalDOMWindow>(context)); CHECK(!controller_ || controller_->signal() == signal_); }
diff --git a/third_party/blink/renderer/core/navigation_api/navigate_event_init.idl b/third_party/blink/renderer/core/navigation_api/navigate_event_init.idl index 9245e2c1..b190fda 100644 --- a/third_party/blink/renderer/core/navigation_api/navigate_event_init.idl +++ b/third_party/blink/renderer/core/navigation_api/navigate_event_init.idl
@@ -21,4 +21,5 @@ FormData? formData = null; DOMString? downloadRequest = null; any info; + boolean hasUAVisualTransition = false; };
diff --git a/third_party/blink/renderer/core/page/touch_adjustment.cc b/third_party/blink/renderer/core/page/touch_adjustment.cc index be7fd161c..760b68c 100644 --- a/third_party/blink/renderer/core/page/touch_adjustment.cc +++ b/third_party/blink/renderer/core/page/touch_adjustment.cc
@@ -549,7 +549,8 @@ const gfx::Point& touch_hotspot, const gfx::Rect& touch_area, const HeapVector<Member<Node>>& nodes) { - CHECK(touch_area.Contains(touch_hotspot)); + // TODO(https://crbug.com/1469267): A CHECK here caused failures on Android! + DCHECK(touch_area.Contains(touch_hotspot)); touch_adjustment::NodeFilter node_filter; touch_adjustment::AppendSubtargetsForNode append_subtargets_for_node;
diff --git a/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.cc index de62c21..ab6fd9f 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.cc
@@ -204,8 +204,8 @@ // If the ‘text-decoration-line’ is not ‘spelling-error’ or ‘grammar-error’, // depending on the pseudo. ‘text-decoration-color’ can vary without hurting - // the optimisation, and for these line types, we ignore ‘-thickness’ and - // ‘-style’ and ‘text-decoration-skip-ink’ anyway. + // the optimisation, and for these line types, we ignore all other text + // decoration related properties anyway. if (pseudo_style->TextDecorationsInEffect() != (pseudo == kPseudoIdSpellingError ? TextDecorationLine::kSpellingError
diff --git a/third_party/blink/renderer/core/paint/text_decoration_info.cc b/third_party/blink/renderer/core/paint/text_decoration_info.cc index b47e9cf..4f473a58 100644 --- a/third_party/blink/renderer/core/paint/text_decoration_info.cc +++ b/third_party/blink/renderer/core/paint/text_decoration_info.cc
@@ -510,7 +510,7 @@ DCHECK(applied_text_decoration_); const int paint_underline_offset = decoration_offset.ComputeUnderlineOffset( FlippedUnderlinePosition(), TargetStyle().ComputedFontSize(), FontData(), - applied_text_decoration_->UnderlineOffset(), ResolvedThickness()); + Length(), ResolvedThickness()); SetLineData(HasSpellingError() ? TextDecorationLine::kSpellingError : TextDecorationLine::kGrammarError, paint_underline_offset); @@ -540,6 +540,13 @@ } Color TextDecorationInfo::LineColor() const { + if (HasSpellingError()) { + return LayoutTheme::GetTheme().PlatformSpellingMarkerUnderlineColor(); + } + if (HasGrammarError()) { + return LayoutTheme::GetTheme().PlatformGrammarMarkerUnderlineColor(); + } + if (highlight_override_) return *highlight_override_;
diff --git a/third_party/blink/renderer/modules/webaudio/panner_handler.cc b/third_party/blink/renderer/modules/webaudio/panner_handler.cc index 9620483..ca2f994a 100644 --- a/third_party/blink/renderer/modules/webaudio/panner_handler.cc +++ b/third_party/blink/renderer/modules/webaudio/panner_handler.cc
@@ -21,7 +21,7 @@ namespace { -// A PannerNode only supports 1 or 2 channels +// A PannerNode only supports 1 or 2 channels. constexpr unsigned kMinimumOutputChannels = 1; constexpr unsigned kMaximumOutputChannels = 2; @@ -55,7 +55,7 @@ AddInput(); AddOutput(kMaximumOutputChannels); - // Node-specific default mixing rules. + // Node-specific default mixing rules channel_count_ = kMaximumOutputChannels; SetInternalChannelCountMode(kClampedMax); SetInternalChannelInterpretation(AudioBus::kSpeakers); @@ -217,17 +217,20 @@ void PannerHandler::ProcessSampleAccurateValues(AudioBus* destination, const AudioBus* source, uint32_t frames_to_process) { - CHECK_LE(frames_to_process, GetDeferredTaskHandler().RenderQuantumFrames()); + const unsigned render_quantum_frames = + GetDeferredTaskHandler().RenderQuantumFrames(); - // Get the sample accurate values from all of the AudioParams, including the - // values from the AudioListener. - float panner_x[GetDeferredTaskHandler().RenderQuantumFrames()]; - float panner_y[GetDeferredTaskHandler().RenderQuantumFrames()]; - float panner_z[GetDeferredTaskHandler().RenderQuantumFrames()]; + CHECK_LE(frames_to_process, render_quantum_frames); - float orientation_x[GetDeferredTaskHandler().RenderQuantumFrames()]; - float orientation_y[GetDeferredTaskHandler().RenderQuantumFrames()]; - float orientation_z[GetDeferredTaskHandler().RenderQuantumFrames()]; + float panner_x[render_quantum_frames]; + float panner_y[render_quantum_frames]; + float panner_z[render_quantum_frames]; + float orientation_x[render_quantum_frames]; + float orientation_y[render_quantum_frames]; + float orientation_z[render_quantum_frames]; + double azimuth[render_quantum_frames]; + double elevation[render_quantum_frames]; + float total_gain[render_quantum_frames]; position_x_->CalculateSampleAccurateValues(panner_x, frames_to_process); position_y_->CalculateSampleAccurateValues(panner_y, frames_to_process); @@ -239,34 +242,18 @@ orientation_z_->CalculateSampleAccurateValues(orientation_z, frames_to_process); - // Get the automation values from the listener. auto listener = Listener(); - const float* listener_x = listener->GetPositionXValues( - GetDeferredTaskHandler().RenderQuantumFrames()); - const float* listener_y = listener->GetPositionYValues( - GetDeferredTaskHandler().RenderQuantumFrames()); - const float* listener_z = listener->GetPositionZValues( - GetDeferredTaskHandler().RenderQuantumFrames()); - - const float* forward_x = listener->GetForwardXValues( - GetDeferredTaskHandler().RenderQuantumFrames()); - const float* forward_y = listener->GetForwardYValues( - GetDeferredTaskHandler().RenderQuantumFrames()); - const float* forward_z = listener->GetForwardZValues( - GetDeferredTaskHandler().RenderQuantumFrames()); - - const float* up_x = - listener->GetUpXValues(GetDeferredTaskHandler().RenderQuantumFrames()); - const float* up_y = - listener->GetUpYValues(GetDeferredTaskHandler().RenderQuantumFrames()); - const float* up_z = - listener->GetUpZValues(GetDeferredTaskHandler().RenderQuantumFrames()); + const float* listener_x = listener->GetPositionXValues(render_quantum_frames); + const float* listener_y = listener->GetPositionYValues(render_quantum_frames); + const float* listener_z = listener->GetPositionZValues(render_quantum_frames); + const float* forward_x = listener->GetForwardXValues(render_quantum_frames); + const float* forward_y = listener->GetForwardYValues(render_quantum_frames); + const float* forward_z = listener->GetForwardZValues(render_quantum_frames); + const float* up_x = listener->GetUpXValues(render_quantum_frames); + const float* up_y = listener->GetUpYValues(render_quantum_frames); + const float* up_z = listener->GetUpZValues(render_quantum_frames); // Compute the azimuth, elevation, and total gains for each position. - double azimuth[GetDeferredTaskHandler().RenderQuantumFrames()]; - double elevation[GetDeferredTaskHandler().RenderQuantumFrames()]; - float total_gain[GetDeferredTaskHandler().RenderQuantumFrames()]; - for (unsigned k = 0; k < frames_to_process; ++k) { gfx::Point3F panner_position(panner_x[k], panner_y[k], panner_z[k]); gfx::Vector3dF orientation(orientation_x[k], orientation_y[k], @@ -278,7 +265,6 @@ CalculateAzimuthElevation(&azimuth[k], &elevation[k], panner_position, listener_position, listener_forward, listener_up); - // Get distance and cone gain total_gain[k] = CalculateDistanceConeGain(panner_position, orientation, listener_position); } @@ -305,7 +291,6 @@ position_x_->CalculateSampleAccurateValues(values, frames_to_process); position_y_->CalculateSampleAccurateValues(values, frames_to_process); position_z_->CalculateSampleAccurateValues(values, frames_to_process); - orientation_x_->CalculateSampleAccurateValues(values, frames_to_process); orientation_y_->CalculateSampleAccurateValues(values, frames_to_process); orientation_z_->CalculateSampleAccurateValues(values, frames_to_process);
diff --git a/third_party/blink/renderer/modules/webaudio/panner_handler.h b/third_party/blink/renderer/modules/webaudio/panner_handler.h index 1ac5859..fb05133 100644 --- a/third_party/blink/renderer/modules/webaudio/panner_handler.h +++ b/third_party/blink/renderer/modules/webaudio/panner_handler.h
@@ -45,56 +45,43 @@ ~PannerHandler() override; // AudioHandler - void ProcessIfNecessary(uint32_t frames_to_process) override; - void Process(uint32_t frames_to_process) override; - void ProcessSampleAccurateValues(AudioBus* destination, - const AudioBus* source, - uint32_t frames_to_process); - void ProcessOnlyAudioParams(uint32_t frames_to_process) override; void Initialize() override; - void Uninitialize() override; - - // Panning model - String PanningModel() const; - void SetPanningModel(const String&); - - // Position and orientation - void SetPosition(float x, float y, float z, ExceptionState&); - void SetOrientation(float x, float y, float z, ExceptionState&); - - // Distance parameters - String DistanceModel() const; - void SetDistanceModel(const String&); - - double RefDistance() { return distance_effect_.RefDistance(); } - void SetRefDistance(double); - - double MaxDistance() { return distance_effect_.MaxDistance(); } - void SetMaxDistance(double); - - double RolloffFactor() { return distance_effect_.RolloffFactor(); } - void SetRolloffFactor(double); - - // Sound cones - angles in degrees - double ConeInnerAngle() const { return cone_effect_.InnerAngle(); } - void SetConeInnerAngle(double); - - double ConeOuterAngle() const { return cone_effect_.OuterAngle(); } - void SetConeOuterAngle(double); - - double ConeOuterGain() const { return cone_effect_.OuterGain(); } - void SetConeOuterGain(double); - - void MarkPannerAsDirty(unsigned); - - double TailTime() const override { return panner_ ? panner_->TailTime() : 0; } double LatencyTime() const override { return panner_ ? panner_->LatencyTime() : 0; } - bool RequiresTailProcessing() const final; + void Process(uint32_t frames_to_process) override; + void ProcessIfNecessary(uint32_t frames_to_process) override; + void ProcessOnlyAudioParams(uint32_t frames_to_process) override; + void ProcessSampleAccurateValues(AudioBus* destination, + const AudioBus* source, + uint32_t frames_to_process); + bool RequiresTailProcessing() const override; + void SetChannelCount(unsigned, ExceptionState&) override; + void SetChannelCountMode(const String&, ExceptionState&) override; + double TailTime() const override { return panner_ ? panner_->TailTime() : 0; } + void Uninitialize() override; - void SetChannelCount(unsigned, ExceptionState&) final; - void SetChannelCountMode(const String&, ExceptionState&) final; + double ConeInnerAngle() const { return cone_effect_.InnerAngle(); } + double ConeOuterAngle() const { return cone_effect_.OuterAngle(); } + double ConeOuterGain() const { return cone_effect_.OuterGain(); } + String DistanceModel() const; + double MaxDistance() { return distance_effect_.MaxDistance(); } + String PanningModel() const; + double RefDistance() { return distance_effect_.RefDistance(); } + double RolloffFactor() { return distance_effect_.RolloffFactor(); } + + void SetConeInnerAngle(double angles_in_degrees); + void SetConeOuterAngle(double angles_in_degrees); + void SetConeOuterGain(double); + void SetDistanceModel(const String&); + void SetMaxDistance(double); + void SetOrientation(float x, float y, float z, ExceptionState&); + void SetPanningModel(const String&); + void SetPosition(float x, float y, float z, ExceptionState&); + void SetRefDistance(double); + void SetRolloffFactor(double); + + void MarkPannerAsDirty(unsigned); private: PannerHandler(AudioNode&, @@ -109,9 +96,14 @@ // BaseAudioContext's listener CrossThreadPersistent<AudioListener> Listener() const; - bool SetPanningModel(Panner::PanningModel); // Returns true on success. - bool SetDistanceModel(unsigned); // Returns true on success. + // Returns true on successful operation. + bool SetPanningModel(Panner::PanningModel); + bool SetDistanceModel(unsigned); + gfx::Point3F GetPosition() const; + gfx::Vector3dF Orientation() const; + + // Returns a combined gain attenuation for azimuth and elevation. void CalculateAzimuthElevation(double* out_azimuth, double* out_elevation, const gfx::Point3F& position, @@ -119,59 +111,56 @@ const gfx::Vector3dF& listener_forward, const gfx::Vector3dF& listener_up); - // Returns the combined distance and cone gain attenuation. + // Returns a combined gain attenuation for distance and sound cone. float CalculateDistanceConeGain(const gfx::Point3F& position, const gfx::Vector3dF& orientation, const gfx::Point3F& listener_position); + // The in-place version of `CalculateAzimuthElevation` above for k-rate. void AzimuthElevation(double* out_azimuth, double* out_elevation); + + // Returns a combined gain attenuation for distance and sound cone in k-rate. float DistanceConeGain(); bool IsAzimuthElevationDirty() const { return is_azimuth_elevation_dirty_; } bool IsDistanceConeGainDirty() const { return is_distance_cone_gain_dirty_; } void UpdateDirtyState(); - // AudioListener is held alive by PannerNode. - CrossThreadWeakPersistent<AudioListener> listener_; - std::unique_ptr<Panner> panner_; - Panner::PanningModel panning_model_; - unsigned distance_model_ = DistanceEffect::kModelInverse; - - bool is_azimuth_elevation_dirty_ = true; - bool is_distance_cone_gain_dirty_ = true; - - // Gain - DistanceEffect distance_effect_; - ConeEffect cone_effect_; - - // Cached values - double cached_azimuth_ = 0; - double cached_elevation_ = 0; - float cached_distance_cone_gain_ = 1.0f; - - gfx::Point3F GetPosition() const; - gfx::Vector3dF Orientation() const; - // True if any of this panner's AudioParams have automations. bool HasSampleAccurateValues() const; - // True if any of the panner's AudioParams are set for a-rate - // automations (the default). + // True if any of the panner's AudioParams are set for a-rate automations + // (the default). bool IsAudioRate() const; - scoped_refptr<AudioParamHandler> position_x_; - scoped_refptr<AudioParamHandler> position_y_; - scoped_refptr<AudioParamHandler> position_z_; + CrossThreadWeakPersistent<AudioListener> listener_; - scoped_refptr<AudioParamHandler> orientation_x_; - scoped_refptr<AudioParamHandler> orientation_y_; - scoped_refptr<AudioParamHandler> orientation_z_; + std::unique_ptr<Panner> panner_; + + Panner::PanningModel panning_model_; + unsigned distance_model_ = DistanceEffect::kModelInverse; gfx::Point3F last_position_; gfx::Vector3dF last_orientation_; - // Synchronize process() with setting of the panning model, source's location - // information, listener, distance parameters and sound cones. + double cached_azimuth_ = 0; + double cached_elevation_ = 0; + bool is_azimuth_elevation_dirty_ = true; + + DistanceEffect distance_effect_; + ConeEffect cone_effect_; + float cached_distance_cone_gain_ = 1.0f; + bool is_distance_cone_gain_dirty_ = true; + + scoped_refptr<AudioParamHandler> position_x_; + scoped_refptr<AudioParamHandler> position_y_; + scoped_refptr<AudioParamHandler> position_z_; + scoped_refptr<AudioParamHandler> orientation_x_; + scoped_refptr<AudioParamHandler> orientation_y_; + scoped_refptr<AudioParamHandler> orientation_z_; + + // To synchronize `Process()` with the setting of this panner's state. (e.g. + // position, orientation, distance, sound cone, and the listener) mutable base::Lock process_lock_; };
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 6fd42c0c..8523d75 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1948,7 +1948,7 @@ }, { name: "HasUAVisualTransition", - status: "test", + status: "stable", base_feature: "none", }, // HighlightAPI's custom highlights use HighlightInheritance's behavior even
diff --git a/third_party/blink/tools/blinkpy/w3c/import_notifier.py b/third_party/blink/tools/blinkpy/w3c/import_notifier.py index a8754b9..939c06ca 100644 --- a/third_party/blink/tools/blinkpy/w3c/import_notifier.py +++ b/third_party/blink/tools/blinkpy/w3c/import_notifier.py
@@ -353,8 +353,10 @@ dir_metadata_path = self.host.filesystem.join( directory, "DIR_METADATA") epilogue = ( - '\nTo opt out of WPT import notifications for this component, ' - 'add "wpt { notify: NO }" to "%s".' % dir_metadata_path) + '\nThis bug was filed automatically due to a new WPT test ' + 'failure for which you are marked an OWNER. ' + 'If you do not want to receive these reports, please add ' + '"wpt { notify: NO }" to the relevant DIR_METADATA file.') description = (prologue + failure_list + expectations_statement + range_statement + commit_list + links_list +
diff --git a/third_party/blink/tools/blinkpy/w3c/import_notifier_unittest.py b/third_party/blink/tools/blinkpy/w3c/import_notifier_unittest.py index ac6a7cb..cd040ca0 100644 --- a/third_party/blink/tools/blinkpy/w3c/import_notifier_unittest.py +++ b/third_party/blink/tools/blinkpy/w3c/import_notifier_unittest.py
@@ -503,9 +503,10 @@ self.assertIn('crbug.com/12345 external/wpt/foo/baz.html [ Fail ]', bugs[0].body['description'].splitlines()) self.assertIn( - 'To opt out of WPT import notifications for this component, ' - 'add "wpt { notify: NO }" to "external/wpt/foo/DIR_METADATA".', - bugs[0].body['description'].splitlines()) + 'This bug was filed automatically due to a new WPT test failure ' + 'for which you are marked an OWNER. If you do not want to receive ' + 'these reports, please add "wpt { notify: NO }" to the relevant ' + 'DIR_METADATA file.', bugs[0].body['description'].splitlines()) def test_file_bug_without_owners(self): """A bug should be filed, even without OWNERS next to DIR_METADATA."""
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 14a325f3..5ad14985 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -1047,11 +1047,6 @@ # `text-decoration-skip-ink: all` not implemented yet. crbug.com/1054656 external/wpt/css/css-text-decor/text-decoration-skip-ink-005.html [ Crash Failure Pass Timeout ] -# `text-decoration: spelling|grammar-error` -crbug.com/1163436 wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-001.html [ Failure ] -crbug.com/1163436 wpt_internal/css/css-text-decor/text-decoration-line-spelling-error-001.html [ Failure ] - - crbug.com/846753 [ Mac ] http/tests/media/reload-after-dialog.html [ Failure Pass Timeout ] ### external/wpt/css/css-tables/
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 144dc59b..e6c069e5 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -4276,7 +4276,9 @@ "wpt_internal/css/css-pseudo/spelling-error-color-dynamic-003.html", "wpt_internal/css/css-pseudo/spelling-error-color-dynamic-004.html", "wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-001.html", + "wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-002.html", "wpt_internal/css/css-text-decor/text-decoration-line-spelling-error-001.html", + "wpt_internal/css/css-text-decor/text-decoration-line-spelling-error-002.html", "wpt_internal/digital-goods/digital-goods-interface.https.html", "wpt_internal/display-lock/beforematch/beforematch-scroll-to-text-fragment.html", "wpt_internal/display-lock/css-content-visibility/hiddenuntilfound/content-visibility-auto-text-fragment.html",
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 baee0606..48c4d3b 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
@@ -279306,11 +279306,11 @@ "support": { ".cache": { "gitignore2.json": [ - "a25f3796e54a5b97869fbbcb8a3482d9961e4fa5", + "2007900b8dadd36d746b945687204e1bda6266fb", [] ], "mtime.json": [ - "85615b0d65ada4937e9f8763b2b5eceb01874a8b", + "a7e07a4dfa3aabf8110cb03351cc6fcb1f631d5d", [] ] }, @@ -287309,6 +287309,10 @@ "86cbebe62e06f8f90f2801d348af7f84ced12312", [] ], + "background-048.xht.ini": [ + "706387322fb22c31056194b3b5e6657e766e1db6", + [] + ], "background-055.xht.ini": [ "0733404049807afe641944860e9077a8c46d116a", [] @@ -288342,7 +288346,7 @@ [] ], "background-root-013b.xht.ini": [ - "939f269d0c7001fdbc0c21259c72e87e96ac447c", + "870af93144d9ca979e37f35b0f446966f0f09d27", [] ], "background-root-014a-ref.xht": [ @@ -289185,6 +289189,10 @@ "ea9e7c3bcdc57c08b92cb58c19870f26b0098882", [] ], + "border-bottom-color-012.xht.ini": [ + "119e2a3cf4e04cfc049f804e090152b242d8eca0", + [] + ], "border-bottom-color-013.xht.ini": [ "8fc0e7cab7be0a63b6ae2428ba7e913a3120ecdc", [] @@ -289309,6 +289317,10 @@ "8096f85a34258c38b50736f331cc9324d639c512", [] ], + "border-bottom-color-053.xht.ini": [ + "7c72657ab6dae926dcf65776761eae68f9dd014f", + [] + ], "border-bottom-color-054-ref.xht": [ "9d1c01f601152b10beac4885b2154b51bd29d469", [] @@ -289353,6 +289365,10 @@ "813946da33074aaf8f2f42e23b59adf0b9ed7389", [] ], + "border-bottom-color-076.xht.ini": [ + "996b8b197a2d6d4fbf77d933afdacfc4e4ec5181", + [] + ], "border-bottom-color-078.xht.ini": [ "4aa9bda4b7fefe18483ebbf6758231a73c07ee7d", [] @@ -289993,6 +290009,10 @@ "fb0c1f515d21888af7f48f1d2b3d8e18885d965f", [] ], + "border-right-applies-to-001.xht.ini": [ + "56b5a01927c06c510b00e86727abf8ea2d4cf700", + [] + ], "border-right-applies-to-007.xht.ini": [ "88a2e522606e48bf8c2696c7aa6dc2eb6638dad7", [] @@ -290613,6 +290633,10 @@ "3b7317865ad37d6d4fb34b9fca913ee72f57be85", [] ], + "border-top-color-077.xht.ini": [ + "249e2408314271b88dbb9e93870bf64d1b8b0cbd", + [] + ], "border-top-color-080.xht.ini": [ "97fd554293549c39a1569ec10751ef45c64694cb", [] @@ -290622,7 +290646,11 @@ [] ], "border-top-color-086.xht.ini": [ - "febad4719e03bd563b731251b2f883bc9f75bcbe", + "419cc628d5fdc9a9cc0c4b323a18875da445bdfb", + [] + ], + "border-top-color-087.xht.ini": [ + "9f66327fe3675a5eb9a755e5ba12629c9f2657be", [] ], "border-top-color-090.xht.ini": [ @@ -292124,7 +292152,7 @@ [] ], "float-applies-to-013.xht.ini": [ - "1afec0d8039240a40b48148cd10ab8e1e482828f", + "0ebd97a0901d73edd79eab47d375ea0a0f5fc354", [] ], "float-applies-to-014.xht.ini": [ @@ -293437,6 +293465,10 @@ "fb3b0b9b800c18c06c33e4cdfb2dec774901c1c3", [] ], + "block-formatting-context-height-003.xht.ini": [ + "65c10b4754bd219fca16055ef8fabc87320fb3ca", + [] + ], "block-formatting-contexts-001-ref.xht": [ "305691fbaffe79f3b464405a9011933670ebf344", [] @@ -293470,7 +293502,7 @@ [] ], "block-formatting-contexts-007.xht.ini": [ - "1ab207a3088f480d5ecc63cfeb3e68ebd1691aa1", + "4daad6bb73af0e0bea8abb5527be87e2cf432d82", [] ], "block-formatting-contexts-008-ref.xht": [ @@ -294271,6 +294303,10 @@ "f2f9e0ec111102a25ed98f848580d6f32259b717", [] ], + "max-height-107.xht.ini": [ + "f9e4a9e44a0707592836d9f7be2fc6491591201f", + [] + ], "max-height-110-ref.xht": [ "769a7abbdf8fd0b8867fb6d1d31f43574a291d9b", [] @@ -294343,6 +294379,10 @@ "b6301113707db228ce267640905f9bcb81637fc8", [] ], + "max-width-072.xht.ini": [ + "aea71c3c8428e855475817ecebb05b8040c202b0", + [] + ], "max-width-103.xht.ini": [ "b3215c9fda6baeb3050877a9a42ee4513cb32ae7", [] @@ -295192,7 +295232,7 @@ [] ], "absolute-replaced-width-003c.xht.ini": [ - "776db3345024ef96fa2438d465c26e6b1204f826", + "db61344edd333e872d342886f20c6663b9144a75", [] ], "absolute-replaced-width-004-ref.xht": [ @@ -295299,6 +295339,10 @@ "f51f7e87be8b00be2097108697d98cadc1f568f5", [] ], + "absolute-replaced-width-039.xht.ini": [ + "e8bd7ec492f51a05d28e74a595edf01e93125535", + [] + ], "absolute-replaced-width-041-ref.xht": [ "893f3596e5cc0d20262e8c5752452a136ce4a5ab", [] @@ -295708,7 +295752,7 @@ [] ], "left-016.xht.ini": [ - "3981c032cc8bda95a0cb0ac67c8d9d2b0fe3ef9d", + "1d6a805eae5d6d9f3b180f4ebd2d3b54ce8c4cd1", [] ], "left-017.xht.ini": [ @@ -296481,6 +296525,10 @@ "7f7f118b2c747ad87fc3de69d0c67991ad4f1c0b", [] ], + "top-113.xht.ini": [ + "553e5aee56a846af5686b2904b12260ad93d01fd", + [] + ], "top-applies-to-001-ref.xht": [ "6c513cfd2029be45f0360d43e5c40e59dd0eead5", [] @@ -297321,6 +297369,10 @@ "ed7a1cd4faef8f7a82bb7ba8391902e3d75b7fdb", [] ], + "fixed-table-layout-019.xht.ini": [ + "32efea1dfa3185117c86967fc527f61b057c4036", + [] + ], "fixed-table-layout-020.xht.ini": [ "a29cc2e0ab9eb335bbf37d5e6fb2c1645a336078", [] @@ -299488,7 +299540,7 @@ [] ], "mix-blend-mode-video-sibling.html.ini": [ - "bc72db7e3e4f221314b72b41e59e158e0ad99f26", + "e9eaf1ef2c5222c6286d7c8d552427110a6a6929", [] ], "mix-blend-mode-video.html.ini": [ @@ -301783,7 +301835,7 @@ [] ], "border-radius-clipping-with-transform-001.html.ini": [ - "3dcf808146d3728217775b0a9ea36034ca3b464e", + "2f282744c4b0f663d060876b42b939511a85a6dc", [] ], "border-radius-dynamic-from-no-radius-ref.html": [ @@ -301830,6 +301882,10 @@ "c3712fb856368a9de23708a5d08066d13ffb4e9a", [] ], + "border-top-width-thick.html.ini": [ + "ce3c00395b78c6860c9c52cb3d2dac5f48ac0eb9", + [] + ], "border-width-cssom.html.ini": [ "93e03ee39ccbb676caacab8041685f42cb45a105", [] @@ -303783,7 +303839,7 @@ [] ], "borders-004.html.ini": [ - "72b2ebd5a1456cc7cca1d9393a85b678e026a697", + "b381f4cd37647c8e83976643fd98ab3ae6a38aba", [] ], "borders-005-ref.html": [ @@ -305529,7 +305585,7 @@ [] ], "tall-float-pushed-to-next-fragmentainer-003.html.ini": [ - "f8d7a98aa9553c868b10a4453e8c8c77f758de3e", + "c914371185fe8443b20cf587768b5167b35e65f4", [] ], "tall-line-in-short-fragmentainer-002.html.ini": [ @@ -305654,6 +305710,10 @@ "e25558578344f0725d752e35fcc35e2db683eb2c", [] ], + "all-prop-initial-color.html.ini": [ + "78a791f7b7f7f969aba38bfe7830eb2d1b521a4f", + [] + ], "all-prop-initial-visited-ref.html": [ "f596b559b0e26b9c03d47b7dcab966a4d091308b", [] @@ -307654,7 +307714,7 @@ [] ], "canvas-as-container-002.html.ini": [ - "a2df9032fd586902cd8bd471d469c90a2b0310b6", + "523eb04ac0e3ca677c2942311d9274a8679bdda1", [] ], "canvas-as-container-003.html.ini": [ @@ -307882,7 +307942,7 @@ [] ], "content-visibility-033.sub.https.html.ini": [ - "d6d83940ffc4f594f171aa4eea8bc22476736ad6", + "03bfeafd3a2ff2708f5b4bfb4b37be981789caff", [] ], "content-visibility-034-ref.html": [ @@ -311016,6 +311076,10 @@ "a45310a2a1c51eaf71a85e792fcf392c875a9b55", [] ], + "auto-height-with-flex.html.ini": [ + "41a187b1be54c66e2eba0ca02b8cc68c7cacdd0a", + [] + ], "auto-margins-001-ref.html": [ "57f4307ca0c60174495221d27d2a739f14a94abe", [] @@ -312623,7 +312687,7 @@ [] ], "flexbox_flex-0-1-Npercent.html.ini": [ - "9b0eaf0dcc55f04931fee8468101335ad2d1bb6e", + "52baefe7320f26c9ee68773c83697a031ecd077a", [] ], "flexbox_flex-0-1-auto-ref.html": [ @@ -313106,6 +313170,10 @@ "1ca43d8464e81cd0b0ac248e526ea5f28de0890e", [] ], + "flexbox_justifycontent-center.html.ini": [ + "ee9ca929caeba110ddf7a6066879e6595d5fe02f", + [] + ], "flexbox_justifycontent-end-ref.html": [ "5d782c465996945b248b54cd2f8603a076739165", [] @@ -313402,6 +313470,10 @@ "64d21f89c02b1b360000e0dbab0a363b62fa073d", [] ], + "gap-004-rl.html.ini": [ + "b33f3a6b04de0eb3e36fbb0657ae6e9d38649d62", + [] + ], "gap-004-rtl-ref.html": [ "eadf6c31b935a0bb94ee17d47f8b530b5def3fe4", [] @@ -315168,6 +315240,10 @@ "5d0e0d7931f5a08707c8fbca5400fdf563679b9d", [] ], + "font-size-adjust-011.html.ini": [ + "fb6b00fafbe96028ccd30ad09d88d8e88fe3f700", + [] + ], "font-size-adjust-012-ref.html": [ "ac93186a23c74af801aa9d4a8bf75440f4e2e5ce", [] @@ -315404,6 +315480,10 @@ "49427186bee6e2a2675ad06f0396dcb5f3ac11e0", [] ], + "font-variant-alternates-05.html.ini": [ + "bdd1e215357972130c79ea5143e5541639be6bb3", + [] + ], "font-variant-alternates-06-ref.html": [ "b2fc91762eb9fb0e78c64635e31d3a45def5e77d", [] @@ -331586,6 +331666,10 @@ "04ec9d740b837be76f41f5585d96ae01316eaca8", [] ], + "multicol-count-non-integer-001.xht.ini": [ + "683f6792c80819ca3291aabeb374dd0bc672537b", + [] + ], "multicol-count-non-integer-002.xht.ini": [ "89c26d423fda7faf623b29445091a377ce8a7a7d", [] @@ -331966,6 +332050,10 @@ "23ecc6dec3452dc6a47d872c6719ca18258968c9", [] ], + "multicol-rule-double-000.xht.ini": [ + "392c8cd0c82552f01fb92b928e316059b28c5aa6", + [] + ], "multicol-rule-fraction-001-ref.xht": [ "29ab6de4aff1df1c4366644b8572c8dd796ad153", [] @@ -335015,6 +335103,10 @@ "95eb910229fce82d013ae2af91a39e5803fb2c7d", [] ], + "position-sticky-left-003.html.ini": [ + "28e8732b84655da97421a254bce246bedc17fe1f", + [] + ], "position-sticky-margins.html.ini": [ "5d9b72f3895d46daf9105d36d6bb7eb2b502d888", [] @@ -337542,6 +337634,10 @@ "37e7c7af8390c77baeee9ff8f3ec182514f5e588", [] ], + "scroll-target-snap-003.html.ini": [ + "27ed451ae9520add558f525e14c593ccf66a39a1", + [] + ], "selection-target-expected.txt": [ "fc26df28fe32770cdf60881c7dd6eae94c0cae0c", [] @@ -337682,6 +337778,10 @@ "890179a21c68bc7051c1db252fb7550468bb952e", [] ], + "scrollbar-color-010.html.ini": [ + "8df845960751021e390bb1fd9ae17a72e4a6d190", + [] + ], "scrollbar-color-011-ref.html": [ "a4db731eb0ddc19c9b51e8b365def94e156f2db1", [] @@ -347305,6 +347405,10 @@ "ef0bf49032d0606d770fa37e13f407f9e6692b0f", [] ], + "word-break-break-all-012.html.ini": [ + "b28d526da64ea0f7b46ab9be413798b8932a51cf", + [] + ], "word-break-break-all-014.html.ini": [ "115cfea97075cc0ca1b7902f01aada639200e56b", [] @@ -350233,7 +350337,7 @@ [] ], "transform-applies-to-001.xht.ini": [ - "689cfd3d8c3ff4fa2b99b13f3b9a035017a22e25", + "3333a342e306f39fb193811137b6f7306e0728b9", [] ], "transform-background-003.html.ini": [ @@ -351296,6 +351400,10 @@ "802fee6e014911f62fce9325cd46478036daeb7c", [] ], + "ttwf-transform-skewy-001.html.ini": [ + "fbae5b28fcecba586426f9572d92971aa6d743b1", + [] + ], "z-index-does-not-apply-ref.html": [ "f3b68dd6c953c90d85a795d5e140ce0fe91ca941", [] @@ -352858,7 +352966,7 @@ [] ], "kind-of-widget-fallback-button-background-origin-001.html.ini": [ - "c2681c6e3a05be6c58603043ecb5ddc1c445f8f5", + "60a808318682d62b34b216617953151a6c40b5ce", [] ], "kind-of-widget-fallback-button-background-position-001.html.ini": [ @@ -352890,7 +352998,7 @@ [] ], "kind-of-widget-fallback-button-border-block-start-width-001.html.ini": [ - "d02de3ea1fd51464e786ce9f98ad1faaae4860db", + "bd9b0161e514dc673299fbd520ae3107b27dbb49", [] ], "kind-of-widget-fallback-button-border-bottom-color-001.html.ini": [ @@ -353170,7 +353278,7 @@ [] ], "kind-of-widget-fallback-color-input-border-top-left-radius-001.html.ini": [ - "4eab51176adf2b1fc701209d623ceb277d2d1cc4", + "4676fb91bd40a716fc77e5549300281137132da8", [] ], "kind-of-widget-fallback-color-input-border-top-right-radius-001.html.ini": [ @@ -353366,7 +353474,7 @@ [] ], "kind-of-widget-fallback-input-reset-border-block-end-style-001.html.ini": [ - "c454e2c25e7075dac89672f0daf973d2218b2115", + "ef3ca1bcab256fa76fc959f9498bc021525636b4", [] ], "kind-of-widget-fallback-input-reset-border-block-end-width-001.html.ini": [ @@ -353506,7 +353614,7 @@ [] ], "kind-of-widget-fallback-input-search-background-clip-001.html.ini": [ - "caf7f58bb29eae5a3a54a74b9054e2f8a3c536cb", + "a228c7d1ecf39d70a25b65fbbcd0fdeefa7514f7", [] ], "kind-of-widget-fallback-input-search-background-image-001.html.ini": [ @@ -353714,7 +353822,7 @@ [] ], "kind-of-widget-fallback-input-search-text-border-block-start-style-001.html.ini": [ - "0e23d9e08d791f08416323109661a761c791668a", + "9b43bdca01934102f4b61f6b4f01c632c2d5c650", [] ], "kind-of-widget-fallback-input-search-text-border-block-start-width-001.html.ini": [ @@ -353781,6 +353889,10 @@ "1f083a9cb9551618a02b9ed6debdf0603a74e11c", [] ], + "kind-of-widget-fallback-input-search-text-border-inline-start-style-001.html.ini": [ + "ba25a0b73d637b15c92adbc6e7586e9d69b36ad2", + [] + ], "kind-of-widget-fallback-input-search-text-border-inline-start-width-001.html.ini": [ "0cab6e0ad3747cdae8a70146805faa2dbece33bc", [] @@ -353854,7 +353966,7 @@ [] ], "kind-of-widget-fallback-input-submit-background-position-001.html.ini": [ - "e4c08ebe85e065ba6d38d2c1cf7a2f39a425a6ec", + "6d1ba01b7d98f1ba85ab31ccae080997184a3b0a", [] ], "kind-of-widget-fallback-input-submit-background-size-001.html.ini": [ @@ -353898,11 +354010,11 @@ [] ], "kind-of-widget-fallback-input-submit-border-bottom-style-001.html.ini": [ - "b1b41fdc89cd4b63fa938c43736e60c13f3bea5c", + "05c50a97b32eb1645b8a3f11d03a98fca3efd069", [] ], "kind-of-widget-fallback-input-submit-border-bottom-width-001.html.ini": [ - "5a47d88b649652e0934450853de9704e3f623c73", + "229f3174bd0c77d61c2923b6db6ae3dec51d0279", [] ], "kind-of-widget-fallback-input-submit-border-end-end-radius-001.html.ini": [ @@ -354026,7 +354138,7 @@ [] ], "kind-of-widget-fallback-input-text-background-position-001.html.ini": [ - "5210e362c5a7047fd75ec83542994c45065dd921", + "f793967f955cae7c5abba6d7e8a56a4cf3609bb4", [] ], "kind-of-widget-fallback-input-text-background-size-001.html.ini": [ @@ -354034,7 +354146,7 @@ [] ], "kind-of-widget-fallback-input-text-border-block-end-color-001.html.ini": [ - "8a04c92f5d0e1491108922a4f819070995df55b9", + "4792958b5d696a133ad6f015a34fc0ae7e800ae6", [] ], "kind-of-widget-fallback-input-text-border-block-end-style-001.html.ini": [ @@ -354162,7 +354274,7 @@ [] ], "kind-of-widget-fallback-input-text-border-top-color-001.html.ini": [ - "bb7663a8b7237c5489b037d97614de99962722f2", + "0b35549cab028aaa9f97565434815404866654f9", [] ], "kind-of-widget-fallback-input-text-border-top-left-radius-001.html.ini": [ @@ -354173,6 +354285,10 @@ "eab1be0db4fef9b22e2c4ea1a5df0a5d1b110503", [] ], + "kind-of-widget-fallback-input-text-border-top-style-001.html.ini": [ + "b34b4fd624dc3ba64fe99874e99bb99ddac57b67", + [] + ], "kind-of-widget-fallback-input-text-border-top-width-001.html.ini": [ "c9f7e6827e84f0adee94338a180035e5b27336af", [] @@ -354386,7 +354502,7 @@ [] ], "kind-of-widget-fallback-textarea-background-image-001.html.ini": [ - "bc57a242f6e5330395da21acae43d1cfca37b52f", + "cf79889653a50602ba4c7282b41da0ae179d72a7", [] ], "kind-of-widget-fallback-textarea-background-origin-001.html.ini": [ @@ -354466,7 +354582,7 @@ [] ], "kind-of-widget-fallback-textarea-border-image-source-001.html.ini": [ - "e76b4342912d6e4297800cbc0142a37ef4885968", + "2926713833c075aa2af48bc89fed0cb8426d01e2", [] ], "kind-of-widget-fallback-textarea-border-image-width-001.html.ini": [ @@ -354542,7 +354658,7 @@ [] ], "kind-of-widget-fallback-textarea-border-top-style-001.html.ini": [ - "41e3cc36d0d046fe1dfee14099c0c891fcd07764", + "a0439c39abeddfd3e6698c62ab5c1b93c90f15a7", [] ], "kind-of-widget-fallback-textarea-border-top-width-001.html.ini": [ @@ -356208,6 +356324,10 @@ "6409ecc14a0defb4ad88435992193a524ccc522a", [] ], + "calc-text-indent-intrinsic-1.html.ini": [ + "8fcadc9995441a542c5822c3ff26882013ed4072", + [] + ], "calc-transform-origin-1-ref.html": [ "36f8f1945b1a4928ed2af241df229e18e15c1848", [] @@ -357990,6 +358110,10 @@ "b8ebd25efa1b862923acb7b58cb3f99739a8aa14", [] ], + "abs-pos-non-replaced-vrl-206.xht.ini": [ + "3bd3c40e6755b4f390f26edd1ea3a298c54bae99", + [] + ], "abs-pos-non-replaced-vrl-210.xht.ini": [ "c51b4fb5d767b1dc98afd0de687b96ca0d6619e2", [] @@ -365275,7 +365399,7 @@ [] ], "nth-child-specificity-2.html.ini": [ - "2ea6ba7282c0f320cf5ea9a6564797e20c81e0c3", + "88ab12c04646d92900f7af311d0d1eef53dea6ea", [] ], "nth-child-specificity-3-ref.html": [ @@ -365424,7 +365548,7 @@ [] ], "css3-modsel-128b.xml.ini": [ - "8fcd1e25095169d4eb30c21fa818fa3fe2262ba7", + "d6d92753a953cce66a69f99aca277f2e78a1c947", [] ], "css3-modsel-129.xml.ini": [ @@ -372780,6 +372904,18 @@ "response-null-body.any.worker-expected.txt": [ "fa818f443d303b3903069f46bc8824dd2bf8bb27", [] + ], + "scheme-blob.sub.any-expected.txt": [ + "fadb5a64d31cde0656f3cd2a6feb5ea2026b5d56", + [] + ], + "scheme-blob.sub.any.js.ini": [ + "db53cee6c654b9e039416e3eb44a5cef2cbf3777", + [] + ], + "scheme-blob.sub.any.worker-expected.txt": [ + "fadb5a64d31cde0656f3cd2a6feb5ea2026b5d56", + [] ] }, "body": { @@ -377159,7 +377295,7 @@ [] ], "element-request-fullscreen-cross-origin.sub.html.ini": [ - "d115c068e9073db25a935e29bd0df9c023523907", + "f38c5ec19c18977a2292e2373d69141855fdc936", [] ], "element-request-fullscreen-namespaces-expected.txt": [ @@ -382862,6 +382998,10 @@ "93131dca9cfee5953e4a06cee99ec1429d8f062d", [] ], + "2d.layer.reset.w.html.ini": [ + "aa8fb87e3d3948c9bf48470ee905877fbdbfd012", + [] + ], "2d.layer.restore-style-expected.html": [ "1d0ac3558d1d4c15609c364a6e5678ed329fa272", [] @@ -390381,7 +390521,7 @@ [] ], "img-dim.html.ini": [ - "d78081e30e654a8cc93fad815ac6494049607faf", + "24866934db5e104c064ddaba1a7539ee0e458bf1", [] ], "img_border-ref.xhtml": [ @@ -390875,11 +391015,11 @@ [] ], "option-only-label.html.ini": [ - "60c4b4ea8625328244f575117329d80427d8dcaa", + "4234716d143b779274dfe2245ab005586fb450d3", [] ], "option-rm-label.html.ini": [ - "1740f16849bc86ba539723a960a9dbfdebe5cd67", + "5e1356bc5c4e24e80631a6946b927865f5b1154b", [] ], "select-as-listbox-default-styles.tentative.html.ini": [ @@ -392308,6 +392448,10 @@ "a2c2a93992ba75cec47b25212bb8adbf7d717076", [] ], + "embed-represent-nothing-01.html.ini": [ + "5c972a17e7de195c9e05d1716632b7f539a9ef15", + [] + ], "embed-represent-nothing-04.html.ini": [ "4d5a9d55dd4791c54c2bdc0090e113bb11f9332e", [] @@ -402558,7 +402702,7 @@ [] ], "longtask-in-sibling-iframe-crossorigin.html.ini": [ - "abf1f550026a8b5194c19c45cd582926a183d070", + "e2c40685143c480cb525cab618e6493a4b0810fd", [] ], "longtask-promise.html.ini": [ @@ -403188,7 +403332,7 @@ [] ], "operator-dictionary-arabic-001.html.ini": [ - "9da11238ade43204a9b3eb49b604c19ee72c7487", + "bc4b5befe18924dd2a7ef4bf441d1b71a5549f1d", [] ], "operator-dictionary-arabic-002-ref.html": [ @@ -406349,7 +406493,7 @@ }, "scroll-behavior": { "after-transition-intercept-handler-modifies.html.ini": [ - "8323334ac8bd211c8ecaf5ea3970d1877f69360b", + "4028af9abfc23137cf333e8a8df76d183607e6ee", [] ], "scroll-after-preventDefault.html.ini": [ @@ -408199,7 +408343,7 @@ [] ], "pointerevent_mouseevent_key_pressed.html.ini": [ - "f24ff0f3ed93056c64b80832482e98777d06d1bd", + "7cd03061b23fba600800774b9c17ffb9970b4a61", [] ], "pointerevent_touch-action_two-finger_interaction.html.ini": [ @@ -411162,7 +411306,7 @@ [] ], "content-type-parsing.html.ini": [ - "b5230d607320f8ec2530a77f0a00fd02283fda76", + "be6d7867963720307f77ded0e193e0ebe8dac40e", [] ], "frameset-timing.html": [ @@ -421179,6 +421323,10 @@ [] ], "mouse-events": { + "mousemove-across.html.ini": [ + "de7bd2dc075caec59539ee495475237ec7daee91", + [] + ], "mouseover-out.html.ini": [ "f5a4528bc84b8492f5a5b64f950124e8f6d9383c", [] @@ -424452,7 +424600,7 @@ [] ], "full-cycle-test.https.any.js.ini": [ - "c66c645c35531548998b2375a67f9633e20f836c", + "510922e3b26e89143407aef112d9c96d72ded9ea", [] ], "h264.annexb": [ @@ -424496,7 +424644,7 @@ [] ], "reconfiguring-encoder.https.any.js.ini": [ - "6f14f304bfda7b8340c12c2d94ef7db6d042f614", + "27b2436f84c230f08a340302721d72267ccfd6e9", [] ], "serialization.crossAgentCluster.serviceworker.js": [ @@ -532083,7 +532231,7 @@ ] ], "scheme-blob.sub.any.js": [ - "a6059ea93d9a5a18235ffdc3a131b4098b9982c3", + "8afdc033c9d7dd4b0861e6ed4ed7098a9c507558", [ "fetch/api/basic/scheme-blob.sub.any.html", {
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/backgrounds/background-048.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/backgrounds/background-048.xht.ini new file mode 100644 index 0000000..70638732 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/backgrounds/background-048.xht.ini
@@ -0,0 +1,3 @@ +[background-048.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/backgrounds/background-root-013b.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/backgrounds/background-root-013b.xht.ini index 939f269..870af93 100644 --- a/third_party/blink/web_tests/external/wpt/css/CSS2/backgrounds/background-root-013b.xht.ini +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/backgrounds/background-root-013b.xht.ini
@@ -1,3 +1,4 @@ [background-root-013b.xht] expected: if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-bottom-color-012.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-bottom-color-012.xht.ini new file mode 100644 index 0000000..119e2a3c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-bottom-color-012.xht.ini
@@ -0,0 +1,3 @@ +[border-bottom-color-012.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-bottom-color-053.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-bottom-color-053.xht.ini new file mode 100644 index 0000000..7c72657 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-bottom-color-053.xht.ini
@@ -0,0 +1,3 @@ +[border-bottom-color-053.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-bottom-color-076.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-bottom-color-076.xht.ini new file mode 100644 index 0000000..996b8b197 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-bottom-color-076.xht.ini
@@ -0,0 +1,3 @@ +[border-bottom-color-076.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-right-applies-to-001.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-right-applies-to-001.xht.ini new file mode 100644 index 0000000..56b5a01 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-right-applies-to-001.xht.ini
@@ -0,0 +1,3 @@ +[border-right-applies-to-001.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-top-color-077.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-top-color-077.xht.ini new file mode 100644 index 0000000..249e2408 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-top-color-077.xht.ini
@@ -0,0 +1,3 @@ +[border-top-color-077.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-top-color-086.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-top-color-086.xht.ini index febad471..419cc628 100644 --- a/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-top-color-086.xht.ini +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-top-color-086.xht.ini
@@ -1,3 +1,4 @@ [border-top-color-086.xht] expected: if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-top-color-087.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-top-color-087.xht.ini new file mode 100644 index 0000000..9f66327 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-top-color-087.xht.ini
@@ -0,0 +1,3 @@ +[border-top-color-087.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/floats-clear/float-applies-to-013.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/floats-clear/float-applies-to-013.xht.ini index 1afec0d..0ebd97a0 100644 --- a/third_party/blink/web_tests/external/wpt/css/CSS2/floats-clear/float-applies-to-013.xht.ini +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/floats-clear/float-applies-to-013.xht.ini
@@ -1,3 +1,4 @@ [float-applies-to-013.xht] expected: if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/block-formatting-context-height-003.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/block-formatting-context-height-003.xht.ini new file mode 100644 index 0000000..65c10b4 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/block-formatting-context-height-003.xht.ini
@@ -0,0 +1,3 @@ +[block-formatting-context-height-003.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/block-formatting-contexts-007.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/block-formatting-contexts-007.xht.ini index 1ab207a3..4daad6b 100644 --- a/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/block-formatting-contexts-007.xht.ini +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/block-formatting-contexts-007.xht.ini
@@ -1,3 +1,4 @@ [block-formatting-contexts-007.xht] expected: if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/max-height-107.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/max-height-107.xht.ini new file mode 100644 index 0000000..f9e4a9e4 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/max-height-107.xht.ini
@@ -0,0 +1,3 @@ +[max-height-107.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/max-width-072.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/max-width-072.xht.ini new file mode 100644 index 0000000..aea71c3c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/max-width-072.xht.ini
@@ -0,0 +1,3 @@ +[max-width-072.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/absolute-replaced-width-003c.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/absolute-replaced-width-003c.xht.ini index 776db334..db61344 100644 --- a/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/absolute-replaced-width-003c.xht.ini +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/absolute-replaced-width-003c.xht.ini
@@ -1,3 +1,4 @@ [absolute-replaced-width-003c.xht] expected: if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/absolute-replaced-width-039.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/absolute-replaced-width-039.xht.ini new file mode 100644 index 0000000..e8bd7ec --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/absolute-replaced-width-039.xht.ini
@@ -0,0 +1,3 @@ +[absolute-replaced-width-039.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/left-016.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/left-016.xht.ini index 3981c03..1d6a805 100644 --- a/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/left-016.xht.ini +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/left-016.xht.ini
@@ -1,3 +1,4 @@ [left-016.xht] expected: if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/top-113.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/top-113.xht.ini new file mode 100644 index 0000000..553e5ae --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/positioning/top-113.xht.ini
@@ -0,0 +1,3 @@ +[top-113.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/tables/fixed-table-layout-019.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/tables/fixed-table-layout-019.xht.ini new file mode 100644 index 0000000..32efea1d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/tables/fixed-table-layout-019.xht.ini
@@ -0,0 +1,3 @@ +[fixed-table-layout-019.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-video-sibling.html.ini b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-video-sibling.html.ini index bc72db7..e9eaf1e 100644 --- a/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-video-sibling.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-video-sibling.html.ini
@@ -1,3 +1,4 @@ [mix-blend-mode-video-sibling.html] expected: if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-backgrounds/border-radius-clipping-with-transform-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/border-radius-clipping-with-transform-001.html.ini index 3dcf808..2f28274 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-backgrounds/border-radius-clipping-with-transform-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/border-radius-clipping-with-transform-001.html.ini
@@ -1,3 +1,4 @@ [border-radius-clipping-with-transform-001.html] expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-backgrounds/border-top-width-thick.html.ini b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/border-top-width-thick.html.ini new file mode 100644 index 0000000..ce3c00395 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/border-top-width-thick.html.ini
@@ -0,0 +1,3 @@ +[border-top-width-thick.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-break/borders-004.html.ini b/third_party/blink/web_tests/external/wpt/css/css-break/borders-004.html.ini index 72b2ebd..b381f4cd 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-break/borders-004.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-break/borders-004.html.ini
@@ -1,3 +1,4 @@ [borders-004.html] expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS] if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-break/tall-float-pushed-to-next-fragmentainer-003.html.ini b/third_party/blink/web_tests/external/wpt/css/css-break/tall-float-pushed-to-next-fragmentainer-003.html.ini index f8d7a98..c9143711 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-break/tall-float-pushed-to-next-fragmentainer-003.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-break/tall-float-pushed-to-next-fragmentainer-003.html.ini
@@ -1,3 +1,4 @@ [tall-float-pushed-to-next-fragmentainer-003.html] expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-cascade/all-prop-initial-color.html.ini b/third_party/blink/web_tests/external/wpt/css/css-cascade/all-prop-initial-color.html.ini new file mode 100644 index 0000000..78a791f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-cascade/all-prop-initial-color.html.ini
@@ -0,0 +1,3 @@ +[all-prop-initial-color.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/canvas-as-container-002.html.ini b/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/canvas-as-container-002.html.ini index a2df903..523eb04a 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/canvas-as-container-002.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/canvas-as-container-002.html.ini
@@ -1,6 +1,7 @@ [canvas-as-container-002.html] expected: - if (product == "content_shell") and (os == "win"): PASS + if (product == "content_shell") and (os == "win") and (port == "win11"): [FAIL, PASS] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): PASS if (product == "content_shell") and (os == "linux"): PASS if product == "chrome": PASS FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-033.sub.https.html.ini b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-033.sub.https.html.ini index d6d8394..03bfeaf 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-033.sub.https.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-033.sub.https.html.ini
@@ -1,4 +1,5 @@ [content-visibility-033.sub.https.html] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): [TIMEOUT, PASS] + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [TIMEOUT, PASS] + if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): TIMEOUT if (product == "content_shell") and (os == "linux"): TIMEOUT
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/auto-height-with-flex.html.ini b/third_party/blink/web_tests/external/wpt/css/css-flexbox/auto-height-with-flex.html.ini new file mode 100644 index 0000000..41a187b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/auto-height-with-flex.html.ini
@@ -0,0 +1,3 @@ +[auto-height-with-flex.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_flex-0-1-Npercent.html.ini b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_flex-0-1-Npercent.html.ini index 9b0eaf0..52baefe 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_flex-0-1-Npercent.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_flex-0-1-Npercent.html.ini
@@ -1,3 +1,4 @@ [flexbox_flex-0-1-Npercent.html] expected: if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_justifycontent-center.html.ini b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_justifycontent-center.html.ini new file mode 100644 index 0000000..ee9ca92 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_justifycontent-center.html.ini
@@ -0,0 +1,3 @@ +[flexbox_justifycontent-center.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/gap-004-rl.html.ini b/third_party/blink/web_tests/external/wpt/css/css-flexbox/gap-004-rl.html.ini new file mode 100644 index 0000000..b33f3a6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/gap-004-rl.html.ini
@@ -0,0 +1,3 @@ +[gap-004-rl.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-adjust-011.html.ini b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-adjust-011.html.ini new file mode 100644 index 0000000..fb6b00f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-adjust-011.html.ini
@@ -0,0 +1,3 @@ +[font-size-adjust-011.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/font-variant-alternates-05.html.ini b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-variant-alternates-05.html.ini new file mode 100644 index 0000000..bdd1e21 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-variant-alternates-05.html.ini
@@ -0,0 +1,3 @@ +[font-variant-alternates-05.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-multicol/multicol-count-non-integer-001.xht.ini b/third_party/blink/web_tests/external/wpt/css/css-multicol/multicol-count-non-integer-001.xht.ini new file mode 100644 index 0000000..683f679 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-multicol/multicol-count-non-integer-001.xht.ini
@@ -0,0 +1,3 @@ +[multicol-count-non-integer-001.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-multicol/multicol-rule-double-000.xht.ini b/third_party/blink/web_tests/external/wpt/css/css-multicol/multicol-rule-double-000.xht.ini new file mode 100644 index 0000000..392c8cd --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-multicol/multicol-rule-double-000.xht.ini
@@ -0,0 +1,3 @@ +[multicol-rule-double-000.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-position/sticky/position-sticky-left-003.html.ini b/third_party/blink/web_tests/external/wpt/css/css-position/sticky/position-sticky-left-003.html.ini new file mode 100644 index 0000000..28e8732 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-position/sticky/position-sticky-left-003.html.ini
@@ -0,0 +1,3 @@ +[position-sticky-left-003.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-scroll-snap/scroll-target-snap-003.html.ini b/third_party/blink/web_tests/external/wpt/css/css-scroll-snap/scroll-target-snap-003.html.ini new file mode 100644 index 0000000..27ed451 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-scroll-snap/scroll-target-snap-003.html.ini
@@ -0,0 +1,3 @@ +[scroll-target-snap-003.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-scrollbars/scrollbar-color-010.html.ini b/third_party/blink/web_tests/external/wpt/css/css-scrollbars/scrollbar-color-010.html.ini new file mode 100644 index 0000000..8df8459 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-scrollbars/scrollbar-color-010.html.ini
@@ -0,0 +1,3 @@ +[scrollbar-color-010.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-012.html.ini b/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-012.html.ini new file mode 100644 index 0000000..b28d526d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/word-break/word-break-break-all-012.html.ini
@@ -0,0 +1,3 @@ +[word-break-break-all-012.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/transform-applies-to-001.xht.ini b/third_party/blink/web_tests/external/wpt/css/css-transforms/transform-applies-to-001.xht.ini index 689cfd3d..3333a34 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/transform-applies-to-001.xht.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/transform-applies-to-001.xht.ini
@@ -1,3 +1,4 @@ [transform-applies-to-001.xht] expected: + if (product == "content_shell") and (os == "mac") and (port == "mac11"): [FAIL, PASS] if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/ttwf-transform-skewy-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-transforms/ttwf-transform-skewy-001.html.ini new file mode 100644 index 0000000..fbae5b2 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/ttwf-transform-skewy-001.html.ini
@@ -0,0 +1,3 @@ +[ttwf-transform-skewy-001.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-button-background-origin-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-button-background-origin-001.html.ini index c2681c6e..60a8083 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-button-background-origin-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-button-background-origin-001.html.ini
@@ -1,3 +1,4 @@ [kind-of-widget-fallback-button-background-origin-001.html] expected: if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): FAIL + if (product == "content_shell") and (os == "win") and (port == "win11"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-button-border-block-start-width-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-button-border-block-start-width-001.html.ini index d02de3e..bd9b016 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-button-border-block-start-width-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-button-border-block-start-width-001.html.ini
@@ -1,3 +1,4 @@ [kind-of-widget-fallback-button-border-block-start-width-001.html] expected: if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL + if (product == "content_shell") and (os == "linux"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-color-input-border-top-left-radius-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-color-input-border-top-left-radius-001.html.ini index 4eab511..4676fb91 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-color-input-border-top-left-radius-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-color-input-border-top-left-radius-001.html.ini
@@ -1,3 +1,4 @@ [kind-of-widget-fallback-color-input-border-top-left-radius-001.html] expected: if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): FAIL + if (product == "content_shell") and (os == "win") and (port == "win11"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-reset-border-block-end-style-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-reset-border-block-end-style-001.html.ini index c454e2c2..ef3ca1b 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-reset-border-block-end-style-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-reset-border-block-end-style-001.html.ini
@@ -1,4 +1,5 @@ [kind-of-widget-fallback-input-reset-border-block-end-style-001.html] expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12"): [FAIL, PASS] if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-background-clip-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-background-clip-001.html.ini index caf7f58..a228c7d1 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-background-clip-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-background-clip-001.html.ini
@@ -1,7 +1,8 @@ [kind-of-widget-fallback-input-search-background-clip-001.html] expected: if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL + if (product == "content_shell") and (os == "win") and (port == "win11"): [FAIL, PASS] if (product == "content_shell") and (os == "linux"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-text-border-block-start-style-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-text-border-block-start-style-001.html.ini index 0e23d9e..9b43bdc 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-text-border-block-start-style-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-text-border-block-start-style-001.html.ini
@@ -1,5 +1,6 @@ [kind-of-widget-fallback-input-search-text-border-block-start-style-001.html] expected: if (product == "content_shell") and (os == "win") and (port == "win11"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] if (product == "content_shell") and (os == "linux"): FAIL if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-text-border-inline-start-style-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-text-border-inline-start-style-001.html.ini new file mode 100644 index 0000000..ba25a0b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-text-border-inline-start-style-001.html.ini
@@ -0,0 +1,3 @@ +[kind-of-widget-fallback-input-search-text-border-inline-start-style-001.html] + expected: + if (product == "content_shell") and (os == "linux"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-submit-background-position-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-submit-background-position-001.html.ini index e4c08eb..6d1ba01 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-submit-background-position-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-submit-background-position-001.html.ini
@@ -1,3 +1,4 @@ [kind-of-widget-fallback-input-submit-background-position-001.html] expected: if (product == "content_shell") and (os == "win"): FAIL + if (product == "content_shell") and (os == "linux"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-submit-border-bottom-style-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-submit-border-bottom-style-001.html.ini index b1b41fdc..05c50a9 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-submit-border-bottom-style-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-submit-border-bottom-style-001.html.ini
@@ -1,5 +1,6 @@ [kind-of-widget-fallback-input-submit-border-bottom-style-001.html] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12"): [FAIL, PASS] + if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL if (product == "content_shell") and (os == "linux"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-submit-border-bottom-width-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-submit-border-bottom-width-001.html.ini index 5a47d88b..229f317 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-submit-border-bottom-width-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-submit-border-bottom-width-001.html.ini
@@ -1,5 +1,6 @@ [kind-of-widget-fallback-input-submit-border-bottom-width-001.html] expected: + if (product == "content_shell") and (os == "mac") and (port == "mac11"): [FAIL, PASS] if (product == "content_shell") and (os == "win") and (port == "win11"): FAIL if (product == "content_shell") and (os == "linux"): FAIL if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-background-position-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-background-position-001.html.ini index 5210e36..f793967 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-background-position-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-background-position-001.html.ini
@@ -2,4 +2,5 @@ expected: if (product == "content_shell") and (os == "win") and (port == "win11"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac11"): [FAIL, PASS] if (product == "content_shell") and (os == "linux"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-border-block-end-color-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-border-block-end-color-001.html.ini index 8a04c92..4792958b 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-border-block-end-color-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-border-block-end-color-001.html.ini
@@ -1,5 +1,6 @@ [kind-of-widget-fallback-input-text-border-block-end-color-001.html] expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL - if (product == "content_shell") and (os == "linux"): FAIL if (product == "content_shell") and (os == "win"): FAIL + if (product == "content_shell") and (os == "linux"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-border-top-color-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-border-top-color-001.html.ini index bb7663a..0b35549 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-border-top-color-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-border-top-color-001.html.ini
@@ -1,6 +1,6 @@ [kind-of-widget-fallback-input-text-border-top-color-001.html] expected: if (product == "content_shell") and (os == "win") and (port == "win11"): PASS - if (product == "content_shell") and (os == "linux"): PASS + if (product == "content_shell") and (os == "linux"): [FAIL, PASS] if product == "chrome": PASS FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-border-top-style-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-border-top-style-001.html.ini new file mode 100644 index 0000000..b34b4fd --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-border-top-style-001.html.ini
@@ -0,0 +1,3 @@ +[kind-of-widget-fallback-input-text-border-top-style-001.html] + expected: + if (product == "content_shell") and (os == "win") and (port == "win11"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-background-image-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-background-image-001.html.ini index bc57a242..cf798896 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-background-image-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-background-image-001.html.ini
@@ -1,5 +1,6 @@ [kind-of-widget-fallback-textarea-background-image-001.html] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL + if (product == "content_shell") and (os == "linux"): [FAIL, PASS] if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-border-image-source-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-border-image-source-001.html.ini index e76b434..29267138 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-border-image-source-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-border-image-source-001.html.ini
@@ -2,3 +2,4 @@ expected: if (product == "content_shell") and (os == "win") and (port == "win11"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL + if (product == "content_shell") and (os == "linux"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-border-top-style-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-border-top-style-001.html.ini index 41e3cc3..a0439c39 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-border-top-style-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-border-top-style-001.html.ini
@@ -1,4 +1,5 @@ [kind-of-widget-fallback-textarea-border-top-style-001.html] expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] if (product == "content_shell") and (os == "linux"): FAIL if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-values/calc-text-indent-intrinsic-1.html.ini b/third_party/blink/web_tests/external/wpt/css/css-values/calc-text-indent-intrinsic-1.html.ini new file mode 100644 index 0000000..8fcadc9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-values/calc-text-indent-intrinsic-1.html.ini
@@ -0,0 +1,3 @@ +[calc-text-indent-intrinsic-1.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-206.xht.ini b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-206.xht.ini new file mode 100644 index 0000000..3bd3c40 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-206.xht.ini
@@ -0,0 +1,3 @@ +[abs-pos-non-replaced-vrl-206.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/nth-child-specificity-2.html.ini b/third_party/blink/web_tests/external/wpt/css/selectors/nth-child-specificity-2.html.ini index 2ea6ba7..88ab12c 100644 --- a/third_party/blink/web_tests/external/wpt/css/selectors/nth-child-specificity-2.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/selectors/nth-child-specificity-2.html.ini
@@ -1,3 +1,4 @@ [nth-child-specificity-2.html] expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS] if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/old-tests/css3-modsel-128b.xml.ini b/third_party/blink/web_tests/external/wpt/css/selectors/old-tests/css3-modsel-128b.xml.ini index 8fcd1e25..d6d9275 100644 --- a/third_party/blink/web_tests/external/wpt/css/selectors/old-tests/css3-modsel-128b.xml.ini +++ b/third_party/blink/web_tests/external/wpt/css/selectors/old-tests/css3-modsel-128b.xml.ini
@@ -1,3 +1,4 @@ [css3-modsel-128b.xml] expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS] if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any-expected.txt new file mode 100644 index 0000000..fadb5a64 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any-expected.txt
@@ -0,0 +1,21 @@ +This is a testharness.js-based test. +PASS Fetching [GET] URL.createObjectURL(blob) is OK +PASS Fetching [GET] blob:http://www.web-platform.test:8001/ is KO +PASS Fetching [POST] URL.createObjectURL(blob) is KO +PASS Fetching [OPTIONS] URL.createObjectURL(blob) is KO +PASS Fetching [HEAD] URL.createObjectURL(blob) is KO +PASS Fetching [PUT] URL.createObjectURL(blob) is KO +PASS Fetching [DELETE] URL.createObjectURL(blob) is KO +PASS Fetching [INVALID] URL.createObjectURL(blob) is KO +PASS Fetching [GET] blob:not-backed-by-a-blob/ is KO +PASS Fetching URL.createObjectURL(empty_blob) is OK +PASS Fetching URL.createObjectURL(empty_type_blob) is OK +PASS Fetching URL.createObjectURL(empty_data_blob) is OK +FAIL Fetching URL.createObjectURL(invalid_type_blob) is OK assert_equals: Content-Type is invalid expected "" but got "invalid" +PASS Blob content is not sniffed for a content type [image/png] +PASS Blob content is not sniffed for a content type [text/xml] +PASS Set content type to the empty string for slice with invalid content type +PASS Set content type to the empty string for slice with no content type +PASS Blob.slice should not sniff the content for a content type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any.js b/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any.js index a6059ea9..8afdc03 100644 --- a/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any.js +++ b/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any.js
@@ -57,6 +57,10 @@ checkFetchResponse(URL.createObjectURL(empty_data_blob), "", "text/plain", 0, "Fetching URL.createObjectURL(empty_data_blob) is OK"); +let invalid_type_blob = new Blob([], {type: "invalid"}); +checkFetchResponse(URL.createObjectURL(invalid_type_blob), "", "", 0, + "Fetching URL.createObjectURL(invalid_type_blob) is OK"); + promise_test(function(test) { return fetch("/images/blue.png").then(function(resp) { return resp.arrayBuffer();
diff --git a/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any.js.ini b/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any.js.ini new file mode 100644 index 0000000..db53cee6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any.js.ini
@@ -0,0 +1,14 @@ +[scheme-blob.sub.any.html] + [Fetching URL.createObjectURL(invalid_type_blob) is OK] + expected: + if not debug and (product == "content_shell") and (os == "mac") and (port == "mac10.15"): PASS + if debug: PASS + [FAIL, PASS] + + +[scheme-blob.sub.any.worker.html] + [Fetching URL.createObjectURL(invalid_type_blob) is OK] + expected: + if not debug and (product == "content_shell") and (os == "mac") and (port == "mac10.15"): PASS + if debug: PASS + [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any.worker-expected.txt new file mode 100644 index 0000000..fadb5a64 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/fetch/api/basic/scheme-blob.sub.any.worker-expected.txt
@@ -0,0 +1,21 @@ +This is a testharness.js-based test. +PASS Fetching [GET] URL.createObjectURL(blob) is OK +PASS Fetching [GET] blob:http://www.web-platform.test:8001/ is KO +PASS Fetching [POST] URL.createObjectURL(blob) is KO +PASS Fetching [OPTIONS] URL.createObjectURL(blob) is KO +PASS Fetching [HEAD] URL.createObjectURL(blob) is KO +PASS Fetching [PUT] URL.createObjectURL(blob) is KO +PASS Fetching [DELETE] URL.createObjectURL(blob) is KO +PASS Fetching [INVALID] URL.createObjectURL(blob) is KO +PASS Fetching [GET] blob:not-backed-by-a-blob/ is KO +PASS Fetching URL.createObjectURL(empty_blob) is OK +PASS Fetching URL.createObjectURL(empty_type_blob) is OK +PASS Fetching URL.createObjectURL(empty_data_blob) is OK +FAIL Fetching URL.createObjectURL(invalid_type_blob) is OK assert_equals: Content-Type is invalid expected "" but got "invalid" +PASS Blob content is not sniffed for a content type [image/png] +PASS Blob content is not sniffed for a content type [text/xml] +PASS Set content type to the empty string for slice with invalid content type +PASS Set content type to the empty string for slice with no content type +PASS Blob.slice should not sniff the content for a content type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/fullscreen/api/element-request-fullscreen-cross-origin.sub.html.ini b/third_party/blink/web_tests/external/wpt/fullscreen/api/element-request-fullscreen-cross-origin.sub.html.ini index d115c06..f38c5ec 100644 --- a/third_party/blink/web_tests/external/wpt/fullscreen/api/element-request-fullscreen-cross-origin.sub.html.ini +++ b/third_party/blink/web_tests/external/wpt/fullscreen/api/element-request-fullscreen-cross-origin.sub.html.ini
@@ -1,14 +1,16 @@ [element-request-fullscreen-cross-origin.sub.html] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): OK + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [OK, TIMEOUT] if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): OK if (product == "content_shell") and (os == "mac") and (port == "mac13"): OK if (product == "content_shell") and (os == "mac") and (port == "mac12"): OK + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): OK TIMEOUT [Element#requestFullscreen() works properly with a tree of cross-origin iframes] expected: if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [FAIL, TIMEOUT] TIMEOUT
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html b/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html index 5774c15..9ee75762 100644 --- a/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html +++ b/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html
@@ -24,15 +24,24 @@ }, "Initial value of PopStateEvent.state must be null"); test(function () { + var popStateEvent = new PopStateEvent("popstate"); + assert_false(popStateEvent.hasUAVisualTransition, "the PopStateEvent.hasUAVisualTransition"); +}, "Initial value of PopStateEvent.hasUAVisualTransition must be false"); + +test(function () { var state = history.state; var data; + var hasUAVisualTransition = false; window.addEventListener('popstate', function (e) { data = e.state; + hasUAVisualTransition = e.hasUAVisualTransition; }); window.dispatchEvent(new PopStateEvent('popstate', { - 'state': {testdata:true} + 'state': {testdata:true}, + 'hasUAVisualTransition': true })); assert_true(data.testdata,'state data was corrupted'); assert_equals(history.state, state, "history.state was NOT set by dispatching the event"); + assert_true(hasUAVisualTransition, 'hasUAVisualTransition not set correctly'); }, 'Dispatching a synthetic PopStateEvent'); </script>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/layers/2d.layer.reset.w.html.ini b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/layers/2d.layer.reset.w.html.ini new file mode 100644 index 0000000..aa8fb87 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/layers/2d.layer.reset.w.html.ini
@@ -0,0 +1,3 @@ +[2d.layer.reset.w.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim.html.ini b/third_party/blink/web_tests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim.html.ini index d78081e..2486693 100644 --- a/third_party/blink/web_tests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim.html.ini +++ b/third_party/blink/web_tests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim.html.ini
@@ -1,4 +1,5 @@ [img-dim.html] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS] if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/html/rendering/widgets/the-select-element/option-only-label.html.ini b/third_party/blink/web_tests/external/wpt/html/rendering/widgets/the-select-element/option-only-label.html.ini index 60c4b4e..4234716 100644 --- a/third_party/blink/web_tests/external/wpt/html/rendering/widgets/the-select-element/option-only-label.html.ini +++ b/third_party/blink/web_tests/external/wpt/html/rendering/widgets/the-select-element/option-only-label.html.ini
@@ -1,4 +1,5 @@ [option-only-label.html] expected: - if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): FAIL + if (product == "content_shell") and (os == "win") and (port == "win11"): [FAIL, PASS] if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): FAIL + if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/html/rendering/widgets/the-select-element/option-rm-label.html.ini b/third_party/blink/web_tests/external/wpt/html/rendering/widgets/the-select-element/option-rm-label.html.ini index 1740f1684..5e1356b 100644 --- a/third_party/blink/web_tests/external/wpt/html/rendering/widgets/the-select-element/option-rm-label.html.ini +++ b/third_party/blink/web_tests/external/wpt/html/rendering/widgets/the-select-element/option-rm-label.html.ini
@@ -1,4 +1,5 @@ [option-rm-label.html] expected: + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [FAIL, PASS] if (product == "content_shell") and (os == "win") and (port == "win11"): FAIL if (product == "content_shell") and (os == "linux"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-01.html.ini b/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-01.html.ini new file mode 100644 index 0000000..5c972a1 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-01.html.ini
@@ -0,0 +1,3 @@ +[embed-represent-nothing-01.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/longtask-timing/longtask-in-sibling-iframe-crossorigin.html.ini b/third_party/blink/web_tests/external/wpt/longtask-timing/longtask-in-sibling-iframe-crossorigin.html.ini index abf1f55..e2c40685 100644 --- a/third_party/blink/web_tests/external/wpt/longtask-timing/longtask-in-sibling-iframe-crossorigin.html.ini +++ b/third_party/blink/web_tests/external/wpt/longtask-timing/longtask-in-sibling-iframe-crossorigin.html.ini
@@ -1,6 +1,7 @@ [longtask-in-sibling-iframe-crossorigin.html] [Performance longtask entries from cross-origin iframe are observable in its sibling.] expected: + if (product == "content_shell") and (os == "linux") and (flag_specific == ""): [FAIL, PASS] if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/mathml/presentation-markup/operators/operator-dictionary-arabic-001.html.ini b/third_party/blink/web_tests/external/wpt/mathml/presentation-markup/operators/operator-dictionary-arabic-001.html.ini index 9da1123..bc4b5be 100644 --- a/third_party/blink/web_tests/external/wpt/mathml/presentation-markup/operators/operator-dictionary-arabic-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/mathml/presentation-markup/operators/operator-dictionary-arabic-001.html.ini
@@ -2,3 +2,4 @@ expected: if (product == "content_shell") and (os == "win") and (port == "win11"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/event-constructor.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/event-constructor.html index 0658842..a668730e 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/event-constructor.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/event-constructor.html
@@ -49,6 +49,7 @@ const formData = new FormData(); const signal = (new AbortController()).signal; const downloadRequest = "abc"; + const hasUAVisualTransition = true; const event = new NavigateEvent("navigate", { navigationType: "replace", @@ -59,7 +60,8 @@ signal, formData, downloadRequest, - info + info, + hasUAVisualTransition }); assert_equals(event.navigationType, "replace"); @@ -71,6 +73,7 @@ assert_equals(event.formData, formData); assert_equals(event.downloadRequest, downloadRequest); assert_equals(event.info, info); + assert_equals(event.hasUAVisualTransition, hasUAVisualTransition); }); history.pushState(2, null, "#2"); }, "all properties are reflected back"); @@ -93,4 +96,16 @@ }); history.pushState(3, null, "#3"); }, "defaults are as expected"); + +async_test(t => { + navigation.onnavigate = t.step_func_done(e => { + const event = new NavigateEvent("navigate", { + destination: e.destination, + signal: (new AbortController()).signal + }); + + assert_false(event.hasUAVisualTransition); + }); + history.pushState(3, null, "#3"); +}, "hasUAVisualTransition is default false"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/scroll-behavior/after-transition-intercept-handler-modifies.html.ini b/third_party/blink/web_tests/external/wpt/navigation-api/scroll-behavior/after-transition-intercept-handler-modifies.html.ini index 8323334..4028af9 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/scroll-behavior/after-transition-intercept-handler-modifies.html.ini +++ b/third_party/blink/web_tests/external/wpt/navigation-api/scroll-behavior/after-transition-intercept-handler-modifies.html.ini
@@ -1,7 +1,8 @@ [after-transition-intercept-handler-modifies.html] [scroll: state should be saved before intercept handlers run] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [FAIL, PASS] if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/pointerevents/compat/pointerevent_mouseevent_key_pressed.html.ini b/third_party/blink/web_tests/external/wpt/pointerevents/compat/pointerevent_mouseevent_key_pressed.html.ini index f24ff0f3..7cd0306 100644 --- a/third_party/blink/web_tests/external/wpt/pointerevents/compat/pointerevent_mouseevent_key_pressed.html.ini +++ b/third_party/blink/web_tests/external/wpt/pointerevents/compat/pointerevent_mouseevent_key_pressed.html.ini
@@ -1,10 +1,12 @@ [pointerevent_mouseevent_key_pressed.html] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [ERROR, TIMEOUT] - if (product == "content_shell") and (os == "linux"): ERROR - if (product == "content_shell") and (os == "win"): ERROR + if (product == "content_shell") and (os == "mac") and (port == "mac13"): TIMEOUT + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [ERROR, TIMEOUT] + if (product == "content_shell") and (os == "mac") and (port == "mac12"): TIMEOUT + if (product == "content_shell") and (os == "mac") and (port == "mac11"): TIMEOUT + if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): TIMEOUT if product == "chrome": OK - TIMEOUT + ERROR [Tests that the mouse events with some keys pressed.] expected: if product == "chrome": PASS
diff --git a/third_party/blink/web_tests/external/wpt/resource-timing/content-type-parsing.html.ini b/third_party/blink/web_tests/external/wpt/resource-timing/content-type-parsing.html.ini index b5230d6..be6d786 100644 --- a/third_party/blink/web_tests/external/wpt/resource-timing/content-type-parsing.html.ini +++ b/third_party/blink/web_tests/external/wpt/resource-timing/content-type-parsing.html.ini
@@ -1,10 +1,6 @@ [content-type-parsing.html] expected: - if (product == "content_shell") and (os == "win") and (port == "win11"): [OK, TIMEOUT] - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): OK - if (product == "content_shell") and (os == "linux"): OK - if product == "chrome": OK - TIMEOUT + if (product == "content_shell") and (os == "mac"): TIMEOUT [content-type 0 : ,text/plain] expected: FAIL @@ -13,30 +9,32 @@ [content-type 10 : text/plain,*/*] expected: - if (product == "content_shell") and (os == "win") and (port == "win11"): [PASS, FAIL] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] if (product == "content_shell") and (os == "linux"): FAIL if product == "chrome": FAIL [content-type 11 : text/html,*/*] expected: + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] if (product == "content_shell") and (os == "linux"): FAIL if product == "chrome": FAIL [content-type 12 : */*,text/html] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): PASS - if (product == "content_shell") and (os == "win") and (port == "win11"): [FAIL, PASS] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [FAIL, PASS] if (product == "content_shell") and (os == "linux"): PASS if product == "chrome": PASS FAIL [content-type 13 : text/plain,*/*;charset=gbk] expected: + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] if (product == "content_shell") and (os == "linux"): FAIL if product == "chrome": FAIL [content-type 14 : text/html,*/*;charset=gbk] expected: + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] if (product == "content_shell") and (os == "linux"): FAIL if product == "chrome": FAIL @@ -51,16 +49,12 @@ [content-type 2 : text/html,text/plain] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): PASS - if (product == "content_shell") and (os == "win") and (port == "win11"): [PASS, FAIL] - if (product == "content_shell") and (os == "linux"): PASS - if product == "chrome": PASS - FAIL + if (product == "content_shell") and (os == "mac"): FAIL [content-type 3 : text/plain;charset=gbk,text/html] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): PASS - if (product == "content_shell") and (os == "win") and (port == "win11"): [PASS, FAIL] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] + if (product == "content_shell") and (os == "win") and (port == "win11"): PASS if (product == "content_shell") and (os == "linux"): PASS if product == "chrome": PASS FAIL @@ -82,7 +76,7 @@ [content-type 9 : text/html;charset=gbk,text/plain,text/html] expected: - if (product == "content_shell") and (os == "win") and (port == "win11"): [PASS, FAIL] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] if (product == "content_shell") and (os == "linux"): FAIL if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/external/wpt/uievents/order-of-events/mouse-events/mousemove-across.html.ini b/third_party/blink/web_tests/external/wpt/uievents/order-of-events/mouse-events/mousemove-across.html.ini new file mode 100644 index 0000000..de7bd2d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/uievents/order-of-events/mouse-events/mousemove-across.html.ini
@@ -0,0 +1,4 @@ +[mousemove-across.html] + [Mousemove events across elements should fire in the correct order.] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS]
diff --git a/third_party/blink/web_tests/external/wpt/webcodecs/full-cycle-test.https.any.js.ini b/third_party/blink/web_tests/external/wpt/webcodecs/full-cycle-test.https.any.js.ini index c66c645..510922e 100644 --- a/third_party/blink/web_tests/external/wpt/webcodecs/full-cycle-test.https.any.js.ini +++ b/third_party/blink/web_tests/external/wpt/webcodecs/full-cycle-test.https.any.js.ini
@@ -1,19 +1,29 @@ [full-cycle-test.https.any.html?h264_annexb] expected: + if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): TIMEOUT + if (product == "content_shell") and (os == "mac") and (port == "mac13"): ERROR + if (product == "content_shell") and (os == "mac") and (port == "mac12"): [OK, ERROR] if (product == "content_shell") and (os == "mac") and (port == "mac11"): ERROR if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): ERROR - if (product == "content_shell") and (os == "mac") and (port == "mac13"): ERROR - if (product == "content_shell") and (os == "mac") and (port == "mac12"): ERROR - if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): TIMEOUT if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): ERROR [Encoding and decoding cycle] expected: - if (product == "content_shell") and (os == "mac"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12"): [PRECONDITION_FAILED, FAIL] + if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL PRECONDITION_FAILED [Encoding and decoding cycle w/ stripped color space] expected: - if (product == "content_shell") and (os == "mac"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12"): [PRECONDITION_FAILED, FAIL] + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL PRECONDITION_FAILED
diff --git a/third_party/blink/web_tests/external/wpt/webcodecs/reconfiguring-encoder.https.any.js.ini b/third_party/blink/web_tests/external/wpt/webcodecs/reconfiguring-encoder.https.any.js.ini index 6f14f30..27b2436 100644 --- a/third_party/blink/web_tests/external/wpt/webcodecs/reconfiguring-encoder.https.any.js.ini +++ b/third_party/blink/web_tests/external/wpt/webcodecs/reconfiguring-encoder.https.any.js.ini
@@ -4,14 +4,16 @@ [reconfiguring-encoder.https.any.html?h264_annexb] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): ERROR - if (product == "content_shell") and (os == "mac") and (port == "mac13"): ERROR + if (product == "content_shell") and (os == "mac") and (port == "mac12"): [ERROR, OK] if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): ERROR + if (product == "content_shell") and (os == "mac") and (port == "mac13"): ERROR + if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): ERROR [Reconfiguring encoder] expected: if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12"): [FAIL, PRECONDITION_FAILED] PRECONDITION_FAILED
diff --git a/third_party/blink/web_tests/platform/linux/virtual/plz-dedicated-worker/external/wpt/fetch/api/basic/scheme-blob.sub.any-expected.txt b/third_party/blink/web_tests/platform/linux/virtual/plz-dedicated-worker/external/wpt/fetch/api/basic/scheme-blob.sub.any-expected.txt index f93d78d..fadb5a64 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/plz-dedicated-worker/external/wpt/fetch/api/basic/scheme-blob.sub.any-expected.txt +++ b/third_party/blink/web_tests/platform/linux/virtual/plz-dedicated-worker/external/wpt/fetch/api/basic/scheme-blob.sub.any-expected.txt
@@ -11,6 +11,7 @@ PASS Fetching URL.createObjectURL(empty_blob) is OK PASS Fetching URL.createObjectURL(empty_type_blob) is OK PASS Fetching URL.createObjectURL(empty_data_blob) is OK +FAIL Fetching URL.createObjectURL(invalid_type_blob) is OK assert_equals: Content-Type is invalid expected "" but got "invalid" PASS Blob content is not sniffed for a content type [image/png] PASS Blob content is not sniffed for a content type [text/xml] PASS Set content type to the empty string for slice with invalid content type
diff --git a/third_party/blink/web_tests/platform/linux/virtual/plz-dedicated-worker/external/wpt/fetch/api/basic/scheme-blob.sub.any.worker-expected.txt b/third_party/blink/web_tests/platform/linux/virtual/plz-dedicated-worker/external/wpt/fetch/api/basic/scheme-blob.sub.any.worker-expected.txt index f93d78d..fadb5a64 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/plz-dedicated-worker/external/wpt/fetch/api/basic/scheme-blob.sub.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/linux/virtual/plz-dedicated-worker/external/wpt/fetch/api/basic/scheme-blob.sub.any.worker-expected.txt
@@ -11,6 +11,7 @@ PASS Fetching URL.createObjectURL(empty_blob) is OK PASS Fetching URL.createObjectURL(empty_type_blob) is OK PASS Fetching URL.createObjectURL(empty_data_blob) is OK +FAIL Fetching URL.createObjectURL(invalid_type_blob) is OK assert_equals: Content-Type is invalid expected "" but got "invalid" PASS Blob content is not sniffed for a content type [image/png] PASS Blob content is not sniffed for a content type [text/xml] PASS Set content type to the empty string for slice with invalid content type
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/fetch/api/basic/scheme-blob.sub.any-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/fetch/api/basic/scheme-blob.sub.any-expected.txt new file mode 100644 index 0000000..5b37deb --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/fetch/api/basic/scheme-blob.sub.any-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +All subtests passed and are omitted for brevity. +See https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/writing_web_tests.md#Text-Test-Baselines for details. +Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/fetch/api/basic/scheme-blob.sub.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/fetch/api/basic/scheme-blob.sub.any.worker-expected.txt new file mode 100644 index 0000000..5b37deb --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/fetch/api/basic/scheme-blob.sub.any.worker-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +All subtests passed and are omitted for brevity. +See https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/writing_web_tests.md#Text-Test-Baselines for details. +Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt index 00252478..54bbddc 100644 --- a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -5555,6 +5555,7 @@ getter destination getter downloadRequest getter formData + getter hasUAVisualTransition getter hashChange getter info getter navigationType @@ -6323,6 +6324,7 @@ method getPredictedEvents interface PopStateEvent : Event attribute @@toStringTag + getter hasUAVisualTransition getter state method constructor interface Presentation
diff --git a/third_party/blink/web_tests/wpt_internal/css/css-pseudo/grammar-error-color-001.html b/third_party/blink/web_tests/wpt_internal/css/css-pseudo/grammar-error-color-001.html index 9b70d8d9..1cfa3aa 100644 --- a/third_party/blink/web_tests/wpt_internal/css/css-pseudo/grammar-error-color-001.html +++ b/third_party/blink/web_tests/wpt_internal/css/css-pseudo/grammar-error-color-001.html
@@ -9,6 +9,7 @@ <script src="../support/markers.js"></script> <style> ::grammar-error { + text-decoration-line: underline; text-decoration-color: rgba(200, 225, 50, 0.75); } </style>
diff --git a/third_party/blink/web_tests/wpt_internal/css/css-pseudo/grammar-error-color-002.html b/third_party/blink/web_tests/wpt_internal/css/css-pseudo/grammar-error-color-002.html index 00856dc..cd55099f 100644 --- a/third_party/blink/web_tests/wpt_internal/css/css-pseudo/grammar-error-color-002.html +++ b/third_party/blink/web_tests/wpt_internal/css/css-pseudo/grammar-error-color-002.html
@@ -14,6 +14,7 @@ } ::grammar-error { + text-decoration-line: underline; text-decoration-color: cyan; } </style>
diff --git a/third_party/blink/web_tests/wpt_internal/css/css-pseudo/spelling-error-color-001.html b/third_party/blink/web_tests/wpt_internal/css/css-pseudo/spelling-error-color-001.html index e0ff5a7..f0ea2cb 100644 --- a/third_party/blink/web_tests/wpt_internal/css/css-pseudo/spelling-error-color-001.html +++ b/third_party/blink/web_tests/wpt_internal/css/css-pseudo/spelling-error-color-001.html
@@ -9,6 +9,7 @@ <script src="../support/markers.js"></script> <style> ::spelling-error { + text-decoration-line: underline; text-decoration-color: rgba(200, 225, 50, 0.75); } </style>
diff --git a/third_party/blink/web_tests/wpt_internal/css/css-pseudo/spelling-error-color-002.html b/third_party/blink/web_tests/wpt_internal/css/css-pseudo/spelling-error-color-002.html index 1709efd..5923179 100644 --- a/third_party/blink/web_tests/wpt_internal/css/css-pseudo/spelling-error-color-002.html +++ b/third_party/blink/web_tests/wpt_internal/css/css-pseudo/spelling-error-color-002.html
@@ -14,6 +14,7 @@ } ::spelling-error { + text-decoration-line: underline; text-decoration-color: cyan; } </style>
diff --git a/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-001-ref.html b/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-001-ref.html index b7a6ba6..1009494 100644 --- a/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-001-ref.html +++ b/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-001-ref.html
@@ -8,5 +8,5 @@ <div>The <span id="target">quikc</span> brown fox.</div> <script> - addSpellingMarker(target, 0, 5); + addGrammarMarker(target, 0, 5); </script>
diff --git a/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-001.html b/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-001.html index 83e48e1b..213cf83 100644 --- a/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-001.html +++ b/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-001.html
@@ -5,6 +5,7 @@ <link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-grammar-error"> <meta name="assert" content="This test checks that the rendering of 'text-decoration-line: grammar-error' matches the default grammar markers."> <link rel="match" href="text-decoration-line-grammar-error-001-ref.html"> +<meta name="fuzzy" content="0-255;0-6"> <script src="../support/markers.js"></script> <style> span {
diff --git a/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-002.html b/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-002.html new file mode 100644 index 0000000..1f33fce --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-grammar-error-002.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>CSS Text Decoration Test: text-decoration-line: grammar-error</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-grammar-error"> +<meta name="assert" content="This test checks that the rendering of 'text-decoration-line: grammar-error' matches the default grammar markers, and ignores other properties."> +<link rel="match" href="text-decoration-line-grammar-error-001-ref.html"> +<meta name="fuzzy" content="0-255;0-6"> +<script src="../support/markers.js"></script> +<style> + span { + text-decoration-line: grammar-error; + text-underline-offset: 10px; + text-decoration-color: red; + text-decoration-width: 5; + text-decoration-style: dotted; + } +</style> + +<p>The test passes if "quikc" has a grammar error marker that looks like the default grammar error marker.</p> +<div>The <span>quikc</span> brown fox.</div>
diff --git a/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-spelling-error-001.html b/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-spelling-error-001.html index 166067a..ac1a3af 100644 --- a/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-spelling-error-001.html +++ b/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-spelling-error-001.html
@@ -5,6 +5,7 @@ <link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-spelling-error"> <meta name="assert" content="This test checks that the rendering of 'text-decoration-line: spelling-error' matches the default spelling markers."> <link rel="match" href="text-decoration-line-spelling-error-001-ref.html"> +<meta name="fuzzy" content="0-255;0-6"> <script src="../support/markers.js"></script> <style> span {
diff --git a/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-spelling-error-002.html b/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-spelling-error-002.html new file mode 100644 index 0000000..5a2e382 --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/css/css-text-decor/text-decoration-line-spelling-error-002.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>CSS Text Decoration Test: text-decoration-line: spelling-error</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-line-spelling-error"> +<meta name="assert" content="This test checks that the rendering of 'text-decoration-line: spelling-error' matches the default spelling markers, and ignores other properties."> +<link rel="match" href="text-decoration-line-spelling-error-001-ref.html"> +<meta name="fuzzy" content="0-255;0-6"> +<script src="../support/markers.js"></script> +<style> + span { + text-decoration-line: spelling-error; + text-underline-offset: 10px; + text-decoration-color: green; + text-decoration-width: 5; + text-decoration-style: dotted; + } +</style> + +<p>The test passes if "quikc" has a spelling error marker that looks like the default spelling error marker.</p> +<div>The <span>quikc</span> brown fox.</div>
diff --git a/third_party/chromite b/third_party/chromite index c4b0ff0..9e7986f 160000 --- a/third_party/chromite +++ b/third_party/chromite
@@ -1 +1 @@ -Subproject commit c4b0ff08d3975d0d7a8170c2014504d81d778288 +Subproject commit 9e7986f9a469c985d8a1ad6e764497af190e0e77
diff --git a/third_party/dawn b/third_party/dawn index 2594556..d0ff6fb 160000 --- a/third_party/dawn +++ b/third_party/dawn
@@ -1 +1 @@ -Subproject commit 259455654c3439348c7b3c8be68909f6864d5ae1 +Subproject commit d0ff6fbab11a8c0f5ef0c003015d66fd5be7dfb2
diff --git a/third_party/depot_tools b/third_party/depot_tools index caeef7b..65c49b1 160000 --- a/third_party/depot_tools +++ b/third_party/depot_tools
@@ -1 +1 @@ -Subproject commit caeef7ba32da0a782b5b719d038a9dcab7104d6d +Subproject commit 65c49b18b964400859c1f3eb4cd4ad809da3f90c
diff --git a/third_party/devtools-frontend-internal b/third_party/devtools-frontend-internal index 39c34c4..e78fd89 160000 --- a/third_party/devtools-frontend-internal +++ b/third_party/devtools-frontend-internal
@@ -1 +1 @@ -Subproject commit 39c34c4aa41e7091119a306f650506a56b1cc42e +Subproject commit e78fd89a185f656935b000b459af1099ef8062bd
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index 13d80cf..c9f2047 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit 13d80cf6f85e8e1e9468dfffce45f00e0d5487c5 +Subproject commit c9f204731633fd2e2b6999a2543e99b7cc489b4b
diff --git a/third_party/freetype/README.chromium b/third_party/freetype/README.chromium index a3fdc1e..12f702d9 100644 --- a/third_party/freetype/README.chromium +++ b/third_party/freetype/README.chromium
@@ -1,7 +1,7 @@ Name: FreeType URL: http://www.freetype.org/ -Version: VER-2-13-1-22-g97251fd5a -Revision: 97251fd5aa2a90041cf4f397a5e887b8d60ab0c2 +Version: VER-2-13-1-23-g00b07598d +Revision: 00b07598d96f7c6c96d2d32dbbb9cd11b3adeacd CPEPrefix: cpe:/a:freetype:freetype:2.13.1 License: Custom license "inspired by the BSD, Artistic, and IJG (Independent JPEG Group) licenses"
diff --git a/third_party/freetype/src b/third_party/freetype/src index 97251fd..00b0759 160000 --- a/third_party/freetype/src +++ b/third_party/freetype/src
@@ -1 +1 @@ -Subproject commit 97251fd5aa2a90041cf4f397a5e887b8d60ab0c2 +Subproject commit 00b07598d96f7c6c96d2d32dbbb9cd11b3adeacd
diff --git a/third_party/perfetto b/third_party/perfetto index c9dd257..10b9801 160000 --- a/third_party/perfetto +++ b/third_party/perfetto
@@ -1 +1 @@ -Subproject commit c9dd257f3c87a3058a92897950fa9fb4c18f5bfb +Subproject commit 10b980190fea75c5472eee93fc42a8c4a3eaadd3
diff --git a/third_party/skia b/third_party/skia index 68700a1..b17ee34 160000 --- a/third_party/skia +++ b/third_party/skia
@@ -1 +1 @@ -Subproject commit 68700a1a2be99ffad639f6cb8023e5256f98bff5 +Subproject commit b17ee34f337883f45840d16927eb9eb799df8768
diff --git a/third_party/webrtc b/third_party/webrtc index 43a5dd8..66bf3f4 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit 43a5dd86c20df887496979acf5041f9920b1b501 +Subproject commit 66bf3f472c3cbf3872b77ff15c2b02bd1b3d88db
diff --git a/tools/clang/scripts/build.py b/tools/clang/scripts/build.py index 932bda5b..cd02f79 100755 --- a/tools/clang/scripts/build.py +++ b/tools/clang/scripts/build.py
@@ -57,6 +57,16 @@ os.path.join(LLVM_DIR, '..', 'llvm-build-tools')) ANDROID_NDK_DIR = os.path.join(CHROMIUM_DIR, 'third_party', 'android_toolchain', 'ndk') +ANDROID_NDK_TOOLCHAIN_RELATIVE_DIR = os.path.join('toolchains', 'llvm', + 'prebuilt', 'linux-x86_64') +ANDROID_NDK_TOOLCHAIN_DIR = os.path.join(ANDROID_NDK_DIR, + ANDROID_NDK_TOOLCHAIN_RELATIVE_DIR) +# NOTE(nathaniel): Using the canary Android NDK in this manner is forecast +# to be temporary (~months; will be done differently by 2024). +ANDROID_NDK_CANARY_DIR = os.path.join(CHROMIUM_DIR, 'third_party', + 'android_toolchain_canary', 'ndk') +ANDROID_NDK_CANARY_TOOLCHAIN_DIR = os.path.join( + ANDROID_NDK_CANARY_DIR, ANDROID_NDK_TOOLCHAIN_RELATIVE_DIR) FUCHSIA_SDK_DIR = os.path.join(CHROMIUM_DIR, 'third_party', 'fuchsia-sdk', 'sdk') PINNED_CLANG_DIR = os.path.join(LLVM_BUILD_TOOLS_DIR, 'pinned-clang') @@ -1267,14 +1277,17 @@ } if args.with_android: - toolchain_dir = ANDROID_NDK_DIR + '/toolchains/llvm/prebuilt/linux-x86_64' - for target_arch in ['aarch64', 'arm', 'i686', 'x86_64']: + toolchain_dir = ANDROID_NDK_TOOLCHAIN_DIR + for target_arch in ['aarch64', 'arm', 'i686', 'riscv64', 'x86_64']: target_triple = target_arch if target_arch == 'arm': target_triple = 'armv7' api_level = '19' if target_arch == 'aarch64' or target_arch == 'x86_64': api_level = '21' + elif target_arch == 'riscv64': + api_level = '35' + toolchain_dir = ANDROID_NDK_CANARY_TOOLCHAIN_DIR target_triple += '-linux-android' + api_level android_cflags = [ '--sysroot=%s/sysroot' % toolchain_dir,
diff --git a/tools/clang/scripts/package.py b/tools/clang/scripts/package.py index b15cc8b..f6f3bca 100755 --- a/tools/clang/scripts/package.py +++ b/tools/clang/scripts/package.py
@@ -358,15 +358,18 @@ 'lib/clang/$V/lib/linux/libclang_rt.asan-aarch64-android.so', 'lib/clang/$V/lib/linux/libclang_rt.asan-arm-android.so', 'lib/clang/$V/lib/linux/libclang_rt.asan-i686-android.so', + 'lib/clang/$V/lib/linux/libclang_rt.asan-riscv64-android.so', 'lib/clang/$V/lib/linux/libclang_rt.asan_static-aarch64-android.a', 'lib/clang/$V/lib/linux/libclang_rt.asan_static-arm-android.a', 'lib/clang/$V/lib/linux/libclang_rt.asan_static-i686-android.a', + 'lib/clang/$V/lib/linux/libclang_rt.asan_static-riscv64-android.a', # Builtins for Android. 'lib/clang/$V/lib/linux/libclang_rt.builtins-aarch64-android.a', 'lib/clang/$V/lib/linux/libclang_rt.builtins-arm-android.a', 'lib/clang/$V/lib/linux/libclang_rt.builtins-i686-android.a', 'lib/clang/$V/lib/linux/libclang_rt.builtins-x86_64-android.a', + 'lib/clang/$V/lib/linux/libclang_rt.builtins-riscv64-android.a', # Builtins for Linux and Lacros. 'lib/clang/$V/lib/aarch64-unknown-linux-gnu/libclang_rt.builtins.a', @@ -385,6 +388,8 @@ # HWASAN Android runtime. 'lib/clang/$V/lib/linux/libclang_rt.hwasan-aarch64-android.so', 'lib/clang/$V/lib/linux/libclang_rt.hwasan-preinit-aarch64-android.a', + 'lib/clang/$V/lib/linux/libclang_rt.hwasan-riscv64-android.so', + 'lib/clang/$V/lib/linux/libclang_rt.hwasan-preinit-riscv64-android.a', # MemorySanitizer C runtime (pure C won't link with *_cxx). 'lib/clang/$V/lib/x86_64-unknown-linux-gnu/libclang_rt.msan.a', @@ -403,6 +408,7 @@ 'lib/clang/$V/lib/linux/libclang_rt.profile-x86_64-android.a', 'lib/clang/$V/lib/linux/libclang_rt.profile-aarch64-android.a', 'lib/clang/$V/lib/linux/libclang_rt.profile-arm-android.a', + 'lib/clang/$V/lib/linux/libclang_rt.profile-riscv64-android.a', # ThreadSanitizer C runtime (pure C won't link with *_cxx). 'lib/clang/$V/lib/x86_64-unknown-linux-gnu/libclang_rt.tsan.a', @@ -425,6 +431,7 @@ # UndefinedBehaviorSanitizer Android runtime, needed for CFI. 'lib/clang/$V/lib/linux/libclang_rt.ubsan_standalone-aarch64-android.so', 'lib/clang/$V/lib/linux/libclang_rt.ubsan_standalone-arm-android.so', + 'lib/clang/$V/lib/linux/libclang_rt.ubsan_standalone-riscv64-android.so', # Ignorelist for MemorySanitizer (used on Linux only). 'lib/clang/$V/share/msan_*list.txt',
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py index 88d55cde..eaabc64 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py
@@ -36,7 +36,7 @@ # Reverting problematic clang rolls is safe, though. # This is the output of `git describe` and is usable as a commit-ish. CLANG_REVISION = 'llvmorg-17-init-16420-g0c545a44' -CLANG_SUB_REVISION = 6 +CLANG_SUB_REVISION = 7 PACKAGE_VERSION = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION) RELEASE_VERSION = '17'
diff --git a/tools/licenses/licenses.py b/tools/licenses/licenses.py index c99c63ae..9a34155 100755 --- a/tools/licenses/licenses.py +++ b/tools/licenses/licenses.py
@@ -1086,7 +1086,6 @@ if args.output_file: with open(args.output_file, 'w', encoding='utf-8') as f: f.write(license_txt) - print(f"\n ---- \nWrote license data to file {args.output_file}") else: print(license_txt)
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 3a66f06..4e5c6379 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -12586,6 +12586,11 @@ <int value="1" label="Has CRC"/> </enum> +<enum name="BooleanHasData"> + <int value="0" label="No data"/> + <int value="1" label="Has data"/> +</enum> + <enum name="BooleanHasDiscount"> <int value="0" label="No discount"/> <int value="1" label="has discount"/> @@ -12596,6 +12601,11 @@ <int value="1" label="Has distilled data"/> </enum> +<enum name="BooleanHasFetchers"> + <int value="0" label="Missing fetchers"/> + <int value="1" label="Has fetchers"/> +</enum> + <enum name="BooleanHasKey"> <int value="0" label="Lacks key"/> <int value="1" label="Has key"/> @@ -33775,7 +33785,7 @@ <int value="1097" label="DeviceReportNetworkEvents"/> <int value="1098" label="SafeBrowsingExtensionProtectionAllowed"/> <int value="1099" label="ShowDisplaySizeScreenEnabled"/> - <int value="1100" label="AnonymousSearchEnabled"/> + <int value="1100" label="EssentialSearchEnabled"/> <int value="1101" label="LegacyTechReportAllowlist"/> <int value="1102" label="ReportAppInventory"/> <int value="1103" label="ReportAppUsage"/> @@ -61287,6 +61297,7 @@ <int value="-1581969217" label="enable-switch-access-point-scanning"/> <int value="-1581724231" label="ModalPermissionPrompts:enabled"/> <int value="-1580376019" label="ShowAllDialogsWithViewsToolkit:enabled"/> + <int value="-1579273370" label="FastPairPwaCompanion:enabled"/> <int value="-1578781240" label="QuickAnswersV2:enabled"/> <int value="-1578677451" label="EnableAppGridGhost:disabled"/> <int value="-1578620046" label="ContextualTriggersSelectionHandles:enabled"/> @@ -63262,6 +63273,7 @@ <int value="-606898702" label="MaterialDesignSettings:disabled"/> <int value="-606696801" label="TabGroupsUiImprovementsAndroid:enabled"/> <int value="-606431158" label="DrawVerticallyEdgeToEdge:enabled"/> + <int value="-606011880" label="OverscrollHistoryNavigationSetting:disabled"/> <int value="-605720512" label="JourneysZeroStateFiltering:enabled"/> <int value="-605117040" label="OsSettingsRevampWayfinding:disabled"/> <int value="-604814313" label="enable-pinch"/> @@ -63684,6 +63696,7 @@ <int value="-389601101" label="HelpAppAutoTriggerInstallDialog:enabled"/> <int value="-389283574" label="IPH_PasswordsAccountStorage:disabled"/> <int value="-387606010" label="ArcBootCompletedBroadcast:enabled"/> + <int value="-387341308" label="ParentAccessJelly:disabled"/> <int value="-387217874" label="LinkCapturingInfoBar:enabled"/> <int value="-385461103" label="XsurfaceMetricsReporting:enabled"/> <int value="-385337473" label="enable-fast-unload"/> @@ -64657,6 +64670,7 @@ <int value="99177659" label="OmniboxUICuesForSearchHistoryMatches:disabled"/> <int value="99660832" label="DockedMagnifierResizing:enabled"/> <int value="101253756" label="RequestDesktopSiteDefaults:disabled"/> + <int value="101364236" label="ParentAccessJelly:enabled"/> <int value="101973012" label="OmniboxConsumesImeInsets:enabled"/> <int value="103347629" label="WinrtSensorsImplementation:enabled"/> <int value="103560544" label="ViewportHeightClientHintHeader:disabled"/> @@ -66573,6 +66587,8 @@ <int value="1083020187" label="FractionalScrollOffsets:enabled"/> <int value="1083201516" label="PersistentWindowBounds:enabled"/> <int value="1083575298" label="LoadCryptoTokenExtension:enabled"/> + <int value="1083781462" + label="OmniboxMostVisitedTilesHorizontalRenderGroup:enabled"/> <int value="1084365949" label="ReleaseNotesNotification:disabled"/> <int value="1084484359" label="ContextualTriggersSelectionSize:disabled"/> <int value="1084972292" label="WebXRAnchors:enabled"/> @@ -67045,6 +67061,7 @@ <int value="1304523073" label="RetryGetVideoCaptureDeviceInfos:enabled"/> <int value="1304636193" label="ArcEnableUnifiedAudioFocus:enabled"/> <int value="1305792241" label="SafeBrowsingEnhancedProtection:disabled"/> + <int value="1306412559" label="FastPairPwaCompanion:disabled"/> <int value="1306473273" label="BluetoothFlossCoredump:enabled"/> <int value="1307003774" label="AutofillEnableCompanyName:disabled"/> <int value="1307402891" label="ReadAloud:enabled"/> @@ -67488,6 +67505,7 @@ <int value="1534386287" label="SendTabToSelfWhenSignedIn:enabled"/> <int value="1534561775" label="HeavyAdPrivacyMitigations:disabled"/> <int value="1535497541" label="FillingAcrossGroupedSites:disabled"/> + <int value="1536024579" label="OverscrollHistoryNavigationSetting:enabled"/> <int value="1536568742" label="SyncAndroidPromosWithIllustration:enabled"/> <int value="1536921097" label="NavigationMojoResponse:disabled"/> <int value="1537685016" label="NtpDriveModuleSegmentation:disabled"/> @@ -67688,6 +67706,8 @@ <int value="1638582559" label="UpdatedCellularActivationUi:disabled"/> <int value="1638617234" label="GetTheMostOutOfChrome:disabled"/> <int value="1638927687" label="AutofillRichMetadataQueries:disabled"/> + <int value="1638944472" + label="OmniboxMostVisitedTilesHorizontalRenderGroup:disabled"/> <int value="1639190590" label="UseMessagesGoogleComDomain:enabled"/> <int value="1639314588" label="LookalikeUrlNavigationSuggestions:disabled"/> <int value="1639681180" label="HelpAppAppsDiscovery:enabled"/>
diff --git a/tools/metrics/histograms/metadata/accessibility/histograms.xml b/tools/metrics/histograms/metadata/accessibility/histograms.xml index 1bb5cf41..cdd41de 100644 --- a/tools/metrics/histograms/metadata/accessibility/histograms.xml +++ b/tools/metrics/histograms/metadata/accessibility/histograms.xml
@@ -261,7 +261,7 @@ <histogram name="Accessibility.Android.OnDemand.OneHundredPercentEventsDropped.{AXMode}" - units="count" expires_after="2023-11-30"> + units="count" expires_after="2024-02-20"> <owner>mschillaci@google.com</owner> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -297,7 +297,7 @@ </histogram> <histogram name="Accessibility.Android.OnDemand.PercentageDropped.{AXMode}" - units="%" expires_after="2023-11-30"> + units="%" expires_after="2024-02-20"> <owner>mschillaci@google.com</owner> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -417,7 +417,7 @@ </histogram> <histogram name="Accessibility.Android.Usage.A11yAlwaysOn" units="ms" - expires_after="2023-11-30"> + expires_after="2024-02-20"> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -433,7 +433,7 @@ </histogram> <histogram name="Accessibility.Android.Usage.{UsageType}" units="ms" - expires_after="2023-11-30"> + expires_after="2024-02-20"> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -490,7 +490,7 @@ </histogram> <histogram name="Accessibility.AndroidServiceInfo.{RunningApps}" - enum="AccessibilityAndroidServiceInfoEnum" expires_after="2023-11-30"> + enum="AccessibilityAndroidServiceInfoEnum" expires_after="2024-02-20"> <owner>mschillaci@google.com</owner> <owner>aldietz@google.com</owner> <owner>dtseng@chromium.org</owner> @@ -1015,7 +1015,7 @@ </histogram> <histogram name="Accessibility.CrosSpokenFeedback{AccessibilityEveryReport}" - enum="BooleanEnabled" expires_after="2023-11-30"> + enum="BooleanEnabled" expires_after="2024-02-20"> <owner>dtseng@chromium.org</owner> <owner>kenjibaheux@google.com</owner> <owner>aleventhal@google.com</owner> @@ -1260,7 +1260,7 @@ </histogram> <histogram name="Accessibility.ImageLabels.{Result}By{Dimension}" - units="pixels" expires_after="2023-11-30"> + units="pixels" expires_after="2024-02-20"> <owner>dtseng@chromium.org</owner> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1281,7 +1281,7 @@ </histogram> <histogram name="Accessibility.ImageLabels.{Result}By{Length}" - units="characters" expires_after="2023-11-30"> + units="characters" expires_after="2024-02-20"> <owner>dtseng@chromium.org</owner> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1476,7 +1476,7 @@ </histogram> <histogram name="Accessibility.LiveCaption.Duration.CaptionBubble{Visibility}3" - units="ms" expires_after="2023-11-30"> + units="ms" expires_after="2024-02-20"> <owner>abigailbklein@google.com</owner> <owner>evliu@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1494,7 +1494,7 @@ </histogram> <histogram name="Accessibility.LiveCaption.EnableFrom{Entrypoint}" - enum="BooleanEnabled" expires_after="2023-11-30"> + enum="BooleanEnabled" expires_after="2024-02-20"> <owner>katie@chromium.org</owner> <owner>abigailbklein@google.com</owner> <owner>evliu@google.com</owner> @@ -1936,7 +1936,7 @@ </histogram> <histogram name="Accessibility.Performance.WinAPIs.{API}" units="microseconds" - expires_after="2023-11-30"> + expires_after="2024-02-20"> <owner>aleventhal@chromium.org</owner> <owner>kschmi@microsoft.com</owner> <owner>janewman@microsoft.com</owner> @@ -2061,7 +2061,7 @@ </histogram> <histogram name="Accessibility.ReadAnything.MergedDistillationTime.{Result}" - units="ms" expires_after="2023-11-30"> + units="ms" expires_after="2024-02-20"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2076,7 +2076,7 @@ </histogram> <histogram name="Accessibility.ReadAnything.RulesDistillationTime.{Result}" - units="ms" expires_after="2023-11-30"> + units="ms" expires_after="2024-02-20"> <owner>abigailbklein@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2212,7 +2212,7 @@ </histogram> <histogram name="Accessibility.ScreenAI.Screen2xDistillationTime.{Result}" - units="ms" expires_after="2023-11-30"> + units="ms" expires_after="2024-02-20"> <owner>abigailbklein@google.com</owner> <owner>rhalavati@google.com</owner> <owner>kyungjunlee@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/android/histograms.xml b/tools/metrics/histograms/metadata/android/histograms.xml index 1c12529..cec41a2 100644 --- a/tools/metrics/histograms/metadata/android/histograms.xml +++ b/tools/metrics/histograms/metadata/android/histograms.xml
@@ -1146,7 +1146,7 @@ </histogram> <histogram name="Android.DragDrop.FromWebContent.Duration{DropResult}" - units="ms" expires_after="2023-12-08"> + units="ms" expires_after="2024-02-20"> <owner>wenyufu@chromium.org</owner> <owner>clank-large-form-factors@google.com</owner> <summary> @@ -1247,7 +1247,7 @@ </histogram> <histogram name="Android.DragDrop.Image.Size" units="KB" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>shuyng@google.com</owner> <owner>clank-large-form-factors@google.com</owner> <summary> @@ -1318,7 +1318,7 @@ </histogram> <histogram base="true" name="Android.FeatureModules.AvailabilityStatus" - enum="FeatureModuleAvailabilityStatus" expires_after="2023-12-17"> + enum="FeatureModuleAvailabilityStatus" expires_after="2024-02-20"> <!-- Name completed by histogram_suffixes name="AndroidFeatureModuleName" --> @@ -1351,7 +1351,7 @@ </histogram> <histogram base="true" name="Android.FeatureModules.InstallingStatus" - enum="FeatureModuleInstallingStatus" expires_after="2023-12-17"> + enum="FeatureModuleInstallingStatus" expires_after="2024-02-20"> <!-- Name completed by histogram_suffixes name="AndroidFeatureModuleName" --> @@ -1516,7 +1516,7 @@ <histogram name="Android.Fonts.TimeDownloadableFontsRetrievedAfterFirstDraw{ActivityType}" - units="ms" expires_after="2023-12-15"> + units="ms" expires_after="2024-02-20"> <owner>sinansahin@google.com</owner> <owner>twellington@chromium.org</owner> <summary> @@ -1542,7 +1542,7 @@ <histogram name="Android.Fonts.TimeDownloadableFontsRetrievedBeforeFirstDraw{ActivityType}" - units="ms" expires_after="2023-12-15"> + units="ms" expires_after="2024-02-20"> <owner>sinansahin@google.com</owner> <owner>twellington@chromium.org</owner> <summary> @@ -1710,7 +1710,7 @@ </histogram> <histogram name="Android.Intent.MainFrameIntentLaunch" - enum="MainFrameIntentLaunch" expires_after="2023-12-17"> + enum="MainFrameIntentLaunch" expires_after="2024-02-20"> <owner>mthiesse@chromium.org</owner> <owner>yfriedman@chromium.org</owner> <summary> @@ -2147,7 +2147,7 @@ </histogram> <histogram name="Android.MultiWindowMode.TotalDuration" units="ms" - expires_after="2023-12-16"> + expires_after="2024-02-20"> <owner>skavuluru@google.com</owner> <owner>twellington@chromium.org</owner> <owner>clank-large-form-factors@google.com</owner> @@ -2277,7 +2277,7 @@ </histogram> <histogram name="Android.Omnibox.SetGeolocationHeadersTime" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>spelchat@chromium.org</owner> <owner>chrome-brapp-loading@google.com</owner> <summary> @@ -2318,7 +2318,7 @@ </histogram> <histogram name="Android.Omnibox.SuggestionList.LayoutTime2" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>ender@chromium.org</owner> <owner>mpearson@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> @@ -2376,7 +2376,7 @@ </histogram> <histogram name="Android.Omnibox.SuggestionList.MeasureTime2" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>ender@chromium.org</owner> <owner>mpearson@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> @@ -2508,7 +2508,7 @@ </histogram> <histogram name="Android.Omnibox.SuggestionView.CreateTime2" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>ender@chromium.org</owner> <owner>mpearson@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> @@ -3384,7 +3384,7 @@ </histogram> <histogram name="Android.RequestDesktopSite.Changed" enum="SiteLayout" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>shuyng@google.com</owner> <owner>twellington@chromium.org</owner> <summary> @@ -3395,7 +3395,7 @@ </histogram> <histogram name="Android.RequestDesktopSite.DomainSettingChanged" - enum="Boolean" expires_after="2023-12-17"> + enum="Boolean" expires_after="2024-02-20"> <owner>shuyng@google.com</owner> <owner>twellington@chromium.org</owner> <summary> @@ -3407,7 +3407,7 @@ </histogram> <histogram name="Android.RequestDesktopSite.PerSiteIphDismissed.AppMenuOpened" - enum="Boolean" expires_after="2023-12-17"> + enum="Boolean" expires_after="2024-02-20"> <owner>aishwaryarj@google.com</owner> <owner>shuyng@google.com</owner> <summary> @@ -3417,7 +3417,7 @@ </histogram> <histogram name="Android.RequestDesktopSite.SubDomainSettingChanged" - enum="Boolean" expires_after="2023-12-17"> + enum="Boolean" expires_after="2024-02-20"> <owner>shuyng@google.com</owner> <owner>twellington@chromium.org</owner> <summary> @@ -3465,7 +3465,7 @@ <histogram name="Android.RequestDesktopSite.UserSwitchToDesktop.DomainSettingAdded" - enum="Boolean" expires_after="2023-12-17"> + enum="Boolean" expires_after="2024-02-20"> <owner>shuyng@google.com</owner> <owner>twellington@chromium.org</owner> <summary> @@ -3478,7 +3478,7 @@ <histogram name="Android.RequestDesktopSite.UserSwitchToDesktop.SubDomainSettingAdded" - enum="Boolean" expires_after="2023-12-17"> + enum="Boolean" expires_after="2024-02-20"> <owner>shuyng@google.com</owner> <owner>twellington@chromium.org</owner> <summary> @@ -3836,7 +3836,7 @@ </histogram> <histogram name="Android.Tab.CreateNewTabDuration.{TabLaunchType}" units="ms" - expires_after="2023-12-10"> + expires_after="2024-02-20"> <owner>sreejakshetty@chromium.org</owner> <owner>spelchat@chromium.org</owner> <owner>chrome-brapp-loading@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/apps/histograms.xml b/tools/metrics/histograms/metadata/apps/histograms.xml index e0b6fb76..57c5ed1 100644 --- a/tools/metrics/histograms/metadata/apps/histograms.xml +++ b/tools/metrics/histograms/metadata/apps/histograms.xml
@@ -404,7 +404,7 @@ <histogram name="Apps.AppList.CardifiedStateAnimation.AnimationSmoothness{EnterOrExitCardifiedState}" - units="%" expires_after="2023-10-25"> + units="%" expires_after="2024-02-20"> <owner>anasalazar@chromium.org</owner> <owner>tbarzic@chromium.org</owner> <summary> @@ -473,7 +473,7 @@ </histogram> <histogram name="Apps.AppList.ContinueSectionHiddenByUser{TabletOrClamshell}" - enum="Boolean" expires_after="2023-11-01"> + enum="Boolean" expires_after="2024-02-20"> <owner>jamescook@chromium.org</owner> <owner>tbarzic@chromium.org</owner> <summary> @@ -537,7 +537,7 @@ </histogram> <histogram name="Apps.AppList.DriveZeroStateProvider.Latency" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <summary> @@ -703,7 +703,7 @@ </histogram> <histogram name="Apps.AppList.Keyword.NumberOfKeywordsInQuery" units="count" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>laurencom@chromium.org</owner> <owner>amandadeacon@chromium.org</owner> <summary> @@ -714,7 +714,7 @@ <histogram name="Apps.AppList.LaunchedResultInNewUsersFirstSearch{TabletOrClamshell}" - enum="AppListSearchResult" expires_after="2023-12-05"> + enum="AppListSearchResult" expires_after="2024-02-20"> <owner>tbarzic@chromium.org</owner> <owner>gzadina@google.com</owner> <summary> @@ -783,7 +783,7 @@ </histogram> <histogram name="Apps.AppList.OmniboxProvider.QueryTime" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>laurencom@chromium.org</owner> <owner>tbarzic@chromium.org</owner> <summary> @@ -831,7 +831,7 @@ </histogram> <histogram name="Apps.AppList.PersistentProto.ReadStatus" - enum="PersistentProtoReadStatus" expires_after="2023-12-17"> + enum="PersistentProtoReadStatus" expires_after="2024-02-20"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <summary> @@ -947,7 +947,7 @@ </histogram> <histogram name="Apps.AppList.Search.Error" enum="AppListUserEventError" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>dgrebenyuk@google.com</owner> <owner>ypitsishin@google.com</owner> <owner>chromeos-launcher-search@google.com</owner> @@ -1466,7 +1466,7 @@ </histogram> <histogram name="Apps.AppListAppLaunchedV2{AppListState}" - enum="AppListLaunchedFrom" expires_after="2023-12-19"> + enum="AppListLaunchedFrom" expires_after="2024-02-20"> <owner>tbarzic@chromium.org</owner> <owner>mmourgos@chromium.org</owner> <owner>newcomer@chromium.org</owner> @@ -1533,7 +1533,7 @@ </histogram> <histogram name="Apps.AppListBubbleShowSource" enum="AppListShowSource" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>tbarzic@chromium.org</owner> <owner>newcomer@chromium.org</owner> <owner>chromeos-launcher@google.com</owner> @@ -1706,7 +1706,7 @@ </histogram> <histogram name="Apps.AppListPlayStoreQueryState" - enum="AppListPlayStoreQueryState" expires_after="2023-12-17"> + enum="AppListPlayStoreQueryState" expires_after="2024-02-20"> <owner>tby@chromium.org</owner> <owner>ypitsishin@google.com</owner> <owner>chrome-knowledge-eng@google.com</owner> @@ -1760,7 +1760,7 @@ </histogram> <histogram name="Apps.AppListSearchAutocomplete" enum="SearchBoxTextMatch" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>yulunwu@chromium.org</owner> <owner>tbarzic@chromium.org</owner> <summary> @@ -1846,7 +1846,7 @@ </histogram> <histogram name="Apps.AppListShowSource" enum="AppListShowSource" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>tbarzic@chromium.org</owner> <owner>newcomer@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/arc/histograms.xml b/tools/metrics/histograms/metadata/arc/histograms.xml index c4b6c62..a9234f1 100644 --- a/tools/metrics/histograms/metadata/arc/histograms.xml +++ b/tools/metrics/histograms/metadata/arc/histograms.xml
@@ -707,7 +707,7 @@ </histogram> <histogram name="Arc.Auth.MainAccountResolution.Status{ArcUserTypes}" - enum="ArcAuthMainAccountResolutionStatus" expires_after="2023-10-24"> + enum="ArcAuthMainAccountResolutionStatus" expires_after="2024-02-20"> <owner>mhasank@google.com</owner> <owner>arc-core@google.com</owner> <summary> @@ -1507,7 +1507,7 @@ <histogram name="Arc.LoadAverageX100PerProcessor15MinutesAfterArcStart.{ArcBootType}" - units="0.01 jobs/processor" expires_after="2023-11-01"> + units="0.01 jobs/processor" expires_after="2024-02-20"> <owner>hashimoto@google.com</owner> <owner>khmel@google.com</owner> <owner>arc-performance@google.com</owner> @@ -1642,7 +1642,7 @@ </histogram> <histogram name="Arc.Net.ArcNetworkError" enum="ArcNetworkError" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>hugobenichi@google.com</owner> <owner>cros-networking@google.com</owner> <summary> @@ -2216,7 +2216,7 @@ </histogram> <histogram name="Arc.Session.StopReason{ArcUserTypes}" enum="ArcStopReason" - expires_after="2023-11-01"> + expires_after="2024-02-20"> <owner>jhorwich@google.com</owner> <owner>arc-core@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/ash/histograms.xml b/tools/metrics/histograms/metadata/ash/histograms.xml index 0e9331c..d9e97cbe 100644 --- a/tools/metrics/histograms/metadata/ash/histograms.xml +++ b/tools/metrics/histograms/metadata/ash/histograms.xml
@@ -273,7 +273,7 @@ </histogram> <histogram name="Ash.Accelerators.ActivateDeskByIndex" - enum="ActivateDeskByIndex" expires_after="2023-12-21"> + enum="ActivateDeskByIndex" expires_after="2024-02-20"> <owner>jimmyxgong@chromium.org</owner> <owner>longbowei@google.com</owner> <owner>cros-peripherals@google.com</owner> @@ -324,7 +324,7 @@ </histogram> <histogram name="Ash.AmbientMode.Activation.{TabletOrClamshell}" - enum="AmbientUiMode" expires_after="2023-12-01"> + enum="AmbientUiMode" expires_after="2024-02-20"> <owner>cowmoo@google.com</owner> <owner>xiaohuic@chromium.org</owner> <summary> @@ -360,7 +360,7 @@ </histogram> <histogram name="Ash.AmbientMode.EngagementTime.{Settings}" units="ms" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>cowmoo@google.com</owner> <owner>esum@google.com</owner> <summary> @@ -391,7 +391,7 @@ </histogram> <histogram name="Ash.AmbientMode.EngagementTime.{TabletOrClamshell}" units="ms" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>cowmoo@google.com</owner> <owner>xiaohuic@chromium.org</owner> <summary> @@ -457,7 +457,7 @@ </histogram> <histogram name="Ash.AmbientMode.ScreenCount.{Settings}" units="int" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>esum@google.com</owner> <owner>xiaohuic@chromium.org</owner> <summary> @@ -480,7 +480,7 @@ </histogram> <histogram name="Ash.AmbientMode.StartupTime.{Settings}" units="ms" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>esum@google.com</owner> <owner>xiaohuic@google.com</owner> <summary> @@ -528,7 +528,7 @@ </histogram> <histogram name="Ash.AmbientMode.VideoSmoothness.{Settings}" units="%" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>esum@google.com</owner> <owner>xiaohuic@chromium.org</owner> <summary> @@ -914,7 +914,7 @@ </histogram> <histogram name="Ash.BrowserDataMigrator.DryRunExtraDiskSpaceOccupiedByMove" - units="MB" expires_after="M121"> + units="MB" expires_after="2024-02-20"> <owner>ythjkt@chromium.org</owner> <owner>hidehiko@chromium.org</owner> <summary> @@ -949,7 +949,7 @@ </histogram> <histogram name="Ash.BrowserDataMigrator.DryRunFreeDiskSpaceAfterDelete" - units="MB" expires_after="M121"> + units="MB" expires_after="2024-02-20"> <owner>ythjkt@chromium.org</owner> <owner>hidehiko@chromium.org</owner> <summary> @@ -973,7 +973,7 @@ </histogram> <histogram name="Ash.BrowserDataMigrator.DryRunFreeDiskSpaceAfterMigration" - units="MB" expires_after="M121"> + units="MB" expires_after="2024-02-20"> <owner>ythjkt@chromium.org</owner> <owner>hidehiko@chromium.org</owner> <summary> @@ -3568,7 +3568,7 @@ </histogram> <histogram name="Ash.Float.MultitaskMenuActionType.{TabletOrClamshell}" - enum="MultitaskMenuActionType" expires_after="2023-11-11"> + enum="MultitaskMenuActionType" expires_after="2024-02-20"> <owner>nupurjain@google.com</owner> <owner>shidi@chromium.org</owner> <owner>sophiewen@chromium.org</owner> @@ -3579,7 +3579,7 @@ </histogram> <histogram name="Ash.Float.MultitaskMenuEntryType.{TabletOrClamshell}" - enum="MultitaskMenuEntryType" expires_after="2023-11-11"> + enum="MultitaskMenuEntryType" expires_after="2024-02-20"> <owner>nupurjain@google.com</owner> <owner>shidi@chromium.org</owner> <owner>sophiewen@chromium.org</owner> @@ -4076,7 +4076,7 @@ </histogram> <histogram name="Ash.Login.PinAutosubmit.Backfill" - enum="PinAutosubmitBackfillEvent" expires_after="2023-12-10"> + enum="PinAutosubmitBackfillEvent" expires_after="2024-02-20"> <owner>emaamari@google.com</owner> <owner>rrsilva@google.com</owner> <owner>cros-lurs@google.com</owner> @@ -4843,7 +4843,7 @@ </histogram> <histogram base="true" name="Ash.Overview.AnimationSmoothness.Close" units="%" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <!-- Name completed by histogram_suffixes name="TabletOrClamshellMode" --> @@ -5392,7 +5392,7 @@ </histogram> <histogram name="Ash.PowerSoundsController.PluggedInBatteryLevel" units="%" - expires_after="2023-12-21"> + expires_after="2024-02-20"> <owner>hongyulong@chromium.org</owner> <owner>nupurjain@google.com</owner> <summary> @@ -5402,7 +5402,7 @@ </histogram> <histogram name="Ash.PowerSoundsController.UnpluggedBatteryLevel" units="%" - expires_after="2023-12-21"> + expires_after="2024-02-20"> <owner>hongyulong@chromium.org</owner> <owner>nupurjain@google.com</owner> <summary> @@ -5533,7 +5533,7 @@ </histogram> <histogram name="Ash.Projector.CreationFlow.{TabletOrClamshell}" - enum="ProjectorCreationFlow" expires_after="2023-10-17"> + enum="ProjectorCreationFlow" expires_after="2024-02-20"> <owner>dorianbrandon@google.com</owner> <owner>ligeng@google.com</owner> <owner>cros-projector@google.com</owner> @@ -5558,7 +5558,7 @@ </histogram> <histogram name="Ash.Projector.MarkerColor.{TabletOrClamshell}" - enum="ProjectorMarkerColor" expires_after="2023-10-17"> + enum="ProjectorMarkerColor" expires_after="2024-02-20"> <owner>dorianbrandon@google.com</owner> <owner>ligeng@google.com</owner> <owner>cros-projector@google.com</owner> @@ -5572,7 +5572,7 @@ <histogram name="Ash.Projector.OnDeviceToServerSpeechRecognitionFallbackReason" enum="OnDeviceToServerSpeechRecognitionFallbackReason" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>dorianbrandon@google.com</owner> <owner>ligeng@google.com</owner> <owner>cros-projector@google.com</owner> @@ -5622,7 +5622,7 @@ </histogram> <histogram name="Ash.Projector.SpeechRecognitionEndState.{Location}" - enum="SpeechRecognitionEndState" expires_after="2023-11-01"> + enum="SpeechRecognitionEndState" expires_after="2024-02-20"> <owner>dorianbrandon@google.com</owner> <owner>ligeng@google.com</owner> <owner>cros-projector@google.com</owner> @@ -5634,7 +5634,7 @@ </histogram> <histogram name="Ash.Projector.Toolbar.{TabletOrClamshell}" - enum="ProjectorToolbar" expires_after="2023-10-17"> + enum="ProjectorToolbar" expires_after="2024-02-20"> <owner>dorianbrandon@google.com</owner> <owner>ligeng@google.com</owner> <owner>cros-projector@google.com</owner> @@ -6219,7 +6219,7 @@ </histogram> <histogram name="Ash.SpeechRecognitionSessionLength.{Location}" units="ms" - expires_after="2023-11-01"> + expires_after="2024-02-20"> <owner>dorianbrandon@google.com</owner> <owner>ligeng@google.com</owner> <owner>cros-projector@google.com</owner> @@ -6397,7 +6397,7 @@ </histogram> <histogram name="Ash.SplitViewResize.PresentationTime{SplitViewResizeModes}" - units="ms" expires_after="2023-11-18"> + units="ms" expires_after="2024-02-20"> <owner>xdai@chromium.org</owner> <owner>omrilio@chromium.org</owner> <owner>oshima@chromium.org</owner> @@ -6635,7 +6635,7 @@ </histogram> <histogram name="Ash.TabletMode.AnimationSmoothness.Enter" units="%" - expires_after="2023-10-08"> + expires_after="2024-02-20"> <owner>oshima@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/assistant/histograms.xml b/tools/metrics/histograms/metadata/assistant/histograms.xml index e1fad68..ff36917 100644 --- a/tools/metrics/histograms/metadata/assistant/histograms.xml +++ b/tools/metrics/histograms/metadata/assistant/histograms.xml
@@ -158,7 +158,7 @@ </histogram> <histogram name="Assistant.OptInFlowStatus" enum="AssistantOptInFlowStatus" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>updowndota@chromium.org</owner> <owner>croissant-eng@chromium.org</owner> <summary>Record the status of the Assistant opt-in flow.</summary>
diff --git a/tools/metrics/histograms/metadata/autofill/histograms.xml b/tools/metrics/histograms/metadata/autofill/histograms.xml index 646afe3..44152d4 100644 --- a/tools/metrics/histograms/metadata/autofill/histograms.xml +++ b/tools/metrics/histograms/metadata/autofill/histograms.xml
@@ -379,7 +379,7 @@ </histogram> <histogram name="Autofill.Address.IsEnabled.PageLoad" enum="BooleanEnabled" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jsaul@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -463,7 +463,7 @@ <histogram name="Autofill.AddressTokenVerificationStatusAtProfileUsage.{AddressType}" - enum="AufofillStructuredTokenVerificationStatus" expires_after="M120"> + enum="AufofillStructuredTokenVerificationStatus" expires_after="2024-02-20"> <owner>koerber@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -623,7 +623,7 @@ <histogram name="Autofill.Autocomplete.PredictionCollisionType2.{PredictionType}.{AutocompleteState}" - enum="AutofillServerFieldType" expires_after="2023-10-31"> + enum="AutofillServerFieldType" expires_after="2024-02-20"> <owner>koerber@google.com</owner> <owner>fleimgruber@google.com</owner> <owner>chrome-autofill-team@google.com</owner> @@ -1101,7 +1101,7 @@ </histogram> <histogram name="Autofill.CardUploadEnabled" enum="AutofillCardUploadEnabled" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jsaul@google.com</owner> <owner>aneeshali@google.com</owner> <summary> @@ -1132,7 +1132,7 @@ <histogram name="Autofill.CreditCard.Seamless{AutofillSeamlessnessFillability}{AutofillSeamlessnessMeasurementTime}{AutofillSeamlessnessVisibility}" - enum="CreditCardSeamlessFill" expires_after="2023-10-31"> + enum="CreditCardSeamlessFill" expires_after="2024-02-20"> <owner>schwering@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -1172,7 +1172,7 @@ <histogram name="Autofill.CreditCard.Seamless{AutofillSeamlessnessFillability}{AutofillSeamlessnessMeasurementTime}{AutofillSeamlessnessVisibility}.Bitmask" - enum="AutofillCreditCardSeamlessnessBitmask" expires_after="2023-10-31"> + enum="AutofillCreditCardSeamlessnessBitmask" expires_after="2024-02-20"> <owner>schwering@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -1311,7 +1311,7 @@ </histogram> <histogram name="Autofill.CreditCardInfoBar{AutofillCreditCardInfoBarSaveType}" - enum="AutofillCreditCardInfoBar" expires_after="2023-12-12"> + enum="AutofillCreditCardInfoBar" expires_after="2024-02-20"> <owner>jsaul@google.com</owner> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> @@ -1449,7 +1449,7 @@ </histogram> <histogram name="Autofill.CvcAuth.{CardType}.Attempt" enum="BooleanAttempted" - expires_after="2023-11-01"> + expires_after="2024-02-20"> <owner>jsaul@google.com</owner> <owner>payments-autofill-team@google.com</owner> <summary> @@ -1461,7 +1461,7 @@ </histogram> <histogram name="Autofill.CvcAuth.{CardType}.Result" - enum="AutofillCvcAuthEvent" expires_after="2023-11-01"> + enum="AutofillCvcAuthEvent" expires_after="2024-02-20"> <owner>jsaul@google.com</owner> <owner>payments-autofill-team@google.com</owner> <summary> @@ -1519,7 +1519,7 @@ </histogram> <histogram name="Autofill.DaysSinceLastUse.StoredIban{IbanTypeToBeSaved}" - units="days" expires_after="2023-12-12"> + units="days" expires_after="2024-02-20"> <owner>qihuizhao@google.com</owner> <owner>jsaul@google.com</owner> <owner>payments-autofill-team@google.com</owner> @@ -1548,7 +1548,7 @@ </histogram> <histogram name="Autofill.DaysSinceLastUse.StoredProfile.{Category}" - units="days" expires_after="2023-12-12"> + units="days" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -1688,7 +1688,7 @@ <histogram name="Autofill.FastCheckout.CapabilitiesFetcher.CacheStateForIsTriggerFormSupported" enum="FastCheckoutCacheStateForIsTriggerFormSupported" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>bwolfgang@google.com</owner> <owner>jkeitel@google.com</owner> <owner>vizcay@google.com</owner> @@ -1700,7 +1700,7 @@ <histogram name="Autofill.FastCheckout.CapabilitiesFetcher.HttpResponseAndNetErrorCode" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2023-12-17"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2024-02-20"> <owner>vizcay@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -1709,7 +1709,7 @@ </histogram> <histogram name="Autofill.FastCheckout.CapabilitiesFetcher.ParsingResult" - enum="FastCheckoutCapabilitiesParsingResult" expires_after="2023-12-17"> + enum="FastCheckoutCapabilitiesParsingResult" expires_after="2024-02-20"> <owner>bwolfgang@google.com</owner> <owner>jkeitel@google.com</owner> <owner>vizcay@google.com</owner> @@ -1719,7 +1719,7 @@ </histogram> <histogram name="Autofill.FastCheckout.CapabilitiesFetcher.ResponseTime" - units="ms" expires_after="2023-12-17"> + units="ms" expires_after="2024-02-20"> <owner>vizcay@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -1781,7 +1781,7 @@ </histogram> <histogram name="Autofill.FieldFillingStats{AutofillFormType}.{FillingStatus}" - units="fields" expires_after="M120"> + units="fields" expires_after="2024-02-20"> <owner>koerber@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -1852,7 +1852,7 @@ <histogram name="Autofill.FieldPredictionQuality.Aggregate{AutofillFieldPredictionSource}" - enum="AutofillFieldPredictionQuality" expires_after="2023-12-12"> + enum="AutofillFieldPredictionQuality" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -1868,7 +1868,7 @@ <histogram name="Autofill.FieldPredictionQuality.ByFieldType{AutofillFieldPredictionSource}" - enum="AutofillFieldPredictionQualityByFieldType" expires_after="2023-12-12"> + enum="AutofillFieldPredictionQualityByFieldType" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -1883,7 +1883,7 @@ </histogram> <histogram name="Autofill.FieldPrediction{AutofillFieldPredictionSource}" - units="units" expires_after="2023-12-12"> + units="units" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -1900,7 +1900,7 @@ <histogram name="Autofill.FillDuration.FromInteraction.WithAutofill{AutofillFormType}" - units="units" expires_after="2023-12-12"> + units="units" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -1916,7 +1916,7 @@ <histogram name="Autofill.FillDuration.FromInteraction.WithoutAutofill{AutofillFormType}" - units="units" expires_after="2023-12-12"> + units="units" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -2006,7 +2006,7 @@ <histogram name="Autofill.FormAffectedByLaxLocalHeuristicRule.FillingCorrectness{AutofillFormType}" - enum="BooleanAutofillFillingCorrectness" expires_after="M120"> + enum="BooleanAutofillFillingCorrectness" expires_after="2024-02-20"> <owner>battre@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -2046,7 +2046,7 @@ </histogram> <histogram name="Autofill.FormEvents.Address{AutofillDataAvailability}" - enum="AutofillFormEvent" expires_after="2023-12-12"> + enum="AutofillFormEvent" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>jsaul@google.com</owner> <summary> @@ -2080,7 +2080,7 @@ </histogram> <histogram name="Autofill.FormEvents.CreditCard{AutofillDataAvailability}" - enum="AutofillFormEvent" expires_after="2023-12-12"> + enum="AutofillFormEvent" expires_after="2024-02-20"> <owner>jsaul@google.com</owner> <owner>battre@chromium.org</owner> <summary> @@ -2197,7 +2197,7 @@ </histogram> <histogram name="Autofill.Funnel.FillAfterSuggestion{AutofillFormType}" - enum="BooleanAutofillFillAfterSuggestion" expires_after="2023-12-12"> + enum="BooleanAutofillFillAfterSuggestion" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>kolos@chromium.org</owner> <owner>nepper@chromium.org</owner> @@ -2217,7 +2217,7 @@ <histogram name="Autofill.Funnel.InteractionAfterParsedAsType{AutofillFormType}" enum="BooleanAutofillInteractionAfterParsedAsType" - expires_after="2023-12-12"> + expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>kolos@chromium.org</owner> <owner>nepper@chromium.org</owner> @@ -2240,7 +2240,7 @@ </histogram> <histogram name="Autofill.Funnel.ParsedAsType{AutofillFormType}" - enum="BooleanAutofillParsedAsType" expires_after="2023-12-12"> + enum="BooleanAutofillParsedAsType" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>kolos@chromium.org</owner> <owner>nepper@chromium.org</owner> @@ -2256,7 +2256,7 @@ </histogram> <histogram name="Autofill.Funnel.SubmissionAfterFill{AutofillFormType}" - enum="BooleanAutofillSubmissionAfterFill" expires_after="2023-12-12"> + enum="BooleanAutofillSubmissionAfterFill" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>kolos@chromium.org</owner> <owner>nepper@chromium.org</owner> @@ -2270,7 +2270,7 @@ </histogram> <histogram name="Autofill.Funnel.SuggestionAfterInteraction{AutofillFormType}" - enum="BooleanAutofillSuggestionAfterInteraction" expires_after="2023-12-12"> + enum="BooleanAutofillSuggestionAfterInteraction" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>kolos@chromium.org</owner> <owner>nepper@chromium.org</owner> @@ -2516,7 +2516,7 @@ </histogram> <histogram name="Autofill.KeyMetrics.FillingAcceptance{AutofillFormType}" - enum="BooleanAutofillFillingAcceptance" expires_after="2023-12-12"> + enum="BooleanAutofillFillingAcceptance" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>kolos@chromium.org</owner> <owner>nepper@chromium.org</owner> @@ -2530,7 +2530,7 @@ </histogram> <histogram name="Autofill.KeyMetrics.FillingAssistance{AutofillFormType}" - enum="BooleanAutofillFillingAssistance" expires_after="2023-12-12"> + enum="BooleanAutofillFillingAssistance" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>kolos@chromium.org</owner> <owner>nepper@chromium.org</owner> @@ -2547,7 +2547,7 @@ </histogram> <histogram name="Autofill.KeyMetrics.FillingCorrectness{AutofillFormType}" - enum="BooleanAutofillFillingCorrectness" expires_after="2023-12-12"> + enum="BooleanAutofillFillingCorrectness" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>kolos@chromium.org</owner> <owner>nepper@chromium.org</owner> @@ -2559,7 +2559,7 @@ </histogram> <histogram name="Autofill.KeyMetrics.FillingReadiness{AutofillFormType}" - enum="BooleanAutofillFillingReadiness" expires_after="2023-12-12"> + enum="BooleanAutofillFillingReadiness" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>kolos@chromium.org</owner> <owner>nepper@chromium.org</owner> @@ -2576,7 +2576,7 @@ <histogram name="Autofill.KeyMetrics.FormSubmission.Autofilled{AutofillFormType}" - enum="BooleanAutofillSubmission" expires_after="2023-12-12"> + enum="BooleanAutofillSubmission" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>kolos@chromium.org</owner> <owner>nepper@chromium.org</owner> @@ -2594,7 +2594,7 @@ <histogram name="Autofill.KeyMetrics.FormSubmission.NotAutofilled{AutofillFormType}" - enum="BooleanAutofillSubmission" expires_after="2023-12-12"> + enum="BooleanAutofillSubmission" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>kolos@chromium.org</owner> <owner>nepper@chromium.org</owner> @@ -2671,7 +2671,7 @@ </histogram> <histogram name="Autofill.Leipzig.FillingCorrectness.{Category}" - enum="BooleanAutofillFillingCorrectness" expires_after="2023-12-12"> + enum="BooleanAutofillFillingCorrectness" expires_after="2024-02-20"> <owner>koerber@chromium.org</owner> <owner>fleimgruber@chromium.org</owner> <owner>chrome-autofill-team@google.com</owner> @@ -2916,7 +2916,7 @@ <histogram name="Autofill.NumberOfAutofilledFieldsAtSubmission.{AcceptanceStatus}" - units="fields" expires_after="M120"> + units="fields" expires_after="2024-02-20"> <owner>koerber@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -2932,7 +2932,7 @@ <histogram name="Autofill.NumberOfAutofilledFieldsWithAutocompleteUnrecognizedAtSubmission.{AcceptanceStatus}" - units="fields" expires_after="M120"> + units="fields" expires_after="2024-02-20"> <owner>koerber@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -3512,7 +3512,7 @@ </histogram> <histogram name="Autofill.PerfectFilling.{FormType}" enum="Boolean" - expires_after="M120"> + expires_after="2024-02-20"> <owner>koerber@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -4096,7 +4096,7 @@ </histogram> <histogram name="Autofill.ScanCreditCard.Duration{CreditCardScanSuccess}" - units="ms" expires_after="2023-12-12"> + units="ms" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -4271,7 +4271,7 @@ </histogram> <histogram name="Autofill.Snackbar.{SnackbarType}.ActionClicked" - enum="BooleanShown" expires_after="2023-11-01"> + enum="BooleanShown" expires_after="2024-02-20"> <owner>siashah@chromium.org</owner> <owner>jsaul@google.com</owner> <owner>payments-autofill-team@google.com</owner> @@ -4283,7 +4283,7 @@ </histogram> <histogram name="Autofill.Snackbar.{SnackbarType}.Shown" enum="BooleanShown" - expires_after="2023-11-01"> + expires_after="2024-02-20"> <owner>siashah@chromium.org</owner> <owner>jsaul@google.com</owner> <owner>payments-autofill-team@google.com</owner> @@ -4389,7 +4389,7 @@ </histogram> <histogram name="Autofill.StoredProfileCount.{Category}" units="Profiles" - expires_after="2023-12-12"> + expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -4425,7 +4425,7 @@ </histogram> <histogram name="Autofill.StoredProfileDisusedCount.{Category}" - units="Profiles" expires_after="2023-12-12"> + units="Profiles" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -4452,7 +4452,7 @@ </histogram> <histogram name="Autofill.StoredProfileUsedCount.{Category}" units="Profiles" - expires_after="M120"> + expires_after="2024-02-20"> <owner>koerber@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -4658,7 +4658,7 @@ </histogram> <histogram name="Autofill.SubmittedCardState" enum="AutofillSubmittedCardState" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jsaul@google.com</owner> <owner>payments-autofill-team@google.com</owner> <summary> @@ -4669,7 +4669,7 @@ <histogram name="Autofill.SubmittedServerCardExpirationStatus" enum="AutofillSubmittedServerCardExpirationStatus" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jsaul@google.com</owner> <owner>payments-autofill-team@google.com</owner> <summary> @@ -4715,7 +4715,7 @@ <histogram name="Autofill.SuggestionAcceptedIndex{AutofillSuggestionAcceptedIndexSuggestionType}" - units="position" expires_after="2023-12-12"> + units="position" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -4769,7 +4769,7 @@ </histogram> <histogram name="Autofill.Timing.{AutofillTimedFunction}" units="ms" - expires_after="2023-12-12"> + expires_after="2024-02-20"> <owner>schwering@chromium.org</owner> <owner>kenjitoyama@chromium.org</owner> <owner>battre@chromium.org</owner> @@ -4973,7 +4973,7 @@ </histogram> <histogram name="Autofill.UnmaskPrompt.GetRealPanDuration.{CardType}.{Result}" - units="ms" expires_after="2023-11-12"> + units="ms" expires_after="2024-02-20"> <owner>siyua@chromium.org</owner> <owner>payments-autofill-team@google.com</owner> <summary> @@ -5050,7 +5050,7 @@ </histogram> <histogram name="Autofill.UnmaskPrompt.{CardType}.Events" - enum="AutofillUnmaskPromptEvent" expires_after="2023-11-01"> + enum="AutofillUnmaskPromptEvent" expires_after="2024-02-20"> <owner>jsaul@google.com</owner> <owner>siyua@chromium.org</owner> <owner>payments-autofill-team@google.com</owner> @@ -5115,7 +5115,7 @@ </histogram> <histogram name="Autofill.UploadEvent{AutofillUploadEvents}" enum="BooleanSent" - expires_after="2023-12-12"> + expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -5173,7 +5173,7 @@ </histogram> <histogram name="Autofill.UserHappiness{AutofillFormType}" - enum="AutofillUserHappiness" expires_after="2023-12-12"> + enum="AutofillUserHappiness" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/blink/histograms.xml b/tools/metrics/histograms/metadata/blink/histograms.xml index 94f44fda..2d643aa 100644 --- a/tools/metrics/histograms/metadata/blink/histograms.xml +++ b/tools/metrics/histograms/metadata/blink/histograms.xml
@@ -1351,7 +1351,7 @@ </histogram> <histogram name="Blink.FedCm.IsSignInUser" enum="Boolean" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>yigu@chromium.org</owner> <owner>web-identity-eng@google.com</owner> <summary> @@ -1456,7 +1456,7 @@ </histogram> <histogram name="Blink.FedCm.Status.Csp" enum="FedCmCspStatus" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>cbiesinger@chromium.org</owner> <owner>web-identity-eng@google.com</owner> <summary>Records the result of CSP checks in the FedCM API.</summary> @@ -1546,7 +1546,7 @@ </histogram> <histogram name="Blink.FedCm.Timing.ContinueOnDialog" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>yigu@chromium.org</owner> <owner>web-identity-eng@google.com</owner> <summary> @@ -1606,7 +1606,7 @@ </histogram> <histogram name="Blink.FedCm.Timing.TurnaroundTime" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>yigu@chromium.org</owner> <owner>web-identity-eng@google.com</owner> <summary> @@ -2810,7 +2810,7 @@ </histogram> <histogram name="Blink.MemoryCache.RevalidationPolicy.AsyncScript" - enum="RevalidationPolicy" expires_after="2023-12-17"> + enum="RevalidationPolicy" expires_after="2024-02-20"> <owner>hiroshige@chromium.org</owner> <owner>lizeb@chromium.org</owner> <owner>gjc@chromium.org</owner> @@ -3310,7 +3310,7 @@ </histogram> <histogram name="Blink.Sms.Receive.Infobar" enum="WebOTPServiceInfobarAction" - expires_after="2023-12-09"> + expires_after="2024-02-20"> <owner>yigu@chromium.org</owner> <owner>goto@chromium.org</owner> <owner>web-identity-eng@google.com</owner> @@ -3374,7 +3374,7 @@ </histogram> <histogram name="Blink.Sms.Receive.TimeContinueOnSuccess" units="ms" - expires_after="2023-12-09"> + expires_after="2024-02-20"> <owner>yigu@chromium.org</owner> <owner>goto@chromium.org</owner> <owner>web-identity-eng@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/bluetooth/histograms.xml b/tools/metrics/histograms/metadata/bluetooth/histograms.xml index 048ac02a..500f44b 100644 --- a/tools/metrics/histograms/metadata/bluetooth/histograms.xml +++ b/tools/metrics/histograms/metadata/bluetooth/histograms.xml
@@ -169,7 +169,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.AccountKey.Write.Result.{FastPairPairingProtocol}" - enum="BooleanSuccess" expires_after="2023-10-22"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -410,7 +410,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.EngagementFunnel.Steps.{FastPairPairingProtocol}" - enum="FastPairEngagementFlowEvent" expires_after="2023-10-22"> + enum="FastPairEngagementFlowEvent" expires_after="2024-02-20"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -471,7 +471,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.EngagementFunnel.Steps.{FastPairPairingProtocol}.{FastPairTrackedModelID}" - enum="FastPairEngagementFlowEvent" expires_after="2023-10-22"> + enum="FastPairEngagementFlowEvent" expires_after="2024-02-20"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -678,7 +678,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.FootprintsFetcher.{Method}.HttpResponseError" - enum="HttpResponseCode" expires_after="2023-10-22"> + enum="HttpResponseCode" expires_after="2024-02-20"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -697,7 +697,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.FootprintsFetcher.{Method}.NetError" - enum="NetErrorCodes" expires_after="2023-10-22"> + enum="NetErrorCodes" expires_after="2024-02-20"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -742,7 +742,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.GattConnection.ErrorReason" - enum="BluetoothDeviceConnectErrorCode" expires_after="2023-12-04"> + enum="BluetoothDeviceConnectErrorCode" expires_after="2024-02-20"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -781,7 +781,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.Handshake.FailureReason" - enum="FastPairHandshakeFailureReason" expires_after="2023-11-12"> + enum="FastPairHandshakeFailureReason" expires_after="2024-02-20"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -810,7 +810,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.Handshake.Steps.{FastPairPairingProtocol}" - enum="FastPairHandshakeSteps" expires_after="2023-10-22"> + enum="FastPairHandshakeSteps" expires_after="2024-02-20"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1044,7 +1044,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.PairFailure.{FastPairPairingProtocol}" - enum="FastPairPairFailure" expires_after="2023-10-22"> + enum="FastPairPairFailure" expires_after="2024-02-20"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1065,7 +1065,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.Pairing.Result.{FastPairPairingProtocol}" - enum="BooleanSuccess" expires_after="2023-10-22"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1545,7 +1545,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.TotalUxPairTime.{FastPairPairingProtocol}2" - units="ms" expires_after="2023-10-22"> + units="ms" expires_after="2024-02-20"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/bookmarks/histograms.xml b/tools/metrics/histograms/metadata/bookmarks/histograms.xml index 9eb67ad..f2250f57 100644 --- a/tools/metrics/histograms/metadata/bookmarks/histograms.xml +++ b/tools/metrics/histograms/metadata/bookmarks/histograms.xml
@@ -50,7 +50,7 @@ </histogram> <histogram name="BookmarkManager.ResultsRenderedTime" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>johntlee@chromium.org</owner> <owner>dbeam@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/borealis/histograms.xml b/tools/metrics/histograms/metadata/borealis/histograms.xml index 13c026e..8c78650 100644 --- a/tools/metrics/histograms/metadata/borealis/histograms.xml +++ b/tools/metrics/histograms/metadata/borealis/histograms.xml
@@ -128,7 +128,7 @@ </histogram> <histogram name="Borealis.EngagementTime.{Variant}" units="ms" - expires_after="2023-10-09"> + expires_after="2024-02-20"> <owner>lqu@google.com</owner> <owner>src/chrome/browser/ash/borealis/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/browser/histograms.xml b/tools/metrics/histograms/metadata/browser/histograms.xml index ae502c7..2f92bd0 100644 --- a/tools/metrics/histograms/metadata/browser/histograms.xml +++ b/tools/metrics/histograms/metadata/browser/histograms.xml
@@ -143,6 +143,16 @@ </summary> </histogram> +<histogram name="Browser.ERP.ConfigFileParsingError" + enum="EnterpriseCloudReportingStatusCode" expires_after="2024-06-01"> + <owner>albertojuarez@google.com</owner> + <owner>src/components/reporting/OWNERS</owner> + <summary> + Recorded when RecordHandlerImpl catches an error while trying to parse the + configuration file that was sent from the reporting server. + </summary> +</histogram> + <histogram name="Browser.ERP.EventEnqueueResult" enum="EnterpriseCloudReportingStatusCode" expires_after="2024-01-21"> <owner>lbaraz@chromium.org</owner> @@ -580,7 +590,7 @@ <histogram name="Browser.PaintPreview.TabbedPlayer.UpTime{TabbedPaintPreviewPlayerUptime}" - units="ms" expires_after="2023-11-27"> + units="ms" expires_after="2024-02-20"> <owner>ckitagawa@chromium.org</owner> <owner>fredmello@chromium.org</owner> <owner>chrome-fdt@google.com</owner> @@ -848,7 +858,7 @@ </histogram> <histogram name="BrowserRenderProcessHost.Cleanup.DelayReason" - enum="RenderProcessHostDelayShutdownReason" expires_after="2023-12-15"> + enum="RenderProcessHostDelayShutdownReason" expires_after="2024-02-20"> <owner>mych@chromium.org</owner> <owner>bfcache-dev@chromium.org</owner> <summary> @@ -861,7 +871,7 @@ </histogram> <histogram name="BrowserRenderProcessHost.Cleanup.Total" enum="Boolean" - expires_after="2023-12-15"> + expires_after="2024-02-20"> <owner>mych@chromium.org</owner> <owner>bfcache-dev@chromium.org</owner> <summary> @@ -882,7 +892,7 @@ </histogram> <histogram name="BrowserRenderProcessHost.FastShutdownIfPossible.DelayReason" - enum="RenderProcessHostDelayShutdownReason" expires_after="2023-12-15"> + enum="RenderProcessHostDelayShutdownReason" expires_after="2024-02-20"> <owner>mych@chromium.org</owner> <owner>bfcache-dev@chromium.org</owner> <summary> @@ -895,7 +905,7 @@ </histogram> <histogram name="BrowserRenderProcessHost.FastShutdownIfPossible.Total" - enum="Boolean" expires_after="2023-12-15"> + enum="Boolean" expires_after="2024-02-20"> <owner>mych@chromium.org</owner> <owner>bfcache-dev@chromium.org</owner> <summary> @@ -938,7 +948,7 @@ </histogram> <histogram name="BrowserRenderProcessHost.SpareProcessMaybeTakeAction" - enum="SpareProcessMaybeTakeAction" expires_after="2023-12-15"> + enum="SpareProcessMaybeTakeAction" expires_after="2024-02-20"> <owner>alexmos@chromium.org</owner> <owner>lukasza@chromium.org</owner> <summary> @@ -1030,7 +1040,7 @@ </histogram> <histogram name="BrowserSwitcher.CacheFile.MkDirSuccess" enum="BooleanSuccess" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>nicolaso@chromium.org</owner> <owner>pastarmovj@chromium.org</owner> <summary> @@ -1040,7 +1050,7 @@ </histogram> <histogram name="BrowserSwitcher.CacheFile.MkTempSuccess" enum="BooleanSuccess" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>nicolaso@chromium.org</owner> <owner>pastarmovj@chromium.org</owner> <summary> @@ -1051,7 +1061,7 @@ </histogram> <histogram name="BrowserSwitcher.CacheFile.MoveSuccess" enum="BooleanSuccess" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>nicolaso@chromium.org</owner> <owner>pastarmovj@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/browsing_topics/histograms.xml b/tools/metrics/histograms/metadata/browsing_topics/histograms.xml index 2a59906..42fa6d92 100644 --- a/tools/metrics/histograms/metadata/browsing_topics/histograms.xml +++ b/tools/metrics/histograms/metadata/browsing_topics/histograms.xml
@@ -95,7 +95,7 @@ </histogram> <histogram name="BrowsingTopics.EpochTopicsCalculation.TimeBetweenCalculations" - units="ms" expires_after="2023-12-22"> + units="ms" expires_after="2024-02-20"> <owner>abigailkatcoff@chromium.org</owner> <owner>yaoxia@chromium.org</owner> <owner>jkarlin@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/chromeos/histograms.xml b/tools/metrics/histograms/metadata/chromeos/histograms.xml index ce37155..da194732 100644 --- a/tools/metrics/histograms/metadata/chromeos/histograms.xml +++ b/tools/metrics/histograms/metadata/chromeos/histograms.xml
@@ -193,7 +193,7 @@ </histogram> <histogram name="ChromeOS.Apps.IntentPickerDestinationPlatform" - enum="ArcIntentHandlerDestinationPlatform" expires_after="2023-12-17"> + enum="ArcIntentHandlerDestinationPlatform" expires_after="2024-02-20"> <owner>tsergeant@chromium.org</owner> <owner>chromeos-apps-foundation-team@google.com</owner> <summary> @@ -672,7 +672,7 @@ </histogram> <histogram name="ChromeOS.Camera.ModuleID" enum="PopularCamPeriphModuleID" - expires_after="2023-12-04"> + expires_after="2024-02-20"> <owner>dorahkim@google.com</owner> <owner>chromeos-camera-eng@google.com</owner> <summary> @@ -705,7 +705,7 @@ </histogram> <histogram name="ChromeOS.Camera.SessionDuration" units="seconds" - expires_after="2023-12-04"> + expires_after="2024-02-20"> <owner>wtlee@chromium.org</owner> <owner>chromeos-camera-eng@google.com</owner> <summary>Records the session duration in Chrome OS camera service.</summary> @@ -834,7 +834,7 @@ </histogram> <histogram name="ChromeOS.CWP.ParseLacrosPath" enum="ChromeOSParseLacrosPath" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>shantuo@google.com</owner> <owner>cwp-team@google.com</owner> <summary> @@ -865,7 +865,7 @@ </histogram> <histogram name="ChromeOS.CWP.PSIMemPressure.{PType}" units="failures" - expires_after="2023-10-13"> + expires_after="2024-02-20"> <owner>raging@google.com</owner> <owner>chromeos-memory@google.com</owner> <summary> @@ -1448,7 +1448,7 @@ </histogram> <histogram name="ChromeOS.Inputs.AttachmentForm.{Type}" enum="AttachmentForm" - expires_after="2023-10-24"> + expires_after="2024-02-20"> <owner>wmahon@google.com</owner> <owner>chromeos-tango@google.com</owner> <owner>cros-peripherals@google.com</owner> @@ -1468,7 +1468,7 @@ </histogram> <histogram name="ChromeOS.Inputs.AttachmentType.{Form}" enum="AttachmentType" - expires_after="2023-10-24"> + expires_after="2024-02-20"> <owner>wmahon@google.com</owner> <owner>chromeos-tango@google.com</owner> <owner>cros-peripherals@google.com</owner> @@ -1796,7 +1796,7 @@ </histogram> <histogram name="ChromeOS.LanguagePacks.InstallError.Handwriting" - enum="LanguagePackDlcErrorType" expires_after="2023-12-17"> + enum="LanguagePackDlcErrorType" expires_after="2024-02-20"> <owner>claudiomagni@chromium.org</owner> <owner>mlcui@google.com</owner> <owner>dvallet@chromium.org</owner> @@ -1914,7 +1914,7 @@ </histogram> <histogram name="ChromeOS.Liveness.PingResult" enum="BooleanSuccess" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>iby@google.com</owner> <owner>xiyuan@google.com</owner> <summary> @@ -1994,7 +1994,7 @@ </histogram> <histogram name="ChromeOS.Printing.TimeCostOfFailedFoomaticShell" - units="seconds" expires_after="2023-12-16"> + units="seconds" expires_after="2024-02-20"> <owner>pawliczek@chromium.org</owner> <owner>bmgordon@chromium.org</owner> <owner>project-bolton@google.com</owner> @@ -2006,7 +2006,7 @@ </histogram> <histogram name="ChromeOS.Printing.TimeCostOfSuccessfulFoomaticShell" - units="seconds" expires_after="2023-12-16"> + units="seconds" expires_after="2024-02-20"> <owner>pawliczek@chromium.org</owner> <owner>bmgordon@chromium.org</owner> <owner>project-bolton@google.com</owner> @@ -3113,7 +3113,7 @@ </histogram> <histogram name="ChromeOS.SystemTray.Network.{NetworkType}.Toggled" - enum="BooleanToggled" expires_after="2023-10-22"> + enum="BooleanToggled" expires_after="2024-02-20"> <owner>khorimoto@chromium.org</owner> <owner>tjohnsonkanu@chromium.org</owner> <owner>chadduffin@chromium.org</owner> @@ -3369,7 +3369,7 @@ </histogram> <histogram name="ChromeOS.WebAPK.{InstallType}.Result" - enum="WebApkInstallResultChromeOS" expires_after="2023-10-14"> + enum="WebApkInstallResultChromeOS" expires_after="2024-02-20"> <owner>tsergeant@chromium.org</owner> <owner>chromeos-apps-foundation-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml b/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml index 1e0c92a..0a81374 100644 --- a/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml +++ b/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml
@@ -129,7 +129,7 @@ </histogram> <histogram name="ChromeOS.Settings.Device.KeyboardAutoRepeat{Setting}" - units="ms" expires_after="2023-11-01"> + units="ms" expires_after="2024-02-20"> <owner>ckincaid@chromium.org</owner> <owner>dmblack@google.com</owner> <owner>cros-settings@google.com</owner> @@ -165,7 +165,7 @@ </histogram> <histogram name="ChromeOS.Settings.Device.TouchpadSpeedValue" - enum="TouchpadSensitivity" expires_after="2023-11-12"> + enum="TouchpadSensitivity" expires_after="2024-02-20"> <owner>xiaohuic@chromium.org</owner> <owner>cros-settings@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/commerce/histograms.xml b/tools/metrics/histograms/metadata/commerce/histograms.xml index 60c96e6..6e91ff6 100644 --- a/tools/metrics/histograms/metadata/commerce/histograms.xml +++ b/tools/metrics/histograms/metadata/commerce/histograms.xml
@@ -222,7 +222,7 @@ </histogram> <histogram name="Commerce.PDPNavigation.{FeatureName}.Eligible" enum="Boolean" - expires_after="2023-11-15"> + expires_after="2024-02-20"> <owner>ayman@chromium.org</owner> <owner>mdjones@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -240,7 +240,7 @@ </histogram> <histogram name="Commerce.PDPNavigation.{FeatureName}.IneligibilityReason" - enum="ShoppingFeatureIneligibilityReason" expires_after="2023-11-15"> + enum="ShoppingFeatureIneligibilityReason" expires_after="2024-02-20"> <owner>ayman@chromium.org</owner> <owner>mdjones@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -358,7 +358,7 @@ </histogram> <histogram name="Commerce.PriceDrop.NotificationChannelBlocked" enum="Boolean" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>zhiyuancai@chromium.org</owner> <owner>chrome-shopping@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/companion/histograms.xml b/tools/metrics/histograms/metadata/companion/histograms.xml index 9dcf8f5..c997c11 100644 --- a/tools/metrics/histograms/metadata/companion/histograms.xml +++ b/tools/metrics/histograms/metadata/companion/histograms.xml
@@ -384,7 +384,7 @@ </histogram> <histogram name="Companion.{UiSurface}.ChildElementCount" units="Index" - expires_after="2023-10-20"> + expires_after="2024-02-20"> <owner>shaktisahu@chromium.org</owner> <owner>src/chrome/browser/companion/OWNERS</owner> <summary> @@ -395,7 +395,7 @@ </histogram> <histogram name="Companion.{UiSurface}.Clicked" enum="BooleanClicked" - expires_after="2023-10-20"> + expires_after="2024-02-20"> <owner>shaktisahu@chromium.org</owner> <owner>src/chrome/browser/companion/OWNERS</owner> <summary> @@ -406,7 +406,7 @@ </histogram> <histogram name="Companion.{UiSurface}.ClickPosition" units="Index" - expires_after="2023-10-20"> + expires_after="2024-02-20"> <owner>shaktisahu@chromium.org</owner> <owner>src/chrome/browser/companion/OWNERS</owner> <summary> @@ -417,7 +417,7 @@ </histogram> <histogram name="Companion.{UiSurface}.Shown" enum="BooleanShown" - expires_after="2023-10-20"> + expires_after="2024-02-20"> <owner>shaktisahu@chromium.org</owner> <owner>src/chrome/browser/companion/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/compositing/histograms.xml b/tools/metrics/histograms/metadata/compositing/histograms.xml index 1070eea..232986be 100644 --- a/tools/metrics/histograms/metadata/compositing/histograms.xml +++ b/tools/metrics/histograms/metadata/compositing/histograms.xml
@@ -298,7 +298,7 @@ </histogram> <histogram name="Compositing.Display.Draw.Occlusion.Calculation.Time" - units="microseconds" expires_after="2023-12-18"> + units="microseconds" expires_after="2024-02-20"> <owner>yiyix@chromium.org</owner> <owner>chromeos-gfx@chromium.org</owner> <summary> @@ -313,7 +313,7 @@ </histogram> <histogram name="Compositing.Display.DrawToSwapUs" units="microseconds" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jonross@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -474,7 +474,7 @@ <histogram name="Compositing.Display.OverlayProcessorUsingStrategy.NumOverlays{Counted}" - units="overlay candidates" expires_after="2023-11-30"> + units="overlay candidates" expires_after="2024-02-20"> <owner>khaslett@chromium.org</owner> <owner>kylechar@chromium.org</owner> <owner>chromeos-gfx-compositor@chromium.org</owner> @@ -834,7 +834,7 @@ </histogram> <histogram name="Compositing.SurfaceAggregator.Has{Type}PerFrame" - enum="Boolean" expires_after="2023-11-01"> + enum="Boolean" expires_after="2024-02-20"> <owner>magchen@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/content/histograms.xml b/tools/metrics/histograms/metadata/content/histograms.xml index be3d444b7..93d9c926 100644 --- a/tools/metrics/histograms/metadata/content/histograms.xml +++ b/tools/metrics/histograms/metadata/content/histograms.xml
@@ -1823,7 +1823,7 @@ </histogram> <histogram name="ContentSuggestions.{FeedType}.Activity.ByProvider" - enum="FeedActivityBucket" expires_after="2023-11-24"> + enum="FeedActivityBucket" expires_after="2024-02-20"> <owner>guiperez@google.com</owner> <owner>feed@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/cookie/histograms.xml b/tools/metrics/histograms/metadata/cookie/histograms.xml index 3a4e9490..38e63d3d 100644 --- a/tools/metrics/histograms/metadata/cookie/histograms.xml +++ b/tools/metrics/histograms/metadata/cookie/histograms.xml
@@ -91,7 +91,7 @@ </histogram> <histogram name="Cookie.CookieJarSize" units="kibibytes" - expires_after="2023-12-22"> + expires_after="2024-02-20"> <owner>dylancutler@google.com</owner> <owner>src/net/cookies/OWNERS</owner> <summary> @@ -182,7 +182,7 @@ </histogram> <histogram name="Cookie.CookieSourceSchemeName" enum="CookieSourceSchemeName" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>bingler@chromium.org</owner> <owner>miketaylr@chromium.org</owner> <summary> @@ -202,7 +202,7 @@ <histogram name="Cookie.CrossSiteRedirectDowngradeChangesInclusion2.{AccessType}" - enum="CookieSameSite2" expires_after="2023-11-15"> + enum="CookieSameSite2" expires_after="2024-02-20"> <owner>bingler@chromium.org</owner> <owner>miketaylr@chromium.org</owner> <summary> @@ -611,7 +611,7 @@ </histogram> <histogram name="Cookie.IsPartitionedValid" enum="BooleanValid" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>dylancutler@google.com</owner> <owner>bingler@chromium.org</owner> <summary> @@ -716,7 +716,7 @@ </histogram> <histogram name="Cookie.PartitionedCookieJarSizeKibibytes" units="kibibytes" - expires_after="2023-12-22"> + expires_after="2024-02-20"> <owner>dylancutler@google.com</owner> <owner>src/net/cookies/OWNERS</owner> <summary> @@ -727,7 +727,7 @@ </histogram> <histogram name="Cookie.PartitionedCookieJarSizeKibibytes.{NonceType}" - units="kibibytes" expires_after="2023-12-22"> + units="kibibytes" expires_after="2024-02-20"> <owner>dylancutler@google.com</owner> <owner>src/net/cookies/OWNERS</owner> <summary> @@ -806,7 +806,7 @@ </histogram> <histogram name="Cookie.Port.Read.{HostType}" enum="InterestingCookiePorts" - expires_after="2023-11-18"> + expires_after="2024-02-20"> <owner>bingler@chromium.org</owner> <owner>miketaylr@chromium.org</owner> <summary> @@ -828,7 +828,7 @@ </histogram> <histogram name="Cookie.Port.ReadDiffersFromSet.{HostType}" - enum="CookieSentToSamePort" expires_after="2023-11-18"> + enum="CookieSentToSamePort" expires_after="2024-02-20"> <owner>bingler@chromium.org</owner> <owner>miketaylr@chromium.org</owner> <summary> @@ -859,7 +859,7 @@ </histogram> <histogram name="Cookie.Port.Set.{HostType}" enum="InterestingCookiePorts" - expires_after="2023-11-18"> + expires_after="2024-02-20"> <owner>bingler@chromium.org</owner> <owner>miketaylr@chromium.org</owner> <summary> @@ -913,7 +913,7 @@ </histogram> <histogram name="Cookie.SameSiteNoneSizeBytes.{IsPartitioned}" units="bytes" - expires_after="2023-10-25"> + expires_after="2024-02-20"> <owner>dylancutler@google.com</owner> <owner>src/net/cookies/OWNERS</owner> <summary> @@ -952,7 +952,7 @@ </histogram> <histogram name="Cookie.TimeToRecordPeriodicStats" units="ms" - expires_after="2023-12-22"> + expires_after="2024-02-20"> <owner>bingler@chromium.org</owner> <owner>src/net/cookies/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/cras/histograms.xml b/tools/metrics/histograms/metadata/cras/histograms.xml index 2a98322cf..e2d8a74 100644 --- a/tools/metrics/histograms/metadata/cras/histograms.xml +++ b/tools/metrics/histograms/metadata/cras/histograms.xml
@@ -609,7 +609,7 @@ </histogram> <histogram name="Cras.RtcRuntime.{InDevice}.{OutDevice}" units="seconds" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>yuhsuan@chromium.org</owner> <owner>chromeos-audio@google.com</owner> <summary> @@ -787,7 +787,7 @@ </token> </histogram> -<histogram name="Cras.StreamFlags" units="value" expires_after="2023-12-17"> +<histogram name="Cras.StreamFlags" units="value" expires_after="2024-02-20"> <!-- Name completed by histogram_suffixes name="Cras.Direction" and name="Cras.ClientType" -->
diff --git a/tools/metrics/histograms/metadata/crostini/histograms.xml b/tools/metrics/histograms/metadata/crostini/histograms.xml index 644140a..b6e012b 100644 --- a/tools/metrics/histograms/metadata/crostini/histograms.xml +++ b/tools/metrics/histograms/metadata/crostini/histograms.xml
@@ -155,7 +155,7 @@ </histogram> <histogram name="Crostini.ContainerOsVersion" enum="CrostiniContainerOsVersion" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>davidmunro@google.com</owner> <owner>clumptini@google.com</owner> <summary> @@ -453,7 +453,7 @@ </histogram> <histogram name="Crostini.Sshfs.Mount.TimeTaken" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>davidmunro@google.com</owner> <owner>clumptini@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/cryptohome/histograms.xml b/tools/metrics/histograms/metadata/cryptohome/histograms.xml index e96cc2e..b3c869fd 100644 --- a/tools/metrics/histograms/metadata/cryptohome/histograms.xml +++ b/tools/metrics/histograms/metadata/cryptohome/histograms.xml
@@ -440,7 +440,7 @@ </histogram> <histogram name="Cryptohome.OOPMountOperationResult" - enum="CryptohomeOOPMountOperationResult" expires_after="2023-12-17"> + enum="CryptohomeOOPMountOperationResult" expires_after="2024-02-20"> <owner>betuls@chromium.org</owner> <owner>cros-security-cryptohome+uma@google.com</owner> <summary> @@ -522,7 +522,7 @@ </histogram> <histogram name="Cryptohome.TimeToGenerateEccAuthValue" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>yich@google.com</owner> <owner>cros-hwsec+uma@google.com</owner> <summary> @@ -621,7 +621,7 @@ </histogram> <histogram name="Cryptohome.TimeToUSSPersist" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>thomascedeno@google.com</owner> <owner>cros-security-cryptohome+uma@google.com</owner> <summary> @@ -712,7 +712,7 @@ </histogram> <histogram name="Cryptohome.{Action}AuthBlockType" - enum="CryptohomeAuthBlockType" expires_after="2023-10-11"> + enum="CryptohomeAuthBlockType" expires_after="2024-02-20"> <owner>yich@google.com</owner> <owner>cros-hwsec+uma@google.com</owner> <summary> @@ -749,7 +749,7 @@ </histogram> <histogram name="Cryptohome.{AuthSessionFunction}.{AuthBlockType}" units="ms" - expires_after="2023-11-01"> + expires_after="2024-02-20"> <owner>thomascedeno@google.com</owner> <owner>cros-security-cryptohome+uma@google.com</owner> <summary> @@ -803,7 +803,7 @@ </histogram> <histogram name="Cryptohome.{ErrorOperation}{AuthFactorType}.AllLocations" - enum="CryptohomeErrorLocation" expires_after="2023-11-01"> + enum="CryptohomeErrorLocation" expires_after="2024-02-20"> <owner>zuan@chromium.org</owner> <owner>cros-hwsec+uma@google.com</owner> <summary> @@ -839,7 +839,7 @@ <histogram name="Cryptohome.{ErrorOperation}{AuthFactorType}.DevUnexpectedState" - enum="CryptohomeErrorLocation" expires_after="2023-11-01"> + enum="CryptohomeErrorLocation" expires_after="2024-02-20"> <owner>zuan@chromium.org</owner> <owner>cros-hwsec+uma@google.com</owner> <summary> @@ -876,7 +876,7 @@ </histogram> <histogram name="Cryptohome.{ErrorOperation}{AuthFactorType}.HashedStack" - enum="CryptohomeErrorHashed" expires_after="2023-11-01"> + enum="CryptohomeErrorHashed" expires_after="2024-02-20"> <owner>zuan@chromium.org</owner> <owner>cros-hwsec+uma@google.com</owner> <summary> @@ -911,7 +911,7 @@ </histogram> <histogram name="Cryptohome.{ErrorOperation}{AuthFactorType}.LeafErrorWithTPM" - enum="CryptohomeErrorLocationWithTPMError" expires_after="2023-11-01"> + enum="CryptohomeErrorLocationWithTPMError" expires_after="2024-02-20"> <owner>zuan@chromium.org</owner> <owner>cros-hwsec+uma@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/custom_tabs/histograms.xml b/tools/metrics/histograms/metadata/custom_tabs/histograms.xml index e7c6ce3..60a4240 100644 --- a/tools/metrics/histograms/metadata/custom_tabs/histograms.xml +++ b/tools/metrics/histograms/metadata/custom_tabs/histograms.xml
@@ -494,7 +494,7 @@ <histogram name="CustomTabs.RetainableSessionsV2.TimeBetweenLaunch{IdentifierType}" - units="seconds" expires_after="2023-10-22"> + units="seconds" expires_after="2024-02-20"> <owner>wenyufu@chromium.org</owner> <owner>chrome-connective-tissue@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/dev/histograms.xml b/tools/metrics/histograms/metadata/dev/histograms.xml index 3630706..74a0c11 100644 --- a/tools/metrics/histograms/metadata/dev/histograms.xml +++ b/tools/metrics/histograms/metadata/dev/histograms.xml
@@ -90,7 +90,7 @@ </histogram> <histogram name="DevTools.CDPCommandFrom{ClientType}" enum="CDPCommands" - expires_after="2023-12-16"> + expires_after="2024-02-20"> <owner>wolfi@chromium.org</owner> <owner>dsv@chromium.org</owner> <owner>yangguo@chromium.org</owner> @@ -125,7 +125,7 @@ </histogram> <histogram name="DevTools.CSSHintShown" enum="DevToolsCSSHintShown" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>changhaohan@chromium.org</owner> <owner>mathias@chromium.org</owner> <owner>yangguo@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/disk/histograms.xml b/tools/metrics/histograms/metadata/disk/histograms.xml index 6d7c2da6..76326c82 100644 --- a/tools/metrics/histograms/metadata/disk/histograms.xml +++ b/tools/metrics/histograms/metadata/disk/histograms.xml
@@ -34,7 +34,7 @@ </histogram> <histogram name="DiskCache.0.TotalIOTimeRead" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jam@chromium.org</owner> <owner>swarm-team@google.com</owner> <summary> @@ -45,7 +45,7 @@ </histogram> <histogram name="DiskCache.0.TotalIOTimeWrite" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jam@chromium.org</owner> <owner>swarm-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/download/histograms.xml b/tools/metrics/histograms/metadata/download/histograms.xml index 7945c78..1d4c3ddd 100644 --- a/tools/metrics/histograms/metadata/download/histograms.xml +++ b/tools/metrics/histograms/metadata/download/histograms.xml
@@ -63,7 +63,7 @@ </variants> <histogram name="Download.ApiFunctions" enum="DownloadFunctions" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>dtrainor@chromium.org</owner> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> @@ -1152,7 +1152,7 @@ </histogram> <histogram name="Download.Session.IsDownloadBubbleShowingWhenSession{Status}" - enum="BooleanShowing" expires_after="2023-10-18"> + enum="BooleanShowing" expires_after="2024-02-20"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/enterprise/histograms.xml b/tools/metrics/histograms/metadata/enterprise/histograms.xml index b40bbaf8..1875e2d 100644 --- a/tools/metrics/histograms/metadata/enterprise/histograms.xml +++ b/tools/metrics/histograms/metadata/enterprise/histograms.xml
@@ -198,7 +198,7 @@ <histogram name="Enterprise.AutoEnrollmentHashDanceSuccessTime{EnterpriseAutoEnrollmentType}" - units="ms" expires_after="2023-12-01"> + units="ms" expires_after="2024-02-20"> <owner>sergiyb@chromium.org</owner> <owner>igorcov@chromium.org</owner> <owner>chromeos-commercial-remote-management@google.com</owner> @@ -227,7 +227,7 @@ <histogram name="Enterprise.AutoEnrollmentProtocolTime{EnterpriseAutoEnrollmentType}" - units="ms" expires_after="2023-12-01"> + units="ms" expires_after="2024-02-20"> <owner>sergiyb@chromium.org</owner> <owner>igorcov@chromium.org</owner> <owner>chromeos-commercial-remote-management@google.com</owner> @@ -244,7 +244,7 @@ <histogram name="Enterprise.AutoEnrollmentPsmDmServerRequestStatus{EnterpriseAutoEnrollmentType}" - enum="EnterpriseDeviceManagementStatus" expires_after="2023-12-01"> + enum="EnterpriseDeviceManagementStatus" expires_after="2024-02-20"> <owner>sergiyb@chromium.org</owner> <owner>igorcov@chromium.org</owner> <owner>chromeos-commercial-remote-management@google.com</owner> @@ -263,7 +263,7 @@ <histogram name="Enterprise.AutoEnrollmentPsmRequestNetworkErrorCode{EnterpriseAutoEnrollmentType}" - enum="NetErrorCodes" expires_after="2023-12-01"> + enum="NetErrorCodes" expires_after="2024-02-20"> <owner>sergiyb@chromium.org</owner> <owner>igorcov@chromium.org</owner> <owner>chromeos-commercial-remote-management@google.com</owner> @@ -282,7 +282,7 @@ <histogram name="Enterprise.AutoEnrollmentPsmResult{EnterpriseAutoEnrollmentType}" - enum="PsmResult" expires_after="2023-12-01"> + enum="PsmResult" expires_after="2024-02-20"> <owner>sergiyb@chromium.org</owner> <owner>igorcov@chromium.org</owner> <owner>chromeos-commercial-remote-management@google.com</owner> @@ -319,7 +319,7 @@ <histogram name="Enterprise.AutoEnrollmentRequestStatus{EnterpriseAutoEnrollmentType}" - enum="EnterpriseDeviceManagementStatus" expires_after="2023-12-01"> + enum="EnterpriseDeviceManagementStatus" expires_after="2024-02-20"> <owner>sergiyb@chromium.org</owner> <owner>igorcov@chromium.org</owner> <owner>chromeos-commercial-remote-management@google.com</owner> @@ -364,7 +364,7 @@ </histogram> <histogram name="Enterprise.BrowserSigninPolicy" - enum="EnterpriseBrowserSigninPolicy" expires_after="2023-12-17"> + enum="EnterpriseBrowserSigninPolicy" expires_after="2024-02-20"> <owner>alexwchen@chromium.org</owner> <owner>cbe-eng@google.com</owner> <summary> @@ -658,7 +658,7 @@ <histogram name="Enterprise.DeviceRemoteCommand.Executed{Enterprise_RemoteCommandType}" - enum="RemoteCommandExecutionStatus" expires_after="2023-12-01"> + enum="RemoteCommandExecutionStatus" expires_after="2024-02-20"> <owner>asumaneev@google.com</owner> <owner>chromeos-commercial-remote-management@google.com</owner> <summary> @@ -1638,7 +1638,7 @@ </histogram> <histogram name="Enterprise.DMServerRequestSuccess{EnterpriseDMServerRequest}" - enum="EnterpriseDMServerRequestSuccess" expires_after="2023-12-01"> + enum="EnterpriseDMServerRequestSuccess" expires_after="2024-02-20"> <owner>rbock@google.com</owner> <owner>chromeos-commercial-remote-management@google.com</owner> <owner>managed-devices@google.com</owner> @@ -2310,7 +2310,7 @@ </histogram> <histogram name="Enterprise.PlatformAuth.GetAuthData.{Result}Time" units="ms" - expires_after="2023-10-31"> + expires_after="2024-02-20"> <owner>igorruvinov@chromium.org</owner> <owner>zmin@chromium.org</owner> <summary> @@ -2350,7 +2350,7 @@ </histogram> <histogram name="Enterprise.Policies.{PolicyLevel}" enum="EnterprisePolicies" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>zmin@chromium.org</owner> <owner>qiutanw@google.com</owner> <owner>chromeos-commercial-remote-management@google.com</owner> @@ -2493,7 +2493,7 @@ </histogram> <histogram name="Enterprise.ProfileSeparation.DasherPolicyFetch.HttpResponse" - enum="HttpResponseCode" expires_after="2023-09-03"> + enum="HttpResponseCode" expires_after="2024-07-01"> <owner>ydago@chromium.org</owner> <owner>zmin@chromium.org</owner> <summary> @@ -2505,7 +2505,7 @@ </histogram> <histogram name="Enterprise.ProfileSeparation.DasherPolicyFetch.NetworkError" - enum="NetErrorCodes" expires_after="2023-10-08"> + enum="NetErrorCodes" expires_after="2024-07-01"> <owner>ydago@chromium.org</owner> <owner>zmin@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/extensions/histograms.xml b/tools/metrics/histograms/metadata/extensions/histograms.xml index dbc6740..124d35d2 100644 --- a/tools/metrics/histograms/metadata/extensions/histograms.xml +++ b/tools/metrics/histograms/metadata/extensions/histograms.xml
@@ -773,7 +773,7 @@ </histogram> <histogram name="Extensions.DeclarativeNetRequest.LoadRulesetResult" - enum="LoadRulesetResult" expires_after="2023-11-12"> + enum="LoadRulesetResult" expires_after="2024-02-20"> <owner>kelvinjiang@chromium.org</owner> <owner>src/extensions/OWNERS</owner> <summary> @@ -1021,7 +1021,7 @@ </histogram> <histogram name="Extensions.DidCreateScriptContext_Unblessed" units="ms" - expires_after="2023-12-15"> + expires_after="2024-02-20"> <owner>rdevlin.cronin@chromium.org</owner> <owner>extensions-core@chromium.org</owner> <summary> @@ -1828,7 +1828,7 @@ </histogram> <histogram name="Extensions.ForceInstalledFailureSessionType{FailureReason}" - enum="SessionType" expires_after="2023-12-01"> + enum="SessionType" expires_after="2024-02-20"> <owner>vkovalova@google.com</owner> <owner>burunduk@chromium.org</owner> <owner>managed-devices@google.com</owner> @@ -1992,7 +1992,7 @@ </histogram> <histogram name="Extensions.ForceInstalledTime{ExtensionInstallStages}" - units="ms" expires_after="2023-12-01"> + units="ms" expires_after="2024-02-20"> <owner>vkovalova@google.com</owner> <owner>burunduk@chromium.org</owner> <owner>managed-devices@google.com</owner> @@ -2038,7 +2038,7 @@ </histogram> <histogram name="Extensions.ForceInstalled{ErrorType}FetchTries" - units="retries" expires_after="2023-12-01"> + units="retries" expires_after="2024-02-20"> <owner>vkovalova@google.com</owner> <owner>burunduk@chromium.org</owner> <owner>managed-devices@google.com</owner> @@ -2060,7 +2060,7 @@ </histogram> <histogram name="Extensions.ForceInstalled{ErrorType}NetworkErrorCode" - enum="NetErrorCodes" expires_after="2023-12-01"> + enum="NetErrorCodes" expires_after="2024-02-20"> <owner>vkovalova@google.com</owner> <owner>burunduk@chromium.org</owner> <owner>managed-devices@google.com</owner> @@ -2353,7 +2353,7 @@ </histogram> <histogram name="Extensions.GuestView.ChangeOwnerWebContentsOnAttach" - enum="Boolean" expires_after="2023-12-17"> + enum="Boolean" expires_after="2024-02-20"> <owner>mcnee@chromium.org</owner> <owner>src/components/guest_view/OWNERS</owner> <summary> @@ -3661,7 +3661,7 @@ </summary> </histogram> -<histogram name="Extensions.NetworkDelay" units="ms" expires_after="2023-12-15"> +<histogram name="Extensions.NetworkDelay" units="ms" expires_after="2024-02-20"> <owner>rdevlin.cronin@chromium.org</owner> <owner>kelvinjiang@chromium.org</owner> <owner>src/extensions/OWNERS</owner> @@ -4293,7 +4293,7 @@ <histogram name="Extensions.SettingsOverridden.BackToGoogleNtpOverriddenDialogResult" - enum="SettingsOverriddenDialogResult" expires_after="2023-12-15"> + enum="SettingsOverriddenDialogResult" expires_after="2024-02-20"> <owner>rdevlin.cronin@chromium.org</owner> <owner>extensions-core@chromium.org</owner> <summary> @@ -4307,7 +4307,7 @@ <histogram name="Extensions.SettingsOverridden.BackToGoogleSearchOverriddenDialogResult" - enum="SettingsOverriddenDialogResult" expires_after="2023-12-15"> + enum="SettingsOverriddenDialogResult" expires_after="2024-02-20"> <owner>rdevlin.cronin@chromium.org</owner> <owner>extensions-core@chromium.org</owner> <summary> @@ -4583,7 +4583,7 @@ <histogram name="Extensions.WebRequest.BeforeRequestListenerEvaluationTimeInMicroseconds.{HandlerTypes}" - units="microseconds" expires_after="2023-12-01"> + units="microseconds" expires_after="2024-02-20"> <owner>rdevlin.cronin@chromium.org</owner> <owner>src/extensions/OWNERS</owner> <summary> @@ -4914,7 +4914,7 @@ <histogram name="Extensions.{ExtensionSource}ForceInstalled{ErrorType}HttpErrorCode2" - enum="HttpResponseCode" expires_after="2023-12-01"> + enum="HttpResponseCode" expires_after="2024-02-20"> <owner>vkovalova@google.com</owner> <owner>burunduk@chromium.org</owner> <owner>managed-devices@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/families/histograms.xml b/tools/metrics/histograms/metadata/families/histograms.xml index 4f08bb7..4a66fcf7 100644 --- a/tools/metrics/histograms/metadata/families/histograms.xml +++ b/tools/metrics/histograms/metadata/families/histograms.xml
@@ -30,7 +30,7 @@ <histograms> <histogram name="AddSupervisionDialog.Enrollment" - enum="AddSupervisionEnrollment" expires_after="2023-12-12"> + enum="AddSupervisionEnrollment" expires_after="2024-02-20"> <owner>courtneywong@chromium.org</owner> <owner>michaelpg@chromium.org</owner> <owner>cros-families-eng@google.com</owner> @@ -149,7 +149,7 @@ </histogram> <histogram name="ChromeOS.FamilyLinkUser.ParentAccess.FlowResult.{FlowType}" - enum="ParentAccessFlowResult" expires_after="2023-12-12"> + enum="ParentAccessFlowResult" expires_after="2024-02-20"> <owner>courtneywong@chromium.org</owner> <owner>cros-families-eng@google.com</owner> <summary> @@ -167,7 +167,7 @@ </histogram> <histogram name="ChromeOS.FamilyLinkUser.ParentAccessWidgetError.{FlowType}" - enum="FamilyLinkUserParentAccessWidgetError" expires_after="2023-12-12"> + enum="FamilyLinkUserParentAccessWidgetError" expires_after="2024-02-20"> <owner>agawronska@chromium.org</owner> <owner>cros-families-eng@google.com</owner> <summary> @@ -185,7 +185,7 @@ <histogram name="ChromeOS.FamilyLinkUser.ParentAccessWidgetShowDialogError.{FlowType}" enum="FamilyLinkUserParentAccessWidgetShowDialogError" - expires_after="2023-12-12"> + expires_after="2024-02-20"> <owner>agawronska@chromium.org</owner> <owner>cros-families-eng@google.com</owner> <summary> @@ -352,7 +352,7 @@ </histogram> <histogram name="FamilyLinkUser.CreatePermissionRequest.Status" - enum="SupervisedUserProtoFetcherStatus" expires_after="2023-11-01"> + enum="SupervisedUserProtoFetcherStatus" expires_after="2024-02-20"> <owner>tju@google.com</owner> <owner>anthie@google.com</owner> <owner>chrome-kids-eng@google.com</owner> @@ -630,7 +630,7 @@ </histogram> <histogram name="FamilyUser.{AppType}AppsCount2" units="Number of Apps" - expires_after="2023-12-12"> + expires_after="2024-02-20"> <owner>courtneywong@chromium.org</owner> <owner>cros-families-eng@google.com</owner> <summary> @@ -654,7 +654,7 @@ </histogram> <histogram name="FamilyUser.{ExtensionStatus}ExtensionsCount2" - units="Number of Extensions" expires_after="2023-12-12"> + units="Number of Extensions" expires_after="2024-02-20"> <owner>courtneywong@chromium.org</owner> <owner>cros-families-eng@google.com</owner> <summary> @@ -737,7 +737,7 @@ </histogram> <histogram name="ManagedUsers.RequestPermissionSource" - enum="ManagedUserURLRequestPermissionSource" expires_after="2023-12-12"> + enum="ManagedUserURLRequestPermissionSource" expires_after="2024-02-20"> <owner>michaelpg@chromium.org</owner> <owner>yilkal@chromium.org</owner> <owner>cros-families-eng@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/feature_engagement/histograms.xml b/tools/metrics/histograms/metadata/feature_engagement/histograms.xml index af40f52..65bb844 100644 --- a/tools/metrics/histograms/metadata/feature_engagement/histograms.xml +++ b/tools/metrics/histograms/metadata/feature_engagement/histograms.xml
@@ -543,7 +543,7 @@ </histogram> <histogram name="InProductHelp.TextBubble.ShownTime" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>haileywang@chromium.org</owner> <owner>shaktisahu@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/file/histograms.xml b/tools/metrics/histograms/metadata/file/histograms.xml index 3380cf5..69f7cdc 100644 --- a/tools/metrics/histograms/metadata/file/histograms.xml +++ b/tools/metrics/histograms/metadata/file/histograms.xml
@@ -405,7 +405,7 @@ <histogram name="FileBrowser.DriveOfflineHostedCount.{OpenIsAvailable}.AvailablePercent" - units="%" expires_after="2023-10-08"> + units="%" expires_after="2024-02-20"> <owner>joelhockey@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -420,7 +420,7 @@ <histogram name="FileBrowser.DriveOfflineHostedCount.{OpenIsAvailable}.{DocsOfflineCounts}" - units="Files" expires_after="2023-10-08"> + units="Files" expires_after="2024-02-20"> <owner>joelhockey@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -443,7 +443,7 @@ </histogram> <histogram name="FileBrowser.DriveOfflineOpen.{OpenIsAvailable}" - enum="ViewFileType" expires_after="2023-10-08"> + enum="ViewFileType" expires_after="2024-02-20"> <owner>joelhockey@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -471,7 +471,7 @@ </histogram> <histogram name="FileBrowser.FileSystemProviderMounted" - enum="FileSystemProviderMountType" expires_after="2023-12-17"> + enum="FileSystemProviderMountType" expires_after="2024-02-20"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -521,7 +521,7 @@ </histogram> <histogram name="FileBrowser.FormatFileSystemType" - enum="FileManagerFormatFileSystemType" expires_after="2023-12-17"> + enum="FileManagerFormatFileSystemType" expires_after="2024-02-20"> <owner>austinct@chromium.org</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -751,7 +751,7 @@ </histogram> <histogram name="FileBrowser.Load{FileBrowserLoad}" units="ms" - expires_after="M120"> + expires_after="2024-02-20"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -1390,7 +1390,7 @@ </histogram> <histogram name="FileBrowser.Search.{Source}.Latency" units="ms" - expires_after="M120"> + expires_after="2024-02-20"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -1554,7 +1554,7 @@ </histogram> <histogram name="FileBrowser.ViewingRootType" enum="FileManagerRootType" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -1564,7 +1564,7 @@ </histogram> <histogram name="FileBrowser.ViewingRootType.Offline" - enum="FileManagerRootType" expires_after="2023-12-17"> + enum="FileManagerRootType" expires_after="2024-02-20"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -1575,7 +1575,7 @@ </histogram> <histogram name="FileBrowser.ViewingRootType.Online" enum="FileManagerRootType" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -1596,7 +1596,7 @@ </histogram> <histogram name="FileBrowser.ViewingTaskType.Offline" - enum="FileManagerTaskType" expires_after="2023-12-17"> + enum="FileManagerTaskType" expires_after="2024-02-20"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -1607,7 +1607,7 @@ </histogram> <histogram name="FileBrowser.ViewingTaskType.Online" enum="FileManagerTaskType" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -1678,7 +1678,7 @@ </histogram> <histogram name="Unzipper.DetectEncoding.Result" enum="ContentEncoding" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/gcm/histograms.xml b/tools/metrics/histograms/metadata/gcm/histograms.xml index 184ac8e..25f75df2 100644 --- a/tools/metrics/histograms/metadata/gcm/histograms.xml +++ b/tools/metrics/histograms/metadata/gcm/histograms.xml
@@ -80,7 +80,7 @@ </histogram> <histogram name="GCM.DeliveredToAppHandler{AppHandler}" enum="BooleanDelivered" - expires_after="2023-10-19"> + expires_after="2024-02-20"> <owner>peter@chromium.org</owner> <owner>rushans@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/gpu/histograms.xml b/tools/metrics/histograms/metadata/gpu/histograms.xml index 4c4ffe8..21740b6bd 100644 --- a/tools/metrics/histograms/metadata/gpu/histograms.xml +++ b/tools/metrics/histograms/metadata/gpu/histograms.xml
@@ -290,7 +290,7 @@ </histogram> <histogram name="GPU.ANGLE.MetalShader.CacheHitCount" units="count" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>sky@chromium.org</owner> <owner>angle-team@google.com</owner> <summary> @@ -301,7 +301,7 @@ </histogram> <histogram name="GPU.ANGLE.MetalShader.CacheMissCount" units="count" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>sky@chromium.org</owner> <owner>angle-team@google.com</owner> <summary> @@ -311,7 +311,7 @@ </histogram> <histogram name="GPU.ANGLE.MetalShaderInBlobCache" enum="Boolean" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>sky@chromium.org</owner> <owner>angle-team@google.com</owner> <summary> @@ -716,7 +716,7 @@ </histogram> <histogram name="GPU.EstablishGpuChannelSyncTime" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>cduvall@chromium.org</owner> <owner>jam@chromium.org</owner> <summary> @@ -773,7 +773,7 @@ </histogram> <histogram name="GPU.GPUInitializationTime.V4" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>magchen@chromium.org</owner> <owner>zmo@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> @@ -844,7 +844,7 @@ </histogram> <histogram name="GPU.HardwareAccelerationModeEnabled" enum="BooleanEnabled" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>zmo@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1037,7 +1037,7 @@ </histogram> <histogram name="Gpu.MetalShaderCache.NumEntriesInCache" units="count" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>sky@chromium.org</owner> <owner>angle-team@google.com</owner> <summary> @@ -1047,7 +1047,7 @@ </histogram> <histogram name="Gpu.MetalShaderCache.WaitTime" units="microseconds" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>sky@chromium.org</owner> <owner>angle-team@google.com</owner> <summary> @@ -1228,7 +1228,7 @@ </histogram> <histogram name="GPU.RasterDecoder.TimeToFlush" units="microseconds" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>sky@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1249,7 +1249,7 @@ </histogram> <histogram name="GPU.ReportOnlyModeStatusAtHang" enum="BooleanEnabled" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>spvw@chromium.org</owner> <owner>chrome-catan@google.com</owner> <summary> @@ -1609,7 +1609,7 @@ </histogram> <histogram name="GPU.WebGPU.Create{Module}Success" enum="Boolean" - expires_after="2023-10-20"> + expires_after="2024-02-20"> <owner>enga@chromium.org</owner> <owner>mdb.webgpu-dev-team@google.com</owner> <summary> @@ -1620,7 +1620,7 @@ </histogram> <histogram name="GPU.WebGPU.Create{Module}US" units="microseconds" - expires_after="2023-10-20"> + expires_after="2024-02-20"> <owner>enga@chromium.org</owner> <owner>mdb.webgpu-dev-team@google.com</owner> <summary> @@ -1864,7 +1864,7 @@ </histogram> <histogram name="Viz.DisplayCompositor.OverlaySwitchInterval" units="ms" - expires_after="2023-12-10"> + expires_after="2024-02-20"> <owner>petermcneeley@chromium.org</owner> <owner>khaslett@chromium.org</owner> <owner>graphics-dev@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/history/histograms.xml b/tools/metrics/histograms/metadata/history/histograms.xml index 74b4748..f7a9b51e 100644 --- a/tools/metrics/histograms/metadata/history/histograms.xml +++ b/tools/metrics/histograms/metadata/history/histograms.xml
@@ -859,7 +859,7 @@ <histogram name="History.Clusters.Backend.FilterClusterProcessor.ClusterFilterReason{Source}" - enum="ClusterFilterReason" expires_after="2023-12-10"> + enum="ClusterFilterReason" expires_after="2024-02-20"> <owner>sophiechang@chromium.org</owner> <owner>chrome-journeys@google.com</owner> <component>UI>Browser>Journeys</component> @@ -874,7 +874,7 @@ <histogram name="History.Clusters.Backend.FilterClusterProcessor.NumClusters.{Segment}{Source}" - units="counts" expires_after="2023-12-10"> + units="counts" expires_after="2024-02-20"> <owner>sophiechang@chromium.org</owner> <owner>chrome-journeys@google.com</owner> <component>UI>Browser>Journeys</component> @@ -1886,7 +1886,7 @@ </histogram> <histogram name="History.Clusters.WebUISessionDuration" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>tommycli@chromium.org</owner> <owner>chrome-journeys@google.com</owner> <component>UI>Browser>Journeys</component> @@ -2138,7 +2138,7 @@ </histogram> <histogram name="History.DomainCount7Day_V3" units="domains" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>mpearson@chromium.org</owner> <owner>mjzhang@chromium.org</owner> <owner>chrome-analysis-team@google.com</owner> @@ -2332,7 +2332,7 @@ </histogram> <histogram name="History.InMemoryURLHistoryItems" units="items" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>mpearson@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> <component>UI>Browser>History</component> @@ -2429,7 +2429,7 @@ </histogram> <histogram name="History.MonthlyURLCount" units="urls" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>mpearson@chromium.org</owner> <owner>sky@chromium.org</owner> <component>UI>Browser>History</component>
diff --git a/tools/metrics/histograms/metadata/input/histograms.xml b/tools/metrics/histograms/metadata/input/histograms.xml index e9dcd3e..0751506f 100644 --- a/tools/metrics/histograms/metadata/input/histograms.xml +++ b/tools/metrics/histograms/metadata/input/histograms.xml
@@ -180,7 +180,7 @@ </histogram> <histogram name="InputMethod.Assistive.AutocorrectV2.Internal.PkState" - enum="IMEAutocorrectInternalStates" expires_after="2023-12-17"> + enum="IMEAutocorrectInternalStates" expires_after="2024-02-20"> <owner>mehrab@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -258,7 +258,7 @@ </histogram> <histogram name="InputMethod.Assistive.AutocorrectV2.Latency.ExitField" - units="ms" expires_after="2023-12-17"> + units="ms" expires_after="2024-02-20"> <owner>mehrab@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -332,7 +332,7 @@ <histogram name="InputMethod.Assistive.AutocorrectV2.PkUserPreference.{Language}" - enum="IMEAutocorrectPreference" expires_after="2023-12-01"> + enum="IMEAutocorrectPreference" expires_after="2024-02-20"> <owner>mehrab@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -451,7 +451,7 @@ </histogram> <histogram name="InputMethod.Assistive.AutocorrectV2.SuggestionProvider.Pk" - enum="IMEAutocorrectSuggestionProvider" expires_after="2023-12-17"> + enum="IMEAutocorrectSuggestionProvider" expires_after="2024-02-20"> <owner>curtismcmullan@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -475,7 +475,7 @@ <histogram name="InputMethod.Assistive.AutocorrectV2.UserPrefChange.{Language}.{Type}" - enum="IMEAutocorrectPrefStateTransition" expires_after="2023-12-01"> + enum="IMEAutocorrectPrefStateTransition" expires_after="2024-02-20"> <owner>curtismcmullan@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -527,7 +527,7 @@ </histogram> <histogram name="InputMethod.Assistive.Coverage" enum="IMEAssistiveAction" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jiwan@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -642,7 +642,7 @@ </histogram> <histogram name="InputMethod.Assistive.Match" enum="IMEAssistiveAction" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jiwan@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -1239,7 +1239,7 @@ </histogram> <histogram name="InputMethod.PhysicalKeyboard.LongpressDiacritics.Action" - enum="IMEPKLongpressDiacriticAction" expires_after="2023-12-17"> + enum="IMEPKLongpressDiacriticAction" expires_after="2024-02-20"> <owner>jhtin@chromium.org</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -1629,7 +1629,7 @@ <histogram name="InputMethod.VirtualKeyboard.Handwriting.DWServiceCallbackFailed" - enum="Boolean" expires_after="2023-12-17"> + enum="Boolean" expires_after="2024-02-20"> <owner>alexmitra@chromium.org</owner> <owner>peconn@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/installer/histograms.xml b/tools/metrics/histograms/metadata/installer/histograms.xml index 9d25964..f07a65e 100644 --- a/tools/metrics/histograms/metadata/installer/histograms.xml +++ b/tools/metrics/histograms/metadata/installer/histograms.xml
@@ -175,7 +175,7 @@ </histogram> <histogram name="Installer.PowerwashCount" units="powerwashes" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>kimjae@chromium.org</owner> <owner>chromeos-core-services@chromium.org</owner> <summary> @@ -216,7 +216,7 @@ </histogram> <histogram name="Installer.Recovery.Reason" enum="ChromeOSRecoveryReason" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>kimjae@chromium.org</owner> <owner>chromeos-core-services@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/ios/histograms.xml b/tools/metrics/histograms/metadata/ios/histograms.xml index 2c69e3e5..9aec9d2 100644 --- a/tools/metrics/histograms/metadata/ios/histograms.xml +++ b/tools/metrics/histograms/metadata/ios/histograms.xml
@@ -553,7 +553,7 @@ </histogram> <histogram name="IOS.DefaultBrowserPromo.NonModal.{Impression}" - enum="IOSDefaultBrowserPromoNonModalAction" expires_after="2023-12-01"> + enum="IOSDefaultBrowserPromoNonModalAction" expires_after="2024-02-20"> <owner>sebsg@chromium.org</owner> <owner>nicolasmacbeth@google.com</owner> <owner>bling-get-set-up@google.com</owner> @@ -576,7 +576,7 @@ </histogram> <histogram name="IOS.DefaultBrowserPromo.NonModal.{PromoType}" - enum="IOSDefaultBrowserPromoNonModalAction" expires_after="2023-12-01"> + enum="IOSDefaultBrowserPromoNonModalAction" expires_after="2024-02-20"> <owner>sebsg@chromium.org</owner> <owner>bling-get-set-up@google.com</owner> <summary> @@ -1267,7 +1267,7 @@ </histogram> <histogram name="IOS.MainFrameNavigationIsInBrowserLockdownMode" enum="Boolean" - expires_after="2023-11-23"> + expires_after="2024-02-20"> <owner>joemerramos@chromium.org</owner> <owner>ajuma@chromium.org</owner> <owner>bling-fundamentals@google.com</owner> @@ -2678,7 +2678,7 @@ </summary> </histogram> -<histogram name="IOS.TabGrid.CloseTabs" units="Tabs" expires_after="2023-11-01"> +<histogram name="IOS.TabGrid.CloseTabs" units="Tabs" expires_after="2024-02-20"> <owner>ewannpv@chromium.org</owner> <owner>gambard@chromium.org</owner> <owner>bling-team@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/kerberos/histograms.xml b/tools/metrics/histograms/metadata/kerberos/histograms.xml index 4fd048df..0f023c97 100644 --- a/tools/metrics/histograms/metadata/kerberos/histograms.xml +++ b/tools/metrics/histograms/metadata/kerberos/histograms.xml
@@ -154,7 +154,7 @@ </histogram> <histogram name="Kerberos.Result.ListAccounts" enum="KerberosErrorType" - expires_after="M120"> + expires_after="2024-02-20"> <owner>fsandrade@chromium.org</owner> <owner>src/chrome/browser/ash/kerberos/OWNERS</owner> <summary> @@ -184,7 +184,7 @@ </histogram> <histogram name="Kerberos.Result.ValidateConfig" enum="KerberosErrorType" - expires_after="M120"> + expires_after="2024-02-20"> <owner>fsandrade@chromium.org</owner> <owner>src/chrome/browser/ash/kerberos/OWNERS</owner> <summary> @@ -195,7 +195,7 @@ </histogram> <histogram name="Kerberos.ValidateConfigErrorCode" - enum="KerberosConfigErrorCode" expires_after="M120"> + enum="KerberosConfigErrorCode" expires_after="2024-02-20"> <owner>fsandrade@chromium.org</owner> <owner>src/chrome/browser/ash/kerberos/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/language/histograms.xml b/tools/metrics/histograms/metadata/language/histograms.xml index 190a8f4..149936b5 100644 --- a/tools/metrics/histograms/metadata/language/histograms.xml +++ b/tools/metrics/histograms/metadata/language/histograms.xml
@@ -457,7 +457,7 @@ </histogram> <histogram name="LanguageUsage.ULP.Initiation.Status{AccountType}" - enum="ULPInitiationStatus" expires_after="2023-12-10"> + enum="ULPInitiationStatus" expires_after="2024-02-20"> <owner>perrier@google.com</owner> <owner>chrome-language@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/local/histograms.xml b/tools/metrics/histograms/metadata/local/histograms.xml index 0d754ff2..aad45a6 100644 --- a/tools/metrics/histograms/metadata/local/histograms.xml +++ b/tools/metrics/histograms/metadata/local/histograms.xml
@@ -57,7 +57,7 @@ </histogram> <histogram name="LocalSearchService.{IndexId}AddOrUpdateLatency" units="ms" - expires_after="2023-11-30"> + expires_after="2024-02-20"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <summary> @@ -96,7 +96,7 @@ </histogram> <histogram name="LocalSearchService.{IndexId}DailySearch" units="count" - expires_after="2023-11-30"> + expires_after="2024-02-20"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <summary> @@ -141,7 +141,7 @@ </histogram> <histogram name="LocalSearchService.{IndexId}NumberResults" units="count" - expires_after="2023-11-30"> + expires_after="2024-02-20"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <summary> @@ -153,7 +153,7 @@ </histogram> <histogram name="LocalSearchService.{IndexId}NumberSearchPerformedDone" - enum="Boolean" expires_after="2023-11-30"> + enum="Boolean" expires_after="2024-02-20"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <summary> @@ -166,7 +166,7 @@ </histogram> <histogram name="LocalSearchService.{IndexId}ResponseStatus" - enum="LocalSearchServiceResponseStatus" expires_after="2023-11-30"> + enum="LocalSearchServiceResponseStatus" expires_after="2024-02-20"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <summary> @@ -178,7 +178,7 @@ </histogram> <histogram name="LocalSearchService.{IndexId}SearchLatency" units="ms" - expires_after="2023-11-30"> + expires_after="2024-02-20"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <summary> @@ -246,7 +246,7 @@ </histogram> <histogram name="LocalStorage.MojoTimeToPrimeFor{LocalStorageSizes}" units="ms" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>ayui@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/login/histograms.xml b/tools/metrics/histograms/metadata/login/histograms.xml index c78d9504..367a40b 100644 --- a/tools/metrics/histograms/metadata/login/histograms.xml +++ b/tools/metrics/histograms/metadata/login/histograms.xml
@@ -153,7 +153,7 @@ </histogram> <histogram name="Login.Flow.{UserVisibility}.{UserCount}" - enum="LoginFlowUserLoginType" expires_after="2023-12-01"> + enum="LoginFlowUserLoginType" expires_after="2024-02-20"> <owner>anastasiian@chromium.org</owner> <owner>cros-lurs@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/media/histograms.xml b/tools/metrics/histograms/metadata/media/histograms.xml index b50c920..bec529a 100644 --- a/tools/metrics/histograms/metadata/media/histograms.xml +++ b/tools/metrics/histograms/metadata/media/histograms.xml
@@ -642,7 +642,7 @@ </histogram> <histogram name="Media.Audio.InputVolumeStartsAtZeroWin" - enum="BooleanVolumeZero" expires_after="2023-12-17"> + enum="BooleanVolumeZero" expires_after="2024-02-20"> <owner>henrika@chromium.org</owner> <owner>media-dev-uma@chromium.org</owner> <owner>webrtc-audio-uma@google.com</owner> @@ -1273,7 +1273,7 @@ </histogram> <histogram name="Media.AudioCapturerAudioGlitches" enum="AudioGlitchResult" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>olka@chromium.org</owner> <owner>gustaf@chromium.org</owner> <owner>webrtc-audio-uma@google.com</owner> @@ -1691,7 +1691,7 @@ <histogram name="Media.AudioRendererMissedDeadline3{Mixing}{Duration}{LatencyTag}" - units="misses" expires_after="2023-10-13"> + units="misses" expires_after="2024-02-20"> <owner>fhernqvist@google.com</owner> <owner>olka@chromium.org</owner> <owner>dalecurtis@chromium.org</owner> @@ -2118,7 +2118,7 @@ </histogram> <histogram name="Media.DroppedFrameCount2.{RendererType}.{ClearOrEncrypted}" - units="units" expires_after="2023-12-08"> + units="units" expires_after="2024-02-20"> <owner>dalecurtis@chromium.org</owner> <owner>frankli@microsoft.com</owner> <owner>media-dev-uma@chromium.org</owner> @@ -3303,7 +3303,7 @@ </histogram> <histogram name="Media.HasAcceleratedVideoDecode.{CodecType}" - enum="BooleanSupported" expires_after="2023-12-01"> + enum="BooleanSupported" expires_after="2024-02-20"> <owner>dalecurtis@chromium.org</owner> <owner>media-dev-uma@chromium.org</owner> <summary> @@ -3725,7 +3725,7 @@ </histogram> <histogram name="Media.MicrophoneMuted" enum="MicrophoneMuteResult" - expires_after="2023-11-12"> + expires_after="2024-02-20"> <owner>henrika@chromium.org</owner> <owner>webrtc-audio@google.com</owner> <summary> @@ -4618,7 +4618,7 @@ </histogram> <histogram name="Media.RTCVideoDecoderFallbackReason.{Codecs}" - enum="RTCVideoDecoderFallbackReason" expires_after="2023-10-10"> + enum="RTCVideoDecoderFallbackReason" expires_after="2024-02-20"> <owner>kron@chromium.org</owner> <owner>webrtc-video@google.com</owner> <summary> @@ -5971,7 +5971,7 @@ </histogram> <histogram name="Media.WebMediaPlayerImpl.HLS.HasAccessControl" enum="Boolean" - expires_after="2023-11-30"> + expires_after="2024-02-20"> <owner>tmathmeyer@chromium.org</owner> <owner>tguilbert@chromium.org</owner> <owner>media-dev-uma@chromium.org</owner> @@ -5984,7 +5984,7 @@ </histogram> <histogram name="Media.WebMediaPlayerImpl.HLS.IsCorsCrossOrigin" enum="Boolean" - expires_after="2023-11-30"> + expires_after="2024-02-20"> <owner>tmathmeyer@chromium.org</owner> <owner>tguilbert@chromium.org</owner> <owner>media-dev-uma@chromium.org</owner> @@ -5997,7 +5997,7 @@ </histogram> <histogram name="Media.WebMediaPlayerImpl.HLS.IsMixedContent" enum="Boolean" - expires_after="2023-11-30"> + expires_after="2024-02-20"> <owner>cassew@chromium.org</owner> <owner>tguilbert@chromium.org</owner> <owner>media-dev-uma@chromium.org</owner> @@ -6010,7 +6010,7 @@ </histogram> <histogram name="Media.WebMediaPlayerImpl.HLS{Variant}.MimeType" - enum="MimeTypeOfHlsManifest" expires_after="2023-11-30"> + enum="MimeTypeOfHlsManifest" expires_after="2024-02-20"> <owner>tmathmeyer@chromium.org</owner> <owner>lukasza@chromium.org</owner> <owner>media-dev-uma@chromium.org</owner> @@ -6045,7 +6045,7 @@ <histogram name="Media.WebmMuxer.DidAdjustTimestamp.{StreamTypesRecorded}.{Domain}" - enum="Boolean" expires_after="2023-11-26"> + enum="Boolean" expires_after="2024-02-20"> <owner>handellm@google.com</owner> <owner>video-performance-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/memory/histograms.xml b/tools/metrics/histograms/metadata/memory/histograms.xml index dbf5af5..17567e5e 100644 --- a/tools/metrics/histograms/metadata/memory/histograms.xml +++ b/tools/metrics/histograms/metadata/memory/histograms.xml
@@ -159,7 +159,7 @@ </histogram> <histogram name="HeapProfiling.InProcess.TotalSampledMemory{Process}" - units="MB" expires_after="2023-10-30"> + units="MB" expires_after="2024-02-20"> <owner>joenotcharles@google.com</owner> <owner>etienneb@chromium.org</owner> <owner>chrome-memory@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/navigation/histograms.xml b/tools/metrics/histograms/metadata/navigation/histograms.xml index 205faee1..1990db71 100644 --- a/tools/metrics/histograms/metadata/navigation/histograms.xml +++ b/tools/metrics/histograms/metadata/navigation/histograms.xml
@@ -583,7 +583,7 @@ </histogram> <histogram name="Navigation.DidCommitSameDocumentNavigation.Duration" - units="ms" expires_after="2023-12-17"> + units="ms" expires_after="2024-02-20"> <owner>peilinwang@google.com</owner> <owner>woa-performance-bugs+jank@google.com</owner> <summary> @@ -678,7 +678,7 @@ </histogram> <histogram name="Navigation.EngagementTime.Ratio" units="%" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>estark@chromium.org</owner> <owner>security-enamel@chromium.org</owner> <summary> @@ -688,7 +688,7 @@ </histogram> <histogram name="Navigation.GetFrameHostForNavigation.Duration" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>peilinwang@google.com</owner> <owner>woa-performance-bugs+jank@google.com</owner> <summary> @@ -1254,7 +1254,7 @@ <histogram name="Navigation.Prerender.ActivationCommitDeferTime{PrerenderTriggerType}" - units="ms" expires_after="2023-11-23"> + units="ms" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>chrome-prerendering@chromium.org</owner> <summary> @@ -1415,7 +1415,7 @@ </histogram> <histogram name="Navigation.SuddenTerminationDisabler.{Origins}" - enum="NavigationSuddenTerminationDisabler" expires_after="2023-10-11"> + enum="NavigationSuddenTerminationDisabler" expires_after="2024-02-20"> <owner>fergal@chromium.org</owner> <owner>rakina@chromium.org</owner> <summary> @@ -1686,7 +1686,7 @@ <histogram name="Prerender.Experimental.ActivationNavigationParamsMatch{PrerenderTriggerType}" - enum="PrerenderActivationNavigationParamsMatch" expires_after="2023-12-03"> + enum="PrerenderActivationNavigationParamsMatch" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>chrome-prerendering@google.com</owner> <summary> @@ -1699,7 +1699,7 @@ <histogram name="Prerender.Experimental.ActivationTransitionMismatch{PrerenderTriggerType}" - enum="PrerenderActivationTransitionMismatchType" expires_after="2023-10-26"> + enum="PrerenderActivationTransitionMismatchType" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>chrome-prerendering@google.com</owner> <summary> @@ -1831,7 +1831,7 @@ <histogram name="Prerender.Experimental.PrerenderCancelledInterface{PrerenderTriggerType}" - enum="PrerenderCancelledInterface" expires_after="2023-12-05"> + enum="PrerenderCancelledInterface" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>toyoshim@chromium.org</owner> <owner>lingqi@chromium.org</owner> @@ -1845,7 +1845,7 @@ <histogram name="Prerender.Experimental.PrerenderCancelledUnknownInterface{PrerenderTriggerType}" - enum="PrerenderCancelledUnknownInterface" expires_after="2023-12-05"> + enum="PrerenderCancelledUnknownInterface" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>toyoshim@chromium.org</owner> <owner>lingqi@chromium.org</owner> @@ -1894,7 +1894,7 @@ <histogram name="Prerender.Experimental.PrerenderHostFinalStatus{PrerenderTriggerType}" - enum="PrerenderHostFinalStatus" expires_after="2023-12-05"> + enum="PrerenderHostFinalStatus" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>toyoshim@chromium.org</owner> <owner>lingqi@chromium.org</owner> @@ -1908,7 +1908,7 @@ <histogram name="Prerender.Experimental.PrerenderLoadingFailureError{PrerenderTriggerType}" - enum="NetErrorCodes" expires_after="2023-10-31"> + enum="NetErrorCodes" expires_after="2024-02-20"> <owner>lingqi@chromium.org</owner> <owner>chrome-prerendering@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/nearby/histograms.xml b/tools/metrics/histograms/metadata/nearby/histograms.xml index 4c452bd..41aef08 100644 --- a/tools/metrics/histograms/metadata/nearby/histograms.xml +++ b/tools/metrics/histograms/metadata/nearby/histograms.xml
@@ -70,7 +70,7 @@ </histogram> <histogram name="Nearby.Connections.Bluetooth.ClassicMedium.{Operation}.Result" - enum="BooleanSuccess" expires_after="2023-10-08"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>hansenmichael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary>Records the result of {Operation}.</summary> @@ -110,7 +110,7 @@ </histogram> <histogram name="Nearby.Connections.Bluetooth.LEMedium.StopScanning.Result" - enum="BooleanSuccess" expires_after="2023-12-17"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>hansenmichael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary>Records whether BLE scanning has been stopped successfully.</summary> @@ -131,7 +131,7 @@ <histogram name="Nearby.Connections.InstantMessaging.TachyonIceConfigFetcher.CacheHit" - enum="BooleanCacheHit" expires_after="2023-12-17"> + enum="BooleanCacheHit" expires_after="2024-02-20"> <owner>cclem@chromium.org</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -175,7 +175,7 @@ <histogram name="Nearby.Connections.InstantMessaging.{Direction}Express.OAuthTokenFetchResult" - enum="BooleanSuccess" expires_after="2023-10-08"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>hansenmichael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -191,7 +191,7 @@ </histogram> <histogram name="Nearby.Connections.InstantMessaging.{Direction}Express.Result" - enum="BooleanSuccess" expires_after="2023-10-08"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>hansenmichael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -206,7 +206,7 @@ <histogram name="Nearby.Connections.InstantMessaging.{Direction}Express.Result.FailureReason" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2023-10-08"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2024-02-20"> <owner>hansenmichael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -235,7 +235,7 @@ <histogram name="Nearby.Connections.UtilityProcessShutdownReason.DisconnectedMojoDependency" enum="NearbyConnectionsUtilityProcessMojoDependencyName" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>hansenmichael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -248,7 +248,7 @@ </histogram> <histogram name="Nearby.Connections.WifiLan.ConnectResult" - enum="NearbyConnectionsWifiLanConnectResult" expires_after="2023-12-17"> + enum="NearbyConnectionsWifiLanConnectResult" expires_after="2024-02-20"> <owner>hansenmichael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -261,7 +261,7 @@ </histogram> <histogram name="Nearby.Connections.WifiLan.ListenResult" - enum="NearbyConnectionsWifiLanListenResult" expires_after="2023-12-17"> + enum="NearbyConnectionsWifiLanListenResult" expires_after="2024-02-20"> <owner>hansenmichael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -299,7 +299,7 @@ </histogram> <histogram name="Nearby.Connections.{Medium}.Socket.{Operation}.Result" - enum="BooleanSuccess" expires_after="2023-10-08"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>hansenmichael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -519,7 +519,7 @@ </histogram> <histogram name="Nearby.Share.BackgroundScanning.SessionStarted" - enum="BooleanSuccess" expires_after="2023-12-17"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>hansenmichael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -676,7 +676,7 @@ </histogram> <histogram name="Nearby.Share.Certificates.Storage.{Operation}SuccessRate" - enum="BooleanSuccess" expires_after="2023-10-08"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>cclem@chromium.org</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -691,7 +691,7 @@ </histogram> <histogram name="Nearby.Share.Connection.EstablishOutgoingConnection.Success" - enum="BooleanSuccess" expires_after="2023-12-17"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -705,7 +705,7 @@ </histogram> <histogram name="Nearby.Share.Connection.EstablishOutgoingConnectionStatus" - enum="NearbyShareFinalStatus" expires_after="2023-12-17"> + enum="NearbyShareFinalStatus" expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -718,7 +718,7 @@ </histogram> <histogram name="Nearby.Share.Connection.TimeToEstablishOutgoingConnection" - units="ms" expires_after="2023-12-17"> + units="ms" expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -747,7 +747,7 @@ </histogram> <histogram name="Nearby.Share.Contacts.DownloadPageCount.{Result}" - units="pages" expires_after="2023-10-08"> + units="pages" expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -795,7 +795,7 @@ </histogram> <histogram name="Nearby.Share.Contacts.NumContacts.{Type}" units="contacts" - expires_after="2023-10-08"> + expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -818,7 +818,7 @@ </histogram> <histogram name="Nearby.Share.Contacts.Percent{Type}" units="%" - expires_after="2023-10-08"> + expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -841,7 +841,7 @@ </histogram> <histogram name="Nearby.Share.Contacts.TimeToDownload.{Result}" units="ms" - expires_after="2023-10-08"> + expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -859,7 +859,7 @@ </histogram> <histogram name="Nearby.Share.DeviceType{Direction}" - enum="NearbyShareDeviceType" expires_after="2023-10-08"> + enum="NearbyShareDeviceType" expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -875,7 +875,7 @@ </histogram> <histogram name="Nearby.Share.Discovery.Delay.FromStartDiscoveryTo{EndState}" - units="ms" expires_after="2023-10-08"> + units="ms" expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -890,7 +890,7 @@ </histogram> <histogram name="Nearby.Share.Discovery.FurthestDiscoveryProgress" - enum="NearbyShareDiscoveryProgress" expires_after="2023-12-17"> + enum="NearbyShareDiscoveryProgress" expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -912,7 +912,7 @@ </histogram> <histogram name="Nearby.Share.Discovery.NumShareTargets.{Variation}" - units="share targets" expires_after="2023-10-08"> + units="share targets" expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -927,7 +927,7 @@ </histogram> <histogram name="Nearby.Share.Discovery.{Operation}" - enum="NearbyShareServiceStatusCode" expires_after="2023-10-08"> + enum="NearbyShareServiceStatusCode" expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -946,7 +946,7 @@ </histogram> <histogram name="Nearby.Share.Enabled" enum="NearbyShareEnabledState" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -971,7 +971,7 @@ </histogram> <histogram name="Nearby.Share.IsKnownContact" enum="BooleanKnown" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -993,7 +993,7 @@ </histogram> <histogram name="Nearby.Share.Medium.ChangedToMedium" - enum="NearbyConnectionsMedium" expires_after="2023-12-17"> + enum="NearbyConnectionsMedium" expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1004,7 +1004,7 @@ </histogram> <histogram name="Nearby.Share.Medium.InitiateBandwidthUpgradeResult" - enum="BooleanSuccess" expires_after="2023-12-17"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1018,7 +1018,7 @@ </histogram> <histogram name="Nearby.Share.Medium.RequestedBandwidthUpgradeResult" - enum="BooleanUpgraded" expires_after="2023-12-17"> + enum="BooleanUpgraded" expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1074,7 +1074,7 @@ </histogram> <histogram name="Nearby.Share.Payload.AttachmentType{Variation}" - enum="NearbyShareAttachmentType" expires_after="2023-10-08"> + enum="NearbyShareAttachmentType" expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1094,7 +1094,7 @@ </histogram> <histogram name="Nearby.Share.Payload.FinalStatus{UpgradedMedium}" - enum="NearbyShareFinalStatus" expires_after="2023-10-08"> + enum="NearbyShareFinalStatus" expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1136,7 +1136,7 @@ <histogram name="Nearby.Share.Payload.Medium.Over5MbTransferred{ShareTargetType}" - enum="NearbyShareUpgradedMedium" expires_after="2023-10-08"> + enum="NearbyShareUpgradedMedium" expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1155,7 +1155,7 @@ </histogram> <histogram name="Nearby.Share.Payload.NumAttachments{Type}" units="attachments" - expires_after="2023-10-08"> + expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1171,7 +1171,7 @@ </histogram> <histogram name="Nearby.Share.Payload.TotalSize{Variation}" units="KB" - expires_after="2023-10-08"> + expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1204,7 +1204,7 @@ </histogram> <histogram name="Nearby.Share.Payload.TransferRate{Variation}" units="KB/s" - expires_after="2023-10-08"> + expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1237,7 +1237,7 @@ </histogram> <histogram name="Nearby.Share.Payload{Operation}.Success{FilePath}" - enum="BooleanSuccess" expires_after="2023-10-08"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>alanding@google.com</owner> <owner>cros-sharesheet@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> @@ -1260,7 +1260,7 @@ </histogram> <histogram name="Nearby.Share.StartAdvertising.Result.FailureReason{Mode}" - enum="NearbyShareStartAdvertisingFailureReason" expires_after="2023-10-08"> + enum="NearbyShareStartAdvertisingFailureReason" expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1274,7 +1274,7 @@ </histogram> <histogram name="Nearby.Share.StartAdvertising.Result{Mode}" - enum="BooleanSuccess" expires_after="2023-10-08"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1303,7 +1303,7 @@ </histogram> <histogram name="Nearby.Share.TimeFromLocalAcceptToTransferStart" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1315,7 +1315,7 @@ </histogram> <histogram name="Nearby.Share.Transfer.FinalStatus{Variation}" - enum="NearbyShareTransferFinalStatus" expires_after="2023-10-08"> + enum="NearbyShareTransferFinalStatus" expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1352,7 +1352,7 @@ <histogram name="Nearby.Share.Transfer.Success.{Direction}.{ShareTargetType}.{ContactStatus}" - enum="BooleanSuccess" expires_after="2023-10-08"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1533,7 +1533,7 @@ </histogram> <histogram name="Nearby.Share.VisibilityChoice" enum="NearbyShareVisibility" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>pushi@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary> @@ -1544,7 +1544,7 @@ </histogram> <histogram name="Nearby.Share.WifiNetworkConfiguration.Result" - enum="BooleanSuccess" expires_after="2023-12-17"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>crisrael@google.com</owner> <owner>nearby-share-chromeos-eng@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/net/histograms.xml b/tools/metrics/histograms/metadata/net/histograms.xml index 8e0e43c..7e1f3e9 100644 --- a/tools/metrics/histograms/metadata/net/histograms.xml +++ b/tools/metrics/histograms/metadata/net/histograms.xml
@@ -91,7 +91,7 @@ </histogram> <histogram name="Crypto.TPMDuration.{Operation}{SignatureAlgorithm}" units="ms" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>kristianm@chromium.org</owner> <owner>wfh@chromium.org</owner> <summary> @@ -152,7 +152,7 @@ </histogram> <histogram name="Crypto.TPMOperation.Virtual.{Operation}{SignatureAlgorithm}" - enum="BooleanSuccess" expires_after="2023-12-01"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>kristianm@chromium.org</owner> <owner>agl@chromium.org</owner> <summary> @@ -174,7 +174,7 @@ </histogram> <histogram name="Crypto.TPMOperation.{Operation}{SignatureAlgorithm}" - enum="BooleanSuccess" expires_after="2023-12-01"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>kristianm@chromium.org</owner> <owner>wfh@chromium.org</owner> <summary> @@ -331,7 +331,7 @@ </histogram> <histogram name="HttpCache.TotalDiskCacheTimePerTransaction.{AccessType}" - units="ms" expires_after="2023-11-16"> + units="ms" expires_after="2024-02-20"> <owner>bashi@chromium.org</owner> <owner>blink-network-stack@google.com</owner> <summary> @@ -664,7 +664,7 @@ </histogram> <histogram name="Net.CertVerifier.PathBuilderIterationCount" units="units" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>mattm@chromium.org</owner> <owner>rsleevi@chromium.org</owner> <summary> @@ -705,7 +705,7 @@ </histogram> <histogram name="Net.CertVerifier_TrialComparisonResult" - enum="CertVerifierTrialComparisonResult" expires_after="2023-12-17"> + enum="CertVerifierTrialComparisonResult" expires_after="2024-02-20"> <owner>mattm@chromium.org</owner> <owner>rsleevi@chromium.org</owner> <summary> @@ -847,7 +847,7 @@ </histogram> <histogram name="Net.DNS.DnsConfig.Nsswitch.FileChange" enum="BooleanChanged" - expires_after="2023-12-18"> + expires_after="2024-02-20"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -899,7 +899,7 @@ </histogram> <histogram name="Net.DNS.DnsConfig.Nsswitch.Read" enum="BooleanReceived" - expires_after="2023-12-18"> + expires_after="2024-02-20"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -911,7 +911,7 @@ </histogram> <histogram name="Net.DNS.DnsConfig.Nsswitch.TooLarge" enum="BooleanExceeded" - expires_after="2023-12-18"> + expires_after="2024-02-20"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -934,7 +934,7 @@ </histogram> <histogram name="Net.DNS.DnsConfig.Resolv.FileChange" enum="BooleanChanged" - expires_after="2023-12-18"> + expires_after="2024-02-20"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -944,7 +944,7 @@ </histogram> <histogram name="Net.DNS.DnsConfig.Resolv.Read" enum="BooleanReceived" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -955,7 +955,7 @@ </histogram> <histogram name="Net.DNS.DnsConfig.Resolv.Valid" enum="BooleanValid" - expires_after="2023-12-18"> + expires_after="2024-02-20"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -1748,7 +1748,7 @@ </histogram> <histogram name="Net.ErrorPageCounts.WebAppAlternativeErrorPage" - enum="NetErrorCodes" expires_after="2023-12-17"> + enum="NetErrorCodes" expires_after="2024-02-20"> <owner>finnur@chromium.org</owner> <owner>alexbn@chromium.org</owner> <summary> @@ -2073,7 +2073,7 @@ </histogram> <histogram name="Net.HttpResponseHeaders.HeaderCount" units="count" - expires_after="2023-10-10"> + expires_after="2024-02-20"> <owner>ricea@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -2792,7 +2792,7 @@ </histogram> <histogram name="Net.QuicSession.AcceptChFrameReceivedViaAlps" - enum="AcceptChEntries" expires_after="2023-12-17"> + enum="AcceptChEntries" expires_after="2024-02-20"> <owner>bnc@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -4869,7 +4869,7 @@ </histogram> <histogram name="Net.SharedDictionaryStorageOnDisk.MetadataReadTime.{Result}" - units="ms" expires_after="2023-12-01"> + units="ms" expires_after="2024-02-20"> <owner>horo@chromium.org</owner> <owner>src/net/extras/shared_dictionary/OWNERS</owner> <summary> @@ -4906,7 +4906,7 @@ </histogram> <histogram name="Net.SharedDictionaryStore.{MethodName}.Error" - enum="SharedDictionaryStoreError" expires_after="2023-12-01"> + enum="SharedDictionaryStoreError" expires_after="2024-02-20"> <owner>horo@chromium.org</owner> <owner>src/net/extras/shared_dictionary/OWNERS</owner> <summary> @@ -5758,7 +5758,7 @@ </histogram> <histogram name="Net.WebSocket.FallbackResult" enum="WebSocketFallbackResult" - expires_after="2023-12-16"> + expires_after="2024-02-20"> <owner>bashi@chromium.org</owner> <owner>blink-network-stack@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/network/histograms.xml b/tools/metrics/histograms/metadata/network/histograms.xml index 9258f03..f2905c77 100644 --- a/tools/metrics/histograms/metadata/network/histograms.xml +++ b/tools/metrics/histograms/metadata/network/histograms.xml
@@ -2238,7 +2238,7 @@ </histogram> <histogram name="Network.Shill.Cellular.TimeToRedirectFound" units="ms" - expires_after="2023-12-10"> + expires_after="2024-02-20"> <owner>matthewmwang@chromium.org</owner> <owner>hugobenichi@google.com</owner> <owner>cros-network-metrics@google.com</owner> @@ -2343,7 +2343,7 @@ </histogram> <histogram name="Network.Shill.Ethernet.TimeToConfig" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>hugobenichi@google.com</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -2680,7 +2680,7 @@ </histogram> <histogram name="Network.Shill.Vpn.RemoteAuthenticationType" - enum="VPNRemoteAuthenticationType" expires_after="2023-12-17"> + enum="VPNRemoteAuthenticationType" expires_after="2024-02-20"> <owner>jiejiang@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -2690,7 +2690,7 @@ </histogram> <histogram name="Network.Shill.Vpn.TimeOnline" units="seconds" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jiejiang@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -2704,7 +2704,7 @@ </histogram> <histogram name="Network.Shill.Vpn.TimeToConfig" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jiejiang@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -2724,7 +2724,7 @@ </histogram> <histogram name="Network.Shill.Vpn.UserAuthenticationType" - enum="VPNUserAuthenticationType" expires_after="2023-12-17"> + enum="VPNUserAuthenticationType" expires_after="2024-02-20"> <owner>jiejiang@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -3137,7 +3137,7 @@ </histogram> <histogram name="Network.Shill.WiFi.Hidden.EverConnected" - enum="BooleanConnected" expires_after="2023-12-01"> + enum="BooleanConnected" expires_after="2024-02-20"> <owner>jonmann@chromium.org</owner> <owner>tnagel@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> @@ -3152,7 +3152,7 @@ </histogram> <histogram name="Network.Shill.WiFi.Hidden.LastConnected" units="days" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>jonmann@chromium.org</owner> <owner>tnagel@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> @@ -3588,7 +3588,7 @@ </histogram> <histogram name="Network.Shill.WiFi.SessionTagState.{Event}" - enum="WiFiSessionTagState" expires_after="2023-12-01"> + enum="WiFiSessionTagState" expires_after="2024-02-20"> <owner>norvez@chromium.org</owner> <owner>druth@google.com</owner> <owner>cros-network-metrics@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/new_tab_page/histograms.xml b/tools/metrics/histograms/metadata/new_tab_page/histograms.xml index 1c5884a..781b537 100644 --- a/tools/metrics/histograms/metadata/new_tab_page/histograms.xml +++ b/tools/metrics/histograms/metadata/new_tab_page/histograms.xml
@@ -277,7 +277,7 @@ </histogram> <histogram name="NewTabPage.Carts.DiscountConsentStatusAtLoad.{ConsentState}" - enum="CartDiscountConsentVariation" expires_after="2023-11-05"> + enum="CartDiscountConsentVariation" expires_after="2024-02-20"> <owner>meiliang@chromium.org</owner> <owner>chrome-shopping@google.com</owner> <summary> @@ -717,7 +717,7 @@ </histogram> <histogram name="NewTabPage.HistoryClusters.Layout{LayoutNum}.Click" - enum="NTPHistoryClustersElementType" expires_after="2023-12-10"> + enum="NTPHistoryClustersElementType" expires_after="2024-02-20"> <owner>romanarora@chromium.org</owner> <owner>tiborg@chromium.org</owner> <owner>chrome-desktop-ntp@google.com</owner> @@ -736,7 +736,7 @@ <histogram name="NewTabPage.HistoryClusters.Layout{LayoutNum}.ImageDisplayState" - enum="NTPHistoryClustersImageDisplayState" expires_after="2023-12-10"> + enum="NTPHistoryClustersImageDisplayState" expires_after="2024-02-20"> <owner>romanarora@chromium.org</owner> <owner>tiborg@chromium.org</owner> <owner>chrome-desktop-ntp@google.com</owner> @@ -754,7 +754,7 @@ <histogram name="NewTabPage.HistoryClusters.Layout{LayoutNum}.{Type}Tile.ClickIndex" - units="index" expires_after="2023-12-10"> + units="index" expires_after="2024-02-20"> <owner>romanarora@chromium.org</owner> <owner>tiborg@chromium.org</owner> <owner>chrome-desktop-ntp@google.com</owner> @@ -1138,7 +1138,7 @@ </histogram> <histogram name="NewTabPage.Modules.FreImpression" enum="BooleanEnabled" - expires_after="2023-12-10"> + expires_after="2024-02-20"> <owner>danpeng@google.com</owner> <owner>pauladedeji@google.com</owner> <owner>chrome-desktop-ntp@google.com</owner> @@ -1151,7 +1151,7 @@ </histogram> <histogram name="NewTabPage.Modules.FreLoaded" enum="BooleanEnabled" - expires_after="2023-12-10"> + expires_after="2024-02-20"> <owner>danpeng@google.com</owner> <owner>pauladedeji@google.com</owner> <owner>chrome-desktop-ntp@google.com</owner> @@ -1504,7 +1504,7 @@ </histogram> <histogram name="NewTabPage.Promos.DismissAction" enum="NtpPromoDismissAction" - expires_after="2023-10-15"> + expires_after="2024-02-20"> <owner>danpeng@google.com</owner> <owner>pauladedeji@google.com</owner> <owner>chrome-desktop-ntp@google.com</owner> @@ -1556,7 +1556,7 @@ </histogram> <histogram name="NewTabPage.Promos.ShownTime" units="ms" - expires_after="2023-10-08"> + expires_after="2024-02-20"> <owner>danpeng@google.com</owner> <owner>tiborg@chromium.org</owner> <owner>yyushkina@chromium.org</owner> @@ -1587,7 +1587,7 @@ </histogram> <histogram name="NewTabPage.RecipeTasks.RecipeClick" units="index" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>danpeng@google.com</owner> <owner>tiborg@chromium.org</owner> <owner>yyushkina@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/omnibox/histograms.xml b/tools/metrics/histograms/metadata/omnibox/histograms.xml index 2f2b74d..42232cc 100644 --- a/tools/metrics/histograms/metadata/omnibox/histograms.xml +++ b/tools/metrics/histograms/metadata/omnibox/histograms.xml
@@ -214,7 +214,7 @@ <histogram name="Omnibox.AsyncAutocompletionTime2.Provider.{Provider}{Completed}" - units="ms" expires_after="2023-12-01"> + units="ms" expires_after="2024-02-20"> <owner>manukh@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> @@ -277,7 +277,7 @@ </histogram> <histogram name="Omnibox.AsyncAutocompletionTime2.{Change}{Completed}" - units="ms" expires_after="2023-12-01"> + units="ms" expires_after="2024-02-20"> <owner>manukh@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> @@ -380,7 +380,7 @@ </histogram> <histogram name="Omnibox.AutocompletionTime.UpdateResult{Slice}" - units="microseconds" expires_after="2023-12-01"> + units="microseconds" expires_after="2024-02-20"> <owner>manukh@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> @@ -893,7 +893,7 @@ </histogram> <histogram name="Omnibox.HistoryFuzzy.MatchConversion.{SubProvider}" - units="counts" expires_after="M119"> + units="counts" expires_after="2024-02-20"> <owner>orinj@chromium.org</owner> <owner>jdonnelly-team@google.com</owner> <summary> @@ -1130,7 +1130,7 @@ </histogram> <histogram name="Omnibox.LocalHistoryPrefixSuggest.SearchTermsExtractionTimeV2" - units="ms" expires_after="2023-12-20"> + units="ms" expires_after="2024-02-20"> <owner>mahmadi@chromium.org</owner> <owner>chrome-desktop-search@google.com</owner> <summary> @@ -1209,7 +1209,7 @@ <histogram name="Omnibox.MatchStability2.MatchChangeInAnyPosition{OmniboxAutocompleteUpdateSlice}" - enum="BooleanChanged" expires_after="2023-12-01"> + enum="BooleanChanged" expires_after="2024-02-20"> <owner>tommycli@chromium.org</owner> <owner>manukh@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> @@ -1257,7 +1257,7 @@ <histogram name="Omnibox.MatchStability2.MatchChangeIndex{OmniboxAutocompleteUpdateSlice}" - units="position" expires_after="2023-12-01"> + units="position" expires_after="2024-02-20"> <owner>tommycli@chromium.org</owner> <owner>manukh@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> @@ -1641,7 +1641,7 @@ </histogram> <histogram name="Omnibox.SearchPreload.ForwardingResult.NotServedToPrerender" - enum="SearchPreloadForwardingResult" expires_after="2023-12-17"> + enum="SearchPreloadForwardingResult" expires_after="2024-02-20"> <owner>lingqi@chromium.org</owner> <owner>ryansturm@chromium.org</owner> <owner>chrome-prerendering@google.com</owner> @@ -1655,7 +1655,7 @@ </histogram> <histogram name="Omnibox.SearchPreload.ForwardingResult.WasServedToPrerender" - enum="SearchPreloadForwardingResult" expires_after="2023-12-17"> + enum="SearchPreloadForwardingResult" expires_after="2024-02-20"> <owner>lingqi@chromium.org</owner> <owner>ryansturm@chromium.org</owner> <owner>chrome-prerendering@google.com</owner> @@ -1668,7 +1668,7 @@ </histogram> <histogram name="Omnibox.SearchPreload.ResponseDataReaderFinalStatus.Prerender" - enum="SearchPrefetchResponseDataReaderStatus" expires_after="2023-12-17"> + enum="SearchPrefetchResponseDataReaderStatus" expires_after="2024-02-20"> <owner>lingqi@chromium.org</owner> <owner>ryansturm@chromium.org</owner> <owner>chrome-prerendering@google.com</owner> @@ -2748,7 +2748,7 @@ <histogram name="Omnibox.{SearchPrefetch}.NavigationInterceptedToForwardingComplete" - units="ms" expires_after="2023-10-15"> + units="ms" expires_after="2024-02-20"> <owner>spelchat@chromium.org</owner> <owner>chrome-brapp-loading@google.com</owner> <owner>chrome-omnibox-team@google.com</owner> @@ -2807,7 +2807,7 @@ <histogram name="Omnibox.{SearchPrefetch}.PrefetchEligibilityReason2.{NavigationOrSuggestionPrefetch}" - enum="SearchPrefetchEligibilityReason" expires_after="2023-10-15"> + enum="SearchPrefetchEligibilityReason" expires_after="2024-02-20"> <owner>ryansturm@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> <summary> @@ -2826,7 +2826,7 @@ <histogram name="Omnibox.{SearchPrefetch}.PrefetchFinalStatus.{NavigationOrSuggestionPrefetch}" - enum="SearchPrefetchStatus" expires_after="2023-10-15"> + enum="SearchPrefetchStatus" expires_after="2024-02-20"> <owner>ryansturm@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> <summary> @@ -2844,7 +2844,7 @@ <histogram name="Omnibox.{SearchPrefetch}.PrefetchServingReason2{PrerenderOrNavigation}" - enum="SearchPrefetchServingReason" expires_after="2023-10-15"> + enum="SearchPrefetchServingReason" expires_after="2024-02-20"> <owner>ryansturm@chromium.org</owner> <owner>lingqi@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> @@ -2926,7 +2926,7 @@ <histogram name="Omnibox.{SearchPrefetch}.ReceivedServableResponse2.{FallbackOrInitial}.{NavigationOrSuggestionPrefetch}" - units="ms" expires_after="2023-10-15"> + units="ms" expires_after="2024-02-20"> <owner>ryansturm@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> <owner>chrome-prerendering@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/oobe/histograms.xml b/tools/metrics/histograms/metadata/oobe/histograms.xml index 177b2729..dbade8d 100644 --- a/tools/metrics/histograms/metadata/oobe/histograms.xml +++ b/tools/metrics/histograms/metadata/oobe/histograms.xml
@@ -472,7 +472,7 @@ <histogram name="OOBE.ErrorScreensTime.{OOBEScreenShownBeforeNetworkError}.{OOBENetworkError}" - units="ms" expires_after="2023-11-01"> + units="ms" expires_after="2024-02-20"> <owner>dkuzmin@google.com</owner> <owner>cros-oobe@google.com</owner> <summary> @@ -557,7 +557,7 @@ <histogram name="OOBE.GestureNavigationScreen.PageShownTime.{OOBEGestureNavigationPage}" - units="ms" expires_after="2023-11-01"> + units="ms" expires_after="2024-02-20"> <owner>mmourgos@chromium.org</owner> <owner>tbarzic@chromium.org</owner> <summary> @@ -573,7 +573,7 @@ <histogram name="OOBE.HidDetectionScreen.BluetoothPairing.Duration.{PairingResult}" - units="ms" expires_after="2023-11-01"> + units="ms" expires_after="2024-02-20"> <owner>gordonseto@google.com</owner> <owner>cros-connectivity@google.com</owner> <summary> @@ -660,7 +660,7 @@ <histogram name="OOBE.MarketingOptInScreen.BackendConnector.{OOBEMarketingCountry}" - enum="MarketingOptInBackendConnectorEvent" expires_after="2023-11-01"> + enum="MarketingOptInBackendConnectorEvent" expires_after="2024-02-20"> <owner>rrsilva@google.com</owner> <owner>cros-oac@google.com</owner> <summary> @@ -673,7 +673,7 @@ </histogram> <histogram name="OOBE.MarketingOptInScreen.Event.{OOBEMarketingCountry}" - enum="MarketingOptInScreenEvent" expires_after="2023-11-01"> + enum="MarketingOptInScreenEvent" expires_after="2024-02-20"> <owner>rrsilva@google.com</owner> <owner>cros-oac@google.com</owner> <summary> @@ -693,7 +693,7 @@ </histogram> <histogram name="OOBE.NetworkErrorShown.{OOBEScreenShownBeforeNetworkError}" - enum="NetworkErrorType" expires_after="2023-11-01"> + enum="NetworkErrorType" expires_after="2024-02-20"> <owner>achuith@google.com</owner> <owner>cros-oobe@google.com</owner> <summary> @@ -776,7 +776,7 @@ <histogram name="OOBE.StepCompletionTimeByExitReason.{OOBEScreenName_ExitReason}" - units="ms" expires_after="2023-12-01"> + units="ms" expires_after="2024-02-20"> <owner>dkuzmin@google.com</owner> <owner>cros-oac@google.com</owner> <summary>Time spent on specific OOBE screen grouped by exit reason.</summary> @@ -919,7 +919,7 @@ </histogram> <histogram name="OOBE.UpdateScreen.StageTime.{UpdateStage}" units="ms" - expires_after="2023-11-01"> + expires_after="2024-02-20"> <owner>dkuzmin@google.com</owner> <owner>cros-oac@google.com</owner> <summary> @@ -951,7 +951,7 @@ </histogram> <histogram name="OOBE.WebViewLoader.FirstLoadResult.{WebViewID}" - enum="OobeWebViewLoadResult" expires_after="2023-11-01"> + enum="OobeWebViewLoadResult" expires_after="2024-02-20"> <owner>osamafathy@google.com</owner> <owner>cros-oac@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml index ed0ea37..6069387 100644 --- a/tools/metrics/histograms/metadata/others/histograms.xml +++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -1628,7 +1628,7 @@ <summary>Records whenever a Blimp tab toggles visibility.</summary> </histogram> -<histogram name="BlueZ.AdapterLost" units="seconds" expires_after="2023-12-17"> +<histogram name="BlueZ.AdapterLost" units="seconds" expires_after="2024-02-20"> <owner>mcchou@chromium.org</owner> <owner>chromeos-bt-platform-sw-core@google.com</owner> <summary> @@ -1685,7 +1685,7 @@ </token> </histogram> -<histogram name="BlueZ.ChipLost2" units="seconds" expires_after="2023-12-17"> +<histogram name="BlueZ.ChipLost2" units="seconds" expires_after="2024-02-20"> <owner>sonnysasaka@chromium.org</owner> <owner>chromeos-bt-platform-sw-core@google.com</owner> <summary> @@ -1756,7 +1756,7 @@ </histogram> <histogram name="BlueZ.ResultOfConnection" enum="BlueZResultOfConnection" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>mcchou@chromium.org</owner> <owner>chromeos-bt-platform-sw-core@google.com</owner> <summary> @@ -1767,7 +1767,7 @@ </histogram> <histogram name="BlueZ.ResultOfPairing" enum="BlueZResultOfPairing" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>mcchou@chromium.org</owner> <owner>chromeos-bt-platform-sw-core@google.com</owner> <summary> @@ -2902,7 +2902,7 @@ </histogram> <histogram name="ClientHints.FetchLatency{OperationType}" units="microseconds" - expires_after="2023-10-31"> + expires_after="2024-02-20"> <owner>miketaylr@chromium.org</owner> <owner>potassium-katabolism@google.com</owner> <summary> @@ -2967,7 +2967,7 @@ </histogram> <histogram name="ClientHints.Viewport.IsDeviceScaleFactorOne" enum="Boolean" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>curranmax@chromium.org</owner> <summary> This records whether or not the device scale factor was exactly 1.0 or not @@ -3238,7 +3238,7 @@ </histogram> <histogram name="ContextMenu.LensSupportStatus" enum="LensSupportStatus" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>benwgold@google.com</owner> <owner>lens-chrome@google.com</owner> <summary> @@ -3362,7 +3362,7 @@ </histogram> <histogram name="ContextMenu.TimeToTakeAction.Abandoned" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>twellington@chromium.org</owner> <owner>clank-app-team@google.com</owner> <summary> @@ -4139,7 +4139,7 @@ </histogram> <histogram name="Conversions.SentVerboseDebugReportType3" - enum="ConversionVerboseDebugReportType" expires_after="2023-11-30"> + enum="ConversionVerboseDebugReportType" expires_after="2024-02-20"> <owner>tquintanilla@chromium.org</owner> <owner>linnan@chromium.org</owner> <owner>measurement-api-dev+metrics@google.com</owner> @@ -4325,7 +4325,7 @@ </histogram> <histogram name="Crashpad.AnrUpload.Skipped" enum="AnrSkippedReason" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>smaier@chromium.org</owner> <owner>crashpad-dev@chromium.org</owner> <summary>The reason that an ANR upload was skipped.</summary> @@ -5179,7 +5179,7 @@ </histogram> <histogram name="Downgrade.TakeSnapshot.ItemFailure" enum="SnapshotItemId" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>grt@chromium.org</owner> <owner>ydago@chromium.org</owner> <summary> @@ -5931,7 +5931,7 @@ </histogram> <histogram name="Feedback.ChromeOSApp.HelpContentSearchResultCount" - units="numbers" expires_after="2023-12-17"> + units="numbers" expires_after="2024-02-20"> <owner>longbowei@google.com</owner> <owner>xiangdongkong@google.com</owner> <owner>cros-feedback-app@google.com</owner> @@ -6104,7 +6104,7 @@ </histogram> <histogram name="Feedback.Duration.FormOpenToSubmit" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>xiangdongkong@google.com</owner> <owner>fernandex@google.com</owner> <owner>cros-feedback-app@google.com</owner> @@ -6908,13 +6908,13 @@ </summary> </histogram> -<histogram name="Hyphenation.Open" units="ms" expires_after="2023-12-17"> +<histogram name="Hyphenation.Open" units="ms" expires_after="2024-02-20"> <owner>kojii@chromium.org</owner> <owner>layout-dev@chromium.org</owner> <summary>The time it takes to open a hyphenation dictionary.</summary> </histogram> -<histogram name="Hyphenation.Open.File" units="ms" expires_after="2023-12-17"> +<histogram name="Hyphenation.Open.File" units="ms" expires_after="2024-02-20"> <owner>kojii@chromium.org</owner> <owner>layout-dev@chromium.org</owner> <summary>The time it takes to open a hyphenation dictionary file.</summary> @@ -6976,7 +6976,7 @@ </histogram> <histogram name="ImportantFile.SerializationDuration{ImportantFileClients}" - units="ms" expires_after="2023-12-12"> + units="ms" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>gab@chromium.org</owner> <summary> @@ -6990,7 +6990,7 @@ </histogram> <histogram name="ImportantFile.WriteDuration{ImportantFileClients}" units="ms" - expires_after="2023-12-12"> + expires_after="2024-02-20"> <owner>wylieb@chromium.org</owner> <owner>chrome-collections@google.com</owner> <summary> @@ -7002,7 +7002,7 @@ <histogram name="Incognito.ClearBrowsingDataDialog.ActionType" enum="IncognitoClearBrowsingDataDialogActionType" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>roagarwal@chromium.org</owner> <owner>chrome-incognito@google.com</owner> <summary> @@ -7203,7 +7203,7 @@ </histogram> <histogram name="InstanceID.GetToken.RequestStatus.FcmInvalidations" - enum="GCMRegistrationRequestStatus" expires_after="2023-12-17"> + enum="GCMRegistrationRequestStatus" expires_after="2024-02-20"> <owner>peter@chromium.org</owner> <owner>rushans@chromium.org</owner> <owner>treib@chromium.org</owner> @@ -9045,7 +9045,7 @@ </histogram> <histogram name="PageImageService.Backend.OptimizationGuide.Result{ClientId}" - enum="PageImageServiceResult" expires_after="2023-11-08"> + enum="PageImageServiceResult" expires_after="2024-02-20"> <owner>sophiechang@chromium.org</owner> <owner>chrome-journeys@google.com</owner> <component>Internals>OptimizationGuide</component> @@ -9074,7 +9074,7 @@ </histogram> <histogram name="PageImageService.Backend{ClientId}" - enum="PageImageServiceBackend" expires_after="2023-11-08"> + enum="PageImageServiceBackend" expires_after="2024-02-20"> <owner>tommycli@chromium.org</owner> <owner>chrome-journeys@google.com</owner> <component>UI>Browser>Journeys</component> @@ -9088,7 +9088,7 @@ </histogram> <histogram name="PageImageService.ConsentSuccess{ClientId}" - enum="BooleanSuccess" expires_after="2023-11-08"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>tommycli@chromium.org</owner> <owner>chrome-journeys@google.com</owner> <component>UI>Browser>Journeys</component> @@ -10785,7 +10785,7 @@ </histogram> <histogram name="SB2.RemoteCall.Result" enum="SB2RemoteCallResult" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -14169,7 +14169,7 @@ </histogram> <histogram name="WebShare.ApiCount" enum="WebShareMethod" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>mgiuca@chromium.org</owner> <summary> Counts the number of calls to navigator.share. Includes both successful and
diff --git a/tools/metrics/histograms/metadata/page/histograms.xml b/tools/metrics/histograms/metadata/page/histograms.xml index 602dfd13..152b368 100644 --- a/tools/metrics/histograms/metadata/page/histograms.xml +++ b/tools/metrics/histograms/metadata/page/histograms.xml
@@ -853,7 +853,7 @@ <histogram name="PageLoad.Clients.MultiTabLoading{OtherLoadingCount}.{Timing}{Background}" - units="ms" expires_after="2023-11-01"> + units="ms" expires_after="2024-02-20"> <owner>chikamune@chromium.org</owner> <owner>chrome-loading@google.com</owner> <summary>{Timing} {OtherLoadingCount} {Background}</summary> @@ -932,7 +932,7 @@ <histogram name="PageLoad.Clients.Prerender.InteractiveTiming.FirstInputDelay4{PrerenderTriggerType}" - units="ms" expires_after="2023-12-03"> + units="ms" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>src/content/browser/preloading/prerender/OWNERS</owner> <summary> @@ -945,7 +945,7 @@ <histogram name="PageLoad.Clients.Prerender.LayoutInstability.CumulativeShiftScore.MainFrame{PrerenderTriggerType}" - units="ms" expires_after="2023-12-03"> + units="ms" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>src/content/browser/preloading/prerender/OWNERS</owner> <summary> @@ -959,7 +959,7 @@ <histogram name="PageLoad.Clients.Prerender.LayoutInstability.CumulativeShiftScore{PrerenderTriggerType}" - units="ms" expires_after="2023-12-03"> + units="ms" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>src/content/browser/preloading/prerender/OWNERS</owner> <summary> @@ -986,7 +986,7 @@ <histogram name="PageLoad.Clients.Prerender.NavigationToActivation{PrerenderTriggerType}" - units="ms" expires_after="2023-12-03"> + units="ms" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>src/content/browser/preloading/prerender/OWNERS</owner> <summary> @@ -1000,7 +1000,7 @@ <histogram name="PageLoad.Clients.Prerender.PaintTiming.ActivationToFirstContentfulPaint{PrerenderTriggerType}" - units="ms" expires_after="2023-12-03"> + units="ms" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>src/content/browser/preloading/prerender/OWNERS</owner> <summary> @@ -1015,7 +1015,7 @@ <histogram name="PageLoad.Clients.Prerender.PaintTiming.ActivationToFirstPaint{PrerenderTriggerType}" - units="ms" expires_after="2023-12-03"> + units="ms" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>src/content/browser/preloading/prerender/OWNERS</owner> <summary> @@ -1029,7 +1029,7 @@ <histogram name="PageLoad.Clients.Prerender.PaintTiming.ActivationToLargestContentfulPaint2{PrerenderTriggerType}" - units="ms" expires_after="2023-12-03"> + units="ms" expires_after="2024-02-20"> <owner>nhiroki@chromium.org</owner> <owner>src/content/browser/preloading/prerender/OWNERS</owner> <summary> @@ -2331,7 +2331,7 @@ </histogram> <histogram name="PageLoad.Internal.PageLoadTimingStatus{Condition}" - enum="PageLoadTimingStatus" expires_after="2023-12-01"> + enum="PageLoadTimingStatus" expires_after="2024-02-20"> <owner>toyoshim@chromium.org</owner> <owner>src/components/page_load_metrics/OWNERS</owner> <owner>src/content/browser/preloading/prerender/OWNERS</owner> @@ -2352,7 +2352,7 @@ </histogram> <histogram name="PageLoad.Internal.PageType" enum="PageLoadTrackerPageType" - expires_after="2023-11-19"> + expires_after="2024-02-20"> <owner>toyoshim@chromium.org</owner> <owner>mparch-dev@chromium.org</owner> <summary> @@ -2401,7 +2401,7 @@ <histogram name="PageLoad.Internal.Prerender2.ActivatedPageLoaderStatus{PrerenderTriggerType}" - enum="NetErrorCodes" expires_after="2023-10-31"> + enum="NetErrorCodes" expires_after="2024-02-20"> <owner>lingqi@chromium.org</owner> <owner>chrome-prerendering@google.com</owner> <summary> @@ -2631,7 +2631,7 @@ <histogram name="PageLoad.LayoutInstability.CumulativeShiftScoreAtFirstOnHidden" - units="scorex10" expires_after="2023-12-04"> + units="scorex10" expires_after="2024-02-20"> <owner>lanwei@chromium.org</owner> <owner>speed-metrics-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/password/histograms.xml b/tools/metrics/histograms/metadata/password/histograms.xml index 30e8ac74..573b5f5 100644 --- a/tools/metrics/histograms/metadata/password/histograms.xml +++ b/tools/metrics/histograms/metadata/password/histograms.xml
@@ -290,7 +290,7 @@ </histogram> <histogram name="PasswordGeneration.EditsInGeneratedPassword.{CharacterClass}" - enum="CharacterClassPresenceChange" expires_after="2023-11-20"> + enum="CharacterClassPresenceChange" expires_after="2024-02-20"> <owner>kolos@chromium.org</owner> <owner>shaikhitdin@google.com</owner> <summary> @@ -600,7 +600,7 @@ </histogram> <histogram name="PasswordManager.AccountStoreVsProfileStore4.{DifferenceType}" - units="accounts" expires_after="2023-12-01"> + units="accounts" expires_after="2024-02-20"> <owner>mamir@chromium.org</owner> <owner>treib@chromium.org</owner> <summary> @@ -753,7 +753,7 @@ </histogram> <histogram name="PasswordManager.AffiliationFetcher.FetchTime.{Status}" - units="ms" expires_after="M120"> + units="ms" expires_after="2024-02-20"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -1153,7 +1153,7 @@ </histogram> <histogram name="PasswordManager.CredentialEntryActions.{CredentialEntryType}" - enum="CredentialEntryAction" expires_after="M120"> + enum="CredentialEntryAction" expires_after="2024-02-20"> <owner>ioanap@chromium.org</owner> <owner>fhorschig@chromium.org</owner> <summary> @@ -1592,7 +1592,7 @@ </histogram> <histogram name="PasswordManager.Import.DesktopInteractions" - enum="PasswordsImportDesktopInteractions" expires_after="2023-12-17"> + enum="PasswordsImportDesktopInteractions" expires_after="2024-02-20"> <owner>eliaskh@chromium.org</owner> <owner>natiahlyi@google.com</owner> <summary> @@ -1726,7 +1726,7 @@ </histogram> <histogram name="PasswordManager.ImportFileSize" units="bytes" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>eliaskh@chromium.org</owner> <owner>natiahlyi@google.com</owner> <summary> @@ -2081,7 +2081,7 @@ <histogram name="PasswordManager.NewlySavedPasswordHasEmptyUsername.{PasswordType}" - enum="Boolean" expires_after="2023-10-23"> + enum="Boolean" expires_after="2024-02-20"> <owner>khamutov@google.com</owner> <owner>kolos@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> @@ -2115,7 +2115,7 @@ </histogram> <histogram name="PasswordManager.OpenedAsShortcut" enum="Boolean" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>vasilii@chromium.org</owner> <owner>vsemeniuk@google.com</owner> <summary> @@ -2257,7 +2257,7 @@ </histogram> <histogram name="PasswordManager.PasswordCheckup.{Operation}.Latency" - units="ms" expires_after="M120"> + units="ms" expires_after="2024-02-20"> <owner>ioanap@chromium.org</owner> <owner>izuzic@google.com</owner> <summary> @@ -2270,7 +2270,7 @@ </histogram> <histogram name="PasswordManager.PasswordCheckup.{Operation}.Success" - enum="BooleanSuccess" expires_after="M120"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>ioanap@chromium.org</owner> <owner>izuzic@google.com</owner> <summary> @@ -2444,7 +2444,7 @@ <histogram name="PasswordManager.PasswordSettings.{Function}.{Setting}.APIError1" - enum="PasswordStoreAndroidBackendAPIError" expires_after="M120"> + enum="PasswordStoreAndroidBackendAPIError" expires_after="2024-02-20"> <owner>izuzic@google.com</owner> <owner>ioanap@chromium.org</owner> <summary> @@ -2477,7 +2477,7 @@ <histogram name="PasswordManager.PasswordSettings.{Function}.{Setting}.ErrorLatency" - units="ms" expires_after="M120"> + units="ms" expires_after="2024-02-20"> <owner>izuzic@google.com</owner> <owner>ioanap@chromium.org</owner> <summary> @@ -2490,7 +2490,7 @@ </histogram> <histogram name="PasswordManager.PasswordSettings.{Function}.{Setting}.Latency" - units="ms" expires_after="M120"> + units="ms" expires_after="2024-02-20"> <owner>izuzic@google.com</owner> <owner>ioanap@chromium.org</owner> <summary> @@ -2503,7 +2503,7 @@ </histogram> <histogram name="PasswordManager.PasswordSettings.{Function}.{Setting}.Success" - enum="BooleanSuccess" expires_after="M120"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>izuzic@google.com</owner> <owner>ioanap@chromium.org</owner> <summary> @@ -2684,7 +2684,7 @@ <histogram name="PasswordManager.PasswordStoreAndroidBackend{Function}.APIError" - enum="PasswordStoreAndroidBackendAPIError" expires_after="M120"> + enum="PasswordStoreAndroidBackendAPIError" expires_after="2024-02-20"> <owner>maxan@chromium.org</owner> <owner>ioanap@chromium.org</owner> <owner>vasilii@chromium.org</owner> @@ -2707,7 +2707,8 @@ <histogram name="PasswordManager.PasswordStoreAndroidBackend{Function}.ConnectionResultCode" - enum="PasswordStoreAndroidBackendConnectionResultCode" expires_after="M120"> + enum="PasswordStoreAndroidBackendConnectionResultCode" + expires_after="2024-02-20"> <owner>ioanap@chromium.org</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -2729,7 +2730,7 @@ <histogram name="PasswordManager.PasswordStoreAndroidBackend{Function}.ErrorCode" - enum="PasswordStoreAndroidBackendError" expires_after="M120"> + enum="PasswordStoreAndroidBackendError" expires_after="2024-02-20"> <owner>maxan@chromium.org</owner> <owner>ioanap@chromium.org</owner> <owner>vasilii@chromium.org</owner> @@ -2766,7 +2767,7 @@ </histogram> <histogram name="PasswordManager.PasswordStoreProxyBackend.{Function}.Fallback" - enum="Boolean" expires_after="M120"> + enum="Boolean" expires_after="2024-02-20"> <owner>ioanap@chromium.org</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -2779,7 +2780,7 @@ </histogram> <histogram name="PasswordManager.PasswordStore{Backend}.{Function}" - enum="PasswordStoreAndroidBackendRequestStatus" expires_after="M120"> + enum="PasswordStoreAndroidBackendRequestStatus" expires_after="2024-02-20"> <owner>maxan@chromium.org</owner> <owner>ioanap@chromium.org</owner> <owner>vasilii@chromium.org</owner> @@ -2799,7 +2800,7 @@ </histogram> <histogram name="PasswordManager.PasswordStore{Backend}.{Function}.Latency" - units="ms" expires_after="M120"> + units="ms" expires_after="2024-02-20"> <owner>maxan@chromium.org</owner> <owner>ioanap@chromium.org</owner> <owner>vasilii@chromium.org</owner> @@ -2817,7 +2818,7 @@ </histogram> <histogram name="PasswordManager.PasswordStore{Backend}.{Function}.Success" - enum="BooleanSuccess" expires_after="M120"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>maxan@chromium.org</owner> <owner>ioanap@chromium.org</owner> <owner>vasilii@chromium.org</owner> @@ -2959,7 +2960,7 @@ </histogram> <histogram name="PasswordManager.RequirementsSpecFetcher.NetErrorCode" - enum="NetErrorCodes" expires_after="2023-12-17"> + enum="NetErrorCodes" expires_after="2024-02-20"> <owner>kazinova@google.com</owner> <owner>battre@chromium.org</owner> <summary> @@ -3019,7 +3020,7 @@ </histogram> <histogram name="PasswordManager.ReusedPasswordType" enum="ReusedPasswordType" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -3171,7 +3172,7 @@ </histogram> <histogram name="PasswordManager.ShortcutMetric" - enum="PasswordManagerShortcutMetric" expires_after="2023-12-17"> + enum="PasswordManagerShortcutMetric" expires_after="2024-02-20"> <owner>vasilii@chromium.org</owner> <owner>vsemeniuk@google.com</owner> <summary> @@ -3517,7 +3518,7 @@ <histogram name="PasswordManager.UnifiedPasswordManager.{UPMMigrationType}.Success" - enum="BooleanSuccess" expires_after="M120"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>vsemeniuk@google.com</owner> <owner>fhorschig@chromium.org</owner> <summary> @@ -3582,7 +3583,7 @@ </histogram> <histogram name="PasswordManager.WeakCheck.CheckedPasswords" units="passwords" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>kazinova@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -3638,7 +3639,7 @@ </histogram> <histogram name="PasswordManager.{Location}.AuthenticationResult" - enum="BooleanSuccess" expires_after="M120"> + enum="BooleanSuccess" expires_after="2024-02-20"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -3653,7 +3654,7 @@ </histogram> <histogram name="PasswordManager.{Location}.AuthenticationTime" units="ms" - expires_after="M120"> + expires_after="2024-02-20"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary>Records the time it takes user to authenticate {Location}.</summary> @@ -3669,7 +3670,7 @@ <histogram name="PasswordManager.{Store}BlacklistedSitesHiRes3{CustomPassphraseStatus}" - units="sites" expires_after="2023-11-01"> + units="sites" expires_after="2024-02-20"> <owner>kazinova@google.com</owner> <owner>mamir@chromium.org</owner> <owner>treib@chromium.org</owner> @@ -3705,7 +3706,7 @@ </histogram> <histogram name="PasswordManager.{Store}InaccessiblePasswords3" - units="saved passwords" expires_after="2023-11-26"> + units="saved passwords" expires_after="2024-02-20"> <owner>derinel@google.com</owner> <owner>vasilii@chromium.org</owner> <owner>mamir@chromium.org</owner> @@ -3721,7 +3722,7 @@ </histogram> <histogram name="PasswordManager.{Store}LoginDatabaseEncryptionStatus" - enum="LoginDatabaseEncryptionStatus" expires_after="2023-10-30"> + enum="LoginDatabaseEncryptionStatus" expires_after="2024-02-20"> <owner>derinel@google.com</owner> <owner>mamir@chromium.org</owner> <summary> @@ -3778,7 +3779,7 @@ <histogram name="PasswordManager.{Store}TimesPasswordUsed3.{PasswordType}{CustomPassphraseStatus}" - units="PasswordUses" expires_after="2023-11-01"> + units="PasswordUses" expires_after="2024-02-20"> <owner>kazinova@google.com</owner> <owner>battre@chromium.org</owner> <owner>mamir@chromium.org</owner> @@ -3796,7 +3797,7 @@ </histogram> <histogram name="PasswordManager.{Store}TotalAccountsHiRes3.WithScheme{Scheme}" - units="accounts" expires_after="2023-11-30"> + units="accounts" expires_after="2024-02-20"> <owner>battre@chromium.org</owner> <owner>mamir@chromium.org</owner> <owner>treib@chromium.org</owner> @@ -3813,7 +3814,7 @@ <histogram name="PasswordManager.{Store}{Metric3}.{PasswordType}{CustomPassphraseStatus}" - units="units" expires_after="2023-11-01"> + units="units" expires_after="2024-02-20"> <owner>kazinova@google.com</owner> <owner>vasilii@chromium.org</owner> <owner>mamir@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/payment/histograms.xml b/tools/metrics/histograms/metadata/payment/histograms.xml index 8c6d9267..e165c79 100644 --- a/tools/metrics/histograms/metadata/payment/histograms.xml +++ b/tools/metrics/histograms/metadata/payment/histograms.xml
@@ -52,7 +52,7 @@ </histogram> <histogram name="PaymentRequest.EventResponse.CanMakePayment" enum="Boolean" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>rouslan@chromium.org</owner> <owner>web-payments-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/permissions/histograms.xml b/tools/metrics/histograms/metadata/permissions/histograms.xml index a475ae6..2cd073a 100644 --- a/tools/metrics/histograms/metadata/permissions/histograms.xml +++ b/tools/metrics/histograms/metadata/permissions/histograms.xml
@@ -189,7 +189,7 @@ </histogram> <histogram name="Permissions.Action.{PermissionType}.CrossOriginFrame" - enum="PermissionAction" expires_after="2023-10-26"> + enum="PermissionAction" expires_after="2024-02-20"> <owner>tungnh@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -202,7 +202,7 @@ <histogram name="Permissions.Action.{PermissionType}.CrossOriginFrame.TopLevelHeaderPolicy" - enum="PermissionsPolicyConfiguration" expires_after="2023-10-26"> + enum="PermissionsPolicyConfiguration" expires_after="2024-02-20"> <owner>tungnh@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -580,7 +580,7 @@ <histogram name="Permissions.Experimental.PrimaryMainNavigationFinished.{PermissionType}.TopLevelHeaderPolicy" - enum="PermissionsPolicyConfiguration" expires_after="2023-10-26"> + enum="PermissionsPolicyConfiguration" expires_after="2024-02-20"> <owner>tungnh@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -597,7 +597,7 @@ <histogram name="Permissions.Experimental.Usage.{PermissionType}.CrossOriginFrame.TopLevelHeaderPolicy" - enum="PermissionsPolicyConfiguration" expires_after="2023-10-26"> + enum="PermissionsPolicyConfiguration" expires_after="2024-02-20"> <owner>tungnh@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -611,7 +611,7 @@ <histogram name="Permissions.Experimental.Usage.{PermissionType}.IsCrossOriginFrame" - enum="Boolean" expires_after="2023-10-26"> + enum="Boolean" expires_after="2024-02-20"> <owner>tungnh@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -720,7 +720,7 @@ <histogram name="Permissions.PageInfo.Changed.{PermissionType}.Reallowed.Outcome" - enum="PermissionChangeInfo" expires_after="2023-10-31"> + enum="PermissionChangeInfo" expires_after="2024-02-20"> <owner>elklm@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -733,7 +733,7 @@ </histogram> <histogram name="Permissions.PageInfo.Changed.{PermissionType}.{ReloadInfoBar}" - enum="PermissionChangeAction" expires_after="2023-10-31"> + enum="PermissionChangeAction" expires_after="2024-02-20"> <owner>elklm@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -753,7 +753,7 @@ </histogram> <histogram name="Permissions.PageInfo.ChangedWithin1m.{PermissionType}" - enum="PermissionChangeAction" expires_after="2023-10-31"> + enum="PermissionChangeAction" expires_after="2024-02-20"> <owner>fjacky@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -1060,7 +1060,7 @@ </histogram> <histogram name="Permissions.Prompt.{PermissionType}.{Disposition}.Action" - enum="PermissionAction" expires_after="2023-10-31"> + enum="PermissionAction" expires_after="2024-02-20"> <owner>elklm@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -1116,7 +1116,7 @@ <histogram name="Permissions.Prompt.{PermissionType}.{Disposition}.IgnoredReason" - enum="PermissionRequestIgnoredReason" expires_after="2023-12-16"> + enum="PermissionRequestIgnoredReason" expires_after="2024-02-20"> <owner>fjacky@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -1130,7 +1130,7 @@ <histogram name="Permissions.Prompt.{PermissionType}.{Disposition}.{Action}.TimeToAction" - units="ms" expires_after="2023-10-31"> + units="ms" expires_after="2024-02-20"> <owner>elklm@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -1209,7 +1209,7 @@ </histogram> <histogram name="Permissions.Prompt.{PermissionType}.{Gesture}.Attempt" - enum="Boolean" expires_after="2023-10-26"> + enum="Boolean" expires_after="2024-02-20"> <owner>elklm@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary>Recorded when a permission prompt creation is in progress.</summary> @@ -1309,7 +1309,7 @@ </histogram> <histogram name="Permissions.Request.SameOrigin.{FrameLevel}" - enum="PermissionType" expires_after="2023-11-15"> + enum="PermissionType" expires_after="2024-02-20"> <owner>elklm@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/platform/histograms.xml b/tools/metrics/histograms/metadata/platform/histograms.xml index dbf18d7..5d59808 100644 --- a/tools/metrics/histograms/metadata/platform/histograms.xml +++ b/tools/metrics/histograms/metadata/platform/histograms.xml
@@ -908,7 +908,7 @@ </histogram> <histogram name="Platform.Libhwsec.RetryAction{Category}" - enum="HwsecRetryActionEnum" expires_after="2023-12-19"> + enum="HwsecRetryActionEnum" expires_after="2024-02-20"> <owner>yich@google.com</owner> <owner>cros-hwsec-userland-eng+uma@google.com</owner> <summary> @@ -1157,7 +1157,7 @@ </histogram> <histogram name="Platform.Memory.Daemons" units="MiB" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <!-- Name completed by histogram_suffixes name="ProcessMemoryType" --> <owner>bgeffon@chromium.org</owner> @@ -1167,7 +1167,7 @@ </summary> </histogram> -<histogram name="Platform.Memory.Gpu" units="MiB" expires_after="2023-12-17"> +<histogram name="Platform.Memory.Gpu" units="MiB" expires_after="2024-02-20"> <!-- Name completed by histogram_suffixes name="ProcessMemoryType" --> <owner>bgeffon@chromium.org</owner> @@ -1567,6 +1567,15 @@ </summary> </histogram> +<histogram name="Platform.Resourced.MemoryNotificationCountTenMinutes" + units="count" expires_after="2024-08-23"> + <owner>vovoy@chromium.org</owner> + <owner>chromeos-memory@google.com</owner> + <summary> + Memory notification count in 10 minutes, reported every 10 minutes. + </summary> +</histogram> + <histogram name="Platform.SATA.AvailableReservedSpace" units="%" expires_after="2024-08-07"> <owner>asavery@chromium.org</owner> @@ -1971,7 +1980,7 @@ </histogram> <histogram name="Platform.TPM1.CommandAndResponse.{Client}" - enum="TPM1CommandAndResponse" expires_after="2023-12-20"> + enum="TPM1CommandAndResponse" expires_after="2024-02-20"> <owner>chingkang@chromium.org</owner> <owner>cros-hwsec+uma@google.com</owner> <summary> @@ -1991,7 +2000,7 @@ </histogram> <histogram name="Platform.TPM2.CommandAndResponse.{Client}" - enum="TPM2CommandAndResponse" expires_after="2023-12-20"> + enum="TPM2CommandAndResponse" expires_after="2024-02-20"> <owner>chingkang@chromium.org</owner> <owner>cros-hwsec+uma@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/power/histograms.xml b/tools/metrics/histograms/metadata/power/histograms.xml index aa966ce..399b710 100644 --- a/tools/metrics/histograms/metadata/power/histograms.xml +++ b/tools/metrics/histograms/metadata/power/histograms.xml
@@ -628,7 +628,7 @@ <histogram name="Power.AdaptiveChargingDelayDelta.{AdaptiveChargingState}.{OnTimeStatus}" - units="minutes" expires_after="2023-10-26"> + units="minutes" expires_after="2024-02-20"> <owner>dbasehore@chromium.org</owner> <owner>chromeos-platform-power@google.com</owner> <summary> @@ -980,7 +980,7 @@ </histogram> <histogram name="Power.BatteryDischargeRate" units="mW" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>puthik@chromium.org</owner> <owner>chromeos-platform-power@google.com</owner> <summary> @@ -1599,7 +1599,7 @@ </histogram> <histogram name="Power.ForegroundBatteryDrain.30Seconds{Exclusive}" units="uAh" - expires_after="2023-11-07"> + expires_after="2024-02-20"> <owner>eseckler@chromium.org</owner> <owner>skyostil@chromium.org</owner> <owner>woa-performance@google.com</owner> @@ -1641,7 +1641,7 @@ </histogram> <histogram name="Power.ForegroundBatteryDrain{Exclusive}" units="0.1 mAh" - expires_after="2023-11-07"> + expires_after="2024-02-20"> <owner>eseckler@chromium.org</owner> <owner>skyostil@chromium.org</owner> <owner>woa-performance@google.com</owner> @@ -2137,7 +2137,7 @@ </histogram> <histogram name="Power.SuspendAttemptsBeforeCancel" units="units" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>puthik@chromium.org</owner> <owner>chromeos-platform-power@google.com</owner> <summary> @@ -2151,7 +2151,7 @@ </histogram> <histogram name="Power.SuspendAttemptsBeforeSuccess" units="units" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>puthik@chromium.org</owner> <owner>chromeos-platform-power@google.com</owner> <summary> @@ -2263,7 +2263,7 @@ </histogram> <histogram name="PowerML.ModelNoDim.Result" enum="PowerMLFinalResult" - expires_after="2023-11-12"> + expires_after="2024-02-20"> <owner>napper@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/printing/histograms.xml b/tools/metrics/histograms/metadata/printing/histograms.xml index 3d62db8..4e29acbe 100644 --- a/tools/metrics/histograms/metadata/printing/histograms.xml +++ b/tools/metrics/histograms/metadata/printing/histograms.xml
@@ -83,7 +83,7 @@ </histogram> <histogram name="Printing.CUPS.AddressResolutionResult" enum="BooleanSuccess" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>bmgordon@chromium.org</owner> <owner>cros-printing-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/privacy/histograms.xml b/tools/metrics/histograms/metadata/privacy/histograms.xml index 52855276..fab464fd 100644 --- a/tools/metrics/histograms/metadata/privacy/histograms.xml +++ b/tools/metrics/histograms/metadata/privacy/histograms.xml
@@ -199,7 +199,7 @@ </histogram> <histogram name="Privacy.CookiesInUseDialog.Action" - enum="CookiesInUseDialogActions" expires_after="2023-12-17"> + enum="CookiesInUseDialogActions" expires_after="2024-02-20"> <owner>alimariam@google.com</owner> <owner>olesiamarukhno@google.com</owner> <owner>sauski@google.com</owner> @@ -241,7 +241,7 @@ </histogram> <histogram name="Privacy.DIPS.ClearedSitesCount{DIPSCookieMode}" units="sites" - expires_after="2023-11-01"> + expires_after="2024-02-20"> <owner>wanderview@chromium.org</owner> <owner>src/chrome/browser/dips/OWNERS</owner> <summary> @@ -343,7 +343,7 @@ </histogram> <histogram name="Privacy.DIPS.Deletion{DIPSCookieMode}" - enum="DIPSDeletionAction" expires_after="2023-11-01"> + enum="DIPSDeletionAction" expires_after="2024-02-20"> <owner>njeunje@chromium.org</owner> <owner>src/chrome/browser/dips/OWNERS</owner> <summary> @@ -731,7 +731,7 @@ <histogram name="PrivacySandbox.PrivateAggregation.Budgeter.NumReportingOriginsStoredPerSite" - units="counts" expires_after="2023-11-22"> + units="counts" expires_after="2024-02-20"> <owner>alexmt@chromium.org</owner> <owner>linnan@chromium.org</owner> <owner>measurement-api-dev+metrics@google.com</owner> @@ -746,7 +746,7 @@ <histogram name="PrivacySandbox.PrivateAggregation.Budgeter.RequestResult2" enum="PrivacySandboxPrivateAggregationBudgeterRequestResult2" - expires_after="2023-11-24"> + expires_after="2024-02-20"> <owner>alexmt@chromium.org</owner> <owner>linnan@chromium.org</owner> <summary> @@ -758,7 +758,7 @@ <histogram name="PrivacySandbox.PrivateAggregation.BudgetStorage.BeginInitializationCount" - units="units" expires_after="2023-11-12"> + units="units" expires_after="2024-02-20"> <owner>anthonygarant@chromium.org</owner> <owner>alexmt@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/profile/histograms.xml b/tools/metrics/histograms/metadata/profile/histograms.xml index 19ec30d..85c330c 100644 --- a/tools/metrics/histograms/metadata/profile/histograms.xml +++ b/tools/metrics/histograms/metadata/profile/histograms.xml
@@ -112,7 +112,7 @@ </histogram> <histogram name="Profile.DeleteProfileContext" enum="ProfileDeleteContext" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>alexilin@chromium.org</owner> <owner>droger@chromium.org</owner> <owner>msalama@chromium.org</owner> @@ -696,7 +696,7 @@ </histogram> <histogram name="ProfilePicker.FirstRun.EntryPoint" enum="FirstRunEntryPoint" - expires_after="2023-12-19"> + expires_after="2024-02-20"> <owner>dgn@chromium.org</owner> <owner>for-you-fre@google.com</owner> <summary> @@ -713,7 +713,7 @@ </histogram> <histogram name="ProfilePicker.FirstRun.ExitStatus" enum="FirstRunExitStatus" - expires_after="2023-12-19"> + expires_after="2024-02-20"> <owner>dgn@chromium.org</owner> <owner>for-you-fre@google.com</owner> <summary> @@ -724,7 +724,7 @@ </histogram> <histogram name="ProfilePicker.FirstRun.FinishReason" - enum="FirstRunFinishReason" expires_after="2023-12-19"> + enum="FirstRunFinishReason" expires_after="2024-02-20"> <owner>dgn@chromium.org</owner> <owner>for-you-fre@google.com</owner> <summary> @@ -763,7 +763,7 @@ </histogram> <histogram name="ProfilePicker.FirstRun.ServiceCreated" enum="BooleanCreated" - expires_after="2023-12-19"> + expires_after="2024-02-20"> <owner>dgn@chromium.org</owner> <owner>for-you-fre@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/quick_answers/histograms.xml b/tools/metrics/histograms/metadata/quick_answers/histograms.xml index f76d67ae..a0a08ec 100644 --- a/tools/metrics/histograms/metadata/quick_answers/histograms.xml +++ b/tools/metrics/histograms/metadata/quick_answers/histograms.xml
@@ -50,7 +50,7 @@ <histogram name="QuickAnswers.ActiveImpression.Duration{QuickAnswersClickResultType}" - units="ms" expires_after="2023-12-01"> + units="ms" expires_after="2024-02-20"> <owner>angelaxiao@chromium.org</owner> <owner>yawano@google.com</owner> <owner>llin@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/quota/histograms.xml b/tools/metrics/histograms/metadata/quota/histograms.xml index 3d2cc81..345d1cd 100644 --- a/tools/metrics/histograms/metadata/quota/histograms.xml +++ b/tools/metrics/histograms/metadata/quota/histograms.xml
@@ -153,7 +153,7 @@ </histogram> <histogram name="Quota.EvictedBytesPerRound" units="MB" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>ayui@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/renderer/histograms.xml b/tools/metrics/histograms/metadata/renderer/histograms.xml index e0e2966..1f68cd69 100644 --- a/tools/metrics/histograms/metadata/renderer/histograms.xml +++ b/tools/metrics/histograms/metadata/renderer/histograms.xml
@@ -570,7 +570,7 @@ </histogram> <histogram name="RendererScheduler.QueueingDuration.{Priority}Priority" - units="microseconds" expires_after="2023-10-31"> + units="microseconds" expires_after="2024-02-20"> <owner>szager@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/safe_browsing/histograms.xml b/tools/metrics/histograms/metadata/safe_browsing/histograms.xml index faddacd..7e742cf 100644 --- a/tools/metrics/histograms/metadata/safe_browsing/histograms.xml +++ b/tools/metrics/histograms/metadata/safe_browsing/histograms.xml
@@ -124,7 +124,7 @@ <histogram name="SafeBrowsing.Android.RealTimeAllowlist.IsInAllowlist.{AllowlistSource}Result" - enum="AndroidRealTimeIsInAllowlistResult" expires_after="2023-10-26"> + enum="AndroidRealTimeIsInAllowlistResult" expires_after="2024-02-20"> <owner>skrakowi@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -145,7 +145,7 @@ <histogram name="SafeBrowsing.Android.RealTimeAllowlist.Populate.{AllowlistSource}Result" - enum="AndroidRealTimePopulateAllowlistResult" expires_after="2023-10-26"> + enum="AndroidRealTimePopulateAllowlistResult" expires_after="2024-02-20"> <owner>skrakowi@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -157,7 +157,7 @@ <histogram name="SafeBrowsing.Android.RealTimeAllowlist.Populate.{AllowlistSource}Size" - units="entries" expires_after="2023-10-26"> + units="entries" expires_after="2024-02-20"> <owner>skrakowi@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -169,7 +169,7 @@ <histogram name="SafeBrowsing.Android.RealTimeAllowlist.Populate.{AllowlistSource}Version" - units="versioncode" expires_after="2023-10-26"> + units="versioncode" expires_after="2024-02-20"> <owner>skrakowi@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -361,7 +361,7 @@ <histogram name="SafeBrowsing.ClientSafeBrowsingReport.HasThreatDetailsAtFinish.{ResourceType}" - enum="BooleanAvailable" expires_after="2023-12-13"> + enum="BooleanAvailable" expires_after="2024-02-20"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -377,7 +377,7 @@ <histogram name="SafeBrowsing.ClientSafeBrowsingReport.HasThreatDetailsAtStart.{ResourceType}" - enum="BooleanAvailable" expires_after="2023-12-13"> + enum="BooleanAvailable" expires_after="2024-02-20"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -393,7 +393,7 @@ <histogram name="SafeBrowsing.ClientSafeBrowsingReport.HasThreatDetailsForTab{TriggerType}" - enum="BooleanAvailable" expires_after="2023-11-12"> + enum="BooleanAvailable" expires_after="2024-02-20"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -1116,7 +1116,7 @@ </histogram> <histogram name="SafeBrowsing.HPRT.Network.HttpResponseCode.{NetError}" - enum="HttpResponseCode" expires_after="2023-10-25"> + enum="HttpResponseCode" expires_after="2024-02-20"> <owner>thefrog@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -1701,7 +1701,7 @@ </histogram> <histogram name="SafeBrowsing.ReferrerURLChainSize" units="units" - expires_after="2023-12-04"> + expires_after="2024-02-20"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -1886,7 +1886,7 @@ </histogram> <histogram name="SafeBrowsing.RT.GetToken.Time" units="ms" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2228,7 +2228,7 @@ <histogram name="SafeBrowsing.TailoredSecurityConsented{Status}{PromptType}Outcome" - enum="SafeBrowsingTailoredSecurityOutcome" expires_after="2023-11-22"> + enum="SafeBrowsingTailoredSecurityOutcome" expires_after="2024-02-20"> <owner>jacastro@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2313,7 +2313,7 @@ </histogram> <histogram name="SafeBrowsing.TailoredSecurityUnconsented{Flow}MessageOutcome" - enum="SafeBrowsingTailoredSecurityOutcome" expires_after="2023-11-11"> + enum="SafeBrowsingTailoredSecurityOutcome" expires_after="2024-02-20"> <owner>jacastro@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2360,7 +2360,7 @@ </histogram> <histogram name="SafeBrowsing.V4Database.DirectoryCreationResult{Attempt}" - enum="PlatformFileError" expires_after="2023-12-04"> + enum="PlatformFileError" expires_after="2024-02-20"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2399,7 +2399,7 @@ </histogram> <histogram name="SafeBrowsing.V4Database.SizeLinear{ThreatType}" units="MB" - expires_after="2023-11-11"> + expires_after="2024-02-20"> <owner>richche@google.com</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2426,7 +2426,7 @@ </histogram> <histogram name="SafeBrowsing.V4GetHash.CacheFullyHit" enum="BooleanCacheHit" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>thefrog@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2522,7 +2522,7 @@ </histogram> <histogram name="SafeBrowsing.V4LocalDatabaseManager.ThreatInfoSize" - units="verdicts" expires_after="2023-12-17"> + units="verdicts" expires_after="2024-02-20"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2756,7 +2756,7 @@ </histogram> <histogram name="SafeBrowsing.V4UnusedStoreFileExists.{Store}" - enum="BooleanExists" expires_after="2023-10-26"> + enum="BooleanExists" expires_after="2024-02-20"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -2844,7 +2844,7 @@ <histogram name="SafeBrowsing.{CloudOrLocal}DeepScan.{Connector}{Result}.Duration" - units="ms" expires_after="2023-10-20"> + units="ms" expires_after="2024-02-20"> <owner>domfc@chromium.org</owner> <owner>drubery@chromium.org</owner> <owner>rogerta@chromium.org</owner> @@ -2875,7 +2875,7 @@ <histogram name="SafeBrowsing.{Process}Throttle.IntervalBetweenStartAndProcess{ResponseType}" - units="ms" expires_after="2023-10-13"> + units="ms" expires_after="2024-02-20"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/sb_client/histograms.xml b/tools/metrics/histograms/metadata/sb_client/histograms.xml index b76869cd..2e81eb57 100644 --- a/tools/metrics/histograms/metadata/sb_client/histograms.xml +++ b/tools/metrics/histograms/metadata/sb_client/histograms.xml
@@ -127,7 +127,7 @@ </histogram> <histogram name="SBClientDownload.DocumentCheckDownloadStats" - enum="SBClientDownloadCheckDownloadStats" expires_after="2023-12-17"> + enum="SBClientDownloadCheckDownloadStats" expires_after="2024-02-20"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -138,7 +138,7 @@ </histogram> <histogram name="SBClientDownload.DocumentContainsMacros" - enum="BooleanContainsMacros" expires_after="2023-12-17"> + enum="BooleanContainsMacros" expires_after="2024-02-20"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -551,7 +551,7 @@ <histogram name="SBClientPhishing.CancelClassificationReason" enum="SBClientPhishingCancelClassificationReason" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/security/histograms.xml b/tools/metrics/histograms/metadata/security/histograms.xml index 60f973e..68ccbb0 100644 --- a/tools/metrics/histograms/metadata/security/histograms.xml +++ b/tools/metrics/histograms/metadata/security/histograms.xml
@@ -964,7 +964,7 @@ <histogram name="SiteIsolation.ProcessPerSiteWithMainFrameThreshold.BlockReason" enum="ProcessPerSiteWithMainFrameThresholdBlockReason" - expires_after="2023-12-22"> + expires_after="2024-02-20"> <owner>bashi@chromium.org</owner> <owner>blink-network-stack@google.com</owner> <summary> @@ -1010,7 +1010,7 @@ <histogram name="SiteIsolation.ReusePendingOrCommittedSite.TimeSinceReusableProcessDestroyed" - units="ms" expires_after="2023-12-20"> + units="ms" expires_after="2024-02-20"> <owner>jessemckenna@google.com</owner> <owner>olivierli@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/segmentation_platform/histograms.xml b/tools/metrics/histograms/metadata/segmentation_platform/histograms.xml index 3209a80..d805958 100644 --- a/tools/metrics/histograms/metadata/segmentation_platform/histograms.xml +++ b/tools/metrics/histograms/metadata/segmentation_platform/histograms.xml
@@ -217,7 +217,7 @@ <histogram name="SegmentationPlatform.ClassificationRequest.TotalDuration.{SegmentationKey}" - units="ms" expires_after="2023-10-10"> + units="ms" expires_after="2024-02-20"> <owner>ritikagup@google.com</owner> <owner>chrome-segmentation-platform@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/service/histograms.xml b/tools/metrics/histograms/metadata/service/histograms.xml index 18fa388..85b50536 100644 --- a/tools/metrics/histograms/metadata/service/histograms.xml +++ b/tools/metrics/histograms/metadata/service/histograms.xml
@@ -143,7 +143,7 @@ </histogram> <histogram name="ServiceWorker.ActivateEvent.Time" units="ms" - expires_after="2023-11-12"> + expires_after="2024-02-20"> <owner>yyanagisawa@chromium.org</owner> <owner>chikamune@chromium.org</owner> <owner>chrome-worker@google.com</owner> @@ -459,7 +459,7 @@ </histogram> <histogram name="ServiceWorker.FetchEvent.{Resource}.FetchResponseFrom" - enum="ServiceWorkerFetchResponseFrom" expires_after="2023-10-20"> + enum="ServiceWorkerFetchResponseFrom" expires_after="2024-02-20"> <owner>sisidovski@chromium.org</owner> <owner>chrome-worker@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/session/histograms.xml b/tools/metrics/histograms/metadata/session/histograms.xml index 0e1f28c..63d15ba6a 100644 --- a/tools/metrics/histograms/metadata/session/histograms.xml +++ b/tools/metrics/histograms/metadata/session/histograms.xml
@@ -887,6 +887,16 @@ </summary> </histogram> +<histogram name="Session.WebStates.NativeRestoreHasFetchers" + enum="BooleanHasFetchers" expires_after="2024-01-28"> + <owner>ajuma@chromium.org</owner> + <owner>michaeldo@chromium.org</owner> + <summary> + Records whether the WKWebView native session restore has any fetchers or + not. Recorded each time a native session restore is attempted. + </summary> +</histogram> + <histogram name="Session.WebStates.NativeRestoreSession" enum="BooleanSuccess" expires_after="2024-01-07"> <owner>justincohen@chromium.org</owner> @@ -894,7 +904,7 @@ <summary> Records whether generic WKWebView native session restore succeeded in creating navigation items. Recorded each time a generic native session - restore is attempted. + restore is attempted (if data exists). </summary> </histogram> @@ -905,7 +915,29 @@ <summary> Records whether WKWebView native session restore from cached data succeeded in creating navigation items. Recorded each time a cached native session - restore is attempted. + restore is attempted (if data exists). + </summary> +</histogram> + +<histogram name="Session.WebStates.NativeRestoreSessionFromCacheHasData" + enum="BooleanHasData" expires_after="2024-01-28"> + <owner>ajuma@chromium.org</owner> + <owner>michaeldo@chromium.org</owner> + <summary> + Records whether the WKWebView native session restore from cached data + fetcher has data or not. Recorded each time a cached native session restore + is attempted. + </summary> +</histogram> + +<histogram name="Session.WebStates.NativeRestoreSessionHasData" + enum="BooleanHasData" expires_after="2024-01-28"> + <owner>ajuma@chromium.org</owner> + <owner>michaeldo@chromium.org</owner> + <summary> + Records whether the generic WKWebView native session restore fetcher has + data or not. Recorded each time a generic native session restore is + attempted. </summary> </histogram>
diff --git a/tools/metrics/histograms/metadata/settings/histograms.xml b/tools/metrics/histograms/metadata/settings/histograms.xml index e2532e4..69653d4 100644 --- a/tools/metrics/histograms/metadata/settings/histograms.xml +++ b/tools/metrics/histograms/metadata/settings/histograms.xml
@@ -630,7 +630,7 @@ </histogram> <histogram name="Settings.SafetyCheck.UnusedSitePermissionsAllowAgainDays" - units="days" expires_after="2023-12-21"> + units="days" expires_after="2024-02-20"> <owner>sideyilmaz@chromium.org</owner> <owner>msramek@chromium.org</owner> <summary> @@ -643,7 +643,7 @@ </histogram> <histogram name="Settings.SafetyCheck.UnusedSitePermissionsListCount" - units="suggestions" expires_after="2023-12-21"> + units="suggestions" expires_after="2024-02-20"> <owner>sideyilmaz@chromium.org</owner> <owner>msramek@chromium.org</owner> <summary> @@ -655,7 +655,7 @@ <histogram name="Settings.SafetyCheck.UnusedSitePermissionsModuleEntryPointShown" - enum="BooleanVisible" expires_after="2023-12-21"> + enum="BooleanVisible" expires_after="2024-02-20"> <owner>sideyilmaz@chromium.org</owner> <owner>msramek@chromium.org</owner> <owner>hkamila@chromium.org</owner> @@ -669,7 +669,7 @@ <histogram name="Settings.SafetyCheck.UnusedSitePermissionsModuleInteractions" enum="SafetyCheckUnusedSitePermissionsModuleInteractions" - expires_after="2023-12-21"> + expires_after="2024-02-20"> <owner>sideyilmaz@chromium.org</owner> <owner>msramek@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/sharing/histograms.xml b/tools/metrics/histograms/metadata/sharing/histograms.xml index eaf229c..2f43d5d 100644 --- a/tools/metrics/histograms/metadata/sharing/histograms.xml +++ b/tools/metrics/histograms/metadata/sharing/histograms.xml
@@ -129,7 +129,7 @@ </histogram> <histogram name="Sharing.MessageReceivedType" enum="SharingMessageType" - expires_after="2023-12-10"> + expires_after="2024-02-20"> <owner>mvanouwerkerk@chromium.org</owner> <owner>peter@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/signin/histograms.xml b/tools/metrics/histograms/metadata/signin/histograms.xml index cc0b3dff6..9e9f787 100644 --- a/tools/metrics/histograms/metadata/signin/histograms.xml +++ b/tools/metrics/histograms/metadata/signin/histograms.xml
@@ -103,7 +103,7 @@ </histogram> <histogram name="Signin.AccountConsistencyPromoAction.{PromoEvent}" - enum="SigninAccessPoint" expires_after="2023-10-22"> + enum="SigninAccessPoint" expires_after="2024-02-20"> <owner>bsazonov@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> <summary> @@ -1151,7 +1151,7 @@ </histogram> <histogram name="Signin.SignIn.Completed" enum="SigninAccessPoint" - expires_after="2023-12-19"> + expires_after="2024-02-20"> <owner>bsazonov@chromium.org</owner> <owner>dgn@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> @@ -1176,7 +1176,7 @@ </histogram> <histogram name="Signin.SignIn.Started" enum="SigninAccessPoint" - expires_after="2023-12-19"> + expires_after="2024-02-20"> <owner>bsazonov@chromium.org</owner> <owner>dgn@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> @@ -1272,7 +1272,7 @@ </histogram> <histogram name="Signin.SignOut.Completed" enum="SigninSignoutProfile" - expires_after="2023-12-19"> + expires_after="2024-02-20"> <owner>bsazonov@chromium.org</owner> <owner>dgn@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> @@ -1432,7 +1432,7 @@ </histogram> <histogram name="Signin.SyncOptIn.Completed" enum="SigninAccessPoint" - expires_after="2023-12-19"> + expires_after="2024-02-20"> <owner>bsazonov@chromium.org</owner> <owner>dgn@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> @@ -1445,7 +1445,7 @@ </histogram> <histogram name="Signin.SyncOptIn.OpenedSyncSettings" enum="SigninAccessPoint" - expires_after="2023-12-19"> + expires_after="2024-02-20"> <owner>bsazonov@chromium.org</owner> <owner>dgn@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> @@ -1457,7 +1457,7 @@ </histogram> <histogram name="Signin.SyncOptIn.Started" enum="SigninAccessPoint" - expires_after="2023-12-19"> + expires_after="2024-02-20"> <owner>bsazonov@chromium.org</owner> <owner>dgn@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> @@ -1494,7 +1494,7 @@ </histogram> <histogram name="Signin.SyncTurnOff.Completed" enum="SigninSignoutProfile" - expires_after="2023-12-19"> + expires_after="2024-02-20"> <owner>bsazonov@chromium.org</owner> <owner>dgn@chromium.org</owner> <owner>chrome-signin-team@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/storage/histograms.xml b/tools/metrics/histograms/metadata/storage/histograms.xml index dfc8a05..5d8bb54a 100644 --- a/tools/metrics/histograms/metadata/storage/histograms.xml +++ b/tools/metrics/histograms/metadata/storage/histograms.xml
@@ -314,7 +314,7 @@ </histogram> <histogram name="Storage.Blob.RegisterURLTimeWithoutPartitioningSupport" - units="ms" expires_after="2023-12-17"> + units="ms" expires_after="2024-02-20"> <owner>awillia@chromium.org</owner> <owner>chrome-owp-storage@chromium.org</owner> <summary> @@ -326,7 +326,7 @@ </histogram> <histogram name="Storage.Blob.RegisterURLTimeWithPartitioningSupport.{Type}" - units="ms" expires_after="2023-10-15"> + units="ms" expires_after="2024-02-20"> <owner>awillia@chromium.org</owner> <owner>chrome-owp-storage@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/sync/histograms.xml b/tools/metrics/histograms/metadata/sync/histograms.xml index b4afd21..8a06bcca 100644 --- a/tools/metrics/histograms/metadata/sync/histograms.xml +++ b/tools/metrics/histograms/metadata/sync/histograms.xml
@@ -115,7 +115,7 @@ </histogram> <histogram name="Sync.BookmarkEntityReuploadNeeded.On{UpdateType}" - enum="Boolean" expires_after="2023-10-30"> + enum="Boolean" expires_after="2024-02-20"> <owner>rushans@google.com</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -263,7 +263,7 @@ </histogram> <histogram name="Sync.CommitResponseForUnknownEntity" enum="SyncModelTypes" - expires_after="2023-12-15"> + expires_after="2024-02-20"> <owner>treib@chromium.org</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -377,7 +377,7 @@ </histogram> <histogram name="Sync.Crypto.NigoriKeyDerivationDuration.{Method}" units="ms" - expires_after="2023-11-01"> + expires_after="2024-02-20"> <owner>mmoskvitin@google.com</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component> @@ -488,7 +488,7 @@ </histogram> <histogram name="Sync.DeviceCount2.{DeviceType}" units="devices" - expires_after="2023-11-02"> + expires_after="2024-02-20"> <owner>ssid@chromium.org</owner> <owner>mastiz@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> @@ -506,7 +506,7 @@ </histogram> <histogram name="Sync.EntitySizeOnCommit{SyncModelType}" units="bytes" - expires_after="2023-11-30"> + expires_after="2024-02-20"> <owner>ankushkush@google.com</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component> @@ -530,7 +530,7 @@ </histogram> <histogram name="Sync.FCMMessageDeliveredToListeners" enum="Boolean" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>rushans@google.com</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component> @@ -553,7 +553,7 @@ </histogram> <histogram name="Sync.History.IncomingSpecificsError" - enum="SyncHistorySpecificsError" expires_after="2023-12-17"> + enum="SyncHistorySpecificsError" expires_after="2024-02-20"> <owner>treib@chromium.org</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -688,7 +688,7 @@ </summary> </histogram> -<histogram name="Sync.Local.FileSizeKB" units="KB" expires_after="2023-12-04"> +<histogram name="Sync.Local.FileSizeKB" units="KB" expires_after="2024-02-20"> <owner>igorruvinov@chromium.org</owner> <owner>pastarmovj@chromium.org</owner> <component>Services>Sync</component> @@ -929,7 +929,7 @@ </histogram> <histogram name="Sync.ModelTypeOrphanMetadata.{Operation}" - enum="SyncModelTypes" expires_after="2023-12-15"> + enum="SyncModelTypes" expires_after="2024-02-20"> <owner>mastiz@chromium.org</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component> @@ -1697,7 +1697,7 @@ </histogram> <histogram name="Sync.TrustedVaultFileReadStatus" - enum="TrustedVaultFileReadStatus" expires_after="2023-12-17"> + enum="TrustedVaultFileReadStatus" expires_after="2024-02-20"> <owner>mmoskvitin@google.com</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -1705,7 +1705,7 @@ </histogram> <histogram name="Sync.TrustedVaultFileWriteSuccess" enum="Boolean" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>mmoskvitin@google.com</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -1801,7 +1801,7 @@ </histogram> <histogram name="Sync.TrustedVaultKeyRetrievalTrigger" - enum="TrustedVaultUserActionTrigger" expires_after="2023-12-17"> + enum="TrustedVaultUserActionTrigger" expires_after="2024-02-20"> <owner>mmoskvitin@google.com</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -1866,7 +1866,7 @@ </histogram> <histogram name="Sync.TrustedVaultURLFetchResponse{Reason}" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2023-11-01"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2024-02-20"> <owner>mmoskvitin@google.com</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component>
diff --git a/tools/metrics/histograms/metadata/tab/histograms.xml b/tools/metrics/histograms/metadata/tab/histograms.xml index a9e119a..9eee6e904 100644 --- a/tools/metrics/histograms/metadata/tab/histograms.xml +++ b/tools/metrics/histograms/metadata/tab/histograms.xml
@@ -93,7 +93,7 @@ </histogram> <histogram name="Discarding.DiscardCandidatesCount" units="tabs" - expires_after="2023-12-18"> + expires_after="2024-02-20"> <owner>chrisha@chromium.org</owner> <owner>catan-team@chromium.org</owner> <summary> @@ -1091,7 +1091,7 @@ </histogram> <histogram name="TabRestore.{RestoreType}.TimeBetweenClosedAndRestored" - units="ms" expires_after="2023-12-10"> + units="ms" expires_after="2024-02-20"> <owner>sreejakshetty@chromium.org</owner> <owner>chrome-brapp-loading@google.com</owner> <summary> @@ -2468,7 +2468,7 @@ </histogram> <histogram name="Tabs.{TabActiveState}TabWidth" units="px" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>dpenning@chromium.org</owner> <owner>tbergquist@chromium.org</owner> <summary> @@ -2492,7 +2492,7 @@ </histogram> <histogram name="TabStrip.Tab.{Framework}.ActivationAction" - enum="TabActivationTypes" expires_after="2023-12-13"> + enum="TabActivationTypes" expires_after="2024-02-20"> <owner>yuhengh@chromium.org</owner> <owner>tluk@chromium.org</owner> <owner>romanarora@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/translate/histograms.xml b/tools/metrics/histograms/metadata/translate/histograms.xml index a4eb169..a4398c85 100644 --- a/tools/metrics/histograms/metadata/translate/histograms.xml +++ b/tools/metrics/histograms/metadata/translate/histograms.xml
@@ -109,7 +109,7 @@ </histogram> <histogram name="Translate.CLD3.LanguagePercentage" units="%" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>megjablon@google.com</owner> <owner>chrome-language@google.com</owner> <summary> @@ -161,7 +161,7 @@ </histogram> <histogram name="Translate.LanguageDetection.ContentLength" units="characters" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>sclittle@chromium.org</owner> <owner>megjablon@chromium.org</owner> <owner>chrome-language@google.com</owner> @@ -342,7 +342,7 @@ </histogram> <histogram name="Translate.PageLoad.InitialTargetLanguage.Origin" - enum="TranslateTargetLanguageOrigin" expires_after="2023-12-17"> + enum="TranslateTargetLanguageOrigin" expires_after="2024-02-20"> <owner>megjablon@google.com</owner> <owner>chrome-language@google.com</owner> <summary> @@ -624,7 +624,7 @@ </histogram> <histogram name="Translate.Translation.TimeToBeReady" units="ms" - expires_after="2023-12-10"> + expires_after="2024-02-20"> <owner>megjablon@google.com</owner> <owner>chrome-language@google.com</owner> <summary> @@ -636,7 +636,7 @@ </histogram> <histogram name="Translate.Translation.TimeToLoad" units="ms" - expires_after="2023-12-10"> + expires_after="2024-02-20"> <owner>megjablon@google.com</owner> <owner>chrome-language@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/uma/histograms.xml b/tools/metrics/histograms/metadata/uma/histograms.xml index 355edad..a2b1a6ad 100644 --- a/tools/metrics/histograms/metadata/uma/histograms.xml +++ b/tools/metrics/histograms/metadata/uma/histograms.xml
@@ -117,7 +117,7 @@ </histogram> <histogram name="UMA.ChildProcess.Ping.{Source}" enum="UmaChildPingStatus" - expires_after="2023-11-01"> + expires_after="2024-02-20"> <owner>lucnguyen@google.com</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -322,7 +322,7 @@ </histogram> <histogram name="UMA.IndependentLog.{Provider}.FinalizeTime" units="ms" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>lucnguyen@google.com</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -351,7 +351,7 @@ </histogram> <histogram name="UMA.InitSequence" enum="UmaInitSequence" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -434,7 +434,7 @@ </histogram> <histogram name="UMA.MachineIdState" enum="UmaMachineIdState" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jwd@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -446,7 +446,7 @@ </histogram> <histogram name="UMA.MetricsIDsReset" enum="BooleanHit" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>jwd@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -656,7 +656,7 @@ </histogram> <histogram name="UMA.PersistentHistograms.InitResult" - enum="PersistentHistogramsInitResult" expires_after="2023-12-17"> + enum="PersistentHistogramsInitResult" expires_after="2024-02-20"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -666,7 +666,7 @@ </histogram> <histogram name="UMA.PrimaryUserType" enum="UserType" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>michaelpg@chromium.org</owner> <owner>yilkal@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> @@ -956,7 +956,7 @@ </histogram> <histogram name="UMA.TruncatedEvents.UserAction" units="events" - expires_after="2024-02-11"> + expires_after="2024-02-20"> <owner>rkaplow@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/v8/histograms.xml b/tools/metrics/histograms/metadata/v8/histograms.xml index 00eb2ec4..7af973b 100644 --- a/tools/metrics/histograms/metadata/v8/histograms.xml +++ b/tools/metrics/histograms/metadata/v8/histograms.xml
@@ -1089,7 +1089,7 @@ </summary> </histogram> -<histogram name="V8.GCIncrementalMarking" units="ms" expires_after="2023-12-17"> +<histogram name="V8.GCIncrementalMarking" units="ms" expires_after="2024-02-20"> <owner>hpayer@chromium.org</owner> <owner>mlippautz@chromium.org</owner> <owner>v8-memory-sheriffs@google.com</owner> @@ -1130,7 +1130,7 @@ <summary>Reason a mark-compact garbage collection was started in V8.</summary> </histogram> -<histogram name="V8.GCMarkingSum" units="ms" expires_after="2023-12-17"> +<histogram name="V8.GCMarkingSum" units="ms" expires_after="2024-02-20"> <owner>mlippautz@chromium.org</owner> <owner>v8-memory-sheriffs@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/variations/histograms.xml b/tools/metrics/histograms/metadata/variations/histograms.xml index 83af57b..87acfe1 100644 --- a/tools/metrics/histograms/metadata/variations/histograms.xml +++ b/tools/metrics/histograms/metadata/variations/histograms.xml
@@ -505,7 +505,7 @@ </histogram> <histogram name="Variations.SeedFetchResponseOrErrorCode{ConnectionType}" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2023-11-01"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2024-02-20"> <owner>asvitkine@chromium.org</owner> <owner>rkaplow@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> @@ -723,7 +723,7 @@ </histogram> <histogram name="Variations.{Mode}CreateTrials.SeedExpiry" - enum="VariationsSeedExpiry" expires_after="2023-11-01"> + enum="VariationsSeedExpiry" expires_after="2024-02-20"> <owner>asvitkine@chromium.org</owner> <owner>rkaplow@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner>
diff --git a/tools/metrics/histograms/metadata/web_apk/histograms.xml b/tools/metrics/histograms/metadata/web_apk/histograms.xml index dd97010..5a4cfac 100644 --- a/tools/metrics/histograms/metadata/web_apk/histograms.xml +++ b/tools/metrics/histograms/metadata/web_apk/histograms.xml
@@ -255,7 +255,7 @@ </histogram> <histogram name="WebApk.ShellApkVersion2{WebApkDistributorType}" units="units" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>hartmanng@chromium.org</owner> <owner>src/chrome/android/webapk/OWNERS</owner> <summary> @@ -299,7 +299,7 @@ </histogram> <histogram name="WebApk.Uninstall{WebApkDistributorType}" enum="BooleanHit" - expires_after="2023-12-01"> + expires_after="2024-02-20"> <owner>hartmanng@chromium.org</owner> <owner>src/chrome/android/webapk/OWNERS</owner> <summary> @@ -320,7 +320,7 @@ </histogram> <histogram name="WebApk.Update.GooglePlayUpdateResult" - enum="WebApkGooglePlayInstallResult" expires_after="2023-12-17"> + enum="WebApkGooglePlayInstallResult" expires_after="2024-02-20"> <owner>hartmanng@chromium.org</owner> <owner>src/chrome/android/webapk/OWNERS</owner> <summary> @@ -351,7 +351,7 @@ </histogram> <histogram name="WebApk.Update.RequestSent" enum="WebApkUpdateRequestSent" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>hartmanng@chromium.org</owner> <owner>src/chrome/android/webapk/OWNERS</owner> <summary> @@ -361,7 +361,7 @@ </histogram> <histogram name="WebApk.Update.UniqueId{SameOrEmpty}.{LegacyIdentifierType}" - enum="Boolean" expires_after="2023-12-01"> + enum="Boolean" expires_after="2024-02-20"> <owner>eirage@chromium.org</owner> <owner>hartmanng@chromium.org</owner> <owner>src/chrome/android/webapk/OWNERS</owner>
diff --git a/tools/metrics/histograms/metadata/web_audio/histograms.xml b/tools/metrics/histograms/metadata/web_audio/histograms.xml index 3f03fe40..a7ea926 100644 --- a/tools/metrics/histograms/metadata/web_audio/histograms.xml +++ b/tools/metrics/histograms/metadata/web_audio/histograms.xml
@@ -135,7 +135,7 @@ </histogram> <histogram name="WebAudio.AudioContextOptions.sampleRate" units="Hz" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>hongchan@chromium.org</owner> <owner>mjwilson@chromium.org</owner> <owner>src/third_party/blink/renderer/modules/webaudio/OWNERS</owner>
diff --git a/tools/metrics/histograms/metadata/web_rtc/histograms.xml b/tools/metrics/histograms/metadata/web_rtc/histograms.xml index 311f1c0..0263c4f 100644 --- a/tools/metrics/histograms/metadata/web_rtc/histograms.xml +++ b/tools/metrics/histograms/metadata/web_rtc/histograms.xml
@@ -1468,7 +1468,7 @@ </histogram> <histogram name="WebRTC.PeerConnection.RtcpMux" enum="PeerConnectionRtcpMux" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>hta@chromium.org</owner> <owner>webrtc-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/webapps/histograms.xml b/tools/metrics/histograms/metadata/webapps/histograms.xml index be40bd6..7eebcab 100644 --- a/tools/metrics/histograms/metadata/webapps/histograms.xml +++ b/tools/metrics/histograms/metadata/webapps/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="AppBanners.BeforeInstallEvent" - enum="AppBannersBeforeInstallEvent" expires_after="2023-12-17"> + enum="AppBannersBeforeInstallEvent" expires_after="2024-02-20"> <owner>dominickn@chromium.org</owner> <owner>pjmclachlan@google.com</owner> <owner>desktop-pwas-team@google.com</owner> @@ -899,7 +899,7 @@ </histogram> <histogram name="WebApp.LaunchContainer" enum="AppLaunchContainer" - expires_after="2023-12-17"> + expires_after="2024-02-20"> <owner>phillis@chromium.org</owner> <owner>desktop-pwas-team@google.com</owner> <summary> @@ -1367,7 +1367,7 @@ </histogram> <histogram name="WebApp.Shortcuts.Delete.Result" enum="BooleanSuccess" - expires_after="2023-12-16"> + expires_after="2024-02-20"> <owner>dmurph@google.com</owner> <owner>desktop-pwas-team@google.com</owner> <summary> @@ -1381,7 +1381,7 @@ </histogram> <histogram name="WebApp.Shortcuts.Update.Result" enum="BooleanSuccess" - expires_after="2023-12-16"> + expires_after="2024-02-20"> <owner>camdenking@google.com</owner> <owner>desktop-pwas-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/windows/histograms.xml b/tools/metrics/histograms/metadata/windows/histograms.xml index 6c41eb20..8b57591 100644 --- a/tools/metrics/histograms/metadata/windows/histograms.xml +++ b/tools/metrics/histograms/metadata/windows/histograms.xml
@@ -76,8 +76,32 @@ </summary> </histogram> +<histogram name="Windows.Enclave.{Type}.Available" enum="BooleanAvailable" + expires_after="2023-12-01"> + <owner>ajgo@chromium.org</owner> + <owner>wfh@chromium.org</owner> + <summary> + Whether or not support for {Type} is/are available for use on the system, by + calling IsEnclaveTypeSupported. Reported once per browser session, on + startup. + </summary> + <token key="Type"> + <variant name="SGX" + summary="an enclave for the Intel Software Guard Extensions (SGX) + architecture extension"/> + <variant name="SGX2" + summary="SGX2 and SGX1 enclaves (the platform and OS support SGX2 + instructions with EDMM on this platform - in addition to + other SGX2 constructs)"/> + <variant name="VBS" + summary="a virtualization-based security (VBS) enclave"/> + <variant name="VBSBasic" + summary="a virtualization-based security (VBS) basic enclave"/> + </token> +</histogram> + <histogram name="Windows.HasHighResolutionTimeTicks" enum="Boolean" - expires_after="2023-12-19"> + expires_after="2024-02-20"> <owner>brucedawson@chromium.org</owner> <owner>gab@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/xr/histograms.xml b/tools/metrics/histograms/metadata/xr/histograms.xml index 59c1648..60db11b 100644 --- a/tools/metrics/histograms/metadata/xr/histograms.xml +++ b/tools/metrics/histograms/metadata/xr/histograms.xml
@@ -30,7 +30,7 @@ </summary> </histogram> -<histogram name="VRSessionTime" units="ms" expires_after="2023-12-17"> +<histogram name="VRSessionTime" units="ms" expires_after="2024-02-20"> <owner>alcooper@chromium.org</owner> <owner>xr-dev@chromium.org</owner> <summary>
diff --git a/tools/perf/benchmarks/rendering.py b/tools/perf/benchmarks/rendering.py index 782f3db..8bdfc45 100644 --- a/tools/perf/benchmarks/rendering.py +++ b/tools/perf/benchmarks/rendering.py
@@ -37,6 +37,8 @@ 'Graphics.Smoothness.PercentDroppedFrames3.AllSequences', 'Memory.GPU.PeakMemoryUsage2.Scroll', 'Memory.GPU.PeakMemoryUsage2.PageLoad', + 'Event.ScrollJank.DelayedFramesPercentage.FixedWindow', + 'Event.ScrollJank.MissedVsyncsSum.FixedWindow', ]
diff --git a/tools/roll_webgl_conformance.py b/tools/roll_webgl_conformance.py index 987f31a..5694e09 100755 --- a/tools/roll_webgl_conformance.py +++ b/tools/roll_webgl_conformance.py
@@ -31,6 +31,10 @@ "mastername": "luci.chromium.try", "buildernames": ["android_optional_gpu_tests_rel"] }, + { + "mastername": "luci.chromium.try", + "buildernames": ["gpu-fyi-cq-android-arm64"] + }, ] SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) @@ -259,6 +263,7 @@ logging.debug('Pulling latest changes') if not ignore_checks: self._RunCommand(['git', 'pull']) + self._RunCommand(['gclient', 'sync']) self._RunCommand(['git', 'checkout', '-b', ROLL_BRANCH_NAME]) @@ -303,6 +308,7 @@ # Checkout main again. self._RunCommand(['git', 'checkout', 'main']) + self._RunCommand(['gclient', 'sync']) print('Roll branch left as ' + ROLL_BRANCH_NAME) return 0 @@ -312,6 +318,7 @@ self._RunCommand( ['gclient', 'setdep', '-r', dep_revision], working_dir=os.path.dirname(deps_filename)) + self._RunCommand(['gclient', 'sync']) def _UpdateWebGLRevTextFile(self, txt_filename, commit_info): # Rolling the WebGL conformance tests must cause at least all of @@ -328,6 +335,7 @@ def _DeleteRollBranch(self): self._RunCommand(['git', 'checkout', 'main']) + self._RunCommand(['gclient', 'sync']) self._RunCommand(['git', 'branch', '-D', ROLL_BRANCH_NAME]) logging.debug('Deleted the local roll branch (%s)', ROLL_BRANCH_NAME) @@ -362,6 +370,7 @@ # Ignore an error here in case an issue wasn't created for some reason. self._RunCommand(['git', 'cl', 'set_close'], ignore_exit_code=True) self._RunCommand(['git', 'checkout', active_branch]) + self._RunCommand(['gclient', 'sync']) self._RunCommand(['git', 'branch', '-D', ROLL_BRANCH_NAME]) return 0
diff --git a/ui/accessibility/ax_node_position.cc b/ui/accessibility/ax_node_position.cc index f676fb4..8eaf308 100644 --- a/ui/accessibility/ax_node_position.cc +++ b/ui/accessibility/ax_node_position.cc
@@ -17,7 +17,7 @@ // character and a word boundary. AXEmbeddedObjectBehavior g_ax_embedded_object_behavior = #if BUILDFLAG(IS_WIN) || BUILDFLAG(USE_ATK) - AXEmbeddedObjectBehavior::kExposeCharacter; + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext; #else AXEmbeddedObjectBehavior::kSuppressCharacter; #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(USE_ATK)
diff --git a/ui/accessibility/ax_node_position_unittest.cc b/ui/accessibility/ax_node_position_unittest.cc index fb99516..97a34a6 100644 --- a/ui/accessibility/ax_node_position_unittest.cc +++ b/ui/accessibility/ax_node_position_unittest.cc
@@ -2902,7 +2902,7 @@ TEST_F(AXPositionTest, AtStartOrEndOfParagraphWithEmbeddedObjectCharacter) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // This test ensures that "At{Start|End}OfParagraph" work correctly when there // are embedded objects present near a paragraph boundary. @@ -3957,7 +3957,7 @@ TEST_F(AXPositionTest, AsLeafTextPositionWithTextPositionAndEmbeddedObject) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // ++1 kRootWebArea "<embedded_object><embedded_object>" // ++++2 kImage alt="Test image" @@ -4672,7 +4672,7 @@ TEST_F(AXPositionTest, CreatePositionAtPreviousFormatStartWithTreePosition) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); TestPositionType tree_position = CreateTreePosition(static_text1_, 1 /* child_index */); ASSERT_NE(nullptr, tree_position); @@ -4732,7 +4732,7 @@ TEST_F(AXPositionTest, CreatePositionAtPreviousFormatStartWithTextPosition) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); TestPositionType text_position = CreateTextPosition( inline_box1_, 2 /* text_offset */, ax::mojom::TextAffinity::kDownstream); ASSERT_NE(nullptr, text_position); @@ -4808,7 +4808,7 @@ TEST_F(AXPositionTest, CreatePositionAtNextFormatEndWithTreePosition) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); TestPositionType tree_position = CreateTreePosition(button_, 0 /* child_index */); ASSERT_NE(nullptr, tree_position); @@ -4875,7 +4875,7 @@ TEST_F(AXPositionTest, CreatePositionAtNextFormatEndWithTextPosition) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); TestPositionType text_position = CreateTextPosition( button_, 0 /* text_offset */, ax::mojom::TextAffinity::kDownstream); ASSERT_NE(nullptr, text_position); @@ -4950,7 +4950,7 @@ TEST_F(AXPositionTest, CreatePositionAtNextFormatEndOnEmbeddedObject) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // ++root_1 // ++++heading_2 // ++++++static_text_3 "heading 1" @@ -7541,7 +7541,7 @@ // accessibility tree, e.g., in IAccessible2, UI Automation and Linux ATK // APIs. ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // This test ensures that "CreateParentPosition" (and by extension // "CreateAncestorPosition") works correctly when it is given either a tree or @@ -8359,7 +8359,7 @@ TEST_F(AXPositionTest, CreateParentAndLeafPositionWithEmbeddedObjects) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // ++kRootWebArea "<embedded>Hello<embedded>" // ++++kParagraph "Paragraph" @@ -9170,7 +9170,7 @@ TEST_F(AXPositionTest, AsLeafTextPositionBeforeCharacterIncludingGeneratedNewlines) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); TestPositionType text_position = CreateTextPosition( button_, 1 /* text_offset */, ax::mojom::TextAffinity::kDownstream); @@ -9294,7 +9294,7 @@ TEST_F(AXPositionTest, AsLeafTextPositionAfterCharacterIncludingGeneratedNewlines) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); TestPositionType text_position = CreateTextPosition( button_, 0 /* text_offset */, ax::mojom::TextAffinity::kDownstream); @@ -9479,7 +9479,7 @@ TEST_F(AXPositionTest, AsValidPositionInDescendantOfEmptyObject) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // ++1 kRootWebArea // ++++2 kButton @@ -9760,7 +9760,7 @@ TEST_F(AXPositionTest, CreateNextCharacterPositionIncludingGeneratedNewlines) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); TestPositionType text_position = CreateTextPosition( inline_box1_, 6 /* text_offset */, ax::mojom::TextAffinity::kDownstream); @@ -10084,7 +10084,7 @@ TEST_F(AXPositionTest, CreatePreviousCharacterPositionIncludingGeneratedNewlines) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); TestPositionType text_position = CreateTextPosition( inline_box2_, 0 /* text_offset */, ax::mojom::TextAffinity::kDownstream); @@ -10616,7 +10616,7 @@ TEST_F(AXPositionTest, OperatorEqualsTextPositionsInTextField) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // ++1 kRootWebArea // ++++2 kTextField editable @@ -10679,7 +10679,7 @@ TEST_F(AXPositionTest, OperatorEqualsTextPositionsInSearchBox) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // ++1 kRootWebArea // ++++2 kSearchBox editable @@ -10777,7 +10777,7 @@ TEST_F(AXPositionTest, OperatorsTreePositionsAroundEmbeddedCharacter) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // ++1 kRootWebArea "<embedded_object><embedded_object>" // ++++2 kParagraph "<embedded_object>" @@ -10909,7 +10909,7 @@ TEST_F(AXPositionTest, OperatorsTextPositionsAroundEmbeddedCharacter) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // ++1 kRootWebArea "<embedded_object><embedded_object>" // ++++2 kParagraph "<embedded_object>" @@ -11803,7 +11803,7 @@ TEST_F(AXPositionTest, EmptyObjectReplacedByCharacterTextNavigation) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // ++1 kRootWebArea // ++++2 kStaticText @@ -12132,7 +12132,7 @@ TEST_F(AXPositionTest, EmptyObjectReplacedByCharacterEmbedObject) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // Parent Tree // ++1 kRootWebArea @@ -12184,7 +12184,7 @@ // expanded, it must be accessible in the tree. This test ensures we can't // navigate into the options of a collapsed menu list popup. ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); // ++1 kRootWebArea // ++++2 kStaticText "Hi" @@ -12346,7 +12346,7 @@ TEST_F(AXPositionTest, GetUnignoredSelectionWithLeafNodes) { ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( - AXEmbeddedObjectBehavior::kExposeCharacter); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext); AXNodeData root_data; root_data.id = 1;
diff --git a/ui/accessibility/ax_position.h b/ui/accessibility/ax_position.h index dd78fdd..47e9999 100644 --- a/ui/accessibility/ax_position.h +++ b/ui/accessibility/ax_position.h
@@ -148,9 +148,18 @@ // `AXPlatformNodeTextRangeProvider` methods. Since an "embedded object // character" is the only character in a node, we also treat this character as a // word. +// +// However, there is a special case for UIA. kExposeCharacterForHypertext is +// used mainly to enable the hypertext logic and calculation for cases where the +// embedded object character is not needed. This logic is IA2 and ATK specific, +// and should not be used for UIA relevant calls and calculations. As a result, +// we have the kUIAExposeCharacterForTextContent which avoids the IA2/ATK +// specific logic for the text calculation but also keeps the same embedded +// object character behavior for cases when it is needed. enum class AXEmbeddedObjectBehavior { - kExposeCharacter, + kExposeCharacterForHypertext, kSuppressCharacter, + kUIAExposeCharacterForTextContent, }; // Controls whether embedded objects are represented by a replacement @@ -2755,11 +2764,12 @@ // // We can only create character stops around generated newline characters // when empty objects are represented in the accessible text (ie. when the - // behavior is set to `AXEmbeddedObjectBehavior::kExposeCharacter`). - // Otherwise, there's a risk that `CreateParentPosition` will create a - // position that doesn't point to the same character. This is because a - // position located right before a generated newline character will be - // represented in the parent ancestor with an upstream affinity. + // behavior is set to + // `AXEmbeddedObjectBehavior::kExposeCharacterForHypertext`). Otherwise, + // there's a risk that `CreateParentPosition` will create a position that + // doesn't point to the same character. This is because a position located + // right before a generated newline character will be represented in the + // parent ancestor with an upstream affinity. // // Let's consider this AXTree: // 1 root @@ -2804,7 +2814,7 @@ // even know they are there. bool AllowsCharacterStopsOnGeneratedNewline() const { return g_ax_embedded_object_behavior == - AXEmbeddedObjectBehavior::kExposeCharacter || + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext || !IsInUnignoredEmptyObject(); } @@ -4295,10 +4305,12 @@ if (IsNullPosition()) return base::EmptyString16(); + static const base::NoDestructor<std::u16string> embedded_character_str( + AXNode::kEmbeddedObjectCharacterUTF16); switch (embedded_object_behavior) { case AXEmbeddedObjectBehavior::kSuppressCharacter: return GetAnchor()->GetTextContentUTF16(); - case AXEmbeddedObjectBehavior::kExposeCharacter: + case AXEmbeddedObjectBehavior::kExposeCharacterForHypertext: // Special case, if a position's anchor node has only ignored // descendants, i.e., it appears to be empty to assistive software, on // some platforms we need to still treat it as a character and a word @@ -4306,11 +4318,23 @@ // the text representation used by this class, but we don't expose that // character to assistive software that tries to retrieve the node's // text content. - static const base::NoDestructor<std::u16string> embedded_character_str( - AXNode::kEmbeddedObjectCharacterUTF16); - if (IsInUnignoredEmptyObject()) + if (IsInUnignoredEmptyObject()) { return *embedded_character_str; + } return GetAnchor()->GetHypertext(); + case AXEmbeddedObjectBehavior::kUIAExposeCharacterForTextContent: + // For UIA, we still have the notion of embedded object characters for + // text navigation purposes. I.e. when AT's need to navigate around + // nodes and elements which are empty and should then be exposed as + // embedded object characters. + if (IsInUnignoredEmptyObject()) { + return *embedded_character_str; + } + // However, for UIA, we don't want to expose the Hypertext like the + // kExposeCharacterForHypertext case does, since that computation for + // Hypertext is IA2-specific. Instead, UIA needs the text contents of + // the node, which is what GetTextContentUTF16() returns. + return GetAnchor()->GetTextContentUTF16(); } } @@ -4390,7 +4414,7 @@ // TODO(nektar): Switch to anchor->GetTextContentLengthUTF8() after // AXPosition switches to using UTF8. return GetAnchor()->GetTextContentLengthUTF16(); - case AXEmbeddedObjectBehavior::kExposeCharacter: + case AXEmbeddedObjectBehavior::kExposeCharacterForHypertext: // Special case: If a node has only ignored descendants, i.e., it // appears to be empty to assistive software, on some platforms we need // to still treat it as a character and a word boundary. We achieve this @@ -4401,6 +4425,22 @@ if (IsInUnignoredEmptyObject()) return AXNode::kEmbeddedObjectCharacterLengthUTF16; return static_cast<int>(GetAnchor()->GetHypertext().length()); + case AXEmbeddedObjectBehavior::kUIAExposeCharacterForTextContent: + // For UIA, we still have the notion of embedded object characters for + // text navigation purposes. I.e. when AT's need to navigate around + // nodes and elements which are empty and should then be exposed as + // embedded object characters, and as such we need to return the length + // of the embedded object character when calculating the `MaxTextOffset` + // for these nodes. + if (IsInUnignoredEmptyObject()) { + return AXNode::kEmbeddedObjectCharacterLengthUTF16; + } + // However, for UIA, we don't want to expose the Hypertext like the + // kExposeCharacterForHypertext case does, since that computation for + // Hypertext is IA2-specific. Instead, UIA needs the text contents of + // the node, so for `MaxTextOffset()` we should return the length of the + // text content. + return GetAnchor()->GetTextContentLengthUTF16(); } } @@ -4653,7 +4693,8 @@ switch (g_ax_embedded_object_behavior) { case AXEmbeddedObjectBehavior::kSuppressCharacter: return false; - case AXEmbeddedObjectBehavior::kExposeCharacter: + case AXEmbeddedObjectBehavior::kExposeCharacterForHypertext: + case AXEmbeddedObjectBehavior::kUIAExposeCharacterForTextContent: // We expose an "object replacement character" for all nodes except: // A) Textual nodes, such as static text, inline text boxes and line // breaks, and B) Nodes that are invisible to platform APIs. @@ -4717,7 +4758,7 @@ // `ax::mojom::IntListAttribute::kWordStarts` attribute, so we need to // special case them here. if (g_ax_embedded_object_behavior == - AXEmbeddedObjectBehavior::kExposeCharacter && + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext && IsInUnignoredEmptyObject()) { // Using braces ensures that the vector will contain the given value, and // not create a vector of size 0. @@ -4749,7 +4790,7 @@ // characters as ordinary characters, it wouldn't be consistent to assume // they have no length and return 0 instead of 1. if (g_ax_embedded_object_behavior == - AXEmbeddedObjectBehavior::kExposeCharacter && + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext && IsInUnignoredEmptyObject()) { // Using braces ensures that the vector will contain the given value, and // not create a vector of size 1.
diff --git a/ui/accessibility/ax_range.h b/ui/accessibility/ax_range.h index 12e6f58..89cd9b1 100644 --- a/ui/accessibility/ax_range.h +++ b/ui/accessibility/ax_range.h
@@ -301,10 +301,10 @@ AXTextConcatenationBehavior concatenation_behavior = AXTextConcatenationBehavior::kWithoutParagraphBreaks, AXEmbeddedObjectBehavior embedded_object_behavior = - AXEmbeddedObjectBehavior::kExposeCharacter, + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext, int max_count = -1, bool include_ignored = false, - size_t* appended_newlines_count = nullptr) const { + std::vector<size_t>* appended_newlines_indices = nullptr) const { if (max_count == 0 || IsNull()) return std::u16string(); @@ -321,7 +321,6 @@ : anchor_->AsLeafTextPosition(); std::u16string range_text; - size_t computed_newlines_count = 0; bool is_first_non_whitespace_leaf = true; bool crossed_paragraph_boundary = false; bool is_first_included_leaf = true; @@ -355,7 +354,9 @@ // previous leaf position was a <br> (already ending with a newline). if (crossed_paragraph_boundary && !found_trailing_newline) { range_text += u"\n"; - computed_newlines_count++; + if (appended_newlines_indices) { + appended_newlines_indices->push_back(range_text.length() - 1); + } } is_first_non_whitespace_leaf = false; @@ -413,8 +414,6 @@ } } - if (appended_newlines_count) - *appended_newlines_count = computed_newlines_count; return range_text; }
diff --git a/ui/accessibility/ax_range_unittest.cc b/ui/accessibility/ax_range_unittest.cc index 1f6b1584..25f241d 100644 --- a/ui/accessibility/ax_range_unittest.cc +++ b/ui/accessibility/ax_range_unittest.cc
@@ -887,7 +887,7 @@ .append(part4); EXPECT_EQ(text, forward_range.GetText( AXTextConcatenationBehavior::kWithParagraphBreaks, - AXEmbeddedObjectBehavior::kExposeCharacter)); + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext)); } TEST_F(AXRangeTest, GetTextWithWholeObjects) { @@ -1160,19 +1160,22 @@ range_end->Clone()); TestPositionRange backward_test_range(std::move(range_end), std::move(range_start)); - size_t appended_newlines_count = 0; + std::vector<size_t> appended_newlines_indices; EXPECT_EQ(expected_text, forward_test_range.GetText( AXTextConcatenationBehavior::kWithParagraphBreaks, g_ax_embedded_object_behavior, -1, false, - &appended_newlines_count)); - EXPECT_EQ(expected_appended_newlines_count, appended_newlines_count); + &appended_newlines_indices)); + EXPECT_EQ(expected_appended_newlines_count, + appended_newlines_indices.size()); + appended_newlines_indices.clear(); EXPECT_EQ(expected_text, backward_test_range.GetText( AXTextConcatenationBehavior::kWithParagraphBreaks, g_ax_embedded_object_behavior, -1, false, - &appended_newlines_count)); - EXPECT_EQ(expected_appended_newlines_count, appended_newlines_count); + &appended_newlines_indices)); + EXPECT_EQ(expected_appended_newlines_count, + appended_newlines_indices.size()); }; std::u16string button_start_to_line1_end =
diff --git a/ui/accessibility/platform/ax_platform_node_cocoa.mm b/ui/accessibility/platform/ax_platform_node_cocoa.mm index c2174a3..fa03d48d 100644 --- a/ui/accessibility/platform/ax_platform_node_cocoa.mm +++ b/ui/accessibility/platform/ax_platform_node_cocoa.mm
@@ -2091,11 +2091,11 @@ if (axRange.IsNull()) return nil; - NSString* text = base::SysUTF16ToNSString( - axRange.GetText(ui::AXTextConcatenationBehavior::kWithoutParagraphBreaks, - ui::AXEmbeddedObjectBehavior::kExposeCharacter, - // Constrain the amount of text retrieved for performance. - /* max_count =*/200)); + NSString* text = base::SysUTF16ToNSString(axRange.GetText( + ui::AXTextConcatenationBehavior::kWithoutParagraphBreaks, + ui::AXEmbeddedObjectBehavior::kExposeCharacterForHypertext, + // Constrain the amount of text retrieved for performance. + /* max_count =*/200)); if (text.length == 0) { return nil;
diff --git a/ui/accessibility/platform/ax_platform_node_textprovider_win.cc b/ui/accessibility/platform/ax_platform_node_textprovider_win.cc index fec737e2..7672b06 100644 --- a/ui/accessibility/platform/ax_platform_node_textprovider_win.cc +++ b/ui/accessibility/platform/ax_platform_node_textprovider_win.cc
@@ -132,12 +132,12 @@ // Whether we expose embedded object characters for nodes is managed by the // |g_ax_embedded_object_behavior| global variable set in ax_node_position.cc. - // When on Windows, this variable is always set to kExposeCharacter... which - // is incorrect if we run UIA-specific code relating to computing text content - // of nodes that themselves do not have text, such as `<p>` elements. To avoid - // problems caused by that, we use the following - // ScopedAXEmbeddedObjectBehaviorSetter to modify the value of the global - // variable to what is really expected on UIA. + // When on Windows, this variable is always set to + // kExposeCharacterForHypertext... which is incorrect if we run UIA-specific + // code relating to computing text content of nodes that themselves do not + // have text, such as `<p>` elements. To avoid problems caused by that, we use + // the following ScopedAXEmbeddedObjectBehaviorSetter to modify the value of + // the global variable to what is really expected on UIA. ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( AXEmbeddedObjectBehavior::kSuppressCharacter);
diff --git a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc index ca887ab..d44e36d 100644 --- a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc +++ b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc
@@ -491,11 +491,12 @@ // // Whether we expose embedded object characters for nodes is managed by the // |g_ax_embedded_object_behavior| global variable set in ax_node_position.cc. - // When on Windows, this variable is always set to kExposeCharacter... which - // is incorrect if we run UIA-specific code. To avoid problems caused by that, - // we use the following ScopedAXEmbeddedObjectBehaviorSetter to modify the - // value of the global variable to what is really expected on UIA. - ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( + // When on Windows, this variable is always set to + // kExposeCharacterForHypertext... which is incorrect if we run UIA-specific + // code. To avoid problems caused by that, we use the following + // ScopedAXEmbeddedObjectBehaviorSetter to modify the value of the global + // variable to what is really expected on UIA. + ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior_find_text( AXEmbeddedObjectBehavior::kSuppressCharacter); WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_TEXTRANGE_FINDTEXT); @@ -503,23 +504,22 @@ // The following has to be called after setting the // ax_embedded_object_behavior. This is because it can modify `this`'s `start` // and `end`, and it will do so assuming - // `AXEmbeddedObjectBehavior::kExposeCharacter` if we do not set it to - // `kSuppressCharacter' above. This would lead to incorrect behavior where the - // `text_range` length = 1, since that is the length of the embedded object - // character. + // `AXEmbeddedObjectBehavior::kExposeCharacterForHypertext` if we do not set + // it to `kSuppressCharacter' above. This would lead to incorrect behavior + // where the `text_range` length = 1, since that is the length of the embedded + // object character. UIA_VALIDATE_TEXTRANGEPROVIDER_CALL_1_IN_1_OUT(string, result); std::u16string search_string = base::WideToUTF16(string); if (search_string.length() <= 0) return E_INVALIDARG; - size_t appended_newlines_count = 0; - std::u16string text_range = GetString(-1, &appended_newlines_count); + std::vector<size_t> appended_newlines_indices; + std::u16string text_range = GetString(-1, &appended_newlines_indices); size_t find_start; size_t find_length; if (base::i18n::StringSearch(search_string, text_range, &find_start, - &find_length, !ignore_case, !backwards) && - find_length > appended_newlines_count) { + &find_length, !ignore_case, !backwards)) { // TODO(https://crbug.com/1023599): There is a known issue here related to // text searches of a |string| starting and ending with a "\n", e.g. // "\nsometext" or "sometext\n" if the newline is computed from a line @@ -538,7 +538,10 @@ DCHECK(anchor); const int start_offset = start_ancestor_position->text_offset() + find_start; - const int end_offset = start_offset + find_length - appended_newlines_count; + const int end_offset = + start_offset + find_length - + GetAppendedNewLinesCountInRange(find_start, find_length, + appended_newlines_indices); const int max_end_offset = end_ancestor_position->text_offset(); DCHECK(start_offset <= end_offset && end_offset <= max_end_offset); @@ -727,6 +730,8 @@ } HRESULT AXPlatformNodeTextRangeProviderWin::GetText(int max_count, BSTR* text) { + ScopedAXEmbeddedObjectBehaviorSetter ax_embedded_object_behavior( + AXEmbeddedObjectBehavior::kUIAExposeCharacterForTextContent); WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_TEXTRANGE_GETTEXT); WIN_ACCESSIBILITY_API_PERF_HISTOGRAM(UMA_API_TEXTRANGE_GETTEXT); UIA_VALIDATE_TEXTRANGEPROVIDER_CALL_1_OUT(text); @@ -1206,11 +1211,34 @@ std::u16string AXPlatformNodeTextRangeProviderWin::GetString( int max_count, - size_t* appended_newlines_count) { + std::vector<size_t>* appended_newlines_indices) { AXNodeRange range(start()->Clone(), end()->Clone()); - return range.GetText(AXTextConcatenationBehavior::kWithParagraphBreaks, - AXEmbeddedObjectBehavior::kExposeCharacter, max_count, - false, appended_newlines_count); + return range.GetText( + AXTextConcatenationBehavior::kWithParagraphBreaks, + AXEmbeddedObjectBehavior::kUIAExposeCharacterForTextContent, max_count, + false, appended_newlines_indices); +} + +size_t AXPlatformNodeTextRangeProviderWin::GetAppendedNewLinesCountInRange( + size_t find_start, + size_t find_length, + const std::vector<size_t>& appended_newlines_indices) { + size_t relevant_appended_newlines_count = 0; + + for (size_t i = 0; i < appended_newlines_indices.size(); ++i) { + // Since the vector is ordered, we can break out of the loop once we've + // passed the end of the range. + if (appended_newlines_indices[i] > find_start + find_length) { + break; + } + + if (appended_newlines_indices[i] >= find_start && + appended_newlines_indices[i] < find_start + find_length) { + ++relevant_appended_newlines_count; + } + } + + return relevant_appended_newlines_count; } AXPlatformNodeWin* AXPlatformNodeTextRangeProviderWin::GetOwner() const {
diff --git a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.h b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.h index a9c9c2f..bd4381f 100644 --- a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.h +++ b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.h
@@ -121,8 +121,14 @@ IFACEMETHODIMP ExpandToEnclosingUnitImpl(TextUnit unit); - std::u16string GetString(int max_count, - size_t* appended_newlines_count = nullptr); + std::u16string GetString( + int max_count, + std::vector<size_t>* appended_newlines_indices = nullptr); + + static size_t GetAppendedNewLinesCountInRange( + size_t find_start, + size_t find_length, + const std::vector<size_t>& appended_newlines_indices); const AXPositionInstance& start() const { return endpoints_.GetStart(); } const AXPositionInstance& end() const { return endpoints_.GetEnd(); } AXPlatformNodeDelegate* GetDelegate(
diff --git a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc index 5601449..de07ea7 100644 --- a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc +++ b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc
@@ -1917,6 +1917,65 @@ } TEST_F(AXPlatformNodeTextRangeProviderTest, + TestGetVisibleRangesFindTextGetTextPipeline) { + TestAXTreeUpdate update(std::string(R"HTML( + ++1 kRootWebArea + ++++2 kGenericContainer state=kRichlyEditable + ++++++3 kGenericContainer + ++++++++4 kStaticText + ++++++++++5 kInlineTextBox + ++++++6 kGenericContainer boolAttribute=kIsLineBreakingObject,true + )HTML")); + update.nodes[2].SetName("Hello World"); + update.nodes[3].SetName("Hello World"); + update.nodes[4].SetName("Hello World"); + + Init(update); + + ComPtr<IRawElementProviderSimple> root_node = + GetRootIRawElementProviderSimple(); + + ComPtr<ITextProvider> text_provider; + EXPECT_HRESULT_SUCCEEDED( + root_node->GetPatternProvider(UIA_TextPatternId, &text_provider)); + + ComPtr<ITextRangeProvider> range; + EXPECT_HRESULT_SUCCEEDED(text_provider->get_DocumentRange(&range)); + + AXPlatformNodeWin* owner = + static_cast<AXPlatformNodeWin*>(AXPlatformNodeFromNode(GetNode(2))); + ASSERT_NE(owner, nullptr); + SetOwner(owner, range.Get()); + + base::win::ScopedBstr find_string(L"Hello"); + Microsoft::WRL::ComPtr<ITextRangeProvider> text_range_provider_found; + EXPECT_HRESULT_SUCCEEDED(range->FindText(find_string.Get(), false, false, + &text_range_provider_found)); + SetOwner(owner, text_range_provider_found.Get()); + EXPECT_UIA_TEXTRANGE_EQ(text_range_provider_found, L"Hello") + + ComPtr<ITextRangeProvider> selected_text_range_provider; + base::win::ScopedSafearray selection; + LONG index = 0; + text_range_provider_found->Select(); + + AXPlatformNodeDelegate* delegate = owner->GetDelegate(); + + // Verify selection. + AXSelection unignored_selection = delegate->GetUnignoredSelection(); + + // Verify the content of the selection. + text_provider->GetSelection(selection.Receive()); + ASSERT_NE(nullptr, selection.Get()); + + EXPECT_HRESULT_SUCCEEDED( + SafeArrayGetElement(selection.Get(), &index, + static_cast<void**>(&selected_text_range_provider))); + SetOwner(owner, selected_text_range_provider.Get()); + EXPECT_UIA_TEXTRANGE_EQ(selected_text_range_provider, L"Hello"); +} + +TEST_F(AXPlatformNodeTextRangeProviderTest, TestITextRangeProviderMoveCharacter) { Init(BuildAXTreeForMove()); AXNode* root_node = GetRoot();
diff --git a/ui/accessibility/platform/ax_platform_node_win_unittest.cc b/ui/accessibility/platform/ax_platform_node_win_unittest.cc index 3370be8..95067c2 100644 --- a/ui/accessibility/platform/ax_platform_node_win_unittest.cc +++ b/ui/accessibility/platform/ax_platform_node_win_unittest.cc
@@ -269,7 +269,8 @@ } AXPlatformNodeWinTest::AXPlatformNodeWinTest() - : ax_embedded_object_behavior_(AXEmbeddedObjectBehavior::kExposeCharacter) { + : ax_embedded_object_behavior_( + AXEmbeddedObjectBehavior::kExposeCharacterForHypertext) { scoped_feature_list_.InitAndEnableFeature(features::kIChromeAccessible); }
diff --git a/ui/base/moving_max.h b/ui/base/moving_max.h index 639c201..c1f1bcc 100644 --- a/ui/base/moving_max.h +++ b/ui/base/moving_max.h
@@ -4,6 +4,7 @@ #ifndef UI_BASE_MOVING_MAX_H_ #define UI_BASE_MOVING_MAX_H_ +#include <stddef.h> #include <stdint.h> #include <vector>
diff --git a/ui/gfx/color_transform.cc b/ui/gfx/color_transform.cc index 8ee705e9..5c1aa353 100644 --- a/ui/gfx/color_transform.cc +++ b/ui/gfx/color_transform.cc
@@ -182,7 +182,7 @@ BASE_FEATURE(kHlgPqUnifiedTonemap, "HlgPqUnifiedTonemap", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kHlgPqSdrRelative, "HlgPqSdrRelative",
diff --git a/ui/views/view_unittest_mac.mm b/ui/views/view_unittest_mac.mm index 6de93389..ba89f8f 100644 --- a/ui/views/view_unittest_mac.mm +++ b/ui/views/view_unittest_mac.mm
@@ -6,8 +6,6 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/raw_ptr.h" -#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/events/gesture_event_details.h" #include "ui/views/test/widget_test.h" @@ -45,102 +43,79 @@ namespace { -// Stores last received swipe gesture direction vector in -// |last_swipe_gesture()|. +enum SwipeType { + SWIPE_NONE, + SWIPE_LEFT, + SWIPE_RIGHT, + SWIPE_UP, + SWIPE_DOWN, +}; + +// Stores last received swipe gesture direction. class ThreeFingerSwipeView : public View { public: - ThreeFingerSwipeView() = default; - - ThreeFingerSwipeView(const ThreeFingerSwipeView&) = delete; - ThreeFingerSwipeView& operator=(const ThreeFingerSwipeView&) = delete; - // View: void OnGestureEvent(ui::GestureEvent* event) override { EXPECT_EQ(ui::ET_GESTURE_SWIPE, event->details().type()); - int dx = 0, dy = 0; - if (event->details().swipe_left()) - dx = -1; - - if (event->details().swipe_right()) { - EXPECT_EQ(0, dx); - dx = 1; + if (event->details().swipe_left()) { + last_swipe_ = SWIPE_LEFT; + } else if (event->details().swipe_right()) { + last_swipe_ = SWIPE_RIGHT; + } else if (event->details().swipe_up()) { + last_swipe_ = SWIPE_UP; + } else if (event->details().swipe_down()) { + last_swipe_ = SWIPE_DOWN; + } else { + NOTREACHED(); } - - if (event->details().swipe_down()) - dy = 1; - - if (event->details().swipe_up()) { - EXPECT_EQ(0, dy); - dy = -1; - } - - last_swipe_gesture_ = gfx::Point(dx, dy); } - absl::optional<gfx::Point> last_swipe_gesture() const { - return last_swipe_gesture_; - } + SwipeType last_swipe() const { return last_swipe_; } private: - absl::optional<gfx::Point> last_swipe_gesture_; + SwipeType last_swipe_{SWIPE_NONE}; }; +using ViewMacTest = test::WidgetTest; + +SwipeType SendSwipeGesture(ThreeFingerSwipeView* view, NSPoint gesture) { + NSWindow* window = view->GetWidget()->GetNativeWindow().GetNativeNSWindow(); + FakeSwipeEvent* swipe_event = [[FakeSwipeEvent alloc] init]; + swipe_event.deltaX = gesture.x; + swipe_event.deltaY = gesture.y; + swipe_event.window = window; + swipe_event.locationInWindow = NSMakePoint(50, 50); + swipe_event.timestamp = NSProcessInfo.processInfo.systemUptime; + + // BridgedContentView should create an appropriate ui::GestureEvent and pass + // it to the Widget. + [window.contentView swipeWithEvent:swipe_event]; + return view->last_swipe(); +} + +// Test that three-finger swipe events are translated by BridgedContentView. +TEST_F(ViewMacTest, HandlesThreeFingerSwipeGestures) { + WidgetAutoclosePtr widget(CreateTopLevelPlatformWidget()); + widget->SetBounds(gfx::Rect(0, 0, 100, 100)); + widget->Show(); + + auto* view = widget->non_client_view()->frame_view()->AddChildView( + std::make_unique<ThreeFingerSwipeView>()); + view->SetSize(widget->GetClientAreaBoundsInScreen().size()); + + // Remember that in AppKit coordinates, x and y increase towards the top-left. + const NSPoint nsleft = NSMakePoint(1, 0); + const NSPoint nsright = NSMakePoint(-1, 0); + const NSPoint nsup = NSMakePoint(0, 1); + const NSPoint nsdown = NSMakePoint(0, -1); + + EXPECT_EQ(SWIPE_LEFT, SendSwipeGesture(view, nsleft)); + EXPECT_EQ(SWIPE_RIGHT, SendSwipeGesture(view, nsright)); + EXPECT_EQ(SWIPE_DOWN, SendSwipeGesture(view, nsdown)); + EXPECT_EQ(SWIPE_UP, SendSwipeGesture(view, nsup)); +} + } // namespace -class ViewMacTest : public test::WidgetTest { - public: - ViewMacTest() = default; - - ViewMacTest(const ViewMacTest&) = delete; - ViewMacTest& operator=(const ViewMacTest&) = delete; - - absl::optional<gfx::Point> SwipeGestureVector(int dx, int dy) { - FakeSwipeEvent* swipe_event = [[FakeSwipeEvent alloc] init]; - swipe_event.deltaX = dx; - swipe_event.deltaY = dy; - swipe_event.window = widget_->GetNativeWindow().GetNativeNSWindow(); - swipe_event.locationInWindow = NSMakePoint(50, 50); - swipe_event.timestamp = NSProcessInfo.processInfo.systemUptime; - - // BridgedContentView should create an appropriate ui::GestureEvent and pass - // it to the Widget. - [widget_->GetNativeWindow().GetNativeNSWindow().contentView - swipeWithEvent:swipe_event]; - return view_->last_swipe_gesture(); - } - - // testing::Test: - void SetUp() override { - WidgetTest::SetUp(); - - widget_ = CreateTopLevelPlatformWidget(); - widget_->SetBounds(gfx::Rect(0, 0, 100, 100)); - widget_->Show(); - - view_ = new ThreeFingerSwipeView; - view_->SetSize(widget_->GetClientAreaBoundsInScreen().size()); - widget_->non_client_view()->frame_view()->AddChildView(view_.get()); - } - - void TearDown() override { - widget_->CloseNow(); - WidgetTest::TearDown(); - } - - private: - raw_ptr<Widget, DanglingUntriaged> widget_ = nullptr; - raw_ptr<ThreeFingerSwipeView, DanglingUntriaged> view_ = nullptr; -}; - -// Three-finger swipes send immediate events and they cannot be tracked. -TEST_F(ViewMacTest, HandlesThreeFingerSwipeGestures) { - // Note that positive delta is left and up for NSEvent, which is the inverse - // of ui::GestureEventDetails. - EXPECT_EQ(gfx::Point(1, 0), *SwipeGestureVector(-1, 0)); - EXPECT_EQ(gfx::Point(-1, 0), *SwipeGestureVector(1, 0)); - EXPECT_EQ(gfx::Point(0, 1), *SwipeGestureVector(0, -1)); - EXPECT_EQ(gfx::Point(0, -1), *SwipeGestureVector(0, 1)); -} - } // namespace views
diff --git a/v8 b/v8 index c2dd928..f413feb 160000 --- a/v8 +++ b/v8
@@ -1 +1 @@ -Subproject commit c2dd92816971fd8cdb8db15d9ac1e0ffb5ca5858 +Subproject commit f413feb63b48498dac02e21626efdf3be938862a