diff --git a/DEPS b/DEPS index 0589b704..5065492 100644 --- a/DEPS +++ b/DEPS
@@ -305,7 +305,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'src_internal_revision': 'cce7577191a433fcfb0930d6a8bdd99632e7bb28', + 'src_internal_revision': '6b1a25bd76bb7b2eb1682803a9e6ebfffe217162', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. @@ -313,7 +313,7 @@ # 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': 'ebf02ba08602e6e8d46a85c1035663f497a40d22', + 'v8_revision': '21cb77a290b0f8d9174e681e9994fd0789957c0b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. @@ -325,7 +325,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': 'a5bb284fd0387fe11def18f1048516fa60313c77', + 'pdfium_revision': 'bb8fd49d1000b558aaa017d52936cfcadb1795fd', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -380,7 +380,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '180b79d05050132d75733851bcb06c251a537f66', + 'catapult_revision': '5c1525f035b3ffeadd8a6e7750de77344e68112d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling chromium_variations # and whatever else without interference from each other. @@ -400,7 +400,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': 'fd10bc6f17bc4aa259e08d8919652322981f08c5', + 'devtools_frontend_revision': '90df4938501d1d93882c0e4b728e5869203fce92', # 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. @@ -424,7 +424,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': 'f56616d501a644383b7abe9848a905aece2a26da', + 'dawn_revision': 'b61659d71d467bb4f6f0ab1bcd8b2592383c49ef', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -468,7 +468,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. - 'cros_components_revision': '99998f1608c8b13dab09cdc0585a0f8007211080', + 'cros_components_revision': '4a3a8e04f11a06540a2b286d3959ac1b4b81ccb0', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -824,7 +824,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - '271b17d7f642611a02c0b448cfb3b96f96c1ba3b', + '1b10f2fd7011f7dd42e02cb6cf687c833494db65', 'condition': 'checkout_android and checkout_src_internal', }, @@ -986,7 +986,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': '_EFR2AE4tYf4EVCMpmbLWfPPFlsLFCn-2PGy8RRZiyIC', + 'version': '8W71dyBO10LAZ7st6G_K1g2WBl-YrrMuQGJkhktKzBYC', }, ], 'condition': 'checkout_android', @@ -1197,7 +1197,7 @@ Var('chromium_git') + '/external/github.com/google/cpu_features.git' + '@' + '936b9ab5515dead115606559502e3864958f7f6e', 'src/third_party/cpuinfo/src': - Var('chromium_git') + '/external/github.com/pytorch/cpuinfo.git' + '@' + 'd6860c477c99f1fce9e28eb206891af3c0e1a1d7', + Var('chromium_git') + '/external/github.com/pytorch/cpuinfo.git' + '@' + 'ef634603954d88d2643d5809011288b890ac126e', 'src/third_party/crc32c/src': Var('chromium_git') + '/external/github.com/google/crc32c.git' + '@' + 'fa5ade41ee480003d9c5af6f43567ba22e4e17e6', @@ -1218,13 +1218,13 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'f078723bf4a546a5b9c5c2c10734d0a37f684b69', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '38b8de056ebb9d0aa138f09907fa83c5b6107bb5', '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' + '@' + 'c4f2afc97855cd2f0b951e952e0bef4f135e8eda', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + 'b53978fe7888e7831b6acb4698fae39f734f6524', 'condition': 'checkout_src_internal', }, @@ -1232,7 +1232,7 @@ Var('chromium_git') + '/chromium/dom-distiller/dist.git' + '@' + '199de96b345ada7c6e7e6ba3d2fa7a6911b8767d', 'src/third_party/eigen3/src': - Var('chromium_git') + '/external/gitlab.com/libeigen/eigen.git' + '@' + 'aa6964bf3a34fd607837dd8123bc42465185c4f8', + Var('chromium_git') + '/external/gitlab.com/libeigen/eigen.git' + '@' + '3cf6bb6f1ce9cd3cd6bdc43cdcfae7f4822ff2c3', 'src/third_party/emoji-metadata/src': { 'url': Var('chromium_git') + '/external/github.com/googlefonts/emoji-metadata' + '@' + '045f146fca682a836e01cd265171312bfb300e06', @@ -1821,7 +1821,7 @@ Var('chromium_git') + '/external/github.com/GoogleChromeLabs/text-fragments-polyfill.git' + '@' + 'c036420683f672d685e27415de0a5f5e85bdc23f', 'src/third_party/tflite/src': - Var('chromium_git') + '/external/github.com/tensorflow/tensorflow.git' + '@' + '1f9ffe6c62b9418f6ff131d7b38ae17f3d1df006', + Var('chromium_git') + '/external/github.com/tensorflow/tensorflow.git' + '@' + '1a6ed44670279ff61e9d984067127acf5704344f', 'src/third_party/turbine': { 'packages': [ @@ -1834,7 +1834,7 @@ 'dep_type': 'cipd', }, - 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@cf897faaa6670b6196106f53d2843a6b77ff1a6e', + 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@856d90fb41aaf1b662652010ac22abbcb7b7b8ab', 'src/third_party/vulkan_memory_allocator': Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + '56300b29fbfcc693ee6609ddad3fdd5b7a449a21', @@ -1874,7 +1874,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '300768e70537a52889f9e283465b1fbf8679ebfb', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'a9d497b52dc21497fdfd0e8c03ab2f8559e02d15', + Var('webrtc_git') + '/src.git' + '@' + 'a37b29f3a9f21eef4190f0d232aff2ef19819ef4', # 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. @@ -1986,7 +1986,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/eche_app/app', - 'version': 'j21Q20N2fPKKIGhlZfSSFdsX_oevxknaW6qiXYZl8QQC', + 'version': 'aMWcmQbwDSAhG9e1YP71Ff8Dat-GQhFyBIhEgmtq4m4C', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -3977,7 +3977,7 @@ 'src/components/optimization_guide/internal': { 'url': Var('chrome_git') + '/chrome/components/optimization_guide.git' + '@' + - '80d7d6e3436af2186c17c4fa76774715d26c7c67', + '60f9997f88f625ec79d7de4197b1a8242ea6863e', 'condition': 'checkout_src_internal', },
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 10fb236..278ad60 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -1467,6 +1467,8 @@ "system/federated/test_federated_service_controller.h", "system/firmware_update/firmware_update_notification_controller.cc", "system/firmware_update/firmware_update_notification_controller.h", + "system/focus_mode/focus_mode_chip_carousel.cc", + "system/focus_mode/focus_mode_chip_carousel.h", "system/focus_mode/focus_mode_controller.cc", "system/focus_mode/focus_mode_controller.h", "system/focus_mode/focus_mode_countdown_view.cc", @@ -3479,6 +3481,7 @@ "system/federated/federated_client_manager_unittest.cc", "system/federated/federated_service_controller_impl_unittest.cc", "system/firmware_update/firmware_update_notification_controller_unittest.cc", + "system/focus_mode/focus_mode_chip_carousel_unittest.cc", "system/focus_mode/focus_mode_controller_unittest.cc", "system/focus_mode/focus_mode_countdown_view_unittest.cc", "system/focus_mode/focus_mode_detailed_view_unittest.cc",
diff --git a/ash/capture_mode/capture_mode_controller.cc b/ash/capture_mode/capture_mode_controller.cc index 7a7be3f7..3bdb2c1 100644 --- a/ash/capture_mode/capture_mode_controller.cc +++ b/ash/capture_mode/capture_mode_controller.cc
@@ -120,17 +120,17 @@ // The screenshot notification button index. enum ScreenshotNotificationButtonIndex { - BUTTON_EDIT = 0, - BUTTON_DELETE, + kButtonEdit = 0, + kButtonDelete, }; // The video notification button index. enum GameDashboardVideoNotificationButtonIndex { - BUTTON_SHARE_TO_YOUTUBE = 0, - BUTTON_DELETE_GAME_VIDEO, + kButtonShareToYoutube = 0, + kButtonDeleteGameVideo, }; enum VideoNotificationButtonIndex { - BUTTON_DELETE_VIDEO = 0, + kButtonDeleteVideo = 0, }; // Returns the file extension for the given `recording_type` and the current @@ -1659,11 +1659,11 @@ if (behavior_type == BehaviorType::kGameDashboard) { switch (button_index_value) { case GameDashboardVideoNotificationButtonIndex:: - BUTTON_SHARE_TO_YOUTUBE: + kButtonShareToYoutube: OnShareToYouTubeButtonPressed(); break; case GameDashboardVideoNotificationButtonIndex:: - BUTTON_DELETE_GAME_VIDEO: + kButtonDeleteGameVideo: DeleteFileAsync(blocking_task_runner_, screen_capture_path, std::move(on_file_deleted_callback_for_test_)); break; @@ -1672,7 +1672,7 @@ break; } } else { - CHECK_EQ(VideoNotificationButtonIndex::BUTTON_DELETE_VIDEO, + CHECK_EQ(VideoNotificationButtonIndex::kButtonDeleteVideo, button_index_value); DeleteFileAsync(blocking_task_runner_, screen_capture_path, std::move(on_file_deleted_callback_for_test_)); @@ -1680,12 +1680,12 @@ } else { CHECK_EQ(type, CaptureModeType::kImage); switch (button_index_value) { - case ScreenshotNotificationButtonIndex::BUTTON_EDIT: + case ScreenshotNotificationButtonIndex::kButtonEdit: delegate_->OpenScreenshotInImageEditor(screen_capture_path); RecordScreenshotNotificationQuickAction( CaptureQuickAction::kBacklight); break; - case ScreenshotNotificationButtonIndex::BUTTON_DELETE: + case ScreenshotNotificationButtonIndex::kButtonDelete: DeleteFileAsync(blocking_task_runner_, screen_capture_path, std::move(on_file_deleted_callback_for_test_)); RecordScreenshotNotificationQuickAction(CaptureQuickAction::kDelete);
diff --git a/ash/components/arc/metrics/arc_wm_metrics.cc b/ash/components/arc/metrics/arc_wm_metrics.cc index 3c0be28..ea80a745 100644 --- a/ash/components/arc/metrics/arc_wm_metrics.cc +++ b/ash/components/arc/metrics/arc_wm_metrics.cc
@@ -117,7 +117,7 @@ ArcWmMetrics::GetWindowEnterTabletModeTimeHistogramName(app_type), window_operation_elapsed_timer_.Elapsed(), /*minimum=*/base::Milliseconds(1), - /*maximum=*/base::Seconds(2), 100); + /*maximum=*/base::Seconds(5), 100); } } else { if (state->IsMaximized()) { @@ -125,7 +125,7 @@ ArcWmMetrics::GetWindowMaximizedTimeHistogramName(app_type), window_operation_elapsed_timer_.Elapsed(), /*minimum=*/base::Milliseconds(1), - /*maximum=*/base::Seconds(2), 100); + /*maximum=*/base::Seconds(3), 100); } else if (state->IsMinimized()) { base::UmaHistogramCustomTimes( ArcWmMetrics::GetWindowMinimizedTimeHistogramName(app_type), @@ -137,7 +137,7 @@ ArcWmMetrics::GetWindowExitTabletModeTimeHistogramName(app_type), window_operation_elapsed_timer_.Elapsed(), /*minimum=*/base::Milliseconds(1), - /*maximum=*/base::Seconds(2), 100); + /*maximum=*/base::Seconds(5), 100); } } } @@ -180,7 +180,7 @@ ArcWmMetrics::GetArcWindowClosedTimeHistogramName(), window_close_elapsed_timer_.Elapsed(), /*minimum=*/base::Milliseconds(1), - /*maximum=*/base::Seconds(2), 100); + /*maximum=*/base::Seconds(3), 100); } // Tracks the elapsed time from the window closing operation happens until the
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index 47c21f5c..43603de 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -1888,6 +1888,12 @@ "OnDeviceSpeechRecognition", base::FEATURE_DISABLED_BY_DEFAULT); +// Whether the OneDrive upload flow should immediately prompt the user to +// re-authenticate without first showing a notification. +BASE_FEATURE(kOneDriveUploadImmediateReauth, + "OneDriveUploadImmediateReauth", + base::FEATURE_ENABLED_BY_DEFAULT); + // If enabled, CHOBOE Screen will be shown during the new user onboarding flow. BASE_FEATURE(kOobeChoobe, "OobeChoobe", base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index 2921887..4a446f7 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -578,6 +578,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kOnDeviceGrammarCheck); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kOnDeviceSpeechRecognition); +COMPONENT_EXPORT(ASH_CONSTANTS) +BASE_DECLARE_FEATURE(kOneDriveUploadImmediateReauth); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kOnlyShowNewShortcutsApp); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kSearchCustomizableShortcutsInLauncher);
diff --git a/ash/constants/ash_switches.cc b/ash/constants/ash_switches.cc index 655ee28..7516ca31 100644 --- a/ash/constants/ash_switches.cc +++ b/ash/constants/ash_switches.cc
@@ -623,6 +623,11 @@ // for any type of user. Should be used only for testing. const char kForceHappinessTrackingSystem[] = "force-happiness-tracking-system"; +// Forces prelaunching Lacros at login screen regardless +// of whether there are or aren't users with Lacros enabled. +const char kForceLacrosLaunchAtLoginScreenForTesting[] = + "force-lacros-launch-at-login-screen-for-testing"; + // Forces FullRestoreService to launch browser for telemetry tests. const char kForceLaunchBrowser[] = "force-launch-browser";
diff --git a/ash/constants/ash_switches.h b/ash/constants/ash_switches.h index a999a27..afcfd98 100644 --- a/ash/constants/ash_switches.h +++ b/ash/constants/ash_switches.h
@@ -211,6 +211,8 @@ extern const char kForceHWIDCheckResultForTest[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kForceHappinessTrackingSystem[]; +COMPONENT_EXPORT(ASH_CONSTANTS) +extern const char kForceLacrosLaunchAtLoginScreenForTesting[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kForceLaunchBrowser[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kForceLoginManagerInTests[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kForceShowCursor[];
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index e664e027..85dfa36 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc
@@ -999,7 +999,8 @@ absl::optional<OverviewStartAction> action, absl::optional<OverviewEnterExitType> type, WindowSnapActionSource snap_action_source) { - if (!OverviewController::Get()->CanEnterOverview()) { + if (split_view_overview_session_ || + !OverviewController::Get()->CanEnterOverview()) { // If we can't start overview, we shouldn't start split view overview // either. This can happen when we restore snap state after exiting // overview.
diff --git a/ash/style/ash_color_mixer.cc b/ash/style/ash_color_mixer.cc index ecc4066f..43a6ce0 100644 --- a/ash/style/ash_color_mixer.cc +++ b/ash/style/ash_color_mixer.cc
@@ -434,6 +434,7 @@ mixer[cros_tokens::kCrosRefNeutral0] = {ui::kColorRefNeutral0}; mixer[cros_tokens::kCrosRefNeutral8] = {ui::kColorRefNeutral8}; mixer[cros_tokens::kCrosRefNeutral10] = {ui::kColorRefNeutral10}; + mixer[cros_tokens::kCrosRefNeutral15] = {ui::kColorRefNeutral15}; mixer[cros_tokens::kCrosRefNeutral20] = {ui::kColorRefNeutral20}; mixer[cros_tokens::kCrosRefNeutral25] = {ui::kColorRefNeutral25}; mixer[cros_tokens::kCrosRefNeutral30] = {ui::kColorRefNeutral30};
diff --git a/ash/system/focus_mode/focus_mode_chip_carousel.cc b/ash/system/focus_mode/focus_mode_chip_carousel.cc new file mode 100644 index 0000000..8ec895b --- /dev/null +++ b/ash/system/focus_mode/focus_mode_chip_carousel.cc
@@ -0,0 +1,106 @@ +// 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 "ash/system/focus_mode/focus_mode_chip_carousel.h" + +#include "ash/resources/vector_icons/vector_icons.h" +#include "ash/style/style_util.h" +#include "ui/chromeos/styles/cros_tokens_color_mappings.h" +#include "ui/views/animation/ink_drop.h" +#include "ui/views/border.h" +#include "ui/views/controls/button/label_button.h" +#include "ui/views/controls/highlight_path_generator.h" +#include "ui/views/layout/box_layout_view.h" + +namespace ash { + +namespace { + +constexpr auto kScrollViewInsets = gfx::Insets::TLBR(16, 0, 0, 0); +constexpr int kChipSpaceInbetween = 8; +constexpr int kChipHeight = 32; +constexpr int kChipMaxWidth = 192; +constexpr auto kChipInsets = gfx::Insets::TLBR(0, 8, 0, 12); +constexpr int kChipImageSize = 16; +constexpr int kChipCornerRadius = 16; +constexpr int kChipImageSpacing = 12; +constexpr size_t kMaxTasks = 5; + +void SetupChip(views::LabelButton* chip) { + chip->SetHorizontalAlignment(gfx::ALIGN_CENTER); + chip->SetBorder(views::CreatePaddedBorder( + views::CreateThemedRoundedRectBorder(1, kChipHeight, + cros_tokens::kCrosSysSeparator), + kChipInsets)); + chip->SetLabelStyle(views::style::STYLE_BODY_3_MEDIUM); + chip->SetMinSize(gfx::Size(0, kChipHeight)); + chip->SetMaxSize(gfx::Size(kChipMaxWidth, kChipHeight)); + chip->SetImageLabelSpacing(kChipImageSpacing); + chip->SetImageModel(views::Button::STATE_NORMAL, + ui::ImageModel::FromVectorIcon( + kGlanceablesTasksIcon, cros_tokens::kCrosSysOnSurface, + kChipImageSize)); + views::FocusRing::Get(chip)->SetColorId(cros_tokens::kCrosSysFocusRing); + views::InstallRoundRectHighlightPathGenerator(chip, gfx::Insets(1), + kChipCornerRadius); + views::InkDrop::Get(chip)->SetMode(views::InkDropHost::InkDropMode::ON); + chip->SetHasInkDropActionOnClick(true); + StyleUtil::ConfigureInkDropAttributes( + chip, StyleUtil::kBaseColor | StyleUtil::kInkDropOpacity); + chip->SetNotifyEnterExitOnChild(true); +} + +} // namespace + +// `on_chip_pressed` will be called when a task chip is clicked, containing a +// string name of a task. +FocusModeChipCarousel::FocusModeChipCarousel( + ChipPressedCallback on_chip_pressed) + : views::ScrollView(views::ScrollView::ScrollWithLayers::kEnabled), + on_chip_pressed_(std::move(on_chip_pressed)) { + SetBorder(views::CreateEmptyBorder(kScrollViewInsets)); + SetHorizontalScrollBarMode( + views::ScrollView::ScrollBarMode::kHiddenButEnabled); + SetDrawOverflowIndicator(false); + SetPaintToLayer(ui::LAYER_NOT_DRAWN); + SetBackgroundColor(absl::nullopt); + + scroll_contents_ = SetContents(std::make_unique<views::BoxLayoutView>()); + scroll_contents_->SetOrientation(views::BoxLayout::Orientation::kHorizontal); + scroll_contents_->SetBetweenChildSpacing(kChipSpaceInbetween); +} + +FocusModeChipCarousel::~FocusModeChipCarousel() = default; + +void FocusModeChipCarousel::SetTasks(const std::vector<std::u16string>& tasks) { + scroll_contents_->RemoveAllChildViews(); + if (tasks.empty()) { + return; + } + + // Populate a maximum of `kMaxTasks` tasks. + const size_t num_tasks = std::min(tasks.size(), kMaxTasks); + int content_width = kChipSpaceInbetween * (num_tasks - 1) + + (kChipInsets.width() + kChipSpaceInbetween) * num_tasks; + + for (size_t i = 0; i < num_tasks; i++) { + const std::u16string& task = tasks[i]; + views::LabelButton* chip = + scroll_contents_->AddChildView(std::make_unique<views::LabelButton>( + base::BindRepeating(on_chip_pressed_, task), task)); + SetupChip(chip); + content_width += chip->GetPreferredSize().width(); + } + + // Now that the chips have populated, contract the contents to only be wide + // enough to fit all the chips with no extra space, but not narrow enough to + // make the chips contract. + scroll_contents_->SetPreferredSize(gfx::Size(content_width, kChipHeight)); +} + +bool FocusModeChipCarousel::HasTasks() const { + return !scroll_contents_->GetChildrenInZOrder().empty(); +} + +} // namespace ash
diff --git a/ash/system/focus_mode/focus_mode_chip_carousel.h b/ash/system/focus_mode/focus_mode_chip_carousel.h new file mode 100644 index 0000000..6302532 --- /dev/null +++ b/ash/system/focus_mode/focus_mode_chip_carousel.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 ASH_SYSTEM_FOCUS_MODE_FOCUS_MODE_CHIP_CAROUSEL_H_ +#define ASH_SYSTEM_FOCUS_MODE_FOCUS_MODE_CHIP_CAROUSEL_H_ + +#include "ash/ash_export.h" +#include "ui/views/controls/scroll_view.h" + +namespace views { +class BoxLayoutView; +} + +namespace ash { + +// A horizontal scroll bar of chips for tasks. Selecting a task chip will save +// it as the currently selected task for the focus session. +class ASH_EXPORT FocusModeChipCarousel : public views::ScrollView { + public: + // Called when a task chip is pressed, contains a task name string. + using ChipPressedCallback = + base::RepeatingCallback<void(const std::u16string&)>; + + FocusModeChipCarousel(ChipPressedCallback on_chip_pressed); + FocusModeChipCarousel(const FocusModeChipCarousel&) = delete; + FocusModeChipCarousel& operator=(const FocusModeChipCarousel&) = delete; + ~FocusModeChipCarousel() override; + + // Updates the carousel of task chips from the first 5 tasks in `tasks`. + // TODO(b/305085993): Update task data representation once API is integrated. + void SetTasks(const std::vector<std::u16string>& tasks); + + // Returns whether the carousel is currently displaying any tasks. + bool HasTasks() const; + + private: + // This view contains the chips for the chip carousel. + raw_ptr<views::BoxLayoutView> scroll_contents_ = nullptr; + const ChipPressedCallback on_chip_pressed_; +}; + +} // namespace ash + +#endif // ASH_SYSTEM_FOCUS_MODE_FOCUS_MODE_CHIP_CAROUSEL_H_
diff --git a/ash/system/focus_mode/focus_mode_chip_carousel_unittest.cc b/ash/system/focus_mode/focus_mode_chip_carousel_unittest.cc new file mode 100644 index 0000000..78757994 --- /dev/null +++ b/ash/system/focus_mode/focus_mode_chip_carousel_unittest.cc
@@ -0,0 +1,108 @@ +// 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 "ash/system/focus_mode/focus_mode_chip_carousel.h" + +#include "ash/constants/ash_features.h" +#include "ash/test/ash_test_base.h" +#include "base/test/scoped_feature_list.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "ui/views/controls/button/label_button.h" +#include "ui/views/widget/widget.h" + +namespace { + +MATCHER_P(LabelMatcher, task, "") { + return static_cast<views::LabelButton*>(arg)->GetText() == task; +} + +} // namespace + +namespace ash { + +class FocusModeChipCarouselTest : public AshTestBase { + public: + FocusModeChipCarouselTest() : scoped_feature_(features::kFocusMode) {} + ~FocusModeChipCarouselTest() override = default; + + // AshTestBase: + void SetUp() override { + AshTestBase::SetUp(); + widget_ = CreateFramelessTestWidget(); + + // Create a container view to stop the carousel from stretching to the + // widget dimensions. + container_view_ = widget_->SetContentsView(std::make_unique<views::View>()); + auto focus_mode_chip_carousel = + std::make_unique<FocusModeChipCarousel>(base::DoNothing()); + focus_mode_chip_carousel_ = focus_mode_chip_carousel.get(); + container_view_->AddChildView(std::move(focus_mode_chip_carousel)); + } + + void TearDown() override { + focus_mode_chip_carousel_ = nullptr; + container_view_ = nullptr; + widget_.reset(); + AshTestBase::TearDown(); + } + + FocusModeChipCarousel* focus_mode_chip_carousel() { + return focus_mode_chip_carousel_; + } + + views::View* GetTaskScrollContents() { + return focus_mode_chip_carousel_->contents(); + } + + private: + base::test::ScopedFeatureList scoped_feature_; + std::unique_ptr<views::Widget> widget_; + raw_ptr<views::View> container_view_; + raw_ptr<FocusModeChipCarousel> focus_mode_chip_carousel_; +}; + +// Tests that the task list displays the list of tasks. +TEST_F(FocusModeChipCarouselTest, ChipCarouselPopulates) { + EXPECT_FALSE(focus_mode_chip_carousel()->HasTasks()); + auto validate_tasks = [&](const std::vector<std::u16string> tasks) { + SCOPED_TRACE(::testing::Message() << "Tasks length: " << tasks.size()); + focus_mode_chip_carousel()->SetTasks(tasks); + + EXPECT_EQ(tasks.size(), + GetTaskScrollContents()->GetChildrenInZOrder().size()); + EXPECT_NE(tasks.empty(), focus_mode_chip_carousel()->HasTasks()); + + std::vector<LabelMatcherMatcherP<std::u16string>> task_labels = {}; + for (const std::u16string& task : tasks) { + task_labels.push_back(LabelMatcher(task)); + } + EXPECT_THAT(GetTaskScrollContents()->GetChildrenInZOrder(), + testing::ElementsAreArray(task_labels)); + }; + + validate_tasks({}); + validate_tasks({u"Preparing for I485 form", u"Podcast interview Script", + u"Book a flight to Seoul"}); + validate_tasks({u"Only one task"}); + validate_tasks({u"Maximum", u"of", u"five", u"tasks", u"populated"}); +} + +// Tests that if more than 5 tasks are provided, the carousel only populates the +// first 5. +TEST_F(FocusModeChipCarouselTest, MaxOfFive) { + focus_mode_chip_carousel()->SetTasks( + {u"one", u"two", u"three", u"four", u"five", u"six"}); + EXPECT_EQ(5u, GetTaskScrollContents()->GetChildrenInZOrder().size()); + + // The first 5 tasks should be populated. + std::vector<LabelMatcherMatcherP<std::u16string>> task_labels = {}; + for (const std::u16string& task : + {u"one", u"two", u"three", u"four", u"five"}) { + task_labels.push_back(LabelMatcher(task)); + } + EXPECT_THAT(GetTaskScrollContents()->GetChildrenInZOrder(), + testing::ElementsAreArray(task_labels)); +} + +} // namespace ash
diff --git a/ash/system/focus_mode/focus_mode_detailed_view.cc b/ash/system/focus_mode/focus_mode_detailed_view.cc index 6e2a3e1..ba8375ee 100644 --- a/ash/system/focus_mode/focus_mode_detailed_view.cc +++ b/ash/system/focus_mode/focus_mode_detailed_view.cc
@@ -45,7 +45,6 @@ #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/controls/label.h" #include "ui/views/focus/focus_manager.h" -#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout_view.h" #include "ui/views/view_class_properties.h" #include "ui/views/view_observer.h"
diff --git a/ash/system/focus_mode/focus_mode_detailed_view.h b/ash/system/focus_mode/focus_mode_detailed_view.h index 3a541ff..45b5b068 100644 --- a/ash/system/focus_mode/focus_mode_detailed_view.h +++ b/ash/system/focus_mode/focus_mode_detailed_view.h
@@ -63,10 +63,11 @@ // session based on whether focus is in session. void UpdateTimerView(bool in_focus_session); - // Creates the row to show a textfield view to allow a user to manually input - // a task and a list of chip carousel, or to show a saved task item view which - // was created by the text from the textfield view or selecting from the list - // of chip carousel. + // Creates the row with the task elements. Creates the textfield to allow a + // user to manually input a task and creates a chip carousel list of tasks to + // allow the user to select a task. Once the user enters a task in the + // textfield or selects a task from the list, this view only shows the + // selected saved task item view and the header. void CreateTaskView(); // Creates the DND rounded container. This view will be visible only when
diff --git a/ash/system/focus_mode/focus_mode_task_view.cc b/ash/system/focus_mode/focus_mode_task_view.cc index e0c39b6f..ab6a716 100644 --- a/ash/system/focus_mode/focus_mode_task_view.cc +++ b/ash/system/focus_mode/focus_mode_task_view.cc
@@ -11,10 +11,12 @@ #include "ash/style/system_textfield.h" #include "ash/style/system_textfield_controller.h" #include "ash/style/typography.h" +#include "ash/system/focus_mode/focus_mode_chip_carousel.h" #include "ash/system/focus_mode/focus_mode_controller.h" #include "ui/base/l10n/l10n_util.h" #include "ui/chromeos/styles/cros_tokens_color_mappings.h" #include "ui/views/border.h" +#include "ui/views/layout/flex_layout_view.h" #include "ui/views/vector_icons.h" #include "ui/views/view_observer.h" #include "ui/views/widget/widget.h" @@ -64,11 +66,11 @@ // views::ViewObserver: void OnViewFocused(View* observed_view) override { - owner_->UpdateTextfieldStyle(/*show_selected_state=*/false); + owner_->UpdateStyle(/*show_selected_state=*/false); } void OnViewBlurred(views::View* view) override { - owner_->OnFinishedEditing(); + owner_->SelectTask(textfield_->GetText()); } private: @@ -79,27 +81,33 @@ }; FocusModeTaskView::FocusModeTaskView() { - SetCrossAxisAlignment(views::LayoutAlignment::kStart); - SetOrientation(views::LayoutOrientation::kHorizontal); - SetProperty(views::kFlexBehaviorKey, - views::FlexSpecification(views::MinimumFlexSizeRule::kPreferred, - views::MaximumFlexSizeRule::kUnbounded)); + SetOrientation(views::BoxLayout::Orientation::kVertical); + + auto* textfield_container = + AddChildView(std::make_unique<views::FlexLayoutView>()); + textfield_container->SetCrossAxisAlignment(views::LayoutAlignment::kStart); + textfield_container->SetOrientation(views::LayoutOrientation::kHorizontal); + textfield_container->SetProperty( + views::kFlexBehaviorKey, + views::FlexSpecification(views::MinimumFlexSizeRule::kPreferred, + views::MaximumFlexSizeRule::kUnbounded)); // TODO(b/306272008): Finalize the style, size and spacing for the radio // button and the close button. Wait for replacing the check icon with the one // from UX. - radio_button_ = AddChildView(std::make_unique<IconButton>( - base::BindRepeating(&FocusModeTaskView::OnRadioButtonPressed, - base::Unretained(this)), - IconButton::Type::kXSmall, &views::kRadioButtonNormalIcon, - std::u16string(), /*is_togglable=*/true, /*has_border=*/false)); + radio_button_ = + textfield_container->AddChildView(std::make_unique<IconButton>( + base::BindRepeating(&FocusModeTaskView::OnRadioButtonPressed, + base::Unretained(this)), + IconButton::Type::kXSmall, &views::kRadioButtonNormalIcon, + std::u16string(), /*is_togglable=*/true, /*has_border=*/false)); radio_button_->SetAccessibleName(l10n_util::GetStringUTF16( IDS_ASH_STATUS_TRAY_FOCUS_MODE_TASK_RADIO_BUTTON)); radio_button_->SetToggledVectorIcon(kCheckIcon); task_title_ = FocusModeController::Get()->selected_task_title(); - textfield_ = AddChildView( + textfield_ = textfield_container->AddChildView( std::make_unique<SystemTextfield>(SystemTextfield::Type::kMedium)); textfield_->SetProperty( views::kFlexBehaviorKey, @@ -114,12 +122,17 @@ textfield_->SetPlaceholderTextColorId(cros_tokens::kCrosSysSecondary); textfield_->SetText(task_title_); - deselect_button_ = AddChildView(std::make_unique<CloseButton>( - base::BindRepeating(&FocusModeTaskView::OnDeselectButtonPressed, - base::Unretained(this)), - CloseButton::Type::kMedium)); + deselect_button_ = + textfield_container->AddChildView(std::make_unique<CloseButton>( + base::BindRepeating(&FocusModeTaskView::OnDeselectButtonPressed, + base::Unretained(this)), + CloseButton::Type::kMedium)); - UpdateTextfieldStyle(!task_title_.empty()); + chip_carousel_ = + AddChildView(std::make_unique<FocusModeChipCarousel>(base::BindRepeating( + &FocusModeTaskView::SelectTask, base::Unretained(this)))); + + UpdateStyle(!task_title_.empty()); textfield_controller_ = std::make_unique<TaskTextfieldController>(textfield_, this); @@ -127,16 +140,34 @@ FocusModeTaskView::~FocusModeTaskView() = default; -void FocusModeTaskView::OnFinishedEditing() { - task_title_ = textfield_->GetText(); +void FocusModeTaskView::SelectTask(const std::u16string& task_title) { + task_title_ = task_title; FocusModeController::Get()->set_selected_task_title(task_title_); - UpdateTextfieldStyle(/*show_selected_state=*/!task_title_.empty()); + UpdateStyle(/*show_selected_state=*/!task_title_.empty()); // TODO(b/306271332): Call the tasks API to either save or update a task. + // TODO(b/306271315): Save task info to user prefs. } -void FocusModeTaskView::UpdateTextfieldStyle(bool show_selected_state) { +void FocusModeTaskView::UpdateStyle(bool show_selected_state) { + // If a task chip was selected, populate the textfield with its name and + // unfocus the textfield. + if (show_selected_state) { + textfield_->SetText(task_title_); + auto* focus_manager = textfield_->GetFocusManager(); + // If a task was selected from a chip, the textfield will still be focused. + // Unfocus it in this case. + if (focus_manager && focus_manager->GetFocusedView() == textfield_) { + textfield_->GetFocusManager()->AdvanceFocus(/*reverse=*/false); + // If the textfield is focused, unfocusing it will end up calling this + // method again. + return; + } + } + radio_button_->SetVisible(show_selected_state); deselect_button_->SetVisible(show_selected_state); + chip_carousel_->SetVisible(!show_selected_state && + chip_carousel_->HasTasks()); // TODO(b/306272008): Update label color and add a strikethrough if it's // selected state.
diff --git a/ash/system/focus_mode/focus_mode_task_view.h b/ash/system/focus_mode/focus_mode_task_view.h index 408d76b1..fd0ee48 100644 --- a/ash/system/focus_mode/focus_mode_task_view.h +++ b/ash/system/focus_mode/focus_mode_task_view.h
@@ -6,49 +6,56 @@ #define ASH_SYSTEM_FOCUS_MODE_FOCUS_MODE_TASK_VIEW_H_ #include "ash/ash_export.h" -#include "ui/views/layout/flex_layout_view.h" +#include "ui/views/layout/box_layout_view.h" namespace ash { class IconButton; class CloseButton; +class FocusModeChipCarousel; class SystemTextfield; // The class will be used in the `FocusModeDetailedView` under the task view // container to let the user create, edit, select, or deselect a task for a // focus session. -class ASH_EXPORT FocusModeTaskView : public views::FlexLayoutView { +class ASH_EXPORT FocusModeTaskView : public views::BoxLayoutView { public: FocusModeTaskView(); FocusModeTaskView(const FocusModeTaskView&) = delete; FocusModeTaskView& operator=(const FocusModeTaskView&) = delete; ~FocusModeTaskView() override; + // Handles finished editing event from the text field, updates `task_title_`, + // and saves the task information to the focus mode controller and user + // prefs. + // TODO(b/305085993): Update task data representation once API is integrated. + void SelectTask(const std::u16string& task_title); + private: class TaskTextfieldController; - // Handles finished editing event from the text field, updates `task_title_`. - void OnFinishedEditing(); - + // TODO(b/306272008): Check off or deselect a task void OnRadioButtonPressed() {} void OnDeselectButtonPressed() {} - // If `show_selected_state` is true, it means that there is a task selected by - // the user for a focus session, then we will show `radio_button_` and - // `deselect_button_` and update the style of `textfield_`; otherwise, we will - // hide the two buttons and also update the style of `textfield_` and let the - // user to create a new task, or edit an existing task. - void UpdateTextfieldStyle(bool show_selected_state); + // If `show_selected_state` is true, it means that there is a task selected + // by the user for a focus session, then we will show `radio_button_` and + // `deselect_button_`, update the style of `textfield_`, and hide the + // selection carousel; otherwise, we will hide the two buttons, update the + // style of `textfield_`, show the carousel, and let the user to create a new + // task, edit an existing task, or select a task from the carousel. + void UpdateStyle(bool show_selected_state); // TODO(b/306272008): Update the image of `radio_button_` to a check icon if // it was clicked by the user. raw_ptr<IconButton> radio_button_; raw_ptr<CloseButton> deselect_button_; - // Title of the task. + // Title of the selected task. std::u16string task_title_; raw_ptr<SystemTextfield> textfield_ = nullptr; std::unique_ptr<TaskTextfieldController> textfield_controller_; + raw_ptr<FocusModeChipCarousel> chip_carousel_ = nullptr; }; } // namespace ash
diff --git a/ash/system/night_light/night_light_controller_impl.cc b/ash/system/night_light/night_light_controller_impl.cc index 4cf578b..352f24b9 100644 --- a/ash/system/night_light/night_light_controller_impl.cc +++ b/ash/system/night_light/night_light_controller_impl.cc
@@ -25,7 +25,6 @@ #include "base/i18n/time_formatting.h" #include "base/logging.h" #include "base/metrics/histogram_macros.h" -#include "base/strings/stringprintf.h" #include "base/time/default_clock.h" #include "base/time/time.h" #include "cc/base/math_util.h" @@ -346,23 +345,20 @@ }; NightLightControllerImpl::NightLightControllerImpl() - : geolocation_controller_(GeolocationController::Get()), + : ScheduledFeature(prefs::kNightLightEnabled, + prefs::kNightLightScheduleType, + prefs::kNightLightCustomStartTime, + prefs::kNightLightCustomEndTime), temperature_animation_(std::make_unique<ColorTemperatureAnimation>()), ambient_temperature_(kNeutralColorTemperatureInKelvin), - clock_(base::DefaultClock::GetInstance()), weak_ptr_factory_(this) { - CHECK(geolocation_controller_); - Shell::Get()->session_controller()->AddObserver(this); Shell::Get()->window_tree_host_manager()->AddObserver(this); aura::Env::GetInstance()->AddObserver(this); - chromeos::PowerManagerClient::Get()->AddObserver(this); } NightLightControllerImpl::~NightLightControllerImpl() { - chromeos::PowerManagerClient::Get()->RemoveObserver(this); aura::Env::GetInstance()->RemoveObserver(this); Shell::Get()->window_tree_host_manager()->RemoveObserver(this); - Shell::Get()->session_controller()->RemoveObserver(this); } // static @@ -479,8 +475,9 @@ } float NightLightControllerImpl::GetColorTemperature() const { - if (active_user_pref_service_) - return active_user_pref_service_->GetDouble(prefs::kNightLightTemperature); + if (active_user_pref_service()) { + return active_user_pref_service()->GetDouble(prefs::kNightLightTemperature); + } return kDefaultColorTemperature; } @@ -491,87 +488,29 @@ ambient_temperature_); } -ScheduleType NightLightControllerImpl::GetScheduleType() const { - if (active_user_pref_service_) { - return static_cast<ScheduleType>( - active_user_pref_service_->GetInteger(prefs::kNightLightScheduleType)); - } - - return ScheduleType::kNone; -} - -TimeOfDay NightLightControllerImpl::GetCustomStartTime() const { - if (active_user_pref_service_) { - return TimeOfDay(active_user_pref_service_->GetInteger( - prefs::kNightLightCustomStartTime)) - .SetClock(clock_); - } - - return TimeOfDay(kDefaultStartTimeOffsetMinutes).SetClock(clock_); -} - -TimeOfDay NightLightControllerImpl::GetCustomEndTime() const { - if (active_user_pref_service_) { - return TimeOfDay(active_user_pref_service_->GetInteger( - prefs::kNightLightCustomEndTime)) - .SetClock(clock_); - } - - return TimeOfDay(kDefaultEndTimeOffsetMinutes).SetClock(clock_); -} - void NightLightControllerImpl::SetAmbientColorEnabled(bool enabled) { - if (active_user_pref_service_) - active_user_pref_service_->SetBoolean(prefs::kAmbientColorEnabled, enabled); + if (active_user_pref_service()) { + active_user_pref_service()->SetBoolean(prefs::kAmbientColorEnabled, + enabled); + } } bool NightLightControllerImpl::GetAmbientColorEnabled() const { - return features::IsAllowAmbientEQEnabled() && active_user_pref_service_ && - active_user_pref_service_->GetBoolean(prefs::kAmbientColorEnabled); -} - -void NightLightControllerImpl::SetEnabled(bool enabled, - AnimationDuration animation_type) { - if (active_user_pref_service_) { - animation_duration_ = animation_type; - active_user_pref_service_->SetBoolean(prefs::kNightLightEnabled, enabled); - } + return features::IsAllowAmbientEQEnabled() && active_user_pref_service() && + active_user_pref_service()->GetBoolean(prefs::kAmbientColorEnabled); } void NightLightControllerImpl::SetColorTemperature(float temperature) { DCHECK_GE(temperature, 0.0f); DCHECK_LE(temperature, 1.0f); - if (active_user_pref_service_) { - active_user_pref_service_->SetDouble(prefs::kNightLightTemperature, - temperature); - } -} - -void NightLightControllerImpl::SetScheduleType(ScheduleType type) { - if (active_user_pref_service_) { - active_user_pref_service_->SetInteger(prefs::kNightLightScheduleType, - static_cast<int>(type)); - } -} - -void NightLightControllerImpl::SetCustomStartTime(TimeOfDay start_time) { - if (active_user_pref_service_) { - active_user_pref_service_->SetInteger( - prefs::kNightLightCustomStartTime, - start_time.offset_minutes_from_zero_hour()); - } -} - -void NightLightControllerImpl::SetCustomEndTime(TimeOfDay end_time) { - if (active_user_pref_service_) { - active_user_pref_service_->SetInteger( - prefs::kNightLightCustomEndTime, - end_time.offset_minutes_from_zero_hour()); + if (active_user_pref_service()) { + active_user_pref_service()->SetDouble(prefs::kNightLightTemperature, + temperature); } } void NightLightControllerImpl::Toggle() { - SetEnabled(!IsNightLightEnabled(), AnimationDuration::kShort); + SetEnabled(!IsNightLightEnabled()); } void NightLightControllerImpl::OnDisplayConfigurationChanged() { @@ -586,54 +525,8 @@ IsNightLightEnabled() ? GetColorTemperature() : 0.0f); } -void NightLightControllerImpl::OnActiveUserPrefServiceChanged( - PrefService* pref_service) { - if (pref_service == active_user_pref_service_) - return; - - // TODO(afakhry|yjliu): Remove this VLOG when https://crbug.com/1015474 is - // fixed. - auto vlog_helper = [](const PrefService* pref_service) -> std::string { - if (!pref_service) - return "None"; - return base::StringPrintf( - "{State %s, Schedule Type: %d}", - pref_service->GetBoolean(prefs::kNightLightEnabled) ? "enabled" - : "disabled", - pref_service->GetInteger(prefs::kNightLightScheduleType)); - }; - VLOG(1) << "Switching user pref service from " - << vlog_helper(active_user_pref_service_) << " to " - << vlog_helper(pref_service) << "."; - - // Initial login and user switching in multi profiles. - active_user_pref_service_ = pref_service; - InitFromUserPrefs(); -} - -void NightLightControllerImpl::OnGeopositionChanged( - bool possible_change_in_timezone) { - DCHECK(GetScheduleType() != ScheduleType::kNone); - - VLOG(1) << "Received new geoposition."; - - // We only keep manual toggles if there's no change in timezone. - const bool keep_manual_toggles_during_schedules = - !possible_change_in_timezone; - - Refresh(/*did_schedule_change=*/true, keep_manual_toggles_during_schedules); -} - bool NightLightControllerImpl::IsNightLightEnabled() const { - return active_user_pref_service_ && - active_user_pref_service_->GetBoolean(prefs::kNightLightEnabled); -} - -void NightLightControllerImpl::SuspendDone(base::TimeDelta sleep_duration) { - // Time changes while the device is suspended. We need to refresh the schedule - // upon device resume to know what the status should be now. - Refresh(/*did_schedule_change=*/true, - /*keep_manual_toggles_during_schedules=*/true); + return GetEnabled(); } void NightLightControllerImpl::Close(bool by_user) { @@ -692,47 +585,21 @@ } } -void NightLightControllerImpl::SetClockForTesting(const base::Clock* clock) { - CHECK(clock); - clock_ = clock; -} - message_center::Notification* NightLightControllerImpl::GetAutoNightLightNotificationForTesting() const { return message_center::MessageCenter::Get()->FindVisibleNotificationById( kNotificationId); } -bool NightLightControllerImpl::MaybeRestoreSchedule() { - DCHECK(active_user_pref_service_); - DCHECK_NE(GetScheduleType(), ScheduleType::kNone); - - auto iter = per_user_schedule_target_state_.find(active_user_pref_service_); - if (iter == per_user_schedule_target_state_.end()) - return false; - - ScheduleTargetState& target_state = iter->second; - // It may be that the device was suspended for a very long time that the - // target time is no longer valid. - if (target_state.target_time <= clock_->Now()) { - return false; - } - - VLOG(1) << "Restoring a previous schedule."; - DCHECK_NE(IsNightLightEnabled(), target_state.target_status); - ScheduleNextToggle(target_state.target_time - clock_->Now()); - return true; -} - bool NightLightControllerImpl::UserHasEverChangedSchedule() const { - return active_user_pref_service_ && - active_user_pref_service_->HasPrefPath(prefs::kNightLightScheduleType); + return active_user_pref_service() && active_user_pref_service()->HasPrefPath( + prefs::kNightLightScheduleType); } bool NightLightControllerImpl::UserHasEverDismissedAutoNightLightNotification() const { - return active_user_pref_service_ && - active_user_pref_service_->GetBoolean( + return active_user_pref_service() && + active_user_pref_service()->GetBoolean( prefs::kAutoNightLightNotificationDismissed); } @@ -768,8 +635,8 @@ if (Shell::Get()->session_controller()->IsUserSessionBlocked()) return; - if (active_user_pref_service_) { - active_user_pref_service_->SetBoolean( + if (active_user_pref_service()) { + active_user_pref_service()->SetBoolean( prefs::kAutoNightLightNotificationDismissed, true); } } @@ -806,59 +673,86 @@ ApplyTemperatureToAllDisplays(target_temperature); } -void NightLightControllerImpl::StartWatchingPrefsChanges() { - DCHECK(active_user_pref_service_); +void NightLightControllerImpl::NotifyStatusChanged() { + for (auto& observer : observers_) { + observer.OnNightLightEnabledChanged(IsNightLightEnabled()); + } +} - pref_change_registrar_ = std::make_unique<PrefChangeRegistrar>(); - pref_change_registrar_->Init(active_user_pref_service_); - pref_change_registrar_->Add( - prefs::kNightLightEnabled, - base::BindRepeating(&NightLightControllerImpl::OnEnabledPrefChanged, - base::Unretained(this))); - pref_change_registrar_->Add( +void NightLightControllerImpl::OnAmbientColorEnabledPrefChanged() { + DCHECK(active_user_pref_service()); + if (GetAmbientColorEnabled()) { + UpdateAmbientRgbScalingFactors(); + VerifyAmbientColorCtmSupport(); + } + ReapplyColorTemperatures(); +} + +void NightLightControllerImpl::OnColorTemperaturePrefChanged() { + DCHECK(active_user_pref_service()); + const float color_temperature = GetColorTemperature(); + UMA_HISTOGRAM_EXACT_LINEAR( + "Ash.NightLight.Temperature", GetTemperatureRange(color_temperature), + 5 /* number of buckets defined in GetTemperatureRange() */); + RefreshDisplaysTemperature(color_temperature); +} + +void NightLightControllerImpl::RefreshFeatureState(RefreshReason reason) { + bool enabled_state_changed = false; + if (active_user_pref_service()) { + const bool enabled = IsNightLightEnabled(); + enabled_state_changed = last_observed_enabled_state_ != enabled; + last_observed_enabled_state_ = enabled; + + if (enabled_state_changed) { + VLOG(1) << "Enable state changed. New state: " << enabled << "."; + UpdateAutoNightLightNotification(reason); + } + is_first_user_init_ = false; + } + + animation_duration_ = reason == RefreshReason::kScheduled + ? AnimationDuration::kLong + : AnimationDuration::kShort; + RefreshDisplaysTemperature(GetColorTemperature()); + + if (enabled_state_changed) { + NotifyStatusChanged(); + } +} + +const char* NightLightControllerImpl::GetFeatureName() const { + return "NightLightControllerImpl"; +} + +void NightLightControllerImpl::InitFeatureForNewActiveUser() { + last_observed_enabled_state_.reset(); + if (GetAmbientColorEnabled()) { + UpdateAmbientRgbScalingFactors(); + } +} + +void NightLightControllerImpl::ListenForPrefChanges( + PrefChangeRegistrar& pref_change_registrar) { + pref_change_registrar.Add( prefs::kNightLightTemperature, base::BindRepeating( &NightLightControllerImpl::OnColorTemperaturePrefChanged, base::Unretained(this))); - pref_change_registrar_->Add( - prefs::kNightLightScheduleType, - base::BindRepeating(&NightLightControllerImpl::OnScheduleTypePrefChanged, - base::Unretained(this))); - pref_change_registrar_->Add( - prefs::kNightLightCustomStartTime, - base::BindRepeating( - &NightLightControllerImpl::OnCustomSchedulePrefsChanged, - base::Unretained(this))); - pref_change_registrar_->Add( - prefs::kNightLightCustomEndTime, - base::BindRepeating( - &NightLightControllerImpl::OnCustomSchedulePrefsChanged, - base::Unretained(this))); - pref_change_registrar_->Add( + pref_change_registrar.Add( prefs::kAmbientColorEnabled, base::BindRepeating( &NightLightControllerImpl::OnAmbientColorEnabledPrefChanged, base::Unretained(this))); } -void NightLightControllerImpl::InitFromUserPrefs() { - StartWatchingPrefsChanges(); - if (GetAmbientColorEnabled()) - UpdateAmbientRgbScalingFactors(); - RefreshForCurrentScheduleType(/*keep_manual_toggles_during_schedules=*/true); - NotifyStatusChanged(); - is_first_user_init_ = false; +const char* NightLightControllerImpl::GetScheduleTypeHistogramName() const { + return "Ash.NightLight.ScheduleType"; } -void NightLightControllerImpl::NotifyStatusChanged() { - for (auto& observer : observers_) - observer.OnNightLightEnabledChanged(IsNightLightEnabled()); -} - -void NightLightControllerImpl::OnEnabledPrefChanged() { - const bool enabled = IsNightLightEnabled(); - VLOG(1) << "Enable state changed. New state: " << enabled << "."; - DCHECK(active_user_pref_service_); +void NightLightControllerImpl::UpdateAutoNightLightNotification( + RefreshReason refresh_reason) { + DCHECK(active_user_pref_service()); // When there's no valid geolocation, the default sunset/sunrise times are // used, which could lead to Auto Night Light turning on briefly until a valid @@ -868,231 +762,14 @@ message_center::MessageCenter::Get()->RemoveNotification(kNotificationId, /*by_user=*/false); - if (enabled && features::IsAutoNightLightEnabled() && + if (IsNightLightEnabled() && features::IsAutoNightLightEnabled() && GetScheduleType() == ScheduleType::kSunsetToSunrise && - (is_first_user_init_ || - animation_duration_ == AnimationDuration::kLong) && + (is_first_user_init_ || refresh_reason == RefreshReason::kScheduled) && !UserHasEverChangedSchedule() && !UserHasEverDismissedAutoNightLightNotification()) { VLOG(1) << "Auto Night Light is turning on."; ShowAutoNightLightNotification(); } - - Refresh(/*did_schedule_change=*/false, - /*keep_manual_toggles_during_schedules=*/false); - NotifyStatusChanged(); -} - -void NightLightControllerImpl::OnAmbientColorEnabledPrefChanged() { - DCHECK(active_user_pref_service_); - if (GetAmbientColorEnabled()) { - UpdateAmbientRgbScalingFactors(); - VerifyAmbientColorCtmSupport(); - } - ReapplyColorTemperatures(); -} - -void NightLightControllerImpl::OnColorTemperaturePrefChanged() { - DCHECK(active_user_pref_service_); - const float color_temperature = GetColorTemperature(); - UMA_HISTOGRAM_EXACT_LINEAR( - "Ash.NightLight.Temperature", GetTemperatureRange(color_temperature), - 5 /* number of buckets defined in GetTemperatureRange() */); - RefreshDisplaysTemperature(color_temperature); -} - -void NightLightControllerImpl::OnScheduleTypePrefChanged() { - VLOG(1) << "Schedule type changed. New type: " - << static_cast<int>(GetScheduleType()) << "."; - UMA_HISTOGRAM_ENUMERATION("Ash.NightLight.ScheduleType", GetScheduleType()); - RefreshForCurrentScheduleType(/*keep_manual_toggles_during_schedules=*/false); -} - -void NightLightControllerImpl::RefreshForCurrentScheduleType( - bool keep_manual_toggles_during_schedules) { - DCHECK(active_user_pref_service_); - const ScheduleType schedule_type = GetScheduleType(); - // To prevent adding an observer twice in a row when switching between - // different users, we need to check `HasObserver()`. - if (schedule_type == ScheduleType::kNone) { - geolocation_controller_->RemoveObserver(this); - } else if (!geolocation_controller_->HasObserver(this)) { - geolocation_controller_->AddObserver(this); - } - Refresh(/*did_schedule_change=*/true, keep_manual_toggles_during_schedules); -} - -void NightLightControllerImpl::OnCustomSchedulePrefsChanged() { - DCHECK(active_user_pref_service_); - Refresh(/*did_schedule_change=*/true, - /*keep_manual_toggles_during_schedules=*/false); -} - -void NightLightControllerImpl::Refresh( - bool did_schedule_change, - bool keep_manual_toggles_during_schedules) { - switch (GetScheduleType()) { - case ScheduleType::kNone: - timer_.Stop(); - RefreshDisplaysTemperature(GetColorTemperature()); - return; - - case ScheduleType::kSunsetToSunrise: - RefreshScheduleTimer( - geolocation_controller_->GetSunsetTime().value_or(base::Time()), - geolocation_controller_->GetSunriseTime().value_or(base::Time()), - did_schedule_change, keep_manual_toggles_during_schedules); - return; - - case ScheduleType::kCustom: - RefreshScheduleTimer( - GetCustomStartTime().ToTimeToday().value_or(base::Time()), - GetCustomEndTime().ToTimeToday().value_or(base::Time()), - did_schedule_change, keep_manual_toggles_during_schedules); - return; - } -} - -void NightLightControllerImpl::RefreshScheduleTimer( - base::Time start_time, - base::Time end_time, - bool did_schedule_change, - bool keep_manual_toggles_during_schedules) { - if (GetScheduleType() == ScheduleType::kNone) { - NOTREACHED(); - timer_.Stop(); - return; - } - - if (keep_manual_toggles_during_schedules && MaybeRestoreSchedule()) { - RefreshDisplaysTemperature(GetColorTemperature()); - return; - } - - // NOTE: Users can set any weird combinations. - const base::Time now = clock_->Now(); - if (end_time <= start_time) { - // Example: - // Start: 9:00 PM, End: 6:00 AM. - // - // 6:00 21:00 - // <----- + ------------------ + -----> - // | | - // end start - // - // Note that the above times are times of day (today). It is important to - // know where "now" is with respect to these times to decide how to adjust - // them. - if (end_time >= now) { - // If the end time (today) is greater than the time now, this means "now" - // is within the NightLight schedule, and the start time is actually - // yesterday. The above timeline is interpreted as: - // - // 21:00 (-1day) 6:00 - // <----- + ----------- + ------ + -----> - // | | | - // start now end - // - start_time -= base::Days(1); - } else { - // Two possibilities here: - // - Either "now" is greater than the end time, but less than start time. - // This means NightLight is outside the schedule, waiting for the next - // start time. The end time is actually a day later. - // - Or "now" is greater than both the start and end times. This means - // NightLight is within the schedule, waiting to turn off at the next - // end time, which is also a day later. - end_time += base::Days(1); - } - } - - DCHECK_GE(end_time, start_time); - - // The target status that we need to set NightLight to now if a change of - // status is needed immediately. - bool enable_now = false; - - // Where are we now with respect to the start and end times? - if (now < start_time) { - // Example: - // Start: 6:00 PM today, End: 6:00 AM tomorrow, Now: 4:00 PM. - // - // <----- + ----------- + ----------- + -----> - // | | | - // now start end - // - // In this case, we need to disable NightLight immediately if it's enabled. - enable_now = false; - } else if (now >= start_time && now < end_time) { - // Example: - // Start: 6:00 PM today, End: 6:00 AM tomorrow, Now: 11:00 PM. - // - // <----- + ----------- + ----------- + -----> - // | | | - // start now end - // - // Start NightLight right away. Our future start time is a day later than - // its current value. - enable_now = true; - start_time += base::Days(1); - } else { // now >= end_time. - // Example: - // Start: 6:00 PM today, End: 10:00 PM today, Now: 11:00 PM. - // - // <----- + ----------- + ----------- + -----> - // | | | - // start end now - // - // In this case, our future start and end times are a day later from their - // current values. NightLight needs to be ended immediately if it's already - // enabled. - enable_now = false; - start_time += base::Days(1); - end_time += base::Days(1); - } - - // After the above processing, the start and end time are all in the future. - DCHECK_GE(start_time, now); - DCHECK_GE(end_time, now); - - if (did_schedule_change && enable_now != IsNightLightEnabled()) { - // If the change in the schedule introduces a change in the status, then - // calling SetEnabled() is all we need, since it will trigger a change in - // the user prefs to which we will respond by calling Refresh(). This will - // end up in this function again, adjusting all the needed schedules. - SetEnabled(enable_now, AnimationDuration::kShort); - return; - } - - // We reach here in one of the following conditions: - // 1) If schedule changes don't result in changes in the status, we need to - // explicitly update the timer to re-schedule the next toggle to account for - // any changes. - // 2) The user has just manually toggled the status of NightLight either from - // the System Menu or System Settings. In this case, we respect the user - // wish and maintain the current status that they desire, but we schedule the - // status to be toggled according to the time that corresponds with the - // opposite status of the current one. - ScheduleNextToggle(IsNightLightEnabled() ? end_time - now : start_time - now); - RefreshDisplaysTemperature(GetColorTemperature()); -} - -void NightLightControllerImpl::ScheduleNextToggle(base::TimeDelta delay) { - DCHECK(active_user_pref_service_); - - const bool new_status = !IsNightLightEnabled(); - const base::Time target_time = clock_->Now() + delay; - - per_user_schedule_target_state_[active_user_pref_service_] = - ScheduleTargetState{target_time, new_status}; - - VLOG(1) << "Setting Night Light to toggle to " - << (new_status ? "enabled" : "disabled") << " at " - << base::TimeFormatTimeOfDay(target_time); - timer_.Start(FROM_HERE, delay, - base::BindOnce(&NightLightControllerImpl::SetEnabled, - base::Unretained(this), new_status, - AnimationDuration::kLong)); } } // namespace ash
diff --git a/ash/system/night_light/night_light_controller_impl.h b/ash/system/night_light/night_light_controller_impl.h index 13edd71..bb41055 100644 --- a/ash/system/night_light/night_light_controller_impl.h +++ b/ash/system/night_light/night_light_controller_impl.h
@@ -12,25 +12,18 @@ #include "ash/public/cpp/night_light_controller.h" #include "ash/public/cpp/schedule_enums.h" #include "ash/public/cpp/session/session_observer.h" -#include "ash/system/geolocation/geolocation_controller.h" +#include "ash/system/scheduled_feature/scheduled_feature.h" #include "ash/system/time/time_of_day.h" #include "base/containers/flat_map.h" -#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "base/timer/timer.h" #include "chromeos/dbus/power/power_manager_client.h" -#include "components/prefs/pref_change_registrar.h" #include "ui/aura/env_observer.h" #include "ui/gfx/geometry/vector3d_f.h" #include "ui/message_center/public/cpp/notification_delegate.h" class PrefRegistrySimple; -class PrefService; - -namespace base { -class Clock; -} // namespace base namespace message_center { class Notification; @@ -53,10 +46,8 @@ : public NightLightController, public WindowTreeHostManager::Observer, public aura::EnvObserver, - public SessionObserver, - public chromeos::PowerManagerClient::Observer, public message_center::NotificationObserver, - public GeolocationController::Observer { + public ScheduledFeature { public: enum class AnimationDuration { // Short animation (2 seconds) used for manual changes of NightLight status @@ -120,16 +111,12 @@ AnimationDuration last_animation_duration() const { return last_animation_duration_; } - base::OneShotTimer* timer() { return &timer_; } float ambient_temperature() const { return ambient_temperature_; } const gfx::Vector3dF& ambient_rgb_scaling_factors() const { return ambient_rgb_scaling_factors_; } float GetColorTemperature() const; - ScheduleType GetScheduleType() const; - TimeOfDay GetCustomStartTime() const; - TimeOfDay GetCustomEndTime() const; bool GetAmbientColorEnabled() const; // Update |ambient_rgb_scaling_factors_| from the current @@ -137,11 +124,7 @@ void UpdateAmbientRgbScalingFactors(); // Set the desired NightLight settings in the current active user prefs. - void SetEnabled(bool enabled, AnimationDuration animation_type); void SetColorTemperature(float temperature); - void SetScheduleType(ScheduleType type); - void SetCustomStartTime(TimeOfDay start_time); - void SetCustomEndTime(TimeOfDay end_time); void SetAmbientColorEnabled(bool enabled); // This is always called as a result of a user action and will always use the @@ -154,14 +137,10 @@ // aura::EnvObserver: void OnHostInitialized(aura::WindowTreeHost* host) override; - // SessionObserver: - void OnActiveUserPrefServiceChanged(PrefService* pref_service) override; - // ash::NightLightController: bool IsNightLightEnabled() const override; // chromeos::PowerManagerClient::Observer: - void SuspendDone(base::TimeDelta sleep_duration) override; void AmbientColorChanged(const int32_t color_temperature) override; // message_center::NotificationObserver: @@ -169,19 +148,18 @@ void Click(const absl::optional<int>& button_index, const absl::optional<std::u16string>& reply) override; - // GeolocationController::Observer: - void OnGeopositionChanged(bool possible_change_in_timezone) override; - - void SetClockForTesting(const base::Clock* clock); - // Returns the Auto Night Light notification if any is currently shown, or // nullptr. message_center::Notification* GetAutoNightLightNotificationForTesting() const; private: - // Attempts restoring a previously stored schedule for the current user if - // possible and returns true if so, false otherwise. - bool MaybeRestoreSchedule(); + // ScheduledFeature: + void RefreshFeatureState(RefreshReason reason) override; + const char* GetFeatureName() const override; + void InitFeatureForNewActiveUser() override; + void ListenForPrefChanges( + PrefChangeRegistrar& pref_change_registrar) override; + const char* GetScheduleTypeHistogramName() const override; // Returns true if the user has ever changed the schedule type, which means we // must respect the user's choice and let it overwrite Auto Night Light. @@ -208,17 +186,10 @@ // temperature. void ReapplyColorTemperatures(); - void StartWatchingPrefsChanges(); - - void InitFromUserPrefs(); - void NotifyStatusChanged(); void NotifyClientWithScheduleChange(); - // Called when the user pref for the enabled status of NightLight is changed. - void OnEnabledPrefChanged(); - // Called when the user pref for the enabled status of Ambient Color is // changed. void OnAmbientColorEnabledPrefChanged(); @@ -226,46 +197,7 @@ // Called when the user pref for the color temperature is changed. void OnColorTemperaturePrefChanged(); - // Called when the user pref for the schedule type is changed. - void OnScheduleTypePrefChanged(); - void RefreshForCurrentScheduleType(bool keep_manual_toggles_during_schedules); - - // Called when either of the custom schedule prefs (custom start or end times) - // are changed. - void OnCustomSchedulePrefsChanged(); - - // Refreshes the state of NightLight according to the currently set - // parameters. |did_schedule_change| is true when Refresh() is called as a - // result of a change in one of the schedule related prefs, and false - // otherwise. - // If |keep_manual_toggles_during_schedules| is true, refreshing the schedule - // will not override a previous user's decision to toggle the NightLight - // status while the schedule is being used. - void Refresh(bool did_schedule_change, - bool keep_manual_toggles_during_schedules); - - // Given the desired start and end times that determine the time interval - // during which NightLight will be ON, depending on the time of "now", it - // refreshes the |timer_| to either schedule the future start or end of - // NightLight mode, as well as update the current status if needed. - // For |did_schedule_change| and |keep_manual_toggles_during_schedules|, see - // Refresh() above. - // This function should never be called if the schedule type is |kNone|. - void RefreshScheduleTimer(base::Time start_time, - base::Time end_time, - bool did_schedule_change, - bool keep_manual_toggles_during_schedules); - - // Schedule the upcoming next toggle of NightLight mode. This is used for the - // automatic status changes of NightLight which always use an - // AnimationDurationType::kLong. - void ScheduleNextToggle(base::TimeDelta delay); - - const raw_ptr<GeolocationController, ExperimentalAsh> geolocation_controller_; - - // The pref service of the currently active user. Can be null in - // ash_unittests. - raw_ptr<PrefService, ExperimentalAsh> active_user_pref_service_ = nullptr; + void UpdateAutoNightLightNotification(RefreshReason refresh_reason); // The animation duration of any upcoming future change. AnimationDuration animation_duration_ = AnimationDuration::kShort; @@ -274,32 +206,10 @@ std::unique_ptr<ColorTemperatureAnimation> temperature_animation_; - // Tracks the upcoming NightLight state changes per each user due to automatic - // schedules. This can be used to restore a manually toggled status while the - // schedule is being used. See MaybeRestoreSchedule(). - struct ScheduleTargetState { - // The time at which NightLight will switch to |target_status| defined - // below. - base::Time target_time; - bool target_status; - }; - base::flat_map<PrefService*, ScheduleTargetState> - per_user_schedule_target_state_; - - // The timer that schedules the start and end of NightLight when the schedule - // type is either kSunsetToSunrise or kCustom. - base::OneShotTimer timer_; - // True only until Night Light is initialized from the very first user // session. After that, it is set to false. bool is_first_user_init_ = true; - // The registrar used to watch NightLight prefs changes in the above - // |active_user_pref_service_| from outside ash. - // NOTE: Prefs are how Chrome communicates changes to the NightLight settings - // controlled by this class from the WebUI settings. - std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; - // Last ambient temperature read from the sensor. It is continuously // updated for every new value even when GetAmbientColorEnabled() returns // false. @@ -309,7 +219,9 @@ // Valid only if ambient color is enabled. gfx::Vector3dF ambient_rgb_scaling_factors_ = {1.f, 1.f, 1.f}; - raw_ptr<const base::Clock, ExperimentalAsh> clock_; + // Night light state in the last call to `RefreshFeatureState()`. `nullopt` + // if no call has been made yet. + absl::optional<bool> last_observed_enabled_state_; base::WeakPtrFactory<NightLightControllerImpl> weak_ptr_factory_; };
diff --git a/ash/system/night_light/night_light_controller_unittest.cc b/ash/system/night_light/night_light_controller_unittest.cc index 116b54e..d41700ca 100644 --- a/ash/system/night_light/night_light_controller_unittest.cc +++ b/ash/system/night_light/night_light_controller_unittest.cc
@@ -20,6 +20,7 @@ #include "ash/system/geolocation/geolocation_controller_test_util.h" #include "ash/system/geolocation/test_geolocation_url_loader_factory.h" #include "ash/system/night_light/night_light_controller_impl.h" +#include "ash/system/scheduled_feature/scheduled_feature.h" #include "ash/system/time/calendar_unittest_utils.h" #include "ash/system/time/time_of_day.h" #include "ash/test/ash_test_base.h" @@ -33,6 +34,7 @@ #include "base/strings/pattern.h" #include "base/test/scoped_feature_list.h" #include "base/test/simple_test_clock.h" +#include "base/test/simple_test_tick_clock.h" #include "base/time/time.h" #include "chromeos/ash/components/geolocation/simple_geolocation_provider.h" #include "components/prefs/pref_service.h" @@ -73,14 +75,19 @@ enum AmPm { kAM, kPM }; -MATCHER_P(SunRiseSetTimeNear, target, "") { +template <class T> +bool IsSunRiseSetTimeNear(T input, T target) { // The sunrise/set times for the test geopositions above are just approximate // and do not occur exactly on the hour specified. Sunrise/set times also // change by a couple minutes day to day if the test spans multiple days. // So use a small tolerance when comparing timestamps involving sunrise/set. static constexpr base::TimeDelta kSunriseSunsetTolerance = base::Minutes(10); - return target - kSunriseSunsetTolerance <= arg && - arg <= target + kSunriseSunsetTolerance; + return target - kSunriseSunsetTolerance <= input && + input <= target + kSunriseSunsetTolerance; +} + +MATCHER_P(SunRiseSetTimeNear, target, "") { + return IsSunRiseSetTimeNear(arg, target); } // Sunset/sunrise times for all `k*Geoposition*` coordinates above are based @@ -179,7 +186,8 @@ bool status_ = false; }; -class NightLightTest : public NoSessionAshTestBase { +class NightLightTest : public NoSessionAshTestBase, + public ScheduledFeature::Clock { public: NightLightTest() : NightLightTest(GetMidnightForTestGeopositions()) {} explicit NightLightTest(base::Time test_start_time) @@ -206,10 +214,13 @@ // AshTestBase: void SetUp() override { ASSERT_TRUE(timezone_pdt_.is_success()); - SetFakeNow(test_start_time_); + clock_.SetNow(test_start_time_); + // `tick_clock_`'s starting time is irrelevant. It should be advanced in + // unison with the wall `clock_` though to reflect reality. + tick_clock_.SetNowTicks(base::TimeTicks::Now()); NoSessionAshTestBase::SetUp(); geolocation_controller()->SetClockForTesting(&clock_); - GetController()->SetClockForTesting(&clock_); + GetController()->SetClockForTesting(this); CreateTestUserSessions(); @@ -237,8 +248,7 @@ } void SetNightLightEnabled(bool enabled) { - GetController()->SetEnabled( - enabled, NightLightControllerImpl::AnimationDuration::kShort); + GetController()->SetEnabled(enabled); } void SetAmbientColorPrefEnabled(bool enabled) { @@ -267,16 +277,25 @@ return ambient_temperature; } - void SetFakeNow(base::Time time) { clock_.SetNow(time); } - - void SetFakeNow(TimeOfDay time) { + void AdvanceTimeTo(TimeOfDay time) { time.SetClock(&clock_); - clock_.SetNow(ToTimeToday(time)); + base::Time new_time = ToTimeToday(time); + if (new_time < Now()) { + new_time += base::Days(1); + } + AdvanceTimeBy(new_time - Now()); } - void AdvanceTimeBy(base::TimeDelta amount) { clock_.Advance(amount); } + void AdvanceTimeBy(base::TimeDelta amount) { + CHECK_GE(amount, base::TimeDelta()); + clock_.Advance(amount); + tick_clock_.Advance(amount); + } - base::Time Now() { return clock_.Now(); } + // ScheduledFeature::Clock: + base::Time Now() const override { return clock_.Now(); } + + base::TimeTicks NowTicks() const override { return tick_clock_.NowTicks(); } GeolocationController* geolocation_controller() { return Shell::Get()->geolocation_controller(); @@ -308,6 +327,20 @@ ASSERT_EQ(Now(), expected_now); break; } + + // `ScheduledFeature` has a known weakness: If sunrise tomorrow is later in + // the day that sunrise today (ex: 6:59 AM and 7:00 AM), it will wake up at + // both 6:59 AM and 7:00 AM the next day to update the feature state. There + // are no user visible effects and no change in feature status at 7:00 AM, + // but this method needs to advance the clock to the later update so that + // tests can reason about the expected checkpoints easily. + while (IsSunRiseSetTimeNear(GetController()->timer()->GetCurrentDelay(), + base::TimeDelta())) { + const bool feature_status_before = GetController()->GetEnabled(); + AdvanceTimeBy(GetController()->timer()->GetCurrentDelay()); + GetController()->timer()->FireNow(); + ASSERT_EQ(GetController()->GetEnabled(), feature_status_before); + } } private: @@ -316,6 +349,7 @@ calendar_test_utils::ScopedLibcTimeZone timezone_pdt_; const base::Time test_start_time_; base::SimpleTestClock clock_; + base::SimpleTestTickClock tick_clock_; const scoped_refptr<TestGeolocationUrlLoaderFactory> geolocation_url_loader_factory_; }; @@ -489,7 +523,7 @@ TEST_F(NightLightTest, TestScheduleNoneToCustomTransition) { NightLightControllerImpl* controller = GetController(); // Now is 6:00 PM. - SetFakeNow(TimeOfDay(18 * 60)); + AdvanceTimeTo(TimeOfDay(18 * 60)); SetNightLightEnabled(false); controller->SetScheduleType(ScheduleType::kNone); // Start time is at 3:00 PM and end time is at 8:00 PM. @@ -529,7 +563,7 @@ // interval when NightLight mode is on. TEST_F(NightLightTest, TestCustomScheduleReachingEndTime) { NightLightControllerImpl* controller = GetController(); - SetFakeNow(TimeOfDay(18 * 60)); + AdvanceTimeTo(TimeOfDay(18 * 60)); controller->SetCustomStartTime(TimeOfDay(15 * 60)); controller->SetCustomEndTime(TimeOfDay(20 * 60)); controller->SetScheduleType(ScheduleType::kCustom); @@ -545,7 +579,7 @@ // start end & now // // Now is 8:00 PM. - SetFakeNow(TimeOfDay(20 * 60)); + AdvanceTimeTo(TimeOfDay(20 * 60)); controller->timer()->FireNow(); EXPECT_FALSE(controller->IsNightLightEnabled()); TestCompositorsTemperature(0.0f); @@ -568,7 +602,7 @@ // start end now // NightLightControllerImpl* controller = GetController(); - SetFakeNow(TimeOfDay(23 * 60)); + AdvanceTimeTo(TimeOfDay(23 * 60)); controller->SetCustomStartTime(TimeOfDay(15 * 60)); controller->SetCustomEndTime(TimeOfDay(20 * 60)); controller->SetScheduleType(ScheduleType::kCustom); @@ -585,20 +619,29 @@ TestCompositorsTemperature(controller->GetColorTemperature()); EXPECT_EQ(NightLightControllerImpl::AnimationDuration::kShort, controller->last_animation_duration()); - // The timer should still be running, but NightLight should automatically - // turn off at 8:00 PM tomorrow, which is 21 hours from now (11:00 PM). - EXPECT_TRUE(controller->timer()->IsRunning()); - EXPECT_EQ(base::Hours(21), controller->timer()->GetCurrentDelay()); + // Feature status shouldn't change at next start time. + AdvanceControllerToNextTask(base::Days(1) + base::Hours(15)); + EXPECT_TRUE(controller->GetEnabled()); + // Feature status changes back to regular schedule at next end time. + AdvanceControllerToNextTask(base::Days(1) + base::Hours(20)); + EXPECT_FALSE(controller->GetEnabled()); + TestCompositorsTemperature(0.0f); - // Manually turning it back off should also be respected, and this time the + // Back to 11:00 PM the next day. + AdvanceTimeBy(base::Hours(3)); + + // Manually turning it on then back off should be respected, and this time the // start is scheduled at 3:00 PM tomorrow after 19 hours from "now" (8:00 PM). controller->Toggle(); + controller->Toggle(); EXPECT_FALSE(controller->IsNightLightEnabled()); TestCompositorsTemperature(0.0f); EXPECT_EQ(NightLightControllerImpl::AnimationDuration::kShort, controller->last_animation_duration()); - EXPECT_TRUE(controller->timer()->IsRunning()); - EXPECT_EQ(base::Hours(16), controller->timer()->GetCurrentDelay()); + + // Feature status should change at next start time. + AdvanceControllerToNextTask(base::Days(2) + base::Hours(15)); + EXPECT_TRUE(controller->GetEnabled()); } // Tests that changing the custom start and end times, in such a way that @@ -611,7 +654,7 @@ // now start end // NightLightControllerImpl* controller = GetController(); - SetFakeNow(TimeOfDay(16 * 60)); // 4:00 PM. + AdvanceTimeTo(TimeOfDay(16 * 60)); // 4:00 PM. SetNightLightEnabled(false); controller->SetScheduleType(ScheduleType::kNone); controller->SetCustomStartTime(TimeOfDay(18 * 60)); // 6:00 PM. @@ -666,7 +709,12 @@ TestCompositorsTemperature(0.0f); EXPECT_TRUE(controller->timer()->IsRunning()); EXPECT_THAT(controller->timer()->GetCurrentDelay(), - SunRiseSetTimeNear(base::Hours(3))); + SunRiseSetTimeNear(base::Hours(1))); + + // Simulate reaching late afternoon (17:00) + AdvanceControllerToNextTask(base::Hours(17)); + EXPECT_FALSE(controller->GetEnabled()); + TestCompositorsTemperature(0.0f); // Simulate reaching sunset. AdvanceControllerToNextTask(base::Hours(19)); @@ -685,10 +733,9 @@ TestCompositorsTemperature(0.0f); EXPECT_EQ(NightLightControllerImpl::AnimationDuration::kLong, controller->last_animation_duration()); - // Timer is running scheduling the start at the next sunset. EXPECT_TRUE(controller->timer()->IsRunning()); ASSERT_THAT(controller->timer()->GetCurrentDelay(), - SunRiseSetTimeNear(base::Hours(12))); + SunRiseSetTimeNear(base::Hours(4))); } // Tests the behavior of the sunset to sunrise automatic schedule type when the @@ -712,7 +759,12 @@ TestCompositorsTemperature(0.0f); EXPECT_TRUE(controller->timer()->IsRunning()); EXPECT_THAT(controller->timer()->GetCurrentDelay(), - SunRiseSetTimeNear(base::Hours(3))); + SunRiseSetTimeNear(base::Hours(1))); + + // Simulate reaching late afternoon (17:00) + AdvanceControllerToNextTask(base::Hours(17)); + EXPECT_FALSE(controller->GetEnabled()); + TestCompositorsTemperature(0.0f); // Simulate reaching sunset. AdvanceControllerToNextTask(base::Hours(19)); @@ -755,10 +807,10 @@ TestCompositorsTemperature(0.0f); EXPECT_EQ(NightLightControllerImpl::AnimationDuration::kLong, controller->last_animation_duration()); - // Timer is running scheduling the start at the next sunset. + // Timer is scheduling morning. EXPECT_TRUE(controller->timer()->IsRunning()); EXPECT_THAT(controller->timer()->GetCurrentDelay(), - SunRiseSetTimeNear(base::Hours(12))); + SunRiseSetTimeNear(base::Hours(4))); } // Tests the behavior when the client sets the geoposition while in custom @@ -782,7 +834,7 @@ // | | | // now custom start custom end // - SetFakeNow(TimeOfDay(17 * 60)); + AdvanceTimeTo(TimeOfDay(17 * 60)); // Expect that timer is running and is scheduled at next custom start time. controller->SetScheduleType(ScheduleType::kCustom); @@ -832,7 +884,7 @@ TEST_F(NightLightTest, TestCustomScheduleOnResume) { NightLightControllerImpl* controller = GetController(); // Now is 4:00 PM. - SetFakeNow(TimeOfDay(16 * 60)); + AdvanceTimeTo(TimeOfDay(16 * 60)); SetNightLightEnabled(false); // Start time is at 6:00 PM and end time is at 10:00 PM. NightLight should be // off. @@ -854,7 +906,7 @@ // Now simulate that the device was suspended for 3 hours, and the time now // is 7:00 PM when the devices was resumed. Expect that NightLight turns on. - SetFakeNow(TimeOfDay(19 * 60)); + AdvanceTimeTo(TimeOfDay(19 * 60)); controller->SuspendDone(base::TimeDelta::Max()); EXPECT_TRUE(controller->IsNightLightEnabled()); @@ -873,7 +925,7 @@ TEST_F(NightLightTest, TestCustomScheduleInvertedStartAndEndTimesCase1) { NightLightControllerImpl* controller = GetController(); // Now is 4:00 AM. - SetFakeNow(TimeOfDay(4 * 60)); + AdvanceTimeTo(TimeOfDay(4 * 60)); SetNightLightEnabled(false); // Start time is at 9:00 PM and end time is at 6:00 AM. "Now" is less than // both. NightLight should be on. @@ -898,7 +950,7 @@ TEST_F(NightLightTest, TestCustomScheduleInvertedStartAndEndTimesCase2) { NightLightControllerImpl* controller = GetController(); // Now is 6:00 AM. - SetFakeNow(TimeOfDay(6 * 60)); + AdvanceTimeTo(TimeOfDay(6 * 60)); SetNightLightEnabled(false); // Start time is at 9:00 PM and end time is at 4:00 AM. "Now" is between both. // NightLight should be off. @@ -923,7 +975,7 @@ TEST_F(NightLightTest, TestCustomScheduleInvertedStartAndEndTimesCase3) { NightLightControllerImpl* controller = GetController(); // Now is 11:00 PM. - SetFakeNow(TimeOfDay(23 * 60)); + AdvanceTimeTo(TimeOfDay(23 * 60)); SetNightLightEnabled(false); // Start time is at 9:00 PM and end time is at 4:00 AM. "Now" is greater than // both. NightLight should be on. @@ -1041,15 +1093,15 @@ SwitchActiveUser(kUser1Email); struct { - base::Time fake_now; + TimeOfDay fake_now; bool user_1_expected_status; bool user_2_expected_status; } kTestCases[] = { - {ToTimeToday(MakeTimeOfDay(2, kPM)), false, false}, - {ToTimeToday(MakeTimeOfDay(4, kPM)), true, false}, - {ToTimeToday(TimeOfDay(19 * 60 + 30)), true, true}, - {ToTimeToday(MakeTimeOfDay(10, kPM)), false, true}, - {ToTimeToday(MakeTimeOfDay(9, kAM)) + base::Days(1), // 9:00 AM tomorrow. + {MakeTimeOfDay(2, kPM), false, false}, + {MakeTimeOfDay(4, kPM), true, false}, + {TimeOfDay(19 * 60 + 30), true, true}, + {MakeTimeOfDay(10, kPM), false, true}, + {MakeTimeOfDay(9, kAM), // 9:00 AM tomorrow. false, false}, }; @@ -1065,14 +1117,14 @@ bool user_1_previous_status = false; for (const auto& test_case : kTestCases) { // Each test case begins when user_1 is active. - SCOPED_TRACE(TimeOfDay::FromTime(test_case.fake_now).ToString()); + SCOPED_TRACE(test_case.fake_now.ToString()); const bool user_1_toggled_status = !test_case.user_1_expected_status; const bool user_2_toggled_status = !test_case.user_2_expected_status; // Apply the test's case fake time, and fire the timer if there's a change // expected in NightLight's status. - SetFakeNow(test_case.fake_now); + AdvanceTimeTo(test_case.fake_now); if (user_1_previous_status != test_case.user_1_expected_status) controller->timer()->FireNow(); user_1_previous_status = test_case.user_1_expected_status; @@ -1119,7 +1171,7 @@ } TEST_F(NightLightTest, ManualStatusToggleCanPersistAfterResumeFromSuspend) { - SetFakeNow(MakeTimeOfDay(11, kAM)); + AdvanceTimeTo(MakeTimeOfDay(11, kAM)); NightLightControllerImpl* controller = GetController(); controller->SetCustomStartTime(MakeTimeOfDay(3, kPM)); controller->SetCustomEndTime(MakeTimeOfDay(8, kPM)); @@ -1130,23 +1182,21 @@ // turn back off at 8:00 PM. controller->Toggle(); EXPECT_TRUE(controller->IsNightLightEnabled()); - EXPECT_TRUE(controller->timer()->IsRunning()); - EXPECT_EQ(base::Hours(9), controller->timer()->GetCurrentDelay()); // Simulate suspend and then resume at 2:00 PM (which is outside the user's // custom schedule). However, the manual toggle to on should be kept. - SetFakeNow(MakeTimeOfDay(2, kPM)); + AdvanceTimeTo(MakeTimeOfDay(2, kPM)); controller->SuspendDone(base::TimeDelta{}); EXPECT_TRUE(controller->IsNightLightEnabled()); // Suspend again and resume at 5:00 PM (which is within the user's custom // schedule). The schedule should be applied normally. - SetFakeNow(MakeTimeOfDay(5, kPM)); + AdvanceTimeTo(MakeTimeOfDay(5, kPM)); controller->SuspendDone(base::TimeDelta{}); EXPECT_TRUE(controller->IsNightLightEnabled()); // Suspend and resume at 9:00 PM and expect NightLight to be off. - SetFakeNow(MakeTimeOfDay(9, kPM)); + AdvanceTimeTo(MakeTimeOfDay(9, kPM)); controller->SuspendDone(base::TimeDelta{}); EXPECT_FALSE(controller->IsNightLightEnabled()); } @@ -1579,6 +1629,9 @@ EXPECT_FALSE( user1_pref_service()->HasPrefPath(prefs::kNightLightScheduleType)); + // Simulate reaching late afternoon (17:00). + AdvanceControllerToNextTask(base::Hours(1)); + // Simulate reaching sunset. AdvanceControllerToNextTask(base::Hours(3)); EXPECT_TRUE(controller->IsNightLightEnabled()); @@ -1590,11 +1643,20 @@ // turning off Night Light manually for tonight. The notification should be // dismissed. notification->delegate()->Click(absl::nullopt, absl::nullopt); - controller->SetEnabled(false, - NightLightControllerImpl::AnimationDuration::kShort); + controller->SetEnabled(false); EXPECT_FALSE(controller->IsNightLightEnabled()); EXPECT_FALSE(controller->GetAutoNightLightNotificationForTesting()); + // Simulate reaching sunrise (7:00). + AdvanceControllerToNextTask(base::Hours(15)); + EXPECT_FALSE(controller->GetEnabled()); + // Simulate reaching morning (11:00). + AdvanceControllerToNextTask(base::Hours(19)); + EXPECT_FALSE(controller->GetEnabled()); + // Simulate reaching late afternoon (17:00). + AdvanceControllerToNextTask(base::Days(1) + base::Hours(1)); + EXPECT_FALSE(controller->GetEnabled()); + // Simulate reaching next sunset. The notification should no longer show. AdvanceControllerToNextTask(base::Days(1) + base::Hours(3)); EXPECT_TRUE(controller->IsNightLightEnabled()); @@ -1606,6 +1668,9 @@ NightLightControllerImpl* controller = GetController(); EXPECT_EQ(ScheduleType::kSunsetToSunrise, controller->GetScheduleType()); + // Simulate reaching late afternoon (5:00 PM). + AdvanceControllerToNextTask(base::Hours(1)); + // Simulate reaching sunset (7:00 PM). AdvanceControllerToNextTask(base::Hours(3)); EXPECT_TRUE(controller->IsNightLightEnabled()); @@ -1632,6 +1697,9 @@ BlockUserSession(BLOCKED_BY_LOCK_SCREEN); EXPECT_TRUE(Shell::Get()->session_controller()->IsUserSessionBlocked()); + // Simulate reaching late afternoon (17:00). + AdvanceControllerToNextTask(base::Hours(1)); + // Simulate reaching sunset. NightLightControllerImpl* controller = GetController(); AdvanceControllerToNextTask(base::Hours(3)); @@ -1652,6 +1720,9 @@ NightLightControllerImpl* controller = GetController(); controller->SetScheduleType(ScheduleType::kSunsetToSunrise); + // Simulate reaching late afternoon (17:00). + AdvanceControllerToNextTask(base::Hours(1)); + // Simulate reaching sunset. AdvanceControllerToNextTask(base::Hours(3)); EXPECT_TRUE(controller->IsNightLightEnabled());
diff --git a/ash/system/scheduled_feature/scheduled_feature.cc b/ash/system/scheduled_feature/scheduled_feature.cc index cfbfcfb6..9cae89a 100644 --- a/ash/system/scheduled_feature/scheduled_feature.cc +++ b/ash/system/scheduled_feature/scheduled_feature.cc
@@ -21,7 +21,9 @@ #include "base/functional/bind.h" #include "base/i18n/time_formatting.h" #include "base/logging.h" +#include "base/metrics/histogram_functions.h" #include "base/notreached.h" +#include "base/strings/stringprintf.h" #include "base/task/sequenced_task_runner.h" #include "base/time/time.h" #include "components/prefs/pref_registry_simple.h" @@ -200,8 +202,26 @@ if (pref_service == active_user_pref_service_) return; + // TODO(afakhry|yjliu): Remove this VLOG when https://crbug.com/1015474 is + // fixed. + auto vlog_helper = [this](const PrefService* pref_service) -> std::string { + if (!pref_service) { + return "None"; + } + return base::StringPrintf( + "{State %s, Schedule Type: %d}", + pref_service->GetBoolean(prefs_path_enabled_) ? "enabled" : "disabled", + pref_service->GetInteger(prefs_path_schedule_type_)); + }; + VLOG(1) << "Switching user pref service from " + << vlog_helper(active_user_pref_service_) << " to " + << vlog_helper(pref_service) << "."; + // Initial login and user switching in multi profiles. active_user_pref_service_ = pref_service; + // Give the feature a chance to do its own initialization before the first + // call to `RefreshFeatureState()` (made within `InitFromUserPrefs()`). + InitFeatureForNewActiveUser(); InitFromUserPrefs(); } @@ -246,6 +266,10 @@ timer_->SetTaskRunner(std::move(task_runner)); } +const char* ScheduledFeature::GetScheduleTypeHistogramName() const { + return nullptr; +} + bool ScheduledFeature::MaybeRestoreSchedule() { DCHECK(active_user_pref_service_); DCHECK_NE(GetScheduleType(), ScheduleType::kNone); @@ -281,8 +305,7 @@ pref_change_registrar_->Add( prefs_path_schedule_type_, base::BindRepeating(&ScheduledFeature::OnScheduleTypePrefChanged, - base::Unretained(this), - /*keep_manual_toggles_during_schedules=*/false)); + base::Unretained(this))); if (!prefs_path_custom_start_time_.empty()) { pref_change_registrar_->Add( @@ -296,12 +319,12 @@ base::BindRepeating(&ScheduledFeature::OnCustomSchedulePrefsChanged, base::Unretained(this))); } + ListenForPrefChanges(*pref_change_registrar_); } void ScheduledFeature::InitFromUserPrefs() { StartWatchingPrefsChanges(); - OnScheduleTypePrefChanged(/*keep_manual_toggles_during_schedules=*/true); - is_first_user_init_ = false; + RefreshForSettingsChanged(/*keep_manual_toggles_during_schedules=*/true); } void ScheduledFeature::SetEnabledInternal(bool enabled, RefreshReason reason) { @@ -324,12 +347,22 @@ /*keep_manual_toggles_during_schedules=*/false); } -void ScheduledFeature::OnScheduleTypePrefChanged( - bool keep_manual_toggles_during_schedules) { +void ScheduledFeature::OnScheduleTypePrefChanged() { const ScheduleType schedule_type = GetScheduleType(); + VLOG(1) << "Schedule type changed. New type: " + << static_cast<int>(schedule_type) << "."; + if (const char* const schedule_type_histogram = + GetScheduleTypeHistogramName()) { + base::UmaHistogramEnumeration(schedule_type_histogram, schedule_type); + } + RefreshForSettingsChanged(/*keep_manual_toggles_during_schedules=*/false); +} + +void ScheduledFeature::RefreshForSettingsChanged( + bool keep_manual_toggles_during_schedules) { // To prevent adding an observer twice in a row when switching between // different users, we need to check `HasObserver()`. - if (schedule_type == ScheduleType::kNone) { + if (GetScheduleType() == ScheduleType::kNone) { geolocation_controller_->RemoveObserver(this); } else if (!geolocation_controller_->HasObserver(this)) { geolocation_controller_->AddObserver(this);
diff --git a/ash/system/scheduled_feature/scheduled_feature.h b/ash/system/scheduled_feature/scheduled_feature.h index ae6aab0..5178c90 100644 --- a/ash/system/scheduled_feature/scheduled_feature.h +++ b/ash/system/scheduled_feature/scheduled_feature.h
@@ -167,6 +167,23 @@ virtual const char* GetFeatureName() const = 0; + // Invoked whenever `OnActiveUserPrefServiceChanged()` is called. + // `active_user_pref_service()` is guaranteed to be non-null within this + // method and reflect the new active user. This is always called before the + // first `RefreshFeatureState()` call is made for the new user. + virtual void InitFeatureForNewActiveUser() {} + + // Optionally override to observe feature-specific prefs. Invoked whenever + // `OnActiveUserPrefServiceChanged()` is called. Overrides can assume the + // `pref_change_registrar` is already initialized. + virtual void ListenForPrefChanges( + PrefChangeRegistrar& pref_change_registrar) {} + + // Optional for recording a metric that tracks how often each `ScheduleType` + // is used. Returns the full histogram name. By default, returns nullptr, + // which disables the metric. + virtual const char* GetScheduleTypeHistogramName() const; + // Attempts restoring a previously stored schedule for the current user if // possible and returns true if so, false otherwise. bool MaybeRestoreSchedule(); @@ -182,10 +199,13 @@ void OnEnabledPrefChanged(); // Called when the user pref for the schedule type is changed or initialized. + void OnScheduleTypePrefChanged(); + + // Refreshes feature state assuming `RefreshReason::kSettingsChanged`. // During initialization, `keep_manual_toggles_during_schedules` is set to // true, so the load user pref override any user current toggled setting. For // more detail about `keep_manual_toggles_during_schedules`, see `Refresh()`. - void OnScheduleTypePrefChanged(bool keep_manual_toggles_during_schedules); + void RefreshForSettingsChanged(bool keep_manual_toggles_during_schedules); // Called when either of the custom schedule prefs (custom start or end times) // are changed. @@ -237,10 +257,6 @@ // never null; this is only reinitialized when the caller sets a new clock. std::unique_ptr<base::OneShotTimer> timer_; - // True only until this feature is initialized from the very first user - // session. After that, it is set to false. - bool is_first_user_init_ = true; - // The registrar used to watch prefs changes in the above // `active_user_pref_service_` from outside ash. // NOTE: Prefs are how Chrome communicates changes to the ScheduledFeature
diff --git a/ash/system/scheduled_feature/scheduled_feature_unittest.cc b/ash/system/scheduled_feature/scheduled_feature_unittest.cc index adacf39..ef320502 100644 --- a/ash/system/scheduled_feature/scheduled_feature_unittest.cc +++ b/ash/system/scheduled_feature/scheduled_feature_unittest.cc
@@ -40,6 +40,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/test/test_mock_time_task_runner.h" #include "base/time/time.h" @@ -193,9 +194,20 @@ TestScheduledFeature& operator=(const TestScheduledFeature& rhs) = delete; ~TestScheduledFeature() override {} + // ScheduledFeature: const char* GetFeatureName() const override { return "TestFeature"; } - + const char* GetScheduleTypeHistogramName() const override { + return schedule_type_histogram_name_.c_str(); + } MOCK_METHOD(void, RefreshFeatureState, (RefreshReason reason), (override)); + + void set_schedule_type_histogram_name( + std::string schedule_type_histogram_name) { + schedule_type_histogram_name_ = std::move(schedule_type_histogram_name); + } + + private: + std::string schedule_type_histogram_name_; }; class ScheduledFeatureTest : public NoSessionAshTestBase, @@ -778,12 +790,16 @@ // Change the start time in such a way that doesn't change the status, but // despite that, confirm that schedule has been updated. ASSERT_FALSE(GetEnabled()); + EXPECT_CALL(*feature(), RefreshFeatureState(RefreshReason::kSettingsChanged)); feature()->SetCustomStartTime(MakeTimeOfDay(7, AmPm::kPM)); // 7:00 PM. + Mock::VerifyAndClearExpectations(feature()); EXPECT_FALSE(GetEnabled()); // Changing the end time in a similar fashion to the above and expect no // change. + EXPECT_CALL(*feature(), RefreshFeatureState(RefreshReason::kSettingsChanged)); feature()->SetCustomEndTime(MakeTimeOfDay(11, AmPm::kPM)); // 11:00 PM. + Mock::VerifyAndClearExpectations(feature()); EXPECT_FALSE(GetEnabled()); FastForwardBy(base::Days(1)); EXPECT_THAT(change_log.changes(), @@ -1453,6 +1469,32 @@ } } +TEST_F(ScheduledFeatureTest, RecordsScheduleTypeHistogram) { + const std::string test_histogram_name = "Ash.Test.ScheduleType"; + base::HistogramTester histogram_tester; + feature()->SetScheduleType(ScheduleType::kCustom); + histogram_tester.ExpectTotalCount(test_histogram_name, 0); + + feature()->set_schedule_type_histogram_name(test_histogram_name); + feature()->SetScheduleType(ScheduleType::kSunsetToSunrise); + feature()->SetScheduleType(ScheduleType::kNone); + feature()->SetScheduleType(ScheduleType::kCustom); + histogram_tester.ExpectBucketCount(test_histogram_name, ScheduleType::kNone, + 1); + histogram_tester.ExpectBucketCount(test_histogram_name, + ScheduleType::kSunsetToSunrise, 1); + histogram_tester.ExpectBucketCount(test_histogram_name, ScheduleType::kCustom, + 1); + + // Switching users should not count as a schedule type change even if second + // user's schedule type is different from the first. + base::HistogramTester histogram_tester_2; + const ScheduleType user_1_schedule_type = feature()->GetScheduleType(); + SwitchActiveUser(kUser2Email); + ASSERT_NE(feature()->GetScheduleType(), user_1_schedule_type); + histogram_tester_2.ExpectTotalCount(test_histogram_name, 0); +} + } // namespace } // namespace ash
diff --git a/ash/system/time/calendar_view_unittest.cc b/ash/system/time/calendar_view_unittest.cc index 58d55d9..46a9dc1 100644 --- a/ash/system/time/calendar_view_unittest.cc +++ b/ash/system/time/calendar_view_unittest.cc
@@ -2233,6 +2233,8 @@ TEST_F(CalendarViewAnimationTest, OpenAndCloseEventList) { ui::ScopedAnimationDurationScaleMode test_duration_mode( ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); + // Sets the timezone to "America/Los_Angeles". + ash::system::ScopedTimezoneSettings timezone_settings(u"America/Los_Angeles"); CreateCalendarView(); ui::LayerAnimationStoppedWaiter animation_waiter;
diff --git a/ash/webui/common/backend/shortcut_input_provider.cc b/ash/webui/common/backend/shortcut_input_provider.cc index efcda92..8a733f8 100644 --- a/ash/webui/common/backend/shortcut_input_provider.cc +++ b/ash/webui/common/backend/shortcut_input_provider.cc
@@ -10,6 +10,7 @@ #include "ash/public/mojom/input_device_settings.mojom.h" #include "ash/shell.h" #include "ash/webui/common/mojom/shortcut_input_provider.mojom.h" +#include "ui/base/ui_base_features.h" #include "ui/views/widget/widget.h" namespace ash { @@ -42,7 +43,8 @@ void ShortcutInputProvider::BindInterface( mojo::PendingReceiver<common::mojom::ShortcutInputProvider> receiver) { - CHECK(features::IsPeripheralCustomizationEnabled()); + CHECK(features::IsPeripheralCustomizationEnabled() || + ::features::IsShortcutCustomizationEnabled()); if (shortcut_input_receiver_.is_bound()) { shortcut_input_receiver_.reset(); }
diff --git a/ash/webui/shortcut_customization_ui/BUILD.gn b/ash/webui/shortcut_customization_ui/BUILD.gn index ea159fe..3f6886d 100644 --- a/ash/webui/shortcut_customization_ui/BUILD.gn +++ b/ash/webui/shortcut_customization_ui/BUILD.gn
@@ -22,6 +22,8 @@ "//ash", "//ash/constants", "//ash/webui/common:trusted_types_util", + "//ash/webui/common/backend", + "//ash/webui/common/mojom", "//ash/webui/resources:shortcut_customization_app_resources", "//ash/webui/shortcut_customization_ui/backend", "//ash/webui/shortcut_customization_ui/backend/search:mojo_bindings",
diff --git a/ash/webui/shortcut_customization_ui/shortcut_customization_app_ui.cc b/ash/webui/shortcut_customization_ui/shortcut_customization_app_ui.cc index 80ade37..f594a17 100644 --- a/ash/webui/shortcut_customization_ui/shortcut_customization_app_ui.cc +++ b/ash/webui/shortcut_customization_ui/shortcut_customization_app_ui.cc
@@ -9,6 +9,7 @@ #include "ash/constants/ash_features.h" #include "ash/shell.h" +#include "ash/webui/common/backend/shortcut_input_provider.h" #include "ash/webui/common/trusted_types_util.h" #include "ash/webui/grit/ash_shortcut_customization_app_resources.h" #include "ash/webui/grit/ash_shortcut_customization_app_resources_map.h" @@ -27,6 +28,7 @@ #include "services/network/public/mojom/content_security_policy.mojom.h" #include "ui/base/ui_base_features.h" #include "ui/resources/grit/webui_resources.h" +#include "ui/views/widget/widget.h" #include "ui/webui/color_change_listener/color_change_handler.h" #include "ui/webui/mojo_web_ui_controller.h" @@ -287,6 +289,20 @@ } void ShortcutCustomizationAppUI::BindInterface( + mojo::PendingReceiver<common::mojom::ShortcutInputProvider> receiver) { + auto* shortcut_input_provider = + shortcut_ui::ShortcutsAppManagerFactory::GetForBrowserContext( + web_ui()->GetWebContents()->GetBrowserContext()) + ->shortcut_input_provider(); + auto* widget = views::Widget::GetWidgetForNativeWindow( + web_ui()->GetWebContents()->GetTopLevelNativeWindow()); + if (widget) { + shortcut_input_provider->TieProviderToWidget(widget); + } + shortcut_input_provider->BindInterface(std::move(receiver)); +} + +void ShortcutCustomizationAppUI::BindInterface( mojo::PendingReceiver<shortcut_customization::mojom::SearchHandler> receiver) { shortcut_ui::SearchHandler* search_handler =
diff --git a/ash/webui/shortcut_customization_ui/shortcut_customization_app_ui.h b/ash/webui/shortcut_customization_ui/shortcut_customization_app_ui.h index 2d901fb..99587da 100644 --- a/ash/webui/shortcut_customization_ui/shortcut_customization_app_ui.h +++ b/ash/webui/shortcut_customization_ui/shortcut_customization_app_ui.h
@@ -8,6 +8,7 @@ #include <memory> #include "ash/accelerators/accelerator_prefs.h" +#include "ash/webui/common/mojom/shortcut_input_provider.mojom.h" #include "ash/webui/shortcut_customization_ui/backend/search/search.mojom.h" #include "ash/webui/shortcut_customization_ui/backend/search/search_handler.h" #include "ash/webui/shortcut_customization_ui/mojom/shortcut_customization.mojom.h" @@ -56,6 +57,9 @@ receiver); void BindInterface( + mojo::PendingReceiver<common::mojom::ShortcutInputProvider> receiver); + + void BindInterface( mojo::PendingReceiver<shortcut_customization::mojom::SearchHandler> receiver);
diff --git a/ash/webui/shortcut_customization_ui/shortcuts_app_manager.cc b/ash/webui/shortcut_customization_ui/shortcuts_app_manager.cc index b4bc360..568da3d 100644 --- a/ash/webui/shortcut_customization_ui/shortcuts_app_manager.cc +++ b/ash/webui/shortcut_customization_ui/shortcuts_app_manager.cc
@@ -9,6 +9,7 @@ #include "ash/constants/ash_features.h" #include "ash/public/mojom/accelerator_info.mojom-forward.h" #include "ash/public/mojom/accelerator_info.mojom.h" +#include "ash/webui/common/backend/shortcut_input_provider.h" #include "ash/webui/shortcut_customization_ui/backend/accelerator_configuration_provider.h" #include "ash/webui/shortcut_customization_ui/backend/search/search_concept.h" #include "ash/webui/shortcut_customization_ui/backend/search/search_concept_registry.h" @@ -28,6 +29,7 @@ search_concept_registry_.get(), local_search_service_proxy); accelerator_configuration_provider_ = std::make_unique<AcceleratorConfigurationProvider>(pref_service); + shortcut_input_provider_ = std::make_unique<ShortcutInputProvider>(); accelerator_configuration_provider_->AddObserver(this);
diff --git a/ash/webui/shortcut_customization_ui/shortcuts_app_manager.h b/ash/webui/shortcut_customization_ui/shortcuts_app_manager.h index 0b33644..48c8081 100644 --- a/ash/webui/shortcut_customization_ui/shortcuts_app_manager.h +++ b/ash/webui/shortcut_customization_ui/shortcuts_app_manager.h
@@ -15,6 +15,8 @@ namespace ash { +class ShortcutInputProvider; + namespace local_search_service { class LocalSearchServiceProxy; } @@ -49,6 +51,9 @@ return accelerator_configuration_provider_.get(); } SearchHandler* search_handler() { return search_handler_.get(); } + ShortcutInputProvider* shortcut_input_provider() { + return shortcut_input_provider_.get(); + } // shortcut_ui::AcceleratorConfigurationProvider:: void OnAcceleratorsUpdated( @@ -67,6 +72,7 @@ std::unique_ptr<AcceleratorConfigurationProvider> accelerator_configuration_provider_; + std::unique_ptr<ShortcutInputProvider> shortcut_input_provider_; std::unique_ptr<SearchConceptRegistry> search_concept_registry_; std::unique_ptr<SearchHandler> search_handler_; };
diff --git a/ash/wm/float/float_controller.cc b/ash/wm/float/float_controller.cc index 40d795c..7fd741a 100644 --- a/ash/wm/float/float_controller.cc +++ b/ash/wm/float/float_controller.cc
@@ -97,6 +97,12 @@ // `TabletModeWindowState::UpdateWindowPosition`.) if (window->GetProperty(aura::client::kAppType) == static_cast<int>(AppType::ARC_APP)) { + // If any animation is requested, it will directly animate the + // client-controlled windows for a rich animation. The client bounds change + // will follow. + if (animation_type != WindowState::BoundsChangeAnimationType::kNone) { + TabletModeWindowState::UpdateWindowPosition(window_state, animation_type); + } const SetBoundsWMEvent event( TabletModeWindowState::GetBoundsInTabletMode(window_state), /*animate=*/animation_type !=
diff --git a/ash/wm/overview/overview_controller.cc b/ash/wm/overview/overview_controller.cc index d653eaa..491ab09 100644 --- a/ash/wm/overview/overview_controller.cc +++ b/ash/wm/overview/overview_controller.cc
@@ -314,12 +314,11 @@ // Don't allow a window overview if the user session is not active (e.g. // locked or in user-adding screen) or a modal dialog is open or running in // kiosk app session. - SessionControllerImpl* session_controller = - Shell::Get()->session_controller(); - return session_controller->GetSessionState() == + Shell* shell = Shell::Get(); + return shell->session_controller()->GetSessionState() == session_manager::SessionState::ACTIVE && !Shell::IsSystemModalWindowOpen() && - !Shell::Get()->screen_pinning_controller()->IsPinned(); + !shell->screen_pinning_controller()->IsPinned(); } void OverviewController::ToggleOverview(OverviewEnterExitType type) {
diff --git a/ash/wm/splitview/split_view_constants.h b/ash/wm/splitview/split_view_constants.h index f8fe35f..a0f2a6fd 100644 --- a/ash/wm/splitview/split_view_constants.h +++ b/ash/wm/splitview/split_view_constants.h
@@ -8,7 +8,6 @@ #include "ash/ash_export.h" #include "base/time/time.h" #include "chromeos/ui/wm/constants.h" -#include "ui/gfx/geometry/insets.h" namespace ash { @@ -51,6 +50,12 @@ // The delay before the `split_view_divider_` spawning animation. constexpr auto kSplitviewDividerSpawnDelay = base::Milliseconds(183); +// The one-way bouncing animation duration for the `split_view_divider_` when +// the to-be-snapped window can't fit in the work area. The actual duration when +// used should be doubled to include the "bouncing out and bounding back in" +// process. +constexpr auto kBouncingAnimationOneWayDuration = base::Milliseconds(250); + // The thickness of the `split_view_divider_`'s handler. constexpr int kSplitviewWhiteBarShortSideLength = 2;
diff --git a/ash/wm/splitview/split_view_controller.cc b/ash/wm/splitview/split_view_controller.cc index dae2900..031288bb 100644 --- a/ash/wm/splitview/split_view_controller.cc +++ b/ash/wm/splitview/split_view_controller.cc
@@ -6,6 +6,8 @@ #include <algorithm> #include <cmath> +#include <cstdint> +#include <limits> #include "ash/accessibility/accessibility_controller_impl.h" #include "ash/constants/app_types.h" @@ -50,12 +52,13 @@ #include "base/auto_reset.h" #include "base/containers/flat_map.h" #include "base/functional/bind.h" -#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" +#include "base/notreached.h" #include "base/ranges/algorithm.h" #include "base/time/time.h" #include "chromeos/ui/base/window_properties.h" +#include "chromeos/ui/base/window_state_type.h" #include "chromeos/ui/frame/caption_buttons/snap_controller.h" #include "components/app_restore/desk_template_read_handler.h" #include "components/app_restore/window_properties.h" @@ -154,13 +157,14 @@ WindowStateType GetStateTypeFromSnapPosition( SplitViewController::SnapPosition snap_position) { - DCHECK(snap_position != SplitViewController::SnapPosition::kNone); - if (snap_position == SplitViewController::SnapPosition::kPrimary) - return WindowStateType::kPrimarySnapped; - if (snap_position == SplitViewController::SnapPosition::kSecondary) - return WindowStateType::kSecondarySnapped; - NOTREACHED(); - return WindowStateType::kDefault; + switch (snap_position) { + case SplitViewController::SnapPosition::kPrimary: + return WindowStateType::kPrimarySnapped; + case SplitViewController::SnapPosition::kSecondary: + return WindowStateType::kSecondarySnapped; + default: + NOTREACHED_NORETURN(); + } } // Returns the minimum length of the window according to the screen orientation. @@ -226,6 +230,36 @@ window_state->OnWMEvent(&window_event); } +// Returns true if the snap state of the `window` has changed if it's already in +// split view mode. +bool DidInSplitViewWindowChange( + aura::Window* window, + SplitViewController* split_view_controller, + SplitViewController::SnapPosition snap_position) { + if (!split_view_controller->IsWindowInSplitView(window)) { + return false; + } + + const auto* window_state = WindowState::Get(window); + if (window_state->GetStateType() != + GetStateTypeFromSnapPosition(snap_position)) { + return true; + } + + // For the current tablet mode split view design, we can assume that the + // `window` is being snapped to the same `snap_position` it was snapped since + // it's single layer design. We need to check if the snap ratio is the same. + absl::optional<float> snap_ratio = window_state->snap_ratio(); + // Get the snap ratio for the window that is currently occupying the + // `snap_position`. + const auto* window_state_in_current_snap_position = + WindowState::Get(split_view_controller->GetSnappedWindow(snap_position)); + const bool same_snap_ratio = + snap_ratio && window_state_in_current_snap_position && + *snap_ratio == window_state_in_current_snap_position->snap_ratio(); + return !same_snap_ratio; +} + } // namespace // ----------------------------------------------------------------------------- @@ -348,15 +382,10 @@ void AddToBeSnappedWindow(aura::Window* window, SplitViewController::SnapPosition snap_position, WindowSnapActionSource snap_action_source) { - // If `window` is already snapped in split screen, do nothing. - if (split_view_controller_->IsWindowInSplitView(window)) { - if (WindowState::Get(window)->GetStateType() != - GetStateTypeFromSnapPosition(snap_position)) { - // This can happen when swapping the positions of the two snapped - // windows in the split view. - split_view_controller_->AttachSnappingWindow(window, snap_position, - snap_action_source); - } + if (DidInSplitViewWindowChange(window, split_view_controller_, + snap_position)) { + split_view_controller_->AttachSnappingWindow(window, snap_position, + snap_action_source); return; } @@ -365,7 +394,7 @@ return; } - // Stop observe any previous to-be-snapped window in `snap_position`. This + // Stop observing any previous to-be-snapped window in `snap_position`. This // can happen to Android windows as its window state and bounds change are // async, so it's possible to snap another window to the same position while // waiting for the snapping of the previous window. @@ -593,7 +622,7 @@ return false; return GetMinimumWindowLength(window, IsLayoutHorizontal(window)) <= - GetDividerEndPosition() * snap_ratio - + GetDividerPositionUpperLimit() * snap_ratio - kSplitviewDividerShortSideLength / 2; } @@ -698,8 +727,9 @@ event_type == WM_EVENT_SNAP_SECONDARY); // If split view can't be enabled at the moment, do nothing. - if (!ShouldAllowSplitView()) + if (!ShouldAllowSplitView()) { return; + } const bool in_overview = IsInOverviewSession(); @@ -734,56 +764,6 @@ const SnapPosition to_snap_position = event_type == WM_EVENT_SNAP_PRIMARY ? SnapPosition::kPrimary : SnapPosition::kSecondary; - - // Snap events may request a new snap ratio for an already snapped window, so - // update the divider position and use it to calculate the snapped bounds. - // Note that only manually-requested snap events (via the multitask menu) will - // arrive here, as auto-snap (via `SnapWindow()`) will have added the - // to-be-snapped window. b/267380892 - absl::optional<float> new_snap_ratio = WindowState::Get(window)->snap_ratio(); - if (new_snap_ratio) { - const float old_divider_position = divider_position_; - divider_position_ = GetDividerPosition(to_snap_position, *new_snap_ratio); - if (split_view_divider_) { - split_view_divider_->UpdateDividerBounds(); - } - if (!primary_window_ != !secondary_window_) { - // Only notify observers if there is only one snapped window, i.e. - // overview is open. - NotifyDividerPositionChanged(); - } else if (primary_window_ && secondary_window_) { - auto* other_window = event_type == WM_EVENT_SNAP_PRIMARY - ? secondary_window_.get() - : primary_window_.get(); - DCHECK(other_window); - const int other_window_length = - GetMinimumWindowLength(other_window, IsLayoutHorizontal(window)); - const int work_area_size = GetDividerEndPosition(); - const int window_length = event_type == WM_EVENT_SNAP_PRIMARY - ? divider_position_ - : work_area_size - divider_position_ - - kSplitviewDividerShortSideLength; - if (window_length + other_window_length + - kSplitviewDividerShortSideLength > - work_area_size) { - // If `other_window` can't fit in the opposite position, set - // `divider_snap_animation_` to Hide then Show, to give off the - // impression of bouncing the divider back to `old_divider_position`. - // Note the duration is 2 * 250ms to bounce out then in. - tablet_resize_mode_ = TabletResizeMode::kFast; - divider_snap_animation_ = std::make_unique<DividerSnapAnimation>( - this, divider_position_, old_divider_position, - base::Milliseconds(500), gfx::Tween::FAST_OUT_SLOW_IN_3); - divider_snap_animation_->Hide(); - divider_snap_animation_->Show(); - } else { - // If both windows are already snapped and one window snap ratio - // changes, the other window should also get updated. - UpdateSnappedBounds(other_window); - } - } - } - // Start observing the to-be-snapped window. to_be_snapped_windows_observer_->AddToBeSnappedWindow( window, to_snap_position, snap_action_source); @@ -799,13 +779,30 @@ OverviewSession* overview_session = GetOverviewSession(); RemoveSnappingWindowFromOverviewIfApplicable(overview_session, window); + const float old_divider_position = divider_position_; + // Get the divider position given by `snap_ratio` if exists, or if there is + // pre-set `divider_position_`, use it, which can happen during tablet <-> + // clamshell transition or multi-user transition. If neither `snap_ratio` nor + // `divider_position_` exists, calculate the divider position with the default + // snap ratio i.e. `chromeos::kDefaultSnapRatio`. + // TODO(michelefan): See if it is a valid case to not having `snap_ratio` + // while `divider_position` is less than 0. + if (absl::optional<float> snap_ratio = WindowState::Get(window)->snap_ratio(); + snap_ratio) { + divider_position_ = GetDividerPosition(snap_position, *snap_ratio); + } else if (divider_position_ < 0) { + divider_position_ = + GetDividerPosition(snap_position, chromeos::kDefaultSnapRatio); + } + if (state_ == State::kNoSnap) { + Shell* shell = Shell::Get(); // Add observers when the split view mode starts. - Shell::Get()->AddShellObserver(this); - Shell::Get()->overview_controller()->AddObserver(this); + shell->AddShellObserver(this); + OverviewController::Get()->AddObserver(this); if (features::IsAdjustSplitViewForVKEnabled()) { keyboard::KeyboardUIController::Get()->AddObserver(this); - Shell::Get()->activation_client()->AddObserver(this); + shell->activation_client()->AddObserver(this); } if (!window_util::IsFasterSplitScreenOrSnapGroupEnabledInClamshell()) { @@ -820,9 +817,7 @@ if (!IsInTabletMode() && IsInOverviewSession()) { if (auto* root_window_controller = - RootWindowController::ForWindow(window); - root_window_controller && - !root_window_controller->split_view_overview_session()) { + RootWindowController::ForWindow(window)) { // Start the clamshell split overview session. It is too late to create // this in `OnOverviewModeStarting()`, since overview will already have // started and we are dragging `window` into split view. @@ -833,16 +828,6 @@ } } - // Get the divider position given by `snap_ratio`, or if there is - // pre-set `divider_position_`, use it. It can happen during tablet <-> - // clamshell transition or multi-user transition. - absl::optional<float> snap_ratio = WindowState::Get(window)->snap_ratio(); - divider_position_ = - (divider_position_ < 0) - ? GetDividerPosition( - snap_position, - snap_ratio ? *snap_ratio : chromeos::kDefaultSnapRatio) - : divider_position_; default_snap_position_ = snap_position; if (split_view_type_ == SplitViewType::kTabletType) { @@ -861,7 +846,9 @@ } aura::Window* previous_snapped_window = nullptr; + aura::Window* other_window = nullptr; if (snap_position == SnapPosition::kPrimary) { + other_window = secondary_window_; if (primary_window_ != window) { previous_snapped_window = primary_window_; StopObserving(SnapPosition::kPrimary); @@ -874,6 +861,7 @@ default_snap_position_ = SnapPosition::kPrimary; } } else if (snap_position == SnapPosition::kSecondary) { + other_window = primary_window_; if (secondary_window_ != window) { previous_snapped_window = secondary_window_; StopObserving(SnapPosition::kSecondary); @@ -907,6 +895,24 @@ split_view_divider_->UpdateDividerBounds(); } + const bool total_size_exceeds_work_area = + divider_position_ + kSplitviewDividerShortSideLength + + GetMinimumWindowLength(other_window, IsLayoutHorizontal(window)) > + GetDividerPositionUpperLimit(); + if (primary_window_ && secondary_window_ && total_size_exceeds_work_area) { + // If `other_window` can't fit in the opposite position, set + // `divider_snap_animation_` to Hide then Show, to give off the + // impression of bouncing the divider back to `old_divider_position`. + // Note the duration is 2 * `kBouncingAnimationOneWayDuration` to + // bounce out then in. + tablet_resize_mode_ = TabletResizeMode::kFast; + divider_snap_animation_ = std::make_unique<DividerSnapAnimation>( + this, divider_position_, old_divider_position, + 2 * kBouncingAnimationOneWayDuration, gfx::Tween::FAST_OUT_SLOW_IN_3); + divider_snap_animation_->Hide(); + divider_snap_animation_->Show(); + } + base::RecordAction(base::UserMetricsAction("SplitView_SnapWindow")); } @@ -1017,7 +1023,7 @@ // `SplitViewController::GetSnappedWindowBoundsInScreen()` calls in clamshell // mode to `GetSnappedWindowBounds()` in window_positioning_utils.cc. const bool in_tablet_mode = IsInTabletMode(); - const int work_area_size = GetDividerEndPosition(); + const int work_area_size = GetDividerPositionUpperLimit(); int divider_position = divider_position_ < 0 ? GetDividerPosition(snap_position, snap_ratio) : divider_position_; @@ -1126,14 +1132,14 @@ int SplitViewController::GetDividerPosition(SnapPosition snap_position, float snap_ratio) const { - int divider_end_position = GetDividerEndPosition(); + int divider_upper_limit = GetDividerPositionUpperLimit(); // `snap_width` needs to be a float so that the rounding is performed at the // end of the computation of `next_divider_position`. It's important because a // 1-DIP gap between snapped windows precludes multiresizing. See b/262011280. - const float snap_width = divider_end_position * snap_ratio; + const float snap_width = divider_upper_limit * snap_ratio; int next_divider_position = snap_position == SnapPosition::kPrimary ? snap_width - : divider_end_position - snap_width; + : divider_upper_limit - snap_width; if (split_view_divider_ || split_view_type_ == SplitViewType::kTabletType) { // The divider may be visible in tablet mode, or between two windows in a // snap group in clamshell mode. @@ -1692,9 +1698,9 @@ // Reverse the position ratio if top/left window changes. if (is_previous_layout_right_side_up != IsLayoutPrimary(display)) divider_closest_ratio_ = 1.f - divider_closest_ratio_; - divider_position_ = - static_cast<int>(divider_closest_ratio_ * GetDividerEndPosition()) - - kSplitviewDividerShortSideLength / 2; + divider_position_ = static_cast<int>(divider_closest_ratio_ * + GetDividerPositionUpperLimit()) - + kSplitviewDividerShortSideLength / 2; } // For other display configuration changes, we only move the divider to the @@ -1991,9 +1997,9 @@ } void SplitViewController::MaybeEndOverviewOnWindowResize(aura::Window* window) { - const int divider_end_position(GetDividerEndPosition()); - if (divider_position_ < divider_end_position * chromeos::kOneThirdSnapRatio || - divider_position_ > divider_end_position * chromeos::kTwoThirdSnapRatio) { + const int divider_upper_limit(GetDividerPositionUpperLimit()); + if (divider_position_ < divider_upper_limit * chromeos::kOneThirdSnapRatio || + divider_position_ > divider_upper_limit * chromeos::kTwoThirdSnapRatio) { Shell::Get()->overview_controller()->EndOverview( OverviewEndAction::kSplitView); WindowState::Get(window)->Maximize(); @@ -2166,7 +2172,7 @@ secondary_window_min_size = secondary_window_->delegate()->GetMinimumSize(); bool right_side_up = IsLayoutPrimary(root_window_); - int divider_end_position = GetDividerEndPosition(); + int divider_upper_limit = GetDividerPositionUpperLimit(); // The distance from the current resizing position to the left or right side // of the screen. Note: left or right side here means the side of the // |primary_window_| or |secondary_window_|. @@ -2192,12 +2198,12 @@ } if (primary_window_distance < - divider_end_position * chromeos::kOneThirdSnapRatio || + divider_upper_limit * chromeos::kOneThirdSnapRatio || primary_window_distance < min_left_length) { return SnapPosition::kPrimary; } if (secondary_window_distance < - divider_end_position * chromeos::kOneThirdSnapRatio || + divider_upper_limit * chromeos::kOneThirdSnapRatio || secondary_window_distance < min_right_length) { return SnapPosition::kSecondary; } @@ -2226,11 +2232,11 @@ // extract the center from |divider_position_|. The result will also be the // center of the divider, so extract the origin, unless the result is on of // the endpoints. - int divider_end_position = GetDividerEndPosition(); + int divider_upper_limit = GetDividerPositionUpperLimit(); divider_closest_ratio_ = FindClosestPositionRatio( float(divider_position_ + kSplitviewDividerShortSideLength / 2) / - divider_end_position); - int fixed_position = divider_end_position * divider_closest_ratio_; + divider_upper_limit); + int fixed_position = divider_upper_limit * divider_closest_ratio_; if (divider_closest_ratio_ > 0.f && divider_closest_ratio_ < 1.f) { fixed_position -= kSplitviewDividerShortSideLength / 2; } @@ -2253,7 +2259,8 @@ bool SplitViewController::ShouldEndSplitViewAfterResizingAtEdge() { DCHECK(InTabletSplitViewMode() || IsSnapGroupEnabledInClamshellMode()); - return divider_position_ == 0 || divider_position_ == GetDividerEndPosition(); + return divider_position_ == 0 || + divider_position_ == GetDividerPositionUpperLimit(); } void SplitViewController::EndSplitViewAfterResizingAtEdgeIfAppropriate() { @@ -2291,7 +2298,7 @@ : GetPhysicalLeftOrTopWindow(); } -int SplitViewController::GetDividerEndPosition() const { +int SplitViewController::GetDividerPositionUpperLimit() const { const gfx::Rect work_area_bounds = screen_util::GetDisplayWorkAreaBoundsInScreenForActiveDeskContainer( root_window_); @@ -2306,13 +2313,9 @@ RestoreTransformIfApplicable(window); UpdateStateAndNotifyObservers(); - SnapGroupController* snap_group_controller = SnapGroupController::Get(); - const bool snap_group_enabled_in_clamshell = - IsSnapGroupEnabledInClamshellMode(); - if (state_ == State::kBothSnapped && snap_group_enabled_in_clamshell) { + if (state_ == State::kBothSnapped && IsSnapGroupEnabledInClamshellMode()) { + SnapGroupController* snap_group_controller = SnapGroupController::Get(); // TODO(b/286963080): Move this to SnapGroupController. - CHECK(primary_window_); - CHECK(secondary_window_); if (!snap_group_controller->AreWindowsInSnapGroup(primary_window_, secondary_window_)) { snap_group_controller->AddSnapGroup(primary_window_, secondary_window_); @@ -2338,10 +2341,9 @@ if (previous_state && *previous_state == chromeos::WindowStateType::kFloated && IsInTabletMode() && !BothSnapped()) { - auto mru_windows = - Shell::Get()->mru_window_tracker()->BuildWindowForCycleList( - kActiveDesk); - for (aura::Window* mru_window : mru_windows) { + for (aura::Window* mru_window : + Shell::Get()->mru_window_tracker()->BuildWindowForCycleList( + kActiveDesk)) { auto* window_state = WindowState::Get(mru_window); if (mru_window != window && !window_state->IsMinimized() && window_state->CanSnap()) { @@ -2459,21 +2461,6 @@ } } -float SplitViewController::FindClosestPositionRatio(float current_ratio) { - float closest_ratio = 0.f; - std::vector<float> position_ratios( - kFixedPositionRatios, - kFixedPositionRatios + sizeof(kFixedPositionRatios) / sizeof(float)); - ModifyPositionRatios(&position_ratios); - for (const float ratio : position_ratios) { - if (std::abs(current_ratio - ratio) < - std::abs(current_ratio - closest_ratio)) { - closest_ratio = ratio; - } - } - return closest_ratio; -} - void SplitViewController::ModifyPositionRatios( std::vector<float>* out_position_ratios) { const bool landscape = IsCurrentScreenOrientationLandscape(); @@ -2481,11 +2468,11 @@ GetMinimumWindowLength(GetPhysicalLeftOrTopWindow(), landscape); const int min_right_size = GetMinimumWindowLength(GetPhysicalRightOrBottomWindow(), landscape); - const int divider_end_position = GetDividerEndPosition(); + const int divider_upper_limit = GetDividerPositionUpperLimit(); const float min_size_left_ratio = - static_cast<float>(min_left_size) / divider_end_position; + static_cast<float>(min_left_size) / divider_upper_limit; const float min_size_right_ratio = - static_cast<float>(min_right_size) / divider_end_position; + static_cast<float>(min_right_size) / divider_upper_limit; if (min_size_left_ratio <= chromeos::kOneThirdSnapRatio) { out_position_ratios->push_back(chromeos::kOneThirdSnapRatio); } @@ -2501,6 +2488,23 @@ } } +float SplitViewController::FindClosestPositionRatio(float current_ratio) { + float closest_ratio = 0.f; + std::vector<float> position_ratios( + kFixedPositionRatios, + kFixedPositionRatios + std::size(kFixedPositionRatios)); + ModifyPositionRatios(&position_ratios); + float min_ratio_diff = std::numeric_limits<float>::max(); + for (const float ratio : position_ratios) { + const float ratio_diff = std::abs(current_ratio - ratio); + if (ratio_diff < min_ratio_diff) { + min_ratio_diff = ratio_diff; + closest_ratio = ratio; + } + } + return closest_ratio; +} + gfx::Point SplitViewController::GetEndDragLocationInScreen( aura::Window* window, const gfx::Point& location_in_screen) { @@ -2563,7 +2567,7 @@ gfx::Transform right_or_bottom_transform; if (right_or_bottom_window) { - const int right_size = GetDividerEndPosition() - divider_position_ - + const int right_size = GetDividerPositionUpperLimit() - divider_position_ - kSplitviewDividerShortSideLength; const int distance = right_size - GetWindowLength(right_or_bottom_window, horizontal);
diff --git a/ash/wm/splitview/split_view_controller.h b/ash/wm/splitview/split_view_controller.h index 922e7c91..61588c87 100644 --- a/ash/wm/splitview/split_view_controller.h +++ b/ash/wm/splitview/split_view_controller.h
@@ -551,10 +551,10 @@ // needs to be activated. Returns nullptr if there is no such window. aura::Window* GetActiveWindowAfterResizingUponExit(); - // Returns the maximum value of the |divider_position_|. It is the width of + // Returns the maximum value of the `divider_position_`, which is the width of // the current display's work area bounds in landscape orientation, or height // of the current display's work area bounds in portrait orientation. - int GetDividerEndPosition() const; + int GetDividerPositionUpperLimit() const; // Called after a to-be-snapped window `window` got snapped. It updates the // split view states and notifies observers about the change. It also restore
diff --git a/ash/wm/splitview/split_view_controller_unittest.cc b/ash/wm/splitview/split_view_controller_unittest.cc index b6f2531..ccc60b1 100644 --- a/ash/wm/splitview/split_view_controller_unittest.cc +++ b/ash/wm/splitview/split_view_controller_unittest.cc
@@ -11,7 +11,6 @@ #include <vector> #include "ash/accessibility/magnifier/docked_magnifier_controller.h" -#include "ash/app_list/app_list_controller_impl.h" #include "ash/constants/app_types.h" #include "ash/constants/ash_features.h" #include "ash/display/screen_orientation_controller.h" @@ -19,7 +18,6 @@ #include "ash/keyboard/ui/keyboard_ui_controller.h" #include "ash/keyboard/ui/test/keyboard_test_util.h" #include "ash/public/cpp/fps_counter.h" -#include "ash/public/cpp/shelf_config.h" #include "ash/public/cpp/window_backdrop.h" #include "ash/public/cpp/window_properties.h" #include "ash/root_window_controller.h" @@ -34,7 +32,6 @@ #include "ash/test/ash_test_base.h" #include "ash/test/test_window_builder.h" #include "ash/wm/desks/desks_util.h" -#include "ash/wm/drag_window_resizer.h" #include "ash/wm/float/float_controller.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overview/overview_controller.h" @@ -46,6 +43,7 @@ #include "ash/wm/splitview/split_view_divider.h" #include "ash/wm/splitview/split_view_drag_indicators.h" #include "ash/wm/splitview/split_view_metrics_controller.h" +#include "ash/wm/splitview/split_view_overview_session.h" #include "ash/wm/splitview/split_view_utils.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/test/fake_window_state.h" @@ -58,16 +56,13 @@ #include "base/containers/contains.h" #include "base/memory/ptr_util.h" #include "base/memory/raw_ptr.h" -#include "base/ranges/algorithm.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" -#include "chromeos/constants/chromeos_features.h" #include "chromeos/ui/base/window_properties.h" #include "chromeos/ui/frame/caption_buttons/snap_controller.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" -#include "ui/base/hit_test.h" #include "ui/base/ime/dummy_text_input_client.h" #include "ui/compositor/presentation_time_recorder.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" @@ -75,11 +70,10 @@ #include "ui/compositor_extra/shadow.h" #include "ui/display/test/display_manager_test_api.h" #include "ui/events/test/event_generator.h" +#include "ui/gfx/geometry/point_conversions.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/shadow_controller.h" -#include "ui/wm/core/shadow_types.h" -#include "ui/wm/core/transient_window_manager.h" #include "ui/wm/core/window_util.h" namespace ash { @@ -3278,8 +3272,8 @@ EXPECT_TRUE(base::Contains(observed_windows, right_window.get())); } -// Tests that snap between different ratios in the same position works as -// intended. +// Tests that the bounds of the window and divider get updated correctly when +// snapping with different ratios. TEST_F(SplitViewControllerTest, SnapBetweenDifferentRatios) { std::unique_ptr<aura::Window> window1 = CreateTestWindow(); std::unique_ptr<aura::Window> window2 = CreateTestWindow(); @@ -3314,6 +3308,9 @@ chromeos::kTwoThirdSnapRatio); WindowState::Get(window1.get())->OnWMEvent(&snap_primary_two_third); + // Wait until the divider animation completes. + base::RunLoop().RunUntilIdle(); + // Test that the window bounds have updated to two thirds and one third of the // work area width respectively. The the divider is positioned at two thirds // of the work area width minus the `divider_delta`. @@ -3472,12 +3469,65 @@ SkipDividerSnapAnimation(); gfx::Rect divider_bounds = split_view_divider()->GetDividerBoundsInScreen(/*is_dragging=*/false); - ASSERT_NEAR(work_area_bounds.width() * 0.5f, divider_bounds.x(), - divider_bounds.width()); - ASSERT_NEAR(work_area_bounds.width() * 0.5f, window1->bounds().width(), - kSplitviewDividerShortSideLength / 2); - ASSERT_NEAR(work_area_bounds.width() * 0.5f, window2->bounds().width(), - kSplitviewDividerShortSideLength / 2); + ASSERT_EQ(work_area_bounds.width() * 0.5f, + divider_bounds.x() + kSplitviewDividerShortSideLength / 2); + ASSERT_EQ(work_area_bounds.width() * 0.5f, + window1->bounds().width() + kSplitviewDividerShortSideLength / 2); + ASSERT_EQ(work_area_bounds.width() * 0.5f, + window2->bounds().width() + kSplitviewDividerShortSideLength / 2); +} + +// Tests that resnapping a snapped window to its opposite snap position will +// start the partial overview and divider will be at the correct position. See +// crash at b/311216394. +TEST_F(SplitViewControllerTest, ResnapASnappedWindowToOppositePosition) { + const gfx::Rect bounds(0, 0, 400, 400); + std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); + std::unique_ptr<aura::Window> window2(CreateWindow(bounds)); + + gfx::Rect work_area_bounds = + screen_util::GetDisplayWorkAreaBoundsInScreenForActiveDeskContainer( + window1.get()); + aura::test::TestWindowDelegate* delegate2 = + static_cast<aura::test::TestWindowDelegate*>(window2->delegate()); + + // Set the window minimum size to be between 1/3 and 1/2. + delegate2->set_minimum_size( + gfx::Size(work_area_bounds.width() * 0.4f, work_area_bounds.height())); + + WindowSnapWMEvent snap_primary_two_thirds(WM_EVENT_SNAP_PRIMARY, + chromeos::kTwoThirdSnapRatio); + WindowState::Get(window1.get())->OnWMEvent(&snap_primary_two_thirds); + SkipDividerSnapAnimation(); + + OverviewController* overview_controller = OverviewController::Get(); + EXPECT_TRUE(overview_controller->InOverviewSession()); + SplitViewOverviewSession* split_view_overview_session = + RootWindowController::ForWindow(window1.get()) + ->split_view_overview_session(); + EXPECT_TRUE(split_view_overview_session); + + auto* item2 = GetOverviewItemForWindow(window2.get()); + auto* event_generator = GetEventGenerator(); + event_generator->MoveMouseTo( + gfx::ToRoundedPoint(item2->target_bounds().CenterPoint())); + event_generator->ClickLeftButton(); + + EXPECT_EQ(split_view_controller()->state(), + SplitViewController::State::kBothSnapped); + EXPECT_EQ(work_area_bounds.width() * 0.5f, + window1->bounds().width() + kSplitviewDividerShortSideLength / 2); + EXPECT_EQ(work_area_bounds.width() * 0.5f, + window2->bounds().width() + kSplitviewDividerShortSideLength / 2); + + WindowSnapWMEvent snap_secondary_two_thirds(WM_EVENT_SNAP_PRIMARY, + chromeos::kTwoThirdSnapRatio); + WindowState::Get(window2.get())->OnWMEvent(&snap_secondary_two_thirds); + SkipDividerSnapAnimation(); + EXPECT_NEAR(work_area_bounds.width() * 0.67f, window2->bounds().width(), + kSplitviewDividerShortSideLength); + EXPECT_TRUE(overview_controller->InOverviewSession()); + EXPECT_TRUE(split_view_divider()); } // Tests that auto-snap for partial windows works correctly.
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_page.h b/base/allocator/partition_allocator/src/partition_alloc/partition_page.h index 37a1fc9f..4a77782 100644 --- a/base/allocator/partition_allocator/src/partition_alloc/partition_page.h +++ b/base/allocator/partition_allocator/src/partition_alloc/partition_page.h
@@ -80,7 +80,12 @@ #pragma pack(push, 1) struct SlotSpanMetadata { private: - EncodedNextFreelistEntry* freelist_head = nullptr; + union { + EncodedNextFreelistEntry* freelist_head = nullptr; +#if BUILDFLAG(USE_FREELIST_POOL_OFFSETS) + PoolOffsetFreelistEntry* pool_offset_freelist_head = nullptr; +#endif + }; public: // TODO(lizeb): Make as many fields as possible private or const, to @@ -124,14 +129,32 @@ PA_NOINLINE PA_COMPONENT_EXPORT(PARTITION_ALLOC) void FreeSlowPath( size_t number_of_freed); PA_ALWAYS_INLINE EncodedNextFreelistEntry* PopForAlloc(size_t size); - PA_ALWAYS_INLINE void Free(uintptr_t ptr, PartitionRoot* root); + PA_ALWAYS_INLINE void Free(uintptr_t ptr, PartitionRoot* root) + PA_EXCLUSIVE_LOCKS_REQUIRED(PartitionRootLock(root)); + +#if BUILDFLAG(USE_FREELIST_POOL_OFFSETS) + PA_ALWAYS_INLINE PoolOffsetFreelistEntry* PopPoolOffsetFreelistForAlloc( + size_t size); + PA_ALWAYS_INLINE void FreeForPoolOffsetFreelist(uintptr_t ptr, + PartitionRoot* root) + PA_EXCLUSIVE_LOCKS_REQUIRED(PartitionRootLock(root)); +#endif + // Appends the passed freelist to the slot-span's freelist. Please note that // the function doesn't increment the tags of the passed freelist entries, // since FreeInline() did it already. PA_ALWAYS_INLINE void AppendFreeList(EncodedNextFreelistEntry* head, EncodedNextFreelistEntry* tail, size_t number_of_freed, - PartitionRoot* root); + PartitionRoot* root) + PA_EXCLUSIVE_LOCKS_REQUIRED(PartitionRootLock(root)); +#if BUILDFLAG(USE_FREELIST_POOL_OFFSETS) + PA_ALWAYS_INLINE void AppendPoolOffsetFreeList(PoolOffsetFreelistEntry* head, + PoolOffsetFreelistEntry* tail, + size_t number_of_freed, + PartitionRoot* root) + PA_EXCLUSIVE_LOCKS_REQUIRED(PartitionRootLock(root)); +#endif // BUILDFLAG(USE_FREELIST_POOL_OFFSETS) void Decommit(PartitionRoot* root); void DecommitIfPossible(PartitionRoot* root); @@ -169,6 +192,15 @@ } PA_ALWAYS_INLINE void SetFreelistHead(EncodedNextFreelistEntry* new_head); +#if BUILDFLAG(USE_FREELIST_POOL_OFFSETS) + PA_ALWAYS_INLINE PoolOffsetFreelistEntry* get_pool_offset_freelist_head() + const { + return pool_offset_freelist_head; + } + PA_ALWAYS_INLINE void SetPoolOffsetFreelistHead( + PoolOffsetFreelistEntry* new_head); +#endif // BUILDFLAG(USE_FREELIST_POOL_OFFSETS) + // Returns size of the region used within a slot. The used region comprises // of actual allocated data, extras and possibly empty space in the middle. PA_ALWAYS_INLINE size_t GetUtilizedSlotSize() const { @@ -615,6 +647,17 @@ freelist_is_sorted_ = false; } +#if BUILDFLAG(USE_FREELIST_POOL_OFFSETS) +PA_ALWAYS_INLINE void SetPoolOffsetFreelistHead( + PoolOffsetFreelistEntry* new_head) { + PA_DCHECK(!new_head || + (reinterpret_cast<uintptr_t>(this) & kSuperPageBaseMask) == + (UntagPtr(new_head) & kSuperPageBaseMask)); + pool_offset_freelist_head = new_head; + freelist_is_sorted = false; +} +#endif // BUILDFLAG(USE_FREELIST_POOL_OFFSETS) + PA_ALWAYS_INLINE EncodedNextFreelistEntry* SlotSpanMetadata::PopForAlloc( size_t size) { // Not using bucket->slot_size directly as the compiler doesn't know that @@ -628,12 +671,30 @@ return result; } +#if BUILDFLAG(USE_FREELIST_POOL_OFFSETS) +PA_ALWAYS_INLINE PoolOffsetFreelistEntry* +SlotSpanMetadata::PopPoolOffsetFreelistForAlloc(size_t size) { + PA_DCHECK(size == bucket->slot_size); + PoolOffsetFreelistEntry* result = pool_offset_freelist_head; + pool_offset_freelist_head = pool_offset_freelist_head->GetNext(size); + num_allocated_slots++; + return result; +} +#endif // BUILDFLAG(USE_FREELIST_POOL_OFFSETS) + PA_ALWAYS_INLINE void SlotSpanMetadata::Free(uintptr_t slot_start, PartitionRoot* root) // PartitionRootLock() is not defined inside partition_page.h, but // static analysis doesn't require the implementation. PA_EXCLUSIVE_LOCKS_REQUIRED(PartitionRootLock(root)) { DCheckRootLockIsAcquired(root); + +#if BUILDFLAG(USE_FREELIST_POOL_OFFSETS) + if (root->uses_pool_offset_freelists()) { + return FreeForPoolOffsetFreelist(slot_start, root); + } +#endif // BUILDFLAG(USE_FREELIST_POOL_OFFSETS) + auto* entry = static_cast<internal::EncodedNextFreelistEntry*>( SlotStartAddr2Ptr(slot_start)); // Catches an immediate double free. @@ -656,6 +717,34 @@ PA_DCHECK(!CanStoreRawSize()); } } +#if BUILDFLAG(USE_FREELIST_POOL_OFFSETS) +PA_ALWAYS_INLINE void SlotSpanMetadata::FreeForPoolOffsetFreelist( + uintptr_t slot_start, + PartitionRoot* root) PA_EXCLUSIVE_LOCKS_REQUIRED(PartitionRootLock(root)) { + DCheckRootLockIsAcquired(root); + auto* entry = static_cast<internal::PoolOffsetFreelistEntry*>( + SlotStartAddr2Ptr(slot_start)); + // Catches an immediate double free. + PA_CHECK(entry != pool_offset_freelist_head); + // Look for double free one level deeper in debug. + PA_DCHECK(!pool_offset_freelist_head || + entry != pool_offset_freelist_head->GetNext(bucket->slot_size)); + entry->SetNext(pool_offset_freelist_head); + SetPoolOffsetFreelistHead(entry); + // A best effort double-free check. Works only on empty slot spans. + PA_CHECK(num_allocated_slots); + --num_allocated_slots; + // If the span is marked full, or became empty, take the slow path to update + // internal state. + if (PA_UNLIKELY(marked_full || num_allocated_slots == 0)) { + FreeSlowPath(1); + } else { + // All single-slot allocations must go through the slow path to + // correctly update the raw size. + PA_DCHECK(!CanStoreRawSize()); + } +} +#endif // BUILDFLAG(USE_FREELIST_POOL_OFFSETS) PA_ALWAYS_INLINE void SlotSpanMetadata::AppendFreeList( EncodedNextFreelistEntry* head, @@ -699,6 +788,50 @@ } } +#if BUILDFLAG(USE_FREELIST_POOL_OFFSETS) +PA_ALWAYS_INLINE void SlotSpanMetadata::AppendPoolOffsetFreeList( + PoolOffsetFreelistEntry* head, + PoolOffsetFreelistEntry* tail, + size_t number_of_freed, + PartitionRoot* root) { +#if BUILDFLAG(PA_DCHECK_IS_ON) + DCheckRootLockIsAcquired(root); + PA_DCHECK(!tail->GetNext(bucket->slot_size)); + PA_DCHECK(number_of_freed); + PA_DCHECK(num_allocated_slots); + if (CanStoreRawSize()) { + PA_DCHECK(number_of_freed == 1); + } + { + size_t number_of_entries = 0; + for (auto* entry = head; entry; + entry = entry->GetNext(bucket->slot_size), ++number_of_entries) { + uintptr_t untagged_entry = UntagPtr(entry); + // Check that all entries belong to this slot span. + PA_DCHECK(ToSlotSpanStart(this) <= untagged_entry); + PA_DCHECK(untagged_entry < + ToSlotSpanStart(this) + bucket->get_bytes_per_span()); + } + PA_DCHECK(number_of_entries == number_of_freed); + } +#endif + + tail->SetNext(pool_offset_freelist_head); + SetPoolOffsetFreelistHead(head); + PA_DCHECK(num_allocated_slots >= number_of_freed); + num_allocated_slots -= number_of_freed; + // If the span is marked full, or became empty, take the slow path to update + // internal state. + if (PA_UNLIKELY(marked_full || num_allocated_slots == 0)) { + FreeSlowPath(number_of_freed); + } else { + // All single-slot allocations must go through the slow path to + // correctly update the raw size. + PA_DCHECK(!CanStoreRawSize()); + } +} +#endif // BUILDFLAG(USE_FREELIST_POOL_OFFSETS) + PA_ALWAYS_INLINE bool SlotSpanMetadata::is_active() const { PA_DCHECK(this != get_sentinel_slot_span()); bool ret =
diff --git a/base/i18n/icu_mergeable_data_file.cc b/base/i18n/icu_mergeable_data_file.cc index 39ddcac..07b71e4 100644 --- a/base/i18n/icu_mergeable_data_file.cc +++ b/base/i18n/icu_mergeable_data_file.cc
@@ -6,6 +6,10 @@ #include <sys/mman.h> +#include "base/check.h" +#include "base/check_op.h" +#include "base/debug/alias.h" +#include "base/debug/dump_without_crashing.h" #include "base/hash/hash.h" #include "base/numerics/safe_conversions.h" #include "base/strings/string_number_conversions.h" @@ -39,7 +43,8 @@ } IcuMergeableDataFile::HashType ReadHash(const uint8_t* data, size_t offset) { - DCHECK_EQ(0ul, offset % kHashBytes); + // TODO(crbug/1503551): upgrade to CHECK. + DUMP_WILL_BE_CHECK_EQ(0ul, offset % kHashBytes); IcuMergeableDataFile::HashType hash = 0; for (size_t i = 0; i < kHashBytes; i++) { IcuMergeableDataFile::HashType byte = data[offset + i]; @@ -109,8 +114,10 @@ bool IcuMergeableDataFile::Initialize(File lacros_file, MemoryMappedFile::Region region) { - DCHECK(region == MemoryMappedFile::Region::kWholeFile); - DCHECK(!lacros_file_.IsValid()) << "ICUDataFile::Initialize called twice"; + // TODO(crbug/1503551): upgrade to CHECK. + DUMP_WILL_BE_CHECK(region == MemoryMappedFile::Region::kWholeFile); + DUMP_WILL_BE_CHECK(!lacros_file_.IsValid()) + << "ICUDataFile::Initialize called twice"; lacros_file_ = std::move(lacros_file); int64_t lacros_length = lacros_file_.GetLength(); @@ -148,7 +155,8 @@ bool IcuMergeableDataFile::MergeWithAshVersion(const FilePath& ash_file_path) { // Verify the assumption that page size is 4K. - DCHECK_EQ(sysconf(_SC_PAGESIZE), kPageSize); + // TODO(crbug/1503551): upgrade to CHECK. + DUMP_WILL_BE_CHECK_EQ(sysconf(_SC_PAGESIZE), kPageSize); // Mmap Ash's data file. auto ash_file = MmapAshFile(ash_file_path); @@ -185,7 +193,8 @@ if (remap) { // If `remap` == true, we add the MAP_FIXED option to unmap the // existing map and replace it with the new one in a single operation. - DCHECK_NE(lacros_data_, nullptr); + // TODO(crbug/1503551): upgrade to CHECK. + DUMP_WILL_BE_CHECK_NE(lacros_data_, nullptr); lacros_data_ = static_cast<uint8_t*>( mmap(lacros_data_, lacros_length_, PROT_READ, MAP_FIXED | MAP_PRIVATE, lacros_file_.GetPlatformFile(), 0)); @@ -251,6 +260,16 @@ const AshMemoryMappedFile& ash_file, const uint8_t* ash_page, const uint8_t* lacros_page) const { + // TODO(crbug/1478718): Remove once the cause of this crash is identified. + if (!ash_page || !lacros_page) { + const uint8_t* debug_ash_page = ash_page; + const uint8_t* debug_lacros_page = lacros_page; + base::debug::Alias(&debug_ash_page); + base::debug::Alias(&debug_lacros_page); + base::debug::DumpWithoutCrashing(); + return 0; + } + size_t pages = 0; const uint8_t* ash_end = ash_file.data() + ash_file.length(); const uint8_t* lacros_end = lacros_data_ + lacros_length_; @@ -362,8 +381,9 @@ // We read the content of the symbolic link to find the path of the // file associated with the file descriptor. int64_t path_len = readlink(proc_path.value().c_str(), path, sizeof(path)); - DCHECK_NE(path_len, -1); - DCHECK_LT(path_len, PATH_MAX); + // TODO(crbug/1503551): upgrade to CHECK. + DUMP_WILL_BE_CHECK_NE(path_len, -1); + DUMP_WILL_BE_CHECK_LT(path_len, PATH_MAX); return FilePath(std::string(path, 0, path_len)); }
diff --git a/build/config/siso/devtools_frontend.star b/build/config/siso/devtools_frontend.star new file mode 100644 index 0000000..ad3322e5 --- /dev/null +++ b/build/config/siso/devtools_frontend.star
@@ -0,0 +1,99 @@ +load("@builtin//encoding.star", "json") +load("@builtin//path.star", "path") +load("@builtin//struct.star", "module") +load("./config.star", "config") +load("./tsc.star", "tsc") + +# TODO: crbug.com/1478909 - Specify typescript inputs in GN config. +def __filegroups(ctx): + return { + "third_party/devtools-frontend/src/node_modules/typescript:typescript": { + "type": "glob", + "includes": ["*"], + }, + "third_party/devtools-frontend/src/node_modules:node_modules": { + "type": "glob", + "includes": ["*.js", "*.json", "*.ts"], + }, + } + +def __step_config(ctx, step_config): + remote_run = True + + step_config["input_deps"].update({ + "third_party/devtools-frontend/src/third_party/typescript/ts_library.py": [ + "third_party/devtools-frontend/src/node_modules/typescript:typescript", + "third_party/devtools-frontend/src/node_modules:node_modules", + ], + }) + + step_config["rules"].extend([ + { + "name": "devtools-frontend/typescript/ts_library", + "command_prefix": "python3 ../../third_party/devtools-frontend/src/third_party/typescript/ts_library.py", + # TODO: b/308405411 - Support more actions. blocked on crbug.com/1503020 + "action": "__third_party_devtools-frontend_src_front_end_third_party_.*", + "exclude_input_patterns": [ + "*.stamp", + ], + # TODO: crbug.com/1503020 - Fix devtools_entrypoint to propagate d.ts output. + "outputs_map": { + "./gen/third_party/devtools-frontend/src/front_end/third_party/i18n/i18n-tsconfig.json": { + "inputs": [ + "./gen/third_party/devtools-frontend/src/front_end/third_party/intl-messageformat/intl-messageformat.d.ts", + ], + }, + "./gen/third_party/devtools-frontend/src/front_end/third_party/diff/diff-tsconfig.json": { + "inputs": [ + "./gen/third_party/devtools-frontend/src/front_end/core/common/common.d.ts", + ], + }, + }, + "remote": remote_run, + "handler": "devtools_frontend/typescript_ts_library", + "output_local": True, + }, + ]) + return step_config + +def _ts_library(ctx, cmd): + # Handler for https://crsrc.org/c/third_party/devtools-frontend/src/third_party/typescript/ts_library.py + # Note that this is a different script from https://crsrc.org/c/tools/typescript/ts_library.py + deps = [] + sources = [] + tsconfig_path = None + flag = None + for i, arg in enumerate(cmd.args): + if flag != "" and arg.startswith("-"): + flag = "" + if arg == "--tsconfig_output_location": + tsconfig_path = ctx.fs.canonpath(cmd.args[i + 1]) + continue + if arg in ("--deps", "--sources"): + flag = arg + continue + if flag == "--deps": + deps.append(arg) + continue + if flag == "--sources": + sources.append(ctx.fs.canonpath(arg)) + continue + if not tsconfig_path: + fail("missing --tsconfig_output_location") + tsconfig = {"files": [], "references": []} + tsconfig_dir = path.dir(tsconfig_path) + for s in sources: + tsconfig["files"].append(path.rel(tsconfig_dir, s)) + for d in deps: + tsconfig["references"].append({"path": d}) + inputs = tsc.scandeps(ctx, tsconfig_path, tsconfig) + ctx.actions.fix(inputs = cmd.inputs + inputs + sources) + +devtools_frontend = module( + "devtools_frontend", + step_config = __step_config, + handlers = { + "devtools_frontend/typescript_ts_library": _ts_library, + }, + filegroups = __filegroups, +)
diff --git a/build/config/siso/linux.star b/build/config/siso/linux.star index fa628a2..27bfd82 100644 --- a/build/config/siso/linux.star +++ b/build/config/siso/linux.star
@@ -7,8 +7,9 @@ load("@builtin//struct.star", "module") load("./android.star", "android") load("./clang_linux.star", "clang") -load("./cros.star", "cros") load("./config.star", "config") +load("./cros.star", "cros") +load("./devtools_frontend.star", "devtools_frontend") load("./nacl_linux.star", "nacl") load("./nasm_linux.star", "nasm") load("./proto_linux.star", "proto") @@ -21,6 +22,7 @@ fg.update(android.filegroups(ctx)) fg.update(clang.filegroups(ctx)) fg.update(cros.filegroups(ctx)) + fg.update(devtools_frontend.filegroups(ctx)) fg.update(nacl.filegroups(ctx)) fg.update(nasm.filegroups(ctx)) fg.update(proto.filegroups(ctx)) @@ -32,6 +34,7 @@ __handlers.update(android.handlers) __handlers.update(clang.handlers) __handlers.update(cros.handlers) +__handlers.update(devtools_frontend.handlers) __handlers.update(nacl.handlers) __handlers.update(nasm.handlers) __handlers.update(proto.handlers) @@ -84,6 +87,7 @@ step_config = clang.step_config(ctx, step_config) step_config = cros.step_config(ctx, step_config) + step_config = devtools_frontend.step_config(ctx, step_config) step_config = nacl.step_config(ctx, step_config) step_config = nasm.step_config(ctx, step_config) step_config = proto.step_config(ctx, step_config)
diff --git a/build/config/siso/tsc.star b/build/config/siso/tsc.star index b08feb8..dad4904 100644 --- a/build/config/siso/tsc.star +++ b/build/config/siso/tsc.star
@@ -20,7 +20,13 @@ if "files" in parent and not tsconfig["files"]: tsconfig["files"] = parent["files"] if "files" in tsconfig: - paths.extend([path.join(tsconfig_dir, file) for file in tsconfig["files"]]) + for file in tsconfig["files"]: + paths.append(path.join(tsconfig_dir, file)) + if file.endswith(".js"): + # Add if d.ts version of the file exists. + file_dts = path.join(tsconfig_dir, file[:-2] + "d.ts") + if ctx.fs.exists(file_dts): + paths.append(file_dts) return paths def _scan_inputs(ctx, tsconfig_path, tsconfig, loaded, scanned):
diff --git a/build/nocompile.gni b/build/nocompile.gni index 95f41fe..964b7a9 100644 --- a/build/nocompile.gni +++ b/build/nocompile.gni
@@ -12,7 +12,7 @@ # # import("//build/nocompile.gni") # -# nocompile_source_set("base_nocompile") { +# nocompile_source_set("base_nocompile_tests") { # sources = [ # "functional/one_not_equal_two_nocompile.nc", # ]
diff --git a/chrome/VERSION b/chrome/VERSION index 7a85a74..0c481b50 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=121 MINOR=0 -BUILD=6139 +BUILD=6140 PATCH=0
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java index 6367923..d767cd9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -2325,7 +2325,6 @@ } private void logIntentInfo(Intent intent, Pair<Integer, Integer> instanceIdInfo) { - boolean willUseNewInstance = MultiWindowUtils.willUseNewInstance(); boolean isFromOs = getReferrer() != null && getReferrer().toString().equals(SOURCE_ACTIVITY_REFERRER_OS); @@ -2341,8 +2340,11 @@ intent, IntentHandler.EXTRA_LAUNCHED_VIA_CHROME_LAUNCHER_ACTIVITY, false) - + "\nReferrer: " + + "\nActivity referrer: " + getReferrer() + + "\nIntent referrer extra: " + + IntentUtils.safeGetStringExtra( + intent, IntentHandler.EXTRA_ACTIVITY_REFERRER) + "\nIntent contains LAUNCHER category: " + intent.hasCategory(Intent.CATEGORY_LAUNCHER) + "\nIntent contains FLAG_ACTIVITY_MULTIPLE_TASK: " @@ -2353,12 +2355,6 @@ + (intent.getComponent() == null ? "N/A" : intent.getComponent().getClassName()) - + "\nIntent sent by OS: " - + isFromOs - + "\n@ExternalAppId of intent source: " - + IntentHandler.determineExternalIntentSource(intent) - + "\nAre all instances running: " - + willUseNewInstance + "\nWindow allocation type: " + windowAllocationType; Log.i(TAG_MULTI_INSTANCE, logMessage); @@ -2374,7 +2370,7 @@ boolean isMainIntent = Intent.ACTION_MAIN.equals(intent.getAction()) && !isFromChrome && !isFromOs; - if (willUseNewInstance + if (instanceIdInfo.second == InstanceAllocationType.NEW_INSTANCE_NEW_TASK && !DeviceFormFactor.isNonMultiDisplayContextOnTablet(this) && (isViewIntent || isMainIntent)) { logMessage =
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/multiwindow/MultiWindowUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/multiwindow/MultiWindowUtils.java index ff4db4d..f79f86e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/multiwindow/MultiWindowUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/multiwindow/MultiWindowUtils.java
@@ -751,23 +751,4 @@ public static void launchIntentInInstance(Intent intent, int instanceId) { MultiInstanceManagerApi31.launchIntentInInstance(intent, instanceId); } - - /** - * Determine whether a newly created ChromeTabbedActivity was allocated a new window ID. This - * method was introduced for the sole purpose of investigation/logging of the issue in the - * linked bug. It is expected that a valid new window ID is allocated in this scenario iff the - * following conditions are met: 1. At least 1 instance of Chrome is running. 2. The total - * number of currently persisted instances is the same as the number of running Chrome - * instances; it is possible that fewer instances are actively running at a given time, in which - * case the allocated window ID will be for one of the "restored" instances. TODO - * (crbug.com/1484026): Cleanup this method after the issue is resolved. - * - * @return {@code true} if a new instance will be used, {@code false} otherwise. - */ - public static boolean willUseNewInstance() { - int runningInstanceCount = - MultiInstanceManagerApi31.getWindowIdsOfRunningTabbedActivities().size(); - int instanceCount = getInstanceCount(); - return runningInstanceCount >= 1 && instanceCount == runningInstanceCount; - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoCookieControlsManager.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoCookieControlsManager.java index 62b6924..df19a1b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoCookieControlsManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoCookieControlsManager.java
@@ -120,8 +120,10 @@ public void onClick(View v) { if (v.getId() == R.id.cookie_controls_card_managed_icon) { Bundle fragmentArguments = new Bundle(); - fragmentArguments.putString(SingleCategorySettings.EXTRA_CATEGORY, - SiteSettingsCategory.preferenceKey(SiteSettingsCategory.Type.COOKIES)); + fragmentArguments.putString( + SingleCategorySettings.EXTRA_CATEGORY, + SiteSettingsCategory.preferenceKey( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES)); SettingsLauncher settingsLauncher = new SettingsLauncherImpl(); settingsLauncher.launchSettingsActivity( v.getContext(), SingleCategorySettings.class, fragmentArguments);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfoControllerDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfoControllerDelegate.java index cb2b3cec..523487c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfoControllerDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfoControllerDelegate.java
@@ -248,13 +248,12 @@ public Collection<PageInfoSubpageController> createAdditionalRowViews( PageInfoMainController mainController, ViewGroup rowWrapper) { Collection<PageInfoSubpageController> controllers = new ArrayList<>(); - if (ChromeFeatureList.isEnabled(ChromeFeatureList.PRIVACY_SANDBOX_SETTINGS_3)) { - var adPersonalizationRow = new PageInfoRowView(rowWrapper.getContext(), null); - adPersonalizationRow.setId(PageInfoAdPersonalizationController.ROW_ID); - rowWrapper.addView(adPersonalizationRow); - controllers.add(new PageInfoAdPersonalizationController( - mainController, adPersonalizationRow, this)); - } + var adPersonalizationRow = new PageInfoRowView(rowWrapper.getContext(), null); + adPersonalizationRow.setId(PageInfoAdPersonalizationController.ROW_ID); + rowWrapper.addView(adPersonalizationRow); + controllers.add( + new PageInfoAdPersonalizationController( + mainController, adPersonalizationRow, this)); // Add history row. final Tab tab = TabUtils.fromWebContents(mWebContents);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewDarkModeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewDarkModeTest.java index 5248698..c73d503 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewDarkModeTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewDarkModeTest.java
@@ -25,12 +25,14 @@ import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.app.ChromeActivity; +import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.night_mode.ChromeNightModeTestUtils; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.R; +import org.chromium.chrome.test.util.browser.Features.DisableFeatures; import org.chromium.components.page_info.PageInfoController; import org.chromium.components.page_info.PageInfoController.OpenedFromSource; import org.chromium.content_public.browser.test.util.TestThreadUtils; @@ -125,6 +127,7 @@ @Test @MediumTest @Feature({"RenderTest"}) + @DisableFeatures(ChromeFeatureList.TRACKING_PROTECTION_3PCD) public void testShowOnSecureWebsiteDark() throws IOException { loadUrlAndOpenPageInfo(mTestServerRule.getServer().getURL(sSimpleHtml)); mRenderTestRule.render(getPageInfoView(), "PageInfo_SecureWebsiteDark");
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewTest.java index 09464ea9..6d64f98 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewTest.java
@@ -1069,7 +1069,6 @@ @Test @MediumTest @Feature({"RenderTest"}) - @EnableFeatures(ChromeFeatureList.PRIVACY_SANDBOX_SETTINGS_3) public void testShowAdPersonalizationInfo() throws IOException { loadUrlAndOpenPageInfo( mTestServerRule.getServer().getURLWithHostName("example.com", sSimpleHtml));
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/CookieControlsBridgeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/CookieControlsBridgeTest.java index 4cc48de..49cf4b5 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/CookieControlsBridgeTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/CookieControlsBridgeTest.java
@@ -380,6 +380,8 @@ @Test @SmallTest @EnableFeatures(PageInfoFeatures.USER_BYPASS_UI_NAME) + // This test will become obsolete when 3PCD is rolled out. + @DisableFeatures(ChromeFeatureList.TRACKING_PROTECTION_3PCD) public void testCookieBridgeWithTPCookiesDisabledUserBypass() throws Exception { TestThreadUtils.runOnUiThreadBlocking( () -> { @@ -517,6 +519,8 @@ @Test @SmallTest @EnableFeatures(PageInfoFeatures.USER_BYPASS_UI_NAME) + // This test will become obsolete when 3PCD is rolled out. + @DisableFeatures(ChromeFeatureList.TRACKING_PROTECTION_3PCD) public void testCookieBridgeWithIncognitoSettingUserBypass() throws Exception { TestThreadUtils.runOnUiThreadBlocking( () -> {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/CookieSettingsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/CookieSettingsTest.java index e0d47f16..4b0d1c97 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/CookieSettingsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/CookieSettingsTest.java
@@ -7,14 +7,10 @@ import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.CoreMatchers.allOf; -import static org.hamcrest.CoreMatchers.is; - -import static org.chromium.ui.test.util.ViewUtils.onViewWaiting; import android.os.Bundle; import android.view.View; @@ -29,17 +25,12 @@ import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; -import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.settings.SettingsActivity; import org.chromium.chrome.browser.settings.SettingsActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.R; import org.chromium.chrome.test.util.ChromeRenderTestRule; -import org.chromium.chrome.test.util.browser.Features.DisableFeatures; -import org.chromium.chrome.test.util.browser.Features.EnableFeatures; -import org.chromium.components.browser_ui.site_settings.FourStateCookieSettingsPreference; -import org.chromium.components.browser_ui.site_settings.FourStateCookieSettingsPreference.CookieSettingsState; import org.chromium.components.browser_ui.site_settings.SingleCategorySettings; import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory; import org.chromium.content_public.browser.test.util.TestThreadUtils; @@ -70,29 +61,13 @@ Bundle fragmentArgs = new Bundle(); fragmentArgs.putString( SingleCategorySettings.EXTRA_CATEGORY, - SiteSettingsCategory.preferenceKey(SiteSettingsCategory.Type.COOKIES)); + SiteSettingsCategory.preferenceKey(SiteSettingsCategory.Type.THIRD_PARTY_COOKIES)); mSettingsActivity = mSettingsActivityTestRule.startSettingsActivity(fragmentArgs); } @Test @SmallTest @Feature({"RenderTest"}) - @DisableFeatures(ChromeFeatureList.PRIVACY_SANDBOX_FPS_UI) - public void testRenderCookiePage() throws IOException { - // This test is written for when First-Party Sets UI is disabled. When - // First-Party Sets UI is eventually enabled by default, this test will - // be rewritten or deleted. - setCookiesEnabled(mSettingsActivity, false); - View view = mSettingsActivity.getMainFragment().getView(); - onViewWaiting(allOf(is(view), isDisplayed())); - - mRenderTestRule.render(view, "settings_cookie_page"); - } - - @Test - @SmallTest - @Feature({"RenderTest"}) - @EnableFeatures(ChromeFeatureList.PRIVACY_SANDBOX_FPS_UI) public void testRenderCookieFPSSubpage() throws IOException { onView(withId(R.id.block_third_party_with_aux)).perform(click()); onView( @@ -106,26 +81,6 @@ "settings_cookie_fps_subpage"); } - private void setCookiesEnabled(final SettingsActivity settingsActivity, final boolean enabled) { - TestThreadUtils.runOnUiThreadBlocking( - new Runnable() { - @Override - public void run() { - final SingleCategorySettings websitePreferences = - (SingleCategorySettings) settingsActivity.getMainFragment(); - final FourStateCookieSettingsPreference cookies = - (FourStateCookieSettingsPreference) - websitePreferences.findPreference( - SingleCategorySettings - .FOUR_STATE_COOKIE_TOGGLE_KEY); - - websitePreferences.onPreferenceChange( - cookies, - enabled ? CookieSettingsState.ALLOW : CookieSettingsState.BLOCK); - } - }); - } - private View getRootView(int text) { View[] view = {null}; onView(withText(text)).check(((v, e) -> view[0] = v.getRootView()));
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java index fb23de8..c1334f20 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java
@@ -32,7 +32,6 @@ import static org.mockito.ArgumentMatchers.refEq; import static org.chromium.components.browser_ui.site_settings.AutoDarkMetrics.AutoDarkSettingsChangeSource.SITE_SETTINGS_GLOBAL; -import static org.chromium.components.browser_ui.site_settings.WebsitePreferenceBridge.SITE_WILDCARD; import static org.chromium.components.content_settings.PrefNames.COOKIE_CONTROLS_MODE; import static org.chromium.components.content_settings.PrefNames.DESKTOP_SITE_DISPLAY_SETTING_ENABLED; import static org.chromium.components.content_settings.PrefNames.DESKTOP_SITE_PERIPHERAL_SETTING_ENABLED; @@ -113,8 +112,6 @@ import org.chromium.components.browser_ui.site_settings.ContentSettingException; import org.chromium.components.browser_ui.site_settings.ContentSettingsResources; import org.chromium.components.browser_ui.site_settings.FPSCookieSettings; -import org.chromium.components.browser_ui.site_settings.FourStateCookieSettingsPreference; -import org.chromium.components.browser_ui.site_settings.FourStateCookieSettingsPreference.CookieSettingsState; import org.chromium.components.browser_ui.site_settings.GroupedWebsitesSettings; import org.chromium.components.browser_ui.site_settings.SingleCategorySettings; import org.chromium.components.browser_ui.site_settings.SingleCategorySettingsConstants; @@ -465,15 +462,15 @@ public void run() { final SingleCategorySettings websitePreferences = (SingleCategorySettings) settingsActivity.getMainFragment(); - final FourStateCookieSettingsPreference cookies = - (FourStateCookieSettingsPreference) - websitePreferences.findPreference( - SingleCategorySettings - .FOUR_STATE_COOKIE_TOGGLE_KEY); + final TriStateCookieSettingsPreference cookies = + websitePreferences.findPreference( + SingleCategorySettings.TRI_STATE_COOKIE_TOGGLE); websitePreferences.onPreferenceChange( cookies, - enabled ? CookieSettingsState.ALLOW : CookieSettingsState.BLOCK); + enabled + ? CookieControlsMode.OFF + : CookieControlsMode.BLOCK_THIRD_PARTY); Assert.assertEquals( "Cookies should be " + (enabled ? "allowed" : "blocked"), doesAcceptCookies(), @@ -481,34 +478,9 @@ } private boolean doesAcceptCookies() { - return WebsitePreferenceBridge.isCategoryEnabled( - getBrowserContextHandle(), ContentSettingsType.COOKIES); - } - }); - } - - private void setBlockCookiesSiteException( - final SettingsActivity settingsActivity, - final String hostname, - final boolean thirdPartiesOnly) { - TestThreadUtils.runOnUiThreadBlocking( - new Runnable() { - @Override - public void run() { - final SingleCategorySettings websitePreferences = - (SingleCategorySettings) settingsActivity.getMainFragment(); - - Assert.assertTrue(doesAcceptCookies()); - if (thirdPartiesOnly) { - websitePreferences.onAddSite(SITE_WILDCARD, hostname); - } else { - websitePreferences.onAddSite(hostname, SITE_WILDCARD); - } - } - - private boolean doesAcceptCookies() { - return WebsitePreferenceBridge.isCategoryEnabled( - getBrowserContextHandle(), ContentSettingsType.COOKIES); + return UserPrefs.get(Profile.getLastUsedRegularProfile()) + .getInteger(COOKIE_CONTROLS_MODE) + == CookieControlsMode.OFF; } }); } @@ -520,28 +492,27 @@ } /** Checks if the button representing the given state matches the managed expectation. */ - private void checkFourStateCookieToggleButtonState( + private void checkTriStateCookieToggleButtonState( final SettingsActivity settingsActivity, - final CookieSettingsState state, + final @CookieControlsMode int state, final ToggleButtonState toggleState) { TestThreadUtils.runOnUiThreadBlocking( () -> { SingleCategorySettings preferences = (SingleCategorySettings) settingsActivity.getMainFragment(); - FourStateCookieSettingsPreference fourStateCookieToggle = - (FourStateCookieSettingsPreference) - preferences.findPreference( - SingleCategorySettings.FOUR_STATE_COOKIE_TOGGLE_KEY); + TriStateCookieSettingsPreference triStateCookieToggle = + preferences.findPreference( + SingleCategorySettings.TRI_STATE_COOKIE_TOGGLE); boolean enabled = toggleState != ToggleButtonState.Disabled; boolean checked = toggleState == ToggleButtonState.EnabledChecked; Assert.assertEquals( state + " button should be " + (enabled ? "enabled" : "disabled"), enabled, - fourStateCookieToggle.isButtonEnabledForTesting(state)); + triStateCookieToggle.isButtonEnabledForTesting(state)); Assert.assertEquals( state + " button should be " + (checked ? "checked" : "unchecked"), checked, - fourStateCookieToggle.isButtonCheckedForTesting(state)); + triStateCookieToggle.isButtonCheckedForTesting(state)); }); } @@ -611,7 +582,6 @@ SingleCategorySettings preferences = (SingleCategorySettings) settingsActivity.getMainFragment(); TriStateSiteSettingsPreference triStateToggle = - (TriStateSiteSettingsPreference) preferences.findPreference( SingleCategorySettings.TRI_STATE_TOGGLE_KEY); preferences.onPreferenceChange(triStateToggle, newValue); @@ -619,19 +589,19 @@ settingsActivity.finish(); } - private void setFourStateCookieToggle(CookieSettingsState newState) { + private void setTriStateCookieToggle(@CookieControlsMode int newState) { final SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); + SiteSettingsTestUtils.startSiteSettingsCategory( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES); TestThreadUtils.runOnUiThreadBlocking( () -> { SingleCategorySettings preferences = (SingleCategorySettings) settingsActivity.getMainFragment(); - FourStateCookieSettingsPreference fourStateCookieToggle = - (FourStateCookieSettingsPreference) - preferences.findPreference( - SingleCategorySettings.FOUR_STATE_COOKIE_TOGGLE_KEY); - preferences.onPreferenceChange(fourStateCookieToggle, newState); + TriStateCookieSettingsPreference triStateCookieToggle = + preferences.findPreference( + SingleCategorySettings.TRI_STATE_COOKIE_TOGGLE); + preferences.onPreferenceChange(triStateCookieToggle, newState); }); settingsActivity.finish(); } @@ -691,9 +661,11 @@ @Test @SmallTest @Feature({"Preferences"}) + @DisabledTest(message = "TODO(crbug.com/1449833)") public void testCookiesNotBlocked() throws Exception { SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); + SiteSettingsTestUtils.startSiteSettingsCategory( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES); setCookiesEnabled(settingsActivity, true); settingsActivity.finish(); @@ -720,45 +692,37 @@ @EnableFeatures(ChromeFeatureList.PRIVACY_SANDBOX_FPS_UI) public void testCookiesFPSSubpageIsLaunched() throws Exception { SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); + SiteSettingsTestUtils.startSiteSettingsCategory( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES); verifyFPSCookieSubpageIsLaunchedWithParams( - settingsActivity, CookieSettingsState.BLOCK_THIRD_PARTY); + settingsActivity, CookieControlsMode.BLOCK_THIRD_PARTY); verifyFPSCookieSubpageIsLaunchedWithParams( - settingsActivity, CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO); + settingsActivity, CookieControlsMode.INCOGNITO_ONLY); } private void verifyFPSCookieSubpageIsLaunchedWithParams( - final SettingsActivity settingsActivity, CookieSettingsState cookieSettingsState) { + final SettingsActivity settingsActivity, + @CookieControlsMode int expectedCookieControlMode) { TestThreadUtils.runOnUiThreadBlocking( () -> { final SingleCategorySettings websitePreferences = (SingleCategorySettings) settingsActivity.getMainFragment(); - final FourStateCookieSettingsPreference cookies = + final TriStateCookieSettingsPreference cookies = websitePreferences.findPreference( - SingleCategorySettings.FOUR_STATE_COOKIE_TOGGLE_KEY); + SingleCategorySettings.TRI_STATE_COOKIE_TOGGLE); Mockito.clearInvocations(mSettingsLauncher); websitePreferences.setSettingsLauncher(mSettingsLauncher); - SiteSettingsTestUtils.getCookieRadioButtonFrom(cookies, cookieSettingsState) + SiteSettingsTestUtils.getCookieRadioButtonFrom( + cookies, expectedCookieControlMode) .getAuxButtonForTests() .performClick(); - @CookieControlsMode int expectedState = CookieControlsMode.OFF; - switch (cookieSettingsState) { - case BLOCK_THIRD_PARTY_INCOGNITO: - expectedState = CookieControlsMode.INCOGNITO_ONLY; - break; - case BLOCK_THIRD_PARTY: - expectedState = CookieControlsMode.BLOCK_THIRD_PARTY; - break; - default: - assert false; - } - Bundle fragmentArgs = new Bundle(); - fragmentArgs.putInt(FPSCookieSettings.EXTRA_COOKIE_PAGE_STATE, expectedState); + fragmentArgs.putInt( + FPSCookieSettings.EXTRA_COOKIE_PAGE_STATE, expectedCookieControlMode); Mockito.verify(mSettingsLauncher) .launchSettingsActivity( @@ -768,67 +732,6 @@ }); } - /** Blocks cookies from being set and ensures that no cookies can be set. */ - @Test - @SmallTest - @Feature({"Preferences"}) - public void testCookiesBlocked() throws Exception { - SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); - setCookiesEnabled(settingsActivity, false); - settingsActivity.finish(); - - final String url = mPermissionRule.getURL("/chrome/test/data/android/cookie.html"); - - // Load the page and clear any set cookies. - mPermissionRule.loadUrl(url); - mPermissionRule.runJavaScriptCodeInCurrentTab("clearCookie()"); - Assert.assertEquals("\"\"", mPermissionRule.runJavaScriptCodeInCurrentTab("getCookie()")); - mPermissionRule.runJavaScriptCodeInCurrentTab("setCookie()"); - Assert.assertEquals("\"\"", mPermissionRule.runJavaScriptCodeInCurrentTab("getCookie()")); - - // Load the page again and ensure the cookie remains unset. - mPermissionRule.loadUrl(url); - Assert.assertEquals("\"\"", mPermissionRule.runJavaScriptCodeInCurrentTab("getCookie()")); - } - - /** Blocks specific sites from setting cookies and ensures that no cookies can be set. */ - @Test - @SmallTest - @Feature({"Preferences"}) - public void testSiteExceptionCookiesBlocked() throws Exception { - SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); - setCookiesEnabled(settingsActivity, true); - settingsActivity.finish(); - - final String url = mPermissionRule.getURL("/chrome/test/data/android/cookie.html"); - - // Load the page and clear any set cookies. - mPermissionRule.loadUrl(url); - mPermissionRule.runJavaScriptCodeInCurrentTab("clearCookie()"); - Assert.assertEquals("\"\"", mPermissionRule.runJavaScriptCodeInCurrentTab("getCookie()")); - - // Check cookies can be set for this website when there is no rule. - mPermissionRule.runJavaScriptCodeInCurrentTab("setCookie()"); - Assert.assertEquals( - "\"Foo=Bar\"", mPermissionRule.runJavaScriptCodeInCurrentTab("getCookie()")); - - // Set specific rule to block site and ensure it cannot set cookies. - mPermissionRule.loadUrl(url); - mPermissionRule.runJavaScriptCodeInCurrentTab("clearCookie()"); - settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); - setBlockCookiesSiteException(settingsActivity, url, false); - settingsActivity.finish(); - mPermissionRule.runJavaScriptCodeInCurrentTab("setCookie()"); - Assert.assertEquals("\"\"", mPermissionRule.runJavaScriptCodeInCurrentTab("getCookie()")); - - // Load the page again and ensure the cookie remains unset. - mPermissionRule.loadUrl(url); - Assert.assertEquals("\"\"", mPermissionRule.runJavaScriptCodeInCurrentTab("getCookie()")); - } - /** Blocks specific sites from setting cookies and ensures that no cookies can be set. */ @Test @SmallTest @@ -986,20 +889,20 @@ // The ContentSetting is managed (and set to ALLOW) while ThirdPartyCookieBlocking is not // managed. This means that every button other than BLOCK is enabled. SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.ALLOW, ToggleButtonState.EnabledUnchecked); - checkFourStateCookieToggleButtonState( + SiteSettingsTestUtils.startSiteSettingsCategory( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.OFF, ToggleButtonState.EnabledUnchecked); + checkTriStateCookieToggleButtonState( settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO, + CookieControlsMode.INCOGNITO_ONLY, ToggleButtonState.EnabledChecked); - checkFourStateCookieToggleButtonState( + checkTriStateCookieToggleButtonState( settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY, + CookieControlsMode.BLOCK_THIRD_PARTY, ToggleButtonState.EnabledUnchecked); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.BLOCK, ToggleButtonState.Disabled); - onView(getManagedViewMatcher(/* activeView= */ true)).check(matches(isDisplayed())); + // TODO(crbug.com/1449833): fix this assertion. + // onView(getManagedViewMatcher(/* activeView= */ true)).check(matches(isDisplayed())); onView(getManagedViewMatcher(/* activeView= */ false)).check(matches(not(isDisplayed()))); settingsActivity.finish(); } @@ -1014,7 +917,8 @@ @Policies.Add({@Policies.Item(key = "DefaultCookiesSetting", string = "1")}) public void testDefaultCookiesSettingManagedAllowWithIncognitoDisabled() throws Exception { IncognitoUtils.setEnabledForTesting(false); - setFourStateCookieToggle(CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO); + setTriStateCookieToggle(CookieControlsMode.INCOGNITO_ONLY); + checkDefaultCookiesSettingManaged(true); checkThirdPartyCookieBlockingManaged(false); // The ContentSetting is managed (and set to ALLOW) while ThirdPartyCookieBlocking managed. @@ -1022,57 +926,18 @@ // incognito is disabled the button should be disabled and the allow // toggle should be checked. SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.ALLOW, ToggleButtonState.EnabledChecked); - checkFourStateCookieToggleButtonState( + SiteSettingsTestUtils.startSiteSettingsCategory( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.OFF, ToggleButtonState.EnabledChecked); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.INCOGNITO_ONLY, ToggleButtonState.Disabled); + checkTriStateCookieToggleButtonState( settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO, - ToggleButtonState.Disabled); - checkFourStateCookieToggleButtonState( - settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY, + CookieControlsMode.BLOCK_THIRD_PARTY, ToggleButtonState.EnabledUnchecked); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.BLOCK, ToggleButtonState.Disabled); - onView(getManagedViewMatcher(/* activeView= */ true)).check(matches(isDisplayed())); - onView(getManagedViewMatcher(/* activeView= */ false)).check(matches(not(isDisplayed()))); - settingsActivity.finish(); - } - - /** - * Set the cookie content setting to block through a policy and ensure the correct radio buttons - * are enabled. - */ - @Test - @SmallTest - @Feature({"Preferences"}) - @Policies.Add({@Policies.Item(key = "DefaultCookiesSetting", string = "2")}) - public void testDefaultCookiesSettingManagedBlock() { - checkDefaultCookiesSettingManaged(true); - checkThirdPartyCookieBlockingManaged(true); - // The ContentSetting is managed (and set to BLOCK) while ThirdPartyCookieBlocking is not - // managed. This means cookies should always be blocked, so the user cannot choose any other - // options and all buttons except the active one should be disabled. - // TODO(crbug.com/1378703): The logic this is testing is now somewhat superfluous, as the - // default content setting policy automatically sets the 3P cookie policy. This can be - // removed when the old cookies page is removed as part of the solidication of the Privacy - // Sandbox Settings 4 launch. - SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.ALLOW, ToggleButtonState.Disabled); - checkFourStateCookieToggleButtonState( - settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO, - ToggleButtonState.Disabled); - checkFourStateCookieToggleButtonState( - settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY, - ToggleButtonState.Disabled); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.BLOCK, ToggleButtonState.EnabledChecked); - onView(getManagedViewMatcher(/* activeView= */ true)).check(matches(isDisplayed())); + // TODO(crbug.com/1449833): fix this assertion. + // onView(getManagedViewMatcher(/* activeView= */ true)).check(matches(isDisplayed())); onView(getManagedViewMatcher(/* activeView= */ false)).check(matches(not(isDisplayed()))); settingsActivity.finish(); } @@ -1092,19 +957,16 @@ // managed. This means a user can choose only between BLOCK_THIRD_PARTY and BLOCK, so only // these should be enabled. SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.ALLOW, ToggleButtonState.Disabled); - checkFourStateCookieToggleButtonState( + SiteSettingsTestUtils.startSiteSettingsCategory( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.OFF, ToggleButtonState.Disabled); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.INCOGNITO_ONLY, ToggleButtonState.Disabled); + checkTriStateCookieToggleButtonState( settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO, - ToggleButtonState.Disabled); - checkFourStateCookieToggleButtonState( - settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY, + CookieControlsMode.BLOCK_THIRD_PARTY, ToggleButtonState.EnabledChecked); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.BLOCK, ToggleButtonState.EnabledUnchecked); onView(getManagedViewMatcher(/* activeView= */ true)).check(matches(isDisplayed())); onView(getManagedViewMatcher(/* activeView= */ false)).check(matches(not(isDisplayed()))); settingsActivity.finish(); @@ -1125,19 +987,14 @@ // managed. This means a user can only choose to ALLOW all cookies or BLOCK all cookies, so // only these should be enabled. SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.ALLOW, ToggleButtonState.EnabledChecked); - checkFourStateCookieToggleButtonState( - settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO, - ToggleButtonState.Disabled); - checkFourStateCookieToggleButtonState( - settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY, - ToggleButtonState.Disabled); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.BLOCK, ToggleButtonState.EnabledUnchecked); + SiteSettingsTestUtils.startSiteSettingsCategory( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.OFF, ToggleButtonState.EnabledChecked); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.INCOGNITO_ONLY, ToggleButtonState.Disabled); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.BLOCK_THIRD_PARTY, ToggleButtonState.Disabled); onView(getManagedViewMatcher(/* activeView= */ true)).check(matches(isDisplayed())); onView(getManagedViewMatcher(/* activeView= */ false)).check(matches(not(isDisplayed()))); settingsActivity.finish(); @@ -1161,19 +1018,14 @@ // fixed setting for cookies that they cannot change. Therefore, all buttons except the // selected one should be disabled. SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.ALLOW, ToggleButtonState.EnabledChecked); - checkFourStateCookieToggleButtonState( - settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO, - ToggleButtonState.Disabled); - checkFourStateCookieToggleButtonState( - settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY, - ToggleButtonState.Disabled); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.BLOCK, ToggleButtonState.Disabled); + SiteSettingsTestUtils.startSiteSettingsCategory( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.OFF, ToggleButtonState.EnabledChecked); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.INCOGNITO_ONLY, ToggleButtonState.Disabled); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.BLOCK_THIRD_PARTY, ToggleButtonState.Disabled); onView(getManagedViewMatcher(/* activeView= */ true)).check(matches(isDisplayed())); onView(getManagedViewMatcher(/* activeView= */ false)).check(matches(not(isDisplayed()))); settingsActivity.finish(); @@ -1189,19 +1041,18 @@ // The ContentSetting and ThirdPartyCookieBlocking are unmanaged. This means all buttons // should be enabled. SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.ALLOW, ToggleButtonState.EnabledUnchecked); - checkFourStateCookieToggleButtonState( + SiteSettingsTestUtils.startSiteSettingsCategory( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.OFF, ToggleButtonState.EnabledUnchecked); + checkTriStateCookieToggleButtonState( settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO, + CookieControlsMode.INCOGNITO_ONLY, ToggleButtonState.EnabledChecked); - checkFourStateCookieToggleButtonState( + checkTriStateCookieToggleButtonState( settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY, + CookieControlsMode.BLOCK_THIRD_PARTY, ToggleButtonState.EnabledUnchecked); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.BLOCK, ToggleButtonState.EnabledUnchecked); onView(getManagedViewMatcher(/* activeView= */ true)).check(matches(not(isDisplayed()))); onView(getManagedViewMatcher(/* activeView= */ false)).check(matches(not(isDisplayed()))); settingsActivity.finish(); @@ -1218,19 +1069,16 @@ // The ContentSetting and ThirdPartyCookieBlocking are unmanaged. This means all buttons // should be enabled. SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.ALLOW, ToggleButtonState.EnabledChecked); - checkFourStateCookieToggleButtonState( + SiteSettingsTestUtils.startSiteSettingsCategory( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.OFF, ToggleButtonState.EnabledChecked); + checkTriStateCookieToggleButtonState( + settingsActivity, CookieControlsMode.INCOGNITO_ONLY, ToggleButtonState.Disabled); + checkTriStateCookieToggleButtonState( settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO, - ToggleButtonState.Disabled); - checkFourStateCookieToggleButtonState( - settingsActivity, - CookieSettingsState.BLOCK_THIRD_PARTY, + CookieControlsMode.BLOCK_THIRD_PARTY, ToggleButtonState.EnabledUnchecked); - checkFourStateCookieToggleButtonState( - settingsActivity, CookieSettingsState.BLOCK, ToggleButtonState.EnabledUnchecked); onView(getManagedViewMatcher(/* activeView= */ true)).check(matches(not(isDisplayed()))); onView(getManagedViewMatcher(/* activeView= */ false)).check(matches(not(isDisplayed()))); settingsActivity.finish(); @@ -1378,7 +1226,7 @@ public void testOnlyExpectedPreferencesShown() { // If you add a category in the SiteSettings UI, please update this total AND add a test for // it below, named "testOnlyExpectedPreferences<Category>". - Assert.assertEquals(32, SiteSettingsCategory.Type.NUM_ENTRIES); + Assert.assertEquals(31, SiteSettingsCategory.Type.NUM_ENTRIES); } @Test @@ -1491,21 +1339,6 @@ @Test @SmallTest @Feature({"Preferences"}) - public void testOnlyExpectedPreferencesCookies() { - String[] cookie = new String[] {"info_text", "four_state_cookie_toggle", "add_exception"}; - setFourStateCookieToggle(CookieSettingsState.ALLOW); - checkPreferencesForCategory(SiteSettingsCategory.Type.COOKIES, cookie); - setFourStateCookieToggle(CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO); - checkPreferencesForCategory(SiteSettingsCategory.Type.COOKIES, cookie); - setFourStateCookieToggle(CookieSettingsState.BLOCK_THIRD_PARTY); - checkPreferencesForCategory(SiteSettingsCategory.Type.COOKIES, cookie); - setFourStateCookieToggle(CookieSettingsState.BLOCK); - checkPreferencesForCategory(SiteSettingsCategory.Type.COOKIES, cookie); - } - - @Test - @SmallTest - @Feature({"Preferences"}) public void testOnlyExpectedPreferencesThirdPartyCookies() { testExpectedPreferences( SiteSettingsCategory.Type.THIRD_PARTY_COOKIES, @@ -1733,36 +1566,26 @@ @EnableFeatures(ChromeFeatureList.PRIVACY_SANDBOX_FPS_UI) public void testExpectedCookieButtonsCheckedWhenFPSUiEnabled() { SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); + SiteSettingsTestUtils.startSiteSettingsCategory( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES); TestThreadUtils.runOnUiThreadBlocking( () -> { SingleCategorySettings preferences = (SingleCategorySettings) settingsActivity.getMainFragment(); - FourStateCookieSettingsPreference fourStateCookieToggle = + TriStateCookieSettingsPreference cookieToggle = preferences.findPreference( - SingleCategorySettings.FOUR_STATE_COOKIE_TOGGLE_KEY); + SingleCategorySettings.TRI_STATE_COOKIE_TOGGLE); + clickButtonAndVerifyItsChecked(cookieToggle, CookieControlsMode.OFF); + clickButtonAndVerifyItsChecked(cookieToggle, CookieControlsMode.INCOGNITO_ONLY); clickButtonAndVerifyItsChecked( - fourStateCookieToggle, CookieSettingsState.ALLOW); - clickButtonAndVerifyItsChecked( - fourStateCookieToggle, CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO); - clickButtonAndVerifyItsChecked( - fourStateCookieToggle, CookieSettingsState.BLOCK_THIRD_PARTY); - clickButtonAndVerifyItsChecked( - fourStateCookieToggle, CookieSettingsState.BLOCK); + cookieToggle, CookieControlsMode.BLOCK_THIRD_PARTY); }); settingsActivity.finish(); } - private void clickButtonAndVerifyItsChecked( - FourStateCookieSettingsPreference fourStateCookieToggle, CookieSettingsState state) { - fourStateCookieToggle.getButton(state).performClick(); - Assert.assertTrue( - "Button should be checked.", fourStateCookieToggle.getButton(state).isChecked()); - } - @Test @SmallTest @Feature({"Preferences"}) @@ -2939,7 +2762,8 @@ @EnableFeatures(ChromeFeatureList.PRIVACY_SANDBOX_FPS_UI) public void testRenderCookiesPageWithFPS() throws Exception { createCookieExceptions(); - renderCategoryPage(SiteSettingsCategory.Type.COOKIES, "site_settings_cookies_page_fps"); + renderCategoryPage( + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES, "site_settings_cookies_page_fps"); } @Test @@ -3020,7 +2844,8 @@ public void testCookiesSettingsManagedForURL(String setting) throws Exception { final SettingsActivity settingsActivity = - SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); + SiteSettingsTestUtils.startSiteSettingsCategory( + SiteSettingsCategory.Type.SITE_DATA); SingleCategorySettings websitePreferences = (SingleCategorySettings) settingsActivity.getMainFragment();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTestUtils.java b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTestUtils.java index 87e10ea..e790fa5 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTestUtils.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTestUtils.java
@@ -17,18 +17,18 @@ import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.site_settings.AllSiteSettings; import org.chromium.components.browser_ui.site_settings.ContentSettingsResources; -import org.chromium.components.browser_ui.site_settings.FourStateCookieSettingsPreference; -import org.chromium.components.browser_ui.site_settings.FourStateCookieSettingsPreference.CookieSettingsState; import org.chromium.components.browser_ui.site_settings.GroupedWebsitesSettings; import org.chromium.components.browser_ui.site_settings.SingleCategorySettings; import org.chromium.components.browser_ui.site_settings.SingleWebsiteSettings; import org.chromium.components.browser_ui.site_settings.SiteSettings; import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory; import org.chromium.components.browser_ui.site_settings.StorageAccessSubpageSettings; +import org.chromium.components.browser_ui.site_settings.TriStateCookieSettingsPreference; import org.chromium.components.browser_ui.site_settings.Website; import org.chromium.components.browser_ui.site_settings.WebsiteGroup; import org.chromium.components.browser_ui.widget.RadioButtonWithDescription; import org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionAndAuxButton; +import org.chromium.components.content_settings.CookieControlsMode; import org.chromium.content_public.browser.test.util.TestThreadUtils; /** Util functions for testing SiteSettings functionality. */ @@ -129,8 +129,9 @@ } public static RadioButtonWithDescriptionAndAuxButton getCookieRadioButtonFrom( - FourStateCookieSettingsPreference cookiePage, CookieSettingsState cookieSettingsState) { - RadioButtonWithDescription button = cookiePage.getButton(cookieSettingsState); + TriStateCookieSettingsPreference cookiePage, + @CookieControlsMode int cookieControlsMode) { + RadioButtonWithDescription button = cookiePage.getButton(cookieControlsMode); return ((RadioButtonWithDescriptionAndAuxButton) button); }
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd index 06862895..755eca8 100644 --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd
@@ -1210,12 +1210,6 @@ </if> <!-- Settings API bubble --> - <message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES_SPECIFIC" desc="Text displayed in the Settings API bubble as first line when an extension has changed the start pages, and we are pointing to its icon."> - This extension has changed what page is shown when you start Chromium. - </message> - <message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES" desc="Text displayed in the Settings API bubble as first line when an extension has changed the start pages, and we are not pointing to its icon."> - The extension "<ph name="EXTENSION_NAME">$1<ex>AdBlock</ex></ph>" has changed what page is shown when you start Chromium. - </message> <message name="IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_START_PAGES" desc="Second line in the Settings API bubble. Only shown if the secondary change by the extension was just the start pages. The triple single quotes are needed to preserve the space before and after the sentence which is needed when the language (Chrome is being translated to) uses space as word separator. Please preserve them, unless the language being translated to does not use space as word separator."> ''' It also controls what page is shown when you start Chromium. ''' </message>
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index bac2935..e67b3aa 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -6538,9 +6538,6 @@ <message name="IDS_EXTENSIONS_SETTINGS_API_TITLE_HOME_PAGE_BUBBLE" desc="Title of a bubble warning users that an extension has overridden their home page setting"> Is this the home page you were expecting? </message> - <message name="IDS_EXTENSIONS_SETTINGS_API_TITLE_STARTUP_PAGES_BUBBLE" desc="Title of a bubble warning users that an extension has overridden their startup pages setting"> - Is this the startup page you were expecting? - </message> <message name="IDS_EXTENSIONS_SETTINGS_API_TITLE_SEARCH_ENGINE_BUBBLE" desc="Title of a bubble warning users that an extension has overridden their default search engine setting"> Is this the search page you were expecting? </message> @@ -6570,9 +6567,6 @@ <message name="IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_HOME_PAGE" desc="Second line in the Settings API bubble. Only shown if the secondary change by the extension was the just home page. See IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_SEARCH_ENGINE for reason for triple quotes."> ''' It also controls what page is shown when you click the Home button. ''' </message> - <message name="IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_HOME_AND_SEARCH" desc="Second line in the Settings API bubble. Only shown if the secondary change by the extension was both the home page and the search engine. See IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_SEARCH_ENGINE for reason for triple quotes."> - ''' It also controls what page is shown when you click the Home button or search from the Omnibox. ''' - </message> <!-- Strings for the print job confirmation dialog triggered by chrome.printing --> <message name="IDS_EXTENSIONS_PRINTING_API_PRINT_REQUEST_BUBBLE_TITLE" desc="Title of a bubble with print job confirmation dialog triggered by chrome.printing API">
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index f5a467ba..c064f4f 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd
@@ -1200,12 +1200,6 @@ </if> <!-- Settings API bubble --> - <message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES_SPECIFIC" desc="Text displayed in the Settings API bubble as first line when an extension has changed the start pages, and we are pointing to its icon."> - This extension has changed what page is shown when you start Chrome. - </message> - <message name="IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES" desc="Text displayed in the Settings API bubble as first line when an extension has changed the start pages, and we are not pointing to its icon."> - The extension "<ph name="EXTENSION_NAME">$1<ex>AdBlock</ex></ph>" has changed what page is shown when you start Chrome. - </message> <message name="IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_START_PAGES" desc="Second line in the Settings API bubble. Only shown if the secondary change by the extension was just the start pages. The triple single quotes are needed to preserve the space before and after the sentence which is needed when the language (Chrome is being translated to) uses space as word separator. Please preserve them, unless the language being translated to does not use space as word separator."> ''' It also controls what page is shown when you start Chrome. ''' </message>
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index 1170a20..b853c0b 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -2227,7 +2227,7 @@ Do Not Track </message> <message name="IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_TEXT" desc="The text of a confirmation dialog that confirms that the user want to send the 'Do Not Track' header"> - Enabling "Do Not Track" means that a request will be included with your browsing traffic. Any effect depends on whether a website responds to the request, and how the request is interpreted. For example, some websites may respond to this request by showing you ads that aren't based on other websites you've visited. Many websites will still collect and use your browsing data - for example to improve security, to provide content, services, ads and recommendations on their websites, and to generate reporting statistics. <ph name="BEGIN_LINK"><a target="_blank" href="$1"></ph>Learn more<ph name="END_LINK"></a><ex></a></ex></ph> + Enabling "Do Not Track" means that a request will be included with your browsing traffic. Any effect depends on whether a website responds to the request, and how the request is interpreted. For example, some websites may respond to this request by showing you ads that aren't based on other websites you've visited. Many websites will still collect and use your browsing data - for example to improve security, to provide content, services, ads and recommendations on their websites, and to generate reporting statistics. <ph name="BEGIN_LINK"><a target="_blank" href="$1" aria-description="$2"></ph>Learn more<ph name="END_LINK"></a><ex></a></ex></ph> </message> <message name="IDS_SETTINGS_PERMISSIONS" desc="Name of the settings page which allows users to manage permissions and site content settings"> Permissions and content settings @@ -3258,7 +3258,7 @@ Most sites should work as expected </message> <message name="IDS_SETTINGS_TRACKING_PROTECTION_BULLET_TWO_DESCRIPTION" desc="Description of the second bullet for Tracking Protection settings. Explains that you can temporarilty allow a site to use third-party cookies if it isn't working. Contains a learn more link to a help center article."> - If a site isn’t working, you can try giving it temporary permission to use third-party cookies. <ph name="BEGIN_LINK"><a target="_blank" href="$1" aria-label="$2"></ph>Learn more<ph name="END_LINK"></a><ex></a></ex></ph> + If a site isn’t working, you can try giving it temporary permission to use third-party cookies. <ph name="BEGIN_LINK"><a target="_blank" href="$1" aria-label="$2" aria-description="$3"></ph>Learn more<ph name="END_LINK"></a><ex></a></ex></ph> </message> <message name="IDS_SETTINGS_TRACKING_PROTECTION_BULLET_TWO_LEARN_MORE_ARIA_LABEL" desc="Screenreader text for the 'Learn more' link in the second bullet of Tracking Protection settings."> Learn more about giving a site temporary permission to use third-party cookies
diff --git a/chrome/browser/ash/BUILD.gn b/chrome/browser/ash/BUILD.gn index 8b20a18..8ab5e4b 100644 --- a/chrome/browser/ash/BUILD.gn +++ b/chrome/browser/ash/BUILD.gn
@@ -2465,6 +2465,7 @@ "policy/enrollment/auto_enrollment_client_impl.h", "policy/enrollment/auto_enrollment_controller.cc", "policy/enrollment/auto_enrollment_controller.h", + "policy/enrollment/auto_enrollment_state.cc", "policy/enrollment/auto_enrollment_state.h", "policy/enrollment/auto_enrollment_state_message_processor.cc", "policy/enrollment/auto_enrollment_state_message_processor.h",
diff --git a/chrome/browser/ash/crosapi/browser_manager.cc b/chrome/browser/ash/crosapi/browser_manager.cc index def88b56..213608a 100644 --- a/chrome/browser/ash/crosapi/browser_manager.cc +++ b/chrome/browser/ash/crosapi/browser_manager.cc
@@ -519,6 +519,7 @@ } bool ShouldPrelaunchLacrosAtLoginScreen() { + // Only prelaunch if the corresponding feature is enabled. if (!base::FeatureList::IsEnabled(kLacrosLaunchAtLoginScreen)) { LOG(WARNING) << "Lacros will not be prelaunched: prelaunching feature is disabled"; @@ -540,15 +541,18 @@ // Originally introduced because of https://crbug.com/1432779, which // causes PRE_ tests to restart back to login screen, but with the // user still "logged in" (UserManager::IsUserLoggedIn() == true). - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - ash::switches::kLoginUser)) { + const auto* cmdline = base::CommandLine::ForCurrentProcess(); + if (cmdline->HasSwitch(ash::switches::kLoginUser)) { LOG(WARNING) << "Lacros will not be prelaunched: `login-user` switch was passed"; return false; } - // If Lacros is not enabled for any user, don't prelaunch it. - if (!IsLacrosEnabledByAnyUserForPrelaunch()) { + // If Lacros is not enabled for any user, don't prelaunch it, unless + // a switch to force prelaunching was passed. + const bool force_prelaunch = cmdline->HasSwitch( + ash::switches::kForceLacrosLaunchAtLoginScreenForTesting); + if (!force_prelaunch && !IsLacrosEnabledByAnyUserForPrelaunch()) { LOG(WARNING) << "Lacros will not be prelaunched: no user has Lacros enabled"; return false;
diff --git a/chrome/browser/ash/crosapi/browser_manager_unittest.cc b/chrome/browser/ash/crosapi/browser_manager_unittest.cc index 06b98bfc..66b3c22 100644 --- a/chrome/browser/ash/crosapi/browser_manager_unittest.cc +++ b/chrome/browser/ash/crosapi/browser_manager_unittest.cc
@@ -523,6 +523,7 @@ } class BrowserManagerWithoutLacrosUserTest : public BrowserManagerTest { + public: void SetUpBrowserManager() override { AddKnownUser(/*lacros_enabled=*/false); BrowserManagerTest::SetUpBrowserManager(); @@ -534,14 +535,34 @@ // Simulate that we are ready and the log in screen is shown. session_manager::SessionManager::Get()->SetSessionState( session_manager::SessionState::LOGIN_PRIMARY); - // Trigger the pre-launch logic as the log in screen is ready. fake_browser_manager_->TriggerLoginPromptVisible(); - // Expect the prelaunch logic was NOT called as no user has Lacros enabled. EXPECT_EQ(fake_browser_manager_->prelaunch_count(), 0); } +class BrowserManagerWithForceSwitchWithoutLacrosUserTest + : public BrowserManagerWithoutLacrosUserTest { + void SetUpBrowserManager() override { + base::test::ScopedCommandLine command_line; + command_line.GetProcessCommandLine()->AppendSwitch( + ash::switches::kForceLacrosLaunchAtLoginScreenForTesting); + BrowserManagerWithoutLacrosUserTest::SetUpBrowserManager(); + } +}; + +TEST_F(BrowserManagerWithForceSwitchWithoutLacrosUserTest, + PrelaunchLacrosIfForcedViaSwitch) { + // Simulate that we are ready and the log in screen is shown. + session_manager::SessionManager::Get()->SetSessionState( + session_manager::SessionState::LOGIN_PRIMARY); + // Trigger the pre-launch logic as the log in screen is ready. + fake_browser_manager_->TriggerLoginPromptVisible(); + // Expect the prelaunch logic was called as the force switch was passed, + // even if no Lacros users were present in the system. + EXPECT_EQ(fake_browser_manager_->prelaunch_count(), 1); +} + class BrowserManagerWithLacrosUserTest : public BrowserManagerTest { public: void SetUpBrowserManager() override { @@ -554,10 +575,8 @@ // Simulate that we are ready and the log in screen is shown. session_manager::SessionManager::Get()->SetSessionState( session_manager::SessionState::LOGIN_PRIMARY); - // Trigger the pre-launch logic as the log in screen is ready. fake_browser_manager_->TriggerLoginPromptVisible(); - // Expect that the prelaunch logic was called. EXPECT_EQ(fake_browser_manager_->prelaunch_count(), 1); } @@ -575,10 +594,8 @@ // Simulate that we are ready and the log in screen is shown. session_manager::SessionManager::Get()->SetSessionState( session_manager::SessionState::LOGIN_PRIMARY); - // Trigger the pre-launch logic as the log in screen is ready. fake_browser_manager_->TriggerLoginPromptVisible(); - // Expect the prelaunch logic was NOT called as the CPU is not sufficient. EXPECT_EQ(fake_browser_manager_->prelaunch_count(), 0); }
diff --git a/chrome/browser/ash/file_manager/file_manager_test_util.cc b/chrome/browser/ash/file_manager/file_manager_test_util.cc index 757264b7..755011e74 100644 --- a/chrome/browser/ash/file_manager/file_manager_test_util.cc +++ b/chrome/browser/ash/file_manager/file_manager_test_util.cc
@@ -388,11 +388,30 @@ return fake_provided_file_system; } +bool FakeExtensionProviderOneDrive::RequestMount( + Profile* profile, + ash::file_system_provider::RequestMountCallback callback) { + if (request_mount_impl_) { + std::move(request_mount_impl_).Run(std::move(callback)); + return true; + } + return ash::file_system_provider::FakeExtensionProvider::RequestMount( + profile, std::move(callback)); +} + +void FakeExtensionProviderOneDrive::SetRequestMountImpl( + base::OnceCallback<void(ash::file_system_provider::RequestMountCallback)> + callback) { + request_mount_impl_ = std::move(callback); +} + FakeExtensionProviderOneDrive::FakeExtensionProviderOneDrive( const extensions::ExtensionId& extension_id, const ash::file_system_provider::Capabilities& capabilities) : FakeExtensionProvider(extension_id, capabilities) {} +FakeExtensionProviderOneDrive::~FakeExtensionProviderOneDrive() = default; + FakeProvidedFileSystemOneDrive* CreateFakeProvidedFileSystemOneDrive( Profile* profile) { // Create a fake ODFS. @@ -418,6 +437,16 @@ return provided_file_system; } +FakeExtensionProviderOneDrive* GetFakeProviderOneDrive(Profile* profile) { + ash::file_system_provider::Service* service = + ash::file_system_provider::Service::Get(profile); + ash::file_system_provider::ProviderId provider_id = + ash::file_system_provider::ProviderId::CreateFromExtensionId( + extension_misc::kODFSExtensionId); + return static_cast<FakeExtensionProviderOneDrive*>( + service->GetProvider(provider_id)); +} + FakeProvidedFileSystemOneDrive::~FakeProvidedFileSystemOneDrive() = default; } // namespace test
diff --git a/chrome/browser/ash/file_manager/file_manager_test_util.h b/chrome/browser/ash/file_manager/file_manager_test_util.h index b4d20e5..bf2ba28 100644 --- a/chrome/browser/ash/file_manager/file_manager_test_util.h +++ b/chrome/browser/ash/file_manager/file_manager_test_util.h
@@ -205,16 +205,33 @@ const ash::file_system_provider::ProvidedFileSystemInfo& file_system_info) override; + // Calls `request_mount_callback` if set. + bool RequestMount( + Profile* profile, + ash::file_system_provider::RequestMountCallback callback) override; + + // `RequestMount()` will call this callback as its implementation. + void SetRequestMountImpl( + base::OnceCallback< + void(ash::file_system_provider::RequestMountCallback)>); + private: FakeExtensionProviderOneDrive( const extensions::ExtensionId& extension_id, const ash::file_system_provider::Capabilities& capabilities); + ~FakeExtensionProviderOneDrive() override; + + base::OnceCallback<void(ash::file_system_provider::RequestMountCallback)> + request_mount_impl_; }; // Mount a `FakeProvidedFileSystemOneDrive`. FakeProvidedFileSystemOneDrive* CreateFakeProvidedFileSystemOneDrive( Profile* profile); +// Only call this after `CreateFakeProvidedFileSystemOneDrive()`. +FakeExtensionProviderOneDrive* GetFakeProviderOneDrive(Profile* profile); + } // namespace test } // namespace file_manager
diff --git a/chrome/browser/ash/login/enrollment/auto_enrollment_check_screen.cc b/chrome/browser/ash/login/enrollment/auto_enrollment_check_screen.cc index 801c417..34a7c4b9 100644 --- a/chrome/browser/ash/login/enrollment/auto_enrollment_check_screen.cc +++ b/chrome/browser/ash/login/enrollment/auto_enrollment_check_screen.cc
@@ -98,9 +98,9 @@ // IsCompleted() would still return false, and Show would not report result // early. In that case auto-enrollment check should be retried. if (auto_enrollment_controller_->state() == - policy::AutoEnrollmentState::kConnectionError || + policy::kAutoEnrollmentLegacyConnectionError || auto_enrollment_controller_->state() == - policy::AutoEnrollmentState::kServerError) { + policy::kAutoEnrollmentLegacyServerError) { // TODO(crbug.com/1271134): Logging as "WARNING" to make sure it's preserved // in the logs. LOG(WARNING) << "AutoEnrollmentCheckScreen::ShowImpl() retrying enrollment" @@ -147,7 +147,7 @@ void AutoEnrollmentCheckScreen::UpdateState( NetworkState::PortalState new_captive_portal_state) { - const std::optional<policy::AutoEnrollmentState> new_auto_enrollment_state = + const std::optional<policy::AutoEnrollmentState>& new_auto_enrollment_state = auto_enrollment_controller_->state(); // Configure the error screen to show the appropriate error message. @@ -204,19 +204,19 @@ bool AutoEnrollmentCheckScreen::ShowAutoEnrollmentState( policy::AutoEnrollmentState new_auto_enrollment_state) { - switch (new_auto_enrollment_state) { - case policy::AutoEnrollmentState::kEnrollment: - case policy::AutoEnrollmentState::kNoEnrollment: - case policy::AutoEnrollmentState::kDisabled: - return false; - case policy::AutoEnrollmentState::kServerError: + if (new_auto_enrollment_state.has_value()) { + return false; + } + + switch (new_auto_enrollment_state.error()) { + case policy::AutoEnrollmentLegacyError::kServerError: if (!ShouldBlockOnServerError()) return false; // Fall to the same behavior like any connection error if the device is // enrolled. [[fallthrough]]; - case policy::AutoEnrollmentState::kConnectionError: + case policy::AutoEnrollmentLegacyError::kConnectionError: ShowErrorScreen(NetworkError::ERROR_STATE_OFFLINE); return true; } @@ -272,17 +272,19 @@ return false; } - switch (auto_enrollment_controller_->state().value()) { - case policy::AutoEnrollmentState::kConnectionError: + const policy::AutoEnrollmentState state = + auto_enrollment_controller_->state().value(); + if (state.has_value()) { + // Decision made, ready to proceed. + return true; + } + + switch (state.error()) { + case policy::AutoEnrollmentLegacyError::kConnectionError: return false; - case policy::AutoEnrollmentState::kServerError: + case policy::AutoEnrollmentLegacyError::kServerError: // Server errors should block OOBE for enrolled devices. return !ShouldBlockOnServerError(); - case policy::AutoEnrollmentState::kEnrollment: - case policy::AutoEnrollmentState::kNoEnrollment: - case policy::AutoEnrollmentState::kDisabled: - // Decision made, ready to proceed. - return true; } NOTREACHED(); return false;
diff --git a/chrome/browser/ash/login/wizard_controller_browsertest.cc b/chrome/browser/ash/login/wizard_controller_browsertest.cc index e95ed77..814516ae 100644 --- a/chrome/browser/ash/login/wizard_controller_browsertest.cc +++ b/chrome/browser/ash/login/wizard_controller_browsertest.cc
@@ -71,6 +71,7 @@ #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" #include "chrome/browser/ash/policy/enrollment/auto_enrollment_client.h" #include "chrome/browser/ash/policy/enrollment/auto_enrollment_controller.h" +#include "chrome/browser/ash/policy/enrollment/auto_enrollment_state.h" #include "chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.h" #include "chrome/browser/ash/policy/enrollment/enrollment_config.h" #include "chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.h" @@ -1226,7 +1227,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateTest, ControlFlowNoForcedReEnrollmentOnFirstBoot) { fake_statistics_provider_.ClearMachineStatistic(system::kActivateDateKey); - EXPECT_NE(policy::AutoEnrollmentState::kNoEnrollment, + EXPECT_NE(policy::AutoEnrollmentResult::kNoEnrollment, auto_enrollment_controller()->state()); CheckCurrentScreen(WelcomeView::kScreenId); @@ -1248,7 +1249,7 @@ mock_update_screen_->RunExit(UpdateScreen::Result::UPDATE_NOT_REQUIRED); CheckCurrentScreen(UserCreationView::kScreenId); - EXPECT_EQ(policy::AutoEnrollmentState::kNoEnrollment, + EXPECT_EQ(policy::AutoEnrollmentResult::kNoEnrollment, auto_enrollment_controller()->state()); EXPECT_EQ(1, FakeInstallAttributesClient::Get() @@ -1316,7 +1317,7 @@ mock_auto_enrollment_check_screen_->RealShow(); // Wait for auto-enrollment controller to encounter the connection error. - WaitForAutoEnrollmentState(policy::AutoEnrollmentState::kConnectionError); + WaitForAutoEnrollmentState(policy::kAutoEnrollmentLegacyConnectionError); // The error screen shows up if device state could not be retrieved. EXPECT_FALSE(StartupUtils::IsOobeCompleted()); @@ -1408,7 +1409,7 @@ mock_auto_enrollment_check_screen_->RealShow(); // Wait for auto-enrollment controller to encounter the connection error. - WaitForAutoEnrollmentState(policy::AutoEnrollmentState::kConnectionError); + WaitForAutoEnrollmentState(policy::kAutoEnrollmentLegacyConnectionError); // The error screen shows up if there's no auto-enrollment decision. EXPECT_FALSE(StartupUtils::IsOobeCompleted()); @@ -1497,7 +1498,7 @@ // Make AutoEnrollmentClient notify the controller that a server error // occurred. fake_auto_enrollment_client->SetState( - policy::AutoEnrollmentState::kServerError); + policy::kAutoEnrollmentLegacyServerError); base::RunLoop().RunUntilIdle(); // The error screen shows up. @@ -1523,7 +1524,7 @@ policy::EnrollmentConfig::MODE_SERVER_FORCED))) .Times(1); fake_auto_enrollment_client->SetState( - policy::AutoEnrollmentState::kEnrollment); + policy::AutoEnrollmentResult::kEnrollment); mock_auto_enrollment_check_screen_->ExitScreen(); ResetAutoEnrollmentCheckScreen(); @@ -1542,7 +1543,7 @@ // Make AutoEnrollmentClient notify the controller that a server error // occurred. fake_auto_enrollment_client->SetState( - policy::AutoEnrollmentState::kServerError); + policy::kAutoEnrollmentLegacyServerError); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(StartupUtils::IsOobeCompleted()); @@ -1607,12 +1608,12 @@ fetcher_factory.WaitUntilEnrollmentStateFetcherCreated(); fetcher_factory.ReportEnrollmentState( - policy::AutoEnrollmentState::kNoEnrollment); + policy::AutoEnrollmentResult::kNoEnrollment); CheckCurrentScreen(UserCreationView::kScreenId); EXPECT_CALL(*mock_enrollment_screen_, ShowImpl()).Times(0); EXPECT_CALL(*mock_enrollment_screen_, HideImpl()).Times(0); - EXPECT_EQ(policy::AutoEnrollmentState::kNoEnrollment, + EXPECT_EQ(policy::AutoEnrollmentResult::kNoEnrollment, auto_enrollment_controller()->state()); EXPECT_EQ(policy::AutoEnrollmentTypeChecker::CheckType:: kForcedReEnrollmentExplicitlyRequired, @@ -1628,7 +1629,7 @@ fetcher_factory.WaitUntilEnrollmentStateFetcherCreated(); fetcher_factory.ReportEnrollmentState( - policy::AutoEnrollmentState::kServerError); + policy::kAutoEnrollmentLegacyServerError); CheckCurrentScreen(AutoEnrollmentCheckScreenView::kScreenId); EXPECT_EQ(AutoEnrollmentCheckScreenView::kScreenId.AsId(), @@ -1646,7 +1647,7 @@ fetcher_factory.WaitUntilEnrollmentStateFetcherCreated(); fetcher_factory.ReportEnrollmentState( - policy::AutoEnrollmentState::kConnectionError); + policy::kAutoEnrollmentLegacyConnectionError); CheckCurrentScreen(AutoEnrollmentCheckScreenView::kScreenId); EXPECT_EQ(AutoEnrollmentCheckScreenView::kScreenId.AsId(), @@ -1671,7 +1672,7 @@ g_browser_process->local_state()->SetDict(prefs::kServerBackedDeviceState, std::move(device_state)); fetcher_factory.ReportEnrollmentState( - policy::AutoEnrollmentState::kEnrollment); + policy::AutoEnrollmentResult::kEnrollment); CheckCurrentScreen(EnrollmentScreenView::kScreenId); } @@ -1694,7 +1695,8 @@ base::Value(kDisabledMessage)); g_browser_process->local_state()->SetDict(prefs::kServerBackedDeviceState, std::move(device_state)); - fetcher_factory.ReportEnrollmentState(policy::AutoEnrollmentState::kDisabled); + fetcher_factory.ReportEnrollmentState( + policy::AutoEnrollmentResult::kDisabled); CheckCurrentScreen(DeviceDisabledScreenView::kScreenId); } @@ -1713,7 +1715,7 @@ // Ensure that we show an error on enrollment check screen and that it is not // possible to enter guest mode (like in FRE). EXPECT_EQ(auto_enrollment_controller()->state(), - policy::AutoEnrollmentState::kConnectionError); + policy::kAutoEnrollmentLegacyConnectionError); CheckCurrentScreen(AutoEnrollmentCheckScreenView::kScreenId); EXPECT_EQ(AutoEnrollmentCheckScreenView::kScreenId.AsId(), GetErrorScreen()->GetParentScreen()); @@ -1739,7 +1741,7 @@ // Simulate connection error, reset factory and attempt a retry. fetcher_factory.ReportEnrollmentState( - policy::AutoEnrollmentState::kConnectionError); + policy::kAutoEnrollmentLegacyConnectionError); fetcher_factory.Reset(); auto_enrollment_controller()->Retry(); @@ -1796,7 +1798,7 @@ if (check_fre) { // Wait for auto-enrollment controller to encounter the connection error. - WaitForAutoEnrollmentState(policy::AutoEnrollmentState::kConnectionError); + WaitForAutoEnrollmentState(policy::kAutoEnrollmentLegacyConnectionError); // Let update screen smooth time process (time = 0ms). base::RunLoop().RunUntilIdle(); @@ -1921,7 +1923,7 @@ // Make AutoEnrollmentClient notify the controller that a server error // occurred. fake_auto_enrollment_client->SetState( - policy::AutoEnrollmentState::kServerError); + policy::kAutoEnrollmentLegacyServerError); base::RunLoop().RunUntilIdle(); // The error screen shows up if there's no auto-enrollment decision. @@ -1945,7 +1947,7 @@ policy::EnrollmentConfig::MODE_SERVER_FORCED))) .Times(1); fake_auto_enrollment_client->SetState( - policy::AutoEnrollmentState::kEnrollment); + policy::AutoEnrollmentResult::kEnrollment); mock_auto_enrollment_check_screen_->ExitScreen(); ResetAutoEnrollmentCheckScreen(); @@ -1966,7 +1968,7 @@ fake_statistics_provider_.SetMachineStatistic( system::kEnterpriseManagementEmbargoEndDateKey, GenerateEmbargoEndDate(1 /* days_offset */)); - EXPECT_NE(policy::AutoEnrollmentState::kNoEnrollment, + EXPECT_NE(policy::AutoEnrollmentResult::kNoEnrollment, auto_enrollment_controller()->state()); CheckCurrentScreen(WelcomeView::kScreenId); @@ -1989,7 +1991,7 @@ mock_update_screen_->RunExit(UpdateScreen::Result::UPDATE_NOT_REQUIRED); CheckCurrentScreen(UserCreationView::kScreenId); - EXPECT_EQ(policy::AutoEnrollmentState::kNoEnrollment, + EXPECT_EQ(policy::AutoEnrollmentResult::kNoEnrollment, auto_enrollment_controller()->state()); } @@ -1999,7 +2001,7 @@ fake_statistics_provider_.SetMachineStatistic( system::kEnterpriseManagementEmbargoEndDateKey, GenerateEmbargoEndDate(1 /* days_offset */)); - EXPECT_NE(policy::AutoEnrollmentState::kNoEnrollment, + EXPECT_NE(policy::AutoEnrollmentResult::kNoEnrollment, auto_enrollment_controller()->state()); CheckCurrentScreen(WelcomeView::kScreenId); @@ -2033,7 +2035,7 @@ base::RunLoop().RunUntilIdle(); EXPECT_EQ(policy::AutoEnrollmentTypeChecker::CheckType::kNone, auto_enrollment_controller()->auto_enrollment_check_type()); - EXPECT_EQ(policy::AutoEnrollmentState::kNoEnrollment, + EXPECT_EQ(policy::AutoEnrollmentResult::kNoEnrollment, auto_enrollment_controller()->state()); } @@ -2046,7 +2048,7 @@ fake_statistics_provider_.SetMachineStatistic( system::kEnterpriseManagementEmbargoEndDateKey, GenerateEmbargoEndDate(1 /* days_offset */)); - EXPECT_NE(policy::AutoEnrollmentState::kNoEnrollment, + EXPECT_NE(policy::AutoEnrollmentResult::kNoEnrollment, auto_enrollment_controller()->state()); CheckCurrentScreen(WelcomeView::kScreenId); @@ -2081,8 +2083,8 @@ EXPECT_EQ(policy::AutoEnrollmentTypeChecker::CheckType:: kUnknownDueToMissingSystemClockSync, auto_enrollment_controller()->auto_enrollment_check_type()); - EXPECT_EQ(policy::AutoEnrollmentState::kConnectionError, - auto_enrollment_controller()->state()); + EXPECT_EQ(auto_enrollment_controller()->state(), + policy::kAutoEnrollmentLegacyConnectionError); } IN_PROC_BROWSER_TEST_F(WizardControllerDeviceStateWithInitialEnrollmentTest, @@ -2094,7 +2096,7 @@ fake_statistics_provider_.SetMachineStatistic( system::kEnterpriseManagementEmbargoEndDateKey, GenerateEmbargoEndDate(1 /* days_offset */)); - EXPECT_NE(policy::AutoEnrollmentState::kNoEnrollment, + EXPECT_NE(policy::AutoEnrollmentResult::kNoEnrollment, auto_enrollment_controller()->state()); CheckCurrentScreen(WelcomeView::kScreenId); @@ -2151,7 +2153,7 @@ ResetAutoEnrollmentCheckScreen(); fake_auto_enrollment_client->SetState( - policy::AutoEnrollmentState::kEnrollment); + policy::AutoEnrollmentResult::kEnrollment); // Make sure enterprise enrollment page shows up. CheckCurrentScreen(EnrollmentScreenView::kScreenId); @@ -2789,7 +2791,7 @@ mock_auto_enrollment_check_screen_->RealShow(); // Wait for auto-enrollment controller to encounter the connection error. - WaitForAutoEnrollmentState(policy::AutoEnrollmentState::kConnectionError); + WaitForAutoEnrollmentState(policy::kAutoEnrollmentLegacyConnectionError); // The error screen shows up if device state could not be retrieved. CheckCurrentScreen(AutoEnrollmentCheckScreenView::kScreenId);
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.cc index c10f726..508c2a9 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.cc +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.cc
@@ -606,15 +606,15 @@ const DeviceStateMode device_state_mode = GetDeviceStateMode(); switch (device_state_mode) { case RESTORE_MODE_NONE: - return AutoEnrollmentState::kNoEnrollment; + return AutoEnrollmentResult::kNoEnrollment; case RESTORE_MODE_DISABLED: - return AutoEnrollmentState::kDisabled; + return AutoEnrollmentResult::kDisabled; case RESTORE_MODE_REENROLLMENT_REQUESTED: case RESTORE_MODE_REENROLLMENT_ENFORCED: case INITIAL_MODE_ENROLLMENT_ENFORCED: case RESTORE_MODE_REENROLLMENT_ZERO_TOUCH: case INITIAL_MODE_ENROLLMENT_ZERO_TOUCH: - return AutoEnrollmentState::kEnrollment; + return AutoEnrollmentResult::kEnrollment; } } @@ -867,11 +867,11 @@ break; case ServerStateAvailabilityResult::kConnectionError: state_ = State::kRequestServerStateAvailabilityConnectionError; - ReportProgress(AutoEnrollmentState::kConnectionError); + ReportProgress(kAutoEnrollmentLegacyConnectionError); break; case ServerStateAvailabilityResult::kServerError: state_ = State::kRequestServerStateAvailabilityServerError; - ReportProgress(AutoEnrollmentState::kServerError); + ReportProgress(kAutoEnrollmentLegacyServerError); break; case ServerStateAvailabilityResult::kAutoEnrollmentRetriableError: state_ = State::kRequestServerStateAvailabilityServerError; @@ -912,11 +912,11 @@ break; case ServerStateRetrievalResult::kConnectionError: state_ = State::kRequestStateRetrievalConnectionError; - ReportProgress(AutoEnrollmentState::kConnectionError); + ReportProgress(kAutoEnrollmentLegacyConnectionError); break; case ServerStateRetrievalResult::kServerError: state_ = State::kRequestStateRetrievalServerError; - ReportProgress(AutoEnrollmentState::kServerError); + ReportProgress(kAutoEnrollmentLegacyServerError); break; } } @@ -934,7 +934,7 @@ if (auto_enrollment_state_result) { ReportProgress(auto_enrollment_state_result.value()); } else { - ReportProgress(AutoEnrollmentState::kNoEnrollment); + ReportProgress(AutoEnrollmentResult::kNoEnrollment); } }
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl_unittest.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl_unittest.cc index 2ab48de..f1c9f55 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl_unittest.cc +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl_unittest.cc
@@ -549,7 +549,7 @@ /*dm_status_count=*/1); EXPECT_EQ(DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT, failed_job_type_); - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); EXPECT_FALSE(HasCachedDecision()); EXPECT_FALSE(HasServerBackedState()); } @@ -568,7 +568,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); VerifyCachedResult(/*should_enroll=*/false, kPowerLimit); EXPECT_FALSE(HasServerBackedState()); } @@ -586,7 +586,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); EXPECT_FALSE(HasCachedDecision()); EXPECT_FALSE(HasServerBackedState()); } @@ -605,7 +605,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); EXPECT_TRUE(auto_enrollment_request().has_remainder()); EXPECT_TRUE(auto_enrollment_request().has_modulus()); @@ -630,7 +630,7 @@ DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(failed_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); EXPECT_FALSE(HasCachedDecision()); EXPECT_FALSE(HasServerBackedState()); } @@ -652,7 +652,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); EXPECT_FALSE(HasCachedDecision()); EXPECT_FALSE(HasServerBackedState()); } @@ -678,7 +678,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedState( "example.com", kDeviceStateRestoreModeReEnrollmentEnforced, @@ -707,7 +707,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedState("example.com", kDeviceStateRestoreModeReEnrollmentEnforced, @@ -731,7 +731,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); EXPECT_FALSE(HasCachedDecision()); EXPECT_FALSE(HasServerBackedState()); } @@ -750,7 +750,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); EXPECT_FALSE(HasCachedDecision()); EXPECT_FALSE(HasServerBackedState()); } @@ -770,7 +770,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); EXPECT_FALSE(HasCachedDecision()); EXPECT_FALSE(HasServerBackedState()); } @@ -792,7 +792,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); EXPECT_TRUE(auto_enrollment_request().has_remainder()); EXPECT_TRUE(auto_enrollment_request().has_modulus()); EXPECT_EQ(128, auto_enrollment_request().modulus()); @@ -814,7 +814,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); VerifyCachedResult(/*should_enroll=*/false, kPowerLimit); EXPECT_FALSE(HasServerBackedState()); } @@ -839,7 +839,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedState("example.com", kDeviceStateRestoreModeReEnrollmentEnforced, @@ -902,7 +902,7 @@ ServerRepliesEmptyResponseForAsyncJob(&device_state_job); // Verify that no enrollment has been done, and no state has been retrieved. - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); EXPECT_FALSE(HasServerBackedState()); // Verify all jobs have finished. @@ -930,7 +930,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedState("example.com", kDeviceStateRestoreModeReEnrollmentZeroTouch, @@ -957,7 +957,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedState("example.com", kDeviceStateRestoreModeReEnrollmentRequested, @@ -983,7 +983,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kDisabled); + EXPECT_EQ(state_, AutoEnrollmentResult::kDisabled); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedState("example.com", kDeviceStateModeDisabled, kDisabledMessage, kNotWithLicense, kNoLicenseType); @@ -1008,7 +1008,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedState(std::string(), std::string(), std::string(), kNotWithLicense, kNoLicenseType); @@ -1029,7 +1029,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); EXPECT_TRUE(auto_enrollment_request().has_remainder()); EXPECT_TRUE(auto_enrollment_request().has_modulus()); EXPECT_EQ(1, auto_enrollment_request().modulus()); @@ -1050,7 +1050,7 @@ /*dm_status_count=*/i + 1); EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); EXPECT_TRUE(auto_enrollment_request().has_remainder()); EXPECT_TRUE(auto_enrollment_request().has_modulus()); EXPECT_EQ(INT64_C(1) << i, auto_enrollment_request().modulus()); @@ -1084,7 +1084,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); VerifyCachedResult(/*should_enroll=*/true, /*power_limit=*/37); VerifyServerBackedState("example.com", kDeviceStateRestoreModeReEnrollmentEnforced, @@ -1113,7 +1113,7 @@ ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, /*dm_status_count=*/1); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); VerifyServerBackedState("example.com", kDeviceStateRestoreModeReEnrollmentEnforced, kDisabledMessage, kNotWithLicense, kNoLicenseType); @@ -1145,7 +1145,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); VerifyServerBackedState("example.com", kDeviceStateRestoreModeReEnrollmentEnforced, kDisabledMessage, kNotWithLicense, kNoLicenseType); @@ -1160,7 +1160,7 @@ // Don't invoke the callback if there was a network failure. EXPECT_EQ(DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT, failed_job_type_); - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); EXPECT_FALSE(HasCachedDecision()); EXPECT_FALSE(HasServerBackedState()); @@ -1179,7 +1179,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); EXPECT_TRUE(HasCachedDecision()); VerifyServerBackedState("example.com", kDeviceStateRestoreModeReEnrollmentEnforced, @@ -1198,7 +1198,7 @@ // Callback should signal the connection error. EXPECT_EQ(DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT, failed_job_type_); - EXPECT_EQ(state_, AutoEnrollmentState::kConnectionError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyConnectionError); EXPECT_FALSE(HasCachedDecision()); EXPECT_FALSE(HasServerBackedState()); Mock::VerifyAndClearExpectations(service_.get()); @@ -1228,7 +1228,7 @@ // histograms were recorded correctly with the same value. ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); EXPECT_TRUE(HasCachedDecision()); VerifyServerBackedState("example.com", kDeviceStateRestoreModeReEnrollmentEnforced, @@ -1256,7 +1256,7 @@ ExpectHashDanceNetworkErrorHistogram(-net::ERR_FAILED); EXPECT_EQ(failed_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kConnectionError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyConnectionError); EXPECT_FALSE(HasServerBackedState()); } @@ -1290,7 +1290,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedState(std::string(), std::string(), std::string(), kNotWithLicense, kNoLicenseType); @@ -1302,7 +1302,7 @@ client()->Retry(); base::RunLoop().RunUntilIdle(); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); } TEST_F(AutoEnrollmentClientImplTest, @@ -1316,7 +1316,7 @@ ExpectHashDanceNetworkErrorHistogram(-net::ERR_FAILED); EXPECT_EQ(DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT, failed_job_type_); - EXPECT_EQ(state_, AutoEnrollmentState::kConnectionError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyConnectionError); EXPECT_FALSE(HasCachedDecision()); EXPECT_FALSE(HasServerBackedState()); @@ -1330,7 +1330,7 @@ /*dm_status_count=*/1); EXPECT_EQ(DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT, failed_job_type_); - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); EXPECT_FALSE(HasCachedDecision()); EXPECT_FALSE(HasServerBackedState()); @@ -1349,7 +1349,7 @@ ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); VerifyCachedResult(/*should_enroll=*/false, kPowerLimit); EXPECT_FALSE(HasServerBackedState()); } @@ -1370,7 +1370,7 @@ ExpectHashDanceNetworkErrorHistogram(-net::ERR_FAILED); EXPECT_EQ(failed_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kConnectionError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyConnectionError); EXPECT_FALSE(HasServerBackedState()); // Second, the server fails with an internal error. @@ -1382,7 +1382,7 @@ ExpectHashDanceRequestStatusHistogram(DM_STATUS_TEMPORARY_UNAVAILABLE, /*dm_status_count=*/1); EXPECT_EQ(failed_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); EXPECT_FALSE(HasServerBackedState()); // Third, the server responds with a correct server state. @@ -1397,7 +1397,7 @@ ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, /*dm_status_count=*/1); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedState(std::string(), std::string(), std::string(), kNotWithLicense, kNoLicenseType); @@ -1410,7 +1410,7 @@ base::RunLoop().RunUntilIdle(); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedState(std::string(), std::string(), std::string(), kNotWithLicense, kNoLicenseType); @@ -1438,7 +1438,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedStateForInitialEnrollment( std::string(), std::string(), kWithLicense, @@ -1468,7 +1468,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedStateForInitialEnrollment( "example.com", kDeviceStateInitialModeEnrollmentZeroTouch, kWithLicense, @@ -1498,7 +1498,7 @@ EXPECT_EQ(auto_enrollment_job_type_, DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); VerifyServerBackedStateForInitialEnrollment( "example.com", kDeviceStateInitialModeEnrollmentEnforced, kWithLicense, @@ -1607,7 +1607,7 @@ EXPECT_TRUE(GetPsmDeterminationTimestamp().is_null()); // Verify initial enrollment state retrieval. - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); } TEST_F(PsmHelperInitialEnrollmentTest, @@ -1660,9 +1660,9 @@ // Verify initial enrollment state retrieval. if (kExpectedMembershipResult) { EXPECT_EQ(failed_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kConnectionError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyConnectionError); } else { - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); } } @@ -1707,12 +1707,12 @@ // Verify initial enrollment state retrieval. if (kExpectedMembershipResult) { EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); VerifyServerBackedState( "example.com", kDeviceStateRestoreModeReEnrollmentEnforced, kDisabledMessage, kWithLicense, kDeviceStateLicenseTypeEnterprise); } else { - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); } } @@ -1751,9 +1751,9 @@ // Verify initial enrollment state retrieval. if (kExpectedMembershipResult) { EXPECT_EQ(failed_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); } else { - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); } } @@ -1782,7 +1782,7 @@ EXPECT_EQ(kExpectedPsmDeterminationTimestamp, GetPsmDeterminationTimestamp()); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kServerError); + EXPECT_EQ(state_, kAutoEnrollmentLegacyServerError); EXPECT_FALSE(HasServerBackedState()); } @@ -1813,7 +1813,7 @@ EXPECT_EQ(kExpectedPsmDeterminationTimestamp, GetPsmDeterminationTimestamp()); EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentState::kDisabled); + EXPECT_EQ(state_, AutoEnrollmentResult::kDisabled); VerifyServerBackedState("example.com", kDeviceStateModeDisabled, kDisabledMessage, kNotWithLicense, kNoLicenseType); } @@ -1836,7 +1836,7 @@ TEST_P(PsmHelperInitialEnrollmentInternalErrorTest, PsmFails) { // This test verifies that after PSM client fails with an internal error, the - // client reports `AutoEnrollmentState::kNoEnrollment` and retry does not + // client reports `AutoEnrollmentResult::kNoEnrollment` and retry does not // change the decision. PsmWillReplyWith(GetPsmInternalErrorResult()); @@ -1851,7 +1851,7 @@ EXPECT_EQ(GetStateDiscoveryResult(), kExpectedStateResult); EXPECT_EQ(GetPsmExecutionResult(), kExpectedPsmExecutionResult); EXPECT_TRUE(GetPsmDeterminationTimestamp().is_null()); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); // Verify that PSM cached membership result hasn't changed. @@ -1861,7 +1861,7 @@ EXPECT_EQ(GetStateDiscoveryResult(), kExpectedStateResult); EXPECT_EQ(GetPsmExecutionResult(), kExpectedPsmExecutionResult); EXPECT_TRUE(GetPsmDeterminationTimestamp().is_null()); - EXPECT_EQ(state_, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); } INSTANTIATE_TEST_SUITE_P(
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.cc index 918ece74b..2065fed 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.cc +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.cc
@@ -62,9 +62,10 @@ // If `kSafeguardTimeout` after `Start()` has been called, // `AutoEnrollmentController::state()` is still AutoEnrollmentState::kPending, // the AutoEnrollmentController will switch to -// AutoEnrollmentState::kNoEnrollment or AutoEnrollmentState::kConnectionError -// (see `AutoEnrollmentController::Timeout`). Note that this timeout should not -// be too short, because one of the steps `AutoEnrollmentController` performs - +// AutoEnrollmentResult::kNoEnrollment or +// kAutoEnrollmentLegacyConnectionError (see +// `AutoEnrollmentController::Timeout`). Note that this timeout should not be +// too short, because one of the steps `AutoEnrollmentController` performs - // downloading identifier hash buckets - can be non-negligible, especially on 2G // connections. constexpr base::TimeDelta kSafeguardTimeout = base::Seconds(90); @@ -108,21 +109,6 @@ return int_value; } -std::string AutoEnrollmentStateToString(AutoEnrollmentState state) { - switch (state) { - case AutoEnrollmentState::kConnectionError: - return "Connection error"; - case AutoEnrollmentState::kServerError: - return "Server error"; - case AutoEnrollmentState::kEnrollment: - return "Enrollment"; - case AutoEnrollmentState::kNoEnrollment: - return "No enrollment"; - case AutoEnrollmentState::kDisabled: - return "Device disabled"; - } -} - bool IsSystemClockSynchronized( AutoEnrollmentController::SystemClockSyncState state) { switch (state) { @@ -151,15 +137,7 @@ } bool IsFinalAutoEnrollmentState(AutoEnrollmentState state) { - switch (state) { - case AutoEnrollmentState::kConnectionError: - case AutoEnrollmentState::kServerError: - return false; - case AutoEnrollmentState::kEnrollment: - case AutoEnrollmentState::kNoEnrollment: - case AutoEnrollmentState::kDisabled: - return true; - } + return state.has_value(); } } // namespace @@ -329,7 +307,7 @@ ash::system::StatisticsProvider::GetInstance(), dev_disable_boot_); if (auto_enrollment_check_type_ == AutoEnrollmentTypeChecker::CheckType::kNone) { - UpdateState(AutoEnrollmentState::kNoEnrollment); + UpdateState(AutoEnrollmentResult::kNoEnrollment); return; } // If waiting for system clock synchronization has been triggered, wait until @@ -435,11 +413,11 @@ return; case ash::DeviceSettingsService::OwnershipStatus::kOwnershipTaken: LOG(WARNING) << "Device already owned, skipping auto-enrollment check."; - UpdateState(AutoEnrollmentState::kNoEnrollment); + UpdateState(AutoEnrollmentResult::kNoEnrollment); return; case ash::DeviceSettingsService::OwnershipStatus::kOwnershipUnknown: LOG(ERROR) << "Ownership unknown, skipping auto-enrollment check."; - UpdateState(AutoEnrollmentState::kNoEnrollment); + UpdateState(AutoEnrollmentResult::kNoEnrollment); return; } } @@ -465,7 +443,7 @@ base::BindOnce(&AutoEnrollmentController::StartClientForFRE, client_start_weak_factory_.GetWeakPtr())); } else { - UpdateState(AutoEnrollmentState::kNoEnrollment); + UpdateState(AutoEnrollmentResult::kNoEnrollment); } return; } @@ -503,14 +481,13 @@ : "failed to synchronize"); // Only call StartWithSystemClockSyncState() to determine the auto-enrollment // type if the system clock could synchronize successfully. Otherwise, return - // an AutoEnrollmentState::kConnectionError to show an error screen and not - // proceeding with the auto-enrollment checks until + // an error to show to not to proceed with the auto-enrollment checks until // AutoEnrollmentController::Start() is called again by a network state // change or network selection. if (system_clock_sync_state_ == SystemClockSyncState::kSynchronized) { StartWithSystemClockSyncState(); } else { - UpdateState(AutoEnrollmentState::kConnectionError); + UpdateState(kAutoEnrollmentLegacyConnectionError); } } @@ -564,7 +541,7 @@ // Device disabling mode is relying on device state stored in install // attributes. In case that file is corrupted, this should prevent device // re-enabling. - if (state_ == AutoEnrollmentState::kDisabled) { + if (state_ == AutoEnrollmentResult::kDisabled) { DeviceMode device_mode = ash::InstallAttributes::Get()->GetMode(); if (device_mode == DeviceMode::DEVICE_MODE_PENDING || device_mode == DeviceMode::DEVICE_MODE_NOT_SET) { @@ -573,7 +550,7 @@ } } - if (state_ == AutoEnrollmentState::kNoEnrollment) { + if (state_ == AutoEnrollmentResult::kNoEnrollment) { StartCleanupForcedReEnrollment(); } else { progress_callbacks_.Notify(state_.value()); @@ -591,7 +568,7 @@ void AutoEnrollmentController::StartRemoveFirmwareManagementParameters( bool service_is_ready) { - DCHECK(state_ == AutoEnrollmentState::kNoEnrollment); + DCHECK(state_ == AutoEnrollmentResult::kNoEnrollment); if (!service_is_ready) { LOG(ERROR) << "Failed waiting for cryptohome D-Bus service availability."; progress_callbacks_.Notify(state_.value()); @@ -624,7 +601,7 @@ void AutoEnrollmentController::StartClearForcedReEnrollmentVpd( bool service_is_ready) { - DCHECK(state_ == AutoEnrollmentState::kNoEnrollment); + DCHECK(state_ == AutoEnrollmentResult::kNoEnrollment); if (!service_is_ready) { LOG(ERROR) << "Failed waiting for session_manager D-Bus service availability."; @@ -651,7 +628,7 @@ // generation is waiting for time sync or the server just doesn't reply and // keeps the connection open. LOG(ERROR) << "EnrollmentStateFetcher didn't complete within time limit."; - UpdateState(AutoEnrollmentState::kConnectionError); + UpdateState(kAutoEnrollmentLegacyConnectionError); ReportTimeoutUMA(AutoEnrollmentControllerTimeoutReport::kTimeoutUnified); return; } @@ -670,14 +647,14 @@ // pending, there's a bug in the code running on the device. No use in // retrying anything, need to fix that bug. LOG(ERROR) << "Failed to start auto-enrollment check, fix the code!"; - UpdateState(AutoEnrollmentState::kNoEnrollment); + UpdateState(AutoEnrollmentResult::kNoEnrollment); ReportTimeoutUMA(AutoEnrollmentControllerTimeoutReport::kTimeout); } else { // This can actually happen in some cases, for example when state key // generation is waiting for time sync or the server just doesn't reply and // keeps the connection open. LOG(ERROR) << "AutoEnrollmentClient didn't complete within time limit."; - UpdateState(AutoEnrollmentState::kConnectionError); + UpdateState(kAutoEnrollmentLegacyConnectionError); ReportTimeoutUMA(AutoEnrollmentControllerTimeoutReport::kTimeoutFRE); }
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.h b/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.h index 54918c9..68ea342 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.h +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.h
@@ -119,7 +119,7 @@ const ash::NetworkState::PortalState portal_state) override; void OnShuttingDown() override; - std::optional<AutoEnrollmentState> state() const { return state_; } + const std::optional<AutoEnrollmentState>& state() const { return state_; } // Returns the auto-enrollment check type performed by this client. // The returned value will be `CheckType::kNone` before calling `Start()`.
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_controller_unittest.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_controller_unittest.cc index 23a429e..0f774a6 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_controller_unittest.cc +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_controller_unittest.cc
@@ -442,7 +442,7 @@ AutoEnrollmentTypeChecker::CheckType:: kForcedReEnrollmentExplicitlyRequired); EXPECT_FALSE(controller.SafeguardTimerForTesting().IsRunning()); - EXPECT_EQ(controller.state(), AutoEnrollmentState::kConnectionError); + EXPECT_EQ(controller.state(), kAutoEnrollmentLegacyConnectionError); } // Tests that the controller times out with no enrollment state when it performs @@ -479,7 +479,7 @@ AutoEnrollmentTypeChecker::CheckType:: kForcedReEnrollmentImplicitlyRequired); EXPECT_FALSE(controller.SafeguardTimerForTesting().IsRunning()); - EXPECT_EQ(controller.state(), AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(controller.state(), AutoEnrollmentResult::kNoEnrollment); } // Tests that the controller times out with connection error when runs out of @@ -522,7 +522,7 @@ std::move(last_state_keys_callback).Run({}); EXPECT_FALSE(controller.SafeguardTimerForTesting().IsRunning()); - EXPECT_EQ(controller.state(), AutoEnrollmentState::kConnectionError); + EXPECT_EQ(controller.state(), kAutoEnrollmentLegacyConnectionError); } class AutoEnrollmentControllerNetworkTest @@ -591,9 +591,9 @@ // Stop the client with connection error so the controller can retry. { mock_auto_enrollment_client_.ReportAutoEnrollmentState( - AutoEnrollmentState::kConnectionError); + kAutoEnrollmentLegacyConnectionError); - EXPECT_EQ(controller.state(), AutoEnrollmentState::kConnectionError); + EXPECT_EQ(controller.state(), kAutoEnrollmentLegacyConnectionError); } // Flip-flop the network state and check that retry is triggered. @@ -607,11 +607,11 @@ testing_network_.GoOnline(); mock_auto_enrollment_client_.ReportAutoEnrollmentState( - AutoEnrollmentState::kNoEnrollment); + AutoEnrollmentResult::kNoEnrollment); })); testing::Mock::VerifyAndClearExpectations(&mock_auto_enrollment_client_); - EXPECT_EQ(controller.state(), AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(controller.state(), AutoEnrollmentResult::kNoEnrollment); } }
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_state.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_state.cc new file mode 100644 index 0000000..c3d6f85 --- /dev/null +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_state.cc
@@ -0,0 +1,42 @@ +// 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/ash/policy/enrollment/auto_enrollment_state.h" + +namespace policy { + +namespace { + +std::string_view AutoEnrollmentResultToString(AutoEnrollmentResult result) { + switch (result) { + case AutoEnrollmentResult::kEnrollment: + return "Enrollment"; + case AutoEnrollmentResult::kNoEnrollment: + return "No enrollment"; + case AutoEnrollmentResult::kDisabled: + return "Device disabled"; + } +} + +std::string_view AutoEnrollmentLegacyErrorCodeToString( + AutoEnrollmentLegacyError error) { + switch (error) { + case policy::AutoEnrollmentLegacyError::kConnectionError: + return "Connection error"; + case AutoEnrollmentLegacyError::kServerError: + return "Server error"; + } +} + +} // namespace + +std::string_view AutoEnrollmentStateToString(const AutoEnrollmentState& state) { + if (state.has_value()) { + return AutoEnrollmentResultToString(state.value()); + } else { + return AutoEnrollmentLegacyErrorCodeToString(state.error()); + } +} + +} // namespace policy
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_state.h b/chrome/browser/ash/policy/enrollment/auto_enrollment_state.h index 39e7877..2985b90 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_state.h +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_state.h
@@ -5,22 +5,42 @@ #ifndef CHROME_BROWSER_ASH_POLICY_ENROLLMENT_AUTO_ENROLLMENT_STATE_H_ #define CHROME_BROWSER_ASH_POLICY_ENROLLMENT_AUTO_ENROLLMENT_STATE_H_ +#include <string_view> + +#include "base/types/expected.h" + namespace policy { -// Indicates the current state of the auto-enrollment check. -enum class AutoEnrollmentState { - // Failed to connect to DMServer or to synchronize the system clock. - kConnectionError = 2, - // Connection successful, but the server failed to generate a valid reply. - kServerError = 3, +// Indicates the result of state determination. +enum class AutoEnrollmentResult { // Check completed successfully, enrollment should be triggered. - kEnrollment = 4, + kEnrollment, // Check completed successfully, enrollment not applicable. - kNoEnrollment = 5, + kNoEnrollment, // Check completed successfully, device is disabled. - kDisabled = 6, + kDisabled, }; +// Indicates an error during state determination. +enum class AutoEnrollmentLegacyError { + // Failed to connect to DMServer or to synchronize the system clock. + kConnectionError, + // Connection successful, but the server failed to generate a valid reply. + kServerError, +}; + +// Indicates the current state of the auto-enrollment check. +using AutoEnrollmentState = + base::expected<AutoEnrollmentResult, AutoEnrollmentLegacyError>; + +static constexpr AutoEnrollmentState kAutoEnrollmentLegacyConnectionError = + base::unexpected(AutoEnrollmentLegacyError::kConnectionError); + +static constexpr AutoEnrollmentState kAutoEnrollmentLegacyServerError = + base::unexpected(AutoEnrollmentLegacyError::kServerError); + +std::string_view AutoEnrollmentStateToString(const AutoEnrollmentState& state); + } // namespace policy #endif // CHROME_BROWSER_ASH_POLICY_ENROLLMENT_AUTO_ENROLLMENT_STATE_H_
diff --git a/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.cc b/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.cc index 14783b4..8f58f96 100644 --- a/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.cc +++ b/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.h" #include <memory> +#include <string_view> #include <tuple> #include "ash/constants/ash_features.h" @@ -64,6 +65,26 @@ return rlwe_id; } +std::string_view AutoEnrollmentStateToUmaSuffix(AutoEnrollmentState state) { + if (state.has_value()) { + switch (state.value()) { + case AutoEnrollmentResult::kEnrollment: + return kUMASuffixEnrollment; + case AutoEnrollmentResult::kNoEnrollment: + return kUMASuffixNoEnrollment; + case AutoEnrollmentResult::kDisabled: + return kUMASuffixDisabled; + } + } + + switch (state.error()) { + case AutoEnrollmentLegacyError::kConnectionError: + return kUMASuffixConnectionError; + case AutoEnrollmentLegacyError::kServerError: + return kUMASuffixServerError; + } +} + // The DeterminationContext is used to store state and cache computed values // used at various steps of the enrollment state fetch sequence. struct DeterminationContext { @@ -276,7 +297,7 @@ LOG(ERROR) << "Failed to create PSM RLWE OPRF request: " << oprf_request.status(); return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kNoEnrollment)); + .Run(base::unexpected(AutoEnrollmentResult::kNoEnrollment)); } // Prepare the RLWE OPRF request job. @@ -318,19 +339,19 @@ .has_oprf_response()) { LOG(ERROR) << "Empty PSM RLWE OPRF response"; return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kServerError)); + .Run(base::unexpected(kAutoEnrollmentLegacyServerError)); } break; } case DM_STATUS_REQUEST_FAILED: { LOG(ERROR) << "PSM RLWE OPRF connection error"; return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kConnectionError)); + .Run(base::unexpected(kAutoEnrollmentLegacyConnectionError)); } default: { LOG(ERROR) << "PSM RLWE OPRF server error: " << result.dm_status; return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kServerError)); + .Run(base::unexpected(kAutoEnrollmentLegacyServerError)); } } @@ -374,7 +395,7 @@ LOG(ERROR) << "Failed to create PSM RLWE query request: " << query_request.status(); return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kNoEnrollment)); + .Run(base::unexpected(AutoEnrollmentResult::kNoEnrollment)); } // Prepare the RLWE query request job. @@ -420,19 +441,19 @@ .has_query_response()) { LOG(ERROR) << "Empty PSM RLWE query response"; return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kServerError)); + .Run(base::unexpected(kAutoEnrollmentLegacyServerError)); } break; } case DM_STATUS_REQUEST_FAILED: { LOG(ERROR) << "PSM RLWE query connection error"; return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kConnectionError)); + .Run(base::unexpected(kAutoEnrollmentLegacyConnectionError)); } default: { LOG(ERROR) << "PSM RLWE query server error: " << result.dm_status; return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kServerError)); + .Run(base::unexpected(kAutoEnrollmentLegacyServerError)); } } @@ -444,7 +465,7 @@ if (!responses.ok() || responses->membership_responses_size() != 1) { LOG(ERROR) << "Invalid PSM RLWE query response"; return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kServerError)); + .Run(base::unexpected(kAutoEnrollmentLegacyServerError)); } if (responses->membership_responses_size() != 1) { @@ -452,7 +473,7 @@ << responses->membership_responses_size() << " membership responses, expected 1"; return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kServerError)); + .Run(base::unexpected(kAutoEnrollmentLegacyServerError)); } const bool is_member = @@ -570,19 +591,19 @@ if (!result.response.has_device_state_retrieval_response()) { LOG(ERROR) << "Server failed to provide unified enrollment response."; return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kServerError)); + .Run(base::unexpected(kAutoEnrollmentLegacyServerError)); } break; } case DM_STATUS_REQUEST_FAILED: { LOG(ERROR) << "Enrollment state query connection error"; return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kConnectionError)); + .Run(base::unexpected(kAutoEnrollmentLegacyConnectionError)); } default: { LOG(ERROR) << "Enrollment state query server error"; return std::move(completion_callback) - .Run(base::unexpected(AutoEnrollmentState::kServerError)); + .Run(base::unexpected(kAutoEnrollmentLegacyServerError)); } } @@ -692,15 +713,15 @@ switch (initial_enrollment_mode) { case Response::INITIAL_ENROLLMENT_MODE_NONE: - return {AutoEnrollmentState::kNoEnrollment, std::string()}; + return {AutoEnrollmentResult::kNoEnrollment, std::string()}; case Response::INITIAL_ENROLLMENT_MODE_ENROLLMENT_ENFORCED: - return {AutoEnrollmentState::kEnrollment, + return {AutoEnrollmentResult::kEnrollment, kDeviceStateInitialModeEnrollmentEnforced}; case Response::INITIAL_ENROLLMENT_MODE_ZERO_TOUCH_ENFORCED: - return {AutoEnrollmentState::kEnrollment, + return {AutoEnrollmentResult::kEnrollment, kDeviceStateInitialModeEnrollmentZeroTouch}; case Response::INITIAL_ENROLLMENT_MODE_DISABLED: - return {AutoEnrollmentState::kDisabled, kDeviceStateModeDisabled}; + return {AutoEnrollmentResult::kDisabled, kDeviceStateModeDisabled}; } } @@ -746,19 +767,19 @@ em::DeviceStateRetrievalResponse::RestoreMode restore_mode) { switch (restore_mode) { case em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE: - return {AutoEnrollmentState::kNoEnrollment, std::string()}; + return {AutoEnrollmentResult::kNoEnrollment, std::string()}; case em::DeviceStateRetrievalResponse:: RESTORE_MODE_REENROLLMENT_REQUESTED: - return {AutoEnrollmentState::kEnrollment, + return {AutoEnrollmentResult::kEnrollment, kDeviceStateRestoreModeReEnrollmentRequested}; case em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED: - return {AutoEnrollmentState::kEnrollment, + return {AutoEnrollmentResult::kEnrollment, kDeviceStateRestoreModeReEnrollmentEnforced}; case em::DeviceStateRetrievalResponse::RESTORE_MODE_DISABLED: - return {AutoEnrollmentState::kDisabled, kDeviceStateModeDisabled}; + return {AutoEnrollmentResult::kDisabled, kDeviceStateModeDisabled}; case em::DeviceStateRetrievalResponse:: RESTORE_MODE_REENROLLMENT_ZERO_TOUCH: - return {AutoEnrollmentState::kEnrollment, + return {AutoEnrollmentResult::kEnrollment, kDeviceStateRestoreModeReEnrollmentZeroTouch}; } } @@ -847,7 +868,7 @@ base::UmaHistogramBoolean(kUMAStateDeterminationEnabled, enabled); if (!enabled) { VLOG(1) << "Unified state determination is disabled"; - return ReportResult(AutoEnrollmentState::kNoEnrollment); + return ReportResult(AutoEnrollmentResult::kNoEnrollment); } // Flex devices do not support FRE, hence there is no need to perform state @@ -855,7 +876,7 @@ const bool is_on_flex = ash::switches::IsRevenBranding(); base::UmaHistogramBoolean(kUMAStateDeterminationOnFlex, is_on_flex); if (is_on_flex) { - return ReportResult(AutoEnrollmentState::kNoEnrollment); + return ReportResult(AutoEnrollmentResult::kNoEnrollment); } // TODO(b/265923216): Investigate the possibility of using bypassing PSM and // using state key to directly request state when identifiers are missing. @@ -863,7 +884,7 @@ context_.rlz_brand_code, context_.serial_number)) { // Skip enrollment if serial number or brand code are missing. - return ReportResult(AutoEnrollmentState::kNoEnrollment); + return ReportResult(AutoEnrollmentResult::kNoEnrollment); } step_started_ = base::TimeTicks::Now(); @@ -879,13 +900,13 @@ synchronized); if (!synchronized) { LOG(ERROR) << "System clock failed to synchronize"; - return ReportResult(AutoEnrollmentState::kConnectionError); + return ReportResult(kAutoEnrollmentLegacyConnectionError); } const bool passed = embargo_date_.Passed(context_); base::UmaHistogramBoolean(kUMAStateDeterminationEmbargoDatePassed, passed); if (!passed) { - return ReportResult(AutoEnrollmentState::kNoEnrollment); + return ReportResult(AutoEnrollmentResult::kNoEnrollment); } ownership_.Check(context_.device_settings_service, @@ -900,13 +921,13 @@ if (status == ash::DeviceSettingsService::OwnershipStatus::kOwnershipUnknown) { LOG(ERROR) << "Device ownership is unknown. Skipping enrollment"; - return ReportResult(AutoEnrollmentState::kNoEnrollment); + return ReportResult(AutoEnrollmentResult::kNoEnrollment); } if (status == ash::DeviceSettingsService::OwnershipStatus::kOwnershipTaken) { VLOG(1) << "Device ownership is already taken. Skipping enrollment"; - return ReportResult(AutoEnrollmentState::kNoEnrollment); + return ReportResult(AutoEnrollmentResult::kNoEnrollment); } oprf_.Request(context_, base::BindOnce(&Sequence::OnOprfRequestDone, @@ -941,7 +962,7 @@ base::UmaHistogramBoolean(kUMAStateDeterminationPsmReportedAvailableState, result.value()); if (!result.value()) { - return ReportResult(AutoEnrollmentState::kNoEnrollment); + return ReportResult(AutoEnrollmentResult::kNoEnrollment); } query_.StoreResponse(local_state_, result.value()); state_keys_.Retrieve(context_.state_key_broker, @@ -973,24 +994,7 @@ // Helpers void ReportTotalDuration(base::TimeDelta fetch_duration, AutoEnrollmentState state) { - std::string uma_suffix; - switch (state) { - case AutoEnrollmentState::kConnectionError: - uma_suffix = kUMASuffixConnectionError; - break; - case AutoEnrollmentState::kDisabled: - uma_suffix = kUMASuffixDisabled; - break; - case AutoEnrollmentState::kEnrollment: - uma_suffix = kUMASuffixEnrollment; - break; - case AutoEnrollmentState::kNoEnrollment: - uma_suffix = kUMASuffixNoEnrollment; - break; - case AutoEnrollmentState::kServerError: - uma_suffix = kUMASuffixServerError; - break; - } + const std::string_view uma_suffix = AutoEnrollmentStateToUmaSuffix(state); base::UmaHistogramMediumTimes(kUMAStateDeterminationTotalDuration, fetch_duration);
diff --git a/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher_unittest.cc b/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher_unittest.cc index ab4e46e5..3228ef45 100644 --- a/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher_unittest.cc +++ b/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher_unittest.cc
@@ -288,7 +288,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); } TEST_F(EnrollmentStateFetcherTest, DisabledOnFlex) { @@ -298,7 +298,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); histograms.ExpectUniqueSample(kUMAStateDeterminationOnFlex, true, 1); } @@ -307,7 +307,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kConnectionError); + EXPECT_EQ(state, kAutoEnrollmentLegacyConnectionError); } TEST_F(EnrollmentStateFetcherTest, EmbargoDateNotPassed) { @@ -319,7 +319,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); } TEST_F(EnrollmentStateFetcherTest, RlzBrandCodeMissing) { @@ -328,7 +328,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); histograms.ExpectUniqueSample(kUMAStateDeterminationDeviceIdentifierStatus, 2 /*kRlzBrandCodeMissing*/, 1); } @@ -340,7 +340,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); histograms.ExpectUniqueSample(kUMAStateDeterminationDeviceIdentifierStatus, 1 /*kRlzBrandCodeMissing*/, 1); } @@ -353,7 +353,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); histograms.ExpectUniqueSample(kUMAStateDeterminationDeviceIdentifierStatus, 3 /*kAllMissing*/, 1); } @@ -365,7 +365,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); } TEST_F(EnrollmentStateFetcherTest, OwnershipUnknown) { @@ -375,7 +375,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); } TEST_F(EnrollmentStateFetcherTest, ProceedWithMissingStateKeys) { @@ -391,7 +391,7 @@ .WillOnce( fake_dm_service_->SendJobOKAsync(em::DeviceManagementResponse())); - FetchEnrollmentState(); + std::ignore = FetchEnrollmentState(); } TEST_F(EnrollmentStateFetcherTest, EmptyOprfResponse) { @@ -403,7 +403,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kServerError); + EXPECT_EQ(state, kAutoEnrollmentLegacyServerError); } TEST_F(EnrollmentStateFetcherTest, ConnectionErrorOnOprfRequest) { @@ -415,7 +415,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kConnectionError); + EXPECT_EQ(state, kAutoEnrollmentLegacyConnectionError); } TEST_F(EnrollmentStateFetcherTest, ServerErrorOnOprfRequest) { @@ -428,7 +428,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kServerError); + EXPECT_EQ(state, kAutoEnrollmentLegacyServerError); } TEST_F(EnrollmentStateFetcherTest, FailToCreateQueryRequest) { @@ -459,7 +459,7 @@ fetcher->Start(); AutoEnrollmentState state = future.Get(); - EXPECT_EQ(state, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); } TEST_F(EnrollmentStateFetcherTest, EmptyQueryResponse) { @@ -471,7 +471,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kServerError); + EXPECT_EQ(state, kAutoEnrollmentLegacyServerError); } TEST_F(EnrollmentStateFetcherTest, ConnectionErrorOnQueryRequest) { @@ -483,7 +483,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kConnectionError); + EXPECT_EQ(state, kAutoEnrollmentLegacyConnectionError); } TEST_F(EnrollmentStateFetcherTest, ServerErrorOnQueryRequest) { @@ -496,7 +496,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kServerError); + EXPECT_EQ(state, kAutoEnrollmentLegacyServerError); } TEST_F(EnrollmentStateFetcherTest, PsmReportsNoState) { @@ -508,7 +508,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); histograms.ExpectUniqueSample(kUMAStateDeterminationPsmReportedAvailableState, false, 1); } @@ -526,7 +526,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kServerError); + EXPECT_EQ(state, kAutoEnrollmentLegacyServerError); } TEST_F(EnrollmentStateFetcherTest, ConnectionErrorOnEnrollmentStateRequest) { @@ -541,7 +541,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kConnectionError); + EXPECT_EQ(state, kAutoEnrollmentLegacyConnectionError); } TEST_F(EnrollmentStateFetcherTest, ServerErrorOnEnrollmentStateRequest) { @@ -557,7 +557,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kServerError); + EXPECT_EQ(state, kAutoEnrollmentLegacyServerError); } TEST_F(EnrollmentStateFetcherTest, NoEnrollment) { @@ -574,7 +574,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); EXPECT_TRUE(device_state.empty()); @@ -588,7 +588,7 @@ ExpectStateKeysRequest(); ExpectStateRequest(); - FetchEnrollmentState(); + std::ignore = FetchEnrollmentState(); histograms.ExpectUniqueSample(kUMAStateDeterminationDeviceIdentifierStatus, 0 /*kAllPresent*/, 1); @@ -630,7 +630,7 @@ ExpectStateKeysRequest(/*time=*/base::Seconds(4)); ExpectStateRequest(/*time=*/base::Seconds(5)); - FetchEnrollmentState(); + std::ignore = FetchEnrollmentState(); const char* ds = kUMAStateDeterminationTotalDurationByState; histograms.ExpectUniqueTimeSample(base::StrCat({ds, kUMASuffixNoEnrollment}), @@ -677,7 +677,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kNoEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kNoEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); EXPECT_FALSE(device_state.FindString(kDeviceStateMode)); @@ -707,7 +707,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateMode)); @@ -741,7 +741,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kDisabled); + EXPECT_EQ(state, AutoEnrollmentResult::kDisabled); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateMode)); @@ -774,7 +774,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateMode)); @@ -809,7 +809,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindBool(kDeviceStatePackagedLicense)); @@ -840,7 +840,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateLicenseType)); @@ -869,7 +869,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateAssignedUpgradeType)); @@ -898,7 +898,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateAssignedUpgradeType)); @@ -927,7 +927,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateAssignedUpgradeType)); @@ -952,7 +952,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateMode)); @@ -983,7 +983,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateMode)); @@ -1008,7 +1008,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kDisabled); + EXPECT_EQ(state, AutoEnrollmentResult::kDisabled); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateMode)); @@ -1037,7 +1037,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateMode)); @@ -1066,7 +1066,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateLicenseType)); @@ -1091,7 +1091,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateLicenseType)); @@ -1117,7 +1117,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateLicenseType)); @@ -1143,7 +1143,7 @@ AutoEnrollmentState state = FetchEnrollmentState(); - EXPECT_EQ(state, AutoEnrollmentState::kEnrollment); + EXPECT_EQ(state, AutoEnrollmentResult::kEnrollment); const base::Value::Dict& device_state = local_state_.GetDict(prefs::kServerBackedDeviceState); ASSERT_TRUE(device_state.FindString(kDeviceStateLicenseType));
diff --git a/chrome/browser/ash/telemetry_extension/routines/routine_converters.cc b/chrome/browser/ash/telemetry_extension/routines/routine_converters.cc index de3036d..74d3c96b 100644 --- a/chrome/browser/ash/telemetry_extension/routines/routine_converters.cc +++ b/chrome/browser/ash/telemetry_extension/routines/routine_converters.cc
@@ -38,6 +38,13 @@ return crosapi::TelemetryDiagnosticVolumeButtonRoutineDetail::New(); } +crosapi::TelemetryDiagnosticFanRoutineDetailPtr UncheckedConvertPtr( + healthd::FanRoutineDetailPtr input) { + return crosapi::TelemetryDiagnosticFanRoutineDetail::New( + input->passed_fan_ids, input->failed_fan_ids, + Convert(input->fan_count_status)); +} + crosapi::TelemetryDiagnosticRoutineStateInitializedPtr UncheckedConvertPtr( healthd::RoutineStateInitializedPtr input) { return crosapi::TelemetryDiagnosticRoutineStateInitialized::New(); @@ -66,6 +73,9 @@ case healthd::RoutineDetail::Tag::kVolumeButton: return crosapi::TelemetryDiagnosticRoutineDetail::NewVolumeButton( ConvertRoutinePtr(std::move(input->get_volume_button()))); + case healthd::RoutineDetail::Tag::kFan: + return crosapi::TelemetryDiagnosticRoutineDetail::NewFan( + ConvertRoutinePtr(std::move(input->get_fan()))); } NOTREACHED_NORETURN(); } @@ -117,6 +127,9 @@ case crosapi::TelemetryDiagnosticRoutineArgument::Tag::kVolumeButton: return healthd::RoutineArgument::NewVolumeButton( ConvertRoutinePtr(std::move(input->get_volume_button()))); + case crosapi::TelemetryDiagnosticRoutineArgument::Tag::kFan: + return healthd::RoutineArgument::NewFan( + ConvertRoutinePtr(std::move(input->get_fan()))); } } @@ -148,6 +161,11 @@ return arg; } +healthd::FanRoutineArgumentPtr UncheckedConvertPtr( + crosapi::TelemetryDiagnosticFanRoutineArgumentPtr input) { + return healthd::FanRoutineArgument::New(); +} + } // namespace unchecked crosapi::TelemetryDiagnosticMemtesterTestItemEnum Convert( @@ -201,6 +219,22 @@ NOTREACHED_NORETURN(); } +crosapi::TelemetryDiagnosticHardwarePresenceStatus Convert( + healthd::HardwarePresenceStatus input) { + switch (input) { + case healthd::HardwarePresenceStatus::kUnmappedEnumField: + return crosapi::TelemetryDiagnosticHardwarePresenceStatus:: + kUnmappedEnumField; + case healthd::HardwarePresenceStatus::kMatched: + return crosapi::TelemetryDiagnosticHardwarePresenceStatus::kMatched; + case healthd::HardwarePresenceStatus::kNotMatched: + return crosapi::TelemetryDiagnosticHardwarePresenceStatus::kNotMatched; + case healthd::HardwarePresenceStatus::kNotConfigured: + return crosapi::TelemetryDiagnosticHardwarePresenceStatus::kNotConfigured; + } + NOTREACHED_NORETURN(); +} + crosapi::TelemetryDiagnosticRoutineStateWaiting::Reason Convert( healthd::RoutineStateWaiting::Reason input) { switch (input) {
diff --git a/chrome/browser/ash/telemetry_extension/routines/routine_converters.h b/chrome/browser/ash/telemetry_extension/routines/routine_converters.h index dc93642..dea179ed 100644 --- a/chrome/browser/ash/telemetry_extension/routines/routine_converters.h +++ b/chrome/browser/ash/telemetry_extension/routines/routine_converters.h
@@ -30,6 +30,9 @@ crosapi::mojom::TelemetryDiagnosticVolumeButtonRoutineDetailPtr UncheckedConvertPtr(cros_healthd::mojom::VolumeButtonRoutineDetailPtr input); +crosapi::mojom::TelemetryDiagnosticFanRoutineDetailPtr UncheckedConvertPtr( + cros_healthd::mojom::FanRoutineDetailPtr input); + crosapi::mojom::TelemetryDiagnosticRoutineStateInitializedPtr UncheckedConvertPtr(cros_healthd::mojom::RoutineStateInitializedPtr input); @@ -60,11 +63,17 @@ cros_healthd::mojom::VolumeButtonRoutineArgumentPtr UncheckedConvertPtr( crosapi::mojom::TelemetryDiagnosticVolumeButtonRoutineArgumentPtr input); +cros_healthd::mojom::FanRoutineArgumentPtr UncheckedConvertPtr( + crosapi::mojom::TelemetryDiagnosticFanRoutineArgumentPtr input); + } // namespace unchecked crosapi::mojom::TelemetryDiagnosticMemtesterTestItemEnum Convert( cros_healthd::mojom::MemtesterTestItemEnum input); +crosapi::mojom::TelemetryDiagnosticHardwarePresenceStatus Convert( + cros_healthd::mojom::HardwarePresenceStatus input); + crosapi::mojom::TelemetryDiagnosticRoutineStateWaiting::Reason Convert( cros_healthd::mojom::RoutineStateWaiting::Reason input);
diff --git a/chrome/browser/ash/telemetry_extension/routines/routine_converters_unittest.cc b/chrome/browser/ash/telemetry_extension/routines/routine_converters_unittest.cc index a12606ea..9effbe7 100644 --- a/chrome/browser/ash/telemetry_extension/routines/routine_converters_unittest.cc +++ b/chrome/browser/ash/telemetry_extension/routines/routine_converters_unittest.cc
@@ -73,6 +73,14 @@ EXPECT_EQ(result->timeout, kTimeout); } +TEST(TelemetryDiagnosticRoutineConvertersTest, ConvertFanRoutineArgumentPtr) { + auto input = crosapi::TelemetryDiagnosticFanRoutineArgument::New(); + + auto result = ConvertRoutinePtr(std::move(input)); + + ASSERT_TRUE(result); +} + TEST(TelemetryDiagnosticRoutineConvertersTest, ConvertTelemetryDiagnosticRoutineStateInitializedPtr) { EXPECT_EQ(ConvertRoutinePtr(healthd::RoutineStateInitialized::New()), @@ -215,6 +223,22 @@ } TEST(TelemetryDiagnosticRoutineConvertersTest, + ConvertTelemetryDiagnosticFanRoutineDetailPtr) { + auto input = healthd::FanRoutineDetail::New(); + input->passed_fan_ids = {0}; + input->failed_fan_ids = {1}; + input->fan_count_status = healthd::HardwarePresenceStatus::kMatched; + + auto result = ConvertRoutinePtr(std::move(input)); + + ASSERT_TRUE(result); + EXPECT_THAT(result->passed_fan_ids, testing::ElementsAre(0)); + EXPECT_THAT(result->failed_fan_ids, testing::ElementsAre(1)); + EXPECT_EQ(result->fan_count_status, + crosapi::TelemetryDiagnosticHardwarePresenceStatus::kMatched); +} + +TEST(TelemetryDiagnosticRoutineConvertersTest, ConvertTelemetryDiagnosticRoutineDetailPtr) { EXPECT_EQ( ConvertRoutinePtr(healthd::RoutineDetail::NewUnrecognizedArgument(true)), @@ -229,6 +253,11 @@ healthd::VolumeButtonRoutineDetail::New())), crosapi::TelemetryDiagnosticRoutineDetail::NewVolumeButton( crosapi::TelemetryDiagnosticVolumeButtonRoutineDetail::New())); + + EXPECT_EQ(ConvertRoutinePtr(healthd::RoutineDetail::NewFan( + healthd::FanRoutineDetail::New())), + crosapi::TelemetryDiagnosticRoutineDetail::NewFan( + crosapi::TelemetryDiagnosticFanRoutineDetail::New())); } TEST(TelemetryDiagnosticRoutineConvertersTest,
diff --git a/chrome/browser/ash/wilco_dtc_supportd/wilco_dtc_supportd_web_request_service_browsertest.cc b/chrome/browser/ash/wilco_dtc_supportd/wilco_dtc_supportd_web_request_service_browsertest.cc index c7f3314c3..3e1fb6b 100644 --- a/chrome/browser/ash/wilco_dtc_supportd/wilco_dtc_supportd_web_request_service_browsertest.cc +++ b/chrome/browser/ash/wilco_dtc_supportd/wilco_dtc_supportd_web_request_service_browsertest.cc
@@ -137,11 +137,11 @@ std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); url_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - url_loader_factory_, url_loader_test_helper_.GetCallback()); + url_loader_factory_, url_loader_test_helper_.GetCallbackDeprecated()); url_loader_test_helper_.WaitForCallback(); } - const std::string* response_body() const { + const std::optional<std::string>& response_body() const { DCHECK(request_performed_); return url_loader_test_helper_.response_body(); }
diff --git a/chrome/browser/browsing_data/counters/cache_counter_browsertest.cc b/chrome/browser/browsing_data/counters/cache_counter_browsertest.cc index 5a4d90e..41a53ead 100644 --- a/chrome/browser/browsing_data/counters/cache_counter_browsertest.cc +++ b/chrome/browser/browsing_data/counters/cache_counter_browsertest.cc
@@ -88,7 +88,7 @@ ->GetDefaultStoragePartition() ->GetURLLoaderFactoryForBrowserProcess() .get(), - simple_loader_helper.GetCallback()); + simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); }
diff --git a/chrome/browser/browsing_data/counters/conditional_cache_counting_helper_browsertest.cc b/chrome/browser/browsing_data/counters/conditional_cache_counting_helper_browsertest.cc index 2c6f0bc..d1f002a7 100644 --- a/chrome/browser/browsing_data/counters/conditional_cache_counting_helper_browsertest.cc +++ b/chrome/browser/browsing_data/counters/conditional_cache_counting_helper_browsertest.cc
@@ -106,7 +106,7 @@ ->GetDefaultStoragePartition() ->GetURLLoaderFactoryForBrowserProcess() .get(), - simple_loader_helper.GetCallback()); + simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); } }
diff --git a/chrome/browser/browsing_topics/browsing_topics_internals_browsertest.cc b/chrome/browser/browsing_topics/browsing_topics_internals_browsertest.cc index f40257bb..c87d97d 100644 --- a/chrome/browser/browsing_topics/browsing_topics_internals_browsertest.cc +++ b/chrome/browser/browsing_topics/browsing_topics_internals_browsertest.cc
@@ -336,7 +336,6 @@ blink::features::kBrowsingTopics, blink::features::kBrowsingTopicsParameters, features::kPrivacySandboxAdsAPIsOverride, - privacy_sandbox::kPrivacySandboxSettings3, privacy_sandbox::kPrivacySandboxSettings4, }); } @@ -352,7 +351,6 @@ EXPECT_EQ(GetFeaturesAndParametersTabContent(), R"(BrowsingTopics: disabled PrivacySandboxAdsAPIsOverride: disabled -PrivacySandboxSettings3: disabled OverridePrivacySandboxSettingsLocalTesting: disabled BrowsingTopicsBypassIPIsPubliclyRoutableCheck: disabled BrowsingTopicsDocumentAPI: enabled @@ -416,7 +414,6 @@ {"time_period_per_epoch", "15s"}}}, {blink::features::kBrowsingTopics, {}}, {features::kPrivacySandboxAdsAPIsOverride, {}}, - {privacy_sandbox::kPrivacySandboxSettings3, {}}, {privacy_sandbox::kPrivacySandboxSettings4, {{"consent-required", "true"}}}}, /*disabled_features=*/{}); @@ -467,7 +464,6 @@ EXPECT_EQ(GetFeaturesAndParametersTabContent(), R"(BrowsingTopics: enabled PrivacySandboxAdsAPIsOverride: enabled -PrivacySandboxSettings3: enabled OverridePrivacySandboxSettingsLocalTesting: disabled BrowsingTopicsBypassIPIsPubliclyRoutableCheck: disabled BrowsingTopicsDocumentAPI: enabled
diff --git a/chrome/browser/chrome_browser_interface_binders.cc b/chrome/browser/chrome_browser_interface_binders.cc index e6f4593..0931152b 100644 --- a/chrome/browser/chrome_browser_interface_binders.cc +++ b/chrome/browser/chrome_browser_interface_binders.cc
@@ -1390,8 +1390,8 @@ ash::settings::OSSettingsUI>(map); RegisterWebUIControllerInterfaceBinder< - ash::common::mojom::ShortcutInputProvider, ash::settings::OSSettingsUI>( - map); + ash::common::mojom::ShortcutInputProvider, ash::settings::OSSettingsUI, + ash::ShortcutCustomizationAppUI>(map); RegisterWebUIControllerInterfaceBinder< ash::cellular_setup::mojom::CellularSetup, ash::settings::OSSettingsUI>(
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/common/base_telemetry_extension_api_guard_function_browsertest.cc b/chrome/browser/chromeos/extensions/telemetry/api/common/base_telemetry_extension_api_guard_function_browsertest.cc index 7c7c62a..1aebd78 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/common/base_telemetry_extension_api_guard_function_browsertest.cc +++ b/chrome/browser/chromeos/extensions/telemetry/api/common/base_telemetry_extension_api_guard_function_browsertest.cc
@@ -41,6 +41,8 @@ namespace { +// The tests cases must be kept sorted for the test to pass. Tests should be +// grouped by the API type, then sorted alphabetically within the same type. std::string GetServiceWorkerForError(const std::string& error) { std::string service_worker = R"( const tests = [ @@ -173,6 +175,16 @@ ); chrome.test.succeed(); }, + async function createFanRoutine() { + await chrome.test.assertPromiseRejects( + chrome.os.diagnostics.createFanRoutine({ + }), + 'Error: Unauthorized access to ' + + 'chrome.os.diagnostics.createFanRoutine. ' + + '%s' + ); + chrome.test.succeed(); + }, async function createMemoryRoutine() { await chrome.test.assertPromiseRejects( chrome.os.diagnostics.createMemoryRoutine({ @@ -219,6 +231,16 @@ ); chrome.test.succeed(); }, + async function isFanRoutineArgumentSupported() { + await chrome.test.assertPromiseRejects( + chrome.os.diagnostics.isFanRoutineArgumentSupported({ + }), + 'Error: Unauthorized access to ' + + 'chrome.os.diagnostics.isFanRoutineArgumentSupported. ' + + '%s' + ); + chrome.test.succeed(); + }, async function isMemoryRoutineArgumentSupported() { await chrome.test.assertPromiseRejects( chrome.os.diagnostics.isMemoryRoutineArgumentSupported({
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/diagnostics/diagnostics_api.cc b/chrome/browser/chromeos/extensions/telemetry/api/diagnostics/diagnostics_api.cc index 817f9c8..930940d 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/diagnostics/diagnostics_api.cc +++ b/chrome/browser/chromeos/extensions/telemetry/api/diagnostics/diagnostics_api.cc
@@ -591,6 +591,43 @@ cx_diag::CreateVolumeButtonRoutine::Results::Create(response))); } +// OsDiagnosticsCreateFanRoutineFunction ------------------------------------ + +void OsDiagnosticsCreateFanRoutineFunction::RunIfAllowed() { + absl::optional<cx_diag::CreateFanRoutine::Params> params( + cx_diag::CreateFanRoutine::Params::Create(args())); + + if (!params.has_value()) { + SetBadMessage(); + Respond(BadMessage()); + return; + } + + auto fan_arg = crosapi::mojom::TelemetryDiagnosticFanRoutineArgument::New(); + + auto* routines_manager = DiagnosticRoutineManager::Get(browser_context()); + auto result = routines_manager->CreateRoutine( + extension_id(), + crosapi::mojom::TelemetryDiagnosticRoutineArgument::NewFan( + std::move(fan_arg))); + + if (!result.has_value()) { + switch (result.error()) { + case DiagnosticRoutineManager::kAppUiClosed: + Respond(Error("Companion app UI is not open.")); + break; + case DiagnosticRoutineManager::kExtensionUnloaded: + Respond(Error("Extension has been unloaded.")); + break; + } + return; + } + + cx_diag::CreateRoutineResponse response; + response.uuid = result->AsLowercaseString(); + Respond(ArgumentList(cx_diag::CreateFanRoutine::Results::Create(response))); +} + // OsDiagnosticsStartRoutineFunction ------------------------------------------- void OsDiagnosticsStartRoutineFunction::RunIfAllowed() { @@ -718,4 +755,41 @@ response.value()))); } +// OsDiagnosticsIsFanRoutineArgumentSupportedFunction ----------------------- + +void OsDiagnosticsIsFanRoutineArgumentSupportedFunction::RunIfAllowed() { + auto params = GetParams<cx_diag::IsFanRoutineArgumentSupported::Params>(); + if (!params.has_value()) { + return; + } + + auto* routines_manager = DiagnosticRoutineManager::Get(browser_context()); + auto fan_args = crosapi::mojom::TelemetryDiagnosticFanRoutineArgument::New(); + + auto args = crosapi::mojom::TelemetryDiagnosticRoutineArgument::NewFan( + std::move(fan_args)); + routines_manager->IsRoutineArgumentSupported( + std::move(args), + base::BindOnce( + &OsDiagnosticsIsFanRoutineArgumentSupportedFunction::OnResult, this)); +} + +void OsDiagnosticsIsFanRoutineArgumentSupportedFunction::OnResult( + crosapi::mojom::TelemetryExtensionSupportStatusPtr result) { + if (result.is_null()) { + RespondWithError("API internal error."); + return; + } + + auto response = ParseRoutineArgumentSupportResult(std::move(result)); + + if (!response.has_value()) { + RespondWithError(response.error()); + return; + } + + Respond(ArgumentList(cx_diag::IsFanRoutineArgumentSupported::Results::Create( + response.value()))); +} + } // namespace chromeos
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/diagnostics/diagnostics_api.h b/chrome/browser/chromeos/extensions/telemetry/api/diagnostics/diagnostics_api.h index edce58a..106ffd5 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/diagnostics/diagnostics_api.h +++ b/chrome/browser/chromeos/extensions/telemetry/api/diagnostics/diagnostics_api.h
@@ -458,6 +458,17 @@ void RunIfAllowed() override; }; +class OsDiagnosticsCreateFanRoutineFunction + : public DiagnosticsApiFunctionBaseV2 { + DECLARE_EXTENSION_FUNCTION("os.diagnostics.createFanRoutine", + OS_DIAGNOSTICS_CREATEFANROUTINE) + private: + ~OsDiagnosticsCreateFanRoutineFunction() override = default; + + // BaseTelemetryExtensionApiGuardFunction: + void RunIfAllowed() override; +}; + class OsDiagnosticsStartRoutineFunction : public DiagnosticsApiFunctionBaseV2 { DECLARE_EXTENSION_FUNCTION("os.diagnostics.startRoutine", OS_DIAGNOSTICS_STARTROUTINE) @@ -506,6 +517,19 @@ void OnResult(crosapi::mojom::TelemetryExtensionSupportStatusPtr result); }; +class OsDiagnosticsIsFanRoutineArgumentSupportedFunction + : public DiagnosticsApiFunctionBaseV2 { + DECLARE_EXTENSION_FUNCTION("os.diagnostics.isFanRoutineArgumentSupported", + OS_DIAGNOSTICS_ISFANROUTINEARGUMENTSUPPORTED) + private: + ~OsDiagnosticsIsFanRoutineArgumentSupportedFunction() override = default; + + // BaseTelemetryExtensionApiGuardFunction: + void RunIfAllowed() override; + + void OnResult(crosapi::mojom::TelemetryExtensionSupportStatusPtr result); +}; + } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_TELEMETRY_API_DIAGNOSTICS_DIAGNOSTICS_API_H_
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/diagnostics/diagnostics_api_v2_browsertest.cc b/chrome/browser/chromeos/extensions/telemetry/api/diagnostics/diagnostics_api_v2_browsertest.cc index af32f346..41231e9 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/diagnostics/diagnostics_api_v2_browsertest.cc +++ b/chrome/browser/chromeos/extensions/telemetry/api/diagnostics/diagnostics_api_v2_browsertest.cc
@@ -762,4 +762,206 @@ )"); } +IN_PROC_BROWSER_TEST_F( + TelemetryExtensionDiagnosticsApiV2BrowserTestPendingApproval, + IsFanRoutineArgSupportedWithFeatureFlagApiInternalError) { + fake_service().SetIsRoutineArgumentSupportedResponse( + crosapi::TelemetryExtensionSupportStatus::NewUnmappedUnionField(0)); + OpenAppUiAndMakeItSecure(); + + CreateExtensionAndRunServiceWorker(R"( + chrome.test.runTests([ + async function isFanRoutineArgSupported() { + await chrome.test.assertPromiseRejects( + chrome.os.diagnostics.isFanRoutineArgumentSupported({ + }), + 'Error: API internal error.' + ); + + chrome.test.succeed(); + } + ]); + )"); +} + +IN_PROC_BROWSER_TEST_F( + TelemetryExtensionDiagnosticsApiV2BrowserTestPendingApproval, + IsFanRoutineArgSupportedWithFeatureFlagException) { + auto exception = crosapi::TelemetryExtensionException::New(); + exception->debug_message = "TEST_MESSAGE"; + fake_service().SetIsRoutineArgumentSupportedResponse( + crosapi::TelemetryExtensionSupportStatus::NewException( + std::move(exception))); + OpenAppUiAndMakeItSecure(); + + CreateExtensionAndRunServiceWorker(R"( + chrome.test.runTests([ + async function isFanRoutineArgSupported() { + await chrome.test.assertPromiseRejects( + chrome.os.diagnostics.isFanRoutineArgumentSupported({ + }), + 'Error: TEST_MESSAGE' + ); + + chrome.test.succeed(); + } + ]); + )"); +} + +IN_PROC_BROWSER_TEST_F( + TelemetryExtensionDiagnosticsApiV2BrowserTestPendingApproval, + IsFanRoutineArgSupportedWithFeatureFlagSuccess) { + fake_service().SetIsRoutineArgumentSupportedResponse( + crosapi::TelemetryExtensionSupportStatus::NewSupported( + crosapi::TelemetryExtensionSupported::New())); + OpenAppUiAndMakeItSecure(); + + CreateExtensionAndRunServiceWorker(R"( + chrome.test.runTests([ + async function isFanRoutineArgSupported() { + const result = await chrome.os.diagnostics. + isFanRoutineArgumentSupported({ + }); + + chrome.test.assertEq(result.status, 'supported'); + + chrome.test.succeed(); + } + ]); + )"); +} + +IN_PROC_BROWSER_TEST_F( + TelemetryExtensionDiagnosticsApiV2BrowserTestPendingApproval, + CreateFanRoutineWithFeatureFlagCompanionUiNotOpenError) { + CreateExtensionAndRunServiceWorker(R"( + chrome.test.runTests([ + async function createFanRoutineFail() { + await chrome.test.assertPromiseRejects( + chrome.os.diagnostics.createFanRoutine({ + }), + 'Error: Companion app UI is not open.' + ); + + chrome.test.succeed(); + } + ]); + )"); +} + +IN_PROC_BROWSER_TEST_F( + TelemetryExtensionDiagnosticsApiV2BrowserTestPendingApproval, + CreateFanRoutineWithFeatureFlagResetConnection) { + fake_service().SetOnCreateRoutineCalled(base::BindLambdaForTesting([this]() { + auto* control = fake_service().GetCreatedRoutineControlForRoutineType( + crosapi::TelemetryDiagnosticRoutineArgument::Tag::kFan); + ASSERT_TRUE(control); + + control->receiver().ResetWithReason( + static_cast<uint32_t>( + crosapi::TelemetryExtensionException::Reason::kUnsupported), + "test message"); + })); + + OpenAppUiAndMakeItSecure(); + + CreateExtensionAndRunServiceWorker(R"( + chrome.test.runTests([ + async function createFanRoutineResetConnection() { + let resolver; + // Set later once the routine was created. + var uuid = new Promise((resolve) => { + resolver = resolve; + }); + + chrome.os.diagnostics.onRoutineException.addListener(async (status) => { + chrome.test.assertEq(status, { + "uuid": await uuid, + "reason": "unsupported", + "debugMessage": "test message" + }); + + chrome.test.succeed(); + }); + + const response = await chrome.os.diagnostics.createFanRoutine({ + }); + chrome.test.assertTrue(response !== undefined); + resolver(response.uuid); + } + ]); + )"); +} + +IN_PROC_BROWSER_TEST_F( + TelemetryExtensionDiagnosticsApiV2BrowserTestPendingApproval, + CreateFanRoutineWithFeatureFlagSuccess) { + fake_service().SetOnCreateRoutineCalled(base::BindLambdaForTesting([this]() { + auto* control = fake_service().GetCreatedRoutineControlForRoutineType( + crosapi::TelemetryDiagnosticRoutineArgument::Tag::kFan); + ASSERT_TRUE(control); + + auto fan_detail = crosapi::TelemetryDiagnosticFanRoutineDetail::New(); + fan_detail->passed_fan_ids = {0}; + fan_detail->failed_fan_ids = {1}; + fan_detail->fan_count_status = + crosapi::TelemetryDiagnosticHardwarePresenceStatus::kMatched; + + auto finished_state = + crosapi::TelemetryDiagnosticRoutineStateFinished::New(); + finished_state->detail = crosapi::TelemetryDiagnosticRoutineDetail::NewFan( + std::move(fan_detail)); + finished_state->has_passed = true; + + auto state = crosapi::TelemetryDiagnosticRoutineState::New(); + state->state_union = + crosapi::TelemetryDiagnosticRoutineStateUnion::NewFinished( + std::move(finished_state)); + + control->SetState(std::move(state)); + })); + + OpenAppUiAndMakeItSecure(); + + CreateExtensionAndRunServiceWorker(R"( + chrome.test.runTests([ + async function createFanRoutine() { + let resolver; + // Set later once the routine was created. + var uuid = new Promise((resolve) => { + resolver = resolve; + }); + + let onInitCalled = false; + chrome.os.diagnostics.onRoutineInitialized.addListener( + async (status) => { + chrome.test.assertEq(status.uuid, await uuid); + onInitCalled = true; + }); + + // Only resolve the test once we got the final event. + chrome.os.diagnostics.onFanRoutineFinished.addListener( + async (status) => { + chrome.test.assertEq(status, { + "has_passed": true, + "uuid": await uuid, + "failed_fan_ids":[1], + "passed_fan_ids":[0], + "fan_count_status": "matched", + }); + chrome.test.assertTrue(onInitCalled); + + chrome.test.succeed(); + }); + + const response = await chrome.os.diagnostics.createFanRoutine({ + }); + chrome.test.assertTrue(response !== undefined); + resolver(response.uuid); + } + ]); + )"); +} + } // namespace chromeos
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters.cc b/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters.cc index efac521..c0ef0cf 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters.cc +++ b/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters.h" #include <cstdint> +#include <vector> #include "base/notreached.h" #include "base/uuid.h" @@ -85,6 +86,30 @@ return result; } +cx_diag::FanRoutineFinishedInfo UncheckedConvertPtr( + crosapi::TelemetryDiagnosticFanRoutineDetailPtr input, + base::Uuid uuid, + bool has_passed) { + cx_diag::FanRoutineFinishedInfo result; + + std::vector<int> passed_fan_ids = {}; + for (const auto& passed_fan_id : input->passed_fan_ids) { + passed_fan_ids.push_back(passed_fan_id); + } + result.passed_fan_ids = passed_fan_ids; + + std::vector<int> failed_fan_ids = {}; + for (const auto& failed_fan_id : input->failed_fan_ids) { + failed_fan_ids.push_back(failed_fan_id); + } + result.failed_fan_ids = failed_fan_ids; + + result.fan_count_status = Convert(input->fan_count_status); + result.uuid = uuid.AsLowercaseString(); + result.has_passed = has_passed; + return result; +} + } // namespace unchecked cx_diag::ExceptionReason Convert( @@ -167,4 +192,19 @@ NOTREACHED_NORETURN(); } +cx_diag::HardwarePresenceStatus Convert( + crosapi::TelemetryDiagnosticHardwarePresenceStatus input) { + switch (input) { + case crosapi::TelemetryDiagnosticHardwarePresenceStatus::kUnmappedEnumField: + return cx_diag::HardwarePresenceStatus::kNone; + case crosapi::TelemetryDiagnosticHardwarePresenceStatus::kMatched: + return cx_diag::HardwarePresenceStatus::kMatched; + case crosapi::TelemetryDiagnosticHardwarePresenceStatus::kNotMatched: + return cx_diag::HardwarePresenceStatus::kNotMatched; + case crosapi::TelemetryDiagnosticHardwarePresenceStatus::kNotConfigured: + return cx_diag::HardwarePresenceStatus::kNotConfigured; + } + NOTREACHED_NORETURN(); +} + } // namespace chromeos::converters::routines
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters.h b/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters.h index a9bce2b9..44c6308 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters.h +++ b/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters.h
@@ -50,6 +50,11 @@ base::Uuid uuid, bool has_passed); +api::os_diagnostics::FanRoutineFinishedInfo UncheckedConvertPtr( + crosapi::mojom::TelemetryDiagnosticFanRoutineDetailPtr input, + base::Uuid uuid, + bool has_passed); + } // namespace unchecked api::os_diagnostics::ExceptionReason Convert( @@ -61,6 +66,9 @@ api::os_diagnostics::MemtesterTestItemEnum Convert( crosapi::mojom::TelemetryDiagnosticMemtesterTestItemEnum input); +api::os_diagnostics::HardwarePresenceStatus Convert( + crosapi::mojom::TelemetryDiagnosticHardwarePresenceStatus input); + template <class InputT, class OutputT = decltype(Convert(std::declval<InputT>())), class = std::enable_if_t<std::is_enum_v<InputT> ||
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters_unittest.cc b/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters_unittest.cc index f952a6c..673287dd 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters_unittest.cc +++ b/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_converters_unittest.cc
@@ -123,6 +123,26 @@ EXPECT_EQ(*result.has_passed, kHasPassed); } +TEST(TelemetryExtensionDiagnosticRoutineConvertersTest, + FanRoutineFinishedInfo) { + auto input = crosapi::TelemetryDiagnosticFanRoutineDetail::New(); + input->passed_fan_ids = {0}; + input->failed_fan_ids = {1}; + input->fan_count_status = + crosapi::TelemetryDiagnosticHardwarePresenceStatus::kMatched; + + constexpr bool kHasPassed = true; + const base::Uuid kUuid = base::Uuid::GenerateRandomV4(); + + auto result = ConvertPtr(std::move(input), kUuid, kHasPassed); + + ASSERT_TRUE(result.uuid.has_value()); + EXPECT_EQ(*result.uuid, kUuid.AsLowercaseString()); + + ASSERT_TRUE(result.has_passed.has_value()); + EXPECT_EQ(*result.has_passed, kHasPassed); +} + TEST(TelemetryExtensionDiagnosticRoutineConvertersTest, MemtesterResult) { auto input = crosapi::TelemetryDiagnosticMemtesterResult::New(); input->passed_items = {
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_observation.cc b/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_observation.cc index 0eb4983..c0eccd56 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_observation.cc +++ b/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_observation.cc
@@ -51,6 +51,14 @@ cx_diag::OnVolumeButtonRoutineFinished::kEventName, base::Value::List().Append(finished_info.ToValue()), browser_context); } + case crosapi::TelemetryDiagnosticRoutineDetail::Tag::kFan: { + auto finished_info = converters::routines::ConvertPtr( + std::move(finished->detail->get_fan()), uuid, finished->has_passed); + return std::make_unique<extensions::Event>( + extensions::events::OS_DIAGNOSTICS_ON_FAN_ROUTINE_FINISHED, + cx_diag::OnFanRoutineFinished::kEventName, + base::Value::List().Append(finished_info.ToValue()), browser_context); + } } NOTREACHED_NORETURN(); }
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_observation_browsertest.cc b/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_observation_browsertest.cc index 67bc8da..30567ac 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_observation_browsertest.cc +++ b/chrome/browser/chromeos/extensions/telemetry/api/routines/diagnostic_routine_observation_browsertest.cc
@@ -291,6 +291,26 @@ )"); } +IN_PROC_BROWSER_TEST_F(TelemetryExtensionDiagnosticRoutineObserverBrowserTest, + CannotObserveOnFanRoutineFinishedWithoutFeatureFlag) { + CreateExtensionAndRunServiceWorker(R"( + chrome.test.runTests([ + function cannotObserveOnFanRoutineFinished() { + chrome.test.assertThrows(() => { + chrome.os.diagnostics.onFanRoutineFinished.addListener( + (event) => { + // unreachable + }); + }, [], + 'Cannot read properties of undefined (reading \'addListener\')' + ); + + chrome.test.succeed(); + } + ]); + )"); +} + class PendingApprovalTelemetryExtensionDiagnosticRoutineObserverBrowserTest : public TelemetryExtensionDiagnosticRoutineObserverBrowserTest { public: @@ -349,4 +369,55 @@ EXPECT_EQ(info.uuid, uuid_); } +IN_PROC_BROWSER_TEST_F( + PendingApprovalTelemetryExtensionDiagnosticRoutineObserverBrowserTest, + CanObserveOnFanRoutineFinished) { + RegisterEventObserver( + api::os_diagnostics::OnFanRoutineFinished::kEventName, + base::BindLambdaForTesting([this] { + auto fan_detail = crosapi::TelemetryDiagnosticFanRoutineDetail::New(); + fan_detail->passed_fan_ids = {0}; + fan_detail->failed_fan_ids = {1}; + fan_detail->fan_count_status = + crosapi::TelemetryDiagnosticHardwarePresenceStatus::kMatched; + + auto finished_detail = + crosapi::TelemetryDiagnosticRoutineDetail::NewFan( + std::move(fan_detail)); + + auto finished_state = crosapi::TelemetryDiagnosticRoutineState::New(); + finished_state->state_union = + crosapi::TelemetryDiagnosticRoutineStateUnion::NewFinished( + crosapi::TelemetryDiagnosticRoutineStateFinished::New( + /*has_passed=*/true, std::move(finished_detail))); + finished_state->percentage = 100; + + remote_->OnRoutineStateChange(std::move(finished_state)); + })); + + CreateExtensionAndRunServiceWorker( + base::StringPrintf(R"( + chrome.test.runTests([ + async function canObserveOnFanRoutineFinished() { + chrome.os.diagnostics.onFanRoutineFinished.addListener((event) => { + chrome.test.assertEq(event, { + "passed_fan_ids": [0], + "failed_fan_ids": [1], + "fan_count_status": "matched", + "has_passed": true, + "uuid":"%s" + }); + + chrome.test.succeed(); + }); + } + ]); + )", + uuid_.AsLowercaseString().c_str())); + + auto info = WaitForFinishedReport(); + EXPECT_EQ(info.extension_id, extension_id()); + EXPECT_EQ(info.uuid, uuid_); +} + } // namespace chromeos
diff --git a/chrome/browser/component_updater/recovery_component_installer.cc b/chrome/browser/component_updater/recovery_component_installer.cc index ba3e1a0..01128b0 100644 --- a/chrome/browser/component_updater/recovery_component_installer.cc +++ b/chrome/browser/component_updater/recovery_component_installer.cc
@@ -20,7 +20,6 @@ #include "base/json/json_file_value_serializer.h" #include "base/logging.h" #include "base/memory/raw_ptr.h" -#include "base/metrics/histogram_macros.h" #include "base/path_service.h" #include "base/process/kill.h" #include "base/process/launch.h" @@ -83,25 +82,6 @@ EXIT_CODE_ELEVATION_NEEDED = 2, }; -enum RecoveryComponentEvent { - RCE_RUNNING_NON_ELEVATED = 0, - RCE_ELEVATION_NEEDED = 1, - RCE_FAILED = 2, - RCE_SUCCEEDED = 3, - RCE_SKIPPED = 4, - RCE_RUNNING_ELEVATED = 5, - RCE_ELEVATED_FAILED = 6, - RCE_ELEVATED_SUCCEEDED = 7, - RCE_ELEVATED_SKIPPED = 8, - RCE_COMPONENT_DOWNLOAD_ERROR = 9, - RCE_ELEVATED_UNKNOWN_RESULT = 10, - RCE_COUNT -}; - -void RecordRecoveryComponentUMAEvent(RecoveryComponentEvent event) { - UMA_HISTOGRAM_ENUMERATION("RecoveryComponent.Event", event, RCE_COUNT); -} - // Checks if elevated recovery simulation switch was present on the command // line. This is for testing purpose. bool SimulatingElevatedRecovery() { @@ -158,17 +138,8 @@ } void WaitForElevatedInstallToComplete(base::Process process) { - int installer_exit_code = 0; const base::TimeDelta kMaxWaitTime = base::Seconds(600); - if (process.WaitForExitWithTimeout(kMaxWaitTime, &installer_exit_code)) { - if (installer_exit_code == EXIT_CODE_RECOVERY_SUCCEEDED) { - RecordRecoveryComponentUMAEvent(RCE_ELEVATED_SUCCEEDED); - } else { - RecordRecoveryComponentUMAEvent(RCE_ELEVATED_SKIPPED); - } - } else { - RecordRecoveryComponentUMAEvent(RCE_ELEVATED_FAILED); - } + process.WaitForExitWithTimeout(kMaxWaitTime, nullptr); } void DoElevatedInstallRecoveryComponent(const base::FilePath& path) { @@ -196,8 +167,6 @@ const auto cmdline = BuildRecoveryInstallCommandLine( main_file, manifest, is_deferred_run, version); - RecordRecoveryComponentUMAEvent(RCE_RUNNING_ELEVATED); - base::LaunchOptions options; options.start_hidden = true; options.elevated = true; @@ -206,7 +175,6 @@ base::mac::ScopedAuthorizationRef authRef = base::mac::AuthorizationCreateToRunAsRoot(nullptr); if (!authRef.get()) { - RecordRecoveryComponentUMAEvent(RCE_ELEVATED_FAILED); return; } @@ -225,7 +193,6 @@ authRef.get(), main_file.value().c_str(), kAuthorizationFlagDefaults, raw_string_args.data(), nullptr, &pid); if (status != errAuthorizationSuccess) { - RecordRecoveryComponentUMAEvent(RCE_ELEVATED_FAILED); return; } @@ -234,7 +201,6 @@ // for more details. When |pid| cannot be determined, we are not able to // get process exit code, thus bail out early. if (pid < 0) { - RecordRecoveryComponentUMAEvent(RCE_ELEVATED_UNKNOWN_RESULT); return; } base::Process process = base::Process::Open(pid); @@ -338,7 +304,6 @@ } void RecoveryComponentInstaller::OnUpdateError(int error) { - RecordRecoveryComponentUMAEvent(RCE_COMPONENT_DOWNLOAD_ERROR); NOTREACHED() << "Recovery component update error: " << error; } @@ -349,26 +314,16 @@ const base::TimeDelta kMaxWaitTime = base::Seconds(600); if (process.WaitForExitWithTimeout(kMaxWaitTime, &installer_exit_code)) { if (installer_exit_code == EXIT_CODE_ELEVATION_NEEDED) { - RecordRecoveryComponentUMAEvent(RCE_ELEVATION_NEEDED); - content::GetUIThreadTaskRunner({})->PostTask( FROM_HERE, base::BindOnce(&SetPrefsForElevatedRecoveryInstall, installer_folder, prefs)); - } else if (installer_exit_code == EXIT_CODE_RECOVERY_SUCCEEDED) { - RecordRecoveryComponentUMAEvent(RCE_SUCCEEDED); - } else if (installer_exit_code == EXIT_CODE_RECOVERY_SKIPPED) { - RecordRecoveryComponentUMAEvent(RCE_SKIPPED); } - } else { - RecordRecoveryComponentUMAEvent(RCE_FAILED); } } bool RecoveryComponentInstaller::RunInstallCommand( const base::CommandLine& cmdline, const base::FilePath& installer_folder) const { - RecordRecoveryComponentUMAEvent(RCE_RUNNING_NON_ELEVATED); - base::LaunchOptions options; #if BUILDFLAG(IS_WIN) options.start_hidden = true;
diff --git a/chrome/browser/compose/chrome_compose_client_unittest.cc b/chrome/browser/compose/chrome_compose_client_unittest.cc index 1c4f27c7..bfee2d24 100644 --- a/chrome/browser/compose/chrome_compose_client_unittest.cc +++ b/chrome/browser/compose/chrome_compose_client_unittest.cc
@@ -1295,24 +1295,41 @@ TEST_F(ChromeComposeClientTest, TestComposeQualityLatency) { ShowDialogAndBindMojo(); - // optimization_guide::proto::ComposeQuality quality; - EXPECT_CALL(session(), ExecuteModel(_, _)).Times(1); + EXPECT_CALL(session(), ExecuteModel(_, _)).Times(2); base::test::TestFuture< std::unique_ptr<optimization_guide::ModelQualityLogEntry>> - test_future; + quality_test_future; + EXPECT_CALL(model_quality_logs_uploader(), UploadModelQualityLogs(_)) - .WillOnce(testing::Invoke( + .WillRepeatedly(testing::Invoke( [&](std::unique_ptr<optimization_guide::ModelQualityLogEntry> - response) { test_future.SetValue(std::move(response)); })); + response) { + quality_test_future.SetValue(std::move(response)); + })); auto style_modifiers = compose::mojom::StyleModifiers::New(); page_handler()->Compose(std::move(style_modifiers), "a user typed this", /*rewrite=*/false); + style_modifiers = compose::mojom::StyleModifiers::New(); + page_handler()->Compose(std::move(style_modifiers), "a user typed that", + /*rewrite=*/false); + + // This take should clear the test future for the second commit. std::unique_ptr<optimization_guide::ModelQualityLogEntry> result = - test_future.Take(); + quality_test_future.Take(); + + EXPECT_EQ( + base::ScopedMockElapsedTimersForTest::kMockElapsedTime.InMilliseconds(), + result->quality_data<optimization_guide::ComposeFeatureTypeMap>() + ->request_latency_ms()); + + // Close UI to submit quality logs. + client_page_handler()->CloseUI(compose::mojom::CloseReason::kCloseButton); + + result = quality_test_future.Take(); EXPECT_EQ( base::ScopedMockElapsedTimersForTest::kMockElapsedTime.InMilliseconds(),
diff --git a/chrome/browser/compose/compose_session.cc b/chrome/browser/compose/compose_session.cc index 37e63a8f..7e1abac 100644 --- a/chrome/browser/compose/compose_session.cc +++ b/chrome/browser/compose/compose_session.cc
@@ -105,10 +105,15 @@ modeling_log_entry_ ->quality_data<optimization_guide::ComposeFeatureTypeMap>() ->set_final_status(final_status_); + // Quality log would automaticlaly be uploaded on the destruction of + // modeling_log_entry_. However in order to more easily test the qulity + // uploads we are calling upload directly here. + if (model_quality_logs_uploader_.has_value()) { + model_quality_logs_uploader_.value()->UploadModelQualityLogs( + std::move(modeling_log_entry_)); } - // Ensure that log gets uploaded on destruction. - modeling_log_entry_.reset(); } +} void ComposeSession::Bind( mojo::PendingReceiver<compose::mojom::ComposeSessionPageHandler> handler, @@ -133,7 +138,12 @@ ProcessError(compose::mojom::ComposeStatus::kMisconfiguration); return; } - + // Upload any previously existing modeling data. + if (modeling_log_entry_ && model_quality_logs_uploader_.has_value()) { + model_quality_logs_uploader_.value()->UploadModelQualityLogs( + std::move(modeling_log_entry_)); + modeling_log_entry_ = nullptr; + } // Increase compose count regradless of status of request. compose_count_ += 1; @@ -182,18 +192,17 @@ *request.mutable_generate_params() = std::move(generate_params); } - auto request_timer = std::make_unique<base::ElapsedTimer>(); + base::ElapsedTimer request_timer; request_id_++; session_->ExecuteModel( - request, - base::BindRepeating(&ComposeSession::ModelExecutionCallback, - weak_ptr_factory_.GetWeakPtr(), - std::move(request_timer.get()), request_id_)); + request, base::BindRepeating(&ComposeSession::ModelExecutionCallback, + weak_ptr_factory_.GetWeakPtr(), + std::move(request_timer), request_id_)); } void ComposeSession::ModelExecutionCallback( - base::ElapsedTimer* request_timer, + const base::ElapsedTimer& request_timer, int request_id, optimization_guide::OptimizationGuideModelStreamingExecutionResult result, std::unique_ptr<optimization_guide::ModelQualityLogEntry> log_entry) { @@ -202,7 +211,7 @@ return; } - base::TimeDelta request_delta = request_timer->Elapsed(); + base::TimeDelta request_delta = request_timer.Elapsed(); current_state_->has_pending_request = false; compose::mojom::ComposeStatus status = @@ -250,10 +259,6 @@ ->quality_data<optimization_guide::ComposeFeatureTypeMap>() ->set_request_latency_ms(request_delta.InMilliseconds()); - if (model_quality_logs_uploader_.has_value()) { - model_quality_logs_uploader_.value()->UploadModelQualityLogs( - std::move(modeling_log_entry_)); - } } } @@ -308,6 +313,13 @@ compose::mojom::ComposeStatePtr undo_state = std::move(undo_states_.top()); undo_states_.pop(); + + // If we have a modeling quality log entry, upload it. + if (modeling_log_entry_ && model_quality_logs_uploader_.has_value()) { + model_quality_logs_uploader_.value()->UploadModelQualityLogs( + std::move(modeling_log_entry_)); + } + if (!undo_state->response || undo_state->response->status != compose::mojom::ComposeStatus::kOk || undo_state->response->result == "") { @@ -339,12 +351,6 @@ ->quality_data<optimization_guide::ComposeFeatureTypeMap>(); if (quality) { quality->set_user_feedback(user_feedback); - auto* optimization_guide_keyed_service = - OptimizationGuideKeyedServiceFactory::GetForProfile( - Profile::FromBrowserContext(web_contents_->GetBrowserContext())); - // TODO(b/311798158): manage lifecycle to maintain modeling_log_entry_. - optimization_guide_keyed_service->UploadModelQualityLogs( - std::move(modeling_log_entry_)); } } }
diff --git a/chrome/browser/compose/compose_session.h b/chrome/browser/compose/compose_session.h index 91dc9c3..ae27a03 100644 --- a/chrome/browser/compose/compose_session.h +++ b/chrome/browser/compose/compose_session.h
@@ -122,7 +122,7 @@ private: void ProcessError(compose::mojom::ComposeStatus status); void ModelExecutionCallback( - base::ElapsedTimer* request_start, + const base::ElapsedTimer& request_start, int request_id, optimization_guide::OptimizationGuideModelStreamingExecutionResult result, std::unique_ptr<optimization_guide::ModelQualityLogEntry> log_entry);
diff --git a/chrome/browser/extensions/api/web_request/web_request_apitest.cc b/chrome/browser/extensions/api/web_request/web_request_apitest.cc index c64e412..ca5b0a5 100644 --- a/chrome/browser/extensions/api/web_request/web_request_apitest.cc +++ b/chrome/browser/extensions/api/web_request/web_request_apitest.cc
@@ -1793,7 +1793,7 @@ auto loader = network::SimpleURLLoader::Create( std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - url_loader_factory, loader_helper.GetCallback()); + url_loader_factory, loader_helper.GetCallbackDeprecated()); // Wait for the response to complete. loader_helper.WaitForCallback(); @@ -2163,7 +2163,7 @@ auto simple_loader = network::SimpleURLLoader::Create( std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - url_loader_factory, simple_loader_helper.GetCallback()); + url_loader_factory, simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback();
diff --git a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc index 2893691..a1c5292 100644 --- a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc +++ b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc
@@ -380,8 +380,7 @@ // unpredicatable behavior. DevModeBubbleDelegate(profile()).ClearProfileSetForTesting(); ProxyOverriddenBubbleDelegate(profile()).ClearProfileSetForTesting(); - for (auto type : {BUBBLE_TYPE_HOME_PAGE, BUBBLE_TYPE_SEARCH_ENGINE, - BUBBLE_TYPE_STARTUP_PAGES}) { + for (auto type : {BUBBLE_TYPE_HOME_PAGE, BUBBLE_TYPE_SEARCH_ENGINE}) { SettingsApiBubbleDelegate(profile(), type).ClearProfileSetForTesting(); } SuspiciousExtensionBubbleDelegate(profile()).ClearProfileSetForTesting(); @@ -712,8 +711,8 @@ TEST_F(ExtensionMessageBubbleTest, SettingsApiControllerTest) { Init(); - for (int i = 0; i < 3; ++i) { - switch (static_cast<SettingsApiOverrideType>(i)) { + for (auto type : {BUBBLE_TYPE_HOME_PAGE, BUBBLE_TYPE_SEARCH_ENGINE}) { + switch (type) { case BUBBLE_TYPE_HOME_PAGE: // Load two extensions overriding home page and one overriding something // unrelated (to check for interference). Extension 2 should still win @@ -732,23 +731,8 @@ // that is more or less the same for the search engine as it is for the // others. continue; - case BUBBLE_TYPE_STARTUP_PAGES: - // Load two extensions overriding start page and one overriding - // something unrelated (to check for interference). Extension 2 should - // still win on the startup page setting. - ASSERT_TRUE(LoadExtensionOverridingStart("1", kId1, - ManifestLocation::kUnpacked)); - ASSERT_TRUE(LoadExtensionOverridingStart("2", kId2, - ManifestLocation::kUnpacked)); - ASSERT_TRUE(LoadExtensionOverridingHome("3", kId3, - ManifestLocation::kUnpacked)); - break; - default: - NOTREACHED(); - break; } - SettingsApiOverrideType type = static_cast<SettingsApiOverrideType>(i); std::unique_ptr<TestExtensionMessageBubbleController> controller( new TestExtensionMessageBubbleController( new SettingsApiBubbleDelegate(browser()->profile(), type),
diff --git a/chrome/browser/extensions/settings_api_bubble_delegate.cc b/chrome/browser/extensions/settings_api_bubble_delegate.cc index 001f0ab..7b4e1f8e 100644 --- a/chrome/browser/extensions/settings_api_bubble_delegate.cc +++ b/chrome/browser/extensions/settings_api_bubble_delegate.cc
@@ -48,12 +48,6 @@ bool SettingsApiBubbleDelegate::ShouldIncludeExtension( const Extension* extension) { - // If the browser is showing the 'Chrome crashed' infobar, it won't be showing - // the startup pages, so there's no point in showing the bubble now. - if (type_ == BUBBLE_TYPE_STARTUP_PAGES && - ExitTypeService::GetLastSessionExitType(profile()) == ExitType::kCrashed) - return false; - if (HasBubbleInfoBeenAcknowledged(extension->id())) return false; @@ -62,9 +56,6 @@ case extensions::BUBBLE_TYPE_HOME_PAGE: override = extensions::GetExtensionOverridingHomepage(profile()); break; - case extensions::BUBBLE_TYPE_STARTUP_PAGES: - override = extensions::GetExtensionOverridingStartupPages(profile()); - break; case extensions::BUBBLE_TYPE_SEARCH_ENGINE: override = extensions::GetExtensionOverridingSearchEngine(profile()); break; @@ -95,9 +86,6 @@ case BUBBLE_TYPE_HOME_PAGE: return l10n_util::GetStringUTF16( IDS_EXTENSIONS_SETTINGS_API_TITLE_HOME_PAGE_BUBBLE); - case BUBBLE_TYPE_STARTUP_PAGES: - return l10n_util::GetStringUTF16( - IDS_EXTENSIONS_SETTINGS_API_TITLE_STARTUP_PAGES_BUBBLE); case BUBBLE_TYPE_SEARCH_ENGINE: return l10n_util::GetStringUTF16( IDS_EXTENSIONS_SETTINGS_API_TITLE_SEARCH_ENGINE_BUBBLE); @@ -140,19 +128,6 @@ second_line_id = IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_SEARCH_ENGINE; } break; - case BUBBLE_TYPE_STARTUP_PAGES: - first_line_id = anchored_to_browser_action ? - IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES_SPECIFIC : - IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_START_PAGES; - if (home_change && search_change) { - second_line_id = - IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_HOME_AND_SEARCH; - } else if (home_change) { - second_line_id = IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_HOME_PAGE; - } else if (search_change) { - second_line_id = IDS_EXTENSIONS_SETTINGS_API_SECOND_LINE_SEARCH_ENGINE; - } - break; case BUBBLE_TYPE_SEARCH_ENGINE: first_line_id = anchored_to_browser_action ? IDS_EXTENSIONS_SETTINGS_API_FIRST_LINE_SEARCH_ENGINE_SPECIFIC : @@ -199,9 +174,7 @@ } bool SettingsApiBubbleDelegate::ShouldCloseOnDeactivate() const { - // Startup bubbles tend to get lost in the focus storm that happens on - // startup. Other types should dismiss on focus loss. - return type_ != BUBBLE_TYPE_STARTUP_PAGES; + return true; } bool SettingsApiBubbleDelegate::ShouldShow( @@ -240,8 +213,6 @@ switch (type_) { case BUBBLE_TYPE_HOME_PAGE: return "SettingsApiBubbleDelegate.HomePage"; - case BUBBLE_TYPE_STARTUP_PAGES: - return "SettingsApiBubbleDelegate.StartupPages"; case BUBBLE_TYPE_SEARCH_ENGINE: return "SettingsApiBubbleDelegate.SearchEngine"; }
diff --git a/chrome/browser/extensions/settings_api_helpers.cc b/chrome/browser/extensions/settings_api_helpers.cc index f82a52d..4ff4c00b 100644 --- a/chrome/browser/extensions/settings_api_helpers.cc +++ b/chrome/browser/extensions/settings_api_helpers.cc
@@ -21,11 +21,17 @@ namespace { +enum class OverrideType { + kStartupPages, + kHomePage, + kSearchEngine, +}; + // Returns which |extension| (if any) is overriding a particular |type| of // setting. const Extension* FindOverridingExtension( content::BrowserContext* browser_context, - SettingsApiOverrideType type) { + OverrideType type) { const ExtensionSet& extensions = ExtensionRegistry::Get(browser_context)->enabled_extensions(); ExtensionPrefsHelper* prefs_helper = @@ -36,22 +42,26 @@ ++it) { const SettingsOverrides* settings = SettingsOverrides::Get(it->get()); if (settings) { - if (type == BUBBLE_TYPE_HOME_PAGE && !settings->homepage) + if (type == OverrideType::kHomePage && !settings->homepage) { continue; - if (type == BUBBLE_TYPE_STARTUP_PAGES && settings->startup_pages.empty()) + } + if (type == OverrideType::kStartupPages && + settings->startup_pages.empty()) { continue; - if (type == BUBBLE_TYPE_SEARCH_ENGINE && !settings->search_engine) + } + if (type == OverrideType::kSearchEngine && !settings->search_engine) { continue; + } std::string key; switch (type) { - case BUBBLE_TYPE_HOME_PAGE: + case OverrideType::kHomePage: key = prefs::kHomePage; break; - case BUBBLE_TYPE_STARTUP_PAGES: + case OverrideType::kStartupPages: key = prefs::kRestoreOnStartup; break; - case BUBBLE_TYPE_SEARCH_ENGINE: + case OverrideType::kSearchEngine: key = prefs::kDefaultSearchProviderEnabled; break; } @@ -74,7 +84,7 @@ const Extension* GetExtensionOverridingHomepage( content::BrowserContext* browser_context) { - return FindOverridingExtension(browser_context, BUBBLE_TYPE_HOME_PAGE); + return FindOverridingExtension(browser_context, OverrideType::kHomePage); } const Extension* GetExtensionOverridingNewTabPage( @@ -91,12 +101,12 @@ const Extension* GetExtensionOverridingStartupPages( content::BrowserContext* browser_context) { - return FindOverridingExtension(browser_context, BUBBLE_TYPE_STARTUP_PAGES); + return FindOverridingExtension(browser_context, OverrideType::kStartupPages); } const Extension* GetExtensionOverridingSearchEngine( content::BrowserContext* browser_context) { - return FindOverridingExtension(browser_context, BUBBLE_TYPE_SEARCH_ENGINE); + return FindOverridingExtension(browser_context, OverrideType::kSearchEngine); } const Extension* GetExtensionOverridingProxy(
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index f07ef2c..3761c898 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -7172,11 +7172,6 @@ "expiry_milestone": -1 }, { - "name": "set-up-list-content-notification", - "owners": ["tinazwang@google.com", "chrome-sherlock@google.com"], - "expiry_milestone": 130 - }, - { "name": "settings-app-notification-settings", "owners": [ "yulunwu@chromium.org" ], "expiry_milestone": 96
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc index 29c375d..752f538 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -380,7 +380,6 @@ kUnifiedPasswordManagerLocalPasswordsMigrationWarning, &features::kBlockMidiByDefault, &privacy_sandbox::kPrivacySandboxFirstPartySetsUI, - &privacy_sandbox::kPrivacySandboxSettings3, &privacy_sandbox::kPrivacySandboxSettings4, &privacy_sandbox::kPrivacySandboxProactiveTopicsBlocking, &privacy_sandbox::kTrackingProtectionSettingsPageRollbackNotice,
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 9fb8e77..48e8700 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
@@ -370,7 +370,6 @@ public static final String PRIVACY_GUIDE_PRELOAD_ANDROID = "PrivacyGuidePreloadAndroid"; public static final String PRIVACY_GUIDE_POST_MVP = "PrivacyGuideAndroidPostMVP"; public static final String PRIVACY_SANDBOX_FPS_UI = "PrivacySandboxFirstPartySetsUI"; - public static final String PRIVACY_SANDBOX_SETTINGS_3 = "PrivacySandboxSettings3"; public static final String PRIVACY_SANDBOX_SETTINGS_4 = "PrivacySandboxSettings4"; public static final String PRIVACY_SANDBOX_PROACTIVE_TOPICS_BLOCKING = "PrivacySandboxProactiveTopicsBlocking";
diff --git a/chrome/browser/interest_group/interest_group_permissions_browsertest.cc b/chrome/browser/interest_group/interest_group_permissions_browsertest.cc index a92c229..ccf3fe8 100644 --- a/chrome/browser/interest_group/interest_group_permissions_browsertest.cc +++ b/chrome/browser/interest_group/interest_group_permissions_browsertest.cc
@@ -39,8 +39,7 @@ features::kPrivacySandboxAdsAPIsOverride, privacy_sandbox::kPrivacySandboxSettings4}, /*disabled_features=*/ - {blink::features::kFencedFrames, - privacy_sandbox::kPrivacySandboxSettings3}); + {blink::features::kFencedFrames}); } void SetUpOnMainThread() override {
diff --git a/chrome/browser/media/webrtc/webrtc_mediadevices_interactive_uitest.cc b/chrome/browser/media/webrtc/webrtc_mediadevices_interactive_uitest.cc index e150a85..bbb356a6 100644 --- a/chrome/browser/media/webrtc/webrtc_mediadevices_interactive_uitest.cc +++ b/chrome/browser/media/webrtc/webrtc_mediadevices_interactive_uitest.cc
@@ -27,6 +27,8 @@ #include "components/media_device_salt/media_device_salt_service.h" #include "components/permissions/permission_request_manager.h" #include "components/permissions/test/permission_request_observer.h" +#include "components/prefs/pref_service.h" +#include "components/privacy_sandbox/tracking_protection_prefs.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browsing_data_remover.h" #include "content/public/common/content_features.h" @@ -328,6 +330,8 @@ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url)); CookieSettingsFactory::GetForProfile(browser()->profile()) ->SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); + browser()->profile()->GetPrefs()->SetBoolean(prefs::kBlockAll3pcToggleEnabled, + true); content::WebContents* tab1 = browser()->tab_strip_model()->GetActiveWebContents(); @@ -357,6 +361,8 @@ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url)); CookieSettingsFactory::GetForProfile(browser()->profile()) ->SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); + browser()->profile()->GetPrefs()->SetBoolean(prefs::kBlockAll3pcToggleEnabled, + true); content::WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); @@ -464,6 +470,8 @@ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url)); CookieSettingsFactory::GetForProfile(browser()->profile()) ->SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); + browser()->profile()->GetPrefs()->SetBoolean(prefs::kBlockAll3pcToggleEnabled, + true); content::WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); std::vector<MediaDeviceInfo> devices;
diff --git a/chrome/browser/metrics/structured/ash_event_storage.cc b/chrome/browser/metrics/structured/ash_event_storage.cc index 3093fd94..2461c4e4 100644 --- a/chrome/browser/metrics/structured/ash_event_storage.cc +++ b/chrome/browser/metrics/structured/ash_event_storage.cc
@@ -10,74 +10,129 @@ namespace metrics::structured { -AshEventStorage::AshEventStorage(base::TimeDelta write_delay) - : write_delay_(write_delay) {} +AshEventStorage::AshEventStorage(base::TimeDelta write_delay, + const base::FilePath& pre_user_event_path) + : write_delay_(write_delay) { + // Store to persist events before a user has logged-in. + pre_user_events_ = std::make_unique<PersistentProto<EventsProto>>( + pre_user_event_path, write_delay_, + base::BindOnce(&AshEventStorage::OnRead, weak_factory_.GetWeakPtr()), + base::BindRepeating(&AshEventStorage::OnWrite, + weak_factory_.GetWeakPtr())); +} AshEventStorage::~AshEventStorage() = default; -// EventStorage: -bool AshEventStorage::IsReady() { - return events_.get() != nullptr && is_initialized_; -} - void AshEventStorage::OnReady() { + CHECK(pre_user_events_.get()); is_initialized_ = true; for (auto& event : pre_storage_events_) { AddEvent(std::move(event)); } - - pre_storage_events_.reserve(0); } void AshEventStorage::AddEvent(StructuredEventProto&& event) { - if (IsReady()) { - *events()->add_non_uma_events() = event; - events_->StartWrite(); - } else { + PersistentProto<EventsProto>* event_store_to_write = + GetStoreToWriteEvent(event); + + if (!event_store_to_write) { pre_storage_events_.emplace_back(event); + return; } + + *event_store_to_write->get()->add_non_uma_events() = event; + event_store_to_write->StartWrite(); } void AshEventStorage::MoveEvents(ChromeUserMetricsExtension& uma_proto) { StructuredDataProto* proto = uma_proto.mutable_structured_data(); - proto->mutable_events()->Swap(events()->mutable_non_uma_events()); - events()->clear_uma_events(); - events()->clear_non_uma_events(); + if (IsPreUserStorageReadable() && + pre_user_events()->non_uma_events_size() > 0) { + proto->mutable_events()->MergeFrom(pre_user_events()->non_uma_events()); + pre_user_events()->clear_non_uma_events(); + pre_user_events_->StartWrite(); + } + if (IsProfileReady() && user_events()->non_uma_events_size() > 0) { + proto->mutable_events()->MergeFrom(user_events()->non_uma_events()); + user_events()->clear_non_uma_events(); + user_events_->StartWrite(); + } + + // TODO(b/312292811): Cleanup |pre_user_events_| after the first upload as it + // is not needed. This cannot be done currently because the dtor will trigger + // a blocking call on a non-blocking thread. } int AshEventStorage::RecordedEventsCount() const { - return events_ ? events_->get()->non_uma_events_size() : 0; + int total_event_count = 0; + if (IsPreUserStorageReadable()) { + total_event_count += pre_user_events_->get()->non_uma_events_size(); + } + if (is_user_initialized_) { + total_event_count += user_events_->get()->non_uma_events_size(); + } + return total_event_count; } void AshEventStorage::Purge() { - if (IsReady()) { - events_->Purge(); + if (IsProfileReady()) { + user_events_->Purge(); + } + if (IsPreUserStorageReadable()) { + pre_user_events_->Purge(); + } + if (!pre_storage_events_.empty()) { + pre_storage_events_.clear(); } } void AshEventStorage::OnProfileAdded(const base::FilePath& path) { DCHECK(base::CurrentUIThread::IsSet()); - if (is_initialized_) { + if (is_user_initialized_) { return; } // The directory used to store unsent logs. Relative to the user's cryptohome. // This file is created by chromium. - events_ = std::make_unique<PersistentProto<EventsProto>>( + user_events_ = std::make_unique<PersistentProto<EventsProto>>( path.Append(FILE_PATH_LITERAL("structured_metrics")) .Append(FILE_PATH_LITERAL("events")), write_delay_, - base::BindOnce(&AshEventStorage::OnRead, weak_factory_.GetWeakPtr()), + base::BindOnce(&AshEventStorage::OnProfileRead, + weak_factory_.GetWeakPtr()), base::BindRepeating(&AshEventStorage::OnWrite, weak_factory_.GetWeakPtr())); } void AshEventStorage::AddBatchEvents( const google::protobuf::RepeatedPtrField<StructuredEventProto>& events) { - AshEventStorage::events()->mutable_non_uma_events()->MergeFrom(events); + for (const auto& event : events) { + PersistentProto<EventsProto>* event_store = GetStoreToWriteEvent(event); + + if (event_store) { + *event_store->get()->add_non_uma_events() = event; + event_store->StartWrite(); + return; + } + + if (!is_initialized_) { + pre_storage_events_.emplace_back(event); + } + } +} + +void AshEventStorage::GetEvents(EventsProto* proto) { + if (IsPreUserStorageReadable() && + pre_user_events()->non_uma_events_size() > 0) { + proto->mutable_non_uma_events()->MergeFrom( + pre_user_events()->non_uma_events()); + } + if (IsProfileReady() && user_events()->non_uma_events_size() > 0) { + proto->mutable_non_uma_events()->MergeFrom(user_events()->non_uma_events()); + } } void AshEventStorage::OnWrite(const WriteStatus status) { @@ -113,4 +168,53 @@ OnReady(); } +void AshEventStorage::OnProfileRead(const ReadStatus status) { + DCHECK(base::CurrentUIThread::IsSet()); + + switch (status) { + case ReadStatus::kOk: + case ReadStatus::kMissing: + break; + case ReadStatus::kReadError: + LogInternalError(StructuredMetricsError::kEventReadError); + break; + case ReadStatus::kParseError: + LogInternalError(StructuredMetricsError::kEventParseError); + break; + } + + OnProfileReady(); +} + +void AshEventStorage::OnProfileReady() { + CHECK(user_events_.get()); + is_user_initialized_ = true; + + // Dealloc any memory that the vector is occupying as it will not be used + // anymore. + std::vector<StructuredEventProto>().swap(pre_storage_events_); +} + +bool AshEventStorage::IsProfileReady() const { + return is_user_initialized_ && user_events_.get(); +} + +bool AshEventStorage::IsPreUserStorageReadable() const { + return pre_user_events_ && is_initialized_; +} + +PersistentProto<EventsProto>* AshEventStorage::GetStoreToWriteEvent( + const StructuredEventProto& event) { + // If user storage is ready, all events should be stored in user event store + // regardless of the type. + if (IsProfileReady()) { + return user_events_.get(); + } + // Use the shared storage if user storage is not ready. + if (IsPreUserStorageReadable()) { + return pre_user_events_.get(); + } + return nullptr; +} + } // namespace metrics::structured
diff --git a/chrome/browser/metrics/structured/ash_event_storage.h b/chrome/browser/metrics/structured/ash_event_storage.h index ba1969b..d23ef34 100644 --- a/chrome/browser/metrics/structured/ash_event_storage.h +++ b/chrome/browser/metrics/structured/ash_event_storage.h
@@ -7,6 +7,7 @@ #include <memory> +#include "base/files/file_path.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "components/metrics/structured/event_storage.h" @@ -17,20 +18,21 @@ // Storage for Structured Metrics events on Ash. // -// Events are stored in a proto called EventsProto. It is persisted to disk in -// the user's cryptohome. This proto is not ready until a user has logged in. -// Events are stored in an in-memory vector until then. +// Events are stored in a proto called EventsProto. These events are flushed to +// disk on a cadence. Before a user has logged in, these events will be stored +// in the shared partition. The events after a user has logged in, events will +// be stored in the user cryptohome. class AshEventStorage : public EventStorage { public: // The delay period for the PersistentProto. constexpr static base::TimeDelta kSaveDelay = base::Seconds(1); - explicit AshEventStorage(base::TimeDelta write_delay); + AshEventStorage(base::TimeDelta write_delay, + const base::FilePath& pre_user_event_path); ~AshEventStorage() override; // EventStorage: - bool IsReady() override; void OnReady() override; void AddEvent(StructuredEventProto&& event) override; void MoveEvents(ChromeUserMetricsExtension& uma_proto) override; @@ -41,20 +43,41 @@ const google::protobuf::RepeatedPtrField<StructuredEventProto>& events) override; - EventsProto* events() { return events_->get(); } + // Populates |proto| with a copy of the events currently recorded across both + // |pre_user_events_| and |user_events_|. + void GetEvents(EventsProto* proto); private: void OnWrite(const WriteStatus status); void OnRead(const ReadStatus status); + void OnProfileRead(const ReadStatus status); + + EventsProto* pre_user_events() { return pre_user_events_->get(); } + EventsProto* user_events() { return user_events_->get(); } + + // Retrieves the approproiate event store to write the event. Returns nullptr + // if there is no appropriate place to persist the event. + PersistentProto<EventsProto>* GetStoreToWriteEvent( + const StructuredEventProto& event); + + // Callback to be made when profile event storage is ready to record. + void OnProfileReady(); + + bool IsProfileReady() const; + bool IsPreUserStorageReadable() const; bool is_initialized_ = false; + bool is_user_initialized_ = false; // Delay period for PersistentProto writes. Default value of 1000 ms used if // not specified in ctor. base::TimeDelta write_delay_; + // Events captured before a user has logged in. + std::unique_ptr<PersistentProto<EventsProto>> pre_user_events_; + // On-device storage within the user's cryptohome for unsent logs. - std::unique_ptr<PersistentProto<EventsProto>> events_; + std::unique_ptr<PersistentProto<EventsProto>> user_events_; // Storage for events to be stored if they are recorded before the storage is // ready. Should never be used once `OnReady` is called.
diff --git a/chrome/browser/metrics/structured/ash_event_storage_unittest.cc b/chrome/browser/metrics/structured/ash_event_storage_unittest.cc index 45dedce3..bd30680 100644 --- a/chrome/browser/metrics/structured/ash_event_storage_unittest.cc +++ b/chrome/browser/metrics/structured/ash_event_storage_unittest.cc
@@ -38,12 +38,25 @@ void Wait() { task_environment_.RunUntilIdle(); } - base::FilePath GetUserDirectory() { return temp_dir_.GetPath(); } + base::FilePath GetTestDirectory() { return temp_dir_.GetPath(); } + base::FilePath GetUserDirectory() { + return temp_dir_.GetPath() + .Append(FILE_PATH_LITERAL("structured_metrics")) + .Append(FILE_PATH_LITERAL("user")); + } - StructuredDataProto GetReport(AshEventStorage& storage) { + std::unique_ptr<AshEventStorage> BuildTestStorage() { + return std::make_unique<AshEventStorage>( + /*write_delay=*/base::Seconds(0), + GetTestDirectory() + .Append(FILE_PATH_LITERAL("structured_metrics")) + .Append(FILE_PATH_LITERAL("events"))); + } + + StructuredDataProto GetReport(AshEventStorage* storage) { ChromeUserMetricsExtension uma; - storage.MoveEvents(uma); + storage->MoveEvents(uma); return uma.structured_data(); } @@ -64,59 +77,65 @@ }; TEST_F(AshEventStorageTest, StoreAndProvideEvents) { - AshEventStorage storage(/*write_delay=*/base::Seconds(0)); - storage.OnProfileAdded(GetUserDirectory()); + std::unique_ptr<AshEventStorage> storage = BuildTestStorage(); + storage->OnProfileAdded(GetUserDirectory()); Wait(); - ASSERT_TRUE(storage.IsReady()); + ASSERT_TRUE(storage->IsReady()); - storage.AddEvent(BuildTestEvent()); - EXPECT_EQ(storage.events()->non_uma_events_size(), 1); + storage->AddEvent(BuildTestEvent()); - StructuredDataProto proto = GetReport(storage); + EventsProto events; + storage->GetEvents(&events); + EXPECT_EQ(events.non_uma_events_size(), 1); + StructuredDataProto proto = GetReport(storage.get()); EXPECT_EQ(proto.events_size(), 1); - EXPECT_EQ(storage.events()->non_uma_events_size(), 0); + + // Storage should have no events after a successful dump. + events.Clear(); + storage->GetEvents(&events); + EXPECT_EQ(events.non_uma_events_size(), 0); ExpectNoErrors(); } TEST_F(AshEventStorageTest, PreRecordedEventsProcessedCorrectly) { - AshEventStorage storage(/*write_delay=*/base::Seconds(0)); - - storage.AddEvent(BuildTestEvent()); + std::unique_ptr<AshEventStorage> storage = BuildTestStorage(); + storage->AddEvent(BuildTestEvent()); // Add Profile and wait for the storage to be ready. - storage.OnProfileAdded(GetUserDirectory()); + storage->OnProfileAdded(GetUserDirectory()); Wait(); - ASSERT_TRUE(storage.IsReady()); + ASSERT_TRUE(storage->IsReady()); - // The proto should not be stored in the proto. - EXPECT_EQ(storage.events()->non_uma_events_size(), 1); + EventsProto events; + storage->GetEvents(&events); + EXPECT_EQ(events.non_uma_events_size(), 1); ExpectNoErrors(); } TEST_F(AshEventStorageTest, EventsClearedAfterReport) { - AshEventStorage storage(/*write_delay=*/base::Seconds(0)); - storage.OnProfileAdded(GetUserDirectory()); + std::unique_ptr<AshEventStorage> storage = BuildTestStorage(); + storage->OnProfileAdded(GetUserDirectory()); Wait(); - storage.AddEvent(BuildTestEvent()); - storage.AddEvent(BuildTestEvent()); + storage->AddEvent(BuildTestEvent()); + storage->AddEvent(BuildTestEvent()); // Should provide both the previous events. - EXPECT_EQ(GetReport(storage).events_size(), 2); + EXPECT_EQ(GetReport(storage.get()).events_size(), 2); // But the previous events shouldn't appear in the second report. - EXPECT_EQ(GetReport(storage).events_size(), 0); + EXPECT_EQ(GetReport(storage.get()).events_size(), 0); - storage.AddEvent(BuildTestEvent()); + storage->AddEvent(BuildTestEvent()); // The third request should only contain the third event. - EXPECT_EQ(GetReport(storage).events_size(), 1); + EXPECT_EQ(GetReport(storage.get()).events_size(), 1); ExpectNoErrors(); } @@ -125,8 +144,7 @@ // uploaded in the first report from a subsequent session. TEST_F(AshEventStorageTest, EventsFromPreviousSessionAreLoaded) { // Start first session and record one event. - std::unique_ptr<AshEventStorage> storage = - std::make_unique<AshEventStorage>(/*write_delay=*/base::Seconds(0)); + std::unique_ptr<AshEventStorage> storage = BuildTestStorage(); storage->OnProfileAdded(GetUserDirectory()); Wait(); @@ -136,13 +154,12 @@ storage.reset(); Wait(); - storage = std::make_unique<AshEventStorage>(/*write_delay=*/base::Seconds(0)); - + storage = BuildTestStorage(); storage->OnProfileAdded(GetUserDirectory()); Wait(); // Start a second session and ensure the event is reported. - const auto data = GetReport(*storage); + const auto data = GetReport(storage.get()); ASSERT_EQ(data.events_size(), 1); ASSERT_EQ(data.events(0).metrics_size(), 1); EXPECT_EQ(data.events(0).metrics(0).value_int64(), 1234); @@ -150,4 +167,31 @@ ExpectNoErrors(); } +TEST_F(AshEventStorageTest, EventsPreProfilePersistedCorrectly) { + std::unique_ptr<AshEventStorage> storage = BuildTestStorage(); + Wait(); + + // Add event before OnProfileAdded is called. + storage->AddEvent(BuildTestEvent()); + ASSERT_TRUE(storage->IsReady()); + + // Ensure that the event is persisted. + EventsProto events; + storage->GetEvents(&events); + EXPECT_EQ(events.non_uma_events_size(), 1); + ExpectNoErrors(); + + storage->OnProfileAdded(GetUserDirectory()); + Wait(); + + // Add another event OnProfileAdded is called. + storage->AddEvent(BuildTestEvent()); + + // Ensure that both events are in the report. + const auto data = GetReport(storage.get()); + ASSERT_EQ(data.events_size(), 2); + + ExpectNoErrors(); +} + } // namespace metrics::structured
diff --git a/chrome/browser/metrics/structured/chrome_structured_metrics_recorder.cc b/chrome/browser/metrics/structured/chrome_structured_metrics_recorder.cc index 2dd2837..df4b80dc 100644 --- a/chrome/browser/metrics/structured/chrome_structured_metrics_recorder.cc +++ b/chrome/browser/metrics/structured/chrome_structured_metrics_recorder.cc
@@ -13,7 +13,7 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) #include "chrome/browser/ash/login/startup_utils.h" -#include "chrome/browser/browser_process.h" // nogncheck +#include "chrome/browser/browser_process.h" // nogncheck #include "chrome/browser/metrics/structured/ash_event_storage.h" // nogncheck #include "chrome/browser/metrics/structured/ash_structured_metrics_delegate.h" // nogncheck #include "chrome/browser/metrics/structured/cros_events_processor.h" // nogncheck @@ -45,6 +45,12 @@ .Record(); } +#if BUILDFLAG(IS_CHROMEOS_ASH) +// The path used to store events before the start of a user session. +constexpr char kAshPreUserStorePath[] = + "/var/lib/metrics/structured/chromium/events"; +#endif + } // namespace ChromeStructuredMetricsRecorder::ChromeStructuredMetricsRecorder() { @@ -99,8 +105,8 @@ // Initialize the key data provider and event storage. service->recorder()->InitializeKeyDataProvider( std::make_unique<KeyDataProviderAsh>()); - service->recorder()->InitializeEventStorage( - std::make_unique<AshEventStorage>(AshEventStorage::kSaveDelay)); + service->recorder()->InitializeEventStorage(std::make_unique<AshEventStorage>( + AshEventStorage::kSaveDelay, base::FilePath(kAshPreUserStorePath))); Recorder::GetInstance()->AddEventsProcessor( std::make_unique<MetadataProcessorAsh>());
diff --git a/chrome/browser/metrics/structured/key_data_provider_ash.cc b/chrome/browser/metrics/structured/key_data_provider_ash.cc index 5a042013..69eb629 100644 --- a/chrome/browser/metrics/structured/key_data_provider_ash.cc +++ b/chrome/browser/metrics/structured/key_data_provider_ash.cc
@@ -54,9 +54,10 @@ KeyData* KeyDataProviderAsh::GetKeyData(const std::string& project_name) { auto* key_data_provider = GetKeyDataProvider(project_name); - if (!key_data_provider) { + if (!key_data_provider || !key_data_provider->IsReady()) { return nullptr; } + return key_data_provider->GetKeyData(project_name); }
diff --git a/chrome/browser/metrics/variations/variations_http_headers_browsertest.cc b/chrome/browser/metrics/variations/variations_http_headers_browsertest.cc index 8f0aa45..1cca3cb 100644 --- a/chrome/browser/metrics/variations/variations_http_headers_browsertest.cc +++ b/chrome/browser/metrics/variations/variations_http_headers_browsertest.cc
@@ -783,7 +783,7 @@ partition->GetURLLoaderFactoryForBrowserProcess().get(); content::SimpleURLLoaderTestHelper loader_helper; loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory, loader_helper.GetCallback()); + loader_factory, loader_helper.GetCallbackDeprecated()); // Wait for the response to complete. loader_helper.WaitForCallback(); @@ -815,7 +815,7 @@ .get(); content::SimpleURLLoaderTestHelper loader_helper; loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory, loader_helper.GetCallback()); + loader_factory, loader_helper.GetCallbackDeprecated()); // Wait for the response to complete. loader_helper.WaitForCallback();
diff --git a/chrome/browser/net/network_context_configuration_browsertest.cc b/chrome/browser/net/network_context_configuration_browsertest.cc index c0846d40..323805e 100644 --- a/chrome/browser/net/network_context_configuration_browsertest.cc +++ b/chrome/browser/net/network_context_configuration_browsertest.cc
@@ -513,7 +513,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); if (expect_success) { @@ -538,8 +538,8 @@ live_during_shutdown_simple_loader_ ->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), - live_during_shutdown_simple_loader_helper_->GetCallback()); + loader_factory(), live_during_shutdown_simple_loader_helper_ + ->GetCallbackDeprecated()); // Don't actually care about controlling the response, just need to wait // until it sees the request, to make sure that a URLRequest has been @@ -567,7 +567,7 @@ network::SimpleURLLoader::Create(std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); if (simple_loader_helper.response_body()) { *header_value_out = *simple_loader_helper.response_body(); @@ -607,7 +607,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); EXPECT_EQ(net::OK, simple_loader->NetError()); } @@ -786,7 +786,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); EXPECT_EQ(200, simple_loader->ResponseInfo()->headers->response_code()); @@ -875,7 +875,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); ASSERT_TRUE(simple_loader->ResponseInfo()); @@ -915,7 +915,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); ASSERT_TRUE(simple_loader_helper.response_body()); @@ -937,7 +937,7 @@ network::SimpleURLLoader::Create(std::move(request2), TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader2->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper2.GetCallback()); + loader_factory(), simple_loader_helper2.GetCallbackDeprecated()); simple_loader_helper2.WaitForCallback(); ASSERT_TRUE(simple_loader_helper2.response_body()); if (GetHttpCacheType() == StorageType::kNone) { @@ -967,7 +967,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); ASSERT_TRUE(simple_loader_helper.response_body()); @@ -989,7 +989,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader2->DownloadToStringOfUnboundedSizeUntilCrashAndDie( GetLoaderFactoryForContextType(network_context_type), - simple_loader_helper2.GetCallback()); + simple_loader_helper2.GetCallbackDeprecated()); simple_loader_helper2.WaitForCallback(); EXPECT_FALSE(simple_loader_helper2.response_body()); EXPECT_EQ(net::ERR_CONNECTION_REFUSED, simple_loader2->NetError()); @@ -1027,7 +1027,7 @@ network::SimpleURLLoader::Create(std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); EXPECT_EQ(net::OK, simple_loader->NetError()); @@ -1093,7 +1093,7 @@ network::SimpleURLLoader::Create(std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); // The request should only succeed if there is an on-disk cache. @@ -1184,7 +1184,7 @@ network::SimpleURLLoader::Create(std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); EXPECT_EQ(net::OK, simple_loader->NetError()); @@ -1209,7 +1209,7 @@ simple_loader = network::SimpleURLLoader::Create( std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper2.GetCallback()); + loader_factory(), simple_loader_helper2.GetCallbackDeprecated()); simple_loader_helper2.WaitForCallback(); EXPECT_FALSE(simple_loader_helper2.response_body()); EXPECT_EQ(exected_ssl_url, simple_loader->GetFinalURL()); @@ -1256,7 +1256,7 @@ network::SimpleURLLoader::Create(std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); EXPECT_FALSE(simple_loader_helper.response_body()); @@ -1444,7 +1444,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); if (GetParam().network_context_type == NetworkContextType::kSafeBrowsing) { // Safebrowsing ignores referrers so the requests succeed. @@ -1654,7 +1654,7 @@ simple_loader->AttachFileForUpload(path, "text/html"); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); ASSERT_TRUE(simple_loader->ResponseInfo()); @@ -1699,7 +1699,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); EXPECT_EQ(net::OK, simple_loader->NetError()); @@ -1926,7 +1926,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); loaders.emplace_back(std::move(simple_loader)); } expected_connections_run_loop.Run(); @@ -2046,7 +2046,7 @@ request_state->loader = network::SimpleURLLoader::Create( std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); request_state->loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), request_state->helper.GetCallback()); + loader_factory(), request_state->helper.GetCallbackDeprecated()); return request_state; }
diff --git a/chrome/browser/net/profile_network_context_service_browsertest.cc b/chrome/browser/net/profile_network_context_service_browsertest.cc index 831c0d8..591a97c 100644 --- a/chrome/browser/net/profile_network_context_service_browsertest.cc +++ b/chrome/browser/net/profile_network_context_service_browsertest.cc
@@ -155,7 +155,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); ASSERT_TRUE(simple_loader_helper.response_body()); @@ -237,7 +237,7 @@ network::SimpleURLLoader::Create(std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); ASSERT_TRUE(simple_loader_helper.response_body()); std::vector<std::string> encodings = @@ -647,7 +647,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); + loader_factory(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); ASSERT_TRUE(simple_loader_helper.response_body()); @@ -746,8 +746,7 @@ network::features::kTrustTokenOperationsRequiringOriginTrial; feature_list_.InitWithFeaturesAndParameters( // Enabled Features: - {{privacy_sandbox::kPrivacySandboxSettings3, {}}, - {network::features::kPrivateStateTokens, + {{network::features::kPrivateStateTokens, {{field_trial_param.name, field_trial_param.GetName( network::features::TrustTokenOriginTrialSpec::
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 595a0b27..d22a485 100644 --- a/chrome/browser/policy/messaging_layer/upload/record_handler_impl.cc +++ b/chrome/browser/policy/messaging_layer/upload/record_handler_impl.cc
@@ -40,6 +40,7 @@ #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/record_upload_request_json_keys.h" #include "components/reporting/util/status.h" #include "components/reporting/util/status_macros.h" #include "components/reporting/util/statusor.h" @@ -309,11 +310,11 @@ RecordHandlerImpl::SequenceInformationValueToProto( const base::Value::Dict& value) { const std::string* sequencing_id = - value.FindString(UploadEncryptedReportingRequestBuilder::kSequencingId); + value.FindString(reporting::json_keys::kSequencingIdKey); const std::string* generation_id = - value.FindString(UploadEncryptedReportingRequestBuilder::kGenerationId); + value.FindString(reporting::json_keys::kGenerationIdKey); const std::string* generation_guid = - value.FindString(UploadEncryptedReportingRequestBuilder::kGenerationGuid); + value.FindString(json_keys::kGenerationGuidKey); const auto priority_result = GetPriorityProtoFromSequenceInformationValue(value); // If required sequence info fields don't exist, or are malformed,
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 3a262a7..fe6f44bb 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
@@ -16,37 +16,11 @@ #include "build/build_config.h" #include "chrome/browser/enterprise/browser_management/management_service_factory.h" #include "components/reporting/proto/synced/record.pb.h" +#include "components/reporting/util/record_upload_request_json_keys.h" #include "content/public/browser/browser_thread.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace reporting { - -namespace { - -// UploadEncryptedReportingRequestBuilder list key -constexpr char kEncryptedRecordListKey[] = "encryptedRecord"; -constexpr char kAttachEncryptionSettingsKey[] = "attachEncryptionSettings"; -constexpr std::string_view kConfigurationFileVersion = - "configurationFileVersion"; -constexpr char kSourcePath[] = "source"; - -// EncryptedRecordDictionaryBuilder strings -constexpr char kEncryptedWrappedRecord[] = "encryptedWrappedRecord"; -constexpr char kSequenceInformationKey[] = "sequenceInformation"; -constexpr char kEncryptionInfoKey[] = "encryptionInfo"; -constexpr char kCompressionInformationKey[] = "compressionInformation"; - -// SequenceInformationDictionaryBuilder strings located in header file. - -// EncryptionInfoDictionaryBuilder strings -constexpr char kEncryptionKey[] = "encryptionKey"; -constexpr char kPublicKeyId[] = "publicKeyId"; - -// CompressionInformationDictionaryBuilder strings -constexpr char kCompressionAlgorithmKey[] = "compressionAlgorithm"; - -} // namespace - // Feature that controls if the configuration file should be requested // from the server. BASE_FEATURE(kShouldRequestConfigurationFile, @@ -121,7 +95,7 @@ return *this; } - result_->Set(UploadEncryptedReportingRequestBuilder::kRequestId, request_id); + result_->Set(reporting::json_keys::kRequestIdKey, request_id); return *this; } @@ -131,12 +105,10 @@ // Ensure that if result_ has value, then it must not have a non-string // requestId. CHECK(!(result_.has_value() && - result_->Find(UploadEncryptedReportingRequestBuilder::kRequestId) && - !result_->FindString( - UploadEncryptedReportingRequestBuilder::kRequestId))); + result_->Find(reporting::json_keys::kRequestIdKey) && + !result_->FindString(reporting::json_keys::kRequestIdKey))); if (result_.has_value() && - result_->FindString(UploadEncryptedReportingRequestBuilder::kRequestId) == - nullptr) { + result_->FindString(reporting::json_keys::kRequestIdKey) == nullptr) { SetRequestId(base::Token::CreateRandom().ToString()); } return std::move(result_); @@ -145,24 +117,24 @@ // static std::string_view UploadEncryptedReportingRequestBuilder::GetEncryptedRecordListPath() { - return kEncryptedRecordListKey; + return reporting::json_keys::kEncryptedRecordListKey; } // static std::string_view UploadEncryptedReportingRequestBuilder::GetAttachEncryptionSettingsPath() { - return kAttachEncryptionSettingsKey; + return reporting::json_keys::kAttachEncryptionSettingsKey; } // static std::string_view UploadEncryptedReportingRequestBuilder::GetConfigurationFileVersionPath() { - return kConfigurationFileVersion; + return reporting::json_keys::kConfigurationFileVersionKey; } // static std::string_view UploadEncryptedReportingRequestBuilder::GetSourcePath() { - return kSourcePath; + return reporting::json_keys::kSourceKey; } EncryptedRecordDictionaryBuilder::EncryptedRecordDictionaryBuilder( @@ -243,24 +215,24 @@ // static std::string_view EncryptedRecordDictionaryBuilder::GetEncryptedWrappedRecordPath() { - return kEncryptedWrappedRecord; + return json_keys::kEncryptedWrappedRecordKey; } // static std::string_view EncryptedRecordDictionaryBuilder::GetSequenceInformationKeyPath() { - return kSequenceInformationKey; + return reporting::json_keys::kSequenceInformationKey; } // static std::string_view EncryptedRecordDictionaryBuilder::GetEncryptionInfoPath() { - return kEncryptionInfoKey; + return json_keys::kEncryptionInfoKey; } // static std::string_view EncryptedRecordDictionaryBuilder::GetCompressionInformationPath() { - return kCompressionInformationKey; + return json_keys::kCompressionInformationKey; } SequenceInformationDictionaryBuilder::SequenceInformationDictionaryBuilder( @@ -302,23 +274,23 @@ // static std::string_view SequenceInformationDictionaryBuilder::GetSequencingIdPath() { - return UploadEncryptedReportingRequestBuilder::kSequencingId; + return reporting::json_keys::kSequencingIdKey; } // static std::string_view SequenceInformationDictionaryBuilder::GetGenerationIdPath() { - return UploadEncryptedReportingRequestBuilder::kGenerationId; + return reporting::json_keys::kGenerationIdKey; } // static std::string_view SequenceInformationDictionaryBuilder::GetPriorityPath() { - return UploadEncryptedReportingRequestBuilder::kPriority; + return reporting::json_keys::kPriorityKey; } #if BUILDFLAG(IS_CHROMEOS) // static std::string_view SequenceInformationDictionaryBuilder::GetGenerationGuidPath() { - return UploadEncryptedReportingRequestBuilder::kGenerationGuid; + return json_keys::kGenerationGuidKey; } // static @@ -361,12 +333,12 @@ // static std::string_view EncryptionInfoDictionaryBuilder::GetEncryptionKeyPath() { - return kEncryptionKey; + return json_keys::kEncryptionKey; } // static std::string_view EncryptionInfoDictionaryBuilder::GetPublicKeyIdPath() { - return kPublicKeyId; + return json_keys::kPublicKeyId; } CompressionInformationDictionaryBuilder:: @@ -397,7 +369,7 @@ // static std::string_view CompressionInformationDictionaryBuilder::GetCompressionAlgorithmPath() { - return kCompressionAlgorithmKey; + return json_keys::kCompressionAlgorithmKey; } } // namespace reporting
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 3ee9a37..b8963f7 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
@@ -98,15 +98,6 @@ class UploadEncryptedReportingRequestBuilder { public: - // SequenceInformationDictionaryBuilder strings - static constexpr char kSequencingId[] = "sequencingId"; - static constexpr char kGenerationId[] = "generationId"; - static constexpr char kPriority[] = "priority"; - static constexpr char kGenerationGuid[] = "generationGuid"; - - // RequestId key used to build UploadEncryptedReportingRequest - static constexpr char kRequestId[] = "requestId"; - // The default values signal the server that it shouldn't attach the // encryption settings and that the config_file_version hasn't been set by // `RecordHandlerImpl`.
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 26ed291..cde9e55a 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
@@ -20,6 +20,7 @@ #include "components/policy/core/common/management/management_service.h" #include "components/policy/core/common/management/scoped_management_service_override_for_testing.h" #include "components/reporting/resources/resource_manager.h" +#include "components/reporting/util/record_upload_request_json_keys.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" @@ -325,8 +326,8 @@ ASSERT_TRUE(request_payload.has_value()); EXPECT_THAT(request_payload.value(), IsEncryptionKeyRequestUploadRequestValid(need_encryption_key())); - auto* payload_request_id = request_payload->FindString( - UploadEncryptedReportingRequestBuilder::kRequestId); + auto* payload_request_id = + request_payload->FindString(reporting::json_keys::kRequestIdKey); EXPECT_THAT(*payload_request_id, ::testing::StrEq(request_id)); }
diff --git a/chrome/browser/predictors/loading_predictor_browsertest.cc b/chrome/browser/predictors/loading_predictor_browsertest.cc index 7774cac..49f1b52 100644 --- a/chrome/browser/predictors/loading_predictor_browsertest.cc +++ b/chrome/browser/predictors/loading_predictor_browsertest.cc
@@ -1079,7 +1079,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( browser()->profile()->GetURLLoaderFactory().get(), - simple_loader_helper.GetCallback()); + simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); ASSERT_TRUE(simple_loader_helper.response_body()); if (url.IntPort() == embedded_test_server()->port()) { @@ -1298,7 +1298,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( browser()->profile()->GetURLLoaderFactory().get(), - simple_loader_helper.GetCallback()); + simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); ASSERT_TRUE(simple_loader_helper.response_body()); EXPECT_EQ(2u, connection_tracker()->GetAcceptedSocketCount());
diff --git a/chrome/browser/preloading/prefetch/search_prefetch/streaming_search_prefetch_url_loader.cc b/chrome/browser/preloading/prefetch/search_prefetch/streaming_search_prefetch_url_loader.cc index bdc4beb..b00ada7 100644 --- a/chrome/browser/preloading/prefetch/search_prefetch/streaming_search_prefetch_url_loader.cc +++ b/chrome/browser/preloading/prefetch/search_prefetch/streaming_search_prefetch_url_loader.cc
@@ -404,10 +404,13 @@ const network::ResourceRequest& resource_request, mojo::PendingReceiver<network::mojom::URLLoader> receiver, mojo::PendingRemote<network::mojom::URLLoaderClient> forwarding_client) { - DCHECK(!streaming_prefetch_request_); + CHECK(!streaming_prefetch_request_); // Bind to the content/ navigation code. - DCHECK(!receiver_.is_bound()); + CHECK(!receiver_.is_bound()); + + CHECK(!is_activated_); is_activated_ = true; + if (network_url_loader_) { network_url_loader_->SetPriority(resource_request.priority, -1); } @@ -434,10 +437,10 @@ return; } - // In the edge case we were between owners when fallback occurred, we need to - // resume the receiver. - if (is_in_fallback_) { - url_loader_receiver_.Resume(); + // In the edge case we were between owners when a response error happened, + // fallback was deferred until here. + if (is_scheduled_to_fallback_) { + Fallback(); } // Headers have not been received yet, we can forward the response if @@ -535,7 +538,15 @@ // kSearchPrefetchBlockBeforeHeaders enabled. DCHECK(navigation_prefetch_ || SearchPrefetchBlockBeforeHeadersIsEnabled()); - Fallback(); + + // SetUpForwardingClient() needs to be called before fallback. + if (is_activated_) { + Fallback(); + } else { + // Wait until SetUpForwardingClient() is called. + CHECK(!is_scheduled_to_fallback_); + is_scheduled_to_fallback_ = true; + } return; } DCHECK(streaming_prefetch_request_); @@ -895,12 +906,20 @@ } void StreamingSearchPrefetchURLLoader::Fallback() { - DCHECK(!is_in_fallback_); - DCHECK(navigation_prefetch_ || SearchPrefetchBlockBeforeHeadersIsEnabled()); + CHECK(navigation_prefetch_ || SearchPrefetchBlockBeforeHeadersIsEnabled()); + + is_scheduled_to_fallback_ = false; + + CHECK(!is_in_fallback_); + is_in_fallback_ = true; + + // SetUpForwardingClient() should be called before fallback. + CHECK(is_activated_); + CHECK(resource_request_); + CHECK(forwarding_client_); network_url_loader_.reset(); url_loader_receiver_.reset(); - is_in_fallback_ = true; // Create a network service URL loader with passed in params. url_loader_factory_->CreateLoaderAndStart( @@ -918,12 +937,6 @@ if (paused_) { network_url_loader_->PauseReadingBodyFromNet(); } - // Pause the url loader until we have a forwarding client, this should be - // rare, but can happen when the callback to this URL Loader is called at a - // later point than when it taken from the prefetch service. - if (!forwarding_client_) { - url_loader_receiver_.Pause(); - } } void StreamingSearchPrefetchURLLoader::OnURLLoaderMojoDisconnectInFallback() {
diff --git a/chrome/browser/preloading/prefetch/search_prefetch/streaming_search_prefetch_url_loader.h b/chrome/browser/preloading/prefetch/search_prefetch/streaming_search_prefetch_url_loader.h index f3f05ff..866d6c93 100644 --- a/chrome/browser/preloading/prefetch/search_prefetch/streaming_search_prefetch_url_loader.h +++ b/chrome/browser/preloading/prefetch/search_prefetch/streaming_search_prefetch_url_loader.h
@@ -431,6 +431,10 @@ // set up, we will delete soon |this|. bool pending_delete_ = false; + // Whether fallback should start when search prefetch is activated (i.e., when + // `is_activated_` is set). + bool is_scheduled_to_fallback_ = false; + // Whether fallback has started. bool is_in_fallback_ = false;
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridge.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridge.java index 7aea4dd4..a077092 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridge.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridge.java
@@ -111,6 +111,10 @@ PrivacySandboxBridgeJni.get().topicsToggleChanged(newValue); } + public static void setAllPrivacySandboxAllowedForTesting() { + PrivacySandboxBridgeJni.get().setAllPrivacySandboxAllowedForTesting(); // IN-TEST + } + @NativeMethods public interface Natives { boolean isPrivacySandboxEnabled(); @@ -132,5 +136,7 @@ int getRequiredPromptType(); void promptActionOccurred(int action); void topicsToggleChanged(boolean newValue); + + void setAllPrivacySandboxAllowedForTesting(); // IN-TEST } }
diff --git a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FakePrivacySandboxBridge.java b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FakePrivacySandboxBridge.java index d3da2ec3..57310bf7 100644 --- a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FakePrivacySandboxBridge.java +++ b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FakePrivacySandboxBridge.java
@@ -195,4 +195,7 @@ public boolean getLastTopicsToggleValue() { return mLastTopicsToggleValue; } + + @Override + public void setAllPrivacySandboxAllowedForTesting() {} }
diff --git a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridgeTest.java b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridgeTest.java index a35c141..6a437c4 100644 --- a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridgeTest.java +++ b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridgeTest.java
@@ -33,7 +33,7 @@ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags.Add({ ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, - "enable-features=PrivacySandboxSettings3:show-sample-data/true" + "enable-features=PrivacySandboxSettings4:show-sample-data/true" }) @Batch(Batch.PER_CLASS) public class PrivacySandboxBridgeTest { @@ -96,6 +96,7 @@ TestThreadUtils.runOnUiThreadBlocking( () -> { + PrivacySandboxBridge.setAllPrivacySandboxAllowedForTesting(); assertThat( PrivacySandboxBridge.getCurrentTopTopics(), contains(topic2, topic1)); assertThat(PrivacySandboxBridge.getBlockedTopics(), contains(topic3, topic4));
diff --git a/chrome/browser/privacy_sandbox/android/privacy_sandbox_bridge.cc b/chrome/browser/privacy_sandbox/android/privacy_sandbox_bridge.cc index 3df19a0..2479d4b 100644 --- a/chrome/browser/privacy_sandbox/android/privacy_sandbox_bridge.cc +++ b/chrome/browser/privacy_sandbox/android/privacy_sandbox_bridge.cc
@@ -15,6 +15,7 @@ #include "chrome/browser/privacy_sandbox/android/jni_headers/PrivacySandboxBridge_jni.h" #include "chrome/browser/privacy_sandbox/privacy_sandbox_service.h" #include "chrome/browser/privacy_sandbox/privacy_sandbox_service_factory.h" +#include "chrome/browser/privacy_sandbox/privacy_sandbox_settings_factory.h" #include "chrome/browser/profiles/profile_manager.h" #include "components/privacy_sandbox/canonical_topic.h" #include "components/privacy_sandbox/privacy_sandbox_settings.h" @@ -191,3 +192,11 @@ jboolean new_value) { GetPrivacySandboxService()->TopicsToggleChanged(new_value); } + +static void +JNI_PrivacySandboxBridge_SetAllPrivacySandboxAllowedForTesting( // IN-TEST + JNIEnv* env) { + PrivacySandboxSettingsFactory::GetForProfile( + ProfileManager::GetActiveUserProfile()) + ->SetAllPrivacySandboxAllowedForTesting(); // IN-TEST +}
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc index f6806b5..f464f87 100644 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc +++ b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc
@@ -329,47 +329,16 @@ PrivacySandboxServiceImpl::GetRequiredPromptType() { const auto third_party_cookies_blocked = AreThirdPartyCookiesBlocked(cookie_settings_.get()); - if (base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings4)) { - return GetRequiredPromptTypeInternalM1( - pref_service_, profile_type_, privacy_sandbox_settings_, - third_party_cookies_blocked, - force_chrome_build_for_tests_ || IsChromeBuild()); - } - return GetRequiredPromptTypeInternal(pref_service_, profile_type_, - privacy_sandbox_settings_, - third_party_cookies_blocked); + return GetRequiredPromptTypeInternal( + pref_service_, profile_type_, privacy_sandbox_settings_, + third_party_cookies_blocked, + force_chrome_build_for_tests_ || IsChromeBuild()); } void PrivacySandboxServiceImpl::PromptActionOccurred(PromptAction action) { RecordPromptActionMetrics(action); - if (base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings4)) { - PromptActionOccurredM1(action); - return; - } - InformSentimentService(action); - if (PromptAction::kNoticeShown == action && - PromptType::kNotice == GetRequiredPromptType()) { - // The Privacy Sandbox pref can be enabled when the notice has been - // shown. Note that a notice will not have been shown if the user - // disabled the old Privacy Sandbox pref. - pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabledV2, true); - pref_service_->SetBoolean(prefs::kPrivacySandboxNoticeDisplayed, true); - } else if (PromptAction::kConsentAccepted == action) { - pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabledV2, true); - pref_service_->SetBoolean(prefs::kPrivacySandboxConsentDecisionMade, true); - } else if (PromptAction::kConsentDeclined == action) { - pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabledV2, false); - pref_service_->SetBoolean(prefs::kPrivacySandboxConsentDecisionMade, true); - } -} - -void PrivacySandboxServiceImpl::PromptActionOccurredM1(PromptAction action) { - DCHECK( - base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings4)); - - InformSentimentServiceM1(action); if (PromptAction::kNoticeAcknowledge == action || PromptAction::kNoticeOpenSettings == action) { if (privacy_sandbox::kPrivacySandboxSettings4ConsentRequired.Get()) { @@ -640,84 +609,6 @@ base::UmaHistogramEnumeration("Settings.PrivacySandbox.Enabled", state); } -void PrivacySandboxServiceImpl::RecordPrivacySandbox3StartupMetrics() { - const std::string privacy_sandbox_startup_histogram = - "Settings.PrivacySandbox.StartupState"; - const bool sandbox_v2_enabled = - pref_service_->GetBoolean(prefs::kPrivacySandboxApisEnabledV2); - - // Handle PS V1 prefs disabled. - if (pref_service_->GetBoolean( - prefs::kPrivacySandboxNoConfirmationSandboxDisabled)) { - base::UmaHistogramEnumeration( - privacy_sandbox_startup_histogram, - sandbox_v2_enabled ? PSStartupStates::kPromptOffV1OffEnabled - : PSStartupStates::kPromptOffV1OffDisabled); - return; - } - // Handle 3PC disabled. - if (pref_service_->GetBoolean( - prefs::kPrivacySandboxNoConfirmationThirdPartyCookiesBlocked)) { - base::UmaHistogramEnumeration( - privacy_sandbox_startup_histogram, - sandbox_v2_enabled ? PSStartupStates::kPromptOff3PCOffEnabled - : PSStartupStates::kPromptOff3PCOffDisabled); - return; - } - // Handle managed. - if (pref_service_->GetBoolean( - prefs::kPrivacySandboxNoConfirmationSandboxManaged)) { - base::UmaHistogramEnumeration( - privacy_sandbox_startup_histogram, - sandbox_v2_enabled ? PSStartupStates::kPromptOffManagedEnabled - : PSStartupStates::kPromptOffManagedDisabled); - return; - } - // Handle restricted. - if (pref_service_->GetBoolean( - prefs::kPrivacySandboxNoConfirmationSandboxRestricted)) { - base::UmaHistogramEnumeration(privacy_sandbox_startup_histogram, - PSStartupStates::kPromptOffRestricted); - return; - } - // Handle manually controlled - if (pref_service_->GetBoolean( - prefs::kPrivacySandboxNoConfirmationManuallyControlled)) { - base::UmaHistogramEnumeration( - privacy_sandbox_startup_histogram, - sandbox_v2_enabled - ? PSStartupStates::kPromptOffManuallyControlledEnabled - : PSStartupStates::kPromptOffManuallyControlledDisabled); - return; - } - if (privacy_sandbox::kPrivacySandboxSettings3ConsentRequired.Get()) { - if (!pref_service_->GetBoolean(prefs::kPrivacySandboxConsentDecisionMade)) { - base::UmaHistogramEnumeration(privacy_sandbox_startup_histogram, - PSStartupStates::kPromptWaiting); - return; - } - base::UmaHistogramEnumeration(privacy_sandbox_startup_histogram, - sandbox_v2_enabled - ? PSStartupStates::kConsentShownEnabled - : PSStartupStates::kConsentShownDisabled); - } else if (privacy_sandbox::kPrivacySandboxSettings3NoticeRequired.Get()) { - if (!pref_service_->GetBoolean(prefs::kPrivacySandboxNoticeDisplayed)) { - base::UmaHistogramEnumeration(privacy_sandbox_startup_histogram, - PSStartupStates::kPromptWaiting); - return; - } - base::UmaHistogramEnumeration(privacy_sandbox_startup_histogram, - sandbox_v2_enabled - ? PSStartupStates::kNoticeShownEnabled - : PSStartupStates::kNoticeShownDisabled); - } else { // No prompt currently required. - base::UmaHistogramEnumeration( - privacy_sandbox_startup_histogram, - sandbox_v2_enabled ? PSStartupStates::kNoPromptRequiredEnabled - : PSStartupStates::kNoPromptRequiredDisabled); - } -} - void PrivacySandboxServiceImpl::RecordPrivacySandbox4StartupMetrics() { // Record the status of the APIs. const bool topics_enabled = @@ -927,69 +818,7 @@ } RecordFirstPartySetsStateHistogram(fps_status); - // Start by recording any metrics for Privacy Sandbox. - if (base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings4)) { - RecordPrivacySandbox4StartupMetrics(); - return; - } else { - RecordPrivacySandbox3StartupMetrics(); - } - - // Check policy status first. - std::string default_cookie_setting_provider; - auto default_cookie_setting = cookie_settings_->GetDefaultCookieSetting( - &default_cookie_setting_provider); - auto default_cookie_setting_source = - HostContentSettingsMap::GetSettingSourceFromProviderName( - default_cookie_setting_provider); - - if (default_cookie_setting_source == - content_settings::SettingSource::SETTING_SOURCE_POLICY && - default_cookie_setting == ContentSetting::CONTENT_SETTING_BLOCK) { - RecordPrivacySandboxHistogram( - SettingsPrivacySandboxEnabled::kPSDisabledPolicyBlockAll); - return; - } - - auto* cookie_controls_mode_pref = - pref_service_->FindPreference(prefs::kCookieControlsMode); - auto cookie_controls_mode_value = - static_cast<content_settings::CookieControlsMode>( - cookie_controls_mode_pref->GetValue()->GetInt()); - - if (cookie_controls_mode_pref->IsManaged() && - cookie_controls_mode_value == - content_settings::CookieControlsMode::kBlockThirdParty) { - RecordPrivacySandboxHistogram( - SettingsPrivacySandboxEnabled::kPSDisabledPolicyBlock3P); - return; - } - - if (privacy_sandbox_settings_->IsPrivacySandboxEnabled()) { - if (default_cookie_setting == ContentSetting::CONTENT_SETTING_BLOCK) { - RecordPrivacySandboxHistogram( - SettingsPrivacySandboxEnabled::kPSEnabledBlockAll); - } else if (cookie_controls_mode_value == - content_settings::CookieControlsMode::kBlockThirdParty) { - RecordPrivacySandboxHistogram( - SettingsPrivacySandboxEnabled::kPSEnabledBlock3P); - } else { - RecordPrivacySandboxHistogram( - SettingsPrivacySandboxEnabled::kPSEnabledAllowAll); - } - } else { - if (default_cookie_setting == ContentSetting::CONTENT_SETTING_BLOCK) { - RecordPrivacySandboxHistogram( - SettingsPrivacySandboxEnabled::kPSDisabledBlockAll); - } else if (cookie_controls_mode_value == - content_settings::CookieControlsMode::kBlockThirdParty) { - RecordPrivacySandboxHistogram( - SettingsPrivacySandboxEnabled::kPSDisabledBlock3P); - } else { - RecordPrivacySandboxHistogram( - SettingsPrivacySandboxEnabled::kPSDisabledAllowAll); - } - } + RecordPrivacySandbox4StartupMetrics(); } void PrivacySandboxServiceImpl::ConvertInterestGroupDataKeysForDisplay( @@ -1037,10 +866,8 @@ std::vector<privacy_sandbox::CanonicalTopic> PrivacySandboxServiceImpl::GetCurrentTopTopics() const { - if (privacy_sandbox::kPrivacySandboxSettings3ShowSampleDataForTesting.Get() || - (pref_service_->GetBoolean(prefs::kPrivacySandboxM1TopicsEnabled) && - privacy_sandbox::kPrivacySandboxSettings4ShowSampleDataForTesting - .Get())) { + if (pref_service_->GetBoolean(prefs::kPrivacySandboxM1TopicsEnabled) && + privacy_sandbox::kPrivacySandboxSettings4ShowSampleDataForTesting.Get()) { return {fake_current_topics_.begin(), fake_current_topics_.end()}; } @@ -1056,8 +883,7 @@ std::vector<privacy_sandbox::CanonicalTopic> PrivacySandboxServiceImpl::GetBlockedTopics() const { - if (privacy_sandbox::kPrivacySandboxSettings3ShowSampleDataForTesting.Get() || - privacy_sandbox::kPrivacySandboxSettings4ShowSampleDataForTesting.Get()) { + if (privacy_sandbox::kPrivacySandboxSettings4ShowSampleDataForTesting.Get()) { return {fake_blocked_topics_.begin(), fake_blocked_topics_.end()}; } @@ -1080,8 +906,7 @@ void PrivacySandboxServiceImpl::SetTopicAllowed( privacy_sandbox::CanonicalTopic topic, bool allowed) { - if (privacy_sandbox::kPrivacySandboxSettings3ShowSampleDataForTesting.Get() || - privacy_sandbox::kPrivacySandboxSettings4ShowSampleDataForTesting.Get()) { + if (privacy_sandbox::kPrivacySandboxSettings4ShowSampleDataForTesting.Get()) { if (allowed) { fake_current_topics_.insert(topic); fake_blocked_topics_.erase(topic); @@ -1135,201 +960,8 @@ PrefService* pref_service, profile_metrics::BrowserProfileType profile_type, privacy_sandbox::PrivacySandboxSettings* privacy_sandbox_settings, - bool third_party_cookies_blocked) { - DCHECK( - !base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings4)); - - // If the prompt is disabled for testing, never show it. - if (g_prompt_disabled_for_tests) { - return PromptType::kNone; - } - - // If the profile isn't a regular profile, no prompt should ever be shown. - if (!IsRegularProfile(profile_type)) { - return PromptType::kNone; - } - - // Forced testing feature parameters override everything. - if (base::FeatureList::IsEnabled( - privacy_sandbox::kDisablePrivacySandboxPrompts)) { - return PromptType::kNone; - } - - if (privacy_sandbox::kPrivacySandboxSettings3DisablePromptForTesting.Get()) { - return PromptType::kNone; - } - - if (privacy_sandbox::kPrivacySandboxSettings3ForceShowConsentForTesting - .Get()) { - return PromptType::kConsent; - } - - if (privacy_sandbox::kPrivacySandboxSettings3ForceShowNoticeForTesting - .Get()) { - return PromptType::kNotice; - } - - // If neither consent or notice is required, no prompt is required. - if (!privacy_sandbox::kPrivacySandboxSettings3ConsentRequired.Get() && - !privacy_sandbox::kPrivacySandboxSettings3NoticeRequired.Get()) { - return PromptType::kNone; - } - - // Only one of the consent or notice should be required by Finch parameters. - DCHECK(!privacy_sandbox::kPrivacySandboxSettings3ConsentRequired.Get() || - !privacy_sandbox::kPrivacySandboxSettings3NoticeRequired.Get()); - - // Start by checking for any previous decision about the prompt, such as - // it already having been shown, or not having been shown for some reason. - // These checks for previous decisions occur in advance of their corresponding - // decisions later in this function, so that changes to profile state to not - // appear to impact previous decisions. - - // If a user wasn't shown a confirmation because they previously turned the - // Privacy Sandbox off, we do not attempt to re-show one. - if (pref_service->GetBoolean( - prefs::kPrivacySandboxNoConfirmationSandboxDisabled)) { - return PromptType::kNone; - } - - // If a consent decision has already been made, no prompt is required. - if (pref_service->GetBoolean(prefs::kPrivacySandboxConsentDecisionMade)) { - return PromptType::kNone; - } - - // If only a notice is required, and has been shown, no prompt is required. - if (!privacy_sandbox::kPrivacySandboxSettings3ConsentRequired.Get() && - pref_service->GetBoolean(prefs::kPrivacySandboxNoticeDisplayed)) { - return PromptType::kNone; - } - - // If a user wasn't shown a confirmation because the sandbox was previously - // restricted, do not attempt to show them one. The user will be able to - // enable the Sandbox on the settings page. - if (pref_service->GetBoolean( - prefs::kPrivacySandboxNoConfirmationSandboxRestricted)) { - return PromptType::kNone; - } - - // If a user wasn't shown a prompt previously because the Privacy Sandbox - // was managed, do not show them one. - if (pref_service->GetBoolean( - prefs::kPrivacySandboxNoConfirmationSandboxManaged)) { - return PromptType::kNone; - } - - // If a user wasn't shown a confirmation because they block third party - // cookies, we do not attempt to re-show one. - if (pref_service->GetBoolean( - prefs::kPrivacySandboxNoConfirmationThirdPartyCookiesBlocked)) { - return PromptType::kNone; - } - - // If the user wasn't shown a confirmation because they are already manually - // controlling the sandbox, do not attempt to show one. - if (pref_service->GetBoolean( - prefs::kPrivacySandboxNoConfirmationManuallyControlled)) { - return PromptType::kNone; - } - - // If the Privacy Sandbox is restricted, no prompt is shown. - if (privacy_sandbox_settings->IsPrivacySandboxRestricted()) { - pref_service->SetBoolean( - prefs::kPrivacySandboxNoConfirmationSandboxRestricted, true); - return PromptType::kNone; - } - - // If the Privacy Sandbox is managed, no prompt is shown. - if (pref_service->FindPreference(prefs::kPrivacySandboxApisEnabledV2) - ->IsManaged()) { - pref_service->SetBoolean(prefs::kPrivacySandboxNoConfirmationSandboxManaged, - true); - return PromptType::kNone; - } - - // If the user blocks third party cookies, then no prompt is shown. - if (third_party_cookies_blocked) { - pref_service->SetBoolean( - prefs::kPrivacySandboxNoConfirmationThirdPartyCookiesBlocked, true); - return PromptType::kNone; - } - - // If the Privacy Sandbox has been manually controlled by the user, no prompt - // is shown. - if (pref_service->GetBoolean(prefs::kPrivacySandboxManuallyControlledV2)) { - pref_service->SetBoolean( - prefs::kPrivacySandboxNoConfirmationManuallyControlled, true); - return PromptType::kNone; - } - - // If a user now requires consent, but has previously seen a notice, whether - // a consent is shown depends on their current Privacy Sandbox setting. - if (privacy_sandbox::kPrivacySandboxSettings3ConsentRequired.Get() && - pref_service->GetBoolean(prefs::kPrivacySandboxNoticeDisplayed)) { - DCHECK( - !pref_service->GetBoolean(prefs::kPrivacySandboxConsentDecisionMade)); - - // As the user has not yet consented, the V2 pref must be disabled. - // However, this may not be the first time that this function is being - // called. The API for this service guarantees, and clients depend, on - // successive calls to this function returning the same value. Browser - // restarts & updates via PromptActionOccurred() notwithstanding. To achieve - // this, we need to distinguish between the case where the user themselves - // previously disabled the APIs, and when this logic disabled them - // previously due to having insufficient confirmation. - if (pref_service->GetBoolean(prefs::kPrivacySandboxApisEnabledV2)) { - pref_service->SetBoolean( - prefs::kPrivacySandboxDisabledInsufficientConfirmation, true); - pref_service->SetBoolean(prefs::kPrivacySandboxApisEnabledV2, false); - } - - if (pref_service->GetBoolean( - prefs::kPrivacySandboxDisabledInsufficientConfirmation)) { - return PromptType::kConsent; - } else { - DCHECK(!pref_service->GetBoolean(prefs::kPrivacySandboxApisEnabledV2)); - pref_service->SetBoolean( - prefs::kPrivacySandboxNoConfirmationSandboxDisabled, true); - return PromptType::kNone; - } - } - - // At this point, no previous decision should have been made. - DCHECK(!pref_service->GetBoolean( - prefs::kPrivacySandboxNoConfirmationSandboxDisabled)); - DCHECK(!pref_service->GetBoolean(prefs::kPrivacySandboxNoticeDisplayed)); - DCHECK(!pref_service->GetBoolean(prefs::kPrivacySandboxConsentDecisionMade)); - - // If the user had previously disabled the Privacy Sandbox, no confirmation - // will be shown. - if (!pref_service->GetBoolean(prefs::kPrivacySandboxApisEnabled)) { - pref_service->SetBoolean( - prefs::kPrivacySandboxNoConfirmationSandboxDisabled, true); - return PromptType::kNone; - } - - // Check if the users requires a consent. This information is provided by - // feature parameter to allow Finch based geo-targeting. - if (privacy_sandbox::kPrivacySandboxSettings3ConsentRequired.Get()) { - return PromptType::kConsent; - } - - // Finally a notice is required. - DCHECK(privacy_sandbox::kPrivacySandboxSettings3NoticeRequired.Get()); - return PromptType::kNotice; -} - -// static -PrivacySandboxService::PromptType -PrivacySandboxServiceImpl::GetRequiredPromptTypeInternalM1( - PrefService* pref_service, - profile_metrics::BrowserProfileType profile_type, - privacy_sandbox::PrivacySandboxSettings* privacy_sandbox_settings, bool third_party_cookies_blocked, bool is_chrome_build) { - DCHECK( - base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings4)); - // If the prompt is disabled for testing, never show it. if (g_prompt_disabled_for_tests) { return PromptType::kNone; @@ -1603,45 +1235,6 @@ switch (action) { case PromptAction::kNoticeOpenSettings: area = TrustSafetySentimentService::FeatureArea:: - kPrivacySandbox3NoticeSettings; - break; - case PromptAction::kNoticeAcknowledge: - area = TrustSafetySentimentService::FeatureArea::kPrivacySandbox3NoticeOk; - break; - case PromptAction::kNoticeDismiss: - area = TrustSafetySentimentService::FeatureArea:: - kPrivacySandbox3NoticeDismiss; - break; - case PromptAction::kNoticeLearnMore: - area = TrustSafetySentimentService::FeatureArea:: - kPrivacySandbox3NoticeLearnMore; - break; - case PromptAction::kConsentAccepted: - area = TrustSafetySentimentService::FeatureArea:: - kPrivacySandbox3ConsentAccept; - break; - case PromptAction::kConsentDeclined: - area = TrustSafetySentimentService::FeatureArea:: - kPrivacySandbox3ConsentDecline; - break; - default: - return; - } - - sentiment_service_->InteractedWithPrivacySandbox3(area); -#endif -} - -void PrivacySandboxServiceImpl::InformSentimentServiceM1(PromptAction action) { -#if !BUILDFLAG(IS_ANDROID) - if (!sentiment_service_) { - return; - } - - TrustSafetySentimentService::FeatureArea area; - switch (action) { - case PromptAction::kNoticeOpenSettings: - area = TrustSafetySentimentService::FeatureArea:: kPrivacySandbox4NoticeSettings; break; case PromptAction::kNoticeAcknowledge:
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.h b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.h index 69427787..367a095 100644 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.h +++ b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.h
@@ -162,18 +162,18 @@ FRIEND_TEST_ALL_PREFIXES(PrivacySandboxServiceTest, FirstPartySetsDisabledMetric); FRIEND_TEST_ALL_PREFIXES( - PrivacySandboxServiceM1Test, + PrivacySandboxServiceTest, RecordPrivacySandbox4StartupMetrics_PromptSuppressed_Explicitly); FRIEND_TEST_ALL_PREFIXES( - PrivacySandboxServiceM1Test, + PrivacySandboxServiceTest, RecordPrivacySandbox4StartupMetrics_PromptSuppressed_Implicitly); FRIEND_TEST_ALL_PREFIXES( - PrivacySandboxServiceM1Test, + PrivacySandboxServiceTest, RecordPrivacySandbox4StartupMetrics_PromptNotSuppressed_EEA); FRIEND_TEST_ALL_PREFIXES( - PrivacySandboxServiceM1Test, + PrivacySandboxServiceTest, RecordPrivacySandbox4StartupMetrics_PromptNotSuppressed_ROW); - FRIEND_TEST_ALL_PREFIXES(PrivacySandboxServiceM1Test, + FRIEND_TEST_ALL_PREFIXES(PrivacySandboxServiceTest, RecordPrivacySandbox4StartupMetrics_APIs); FRIEND_TEST_ALL_PREFIXES( PrivacySandboxServiceM1RestrictedNoticePromptTest, @@ -316,14 +316,6 @@ PrefService* pref_service, profile_metrics::BrowserProfileType profile_type, privacy_sandbox::PrivacySandboxSettings* privacy_sandbox_settings, - bool third_party_cookies_blocked); - - // Equivalent of PrivacySandboxService::GetRequiredPromptTypeInternal, but for - // PrivacySandboxSettings4. - static PrivacySandboxService::PromptType GetRequiredPromptTypeInternalM1( - PrefService* pref_service, - profile_metrics::BrowserProfileType profile_type, - privacy_sandbox::PrivacySandboxSettings* privacy_sandbox_settings, bool third_party_cookies_blocked, bool is_chrome_build); @@ -376,18 +368,10 @@ {browsing_topics::Topic(4), kFakeTaxonomyVersion}}; // Informs the TrustSafetySentimentService, if it exists, that a - // Privacy Sandbox 3 interaction for an area has occurred The area is + // Privacy Sandbox interaction for an area has occurred The area is // determined by |action|. Only a subset of actions has a corresponding area. void InformSentimentService(PrivacySandboxService::PromptAction action); - // Equivalent of PrivacySandboxService::InformSentimentService, but for - // PrivacySandboxSettings4. - void InformSentimentServiceM1(PrivacySandboxService::PromptAction action); - - // Implementation of PrivacySandboxService::PromptActionOccurred, but for - // PrivacySandboxSettings4. - virtual void PromptActionOccurredM1(PromptAction action); - // Record user action metrics based on the |action|. void RecordPromptActionMetrics(PrivacySandboxService::PromptAction action);
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl_unittest.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl_unittest.cc index d0f947b9..02db6b0 100644 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl_unittest.cc +++ b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl_unittest.cc
@@ -133,8 +133,6 @@ using privacy_sandbox_test_util::TestState; const char kFirstPartySetsStateHistogram[] = "Settings.FirstPartySets.State"; -const char kPrivacySandboxStartupHistogram[] = - "Settings.PrivacySandbox.StartupState"; const base::Version kFirstPartySetsVersion("1.2.3"); @@ -207,573 +205,6 @@ std::vector<InterestGroupDataKey> data_keys_; }; -struct PromptTestState { - bool consent_required; - bool old_api_pref; - bool new_api_pref; - bool notice_displayed; - bool consent_decision_made; - bool confirmation_not_shown; -}; - -struct ExpectedPromptOutput { - bool dcheck_failure; - PromptType prompt_type; - bool new_api_pref; -}; - -struct PromptTestCase { - PromptTestState test_setup; - ExpectedPromptOutput expected_output; -}; - -std::vector<PromptTestCase> kPromptTestCases = { - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNotice, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kConsent, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNotice, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kConsent, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kConsent, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kConsent, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/false}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/false, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/false, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/false}}, - - {{/*consent_required=*/false, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/false, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/false, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, - - {{/*consent_required=*/true, /*old_api_pref=*/true, - /*new_api_pref=*/true, - /*notice_displayed=*/true, /*consent_decision_made=*/true, - /*confirmation_not_shown=*/true}, - {/*dcheck_failure=*/false, - /*prompt_type=*/PromptType::kNone, - /*new_api_pref=*/true}}, -}; - -void SetupPromptTestState( - base::test::ScopedFeatureList* feature_list, - sync_preferences::TestingPrefServiceSyncable* pref_service, - const PromptTestState& test_state) { - feature_list->Reset(); - feature_list->InitWithFeaturesAndParameters( - {{privacy_sandbox::kPrivacySandboxSettings3, - {{"consent-required", test_state.consent_required ? "true" : "false"}, - {"notice-required", - !test_state.consent_required ? "true" : "false"}}}}, - {privacy_sandbox::kPrivacySandboxSettings4}); - - pref_service->SetUserPref( - prefs::kPrivacySandboxApisEnabled, - std::make_unique<base::Value>(test_state.old_api_pref)); - - pref_service->SetUserPref( - prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(test_state.new_api_pref)); - - pref_service->SetUserPref( - prefs::kPrivacySandboxNoticeDisplayed, - std::make_unique<base::Value>(test_state.notice_displayed)); - - pref_service->SetUserPref( - prefs::kPrivacySandboxConsentDecisionMade, - std::make_unique<base::Value>(test_state.consent_decision_made)); - - pref_service->SetUserPref( - prefs::kPrivacySandboxNoConfirmationSandboxDisabled, - std::make_unique<base::Value>(test_state.confirmation_not_shown)); -} - // Remove any user preference settings for First Party Set related preferences, // returning them to their default value. void ClearFpsUserPrefs( @@ -908,12 +339,7 @@ first_party_sets_policy_service_.ResetForTesting(); } - virtual void InitializeFeaturesBeforeStart() { - // Setup a default state that can be overridden using the inner scoped - // feature list by tests as required. - outer_feature_list_.InitAndDisableFeature( - privacy_sandbox::kPrivacySandboxSettings4); - } + virtual void InitializeFeaturesBeforeStart() {} virtual std::unique_ptr< privacy_sandbox_test_util::MockPrivacySandboxSettingsDelegate> @@ -952,10 +378,26 @@ return profile_metrics::BrowserProfileType::kRegular; } - void ConfirmRequiredPromptType(PromptType prompt_type) { - // The required prompt type should never change between successive calls to - // GetRequiredPromptType. - EXPECT_EQ(prompt_type, privacy_sandbox_service()->GetRequiredPromptType()); + void RunTestCase(const TestState& test_state, + const TestInput& test_input, + const TestOutput& test_output) { + auto user_provider = std::make_unique<content_settings::MockProvider>(); + auto* user_provider_raw = user_provider.get(); + auto managed_provider = std::make_unique<content_settings::MockProvider>(); + auto* managed_provider_raw = managed_provider.get(); + content_settings::TestUtils::OverrideProvider( + host_content_settings_map(), std::move(user_provider), + HostContentSettingsMap::PREF_PROVIDER); + content_settings::TestUtils::OverrideProvider( + host_content_settings_map(), std::move(managed_provider), + HostContentSettingsMap::POLICY_PROVIDER); + auto service_wrapper = TestPrivacySandboxService(privacy_sandbox_service()); + + privacy_sandbox_test_util::RunTestCase( + browser_task_environment(), prefs(), host_content_settings_map(), + mock_delegate(), mock_browsing_topics_service(), + privacy_sandbox_settings(), &service_wrapper, user_provider_raw, + managed_provider_raw, TestCase(test_state, test_input, test_output)); } TestingProfile* profile() { return &profile_; } @@ -1155,73 +597,12 @@ EXPECT_EQ(returned_sites[1], sites[2]); } -TEST_F(PrivacySandboxServiceTest, PromptActionUpdatesRequiredPrompt) { - // Confirm that when the service is informed a prompt action occurred, it - // correctly adjusts the required prompt type and Privacy Sandbox pref. - - // Consent accepted: - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/true, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - EXPECT_EQ(PromptType::kConsent, - privacy_sandbox_service()->GetRequiredPromptType()); - EXPECT_FALSE(prefs()->GetBoolean(prefs::kPrivacySandboxApisEnabledV2)); - - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kConsentAccepted); - - EXPECT_EQ(PromptType::kNone, - privacy_sandbox_service()->GetRequiredPromptType()); - EXPECT_TRUE(prefs()->GetBoolean(prefs::kPrivacySandboxApisEnabledV2)); - EXPECT_TRUE(prefs()->GetBoolean(prefs::kPrivacySandboxConsentDecisionMade)); - - // Consent declined: - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/true, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - EXPECT_EQ(PromptType::kConsent, - privacy_sandbox_service()->GetRequiredPromptType()); - EXPECT_FALSE(prefs()->GetBoolean(prefs::kPrivacySandboxApisEnabledV2)); - - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kConsentDeclined); - - EXPECT_EQ(PromptType::kNone, - privacy_sandbox_service()->GetRequiredPromptType()); - EXPECT_FALSE(prefs()->GetBoolean(prefs::kPrivacySandboxApisEnabledV2)); - EXPECT_TRUE(prefs()->GetBoolean(prefs::kPrivacySandboxConsentDecisionMade)); - - // Notice shown: - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/false, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - EXPECT_EQ(PromptType::kNotice, - privacy_sandbox_service()->GetRequiredPromptType()); - EXPECT_FALSE(prefs()->GetBoolean(prefs::kPrivacySandboxApisEnabledV2)); - - privacy_sandbox_service()->PromptActionOccurred(PromptAction::kNoticeShown); - - EXPECT_EQ(PromptType::kNone, - privacy_sandbox_service()->GetRequiredPromptType()); - EXPECT_TRUE(prefs()->GetBoolean(prefs::kPrivacySandboxApisEnabledV2)); - EXPECT_TRUE(prefs()->GetBoolean(prefs::kPrivacySandboxNoticeDisplayed)); -} - TEST_F(PrivacySandboxServiceTest, PromptActionsUMAActions) { base::UserActionTester user_action_tester; + feature_list()->Reset(); + feature_list()->InitAndEnableFeatureWithParameters( + privacy_sandbox::kPrivacySandboxSettings4, {{"notice-required", "true"}}); privacy_sandbox_service()->PromptActionOccurred(PromptAction::kNoticeShown); EXPECT_EQ(1, user_action_tester.GetActionCount( "Settings.PrivacySandbox.Notice.Shown")); @@ -1245,6 +626,36 @@ EXPECT_EQ(1, user_action_tester.GetActionCount( "Settings.PrivacySandbox.Notice.ClosedNoInteraction")); + privacy_sandbox_service()->PromptActionOccurred( + PromptAction::kNoticeLearnMore); + EXPECT_EQ(1, user_action_tester.GetActionCount( + "Settings.PrivacySandbox.Notice.LearnMore")); + + privacy_sandbox_service()->PromptActionOccurred( + PromptAction::kNoticeMoreInfoOpened); + EXPECT_EQ(1, user_action_tester.GetActionCount( + "Settings.PrivacySandbox.Notice.LearnMoreExpanded")); + + privacy_sandbox_service()->PromptActionOccurred( + PromptAction::kNoticeMoreInfoClosed); + EXPECT_EQ(1, user_action_tester.GetActionCount( + "Settings.PrivacySandbox.Notice.LearnMoreClosed")); + + privacy_sandbox_service()->PromptActionOccurred( + PromptAction::kConsentMoreButtonClicked); + EXPECT_EQ(1, user_action_tester.GetActionCount( + "Settings.PrivacySandbox.Consent.MoreButtonClicked")); + + privacy_sandbox_service()->PromptActionOccurred( + PromptAction::kNoticeMoreButtonClicked); + EXPECT_EQ(1, user_action_tester.GetActionCount( + "Settings.PrivacySandbox.Notice.MoreButtonClicked")); + + feature_list()->Reset(); + feature_list()->InitAndEnableFeatureWithParameters( + privacy_sandbox::kPrivacySandboxSettings4, + {{"consent-required", "true"}}); + privacy_sandbox_service()->PromptActionOccurred(PromptAction::kConsentShown); EXPECT_EQ(1, user_action_tester.GetActionCount( "Settings.PrivacySandbox.Consent.Shown")); @@ -1274,30 +685,10 @@ EXPECT_EQ(1, user_action_tester.GetActionCount( "Settings.PrivacySandbox.Consent.ClosedNoInteraction")); - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kNoticeLearnMore); - EXPECT_EQ(1, user_action_tester.GetActionCount( - "Settings.PrivacySandbox.Notice.LearnMore")); - - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kNoticeMoreInfoOpened); - EXPECT_EQ(1, user_action_tester.GetActionCount( - "Settings.PrivacySandbox.Notice.LearnMoreExpanded")); - - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kNoticeMoreInfoClosed); - EXPECT_EQ(1, user_action_tester.GetActionCount( - "Settings.PrivacySandbox.Notice.LearnMoreClosed")); - - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kConsentMoreButtonClicked); - EXPECT_EQ(1, user_action_tester.GetActionCount( - "Settings.PrivacySandbox.Consent.MoreButtonClicked")); - - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kNoticeMoreButtonClicked); - EXPECT_EQ(1, user_action_tester.GetActionCount( - "Settings.PrivacySandbox.Notice.MoreButtonClicked")); + feature_list()->Reset(); + feature_list()->InitAndEnableFeatureWithParameters( + privacy_sandbox::kPrivacySandboxSettings4, + {{"consent-required", "true"}, {"restricted-notice", "true"}}); privacy_sandbox_service()->PromptActionOccurred( PromptAction::kRestrictedNoticeOpenSettings); @@ -1327,205 +718,6 @@ "Settings.PrivacySandbox.RestrictedNotice.MoreButtonClicked")); } -#if !BUILDFLAG(IS_ANDROID) -TEST_F(PrivacySandboxServiceTest, PromptActionsSentimentService) { - { - EXPECT_CALL(*mock_sentiment_service(), - InteractedWithPrivacySandbox3(testing::_)) - .Times(0); - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/false, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - privacy_sandbox_service()->PromptActionOccurred(PromptAction::kNoticeShown); - } - { - EXPECT_CALL( - *mock_sentiment_service(), - InteractedWithPrivacySandbox3(TrustSafetySentimentService::FeatureArea:: - kPrivacySandbox3NoticeSettings)) - .Times(1); - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/false, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kNoticeOpenSettings); - } - { - EXPECT_CALL( - *mock_sentiment_service(), - InteractedWithPrivacySandbox3( - TrustSafetySentimentService::FeatureArea::kPrivacySandbox3NoticeOk)) - .Times(1); - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/false, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kNoticeAcknowledge); - } - { - EXPECT_CALL( - *mock_sentiment_service(), - InteractedWithPrivacySandbox3(TrustSafetySentimentService::FeatureArea:: - kPrivacySandbox3NoticeDismiss)) - .Times(1); - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/false, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kNoticeDismiss); - } - { - EXPECT_CALL(*mock_sentiment_service(), - InteractedWithPrivacySandbox3(testing::_)) - .Times(0); - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/false, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kNoticeClosedNoInteraction); - } - { - EXPECT_CALL( - *mock_sentiment_service(), - InteractedWithPrivacySandbox3(TrustSafetySentimentService::FeatureArea:: - kPrivacySandbox3NoticeLearnMore)) - .Times(1); - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/false, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kNoticeLearnMore); - } - { - EXPECT_CALL(*mock_sentiment_service(), - InteractedWithPrivacySandbox3(testing::_)) - .Times(0); - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/true, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kConsentShown); - } - { - EXPECT_CALL( - *mock_sentiment_service(), - InteractedWithPrivacySandbox3(TrustSafetySentimentService::FeatureArea:: - kPrivacySandbox3ConsentAccept)) - .Times(1); - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/true, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kConsentAccepted); - } - { - EXPECT_CALL( - *mock_sentiment_service(), - InteractedWithPrivacySandbox3(TrustSafetySentimentService::FeatureArea:: - kPrivacySandbox3ConsentDecline)) - .Times(1); - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/true, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kConsentDeclined); - } - { - EXPECT_CALL(*mock_sentiment_service(), - InteractedWithPrivacySandbox3(testing::_)) - .Times(0); - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/true, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kConsentMoreInfoOpened); - } - { - EXPECT_CALL(*mock_sentiment_service(), - InteractedWithPrivacySandbox3(testing::_)) - .Times(0); - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/true, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - privacy_sandbox_service()->PromptActionOccurred( - PromptAction::kConsentClosedNoDecision); - } -} -#endif - -TEST_F(PrivacySandboxServiceTest, Block3PCookieNoPrompt) { - // Confirm that when 3P cookies are blocked, that no prompt is shown. - prefs()->SetUserPref( - prefs::kCookieControlsMode, - std::make_unique<base::Value>(static_cast<int>( - content_settings::CookieControlsMode::kBlockThirdParty))); - EXPECT_EQ(PromptType::kNone, - privacy_sandbox_service()->GetRequiredPromptType()); - - // This should persist even if 3P cookies become allowed. - prefs()->SetUserPref(prefs::kCookieControlsMode, - std::make_unique<base::Value>(static_cast<int>( - content_settings::CookieControlsMode::kOff))); - EXPECT_EQ(PromptType::kNone, - privacy_sandbox_service()->GetRequiredPromptType()); -} - -TEST_F(PrivacySandboxServiceTest, BlockAllCookiesNoPrompt) { - // Confirm that when all cookies are blocked, that no prompt is shown. - cookie_settings()->SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); - EXPECT_EQ(PromptType::kNone, - privacy_sandbox_service()->GetRequiredPromptType()); - - // This should persist even if cookies become allowed. - cookie_settings()->SetDefaultCookieSetting(CONTENT_SETTING_ALLOW); - EXPECT_EQ(PromptType::kNone, - privacy_sandbox_service()->GetRequiredPromptType()); -} - TEST_F(PrivacySandboxServiceTest, FledgeBlockDeletesData) { // Allowing FLEDGE joining should not start a removal task. privacy_sandbox_service()->SetFledgeJoiningAllowed("example.com", true); @@ -1542,32 +734,6 @@ browsing_data_remover()->GetLastUsedOriginTypeMaskForTesting()); } -TEST_F(PrivacySandboxServiceTest, DisablingV2SandboxClearsData) { - // Confirm that when the V2 sandbox preference is disabled, a browsing data - // remover task is started and Topics Data is deleted. V1 should remain - // unaffected. - EXPECT_CALL(*mock_browsing_topics_service(), ClearAllTopicsData()).Times(0); - prefs()->SetBoolean(prefs::kPrivacySandboxApisEnabled, false); - constexpr uint64_t kNoRemovalTask = -1ull; - EXPECT_EQ(kNoRemovalTask, - browsing_data_remover()->GetLastUsedRemovalMaskForTesting()); - - // Enabling should not cause a removal task. - prefs()->SetBoolean(prefs::kPrivacySandboxApisEnabledV2, true); - EXPECT_EQ(kNoRemovalTask, - browsing_data_remover()->GetLastUsedRemovalMaskForTesting()); - - // Disabling should start a task clearing all kAPI information. - EXPECT_CALL(*mock_browsing_topics_service(), ClearAllTopicsData()).Times(1); - prefs()->SetBoolean(prefs::kPrivacySandboxApisEnabledV2, false); - EXPECT_EQ(content::BrowsingDataRemover::DATA_TYPE_PRIVACY_SANDBOX, - browsing_data_remover()->GetLastUsedRemovalMaskForTesting()); - EXPECT_EQ(base::Time::Min(), - browsing_data_remover()->GetLastUsedBeginTimeForTesting()); - EXPECT_EQ(content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB, - browsing_data_remover()->GetLastUsedOriginTypeMaskForTesting()); -} - TEST_F(PrivacySandboxServiceTest, DisablingTopicsPrefClearsData) { // Confirm that when the topics preference is disabled, topics data is // deleted. No browsing data remover tasks are started. @@ -1693,54 +859,6 @@ EXPECT_TRUE(privacy_sandbox_settings()->IsTopicAllowed(kTestTopic)); } -#if BUILDFLAG(IS_CHROMEOS) -TEST_F(PrivacySandboxServiceTest, DeviceLocalAccountUser) { -#if BUILDFLAG(IS_CHROMEOS_ASH) - user_manager::ScopedUserManager user_manager( - std::make_unique<user_manager::FakeUserManager>()); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) - - // No prompt should be shown if the user is associated with a device local - // account on CrOS. - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/true, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - // No prompt should be shown for a public session account. -#if BUILDFLAG(IS_CHROMEOS_ASH) - ash::ScopedTestPublicSessionLoginState login_state; -#elif BUILDFLAG(IS_CHROMEOS_LACROS) - crosapi::mojom::BrowserInitParamsPtr init_params = - crosapi::mojom::BrowserInitParams::New(); - init_params->session_type = crosapi::mojom::SessionType::kPublicSession; - chromeos::BrowserInitParams::SetInitParamsForTests(std::move(init_params)); -#endif - EXPECT_EQ(PromptType::kNone, - privacy_sandbox_service()->GetRequiredPromptType()); - - // A prompt should be shown for a regular user. -#if BUILDFLAG(IS_CHROMEOS_ASH) - ash::LoginState::Get()->SetLoggedInState( - ash::LoginState::LoggedInState::LOGGED_IN_ACTIVE, - ash::LoginState::LoggedInUserType::LOGGED_IN_USER_REGULAR); -#elif BUILDFLAG(IS_CHROMEOS_LACROS) - init_params = crosapi::mojom::BrowserInitParams::New(); - init_params->session_type = crosapi::mojom::SessionType::kRegularSession; - chromeos::BrowserInitParams::SetInitParamsForTests(std::move(init_params)); -#endif - EXPECT_EQ(PromptType::kConsent, - privacy_sandbox_service()->GetRequiredPromptType()); - - // No prompt should be shown for a web kiosk account. - chromeos::SetUpFakeKioskSession(); - EXPECT_EQ(PromptType::kNone, - privacy_sandbox_service()->GetRequiredPromptType()); -} -#endif // BUILDFLAG(IS_CHROMEOS) - TEST_F(PrivacySandboxServiceTest, TestNoFakeTopics) { auto* service = privacy_sandbox_service(); EXPECT_THAT(service->GetCurrentTopTopics(), testing::IsEmpty()); @@ -1770,9 +888,6 @@ TEST_F(PrivacySandboxServiceTest, TestFakeTopics) { std::vector<base::test::FeatureRefAndParams> test_features = { - {privacy_sandbox::kPrivacySandboxSettings3, - {{privacy_sandbox::kPrivacySandboxSettings3ShowSampleDataForTesting.name, - "true"}}}, {privacy_sandbox::kPrivacySandboxSettings4, {{privacy_sandbox::kPrivacySandboxSettings4ShowSampleDataForTesting.name, "true"}}}}; @@ -1814,31 +929,6 @@ } } -TEST_F(PrivacySandboxServiceTest, PrivacySandboxPromptNoticeWaiting) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, {{"notice-required", "true"}}); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationSandboxDisabled, - std::make_unique<base::Value>(false)); - prefs()->SetUserPref(prefs::kPrivacySandboxNoticeDisplayed, - std::make_unique<base::Value>(false)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/false, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kPromptWaiting, 1); -} - TEST_F(PrivacySandboxServiceTest, FirstPartySetsNotRelevantMetricAllowedCookies) { base::HistogramTester histogram_tester; @@ -1917,509 +1007,6 @@ PrivacySandboxServiceImpl::FirstPartySetsState::kFpsDisabled, 1); } -TEST_F(PrivacySandboxServiceTest, PrivacySandboxPromptConsentWaiting) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{"consent-required", "true" /* consent required */}}); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationSandboxDisabled, - std::make_unique<base::Value>(false)); - prefs()->SetUserPref(prefs::kPrivacySandboxConsentDecisionMade, - std::make_unique<base::Value>(false)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/false, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kPromptWaiting, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxV1OffDisabled) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{"consent-required", "false" /* consent required */}}); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationSandboxDisabled, - std::make_unique<base::Value>(true)); - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(false)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/false, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kPromptOffV1OffDisabled, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxV1OffEnabled) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{"consent-required", "false" /* consent required */}}); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationSandboxDisabled, - std::make_unique<base::Value>(true)); - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(true)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/true, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kPromptOffV1OffEnabled, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxRestricted) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{"consent-required", "false" /* consent required */}}); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationSandboxRestricted, - std::make_unique<base::Value>(true)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/false, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kPromptOffRestricted, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxManagedEnabled) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{"consent-required", "false" /* consent required */}}); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationSandboxManaged, - std::make_unique<base::Value>(true)); - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(true)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/true, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kPromptOffManagedEnabled, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxManagedDisabled) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{"consent-required", "false" /* consent required */}}); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationSandboxManaged, - std::make_unique<base::Value>(true)); - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(false)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/false, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kPromptOffManagedDisabled, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandbox3PCOffEnabled) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{"consent-required", "false" /* consent required */}}); - prefs()->SetUserPref( - prefs::kPrivacySandboxNoConfirmationThirdPartyCookiesBlocked, - std::make_unique<base::Value>(true)); - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(true)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/true, - /*block_third_party_cookies=*/true, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kPromptOff3PCOffEnabled, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandbox3PCOffDisabled) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{"consent-required", "false" /* consent required */}}); - prefs()->SetUserPref( - prefs::kPrivacySandboxNoConfirmationThirdPartyCookiesBlocked, - std::make_unique<base::Value>(true)); - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(false)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/false, - /*block_third_party_cookies=*/true, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kPromptOff3PCOffDisabled, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxConsentEnabled) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{"consent-required", "true" /* consent required */}}); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationSandboxDisabled, - std::make_unique<base::Value>(false)); - prefs()->SetUserPref(prefs::kPrivacySandboxConsentDecisionMade, - std::make_unique<base::Value>(true)); - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(true)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/true, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kConsentShownEnabled, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxConsentDisabled) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{"consent-required", "true" /* consent required */}}); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationSandboxDisabled, - std::make_unique<base::Value>(false)); - prefs()->SetUserPref(prefs::kPrivacySandboxConsentDecisionMade, - std::make_unique<base::Value>(true)); - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(false)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/false, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kConsentShownDisabled, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxNoticeEnabled) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{"notice-required", "true" /* consent required */}}); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationSandboxDisabled, - std::make_unique<base::Value>(false)); - prefs()->SetUserPref(prefs::kPrivacySandboxNoticeDisplayed, - std::make_unique<base::Value>(true)); - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(true)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/true, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kNoticeShownEnabled, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxNoticeDisabled) { - base::HistogramTester histogram_tester; - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{"notice-required", "true" /* consent required */}}); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationSandboxDisabled, - std::make_unique<base::Value>(false)); - prefs()->SetUserPref(prefs::kPrivacySandboxNoticeDisplayed, - std::make_unique<base::Value>(true)); - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(false)); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/false, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - CreateService(); - - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kNoticeShownDisabled, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxManuallyControlledEnabled) { - base::HistogramTester histogram_tester; - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(true)); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationManuallyControlled, - std::make_unique<base::Value>(true)); - CreateService(); - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates:: - kPromptOffManuallyControlledEnabled, - 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxManuallyControlledDisabled) { - base::HistogramTester histogram_tester; - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(false)); - prefs()->SetUserPref(prefs::kPrivacySandboxNoConfirmationManuallyControlled, - std::make_unique<base::Value>(true)); - CreateService(); - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates:: - kPromptOffManuallyControlledDisabled, - 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxNoPromptDisabled) { - base::HistogramTester histogram_tester; - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(false)); - CreateService(); - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kNoPromptRequiredDisabled, 1); -} - -TEST_F(PrivacySandboxServiceTest, PrivacySandboxNoPromptEnabled) { - base::HistogramTester histogram_tester; - prefs()->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - std::make_unique<base::Value>(true)); - CreateService(); - histogram_tester.ExpectUniqueSample( - kPrivacySandboxStartupHistogram, - PrivacySandboxServiceImpl::PSStartupStates::kNoPromptRequiredEnabled, 1); -} - -TEST_F(PrivacySandboxServiceTest, MetricsLoggingOccursCorrectly) { - base::HistogramTester histograms; - const std::string histogram_name = "Settings.PrivacySandbox.Enabled"; - - // The histogram should start off empty. - histograms.ExpectTotalCount(histogram_name, 0); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/true, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - - CreateService(); - - histograms.ExpectTotalCount(histogram_name, 1); - histograms.ExpectBucketCount( - histogram_name, - static_cast<int>(PrivacySandboxServiceImpl:: - SettingsPrivacySandboxEnabled::kPSEnabledAllowAll), - 1); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/true, - /*block_third_party_cookies=*/true, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - - CreateService(); - - histograms.ExpectTotalCount(histogram_name, 2); - histograms.ExpectBucketCount( - histogram_name, - static_cast<int>(PrivacySandboxServiceImpl:: - SettingsPrivacySandboxEnabled::kPSEnabledBlock3P), - 1); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/true, - /*block_third_party_cookies=*/true, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_BLOCK, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - - CreateService(); - - histograms.ExpectTotalCount(histogram_name, 3); - histograms.ExpectBucketCount( - histogram_name, - static_cast<int>(PrivacySandboxServiceImpl:: - SettingsPrivacySandboxEnabled::kPSEnabledBlockAll), - 1); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/false, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - - CreateService(); - - histograms.ExpectTotalCount(histogram_name, 4); - histograms.ExpectBucketCount( - histogram_name, - static_cast<int>(PrivacySandboxServiceImpl:: - SettingsPrivacySandboxEnabled::kPSDisabledAllowAll), - 1); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/false, - /*block_third_party_cookies=*/true, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - - CreateService(); - - histograms.ExpectTotalCount(histogram_name, 5); - histograms.ExpectBucketCount( - histogram_name, - static_cast<int>(PrivacySandboxServiceImpl:: - SettingsPrivacySandboxEnabled::kPSDisabledBlock3P), - 1); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/false, - /*block_third_party_cookies=*/true, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_BLOCK, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - - CreateService(); - - histograms.ExpectTotalCount(histogram_name, 6); - histograms.ExpectBucketCount( - histogram_name, - static_cast<int>(PrivacySandboxServiceImpl:: - SettingsPrivacySandboxEnabled::kPSDisabledBlockAll), - 1); - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/false, - /*block_third_party_cookies=*/true, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_BLOCK, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/ContentSetting::CONTENT_SETTING_BLOCK, - /*managed_cookie_exceptions=*/{}); - - CreateService(); - - histograms.ExpectTotalCount(histogram_name, 7); - histograms.ExpectBucketCount( - histogram_name, - static_cast<int>( - PrivacySandboxServiceImpl::SettingsPrivacySandboxEnabled:: - kPSDisabledPolicyBlockAll), - 1); -} - TEST_F(PrivacySandboxServiceTest, SampleFpsData) { feature_list()->InitAndEnableFeatureWithParameters( privacy_sandbox::kPrivacySandboxFirstPartySetsUI, @@ -2913,322 +1500,7 @@ net::SchemefulSite(GURL("https://google.de")))); } -class PrivacySandboxServiceTestNonRegularProfile - : public PrivacySandboxServiceTest { - profile_metrics::BrowserProfileType GetProfileType() override { - return profile_metrics::BrowserProfileType::kSystem; - } -}; - -TEST_F(PrivacySandboxServiceTestNonRegularProfile, NoMetricsRecorded) { - // Check that non-regular profiles do not record metrics. - base::HistogramTester histograms; - const std::string histogram_name = "Settings.PrivacySandbox.Enabled"; - - privacy_sandbox_test_util::SetupTestState( - prefs(), host_content_settings_map(), - /*privacy_sandbox_enabled=*/true, - /*block_third_party_cookies=*/false, - /*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW, - /*user_cookie_exceptions=*/{}, - /*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting, - /*managed_cookie_exceptions=*/{}); - - CreateService(); - - // The histogram should remain empty. - histograms.ExpectTotalCount(histogram_name, 0); -} - -TEST_F(PrivacySandboxServiceTestNonRegularProfile, NoPromptRequired) { - CreateService(); - // Non-regular profiles should never have a prompt shown. - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/true, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - EXPECT_EQ(PromptType::kNone, - privacy_sandbox_service()->GetRequiredPromptType()); - - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/false, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - EXPECT_EQ(PromptType::kNone, - privacy_sandbox_service()->GetRequiredPromptType()); -} - -class PrivacySandboxServicePromptTestBase { - public: - PrivacySandboxServicePromptTestBase() { - privacy_sandbox::RegisterProfilePrefs(prefs()->registry()); - feature_list()->InitWithFeatures( - {privacy_sandbox::kPrivacySandboxSettings3}, - {privacy_sandbox::kPrivacySandboxSettings4}); - } - -#if BUILDFLAG(IS_CHROMEOS_ASH) - void SetUp() { - user_manager_ = std::make_unique<ash::FakeChromeUserManager>(); - user_manager_->Initialize(); - } - - void TearDown() { - // Clean up user manager. - user_manager_->Shutdown(); - user_manager_->Destroy(); - user_manager_.reset(); - } -#endif - - protected: - base::test::ScopedFeatureList* feature_list() { return &feature_list_; } - sync_preferences::TestingPrefServiceSyncable* prefs() { - return &pref_service_; - } - privacy_sandbox_test_util::MockPrivacySandboxSettings* - privacy_sandbox_settings() { - return &privacy_sandbox_settings_; - } - - private: - base::test::ScopedFeatureList feature_list_; -#if BUILDFLAG(IS_CHROMEOS_ASH) - std::unique_ptr<ash::FakeChromeUserManager> user_manager_; -#endif - sync_preferences::TestingPrefServiceSyncable pref_service_; - privacy_sandbox_test_util::MockPrivacySandboxSettings - privacy_sandbox_settings_; -}; - -class PrivacySandboxServicePromptTest - : public PrivacySandboxServicePromptTestBase, - public testing::Test { -#if BUILDFLAG(IS_CHROMEOS_ASH) - public: - void SetUp() override { PrivacySandboxServicePromptTestBase::SetUp(); } - - void TearDown() override { PrivacySandboxServicePromptTestBase::TearDown(); } -#endif -}; - -TEST_F(PrivacySandboxServicePromptTest, RestrictedPrompt) { - // Confirm that when the Privacy Sandbox is restricted, that no prompt is - // shown. - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/true, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - - EXPECT_CALL(*privacy_sandbox_settings(), IsPrivacySandboxRestricted()) - .Times(1) - .WillOnce(testing::Return(true)); - EXPECT_EQ( - PromptType::kNone, - PrivacySandboxServiceImpl::GetRequiredPromptTypeInternal( - prefs(), profile_metrics::BrowserProfileType::kRegular, - privacy_sandbox_settings(), /*third_party_cookies_blocked=*/false)); - - // After being restricted, even if the restriction is removed, no prompt - // should be shown. No call should even need to be made to see if the - // sandbox is still restricted. - EXPECT_CALL(*privacy_sandbox_settings(), IsPrivacySandboxRestricted()) - .Times(0); - EXPECT_EQ( - PromptType::kNone, - PrivacySandboxServiceImpl::GetRequiredPromptTypeInternal( - prefs(), profile_metrics::BrowserProfileType::kRegular, - privacy_sandbox_settings(), /*third_party_cookies_blocked=*/false)); -} - -TEST_F(PrivacySandboxServicePromptTest, ManagedNoPrompt) { - // Confirm that when the Privacy Sandbox is managed, that no prompt is - // shown. - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/true, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - - prefs()->SetManagedPref(prefs::kPrivacySandboxApisEnabledV2, - base::Value(true)); - EXPECT_EQ( - PromptType::kNone, - PrivacySandboxServiceImpl::GetRequiredPromptTypeInternal( - prefs(), profile_metrics::BrowserProfileType::kRegular, - privacy_sandbox_settings(), /*third_party_cookies_blocked=*/false)); - - // This should persist even if the preference becomes unmanaged. - prefs()->RemoveManagedPref(prefs::kPrivacySandboxApisEnabledV2); - EXPECT_EQ( - PromptType::kNone, - PrivacySandboxServiceImpl::GetRequiredPromptTypeInternal( - prefs(), profile_metrics::BrowserProfileType::kRegular, - privacy_sandbox_settings(), /*third_party_cookies_blocked=*/false)); -} - -TEST_F(PrivacySandboxServicePromptTest, ManuallyControlledNoPrompt) { - // Confirm that if the Privacy Sandbox V2 is manually controlled by the user, - // that no prompt is shown. - SetupPromptTestState(feature_list(), prefs(), - {/*consent_required=*/true, - /*old_api_pref=*/true, - /*new_api_pref=*/false, - /*notice_displayed=*/false, - /*consent_decision_made=*/false, - /*confirmation_not_shown=*/false}); - prefs()->SetUserPref(prefs::kPrivacySandboxManuallyControlledV2, - base::Value(true)); - EXPECT_EQ( - PromptType::kNone, - PrivacySandboxServiceImpl::GetRequiredPromptTypeInternal( - prefs(), profile_metrics::BrowserProfileType::kRegular, - privacy_sandbox_settings(), /*third_party_cookies_blocked=*/false)); -} - -TEST_F(PrivacySandboxServicePromptTest, NoParamNoPrompt) { - // Confirm that if neither the consent or notice parameter is set, no prompt - // is required. - EXPECT_EQ( - PromptType::kNone, - PrivacySandboxServiceImpl::GetRequiredPromptTypeInternal( - prefs(), profile_metrics::BrowserProfileType::kRegular, - privacy_sandbox_settings(), /*third_party_cookies_blocked=*/false)); -} - -class PrivacySandboxServiceDeathTest - : public PrivacySandboxServicePromptTestBase, - public testing::TestWithParam<int> { -#if BUILDFLAG(IS_CHROMEOS_ASH) - public: - void SetUp() override { PrivacySandboxServicePromptTestBase::SetUp(); } - - void TearDown() override { PrivacySandboxServicePromptTestBase::TearDown(); } -#endif -}; - -TEST_P(PrivacySandboxServiceDeathTest, GetRequiredPromptType) { - const auto& test_case = kPromptTestCases[GetParam()]; - privacy_sandbox_settings()->SetUpDefaultResponse(); - - testing::Message scope_message; - scope_message << "consent_required:" << test_case.test_setup.consent_required - << " old_api_pref:" << test_case.test_setup.old_api_pref - << " new_api_pref:" << test_case.test_setup.new_api_pref - << " notice_displayed:" << test_case.test_setup.notice_displayed - << " consent_decision_made:" - << test_case.test_setup.consent_decision_made - << " confirmation_not_shown:" - << test_case.test_setup.confirmation_not_shown; - SCOPED_TRACE(scope_message); - - SetupPromptTestState(feature_list(), prefs(), test_case.test_setup); - if (test_case.expected_output.dcheck_failure) { - EXPECT_DCHECK_DEATH( - PrivacySandboxServiceImpl::GetRequiredPromptTypeInternal( - prefs(), profile_metrics::BrowserProfileType::kRegular, - privacy_sandbox_settings(), /*third_party_cookies_blocked=*/false); - - ); - return; - } - - // Returned prompt type should never change between successive calls. - EXPECT_EQ( - test_case.expected_output.prompt_type, - PrivacySandboxServiceImpl::GetRequiredPromptTypeInternal( - prefs(), profile_metrics::BrowserProfileType::kRegular, - privacy_sandbox_settings(), /*third_party_cookies_blocked=*/false)); - EXPECT_EQ( - test_case.expected_output.prompt_type, - PrivacySandboxServiceImpl::GetRequiredPromptTypeInternal( - prefs(), profile_metrics::BrowserProfileType::kRegular, - privacy_sandbox_settings(), /*third_party_cookies_blocked=*/false)); - - EXPECT_EQ(test_case.expected_output.new_api_pref, - prefs()->GetBoolean(prefs::kPrivacySandboxApisEnabledV2)); - - // The old Privacy Sandbox pref should never change from the initial test - // state. - EXPECT_EQ(test_case.test_setup.old_api_pref, - prefs()->GetBoolean(prefs::kPrivacySandboxApisEnabled)); -} - -INSTANTIATE_TEST_SUITE_P(PrivacySandboxServiceDeathTestInstance, - PrivacySandboxServiceDeathTest, - testing::Range(0, 64)); - -using PrivacySandboxServiceTestCoverageTest = testing::Test; - -TEST_F(PrivacySandboxServiceTestCoverageTest, PromptTestCoverage) { - // Confirm that the set of prompt test cases exhaustively covers all possible - // combinations of input. - std::set<int> test_case_properties; - for (const auto& test_case : kPromptTestCases) { - int test_case_property = 0; - test_case_property |= test_case.test_setup.consent_required ? 1 << 0 : 0; - test_case_property |= test_case.test_setup.old_api_pref ? 1 << 1 : 0; - test_case_property |= test_case.test_setup.new_api_pref ? 1 << 2 : 0; - test_case_property |= test_case.test_setup.notice_displayed ? 1 << 3 : 0; - test_case_property |= - test_case.test_setup.consent_decision_made ? 1 << 4 : 0; - test_case_property |= - test_case.test_setup.confirmation_not_shown ? 1 << 5 : 0; - test_case_properties.insert(test_case_property); - } - EXPECT_EQ(test_case_properties.size(), kPromptTestCases.size()); - EXPECT_EQ(64u, test_case_properties.size()); -} - -class PrivacySandboxServiceM1Test : public PrivacySandboxServiceTest { - public: - void InitializeFeaturesBeforeStart() override { - feature_list()->InitAndEnableFeature( - privacy_sandbox::kPrivacySandboxSettings4); - } - - protected: - void RunTestCase(const TestState& test_state, - const TestInput& test_input, - const TestOutput& test_output) { - auto user_provider = std::make_unique<content_settings::MockProvider>(); - auto* user_provider_raw = user_provider.get(); - auto managed_provider = std::make_unique<content_settings::MockProvider>(); - auto* managed_provider_raw = managed_provider.get(); - content_settings::TestUtils::OverrideProvider( - host_content_settings_map(), std::move(user_provider), - HostContentSettingsMap::PREF_PROVIDER); - content_settings::TestUtils::OverrideProvider( - host_content_settings_map(), std::move(managed_provider), - HostContentSettingsMap::POLICY_PROVIDER); - auto service_wrapper = TestPrivacySandboxService(privacy_sandbox_service()); - - privacy_sandbox_test_util::RunTestCase( - browser_task_environment(), prefs(), host_content_settings_map(), - mock_delegate(), mock_browsing_topics_service(), - privacy_sandbox_settings(), &service_wrapper, user_provider_raw, - managed_provider_raw, TestCase(test_state, test_input, test_output)); - } - - void DisablePrivacySandboxPromptEnabledPolicy() { - prefs()->SetManagedPref( - prefs::kPrivacySandboxM1PromptSuppressed, - base::Value(static_cast<int>(PromptSuppressedReason::kPolicy))); - } -}; - -TEST_F(PrivacySandboxServiceM1Test, TopicsConsentDefault) { +TEST_F(PrivacySandboxServiceTest, TopicsConsentDefault) { RunTestCase( TestState{}, TestInput{}, TestOutput{{kTopicsConsentGiven, false}, @@ -3238,7 +1510,7 @@ {kTopicsConsentStringIdentifiers, std::vector<int>()}}); } -TEST_F(PrivacySandboxServiceM1Test, TopicsConsentSettings_EnableWithBlocked) { +TEST_F(PrivacySandboxServiceTest, TopicsConsentSettings_EnableWithBlocked) { // Note that when testing for enabling topics, there can never have been // current topics in prod code. RunTestCase( @@ -3261,7 +1533,7 @@ }); } -TEST_F(PrivacySandboxServiceM1Test, TopicsConsentSettings_EnableNoBlocked) { +TEST_F(PrivacySandboxServiceTest, TopicsConsentSettings_EnableNoBlocked) { RunTestCase( TestState{{kActiveTopicsConsent, false}, {kHasCurrentTopics, false}, @@ -3282,7 +1554,7 @@ }); } -TEST_F(PrivacySandboxServiceM1Test, +TEST_F(PrivacySandboxServiceTest, TopicsConsentSettings_DisableCurrentAndBlocked) { RunTestCase( TestState{{kActiveTopicsConsent, true}, @@ -3304,7 +1576,7 @@ }); } -TEST_F(PrivacySandboxServiceM1Test, TopicsConsentSettings_DisableBlockedOnly) { +TEST_F(PrivacySandboxServiceTest, TopicsConsentSettings_DisableBlockedOnly) { RunTestCase( TestState{{kActiveTopicsConsent, true}, {kHasCurrentTopics, false}, @@ -3325,7 +1597,7 @@ }); } -TEST_F(PrivacySandboxServiceM1Test, TopicsConsentSettings_DisableCurrentOnly) { +TEST_F(PrivacySandboxServiceTest, TopicsConsentSettings_DisableCurrentOnly) { RunTestCase( TestState{{kActiveTopicsConsent, true}, {kHasCurrentTopics, true}, @@ -3346,7 +1618,7 @@ }); } -TEST_F(PrivacySandboxServiceM1Test, +TEST_F(PrivacySandboxServiceTest, TopicsConsentSettings_DisableNoCurrentNoBlocked) { RunTestCase( TestState{{kActiveTopicsConsent, true}, @@ -3368,7 +1640,7 @@ }); } -TEST_F(PrivacySandboxServiceM1Test, +TEST_F(PrivacySandboxServiceTest, RecordPrivacySandbox4StartupMetrics_PromptSuppressed_Explicitly) { base::HistogramTester histogram_tester; const std::string privacy_sandbox_prompt_startup_histogram = @@ -3433,7 +1705,7 @@ /*expected_count=*/1); } -TEST_F(PrivacySandboxServiceM1Test, +TEST_F(PrivacySandboxServiceTest, RecordPrivacySandbox4StartupMetrics_PromptSuppressed_Implicitly) { base::HistogramTester histogram_tester; const std::string privacy_sandbox_prompt_startup_histogram = @@ -3454,7 +1726,7 @@ /*expected_count=*/1); } -TEST_F(PrivacySandboxServiceM1Test, +TEST_F(PrivacySandboxServiceTest, RecordPrivacySandbox4StartupMetrics_PromptNotSuppressed_EEA) { base::HistogramTester histogram_tester; const std::string privacy_sandbox_prompt_startup_histogram = @@ -3516,7 +1788,7 @@ /*expected_count=*/1); } -TEST_F(PrivacySandboxServiceM1Test, +TEST_F(PrivacySandboxServiceTest, RecordPrivacySandbox4StartupMetrics_PromptNotSuppressed_ROW) { base::HistogramTester histogram_tester; const std::string privacy_sandbox_prompt_startup_histogram = @@ -3555,7 +1827,7 @@ /*expected_count=*/1); } -TEST_F(PrivacySandboxServiceM1Test, RecordPrivacySandbox4StartupMetrics_APIs) { +TEST_F(PrivacySandboxServiceTest, RecordPrivacySandbox4StartupMetrics_APIs) { // Each test for the APIs are scoped below to ensure we start with a clean // HistogramTester as each call to `RecordPrivacySandbox4StartupMetrics` emits // histograms for all APIs. @@ -3609,7 +1881,7 @@ } class PrivacySandboxServiceM1RestrictedNoticeTest - : public PrivacySandboxServiceM1Test { + : public PrivacySandboxServiceTest { public: void InitializeFeaturesBeforeStart() override { feature_list()->InitAndEnableFeatureWithParameters( @@ -3639,8 +1911,7 @@ {OutputKey::kM1RestrictedNoticeAcknowledged, true}}); } -class PrivacySandboxServiceM1DelayCreation - : public PrivacySandboxServiceM1Test { +class PrivacySandboxServiceM1DelayCreation : public PrivacySandboxServiceTest { public: void SetUp() override { // Prevent service from being created by base class. @@ -3774,7 +2045,7 @@ prefs()->GetBoolean(prefs::kPrivacySandboxM1AdMeasurementEnabled)); } -class PrivacySandboxServiceM1PromptTest : public PrivacySandboxServiceM1Test { +class PrivacySandboxServiceM1PromptTest : public PrivacySandboxServiceTest { public: void InitializeFeaturesBeforeStart() override { feature_list()->InitAndEnableFeatureWithParameters( @@ -3783,33 +2054,45 @@ } }; -TEST_F(PrivacySandboxServiceM1PromptTest, PrivacySandboxCorrectPromptVersion) { - // Depending on the feature enabled, a different prompt type may occur. +#if BUILDFLAG(IS_CHROMEOS) +TEST_F(PrivacySandboxServiceM1PromptTest, DeviceLocalAccountUser) { + privacy_sandbox_service()->ForceChromeBuildForTests(true); +#if BUILDFLAG(IS_CHROMEOS_ASH) + user_manager::ScopedUserManager user_manager( + std::make_unique<user_manager::FakeUserManager>()); +#endif // BUILDFLAG(IS_CHROMEOS_ASH) - // Trials - feature_list()->Reset(); - feature_list()->InitWithFeaturesAndParameters( - {{privacy_sandbox::kPrivacySandboxSettings3, - {{"force-show-consent-for-testing", "true"}}}}, - {privacy_sandbox::kPrivacySandboxSettings4}); - RunTestCase(TestState({}), TestInput{{InputKey::kForceChromeBuild, true}}, - TestOutput{{OutputKey::kPromptType, - static_cast<int>(PromptType::kConsent)}, - {OutputKey::kM1PromptSuppressedReason, - static_cast<int>(PromptSuppressedReason::kNone)}}); + // No prompt should be shown for a public session account. +#if BUILDFLAG(IS_CHROMEOS_ASH) + ash::ScopedTestPublicSessionLoginState login_state; +#elif BUILDFLAG(IS_CHROMEOS_LACROS) + crosapi::mojom::BrowserInitParamsPtr init_params = + crosapi::mojom::BrowserInitParams::New(); + init_params->session_type = crosapi::mojom::SessionType::kPublicSession; + chromeos::BrowserInitParams::SetInitParamsForTests(std::move(init_params)); +#endif + EXPECT_EQ(PromptType::kNone, + privacy_sandbox_service()->GetRequiredPromptType()); - // M1 - feature_list()->Reset(); - feature_list()->InitWithFeaturesAndParameters( - {{privacy_sandbox::kPrivacySandboxSettings4, - {{"force-show-consent-for-testing", "true"}}}}, - {privacy_sandbox::kPrivacySandboxSettings3}); - RunTestCase(TestState({}), TestInput{{InputKey::kForceChromeBuild, true}}, - TestOutput{{OutputKey::kPromptType, - static_cast<int>(PromptType::kM1Consent)}, - {OutputKey::kM1PromptSuppressedReason, - static_cast<int>(PromptSuppressedReason::kNone)}}); + // A prompt should be shown for a regular user. +#if BUILDFLAG(IS_CHROMEOS_ASH) + ash::LoginState::Get()->SetLoggedInState( + ash::LoginState::LoggedInState::LOGGED_IN_ACTIVE, + ash::LoginState::LoggedInUserType::LOGGED_IN_USER_REGULAR); +#elif BUILDFLAG(IS_CHROMEOS_LACROS) + init_params = crosapi::mojom::BrowserInitParams::New(); + init_params->session_type = crosapi::mojom::SessionType::kRegularSession; + chromeos::BrowserInitParams::SetInitParamsForTests(std::move(init_params)); +#endif + EXPECT_EQ(PromptType::kM1Consent, + privacy_sandbox_service()->GetRequiredPromptType()); + + // No prompt should be shown for a web kiosk account. + chromeos::SetUpFakeKioskSession(); + EXPECT_EQ(PromptType::kNone, + privacy_sandbox_service()->GetRequiredPromptType()); } +#endif // BUILDFLAG(IS_CHROMEOS) #if !BUILDFLAG(GOOGLE_CHROME_BRANDING) TEST_F(PrivacySandboxServiceM1PromptTest, NonChromeBuildPrompt) { @@ -4209,7 +2492,7 @@ {OutputKey::kTopicsConsentGiven, false}}); } -TEST_F(PrivacySandboxServiceM1Test, DisablePrivacySandboxPromptPolicy) { +TEST_F(PrivacySandboxServiceTest, DisablePrivacySandboxPromptPolicy) { // Disable the prompt via policy and check the returned prompt type is kNone. RunTestCase(TestState{{StateKey::kM1PromptDisabledByPolicy, static_cast<int>(PromptSuppressedReason::kPolicy)}}, @@ -4218,7 +2501,7 @@ static_cast<int>(PromptType::kNone)}}); } -TEST_F(PrivacySandboxServiceM1Test, DisablePrivacySandboxTopicsPolicy) { +TEST_F(PrivacySandboxServiceTest, DisablePrivacySandboxTopicsPolicy) { // Disable the Topics api via policy and check the returned prompt type is // kNone and topics is not allowed. RunTestCase( @@ -4230,7 +2513,7 @@ {OutputKey::kIsTopicsAllowed, false}}); } -TEST_F(PrivacySandboxServiceM1Test, DisablePrivacySandboxFledgePolicy) { +TEST_F(PrivacySandboxServiceTest, DisablePrivacySandboxFledgePolicy) { // Disable the Fledge api via policy and check the returned prompt type is // kNone and fledge is not allowed. RunTestCase( @@ -4246,7 +2529,7 @@ {OutputKey::kIsFledgeJoinAllowed, false}}); } -TEST_F(PrivacySandboxServiceM1Test, DisablePrivacySandboxAdMeasurementPolicy) { +TEST_F(PrivacySandboxServiceTest, DisablePrivacySandboxAdMeasurementPolicy) { // Disable the ad measurement api via policy and check the returned prompt // type is kNone and the api is not allowed. RunTestCase(
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_settings_delegate_unittest.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_settings_delegate_unittest.cc index 40835a8..8b5d452 100644 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_settings_delegate_unittest.cc +++ b/chrome/browser/privacy_sandbox/privacy_sandbox_settings_delegate_unittest.cc
@@ -134,8 +134,6 @@ TEST_F(PrivacySandboxSettingsDelegateTest, CapabilityRestrictionForSignedOutUser) { - feature_list()->InitAndEnableFeature( - privacy_sandbox::kPrivacySandboxSettings3); // If the user is not signed in to Chrome then we don't use any age signal and // don't restrict the feature. EXPECT_FALSE(delegate()->IsPrivacySandboxRestricted()); @@ -232,14 +230,6 @@ {{privacy_sandbox::kPrivacySandboxSettings4NoticeRequired.name, "true"}}); EXPECT_TRUE(delegate()->HasAppropriateTopicsConsent()); - - feature_list()->Reset(); - feature_list()->InitAndEnableFeatureWithParameters( - privacy_sandbox::kPrivacySandboxSettings3, - {{privacy_sandbox::kPrivacySandboxSettings3ConsentRequired.name, - "true"}}); - - EXPECT_TRUE(delegate()->HasAppropriateTopicsConsent()); } TEST_F(PrivacySandboxSettingsDelegateTest,
diff --git a/chrome/browser/resources/browsing_topics/browsing_topics_internals.html b/chrome/browser/resources/browsing_topics/browsing_topics_internals.html index f65e000..3a0ef2a4 100644 --- a/chrome/browser/resources/browsing_topics/browsing_topics_internals.html +++ b/chrome/browser/resources/browsing_topics/browsing_topics_internals.html
@@ -66,7 +66,6 @@ <div class="features-and-parameters-div"> <div id="browsing-topics-enabled-div">BrowsingTopics: </div> <div id="privacy-sandbox-ads-apis-override-enabled-div">PrivacySandboxAdsAPIsOverride: </div> - <div id="privacy-sandbox-settings3-enabled-div">PrivacySandboxSettings3: </div> <div id="override-privacy-sandbox-settings-local-testing-enabled-div">OverridePrivacySandboxSettingsLocalTesting: </div> <div id="browsing-topics-bypass-ip-is-publicly-routable-check-enabled-div">BrowsingTopicsBypassIPIsPubliclyRoutableCheck: </div> <div id="browsing-topics-document-api-enabled-div">BrowsingTopicsDocumentAPI: </div>
diff --git a/chrome/browser/resources/browsing_topics/browsing_topics_internals.ts b/chrome/browser/resources/browsing_topics/browsing_topics_internals.ts index 0d04663..79ca4bc 100644 --- a/chrome/browser/resources/browsing_topics/browsing_topics_internals.ts +++ b/chrome/browser/resources/browsing_topics/browsing_topics_internals.ts
@@ -126,7 +126,6 @@ // Enabled status fields ['browsing-topics-enabled-div', 'privacy-sandbox-ads-apis-override-enabled-div', - 'privacy-sandbox-settings3-enabled-div', 'override-privacy-sandbox-settings-local-testing-enabled-div', 'browsing-topics-bypass-ip-is-publicly-routable-check-enabled-div', 'browsing-topics-document-api-enabled-div',
diff --git a/chrome/browser/resources/compose/app.html b/chrome/browser/resources/compose/app.html index abc2b91..d4748642 100644 --- a/chrome/browser/resources/compose/app.html +++ b/chrome/browser/resources/compose/app.html
@@ -184,7 +184,7 @@ #resultOptions .md-select { --md-select-bg-color: transparent; - width: 82px; + width: auto; } :host-context(html:not([chrome-refresh-2023])) #resultOptions .md-select {
diff --git a/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_fledge_subpage.ts b/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_fledge_subpage.ts index 9a9bf1b..a6b501b 100644 --- a/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_fledge_subpage.ts +++ b/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_fledge_subpage.ts
@@ -147,7 +147,8 @@ state => this.onFledgeStateChanged_(state)); this.$.footer.querySelectorAll('a').forEach( - link => link.title = this.i18n('opensInNewTab')); + link => + link.setAttribute('aria-description', this.i18n('opensInNewTab'))); HatsBrowserProxyImpl.getInstance().trustSafetyInteractionOccurred( TrustSafetyInteraction.OPENED_FLEDGE_SUBPAGE);
diff --git a/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_topics_subpage.ts b/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_topics_subpage.ts index a6fa415c..6e4272f 100644 --- a/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_topics_subpage.ts +++ b/chrome/browser/resources/settings/privacy_sandbox/privacy_sandbox_topics_subpage.ts
@@ -109,7 +109,8 @@ state => this.onTopicsStateChanged_(state)); this.$.footer.querySelectorAll('a').forEach( - link => link.title = this.i18n('opensInNewTab')); + link => + link.setAttribute('aria-description', this.i18n('opensInNewTab'))); HatsBrowserProxyImpl.getInstance().trustSafetyInteractionOccurred( TrustSafetyInteraction.OPENED_TOPICS_SUBPAGE);
diff --git a/chrome/browser/resources/settings/settings_page/settings_subpage.html b/chrome/browser/resources/settings/settings_page/settings_subpage.html index 0987c3a..c00178c 100644 --- a/chrome/browser/resources/settings/settings_page/settings_subpage.html +++ b/chrome/browser/resources/settings/settings_page/settings_subpage.html
@@ -93,7 +93,8 @@ <slot name="subpage-title-extra"></slot> <template is="dom-if" if="[[learnMoreUrl]]"> <cr-icon-button iron-icon="cr:help-outline" dir="ltr" - aria-label="[[getLearnMoreAriaLabel_(pageTitle)]]" on-click="onHelpClick_"> + aria-label="[[getLearnMoreAriaLabel_(pageTitle)]]" + aria-description="$i18n{opensInNewTab}" on-click="onHelpClick_"> </cr-icon-button> </template> <template is="dom-if" if="[[searchLabel]]">
diff --git a/chrome/browser/resources/settings_shared/controls/settings_toggle_button.html b/chrome/browser/resources/settings_shared/controls/settings_toggle_button.html index b797e234..a2f1da4a 100644 --- a/chrome/browser/resources/settings_shared/controls/settings_toggle_button.html +++ b/chrome/browser/resources/settings_shared/controls/settings_toggle_button.html
@@ -79,6 +79,7 @@ <template is="dom-if" if="[[learnMoreUrl]]"> <a id="learn-more" href="[[learnMoreUrl]]" target="_blank" aria-labelledby$="[[getLearnMoreAriaLabelledBy_(learnMoreAriaLabel)]]" + aria-description="$i18n{opensInNewTab}" on-click="onLearnMoreClick_"> $i18n{learnMore} </a>
diff --git a/chrome/browser/storage/shared_storage_browsertest.cc b/chrome/browser/storage/shared_storage_browsertest.cc index 979fc73..ea6ec9b4 100644 --- a/chrome/browser/storage/shared_storage_browsertest.cc +++ b/chrome/browser/storage/shared_storage_browsertest.cc
@@ -310,7 +310,6 @@ scoped_feature_list_.InitWithFeatures( /*enabled_features=*/{blink::features::kSharedStorageAPI, privacy_sandbox::kPrivacySandboxSettings4, - privacy_sandbox::kPrivacySandboxSettings3, features::kPrivacySandboxAdsAPIsOverride, privacy_sandbox:: kOverridePrivacySandboxSettingsLocalTesting},
diff --git a/chrome/browser/sync/test/integration/sync_service_impl_harness.cc b/chrome/browser/sync/test/integration/sync_service_impl_harness.cc index 61ec27c..71dbd4f 100644 --- a/chrome/browser/sync/test/integration/sync_service_impl_harness.cc +++ b/chrome/browser/sync/test/integration/sync_service_impl_harness.cc
@@ -159,7 +159,7 @@ simple_loader->SetTimeoutDuration(base::Seconds(10)); content::SimpleURLLoaderTestHelper url_loader_helper; simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - url_loader_factory, url_loader_helper.GetCallback()); + url_loader_factory, url_loader_helper.GetCallbackDeprecated()); url_loader_helper.WaitForCallback(); if (simple_loader->NetError() != 0) { LOG(ERROR) << "Reset account failed with error "
diff --git a/chrome/browser/ui/media_router/cast_notification_controller_lacros.cc b/chrome/browser/ui/media_router/cast_notification_controller_lacros.cc index a8df7a0..183b2dc 100644 --- a/chrome/browser/ui/media_router/cast_notification_controller_lacros.cc +++ b/chrome/browser/ui/media_router/cast_notification_controller_lacros.cc
@@ -8,6 +8,7 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/media/router/discovery/access_code/access_code_cast_feature.h" +#include "chrome/browser/media/router/media_router_feature.h" #include "chrome/browser/notifications/notification_display_service.h" #include "chrome/browser/notifications/notification_handler.h" #include "chrome/browser/profiles/profile.h" @@ -15,6 +16,7 @@ #include "components/media_router/browser/media_router.h" #include "components/media_router/browser/media_router_factory.h" #include "components/media_router/browser/mirroring_media_controller_host.h" +#include "components/media_router/common/media_source.h" #include "components/vector_icons/vector_icons.h" #include "content/public/browser/browser_context.h" #include "ui/base/l10n/l10n_util.h" @@ -146,10 +148,9 @@ data.small_image = gfx::Image(gfx::CreateVectorIcon( gfx::IconDescription(vector_icons::kMediaRouterIdleIcon, 32))); - return message_center::Notification{ + message_center::Notification notification( message_center::NotificationType::NOTIFICATION_TYPE_SIMPLE, - kNotificationId, - GetNotificationTitle(route.media_sink_name()), + kNotificationId, GetNotificationTitle(route.media_sink_name()), GetNotificationMessage(route, freeze_host, IsAccessCodeCastFreezeUiEnabled(profile_)), /*icon=*/ui::ImageModel{}, @@ -161,8 +162,18 @@ base::MakeRefCounted<message_center::HandleNotificationClickDelegate>( base::BindRepeating( &CastNotificationControllerLacros::OnNotificationClicked, - weak_ptr_factory_.GetWeakPtr())), - }; + weak_ptr_factory_.GetWeakPtr()))); + + if (GlobalMediaControlsCastStartStopEnabled(profile_) && + (route.media_source().IsCastPresentationUrl() || + route.media_source().IsRemotePlaybackSource())) { + // The session was started via the Global Media Controls UI which would + // still likely be open. It'd be annoying to overlay the notificatin on top + // of it, so add the notification to the tray silently. + notification.set_priority( + message_center::NotificationPriority::LOW_PRIORITY); + } + return notification; } std::vector<message_center::ButtonInfo>
diff --git a/chrome/browser/ui/privacy_sandbox/privacy_sandbox_prompt_helper_browsertest.cc b/chrome/browser/ui/privacy_sandbox/privacy_sandbox_prompt_helper_browsertest.cc index c125488a..8b8b459 100644 --- a/chrome/browser/ui/privacy_sandbox/privacy_sandbox_prompt_helper_browsertest.cc +++ b/chrome/browser/ui/privacy_sandbox/privacy_sandbox_prompt_helper_browsertest.cc
@@ -164,11 +164,8 @@ [[fallthrough]]; case PrivacySandboxService::PromptType::kNotice: [[fallthrough]]; - case PrivacySandboxService::PromptType::kConsent: { - enabled_features.push_back(privacy_sandbox::kPrivacySandboxSettings3); - disabled_features.push_back(privacy_sandbox::kPrivacySandboxSettings4); - break; - } + case PrivacySandboxService::PromptType::kConsent: + NOTREACHED_NORETURN(); case PrivacySandboxService::PromptType::kM1Consent: [[fallthrough]]; case PrivacySandboxService::PromptType::kM1NoticeROW: @@ -177,7 +174,6 @@ [[fallthrough]]; case PrivacySandboxService::PromptType::kM1NoticeRestricted: { enabled_features.push_back(privacy_sandbox::kPrivacySandboxSettings4); - disabled_features.push_back(privacy_sandbox::kPrivacySandboxSettings3); break; } } @@ -514,9 +510,7 @@ PrivacySandboxPromptHelperTestWithParam, testing::Values(PrivacySandboxService::PromptType::kM1Consent, PrivacySandboxService::PromptType::kM1NoticeEEA, - PrivacySandboxService::PromptType::kM1NoticeROW, - PrivacySandboxService::PromptType::kConsent, - PrivacySandboxService::PromptType::kNotice)); + PrivacySandboxService::PromptType::kM1NoticeROW)); struct PrivacySandboxNonNormalBrowserTestData { const PrivacySandboxService::PromptType prompt_type; @@ -739,7 +733,5 @@ PrivacySandboxPromptHelperTestWithSearchEngineChoiceEnabled, testing::Values(PrivacySandboxService::PromptType::kM1Consent, PrivacySandboxService::PromptType::kM1NoticeEEA, - PrivacySandboxService::PromptType::kM1NoticeROW, - PrivacySandboxService::PromptType::kConsent, - PrivacySandboxService::PromptType::kNotice)); + PrivacySandboxService::PromptType::kM1NoticeROW)); #endif // BUILDFLAG(ENABLE_SEARCH_ENGINE_CHOICE)
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view_dialog_browsertest.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view_dialog_browsertest.cc index b35c5950..4639280 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view_dialog_browsertest.cc +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view_dialog_browsertest.cc
@@ -557,16 +557,8 @@ } class PageInfoBubbleViewPrivacySandboxDialogBrowserTest - : public DialogBrowserTest, - public testing::WithParamInterface<bool> { + : public DialogBrowserTest { public: - PageInfoBubbleViewPrivacySandboxDialogBrowserTest() { - feature_list_.InitWithFeatures( - {GetParam() ? privacy_sandbox::kPrivacySandboxSettings4 - : privacy_sandbox::kPrivacySandboxSettings3}, - {}); - } - void SetUpOnMainThread() override { https_server_.SetSSLConfig(net::EmbeddedTestServer::CERT_TEST_NAMES); https_server_.ServeFilesFromSourceDirectory(GetChromeTestDataDir()); @@ -625,20 +617,16 @@ net::EmbeddedTestServer https_server_{net::EmbeddedTestServer::TYPE_HTTPS}; }; -IN_PROC_BROWSER_TEST_P(PageInfoBubbleViewPrivacySandboxDialogBrowserTest, +IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewPrivacySandboxDialogBrowserTest, InvokeUi_PrivacySandboxMain) { ShowAndVerifyUi(); } -IN_PROC_BROWSER_TEST_P(PageInfoBubbleViewPrivacySandboxDialogBrowserTest, +IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewPrivacySandboxDialogBrowserTest, InvokeUi_PrivacySandboxSubpage) { ShowAndVerifyUi(); } -INSTANTIATE_TEST_SUITE_P(All, - PageInfoBubbleViewPrivacySandboxDialogBrowserTest, - testing::Bool()); - class PageInfoBubbleViewHistoryDialogBrowserTest : public DialogBrowserTest { public: PageInfoBubbleViewHistoryDialogBrowserTest() {
diff --git a/chrome/browser/ui/web_applications/web_app_launch_utils.cc b/chrome/browser/ui/web_applications/web_app_launch_utils.cc index 10c23ca..e419283 100644 --- a/chrome/browser/ui/web_applications/web_app_launch_utils.cc +++ b/chrome/browser/ui/web_applications/web_app_launch_utils.cc
@@ -67,6 +67,7 @@ #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/render_frame_host.h" +#include "content/public/browser/site_instance.h" #include "content/public/browser/web_contents.h" #include "extensions/buildflags/buildflags.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -576,11 +577,11 @@ /*partition_domain=*/kExperimentalWebAppStorageParitionDomain, /*partition_name=*/app_id, /*in_memory=*/false); - auto guest_site_instance = content::SiteInstance::CreateForGuest( - nav_params.browser->profile(), partition_config); + auto site_instance = content::SiteInstance::CreateForFixedStoragePartition( + nav_params.browser->profile(), nav_params.url, partition_config); content::WebContents::CreateParams params(nav_params.browser->profile(), - std::move(guest_site_instance)); + std::move(site_instance)); std::unique_ptr<content::WebContents> new_contents = content::WebContents::Create(params); content::NavigationController::LoadURLParams load_url_params(
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_open_metrics.cc b/chrome/browser/ui/webui/ash/cloud_upload/cloud_open_metrics.cc index 745f1f3..7020eab 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_open_metrics.cc +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_open_metrics.cc
@@ -211,6 +211,7 @@ kUploadNotStartedReauthenticationRequired: break; case OfficeFilesUploadResult::kSuccess: + case OfficeFilesUploadResult::kSuccessAfterReauth: SetWrongValueLogged(upload_result); break; } @@ -333,6 +334,7 @@ if (upload_result.logged()) { switch (upload_result.value) { case OfficeFilesUploadResult::kSuccess: + case OfficeFilesUploadResult::kSuccessAfterReauth: break; case OfficeFilesUploadResult::kOtherError: case OfficeFilesUploadResult::kFileSystemNotFound:
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h index 3bb235721..b660c43 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h
@@ -191,7 +191,8 @@ kSyncCancelledAndDeleted = 21, kSyncCancelledAndTrashed = 22, kUploadNotStartedReauthenticationRequired = 23, - kMaxValue = kUploadNotStartedReauthenticationRequired, + kSuccessAfterReauth = 24, + kMaxValue = kSuccessAfterReauth, }; constexpr char kGoogleDriveTaskResultMetricName[] =
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler.cc b/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler.cc index 82d3c2a..ef972f8 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler.cc +++ b/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler.h" +#include "ash/constants/ash_features.h" #include "base/check_op.h" #include "base/debug/dump_without_crashing.h" #include "base/files/file.h" @@ -117,19 +118,11 @@ // Observe IO tasks updates. io_task_controller_->AddObserver(this); - // Destination url. - auto odfs_info = GetODFSInfo(profile_); - if (!odfs_info) { - // TODO(b/293363474): Remove when the underlying cause is diagnosed. - base::debug::DumpWithoutCrashing(FROM_HERE); - OnEndUpload(base::unexpected(GetGenericErrorMessage()), - OfficeFilesUploadResult::kFileSystemNotFound); - return; - } - destination_folder_path_ = odfs_info->mount_path(); - FileSystemURL destination_folder_url = FilePathToFileSystemURL( - profile_, file_system_context_, destination_folder_path_); - // TODO (b/243095484) Define error behavior. + GetODFSMetadataAndStartIOTask(); +} + +void OneDriveUploadHandler::GetODFSMetadataAndStartIOTask() { + FileSystemURL destination_folder_url = GetDestinationFolderUrl(); if (!destination_folder_url.is_valid()) { LOG(ERROR) << "Unable to generate destination folder ODFS URL"; // TODO(b/293363474): Remove when the underlying cause is diagnosed. @@ -164,10 +157,20 @@ LOG(ERROR) << "Failed to get reauthentication required state: " << metadata_or_error.error(); } else if (metadata_or_error->reauthentication_required) { - // Show the reauthentication required error notification. - OnEndUpload( - base::unexpected(GetReauthenticationRequiredMessage()), - OfficeFilesUploadResult::kUploadNotStartedReauthenticationRequired); + if (tried_reauth_ || !base::FeatureList::IsEnabled( + ash::features::kOneDriveUploadImmediateReauth)) { + // We do not expect this failure because it would mean we became de-auth'd + // right after auth. Except when the immediate-reauth feature is on, then + // it just means reauthentication is required and we have to ask the user. + OnEndUpload( + base::unexpected(GetReauthenticationRequiredMessage()), + OfficeFilesUploadResult::kUploadNotStartedReauthenticationRequired); + } else { + // Try to reauth immediately and then try the upload again. + RequestODFSMount(profile_, + base::BindOnce(&OneDriveUploadHandler::OnMountResponse, + weak_ptr_factory_.GetWeakPtr())); + } return; } @@ -185,6 +188,32 @@ observed_task_id_ = io_task_controller_->Add(std::move(task)); } +void OneDriveUploadHandler::OnMountResponse(base::File::Error result) { + if (result != base::File::FILE_OK) { + OnEndUpload( + base::unexpected(GetReauthenticationRequiredMessage()), + OfficeFilesUploadResult::kUploadNotStartedReauthenticationRequired); + return; + } + tried_reauth_ = true; + GetODFSMetadataAndStartIOTask(); +} + +FileSystemURL OneDriveUploadHandler::GetDestinationFolderUrl() { + auto odfs_info = GetODFSInfo(profile_); + if (!odfs_info) { + // TODO(b/293363474): Remove when the underlying cause is diagnosed. + base::debug::DumpWithoutCrashing(FROM_HERE); + OnEndUpload(base::unexpected(GetGenericErrorMessage()), + OfficeFilesUploadResult::kFileSystemNotFound); + return FileSystemURL(); + } + + destination_folder_path_ = odfs_info->mount_path(); + return FilePathToFileSystemURL(profile_, file_system_context_, + destination_folder_path_); +} + void OneDriveUploadHandler::OnEndUpload( base::expected<storage::FileSystemURL, std::string> url, OfficeFilesUploadResult result_metric) { @@ -232,7 +261,12 @@ notification_manager_->SetDestinationPath(status.outputs[0].url.path()); notification_manager_->ShowUploadProgress(100); DCHECK_EQ(status.outputs.size(), 1u); - OnEndUpload(status.outputs[0].url, OfficeFilesUploadResult::kSuccess); + if (tried_reauth_) { + OnEndUpload(status.outputs[0].url, + OfficeFilesUploadResult::kSuccessAfterReauth); + } else { + OnEndUpload(status.outputs[0].url, OfficeFilesUploadResult::kSuccess); + } return; case file_manager::io_task::State::kCancelled: if (status.type == file_manager::io_task::OperationType::kCopy) {
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler.h b/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler.h index 7d989e7..29266beb 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler.h +++ b/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler.h
@@ -56,12 +56,19 @@ // Starts the upload workflow. Initiated by the `UploadToCloud` static method. void Run(UploadCallback callback); - // If reauth is required show an error and finish, or else start the IOTask - // for copy/move. + void GetODFSMetadataAndStartIOTask(); + + // If reauth is required, request a new mount without a notification. If that + // fails, show an error and finish, or else start the IOTask for copy/move. void CheckReauthenticationAndStartIOTask( const FileSystemURL& destination_folder_url, base::expected<ODFSMetadata, base::File::Error> metadata_or_error); + // Called when we have attempted to remount ODFS due to needing to reauth. + void OnMountResponse(base::File::Error result); + + FileSystemURL GetDestinationFolderUrl(); + // Ends upload and runs Upload callback. void OnEndUpload( base::expected<storage::FileSystemURL, std::string> url_or_error, @@ -106,6 +113,7 @@ // Total size (in bytes) required to upload. int64_t upload_size_ = 0; base::SafeRef<CloudOpenMetrics> cloud_open_metrics_; + bool tried_reauth_ = false; base::WeakPtrFactory<OneDriveUploadHandler> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler_browsertest.cc b/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler_browsertest.cc index 1a6740d..269652e 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler_browsertest.cc +++ b/chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler_browsertest.cc
@@ -6,6 +6,7 @@ #include "base/test/bind.h" #include "chrome/browser/ui/webui/ash/cloud_upload/one_drive_upload_handler.h" +#include "ash/constants/ash_features.h" #include "base/files/file.h" #include "base/files/file_util.h" #include "base/memory/raw_ptr.h" @@ -255,9 +256,9 @@ base::SafeRef<CloudOpenMetrics> cloud_open_metrics_ref_ = cloud_open_metrics_->GetSafeRef(); base::HistogramTester histogram_; + base::test::ScopedFeatureList feature_list_; private: - base::test::ScopedFeatureList feature_list_; base::ScopedTempDir temp_dir_; std::unique_ptr<base::RunLoop> run_loop_; // Used to observe upload notifications during the tests. @@ -417,6 +418,111 @@ OfficeFilesUploadResult::kUploadNotStartedReauthenticationRequired, 1); } +class OneDriveUploadHandlerTest_ReauthEnabled + : public OneDriveUploadHandlerTest { + public: + OneDriveUploadHandlerTest_ReauthEnabled() { + feature_list_.Reset(); + feature_list_.InitWithFeatures({chromeos::features::kUploadOfficeToCloud, + features::kOneDriveUploadImmediateReauth}, + {}); + } +}; + +// Test that when reauthentication to OneDrive is required (before starting the +// upload) interactive auth is requested without a prompt. And test that when +// the auth succeeds, the upload succeeds. +IN_PROC_BROWSER_TEST_F(OneDriveUploadHandlerTest_ReauthEnabled, + UploadSucceedsAfterReauth) { + SetUpMyFiles(); + SetUpODFS(); + // Ensure the first check of reauth required fails due to reauthentication to + // OneDrive being required. + provided_file_system_->SetReauthenticationRequired(true); + const std::string test_file_name = "text.docx"; + FileSystemURL source_file_url = + SetUpSourceFile(test_file_name, my_files_dir_); + + // Start the upload workflow and simulate a successful mount() request + // (indicating interactive auth has succeeded). + file_manager::test::GetFakeProviderOneDrive(profile())->SetRequestMountImpl( + base::BindLambdaForTesting( + [&](ash::file_system_provider::RequestMountCallback callback) { + // The second check of reauth required after the mount succeeds + // should be OK so we attempt upload. + provided_file_system_->SetReauthenticationRequired(false); + std::move(callback).Run(base::File::Error::FILE_OK); + })); + + OneDriveUploadHandler::Upload( + profile(), source_file_url, + base::BindOnce(&OneDriveUploadHandlerTest::OnUploadDone, + base::Unretained(this)), + cloud_open_metrics_ref_); + SetUpRunLoopAndWait(); + + // Check that the source file has been moved to OneDrive. + { + base::ScopedAllowBlockingForTesting allow_blocking; + EXPECT_FALSE(base::PathExists(my_files_dir_.AppendASCII(test_file_name))); + CheckPathExistsOnODFS(base::FilePath("/").AppendASCII(test_file_name)); + } + + histogram_.ExpectUniqueSample(kOneDriveUploadResultMetricName, + OfficeFilesUploadResult::kSuccessAfterReauth, + 1); +} + +// Test that when reauthentication to OneDrive is required (before starting the +// upload) interactive auth is requested without a prompt. And test that when +// the auth fails, the upload is not attempted and instead the sign-in +// notification is shown. +IN_PROC_BROWSER_TEST_F(OneDriveUploadHandlerTest, + UploadNotAttemptedAfterFailedReauth) { + SetUpObservers(); + SetUpMyFiles(); + SetUpODFS(); + // Ensure the first check of reauth required fails due to reauthentication to + // OneDrive being required. + provided_file_system_->SetReauthenticationRequired(true); + const std::string test_file_name = "text.docx"; + FileSystemURL source_file_url = + SetUpSourceFile(test_file_name, my_files_dir_); + + // Start the upload workflow and simulate a failed mount() request (indicating + // interactive auth has failed). + file_manager::test::GetFakeProviderOneDrive(profile())->SetRequestMountImpl( + base::BindLambdaForTesting( + [&](ash::file_system_provider::RequestMountCallback callback) { + std::move(callback).Run(base::File::Error::FILE_ERROR_FAILED); + })); + + auto on_notification = base::BindLambdaForTesting( + [&](const message_center::Notification& notification) { + if (notification.message() == + base::UTF8ToUTF16(GetReauthenticationRequiredMessage())) { + EndWait(); + } + }); + SetOnNotificationDisplayedCallback(std::move(on_notification)); + SetUpRunLoop(); + OneDriveUploadHandler::Upload(profile(), source_file_url, base::DoNothing(), + cloud_open_metrics_ref_); + Wait(); + // Check that the source file still exists only at the intended source + // location and did not get uploaded to ODFS. + { + base::ScopedAllowBlockingForTesting allow_blocking; + EXPECT_TRUE(base::PathExists(my_files_dir_.AppendASCII(test_file_name))); + CheckPathNotFoundOnODFS(base::FilePath("/").AppendASCII(test_file_name)); + } + + histogram_.ExpectTotalCount(kOneDriveMoveErrorMetricName, 0); + histogram_.ExpectUniqueSample( + kOneDriveUploadResultMetricName, + OfficeFilesUploadResult::kUploadNotStartedReauthenticationRequired, 1); +} + // Test that when the upload to ODFS fails due an access error that is not // because reauthentication to OneDrive is required, the generic error // notification is shown.
diff --git a/chrome/browser/ui/webui/browsing_topics/browsing_topics_internals_page_handler.cc b/chrome/browser/ui/webui/browsing_topics/browsing_topics_internals_page_handler.cc index 181cf4ac..40aa7e6 100644 --- a/chrome/browser/ui/webui/browsing_topics/browsing_topics_internals_page_handler.cc +++ b/chrome/browser/ui/webui/browsing_topics/browsing_topics_internals_page_handler.cc
@@ -28,7 +28,6 @@ auto config = browsing_topics::mojom::WebUIBrowsingTopicsConfiguration::New( base::FeatureList::IsEnabled(blink::features::kBrowsingTopics), base::FeatureList::IsEnabled(features::kPrivacySandboxAdsAPIsOverride), - base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings3), base::FeatureList::IsEnabled( privacy_sandbox::kOverridePrivacySandboxSettingsLocalTesting), base::FeatureList::IsEnabled(
diff --git a/chrome/browser/ui/webui/realbox/realbox_handler.cc b/chrome/browser/ui/webui/realbox/realbox_handler.cc index 00582a264d..9ee188b 100644 --- a/chrome/browser/ui/webui/realbox/realbox_handler.cc +++ b/chrome/browser/ui/webui/realbox/realbox_handler.cc
@@ -674,12 +674,6 @@ } // static -void RealboxHandler::SetupDropdownWebUIDataSource( - content::WebUIDataSource* source, - Profile* profile) { -} - -// static std::string RealboxHandler::AutocompleteMatchVectorIconToResourceName( const gfx::VectorIcon& icon) { if (icon.name == omnibox::kAnswerCurrencyIcon.name ||
diff --git a/chrome/browser/ui/webui/realbox/realbox_handler.h b/chrome/browser/ui/webui/realbox/realbox_handler.h index 7c6117b..62f2a49 100644 --- a/chrome/browser/ui/webui/realbox/realbox_handler.h +++ b/chrome/browser/ui/webui/realbox/realbox_handler.h
@@ -58,8 +58,6 @@ static void SetupWebUIDataSource(content::WebUIDataSource* source, Profile* profile); - static void SetupDropdownWebUIDataSource(content::WebUIDataSource* source, - Profile* profile); static std::string AutocompleteMatchVectorIconToResourceName( const gfx::VectorIcon& icon); static std::string PedalVectorIconToResourceName(const gfx::VectorIcon& icon);
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 19e42c5..b411fd59 100644 --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -1804,8 +1804,10 @@ html_source->AddString( "doNotTrackDialogMessage", - l10n_util::GetStringFUTF16(IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_TEXT, - chrome::kDoNotTrackLearnMoreURL)); + l10n_util::GetStringFUTF16( + IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_TEXT, + chrome::kDoNotTrackLearnMoreURL, + l10n_util::GetStringUTF16(IDS_SETTINGS_OPENS_IN_NEW_TAB))); html_source->AddString("exceptionsLearnMoreURL", chrome::kContentSettingsExceptionsLearnMoreURL); html_source->AddBoolean( @@ -3337,7 +3339,8 @@ IDS_SETTINGS_TRACKING_PROTECTION_BULLET_TWO_DESCRIPTION, chrome::kUserBypassHelpCenterURL, l10n_util::GetStringUTF16( - IDS_SETTINGS_TRACKING_PROTECTION_BULLET_TWO_LEARN_MORE_ARIA_LABEL))); + IDS_SETTINGS_TRACKING_PROTECTION_BULLET_TWO_LEARN_MORE_ARIA_LABEL), + l10n_util::GetStringUTF16(IDS_SETTINGS_OPENS_IN_NEW_TAB))); html_source->AddString( "trackingProtectionRollbackNotice", l10n_util::GetStringFUTF16(
diff --git a/chrome/browser/ui/webui/signin/ash/inline_login_handler_impl.cc b/chrome/browser/ui/webui/signin/ash/inline_login_handler_impl.cc index ad792e2..0a92ce31 100644 --- a/chrome/browser/ui/webui/signin/ash/inline_login_handler_impl.cc +++ b/chrome/browser/ui/webui/signin/ash/inline_login_handler_impl.cc
@@ -85,25 +85,27 @@ return account_device_id; } -std::string GetInlineLoginFlowName(Profile* profile, - const absl::optional<std::string>& email) { - DCHECK(profile); - if (!profile->IsChild()) { - return kCrosAddAccountFlow; - } - +bool IsPrimaryAccountBeingReauthenticated( + Profile* profile, + const absl::optional<std::string>& email) { std::string primary_account_email = IdentityManagerFactory::GetForProfile(profile) ->GetPrimaryAccountInfo(signin::ConsentLevel::kSignin) .email; - // If provided email is for primary account - it's a reauthentication, use - // normal add account flow. - if (email && gaia::AreEmailsSame(primary_account_email, *email)) { - return kCrosAddAccountFlow; + + return email && gaia::AreEmailsSame(primary_account_email, *email); +} + +std::string GetInlineLoginFlowName(Profile* profile, + const absl::optional<std::string>& email) { + DCHECK(profile); + if (profile->IsChild() && + !IsPrimaryAccountBeingReauthenticated(profile, email)) { + // Child user is adding / reauthenticating a secondary account. + return kCrosAddAccountEduFlow; } - // Child user is adding/reauthenticating a secondary account. - return kCrosAddAccountEduFlow; + return kCrosAddAccountFlow; } const SkBitmap& GetDefaultAccountIcon() {
diff --git a/chrome/browser/ui/webui/signin/ash/inline_login_handler_impl_browsertest.cc b/chrome/browser/ui/webui/signin/ash/inline_login_handler_impl_browsertest.cc index 17ac1cd..6b5fbee9 100644 --- a/chrome/browser/ui/webui/signin/ash/inline_login_handler_impl_browsertest.cc +++ b/chrome/browser/ui/webui/signin/ash/inline_login_handler_impl_browsertest.cc
@@ -53,6 +53,7 @@ using testing::Eq; using testing::IsEmpty; +using testing::IsNull; using testing::Ne; using testing::Not; @@ -78,6 +79,8 @@ constexpr char kConsentLoggedCallback[] = "consent-logged-callback"; constexpr char kToSVersion[] = "12345678"; constexpr char kFakeDeviceId[] = "fake-device-id"; +constexpr char kCrosAddAccountFlow[] = "crosAddAccount"; +constexpr char kCrosAddAccountEduFlow[] = "crosAddAccountEdu"; struct DeviceAccountInfo { std::string id; @@ -433,6 +436,79 @@ EXPECT_THAT(GetDeviceIdFromWebview(), Ne(kFakeDeviceId)); } +IN_PROC_BROWSER_TEST_P(InlineLoginHandlerTest, + FlowNameForDeviceAccountReauthentication) { + base::Value::Dict params; + params.Set("email", primary_account_id().GetUserEmail()); + SetExtraInitParamsInHandler(params); + + std::string* flow_name = params.FindString("flow"); + ASSERT_THAT(flow_name, Not(IsNull())); + EXPECT_THAT(*flow_name, Eq(kCrosAddAccountFlow)); +} + +IN_PROC_BROWSER_TEST_P(InlineLoginHandlerTest, + FlowNameForRegularSecondaryAccountAddition) { + if (GetDeviceAccountInfo().user_type == + user_manager::UserType::USER_TYPE_CHILD) { + return; + } + + base::Value::Dict params; + SetExtraInitParamsInHandler(params); + + std::string* flow_name = params.FindString("flow"); + ASSERT_THAT(flow_name, Not(IsNull())); + EXPECT_THAT(*flow_name, Eq(kCrosAddAccountFlow)); +} + +IN_PROC_BROWSER_TEST_P(InlineLoginHandlerTest, + FlowNameForRegularSecondaryAccountReauthentication) { + if (GetDeviceAccountInfo().user_type == + user_manager::UserType::USER_TYPE_CHILD) { + return; + } + + base::Value::Dict params; + params.Set("email", kSecondaryAccount1Email); + SetExtraInitParamsInHandler(params); + + std::string* flow_name = params.FindString("flow"); + ASSERT_THAT(flow_name, Not(IsNull())); + EXPECT_THAT(*flow_name, Eq(kCrosAddAccountFlow)); +} + +IN_PROC_BROWSER_TEST_P(InlineLoginHandlerTest, + FlowNameForChildEduAccountAddition) { + if (GetDeviceAccountInfo().user_type != + user_manager::UserType::USER_TYPE_CHILD) { + return; + } + + base::Value::Dict params; + SetExtraInitParamsInHandler(params); + + std::string* flow_name = params.FindString("flow"); + ASSERT_THAT(flow_name, Not(IsNull())); + EXPECT_THAT(*flow_name, Eq(kCrosAddAccountEduFlow)); +} + +IN_PROC_BROWSER_TEST_P(InlineLoginHandlerTest, + FlowNameForChildEduAccountReauthentication) { + if (GetDeviceAccountInfo().user_type != + user_manager::UserType::USER_TYPE_CHILD) { + return; + } + + base::Value::Dict params; + params.Set("email", kSecondaryAccount1Email); + SetExtraInitParamsInHandler(params); + + std::string* flow_name = params.FindString("flow"); + ASSERT_THAT(flow_name, Not(IsNull())); + EXPECT_THAT(*flow_name, Eq(kCrosAddAccountEduFlow)); +} + INSTANTIATE_TEST_SUITE_P(InlineLoginHandlerTestSuite, InlineLoginHandlerTest, ::testing::Values(GetGaiaDeviceAccountInfo(),
diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_loader_factory_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_loader_factory_unittest.cc index 07968fc2..ab6e9f8 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_loader_factory_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_loader_factory_unittest.cc
@@ -238,7 +238,7 @@ content::SimpleURLLoaderTestHelper helper; loader->DownloadToString( - factory_.get(), helper.GetCallback(), + factory_.get(), helper.GetCallbackDeprecated(), network::SimpleURLLoader::kMaxBoundedStringDownloadSize); helper.WaitForCallback(); @@ -769,7 +769,7 @@ content::SimpleURLLoaderTestHelper helper; loader->DownloadToString( - factory.get(), helper.GetCallback(), + factory.get(), helper.GetCallbackDeprecated(), network::SimpleURLLoader::kMaxBoundedStringDownloadSize); task_environment()->RunUntilIdle();
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index 83d504cd..c28652a 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1700524724-fdc53fbc60caa5d41f38466fe609c4e29975a946.profdata +chrome-android32-main-1700546273-7daa42f8e4282949d5f27a5080981fee3f6c606a.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt index 007b1a0..1624929 100644 --- a/chrome/build/android-arm64.pgo.txt +++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@ -chrome-android64-main-1700524724-ff729c30352d18b51403da9b256e3e0363328a22.profdata +chrome-android64-main-1700546273-2081e6755d1b3c25f578de9ebf07b82eea8f8160.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 1223b1e..b81739d 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1700502951-155ce6db151477b0d949f6e2b44d315457ad73c6.profdata +chrome-linux-main-1700546273-b100c0234bd31ed0b81eeca1244ea02f9bd254a7.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index 16e7fd4..fe5a9bcc 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1699816418-396c9e96273205f16404b3d3e9a8ec24d56d39f0.profdata +chrome-mac-arm-main-1700553520-f48a56b9856ef071a06b5fea3144c16c38652386.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index f783c05..9a1a2c65c 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1700481515-d1c66873e16a8688d58d64d935a7525589205665.profdata +chrome-mac-main-1700524724-de11c555079fd371af8eec197803f8f1be4dfed8.profdata
diff --git a/chrome/build/win-arm64.pgo.txt b/chrome/build/win-arm64.pgo.txt index 65fa790..e0ceaf61 100644 --- a/chrome/build/win-arm64.pgo.txt +++ b/chrome/build/win-arm64.pgo.txt
@@ -1 +1 @@ -chrome-win-arm64-main-1700502951-94a0a6e7a69ad39e95ed4d8498f6b78f9423a37c.profdata +chrome-win-arm64-main-1700524724-c0cb959af165120a9b791fcc29784090689791ea.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 2978da5..7168ef8 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1700513608-4de10aa14cb363cc8467d67fc49d0d73bfd454e8.profdata +chrome-win32-main-1700546273-4a216f9848a9c86992564ed052fea3a080c394c9.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index b26a7e8..9febcd3 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1700513608-a3fab443cc3f04d70d43cc4ad3fe1c8e3c76276f.profdata +chrome-win64-main-1700524724-d79393b5221c9f9851ac35eb6b934948f449dc32.profdata
diff --git a/chrome/common/chromeos/extensions/api/_api_features.json b/chrome/common/chromeos/extensions/api/_api_features.json index 4a45863..ad37354 100644 --- a/chrome/common/chromeos/extensions/api/_api_features.json +++ b/chrome/common/chromeos/extensions/api/_api_features.json
@@ -102,5 +102,14 @@ "lacros" ], "channel": "stable" + }, + "os.diagnostics.createFanRoutine": { + "feature_flag": "TelemetryExtensionPendingApprovalApi" + }, + "os.diagnostics.isFanRoutineArgumentSupported": { + "feature_flag": "TelemetryExtensionPendingApprovalApi" + }, + "os.diagnostics.onFanRoutineFinished": { + "feature_flag": "TelemetryExtensionPendingApprovalApi" } }
diff --git a/chrome/common/chromeos/extensions/api/diagnostics.idl b/chrome/common/chromeos/extensions/api/diagnostics.idl index 18bd86e..8f30dba 100644 --- a/chrome/common/chromeos/extensions/api/diagnostics.idl +++ b/chrome/common/chromeos/extensions/api/diagnostics.idl
@@ -315,6 +315,29 @@ long timeout_seconds; }; + enum HardwarePresenceStatus { + // The hardware presence matches the description. + matched, + // The hardware presence does not match the description. + not_matched, + // There is no description available, skipping check. + not_configured + }; + + dictionary FanRoutineFinishedInfo { + DOMString? uuid; + boolean? has_passed; + // The ids of fans that can be controlled. + long[]? passed_fan_ids; + // The ids of fans that cannot be controlled. + long[]? failed_fan_ids; + // Whether the number of fan probed is matched. + HardwarePresenceStatus? fan_count_status; + }; + + dictionary RunFanRoutineArguments { + }; + dictionary CreateRoutineResponse { DOMString? uuid; }; @@ -443,6 +466,13 @@ // Checks whether a certain `RunVolumeButtonRoutineArguments` is supported on the platform. [supportsPromises] static void isVolumeButtonRoutineArgumentSupported(RunVolumeButtonRoutineArguments args, RoutineSupportStatusInfoCallback callback); + + [supportsPromises] static void createFanRoutine(RunFanRoutineArguments args, + CreateRoutineCallback callback); + + // Checks whether a certain `RunFanRoutineArguments` is supported on the platform. + [supportsPromises] static void isFanRoutineArgumentSupported(RunFanRoutineArguments args, + RoutineSupportStatusInfoCallback callback); }; interface Events { @@ -467,6 +497,9 @@ // Informs the extension that a volume button routine finished. static void onVolumeButtonRoutineFinished(VolumeButtonRoutineFinishedInfo finishedInfo); + // Informs the extension that a fan routine finished. + static void onFanRoutineFinished(FanRoutineFinishedInfo finishedInfo); + // Informs the extension that an exception occured. The error passed in // `ExceptionInfo` is non-recoverable. static void onRoutineException(ExceptionInfo exceptionInfo);
diff --git a/chrome/common/extensions/manifest_handlers/settings_overrides_handler.h b/chrome/common/extensions/manifest_handlers/settings_overrides_handler.h index 4989c0c..3feefd792 100644 --- a/chrome/common/extensions/manifest_handlers/settings_overrides_handler.h +++ b/chrome/common/extensions/manifest_handlers/settings_overrides_handler.h
@@ -15,7 +15,6 @@ enum SettingsApiOverrideType { BUBBLE_TYPE_HOME_PAGE = 0, BUBBLE_TYPE_SEARCH_ENGINE, - BUBBLE_TYPE_STARTUP_PAGES, }; // SettingsOverride is associated with "chrome_settings_overrides" manifest key.
diff --git a/chrome/test/data/webui/settings/cookies_page_test.ts b/chrome/test/data/webui/settings/cookies_page_test.ts index a7a8f07..8b967eb 100644 --- a/chrome/test/data/webui/settings/cookies_page_test.ts +++ b/chrome/test/data/webui/settings/cookies_page_test.ts
@@ -468,6 +468,10 @@ test('CheckVisibility', function() { // Page description assertTrue(isChildVisible(page, '#explanationText')); + assertEquals( + page.shadowRoot!.querySelector<HTMLAnchorElement>( + 'a[href]')!.getAttribute('aria-description'), + page.i18n('opensInNewTab')); // Advanced toggles assertTrue(isChildVisible(page, '#blockThirdPartyToggle'));
diff --git a/chrome/test/data/webui/settings/do_not_track_toggle_test.ts b/chrome/test/data/webui/settings/do_not_track_toggle_test.ts index 7a27a661..60871db 100644 --- a/chrome/test/data/webui/settings/do_not_track_toggle_test.ts +++ b/chrome/test/data/webui/settings/do_not_track_toggle_test.ts
@@ -5,6 +5,7 @@ // clang-format off import 'chrome://settings/lazy_load.js'; +import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {SettingsDoNotTrackToggleElement} from 'chrome://settings/lazy_load.js'; import {MetricsBrowserProxyImpl, PrivacyElementInteractions, SettingsToggleButtonElement} from 'chrome://settings/settings.js'; @@ -54,6 +55,10 @@ flush(); assertTrue(toggle().checked); + assertEquals( + testElement.shadowRoot!.querySelector<HTMLAnchorElement>( + 'a[href]')!.getAttribute('aria-description'), + loadTimeData.getString('opensInNewTab')); testElement.shadowRoot!.querySelector<HTMLElement>( '.cancel-button')!.click(); assertFalse(toggle().checked);
diff --git a/chrome/test/data/webui/settings/privacy_sandbox_page_test.ts b/chrome/test/data/webui/settings/privacy_sandbox_page_test.ts index fcfaf635..a3baab13 100644 --- a/chrome/test/data/webui/settings/privacy_sandbox_page_test.ts +++ b/chrome/test/data/webui/settings/privacy_sandbox_page_test.ts
@@ -501,7 +501,8 @@ assertEquals(links.length, 2, 'footer should contains two links'); links.forEach( link => assertEquals( - link.title, loadTimeData.getString('opensInNewTab'), + link.getAttribute('aria-description'), + loadTimeData.getString('opensInNewTab'), 'the link should indicate that it will be opened in a new tab')); const hrefs = Array.from<HTMLAnchorElement>(links).map(link => link.href); const expectedLinks = @@ -900,7 +901,8 @@ assertEquals(links.length, 2, 'footer should contains two links'); links.forEach( link => assertEquals( - link.title, loadTimeData.getString('opensInNewTab'), + link.getAttribute('aria-description'), + loadTimeData.getString('opensInNewTab'), 'the link should indicate that it will be opened in a new tab')); const hrefs = Array.from<HTMLAnchorElement>(links).map(link => link.href); const expectedLinks =
diff --git a/chrome/test/data/webui/settings/settings_subpage_test.ts b/chrome/test/data/webui/settings/settings_subpage_test.ts index bda1dc3a..e961bf11 100644 --- a/chrome/test/data/webui/settings/settings_subpage_test.ts +++ b/chrome/test/data/webui/settings/settings_subpage_test.ts
@@ -86,8 +86,10 @@ subpage.pageTitle = 'Title'; flush(); assertEquals( - subpage.i18n('subpageLearnMoreAriaLabel', subpage.pageTitle), - icon.ariaLabel); + icon.ariaLabel, + subpage.i18n('subpageLearnMoreAriaLabel', subpage.pageTitle)); + assertEquals( + icon?.getAttribute('aria-description'), subpage.i18n('opensInNewTab')); }); test('favicon', function() {
diff --git a/chrome/test/data/webui/settings/settings_toggle_button_test.ts b/chrome/test/data/webui/settings/settings_toggle_button_test.ts index 8250198a..eeb773e6 100644 --- a/chrome/test/data/webui/settings/settings_toggle_button_test.ts +++ b/chrome/test/data/webui/settings/settings_toggle_button_test.ts
@@ -5,6 +5,7 @@ // clang-format off import 'chrome://settings/settings.js'; +import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {DEFAULT_CHECKED_VALUE, DEFAULT_UNCHECKED_VALUE, SettingsToggleButtonElement} from 'chrome://settings/settings.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; @@ -271,6 +272,17 @@ assertTrue(testElement.checked); }); + test('learn more link should indicate it opens in new tab', () => { + testElement.set('learnMoreUrl', 'www.google.com'); + flush(); + const learnMoreLink = + testElement.shadowRoot!.querySelector<HTMLElement>('#learn-more'); + assertTrue(!!learnMoreLink); + assertEquals( + learnMoreLink.getAttribute('aria-description'), + loadTimeData.getString('opensInNewTab')); + }); + test('set label text should update aria-label of toggle', () => { const testLabelText = 'test label text'; testElement.setAttribute('label', testLabelText);
diff --git a/chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_routines.mojom b/chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_routines.mojom index 4043266..f523d44 100644 --- a/chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_routines.mojom +++ b/chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_routines.mojom
@@ -73,7 +73,7 @@ // Argument types for the possible routines the routine control API can create. // -// NextMinVersion: 3, NextIndex: 3 +// NextMinVersion: 4, NextIndex: 4 [Stable, Extensible] union RoutineArgument { // Default field is required by extensible unions for backward compatibility. @@ -83,6 +83,8 @@ [MinVersion=1] MemoryRoutineArgument memory@1; // Arguments to create a volume button routine. [MinVersion=2] VolumeButtonRoutineArgument volume_button@2; + // Arguments to create a fan routine. + [MinVersion=3] FanRoutineArgument fan@3; }; // This routine checks whether there is any memory problem by @@ -117,6 +119,12 @@ mojo_base.mojom.TimeDelta timeout@1; }; +// This routine checks whether the fan is controllable. +// +// NextMinVersion: 1, NextIndex: 0 +[Stable] +struct FanRoutineArgument {}; + // Interface exposed to clients for controlling a routine. // // Error Handling: @@ -226,7 +234,7 @@ // Details about a finished routine. // -// NextMinVersion: 3, NextIndex: 3 +// NextMinVersion: 4, NextIndex: 4 [Stable, Extensible] union RoutineDetail { // Default field is required by extensible unions for backward compatibility. @@ -236,6 +244,8 @@ [MinVersion=1] MemoryRoutineDetail memory@1; // Details of a completed volume button routine. [MinVersion=2] VolumeButtonRoutineDetail volume_button@2; + // Details of a completed fan routine. + [MinVersion=3] FanRoutineDetail fan@3; }; // Details regarding memory routine. @@ -322,3 +332,32 @@ // NextMinVersion: 1, NextIndex: 0 [Stable] struct VolumeButtonRoutineDetail {}; + +// Whether the given hardware probed matches the hardware description recorded. +// +// NextMinVersion: 1, NextIndex: 4 +[Stable, Extensible] +enum HardwarePresenceStatus { + // The default value is for backward compatibility, should not be used. + [Default] kUnmappedEnumField = 0, + // The hardware presence matches the description. + kMatched = 1, + // The hardware presence does not match the description. + kNotMatched = 2, + // There is no description available, skipping check. + kNotConfigured = 3, +}; + + +// Details regarding fan routine. +// +// NextMinVersion: 1, NextIndex: 3 +[Stable] +struct FanRoutineDetail { + // The ids of fans that can be controlled. + array<uint8> passed_fan_ids@0; + // The ids of fans that cannot be controlled. + array<uint8> failed_fan_ids@1; + // Whether the number of fan probed is matched. + HardwarePresenceStatus fan_count_status@2; +};
diff --git a/chromeos/crosapi/mojom/telemetry_diagnostic_routine_service.mojom b/chromeos/crosapi/mojom/telemetry_diagnostic_routine_service.mojom index 3064279..cd38271 100644 --- a/chromeos/crosapi/mojom/telemetry_diagnostic_routine_service.mojom +++ b/chromeos/crosapi/mojom/telemetry_diagnostic_routine_service.mojom
@@ -61,9 +61,15 @@ mojo_base.mojom.TimeDelta timeout@1; }; +// This routine checks whether the fan is controllable. +// +// NextMinVersion: 1, NextIndex: 1 +[Stable] +struct TelemetryDiagnosticFanRoutineArgument {}; + // Argument types for the possible routines the routine control API can create. // -// NextMinVersion: 3, NextIndex: 3 +// NextMinVersion: 4, NextIndex: 4 [Stable, Extensible] union TelemetryDiagnosticRoutineArgument { // Default field is required by extensible unions for backward compatibility. @@ -73,6 +79,8 @@ [MinVersion=1] TelemetryDiagnosticMemoryRoutineArgument memory@1; // Arguments to create a volume button routine. [MinVersion=2] TelemetryDiagnosticVolumeButtonRoutineArgument volume_button@2; + // Arguments to create a fan routine. + [MinVersion=3] TelemetryDiagnosticFanRoutineArgument fan@3; }; // Routine has been initialized but not yet started. @@ -194,9 +202,37 @@ [Stable] struct TelemetryDiagnosticVolumeButtonRoutineDetail {}; +// Whether the given hardware probed matches the hardware description recorded. +// +// NextMinVersion: 1, NextIndex: 4 +[Stable, Extensible] +enum TelemetryDiagnosticHardwarePresenceStatus { + // The default value is for backward compatibility, should not be used. + [Default] kUnmappedEnumField = 0, + // The hardware presence matches the description. + kMatched = 1, + // The hardware presence does not match the description. + kNotMatched = 2, + // There is no description available, skipping check. + kNotConfigured = 3, +}; + +// Details regarding fan routine. +// +// NextMinVersion: 1, NextIndex: 3 +[Stable] +struct TelemetryDiagnosticFanRoutineDetail { + // The ids of fans that can be controlled. + array<uint8> passed_fan_ids@0; + // The ids of fans that cannot be controlled. + array<uint8> failed_fan_ids@1; + // Whether the number of fan probed is matched. + TelemetryDiagnosticHardwarePresenceStatus fan_count_status@2; +}; + // Details about a finished routine. // -// NextMinVersion: 3, NextIndex: 3 +// NextMinVersion: 4, NextIndex: 4 [Stable, Extensible] union TelemetryDiagnosticRoutineDetail { // Default field is required by extensible unions for backward compatibility. @@ -206,6 +242,8 @@ [MinVersion=1] TelemetryDiagnosticMemoryRoutineDetail memory@1; // Details of a completed volume button routine. [MinVersion=2] TelemetryDiagnosticVolumeButtonRoutineDetail volume_button@2; + // Details of a completed fan routine. + [MinVersion=3] TelemetryDiagnosticFanRoutineDetail fan@3; }; // Information about a finished routine.
diff --git a/chromeos/profiles/arm-exp.afdo.newest.txt b/chromeos/profiles/arm-exp.afdo.newest.txt index bb7f4ee4..d56218d 100644 --- a/chromeos/profiles/arm-exp.afdo.newest.txt +++ b/chromeos/profiles/arm-exp.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-exp-121-6099.13-1699874308-benchmark-121.0.6128.0-r1-redacted.afdo.xz +chromeos-chrome-arm-exp-121-6126.0-1700479769-benchmark-121.0.6136.0-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/arm.afdo.newest.txt b/chromeos/profiles/arm.afdo.newest.txt index 9c55ca1..d9159ba 100644 --- a/chromeos/profiles/arm.afdo.newest.txt +++ b/chromeos/profiles/arm.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-none-121-6085.0-1699879816-benchmark-121.0.6136.0-r1-redacted.afdo.xz +chromeos-chrome-arm-none-121-6099.25-1700484597-benchmark-121.0.6137.0-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/atom.afdo.newest.txt b/chromeos/profiles/atom.afdo.newest.txt index 9380372..9528b8a 100644 --- a/chromeos/profiles/atom.afdo.newest.txt +++ b/chromeos/profiles/atom.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-atom-121-6099.13-1699874308-benchmark-121.0.6136.0-r1-redacted.afdo.xz +chromeos-chrome-amd64-atom-121-6126.0-1700479769-benchmark-121.0.6137.0-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/bigcore.afdo.newest.txt b/chromeos/profiles/bigcore.afdo.newest.txt index ea26047..be7cb982 100644 --- a/chromeos/profiles/bigcore.afdo.newest.txt +++ b/chromeos/profiles/bigcore.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-bigcore-121-6099.8-1699872611-benchmark-121.0.6136.0-r1-redacted.afdo.xz +chromeos-chrome-amd64-bigcore-121-6099.25-1700476772-benchmark-121.0.6137.0-r1-redacted.afdo.xz
diff --git a/clank b/clank index 271b17d..1b10f2fd 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit 271b17d7f642611a02c0b448cfb3b96f96c1ba3b +Subproject commit 1b10f2fd7011f7dd42e02cb6cf687c833494db65
diff --git a/components/autofill/content/renderer/password_autofill_agent.h b/components/autofill/content/renderer/password_autofill_agent.h index 7bbfabfe4..a5a768fb 100644 --- a/components/autofill/content/renderer/password_autofill_agent.h +++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -473,11 +473,12 @@ return autofill_agent_->field_data_manager(); } - // The logins we have filled so far with their associated info. + // A map from WebInput elements to `PasswordInfo` for all elements that + // password manager has fill information for. WebInputToPasswordInfoMap web_input_to_password_info_; - // A (sort-of) reverse map to |web_input_to_password_info_|. + // A (sort-of) reverse map to `web_input_to_password_info_`. PasswordToLoginMap password_to_username_; - // The chronologically last insertion into |web_input_to_password_info_|. + // The chronologically last insertion into `web_input_to_password_info_`. WebInputToPasswordInfoMap::iterator last_supplied_password_info_iter_; bool should_show_popup_without_passwords_ = false;
diff --git a/components/autofill/core/browser/autofill_download_manager.cc b/components/autofill/core/browser/autofill_download_manager.cc index 4d1e76c..50b78cf8 100644 --- a/components/autofill/core/browser/autofill_download_manager.cc +++ b/components/autofill/core/browser/autofill_download_manager.cc
@@ -389,6 +389,10 @@ out << Tr{} << "generation_type:" << static_cast<int>(field.generation_type()); } + if (field.has_initial_value_changed()) { + out << Tr{} << "initial_value_changed:" + << static_cast<int>(field.initial_value_changed()); + } } out << CTag{"table"}; out << CTag{"div"};
diff --git a/components/autofill/core/browser/browser_autofill_manager.cc b/components/autofill/core/browser/browser_autofill_manager.cc index c3912ed..34ea56f 100644 --- a/components/autofill/core/browser/browser_autofill_manager.cc +++ b/components/autofill/core/browser/browser_autofill_manager.cc
@@ -1916,7 +1916,8 @@ FormStructure* form_structure = FindCachedFormById(form.global_id()); if (form_structure && ShouldTriggerRefill(*form_structure)) { - FillingContext* filling_context = GetFillingContext(*form_structure); + FillingContext* filling_context = + GetFillingContext(form_structure->global_id()); DCHECK(filling_context); // This is enforced by ShouldTriggerRefill. filling_context->forced_fill_values[field.global_id()] = refill_value; ScheduleRefill(form, trigger_details); @@ -1937,7 +1938,8 @@ if (!GetCachedFormAndField(form, field, &form_structure, &autofill_field)) return; - FillingContext* filling_context = GetFillingContext(*form_structure); + FillingContext* filling_context = + GetFillingContext(form_structure->global_id()); if (!filling_context) return; @@ -2458,7 +2460,8 @@ // The form is already filled. // A refill has not been attempted for that form yet. // This fill is not a refill attempt. - FillingContext* filling_context = GetFillingContext(*form_structure); + FillingContext* filling_context = + GetFillingContext(form_structure->global_id()); bool could_attempt_refill = filling_context != nullptr && !filling_context->attempted_refill && !is_refill; @@ -3338,8 +3341,8 @@ } BrowserAutofillManager::FillingContext* -BrowserAutofillManager::GetFillingContext(const FormStructure& form) { - auto it = filling_context_.find(form.global_id()); +BrowserAutofillManager::GetFillingContext(FormGlobalId form_id) { + auto it = filling_context_.find(form_id); return it != filling_context_.end() ? it->second.get() : nullptr; } @@ -3347,7 +3350,8 @@ const FormStructure& form_structure) { // Should not refill if a form with the same FormGlobalId that has not been // filled before. - FillingContext* filling_context = GetFillingContext(form_structure); + FillingContext* filling_context = + GetFillingContext(form_structure.global_id()); if (filling_context == nullptr) return false; @@ -3372,7 +3376,8 @@ if (!form_structure) return; - FillingContext* filling_context = GetFillingContext(*form_structure); + FillingContext* filling_context = + GetFillingContext(form_structure->global_id()); DCHECK(filling_context != nullptr); // If a timer for the refill was already running, it means the form @@ -3398,7 +3403,8 @@ address_form_event_logger_->OnDidRefill(signin_state_for_metrics_, *form_structure); - FillingContext* filling_context = GetFillingContext(*form_structure); + FillingContext* filling_context = + GetFillingContext(form_structure->global_id()); DCHECK(filling_context); // The refill attempt can happen from different paths, some of which happen
diff --git a/components/autofill/core/browser/browser_autofill_manager.h b/components/autofill/core/browser/browser_autofill_manager.h index 30d5593..41ff9f7 100644 --- a/components/autofill/core/browser/browser_autofill_manager.h +++ b/components/autofill/core/browser/browser_autofill_manager.h
@@ -618,7 +618,7 @@ void SetFillingContext(const FormStructure& form, std::unique_ptr<FillingContext> context); - FillingContext* GetFillingContext(const FormStructure& form); + FillingContext* GetFillingContext(FormGlobalId form_id); // Whether there should be an attempts to refill the form. Returns true if all // the following are satisfied:
diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc index 16ab6a77..98e3a7ce 100644 --- a/components/autofill/core/browser/form_structure.cc +++ b/components/autofill/core/browser/form_structure.cc
@@ -1174,8 +1174,11 @@ // GeoIP, we want to hold on to these values. const bool same_value_as_on_page_load = field->value == cached_field->value; + const bool had_type = cached_field->Type().GetStorableType() > + ServerFieldType::UNKNOWN_TYPE || + !cached_field->possible_types().empty(); if (!cached_field->value.empty() && - !field->IsSelectOrSelectListElement()) { + !field->IsSelectOrSelectListElement() && had_type) { field->set_initial_value_changed(!same_value_as_on_page_load); } const bool field_is_neither_state_nor_country =
diff --git a/components/autofill/core/browser/form_structure_unittest.cc b/components/autofill/core/browser/form_structure_unittest.cc index 29cb267..8e7ccca 100644 --- a/components/autofill/core/browser/form_structure_unittest.cc +++ b/components/autofill/core/browser/form_structure_unittest.cc
@@ -6871,14 +6871,27 @@ TEST_F(FormStructureTestImpl, EncodeUploadRequest_SetsInitialValueChanged) { FormData form = test::GetFormData( - {.fields = {{.role = NAME_FIRST}, - {.role = NAME_LAST, .value = u"Doe"}, - {.role = EMAIL_ADDRESS, .value = u"test@example.com"}}}); + {.fields = { + // Field 1: Expect `initial_value_changed` not set because the field + // had no pre-filled value. + {.role = NAME_FIRST}, + // Field 2: Expect `initial_value_changed == false` because `value` + // doesn't change. + {.role = NAME_LAST, .value = u"Doe"}, + // Field 3: Expect `initial_value_changed == true` because `value` is + // changed (below). + {.role = EMAIL_ADDRESS, .value = u"test@example.com"}, + // Field 4: Expect `initial_value_changed` not set because the field + // type resolves to `UNKNOWN_TYPE`. + {.role = USERNAME, .value = u"username"}}}); // Form structure preserving the state from page load. FormStructure cached_form_structure(form); // Form structure containing the state on submit. FormStructure form_structure(form); + cached_form_structure.DetermineHeuristicTypes(GeoIpCountryCode(""), nullptr, + nullptr); + // Simulate user changed non-pre-filled field value. form_structure.field(0)->value = u"John"; // Simulate user changed pre-filled field value. @@ -6896,12 +6909,17 @@ ASSERT_EQ(uploads.size(), 1UL); const AutofillUploadContents& upload = uploads[0]; - ASSERT_EQ(upload.field_size(), 3); + ASSERT_EQ(upload.field_size(), 4); + // Field 1. EXPECT_FALSE(upload.field(0).has_initial_value_changed()); + // Field 2. EXPECT_TRUE(upload.field(1).has_initial_value_changed()); EXPECT_FALSE(upload.field(1).initial_value_changed()); + // Field 3. EXPECT_TRUE(upload.field(2).has_initial_value_changed()); EXPECT_TRUE(upload.field(2).initial_value_changed()); + // Field 4. + EXPECT_FALSE(upload.field(3).has_initial_value_changed()); } } // namespace autofill
diff --git a/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.cc b/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.cc index 5599825..2a551a4e 100644 --- a/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.cc +++ b/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.cc
@@ -114,4 +114,14 @@ NOTREACHED_NORETURN(); } +void LogRiskBasedAuthResult(CreditCard::RecordType card_type, + RiskBasedAuthEvent event) { + std::string card_type_histogram_string = + AutofillMetrics::GetHistogramStringForCardType(card_type); + base::UmaHistogramEnumeration( + base::StrCat( + {"Autofill.RiskBasedAuth", card_type_histogram_string, ".Result"}), + event); +} + } // namespace autofill::autofill_metrics
diff --git a/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h b/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h index 305d68aa..e26e983 100644 --- a/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h +++ b/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h
@@ -165,6 +165,27 @@ // This is used as a helper function for LogOtp methods. std::string GetOtpAuthType(CardUnmaskChallengeOptionType type); +// Card unmasking risk-based authentication-related metrics. +// Risk-based authentication-related events. +enum class RiskBasedAuthEvent { + // These values are persisted to logs. Entries should not be renumbered and + // numeric values should never be reused. + + // No further authentication is required. + kNoAuthenticationRequired = 0, + // The user needs to complete further authentication to retrieve the card. + kAuthenticationRequired = 1, + // The risk-based auth failed because the authentication was cancelled. + kAuthenticationCancelled = 2, + // The risk-based auth failed due to unexpected errors. + kUnexpectedError = 3, + kMaxValue = kUnexpectedError +}; + +// Logs when a risk-based authentication finishes. +void LogRiskBasedAuthResult(CreditCard::RecordType card_type, + RiskBasedAuthEvent event); + } // namespace autofill::autofill_metrics #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_METRICS_PAYMENTS_CARD_UNMASK_AUTHNTICATION_METRICS_H_
diff --git a/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.cc b/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.cc index 130183b..b9ce522c 100644 --- a/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.cc +++ b/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.cc
@@ -19,19 +19,19 @@ void LogServerCardUnmaskResult(ServerCardUnmaskResult unmask_result, AutofillClient::PaymentsRpcCardType card_type, - VirtualCardUnmaskFlowType flow_type) { + ServerCardUnmaskFlowType flow_type) { std::string flow_type_suffix; switch (flow_type) { - case VirtualCardUnmaskFlowType::kUnspecified: + case ServerCardUnmaskFlowType::kUnspecified: flow_type_suffix = ".UnspecifiedFlowType"; break; - case VirtualCardUnmaskFlowType::kFidoOnly: + case ServerCardUnmaskFlowType::kFidoOnly: flow_type_suffix = ".Fido"; break; - case VirtualCardUnmaskFlowType::kOtpOnly: + case ServerCardUnmaskFlowType::kOtpOnly: flow_type_suffix = ".Otp"; break; - case VirtualCardUnmaskFlowType::kOtpFallbackFromFido: + case ServerCardUnmaskFlowType::kOtpFallbackFromFido: flow_type_suffix = ".OtpFallbackFromFido"; break; }
diff --git a/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.h b/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.h index 959a212..847fe26 100644 --- a/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.h +++ b/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.h
@@ -39,10 +39,7 @@ kMaxValue = kUnexpectedError, }; -// TODO(crbug.com/1263302): Right now this is only used for virtual cards. -// Extend it for masked server cards in the future too. Tracks the flow type -// used in a virtual card unmasking. -enum class VirtualCardUnmaskFlowType { +enum class ServerCardUnmaskFlowType { // These values are persisted to logs. Entries should not be renumbered and // numeric values should never be reused. @@ -61,11 +58,9 @@ void LogServerCardUnmaskAttempt(AutofillClient::PaymentsRpcCardType card_type); -// TODO(crbug.com/1263302): These functions are used for only virtual cards -// now. Consider integrating with other masked server cards logging below. void LogServerCardUnmaskResult(ServerCardUnmaskResult unmask_result, AutofillClient::PaymentsRpcCardType card_type, - VirtualCardUnmaskFlowType flow_type); + ServerCardUnmaskFlowType flow_type); void LogServerCardUnmaskFormSubmission( AutofillClient::PaymentsRpcCardType card_type);
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 e40f9746..7c1b727 100644 --- a/components/autofill/core/browser/payments/credit_card_access_manager.cc +++ b/components/autofill/core/browser/payments/credit_card_access_manager.cc
@@ -25,6 +25,7 @@ #include "components/autofill/core/browser/form_data_importer.h" #include "components/autofill/core/browser/metrics/form_events/credit_card_form_event_logger.h" #include "components/autofill/core/browser/metrics/payments/better_auth_metrics.h" +#include "components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h" #include "components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.h" #include "components/autofill/core/browser/metrics/payments/mandatory_reauth_metrics.h" #include "components/autofill/core/browser/payments/autofill_error_dialog_context.h" @@ -316,7 +317,7 @@ autofill_metrics::LogServerCardUnmaskResult( autofill_metrics::ServerCardUnmaskResult::kLocalCacheHit, AutofillClient::PaymentsRpcCardType::kVirtualCard, - autofill_metrics::VirtualCardUnmaskFlowType::kUnspecified); + autofill_metrics::ServerCardUnmaskFlowType::kUnspecified); } Reset(); @@ -436,7 +437,7 @@ autofill_metrics::ServerCardUnmaskResult:: kOnlyFidoAvailableButNotOptedIn, AutofillClient::PaymentsRpcCardType::kVirtualCard, - autofill_metrics::VirtualCardUnmaskFlowType::kFidoOnly); + autofill_metrics::ServerCardUnmaskFlowType::kFidoOnly); return; } @@ -746,7 +747,7 @@ autofill_metrics::LogServerCardUnmaskResult( autofill_metrics::ServerCardUnmaskResult::kAuthenticationUnmasked, AutofillClient::PaymentsRpcCardType::kVirtualCard, - autofill_metrics::VirtualCardUnmaskFlowType::kFidoOnly); + autofill_metrics::ServerCardUnmaskFlowType::kFidoOnly); } // Save credit card for caching purpose. @@ -780,7 +781,7 @@ autofill_metrics::LogServerCardUnmaskResult( autofill_metrics::ServerCardUnmaskResult::kVirtualCardRetrievalError, AutofillClient::PaymentsRpcCardType::kVirtualCard, - autofill_metrics::VirtualCardUnmaskFlowType::kFidoOnly); + autofill_metrics::ServerCardUnmaskFlowType::kFidoOnly); } Reset(); } else { @@ -854,13 +855,13 @@ return; } - autofill_metrics::VirtualCardUnmaskFlowType flow_type; + autofill_metrics::ServerCardUnmaskFlowType flow_type; if (unmask_auth_flow_type_ == UnmaskAuthFlowType::kOtp) { - flow_type = autofill_metrics::VirtualCardUnmaskFlowType::kOtpOnly; + flow_type = autofill_metrics::ServerCardUnmaskFlowType::kOtpOnly; } else { DCHECK(unmask_auth_flow_type_ == UnmaskAuthFlowType::kOtpFallbackFromFido); flow_type = - autofill_metrics::VirtualCardUnmaskFlowType::kOtpFallbackFromFido; + autofill_metrics::ServerCardUnmaskFlowType::kOtpFallbackFromFido; } autofill_metrics::LogServerCardUnmaskResult( result, AutofillClient::PaymentsRpcCardType::kVirtualCard, flow_type); @@ -1076,8 +1077,8 @@ client_->ShowAutofillProgressDialog( AutofillProgressDialogType::kServerCardUnmaskProgressDialog, /*cancel_callback=*/base::BindOnce( - &CreditCardAccessManager::OnRiskBasedAuthenticationCancelled, - weak_ptr_factory_.GetWeakPtr())); + &CreditCardRiskBasedAuthenticator::OnUnmaskCancelled, + client_->GetRiskBasedAuthenticator()->AsWeakPtr())); client_->GetRiskBasedAuthenticator()->Authenticate( *card_, weak_ptr_factory_.GetWeakPtr()); @@ -1217,6 +1218,18 @@ AutofillClient::UnmaskAuthMethod::kFido)); break; case CreditCardRiskBasedAuthenticator::RiskBasedAuthenticationResponse:: + Result::kAuthenticationCancelled: + std::move(on_credit_card_fetched_callback_) + .Run(CreditCardFetchResult::kTransientError, nullptr); + + autofill_metrics::LogServerCardUnmaskResult( + autofill_metrics::ServerCardUnmaskResult::kFlowCancelled, + AutofillClient::PaymentsRpcCardType::kServerCard, + autofill_metrics::ServerCardUnmaskFlowType::kUnspecified); + + Reset(); + break; + case CreditCardRiskBasedAuthenticator::RiskBasedAuthenticationResponse:: Result::kError: // Shows error dialog to users if the authentication failed. client_->CloseAutofillProgressDialog( @@ -1224,6 +1237,12 @@ std::move(on_credit_card_fetched_callback_) .Run(CreditCardFetchResult::kTransientError, nullptr); client_->ShowAutofillErrorDialog(response.error_dialog_context); + + autofill_metrics::LogServerCardUnmaskResult( + autofill_metrics::ServerCardUnmaskResult::kUnexpectedError, + AutofillClient::PaymentsRpcCardType::kServerCard, + autofill_metrics::ServerCardUnmaskFlowType::kUnspecified); + Reset(); break; case CreditCardRiskBasedAuthenticator::RiskBasedAuthenticationResponse:: @@ -1294,7 +1313,7 @@ } autofill_metrics::LogServerCardUnmaskResult( unmask_result, AutofillClient::PaymentsRpcCardType::kVirtualCard, - autofill_metrics::VirtualCardUnmaskFlowType::kUnspecified); + autofill_metrics::ServerCardUnmaskFlowType::kUnspecified); if (response_details.autofill_error_dialog_context) { DCHECK( @@ -1348,13 +1367,12 @@ ->SetCardRecordTypeIfNonInteractiveAuthenticationFlowCompleted( record_type); - // TODO(crbug.com/1470933): Log the unmask result for masked server card. - if (record_type == CreditCard::RecordType::kVirtualCard) { - autofill_metrics::LogServerCardUnmaskResult( - autofill_metrics::ServerCardUnmaskResult::kRiskBasedUnmasked, - AutofillClient::PaymentsRpcCardType::kVirtualCard, - autofill_metrics::VirtualCardUnmaskFlowType::kUnspecified); - } + autofill_metrics::LogServerCardUnmaskResult( + autofill_metrics::ServerCardUnmaskResult::kRiskBasedUnmasked, + record_type == CreditCard::RecordType::kVirtualCard + ? AutofillClient::PaymentsRpcCardType::kVirtualCard + : AutofillClient::PaymentsRpcCardType::kServerCard, + autofill_metrics::ServerCardUnmaskFlowType::kUnspecified); // `OnCreditCardFetchedCallback` makes a copy of `card` and `cvc` before it // asynchronously fills them into the form. Thus we can safely call @@ -1439,17 +1457,17 @@ client_->GetOtpAuthenticator()->Reset(); } - autofill_metrics::VirtualCardUnmaskFlowType flow_type; + autofill_metrics::ServerCardUnmaskFlowType flow_type; switch (unmask_auth_flow_type_) { case UnmaskAuthFlowType::kOtp: - flow_type = autofill_metrics::VirtualCardUnmaskFlowType::kOtpOnly; + flow_type = autofill_metrics::ServerCardUnmaskFlowType::kOtpOnly; break; case UnmaskAuthFlowType::kOtpFallbackFromFido: flow_type = - autofill_metrics::VirtualCardUnmaskFlowType::kOtpFallbackFromFido; + autofill_metrics::ServerCardUnmaskFlowType::kOtpFallbackFromFido; break; case UnmaskAuthFlowType::kNone: - flow_type = autofill_metrics::VirtualCardUnmaskFlowType::kUnspecified; + flow_type = autofill_metrics::ServerCardUnmaskFlowType::kUnspecified; break; case UnmaskAuthFlowType::kFido: case UnmaskAuthFlowType::kCvcThenFido: @@ -1467,14 +1485,6 @@ Reset(); } -void CreditCardAccessManager::OnRiskBasedAuthenticationCancelled() { - std::move(on_credit_card_fetched_callback_) - .Run(CreditCardFetchResult::kTransientError, nullptr); - - // TODO(crbug.com/1470933): Log the cancel metrics. - Reset(); -} - void CreditCardAccessManager::Reset() { weak_ptr_factory_.InvalidateWeakPtrs(); unmask_auth_flow_type_ = UnmaskAuthFlowType::kNone;
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 c465f13..00e17e9 100644 --- a/components/autofill/core/browser/payments/credit_card_access_manager.h +++ b/components/autofill/core/browser/payments/credit_card_access_manager.h
@@ -193,10 +193,6 @@ return ShouldOfferFidoOptInDialog(response); } - void OnRiskBasedAuthenticationCancelledForTesting() { - OnRiskBasedAuthenticationCancelled(); - } - #if BUILDFLAG(IS_ANDROID) bool ShouldOfferFidoAuthForTesting() { return ShouldOfferFidoAuth(); } #endif @@ -390,10 +386,6 @@ // unmasking. void OnVirtualCardUnmaskCancelled(); - // Callback function invoked when the user has cancelled the risk-based card - // authentication. - void OnRiskBasedAuthenticationCancelled(); - // Reset all the member variables of |this| and restore initial states. void Reset();
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 da67ccd..8c614f3 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
@@ -27,6 +27,7 @@ #include "components/autofill/core/browser/data_model/credit_card.h" #include "components/autofill/core/browser/metrics/form_events/credit_card_form_event_logger.h" #include "components/autofill/core/browser/metrics/payments/better_auth_metrics.h" +#include "components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h" #include "components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.h" #include "components/autofill/core/browser/payments/autofill_error_dialog_context.h" #include "components/autofill/core/browser/payments/card_unmask_challenge_option.h" @@ -2770,6 +2771,13 @@ // the server during a risk-based retrieval. TEST_F(CreditCardAccessManagerRiskBasedMaskedServerCardUnmaskingTest, RiskBasedMaskedServerCardUnmasking_Success) { +#if BUILDFLAG(IS_ANDROID) + if (base::android::BuildInfo::GetInstance()->is_automotive()) { + GTEST_SKIP() << "This test should not run on automotive."; + } +#endif // BUILDFLAG(IS_ANDROID) + + base::HistogramTester histogram_tester; std::string test_number = "4444333322221111"; CreditCard* masked_server_card = CreateServerCard(kTestGUID, test_number, /*masked=*/true, kTestServerId); @@ -2805,12 +2813,18 @@ ->GetCardRecordTypeIfNonInteractiveAuthenticationFlowCompleted(); ASSERT_TRUE(card_identifier.has_value()); EXPECT_EQ(card_identifier.value(), CreditCard::RecordType::kMaskedServerCard); + + // Expect the metrics are logged correctly. + histogram_tester.ExpectUniqueSample( + "Autofill.ServerCardUnmask.ServerCard.Result.UnspecifiedFlowType", + autofill_metrics::ServerCardUnmaskResult::kRiskBasedUnmasked, 1); } // Ensures that the masked server card risk-based unmasking response is // handled correctly if the retrieval failed. TEST_F(CreditCardAccessManagerRiskBasedMaskedServerCardUnmaskingTest, RiskBasedMaskedServerCardUnmasking_RetrievalError) { + base::HistogramTester histogram_tester; CreditCard* masked_server_card = CreateServerCard(kTestGUID, kTestNumber, /*masked=*/true, kTestServerId); @@ -2833,12 +2847,18 @@ // Expect the CreditCardAccessManager to end the session. EXPECT_EQ(accessor_->result(), CreditCardFetchResult::kTransientError); EXPECT_TRUE(autofill_client_.autofill_error_dialog_shown()); + + // Expect the metrics are logged correctly. + histogram_tester.ExpectUniqueSample( + "Autofill.ServerCardUnmask.ServerCard.Result.UnspecifiedFlowType", + autofill_metrics::ServerCardUnmaskResult::kUnexpectedError, 1); } // Ensures that the masked server card risk-based unmasking response is // handled correctly if the flow is cancelled. TEST_F(CreditCardAccessManagerRiskBasedMaskedServerCardUnmaskingTest, RiskBasedMaskedServerCardUnmasking_FlowCancelled) { + base::HistogramTester histogram_tester; CreditCard* masked_server_card = CreateServerCard(kTestGUID, kTestNumber, /*masked=*/true, kTestServerId); @@ -2851,11 +2871,20 @@ EXPECT_TRUE(autofill_client_.risk_based_authentication_invoked()); EXPECT_TRUE(autofill_client_.autofill_progress_dialog_shown()); - // Mock the flow is cancelled. - credit_card_access_manager().OnRiskBasedAuthenticationCancelledForTesting(); + // Mock the authentication is cancelled. + credit_card_access_manager().OnRiskBasedAuthenticationResponseReceived( + CreditCardRiskBasedAuthenticator::RiskBasedAuthenticationResponse() + .with_result(CreditCardRiskBasedAuthenticator:: + RiskBasedAuthenticationResponse::Result:: + kAuthenticationCancelled)); // Expect the CreditCardAccessManager to end the session. EXPECT_EQ(accessor_->result(), CreditCardFetchResult::kTransientError); + + // Expect the metrics are logged correctly. + histogram_tester.ExpectUniqueSample( + "Autofill.ServerCardUnmask.ServerCard.Result.UnspecifiedFlowType", + autofill_metrics::ServerCardUnmaskResult::kFlowCancelled, 1); } // Ensures that the masked server card risk-based authentication is not invoked @@ -3029,7 +3058,11 @@ CreditCard* masked_server_card = CreateServerCard(kTestGUID, test_number, /*masked=*/true, kTestServerId); + payments_network_interface().ShouldReturnUnmaskDetailsImmediately(false); + credit_card_access_manager().PrepareToFetchCreditCard(); + MockRiskBasedAuthSucceedsWithoutPanReturned(masked_server_card); + histogram_tester.ExpectUniqueSample( "Autofill.BetterAuth.FlowEvents.Cvc", CreditCardFormEventLogger::UnmaskAuthFlowEvent::kPromptShown, 1);
diff --git a/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.cc b/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.cc index c8d8bc3..539a209 100644 --- a/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.cc +++ b/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.cc
@@ -6,6 +6,7 @@ #include "base/check_deref.h" #include "base/strings/utf_string_conversions.h" +#include "components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h" #include "components/autofill/core/browser/payments/autofill_payments_feature_availability.h" #include "components/autofill/core/browser/payments/payments_util.h" @@ -107,6 +108,10 @@ card_.SetNumber(base::UTF8ToUTF16(response_details.real_pan)); card_.set_record_type(CreditCard::RecordType::kFullServerCard); response.card = card_; + + autofill_metrics::LogRiskBasedAuthResult( + CreditCard::RecordType::kMaskedServerCard, + autofill_metrics::RiskBasedAuthEvent::kNoAuthenticationRequired); } else { // The Payments server indicates further authentication is required. response.result = @@ -114,6 +119,10 @@ response.fido_request_options = std::move(response_details.fido_request_options); response.context_token = response_details.context_token; + + autofill_metrics::LogRiskBasedAuthResult( + CreditCard::RecordType::kMaskedServerCard, + autofill_metrics::RiskBasedAuthEvent::kAuthenticationRequired); } } else { // We received an error when attempting to unmask the card. @@ -126,7 +135,9 @@ : AutofillErrorDialogType:: kMaskedServerCardRiskBasedUnmaskingPermanentError; - // TODO(crbug.com/1470933): Log the error metrics. + autofill_metrics::LogRiskBasedAuthResult( + CreditCard::RecordType::kMaskedServerCard, + autofill_metrics::RiskBasedAuthEvent::kUnexpectedError); } if (requester_) { @@ -135,6 +146,17 @@ Reset(); } +void CreditCardRiskBasedAuthenticator::OnUnmaskCancelled() { + autofill_metrics::LogRiskBasedAuthResult( + CreditCard::RecordType::kMaskedServerCard, + autofill_metrics::RiskBasedAuthEvent::kAuthenticationCancelled); + + requester_->OnRiskBasedAuthenticationResponseReceived( + RiskBasedAuthenticationResponse().with_result( + RiskBasedAuthenticationResponse::Result::kAuthenticationCancelled)); + Reset(); +} + void CreditCardRiskBasedAuthenticator::Reset() { weak_ptr_factory_.InvalidateWeakPtrs(); autofill_client_->GetPaymentsNetworkInterface()->CancelRequest();
diff --git a/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.h b/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.h index 12ee8e76..8046674 100644 --- a/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.h +++ b/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.h
@@ -35,8 +35,10 @@ // The user needs to complete further authentication to retrieve the card. // Also known as yellow path. kAuthenticationRequired = 2, + // The authentication has been cancelled. + kAuthenticationCancelled = 3, // The authentication failed. Also known as red path. - kError = 3, + kError = 4, kMaxValue = kError, }; @@ -107,6 +109,13 @@ virtual void Authenticate(CreditCard card, base::WeakPtr<Requester> requester); + // Callback function invoked when an unmask response has been cancelled. + void OnUnmaskCancelled(); + + base::WeakPtr<CreditCardRiskBasedAuthenticator> AsWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); + } + void OnUnmaskResponseReceivedForTesting( AutofillClient::PaymentsRpcResult result, payments::PaymentsNetworkInterface::UnmaskResponseDetails&
diff --git a/components/autofill/core/browser/payments/credit_card_risk_based_authenticator_unittest.cc b/components/autofill/core/browser/payments/credit_card_risk_based_authenticator_unittest.cc index 327cccc..e63f6e87 100644 --- a/components/autofill/core/browser/payments/credit_card_risk_based_authenticator_unittest.cc +++ b/components/autofill/core/browser/payments/credit_card_risk_based_authenticator_unittest.cc
@@ -7,9 +7,11 @@ #include <memory> #include "base/strings/utf_string_conversions.h" +#include "base/test/metrics/histogram_tester.h" #include "base/test/task_environment.h" #include "components/autofill/core/browser/autofill_test_utils.h" #include "components/autofill/core/browser/data_model/credit_card.h" +#include "components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h" #include "components/autofill/core/browser/payments/test_authentication_requester.h" #include "components/autofill/core/browser/payments/test_payments_network_interface.h" #include "components/autofill/core/browser/test_autofill_client.h" @@ -83,6 +85,7 @@ // Test that risk-based authentication returns the full PAN upon success. TEST_F(CreditCardRiskBasedAuthenticatorTest, AuthenticateServerCardSuccess) { + base::HistogramTester histogram_tester; authenticator_->Authenticate(card_, requester_->GetWeakPtr()); // Mock server response with valid masked server card information. @@ -99,11 +102,17 @@ kTestNumber, base::UTF16ToUTF8( requester_->risk_based_authentication_response().card->number())); + + // Expect the metrics are logged correctly. + histogram_tester.ExpectUniqueSample( + "Autofill.RiskBasedAuth.ServerCard.Result", + autofill_metrics::RiskBasedAuthEvent::kNoAuthenticationRequired, 1); } // Test that risk-based authentication doesn't return the full PAN when the // server call fails. TEST_F(CreditCardRiskBasedAuthenticatorTest, AuthenticateServerCardFailure) { + base::HistogramTester histogram_tester; authenticator_->Authenticate(card_, requester_->GetWeakPtr()); // Payment server response when unmask request fails is empty. @@ -114,12 +123,35 @@ EXPECT_EQ(requester_->risk_based_authentication_response().result, CreditCardRiskBasedAuthenticator::RiskBasedAuthenticationResponse:: Result::kError); + + // Expect the metrics are logged correctly. + histogram_tester.ExpectUniqueSample( + "Autofill.RiskBasedAuth.ServerCard.Result", + autofill_metrics::RiskBasedAuthEvent::kUnexpectedError, 1); +} + +// Test that the requester receives `kAuthenticationCancelled` response when the +// risk-based authentication was cancelled. +TEST_F(CreditCardRiskBasedAuthenticatorTest, AuthenticateServerCardCancelled) { + base::HistogramTester histogram_tester; + authenticator_->Authenticate(card_, requester_->GetWeakPtr()); + + authenticator_->OnUnmaskCancelled(); + EXPECT_EQ(requester_->risk_based_authentication_response().result, + CreditCardRiskBasedAuthenticator::RiskBasedAuthenticationResponse:: + Result::kAuthenticationCancelled); + + // Expect the metrics are logged correctly. + histogram_tester.ExpectUniqueSample( + "Autofill.RiskBasedAuth.ServerCard.Result", + autofill_metrics::RiskBasedAuthEvent::kAuthenticationCancelled, 1); } // Test that risk-based authentication determines authentication is required // when the server call succeeds and the PAN is not returned. TEST_F(CreditCardRiskBasedAuthenticatorTest, AuthenticateServerCardSuccess_PanNotReturned) { + base::HistogramTester histogram_tester; authenticator_->Authenticate(card_, requester_->GetWeakPtr()); // Mock server response with context token. @@ -133,12 +165,18 @@ Result::kAuthenticationRequired); EXPECT_FALSE( requester_->risk_based_authentication_response().card.has_value()); + + // Expect the metrics are logged correctly. + histogram_tester.ExpectUniqueSample( + "Autofill.RiskBasedAuth.ServerCard.Result", + autofill_metrics::RiskBasedAuthEvent::kAuthenticationRequired, 1); } // Test that risk-based authentication determines authentication is required // when the server call succeeds and the `fido_request_options` is returned. TEST_F(CreditCardRiskBasedAuthenticatorTest, AuthenticateServerCardSuccess_FidoReturned) { + base::HistogramTester histogram_tester; authenticator_->Authenticate(card_, requester_->GetWeakPtr()); // Mock server response with FIDO request options. @@ -154,6 +192,11 @@ requester_->risk_based_authentication_response().card.has_value()); EXPECT_TRUE(requester_->risk_based_authentication_response() .fido_request_options.has_value()); + + // Expect the metrics are logged correctly. + histogram_tester.ExpectUniqueSample( + "Autofill.RiskBasedAuth.ServerCard.Result", + autofill_metrics::RiskBasedAuthEvent::kAuthenticationRequired, 1); } // Test a success risk based virtual card unmask request.
diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn index e800328..3e58cdc 100644 --- a/components/browser_ui/site_settings/android/BUILD.gn +++ b/components/browser_ui/site_settings/android/BUILD.gn
@@ -74,7 +74,6 @@ "java/src/org/chromium/components/browser_ui/site_settings/FPSCookieInfo.java", "java/src/org/chromium/components/browser_ui/site_settings/FPSCookieSettings.java", "java/src/org/chromium/components/browser_ui/site_settings/ForwardingManagedPreferenceDelegate.java", - "java/src/org/chromium/components/browser_ui/site_settings/FourStateCookieSettingsPreference.java", "java/src/org/chromium/components/browser_ui/site_settings/GroupedWebsitesActivityHolder.java", "java/src/org/chromium/components/browser_ui/site_settings/GroupedWebsitesSettings.java", "java/src/org/chromium/components/browser_ui/site_settings/LocalStorageInfo.java", @@ -245,7 +244,6 @@ "java/res/layout/clear_reset_dialog.xml", "java/res/layout/clear_storage.xml", "java/res/layout/edit_site_dialog_content.xml", - "java/res/layout/four_state_cookie_settings_preference.xml", "java/res/layout/settings_card.xml", "java/res/layout/storage_preferences_view.xml", "java/res/layout/tri_state_cookie_settings_preference.xml",
diff --git a/components/browser_ui/site_settings/android/java/res/layout/four_state_cookie_settings_preference.xml b/components/browser_ui/site_settings/android/java/res/layout/four_state_cookie_settings_preference.xml deleted file mode 100644 index 3ab289cb1..0000000 --- a/components/browser_ui/site_settings/android/java/res/layout/four_state_cookie_settings_preference.xml +++ /dev/null
@@ -1,91 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -Copyright 2020 The Chromium Authors -Use of this source code is governed by a BSD-style license that can be -found in the LICENSE file. ---> - -<!-- Layout used by the FourStateCookieSettingsPreference. --> - -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:focusable="false" - android:orientation="vertical"> - - <org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionLayout - android:id="@+id/radio_button_layout" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <org.chromium.components.browser_ui.widget.RadioButtonWithDescription - android:id="@+id/allow" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:primaryText="@string/website_settings_category_cookie_allow_title" - app:descriptionText="@string/website_settings_category_cookie_allow_addition" /> - - <org.chromium.components.browser_ui.widget.RadioButtonWithDescription - android:id="@+id/block_third_party_incognito" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:primaryText="@string/website_settings_category_cookie_block_third_party_incognito_title" - app:descriptionText="@string/website_settings_third_party_cookies_page_block_radio_sub_label" /> - - <org.chromium.components.browser_ui.widget.RadioButtonWithDescription - android:id="@+id/block_third_party" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:primaryText="@string/website_settings_category_cookie_block_third_party_title" - app:descriptionText="@string/website_settings_third_party_cookies_page_block_radio_sub_label" /> - - <org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionAndAuxButton - android:id="@+id/block_third_party_incognito_with_aux" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:visibility="gone" - app:primaryText="@string/website_settings_category_cookie_block_third_party_incognito_title" - app:descriptionText="@string/website_settings_third_party_cookies_page_block_radio_sub_label" /> - - <org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionAndAuxButton - android:id="@+id/block_third_party_with_aux" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:visibility="gone" - app:primaryText="@string/website_settings_category_cookie_block_third_party_title" - app:descriptionText="@string/website_settings_third_party_cookies_page_block_radio_sub_label" /> - - <org.chromium.components.browser_ui.widget.RadioButtonWithDescription - android:id="@+id/block" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:primaryText="@string/website_settings_category_cookie_block_title" - app:descriptionText="@string/website_settings_category_cookie_block_addition" /> - - </org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionLayout> - - <org.chromium.components.browser_ui.widget.text.TextViewWithCompoundDrawables - android:id="@+id/managed_view_legacy" - android:text="@string/managed_by_your_organization" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:visibility="gone" - android:gravity="center_vertical" - android:padding="16dp" - android:drawablePadding="10dp" - app:chromeDrawableTint="@macro/default_icon_color" - android:textAppearance="@style/TextAppearance.TextMedium.Primary"/> - - <org.chromium.components.browser_ui.widget.text.TextViewWithCompoundDrawables - android:id="@+id/managed_disclaimer_text" - style="@style/ManagedDisclaimerView" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:drawablePadding="20dp" - android:padding="16dp" - android:paddingStart="20dp" - android:visibility="gone" /> - -</LinearLayout>
diff --git a/components/browser_ui/site_settings/android/java/res/xml/website_preferences.xml b/components/browser_ui/site_settings/android/java/res/xml/website_preferences.xml index 66fbda70..a56e31f 100644 --- a/components/browser_ui/site_settings/android/java/res/xml/website_preferences.xml +++ b/components/browser_ui/site_settings/android/java/res/xml/website_preferences.xml
@@ -24,9 +24,6 @@ "binary_toggle" above and the "four_state_cookie_toggle" below. --> <org.chromium.components.browser_ui.site_settings.TriStateSiteSettingsPreference android:key="tri_state_toggle" /> - <!-- A four state toggle for cookie preferences, only shown for the Cookies category. --> - <org.chromium.components.browser_ui.site_settings.FourStateCookieSettingsPreference - android:key="four_state_cookie_toggle" /> <!-- A three state toggle for third-party cookies preferences, only shown for the ThirdPartyCookies category. --> <org.chromium.components.browser_ui.site_settings.TriStateCookieSettingsPreference android:key="tri_state_cookie_toggle" />
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/AddExceptionPreference.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/AddExceptionPreference.java index 6a267c0..3e5d1403 100644 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/AddExceptionPreference.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/AddExceptionPreference.java
@@ -122,13 +122,7 @@ final EditText input = view.findViewById(R.id.site); final CheckBoxWithDescription checkBox = view.findViewById(R.id.add_site_dialog_checkbox); - if (mCategory.getType() == SiteSettingsCategory.Type.COOKIES) { - checkBox.setVisibility(View.VISIBLE); - checkBox.setPrimaryText( - getContext() - .getString( - R.string.website_settings_third_party_cookies_exception_label)); - } else if (mCategory.getType() == SiteSettingsCategory.Type.REQUEST_DESKTOP_SITE) { + if (mCategory.getType() == SiteSettingsCategory.Type.REQUEST_DESKTOP_SITE) { // Default to domain level setting for Request Desktop Site. checkBox.setChecked(true); checkBox.setVisibility(View.VISIBLE); @@ -224,10 +218,7 @@ @VisibleForTesting static String getPrimaryPattern(@NonNull String pattern, int type, boolean isChecked) { - if (type == SiteSettingsCategory.Type.COOKIES) { - // If a user clicks the third party checkbox, set wildcard as primary. - return isChecked ? SITE_WILDCARD : pattern; - } else if (type == SiteSettingsCategory.Type.THIRD_PARTY_COOKIES) { + if (type == SiteSettingsCategory.Type.THIRD_PARTY_COOKIES) { return SITE_WILDCARD; } return pattern; @@ -235,10 +226,7 @@ @VisibleForTesting static String getSecondaryPattern(@NonNull String pattern, int type, boolean isChecked) { - if (type == SiteSettingsCategory.Type.COOKIES) { - // If a user clicks the third party checkbox, set pattern as secondary. - return isChecked ? pattern : SITE_WILDCARD; - } else if (type == SiteSettingsCategory.Type.THIRD_PARTY_COOKIES) { + if (type == SiteSettingsCategory.Type.THIRD_PARTY_COOKIES) { return pattern; } return SITE_WILDCARD;
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/FPSCookieSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/FPSCookieSettings.java index 9f36c9a6..f3841e4 100644 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/FPSCookieSettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/FPSCookieSettings.java
@@ -19,11 +19,9 @@ import org.chromium.components.user_prefs.UserPrefs; import org.chromium.content_public.browser.BrowserContextHandle; -/** - * First Party Sets preference page. It's a FourStateCookieSettingsPreference subpage. - */ -public class FPSCookieSettings - extends BaseSiteSettingsFragment implements Preference.OnPreferenceChangeListener { +/** First Party Sets preference page. It's a TriStateCookieSettingsPreference subpage. */ +public class FPSCookieSettings extends BaseSiteSettingsFragment + implements Preference.OnPreferenceChangeListener { public static final String ALLOW_FPS_COOKIE_PREFERENCE = "allow_fps"; public static final String SUBTITLE = "subtitle"; public static final String BULLET_TWO = "bullet_two";
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/FourStateCookieSettingsPreference.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/FourStateCookieSettingsPreference.java deleted file mode 100644 index c1c6fd0..0000000 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/FourStateCookieSettingsPreference.java +++ /dev/null
@@ -1,335 +0,0 @@ -// Copyright 2020 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.browser_ui.site_settings; - -import android.content.Context; -import android.content.res.Resources; -import android.util.AttributeSet; -import android.view.View; -import android.widget.RadioGroup; - -import androidx.annotation.VisibleForTesting; -import androidx.preference.Preference; -import androidx.preference.PreferenceViewHolder; - -import org.chromium.components.browser_ui.widget.RadioButtonWithDescription; -import org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionAndAuxButton; -import org.chromium.components.browser_ui.widget.text.TextViewWithCompoundDrawables; -import org.chromium.components.content_settings.CookieControlsMode; - -/** - * A 4-state radio group Preference used for the Cookies subpage of SiteSettings. - */ -public class FourStateCookieSettingsPreference extends Preference - implements RadioGroup.OnCheckedChangeListener, - RadioButtonWithDescriptionAndAuxButton.OnAuxButtonClickedListener { - private OnCookiesDetailsRequested mListener; - - public enum CookieSettingsState { - UNINITIALIZED, - ALLOW, - BLOCK_THIRD_PARTY_INCOGNITO, - BLOCK_THIRD_PARTY, - BLOCK - } - - /** - * Used to notify cookie details subpages requests. - */ - public interface OnCookiesDetailsRequested { - /** - * Notify that Cookie details are requested. - */ - void onCookiesDetailsRequested(@CookieControlsMode int cookieSettingsState); - } - - /** - * Signals used to determine the view and button states. - */ - public static class Params { - // Whether the PrivacySandboxFirstPartySetsUI feature is enabled. - public boolean isPrivacySandboxFirstPartySetsUIEnabled; - - // Whether the cookies content setting is enabled. - public boolean allowCookies; - // An enum indicating when to block third-party cookies. - public @CookieControlsMode int cookieControlsMode; - - // Whether the incognito mode is enabled. - public boolean isIncognitoModeEnabled; - - // Whether the cookies content setting is enforced. - public boolean cookiesContentSettingEnforced; - // Whether third-party blocking is enforced. - public boolean cookieControlsModeEnforced; - // Whether First Party Sets are enabled. - public boolean isFirstPartySetsDataAccessEnabled; - } - - // Keeps the params that are applied to the UI if the params are set before the UI is ready. - private Params mInitializationParams; - - // UI Elements. - private RadioButtonWithDescription mAllowButton; - private RadioButtonWithDescription mBlockThirdPartyIncognitoButton; - private RadioButtonWithDescription mBlockThirdPartyButton; - private RadioButtonWithDescription mBlockButton; - private RadioGroup mRadioGroup; - private TextViewWithCompoundDrawables mManagedView; - - // Sometimes UI is initialized before the initializationParams are set. We keep this viewHolder - // to properly adjust UI once initializationParams are set. See crbug.com/1371236. - // TODO(tommasin) Remove this holder once the FirstPartySets UI will be enabled by default. - private PreferenceViewHolder mViewHolder; - - public FourStateCookieSettingsPreference(Context context, AttributeSet attrs) { - super(context, attrs); - - // Sets the layout resource that will be inflated for the view. - setLayoutResource(R.layout.four_state_cookie_settings_preference); - - // Make unselectable, otherwise FourStateCookieSettingsPreference is treated as one - // selectable Preference, instead of four selectable radio buttons. - setSelectable(false); - } - - /** - * Sets the cookie settings state and updates the radio buttons. - */ - public void setState(Params state) { - if (mRadioGroup != null) { - setRadioButtonsVisibility(state); - configureRadioButtons(state); - } else { - mInitializationParams = state; - } - } - - /** - * @return The state that is currently selected. - */ - public CookieSettingsState getState() { - if (mRadioGroup == null && mInitializationParams == null) { - return CookieSettingsState.UNINITIALIZED; - } - - // Calculate the state from mInitializationParams if the UI is not initialized yet. - if (mInitializationParams != null) { - return getActiveState(mInitializationParams); - } - - if (mAllowButton.isChecked()) { - return CookieSettingsState.ALLOW; - } else if (mBlockThirdPartyIncognitoButton.isChecked()) { - return CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO; - } else if (mBlockThirdPartyButton.isChecked()) { - return CookieSettingsState.BLOCK_THIRD_PARTY; - } else { - assert mBlockButton.isChecked(); - return CookieSettingsState.BLOCK; - } - } - - @Override - public void onCheckedChanged(RadioGroup group, int checkedId) { - callChangeListener(getState()); - } - - @Override - public void onBindViewHolder(PreferenceViewHolder holder) { - super.onBindViewHolder(holder); - - mViewHolder = holder; - mAllowButton = (RadioButtonWithDescription) holder.findViewById(R.id.allow); - mBlockButton = (RadioButtonWithDescription) holder.findViewById(R.id.block); - mRadioGroup = (RadioGroup) holder.findViewById(R.id.radio_button_layout); - mRadioGroup.setOnCheckedChangeListener(this); - - mManagedView = - (TextViewWithCompoundDrawables) holder.findViewById(R.id.managed_disclaimer_text); - - if (mInitializationParams != null) { - setRadioButtonsVisibility(mInitializationParams); - configureRadioButtons(mInitializationParams); - } - } - - private Resources getResources() { - return getContext().getResources(); - } - - private void setRadioButtonsVisibility(Params params) { - if (params.isPrivacySandboxFirstPartySetsUIEnabled) { - mViewHolder.findViewById(R.id.block_third_party_incognito).setVisibility(View.GONE); - mViewHolder.findViewById(R.id.block_third_party).setVisibility(View.GONE); - - // TODO(crbug.com/1349370): Change the buttons class into a - // RadioButtonWithDescriptionAndAuxButton and remove the following casts when the - // PrivacySandboxFirstPartySetsUI feature is launched - var blockTPIncognitoBtnWithDescAndAux = - (RadioButtonWithDescriptionAndAuxButton) mViewHolder.findViewById( - R.id.block_third_party_incognito_with_aux); - var blockTPButtonWithDescAndAux = - (RadioButtonWithDescriptionAndAuxButton) mViewHolder.findViewById( - R.id.block_third_party_with_aux); - - blockTPIncognitoBtnWithDescAndAux.setVisibility(View.VISIBLE); - blockTPButtonWithDescAndAux.setVisibility(View.VISIBLE); - - blockTPIncognitoBtnWithDescAndAux.setAuxButtonClickedListener(this); - blockTPButtonWithDescAndAux.setAuxButtonClickedListener(this); - mBlockThirdPartyIncognitoButton = blockTPIncognitoBtnWithDescAndAux; - mBlockThirdPartyButton = blockTPButtonWithDescAndAux; - setBlockThirdPartyCookieDescription(params); - } else { - mBlockThirdPartyIncognitoButton = (RadioButtonWithDescription) mViewHolder.findViewById( - R.id.block_third_party_incognito); - mBlockThirdPartyButton = - (RadioButtonWithDescription) mViewHolder.findViewById(R.id.block_third_party); - } - } - - private void setBlockThirdPartyCookieDescription(Params params) { - String defaultDescription = getResources().getString( - R.string.website_settings_third_party_cookies_page_block_radio_sub_label); - if (params.isFirstPartySetsDataAccessEnabled) { - String fpsAdditionalDescription = getResources().getString( - R.string.website_settings_category_cookie_block_third_party_fps_addition); - String description = getResources().getString(R.string.concat_two_strings_with_periods, - defaultDescription, fpsAdditionalDescription); - mBlockThirdPartyButton.setDescriptionText(description); - } else { - mBlockThirdPartyButton.setDescriptionText(defaultDescription); - } - } - - public void setCookiesDetailsRequestedListener(OnCookiesDetailsRequested listener) { - mListener = listener; - } - - @Override - public void onAuxButtonClicked(int clickedButtonId) { - if (clickedButtonId == mBlockThirdPartyIncognitoButton.getId()) { - mListener.onCookiesDetailsRequested(CookieControlsMode.INCOGNITO_ONLY); - } else if (clickedButtonId == mBlockThirdPartyButton.getId()) { - mListener.onCookiesDetailsRequested(CookieControlsMode.BLOCK_THIRD_PARTY); - } else { - assert false : "Should not be reached."; - } - } - - private CookieSettingsState getActiveState(Params params) { - // These conditions only check the preference combinations that deterministically decide - // your cookie settings state. In the future we would refactor the backend preferences to - // reflect the only possible states you can be in - // (Allow/BlockThirdPartyIncognito/BlockThirdParty/Block), instead of using this - // combination of multiple signals. - if (!params.allowCookies) { - return CookieSettingsState.BLOCK; - } else if (params.cookieControlsMode == CookieControlsMode.BLOCK_THIRD_PARTY) { - return CookieSettingsState.BLOCK_THIRD_PARTY; - } else if (params.cookieControlsMode == CookieControlsMode.INCOGNITO_ONLY - && params.isIncognitoModeEnabled) { - return CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO; - } else { - return CookieSettingsState.ALLOW; - } - } - - private void configureRadioButtons(Params params) { - assert (mRadioGroup != null); - mAllowButton.setEnabled(true); - mBlockThirdPartyIncognitoButton.setEnabled(true); - mBlockThirdPartyButton.setEnabled(true); - mBlockButton.setEnabled(true); - for (RadioButtonWithDescription button : getEnforcedButtons(params)) { - button.setEnabled(false); - } - mManagedView.setVisibility( - (params.cookiesContentSettingEnforced || params.cookieControlsModeEnforced) - ? View.VISIBLE - : View.GONE); - - RadioButtonWithDescription button = getButton(getActiveState(params)); - // Always want to enable the selected option. - button.setEnabled(true); - button.setChecked(true); - - mInitializationParams = null; - } - - /** - * A helper function to return a button array from a variable number of arguments. - */ - private RadioButtonWithDescription[] buttons(RadioButtonWithDescription... args) { - return args; - } - - @VisibleForTesting - public RadioButtonWithDescription getButton(CookieSettingsState state) { - switch (state) { - case ALLOW: - return mAllowButton; - case BLOCK_THIRD_PARTY_INCOGNITO: - return mBlockThirdPartyIncognitoButton; - case BLOCK_THIRD_PARTY: - return mBlockThirdPartyButton; - case BLOCK: - return mBlockButton; - case UNINITIALIZED: - assert false; - return null; - } - assert false; - return null; - } - - /** - * @return An array of radio buttons that have to be disabled as they can't be selected due to - * policy restrictions. - */ - private RadioButtonWithDescription[] getEnforcedButtons(Params params) { - if (!params.cookiesContentSettingEnforced && !params.cookieControlsModeEnforced) { - // Nothing is enforced. - if (!params.isIncognitoModeEnabled) { - return buttons(mBlockThirdPartyIncognitoButton); - } else { - return buttons(); - } - } - if (params.cookiesContentSettingEnforced && params.cookieControlsModeEnforced) { - return buttons(mAllowButton, mBlockThirdPartyIncognitoButton, mBlockThirdPartyButton, - mBlockButton); - } - if (params.cookiesContentSettingEnforced) { - if (params.allowCookies) { - if (!params.isIncognitoModeEnabled) { - return buttons(mBlockButton, mBlockThirdPartyIncognitoButton); - } else { - return buttons(mBlockButton); - } - } else { - return buttons(mAllowButton, mBlockThirdPartyIncognitoButton, - mBlockThirdPartyButton, mBlockButton); - } - } - // cookieControlsModeEnforced must be true. - if (params.cookieControlsMode == CookieControlsMode.BLOCK_THIRD_PARTY) { - return buttons(mAllowButton, mBlockThirdPartyIncognitoButton); - } else { - return buttons(mBlockThirdPartyIncognitoButton, mBlockThirdPartyButton); - } - } - - public boolean isButtonEnabledForTesting(CookieSettingsState state) { - assert getButton(state) != null; - return getButton(state).isEnabled(); - } - - public boolean isButtonCheckedForTesting(CookieSettingsState state) { - assert getButton(state) != null; - return getButton(state).isChecked(); - } -}
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java index 9bd5236b..755ece35 100644 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
@@ -62,8 +62,6 @@ import org.chromium.components.browser_ui.settings.SettingsUtils; import org.chromium.components.browser_ui.site_settings.AddExceptionPreference.SiteAddedCallback; import org.chromium.components.browser_ui.site_settings.AutoDarkMetrics.AutoDarkSettingsChangeSource; -import org.chromium.components.browser_ui.site_settings.FourStateCookieSettingsPreference.CookieSettingsState; -import org.chromium.components.browser_ui.site_settings.FourStateCookieSettingsPreference.OnCookiesDetailsRequested; import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.components.browser_ui.util.TraceEventVectorDrawableCompat; import org.chromium.components.browser_ui.widget.RadioButtonWithDescription; @@ -113,19 +111,19 @@ SiteAddedCallback, OnPreferenceTreeClickListener, FragmentSettingsLauncher, - OnCookiesDetailsRequested, TriStateCookieSettingsPreference.OnCookiesDetailsRequested, CustomDividerFragment, WebsitePreference.OnStorageAccessWebsiteDetailsRequested { - @IntDef({GlobalToggleLayout.BINARY_TOGGLE, GlobalToggleLayout.TRI_STATE_TOGGLE, - GlobalToggleLayout.TRI_STATE_COOKIE_TOGGLE, - GlobalToggleLayout.FOUR_STATE_COOKIE_TOGGLE}) + @IntDef({ + GlobalToggleLayout.BINARY_TOGGLE, + GlobalToggleLayout.TRI_STATE_TOGGLE, + GlobalToggleLayout.TRI_STATE_COOKIE_TOGGLE + }) @Retention(RetentionPolicy.SOURCE) private @interface GlobalToggleLayout { int BINARY_TOGGLE = 0; int TRI_STATE_TOGGLE = 1; int TRI_STATE_COOKIE_TOGGLE = 2; - int FOUR_STATE_COOKIE_TOGGLE = 3; } // The key to use to pass which category this preference should display, @@ -218,7 +216,6 @@ public static final String BINARY_TOGGLE_KEY = "binary_toggle"; public static final String TRI_STATE_TOGGLE_KEY = "tri_state_toggle"; public static final String TRI_STATE_COOKIE_TOGGLE = "tri_state_cookie_toggle"; - public static final String FOUR_STATE_COOKIE_TOGGLE_KEY = "four_state_cookie_toggle"; // Keys for category-specific preferences (toggle, link, button etc.), dynamically shown. public static final String NOTIFICATIONS_VIBRATE_TOGGLE_KEY = "notifications_vibrate"; @@ -442,8 +439,6 @@ int contentType = mCategory.getContentSettingsType(); if (mCategory.getType() == SiteSettingsCategory.Type.THIRD_PARTY_COOKIES) { mGlobalToggleLayout = GlobalToggleLayout.TRI_STATE_COOKIE_TOGGLE; - } else if (mCategory.getType() == SiteSettingsCategory.Type.COOKIES) { - mGlobalToggleLayout = GlobalToggleLayout.FOUR_STATE_COOKIE_TOGGLE; } else if (WebsitePreferenceBridge.requiresTriStateContentSetting(contentType)) { mGlobalToggleLayout = GlobalToggleLayout.TRI_STATE_TOGGLE; } @@ -622,9 +617,6 @@ WebsitePreferenceBridge.setDefaultContentSetting( browserContextHandle, mCategory.getContentSettingsType(), setting); getInfoForOrigins(); - } else if (FOUR_STATE_COOKIE_TOGGLE_KEY.equals(preference.getKey())) { - setCookieSettingsPreference((CookieSettingsState) newValue); - getInfoForOrigins(); } else if (TRI_STATE_COOKIE_TOGGLE.equals(preference.getKey())) { setThirdPartyCookieSettingsPreference((int) newValue); getInfoForOrigins(); @@ -695,48 +687,6 @@ manager.showDialog(model, ModalDialogType.APP); } - private void setCookieSettingsPreference(CookieSettingsState state) { - assert mCategory.getType() == SiteSettingsCategory.Type.COOKIES; - boolean allowCookies; - @CookieControlsMode - int mode; - - switch (state) { - case ALLOW: - allowCookies = true; - mode = CookieControlsMode.OFF; - break; - case BLOCK_THIRD_PARTY_INCOGNITO: - allowCookies = true; - mode = CookieControlsMode.INCOGNITO_ONLY; - break; - case BLOCK_THIRD_PARTY: - allowCookies = true; - mode = CookieControlsMode.BLOCK_THIRD_PARTY; - break; - case BLOCK: - allowCookies = false; - mode = CookieControlsMode.BLOCK_THIRD_PARTY; - break; - default: - return; - } - - getSiteSettingsDelegate().dismissPrivacySandboxSnackbar(); - - // Display the Privacy Sandbox snackbar whenever third-party/all cookies are blocked. - if (mode == CookieControlsMode.BLOCK_THIRD_PARTY) { - getSiteSettingsDelegate().maybeDisplayPrivacySandboxSnackbar(); - } - - WebsitePreferenceBridge.setCategoryEnabled( - getSiteSettingsDelegate().getBrowserContextHandle(), ContentSettingsType.COOKIES, - allowCookies); - PrefService prefService = - UserPrefs.get(getSiteSettingsDelegate().getBrowserContextHandle()); - prefService.setInteger(COOKIE_CONTROLS_MODE, mode); - } - private void setThirdPartyCookieSettingsPreference(@CookieControlsMode int mode) { assert mCategory.getType() == SiteSettingsCategory.Type.THIRD_PARTY_COOKIES; getSiteSettingsDelegate().dismissPrivacySandboxSnackbar(); @@ -750,12 +700,6 @@ prefService.setInteger(COOKIE_CONTROLS_MODE, mode); } - private CookieSettingsState getCookieSettingsState() { - FourStateCookieSettingsPreference fourStateCookieToggle = - getPreferenceScreen().findPreference(FOUR_STATE_COOKIE_TOGGLE_KEY); - return fourStateCookieToggle.getState(); - } - private String getAddExceptionDialogMessage() { BrowserContextHandle browserContextHandle = getSiteSettingsDelegate().getBrowserContextHandle(); @@ -779,11 +723,6 @@ ? R.string.website_settings_add_site_description_sound_block : R.string.website_settings_add_site_description_sound_allow; break; - case SiteSettingsCategory.Type.COOKIES: - resource = getCookieSettingsState() == CookieSettingsState.ALLOW - ? R.string.website_settings_add_site_description_cookies_block - : R.string.website_settings_add_site_description_cookies_allow; - break; case SiteSettingsCategory.Type.SITE_DATA: resource = WebsitePreferenceBridge.isCategoryEnabled( browserContextHandle, ContentSettingsType.COOKIES) @@ -850,11 +789,6 @@ getSiteSettingsDelegate().getBrowserContextHandle(); int setting = ContentSettingValues.DEFAULT; switch (mGlobalToggleLayout) { - case GlobalToggleLayout.FOUR_STATE_COOKIE_TOGGLE: - setting = getCookieSettingsState() == CookieSettingsState.ALLOW - ? ContentSettingValues.BLOCK - : ContentSettingValues.ALLOW; - break; case GlobalToggleLayout.TRI_STATE_COOKIE_TOGGLE: setting = getCookieControlsMode() == CookieControlsMode.OFF ? ContentSettingValues.BLOCK @@ -914,7 +848,6 @@ switch (mCategory.getType()) { case SiteSettingsCategory.Type.SOUND: case SiteSettingsCategory.Type.JAVASCRIPT: - case SiteSettingsCategory.Type.COOKIES: case SiteSettingsCategory.Type.SITE_DATA: case SiteSettingsCategory.Type.FEDERATED_IDENTITY_API: case SiteSettingsCategory.Type.REQUEST_DESKTOP_SITE: @@ -1109,10 +1042,6 @@ TriStateSiteSettingsPreference triStateToggle = getPreferenceScreen().findPreference(TRI_STATE_TOGGLE_KEY); return (triStateToggle.getCheckedSetting() == ContentSettingValues.BLOCK); - case GlobalToggleLayout.FOUR_STATE_COOKIE_TOGGLE: - FourStateCookieSettingsPreference fourStateCookieToggle = - getPreferenceScreen().findPreference(FOUR_STATE_COOKIE_TOGGLE_KEY); - return fourStateCookieToggle.getState() == CookieSettingsState.BLOCK; case GlobalToggleLayout.TRI_STATE_COOKIE_TOGGLE: TriStateCookieSettingsPreference triStateCookieToggle = getPreferenceScreen().findPreference(TRI_STATE_COOKIE_TOGGLE); @@ -1138,8 +1067,6 @@ TriStateSiteSettingsPreference triStateToggle = screen.findPreference(TRI_STATE_TOGGLE_KEY); TriStateCookieSettingsPreference triStateCookieToggle = screen.findPreference(TRI_STATE_COOKIE_TOGGLE); - FourStateCookieSettingsPreference fourStateCookieToggle = - screen.findPreference(FOUR_STATE_COOKIE_TOGGLE_KEY); Preference notificationsVibrate = screen.findPreference(NOTIFICATIONS_VIBRATE_TOGGLE_KEY); mNotificationsQuietUiPref = screen.findPreference(NOTIFICATIONS_QUIET_UI_TOGGLE_KEY); mDesktopSitePeripheralPref = screen.findPreference(DESKTOP_SITE_PERIPHERAL_TOGGLE_KEY); @@ -1160,9 +1087,6 @@ if (mGlobalToggleLayout != GlobalToggleLayout.TRI_STATE_COOKIE_TOGGLE) { screen.removePreference(triStateCookieToggle); } - if (mGlobalToggleLayout != GlobalToggleLayout.FOUR_STATE_COOKIE_TOGGLE) { - screen.removePreference(fourStateCookieToggle); - } switch (mGlobalToggleLayout) { case GlobalToggleLayout.BINARY_TOGGLE: configureBinaryToggle(binaryToggle, contentType); @@ -1173,15 +1097,10 @@ case GlobalToggleLayout.TRI_STATE_COOKIE_TOGGLE: configureTriStateCookieToggle(triStateCookieToggle); break; - case GlobalToggleLayout.FOUR_STATE_COOKIE_TOGGLE: - configureFourStateCookieToggle(fourStateCookieToggle); - break; } Preference infoText = screen.findPreference(INFO_TEXT_KEY); - if (mCategory.getType() == SiteSettingsCategory.Type.COOKIES) { - infoText.setSummary(R.string.website_settings_cookie_info); - } else if (mCategory.getType() == SiteSettingsCategory.Type.SITE_DATA) { + if (mCategory.getType() == SiteSettingsCategory.Type.SITE_DATA) { infoText.setSummary(R.string.website_settings_site_data_page_description); } else if (mCategory.getType() == SiteSettingsCategory.Type.STORAGE_ACCESS) { infoText.setSummary(getStorageAccessSummary()); @@ -1337,27 +1256,6 @@ } } - private void configureFourStateCookieToggle( - FourStateCookieSettingsPreference fourStateCookieToggle) { - fourStateCookieToggle.setOnPreferenceChangeListener(this); - fourStateCookieToggle.setCookiesDetailsRequestedListener(this); - FourStateCookieSettingsPreference.Params params = - new FourStateCookieSettingsPreference.Params(); - params.allowCookies = WebsitePreferenceBridge.isCategoryEnabled( - getSiteSettingsDelegate().getBrowserContextHandle(), ContentSettingsType.COOKIES); - PrefService prefService = - UserPrefs.get(getSiteSettingsDelegate().getBrowserContextHandle()); - params.cookieControlsMode = getCookieControlsMode(); - params.cookiesContentSettingEnforced = mCategory.isManaged(); - params.cookieControlsModeEnforced = prefService.isManagedPreference(COOKIE_CONTROLS_MODE); - params.isIncognitoModeEnabled = getSiteSettingsDelegate().isIncognitoModeEnabled(); - params.isPrivacySandboxFirstPartySetsUIEnabled = - getSiteSettingsDelegate().isPrivacySandboxFirstPartySetsUIFeatureEnabled(); - params.isFirstPartySetsDataAccessEnabled = - getSiteSettingsDelegate().isFirstPartySetsDataAccessEnabled(); - fourStateCookieToggle.setState(params); - } - private void configureTriStateCookieToggle( TriStateCookieSettingsPreference triStateCookieToggle) { triStateCookieToggle.setOnPreferenceChangeListener(this);
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java index d807b97..ed334fb 100644 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java
@@ -111,9 +111,6 @@ .showPermissionBlockedMessage(getContext())) { // Show 'disabled' message when permission is not granted in Android. p.setSummary(ContentSettingsResources.getCategorySummary(contentType, false)); - } else if (Type.COOKIES == prefCategory && checked - && cookieControlsMode == CookieControlsMode.BLOCK_THIRD_PARTY) { - p.setSummary(ContentSettingsResources.getCookieAllowedExceptThirdPartySummary()); } else if (Type.SITE_DATA == prefCategory) { p.setSummary(ContentSettingsResources.getSiteDataListSummary(checked)); } else if (Type.THIRD_PARTY_COOKIES == prefCategory) {
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java index 0ff64ae..92cb47ce 100644 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
@@ -48,7 +48,6 @@ Type.BLUETOOTH_SCANNING, Type.CAMERA, Type.CLIPBOARD, - Type.COOKIES, Type.IDLE_DETECTION, Type.DEVICE_LOCATION, Type.JAVASCRIPT, @@ -85,33 +84,32 @@ int BLUETOOTH_SCANNING = 5; int CAMERA = 6; int CLIPBOARD = 7; - int COOKIES = 8; - int DEVICE_LOCATION = 9; - int IDLE_DETECTION = 10; - int JAVASCRIPT = 11; - int MICROPHONE = 12; - int NFC = 13; - int NOTIFICATIONS = 14; - int POPUPS = 15; - int PROTECTED_MEDIA = 16; - int SENSORS = 17; - int SOUND = 18; - int USB = 19; - int BLUETOOTH = 20; - int VIRTUAL_REALITY = 21; - int USE_STORAGE = 22; - int AUTO_DARK_WEB_CONTENT = 23; - int REQUEST_DESKTOP_SITE = 24; - int FEDERATED_IDENTITY_API = 25; - int THIRD_PARTY_COOKIES = 26; - int SITE_DATA = 27; - int ANTI_ABUSE = 28; - int ZOOM = 29; - int STORAGE_ACCESS = 30; - int TRACKING_PROTECTION = 31; + int DEVICE_LOCATION = 8; + int IDLE_DETECTION = 9; + int JAVASCRIPT = 10; + int MICROPHONE = 11; + int NFC = 12; + int NOTIFICATIONS = 13; + int POPUPS = 14; + int PROTECTED_MEDIA = 15; + int SENSORS = 16; + int SOUND = 17; + int USB = 18; + int BLUETOOTH = 19; + int VIRTUAL_REALITY = 20; + int USE_STORAGE = 21; + int AUTO_DARK_WEB_CONTENT = 22; + int REQUEST_DESKTOP_SITE = 23; + int FEDERATED_IDENTITY_API = 24; + int THIRD_PARTY_COOKIES = 25; + int SITE_DATA = 26; + int ANTI_ABUSE = 27; + int ZOOM = 28; + int STORAGE_ACCESS = 29; + int TRACKING_PROTECTION = 30; /** Number of handled categories used for calculating array sizes. */ - int NUM_ENTRIES = 32; + int NUM_ENTRIES = 31; } private final BrowserContextHandle mBrowserContextHandle; @@ -207,7 +205,6 @@ return ContentSettingsType.MEDIASTREAM_CAMERA; case Type.CLIPBOARD: return ContentSettingsType.CLIPBOARD_READ_WRITE; - case Type.COOKIES: case Type.SITE_DATA: case Type.THIRD_PARTY_COOKIES: return ContentSettingsType.COOKIES; @@ -292,8 +289,6 @@ return "camera"; case Type.CLIPBOARD: return "clipboard"; - case Type.COOKIES: - return "cookies"; case Type.REQUEST_DESKTOP_SITE: return "request_desktop_site"; case Type.DEVICE_LOCATION: @@ -376,8 +371,7 @@ || mCategory == Type.POPUPS) { return WebsitePreferenceBridge.isContentSettingManaged( getBrowserContextHandle(), getContentSettingsType()); - } else if (mCategory == Type.COOKIES - || mCategory == Type.DEVICE_LOCATION + } else if (mCategory == Type.DEVICE_LOCATION || mCategory == Type.CAMERA || mCategory == Type.MICROPHONE) { return !WebsitePreferenceBridge.isContentSettingUserModifiable( @@ -395,8 +389,7 @@ */ public boolean isManagedByCustodian() { // TODO(dullweber): Why do we only check these types? - if (mCategory == Type.COOKIES - || mCategory == Type.DEVICE_LOCATION + if (mCategory == Type.DEVICE_LOCATION || mCategory == Type.CAMERA || mCategory == Type.MICROPHONE) { return WebsitePreferenceBridge.isContentSettingManagedByCustodian(
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/TriStateCookieSettingsPreference.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/TriStateCookieSettingsPreference.java index cabd468..a5c5150 100644 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/TriStateCookieSettingsPreference.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/TriStateCookieSettingsPreference.java
@@ -102,7 +102,7 @@ // Sets the layout resource that will be inflated for the view. setLayoutResource(R.layout.tri_state_cookie_settings_preference); - // Make unselectable, otherwise FourStateCookieSettingsPreference is treated as one + // Make unselectable, otherwise TriStateCookieSettingsPreference is treated as one // selectable Preference, instead of four selectable radio buttons. setSelectable(false); }
diff --git a/components/browser_ui/site_settings/android/junit/src/org/chromium/components/browser_ui/site_settings/AddExceptionPreferenceUnitTest.java b/components/browser_ui/site_settings/android/junit/src/org/chromium/components/browser_ui/site_settings/AddExceptionPreferenceUnitTest.java index 4dfaa62..2b612b8 100644 --- a/components/browser_ui/site_settings/android/junit/src/org/chromium/components/browser_ui/site_settings/AddExceptionPreferenceUnitTest.java +++ b/components/browser_ui/site_settings/android/junit/src/org/chromium/components/browser_ui/site_settings/AddExceptionPreferenceUnitTest.java
@@ -50,12 +50,9 @@ public void testIsPatternValid() { assertTrue( "Empty pattern should be valid.", - AddExceptionPreference.isPatternValid("", SiteSettingsCategory.Type.COOKIES)); - mIsPatternValid = true; - assertFalse( - "Pattern is invalid when it has colon and the type is not REQUEST_DESKTOP_SITE.", AddExceptionPreference.isPatternValid( - "https://www.google.com", SiteSettingsCategory.Type.COOKIES)); + "", SiteSettingsCategory.Type.THIRD_PARTY_COOKIES)); + mIsPatternValid = true; assertTrue( "Pattern is valid when it has colon and the type is REQUEST_DESKTOP_SITE.", AddExceptionPreference.isPatternValid( @@ -81,12 +78,12 @@ "Pattern should not be updated except for REQUEST_DESKTOP_SITE type.", "maps.google.com", AddExceptionPreference.updatePatternIfNeeded( - "maps.google.com", SiteSettingsCategory.Type.COOKIES, true)); + "maps.google.com", SiteSettingsCategory.Type.THIRD_PARTY_COOKIES, true)); assertEquals( "Pattern should not be updated except for REQUEST_DESKTOP_SITE type.", "maps.google.com", AddExceptionPreference.updatePatternIfNeeded( - "maps.google.com", SiteSettingsCategory.Type.COOKIES, false)); + "maps.google.com", SiteSettingsCategory.Type.THIRD_PARTY_COOKIES, false)); AddExceptionPreference.updatePatternIfNeeded( "https://maps.google.com", SiteSettingsCategory.Type.REQUEST_DESKTOP_SITE, true); @@ -101,52 +98,40 @@ @Test public void testGetPrimaryPattern() { assertEquals( - "Primary pattern should always be the original pattern except for COOKIES type.", + "Primary pattern should always be the original pattern except for" + + " THIRD_PARTY_COOKIES type.", "maps.google.com", AddExceptionPreference.getPrimaryPattern( "maps.google.com", SiteSettingsCategory.Type.REQUEST_DESKTOP_SITE, true)); assertEquals( - "Primary pattern should always be the original pattern except for COOKIES type.", + "Primary pattern should always be the original pattern except for" + + " THIRD_PARTY_COOKIES type.", "maps.google.com", AddExceptionPreference.getPrimaryPattern( "maps.google.com", SiteSettingsCategory.Type.REQUEST_DESKTOP_SITE, false)); assertEquals( - "Primary pattern should be wildcard for COOKIES type if user clicks the third party" - + " checkbox.", + "Primary pattern should be wildcard for THIRD_PARTY_COOKIES.", SITE_WILDCARD, AddExceptionPreference.getPrimaryPattern( - "maps.google.com", SiteSettingsCategory.Type.COOKIES, true)); - assertEquals( - "Primary pattern should be the original pattern for COOKIES type if user does not" - + " click the third party checkbox.", - "maps.google.com", - AddExceptionPreference.getPrimaryPattern( - "maps.google.com", SiteSettingsCategory.Type.COOKIES, false)); + "maps.google.com", SiteSettingsCategory.Type.THIRD_PARTY_COOKIES, true)); } @Test public void testGetSecondaryPattern() { assertEquals( - "Secondary pattern should always be wildcard except for COOKIES type.", + "Secondary pattern should always be wildcard except for THIRD_PARTY_COOKIES type.", SITE_WILDCARD, AddExceptionPreference.getSecondaryPattern( "maps.google.com", SiteSettingsCategory.Type.REQUEST_DESKTOP_SITE, true)); assertEquals( - "Secondary pattern should always be wildcard except for COOKIES type.", + "Secondary pattern should always be wildcard except for THIRD_PARTY_COOKIES type.", SITE_WILDCARD, AddExceptionPreference.getSecondaryPattern( "maps.google.com", SiteSettingsCategory.Type.REQUEST_DESKTOP_SITE, false)); assertEquals( - "Secondary pattern should be the original pattern for COOKIES type if user clicks" - + " the third party checkbox.", + "Secondary pattern should be the original pattern for THIRD_PARTY_COOKIES", "maps.google.com", AddExceptionPreference.getSecondaryPattern( - "maps.google.com", SiteSettingsCategory.Type.COOKIES, true)); - assertEquals( - "Secondary pattern should be wildcard for COOKIES type if user does not click the" - + " third party checkbox.", - SITE_WILDCARD, - AddExceptionPreference.getSecondaryPattern( - "maps.google.com", SiteSettingsCategory.Type.COOKIES, false)); + "maps.google.com", SiteSettingsCategory.Type.THIRD_PARTY_COOKIES, true)); } }
diff --git a/components/browser_ui/site_settings/android/junit/src/org/chromium/components/browser_ui/site_settings/DesktopSiteMetricsUnitTest.java b/components/browser_ui/site_settings/android/junit/src/org/chromium/components/browser_ui/site_settings/DesktopSiteMetricsUnitTest.java index 22e812eb..056eefce 100644 --- a/components/browser_ui/site_settings/android/junit/src/org/chromium/components/browser_ui/site_settings/DesktopSiteMetricsUnitTest.java +++ b/components/browser_ui/site_settings/android/junit/src/org/chromium/components/browser_ui/site_settings/DesktopSiteMetricsUnitTest.java
@@ -43,7 +43,9 @@ @Test public void testRecordDesktopSiteSettingsManuallyAdded() { DesktopSiteMetrics.recordDesktopSiteSettingsManuallyAdded( - SiteSettingsCategory.Type.COOKIES, ContentSettingValues.BLOCK, "www.google.com"); + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES, + ContentSettingValues.BLOCK, + "www.google.com"); assertEquals( "Only REQUEST_DESKTOP_SITE type should be recorded.", 0, @@ -101,7 +103,7 @@ // SubDomain Setting when(mOrigin.getIsAnySubdomainPattern()).thenReturn(false); DesktopSiteMetrics.recordDesktopSiteSettingsChanged( - SiteSettingsCategory.Type.COOKIES, ContentSettingValues.ALLOW, mSite); + SiteSettingsCategory.Type.THIRD_PARTY_COOKIES, ContentSettingValues.ALLOW, mSite); assertEquals( "Only REQUEST_DESKTOP_SITE type should be recorded.", 0,
diff --git a/components/browser_ui/strings/android/site_settings.grdp b/components/browser_ui/strings/android/site_settings.grdp index 1f4eeee..065054aa 100644 --- a/components/browser_ui/strings/android/site_settings.grdp +++ b/components/browser_ui/strings/android/site_settings.grdp
@@ -248,9 +248,6 @@ <message name="IDS_WEBSITE_SETTINGS_PERMISSIONS_BLOCKED_DSE" desc="Status message explaining that the default search engine is blocked from accessing this permission. Displayed in Site Settings page. e.g. Location: Blocked for current search engine"> Blocked for current search engine </message> - <message name="IDS_WEBSITE_SETTINGS_THIRD_PARTY_COOKIES_EXCEPTION_LABEL" desc="The label for site exceptions that affect third party cookies."> - Including third-party cookies on this site - </message> <message name="IDS_WEBSITE_SETTINGS_DOMAIN_EXCEPTION_LABEL" desc="The label for site exceptions that apply to the entire domain."> All sites under <ph name="DOMAIN">%1$s<ex>google.com</ex></ph> </message> @@ -502,36 +499,6 @@ Blocked from reading clipboard </message> - <!-- Cookies --> - - <message name="IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_ALLOW_TITLE" desc="Text used to explain the allow cookies option in settings"> - Allow cookies - </message> - <message name="IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_THIRD_PARTY_INCOGNITO_TITLE" desc="Text used to explain the block third-party cookies in Incognito option in settings"> - Block third-party cookies in Incognito - </message> - <message name="IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_THIRD_PARTY_TITLE" desc="Text used to explain the block third-party cookies option in settings"> - Block third-party cookies - </message> - <message name="IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_TITLE" desc="Text used to explain the block cookies option in settings"> - Block all cookies (not recommended) - </message> - <message name="IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_ALLOW_ADDITION" desc="Additional text used to explain the allow cookies option in settings"> - Sites will work normally - </message> - <message name="IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_THIRD_PARTY_FPS_ADDITION" desc="Additional text used to explain the block third-party cookies option in settings when First Party Sets are enables."> - Related sites can see your activity in the group - </message> - <message name="IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_ADDITION" desc="Additional text used to explain the block cookies option in settings"> - Features on many sites may not work - </message> - <message name="IDS_WEBSITE_SETTINGS_ADD_SITE_DESCRIPTION_COOKIES_ALLOW" desc="The description for the allow Cookies for website dialog."> - Allow cookies for a specific site. - </message> - <message name="IDS_WEBSITE_SETTINGS_ADD_SITE_DESCRIPTION_COOKIES_BLOCK" desc="The description for the block Cookies for website dialog."> - Block cookies for a specific site. - </message> - <!-- Site data page --> <message name="IDS_WEBSITE_SETTINGS_SITE_DATA_PAGE_DESCRIPTION" desc="A paragraph that appear beneath the page title: 'On-device site data'. It defines what on-device site data is. What is 'On-device site data'? When you interact with a site, that site can remember things about what you do. For example, you might place a pair of shoes in a shopping cart, close down your browser, and find those same shoes in your shopping cart when you visit the same site a week later. Sometimes that info is saved in the Cloud. Sometimes that info is saved on the user's device. There are several ways a site can save info to the user's device—for example, with cookies (text files saved to your device), small JavaScript databases, and even Chrome's new ad settings that are part of the Privacy Sandbox project (see details below). This page introduces the concept of on-device site data, allows the user to see which sites are using it, and allows the user to delete all saved data or just data from specific sites. **** CONTEXT PRIVACY SANDBOX **** Chrome’s Privacy Sandbox initiative 1) deprecates third-party cookies in Chrome, 2) supports free and open content on the web (by finding better ways to support ads online), 3) while providing stronger privacy protections for users. You can see a high-level description of this public project at www.privacysanbox.com."> A site you visit can save info about what you’re doing so that it works as expected — for example, to keep you signed in to a site or to save items in your shopping cart. Often sites save this info temporarily on your device. @@ -598,9 +565,6 @@ <message name="IDS_WEBSITE_SETTINGS_THIRD_PARTY_COOKIES_PAGE_BLOCK_RADIO_SUB_LABEL_FPS_DISABLED" desc="This string appears as a sub label beneath the 'Block third-party cookies' label. It summarizes the result of choosing this option. A site you visit may rely on cookies for certain functionality, such as remembering your language preferences or maintaining a shopping cart. If the user chooses this option, some sites they visit may not work as designed."> Features on some sites may not work </message> - <message name="IDS_WEBSITE_SETTINGS_COOKIE_INFO" desc="Text describing cookie and third-party cookie settings."> - A site you visit can embed content from other sites, for example images, ads, and text. Any of these sites can save cookies and other data to personalize your experience. - </message> <message name="IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_SUBPAGE_BULLET_ONE" desc="Description for the first bullet of cookie settings subpage."> Sites can use cookies to improve your browsing experience, for example, to keep you signed in or to remember items in your shopping cart </message>
diff --git a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_ALLOW_ADDITION.png.sha1 b/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_ALLOW_ADDITION.png.sha1 deleted file mode 100644 index ef80341..0000000 --- a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_ALLOW_ADDITION.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -266de8b600f0fdec9283013cad4c7f9f04193cbd \ No newline at end of file
diff --git a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_ALLOW_TITLE.png.sha1 b/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_ALLOW_TITLE.png.sha1 deleted file mode 100644 index ef80341..0000000 --- a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_ALLOW_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -266de8b600f0fdec9283013cad4c7f9f04193cbd \ No newline at end of file
diff --git a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_ADDITION.png.sha1 b/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_ADDITION.png.sha1 deleted file mode 100644 index 47c2a0ea..0000000 --- a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_ADDITION.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -8ead48ecf16381c8c5a5bcf5d6d64eae243e17cf \ No newline at end of file
diff --git a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_THIRD_PARTY_FPS_ADDITION.png.sha1 b/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_THIRD_PARTY_FPS_ADDITION.png.sha1 deleted file mode 100644 index 22a5223..0000000 --- a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_THIRD_PARTY_FPS_ADDITION.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -3363e73ae46f74bd76a6dd1bdc406f2a35c15cd6 \ No newline at end of file
diff --git a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_THIRD_PARTY_INCOGNITO_TITLE.png.sha1 b/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_THIRD_PARTY_INCOGNITO_TITLE.png.sha1 deleted file mode 100644 index ef80341..0000000 --- a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_THIRD_PARTY_INCOGNITO_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -266de8b600f0fdec9283013cad4c7f9f04193cbd \ No newline at end of file
diff --git a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_THIRD_PARTY_TITLE.png.sha1 b/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_THIRD_PARTY_TITLE.png.sha1 deleted file mode 100644 index ef80341..0000000 --- a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_THIRD_PARTY_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -266de8b600f0fdec9283013cad4c7f9f04193cbd \ No newline at end of file
diff --git a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_TITLE.png.sha1 b/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_TITLE.png.sha1 deleted file mode 100644 index ef80341..0000000 --- a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_BLOCK_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -266de8b600f0fdec9283013cad4c7f9f04193cbd \ No newline at end of file
diff --git a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_COOKIE_INFO.png.sha1 b/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_COOKIE_INFO.png.sha1 deleted file mode 100644 index 546727a..0000000 --- a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_COOKIE_INFO.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -9c8a315d36f487a907cb698322687319104ad9fd \ No newline at end of file
diff --git a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_THIRD_PARTY_COOKIES_EXCEPTION_LABEL.png.sha1 b/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_THIRD_PARTY_COOKIES_EXCEPTION_LABEL.png.sha1 deleted file mode 100644 index 131c2641..0000000 --- a/components/browser_ui/strings/android/site_settings_grdp/IDS_WEBSITE_SETTINGS_THIRD_PARTY_COOKIES_EXCEPTION_LABEL.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -1b74b8b270e3c5e64776e6a8288f88cc09d945f0 \ No newline at end of file
diff --git a/components/browsing_topics/mojom/browsing_topics_internals.mojom b/components/browsing_topics/mojom/browsing_topics_internals.mojom index b9113d5..4b08856 100644 --- a/components/browsing_topics/mojom/browsing_topics_internals.mojom +++ b/components/browsing_topics/mojom/browsing_topics_internals.mojom
@@ -16,9 +16,6 @@ // Whether the `PrivacySandboxAdsAPIsOverride` feature is enabled. bool privacy_sandbox_ads_apis_override_enabled; - // Whether the `PrivacySandboxSettings3` feature is enabled. - bool privacy_sandbox_settings3_enabled; - // Whether the `OverridePrivacySandboxSettingsLocalTesting` feature is // enabled. bool override_privacy_sandbox_settings_local_testing_enabled;
diff --git a/components/content_settings/browser/page_specific_content_settings.cc b/components/content_settings/browser/page_specific_content_settings.cc index e35e7202..a27bf10 100644 --- a/components/content_settings/browser/page_specific_content_settings.cc +++ b/components/content_settings/browser/page_specific_content_settings.cc
@@ -1497,10 +1497,7 @@ std::vector<privacy_sandbox::CanonicalTopic> PageSpecificContentSettings::GetAccessedTopics() const { if (accessed_topics_.empty() && - (privacy_sandbox::kPrivacySandboxSettings3ShowSampleDataForTesting - .Get() || - privacy_sandbox::kPrivacySandboxSettings4ShowSampleDataForTesting - .Get()) && + privacy_sandbox::kPrivacySandboxSettings4ShowSampleDataForTesting.Get() && page().GetMainDocument().GetLastCommittedURL().host() == "example.com") { // TODO(crbug.com/1286276): Remove sample topic when API is ready. return {privacy_sandbox::CanonicalTopic(browsing_topics::Topic(3),
diff --git a/components/metrics/structured/structured_metrics_recorder.cc b/components/metrics/structured/structured_metrics_recorder.cc index 74e65d8..1dfa793 100644 --- a/components/metrics/structured/structured_metrics_recorder.cc +++ b/components/metrics/structured/structured_metrics_recorder.cc
@@ -100,7 +100,9 @@ // persistent storage. if (CanProvideMetrics()) { HashUnhashedEventsAndPersist(); - std::move(on_ready_callback_).Run(); + if (!on_ready_callback_.is_null()) { + std::move(on_ready_callback_).Run(); + } } } @@ -125,19 +127,19 @@ const auto& structured_data = uma_proto.structured_data(); LogUploadSizeBytes(structured_data.ByteSizeLong()); LogExternalMetricsScanInUpload(external_metrics_scans_); + LogNumEventsInUpload(structured_data.events_size()); external_metrics_scans_ = 0; // Applies custom metadata providers. Recorder::GetInstance()->OnProvideIndependentMetrics(&uma_proto); } -bool StructuredMetricsRecorder::CanProvideMetrics() { - return recording_enabled() && IsInitialized(); +bool StructuredMetricsRecorder::IsInitialized() { + return init_state_.Has(State::kKeyDataInitialized); } -bool StructuredMetricsRecorder::IsInitialized() { - return init_state_.HasAll( - InitState{State::kKeyDataInitialized, State::kProfileKeyDataInitialized}); +bool StructuredMetricsRecorder::IsProfileInitialized() { + return init_state_.Has(State::kProfileKeyDataInitialized); } void StructuredMetricsRecorder::InitializeKeyDataProvider( @@ -152,7 +154,7 @@ } void StructuredMetricsRecorder::OnExternalMetricsCollected( - const EventsProto& events) { + const EventsProto& external_events) { DCHECK(base::CurrentUIThread::IsSet()); if (!recording_enabled_) { return; @@ -162,21 +164,15 @@ // This isn't called until after a profile is added |event_storage_| will // never be null in that situation. CHECK(event_storage_); - event_storage_->AddBatchEvents(events.non_uma_events()); + event_storage_->AddBatchEvents(external_events.non_uma_events()); // Only increment if new events were add. - if (events.non_uma_events_size()) { + if (external_events.non_uma_events_size()) { external_metrics_scans_ += 1; } } void StructuredMetricsRecorder::Purge() { - // Only purge if the recorder has been initialized. - if (!IsInitialized()) { - return; - } - DCHECK(IsKeyDataInitialized()); - CHECK(event_storage_); event_storage_->Purge(); key_data_provider_->Purge(); @@ -226,15 +222,17 @@ // Events should be ignored if recording is disabled. LogEventRecordingState(EventRecordingState::kRecordingDisabled); return; - } else if (!IsInitialized()) { - // If recorder is not ready to record metrics, then store the events - // in-memory until they are ready to be persisted. - LogEventRecordingState(EventRecordingState::kProviderUninitialized); + } + + if (IsDeviceEvent(event) && !IsInitialized()) { RecordEventBeforeInitialization(event); return; } - DCHECK(IsKeyDataInitialized()); + if (IsProfileEvent(event) && !IsProfileInitialized()) { + RecordProfileEventBeforeInitialization(event); + return; + } RecordEvent(event); @@ -316,6 +314,12 @@ unhashed_events_.emplace_back(event.Clone()); } +void StructuredMetricsRecorder::RecordProfileEventBeforeInitialization( + const Event& event) { + DCHECK(!IsProfileInitialized()); + unhashed_profile_events_.emplace_back(event.Clone()); +} + void StructuredMetricsRecorder::RecordEvent(const Event& event) { DCHECK(IsKeyDataInitialized()); CHECK(event_storage_); @@ -497,11 +501,19 @@ } void StructuredMetricsRecorder::HashUnhashedEventsAndPersist() { - LogNumEventsRecordedBeforeInit(unhashed_events_.size()); - - while (!unhashed_events_.empty()) { - RecordEvent(unhashed_events_.front()); - unhashed_events_.pop_front(); + if (IsInitialized()) { + LogNumEventsRecordedBeforeInit(unhashed_events_.size()); + while (!unhashed_events_.empty()) { + RecordEvent(unhashed_events_.front()); + unhashed_events_.pop_front(); + } + } + if (IsProfileInitialized()) { + LogNumEventsRecordedBeforeInit(unhashed_profile_events_.size()); + while (!unhashed_profile_events_.empty()) { + RecordEvent(unhashed_profile_events_.front()); + unhashed_profile_events_.pop_front(); + } } } @@ -569,4 +581,32 @@ return std::make_pair(project_validator, event_validator); } +bool StructuredMetricsRecorder::IsDeviceEvent(const Event& event) const { + // Validates the event. If valid, retrieve the metadata associated + // with the event. + const auto validators = GetEventValidators(event); + if (!validators) { + return false; + } + const auto* project_validator = validators->first; + + return project_validator->id_scope() == IdScope::kPerDevice; +} + +bool StructuredMetricsRecorder::IsProfileEvent(const Event& event) const { + // Validates the event. If valid, retrieve the metadata associated + // with the event. + const auto validators = GetEventValidators(event); + if (!validators) { + return false; + } + const auto* project_validator = validators->first; + + return project_validator->id_scope() == IdScope::kPerProfile; +} + +bool StructuredMetricsRecorder::CanProvideMetrics() { + return recording_enabled() && (IsInitialized() || IsProfileInitialized()); +} + } // namespace metrics::structured
diff --git a/components/metrics/structured/structured_metrics_recorder.h b/components/metrics/structured/structured_metrics_recorder.h index c7a2c5f..789c3413 100644 --- a/components/metrics/structured/structured_metrics_recorder.h +++ b/components/metrics/structured/structured_metrics_recorder.h
@@ -90,6 +90,9 @@ // Returns true if ready to provide metrics via ProvideEventMetrics. bool CanProvideMetrics(); + // Returns true if there are metrics to provide. + bool HasMetricsToProvide(); + // KeyDataProvider::Observer: void OnKeyReady() override; @@ -131,7 +134,9 @@ using InitState = base::EnumSet<State, State::kUninitialized, State::kMaxValue>; - void OnExternalMetricsCollected(const EventsProto& events); + void OnRead(ReadStatus status); + void OnWrite(WriteStatus status); + void OnExternalMetricsCollected(const EventsProto& external_events); // Recorder::RecorderImpl: void OnProfileAdded(const base::FilePath& profile_path) override; @@ -149,9 +154,12 @@ // happens asynchronously. void SetEventRecordCallbackForTest(base::RepeatingClosure callback); - // Records events before |init_state_| is kInitialized. + // Records events before IsInitialized(). void RecordEventBeforeInitialization(const Event& event); + // Records events before IsProfileInitialized(). + void RecordProfileEventBeforeInitialization(const Event& event); + // Records |event| to persistent disk to be eventually sent. void RecordEvent(const Event& event); @@ -198,12 +206,19 @@ // Returns true if ready to record events. bool IsInitialized(); + // Returns true if ready to record profile events. + bool IsProfileInitialized(); + // Returns whether the |event| can be recorded event if metrics is opted-out. // Note that uploading is still guarded by metrics opt-in state and that these // events will never be uploaded. In the event that a user opts-in, these // events will be purged. bool CanForceRecord(const Event& event) const; + // Helper functions to determine scope of the event. + bool IsDeviceEvent(const Event& event) const; + bool IsProfileEvent(const Event& event) const; + // Helper function to get the validators for |event|. absl::optional<std::pair<const ProjectValidator*, const EventValidator*>> GetEventValidators(const Event& event) const; @@ -255,15 +270,15 @@ // Key data provider that provides device and profile keys. std::unique_ptr<KeyDataProvider> key_data_provider_; - // Store for events that were recorded before user/device keys are loaded. + // Store for events that were recorded before keys are loaded. std::deque<Event> unhashed_events_; + // Store for events that were recorded before profile keys are loaded. + std::deque<Event> unhashed_profile_events_; + // Whether the system profile has been initialized. bool system_profile_initialized_ = false; - // File path where device keys will be persisted. - const base::FilePath device_key_path_; - // Interface for providing the SystemProfile to metrics. // See chrome/browser/metrics/chrome_metrics_service_client.h raw_ptr<metrics::MetricsProvider, DanglingUntriaged> system_profile_provider_;
diff --git a/components/metrics/structured/structured_metrics_recorder_unittest.cc b/components/metrics/structured/structured_metrics_recorder_unittest.cc index b43cdbf..110592f 100644 --- a/components/metrics/structured/structured_metrics_recorder_unittest.cc +++ b/components/metrics/structured/structured_metrics_recorder_unittest.cc
@@ -152,10 +152,15 @@ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); // Fixed paths to store keys for test. - device_key_path_ = - temp_dir_.GetPath().Append("structured_metrics").Append("device_keys"); - profile_key_path_ = - temp_dir_.GetPath().Append("structured_metrics").Append("keys"); + device_key_path_ = temp_dir_.GetPath() + .Append(FILE_PATH_LITERAL("structured_metrics")) + .Append(FILE_PATH_LITERAL("device_keys")); + device_events_path_ = temp_dir_.GetPath() + .Append(FILE_PATH_LITERAL("structured_metrics")) + .Append(FILE_PATH_LITERAL("device_events")); + profile_key_path_ = temp_dir_.GetPath() + .Append(FILE_PATH_LITERAL("structured_metrics")) + .Append(FILE_PATH_LITERAL("profile_keys")); Recorder::GetInstance()->SetUiTaskRunner( task_environment_.GetMainThreadTaskRunner()); @@ -171,6 +176,8 @@ base::FilePath DeviceKeyFilePath() { return device_key_path_; } + base::FilePath DeviceStoreFilePath() { return device_events_path_; } + void TearDown() override { StructuredMetricsClient::Get()->UnsetDelegate(); } void Wait() { task_environment_.RunUntilIdle(); } @@ -351,6 +358,7 @@ TestRecorder test_recorder_; base::FilePath device_key_path_; + base::FilePath device_events_path_; base::FilePath profile_key_path_; };
diff --git a/components/metrics/structured/structured_metrics_service_unittest.cc b/components/metrics/structured/structured_metrics_service_unittest.cc index d4fd94a..c892531 100644 --- a/components/metrics/structured/structured_metrics_service_unittest.cc +++ b/components/metrics/structured/structured_metrics_service_unittest.cc
@@ -119,6 +119,10 @@ .Append("device_keys"); } + base::FilePath DeviceEventsFilePath() { + return temp_dir_.GetPath().Append("structured_metrics").Append("events"); + } + void WriteTestingProfileKeys() { const int today = (base::Time::Now() - base::Time::UnixEpoch()).InDays();
diff --git a/components/ml/webnn/graph_validation_utils.cc b/components/ml/webnn/graph_validation_utils.cc index ca0d0192..ec38fbd 100644 --- a/components/ml/webnn/graph_validation_utils.cc +++ b/components/ml/webnn/graph_validation_utils.cc
@@ -434,6 +434,98 @@ return outputs; } +// This helper method is intended to validate mean, variance, scale and bias +// operands of batchNormalization against the input operand. These operands +// share the same constraint. +base::expected<void, std::string> +ValidateBatchNormalizationOperandIsCompatibleWithInput( + const Operand& operand, + const Operand::DataType input_data_type, + size_t input_size_on_axis) { + if (operand.data_type != input_data_type) { + return base::unexpected("the data type doesn't match the input data type."); + } + if (operand.dimensions.size() != 1) { + return base::unexpected("the operand should be a 1-D tensor."); + } + + if (operand.dimensions[0] != input_size_on_axis) { + return base::unexpected( + "the size of operand must be equal to the size of the input dimension " + "denoted by axis."); + } + + return base::ok(); +} + +BatchNormalizationAttributes::BatchNormalizationAttributes() = default; +BatchNormalizationAttributes::~BatchNormalizationAttributes() = default; + +BatchNormalizationAttributes::BatchNormalizationAttributes( + BatchNormalizationAttributes&& other) = default; +BatchNormalizationAttributes& BatchNormalizationAttributes::operator=( + BatchNormalizationAttributes&& other) = default; + +base::expected<Operand, std::string> ValidateBatchNormalizationAndInferOutput( + const Operand& input, + const Operand& mean, + const Operand& variance, + const BatchNormalizationAttributes& attributes) { + // Validate input type. + if (!IsFloatingPointType(input.data_type)) { + return base::unexpected( + "The input type must be one of the floating point types."); + } + if (base::MakeStrictNum(attributes.axis) >= input.dimensions.size()) { + return base::unexpected( + "The value of axis must be in the range [0, N-1] where N is the rank " + "of the input tensor."); + } + + auto input_size_on_axis = input.dimensions[attributes.axis]; + auto input_data_type = input.data_type; + // Validate mean operand. + const auto validation_mean = + ValidateBatchNormalizationOperandIsCompatibleWithInput( + mean, input_data_type, input_size_on_axis); + if (!validation_mean.has_value()) { + return base::unexpected("For mean operand: " + validation_mean.error()); + } + + // Validate variance operand. + const auto validation_variance = + ValidateBatchNormalizationOperandIsCompatibleWithInput( + variance, input_data_type, input_size_on_axis); + if (!validation_variance.has_value()) { + return base::unexpected("For variance operand: " + + validation_variance.error()); + } + + // Validate scale operand. + if (attributes.scale) { + const auto validation_scale = + ValidateBatchNormalizationOperandIsCompatibleWithInput( + attributes.scale.value(), input_data_type, input_size_on_axis); + if (!validation_scale.has_value()) { + return base::unexpected("For scale operand: " + validation_scale.error()); + } + } + + // Validate bias operand. + if (attributes.bias) { + const auto validation_bias = + ValidateBatchNormalizationOperandIsCompatibleWithInput( + attributes.bias.value(), input_data_type, input_size_on_axis); + if (!validation_bias.has_value()) { + return base::unexpected("For bias operand: " + validation_bias.error()); + } + } + + // The output tensor of batchNormalization is the same shape as the input + // tensor. + return Operand(input_data_type, std::move(input.dimensions)); +} + Conv2dAttributesBase::Conv2dAttributesBase() = default; Conv2dAttributesBase::~Conv2dAttributesBase() = default;
diff --git a/components/ml/webnn/graph_validation_utils.h b/components/ml/webnn/graph_validation_utils.h index ae6dad7b..053d7d3 100644 --- a/components/ml/webnn/graph_validation_utils.h +++ b/components/ml/webnn/graph_validation_utils.h
@@ -122,6 +122,27 @@ Size2d<uint32_t> ending; }; +// Contains the attributes of batchNormalization operator. +struct BatchNormalizationAttributes { + BatchNormalizationAttributes(); + ~BatchNormalizationAttributes(); + + BatchNormalizationAttributes(BatchNormalizationAttributes&& other); + BatchNormalizationAttributes& operator=(BatchNormalizationAttributes&& other); + + BatchNormalizationAttributes(const BatchNormalizationAttributes&) = delete; + BatchNormalizationAttributes& operator=(const BatchNormalizationAttributes&) = + delete; + + // The 1-D tensor of the scaling values. + absl::optional<Operand> scale; + // The 1-D tensor of the bias values. + absl::optional<Operand> bias; + // The number which specifies the index to the feature count dimension of the + // input shape for which the mean and variance values are. + uint32_t axis = 1; +}; + // Contains the attributes of conv2d operator. struct Conv2dAttributesBase { Conv2dAttributesBase(); @@ -275,6 +296,14 @@ const Operand& input, const SplitAttribute& attributes); +// Validate and infer output information of batchNormalization operator defined +// in WebIDL here https://www.w3.org/TR/webnn/#api-mlgraphbuilder-batchnorm. +base::expected<Operand, std::string> ValidateBatchNormalizationAndInferOutput( + const Operand& input, + const Operand& mean, + const Operand& variance, + const BatchNormalizationAttributes& attributes); + // Validate and infer output information of 2-D convolution operator defined in // WebIDL here https://www.w3.org/TR/webnn/#api-mlgraphbuilder-conv2d base::expected<Operand, std::string> ValidateConv2dAndInferOutput(
diff --git a/components/optimization_guide/internal b/components/optimization_guide/internal index 80d7d6e..60f9997 160000 --- a/components/optimization_guide/internal +++ b/components/optimization_guide/internal
@@ -1 +1 @@ -Subproject commit 80d7d6e3436af2186c17c4fa76774715d26c7c67 +Subproject commit 60f9997f88f625ec79d7de4197b1a8242ea6863e
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 8da4cf42..e9e2ca3 100644 --- a/components/policy/core/common/cloud/encrypted_reporting_job_configuration.cc +++ b/components/policy/core/common/cloud/encrypted_reporting_job_configuration.cc
@@ -13,6 +13,7 @@ #include "base/no_destructor.h" #include "base/strings/string_number_conversions.h" #include "components/reporting/proto/synced/record_constants.pb.h" +#include "components/reporting/util/record_upload_request_json_keys.h" #include "net/base/backoff_entry.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -21,19 +22,6 @@ namespace { -// EncryptedReportingJobConfiguration strings -constexpr char kEncryptedRecordListKey[] = "encryptedRecord"; -constexpr char kSequenceInformationKey[] = "sequenceInformation"; -constexpr char kSequenceId[] = "sequencingId"; -constexpr char kGenerationId[] = "generationId"; -constexpr char kPriority[] = "priority"; -constexpr char kConfigurationFileVersionKey[] = "configurationFileVersion"; -constexpr char kAttachEncryptionSettingsKey[] = "attachEncryptionSettings"; -constexpr char kSourceKey[] = "source"; -constexpr char kDeviceKey[] = "device"; -constexpr char kBrowserKey[] = "browser"; -constexpr char kRequestId[] = "requestId"; - // Generate new backoff entry. std::unique_ptr<::net::BackoffEntry> GetBackoffEntry( ::reporting::Priority priority) { @@ -173,7 +161,7 @@ // TODO(b/232455728): if test_request_payload is moved to components/ // we would be able to use it here. const auto* const encrypted_record_list = - payload_.FindList(kEncryptedRecordListKey); + payload_.FindList(reporting::json_keys::kEncryptedRecordListKey); // If there are no records, assume UNDEFINED priority and seq_id = -1. priority_ = ::reporting::UNDEFINED_PRIORITY; generation_id_ = -1; @@ -182,13 +170,15 @@ const auto sequence_information_it = std::prev(encrypted_record_list->cend()); const auto* const sequence_information = - sequence_information_it->GetDict().FindDict(kSequenceInformationKey); + sequence_information_it->GetDict().FindDict( + reporting::json_keys::kSequenceInformationKey); if (sequence_information != nullptr) { - const auto maybe_priority = sequence_information->FindInt(kPriority); - auto* const generation_id_ptr = - sequence_information->FindString(kGenerationId); - auto* const sequence_id_ptr = - sequence_information->FindString(kSequenceId); + const auto maybe_priority = + sequence_information->FindInt(reporting::json_keys::kPriorityKey); + auto* const generation_id_ptr = sequence_information->FindString( + reporting::json_keys::kGenerationIdKey); + auto* const sequence_id_ptr = sequence_information->FindString( + reporting::json_keys::kSequencingIdKey); if (maybe_priority.has_value() && ::reporting::Priority_IsValid(maybe_priority.value())) { priority_ = static_cast<::reporting::Priority>(maybe_priority.value()); @@ -328,9 +318,13 @@ EncryptedReportingJobConfiguration::GetTopLevelKeyAllowList() { static const base::NoDestructor<base::flat_set<std::string>> kTopLevelKeyAllowList{std::initializer_list<std::string>{ - kAttachEncryptionSettingsKey, kBrowserKey, - kConfigurationFileVersionKey, kDeviceKey, kEncryptedRecordListKey, - kRequestId, kSourceKey}}; + reporting::json_keys::kAttachEncryptionSettingsKey, + reporting::json_keys::kBrowserKey, + reporting::json_keys::kConfigurationFileVersionKey, + reporting::json_keys::kDeviceKey, + reporting::json_keys::kEncryptedRecordListKey, + reporting::json_keys::kRequestIdKey, + reporting::json_keys::kSourceKey}}; return *kTopLevelKeyAllowList; }
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 a677020..4325b2e 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
@@ -22,6 +22,8 @@ #include "components/policy/core/common/cloud/mock_cloud_policy_client.h" #include "components/reporting/proto/synced/record.pb.h" #include "components/reporting/proto/synced/record_constants.pb.h" +#include "components/reporting/util/record_upload_request_json_keys.h" +#include "components/reporting/util/record_upload_response_json_keys.h" #include "components/version_info/version_info.h" #include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" #include "services/network/test/test_url_loader_factory.h" @@ -53,44 +55,6 @@ constexpr char kEncryptionKeyValue[] = "abcdef"; constexpr uint64_t kPublicKeyIdValue = 9876; -// Keys for response internal dictionaries -constexpr char kLastSucceedUploadedRecordKey[] = "lastSucceedUploadedRecord"; -constexpr char kFirstFailedUploadedRecordKey[] = "firstFailedUploadedRecord"; - -// UploadEncryptedReportingRequest list key -constexpr char kEncryptedRecordListKey[] = "encryptedRecord"; - -// Encryption settings request key -constexpr char kAttachEncryptionSettingsKey[] = "attachEncryptionSettings"; - -// Configuration file version request key -constexpr char kConfigurationFileVersionKey[] = "configurationFileVersion"; - -// Source key -constexpr char kSourceKey[] = "source"; - -// Keys for EncryptedRecord -constexpr char kEncryptedWrappedRecordKey[] = "encryptedWrappedRecord"; -constexpr char kSequenceInformationKey[] = "sequenceInformation"; -constexpr char kEncryptionInfoKey[] = "encryptionInfo"; - -// Keys for internal encryption information dictionaries. -constexpr char kEncryptionKey[] = "encryptionKey"; -constexpr char kPublicKeyIdKey[] = "publicKeyId"; - -// Keys for internal SequenceInformation dictionaries. -constexpr char kSequencingIdKey[] = "sequencingId"; -constexpr char kGenerationIdKey[] = "generationId"; -constexpr char kPriorityKey[] = "priority"; - -// Keys for FirstFailedUploadRecord values. -constexpr char kFailedUploadedRecord[] = "failedUploadedRecord"; -constexpr char kFailureStatus[] = "failureStatus"; - -// Keys for FirstFailedUploadRecord Status dictionary -constexpr char kCodeKey[] = "code"; -constexpr char kMessageKey[] = "message"; - constexpr char kDmToken[] = "fake-dm-token"; constexpr char kClientId[] = "fake-client-id"; constexpr char kServerUrl[] = "https://example.com/reporting"; @@ -106,20 +70,21 @@ bool request_configuration_file = false, bool client_automated_test = false) { if (attach_encryption_settings) { - payload_.Set(kAttachEncryptionSettingsKey, true); + payload_.Set(reporting::json_keys::kAttachEncryptionSettingsKey, true); } if (request_configuration_file) { - payload_.Set(kConfigurationFileVersionKey, 1234); + payload_.Set(reporting::json_keys::kConfigurationFileVersionKey, 1234); } if (client_automated_test) { - payload_.Set(kSourceKey, "tast"); + payload_.Set(reporting::json_keys::kSourceKey, "tast"); } - payload_.Set(kEncryptedRecordListKey, base::Value::List()); + payload_.Set(reporting::json_keys::kEncryptedRecordListKey, + base::Value::List()); } RequestPayloadBuilder& AddRecord(const base::Value& record) { base::Value::List* records_list = - payload_.FindList(kEncryptedRecordListKey); + payload_.FindList(reporting::json_keys::kEncryptedRecordListKey); records_list->Append(record.Clone()); return *this; } @@ -137,10 +102,11 @@ absl::optional<base::Value> upload_failure) { base::Value::Dict response; - response.Set(kLastSucceedUploadedRecordKey, sequence_information.Clone()); + response.Set(reporting::json_keys::kLastSucceedUploadedRecordKey, + sequence_information.Clone()); if (upload_failure.has_value()) { - response.Set(kFirstFailedUploadedRecordKey, + response.Set(reporting::json_keys::kFirstFailedUploadedRecordKey, std::move(upload_failure.value())); } return response; @@ -153,22 +119,23 @@ } static std::string GetUploadFailureFailedUploadSequencingIdPath() { - return GetPath(kFirstFailedUploadedRecordKey, + return GetPath(reporting::json_keys::kFirstFailedUploadedRecordKey, GetFailedUploadSequencingIdPath()); } static std::string GetUploadFailureFailedUploadGenerationIdPath() { - return GetPath(kFirstFailedUploadedRecordKey, + return GetPath(reporting::json_keys::kFirstFailedUploadedRecordKey, GetFailedUploadGenerationIdPath()); } static std::string GetUploadFailureFailedUploadPriorityPath() { - return GetPath(kFirstFailedUploadedRecordKey, + return GetPath(reporting::json_keys::kFirstFailedUploadedRecordKey, GetFailedUploadPriorityPath()); } static std::string GetUploadFailureStatusCodePath() { - return GetPath(kFirstFailedUploadedRecordKey, GetFailureStatusCodePath()); + return GetPath(reporting::json_keys::kFirstFailedUploadedRecordKey, + GetFailureStatusCodePath()); } private: @@ -177,23 +144,28 @@ } static std::string GetFailedUploadSequencingIdPath() { - return GetPath(kFailedUploadedRecord, kSequencingIdKey); + return GetPath(reporting::json_keys::kFailedUploadedRecordKey, + reporting::json_keys::kSequencingIdKey); } static std::string GetFailedUploadGenerationIdPath() { - return GetPath(kFailedUploadedRecord, kGenerationIdKey); + return GetPath(reporting::json_keys::kFailedUploadedRecordKey, + reporting::json_keys::kGenerationIdKey); } static std::string GetFailedUploadPriorityPath() { - return GetPath(kFailedUploadedRecord, kPriorityKey); + return GetPath(reporting::json_keys::kFailedUploadedRecordKey, + reporting::json_keys::kPriorityKey); } static std::string GetFailureStatusCodePath() { - return GetPath(kFailureStatus, kCodeKey); + return GetPath(reporting::json_keys::kFailureStatusKey, + reporting::json_keys::kCodeKey); } static std::string GetFailureStatusMessagePath() { - return GetPath(kFailureStatus, kMessageKey); + return GetPath(reporting::json_keys::kFailureStatusKey, + reporting::json_keys::kMessageKey); } }; @@ -233,7 +205,8 @@ TestUpload CreateTestUpload(const base::Value& record_value) { TestUpload test_upload; test_upload.response = ResponseValueBuilder::CreateResponse( - *record_value.GetDict().FindDict(kSequenceInformationKey), + *record_value.GetDict().FindDict( + reporting::json_keys::kSequenceInformationKey), absl::nullopt); test_upload.completion_cb = std::make_unique<StrictMock<MockCompleteCb>>(); test_upload.configuration = @@ -251,20 +224,23 @@ base::Value::Dict record_dictionary; std::string base64_encode; base::Base64Encode(encrypted_wrapped_record, &base64_encode); - record_dictionary.Set(kEncryptedWrappedRecordKey, base64_encode); + record_dictionary.Set(reporting::json_keys::kEncryptedWrappedRecordKey, + base64_encode); base::Value::Dict* const sequencing_dictionary = - record_dictionary.EnsureDict(kSequenceInformationKey); - sequencing_dictionary->Set(kSequencingIdKey, + record_dictionary.EnsureDict( + reporting::json_keys::kSequenceInformationKey); + sequencing_dictionary->Set(reporting::json_keys::kSequencingIdKey, base::NumberToString(GetNextSequenceId())); - sequencing_dictionary->Set(kGenerationIdKey, + sequencing_dictionary->Set(reporting::json_keys::kGenerationIdKey, base::NumberToString(kGenerationId)); - sequencing_dictionary->Set(kPriorityKey, priority); + sequencing_dictionary->Set(reporting::json_keys::kPriorityKey, priority); base::Value::Dict* const encryption_info_dictionary = - record_dictionary.EnsureDict(kEncryptionInfoKey); - encryption_info_dictionary->Set(kEncryptionKey, kEncryptionKeyValue); - encryption_info_dictionary->Set(kPublicKeyIdKey, + record_dictionary.EnsureDict(reporting::json_keys::kEncryptionInfoKey); + encryption_info_dictionary->Set(reporting::json_keys::kEncryptionKey, + kEncryptionKeyValue); + encryption_info_dictionary->Set(reporting::json_keys::kPublicKeyId, base::NumberToString(kPublicKeyIdValue)); return base::Value(std::move(record_dictionary)); @@ -280,15 +256,16 @@ void GetRecordList(EncryptedReportingJobConfiguration* configuration, base::Value::List** record_list) { base::Value* const payload = GetPayload(configuration); - *record_list = payload->GetDict().FindList(kEncryptedRecordListKey); + *record_list = payload->GetDict().FindList( + reporting::json_keys::kEncryptedRecordListKey); ASSERT_TRUE(*record_list); } bool GetAttachEncryptionSettings( EncryptedReportingJobConfiguration* configuration) { base::Value* const payload = GetPayload(configuration); - const auto attach_encryption_settings = - payload->GetDict().FindBool(kAttachEncryptionSettingsKey); + const auto attach_encryption_settings = payload->GetDict().FindBool( + reporting::json_keys::kAttachEncryptionSettingsKey); return attach_encryption_settings.has_value() && attach_encryption_settings.value(); } @@ -296,15 +273,16 @@ bool VerifyConfigurationFileVersion( EncryptedReportingJobConfiguration* configuration) { base::Value* const payload = GetPayload(configuration); - auto* request_configuration_file = - payload->GetDict().Find(kConfigurationFileVersionKey); + auto* request_configuration_file = payload->GetDict().Find( + reporting::json_keys::kConfigurationFileVersionKey); return request_configuration_file->is_int() && request_configuration_file->GetIfInt() == 1234; } bool VerifySourceIsTast(EncryptedReportingJobConfiguration* configuration) { base::Value* const payload = GetPayload(configuration); - auto* client_automated_test = payload->GetDict().Find(kSourceKey); + auto* client_automated_test = + payload->GetDict().Find(reporting::json_keys::kSourceKey); return client_automated_test->is_string() && *client_automated_test->GetIfString() == "tast"; } @@ -452,7 +430,8 @@ EXPECT_EQ((*record_list)[0], record_value); std::string* encrypted_wrapped_record = - (*record_list)[0].GetDict().FindString(kEncryptedWrappedRecordKey); + (*record_list)[0].GetDict().FindString( + reporting::json_keys::kEncryptedWrappedRecordKey); ASSERT_THAT(encrypted_wrapped_record, NotNull()); std::string decoded_record; @@ -957,10 +936,11 @@ static constexpr char kInvalidKey[] = "invalid"; base::Value::Dict request; - request.Set(kEncryptedRecordListKey, base::Value::List()); - request.Set(kConfigurationFileVersionKey, 1234); - request.Set(kAttachEncryptionSettingsKey, true); - request.Set(kSourceKey, "tast"); + request.Set(reporting::json_keys::kEncryptedRecordListKey, + base::Value::List()); + request.Set(reporting::json_keys::kConfigurationFileVersionKey, 1234); + request.Set(reporting::json_keys::kAttachEncryptionSettingsKey, true); + request.Set(reporting::json_keys::kSourceKey, "tast"); request.Set(kDeviceKey, base::Value::Dict()); request.Set(kBrowserKey, base::Value::Dict()); request.Set(kInvalidKey, base::Value::Dict()); @@ -975,11 +955,14 @@ ASSERT_TRUE(payload); ASSERT_TRUE(payload->is_dict()); - EXPECT_TRUE(payload->GetDict().FindList(kEncryptedRecordListKey)); - EXPECT_TRUE(payload->GetDict().FindBool(kAttachEncryptionSettingsKey)); - EXPECT_TRUE( - payload->GetDict().FindInt(kConfigurationFileVersionKey).has_value()); - EXPECT_TRUE(payload->GetDict().FindString(kSourceKey)); + EXPECT_TRUE(payload->GetDict().FindList( + reporting::json_keys::kEncryptedRecordListKey)); + EXPECT_TRUE(payload->GetDict().FindBool( + reporting::json_keys::kAttachEncryptionSettingsKey)); + EXPECT_TRUE(payload->GetDict() + .FindInt(reporting::json_keys::kConfigurationFileVersionKey) + .has_value()); + EXPECT_TRUE(payload->GetDict().FindString(reporting::json_keys::kSourceKey)); 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/device_policy_proto_map.yaml b/components/policy/resources/templates/device_policy_proto_map.yaml index c3d4740..4789932d 100644 --- a/components/policy/resources/templates/device_policy_proto_map.yaml +++ b/components/policy/resources/templates/device_policy_proto_map.yaml
@@ -94,7 +94,7 @@ DeviceLoginScreenSystemInfoEnforced: device_login_screen_system_info_enforced.value DeviceLoginScreenVirtualKeyboardEnabled: accessibility_settings.login_screen_virtual_keyboard_enabled DeviceLoginScreenWebUILazyLoading: login_web_ui_lazy_loading.enabled -DeviceLoginScreenWebHidAllowDevicesForUrls: device_login_screen_webhid_allow_devices_for_urls.device_login_screen_webhid_allow_devices_for_urls +DeviceLoginScreenWebHidAllowDevicesForUrls: device_login_screen_webhid_allow_devices_for_urls.value DeviceLoginScreenWebUsbAllowDevicesForUrls: device_login_screen_webusb_allow_devices_for_urls.device_login_screen_webusb_allow_devices_for_urls DeviceMachinePasswordChangeRate: device_machine_password_change_rate.rate_days DeviceMetricsReportingEnabled: metrics_enabled.metrics_enabled
diff --git a/components/privacy_sandbox/privacy_sandbox_features.cc b/components/privacy_sandbox/privacy_sandbox_features.cc index d9faab6e..980c618 100644 --- a/components/privacy_sandbox/privacy_sandbox_features.cc +++ b/components/privacy_sandbox/privacy_sandbox_features.cc
@@ -73,25 +73,6 @@ const base::FeatureParam<bool> kPrivacySandboxSettings4CloseAllPrompts{ &kPrivacySandboxSettings4, "close-all-prompts", true}; -BASE_FEATURE(kPrivacySandboxSettings3, - "PrivacySandboxSettings3", - base::FEATURE_ENABLED_BY_DEFAULT); -const base::FeatureParam<bool> kPrivacySandboxSettings3ConsentRequired{ - &kPrivacySandboxSettings3, "consent-required", false}; -const base::FeatureParam<bool> kPrivacySandboxSettings3NoticeRequired{ - &kPrivacySandboxSettings3, "notice-required", false}; - -const base::FeatureParam<bool> - kPrivacySandboxSettings3ForceShowConsentForTesting{ - &kPrivacySandboxSettings3, "force-show-consent-for-testing", false}; -const base::FeatureParam<bool> - kPrivacySandboxSettings3ForceShowNoticeForTesting{ - &kPrivacySandboxSettings3, "force-show-notice-for-testing", false}; -const base::FeatureParam<bool> kPrivacySandboxSettings3ShowSampleDataForTesting{ - &kPrivacySandboxSettings3, "show-sample-data", false}; -const base::FeatureParam<bool> kPrivacySandboxSettings3DisablePromptForTesting{ - &kPrivacySandboxSettings3, "disable-dialog-for-testing", false}; - BASE_FEATURE(kOverridePrivacySandboxSettingsLocalTesting, "OverridePrivacySandboxSettingsLocalTesting", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/components/privacy_sandbox/privacy_sandbox_features.h b/components/privacy_sandbox/privacy_sandbox_features.h index ca9c604..b44ba65 100644 --- a/components/privacy_sandbox/privacy_sandbox_features.h +++ b/components/privacy_sandbox/privacy_sandbox_features.h
@@ -94,40 +94,6 @@ COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) extern const base::FeatureParam<bool> kPrivacySandboxSettings4CloseAllPrompts; -// Enables the third release of the Privacy Sandbox settings. -COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) -BASE_DECLARE_FEATURE(kPrivacySandboxSettings3); -// When true, the user will be shown a consent to enable the Privacy Sandbox -// release 3, if they accept the APIs will become active. Only one of this and -// the below notice feature should be enabled at any one time. -COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) -extern const base::FeatureParam<bool> kPrivacySandboxSettings3ConsentRequired; -// When true, the user will be shown a notice, after which the Privacy Sandbox -// 3 APIs will become active. Only one of this and the above consent feature -// should be enabled at any one time. -COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) -extern const base::FeatureParam<bool> kPrivacySandboxSettings3NoticeRequired; - -// Feature parameters which should exclusively be used for testing purposes. -// Enabling any of these parameters may result in the Privacy Sandbox prefs -// (unsynced) entering an unexpected state, requiring profile deletion to -// resolve. -COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) -extern const base::FeatureParam<bool> - kPrivacySandboxSettings3ForceShowConsentForTesting; -COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) -extern const base::FeatureParam<bool> - kPrivacySandboxSettings3ForceShowNoticeForTesting; -COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) -extern const base::FeatureParam<bool> - kPrivacySandboxSettings3ShowSampleDataForTesting; -// This parameter will suppress all Privacy Sandbox prompts, but is supersceeded -// by the kDisablePrivacySandboxPrompts feature below, and will be removed when -// the PrivacySandboxSettings3 feature is fully launched & solidified. -COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) -extern const base::FeatureParam<bool> - kPrivacySandboxSettings3DisablePromptForTesting; - COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) BASE_DECLARE_FEATURE(kOverridePrivacySandboxSettingsLocalTesting);
diff --git a/components/privacy_sandbox/privacy_sandbox_prefs.h b/components/privacy_sandbox/privacy_sandbox_prefs.h index 43bfbadb..bb5b255 100644 --- a/components/privacy_sandbox/privacy_sandbox_prefs.h +++ b/components/privacy_sandbox/privacy_sandbox_prefs.h
@@ -58,8 +58,8 @@ // Un-synced boolean pref. This is a replacement for the synced preference // above. It performs the exact same functionality, but is unsynced. This -// preference is only consulted when the kPrivacySandboxSettings3 feature is -// enabled. +// preference is only consulted when the kPrivacySandboxSettings4 feature is +// disabled. inline constexpr char kPrivacySandboxApisEnabledV2[] = "privacy_sandbox.apis_enabled_v2";
diff --git a/components/privacy_sandbox/privacy_sandbox_test_util.cc b/components/privacy_sandbox/privacy_sandbox_test_util.cc index d25fe23..c42d8ce 100644 --- a/components/privacy_sandbox/privacy_sandbox_test_util.cc +++ b/components/privacy_sandbox/privacy_sandbox_test_util.cc
@@ -965,15 +965,8 @@ map, std::move(managed_provider), HostContentSettingsMap::POLICY_PROVIDER); - // Only adjust the Privacy Sandbox preference which should be being consulted - // based on feature state. - if (base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings3)) { - testing_pref_service->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, - base::Value(privacy_sandbox_enabled)); - } else { - testing_pref_service->SetUserPref(prefs::kPrivacySandboxApisEnabled, - base::Value(privacy_sandbox_enabled)); - } + testing_pref_service->SetUserPref(prefs::kPrivacySandboxApisEnabledV2, + base::Value(privacy_sandbox_enabled)); } void RunTestCase(
diff --git a/components/reporting/util/record_upload_request_json_keys.h b/components/reporting/util/record_upload_request_json_keys.h new file mode 100644 index 0000000..94e4ddb --- /dev/null +++ b/components/reporting/util/record_upload_request_json_keys.h
@@ -0,0 +1,123 @@ +// 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_REPORTING_UTIL_RECORD_UPLOAD_REQUEST_JSON_KEYS_H_ +#define COMPONENTS_REPORTING_UTIL_RECORD_UPLOAD_REQUEST_JSON_KEYS_H_ + +// This file contains the JSON keys for a request to upload an encrypted record +// to the reporting server. A JSON version of the payload looks like this: +// { +// "encryptedRecord": [ +// { +// "encryptedWrappedRecord": "EncryptedMessage", +// "encryptionInfo" : { +// "encryptionKey": "LocalPublicValue", +// "publicKeyId": 1 +// }, +// "sequenceInformation": { +// "sequencingId": 1, +// "generationId": 123456789, +// "priority": 1 +// // The string value of the `generation_guid` may be empty for managed +// // ChromeOS devices or any non-ChromeOS devices, but will always have +// // a value for unmanaged ChromeOS devices. Its value, if present, +// // must be a string of base::Uuid. See base/uuid.h for format +// // information. +// "generation_guid": "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" +// }, +// "compressionInformation": { +// "compressionAlgorithm": 1 +// } +// }, +// { +// "encryptedWrappedRecord": "EncryptedMessage", +// "encryptionInfo" : { +// "encryptionKey": "LocalPublicValue", +// "publicKeyId": 2 +// }, +// "sequenceInformation": { +// "sequencingId": 2, +// "generationId": 123456789, +// "priority": 1, +// "generation_guid": "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" +// }, +// "compressionInformation": { +// "compressionAlgorithm": 1 +// } +// } +// ], +// // optional field, corresponding to |need_encryption_keys| in +// // components/reporting/proto/interface.proto +// "attachEncryptionSettings": true, +// "requestId": "SomeString", +// // optional field, corresponding to the configuration file version +// // that the client is holding at the moment. +// "configurationFileVersion": 1234 +// // optional field, only used by the client tast tests to signal to the +// // server that this is an automated test from the lab. In production, this +// // should always be absent. Even if it is erroneously present in production +// // code, server ignores it. Marked as string to make it reusable in the +// // future. Value should be "tast" in the tast tests. +// "source": "SomeString" +// } +// +// This payload is added to the common payload of all reporting jobs, which +// includes other sub-fields such as "device" and "browser" (See note "ERP +// Payload Overview"): +// +// EncryptedReportingRequestBuilder builder; +// builder.AddRecord(record1); +// builder.AddRecord(record2); +// ... +// builder.AddRecord(recordN); +// auto payload_result = builder.Build(); +// CHECK(payload_result.has_value()); +// job_payload_.Merge(payload_result.value()); +// +// The value of an "encryptedRecord" must be a list, in which each element is a +// dictionary that represents a record. The details of each record is documented +// in record.proto. + +namespace reporting { +namespace json_keys { + +// UploadEncryptedReportingRequestBuilder list key +inline constexpr char kEncryptedRecordListKey[] = "encryptedRecord"; +inline constexpr char kAttachEncryptionSettingsKey[] = + "attachEncryptionSettings"; +inline constexpr char kConfigurationFileVersionKey[] = + "configurationFileVersion"; +inline constexpr char kSourceKey[] = "source"; + +// EncryptedRecordDictionaryBuilder strings +inline constexpr char kEncryptedWrappedRecordKey[] = "encryptedWrappedRecord"; +inline constexpr char kSequenceInformationKey[] = "sequenceInformation"; +inline constexpr char kEncryptionInfoKey[] = "encryptionInfo"; +inline constexpr char kCompressionInformationKey[] = "compressionInformation"; + +// EncryptionInfoDictionaryBuilder strings +inline constexpr char kEncryptionKey[] = "encryptionKey"; +inline constexpr char kPublicKeyId[] = "publicKeyId"; + +// CompressionInformationDictionaryBuilder strings +inline constexpr char kCompressionAlgorithmKey[] = "compressionAlgorithm"; + +// SequenceInformationDictionaryBuilder strings +inline constexpr char kSequencingIdKey[] = "sequencingId"; +inline constexpr char kGenerationIdKey[] = "generationId"; +inline constexpr char kPriorityKey[] = "priority"; +inline constexpr char kGenerationGuidKey[] = "generationGuid"; + +// RequestId key used to build UploadEncryptedReportingRequest +inline constexpr char kRequestIdKey[] = "requestId"; + +// Key used for device info +inline constexpr char kDeviceKey[] = "device"; + +// Key used for browser info +inline constexpr char kBrowserKey[] = "browser"; + +} // namespace json_keys +} // namespace reporting + +#endif // COMPONENTS_REPORTING_UTIL_RECORD_UPLOAD_REQUEST_JSON_KEYS_H_
diff --git a/components/reporting/util/record_upload_response_json_keys.h b/components/reporting/util/record_upload_response_json_keys.h new file mode 100644 index 0000000..d096067 --- /dev/null +++ b/components/reporting/util/record_upload_response_json_keys.h
@@ -0,0 +1,29 @@ +// 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_REPORTING_UTIL_RECORD_UPLOAD_RESPONSE_JSON_KEYS_H_ +#define COMPONENTS_REPORTING_UTIL_RECORD_UPLOAD_RESPONSE_JSON_KEYS_H_ + +// This file contains JSON fields for the server's response to a request to +// upload encrypted records. See +// components/reporting/util/record_upload_request_json_keys.h for details about +// the request. +namespace reporting { +namespace json_keys { +// Keys for response internal dictionaries +inline constexpr char kLastSucceedUploadedRecordKey[] = + "lastSucceedUploadedRecord"; +inline constexpr char kFirstFailedUploadedRecordKey[] = + "firstFailedUploadedRecord"; + +// Keys for FirstFailedUploadRecord values. +inline constexpr char kFailedUploadedRecordKey[] = "failedUploadedRecord"; +inline constexpr char kFailureStatusKey[] = "failureStatus"; + +// Keys for FirstFailedUploadRecord Status dictionary +inline constexpr char kCodeKey[] = "code"; +inline constexpr char kMessageKey[] = "message"; +} // namespace json_keys +} // namespace reporting + +#endif // COMPONENTS_REPORTING_UTIL_RECORD_UPLOAD_RESPONSE_JSON_KEYS_H_
diff --git a/components/safe_browsing/content/browser/triggers/ad_sampler_trigger.cc b/components/safe_browsing/content/browser/triggers/ad_sampler_trigger.cc index 282842a..6deb657 100644 --- a/components/safe_browsing/content/browser/triggers/ad_sampler_trigger.cc +++ b/components/safe_browsing/content/browser/triggers/ad_sampler_trigger.cc
@@ -170,6 +170,10 @@ MAX_ACTIONS); } +size_t AdSamplerTrigger::GetSamplerFrequencyDenominatorForTest() { + return GetSamplerFrequencyDenominator(); +} + void AdSamplerTrigger::SetSamplerFrequencyForTest(size_t denominator) { sampler_frequency_denominator_ = denominator; }
diff --git a/components/safe_browsing/content/browser/triggers/ad_sampler_trigger.h b/components/safe_browsing/content/browser/triggers/ad_sampler_trigger.h index b21c982..0896736 100644 --- a/components/safe_browsing/content/browser/triggers/ad_sampler_trigger.h +++ b/components/safe_browsing/content/browser/triggers/ad_sampler_trigger.h
@@ -71,11 +71,11 @@ void DidFinishLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url) override; + static size_t GetSamplerFrequencyDenominatorForTest(); + private: friend class AdSamplerTriggerTest; friend class content::WebContentsUserData<AdSamplerTrigger>; - FRIEND_TEST_ALL_PREFIXES(AdSamplerTriggerTestFinch, - FrequencyDenominatorFeature); AdSamplerTrigger( content::WebContents* web_contents,
diff --git a/components/safe_browsing/content/browser/triggers/ad_sampler_trigger_unittest.cc b/components/safe_browsing/content/browser/triggers/ad_sampler_trigger_unittest.cc index 94a82b1..c529077b 100644 --- a/components/safe_browsing/content/browser/triggers/ad_sampler_trigger_unittest.cc +++ b/components/safe_browsing/content/browser/triggers/ad_sampler_trigger_unittest.cc
@@ -220,12 +220,8 @@ // Make sure that setting the frequency denominator via Finch params works as // expected, and that the default frequency is used when no Finch config is // given. - content::BrowserTaskEnvironment task_environment; - AdSamplerTrigger trigger_default(nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr); - EXPECT_EQ(kAdSamplerDefaultFrequency, - trigger_default.sampler_frequency_denominator_); + AdSamplerTrigger::GetSamplerFrequencyDenominatorForTest()); const size_t kDenominatorInt = 12345; @@ -237,8 +233,7 @@ scoped_feature_list.InitAndEnableFeatureWithParameters( safe_browsing::kAdSamplerTriggerFeature, feature_params); - AdSamplerTrigger trigger_finch(nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr); - EXPECT_EQ(kDenominatorInt, trigger_finch.sampler_frequency_denominator_); + EXPECT_EQ(kDenominatorInt, + AdSamplerTrigger::GetSamplerFrequencyDenominatorForTest()); } } // namespace safe_browsing
diff --git a/components/search_engines/DEPS b/components/search_engines/DEPS index 78e6466..af7fe69e 100644 --- a/components/search_engines/DEPS +++ b/components/search_engines/DEPS
@@ -17,6 +17,7 @@ "+components/sync_preferences/testing_pref_service_syncable.h", "+components/url_formatter", "+components/variations", + "+components/version_info/version_info.h", "+components/webdata", "+google_apis", "+net",
diff --git a/components/search_engines/search_engines_pref_names.cc b/components/search_engines/search_engines_pref_names.cc index 10523946..70b1f15 100644 --- a/components/search_engines/search_engines_pref_names.cc +++ b/components/search_engines/search_engines_pref_names.cc
@@ -34,6 +34,10 @@ const char kDefaultSearchProviderChoiceScreenRandomShuffleSeed[] = "default_search_provider.choice_screen_random_shuffle_seed"; +// The Chrome milestone number at which the random seed was last set. +const char kDefaultSearchProviderChoiceScreenShuffleMilestone[] = + "default_search_provider.choice_screen_shuffle_milestone"; + // Whether a search context menu item is allowed. const char kDefaultSearchProviderContextMenuAccessAllowed[] = "default_search_provider.context_menu_access_allowed";
diff --git a/components/search_engines/search_engines_pref_names.h b/components/search_engines/search_engines_pref_names.h index 7c55408..2a2fa81 100644 --- a/components/search_engines/search_engines_pref_names.h +++ b/components/search_engines/search_engines_pref_names.h
@@ -11,6 +11,7 @@ extern const char kSyncedDefaultSearchProviderGUID[]; extern const char kDefaultSearchProviderChoiceScreenCompletionTimestamp[]; extern const char kDefaultSearchProviderChoiceScreenRandomShuffleSeed[]; +extern const char kDefaultSearchProviderChoiceScreenShuffleMilestone[]; extern const char kDefaultSearchProviderContextMenuAccessAllowed[]; extern const char kDefaultSearchProviderKeywordsUseExtendedList[]; extern const char kDefaultSearchProviderEnabled[];
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc index bbe0d8ad..d4a2114 100644 --- a/components/search_engines/template_url_prepopulate_data.cc +++ b/components/search_engines/template_url_prepopulate_data.cc
@@ -23,6 +23,7 @@ #include "components/search_engines/template_url_data.h" #include "components/search_engines/template_url_data_util.h" #include "components/search_engines/template_url_service.h" +#include "components/version_info/version_info.h" namespace TemplateURLPrepopulateData { @@ -1643,11 +1644,18 @@ uint64_t profile_seed = prefs->GetInt64( prefs::kDefaultSearchProviderChoiceScreenRandomShuffleSeed); - // Ensure that the generated seed is not 0 to avoid accidental re-seeding. - while (profile_seed == 0) { + int seed_version_number = prefs->GetInteger( + prefs::kDefaultSearchProviderChoiceScreenShuffleMilestone); + int current_version_number = version_info::GetMajorVersionNumberAsInt(); + // Ensure that the generated seed is not 0 to avoid accidental re-seeding and + // re-shuffle on every chrome update. + while (profile_seed == 0 || current_version_number != seed_version_number) { profile_seed = base::RandUint64(); prefs->SetInt64(prefs::kDefaultSearchProviderChoiceScreenRandomShuffleSeed, profile_seed); + prefs->SetInteger(prefs::kDefaultSearchProviderChoiceScreenShuffleMilestone, + current_version_number); + seed_version_number = current_version_number; } // Randomize all vectors using the generated seed. @@ -1736,6 +1744,8 @@ registry->RegisterIntegerPref(prefs::kSearchProviderOverridesVersion, -1); registry->RegisterInt64Pref( prefs::kDefaultSearchProviderChoiceScreenRandomShuffleSeed, 0); + registry->RegisterIntegerPref( + prefs::kDefaultSearchProviderChoiceScreenShuffleMilestone, 0); registry->RegisterBooleanPref( prefs::kDefaultSearchProviderKeywordsUseExtendedList, false); }
diff --git a/components/search_engines/template_url_prepopulate_data_unittest.cc b/components/search_engines/template_url_prepopulate_data_unittest.cc index 415dfdd..a1a6181 100644 --- a/components/search_engines/template_url_prepopulate_data_unittest.cc +++ b/components/search_engines/template_url_prepopulate_data_unittest.cc
@@ -154,6 +154,15 @@ TemplateURLPrepopulateData::RegisterProfilePrefs(prefs_.registry()); } + void SetupForChoiceScreenDisplay() { + feature_list_.Reset(); + feature_list_.InitAndEnableFeature(switches::kSearchEngineChoice); + // Pick any EEA country + const int kFranceCountryId = + country_codes::CountryCharsToCountryID('F', 'R'); + prefs_.SetInteger(country_codes::kCountryIDAtInstall, kFranceCountryId); + } + protected: sync_preferences::TestingPrefServiceSyncable prefs_; base::test::ScopedFeatureList feature_list_; @@ -215,11 +224,7 @@ // constant per-profile. TEST_F(TemplateURLPrepopulateDataTest, SearchEnginesOrderDoesNotChangePerProfile) { - feature_list_.Reset(); - feature_list_.InitAndEnableFeature(switches::kSearchEngineChoice); - // Pick any EEA country - const int kFranceCountryId = country_codes::CountryCharsToCountryID('F', 'R'); - prefs_.SetInteger(country_codes::kCountryIDAtInstall, kFranceCountryId); + SetupForChoiceScreenDisplay(); // Fetch the list of search engines twice and make sure the order stays the // same. @@ -240,6 +245,39 @@ } } +// Verifies that the the search engines are re-shuffled on Chrome update. +TEST_F(TemplateURLPrepopulateDataTest, + SearchEnginesOrderChangesOnChromeUpdate) { + SetupForChoiceScreenDisplay(); + + std::vector<std::unique_ptr<TemplateURLData>> t_urls = + TemplateURLPrepopulateData::GetPrepopulatedEngines( + &prefs_, + /*default_search_provider_index=*/nullptr); + + // Change the saved chrome milestone to something else. + prefs_.SetInteger(prefs::kDefaultSearchProviderChoiceScreenShuffleMilestone, + 3); + + std::vector<std::unique_ptr<TemplateURLData>> t_urls_after_update = + TemplateURLPrepopulateData::GetPrepopulatedEngines( + &prefs_, + /*default_search_provider_index=*/nullptr); + + ASSERT_EQ(t_urls.size(), t_urls_after_update.size()); + bool is_order_same = true; + for (size_t i = 0; i < t_urls.size(); i++) { + // Each prepopulated engine has a unique prepopulate_id, so we simply + // compare those. + is_order_same &= + t_urls[i]->prepopulate_id == t_urls_after_update[i]->prepopulate_id; + if (!is_order_same) { + break; + } + } + ASSERT_FALSE(is_order_same); +} + // Verifies that default search providers from the preferences file // override the built-in ones. TEST_F(TemplateURLPrepopulateDataTest, ProvidersFromPrefs) {
diff --git a/content/browser/browsing_data/browsing_data_remover_impl_browsertest.cc b/content/browser/browsing_data/browsing_data_remover_impl_browsertest.cc index e52217b8..6d75e06 100644 --- a/content/browser/browsing_data/browsing_data_remover_impl_browsertest.cc +++ b/content/browser/browsing_data/browsing_data_remover_impl_browsertest.cc
@@ -154,7 +154,7 @@ network::SimpleURLLoader::Create(std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - url_loader_factory(), loader_helper.GetCallback()); + url_loader_factory(), loader_helper.GetCallbackDeprecated()); loader_helper.WaitForCallback(); ASSERT_TRUE(loader_helper.response_body()); EXPECT_EQ(kHstsResponseBody, *loader_helper.response_body()); @@ -181,7 +181,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); SimpleURLLoaderTestHelper loader_helper; loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - url_loader_factory(), loader_helper.GetCallback()); + url_loader_factory(), loader_helper.GetCallbackDeprecated()); loader_helper.WaitForCallback(); // On success, HSTS was enabled for the domain.
diff --git a/content/browser/browsing_instance.cc b/content/browser/browsing_instance.cc index 41c5a62..9243d1e 100644 --- a/content/browser/browsing_instance.cc +++ b/content/browser/browsing_instance.cc
@@ -31,6 +31,7 @@ const WebExposedIsolationInfo& web_exposed_isolation_info, bool is_guest, bool is_fenced, + bool is_fixed_storage_partition, const scoped_refptr<CoopRelatedGroup>& coop_related_group, absl::optional<url::Origin> common_coop_origin) : isolation_context_( @@ -44,13 +45,18 @@ default_site_instance_(nullptr), web_exposed_isolation_info_(web_exposed_isolation_info), coop_related_group_(coop_related_group), - common_coop_origin_(common_coop_origin) { + common_coop_origin_(common_coop_origin), + is_fixed_storage_partition_(is_fixed_storage_partition) { DCHECK(browser_context); + if (is_guest) { + CHECK(is_fixed_storage_partition); + } // If we get passed an empty group, build a new one. This is the common case. if (!coop_related_group_) { - coop_related_group_ = base::WrapRefCounted<CoopRelatedGroup>( - new CoopRelatedGroup(browser_context, is_guest, is_fenced)); + coop_related_group_ = + base::WrapRefCounted<CoopRelatedGroup>(new CoopRelatedGroup( + browser_context, is_guest, is_fenced, is_fixed_storage_partition_)); } DCHECK(coop_related_group_);
diff --git a/content/browser/browsing_instance.h b/content/browser/browsing_instance.h index 497aba86..f726ffe 100644 --- a/content/browser/browsing_instance.h +++ b/content/browser/browsing_instance.h
@@ -102,8 +102,12 @@ // // `is_guest` specifies whether this BrowsingInstance will // be used in a <webview> guest; `is_fenced` specifies whether this - // BrowsingInstance is used inside a fenced frame. Note that both `is_guest` - // and `is_fenced` cannot change over the lifetime of the BrowsingInstance. + // BrowsingInstance is used inside a fenced frame. + // `is_fixed_storage_partition` indicates whether the current + // StoragePartition will apply to future navigations. It must be set to true + // if `is_guest` is true. Note that `is_guest`, `is_fenced`, and + // `is_fixed_storage_partition` cannot change over the lifetime of the + // BrowsingInstance. // // `coop_related_group` represents the CoopRelatedGroup to which this // BrowsingInstance belongs. Pages that live in BrowsingInstances in the same @@ -118,6 +122,7 @@ const WebExposedIsolationInfo& web_exposed_isolation_info, bool is_guest, bool is_fenced, + bool is_fixed_storage_partition, const scoped_refptr<CoopRelatedGroup>& coop_related_group, absl::optional<url::Origin> common_coop_origin); @@ -131,6 +136,11 @@ // with any other state needed to make isolation decisions. const IsolationContext& isolation_context() { return isolation_context_; } + // Return true if the StoragePartition should be preserved across future + // navigations in the frames belonging to this BrowsingInstance. For <webview> + // tags, this always returns true. + bool is_fixed_storage_partition() { return is_fixed_storage_partition_; } + // Get the SiteInstanceGroupManager that controls all of the SiteInstance // groups associated with this BrowsingInstance. SiteInstanceGroupManager& site_instance_group_manager() { @@ -346,6 +356,14 @@ // those cases is figured out, change the mentions of origin to "COOP origin". absl::optional<url::Origin> common_coop_origin_; + // Set to true if the StoragePartition should be preserved across future + // navigations in the frames belonging to this BrowsingInstance. For <webview> + // tags, this is always true. + // + // TODO(crbug.com/1503007): We actually always want this behavior. Remove this + // bit when we are ready. + const bool is_fixed_storage_partition_; + // A token uniquely identifying this BrowsingInstance. This is used in case we // need this information available in the renderer process, rather than // sending an ID. Both IDs and Tokens are necessary, because some parts of the
diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc index 02212809..a9f539a 100644 --- a/content/browser/child_process_security_policy_unittest.cc +++ b/content/browser/child_process_security_policy_unittest.cc
@@ -3082,9 +3082,11 @@ UrlInfo url_info(UrlInfoInit(foo.GetURL()) .WithOriginIsolationRequest(origin_isolation_request)); scoped_refptr<SiteInstanceImpl> foo_instance = - SiteInstanceImpl::CreateForUrlInfo(&context, url_info, - /*is_guest=*/false, - /*is_fenced=*/false); + SiteInstanceImpl::CreateForUrlInfo( + &context, url_info, + /*is_guest=*/false, + /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false); p->Add(kRendererID, &context); p->LockProcess(foo_instance->GetIsolationContext(), kRendererID, @@ -3140,9 +3142,11 @@ UrlInfo url_info(UrlInfoInit(foo.GetURL())); scoped_refptr<SiteInstanceImpl> foo_instance = - SiteInstanceImpl::CreateForUrlInfo(&context, url_info, - /*is_guest=*/false, - /*is_fenced=*/false); + SiteInstanceImpl::CreateForUrlInfo( + &context, url_info, + /*is_guest=*/false, + /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false); p->LockProcess(foo_instance->GetIsolationContext(), kRendererID, /*is_process_used=*/false, ProcessLock::FromSiteInfo(foo_instance->GetSiteInfo()));
diff --git a/content/browser/coop_related_group.cc b/content/browser/coop_related_group.cc index 58301ed..65711bef 100644 --- a/content/browser/coop_related_group.cc +++ b/content/browser/coop_related_group.cc
@@ -13,10 +13,16 @@ CoopRelatedGroup::CoopRelatedGroup(BrowserContext* browser_context, bool is_guest, - bool is_fenced) + bool is_fenced, + bool is_fixed_storage_partition) : browser_context_(browser_context), is_guest_(is_guest), - is_fenced_(is_fenced) {} + is_fenced_(is_fenced), + is_fixed_storage_partition_(is_fixed_storage_partition) { + if (is_guest_) { + CHECK(is_fixed_storage_partition_); + } +} CoopRelatedGroup::~CoopRelatedGroup() = default; @@ -56,7 +62,8 @@ return base::WrapRefCounted<BrowsingInstance>(new BrowsingInstance( browser_context_, web_exposed_isolation_info, is_guest_, is_fenced_, - base::WrapRefCounted<CoopRelatedGroup>(this), common_coop_origin)); + is_fixed_storage_partition_, base::WrapRefCounted<CoopRelatedGroup>(this), + common_coop_origin)); } void CoopRelatedGroup::RegisterBrowsingInstance( @@ -76,6 +83,9 @@ browsing_instance->web_exposed_isolation_info()); CHECK(duplicated_policy_browsing_instance.get() == nullptr); + CHECK(browsing_instance->is_fixed_storage_partition() == + is_fixed_storage_partition_); + coop_related_browsing_instances_.push_back(browsing_instance); }
diff --git a/content/browser/coop_related_group.h b/content/browser/coop_related_group.h index 3ca8fbb6..f765c9e2 100644 --- a/content/browser/coop_related_group.h +++ b/content/browser/coop_related_group.h
@@ -68,7 +68,8 @@ explicit CoopRelatedGroup(BrowserContext* browser_context, bool is_guest, - bool is_fenced); + bool is_fenced, + bool is_fixed_storage_partition); ~CoopRelatedGroup(); // Returns the token uniquely identifying this CoopRelatedGroup. @@ -130,6 +131,13 @@ // fenced frame. bool is_fenced_; + // Whether all the documents presented in this CoopRelatedGroup have fixed + // storage partition config. + // + // TODO(crbug.com/1503007): We actually always want this behavior. Remove this + // bit when we are ready. + bool is_fixed_storage_partition_; + // All the BrowsingInstances belonging to this CoopRelatedGroup. They are not // owned by this group, but collectively own it instead. To keep track of the // group members we therefore use raw_ptrs, and add or delete members of the
diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc index afe951f..1f59190 100644 --- a/content/browser/devtools/protocol/network_handler.cc +++ b/content/browser/devtools/protocol/network_handler.cc
@@ -1968,6 +1968,12 @@ if (!info.cache_storage_cache_name.empty()) { response->SetCacheStorageCacheName(info.cache_storage_cache_name); } + if (!info.service_worker_router_info.is_null()) { + response->SetServiceWorkerRouterInfo( + protocol::Network::ServiceWorkerRouterInfo::Create() + .SetRuleIdMatched(info.service_worker_router_info->rule_id_matched) + .Build()); + } response->SetProtocol(GetProtocol(url, info)); if (info.alternate_protocol_usage !=
diff --git a/content/browser/loader/file_url_loader_factory_unittest.cc b/content/browser/loader/file_url_loader_factory_unittest.cc index 680e074..37beaa8 100644 --- a/content/browser/loader/file_url_loader_factory_unittest.cc +++ b/content/browser/loader/file_url_loader_factory_unittest.cc
@@ -100,7 +100,7 @@ SimpleURLLoaderTestHelper helper; loader->DownloadToString( - factory_.get(), helper.GetCallback(), + factory_.get(), helper.GetCallbackDeprecated(), network::SimpleURLLoader::kMaxBoundedStringDownloadSize); helper.WaitForCallback();
diff --git a/content/browser/navigation_browsertest.cc b/content/browser/navigation_browsertest.cc index 711ad93..d56dbb0 100644 --- a/content/browser/navigation_browsertest.cc +++ b/content/browser/navigation_browsertest.cc
@@ -31,6 +31,7 @@ #include "content/browser/child_process_security_policy_impl.h" #include "content/browser/renderer_host/navigation_request.h" #include "content/browser/renderer_host/render_frame_host_impl.h" +#include "content/browser/site_instance_impl.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/common/content_navigation_policy.h" #include "content/common/features.h" @@ -48,6 +49,7 @@ #include "content/public/browser/network_service_util.h" #include "content/public/browser/page_navigator.h" #include "content/public/browser/render_frame_host.h" +#include "content/public/browser/storage_partition_config.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_client.h" #include "content/public/common/content_features.h" @@ -7709,4 +7711,92 @@ EXPECT_EQ(web_contents()->GetLastCommittedURL(), destination); } +// Test navigation with site instances whose storage partitions are fixed. +IN_PROC_BROWSER_TEST_F(NavigationBrowserTest, FixedStoragePartition) { + auto* browser_context = shell()->web_contents()->GetBrowserContext(); + auto storage_partition_config = StoragePartitionConfig::Create( + browser_context, "NavigationBrowserTest", "FixedStoragePartition", true); + auto url = embedded_test_server()->GetURL("/"); + auto* shell = Shell::CreateNewWindow( + browser_context, url, + SiteInstanceImpl::CreateForFixedStoragePartition( + browser_context, url, storage_partition_config), + gfx::Size()); + + auto GetSiteInstance = [](Shell* shell) { + return static_cast<SiteInstanceImpl*>( + shell->web_contents()->GetSiteInstance()); + }; + + EXPECT_EQ(GetSiteInstance(shell)->GetStoragePartitionConfig(), + storage_partition_config); + EXPECT_TRUE(GetSiteInstance(shell)->IsFixedStoragePartition()); + + // Check navigation. + ASSERT_TRUE( + NavigateToURL(shell, embedded_test_server()->GetURL("/title1.html"))); + EXPECT_EQ(GetSiteInstance(shell)->GetStoragePartitionConfig(), + storage_partition_config); + EXPECT_TRUE(GetSiteInstance(shell)->IsFixedStoragePartition()); + + // Check opening a window. The new window should stay in the same + // BrowsingInstance and StoragePartition. + { + ShellAddedObserver observer; + auto destination = embedded_test_server()->GetURL("a.com", "/title1.html"); + EXPECT_TRUE(ExecJs(shell, JsReplace("window.open($1)", destination), + EXECUTE_SCRIPT_NO_USER_GESTURE)); + auto* popup = observer.GetShell(); + EXPECT_TRUE(WaitForLoadStop(popup->web_contents())); + EXPECT_EQ(popup->web_contents()->GetLastCommittedURL(), destination); + EXPECT_EQ(GetSiteInstance(popup)->GetBrowsingInstanceId(), + GetSiteInstance(shell)->GetBrowsingInstanceId()); + EXPECT_EQ(GetSiteInstance(popup)->GetStoragePartitionConfig(), + storage_partition_config); + EXPECT_TRUE(GetSiteInstance(popup)->IsFixedStoragePartition()); + } + + // Check opening a window with about:blank at the beginning, and then navigate + // it. It should stay in the same BrowsingInstance and StoragePartition. + { + ShellAddedObserver observer; + EXPECT_TRUE(ExecJs(shell, "newWindow = window.open()", + EXECUTE_SCRIPT_NO_USER_GESTURE)); + auto* popup = observer.GetShell(); + EXPECT_EQ(GetSiteInstance(popup)->GetStoragePartitionConfig(), + storage_partition_config); + EXPECT_TRUE(GetSiteInstance(popup)->IsFixedStoragePartition()); + + auto destination = embedded_test_server()->GetURL("a.com", "/title1.html"); + EXPECT_TRUE(ExecJs(shell, + JsReplace("newWindow.location.href = $1", destination), + EXECUTE_SCRIPT_NO_USER_GESTURE)); + EXPECT_TRUE(WaitForLoadStop(popup->web_contents())); + EXPECT_EQ(popup->web_contents()->GetLastCommittedURL(), destination); + EXPECT_EQ(GetSiteInstance(popup)->GetBrowsingInstanceId(), + GetSiteInstance(shell)->GetBrowsingInstanceId()); + EXPECT_EQ(GetSiteInstance(popup)->GetStoragePartitionConfig(), + storage_partition_config); + EXPECT_TRUE(GetSiteInstance(popup)->IsFixedStoragePartition()); + } + + // Check navigation again. + ASSERT_TRUE( + NavigateToURL(shell, embedded_test_server()->GetURL("/title2.html"))); + EXPECT_EQ(GetSiteInstance(shell)->GetStoragePartitionConfig(), + storage_partition_config); + EXPECT_TRUE(GetSiteInstance(shell)->IsFixedStoragePartition()); + + // Check navigation that triggers a BrowsingInstance swap, and the storage + // partition config should also be preserved. + auto browsing_instance_id = GetSiteInstance(shell)->GetBrowsingInstanceId(); + ASSERT_TRUE(NavigateToURL( + shell, embedded_test_server()->GetURL("c.com", "/title2.html"))); + EXPECT_NE(GetSiteInstance(shell)->GetBrowsingInstanceId(), + browsing_instance_id); + EXPECT_EQ(GetSiteInstance(shell)->GetStoragePartitionConfig(), + storage_partition_config); + EXPECT_TRUE(GetSiteInstance(shell)->IsFixedStoragePartition()); +} + } // namespace content
diff --git a/content/browser/network_service_browsertest.cc b/content/browser/network_service_browsertest.cc index ce0796e..9a3a25a 100644 --- a/content/browser/network_service_browsertest.cc +++ b/content/browser/network_service_browsertest.cc
@@ -207,7 +207,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory, simple_loader_helper.GetCallback()); + loader_factory, simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); ASSERT_TRUE(simple_loader_helper.response_body()); }
diff --git a/content/browser/network_service_restart_browsertest.cc b/content/browser/network_service_restart_browsertest.cc index a5f4ec6..90036af 100644 --- a/content/browser/network_service_restart_browsertest.cc +++ b/content/browser/network_service_restart_browsertest.cc
@@ -97,7 +97,7 @@ network::SimpleURLLoader::Create(std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - url_loader_factory, simple_loader_helper.GetCallback()); + url_loader_factory, simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); return simple_loader->NetError(); }
diff --git a/content/browser/preloading/prefetch/prefetch_container.cc b/content/browser/preloading/prefetch/prefetch_container.cc index f1f96f8..425683915 100644 --- a/content/browser/preloading/prefetch/prefetch_container.cc +++ b/content/browser/preloading/prefetch/prefetch_container.cc
@@ -374,8 +374,7 @@ base::WeakPtr<PrefetchDocumentManager> prefetch_document_manager, PreloadingURLMatchCallback matcher) : referring_render_frame_host_id_(referring_render_frame_host_id), - referring_document_token_(referring_document_token), - prefetch_url_(url), + key_(referring_document_token, url), prefetch_type_(prefetch_type), referrer_(referrer), referring_origin_(url::Origin::Create(referrer_.url)), @@ -391,7 +390,7 @@ auto* preloading_data = PreloadingData::GetOrCreateForWebContents(web_contents); if (!matcher) { - matcher = PreloadingData::GetSameURLMatcher(prefetch_url_); + matcher = PreloadingData::GetSameURLMatcher(GetURL()); } auto* attempt = static_cast<PreloadingAttemptImpl*>( preloading_data->AddPreloadingAttempt( @@ -406,7 +405,7 @@ // `PreloadingPrediction` is added in `PreloadingDecider`. redirect_chain_.push_back( - std::make_unique<SinglePrefetch>(prefetch_url_, referring_site_)); + std::make_unique<SinglePrefetch>(GetURL(), referring_site_)); } PrefetchContainer::~PrefetchContainer() { @@ -507,14 +506,14 @@ if (initiator_devtools_navigation_token_.has_value() && preloading_trigger_outcome.has_value()) { devtools_instrumentation::DidUpdatePrefetchStatus( - ftn, initiator_devtools_navigation_token_.value(), prefetch_url_, + ftn, initiator_devtools_navigation_token_.value(), GetURL(), preloading_trigger_outcome.value(), prefetch_status, RequestId()); } } void PrefetchContainer::SetPrefetchStatus(PrefetchStatus prefetch_status) { SetTriggeringOutcomeAndFailureReasonFromStatus( - attempt_.get(), prefetch_url_, + attempt_.get(), GetURL(), /*old_prefetch_status=*/prefetch_status_, /*new_prefetch_status=*/prefetch_status); SetPrefetchStatusWithoutUpdatingTriggeringOutcome(prefetch_status); @@ -882,8 +881,7 @@ if (!GetHead()) { return; } - no_vary_search_data_ = - no_vary_search::ProcessHead(*GetHead(), prefetch_url_, rfh); + no_vary_search_data_ = no_vary_search::ProcessHead(*GetHead(), GetURL(), rfh); } void PrefetchContainer::OnReceivedHead() {
diff --git a/content/browser/preloading/prefetch/prefetch_container.h b/content/browser/preloading/prefetch/prefetch_container.h index 0d684cc..af45089 100644 --- a/content/browser/preloading/prefetch/prefetch_container.h +++ b/content/browser/preloading/prefetch/prefetch_container.h
@@ -151,9 +151,7 @@ const GURL prefetch_url_; }; - Key GetPrefetchContainerKey() const { - return Key(referring_document_token_, prefetch_url_); - } + const Key& GetPrefetchContainerKey() const { return key_; } // The ID of the RenderFrameHost that triggered the prefetch. GlobalRenderFrameHostId GetReferringRenderFrameHostId() const { @@ -161,7 +159,7 @@ } // The initial URL that was requested to be prefetched. - GURL GetURL() const { return prefetch_url_; } + const GURL& GetURL() const { return key_.prefetch_url(); } // The current URL being fetched. GURL GetCurrentURL() const; @@ -557,10 +555,10 @@ // The ID of the RenderFrameHost/Document that triggered the prefetch. const GlobalRenderFrameHostId referring_render_frame_host_id_; - const blink::DocumentToken referring_document_token_; - // The URL that was requested to be prefetch. - const GURL prefetch_url_; + // The key used to match this PrefetchContainer, including the URL that was + // requested to prefetch. + const PrefetchContainer::Key key_; // The type of this prefetch. This controls some specific details about how // the prefetch is handled, including whether an isolated network context or @@ -611,7 +609,7 @@ // any prefetched resources will not be served. bool is_decoy_ = false; - // The redirect chain resulting from prefetching |prefetch_url_|. + // The redirect chain resulting from prefetching |GetURL()|. std::vector<std::unique_ptr<SinglePrefetch>> redirect_chain_; // The network contexts used for this prefetch. They key corresponds to the
diff --git a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc index 6f8b0f0..d354193 100644 --- a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc +++ b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc
@@ -22071,6 +22071,20 @@ url::Origin committed_origin = shell()->web_contents()->GetPrimaryMainFrame()->GetLastCommittedOrigin(); EXPECT_EQ(origin_to_commit.value(), committed_origin); + + GURL site_url = contents()->GetSiteInstance()->GetSiteURL(); + if (AreAllSitesIsolatedForTesting()) { + if (base::FeatureList::IsEnabled(features::kDataUrlsHaveOriginAsUrl)) { + EXPECT_EQ(site_url.spec(), + "data:" + origin_to_commit->GetNonceForTesting()->ToString()); + } else { + EXPECT_EQ(site_url, data_url); + } + } else { + // Without site isolation, the data: URL ends up in the default + // SiteInstance. + EXPECT_EQ(site_url.spec(), "http://unisolated.invalid/"); + } } // This tests a regression found in https://crbug.com/1487803.
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc index a50bb963..17f26c5 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc
@@ -3824,11 +3824,11 @@ url_info_init.WithCommonCoopOrigin(common_coop_origin.value()); } - // Navigations within guests should always stay in the guest's - // StoragePartition. + // Navigations with SiteInstances which have fixed storage partition (e.g. + // <webview> tags) should always stay in the current StoragePartition. SiteInstanceImpl* current_instance = frame_tree_node_->current_frame_host()->GetSiteInstance(); - if (current_instance->IsGuest()) { + if (current_instance->IsFixedStoragePartition()) { url_info_init.WithStoragePartitionConfig( current_instance->GetStoragePartitionConfig()); }
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 cc85035..fbd9a2e 100644 --- a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc +++ b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc
@@ -518,7 +518,7 @@ network::SimpleURLLoader::Create(std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - url_loader_factory.get(), simple_loader_helper.GetCallback()); + url_loader_factory.get(), simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); EXPECT_FALSE(simple_loader_helper.response_body()); EXPECT_EQ(net::ERR_INVALID_ARGUMENT, simple_loader->NetError());
diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc index 7a5c02e0..902de2f 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc
@@ -3330,11 +3330,11 @@ // At this point we know an unrelated site instance must be returned. - // If the current SiteInstance is for a guest, the new unrelated - // SiteInstance must also be for a guest and must stay in the same + // If the current SiteInstance has fixed storage partition (e.g. <webview> + // tags), the new unrelated SiteInstance must also stay in the same // StoragePartition. UrlInfo dest_url_info = descriptor.dest_url_info; - if (current_instance->IsGuest()) { + if (current_instance->IsFixedStoragePartition()) { dest_url_info.storage_partition_config = current_instance->GetSiteInfo().storage_partition_config(); } @@ -3353,7 +3353,8 @@ return SiteInstanceImpl::CreateForUrlInfo( GetNavigationController().GetBrowserContext(), dest_url_info, current_instance->IsGuest(), - current_instance->GetIsolationContext().is_fenced()); + current_instance->GetIsolationContext().is_fenced(), + current_instance->IsFixedStoragePartition()); } bool RenderFrameHostManager::CanUseSourceSiteInstance(
diff --git a/content/browser/service_worker/service_worker_main_resource_loader.cc b/content/browser/service_worker/service_worker_main_resource_loader.cc index 4e2dea4c..db2a48f 100644 --- a/content/browser/service_worker/service_worker_main_resource_loader.cc +++ b/content/browser/service_worker/service_worker_main_resource_loader.cc
@@ -39,6 +39,7 @@ #include "services/network/public/cpp/features.h" #include "services/network/public/cpp/timing_allow_origin_parser.h" #include "services/network/public/mojom/fetch_api.mojom.h" +#include "services/network/public/mojom/service_worker_router_info.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/common/service_worker/service_worker_loader_helpers.h" #include "third_party/blink/public/mojom/service_worker/service_worker_fetch_handler_bypass_option.mojom-shared.h" @@ -269,7 +270,7 @@ RaceNetworkRequestMode race_network_request_mode = RaceNetworkRequestMode::kDefault; - // Check if registered static route rules match the request. + // Check if registered static router rules match the request. if (active_worker->router_evaluator()) { CHECK(active_worker->router_evaluator()->IsValid()); auto eval_result = active_worker->router_evaluator()->Evaluate( @@ -280,6 +281,14 @@ active_worker->CountFeature( blink::mojom::WebFeature::kServiceWorkerStaticRouter_Evaluate); if (eval_result) { // matched the rule. + // Set router information of matched rule for DevTools. + // TODO(crbug.com/1502443): Prepare the router info in ResponseHead even + // when the response is not set by `DidDispatchFetchEvent()`. + network::mojom::ServiceWorkerRouterInfoPtr router_info = + network::mojom::ServiceWorkerRouterInfo::New(); + router_info->rule_id_matched = eval_result->id; + response_head_->service_worker_router_info = std::move(router_info); + const auto& sources = eval_result->sources; // TODO(crbug.com/1371756): support other sources in the full form. // https://github.com/yoshisatoyanagisawa/service-worker-static-routing-api/blob/main/final-form.md @@ -292,7 +301,7 @@ // ready until ServiceWorkerMainResourceLoader::StartRequest() // finishes, so calling the fallback at this point doesn't correctly // handle the fallback process. Use PostTask to run the callback after - // finishing StartRequset(). + // finishing StartRequest(). // // If the kServiceWorkerStaticRouterStartServiceWorker feature is // enabled, it starts the ServiceWorker manually since we don't
diff --git a/content/browser/service_worker/service_worker_main_resource_loader_unittest.cc b/content/browser/service_worker/service_worker_main_resource_loader_unittest.cc index c32347f..59fac56 100644 --- a/content/browser/service_worker/service_worker_main_resource_loader_unittest.cc +++ b/content/browser/service_worker/service_worker_main_resource_loader_unittest.cc
@@ -26,7 +26,6 @@ #include "content/public/test/browser_task_environment.h" #include "content/public/test/mock_render_process_host.h" #include "mojo/public/cpp/system/data_pipe_utils.h" -#include "net/ssl/ssl_info.h" #include "net/test/cert_test_util.h" #include "net/test/test_data_directory.h" #include "services/network/public/cpp/features.h" @@ -571,6 +570,8 @@ info.cache_storage_cache_name); EXPECT_EQ(expected_info.did_service_worker_navigation_preload, info.did_service_worker_navigation_preload); + // TODO(crbug.com/1504040): Write tests about Static Routing API, in + // particular, checking the correctness of `service_worker_router_info`. } std::unique_ptr<network::ResourceRequest> CreateRequest() {
diff --git a/content/browser/site_info.cc b/content/browser/site_info.cc index b4084fd..43a3535 100644 --- a/content/browser/site_info.cc +++ b/content/browser/site_info.cc
@@ -820,13 +820,21 @@ DCHECK(!origin.scheme().empty()); site_url = GURL(origin.scheme() + ":"); } else if (url.has_scheme()) { - // In some cases, it is not safe to use just the scheme as a site URL, as - // that might allow two URLs created by different sites to share a - // process. See https://crbug.com/863623 and https://crbug.com/863069. - // - // TODO(alexmos,creis): This should eventually be expanded to certain - // other schemes, such as file:. - if (url.SchemeIsBlob() || url.scheme() == url::kDataScheme) { + if (url.SchemeIs(url::kDataScheme) && + base::FeatureList::IsEnabled(features::kDataUrlsHaveOriginAsUrl)) { + // We get here for browser-initiated navigations to data URLs. + // We use the serialized opaque origin as the body of the data: URL to + // avoid storing the entire data: URL multiple times, and to use the + // origin's nonce to distinguish between instances of the same URL. This + // means each browser-initiated data: URL will get its own process. + site_url = GetOriginBasedSiteURLForDataURL(origin); + } else if (url.SchemeIsBlob() || url.SchemeIs(url::kDataScheme)) { + // In some cases, it is not safe to use just the scheme as a site URL, + // as that might allow two URLs created by different sites to share a + // process. See https://crbug.com/863623 and https://crbug.com/863069. + // + // TODO(alexmos,creis): This should eventually be expanded to certain + // other schemes, such as file:. // We get here for blob URLs of form blob:null/guid. Use the full URL // with the guid in that case, which isolates all blob URLs with unique // origins from each other. We also get here for browser-initiated @@ -892,4 +900,11 @@ : WebExposedIsolationLevel::kNotIsolated; } +// static +GURL SiteInfo::GetOriginBasedSiteURLForDataURL(const url::Origin& origin) { + CHECK(origin.opaque()); + return GURL(url::kDataScheme + std::string(":") + + origin.GetNonceForSerialization()->ToString()); +} + } // namespace content
diff --git a/content/browser/site_info.h b/content/browser/site_info.h index 4fb0c7d..32e41a1 100644 --- a/content/browser/site_info.h +++ b/content/browser/site_info.h
@@ -116,6 +116,12 @@ // decisions, Create() should be used instead. static GURL GetSiteForOrigin(const url::Origin& origin); + // Returns the site URL derived from an opaque data: origin. This has the form + // data:<serialized nonce>. This is only to be called for data: URLs with + // opaque origins, and will crash otherwise, e.g. in LoadDataWithBaseURL, + // where the base URL is not an opaque origin. + static GURL GetOriginBasedSiteURLForDataURL(const url::Origin& origin); + // Returns a StoragePartitionConfig for the specified URL. Note that the URL // can be both a site URL that was generated by a SiteInfo or a regular // user-provided URL.
diff --git a/content/browser/site_instance_group.cc b/content/browser/site_instance_group.cc index e4d95b4..287cd63 100644 --- a/content/browser/site_instance_group.cc +++ b/content/browser/site_instance_group.cc
@@ -120,7 +120,9 @@ new BrowsingInstance(browser_context, WebExposedIsolationInfo::CreateNonIsolated(), /*is_guest=*/false, - /*is_fenced=*/false, /*coop_related_group=*/nullptr, + /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false, + /*coop_related_group=*/nullptr, /*common_coop_origin=*/absl::nullopt), process); }
diff --git a/content/browser/site_instance_group_unittest.cc b/content/browser/site_instance_group_unittest.cc index 19304d9..2f05c6e57 100644 --- a/content/browser/site_instance_group_unittest.cc +++ b/content/browser/site_instance_group_unittest.cc
@@ -29,7 +29,8 @@ { scoped_refptr<BrowsingInstance> browsing_instance = new BrowsingInstance( &browser_context, WebExposedIsolationInfo::CreateNonIsolated(), - /*is_guest=*/false, /*is_fenced=*/false, /*coop_related_group=*/nullptr, + /*is_guest=*/false, /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false, /*coop_related_group=*/nullptr, /*common_coop_origin=*/absl::nullopt); group = new SiteInstanceGroup(browsing_instance.get(), process.get()); browsing_instance_id = group->browsing_instance_id();
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc index 132ce9a..357b8e4d 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc
@@ -127,6 +127,7 @@ return base::WrapRefCounted(new SiteInstanceImpl(new BrowsingInstance( browser_context, WebExposedIsolationInfo::CreateNonIsolated(), /*is_guest=*/false, /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false, /*coop_related_group=*/nullptr, /*common_coop_origin=*/absl::nullopt))); } @@ -135,19 +136,20 @@ BrowserContext* browser_context, const UrlInfo& url_info, bool is_guest, - bool is_fenced) { + bool is_fenced, + bool is_fixed_storage_partition) { DCHECK(url_info.is_sandboxed || url_info.unique_sandbox_id == UrlInfo::kInvalidUniqueSandboxId); CHECK(!is_guest || url_info.storage_partition_config.has_value()); DCHECK(browser_context); // This will create a new SiteInstance and BrowsingInstance. - scoped_refptr<BrowsingInstance> instance( - new BrowsingInstance(browser_context, - url_info.web_exposed_isolation_info.value_or( - WebExposedIsolationInfo::CreateNonIsolated()), - is_guest, is_fenced, /*coop_related_group=*/nullptr, - url_info.common_coop_origin)); + scoped_refptr<BrowsingInstance> instance(new BrowsingInstance( + browser_context, + url_info.web_exposed_isolation_info.value_or( + WebExposedIsolationInfo::CreateNonIsolated()), + is_guest, is_fenced, is_fixed_storage_partition, + /*coop_related_group=*/nullptr, url_info.common_coop_origin)); // Note: The |allow_default_instance| value used here MUST match the value // used in DoesSiteForURLMatch(). @@ -169,12 +171,16 @@ // TODO(https://crbug.com/1221127): Verify that having different common COOP // origins does not hinder the ability of a ServiceWorker to share its page's // process. - scoped_refptr<BrowsingInstance> instance( - new BrowsingInstance(browser_context, - url_info.web_exposed_isolation_info.value_or( - WebExposedIsolationInfo::CreateNonIsolated()), - is_guest, is_fenced, /*coop_related_group=*/nullptr, - url_info.common_coop_origin)); + scoped_refptr<BrowsingInstance> instance(new BrowsingInstance( + browser_context, + url_info.web_exposed_isolation_info.value_or( + WebExposedIsolationInfo::CreateNonIsolated()), + is_guest, is_fenced, + // It should be safe to just default this to true since the + // BrowsingInstance is not shared with frames, and there are no + // navigations happening in service workers. + /*is_fixed_storage_partition=*/true, + /*coop_related_group=*/nullptr, url_info.common_coop_origin)); // We do NOT want to allow the default site instance here because workers // need to be kept separate from other sites. @@ -213,7 +219,9 @@ base::WrapRefCounted(new SiteInstanceImpl(new BrowsingInstance( browser_context, guest_site_info.web_exposed_isolation_info(), /*is_guest=*/true, - /*is_fenced=*/false, /*coop_related_group=*/nullptr, + /*is_fenced=*/false, + /*is_fixed_storage_partition=*/true, + /*coop_related_group=*/nullptr, /*common_coop_origin=*/absl::nullopt))); site_instance->SetSiteInfoInternal(guest_site_info); @@ -221,6 +229,22 @@ } // static +scoped_refptr<SiteInstanceImpl> +SiteInstanceImpl::CreateForFixedStoragePartition( + BrowserContext* browser_context, + const GURL& url, + const StoragePartitionConfig& partition_config) { + CHECK(browser_context); + CHECK(!partition_config.is_default()); + + return SiteInstanceImpl::CreateForUrlInfo( + browser_context, + UrlInfo(UrlInfoInit(url).WithStoragePartitionConfig(partition_config)), + /*is_guest=*/false, + /*is_fenced=*/false, /*is_fixed_storage_partition=*/true); +} + +// static scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForFencedFrame( SiteInstanceImpl* embedder_site_instance) { DCHECK(embedder_site_instance); @@ -232,6 +256,7 @@ browser_context, embedder_site_instance->GetWebExposedIsolationInfo(), embedder_site_instance->IsGuest(), /*is_fenced=*/should_isolate_fenced_frames, + embedder_site_instance->IsFixedStoragePartition(), /*coop_related_group=*/nullptr, /*common_coop_origin=*/absl::nullopt))); @@ -276,6 +301,7 @@ scoped_refptr<BrowsingInstance> instance(new BrowsingInstance( browser_context, WebExposedIsolationInfo::CreateNonIsolated(), /*is_guest=*/false, /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false, /*coop_related_group=*/nullptr, /*common_coop_origin=*/absl::nullopt)); auto site_instance = instance->GetSiteInstanceForURL( @@ -290,10 +316,11 @@ BrowserContext* browser_context, const GURL& url) { DCHECK(browser_context); - return SiteInstanceImpl::CreateForUrlInfo(browser_context, - UrlInfo::CreateForTesting(url), - /*is_guest=*/false, - /*is_fenced=*/false); + return SiteInstanceImpl::CreateForUrlInfo( + browser_context, UrlInfo::CreateForTesting(url), + /*is_guest=*/false, + /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false); } // static @@ -672,9 +699,9 @@ UrlInfo overridden_url_info = url_info; overridden_url_info.web_exposed_isolation_info = GetWebExposedIsolationInfo(); - // New SiteInfos created for site-isolated guests should keep the same - // StoragePartition. - if (IsGuest()) { + // Keep the same StoragePartition when the storage partition is fixed (e.g. + // for <webview>). + if (IsFixedStoragePartition()) { overridden_url_info.storage_partition_config = GetSiteInfo().storage_partition_config(); } @@ -872,7 +899,7 @@ DCHECK(browser_context); return SiteInstanceImpl::CreateForUrlInfo( browser_context, UrlInfo(UrlInfoInit(url)), /*is_guest=*/false, - /*is_fenced=*/false); + /*is_fenced=*/false, /*is_fixed_storage_partition=*/false); } // static @@ -884,6 +911,16 @@ } // static +scoped_refptr<SiteInstance> SiteInstance::CreateForFixedStoragePartition( + BrowserContext* browser_context, + const GURL& url, + const StoragePartitionConfig& partition_config) { + CHECK(browser_context); + return SiteInstanceImpl::CreateForFixedStoragePartition(browser_context, url, + partition_config); +} + +// static bool SiteInstance::ShouldAssignSiteForURL(const GURL& url) { return SiteInstanceImpl::ShouldAssignSiteForUrlInfo( UrlInfo(UrlInfoInit(url))); @@ -930,6 +967,15 @@ return site_info_.is_guest(); } +bool SiteInstanceImpl::IsFixedStoragePartition() { + bool is_fixed_storage_partition = + browsing_instance_->is_fixed_storage_partition(); + if (IsGuest()) { + CHECK(is_fixed_storage_partition); + } + return is_fixed_storage_partition; +} + bool SiteInstanceImpl::IsJitDisabled() { return site_info_.is_jit_disabled(); }
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h index da41c02..f125f0b 100644 --- a/content/browser/site_instance_impl.h +++ b/content/browser/site_instance_impl.h
@@ -54,6 +54,10 @@ const StoragePartitionConfig& partition_config); static scoped_refptr<SiteInstanceImpl> CreateForFencedFrame( SiteInstanceImpl* embedder_site_instance); + static scoped_refptr<SiteInstanceImpl> CreateForFixedStoragePartition( + BrowserContext* browser_context, + const GURL& url, + const StoragePartitionConfig& partition_config); // Similar to above, but creates an appropriate SiteInstance in a new // BrowsingInstance for a particular `url_info`. This is a more generic @@ -65,12 +69,15 @@ // within a guest; when true, the guest's StoragePartition information must // also be provided in `url_info`. `is_fenced` specifies if the // BrowsingInstance is for a fenced frame, and is used to isolate them from - // non-fenced BrowsingInstances. + // non-fenced BrowsingInstances. `is_fixed_storage_partition` specifies if + // the StoragePartition should be applied across navigation. It must be set + // to true if `is_guest` is true. static scoped_refptr<SiteInstanceImpl> CreateForUrlInfo( BrowserContext* browser_context, const UrlInfo& url_info, bool is_guest, - bool is_fenced); + bool is_fenced, + bool is_fixed_storage_partition); // Creates a SiteInstance that will be use for a service worker. // `url_info` - The UrlInfo for the service worker. It contains the URL and @@ -171,6 +178,11 @@ void WriteIntoTrace(perfetto::TracedProto<TraceProto> context) override; int EstimateOriginAgentClusterOverheadForMetrics() override; + // Return true if the StoragePartition should be preserved across future + // navigations in the frames belonging to this SiteInstance. For <webview> + // tags, this always returns true. + bool IsFixedStoragePartition(); + // This is called every time a renderer process is assigned to a SiteInstance // and is used by the content embedder for collecting metrics. void set_process_assignment(SiteInstanceProcessAssignment assignment) {
diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc index 80a8f57..d8a0902 100644 --- a/content/browser/site_instance_impl_unittest.cc +++ b/content/browser/site_instance_impl_unittest.cc
@@ -703,17 +703,24 @@ EXPECT_EQ("file", site_url.scheme()); EXPECT_FALSE(site_url.has_host()); - // Data URLs should include the whole URL, except for the hash. + // Data URLs should have the scheme and the nonce of their opaque origin. test_url = GURL("data:text/html,foo"); site_url = GetSiteForURL(test_url); - EXPECT_EQ(test_url, site_url); EXPECT_EQ("data", site_url.scheme()); + if (base::FeatureList::IsEnabled(features::kDataUrlsHaveOriginAsUrl)) { + // Check that there is a serialized nonce in the site URL. The nonce is + // different each time, but has length 32. + EXPECT_EQ(32u, site_url.GetContent().length()); + EXPECT_FALSE(site_url.EqualsIgnoringRef(test_url)); + } else { + EXPECT_EQ(test_url, site_url); + EXPECT_TRUE(site_url.EqualsIgnoringRef(test_url)); + } EXPECT_FALSE(site_url.has_host()); test_url = GURL("data:text/html,foo#bar"); site_url = GetSiteForURL(test_url); EXPECT_FALSE(site_url.has_ref()); EXPECT_NE(test_url, site_url); - EXPECT_TRUE(site_url.EqualsIgnoringRef(test_url)); // Javascript URLs should include the scheme. test_url = GURL("javascript:foo();"); @@ -919,6 +926,7 @@ BrowsingInstance* browsing_instance = new BrowsingInstance( browser_context.get(), WebExposedIsolationInfo::CreateNonIsolated(), /*is_guest=*/false, /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false, /*coop_related_group=*/nullptr, /*common_coop_origin=*/absl::nullopt); @@ -955,6 +963,7 @@ BrowsingInstance* browsing_instance2 = new BrowsingInstance( browser_context.get(), WebExposedIsolationInfo::CreateNonIsolated(), /*is_guest=*/false, /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false, /*coop_related_group=*/nullptr, /*common_coop_origin=*/absl::nullopt); // Ensure the new SiteInstance is ref counted so that it gets deleted. @@ -1000,6 +1009,7 @@ scoped_refptr<BrowsingInstance> browsing_instance = new BrowsingInstance( browser_context.get(), WebExposedIsolationInfo::CreateNonIsolated(), /*is_guest=*/false, /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false, /*coop_related_group=*/nullptr, /*common_coop_origin=*/absl::nullopt); @@ -1036,6 +1046,7 @@ BrowsingInstance* browsing_instance2 = new BrowsingInstance( browser_context.get(), WebExposedIsolationInfo::CreateNonIsolated(), /*is_guest=*/false, /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false, /*coop_related_group=*/nullptr, /*common_coop_origin=*/absl::nullopt); scoped_refptr<SiteInstanceImpl> site_instance_a1_2( @@ -1052,6 +1063,7 @@ BrowsingInstance* browsing_instance3 = new BrowsingInstance( browser_context2.get(), WebExposedIsolationInfo::CreateNonIsolated(), /*is_guest=*/false, /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false, /*coop_related_group=*/nullptr, /*common_coop_origin=*/absl::nullopt); scoped_refptr<SiteInstanceImpl> site_instance_a2_3( @@ -2080,7 +2092,8 @@ // verify that the StoragePartition is correct. const auto partitioned_instance = SiteInstanceImpl::CreateForUrlInfo( context(), partitioned_url_info, - /*is_guest=*/false, /*is_fenced=*/false); + /*is_guest=*/false, /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false); EXPECT_EQ(non_default_partition_config, static_cast<SiteInstanceImpl*>(partitioned_instance.get()) ->GetSiteInfo() @@ -2183,7 +2196,7 @@ const auto base_instance = SiteInstanceImpl::CreateForUrlInfo( context(), UrlInfo(UrlInfoInit(test_url)), /*is_guest=*/false, - /*is_fenced=*/false); + /*is_fenced=*/false, /*is_fixed_storage_partition=*/false); const auto derived_instance = base_instance->GetCoopRelatedSiteInstanceImpl( UrlInfo(UrlInfoInit(test_url))); @@ -2198,7 +2211,7 @@ const auto base_instance = SiteInstanceImpl::CreateForUrlInfo( context(), UrlInfo(UrlInfoInit(test_url)), /*is_guest=*/false, - /*is_fenced=*/false); + /*is_fenced=*/false, /*is_fixed_storage_partition=*/false); const auto derived_instance = base_instance->GetCoopRelatedSiteInstanceImpl( UrlInfo(UrlInfoInit(GURL("https://other-example.com")))); @@ -2222,7 +2235,8 @@ context(), UrlInfo(UrlInfoInit(test_url).WithCommonCoopOrigin( url::Origin::Create(test_url))), - /*is_guest=*/false, /*is_fenced=*/false); + /*is_guest=*/false, /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false); const auto derived_instance = base_instance->GetCoopRelatedSiteInstanceImpl( UrlInfo(UrlInfoInit(test_url).WithCommonCoopOrigin( @@ -2239,7 +2253,8 @@ context(), UrlInfo(UrlInfoInit(test_url).WithCommonCoopOrigin( url::Origin::Create(test_url))), - /*is_guest=*/false, /*is_fenced=*/false); + /*is_guest=*/false, /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false); // COOP common origin might differ from the frame's actual origin (for // example for cross-origin subframes), so we verify that this case is handled @@ -2266,7 +2281,7 @@ // Start without a COOP origin. const auto base_instance = SiteInstanceImpl::CreateForUrlInfo( context(), UrlInfo(UrlInfoInit(test_url)), /*is_guest=*/false, - /*is_fenced=*/false); + /*is_fenced=*/false, /*is_fixed_storage_partition=*/false); const auto derived_instance = base_instance->GetCoopRelatedSiteInstanceImpl( UrlInfo(UrlInfoInit(test_url).WithCommonCoopOrigin( @@ -2284,7 +2299,8 @@ UrlInfo(UrlInfoInit(test_url).WithWebExposedIsolationInfo( WebExposedIsolationInfo::CreateIsolated( url::Origin::Create(test_url)))), - /*is_guest=*/false, /*is_fenced=*/false); + /*is_guest=*/false, /*is_fenced=*/false, + /*is_fixed_storage_partition=*/false); const auto derived_instance = base_instance->GetCoopRelatedSiteInstanceImpl( UrlInfo(UrlInfoInit(test_url).WithWebExposedIsolationInfo( @@ -2300,7 +2316,7 @@ const auto base_instance = SiteInstanceImpl::CreateForUrlInfo( context(), UrlInfo(UrlInfoInit(test_url)), /*is_guest=*/false, - /*is_fenced=*/false); + /*is_fenced=*/false, /*is_fixed_storage_partition=*/false); const auto derived_instance = base_instance->GetCoopRelatedSiteInstanceImpl( UrlInfo(UrlInfoInit(test_url).WithWebExposedIsolationInfo( @@ -2315,7 +2331,7 @@ const GURL test_url("https://example.com"); const auto base_instance = SiteInstanceImpl::CreateForUrlInfo( context(), UrlInfo(UrlInfoInit(test_url)), /*is_guest=*/false, - /*is_fenced=*/false); + /*is_fenced=*/false, /*is_fixed_storage_partition=*/false); base::UnguessableToken browsing_instance_token = base_instance->browsing_instance_token(); @@ -2328,7 +2344,7 @@ const GURL test_url("https://example.com"); const auto base_instance = SiteInstanceImpl::CreateForUrlInfo( context(), UrlInfo(UrlInfoInit(test_url)), /*is_guest=*/false, - /*is_fenced=*/false); + /*is_fenced=*/false, /*is_fixed_storage_partition=*/false); const auto derived_instance = base_instance->GetRelatedSiteInstanceImpl( UrlInfo(UrlInfoInit(GURL("https://other-example.com")))); @@ -2352,7 +2368,7 @@ const GURL test_url("https://example.com"); const auto base_instance = SiteInstanceImpl::CreateForUrlInfo( context(), UrlInfo(UrlInfoInit(test_url)), /*is_guest=*/false, - /*is_fenced=*/false); + /*is_fenced=*/false, /*is_fixed_storage_partition=*/false); // Derive a SiteInstance that lives in the same CoopRelatedGroup but a // different BrowsingInstance. Provide a different WebExposedIsolationInfo to @@ -2374,11 +2390,11 @@ const GURL test_url("https://example.com"); const auto base_instance = SiteInstanceImpl::CreateForUrlInfo( context(), UrlInfo(UrlInfoInit(test_url)), /*is_guest=*/false, - /*is_fenced=*/false); + /*is_fenced=*/false, /*is_fixed_storage_partition=*/false); const auto other_instance = SiteInstanceImpl::CreateForUrlInfo( context(), UrlInfo(UrlInfoInit(test_url)), /*is_guest=*/false, - /*is_fenced=*/false); + /*is_fenced=*/false, /*is_fixed_storage_partition=*/false); EXPECT_NE(other_instance.get(), base_instance.get()); EXPECT_FALSE(other_instance->IsRelatedSiteInstance(base_instance.get()));
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index df80445..07e7d711 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -5495,6 +5495,60 @@ EXPECT_EQ(orig_site_instance, child->current_frame_host()->GetSiteInstance()); } +// The site URL for a data: URL is the scheme + the serialized nonce from the +// origin. This means that two data: URLs with the same body will have different +// site URLs. +IN_PROC_BROWSER_TEST_P(SitePerProcessBrowserTest, DataUrlsHaveUniqueSiteURLs) { + // Force process reuse for same-site URLs, to test whether identical data: + // URLs share a process with each other. + RenderProcessHost::SetMaxRendererProcessCount(1); + + // Load a main frame data: URL. + GURL data_url("data:text/html,dataurl"); + EXPECT_TRUE(NavigateToURL(shell(), data_url)); + + // Open another tab, then load the same data: URL in that tab. We need to + // first navigate the new tab to a different page, a_url. + // Shell::CreateNewWindow opens a new tab to about:blank, then loads the URL + // passed in. Since the about:blank is in a new tab, it gets a new process, + // and the passed-in URL keeps using that about:blank process. By navigating + // from a_url to the data: URL, we exercise the flow that will reuse the + // existing data: URL process, if possible. + GURL a_url(embedded_test_server()->GetURL("a.com", "/title1.html")); + ShellAddedObserver new_shell_observer; + Shell* new_shell = + Shell::CreateNewWindow(static_cast<NavigationControllerImpl&>( + shell()->web_contents()->GetController()) + .GetBrowserContext(), + a_url, nullptr, gfx::Size()); + auto* new_contents = static_cast<WebContentsImpl*>(new_shell->web_contents()); + EXPECT_TRUE(WaitForLoadStop(new_contents)); + EXPECT_TRUE(NavigateToURL(new_shell, data_url)); + + auto* main_frame = shell()->web_contents()->GetPrimaryMainFrame(); + auto* new_frame = new_shell->web_contents()->GetPrimaryMainFrame(); + GURL main_url = main_frame->GetSiteInstance()->GetSiteURL(); + GURL new_url = new_frame->GetSiteInstance()->GetSiteURL(); + EXPECT_NE(new_frame->GetSiteInstance(), main_frame->GetSiteInstance()); + if (base::FeatureList::IsEnabled(features::kDataUrlsHaveOriginAsUrl)) { + // The site URL is the data scheme followed by a serialized nonce, which is + // unique for every data: URL instance. + EXPECT_NE(main_url, new_url); + EXPECT_TRUE(main_url.SchemeIs(url::kDataScheme)); + EXPECT_EQ(new_url.GetContent().length(), + base::UnguessableToken::Create().ToString().length()); + EXPECT_NE(new_frame->GetProcess(), main_frame->GetProcess()); + + } else { + // Without the feature, the site URL of data: URLs is the entire data: URL, + // so if the data is the same in both cases, the site URLs will be the same, + // and they will be allowed to share a process. + EXPECT_EQ(main_url, new_url); + EXPECT_EQ(main_url, data_url); + EXPECT_EQ(new_frame->GetProcess(), main_frame->GetProcess()); + } +} + // Ensures that subframes navigated to data: URLs start in a process based on // their creator, but end up in unique processes after a restore (since // SiteInstance relationships are not preserved on restore, until
diff --git a/content/browser/storage_partition_impl_browsertest.cc b/content/browser/storage_partition_impl_browsertest.cc index f4ededc..7139750 100644 --- a/content/browser/storage_partition_impl_browsertest.cc +++ b/content/browser/storage_partition_impl_browsertest.cc
@@ -136,7 +136,7 @@ SimpleURLLoaderTestHelper url_loader_helper; url_loader->DownloadToString( partition->GetURLLoaderFactoryForBrowserProcess().get(), - url_loader_helper.GetCallback(), + url_loader_helper.GetCallbackDeprecated(), /*max_body_size=*/1024 * 1024); url_loader_helper.WaitForCallback(); return url_loader;
diff --git a/content/browser/worker_host/shared_worker_service_impl.cc b/content/browser/worker_host/shared_worker_service_impl.cc index 4aa539bc..fd286b8 100644 --- a/content/browser/worker_host/shared_worker_service_impl.cc +++ b/content/browser/worker_host/shared_worker_service_impl.cc
@@ -306,8 +306,8 @@ .WithStoragePartitionConfig(partition->GetConfig()) .WithWebExposedIsolationInfo( WebExposedIsolationInfo::CreateNonIsolated())), - partition->is_guest(), - creator.GetSiteInstance()->GetIsolationContext().is_fenced()); + partition->is_guest(), site_instance->GetIsolationContext().is_fenced(), + site_instance->IsFixedStoragePartition()); } RenderProcessHost* worker_process_host = site_instance->GetProcess();
diff --git a/content/common/features.cc b/content/common/features.cc index 1d24703..c42c32eb 100644 --- a/content/common/features.cc +++ b/content/common/features.cc
@@ -122,12 +122,24 @@ // Enables setting the nonce of the data: opaque origin early in the navigation // so the nonce remains stable throughout a navigation. +// Note: kDataUrlsHaveOriginAsUrl is dependent on this feature. If this feature +// is being disabled, the other needs to be disabled as well. // TODO(crbug.com/1447896, yangsharon): Remove this once we're confident that // this change isn't causing issues in the wild. BASE_FEATURE(kDataUrlsHaveStableNonce, "DataUrlsHaveStableNonce", base::FEATURE_ENABLED_BY_DEFAULT); +// When enabled, main frame data: URLs use the serialized nonce from the origin +// as the site URL. Otherwise, use the entire data: URL as the site URL. +// Note: This feature is dependent on kDataUrlsHaveStableNonce. If that flag +// needs to be disabled, this will have to be disabled as well. +// TODO(crbug.com/1447896, yangsharon): Remove this once we're confident that +// this change isn't causing issues in the wild. +BASE_FEATURE(kDataUrlsHaveOriginAsUrl, + "DataUrlsHaveOriginAsUrl", + base::FEATURE_ENABLED_BY_DEFAULT); + // Enable changing source dynamically for desktop capture. BASE_FEATURE(kDesktopCaptureChangeSource, "DesktopCaptureChangeSource",
diff --git a/content/common/features.h b/content/common/features.h index 4a3a683..7298212 100644 --- a/content/common/features.h +++ b/content/common/features.h
@@ -31,6 +31,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kConsolidatedMovementXY); CONTENT_EXPORT BASE_DECLARE_FEATURE(kCriticalClientHint); CONTENT_EXPORT BASE_DECLARE_FEATURE(kDataUrlsHaveStableNonce); +CONTENT_EXPORT BASE_DECLARE_FEATURE(kDataUrlsHaveOriginAsUrl); CONTENT_EXPORT BASE_DECLARE_FEATURE(kDesktopCaptureChangeSource); #if BUILDFLAG(IS_MAC) CONTENT_EXPORT BASE_DECLARE_FEATURE(kDeviceMonitorMac);
diff --git a/content/public/browser/site_instance.h b/content/public/browser/site_instance.h index 29bdd6de..648ab5b 100644 --- a/content/public/browser/site_instance.h +++ b/content/public/browser/site_instance.h
@@ -236,6 +236,14 @@ BrowserContext* browser_context, const StoragePartitionConfig& partition_config); + // Factory method to create a SiteInstance in a new BrowsingInstance with a + // custom StoragePartition that is preserved across navigations. + // `partition_config` needs to be for a non-default StoragePartition. + static scoped_refptr<SiteInstance> CreateForFixedStoragePartition( + BrowserContext* browser_context, + const GURL& url, + const StoragePartitionConfig& partition_config); + // Determine if a URL should "use up" a site. URLs such as about:blank or // chrome-native:// leave the site unassigned. //
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc index f7685511..8c5ac8f0 100644 --- a/content/public/test/browser_test_utils.cc +++ b/content/public/test/browser_test_utils.cc
@@ -3814,7 +3814,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS); simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - url_loader_factory, simple_loader_helper.GetCallback()); + url_loader_factory, simple_loader_helper.GetCallbackDeprecated()); simple_loader_helper.WaitForCallback(); return simple_loader->NetError();
diff --git a/content/public/test/simple_url_loader_test_helper.cc b/content/public/test/simple_url_loader_test_helper.cc index a2e6eee..30c9146 100644 --- a/content/public/test/simple_url_loader_test_helper.cc +++ b/content/public/test/simple_url_loader_test_helper.cc
@@ -14,7 +14,7 @@ SimpleURLLoaderTestHelper::~SimpleURLLoaderTestHelper() {} -network::SimpleURLLoader::BodyAsStringCallbackDeprecated +network::SimpleURLLoader::BodyAsStringCallback SimpleURLLoaderTestHelper::GetCallback() { DCHECK(!callback_created_); callback_created_ = true; @@ -23,16 +23,37 @@ weak_ptr_factory_.GetWeakPtr()); } +network::SimpleURLLoader::BodyAsStringCallbackDeprecated +SimpleURLLoaderTestHelper::GetCallbackDeprecated() { + DCHECK(!callback_created_); + callback_created_ = true; + + return base::BindOnce( + &SimpleURLLoaderTestHelper::OnCompleteCallbackDeprecated, + weak_ptr_factory_.GetWeakPtr()); +} + void SimpleURLLoaderTestHelper::WaitForCallback() { DCHECK(!wait_started_); wait_started_ = true; run_loop_.Run(); } -void SimpleURLLoaderTestHelper::OnCompleteCallback( +void SimpleURLLoaderTestHelper::OnCompleteCallbackDeprecated( std::unique_ptr<std::string> response_body) { DCHECK(!response_body_); + if (response_body) { + response_body_ = std::move(*response_body); + } + + run_loop_.Quit(); +} + +void SimpleURLLoaderTestHelper::OnCompleteCallback( + std::optional<std::string> response_body) { + DCHECK(!response_body_); + response_body_ = std::move(response_body); run_loop_.Quit();
diff --git a/content/public/test/simple_url_loader_test_helper.h b/content/public/test/simple_url_loader_test_helper.h index e14aaa4..eac3f8b8 100644 --- a/content/public/test/simple_url_loader_test_helper.h +++ b/content/public/test/simple_url_loader_test_helper.h
@@ -6,6 +6,7 @@ #define CONTENT_PUBLIC_TEST_SIMPLE_URL_LOADER_TEST_HELPER_H_ #include <memory> +#include <optional> #include <string> #include "base/functional/callback_forward.h" @@ -29,19 +30,24 @@ // Returns a BodyAsStringCallbackDeprecated for use with a SimpleURLLoader. // May be called only once. - network::SimpleURLLoader::BodyAsStringCallbackDeprecated GetCallback(); + network::SimpleURLLoader::BodyAsStringCallback GetCallback(); + network::SimpleURLLoader::BodyAsStringCallbackDeprecated + GetCallbackDeprecated(); // Waits until the callback returned by GetCallback() is invoked. void WaitForCallback(); // Response body passed to the callback returned by GetCallback, if there was // one. - const std::string* response_body() const { return response_body_.get(); } + const std::optional<std::string>& response_body() const { + return response_body_; + } private: // Called back GetCallback(). Stores the response body and quits the message // loop. - void OnCompleteCallback(std::unique_ptr<std::string> response_body); + void OnCompleteCallback(std::optional<std::string> response_body); + void OnCompleteCallbackDeprecated(std::unique_ptr<std::string> response_body); // Used to ensure GetCallback() is called only once. bool callback_created_ = false; @@ -50,7 +56,7 @@ base::RunLoop run_loop_; - std::unique_ptr<std::string> response_body_; + std::optional<std::string> response_body_; base::WeakPtrFactory<SimpleURLLoaderTestHelper> weak_ptr_factory_{this}; };
diff --git a/content/test/data/gpu/media_foundation_clear_dcomp.js b/content/test/data/gpu/media_foundation_clear_dcomp.js index fdddb188..1d24aa7 100644 --- a/content/test/data/gpu/media_foundation_clear_dcomp.js +++ b/content/test/data/gpu/media_foundation_clear_dcomp.js
@@ -50,4 +50,5 @@ }, false); video.src = QueryString.src; + video.play(); } \ No newline at end of file
diff --git a/content/test/io_thread_shared_url_loader_factory_owner.cc b/content/test/io_thread_shared_url_loader_factory_owner.cc index dd334b3d..9773231 100644 --- a/content/test/io_thread_shared_url_loader_factory_owner.cc +++ b/content/test/io_thread_shared_url_loader_factory_owner.cc
@@ -107,17 +107,18 @@ TRAFFIC_ANNOTATION_FOR_TESTS); GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce( - [](network::SimpleURLLoader* loader, - network::mojom::URLLoaderFactory* factory, - network::SimpleURLLoader::BodyAsStringCallbackDeprecated - body_as_string_callback) { - loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - factory, std::move(body_as_string_callback)); - }, - base::Unretained(simple_loader.get()), - base::Unretained(shared_url_loader_factory_.get()), - RunOnUIThread(simple_loader_helper.GetCallback()))); + FROM_HERE, + base::BindOnce( + [](network::SimpleURLLoader* loader, + network::mojom::URLLoaderFactory* factory, + network::SimpleURLLoader::BodyAsStringCallbackDeprecated + body_as_string_callback) { + loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( + factory, std::move(body_as_string_callback)); + }, + base::Unretained(simple_loader.get()), + base::Unretained(shared_url_loader_factory_.get()), + RunOnUIThread(simple_loader_helper.GetCallbackDeprecated()))); simple_loader_helper.WaitForCallback(); return simple_loader->NetError();
diff --git a/docs/telemetry_extension/api_overview.md b/docs/telemetry_extension/api_overview.md index 37e6e75..2a09517 100644 --- a/docs/telemetry_extension/api_overview.md +++ b/docs/telemetry_extension/api_overview.md
@@ -305,6 +305,26 @@ ------------ | ------- | ----------- | | maxTestingMemKib | number | An optional field to indicate how much memory should be tested. If the value is null, memory test will run with as much memory as possible | +### Enum HardwarePresenceStatus +| Property Name | +------------ | +| matched | +| not_matched | +| not_configured | + +### FanRoutineFinishedInfo +| Property Name | Type | Description | +------------ | ------- | ----------- | +| uuid | string | UUID of the routine that entered this state | +| has_passed | boolean | Whether the routine finished successfully | +| passed_fan_ids | Array<number\> | The ids of fans that can be controlled | +| failed_fan_ids | Array<number\> | The ids of fans that cannot be controlled | +| fan_count_status | HardwarePresenceStatus | Whether the number of fan probed is matched | + +### RunFanRoutineArguments +| Property Name | Type | Description | +------------ | ------- | ----------- | + ### CreateRoutineResponse | Property Name | Type | Description | ------------ | ------- | ----------- | @@ -333,6 +353,8 @@ | cancelRoutine | (params: CancelRoutineRequest) => Promise<void\> | `os.diagnostics` | M119 | | createMemoryRoutine | (args: RunMemoryRoutineArguments) => Promise<CreateRoutineResponse\> | `os.diagnostics` | M119 | | isMemoryRoutineArgumentSupported | (args: RunMemoryRoutineArguments) => Promise<RoutineSupportStatusInfo\> | `os.diagnostics` | M119 | +| createFanRoutine | (args: RunFanRoutineArguments) => Promise<CreateRoutineResponse\> | `os.diagnostics` | M121 | +| isFanRoutineArgumentSupported | (args: RunFanRoutineArguments) => Promise<RoutineSupportStatusInfo\> | `os.diagnostics` | M121 | ## Events @@ -343,6 +365,7 @@ | onRoutineWaiting | function(RoutineWaitingInfo) | `os.diagnostics` | M119 | Informs the extension that a routine stopped execution and waits for an event, e.g. user interaction. `RoutineWaitingInfo` contains information about what the routine is waiting for | | onRoutineException | function(ExceptionInfo) | `os.diagnostics` | M119 | Informs the extension that an exception occurred. The error passed in `ExceptionInfo` is non-recoverable | | onMemoryRoutineFinished | function(MemoryRoutineFinishedInfo) | `os.diagnostics` | M119 | Informs the extension that a memory routine finished | +| onFanRoutineFinished | function(FanRoutineFinishedInfo) | `os.diagnostics` | M121 | Informs the extension that a fan routine finished | # Events
diff --git a/extensions/browser/extension_event_histogram_value.h b/extensions/browser/extension_event_histogram_value.h index 4a753da..784fb141 100644 --- a/extensions/browser/extension_event_histogram_value.h +++ b/extensions/browser/extension_event_histogram_value.h
@@ -569,6 +569,7 @@ ACCESSIBILITY_SERVICE_PRIVATE_CLIPBOARD_COPY_IN_ACTIVE_GOOGLE_DOC = 547, INPUT_METHOD_PRIVATE_ON_LANGUAGE_PACK_STATUS_CHANGED = 548, OS_DIAGNOSTICS_ON_VOLUME_BUTTON_ROUTINE_FINISHED = 549, + OS_DIAGNOSTICS_ON_FAN_ROUTINE_FINISHED = 550, // Last entry: Add new entries above, then run: // tools/metrics/histograms/update_extension_histograms.py ENUM_BOUNDARY
diff --git a/extensions/browser/extension_function_histogram_value.h b/extensions/browser/extension_function_histogram_value.h index 865e4aa..6248a66d 100644 --- a/extensions/browser/extension_function_histogram_value.h +++ b/extensions/browser/extension_function_histogram_value.h
@@ -1904,6 +1904,8 @@ PDFVIEWERPRIVATE_SETPDFPLUGINATTRIBUTES = 1842, ACCESSIBILITY_PRIVATE_SETCURSORPOSITION = 1843, ACCESSIBILITY_PRIVATE_GETTTSDLCCONTENTS = 1844, + OS_DIAGNOSTICS_CREATEFANROUTINE = 1845, + OS_DIAGNOSTICS_ISFANROUTINEARGUMENTSUPPORTED = 1846, // Last entry: Add new entries above, then run: // tools/metrics/histograms/update_extension_histograms.py ENUM_BOUNDARY
diff --git a/google_apis/gcm/engine/mcs_client.cc b/google_apis/gcm/engine/mcs_client.cc index b56a29dd..013dfed 100644 --- a/google_apis/gcm/engine/mcs_client.cc +++ b/google_apis/gcm/engine/mcs_client.cc
@@ -522,7 +522,6 @@ void MCSClient::OnGCMUpdateFinished(bool success) { LOG_IF(ERROR, !success) << "GCM Update failed!"; - UMA_HISTOGRAM_BOOLEAN("GCM.StoreUpdateSucceeded", success); // TODO(zea): Rebuild the store from scratch in case of persistence failure? }
diff --git a/infra/config/generated/testing/variants.pyl b/infra/config/generated/testing/variants.pyl index 75e4cfc..c1ce6511 100644 --- a/infra/config/generated/testing/variants.pyl +++ b/infra/config/generated/testing/variants.pyl
@@ -70,16 +70,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 121.0.6138.0', + 'description': 'Run with ash-chrome version 121.0.6139.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v121.0.6138.0', - 'revision': 'version:121.0.6138.0', + 'location': 'lacros_version_skew_tests_v121.0.6139.0', + 'revision': 'version:121.0.6139.0', }, ], },
diff --git a/infra/config/targets/lacros-version-skew-variants.json b/infra/config/targets/lacros-version-skew-variants.json index 4fd4ed2..2eb9a63 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_v121.0.6138.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6138.0", + "description": "Run with ash-chrome version 121.0.6139.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_v121.0.6138.0", - "revision": "version:121.0.6138.0" + "location": "lacros_version_skew_tests_v121.0.6139.0", + "revision": "version:121.0.6139.0" } ] }
diff --git a/internal b/internal index cce7577..6b1a25b 160000 --- a/internal +++ b/internal
@@ -1 +1 @@ -Subproject commit cce7577191a433fcfb0930d6a8bdd99632e7bb28 +Subproject commit 6b1a25bd76bb7b2eb1682803a9e6ebfffe217162
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm index 54d68f4c..cbeb0d6 100644 --- a/ios/chrome/browser/flags/about_flags.mm +++ b/ios/chrome/browser/flags/about_flags.mm
@@ -1622,10 +1622,6 @@ {"dynamic-background-color", flag_descriptions::kDynamicBackgroundColorName, flag_descriptions::kDynamicBackgroundColorDescription, flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDynamicBackgroundColor)}, - {"set-up-list-content-notification", - flag_descriptions::kSetUpListContentNotificationName, - flag_descriptions::kSetUpListContentNotificationDescription, - flags_ui::kOsIos, FEATURE_VALUE_TYPE(kSetUpListContentNotification)}, {"fullscreen-improvement", flag_descriptions::kFullscreenImprovementName, flag_descriptions::kFullscreenImprovementDescription, flags_ui::kOsIos, FEATURE_VALUE_TYPE(kFullscreenImprovement)},
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc index 4fb862c2..b082360 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
@@ -922,12 +922,6 @@ const char kSendUmaOverAnyNetworkDescription[] = "When enabled, will send UMA data over either WiFi or cellular by default."; -const char kSetUpListContentNotificationName[] = - "Set Up List Content Notification Opt-in"; -const char kSetUpListContentNotificationDescription[] = - "Displays an content notification opt-in entry point in list of set up " - "tasks on Home for a new user."; - const char kSharedHighlightingIOSName[] = "Enable Shared Highlighting features"; const char kSharedHighlightingIOSDescription[] = "Adds a Link to Text option in the Edit Menu which generates URLs with a "
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h index 1c603c9..49d3215c 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
@@ -815,11 +815,6 @@ extern const char kSendUmaOverAnyNetwork[]; extern const char kSendUmaOverAnyNetworkDescription[]; -// Title and description for the flag to display the Set Up List Content -// Notification Opt-in. -extern const char kSetUpListContentNotificationName[]; -extern const char kSetUpListContentNotificationDescription[]; - // Title and description for the flag to enable Shared Highlighting (Link to // Text Edit Menu option). extern const char kSharedHighlightingIOSName[];
diff --git a/ios/chrome/browser/infobars/overlays/browser_agent/interaction_handlers/autofill_address_profile/save_address_profile_infobar_modal_overlay_request_callback_installer.mm b/ios/chrome/browser/infobars/overlays/browser_agent/interaction_handlers/autofill_address_profile/save_address_profile_infobar_modal_overlay_request_callback_installer.mm index a5201de..e1d39e0f 100644 --- a/ios/chrome/browser/infobars/overlays/browser_agent/interaction_handlers/autofill_address_profile/save_address_profile_infobar_modal_overlay_request_callback_installer.mm +++ b/ios/chrome/browser/infobars/overlays/browser_agent/interaction_handlers/autofill_address_profile/save_address_profile_infobar_modal_overlay_request_callback_installer.mm
@@ -21,8 +21,6 @@ SaveAddressProfileModalRequestConfig; using save_address_profile_infobar_modal_responses::CancelViewAction; using save_address_profile_infobar_modal_responses::EditedProfileSaveAction; -using save_address_profile_infobar_modal_responses:: - LegacyEditedProfileSaveAction; using save_address_profile_infobar_modal_responses::NoThanksViewAction; SaveAddressProfileInfobarModalOverlayRequestCallbackInstaller:: @@ -110,13 +108,6 @@ manager->AddDispatchCallback(OverlayDispatchCallback( base::BindRepeating( &SaveAddressProfileInfobarModalOverlayRequestCallbackInstaller:: - SaveEditedProfileDetailsCallback, - weak_factory_.GetWeakPtr(), request), - LegacyEditedProfileSaveAction::ResponseSupport())); - - manager->AddDispatchCallback(OverlayDispatchCallback( - base::BindRepeating( - &SaveAddressProfileInfobarModalOverlayRequestCallbackInstaller:: CancelModalCallback, weak_factory_.GetWeakPtr(), request), CancelViewAction::ResponseSupport()));
diff --git a/ios/chrome/browser/infobars/overlays/browser_agent/interaction_handlers/autofill_address_profile/save_address_profile_infobar_modal_overlay_request_callback_installer_unittest.mm b/ios/chrome/browser/infobars/overlays/browser_agent/interaction_handlers/autofill_address_profile/save_address_profile_infobar_modal_overlay_request_callback_installer_unittest.mm index c88982bc..f6901fd 100644 --- a/ios/chrome/browser/infobars/overlays/browser_agent/interaction_handlers/autofill_address_profile/save_address_profile_infobar_modal_overlay_request_callback_installer_unittest.mm +++ b/ios/chrome/browser/infobars/overlays/browser_agent/interaction_handlers/autofill_address_profile/save_address_profile_infobar_modal_overlay_request_callback_installer_unittest.mm
@@ -30,8 +30,6 @@ SaveAddressProfileModalRequestConfig; using save_address_profile_infobar_modal_responses::CancelViewAction; using save_address_profile_infobar_modal_responses::EditedProfileSaveAction; -using save_address_profile_infobar_modal_responses:: - LegacyEditedProfileSaveAction; using save_address_profile_infobar_modal_responses::NoThanksViewAction; // Test fixture for
diff --git a/ios/chrome/browser/ntp/set_up_list.mm b/ios/chrome/browser/ntp/set_up_list.mm index c401b5b..5e888552 100644 --- a/ios/chrome/browser/ntp/set_up_list.mm +++ b/ios/chrome/browser/ntp/set_up_list.mm
@@ -137,7 +137,7 @@ // Add content notification item if the feature is enabled and the user has // signed in. - if (IsSetUpListContentNotificationEnabled() && + if (IsContentPushNotificationsSetUpListEnabled() && authService->HasPrimaryIdentity(signin::ConsentLevel::kSignin)) { AddItemIfNotNil(items, BuildItem(SetUpListItemType::kContentNotification, prefs, localState, authService));
diff --git a/ios/chrome/browser/overlays/model/public/infobar_modal/save_address_profile_infobar_modal_overlay_responses.h b/ios/chrome/browser/overlays/model/public/infobar_modal/save_address_profile_infobar_modal_overlay_responses.h index 9b35b7a..e2e36b0 100644 --- a/ios/chrome/browser/overlays/model/public/infobar_modal/save_address_profile_infobar_modal_overlay_responses.h +++ b/ios/chrome/browser/overlays/model/public/infobar_modal/save_address_profile_infobar_modal_overlay_responses.h
@@ -12,22 +12,6 @@ namespace save_address_profile_infobar_modal_responses { // Response info used to create dispatched OverlayResponses once the user -// presses "Save" action on the Edit Modal. -class LegacyEditedProfileSaveAction - : public OverlayResponseInfo<LegacyEditedProfileSaveAction> { - public: - ~LegacyEditedProfileSaveAction() override; - - NSDictionary* profile_data() const { return profile_data_; } - - private: - OVERLAY_USER_DATA_SETUP(LegacyEditedProfileSaveAction); - LegacyEditedProfileSaveAction(NSDictionary* profileData); - - NSDictionary* profile_data_; -}; - -// Response info used to create dispatched OverlayResponses once the user // presses "Save/Update" action on the Edit Modal. class EditedProfileSaveAction : public OverlayResponseInfo<EditedProfileSaveAction> {
diff --git a/ios/chrome/browser/overlays/model/public/infobar_modal/save_address_profile_infobar_modal_overlay_responses.mm b/ios/chrome/browser/overlays/model/public/infobar_modal/save_address_profile_infobar_modal_overlay_responses.mm index 6fe4f38..ee0700f 100644 --- a/ios/chrome/browser/overlays/model/public/infobar_modal/save_address_profile_infobar_modal_overlay_responses.mm +++ b/ios/chrome/browser/overlays/model/public/infobar_modal/save_address_profile_infobar_modal_overlay_responses.mm
@@ -6,16 +6,6 @@ namespace save_address_profile_infobar_modal_responses { -#pragma mark - LegacyEditedProfileSaveAction - -OVERLAY_USER_DATA_SETUP_IMPL(LegacyEditedProfileSaveAction); - -LegacyEditedProfileSaveAction::LegacyEditedProfileSaveAction( - NSDictionary* profileData) - : profile_data_(profileData) {} - -LegacyEditedProfileSaveAction::~LegacyEditedProfileSaveAction() = default; - #pragma mark - EditedProfileSaveAction OVERLAY_USER_DATA_SETUP_IMPL(EditedProfileSaveAction);
diff --git a/ios/chrome/browser/shared/public/features/features.h b/ios/chrome/browser/shared/public/features/features.h index 15f21e4..60cc6c4 100644 --- a/ios/chrome/browser/shared/public/features/features.h +++ b/ios/chrome/browser/shared/public/features/features.h
@@ -51,9 +51,6 @@ // Finchable cooldown period for non-modal promos. BASE_DECLARE_FEATURE(kNonModalDefaultBrowserPromoCooldownRefactor); -// Feature flag to enable Set Up List Content Notification. -BASE_DECLARE_FEATURE(kSetUpListContentNotification); - // The default param value for the non-modal promo cooldown period, in days, // overridable through Finch. extern const base::FeatureParam<int> @@ -634,7 +631,4 @@ // in the Magic Stack. int TimeUntilShowingCompactedSetUpList(); -// Yes if the Set Up List Content Notification is enabled. -bool IsSetUpListContentNotificationEnabled(); - #endif // IOS_CHROME_BROWSER_SHARED_PUBLIC_FEATURES_FEATURES_H_
diff --git a/ios/chrome/browser/shared/public/features/features.mm b/ios/chrome/browser/shared/public/features/features.mm index 619eed47..da9089d 100644 --- a/ios/chrome/browser/shared/public/features/features.mm +++ b/ios/chrome/browser/shared/public/features/features.mm
@@ -82,10 +82,6 @@ "NonModalDefaultBrowserPromoCooldownRefactor", base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kSetUpListContentNotification, - "SetUpListContentNotification", - base::FEATURE_DISABLED_BY_DEFAULT); - constexpr base::FeatureParam<int> kNonModalDefaultBrowserPromoCooldownRefactorParam{ &kNonModalDefaultBrowserPromoCooldownRefactor, @@ -811,7 +807,3 @@ return base::GetFieldTrialParamByFeatureAsInt( kMagicStack, kSetUpListCompactedTimeThresholdDays, 3); } - -bool IsSetUpListContentNotificationEnabled() { - return base::FeatureList::IsEnabled(kSetUpListContentNotification); -}
diff --git a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/BUILD.gn b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/BUILD.gn index 02ecaaf..e280e73d 100644 --- a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/BUILD.gn +++ b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/BUILD.gn
@@ -12,9 +12,6 @@ "infobar_save_address_profile_modal_delegate.h", "infobar_save_address_profile_table_view_controller.h", "infobar_save_address_profile_table_view_controller.mm", - "legacy_infobar_edit_address_profile_modal_delegate.h", - "legacy_infobar_edit_address_profile_table_view_controller.h", - "legacy_infobar_edit_address_profile_table_view_controller.mm", ] deps = [ "//base", @@ -43,7 +40,6 @@ sources = [ "infobar_edit_address_profile_table_view_controller_unittest.mm", "infobar_save_address_profile_table_view_controller_unittest.mm", - "legacy_infobar_edit_address_profile_table_view_controller_unittest.mm", ] deps = [ ":modals",
diff --git a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_modal_delegate.h b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_modal_delegate.h deleted file mode 100644 index 417ac6d..0000000 --- a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_modal_delegate.h +++ /dev/null
@@ -1,20 +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. - -#ifndef IOS_CHROME_BROWSER_UI_INFOBARS_MODALS_AUTOFILL_ADDRESS_PROFILE_LEGACY_INFOBAR_EDIT_ADDRESS_PROFILE_MODAL_DELEGATE_H_ -#define IOS_CHROME_BROWSER_UI_INFOBARS_MODALS_AUTOFILL_ADDRESS_PROFILE_LEGACY_INFOBAR_EDIT_ADDRESS_PROFILE_MODAL_DELEGATE_H_ - -#import <Foundation/Foundation.h> - -#import "ios/chrome/browser/ui/infobars/modals/infobar_modal_delegate.h" - -// Delegate to handle Edit Address Profile Infobar Modal actions. -@protocol LegacyInfobarEditAddressProfileModalDelegate <InfobarModalDelegate> - -// Saves the edited profile data. -- (void)saveEditedProfileWithData:(NSDictionary*)profileData; - -@end - -#endif // IOS_CHROME_BROWSER_UI_INFOBARS_MODALS_AUTOFILL_ADDRESS_PROFILE_LEGACY_INFOBAR_EDIT_ADDRESS_PROFILE_MODAL_DELEGATE_H_
diff --git a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.h b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.h deleted file mode 100644 index 903a778..0000000 --- a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.h +++ /dev/null
@@ -1,22 +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. - -#ifndef IOS_CHROME_BROWSER_UI_INFOBARS_MODALS_AUTOFILL_ADDRESS_PROFILE_LEGACY_INFOBAR_EDIT_ADDRESS_PROFILE_TABLE_VIEW_CONTROLLER_H_ -#define IOS_CHROME_BROWSER_UI_INFOBARS_MODALS_AUTOFILL_ADDRESS_PROFILE_LEGACY_INFOBAR_EDIT_ADDRESS_PROFILE_TABLE_VIEW_CONTROLLER_H_ - -#import "ios/chrome/browser/shared/ui/table_view/legacy_chrome_table_view_controller.h" -#import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_edit_address_profile_modal_consumer.h" - -@protocol LegacyInfobarEditAddressProfileModalDelegate; - -// The TableView for an Autofill save/update address edit menu. -@interface LegacyInfobarEditAddressProfileTableViewController - : LegacyChromeTableViewController <InfobarEditAddressProfileModalConsumer> - -- (instancetype)initWithModalDelegate: - (id<LegacyInfobarEditAddressProfileModalDelegate>)delegate; - -@end - -#endif // IOS_CHROME_BROWSER_UI_INFOBARS_MODALS_AUTOFILL_ADDRESS_PROFILE_LEGACY_INFOBAR_EDIT_ADDRESS_PROFILE_TABLE_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.mm b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.mm deleted file mode 100644 index faa887fe..0000000 --- a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.mm +++ /dev/null
@@ -1,245 +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 "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.h" - -#import "base/apple/foundation_util.h" -#import "base/metrics/user_metrics.h" -#import "base/metrics/user_metrics_action.h" -#import "components/autofill/core/common/autofill_features.h" -#import "components/strings/grit/components_strings.h" -#import "ios/chrome/browser/infobars/infobar_metrics_recorder.h" -#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_button_item.h" -#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_edit_item.h" -#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_edit_item_delegate.h" -#import "ios/chrome/browser/shared/ui/table_view/legacy_chrome_table_view_styler.h" -#import "ios/chrome/browser/ui/autofill/autofill_ui_type.h" -#import "ios/chrome/browser/ui/autofill/autofill_ui_type_util.h" -#import "ios/chrome/browser/ui/autofill/cells/autofill_edit_item.h" -#import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_modal_delegate.h" -#import "ios/chrome/common/ui/colors/semantic_color_names.h" -#import "ios/chrome/common/ui/table_view/table_view_cells_constants.h" -#import "ios/chrome/grit/ios_strings.h" -#import "ui/base/l10n/l10n_util_mac.h" - -namespace { -using ::AutofillTypeFromAutofillUIType; -using ::AutofillUITypeFromAutofillType; - -typedef NS_ENUM(NSInteger, SectionIdentifier) { - SectionIdentifierFields = kSectionIdentifierEnumZero, - SectionIdentifierButton -}; - -typedef NS_ENUM(NSInteger, ItemType) { - ItemTypeTextField = kItemTypeEnumZero, - ItemTypeSaveButton, -}; - -} // namespace - -@interface LegacyInfobarEditAddressProfileTableViewController () < - UITextFieldDelegate> - -// The delegate passed to this instance. -@property(nonatomic, weak) id<LegacyInfobarEditAddressProfileModalDelegate> - delegate; - -// Used to build and record metrics. -@property(nonatomic, strong) InfobarMetricsRecorder* metricsRecorder; - -// All the data to be displayed in the edit dialog. -@property(nonatomic, strong) NSMutableDictionary* profileData; - -// Yes, if the edit is done for updating the profile. -@property(nonatomic, assign) BOOL isEditForUpdate; - -@end - -@implementation LegacyInfobarEditAddressProfileTableViewController - -#pragma mark - Initialization - -- (instancetype)initWithModalDelegate: - (id<LegacyInfobarEditAddressProfileModalDelegate>)modalDelegate { - self = [super initWithStyle:UITableViewStylePlain]; - if (self) { - _delegate = modalDelegate; - _metricsRecorder = [[InfobarMetricsRecorder alloc] - initWithType:InfobarType::kInfobarTypeSaveAutofillAddressProfile]; - } - return self; -} - -#pragma mark - ViewController Lifecycle - -- (void)viewDidLoad { - [super viewDidLoad]; - - self.view.backgroundColor = [UIColor colorNamed:kBackgroundColor]; - self.styler.cellBackgroundColor = [UIColor colorNamed:kBackgroundColor]; - self.tableView.sectionHeaderHeight = 0; - self.tableView.estimatedRowHeight = 56; - - [self.tableView - setSeparatorInset:UIEdgeInsetsMake(0, kTableViewHorizontalSpacing, 0, 0)]; - - // Configure the NavigationBar. - UIBarButtonItem* cancelButton = [[UIBarButtonItem alloc] - initWithBarButtonSystemItem:UIBarButtonSystemItemCancel - target:self - action:@selector(handleCancelButton)]; - - self.navigationItem.leftBarButtonItem = cancelButton; - self.navigationController.navigationBar.prefersLargeTitles = NO; - - if (self.isEditForUpdate) { - self.navigationItem.title = - l10n_util::GetNSString(IDS_IOS_AUTOFILL_UPDATE_ADDRESS_PROMPT_TITLE); - } else { - self.navigationItem.title = - l10n_util::GetNSString(IDS_IOS_AUTOFILL_SAVE_ADDRESS_PROMPT_TITLE); - } - - self.tableView.allowsSelectionDuringEditing = YES; - - [self loadModel]; -} - -#pragma mark - TableViewModel - -- (void)loadModel { - [super loadModel]; - TableViewModel* model = self.tableViewModel; - - NSString* countryCode = - _profileData[@(autofill::ServerFieldType::ADDRESS_HOME_COUNTRY)]; - - [model addSectionWithIdentifier:SectionIdentifierFields]; - for (const AutofillProfileFieldDisplayInfo& field : kProfileFieldsToDisplay) { - if (!FieldIsUsedInAddress(field.autofillType, countryCode)) { - continue; - } - - if (field.autofillType == autofill::NAME_HONORIFIC_PREFIX && - !base::FeatureList::IsEnabled( - autofill::features::kAutofillEnableSupportForHonorificPrefixes)) { - continue; - } - - AutofillEditItem* item = - [[AutofillEditItem alloc] initWithType:ItemTypeTextField]; - item.fieldNameLabelText = l10n_util::GetNSString(field.displayStringID); - item.autofillUIType = AutofillUITypeFromAutofillType(field.autofillType); - item.textFieldValue = _profileData[@(item.autofillUIType)]; - item.textFieldEnabled = YES; - item.hideIcon = NO; - item.autoCapitalizationType = field.autoCapitalizationType; - item.returnKeyType = UIReturnKeyDone; - item.keyboardType = field.keyboardType; - [model addItem:item toSectionWithIdentifier:SectionIdentifierFields]; - } - - [model addSectionWithIdentifier:SectionIdentifierButton]; - TableViewTextButtonItem* saveButton = - [[TableViewTextButtonItem alloc] initWithType:ItemTypeSaveButton]; - saveButton.textAlignment = NSTextAlignmentNatural; - if (self.isEditForUpdate) { - saveButton.buttonText = l10n_util::GetNSString( - IDS_AUTOFILL_UPDATE_ADDRESS_PROMPT_OK_BUTTON_LABEL); - } else { - saveButton.buttonText = l10n_util::GetNSString( - IDS_AUTOFILL_SAVE_ADDRESS_PROMPT_OK_BUTTON_LABEL); - } - saveButton.disableButtonIntrinsicWidth = YES; - [model addItem:saveButton toSectionWithIdentifier:SectionIdentifierButton]; -} - -#pragma mark - UITableViewDataSource - -- (UITableViewCell*)tableView:(UITableView*)tableView - cellForRowAtIndexPath:(NSIndexPath*)indexPath { - UITableViewCell* cell = [super tableView:tableView - cellForRowAtIndexPath:indexPath]; - NSInteger itemType = [self.tableViewModel itemTypeForIndexPath:indexPath]; - - if (itemType == ItemTypeTextField) { - TableViewTextEditCell* editCell = - base::apple::ObjCCastStrict<TableViewTextEditCell>(cell); - editCell.textField.delegate = self; - editCell.selectionStyle = UITableViewCellSelectionStyleNone; - } else if (itemType == ItemTypeSaveButton) { - TableViewTextButtonCell* tableViewTextButtonCell = - base::apple::ObjCCastStrict<TableViewTextButtonCell>(cell); - [tableViewTextButtonCell.button addTarget:self - action:@selector(didTapSaveButton) - forControlEvents:UIControlEventTouchUpInside]; - } - - return cell; -} - -#pragma mark - InfobarEditAddressProfileModalConsumer - -- (void)setupModalViewControllerWithData:(NSDictionary*)data { - self.profileData = [NSMutableDictionary dictionaryWithDictionary:data]; - [self.tableView reloadData]; -} - -- (void)setIsEditForUpdate:(BOOL)isEditForUpdate { - _isEditForUpdate = isEditForUpdate; -} - -- (void)setMigrationPrompt:(BOOL)migrationPrompt { -} - -#pragma mark - UITableViewDelegate - -- (CGFloat)tableView:(UITableView*)tableView - heightForFooterInSection:(NSInteger)section { - return 0; -} - -#pragma mark - UITextFieldDelegate - -- (BOOL)textFieldShouldReturn:(UITextField*)textField { - [textField resignFirstResponder]; - return YES; -} - -#pragma mark - Actions - -- (void)handleCancelButton { - base::RecordAction( - base::UserMetricsAction("MobileMessagesModalCancelledTapped")); - [self.metricsRecorder recordModalEvent:MobileMessagesModalEvent::Canceled]; - [self.delegate dismissInfobarModal:self]; -} - -- (void)didTapSaveButton { - base::RecordAction( - base::UserMetricsAction("MobileMessagesModalAcceptedTapped")); - [self.metricsRecorder recordModalEvent:MobileMessagesModalEvent::Accepted]; - [self updateProfileData]; - [self.delegate saveEditedProfileWithData:self.profileData]; -} - -#pragma mark - Private - -- (void)updateProfileData { - TableViewModel* model = self.tableViewModel; - NSInteger section = - [model sectionForSectionIdentifier:SectionIdentifierFields]; - NSInteger itemCount = [model numberOfItemsInSection:section]; - for (NSInteger itemIndex = 0; itemIndex < itemCount; ++itemIndex) { - NSIndexPath* path = [NSIndexPath indexPathForItem:itemIndex - inSection:section]; - AutofillEditItem* item = base::apple::ObjCCastStrict<AutofillEditItem>( - [model itemAtIndexPath:path]); - self.profileData[[NSNumber numberWithInt:item.autofillUIType]] = - item.textFieldValue; - } -} - -@end
diff --git a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller_unittest.mm b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller_unittest.mm deleted file mode 100644 index 7ff6d28..0000000 --- a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller_unittest.mm +++ /dev/null
@@ -1,41 +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 "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.h" - -#import "base/apple/foundation_util.h" -#import "ios/chrome/browser/shared/ui/table_view/legacy_chrome_table_view_controller_test.h" -#import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_modal_delegate.h" -#import "testing/gtest_mac.h" - -#import "third_party/ocmock/OCMock/OCMock.h" -#import "third_party/ocmock/gtest_support.h" - -// Test fixture for testing LegacyInfobarEditAddressProfileTableViewController -// class. -class LegacyInfobarEditAddressProfileTableViewControllerTest - : public LegacyChromeTableViewControllerTest { - protected: - LegacyInfobarEditAddressProfileTableViewControllerTest() - : delegate_(OCMProtocolMock( - @protocol(LegacyInfobarEditAddressProfileModalDelegate))) {} - - LegacyChromeTableViewController* InstantiateController() override { - return [[LegacyInfobarEditAddressProfileTableViewController alloc] - initWithModalDelegate:delegate_]; - } - - id delegate_; -}; - -// Tests that the edit modal has been initialized. -TEST_F(LegacyInfobarEditAddressProfileTableViewControllerTest, - TestEditModalInitialization) { - CreateController(); - CheckController(); - - EXPECT_EQ(2, NumberOfSections()); - EXPECT_EQ(10, NumberOfItemsInSection(0)); - EXPECT_EQ(1, NumberOfItemsInSection(1)); -}
diff --git a/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_coordinator.mm b/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_coordinator.mm index 35da789..d9ea3eb9 100644 --- a/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_coordinator.mm +++ b/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_coordinator.mm
@@ -21,7 +21,6 @@ #import "ios/chrome/browser/ui/autofill/cells/country_item.h" #import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_edit_address_profile_table_view_controller.h" #import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_save_address_profile_table_view_controller.h" -#import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.h" #import "ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator.h" #import "ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator_delegate.h" #import "ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_overlay_coordinator+modal_configuration.h"
diff --git a/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator.h b/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator.h index 69e46b2f..0753974 100644 --- a/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator.h +++ b/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator.h
@@ -8,7 +8,6 @@ #import "ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_overlay_mediator.h" #import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_save_address_profile_modal_delegate.h" -#import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_modal_delegate.h" #import "ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator_delegate.h" namespace autofill { @@ -20,8 +19,7 @@ // Mediator that configures the modal UI for save address profile infobar. @interface SaveAddressProfileInfobarModalOverlayMediator - : InfobarModalOverlayMediator <InfobarSaveAddressProfileModalDelegate, - LegacyInfobarEditAddressProfileModalDelegate> + : InfobarModalOverlayMediator <InfobarSaveAddressProfileModalDelegate> // The consumer that is configured by this mediator. Setting to a new value // configures the new consumer.
diff --git a/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator.mm b/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator.mm index 81b4bb9..d4edb19 100644 --- a/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator.mm +++ b/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator.mm
@@ -21,8 +21,6 @@ SaveAddressProfileModalRequestConfig; using save_address_profile_infobar_modal_responses::CancelViewAction; using save_address_profile_infobar_modal_responses::EditedProfileSaveAction; -using save_address_profile_infobar_modal_responses:: - LegacyEditedProfileSaveAction; using save_address_profile_infobar_modal_responses::NoThanksViewAction; @interface SaveAddressProfileInfobarModalOverlayMediator () @@ -118,12 +116,6 @@ #pragma mark - InfobarEditAddressProfileModalDelegate -- (void)saveEditedProfileWithData:(NSDictionary*)profileData { - [self dispatchResponse:OverlayResponse::CreateWithInfo< - LegacyEditedProfileSaveAction>(profileData)]; - [self dismissOverlay]; -} - - (void)dismissInfobarModal:(id)infobarModal { base::RecordAction(base::UserMetricsAction(kInfobarModalCancelButtonTapped));
diff --git a/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator_unittest.mm b/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator_unittest.mm index d3fd192..0c61ab1 100644 --- a/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator_unittest.mm +++ b/ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_mediator_unittest.mm
@@ -28,8 +28,6 @@ SaveAddressProfileModalRequestConfig; using save_address_profile_infobar_modal_responses::CancelViewAction; using save_address_profile_infobar_modal_responses::EditedProfileSaveAction; -using save_address_profile_infobar_modal_responses:: - LegacyEditedProfileSaveAction; using save_address_profile_infobar_modal_responses::NoThanksViewAction; // Test fixture for SaveAddressProfileInfobarModalOverlayMediator. @@ -37,8 +35,7 @@ public: SaveAddressProfileInfobarModalOverlayMediatorTest() : callback_installer_(&callback_receiver_, - {LegacyEditedProfileSaveAction::ResponseSupport(), - EditedProfileSaveAction::ResponseSupport(), + {EditedProfileSaveAction::ResponseSupport(), CancelViewAction::ResponseSupport(), NoThanksViewAction::ResponseSupport()}), mediator_delegate_( @@ -113,17 +110,6 @@ } } -// Tests that calling saveEditedProfileWithData: triggers a -// LegacyEditedProfileSaveAction response. -TEST_F(SaveAddressProfileInfobarModalOverlayMediatorTest, LegacyEditAction) { - EXPECT_CALL( - callback_receiver_, - DispatchCallback(request_.get(), - LegacyEditedProfileSaveAction::ResponseSupport())); - OCMExpect([mediator_delegate_ stopOverlayForMediator:mediator_]); - [mediator_ saveEditedProfileWithData:@{}.mutableCopy]; -} - // Tests that calling saveEditedProfileWithProfileData: triggers a // EditedProfileSaveAction response. TEST_F(SaveAddressProfileInfobarModalOverlayMediatorTest, EditAction) {
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index 76b3dd6b..21c6975d 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -361,6 +361,12 @@ [_webView stopLoading]; [_webView removeFromSuperview]; + + // Since the WKWebView is about to be released, the kvo for the `loading` + // state will not be received. Without manually setting loading to false, + // the tab will appear to be endlessly loading until the next page load + // completes. + self.webStateImpl->SetIsLoading(false); } // Set up the new web view.
diff --git a/media/renderers/win/media_engine_notify_impl.cc b/media/renderers/win/media_engine_notify_impl.cc index c8ca386..5d11f0e 100644 --- a/media/renderers/win/media_engine_notify_impl.cc +++ b/media/renderers/win/media_engine_notify_impl.cc
@@ -95,6 +95,7 @@ CanPlayThroughCB can_play_through_cb, PlayingCB playing_cb, WaitingCB waiting_cb, + FrameStepCompletedCB frame_step_completed_cb, TimeUpdateCB time_update_cb) { DVLOG_FUNC(1); @@ -105,6 +106,7 @@ can_play_through_cb_ = std::move(can_play_through_cb); playing_cb_ = std::move(playing_cb); waiting_cb_ = std::move(waiting_cb); + frame_step_completed_cb_ = std::move(frame_step_completed_cb); time_update_cb_ = std::move(time_update_cb); return S_OK; } @@ -151,6 +153,9 @@ case MF_MEDIA_ENGINE_EVENT_WAITING: waiting_cb_.Run(); break; + case MF_MEDIA_ENGINE_EVENT_FRAMESTEPCOMPLETED: + frame_step_completed_cb_.Run(); + break; case MF_MEDIA_ENGINE_EVENT_TIMEUPDATE: time_update_cb_.Run(); break;
diff --git a/media/renderers/win/media_engine_notify_impl.h b/media/renderers/win/media_engine_notify_impl.h index 05350f0..1da5ef65 100644 --- a/media/renderers/win/media_engine_notify_impl.h +++ b/media/renderers/win/media_engine_notify_impl.h
@@ -34,6 +34,7 @@ using CanPlayThroughCB = base::RepeatingClosure; using PlayingCB = base::RepeatingClosure; using WaitingCB = base::RepeatingClosure; + using FrameStepCompletedCB = base::RepeatingClosure; using TimeUpdateCB = base::RepeatingClosure; HRESULT RuntimeClassInitialize(ErrorCB error_cb, @@ -43,6 +44,7 @@ CanPlayThroughCB can_play_through_cb, PlayingCB playing_cb, WaitingCB waiting_cb, + FrameStepCompletedCB frame_step_completed_cb, TimeUpdateCB time_update_cb); // IMFMediaEngineNotify implementation. @@ -63,6 +65,7 @@ CanPlayThroughCB can_play_through_cb_; PlayingCB playing_cb_; WaitingCB waiting_cb_; + FrameStepCompletedCB frame_step_completed_cb_; TimeUpdateCB time_update_cb_; // EventNotify is invoked from MF threadpool thread where the callbacks are
diff --git a/media/renderers/win/media_foundation_renderer.cc b/media/renderers/win/media_foundation_renderer.cc index b4198ff0..a79b004 100644 --- a/media/renderers/win/media_foundation_renderer.cc +++ b/media/renderers/win/media_foundation_renderer.cc
@@ -91,6 +91,8 @@ STRINGIFY(kFailedToCreateMediaEngine); STRINGIFY(kFailedToCreateDCompTextureWrapper); STRINGIFY(kFailedToInitDCompTextureWrapper); + STRINGIFY(kFailedToSetPlaybackRate); + STRINGIFY(kFailedToGetMediaEngineEx); } #undef STRINGIFY } @@ -249,6 +251,8 @@ base::BindPostTaskToCurrentDefault( base::BindRepeating(&MediaFoundationRenderer::OnWaiting, weak_this)), base::BindPostTaskToCurrentDefault(base::BindRepeating( + &MediaFoundationRenderer::OnFrameStepCompleted, weak_this)), + base::BindPostTaskToCurrentDefault(base::BindRepeating( &MediaFoundationRenderer::OnTimeUpdate, weak_this)))); ComPtr<IMFAttributes> creation_attributes; @@ -591,8 +595,14 @@ DVLOG_FUNC(2) << "playback_rate=" << playback_rate; HRESULT hr = mf_media_engine_->SetPlaybackRate(playback_rate); - // Ignore error so that the media continues to play rather than stopped. - DVLOG_IF(1, FAILED(hr)) << "Failed to set playback rate: " << PrintHr(hr); + + if (SUCCEEDED(hr)) { + playback_rate_ = playback_rate; + } else { + DVLOG_IF(1, FAILED(hr)) << "Failed to set playback rate: " << PrintHr(hr); + OnError(PIPELINE_ERROR_COULD_NOT_RENDER, + ErrorReason::kFailedToSetPlaybackRate, hr); + } } void MediaFoundationRenderer::GetDCompSurface(GetDCompSurfaceCB callback) { @@ -882,6 +892,22 @@ void MediaFoundationRenderer::OnCanPlayThrough() { DVLOG_FUNC(2); + // If the playback rate in Media Foundations is 0, the video renderer would + // not pre-roll and request frames. Use Frame Step function to force + // pre-rolling + if (playback_rate_ == 0) { + ComPtr<IMFMediaEngineEx> mf_media_engine_ex; + + HRESULT hr = mf_media_engine_.As(&mf_media_engine_ex); + if (SUCCEEDED(hr)) { + mf_media_engine_ex->FrameStep(/*Forward=*/true); + } else { + OnError(PIPELINE_ERROR_COULD_NOT_RENDER, + ErrorReason::kFailedToGetMediaEngineEx, hr); + return; + } + } + // According to HTML5 <video> spec, on "canplaythrough", the video could be // rendered at the current playback rate all the way to its end, and it's // the time to report BUFFERING_HAVE_ENOUGH. @@ -922,6 +948,27 @@ DCHECK(task_runner_->RunsTasksInCurrentSequence()); } +void MediaFoundationRenderer::OnFrameStepCompleted() { + DVLOG_FUNC(2); + DCHECK(task_runner_->RunsTasksInCurrentSequence()); + + // Frame-Stepping causes Media engine to be in a paused state after finishing. + // Thus play and set playback rate is needed to change the state to be + // playing. + + // Set playback rate is call again because on start, if SetPlaybackRate of 0 + // is called before pipeline topology is setup, the playback rate of Media + // Engine will be defaulted to 1 as setting playback rate is ignored until + // topology is set. Thus, when frame step is finished, setting the playback + // rate again ensures consistency. + HRESULT hr = mf_media_engine_->Play(); + if (FAILED(hr)) { + OnError(PIPELINE_ERROR_COULD_NOT_RENDER, ErrorReason::kFailedToPlay, hr); + return; + } + SetPlaybackRate(playback_rate_); +} + void MediaFoundationRenderer::OnProtectionManagerWaiting(WaitingReason reason) { DVLOG_FUNC(2); DCHECK(task_runner_->RunsTasksInCurrentSequence());
diff --git a/media/renderers/win/media_foundation_renderer.h b/media/renderers/win/media_foundation_renderer.h index d80c149..79deb5b 100644 --- a/media/renderers/win/media_foundation_renderer.h +++ b/media/renderers/win/media_foundation_renderer.h
@@ -46,6 +46,8 @@ public: // An enum for recording MediaFoundationRenderer playback error reason. // Reported to UMA. Do not change existing values. + // Updates to ErrorReason also requires the changes updated to + // tools/metrics/histograms/metadata/media/enums.xml. enum class ErrorReason { kUnknown = 0, kCdmProxyReceivedInInvalidState = 1, @@ -62,8 +64,10 @@ kFailedToCreateMediaEngine = 12, kFailedToCreateDCompTextureWrapper = 13, kFailedToInitDCompTextureWrapper = 14, + kFailedToSetPlaybackRate = 15, + kFailedToGetMediaEngineEx = 16, // Add new values here and update `kMaxValue`. Never reuse existing values. - kMaxValue = kFailedToInitDCompTextureWrapper, + kMaxValue = kFailedToGetMediaEngineEx, }; // Report `reason` to UMA. @@ -129,6 +133,7 @@ void OnCanPlayThrough(); void OnPlaying(); void OnWaiting(); + void OnFrameStepCompleted(); void OnTimeUpdate(); // Callback for `content_protection_manager_`. @@ -198,6 +203,9 @@ // Keep the last volume value being set. float volume_ = 1.0; + // Current playback rate. + double playback_rate_ = 0.0; + // Used for RendererClient::OnBufferingStateChange(). BufferingState max_buffering_state_ = BufferingState::BUFFERING_HAVE_NOTHING;
diff --git a/services/network/public/cpp/devtools_observer_unittest.cc b/services/network/public/cpp/devtools_observer_unittest.cc index 8cc90f1..2c538da2 100644 --- a/services/network/public/cpp/devtools_observer_unittest.cc +++ b/services/network/public/cpp/devtools_observer_unittest.cc
@@ -13,6 +13,7 @@ #include "net/url_request/referrer_policy.h" #include "services/network/public/cpp/devtools_observer_util.h" #include "services/network/public/cpp/resource_request.h" +#include "services/network/public/mojom/service_worker_router_info.mojom.h" #include "services/network/public/mojom/trust_tokens.mojom.h" #include "services/network/public/mojom/url_response_head.mojom.h" #include "testing/gtest/include/gtest/gtest.h" @@ -37,6 +38,7 @@ head.alpn_negotiated_protocol = "alpn"; head.was_fetched_via_spdy = true; head.service_worker_response_source = mojom::FetchResponseSource::kHttpCache; + head.service_worker_router_info = mojom::ServiceWorkerRouterInfo::New(1); head.ssl_info = net::SSLInfo(); head.remote_endpoint = net::IPEndPoint(net::IPAddress(1, 2, 3, 4), 99); @@ -57,6 +59,8 @@ EXPECT_EQ(head_info->was_fetched_via_spdy, head.was_fetched_via_spdy); EXPECT_EQ(head_info->service_worker_response_source, head.service_worker_response_source); + EXPECT_EQ(head_info->service_worker_router_info.is_null(), + head.service_worker_router_info.is_null()); EXPECT_EQ(head_info->ssl_info.has_value(), head.ssl_info.has_value()); EXPECT_EQ(head_info->remote_endpoint, head.remote_endpoint); }
diff --git a/services/network/public/cpp/devtools_observer_util.cc b/services/network/public/cpp/devtools_observer_util.cc index f481cbb..fcd1508 100644 --- a/services/network/public/cpp/devtools_observer_util.cc +++ b/services/network/public/cpp/devtools_observer_util.cc
@@ -5,6 +5,7 @@ #include "services/network/public/cpp/devtools_observer_util.h" #include "services/network/public/cpp/resource_request.h" +#include "services/network/public/mojom/service_worker_router_info.mojom.h" #include "services/network/public/mojom/url_response_head.mojom.h" namespace network { @@ -17,7 +18,8 @@ head.was_fetched_via_service_worker, head.cache_storage_cache_name, head.alpn_negotiated_protocol, head.alternate_protocol_usage, head.was_fetched_via_spdy, head.service_worker_response_source, - head.ssl_info, head.remote_endpoint, head.emitted_extra_info); + head.service_worker_router_info.Clone(), head.ssl_info, + head.remote_endpoint, head.emitted_extra_info); } mojom::URLRequestDevToolsInfoPtr ExtractDevToolsInfo(
diff --git a/services/network/public/mojom/BUILD.gn b/services/network/public/mojom/BUILD.gn index e7602834..25e919b0 100644 --- a/services/network/public/mojom/BUILD.gn +++ b/services/network/public/mojom/BUILD.gn
@@ -480,6 +480,7 @@ "parsed_headers.mojom", "referrer_policy.mojom", "request_priority.mojom", + "service_worker_router_info.mojom", "shared_dictionary_access_observer.mojom", "source_location.mojom", "supports_loading_mode.mojom",
diff --git a/services/network/public/mojom/devtools_observer.mojom b/services/network/public/mojom/devtools_observer.mojom index 929c4f2..9052c19 100644 --- a/services/network/public/mojom/devtools_observer.mojom +++ b/services/network/public/mojom/devtools_observer.mojom
@@ -18,6 +18,7 @@ import "services/network/public/mojom/ip_address_space.mojom"; import "services/network/public/mojom/referrer_policy.mojom"; import "services/network/public/mojom/request_priority.mojom"; +import "services/network/public/mojom/service_worker_router_info.mojom"; import "services/network/public/mojom/trust_tokens.mojom"; import "services/network/public/mojom/ip_endpoint.mojom"; import "services/network/public/mojom/url_loader_completion_status.mojom"; @@ -56,6 +57,7 @@ AlternateProtocolUsage alternate_protocol_usage; bool was_fetched_via_spdy; FetchResponseSource service_worker_response_source; + ServiceWorkerRouterInfo? service_worker_router_info; SSLInfo? ssl_info; IPEndPoint remote_endpoint; bool emitted_extra_info;
diff --git a/services/network/public/mojom/service_worker_router_info.mojom b/services/network/public/mojom/service_worker_router_info.mojom new file mode 100644 index 0000000..17e2676 --- /dev/null +++ b/services/network/public/mojom/service_worker_router_info.mojom
@@ -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. + +module network.mojom; + +// Represents information about ServiceWorker Static Routing API, especially, +// details of the matched static router rule. +struct ServiceWorkerRouterInfo { + // ID of the rule matchhed. Zero (invalid) by default. + uint32 rule_id_matched = 0; +};
diff --git a/services/network/public/mojom/url_response_head.mojom b/services/network/public/mojom/url_response_head.mojom index 105e0bc..8aff4a01 100644 --- a/services/network/public/mojom/url_response_head.mojom +++ b/services/network/public/mojom/url_response_head.mojom
@@ -17,6 +17,7 @@ import "services/network/public/mojom/network_param.mojom"; import "services/network/public/mojom/network_types.mojom"; import "services/network/public/mojom/parsed_headers.mojom"; +import "services/network/public/mojom/service_worker_router_info.mojom"; import "services/proxy_resolver/public/mojom/proxy_resolver.mojom"; import "url/mojom/url.mojom"; @@ -148,6 +149,11 @@ // worker did not respond to the request or did not call respondWith(). array<url.mojom.Url> url_list_via_service_worker; + // Information about ServiceWorker Static Routing API. Only provided if the + // service worker static router has been registered and one of its rule + // matched to the request. + ServiceWorkerRouterInfo? service_worker_router_info; + // https://fetch.spec.whatwg.org/#concept-response-type FetchResponseType response_type = FetchResponseType.kDefault;
diff --git a/services/webnn/dml/graph_impl.cc b/services/webnn/dml/graph_impl.cc index cda2b03..f86b23a 100644 --- a/services/webnn/dml/graph_impl.cc +++ b/services/webnn/dml/graph_impl.cc
@@ -156,6 +156,8 @@ return "elu"; case Operation::Tag::kElementWiseUnary: return "element-wise unary"; + case Operation::Tag::kExpand: + return "expand"; case Operation::Tag::kGemm: return "gemm"; case Operation::Tag::kLeakyRelu: @@ -1325,6 +1327,44 @@ return base::ok(); } +base::expected<void, mojom::ErrorPtr> CreateOperatorNodeForExpand( + const IdToOperandMap& id_to_operand_map, + const mojom::ExpandPtr& expand, + GraphBuilder& graph_builder, + IdToNodeOutputMap& id_to_node_output_map) { + const NodeOutput* input = + GetNodeOutputForOperand(id_to_node_output_map, expand->input_operand_id); + auto input_tensor_desc = input->GetTensorDesc(); + + const uint64_t output_id = expand->output_operand_id; + const auto output_tensor_desc = + CreateOutputTensorDesc(id_to_operand_map, output_id); + + // Use identity to implement the expand operation with broadcasting strides + // https://learn.microsoft.com/en-us/windows/ai/directml/dml-strides#broadcasting-with-strides. + const auto& output_dimensions = output_tensor_desc.GetDimensions(); + if (input_tensor_desc.GetDimensions() != output_dimensions) { + input_tensor_desc.BroadcastTo(output_dimensions); + } + const OperatorNode* identity_node = + CreateUnaryOperator<DML_ELEMENT_WISE_IDENTITY_OPERATOR_DESC, + DML_OPERATOR_ELEMENT_WISE_IDENTITY>( + input_tensor_desc, output_tensor_desc, input, graph_builder); + if (!identity_node) { + return base::unexpected( + mojom::Error::New(mojom::Error::Code::kUnknownError, + "Failed to create identity dml operator to implement " + "expand operation.")); + } + + const NodeOutput* node_output = graph_builder.CreateNodeOutput( + identity_node, std::move(output_tensor_desc)); + // The output id must be unique in the map. + CHECK(id_to_node_output_map.try_emplace(output_id, node_output).second); + + return base::ok(); +} + // Creates a DirectML operator for the WebNN general matrix multiplication // (GEMM) of the expression alpha * A * B + beta * C. base::expected<void, mojom::ErrorPtr> CreateOperatorNodeForGemm( @@ -2023,6 +2063,12 @@ graph_builder, id_to_node_output_map); break; } + case Operation::Tag::kExpand: { + create_operator_result = CreateOperatorNodeForExpand( + id_to_operand_map, operation->get_expand(), graph_builder, + id_to_node_output_map); + break; + } case mojom::Operation::Tag::kGemm: { create_operator_result = CreateOperatorNodeForGemm(id_to_operand_map, operation->get_gemm(),
diff --git a/services/webnn/dml/graph_impl_test.cc b/services/webnn/dml/graph_impl_test.cc index 19c90667..c11f5652 100644 --- a/services/webnn/dml/graph_impl_test.cc +++ b/services/webnn/dml/graph_impl_test.cc
@@ -1428,6 +1428,127 @@ } } +template <typename T> +struct ExpandTester { + OperandInfo<T> input; + OperandInfo<T> output; + + void Test() { + // Build the graph with mojo type. + GraphInfoBuilder builder; + uint64_t input_operand_id = + builder.BuildInput("input", input.dimensions, input.type); + uint64_t output_operand_id = + builder.BuildOutput("output", output.dimensions, output.type); + builder.BuildExpand(input_operand_id, output_operand_id); + + base::flat_map<std::string, mojo_base::BigBuffer> named_inputs; + named_inputs.insert({"input", VectorToBigBuffer(input.values)}); + base::flat_map<std::string, mojo_base::BigBuffer> named_outputs; + BuildAndCompute(builder.CloneGraphInfo(), std::move(named_inputs), + named_outputs); + VerifyIsEqual(std::move(named_outputs["output"]), output); + } +}; + +TEST_F(WebNNGraphDMLImplTest, BuildAndComputeSingleOperatorExpand) { + { + // Test building expand 0-D scalar to 3-D tensor. + ExpandTester<float>{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {}, + .values = {6}}, + .output = + { + .type = mojom::Operand::DataType::kFloat32, + .dimensions = {2, 2, 4}, + // [[[ 6, 6, 6, 6], + // [ 6, 6, 6, 6]], + // [[ 6, 6, 6, 6], + // [ 6, 6, 6, 6]]] with shape (2, 3, 4) + .values = {6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6}, + }} + .Test(); + } + { + // Test building expand with the output shape that are the same as input. + ExpandTester<float>{ + .input = + { + .type = mojom::Operand::DataType::kFloat32, + .dimensions = {3, 4}, + // [[ 1, 2, 3, 4], + // [ 5, 6, 7, 8], + // [ 9, 10, 11, 12]] with shape (3, 4) + .values = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, + }, + .output = + { + .type = mojom::Operand::DataType::kFloat32, + .dimensions = {3, 4}, + // [[ 1, 2, 3, 4], + // [ 5, 6, 7, 8], + // [ 9, 10, 11, 12]] with shape (3, 4) + .values = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, + }} + .Test(); + } + { + // Test building expand with the input shape that are broadcastable. + ExpandTester<float>{ + .input = + { + .type = mojom::Operand::DataType::kFloat32, + .dimensions = {2, 1, 5}, + // [[[1, 2, 3, 4, 5]], + // [[6, 7, 8, 9, 10]]] with shape (2, 1, 5) + .values = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, + }, + .output = + { + .type = mojom::Operand::DataType::kFloat32, + .dimensions = {2, 3, 5}, + // [[[ 1, 2, 3, 4, 5], + // [ 1, 2, 3, 4, 5], + // [ 1, 2, 3, 4, 5]]], + // [[[6, 7, 8, 9, 10], + // [6, 7, 8, 9, 10], + // [6, 7, 8, 9, 10]]] with shape (2, 3, 5) + .values = {1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 6, 7, 8, 9, 10, 6, 7, 8, 9, 10}, + }} + .Test(); + } + { + // Test building expand with the input shape that are broadcastable and the + // rank of output shape larger than input. + ExpandTester<float>{ + .input = + { + .type = mojom::Operand::DataType::kFloat32, + .dimensions = {2, 6}, + // [[[1, 2, 3, 4, 5, 6]], + // [[7, 8, 9, 10, 11, 12]]] with shape (2, 6) + .values = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, + }, + .output = + { + .type = mojom::Operand::DataType::kFloat32, + .dimensions = {3, 2, 6}, + // [[[ 1, 2, 3, 4, 5, 6], + // [ 7, 8, 9, 10, 11, 12]], + // [[ 1, 2, 3, 4, 5, 6], + // [ 7, 8, 9, 10, 11, 12]], + // [[ 1, 2, 3, 4, 5, 6], + // [ 7, 8, 9, 10, 11, 12]]] with shape (3, 2, 6) + .values = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, + }} + .Test(); + } +} + struct Pool2dAttributes { std::vector<uint32_t> window_dimensions; std::vector<uint32_t> padding;
diff --git a/services/webnn/public/mojom/webnn_graph.mojom b/services/webnn/public/mojom/webnn_graph.mojom index 9eafc57c..452403d 100644 --- a/services/webnn/public/mojom/webnn_graph.mojom +++ b/services/webnn/public/mojom/webnn_graph.mojom
@@ -183,6 +183,17 @@ uint64 output_operand_id; }; +// Expands the shape of input operand to the output shape according to +// numpy-broadcasting-rule: +// https://www.w3.org/TR/webnn/#biblio-numpy-broadcasting-rule +struct Expand { + // The input operand referenced by the input id must be distinct from the + // output operand referenced by the output id, and the input shape must be + // broadcastable to the output shape. + uint64 input_operand_id; + uint64 output_operand_id; +}; + // Specifies the different ways to pad a tensor. The padding value is only // specified when the mode is "constant". struct ConstantPadding { @@ -516,6 +527,7 @@ ElementWiseBinary element_wise_binary; Elu elu; ElementWiseUnary element_wise_unary; + Expand expand; Gemm gemm; LeakyRelu leaky_relu; Matmul matmul;
diff --git a/services/webnn/webnn_graph_impl.cc b/services/webnn/webnn_graph_impl.cc index 3178537..cac8c72f 100644 --- a/services/webnn/webnn_graph_impl.cc +++ b/services/webnn/webnn_graph_impl.cc
@@ -535,6 +535,30 @@ return false; } +bool ValidateExpand(const IdToOperandMap& id_to_operand_map, + const mojom::ExpandPtr& expand) { + auto* input = GetMojoOperand(id_to_operand_map, expand->input_operand_id); + auto* output = GetMojoOperand(id_to_operand_map, expand->output_operand_id); + if (!input || !output || output == input) { + // The expand operator is invalid. + return false; + } + if (output->data_type != input->data_type) { + // The output data type doesn't match input data type. + return false; + } + + auto output_shape = + BroadcastShapes(input->dimensions, output->dimensions, false); + if (!output_shape) { + // The input shape is not broadcastable to the output shape. + return false; + } + CHECK(output_shape.value() == output->dimensions); + + return true; +} + bool ValidateGemm(const IdToOperandMap& id_to_operand_map, const mojom::GemmPtr& gemm) { auto* a = GetMojoOperand(id_to_operand_map, gemm->a_operand_id); @@ -902,6 +926,8 @@ case mojom::Operation::Tag::kElementWiseUnary: return ValidateElementWiseUnary(id_to_operand_map, operation->get_element_wise_unary()); + case mojom::Operation::Tag::kExpand: + return ValidateExpand(id_to_operand_map, operation->get_expand()); case mojom::Operation::Tag::kGemm: return ValidateGemm(id_to_operand_map, operation->get_gemm()); case mojom::Operation::Tag::kLeakyRelu:
diff --git a/services/webnn/webnn_graph_impl_unittest.cc b/services/webnn/webnn_graph_impl_unittest.cc index 6dac2ea..1eb0f60 100644 --- a/services/webnn/webnn_graph_impl_unittest.cc +++ b/services/webnn/webnn_graph_impl_unittest.cc
@@ -1496,6 +1496,91 @@ } } +struct ExpandTester { + OperandInfo input; + OperandInfo output; + bool expected; + + void Test() { + // Build the graph with mojo type. + GraphInfoBuilder builder; + uint64_t input_operand_id = + builder.BuildInput("input", input.dimensions, input.type); + uint64_t output_operand_id = + builder.BuildOutput("output", output.dimensions, output.type); + builder.BuildExpand(input_operand_id, output_operand_id); + + EXPECT_EQ(WebNNGraphImpl::ValidateGraph(builder.GetGraphInfo()), expected); + } +}; + +TEST_F(WebNNGraphImplTest, ExpandTest) { + { + // Test building expand with the output shapes that are the same as input. + ExpandTester{.input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2, 6}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2, 6}}, + .expected = true} + .Test(); + } + { + // Test building expand with the output shapes that are broadcastable. + ExpandTester{.input = {.type = mojom::Operand::DataType::kInt32, + .dimensions = {3, 1, 5}}, + .output = {.type = mojom::Operand::DataType::kInt32, + .dimensions = {3, 4, 5}}, + .expected = true} + .Test(); + } + { + // Test building expand with the output shapes that are broadcastable and the + // number of output shapes larger than input. + ExpandTester{.input = {.type = mojom::Operand::DataType::kInt32, + .dimensions = {2, 5}}, + .output = {.type = mojom::Operand::DataType::kInt32, + .dimensions = {3, 2, 5}}, + .expected = true} + .Test(); + } + { + // Test the invalid graph when the input shapes are not the same as output + // shape and not broadcastable. + ExpandTester{.input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {3, 6, 2}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {4, 3, 5}}, + .expected = false} + .Test(); + } + { + // Test the invalid graph when the input shapes are not broadcastable. + ExpandTester{ + .input = {.type = mojom::Operand::DataType::kInt32, .dimensions = {5}}, + .output = {.type = mojom::Operand::DataType::kInt32, + .dimensions = {5, 4}}, + .expected = false} + .Test(); + } + { + // Test the invalid graph for output data types which don't match. + ExpandTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .output = {.type = mojom::Operand::DataType::kInt32, .dimensions = {2}}, + .expected = false} + .Test(); + } + { + // Test the invalid graph when the input is as same as output. + GraphInfoBuilder builder; + uint64_t input_operand_id = + builder.BuildInput("input", {2}, mojom::Operand::DataType::kFloat32); + builder.BuildExpand(input_operand_id, input_operand_id); + EXPECT_FALSE(WebNNGraphImpl::ValidateGraph(builder.GetGraphInfo())); + } +} + struct GemmTester { OperandInfo a; OperandInfo b;
diff --git a/services/webnn/webnn_test_utils.cc b/services/webnn/webnn_test_utils.cc index b08d321..b773097c 100644 --- a/services/webnn/webnn_test_utils.cc +++ b/services/webnn/webnn_test_utils.cc
@@ -169,6 +169,12 @@ mojom::Operation::NewElementWiseBinary(std::move(binary))); } +void GraphInfoBuilder::BuildExpand(uint64_t input_operand_id, + uint64_t output_operand_id) { + graph_info_->operations.push_back(mojom::Operation::NewExpand( + mojom::Expand::New(input_operand_id, output_operand_id))); +} + void GraphInfoBuilder::BuildMatmul(uint64_t a_operand_id, uint64_t b_operand_id, uint64_t output_operand_id) {
diff --git a/services/webnn/webnn_test_utils.h b/services/webnn/webnn_test_utils.h index d5d1b79..30e2d0f 100644 --- a/services/webnn/webnn_test_utils.h +++ b/services/webnn/webnn_test_utils.h
@@ -151,6 +151,8 @@ uint64_t input_operand, uint64_t output_operand); + void BuildExpand(uint64_t input_operand_id, uint64_t output_operand_id); + // A `GemmAttributes` type should have the following members: // struct GemmAttributes { // absl::optional<uint64_t> c_operand_id,
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index c5215a5a..9ee03511 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -6093,9 +6093,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6138.0", + "description": "Run with ash-chrome version 121.0.6139.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6105,8 +6105,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6138.0", - "revision": "version:121.0.6138.0" + "location": "lacros_version_skew_tests_v121.0.6139.0", + "revision": "version:121.0.6139.0" } ], "dimensions": { @@ -6243,9 +6243,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6138.0", + "description": "Run with ash-chrome version 121.0.6139.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6255,8 +6255,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6138.0", - "revision": "version:121.0.6138.0" + "location": "lacros_version_skew_tests_v121.0.6139.0", + "revision": "version:121.0.6139.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.coverage.json b/testing/buildbot/chromium.coverage.json index 1a7830a..9e24017e 100644 --- a/testing/buildbot/chromium.coverage.json +++ b/testing/buildbot/chromium.coverage.json
@@ -20442,9 +20442,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6138.0", + "description": "Run with ash-chrome version 121.0.6139.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -20454,8 +20454,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6138.0", - "revision": "version:121.0.6138.0" + "location": "lacros_version_skew_tests_v121.0.6139.0", + "revision": "version:121.0.6139.0" } ], "dimensions": { @@ -20592,9 +20592,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6138.0", + "description": "Run with ash-chrome version 121.0.6139.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -20604,8 +20604,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6138.0", - "revision": "version:121.0.6138.0" + "location": "lacros_version_skew_tests_v121.0.6139.0", + "revision": "version:121.0.6139.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index d4b2ff4a..da4c642 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -43635,9 +43635,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6138.0", + "description": "Run with ash-chrome version 121.0.6139.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43646,8 +43646,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6138.0", - "revision": "version:121.0.6138.0" + "location": "lacros_version_skew_tests_v121.0.6139.0", + "revision": "version:121.0.6139.0" } ], "dimensions": { @@ -43785,9 +43785,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6138.0", + "description": "Run with ash-chrome version 121.0.6139.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43796,8 +43796,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6138.0", - "revision": "version:121.0.6138.0" + "location": "lacros_version_skew_tests_v121.0.6139.0", + "revision": "version:121.0.6139.0" } ], "dimensions": { @@ -45094,9 +45094,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6138.0", + "description": "Run with ash-chrome version 121.0.6139.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45105,8 +45105,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6138.0", - "revision": "version:121.0.6138.0" + "location": "lacros_version_skew_tests_v121.0.6139.0", + "revision": "version:121.0.6139.0" } ], "dimensions": { @@ -45244,9 +45244,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6138.0", + "description": "Run with ash-chrome version 121.0.6139.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45255,8 +45255,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6138.0", - "revision": "version:121.0.6138.0" + "location": "lacros_version_skew_tests_v121.0.6139.0", + "revision": "version:121.0.6139.0" } ], "dimensions": { @@ -45939,9 +45939,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6138.0", + "description": "Run with ash-chrome version 121.0.6139.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45950,8 +45950,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6138.0", - "revision": "version:121.0.6138.0" + "location": "lacros_version_skew_tests_v121.0.6139.0", + "revision": "version:121.0.6139.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index 866f7f5..4bcf8c1c 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -16151,12 +16151,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 121.0.6138.0", + "description": "Run with ash-chrome version 121.0.6139.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16166,8 +16166,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6138.0", - "revision": "version:121.0.6138.0" + "location": "lacros_version_skew_tests_v121.0.6139.0", + "revision": "version:121.0.6139.0" } ], "dimensions": { @@ -16321,12 +16321,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 121.0.6138.0", + "description": "Run with ash-chrome version 121.0.6139.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16336,8 +16336,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6138.0", - "revision": "version:121.0.6138.0" + "location": "lacros_version_skew_tests_v121.0.6139.0", + "revision": "version:121.0.6139.0" } ], "dimensions": {
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 75e4cfc..c1ce6511 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -70,16 +70,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 121.0.6138.0', + 'description': 'Run with ash-chrome version 121.0.6139.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6138.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6139.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v121.0.6138.0', - 'revision': 'version:121.0.6138.0', + 'location': 'lacros_version_skew_tests_v121.0.6139.0', + 'revision': 'version:121.0.6139.0', }, ], },
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 646dcf7..fc139dbd 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -2296,6 +2296,28 @@ ] } ], + "BackgroundResourceFetch": [ + { + "platforms": [ + "android", + "android_webview", + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "BackgroundResourceFetch", + "ReduceTransferSizeUpdatedIPC" + ] + } + ] + } + ], "BackgroundTabLoadingFromPerformanceManager": [ { "platforms": [ @@ -7754,6 +7776,8 @@ { "name": "Enabled_20231030", "params": { + "enabled_for_googlers": "true", + "histogram_name": "ChromeOS.HaTS.BluetoothAudio", "prob": "0.05", "survey_cycle_length": "7", "survey_start_date_ms": "1698332400000", @@ -14453,27 +14477,6 @@ ] } ], - "ReduceTransferSizeUpdatedIPC": [ - { - "platforms": [ - "android", - "android_webview", - "chromeos", - "chromeos_lacros", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabeld", - "enable_features": [ - "ReduceTransferSizeUpdatedIPC" - ] - } - ] - } - ], "RemoveDataUrlInSvgUse": [ { "platforms": [
diff --git a/third_party/blink/public/devtools_protocol/browser_protocol.pdl b/third_party/blink/public/devtools_protocol/browser_protocol.pdl index 318a374..44f117a 100644 --- a/third_party/blink/public/devtools_protocol/browser_protocol.pdl +++ b/third_party/blink/public/devtools_protocol/browser_protocol.pdl
@@ -5679,6 +5679,10 @@ # This value is used when the reason is unknown. unspecifiedReason + experimental type ServiceWorkerRouterInfo extends object + properties + integer ruleIdMatched + # HTTP response data. type Response extends object properties @@ -5712,6 +5716,8 @@ optional boolean fromServiceWorker # Specifies that the request was served from the prefetch cache. optional boolean fromPrefetchCache + # Infomation about how Service Worker Static Router was used. + experimental optional ServiceWorkerRouterInfo serviceWorkerRouterInfo # Total number of bytes received for this request so far. number encodedDataLength # Timing information for the given request.
diff --git a/third_party/blink/public/platform/web_url_response.h b/third_party/blink/public/platform/web_url_response.h index f5173c6..f62ef0cd 100644 --- a/third_party/blink/public/platform/web_url_response.h +++ b/third_party/blink/public/platform/web_url_response.h
@@ -56,6 +56,7 @@ enum class PrivateNetworkAccessPreflightResult; class URLResponseHead; class LoadTimingInfo; +class ServiceWorkerRouterInfo; } // namespace mojom } // namespace network @@ -184,6 +185,10 @@ network::mojom::FetchResponseSource GetServiceWorkerResponseSource() const; void SetServiceWorkerResponseSource(network::mojom::FetchResponseSource); + // See network.mojom.URLResponseHead.static_routing_info. + void SetServiceWorkerRouterInfo( + const network::mojom::ServiceWorkerRouterInfo&); + // Flag whether a shared dictionary was used to decompress the response body. void SetDidUseSharedDictionary(bool);
diff --git a/third_party/blink/renderer/bindings/generated_in_modules.gni b/third_party/blink/renderer/bindings/generated_in_modules.gni index acd4a9ad..3812937 100644 --- a/third_party/blink/renderer/bindings/generated_in_modules.gni +++ b/third_party/blink/renderer/bindings/generated_in_modules.gni
@@ -732,6 +732,8 @@ "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_compute_result.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_context_options.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_context_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_batch_normalization_options.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_batch_normalization_options.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_2d_options.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_2d_options.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_transpose_2d_options.cc",
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5 index 572aba5..645a70fc 100644 --- a/third_party/blink/renderer/core/css/css_properties.json5 +++ b/third_party/blink/renderer/core/css/css_properties.json5
@@ -6937,6 +6937,7 @@ "y-start", "y-end", "start", "end", "self-start", "self-end", "all" ], typedom_types: ["Keyword"], + valid_for_position_fallback: true, runtime_flag: "CSSAnchorPositioning", },
diff --git a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc index 1f23f15..9b17a6c 100644 --- a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc +++ b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
@@ -1126,13 +1126,16 @@ void LocalFrameMojoHandler::GetOpenGraphMetadata( GetOpenGraphMetadataCallback callback) { auto metadata = mojom::blink::OpenGraphMetadata::New(); - for (const auto& child : Traversal<HTMLMetaElement>::DescendantsOf( - *frame_->GetDocument()->documentElement())) { - // If there are multiple OpenGraph tags for the same property, we always - // take the value from the first one - this is the specified behavior in - // the OpenGraph spec: - // The first tag (from top to bottom) is given preference during conflicts - ParseOpenGraphProperty(child, *frame_->GetDocument(), metadata.get()); + if (auto* document_element = frame_->GetDocument()->documentElement()) { + for (const auto& child : + Traversal<HTMLMetaElement>::DescendantsOf(*document_element)) { + // If there are multiple OpenGraph tags for the same property, we always + // take the value from the first one - this is the specified behavior in + // the OpenGraph spec: + // The first tag (from top to bottom) is given preference during + // conflicts + ParseOpenGraphProperty(child, *frame_->GetDocument(), metadata.get()); + } } std::move(callback).Run(std::move(metadata)); }
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index 31c862b..0828e74b 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -3276,10 +3276,10 @@ // largest relative overflow. float page_scale_factor; if (layout_view->StyleRef().IsHorizontalWritingMode()) { - page_scale_factor = - page.LayoutOverflow().Right().ToFloat() / page.Size().width.ToFloat(); + page_scale_factor = page.ScrollableOverflow().Right().ToFloat() / + page.Size().width.ToFloat(); } else { - page_scale_factor = page.LayoutOverflow().Bottom().ToFloat() / + page_scale_factor = page.ScrollableOverflow().Bottom().ToFloat() / page.Size().height.ToFloat(); } overall_scale_factor = std::max(overall_scale_factor, page_scale_factor);
diff --git a/third_party/blink/renderer/core/inspector/inspector_network_agent.cc b/third_party/blink/renderer/core/inspector/inspector_network_agent.cc index a2be223..bfabb7e 100644 --- a/third_party/blink/renderer/core/inspector/inspector_network_agent.cc +++ b/third_party/blink/renderer/core/inspector/inspector_network_agent.cc
@@ -67,6 +67,7 @@ #include "third_party/blink/renderer/core/inspector/identifiers_factory.h" #include "third_party/blink/renderer/core/inspector/inspected_frames.h" #include "third_party/blink/renderer/core/inspector/network_resources_data.h" +#include "third_party/blink/renderer/core/inspector/protocol/network.h" #include "third_party/blink/renderer/core/inspector/request_debug_header_scope.h" #include "third_party/blink/renderer/core/loader/document_loader.h" #include "third_party/blink/renderer/core/loader/frame_loader.h" @@ -89,6 +90,7 @@ #include "third_party/blink/renderer/platform/loader/fetch/resource_load_timing.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_request.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_response.h" +#include "third_party/blink/renderer/platform/loader/fetch/service_worker_router_info.h" #include "third_party/blink/renderer/platform/loader/fetch/unique_identifier.h" #include "third_party/blink/renderer/platform/loader/fetch/url_loader/url_loader_client.h" #include "third_party/blink/renderer/platform/network/http_header_map.h" @@ -1061,6 +1063,13 @@ if (!response.CacheStorageCacheName().empty()) { response_object->setCacheStorageCacheName(response.CacheStorageCacheName()); } + if (response.GetServiceWorkerRouterInfo()) { + response_object->setServiceWorkerRouterInfo( + protocol::Network::ServiceWorkerRouterInfo::create() + .setRuleIdMatched( + response.GetServiceWorkerRouterInfo()->RuleIdMatched()) + .build()); + } response_object->setFromPrefetchCache(response.WasInPrefetchCache()); if (response.GetResourceLoadTiming())
diff --git a/third_party/blink/renderer/core/inspector/inspector_trace_events.cc b/third_party/blink/renderer/core/inspector/inspector_trace_events.cc index 4ff9fc1..08b922778 100644 --- a/third_party/blink/renderer/core/inspector/inspector_trace_events.cc +++ b/third_party/blink/renderer/core/inspector/inspector_trace_events.cc
@@ -43,6 +43,7 @@ #include "third_party/blink/renderer/platform/loader/fetch/resource_load_timing.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_request.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_response.h" +#include "third_party/blink/renderer/platform/loader/fetch/service_worker_router_info.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" #include "third_party/blink/renderer/platform/wtf/dynamic_annotations.h" #include "third_party/blink/renderer/platform/wtf/text/text_position.h" @@ -947,7 +948,6 @@ dict.Add("serviceWorkerResponseSource", "fallbackCode"); } } - if (!response.ResponseTime().is_null()) { dict.Add("responseTime", response.ResponseTime().InMillisecondsFSinceUnixEpoch()); @@ -955,12 +955,17 @@ if (!response.CacheStorageCacheName().empty()) { dict.Add("cacheStorageCacheName", response.CacheStorageCacheName()); } - if (response.GetResourceLoadTiming()) { RecordTiming(dict.AddItem("timing"), *response.GetResourceLoadTiming()); } - if (response.WasFetchedViaServiceWorker()) + if (response.WasFetchedViaServiceWorker()) { dict.Add("fromServiceWorker", true); + } + if (response.GetServiceWorkerRouterInfo()) { + auto info = dict.AddDictionary("staticRoutingInfo"); + info.Add("ruleIdMatched", + response.GetServiceWorkerRouterInfo()->RuleIdMatched()); + } } void inspector_receive_data_event::Data(perfetto::TracedValue context,
diff --git a/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.cc b/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.cc index 1defaba..85805d4 100644 --- a/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.cc +++ b/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.cc
@@ -97,7 +97,7 @@ } // namespace -PhysicalRect PhysicalLineBoxFragment::ScrollableOverflow( +PhysicalRect PhysicalLineBoxFragment::ComputeRubyEmHeightBox( const NGPhysicalBoxFragment& container, const ComputedStyle& container_style, TextHeightType height_type) const { @@ -109,7 +109,7 @@ return overflow; } -PhysicalRect PhysicalLineBoxFragment::ScrollableOverflowForLine( +PhysicalRect PhysicalLineBoxFragment::ComputeRubyEmHeightBoxForLine( const NGPhysicalBoxFragment& container, const ComputedStyle& container_style, const FragmentItem& line,
diff --git a/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h b/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h index 5223f5c..cc01fc3 100644 --- a/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h +++ b/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h
@@ -61,18 +61,19 @@ // Compute the baseline metrics for this linebox. FontHeight BaselineMetrics() const; - // Scrollable overflow. including contents, in the local coordinate. - // |ScrollableOverflow| is not precomputed/cached because it cannot be + // Em height box. including contents, in the local coordinate. + // |ComputeRubyEmHeightBox| is not precomputed/cached because it cannot be // computed when LineBox is generated because it needs container dimensions // to resolve relative position of its children. - PhysicalRect ScrollableOverflow(const NGPhysicalBoxFragment& container, - const ComputedStyle& container_style, - TextHeightType height_type) const; - PhysicalRect ScrollableOverflowForLine(const NGPhysicalBoxFragment& container, - const ComputedStyle& container_style, - const FragmentItem& line, - const InlineCursor& cursor, - TextHeightType height_type) const; + PhysicalRect ComputeRubyEmHeightBox(const NGPhysicalBoxFragment& container, + const ComputedStyle& container_style, + TextHeightType height_type) const; + PhysicalRect ComputeRubyEmHeightBoxForLine( + const NGPhysicalBoxFragment& container, + const ComputedStyle& container_style, + const FragmentItem& line, + const InlineCursor& cursor, + TextHeightType height_type) const; // Whether the content soft-wraps to the next line. bool HasSoftWrapToNextLine() const;
diff --git a/third_party/blink/renderer/core/layout/inline/ruby_utils.cc b/third_party/blink/renderer/core/layout/inline/ruby_utils.cc index 3ed75c8a..8ed4e71 100644 --- a/third_party/blink/renderer/core/layout/inline/ruby_utils.cc +++ b/third_party/blink/renderer/core/layout/inline/ruby_utils.cc
@@ -261,7 +261,7 @@ const auto* fragment = item.PhysicalFragment(); if (fragment && fragment->IsRubyColumn()) { PhysicalRect rect = - To<NGPhysicalBoxFragment>(fragment)->ScrollableOverflow( + To<NGPhysicalBoxFragment>(fragment)->ComputeRubyEmHeightBox( NGPhysicalFragment::kEmHeight); LayoutUnit block_size; if (IsHorizontalWritingMode(line_style.GetWritingMode())) {
diff --git a/third_party/blink/renderer/core/layout/layout_box.cc b/third_party/blink/renderer/core/layout/layout_box.cc index b156119..4995e75 100644 --- a/third_party/blink/renderer/core/layout/layout_box.cc +++ b/third_party/blink/renderer/core/layout/layout_box.cc
@@ -3299,7 +3299,7 @@ break; } - PhysicalRect fragment_layout_overflow = fragment.LayoutOverflow(); + PhysicalRect fragment_layout_overflow = fragment.ScrollableOverflow(); fragment_layout_overflow.offset += offset_adjust; // If we are the first fragment just set the layout-overflow. @@ -3361,16 +3361,16 @@ // Recalculate our layout-overflow if a child had its layout-overflow // changed, or if we are marked as dirty. if (should_recalculate_layout_overflow) { - const PhysicalRect old_layout_overflow = fragment.LayoutOverflow(); + const PhysicalRect old_layout_overflow = fragment.ScrollableOverflow(); const bool has_block_fragmentation = layout_result->GetConstraintSpaceForCaching() .HasBlockFragmentation(); #if DCHECK_IS_ON() NGPhysicalBoxFragment::AllowPostLayoutScope allow_post_layout_scope; #endif - const PhysicalRect new_layout_overflow = - NGLayoutOverflowCalculator::RecalculateLayoutOverflowForFragment( - fragment, has_block_fragmentation); + const PhysicalRect new_layout_overflow = ScrollableOverflowCalculator:: + RecalculateScrollableOverflowForFragment(fragment, + has_block_fragmentation); // Set the appropriate flags if the layout-overflow changed. if (old_layout_overflow != new_layout_overflow) { @@ -3381,7 +3381,8 @@ } if (layout_overflow) { - fragment.GetMutableForStyleRecalc().SetLayoutOverflow(*layout_overflow); + fragment.GetMutableForStyleRecalc().SetScrollableOverflow( + *layout_overflow); } } SetLayoutOverflowFromLayoutResults();
diff --git a/third_party/blink/renderer/core/layout/layout_text_combine.h b/third_party/blink/renderer/core/layout/layout_text_combine.h index ac5a4d4..08c0c29 100644 --- a/third_party/blink/renderer/core/layout/layout_text_combine.h +++ b/third_party/blink/renderer/core/layout/layout_text_combine.h
@@ -58,7 +58,7 @@ // * |LayoutText::PhysicalLinesBoundingBox()| used by // |LayoutObject::DebugRect()|, intersection observer, and scroll anchor. // * |FragmentItem::RecalcInkOverflow()| for line box - // * |NGLayoutOverflowCalculator::AddItemsInternal()| for line box. + // * |ScrollableOverflowCalculator::AddItemsInternal()| for line box. // * |NGPhysicalFragment::AddOutlineRectsForCursor()| // * |NGPhysicalFragment::AddScrollableOverflowForInlineChild()| PhysicalRect AdjustRectForBoundingBox(const PhysicalRect& rect) const;
diff --git a/third_party/blink/renderer/core/layout/layout_text_combine_test.cc b/third_party/blink/renderer/core/layout/layout_text_combine_test.cc index e04233d5..3f2f326 100644 --- a/third_party/blink/renderer/core/layout/layout_text_combine_test.cc +++ b/third_party/blink/renderer/core/layout/layout_text_combine_test.cc
@@ -569,18 +569,18 @@ const auto& sample1 = *To<LayoutBlockFlow>(GetLayoutObjectByElementId("t1")); ASSERT_EQ(sample1.PhysicalFragmentCount(), 1u); const auto& sample_fragment1 = *sample1.GetPhysicalFragment(0); - EXPECT_FALSE(sample_fragment1.HasLayoutOverflow()); + EXPECT_FALSE(sample_fragment1.HasScrollableOverflow()); EXPECT_EQ(PhysicalSize(150, 200), sample_fragment1.Size()); EXPECT_EQ(PhysicalRect(PhysicalOffset(), PhysicalSize(150, 200)), - sample_fragment1.LayoutOverflow()); + sample_fragment1.ScrollableOverflow()); const auto& sample2 = *To<LayoutBlockFlow>(GetLayoutObjectByElementId("t2")); ASSERT_EQ(sample2.PhysicalFragmentCount(), 1u); const auto& sample_fragment2 = *sample2.GetPhysicalFragment(0); - EXPECT_FALSE(sample_fragment2.HasLayoutOverflow()); + EXPECT_FALSE(sample_fragment2.HasScrollableOverflow()); EXPECT_EQ(PhysicalSize(150, 200), sample_fragment2.Size()); EXPECT_EQ(PhysicalRect(PhysicalOffset(), PhysicalSize(150, 200)), - sample_fragment2.LayoutOverflow()); + sample_fragment2.ScrollableOverflow()); } // http://crbug.com/1223015
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc index 213ce75..940e852a 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc
@@ -3268,7 +3268,7 @@ const NGPhysicalBoxFragment& ruby_text_fragment = To<NGPhysicalBoxFragment>(result->PhysicalFragment()); const LogicalRect ruby_text_box = ruby_text_fragment.ConvertChildToLogical( - ruby_text_fragment.ScrollableOverflow(NGPhysicalFragment::kEmHeight)); + ruby_text_fragment.ComputeRubyEmHeightBox(NGPhysicalFragment::kEmHeight)); // Find the ruby-base fragment. const NGPhysicalBoxFragment* ruby_base_fragment = nullptr; @@ -3291,12 +3291,12 @@ // Get the top of the text in the ruby-base. LayoutUnit first_line_top; if (ruby_base_fragment) { - first_line_top = - ruby_base_block_offset + - ruby_base_fragment - ->ConvertChildToLogical(ruby_base_fragment->ScrollableOverflow( - NGPhysicalFragment::kEmHeight)) - .offset.block_offset; + first_line_top = ruby_base_block_offset + + ruby_base_fragment + ->ConvertChildToLogical( + ruby_base_fragment->ComputeRubyEmHeightBox( + NGPhysicalFragment::kEmHeight)) + .offset.block_offset; } ruby_text_box_top = first_line_top - last_line_ruby_text_bottom; const LayoutUnit ruby_text_top = @@ -3314,12 +3314,12 @@ ruby_base_fragment->Size() .ConvertToLogical(Style().GetWritingMode()) .block_size; - last_line_bottom = - ruby_base_block_offset + - ruby_base_fragment - ->ConvertChildToLogical(ruby_base_fragment->ScrollableOverflow( - NGPhysicalFragment::kEmHeight)) - .BlockEndOffset(); + last_line_bottom = ruby_base_block_offset + + ruby_base_fragment + ->ConvertChildToLogical( + ruby_base_fragment->ComputeRubyEmHeightBox( + NGPhysicalFragment::kEmHeight)) + .BlockEndOffset(); base_logical_bottom = ruby_base_block_offset + base_block_size; } ruby_text_box_top = last_line_bottom - first_line_ruby_text_top;
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_node.h b/third_party/blink/renderer/core/layout/ng/ng_block_node.h index 34aeb1be..4da0f13 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_node.h +++ b/third_party/blink/renderer/core/layout/ng/ng_block_node.h
@@ -152,7 +152,7 @@ // Returns the aspect ratio of a replaced element. LogicalSize GetAspectRatio() const; - // Returns the transform to apply to a child (e.g. for layout-overflow). + // Returns the transform to apply to a child (e.g. for scrollable-overflow). absl::optional<gfx::Transform> GetTransformForChildFragment( const NGPhysicalBoxFragment& child_fragment, PhysicalSize size) const;
diff --git a/third_party/blink/renderer/core/layout/ng/ng_box_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_box_fragment.cc index 78a6eb1..3de0c54 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_box_fragment.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_box_fragment.cc
@@ -65,10 +65,10 @@ return FontHeight(block_size - block_size / 2, block_size / 2); } -LayoutUnit LogicalBoxFragment::BlockEndLayoutOverflow() const { +LayoutUnit LogicalBoxFragment::BlockEndScrollableOverflow() const { WritingModeConverter converter(writing_direction_, physical_fragment_.Size()); LogicalRect overflow = - converter.ToLogical(PhysicalBoxFragment().LayoutOverflow()); + converter.ToLogical(PhysicalBoxFragment().ScrollableOverflow()); return overflow.BlockEndOffset(); }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_box_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_box_fragment.h index 24a555f..48a0952d 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_box_fragment.h +++ b/third_party/blink/renderer/core/layout/ng/ng_box_fragment.h
@@ -93,7 +93,7 @@ return PhysicalBoxFragment().HasDescendantsForTablePart(); } - LayoutUnit BlockEndLayoutOverflow() const; + LayoutUnit BlockEndScrollableOverflow() const; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc b/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc index 5fba012c..1b155123 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc
@@ -203,7 +203,7 @@ // If we are a scroll container, we need to track the maximum bounds of // any inflow children (including line-boxes) to calculate the - // layout-overflow. + // scrollable-overflow. // // This is used for determining the "padding-box" of the scroll container // which is *sometimes* considered as part of the scrollable area. Inflow @@ -211,7 +211,7 @@ // don't. // // Out-of-flow positioned children still contribute to the - // layout-overflow, but just don't influence where this padding is. + // scrollable-overflow, but just don't influence where this padding is. if (Node().IsScrollContainer() && !IsFragmentainerBoxType() && !child.IsOutOfFlowPositioned()) { BoxStrut margins; @@ -398,7 +398,7 @@ LogicalBoxFragment logical_fragment( child_box_fragment->Style().GetWritingDirection(), *child_box_fragment); - block_size = logical_fragment.BlockEndLayoutOverflow(); + block_size = logical_fragment.BlockEndScrollableOverflow(); } else { LogicalFragment logical_fragment( child_fragment.Style().GetWritingDirection(), child_fragment);
diff --git a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc index ec220a25d..4bfc923 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc
@@ -829,7 +829,7 @@ LayoutUnit block_end_overflow = LogicalBoxFragment(GetConstraintSpace().GetWritingDirection(), column) - .BlockEndLayoutOverflow(); + .BlockEndScrollableOverflow(); if (row_offset + block_end_overflow > FragmentainerSpaceLeft(GetConstraintSpace())) { if (GetConstraintSpace().IsInsideBalancedColumns() &&
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.cc index c0a6455..07cb193 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.cc
@@ -271,7 +271,7 @@ // other words, we would still want to clamp a zero height fragmentainer if // it had content with zero inline size and non-zero block size. This would // likely require us to store an extra flag on NGPhysicalBoxFragment. - if (fragmentainer.HasLayoutOverflow()) { + if (fragmentainer.HasScrollableOverflow()) { // Don't clamp the fragmentainer to a block size of 1 if it is truly a // zero-height column. logical_size.block_size =
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.cc b/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.cc index a5ce9ce..0fbe94e 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.cc
@@ -21,7 +21,8 @@ namespace blink { // static -PhysicalRect NGLayoutOverflowCalculator::RecalculateLayoutOverflowForFragment( +PhysicalRect +ScrollableOverflowCalculator::RecalculateScrollableOverflowForFragment( const NGPhysicalBoxFragment& fragment, bool has_block_fragmentation) { const BlockNode node(const_cast<LayoutBox*>( @@ -39,7 +40,7 @@ writing_direction); } - NGLayoutOverflowCalculator calculator( + ScrollableOverflowCalculator calculator( node, fragment.IsCSSBox(), has_block_fragmentation, fragment.Borders(), scrollbar, fragment.Padding(), fragment.Size(), writing_direction); @@ -54,10 +55,11 @@ continue; if (box_fragment->IsFragmentainerBox()) { - // When this function is called nothing has updated the layout-overflow - // of any fragmentainers (as they are not directly associated with a - // layout-object). Recalculate their layout-overflow directly. - PhysicalRect child_overflow = RecalculateLayoutOverflowForFragment( + // When this function is called nothing has updated the + // scrollable-overflow of any fragmentainers (as they are not directly + // associated with a layout-object). Recalculate their scrollable-overflow + // directly. + PhysicalRect child_overflow = RecalculateScrollableOverflowForFragment( *box_fragment, has_block_fragmentation); child_overflow.offset += child.offset; calculator.AddOverflow(child_overflow, /* child_is_fragmentainer */ true); @@ -72,7 +74,7 @@ return calculator.Result(fragment.InflowBounds()); } -NGLayoutOverflowCalculator::NGLayoutOverflowCalculator( +ScrollableOverflowCalculator::ScrollableOverflowCalculator( const BlockNode& node, bool is_css_box, bool has_block_fragmentation, @@ -100,13 +102,13 @@ .ClampNegativeToZero(), (size_.height - border_scrollbar.VerticalSum()) .ClampNegativeToZero())}; - layout_overflow_ = padding_rect_; + scrollable_overflow_ = padding_rect_; } -const PhysicalRect NGLayoutOverflowCalculator::Result( +const PhysicalRect ScrollableOverflowCalculator::Result( const absl::optional<PhysicalRect> inflow_bounds) { if (!inflow_bounds || !is_scroll_container_) - return layout_overflow_; + return scrollable_overflow_; PhysicalOffset start_offset = inflow_bounds->MinXMinYCorner() - PhysicalOffset(padding_.left, padding_.top); @@ -118,23 +120,23 @@ end_offset.top - start_offset.top)}; inflow_overflow = AdjustOverflowForScrollOrigin(inflow_overflow); - layout_overflow_.UniteEvenIfEmpty(inflow_overflow); - return layout_overflow_; + scrollable_overflow_.UniteEvenIfEmpty(inflow_overflow); + return scrollable_overflow_; } -void NGLayoutOverflowCalculator::AddTableSelfRect() { +void ScrollableOverflowCalculator::AddTableSelfRect() { AddOverflow({PhysicalOffset(), size_}); } template <typename Items> -void NGLayoutOverflowCalculator::AddItemsInternal( +void ScrollableOverflowCalculator::AddItemsInternal( const LayoutObject* layout_object, const Items& items) { bool has_hanging = false; PhysicalRect line_rect; - // |LayoutNGTextCombine| doesn't not cause layout overflow because combined - // text fits in 1em by using width variant font or scaling. + // |LayoutNGTextCombine| doesn't not cause scrollable overflow because + // combined text fits in 1em by using width variant font or scaling. if (UNLIKELY(IsA<LayoutTextCombine>(layout_object))) { return; } @@ -147,7 +149,7 @@ if (line_rect.IsEmpty()) continue; - layout_overflow_.UniteEvenIfEmpty(line_rect); + scrollable_overflow_.UniteEvenIfEmpty(line_rect); continue; } @@ -165,7 +167,7 @@ if (const auto* child_box_fragment = item->BoxFragment()) { // Use the default box-fragment overflow logic. PhysicalRect child_overflow = - LayoutOverflowForPropagation(*child_box_fragment); + ScrollableOverflowForPropagation(*child_box_fragment); child_overflow.offset += item->OffsetInContainerFragment(); // Only inline-boxes (not atomic-inlines) should be adjusted if the @@ -179,19 +181,19 @@ } } -void NGLayoutOverflowCalculator::AddItems( +void ScrollableOverflowCalculator::AddItems( const LayoutObject* layout_object, const FragmentItemsBuilder::ItemWithOffsetList& items) { AddItemsInternal(layout_object, items); } -void NGLayoutOverflowCalculator::AddItems( +void ScrollableOverflowCalculator::AddItems( const NGPhysicalBoxFragment& box_fragment, const FragmentItems& items) { AddItemsInternal(box_fragment.GetLayoutObject(), items.Items()); } -PhysicalRect NGLayoutOverflowCalculator::AdjustOverflowForHanging( +PhysicalRect ScrollableOverflowCalculator::AdjustOverflowForHanging( const PhysicalRect& line_rect, PhysicalRect overflow) { if (writing_direction_.IsHorizontal()) { @@ -209,7 +211,7 @@ return overflow; } -PhysicalRect NGLayoutOverflowCalculator::AdjustOverflowForScrollOrigin( +PhysicalRect ScrollableOverflowCalculator::AdjustOverflowForScrollOrigin( const PhysicalRect& overflow) { LayoutUnit left_offset = has_left_overflow_ @@ -234,25 +236,25 @@ PhysicalSize(right_offset - left_offset, bottom_offset - top_offset)}; } -PhysicalRect NGLayoutOverflowCalculator::LayoutOverflowForPropagation( +PhysicalRect ScrollableOverflowCalculator::ScrollableOverflowForPropagation( const NGPhysicalBoxFragment& child_fragment) { - // If the fragment is anonymous, just return its layout-overflow (don't apply - // any incorrect transforms, etc). + // If the fragment is anonymous, just return its scrollable-overflow (don't + // apply any incorrect transforms, etc). if (!child_fragment.IsCSSBox()) - return child_fragment.LayoutOverflow(); + return child_fragment.ScrollableOverflow(); PhysicalRect overflow = {{}, child_fragment.Size()}; // Collapsed table rows/sections set IsHiddenForPaint flag. - bool ignore_layout_overflow = + bool ignore_scrollable_overflow = child_fragment.ShouldApplyLayoutContainment() || child_fragment.IsInlineBox() || (child_fragment.ShouldClipOverflowAlongBothAxis() && !child_fragment.ShouldApplyOverflowClipMargin()) || child_fragment.IsHiddenForPaint(); - if (!ignore_layout_overflow) { - PhysicalRect child_overflow = child_fragment.LayoutOverflow(); + if (!ignore_scrollable_overflow) { + PhysicalRect child_overflow = child_fragment.ScrollableOverflow(); if (child_fragment.HasNonVisibleOverflow()) { const OverflowClipAxes overflow_clip_axes = child_fragment.GetOverflowClipAxes();
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.h b/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.h index dc240cd0..6976f0c 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.h +++ b/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.h
@@ -15,41 +15,42 @@ namespace blink { -// This class contains the logic for correctly determining the layout-overflow -// (also known as scrollable-overflow) for a fragment. +// This class contains the logic for correctly determining the +// scrollable-overflow (also known as layout-overflow) for a fragment. // https://drafts.csswg.org/css-overflow-3/#scrollable -class CORE_EXPORT NGLayoutOverflowCalculator { +class CORE_EXPORT ScrollableOverflowCalculator { STACK_ALLOCATED(); public: - static PhysicalRect RecalculateLayoutOverflowForFragment( + static PhysicalRect RecalculateScrollableOverflowForFragment( const NGPhysicalBoxFragment&, bool has_block_fragmentation); - NGLayoutOverflowCalculator(const BlockNode&, - bool is_css_box, - bool has_block_fragmentation, - const PhysicalBoxStrut& borders, - const PhysicalBoxStrut& scrollbar, - const PhysicalBoxStrut& padding, - PhysicalSize size, - WritingDirectionMode); + ScrollableOverflowCalculator(const BlockNode&, + bool is_css_box, + bool has_block_fragmentation, + const PhysicalBoxStrut& borders, + const PhysicalBoxStrut& scrollbar, + const PhysicalBoxStrut& padding, + PhysicalSize size, + WritingDirectionMode); // Applies the final adjustments given the bounds of any inflow children - // (|inflow_bounds|), and returns the final layout-overflow. + // (|inflow_bounds|), and returns the final scrollable-overflow. const PhysicalRect Result(const absl::optional<PhysicalRect> inflow_bounds); - // Adds layout-overflow from |child_fragment|, at |offset|. + // Adds scrollable-overflow from |child_fragment|, at |offset|. void AddChild(const NGPhysicalBoxFragment& child_fragment, PhysicalOffset offset) { if (is_view_ && child_fragment.IsFixedPositioned()) return; - PhysicalRect child_overflow = LayoutOverflowForPropagation(child_fragment); + PhysicalRect child_overflow = + ScrollableOverflowForPropagation(child_fragment); child_overflow.offset += offset; AddOverflow(child_overflow, child_fragment.IsFragmentainerBox()); } - // Adds layout-overflow from fragment-items. + // Adds scrollable-overflow from fragment-items. void AddItems(const NGPhysicalBoxFragment&, const FragmentItems&); void AddItems(const LayoutObject*, const FragmentItemsBuilder::ItemWithOffsetList&); @@ -64,7 +65,7 @@ PhysicalRect overflow); PhysicalRect AdjustOverflowForScrollOrigin(const PhysicalRect& overflow); - PhysicalRect LayoutOverflowForPropagation( + PhysicalRect ScrollableOverflowForPropagation( const NGPhysicalBoxFragment& child_fragment); void AddOverflow(PhysicalRect child_overflow, @@ -75,7 +76,7 @@ // A fragmentainer may result in an overflow, even if it is empty. For // example, an overflow as a result of a non-zero column gap. if (!child_overflow.IsEmpty() || child_is_fragmentainer) - layout_overflow_.UniteEvenIfEmpty(child_overflow); + scrollable_overflow_.UniteEvenIfEmpty(child_overflow); } const BlockNode node_; @@ -91,7 +92,7 @@ const PhysicalSize size_; PhysicalRect padding_rect_; - PhysicalRect layout_overflow_; + PhysicalRect scrollable_overflow_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc index 4436234f..2678226 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc
@@ -150,12 +150,12 @@ DCHECK(builder->is_may_have_descendant_above_block_start_explicitly_set_); #endif - PhysicalRect layout_overflow = {PhysicalOffset(), physical_size}; + PhysicalRect scrollable_overflow = {PhysicalOffset(), physical_size}; if (builder->node_ && !builder->node_.IsReplaced()) { const PhysicalBoxStrut scrollbar = builder->initial_fragment_geometry_->scrollbar.ConvertToPhysical( writing_direction); - NGLayoutOverflowCalculator calculator( + ScrollableOverflowCalculator calculator( To<BlockNode>(builder->node_), /* is_css_box */ !builder->IsFragmentainerBoxType(), builder->GetConstraintSpace().HasBlockFragmentation(), borders, @@ -180,12 +180,13 @@ if (builder->table_collapsed_borders_) calculator.AddTableSelfRect(); - layout_overflow = calculator.Result(inflow_bounds); + scrollable_overflow = calculator.Result(inflow_bounds); } - // For the purposes of object allocation we have layout-overflow if it + // For the purposes of object allocation we have scrollable-overflow if it // differs from the fragment size. - bool has_layout_overflow = layout_overflow != PhysicalRect({}, physical_size); + bool has_scrollable_overflow = + scrollable_overflow != PhysicalRect({}, physical_size); // Omit |FragmentItems| if there were no items; e.g., display-lock. bool has_fragment_items = false; @@ -202,8 +203,8 @@ // The initialization of the array is done by NGPhysicalFragment; // we pass the buffer as a constructor argument. return MakeGarbageCollected<NGPhysicalBoxFragment>( - AdditionalBytes(byte_size), PassKey(), builder, has_layout_overflow, - layout_overflow, has_borders, borders, has_padding, padding, + AdditionalBytes(byte_size), PassKey(), builder, has_scrollable_overflow, + scrollable_overflow, has_borders, borders, has_padding, padding, inflow_bounds, has_fragment_items, block_or_line_writing_mode); } @@ -214,23 +215,23 @@ size_t byte_size = AdditionalByteSize(other.HasItems()); return MakeGarbageCollected<NGPhysicalBoxFragment>( - AdditionalBytes(byte_size), PassKey(), other, other.HasLayoutOverflow(), - other.LayoutOverflow()); + AdditionalBytes(byte_size), PassKey(), other, + other.HasScrollableOverflow(), other.ScrollableOverflow()); } // static const NGPhysicalBoxFragment* NGPhysicalBoxFragment::CloneWithPostLayoutFragments( const NGPhysicalBoxFragment& other) { - PhysicalRect layout_overflow = other.LayoutOverflow(); - bool has_layout_overflow = other.HasLayoutOverflow(); + PhysicalRect scrollable_overflow = other.ScrollableOverflow(); + bool has_scrollable_overflow = other.HasScrollableOverflow(); // The size of the new fragment shouldn't differ from the old one. size_t byte_size = AdditionalByteSize(other.HasItems()); const auto* cloned_fragment = MakeGarbageCollected<NGPhysicalBoxFragment>( - AdditionalBytes(byte_size), PassKey(), other, has_layout_overflow, - layout_overflow); + AdditionalBytes(byte_size), PassKey(), other, has_scrollable_overflow, + scrollable_overflow); // To ensure the fragment tree is consistent, use the post-layout fragment. #if DCHECK_IS_ON() @@ -294,8 +295,8 @@ NGPhysicalBoxFragment::NGPhysicalBoxFragment( PassKey key, NGBoxFragmentBuilder* builder, - bool has_layout_overflow, - const PhysicalRect& layout_overflow, + bool has_scrollable_overflow, + const PhysicalRect& scrollable_overflow, bool has_borders, const PhysicalBoxStrut& borders, bool has_padding, @@ -343,7 +344,7 @@ SetInkOverflowType(NGInkOverflow::Type::kNotSet); wtf_size_t rare_fields_size = - has_layout_overflow + !!builder->frame_set_layout_data_ + + has_scrollable_overflow + !!builder->frame_set_layout_data_ + !!builder->mathml_paint_info_ + !!builder->table_grid_rect_ + !!builder->table_collapsed_borders_ + !!builder->table_collapsed_borders_geometry_ + @@ -354,7 +355,7 @@ if (rare_fields_size > 0 || !builder->table_column_geometries_.empty()) { rare_data_ = MakeGarbageCollected<PhysicalFragmentRareData>( - has_layout_overflow ? &layout_overflow : nullptr, + has_scrollable_overflow ? &scrollable_overflow : nullptr, has_borders ? &borders : nullptr, has_padding ? &padding : nullptr, inflow_bounds, *builder, rare_fields_size); } @@ -404,8 +405,8 @@ NGPhysicalBoxFragment::NGPhysicalBoxFragment( PassKey key, const NGPhysicalBoxFragment& other, - bool has_layout_overflow, - const PhysicalRect& layout_overflow) + bool has_scrollable_overflow, + const PhysicalRect& scrollable_overflow) : NGPhysicalFragment(other), bit_field_(other.bit_field_), first_baseline_(other.first_baseline_), @@ -782,7 +783,7 @@ return true; } -PhysicalRect NGPhysicalBoxFragment::ScrollableOverflow( +PhysicalRect NGPhysicalBoxFragment::ComputeRubyEmHeightBox( TextHeightType height_type) const { DCHECK(GetLayoutObject()); // TODO(kojii): Scrollable overflow is computed after layout, and that the @@ -796,7 +797,7 @@ } const LayoutObject* layout_object = GetLayoutObject(); if (height_type == TextHeightType::kEmHeight && IsRubyBox()) { - return ScrollableOverflowFromChildren(height_type); + return ComputeRubyEmHeightBoxFromChildren(height_type); } if (const auto* layout_box = DynamicTo<LayoutBox>(layout_object)) { if (HasNonVisibleOverflow()) @@ -810,7 +811,8 @@ overflow = PhysicalRect({}, Size()); for (const auto& child_fragment : PostLayoutChildren()) { PhysicalRect child_overflow = - child_fragment->ScrollableOverflowForPropagation(*this, height_type); + child_fragment->ComputeRubyEmHeightBoxForPropagation(*this, + height_type); child_overflow.offset += child_fragment.Offset(); overflow.Unite(child_overflow); } @@ -821,7 +823,7 @@ return PhysicalRect({}, Size()); } -PhysicalRect NGPhysicalBoxFragment::ScrollableOverflowFromChildren( +PhysicalRect NGPhysicalBoxFragment::ComputeRubyEmHeightBoxFromChildren( TextHeightType height_type) const { // TODO(kojii): See |ScrollableOverflow|. DCHECK(height_type == TextHeightType::kEmHeight || PostLayout() == this); @@ -883,7 +885,7 @@ const PhysicalOffset& child_offset) { DCHECK(child.IsFloatingOrOutOfFlowPositioned()); PhysicalRect child_scrollable_overflow = - child.ScrollableOverflowForPropagation(container, height_type); + child.ComputeRubyEmHeightBoxForPropagation(container, height_type); child_scrollable_overflow.offset += child_offset; AddChild(child_scrollable_overflow); } @@ -893,7 +895,7 @@ if (padding_strut) AddLineBoxRect({child_offset, child.Size()}); PhysicalRect child_scrollable_overflow = - child.ScrollableOverflow(container, style, height_type); + child.ComputeRubyEmHeightBox(container, style, height_type); child_scrollable_overflow.offset += child_offset; AddChild(child_scrollable_overflow); } @@ -907,8 +909,8 @@ const PhysicalLineBoxFragment* line_box = child.LineBoxFragment(); DCHECK(line_box); PhysicalRect child_scrollable_overflow = - line_box->ScrollableOverflowForLine(container, style, child, cursor, - height_type); + line_box->ComputeRubyEmHeightBoxForLine(container, style, child, + cursor, height_type); AddChild(child_scrollable_overflow); } @@ -974,7 +976,7 @@ context.AddLineBoxChild(To<PhysicalLineBoxFragment>(*child), child.Offset()); } else if (height_type == TextHeightType::kEmHeight && IsRubyColumn()) { - PhysicalRect r = child->ScrollableOverflow(*this, height_type); + PhysicalRect r = child->ComputeRubyEmHeightBox(*this, height_type); r.offset += child.offset; context.AddChild(r); } @@ -1042,16 +1044,16 @@ NGPhysicalBoxFragment& fragment) : fragment_(fragment) {} -void NGPhysicalBoxFragment::MutableForStyleRecalc::SetLayoutOverflow( - const PhysicalRect& layout_overflow) { - bool has_layout_overflow = - layout_overflow != PhysicalRect({}, fragment_.Size()); - if (has_layout_overflow) { +void NGPhysicalBoxFragment::MutableForStyleRecalc::SetScrollableOverflow( + const PhysicalRect& scrollable_overflow) { + bool has_scrollable_overflow = + scrollable_overflow != PhysicalRect({}, fragment_.Size()); + if (has_scrollable_overflow) { // This can be called even without rare_data_. - fragment_.EnsureRareField(FieldId::kLayoutOverflow).layout_overflow = - layout_overflow; - } else if (fragment_.HasLayoutOverflow()) { - fragment_.rare_data_->RemoveField(FieldId::kLayoutOverflow); + fragment_.EnsureRareField(FieldId::kScrollableOverflow) + .scrollable_overflow = scrollable_overflow; + } else if (fragment_.HasScrollableOverflow()) { + fragment_.rare_data_->RemoveField(FieldId::kScrollableOverflow); } }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h index c098f26..8b734d0 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h
@@ -47,8 +47,8 @@ using PassKey = base::PassKey<NGPhysicalBoxFragment>; NGPhysicalBoxFragment(PassKey, NGBoxFragmentBuilder* builder, - bool has_layout_overflow, - const PhysicalRect& layout_overflow, + bool has_scrollable_overflow, + const PhysicalRect& scrollable_overflow, bool has_borders, const PhysicalBoxStrut& borders, bool has_padding, @@ -63,8 +63,8 @@ // based on the parameters, rather than copying it from the original fragment. NGPhysicalBoxFragment(PassKey, const NGPhysicalBoxFragment& other, - bool has_layout_overflow, - const PhysicalRect& layout_overflow); + bool has_scrollable_overflow, + const PhysicalRect& scrollable_overflow); ~NGPhysicalBoxFragment(); @@ -215,16 +215,16 @@ return g_null_atom; } - // Returns the layout-overflow for this fragment. - const PhysicalRect LayoutOverflow() const { - if (const auto* field = GetRareField(FieldId::kLayoutOverflow)) { - return field->layout_overflow; + // Returns the scrollable-overflow for this fragment. + const PhysicalRect ScrollableOverflow() const { + if (const auto* field = GetRareField(FieldId::kScrollableOverflow)) { + return field->scrollable_overflow; } return {{}, Size()}; } - bool HasLayoutOverflow() const { - return GetRareField(FieldId::kLayoutOverflow); + bool HasScrollableOverflow() const { + return GetRareField(FieldId::kScrollableOverflow); } const PhysicalBoxStrut Borders() const { @@ -314,8 +314,9 @@ // supported for CSS boxes (i.e. not for fragmentainers, for instance). PhysicalOffset OffsetFromOwnerLayoutBox() const; - PhysicalRect ScrollableOverflow(TextHeightType height_type) const; - PhysicalRect ScrollableOverflowFromChildren(TextHeightType height_type) const; + PhysicalRect ComputeRubyEmHeightBox(TextHeightType height_type) const; + PhysicalRect ComputeRubyEmHeightBoxFromChildren( + TextHeightType height_type) const; // TODO(layout-dev): These three methods delegate to legacy layout for now, // update them to use LayoutNG based overflow information from the fragment @@ -441,7 +442,7 @@ public: MutableForStyleRecalc(base::PassKey<NGPhysicalBoxFragment>, NGPhysicalBoxFragment& fragment); - void SetLayoutOverflow(const PhysicalRect& layout_overflow); + void SetScrollableOverflow(const PhysicalRect& scrollable_overflow); private: NGPhysicalBoxFragment& fragment_;
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc index 3921810..efd24c8 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc
@@ -619,12 +619,13 @@ } #endif -PhysicalRect NGPhysicalFragment::ScrollableOverflow( +PhysicalRect NGPhysicalFragment::ComputeRubyEmHeightBox( const NGPhysicalBoxFragment& container, TextHeightType height_type) const { switch (Type()) { case kFragmentBox: - return To<NGPhysicalBoxFragment>(*this).ScrollableOverflow(height_type); + return To<NGPhysicalBoxFragment>(*this).ComputeRubyEmHeightBox( + height_type); case kFragmentLineBox: NOTREACHED() << "You must call NGLineBoxFragment::ScrollableOverflow explicitly."; @@ -634,15 +635,15 @@ return {{}, Size()}; } -PhysicalRect NGPhysicalFragment::ScrollableOverflowForPropagation( +PhysicalRect NGPhysicalFragment::ComputeRubyEmHeightBoxForPropagation( const NGPhysicalBoxFragment& container, TextHeightType height_type) const { - PhysicalRect overflow = ScrollableOverflow(container, height_type); - AdjustScrollableOverflowForPropagation(container, height_type, &overflow); + PhysicalRect overflow = ComputeRubyEmHeightBox(container, height_type); + AdjustRubyEmHeightBoxForPropagation(container, height_type, &overflow); return overflow; } -void NGPhysicalFragment::AdjustScrollableOverflowForPropagation( +void NGPhysicalFragment::AdjustRubyEmHeightBoxForPropagation( const NGPhysicalBoxFragment& container, TextHeightType height_type, PhysicalRect* overflow) const { @@ -914,16 +915,16 @@ child_box->AddScrollableOverflowForInlineChild( container, container_style, line, has_hanging, descendants, height_type, &child_scroll_overflow); - child_box->AdjustScrollableOverflowForPropagation( - container, height_type, &child_scroll_overflow); + child_box->AdjustRubyEmHeightBoxForPropagation(container, height_type, + &child_scroll_overflow); if (UNLIKELY(has_hanging)) { AdjustScrollableOverflowForHanging(line.RectInContainerFragment(), container_writing_mode, &child_scroll_overflow); } } else { - child_scroll_overflow = - child_box->ScrollableOverflowForPropagation(container, height_type); + child_scroll_overflow = child_box->ComputeRubyEmHeightBoxForPropagation( + container, height_type); child_scroll_overflow.offset += item->OffsetInContainerFragment(); } overflow->Unite(child_scroll_overflow);
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h index a71c569b..b69c07e 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h
@@ -482,6 +482,7 @@ const NGPhysicalFragment* PostLayout() const; // Specifies the type of scrollable overflow computation. + // TODO(layout-dev): Remove this. Only kEmHeight is used. enum TextHeightType { // Apply text fragment size as is. kNormalHeight, @@ -489,16 +490,16 @@ // container's bounding box. This type is useful for ruby annotation. kEmHeight }; - // Scrollable overflow. including contents, in the local coordinate. - PhysicalRect ScrollableOverflow(const NGPhysicalBoxFragment& container, - TextHeightType height_type) const; + // Em height box. including contents, in the local coordinate. + PhysicalRect ComputeRubyEmHeightBox(const NGPhysicalBoxFragment& container, + TextHeightType height_type) const; - // ScrollableOverflow(), with transforms applied wrt container if needed. + // ComputeRubyEmHeightBox(), with transforms applied wrt container if needed. // This does not include any offsets from the parent (including relpos). - PhysicalRect ScrollableOverflowForPropagation( + PhysicalRect ComputeRubyEmHeightBoxForPropagation( const NGPhysicalBoxFragment& container, TextHeightType height_type) const; - void AdjustScrollableOverflowForPropagation( + void AdjustRubyEmHeightBoxForPropagation( const NGPhysicalBoxFragment& container, TextHeightType height_type, PhysicalRect* overflow) const;
diff --git a/third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.cc b/third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.cc index 8f66aec..05e8e04 100644 --- a/third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.cc +++ b/third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.cc
@@ -15,7 +15,7 @@ } PhysicalFragmentRareData::PhysicalFragmentRareData( - const PhysicalRect* layout_overflow, + const PhysicalRect* scrollable_overflow, const PhysicalBoxStrut* borders, const PhysicalBoxStrut* padding, absl::optional<PhysicalRect> inflow_bounds, @@ -26,8 +26,9 @@ // Each field should be processed in order of FieldId to avoid vector // element insertions. - if (layout_overflow) { - SetField(FieldId::kLayoutOverflow).layout_overflow = *layout_overflow; + if (scrollable_overflow) { + SetField(FieldId::kScrollableOverflow).scrollable_overflow = + *scrollable_overflow; } if (borders) { SetField(FieldId::kBorders).borders = *borders; @@ -100,7 +101,7 @@ // Each field should be processed in order of FieldId to avoid vector // element insertions. - SET_IF_EXISTS(kLayoutOverflow, layout_overflow, other); + SET_IF_EXISTS(kScrollableOverflow, scrollable_overflow, other); SET_IF_EXISTS(kBorders, borders, other); SET_IF_EXISTS(kPadding, padding, other); SET_IF_EXISTS(kInflowBounds, inflow_bounds, other); @@ -128,7 +129,7 @@ #define DISPATCH_BY_MEMBER_TYPE(FUNC) \ switch (type) { \ - FUNC(kLayoutOverflow, layout_overflow); \ + FUNC(kScrollableOverflow, scrollable_overflow); \ FUNC(kBorders, borders); \ FUNC(kPadding, padding); \ FUNC(kInflowBounds, inflow_bounds); \
diff --git a/third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.h b/third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.h index c03a841a..f1784c6 100644 --- a/third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.h +++ b/third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.h
@@ -35,7 +35,7 @@ : public GarbageCollected<PhysicalFragmentRareData> { public: explicit PhysicalFragmentRareData(wtf_size_t num_fields); - PhysicalFragmentRareData(const PhysicalRect* layout_overflow, + PhysicalFragmentRareData(const PhysicalRect* scrollable_overflow, const PhysicalBoxStrut* borders, const PhysicalBoxStrut* padding, absl::optional<PhysicalRect> inflow_bounds, @@ -57,7 +57,7 @@ // In ARM, the size of a shift amount operand of shift instructions is same // as the size of shifted data. So FieldId should be RareBitFieldType. enum class FieldId : RareBitFieldType { - kLayoutOverflow = 0, + kScrollableOverflow = 0, kBorders, kPadding, kInflowBounds, @@ -79,7 +79,7 @@ struct RareField { union { - PhysicalRect layout_overflow; + PhysicalRect scrollable_overflow; PhysicalBoxStrut borders; PhysicalBoxStrut padding; PhysicalRect inflow_bounds;
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc index feb0979..9067fca 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
@@ -10,6 +10,7 @@ #include "components/ml/webnn/features.h" #include "third_party/abseil-cpp/absl/types/variant.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" +#include "third_party/blink/renderer/bindings/modules/v8/v8_ml_batch_normalization_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_ml_clamp_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_2d_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_transpose_2d_options.h" @@ -173,6 +174,20 @@ } } +webnn::BatchNormalizationAttributes ConvertToBatchNormalizationAttributes( + const blink::MLBatchNormalizationOptions* options) { + CHECK(options); + webnn::BatchNormalizationAttributes attributes; + if (options->hasScale()) { + attributes.scale = ConvertToComponentOperand(options->scale()); + } + if (options->hasBias()) { + attributes.bias = ConvertToComponentOperand(options->bias()); + } + attributes.axis = options->axis(); + return attributes; +} + template <typename MLConv2dOptionsType, typename Conv2dAttributesType> base::expected<Conv2dAttributesType, String> ConvertToConv2dAttributesBase( const MLConv2dOptionsType* options) { @@ -546,6 +561,49 @@ return constant_operand.value(); } +MLOperand* MLGraphBuilder::batchNormalization( + const MLOperand* input, + const MLOperand* mean, + const MLOperand* variance, + const MLBatchNormalizationOptions* options, + ExceptionState& exception_state) { + const auto validated_output = webnn::ValidateBatchNormalizationAndInferOutput( + ConvertToComponentOperand(input), ConvertToComponentOperand(mean), + ConvertToComponentOperand(variance), + ConvertToBatchNormalizationAttributes(options)); + if (!validated_output.has_value()) { + exception_state.ThrowDOMException( + DOMExceptionCode::kDataError, + WTF::String::FromUTF8(validated_output.error())); + return nullptr; + } + + // Create batchNormalization operator and its output operand. Connect the + // batchNormalization operator to its input and output operands. + auto* batch_normalization = MakeGarbageCollected<MLOperator>( + this, MLOperator::OperatorKind::kBatchNormalization, options); + HeapVector<Member<const MLOperand>> inputs = {input, mean, variance}; + // Adding the optional operands into inputs ensures the graph traversal + // algorithm GetOperatorsInTopologicalOrder() works. For backends, the + // optional operands should be retrieved from the options instead of inputs. + if (options->hasScale()) { + inputs.push_back(options->scale()); + } + if (options->hasBias()) { + inputs.push_back(options->bias()); + } + auto output = MLOperand::ValidateAndCreateOutput( + this, ComponentOperandTypeToBlink(validated_output->data_type), + Vector<uint32_t>(validated_output->dimensions), batch_normalization); + if (!output.has_value()) { + exception_state.ThrowDOMException(DOMExceptionCode::kDataError, + output.error()); + return nullptr; + } + batch_normalization->Connect(std::move(inputs), {output.value()}); + return output.value(); +} + MLOperand* MLGraphBuilder::concat(const HeapVector<Member<MLOperand>>& inputs, const uint32_t axis, ExceptionState& exception_state) {
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h index d7ef500..abeac83 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h
@@ -23,6 +23,7 @@ class ExceptionState; class MLActivation; +class MLBatchNormalizationOptions; class MLContext; class MLClampOptions; class MLConv2dOptions; @@ -74,6 +75,12 @@ ExceptionState& exception_state); // The order of operations declaration is the same as spec. + MLOperand* batchNormalization(const MLOperand* input, + const MLOperand* mean, + const MLOperand* variance, + const MLBatchNormalizationOptions* options, + ExceptionState& exception_state); + MLOperand* clamp(const MLOperand* input, const MLClampOptions* options, ExceptionState& exception_state);
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl index 5c2a673..d8118c10 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl
@@ -14,6 +14,18 @@ enum MLAutoPad { "explicit", "same-upper", "same-lower" }; +// A spec file was issued for WG discussion: +// https://github.com/webmachinelearning/webnn/issues/481. +// TODO(crbug.com/1502361): Revisit whether the scale and bias operands +// should be required inputs based on WG's consensus. +dictionary MLBatchNormalizationOptions { + MLOperand scale; + MLOperand bias; + [EnforceRange] unsigned long axis = 1; + float epsilon = 1e-5; + MLActivation activation; +}; + dictionary MLConv2dOptions { sequence<[EnforceRange] unsigned long> padding; sequence<[EnforceRange] unsigned long> strides; @@ -121,6 +133,8 @@ [RaisesException] MLOperand constant(MLOperandDescriptor desc, MLBufferView bufferView); + [RaisesException] MLOperand batchNormalization(MLOperand input, MLOperand mean, MLOperand variance, optional MLBatchNormalizationOptions options = {}); + [RaisesException] MLOperand clamp(MLOperand input, optional MLClampOptions options = {}); [RaisesException] MLActivation clamp(optional MLClampOptions options = {});
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.cc index ff3155f..e452ed4 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.cc
@@ -241,6 +241,378 @@ } } +MLOperand* BuildBatchNormalization(V8TestingScope& scope, + MLGraphBuilder* builder, + const MLOperand* input, + const MLOperand* mean, + const MLOperand* variance, + const MLBatchNormalizationOptions* options) { + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_NE(output, nullptr); + EXPECT_EQ(output->Kind(), MLOperand::OperandKind::kOutput); + EXPECT_EQ(output->Type(), input->Type()); + auto* batch_normalization = output->Operator(); + EXPECT_NE(batch_normalization, nullptr); + EXPECT_EQ(batch_normalization->Kind(), + MLOperator::OperatorKind::kBatchNormalization); + EXPECT_EQ(batch_normalization->IsConnected(), true); + EXPECT_NE(batch_normalization->Options(), nullptr); + return output; +} + +TEST_F(MLGraphBuilderTest, BatchNormalizationTest) { + V8TestingScope scope; + auto* builder = + CreateMLGraphBuilder(scope.GetExecutionContext(), scope.GetScriptState(), + scope.GetExceptionState()); + { + // Test batchNormalization with default options. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + EXPECT_FALSE(options->hasScale()); + EXPECT_FALSE(options->hasBias()); + EXPECT_FALSE(options->hasActivation()); + EXPECT_TRUE(options->hasAxis()); + EXPECT_EQ(options->axis(), 1u); + EXPECT_TRUE(options->hasEpsilon()); + EXPECT_FLOAT_EQ(options->epsilon(), 1e-5); + auto* output = + BuildBatchNormalization(scope, builder, input, mean, variance, options); + EXPECT_EQ(output->Dimensions(), Vector<uint32_t>({1, 2, 5, 5})); + } + { + // Test batchNormalization with axis = 2 and epsilon = 0.0001. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {5}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {5}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + options->setAxis(2); + options->setEpsilon(0.0001); + auto* output = + BuildBatchNormalization(scope, builder, input, mean, variance, options); + EXPECT_EQ(output->Dimensions(), Vector<uint32_t>({1, 2, 5, 5})); + } + { + // Test throwing exception when the input type is not one of floating point + // types. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kInt32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {2}, V8MLOperandType::Enum::kInt32, + scope.GetExceptionState()); + auto* variance = BuildConstant(builder, {2}, V8MLOperandType::Enum::kInt32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ(scope.GetExceptionState().Message(), + "The input type must be one of the floating point types."); + } + { + // Test throwing exception when the mean type is not the same as the input + // type. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat16, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ( + scope.GetExceptionState().Message(), + "For mean operand: the data type doesn't match the input data type."); + } + { + // Test throwing exception when the mean operand is not a 1-D tensor. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {1, 2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ(scope.GetExceptionState().Message(), + "For mean operand: the operand should be a 1-D tensor."); + } + { + // Test throwing exception when the size of mean operand is not equal to + // the size of the input dimension denoted by axis. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {3}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ(scope.GetExceptionState().Message(), + "For mean operand: the size of operand must be equal to the size " + "of the input dimension denoted by axis."); + } + { + // Test throwing exception when the variance type is not the same as the + // input type. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* variance = BuildConstant(builder, {2}, V8MLOperandType::Enum::kInt32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ(scope.GetExceptionState().Message(), + "For variance operand: the data type doesn't match the input " + "data type."); + } + { + // Test throwing exception when the variance operand is not a 1-D tensor. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {2, 2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ(scope.GetExceptionState().Message(), + "For variance operand: the operand should be a 1-D tensor."); + } + { + // Test throwing exception when the size of variance operand is not + // equal to the size of the input dimension denoted by axis. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {5}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + options->setAxis(2); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ(scope.GetExceptionState().Message(), + "For variance operand: the size of operand must be equal to the " + "size of the input dimension denoted by axis."); + } + { + // Test throwing exception when the scale type is not the same as the input + // type. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat16, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat16, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat16, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + auto* scale = BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + options->setScale(scale); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ( + scope.GetExceptionState().Message(), + "For scale operand: the data type doesn't match the input data type."); + } + { + // Test throwing exception when the scale operand is not a 1-D tensor. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + auto* scale = + BuildConstant(builder, {2, 1}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + options->setScale(scale); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ(scope.GetExceptionState().Message(), + "For scale operand: the operand should be a 1-D tensor."); + } + { + // Test throwing exception when the size of scale operand is not equal + // to the size of the input dimension denoted by axis. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {5}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {5}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + options->setAxis(2); + auto* scale = BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + options->setScale(scale); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ(scope.GetExceptionState().Message(), + "For scale operand: the size of operand must be equal to the " + "size of the input dimension denoted by axis."); + } + { + // Test throwing exception when the bias type is not the same as the input + // type. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat16, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat16, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat16, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + auto* bias = BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + options->setBias(bias); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ( + scope.GetExceptionState().Message(), + "For bias operand: the data type doesn't match the input data type."); + } + { + // Test throwing exception when the bias operand is not a 1-D tensor. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + auto* bias = BuildConstant(builder, {2, 1}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + options->setBias(bias); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ(scope.GetExceptionState().Message(), + "For bias operand: the operand should be a 1-D tensor."); + } + { + // Test throwing exception when the size of bias operand is not equal to + // the size of the input dimension denoted by axis. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {5}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {5}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + options->setAxis(2); + auto* bias = BuildConstant(builder, {2}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + options->setBias(bias); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ(scope.GetExceptionState().Message(), + "For bias operand: the size of operand must be equal to the size " + "of the input dimension denoted by axis."); + } + { + // Test throwing exception when the value of axis is not in the range of [0, + // N-1]. + auto* input = + BuildInput(builder, "input", {1, 2, 5, 5}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* mean = BuildConstant(builder, {5}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* variance = + BuildConstant(builder, {5}, V8MLOperandType::Enum::kFloat32, + scope.GetExceptionState()); + auto* options = MLBatchNormalizationOptions::Create(); + options->setAxis(4); + auto* output = builder->batchNormalization(input, mean, variance, options, + scope.GetExceptionState()); + EXPECT_EQ(output, nullptr); + EXPECT_EQ(scope.GetExceptionState().CodeAs<DOMExceptionCode>(), + DOMExceptionCode::kDataError); + EXPECT_EQ(scope.GetExceptionState().Message(), + "The value of axis must be in the range [0, N-1] where N is the " + "rank of the input tensor."); + } +} + TEST_F(MLGraphBuilderTest, ConcatTest) { V8TestingScope scope; auto* builder =
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.h b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.h index 5e193abf..2a4a7f0 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.h +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_MODULES_ML_WEBNN_ML_GRAPH_BUILDER_TEST_H_ #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/renderer/bindings/modules/v8/v8_ml_batch_normalization_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_ml_clamp_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_2d_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_transpose_2d_options.h" @@ -34,6 +35,14 @@ NotShared<DOMArrayBufferView> CreateArrayBufferViewForOperand( const MLOperand* operand); +MLOperand* BuildBatchNormalization(V8TestingScope& scope, + MLGraphBuilder* builder, + const MLOperand* input, + const MLOperand* mean, + const MLOperand* variance, + const MLBatchNormalizationOptions* options = + MLBatchNormalizationOptions::Create()); + MLOperand* BuildClamp(V8TestingScope& scope, MLGraphBuilder* builder, const MLOperand* input,
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_test_mojo.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_test_mojo.cc index 3d2e03d..ccea9fc 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_test_mojo.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_test_mojo.cc
@@ -1264,6 +1264,89 @@ } } +struct ExpandTester { + OperandInfoBlink input; + Vector<uint32_t> new_shape; + OperandInfoMojo expected; + + void Test(MLGraphTestMojo& helper, + V8TestingScope& scope, + MLGraphBuilder* builder) { + // Build the graph. + auto* input_operand = BuildInput(builder, "input", input.dimensions, + input.type, scope.GetExceptionState()); + auto* output_operand = + builder->expand(input_operand, new_shape, scope.GetExceptionState()); + auto [graph, build_exception] = + helper.BuildGraph(scope, builder, {{"output", output_operand}}); + ASSERT_NE(graph, nullptr); + + auto graph_info = helper.GetGraphInfo(); + // Verify the graph information of mojo are as expected. + ASSERT_EQ(graph_info->operations.size(), 1u); + auto& operation = graph_info->operations[0]; + EXPECT_EQ(operation->is_expand(), true); + EXPECT_EQ(graph_info->output_operands.size(), 1u); + auto output_operand_id = graph_info->output_operands[0]; + auto output_operand_iter = + graph_info->id_to_operand_map.find(output_operand_id); + ASSERT_TRUE(output_operand_iter != graph_info->id_to_operand_map.end()); + EXPECT_EQ(output_operand_iter->value->data_type, expected.type); + EXPECT_EQ(output_operand_iter->value->dimensions, expected.dimensions); + } +}; + +TEST_P(MLGraphTestMojo, ExpandTest) { + V8TestingScope scope; + // Bind fake WebNN Context in the service for testing. + ScopedWebNNServiceBinder scoped_setup_binder(*this, scope); + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeature( + webnn::features::kEnableMachineLearningNeuralNetworkService); + auto* options = MLContextOptions::Create(); + // Create WebNN Context with GPU device type. + options->setDeviceType(V8MLDeviceType::Enum::kGpu); + auto* builder = CreateGraphBuilder(scope, options); + ASSERT_NE(builder, nullptr); + { + // Test building expand 0-D scalar to 3-D tensor. + ExpandTester{ + .input = {.type = V8MLOperandType::Enum::kFloat32, .dimensions = {}}, + .new_shape = {3, 4, 5}, + .expected = {.type = blink_mojom::Operand::DataType::kFloat32, + .dimensions = {3, 4, 5}}} + .Test(*this, scope, builder); + } + { + // Test expanding the new shape that is the same as input. + ExpandTester{.input = {.type = V8MLOperandType::Enum::kFloat32, + .dimensions = {3, 2}}, + .new_shape = {3, 2}, + .expected = {.type = blink_mojom::Operand::DataType::kFloat32, + .dimensions = {3, 2}}} + .Test(*this, scope, builder); + } + { + // Test expanding the new shape that are broadcastable. + ExpandTester{.input = {.type = V8MLOperandType::Enum::kFloat16, + .dimensions = {3, 1, 5}}, + .new_shape = {3, 4, 5}, + .expected = {.type = blink_mojom::Operand::DataType::kFloat16, + .dimensions = {3, 4, 5}}} + .Test(*this, scope, builder); + } + { + // Test expanding the new shape that are broadcastable and the number of new + // shapes larger than input. + ExpandTester{ + .input = {.type = V8MLOperandType::Enum::kInt32, .dimensions = {2, 5}}, + .new_shape = {3, 2, 5}, + .expected = {.type = blink_mojom::Operand::DataType::kInt32, + .dimensions = {3, 2, 5}}} + .Test(*this, scope, builder); + } +} + struct GemmTester { OperandInfoBlink a; OperandInfoBlink b;
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc index 9e11c5c..122e574 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
@@ -163,6 +163,15 @@ return elu_mojo; } +OperationPtr CreateExpandOperation(const OperandToIdMap& operand_to_id_map, + const MLOperator* expand) { + auto expand_mojo = blink_mojom::Expand::New(); + expand_mojo->input_operand_id = GetOperatorInputId(expand, operand_to_id_map); + expand_mojo->output_operand_id = + GetOperatorOutputId(expand, operand_to_id_map); + return blink_mojom::Operation::NewExpand(std::move(expand_mojo)); +} + blink_mojom::LeakyReluPtr CreateLeakyRelu( const OperandToIdMap& operand_to_id_map, const MLOperator* leaky_relu, @@ -817,6 +826,8 @@ case MLOperator::OperatorKind::kElu: return blink_mojom::Operation::NewElu( CreateElu(operand_to_id_map, op, false)); + case MLOperator::OperatorKind::kExpand: + return CreateExpandOperation(operand_to_id_map, op); case MLOperator::OperatorKind::kGemm: return CreateGemmOperation(operand_to_id_map, op); case MLOperator::OperatorKind::kLeakyRelu:
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_operator.cc b/third_party/blink/renderer/modules/ml/webnn/ml_operator.cc index 8886c979..26bcb8b 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_operator.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_operator.cc
@@ -12,6 +12,8 @@ // static String MLOperator::OperatorKindToString(MLOperator::OperatorKind kind) { switch (kind) { + case MLOperator::OperatorKind::kBatchNormalization: + return "batchNormalization"; case MLOperator::OperatorKind::kClamp: return "clamp"; case MLOperator::OperatorKind::kConcat:
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_operator.h b/third_party/blink/renderer/modules/ml/webnn/ml_operator.h index 04bf537..a380b35 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_operator.h +++ b/third_party/blink/renderer/modules/ml/webnn/ml_operator.h
@@ -21,6 +21,7 @@ public: enum class OperatorKind { // Keep the order as the same as build methods of MLGraphBuilder. + kBatchNormalization, kClamp, kConcat, kConv2d,
diff --git a/third_party/blink/renderer/platform/exported/web_url_response.cc b/third_party/blink/renderer/platform/exported/web_url_response.cc index f5c2e41..1bb81fa 100644 --- a/third_party/blink/renderer/platform/exported/web_url_response.cc +++ b/third_party/blink/renderer/platform/exported/web_url_response.cc
@@ -43,12 +43,14 @@ #include "services/network/public/mojom/cors.mojom-shared.h" #include "services/network/public/mojom/ip_address_space.mojom-shared.h" #include "services/network/public/mojom/load_timing_info.mojom.h" +#include "services/network/public/mojom/service_worker_router_info.mojom-blink.h" #include "services/network/public/mojom/url_response_head.mojom.h" #include "third_party/blink/public/platform/web_http_header_visitor.h" #include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/public/platform/web_url.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_load_timing.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_response.h" +#include "third_party/blink/renderer/platform/loader/fetch/service_worker_router_info.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/vector.h" @@ -148,6 +150,9 @@ response.SetWasFetchedViaServiceWorker(head.was_fetched_via_service_worker); response.SetDidUseSharedDictionary(head.did_use_shared_dictionary); response.SetServiceWorkerResponseSource(head.service_worker_response_source); + if (!head.service_worker_router_info.is_null()) { + response.SetServiceWorkerRouterInfo(*head.service_worker_router_info); + } response.SetType(head.response_type); response.SetPadding(head.padding); WebVector<KURL> url_list_via_service_worker( @@ -504,6 +509,13 @@ return resource_response_->GetServiceWorkerResponseSource(); } +void WebURLResponse::SetServiceWorkerRouterInfo( + const network::mojom::ServiceWorkerRouterInfo& value) { + auto info = ServiceWorkerRouterInfo::Create(); + info->SetRuleIdMatched(value.rule_id_matched); + resource_response_->SetServiceWorkerRouterInfo(std::move(info)); +} + void WebURLResponse::SetServiceWorkerResponseSource( network::mojom::FetchResponseSource value) { resource_response_->SetServiceWorkerResponseSource(value);
diff --git a/third_party/blink/renderer/platform/loader/BUILD.gn b/third_party/blink/renderer/platform/loader/BUILD.gn index 4d9cc78..3569fa1 100644 --- a/third_party/blink/renderer/platform/loader/BUILD.gn +++ b/third_party/blink/renderer/platform/loader/BUILD.gn
@@ -112,6 +112,8 @@ "fetch/script_cached_metadata_handler.h", "fetch/script_fetch_options.cc", "fetch/script_fetch_options.h", + "fetch/service_worker_router_info.cc", + "fetch/service_worker_router_info.h", "fetch/shared_buffer_bytes_consumer.cc", "fetch/shared_buffer_bytes_consumer.h", "fetch/stale_revalidation_resource_client.cc",
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_response.cc b/third_party/blink/renderer/platform/loader/fetch/resource_response.cc index 62b6cf4f5..1497fd1 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_response.cc +++ b/third_party/blink/renderer/platform/loader/fetch/resource_response.cc
@@ -26,11 +26,9 @@ #include "third_party/blink/renderer/platform/loader/fetch/resource_response.h" -#include <algorithm> -#include <limits> -#include <memory> #include <string> +#include "base/memory/scoped_refptr.h" #include "net/http/structured_headers.h" #include "net/ssl/ssl_info.h" #include "services/network/public/cpp/cors/cors.h" @@ -38,6 +36,7 @@ #include "third_party/blink/public/mojom/timing/resource_timing.mojom-blink.h" #include "third_party/blink/public/platform/web_url_response.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_load_timing.h" +#include "third_party/blink/renderer/platform/loader/fetch/service_worker_router_info.h" #include "third_party/blink/renderer/platform/network/http_names.h" #include "third_party/blink/renderer/platform/network/http_parsers.h" #include "third_party/blink/renderer/platform/wtf/assertions.h" @@ -229,6 +228,11 @@ ssl_info_ = ssl_info; } +void ResourceResponse::SetServiceWorkerRouterInfo( + scoped_refptr<ServiceWorkerRouterInfo> value) { + service_worker_router_info_ = std::move(value); +} + bool ResourceResponse::IsCorsSameOrigin() const { return network::cors::IsCorsSameOriginResponseType(response_type_); }
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_response.h b/third_party/blink/renderer/platform/loader/fetch/resource_response.h index ab0497cd..99e1170 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_response.h +++ b/third_party/blink/renderer/platform/loader/fetch/resource_response.h
@@ -53,6 +53,7 @@ namespace blink { class ResourceLoadTiming; +class ServiceWorkerRouterInfo; // A ResourceResponse is a "response" object used in blink. Conceptually // it is https://fetch.spec.whatwg.org/#concept-response, but it contains @@ -229,6 +230,12 @@ return service_worker_response_source_; } + // See network.mojom.URLResponseHead.service_worker_router_info. + const blink::ServiceWorkerRouterInfo* GetServiceWorkerRouterInfo() const { + return service_worker_router_info_.get(); + } + void SetServiceWorkerRouterInfo(scoped_refptr<ServiceWorkerRouterInfo> value); + void SetServiceWorkerResponseSource( network::mojom::FetchResponseSource value) { service_worker_response_source_ = value; @@ -593,6 +600,10 @@ network::mojom::FetchResponseSource service_worker_response_source_ = network::mojom::FetchResponseSource::kUnspecified; + // The information about the ServiceWorker Static Router that handled the + // request. Null if there was no registered Static Routers. + scoped_refptr<blink::ServiceWorkerRouterInfo> service_worker_router_info_; + // https://fetch.spec.whatwg.org/#concept-response-type network::mojom::FetchResponseType response_type_ = network::mojom::FetchResponseType::kDefault;
diff --git a/third_party/blink/renderer/platform/loader/fetch/service_worker_router_info.cc b/third_party/blink/renderer/platform/loader/fetch/service_worker_router_info.cc new file mode 100644 index 0000000..17e9241 --- /dev/null +++ b/third_party/blink/renderer/platform/loader/fetch/service_worker_router_info.cc
@@ -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. + +#include "third_party/blink/renderer/platform/loader/fetch/service_worker_router_info.h" + +#include "base/memory/scoped_refptr.h" +#include "services/network/public/mojom/service_worker_router_info.mojom-blink.h" + +namespace blink { + +ServiceWorkerRouterInfo::ServiceWorkerRouterInfo() = default; + +scoped_refptr<ServiceWorkerRouterInfo> ServiceWorkerRouterInfo::Create() { + return base::AdoptRef(new ServiceWorkerRouterInfo); +} + +network::mojom::blink::ServiceWorkerRouterInfoPtr +ServiceWorkerRouterInfo::ToMojo() const { + network::mojom::blink::ServiceWorkerRouterInfoPtr info = + network::mojom::blink::ServiceWorkerRouterInfo::New(); + info->rule_id_matched = rule_id_matched_; + return info; +} + +} // namespace blink
diff --git a/third_party/blink/renderer/platform/loader/fetch/service_worker_router_info.h b/third_party/blink/renderer/platform/loader/fetch/service_worker_router_info.h new file mode 100644 index 0000000..4d8fe26 --- /dev/null +++ b/third_party/blink/renderer/platform/loader/fetch/service_worker_router_info.h
@@ -0,0 +1,35 @@ +// 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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_SERVICE_WORKER_ROUTER_INFO_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_SERVICE_WORKER_ROUTER_INFO_H_ + +#include "base/memory/scoped_refptr.h" +#include "services/network/public/mojom/service_worker_router_info.mojom-blink-forward.h" +#include "third_party/blink/renderer/platform/platform_export.h" +#include "third_party/blink/renderer/platform/wtf/ref_counted.h" + +namespace blink { + +class PLATFORM_EXPORT ServiceWorkerRouterInfo + : public RefCounted<ServiceWorkerRouterInfo> { + public: + static scoped_refptr<ServiceWorkerRouterInfo> Create(); + + network::mojom::blink::ServiceWorkerRouterInfoPtr ToMojo() const; + + void SetRuleIdMatched(std::uint32_t rule_id_matched) { + rule_id_matched_ = rule_id_matched; + } + + const std::uint32_t& RuleIdMatched() const { return rule_id_matched_; } + + private: + ServiceWorkerRouterInfo(); + + std::uint32_t rule_id_matched_; +}; +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_SERVICE_WORKER_ROUTER_INFO_H_
diff --git a/third_party/blink/web_tests/ChromeTestExpectations b/third_party/blink/web_tests/ChromeTestExpectations index 4834b21..c3fe774 100644 --- a/third_party/blink/web_tests/ChromeTestExpectations +++ b/third_party/blink/web_tests/ChromeTestExpectations
@@ -98,6 +98,7 @@ crbug.com/1499775 external/wpt/credential-management/fedcm-pending-call-rejected.https.html [ Timeout ] crbug.com/1499775 external/wpt/credential-management/fedcm-returning-account-auto-reauthn.https.html [ Timeout ] crbug.com/1499775 external/wpt/credential-management/fedcm-revoke.sub.https.html [ Timeout ] +crbug.com/1499775 external/wpt/credential-management/fedcm-revoke-iframe.sub.https.html [ Timeout ] crbug.com/1499775 external/wpt/credential-management/fedcm-store.https.html [ Timeout ] crbug.com/1499775 external/wpt/credential-management/fedcm-token-returned-with-http-error.https.html [ Timeout ] crbug.com/1499775 external/wpt/css/CSS2/floats/float-nowrap-2.html [ Failure ] # Reftest image failure
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 1977c90..3d8bfbc 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -1530,20 +1530,16 @@ crbug.com/1488371 virtual/deprecate-unload/http/tests/devtools/sources/debugger/skip-pause-during-navigation.js [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/history/history-replace-updates-current-item.html [ Failure Skip Timeout ] -crbug.com/1488371 virtual/deprecate-unload/http/tests/inspector-protocol/permissions-policy.js [ Failure Skip Timeout ] -crbug.com/1488371 virtual/deprecate-unload/http/tests/navigation/image-css-load-in-subframe-unload-handler.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/navigation/image-load-in-subframe-unload-handler.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/navigation/image-load-in-unload-handler.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/navigation/navigate-to-about-blank-from-subframe-unload-handler-cross-origin.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/navigation/navigate-to-about-blank-from-subframe-unload-handler-same-origin.html [ Failure Skip Timeout ] -crbug.com/1488371 virtual/deprecate-unload/http/tests/navigation/targeted-navigation-in-unload-handler.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/notifications/close-on-document-unload.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/notifications/notification-creation-detached-context.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/notifications/request-permission-detached-context.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/security/isolatedWorld/context-destroy.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/security/window-events-clear-domain.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/security/window-events-clear-port.html [ Failure Skip Timeout ] -crbug.com/1488371 virtual/deprecate-unload/http/tests/security/window-events-pass.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/xmlhttprequest/frame-load-cancelled-abort.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/xmlhttprequest/frame-unload-abort-crash.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/xmlhttprequest/xhr-onunload.html [ Failure Skip Timeout ] @@ -1598,6 +1594,7 @@ crbug.com/1488371 virtual/deprecate-unload/external/wpt/fetch/api/cors/cors-keepalive.any.html [ Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/external/wpt/fetch/api/redirect/redirect-keepalive.any.html [ Timeout ] crbug.com/1488371 virtual/deprecate-unload/external/wpt/fetch/metadata/unload.https.sub.html [ Timeout ] +crbug.com/1488371 virtual/deprecate-unload/http/tests/navigation/targeted-navigation-in-unload-handler.html [ Timeout ] ######## End Unload Deprecation @@ -7047,6 +7044,9 @@ crbug.com/1467464 http/tests/devtools/security/interstitial-sidebar.js [ Failure Pass ] crbug.com/1467464 http/tests/devtools/security/mixed-content-sidebar.js [ Failure Pass ] +# Expected to fail 2023-11-13 +[ Win ] virtual/media-foundation-for-clear-dcomp/media/video-preload-first-frame-presented.html [ Timeout ] + # Failures due to adding new virtual tests. crbug.com/432153 virtual/css-masking-disabled/external/wpt/css/css-masking/mask-image/* [ Failure ] # Tests that the mask doesn't apply(?). @@ -7105,7 +7105,7 @@ crbug.com/1486131 [ Debug Linux ] external/wpt/html/browsers/history/the-history-interface/001.html [ Failure Pass ] # Gardener 2023-11-10 -crbug.com/1501324 [ Mac ] virtual/compute-pressure/external/wpt/compute-pressure/compute_pressure_rate_obfuscation_mitigation_triggered.tentative.https.window.html [ Failure Pass ] +crbug.com/1501324 [ Mac ] virtual/compute-pressure/external/wpt/compute-pressure/compute_pressure_rate_obfuscation_mitigation_triggered.tentative.https.window.html [ Failure Pass Timeout ] # Tentatively allowed to fail to roll changes in the DevTools frontend. crbug.com/1474670 http/tests/devtools/application-panel/resources-panel-on-navigation.js [ Failure Pass ] @@ -7118,7 +7118,7 @@ crbug.com/1502336 [ Linux ] external/wpt/idle-detection/idle-detection-allowed-by-permissions-policy.https.sub.html [ Failure Pass ] # Gardener 2023-11-16 -crbug.com/1502794 external/wpt/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html [ Failure Pass ] +crbug.com/1502794 external/wpt/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html [ Failure Pass Timeout ] # Gerdener 2023-11-17 crbug.com/1503108 [ Mac ] external/wpt/credential-management/fedcm-revoke.sub.https.html [ Timeout ] @@ -7128,3 +7128,6 @@ crbug.com/1503067 [ Linux ] virtual/pna-iframes-enabled/external/wpt/fetch/private-network-access/iframe.tentative.https.window.html [ Failure Pass ] crbug.com/1503086 [ Linux ] external/wpt/html/semantics/invokers/invoketarget-on-audio-behavior.tentative.html [ Failure Pass ] crbug.com/1503119 [ Mac11 ] external/wpt/webtransport/echo-large-bidirectional-streams.https.any.html [ Timeout ] + +# Gerdener 2023-11-21 +crbug.com/1504071 [ Mac ] http/tests/navigation/ping-cross-origin-from-https.html [ Failure Pass ]
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 55e1ccc2..20c9c18 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -1264,6 +1264,7 @@ "wpt_internal/portals" ], "exclusive_tests": "ALL", "args": ["--enable-features=Portals,PortalsCrossOrigin", + "--disable-features=DeprecateUnload", "--disable-threaded-compositing", "--disable-threaded-animation"], "expires": "Jul 1, 2023" },
diff --git a/third_party/blink/web_tests/external/wpt/css/css-anchor-position/at-fallback-position-allowed-declarations.html b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/at-fallback-position-allowed-declarations.html index 25f6a14..cca222ac 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-anchor-position/at-fallback-position-allowed-declarations.html +++ b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/at-fallback-position-allowed-declarations.html
@@ -44,6 +44,7 @@ test_allowed_declaration('inset-block'); test_allowed_declaration('inset-inline'); test_allowed_declaration('inset'); +test_allowed_declaration('inset-area', 'all'); // Margin properties are allowed test_allowed_declaration('margin-top');
diff --git a/third_party/blink/web_tests/external/wpt/webnn/batch_normalization.https.any-expected.txt b/third_party/blink/web_tests/external/wpt/webnn/batch_normalization.https.any-expected.txt index 886ad038..7369d8f 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/batch_normalization.https.any-expected.txt +++ b/third_party/blink/web_tests/external/wpt/webnn/batch_normalization.https.any-expected.txt
@@ -1,27 +1,27 @@ This is a testharness.js-based test. [FAIL] batchNormalization float32 2D tensor (mean and variance are non-constant) default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "NotSupportedError: The operator (batchNormalization) is not supported." [FAIL] batchNormalization float32 2D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "NotSupportedError: The operator (batchNormalization) is not supported." [FAIL] batchNormalization float32 3D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "NotSupportedError: The operator (batchNormalization) is not supported." [FAIL] batchNormalization float32 4D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "NotSupportedError: The operator (batchNormalization) is not supported." [FAIL] batchNormalization float32 5D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "NotSupportedError: The operator (batchNormalization) is not supported." [FAIL] batchNormalization float32 4D NCHW tensor options.axis=1 / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "NotSupportedError: The operator (batchNormalization) is not supported." [FAIL] batchNormalization float32 4D NHWC tensor options.axis=3 / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "NotSupportedError: The operator (batchNormalization) is not supported." [FAIL] batchNormalization float32 4D NCHW tensor options.scale / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "NotSupportedError: The operator (batchNormalization) is not supported." [FAIL] batchNormalization float32 4D NCHW tensor options.bias / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "NotSupportedError: The operator (batchNormalization) is not supported." [FAIL] batchNormalization float32 4D NCHW tensor options.epsilon / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "NotSupportedError: The operator (batchNormalization) is not supported." [FAIL] batchNormalization float32 4D NCHW tensor options.activation relu / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "NotSupportedError: The operator (batchNormalization) is not supported." [FAIL] batchNormalization float32 4D NHWC tensor all options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "NotSupportedError: The operator (batchNormalization) is not supported." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/webnn/batch_normalization.https.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/webnn/batch_normalization.https.any.worker-expected.txt index dbff80c..c2fb1b3 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/batch_normalization.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/external/wpt/webnn/batch_normalization.https.any.worker-expected.txt
@@ -1,51 +1,51 @@ This is a testharness.js-based test. [FAIL] batchNormalization float32 2D tensor (mean and variance are non-constant) default options / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': The operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 2D tensor default options / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': The operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 3D tensor default options / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': The operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D tensor default options / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': The operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 5D tensor default options / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': The operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NCHW tensor options.axis=1 / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': The operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NHWC tensor options.axis=3 / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': The operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NCHW tensor options.scale / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': The operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NCHW tensor options.bias / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': The operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NCHW tensor options.epsilon / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': The operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NCHW tensor options.activation relu / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': The operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NHWC tensor all options / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': The operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 2D tensor (mean and variance are non-constant) default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 2D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 3D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 5D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NCHW tensor options.axis=1 / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NHWC tensor options.axis=3 / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NCHW tensor options.scale / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NCHW tensor options.bias / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NCHW tensor options.epsilon / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NCHW tensor options.activation relu / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NHWC tensor all options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/webnn/idlharness.https.any-expected.txt b/third_party/blink/web_tests/external/wpt/webnn/idlharness.https.any-expected.txt index 7af7d8a0..16cac1c 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/idlharness.https.any-expected.txt +++ b/third_party/blink/web_tests/external/wpt/webnn/idlharness.https.any-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 70 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 67 FAIL, 0 TIMEOUT, 0 NOTRUN. [FAIL] idl_test setup promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'input' on 'MLGraphBuilder': Failed to read the 'type' property from 'MLOperandDescriptor': Required member is undefined." [FAIL] NavigatorML must be primary interface of navigator @@ -52,8 +52,6 @@ assert_equals: property has wrong .length expected 1 but got 2 [FAIL] MLGraphBuilder interface: operation constant(double, optional MLOperandDataType) assert_equals: property has wrong .length expected 1 but got 2 -[FAIL] MLGraphBuilder interface: operation batchNormalization(MLOperand, MLOperand, MLOperand, optional MLBatchNormalizationOptions) - assert_own_property: interface prototype object missing non-static operation expected property "batchNormalization" missing [FAIL] MLGraphBuilder interface: operation gru(MLOperand, MLOperand, MLOperand, unsigned long, unsigned long, optional MLGruOptions) assert_own_property: interface prototype object missing non-static operation expected property "gru" missing [FAIL] MLGraphBuilder interface: operation gruCell(MLOperand, MLOperand, MLOperand, MLOperand, unsigned long, optional MLGruCellOptions) @@ -84,10 +82,6 @@ assert_own_property: interface prototype object missing non-static operation expected property "softplus" missing [FAIL] MLGraphBuilder interface: operation squeeze(MLOperand, optional MLSqueezeOptions) assert_own_property: interface prototype object missing non-static operation expected property "squeeze" missing -[FAIL] MLGraphBuilder interface: builder must inherit property "batchNormalization(MLOperand, MLOperand, MLOperand, optional MLBatchNormalizationOptions)" with the proper type - assert_inherits: property "batchNormalization" not found in prototype chain -[FAIL] MLGraphBuilder interface: calling batchNormalization(MLOperand, MLOperand, MLOperand, optional MLBatchNormalizationOptions) on builder with too few arguments must throw TypeError - assert_inherits: property "batchNormalization" not found in prototype chain [FAIL] MLGraphBuilder interface: builder must inherit property "gru(MLOperand, MLOperand, MLOperand, unsigned long, unsigned long, optional MLGruOptions)" with the proper type assert_inherits: property "gru" not found in prototype chain [FAIL] MLGraphBuilder interface: calling gru(MLOperand, MLOperand, MLOperand, unsigned long, unsigned long, optional MLGruOptions) on builder with too few arguments must throw TypeError
diff --git a/third_party/blink/web_tests/external/wpt/webnn/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/webnn/idlharness.https.any.worker-expected.txt index a465baa1..bf6000b 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/idlharness.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/external/wpt/webnn/idlharness.https.any.worker-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 77 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 74 FAIL, 0 TIMEOUT, 0 NOTRUN. [FAIL] idl_test setup promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'input' on 'MLGraphBuilder': Failed to read the 'type' property from 'MLOperandDescriptor': Required member is undefined." [FAIL] NavigatorML must be primary interface of navigator @@ -62,8 +62,6 @@ assert_equals: property has wrong .length expected 1 but got 2 [FAIL] MLGraphBuilder interface: operation build(MLNamedOperands) assert_own_property: interface prototype object missing non-static operation expected property "build" missing -[FAIL] MLGraphBuilder interface: operation batchNormalization(MLOperand, MLOperand, MLOperand, optional MLBatchNormalizationOptions) - assert_own_property: interface prototype object missing non-static operation expected property "batchNormalization" missing [FAIL] MLGraphBuilder interface: operation gru(MLOperand, MLOperand, MLOperand, unsigned long, unsigned long, optional MLGruOptions) assert_own_property: interface prototype object missing non-static operation expected property "gru" missing [FAIL] MLGraphBuilder interface: operation gruCell(MLOperand, MLOperand, MLOperand, MLOperand, unsigned long, optional MLGruCellOptions) @@ -98,10 +96,6 @@ assert_inherits: property "build" not found in prototype chain [FAIL] MLGraphBuilder interface: calling build(MLNamedOperands) on builder with too few arguments must throw TypeError assert_inherits: property "build" not found in prototype chain -[FAIL] MLGraphBuilder interface: builder must inherit property "batchNormalization(MLOperand, MLOperand, MLOperand, optional MLBatchNormalizationOptions)" with the proper type - assert_inherits: property "batchNormalization" not found in prototype chain -[FAIL] MLGraphBuilder interface: calling batchNormalization(MLOperand, MLOperand, MLOperand, optional MLBatchNormalizationOptions) on builder with too few arguments must throw TypeError - assert_inherits: property "batchNormalization" not found in prototype chain [FAIL] MLGraphBuilder interface: builder must inherit property "gru(MLOperand, MLOperand, MLOperand, unsigned long, unsigned long, optional MLGruOptions)" with the proper type assert_inherits: property "gru" not found in prototype chain [FAIL] MLGraphBuilder interface: calling gru(MLOperand, MLOperand, MLOperand, unsigned long, unsigned long, optional MLGruOptions) on builder with too few arguments must throw TypeError
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/service-worker/tentative/static-router/network-router-info-mainresource-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/service-worker/tentative/static-router/network-router-info-mainresource-expected.txt new file mode 100644 index 0000000..f75a63d --- /dev/null +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/service-worker/tentative/static-router/network-router-info-mainresource-expected.txt
@@ -0,0 +1,5 @@ +Verifies that the request head has static routing information on the main resource. +{ + ruleIdMatched : 1 +} +
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/service-worker/tentative/static-router/network-router-info-mainresource.js b/third_party/blink/web_tests/http/tests/inspector-protocol/service-worker/tentative/static-router/network-router-info-mainresource.js new file mode 100644 index 0000000..bfa2de34 --- /dev/null +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/service-worker/tentative/static-router/network-router-info-mainresource.js
@@ -0,0 +1,23 @@ +(async function(testRunner) { + var {page, session, dp} = await testRunner.startURL( + 'resources/simple.html', + 'Verifies that the request head has static routing information on the main resource.'); + const swHelper = + (await testRunner.loadScript('../../resources/service-worker-helper.js'))( + dp, session); + + await Promise.all([ + dp.Network.enable(), + dp.Page.enable(), + ]); + + await swHelper.installSWAndWaitForActivated( + 'service-worker-router-fetch-all.js'); + + await dp.Page.reload(); + + const responseReceived = await dp.Network.onceResponseReceived(); + testRunner.log(responseReceived.params.response.serviceWorkerRouterInfo); + + testRunner.completeTest(); +});
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/service-worker/tentative/static-router/resources/service-worker-router-fetch-all.js b/third_party/blink/web_tests/http/tests/inspector-protocol/service-worker/tentative/static-router/resources/service-worker-router-fetch-all.js new file mode 100644 index 0000000..19e890f --- /dev/null +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/service-worker/tentative/static-router/resources/service-worker-router-fetch-all.js
@@ -0,0 +1,11 @@ +'use strict'; + +self.addEventListener('install', async e => { + await e.registerRouter( + [{condition: {urlPattern: '*'}, source: 'fetch-event'}]); + self.skipWaiting(); +}); + +self.addEventListener('fetch', e => { + e.respondWith(new Response('fetch event')); +});
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/service-worker/tentative/static-router/resources/simple.html b/third_party/blink/web_tests/http/tests/inspector-protocol/service-worker/tentative/static-router/resources/simple.html new file mode 100644 index 0000000..3ae43a5 --- /dev/null +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/service-worker/tentative/static-router/resources/simple.html
@@ -0,0 +1,6 @@ +<!DOCTYPE html> +<html> +<head> + <title>simple HTML</title> +</head> +</html>
diff --git a/third_party/blink/web_tests/media/video-preload-first-frame-presented.html b/third_party/blink/web_tests/media/video-preload-first-frame-presented.html new file mode 100644 index 0000000..e52d0ad --- /dev/null +++ b/third_party/blink/web_tests/media/video-preload-first-frame-presented.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<title>Test that an "auto" preload of a media element will present at least one frame.</title> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<video preload="auto"></video> +<script> +async_test(function(t) { + var video = document.querySelector("video"); + video.requestVideoFrameCallback(t.step_func_done(function() { + var quality = video.getVideoPlaybackQuality(); + assert_greater_than_equal(quality.totalVideoFrames, 1, "totalVideoFrames >= 1"); + })); + video.src = "content/test.ogv"; +}); +</script>
diff --git a/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any-expected.txt b/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any-expected.txt index 886ad038..2f89b09 100644 --- a/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any-expected.txt +++ b/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any-expected.txt
@@ -1,27 +1,27 @@ This is a testharness.js-based test. [FAIL] batchNormalization float32 2D tensor (mean and variance are non-constant) default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." [FAIL] batchNormalization float32 2D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." [FAIL] batchNormalization float32 3D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." [FAIL] batchNormalization float32 4D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." [FAIL] batchNormalization float32 5D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." [FAIL] batchNormalization float32 4D NCHW tensor options.axis=1 / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." [FAIL] batchNormalization float32 4D NHWC tensor options.axis=3 / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." [FAIL] batchNormalization float32 4D NCHW tensor options.scale / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." [FAIL] batchNormalization float32 4D NCHW tensor options.bias / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." [FAIL] batchNormalization float32 4D NCHW tensor options.epsilon / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." [FAIL] batchNormalization float32 4D NCHW tensor options.activation relu / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." [FAIL] batchNormalization float32 4D NHWC tensor all options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any.worker-expected.txt index dbff80c..e742b3f 100644 --- a/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any.worker-expected.txt
@@ -1,51 +1,51 @@ This is a testharness.js-based test. [FAIL] batchNormalization float32 2D tensor (mean and variance are non-constant) default options / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. [FAIL] batchNormalization float32 2D tensor default options / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. [FAIL] batchNormalization float32 3D tensor default options / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. [FAIL] batchNormalization float32 4D tensor default options / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. [FAIL] batchNormalization float32 5D tensor default options / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. [FAIL] batchNormalization float32 4D NCHW tensor options.axis=1 / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. [FAIL] batchNormalization float32 4D NHWC tensor options.axis=3 / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. [FAIL] batchNormalization float32 4D NCHW tensor options.scale / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. [FAIL] batchNormalization float32 4D NCHW tensor options.bias / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. [FAIL] batchNormalization float32 4D NCHW tensor options.epsilon / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. [FAIL] batchNormalization float32 4D NCHW tensor options.activation relu / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. [FAIL] batchNormalization float32 4D NHWC tensor all options / sync - builder[operationName] is not a function + Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. [FAIL] batchNormalization float32 2D tensor (mean and variance are non-constant) default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 2D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 3D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 5D tensor default options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NCHW tensor options.axis=1 / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NHWC tensor options.axis=3 / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NCHW tensor options.scale / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NCHW tensor options.bias / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NCHW tensor options.epsilon / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NCHW tensor options.activation relu / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 4D NHWC tensor all options / async - promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" + promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/virtual/deprecate-unload/http/tests/inspector-protocol/permissions-policy-expected.txt b/third_party/blink/web_tests/virtual/deprecate-unload/http/tests/inspector-protocol/permissions-policy-expected.txt new file mode 100644 index 0000000..905837e --- /dev/null +++ b/third_party/blink/web_tests/virtual/deprecate-unload/http/tests/inspector-protocol/permissions-policy-expected.txt
@@ -0,0 +1,36 @@ +Verifies that we can successfully retrieve permissions policy state in frame tree +[ + [0] : { + allowed : false + feature : fullscreen + locator : { + blockReason : Header + frameId : <string> + } + } + [1] : { + allowed : false + feature : geolocation + locator : { + blockReason : Header + frameId : <string> + } + } + [2] : { + allowed : false + feature : unload + locator : { + blockReason : Header + frameId : <string> + } + } +] +{ + error : { + code : -32000 + message : No frame for given id found in this target + } + id : <number> + sessionId : <string> +} +
diff --git a/third_party/blink/web_tests/virtual/deprecate-unload/http/tests/navigation/image-css-load-in-subframe-unload-handler-expected.txt b/third_party/blink/web_tests/virtual/deprecate-unload/http/tests/navigation/image-css-load-in-subframe-unload-handler-expected.txt new file mode 100644 index 0000000..02c9218 --- /dev/null +++ b/third_party/blink/web_tests/virtual/deprecate-unload/http/tests/navigation/image-css-load-in-subframe-unload-handler-expected.txt
@@ -0,0 +1,2 @@ +CONSOLE ERROR: Permissions policy violation: unload is not allowed in this document. +PASS if no crash.
diff --git a/third_party/blink/web_tests/virtual/deprecate-unload/http/tests/security/window-events-pass-expected.txt b/third_party/blink/web_tests/virtual/deprecate-unload/http/tests/security/window-events-pass-expected.txt new file mode 100644 index 0000000..a9ba11e5 --- /dev/null +++ b/third_party/blink/web_tests/virtual/deprecate-unload/http/tests/security/window-events-pass-expected.txt
@@ -0,0 +1,5 @@ +CONSOLE ERROR: Permissions policy violation: unload is not allowed in this document. +Test that window event handlers set for initial document are kept if security check passes. There will be 2 'PASS' messages below if the test passes: + +FAIL +PASS: load fired.
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt index c7ee70f..3e47641 100644 --- a/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -1177,6 +1177,7 @@ [Worker] method abs [Worker] method add [Worker] method averagePool2d +[Worker] method batchNormalization [Worker] method buildSync [Worker] method ceil [Worker] method clamp
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt index 43e0fca..57dcd07 100644 --- a/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt +++ b/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
@@ -5621,6 +5621,7 @@ method abs method add method averagePool2d + method batchNormalization method build method ceil method clamp
diff --git a/third_party/catapult b/third_party/catapult index 180b79d..5c1525f 160000 --- a/third_party/catapult +++ b/third_party/catapult
@@ -1 +1 @@ -Subproject commit 180b79d05050132d75733851bcb06c251a537f66 +Subproject commit 5c1525f035b3ffeadd8a6e7750de77344e68112d
diff --git a/third_party/cpuinfo/README.chromium b/third_party/cpuinfo/README.chromium index 09b1c60..ff98976 100644 --- a/third_party/cpuinfo/README.chromium +++ b/third_party/cpuinfo/README.chromium
@@ -1,8 +1,8 @@ Name: cpuinfo Short Name: cpuinfo URL: https://github.com/pytorch/cpuinfo -Version: d6860c477c99f1fce9e28eb206891af3c0e1a1d7 -Date: 2023-11-07 +Version: ef634603954d88d2643d5809011288b890ac126e +Date: 2023-11-20 License: BSD License File: src/LICENSE Security Critical: Yes
diff --git a/third_party/cpuinfo/src b/third_party/cpuinfo/src index d6860c4..ef63460 160000 --- a/third_party/cpuinfo/src +++ b/third_party/cpuinfo/src
@@ -1 +1 @@ -Subproject commit d6860c477c99f1fce9e28eb206891af3c0e1a1d7 +Subproject commit ef634603954d88d2643d5809011288b890ac126e
diff --git a/third_party/cros-components/src b/third_party/cros-components/src index 99998f1..4a3a8e0 160000 --- a/third_party/cros-components/src +++ b/third_party/cros-components/src
@@ -1 +1 @@ -Subproject commit 99998f1608c8b13dab09cdc0585a0f8007211080 +Subproject commit 4a3a8e04f11a06540a2b286d3959ac1b4b81ccb0
diff --git a/third_party/dawn b/third_party/dawn index f56616d..b61659d7 160000 --- a/third_party/dawn +++ b/third_party/dawn
@@ -1 +1 @@ -Subproject commit f56616d501a644383b7abe9848a905aece2a26da +Subproject commit b61659d71d467bb4f6f0ab1bcd8b2592383c49ef
diff --git a/third_party/depot_tools b/third_party/depot_tools index f078723..38b8de0 160000 --- a/third_party/depot_tools +++ b/third_party/depot_tools
@@ -1 +1 @@ -Subproject commit f078723bf4a546a5b9c5c2c10734d0a37f684b69 +Subproject commit 38b8de056ebb9d0aa138f09907fa83c5b6107bb5
diff --git a/third_party/devtools-frontend-internal b/third_party/devtools-frontend-internal index c4f2afc..b53978f 160000 --- a/third_party/devtools-frontend-internal +++ b/third_party/devtools-frontend-internal
@@ -1 +1 @@ -Subproject commit c4f2afc97855cd2f0b951e952e0bef4f135e8eda +Subproject commit b53978fe7888e7831b6acb4698fae39f734f6524
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index fd10bc6..90df493 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit fd10bc6f17bc4aa259e08d8919652322981f08c5 +Subproject commit 90df4938501d1d93882c0e4b728e5869203fce92
diff --git a/third_party/eigen3/README.chromium b/third_party/eigen3/README.chromium index c990c72e..59ee1b1 100644 --- a/third_party/eigen3/README.chromium +++ b/third_party/eigen3/README.chromium
@@ -1,8 +1,8 @@ Name: Eigen Short Name: eigen3 URL: https://gitlab.com/libeigen/eigen -Version: aa6964bf3a34fd607837dd8123bc42465185c4f8 -Date: 2023-10-26 +Version: 3cf6bb6f1ce9cd3cd6bdc43cdcfae7f4822ff2c3 +Date: 2023-11-20 License: MPL 2 License File: LICENSE Security Critical: Yes
diff --git a/third_party/eigen3/src b/third_party/eigen3/src index aa6964b..3cf6bb6 160000 --- a/third_party/eigen3/src +++ b/third_party/eigen3/src
@@ -1 +1 @@ -Subproject commit aa6964bf3a34fd607837dd8123bc42465185c4f8 +Subproject commit 3cf6bb6f1ce9cd3cd6bdc43cdcfae7f4822ff2c3
diff --git a/third_party/pdfium b/third_party/pdfium index a5bb284..bb8fd49 160000 --- a/third_party/pdfium +++ b/third_party/pdfium
@@ -1 +1 @@ -Subproject commit a5bb284fd0387fe11def18f1048516fa60313c77 +Subproject commit bb8fd49d1000b558aaa017d52936cfcadb1795fd
diff --git a/third_party/tflite/README.chromium b/third_party/tflite/README.chromium index 36da3a0..39e67e8 100644 --- a/third_party/tflite/README.chromium +++ b/third_party/tflite/README.chromium
@@ -1,8 +1,8 @@ Name: TensorFlow Lite Short Name: tflite URL: https://github.com/tensorflow/tensorflow -Version: 1f9ffe6c62b9418f6ff131d7b38ae17f3d1df006 -Date: 2023-11-13 +Version: 1a6ed44670279ff61e9d984067127acf5704344f +Date: 2023-11-20 License: Apache 2.0 License File: LICENSE Security Critical: Yes
diff --git a/third_party/tflite/src b/third_party/tflite/src index 1f9ffe6..1a6ed44 160000 --- a/third_party/tflite/src +++ b/third_party/tflite/src
@@ -1 +1 @@ -Subproject commit 1f9ffe6c62b9418f6ff131d7b38ae17f3d1df006 +Subproject commit 1a6ed44670279ff61e9d984067127acf5704344f
diff --git a/third_party/vulkan-deps b/third_party/vulkan-deps index cf897fa..856d90f 160000 --- a/third_party/vulkan-deps +++ b/third_party/vulkan-deps
@@ -1 +1 @@ -Subproject commit cf897faaa6670b6196106f53d2843a6b77ff1a6e +Subproject commit 856d90fb41aaf1b662652010ac22abbcb7b7b8ab
diff --git a/third_party/webrtc b/third_party/webrtc index a9d497b..a37b29f 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit a9d497b52dc21497fdfd0e8c03ab2f8559e02d15 +Subproject commit a37b29f3a9f21eef4190f0d232aff2ef19819ef4
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 39d0d20..f230033 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -5230,6 +5230,14 @@ <int value="2" label="Bad Rationalization"/> </enum> +<enum name="AutofillRiskBasedAuthEvent"> + <int value="0" label="Completed unmasking without further authentication"/> + <int value="1" + label="Further authentications are needed to retrieve the card"/> + <int value="2" label="The authentication was cancelled"/> + <int value="3" label="Unexpected errors"/> +</enum> + <enum name="AutofillSaveCardRequestExpirationDateReason"> <int value="0" label="Has empty month only"/> <int value="1" label="Has empty year only"/> @@ -14521,6 +14529,7 @@ <enum name="DevToolsMediaType"> <int value="0" label="Unknown"/> + <int value="1" label="text/javascript (Deprecated)"/> <int value="2" label="text/css"/> <int value="3" label="text/html"/> <int value="4" label="application/xml"/> @@ -17564,6 +17573,7 @@ <int value="548" label="INPUT_METHOD_PRIVATE_ON_LANGUAGE_PACK_STATUS_CHANGED"/> <int value="549" label="OS_DIAGNOSTICS_ON_VOLUME_BUTTON_ROUTINE_FINISHED"/> + <int value="550" label="OS_DIAGNOSTICS_ON_FAN_ROUTINE_FINISHED"/> </enum> <enum name="ExtensionFromWebstoreInconcistencyEnum"> @@ -19496,6 +19506,8 @@ <int value="1842" label="PDFVIEWERPRIVATE_SETPDFPLUGINATTRIBUTES"/> <int value="1843" label="ACCESSIBILITY_PRIVATE_SETCURSORPOSITION"/> <int value="1844" label="ACCESSIBILITY_PRIVATE_GETTTSDLCCONTENTS"/> + <int value="1845" label="OS_DIAGNOSTICS_CREATEFANROUTINE"/> + <int value="1846" label="OS_DIAGNOSTICS_ISFANROUTINEARGUMENTSUPPORTED"/> </enum> <enum name="ExtensionInProgressRequestState"> @@ -25659,6 +25671,15 @@ <int value="5" label="kDbCleanOutdatedDataError"/> </enum> +<enum name="FederatedTrainingConditionResult"> + <int value="0" label="kPass"/> + <int value="1" label="kFailed"/> + <int value="2" label="kLowBattery"/> + <int value="3" label="kBatterySaverMode"/> + <int value="4" label="kMeteredNetwork"/> + <int value="5" label="kMemoryPressureHigh"/> +</enum> + <enum name="FeedbackAppContactUserConsentType"> <int value="0" label="kNoEmail"/> <int value="1" label="kYes"/> @@ -46265,6 +46286,7 @@ <int value="21" label="Sync error cancelled and deleted"/> <int value="22" label="Sync error cancelled and trashed"/> <int value="23" label="Upload not started: Reauthentication needed"/> + <int value="24" label="Success after reauthentication"/> </enum> <enum name="OfficeFilesUseOutsideDriveHook">
diff --git a/tools/metrics/histograms/metadata/accessibility/histograms.xml b/tools/metrics/histograms/metadata/accessibility/histograms.xml index 8023602..bb65752 100644 --- a/tools/metrics/histograms/metadata/accessibility/histograms.xml +++ b/tools/metrics/histograms/metadata/accessibility/histograms.xml
@@ -499,7 +499,7 @@ </histogram> <histogram name="Accessibility.Android.UserFontSizePref.Change" units="%" - expires_after="2024-01-14"> + expires_after="2024-05-19"> <owner>twellington@chromium.org</owner> <owner>skym@chromium.org</owner> <summary> @@ -510,7 +510,7 @@ </histogram> <histogram name="Accessibility.Android.UserFontSizePref.OnStartup" units="%" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>twellington@chromium.org</owner> <owner>skym@chromium.org</owner> <summary> @@ -1888,7 +1888,7 @@ </histogram> <histogram name="Accessibility.Performance.AXObjectCacheImpl.Incremental" - units="bytes" expires_after="2024-02-11"> + units="bytes" expires_after="2024-05-19"> <owner>kevers@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2338,7 +2338,7 @@ </histogram> <histogram name="Accessibility.ScreenAI.VisualAnnotator.NodesCount" - units="count" expires_after="2024-03-10"> + units="count" expires_after="2024-05-19"> <owner>kyungjunlee@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -2544,7 +2544,7 @@ </histogram> <histogram name="DomDistiller.Time.ViewingReaderModePage" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mdjones@chromium.org</owner> <summary> Records the amount of time a user spent on a Reader Mode Page.
diff --git a/tools/metrics/histograms/metadata/android/histograms.xml b/tools/metrics/histograms/metadata/android/histograms.xml index 93744b7d..24f4ffd 100644 --- a/tools/metrics/histograms/metadata/android/histograms.xml +++ b/tools/metrics/histograms/metadata/android/histograms.xml
@@ -252,7 +252,7 @@ </histogram> <histogram name="Android.AdaptiveToolbarButton.Settings.Changed" - enum="AdaptiveToolbarRadioButtonState" expires_after="2024-03-17"> + enum="AdaptiveToolbarRadioButtonState" expires_after="2024-05-19"> <owner>shaktisahu@chromium.org</owner> <owner>chrome-segmentation-platform@google.com</owner> <summary> @@ -263,7 +263,7 @@ </histogram> <histogram name="Android.AdaptiveToolbarButton.Settings.Startup" - enum="AdaptiveToolbarRadioButtonState" expires_after="2024-03-17"> + enum="AdaptiveToolbarRadioButtonState" expires_after="2024-05-19"> <owner>shaktisahu@chromium.org</owner> <owner>chrome-segmentation-platform@google.com</owner> <summary> @@ -295,7 +295,7 @@ </histogram> <histogram name="Android.AdaptiveToolbarButton.Variant.OnPageLoad" - enum="AdaptiveToolbarButtonVariant" expires_after="2024-03-17"> + enum="AdaptiveToolbarButtonVariant" expires_after="2024-05-19"> <owner>shaktisahu@chromium.org</owner> <owner>chrome-segmentation-platform@google.com</owner> <summary> @@ -308,7 +308,7 @@ </histogram> <histogram name="Android.AdaptiveToolbarButton.Variant.OnStartNavigation" - enum="AdaptiveToolbarButtonVariant" expires_after="2024-03-17"> + enum="AdaptiveToolbarButtonVariant" expires_after="2024-05-19"> <owner>shaktisahu@chromium.org</owner> <owner>chrome-segmentation-platform@google.com</owner> <summary> @@ -365,7 +365,7 @@ </histogram> <histogram name="Android.ArmCpuPart" enum="ArmCpuPart" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rsesek@chromium.org</owner> <owner>clank-security@google.com</owner> <summary> @@ -586,7 +586,7 @@ </histogram> <histogram name="Android.BackPress.Failure" enum="BackPressConsumer" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>lazzzis@chromium.org</owner> <owner>src/chrome/browser/back_press/android/OWNERS</owner> <summary> @@ -852,7 +852,7 @@ </histogram> <histogram name="Android.DarkTheme.EnabledState" enum="BooleanEnabled" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>twellington@chromium.org</owner> <owner>clank-app-team@google.com</owner> <summary> @@ -886,7 +886,7 @@ </histogram> <histogram name="Android.DeviceSize.LargestDisplaySize2" units="dp" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>twellington@chromium.org</owner> <owner>shuyng@google.com</owner> <owner>clank-app-team@google.com</owner> @@ -898,7 +898,7 @@ </histogram> <histogram name="Android.DeviceSize.ScreenSizeInTensOfInches" - units="10x inches" expires_after="2024-03-17"> + units="10x inches" expires_after="2024-05-19"> <owner>twellington@chromium.org</owner> <owner>aishwaryarj@google.com</owner> <owner>clank-app-team@google.com</owner> @@ -910,7 +910,7 @@ </histogram> <histogram name="Android.DeviceSize.SmallestDisplaySize2" units="dp" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>twellington@chromium.org</owner> <owner>shuyng@google.com</owner> <owner>clank-app-team@google.com</owner> @@ -1599,7 +1599,7 @@ </histogram> <histogram name="Android.IncognitoReauth.PromoAcceptedOrDismissed" - enum="IncognitoReauthPromoActionType" expires_after="2024-03-17"> + enum="IncognitoReauthPromoActionType" expires_after="2024-05-19"> <owner>roagarwal@chromium.org</owner> <owner>chrome-incognito@google.com</owner> <summary> @@ -1625,7 +1625,7 @@ </histogram> <histogram name="Android.IncognitoReauth.ToggleOnOrOff" enum="BooleanToggled" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>roagarwal@chromium.org</owner> <owner>chrome-incognito@google.com</owner> <summary> @@ -1653,7 +1653,7 @@ </histogram> <histogram name="Android.Intent.BlockedExternalNavLastGestureTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mthiesse@chromium.org</owner> <owner>yfriedman@chromium.org</owner> <summary> @@ -1721,7 +1721,7 @@ </histogram> <histogram base="true" name="Android.IsolatedSplits.ContextCreateTime" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <!-- Name completed by histogram_suffixes name="AndroidFeatureModuleName" --> <owner>cduvall@chromium.org</owner> @@ -1758,7 +1758,7 @@ </histogram> <histogram name="Android.KernelVersion" enum="AndroidKernelVersion" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rsesek@chromium.org</owner> <summary> Reports the kernel major and minor version from the utsname.release field. @@ -1807,7 +1807,7 @@ </histogram> <histogram name="Android.Messages.Enqueued" enum="MessageIdentifier" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>lazzzis@chromium.org</owner> <owner>src/components/messages/OWNERS</owner> <summary> @@ -1819,7 +1819,7 @@ </histogram> <histogram name="Android.Messages.Enqueued.Hidden" enum="MessageIdentifier" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>lazzzis@chromium.org</owner> <owner>src/components/messages/OWNERS</owner> <summary> @@ -1845,7 +1845,7 @@ </histogram> <histogram name="Android.Messages.Enqueued.Visible" enum="MessageIdentifier" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>lazzzis@chromium.org</owner> <owner>src/components/messages/OWNERS</owner> <summary> @@ -1857,7 +1857,7 @@ </histogram> <histogram name="Android.Messages.Stacking" enum="StackingAnimationType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>lazzzis@chromium.org</owner> <owner>src/components/messages/OWNERS</owner> <summary> @@ -1868,7 +1868,7 @@ </histogram> <histogram name="Android.Messages.Stacking.Hidden" enum="MessageIdentifier" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>lazzzis@chromium.org</owner> <owner>src/components/messages/OWNERS</owner> <summary> @@ -1878,7 +1878,7 @@ </histogram> <histogram name="Android.Messages.Stacking.Hiding" enum="MessageIdentifier" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>lazzzis@chromium.org</owner> <owner>src/components/messages/OWNERS</owner> <summary> @@ -1888,7 +1888,7 @@ </histogram> <histogram name="Android.Messages.Stacking.ThreeStacked" - enum="StackingAnimationThreeStackedType" expires_after="2024-03-17"> + enum="StackingAnimationThreeStackedType" expires_after="2024-05-19"> <owner>lazzzis@chromium.org</owner> <owner>src/components/messages/OWNERS</owner> <summary> @@ -1945,7 +1945,7 @@ </histogram> <histogram name="Android.MultiInstance.MaxInstanceCount" units="instances" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jinsukkim@chromium.org</owner> <owner>twellington@chromium.org</owner> <owner>clank-app-team@google.com</owner> @@ -1971,7 +1971,7 @@ </histogram> <histogram name="Android.MultiInstance.NumActivities" units="activities" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jinsukkim@chromium.org</owner> <owner>twellington@chromium.org</owner> <owner>clank-app-team@google.com</owner> @@ -1986,7 +1986,7 @@ </histogram> <histogram name="Android.MultiInstance.NumInstances" units="instances" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jinsukkim@chromium.org</owner> <owner>twellington@chromium.org</owner> <owner>clank-app-team@google.com</owner> @@ -2040,7 +2040,7 @@ </histogram> <histogram name="Android.NTP.Impression" enum="NTPImpressionType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>finkm@chromium.org</owner> <summary> Counts impressions of the NTP on Android. It also counts potential @@ -2321,7 +2321,7 @@ </histogram> <histogram name="Android.Omnibox.SuggestionView.CreatedType" - enum="OmniboxSuggestionUiType" expires_after="2024-03-17"> + enum="OmniboxSuggestionUiType" expires_after="2024-05-19"> <owner>ender@google.com</owner> <owner>gangwu@chromium.org</owner> <owner>rongtan@chromium.org</owner> @@ -2390,7 +2390,7 @@ </histogram> <histogram name="Android.Omnibox.SuggestionView.ReusedType" - enum="OmniboxSuggestionUiType" expires_after="2024-03-17"> + enum="OmniboxSuggestionUiType" expires_after="2024-05-19"> <owner>ender@google.com</owner> <owner>gangwu@chromium.org</owner> <owner>rongtan@chromium.org</owner> @@ -2413,7 +2413,7 @@ </histogram> <histogram name="Android.Omnibox.SuggestionView.SessionViewsCreated" - units="count" expires_after="2024-03-17"> + units="count" expires_after="2024-05-19"> <owner>ender@google.com</owner> <owner>rongtan@google.com</owner> <summary> @@ -2439,7 +2439,7 @@ </histogram> <histogram name="Android.Omnibox.SuggestionView.SessionViewsReused" units="%" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ender@google.com</owner> <owner>rongtan@google.com</owner> <summary> @@ -2825,7 +2825,7 @@ <histogram name="Android.PartnerCustomization.TaskCompletion.{CustomizationDelegate}" - enum="PartnerTaskCompletion" expires_after="2024-03-17"> + enum="PartnerTaskCompletion" expires_after="2024-05-19"> <owner>donnd@chromium.org</owner> <owner>wenyufu@chromium.org</owner> <summary> @@ -3204,7 +3204,7 @@ </histogram> <histogram name="Android.PlayServices.Version" units="versioncode" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>twellington@chromium.org</owner> <owner>tedchoc@chromium.org</owner> <summary> @@ -3269,7 +3269,7 @@ </histogram> <histogram name="Android.RequestDesktopSite.UseDesktopUserAgent" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>gangwu@chromium.org</owner> <owner>fgorski@chromium.org</owner> <summary> @@ -3279,7 +3279,7 @@ </histogram> <histogram name="Android.RequestDesktopSite.UserSwitchToDesktop" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>gangwu@chromium.org</owner> <owner>fgorski@chromium.org</owner> <summary> @@ -3547,7 +3547,7 @@ </histogram> <histogram name="Android.ShowSelectionMenuSourceType" enum="MenuSourceType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mvanouwerkerk@chromium.org</owner> <owner>wbjacksonjr@chromium.org</owner> <summary> @@ -3568,7 +3568,7 @@ </histogram> <histogram name="Android.StrictMode.OverrideUrlLoadingTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>yfriedman@chromium.org</owner> <owner>wnwen@chromium.org</owner> <summary> @@ -3797,7 +3797,7 @@ </histogram> <histogram name="Android.TabNavigationIntercept.Scheme" - enum="NavigationInterceptScheme" expires_after="2024-03-17"> + enum="NavigationInterceptScheme" expires_after="2024-05-19"> <owner>rbyers@chromium.org</owner> <owner>mthiesse@chromium.org</owner> <summary> @@ -4092,7 +4092,7 @@ </histogram> <histogram name="Android.TopToolbar.BlockCaptureReason" - enum="TopToolbarBlockCaptureReason" expires_after="2024-03-17"> + enum="TopToolbarBlockCaptureReason" expires_after="2024-05-19"> <owner>skym@chromium.org</owner> <owner>seacow@google.com</owner> <summary> @@ -5158,7 +5158,7 @@ </histogram> <histogram name="Android.WebView.Metrics.PackagesAllowList.RecordStatus" - enum="AppPackageNameLoggingRuleStatus" expires_after="2024-03-17"> + enum="AppPackageNameLoggingRuleStatus" expires_after="2024-05-19"> <owner>avvall@chromium.org</owner> <owner>src/android_webview/OWNERS</owner> <summary> @@ -5270,7 +5270,7 @@ </histogram> <histogram name="Android.WebView.NonEmbeddedMetrics.TransmissionResult" - enum="AndroidWebViewDevUiMetricsTransmission" expires_after="2024-03-17"> + enum="AndroidWebViewDevUiMetricsTransmission" expires_after="2024-05-19"> <owner>ntfschr@chromium.org</owner> <owner>hazems@chromium.org</owner> <owner>src/android_webview/OWNERS</owner> @@ -5846,7 +5846,7 @@ </histogram> <histogram name="AndroidSearchEngineLogo.Events" - enum="AndroidSearchEngineLogoEvents" expires_after="2024-01-20"> + enum="AndroidSearchEngineLogoEvents" expires_after="2024-05-19"> <owner>wylieb@chromium.org</owner> <owner>fgorski@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/apps/histograms.xml b/tools/metrics/histograms/metadata/apps/histograms.xml index c1c8026..3e606652 100644 --- a/tools/metrics/histograms/metadata/apps/histograms.xml +++ b/tools/metrics/histograms/metadata/apps/histograms.xml
@@ -451,7 +451,7 @@ </histogram> <histogram name="Apps.AppList.AppSearchProvider.QueryTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>laurencom@chromium.org</owner> <owner>tbarzic@chromium.org</owner> <summary> @@ -632,7 +632,7 @@ </histogram> <histogram name="Apps.AppList.GameProvider.SearchStatus" - enum="GameProviderSearchStatus" expires_after="2024-03-17"> + enum="GameProviderSearchStatus" expires_after="2024-05-19"> <owner>laurencom@chromium.org</owner> <owner>amandadeacon@chromium.org</owner> <summary> @@ -1190,7 +1190,7 @@ </histogram> <histogram name="Apps.AppList.SearchQueryLength.Apps" units="characters" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dgrebenyuk@google.com</owner> <owner>ypitsishin@google.com</owner> <owner>chromeos-launcher-search@google.com</owner> @@ -1201,7 +1201,7 @@ </histogram> <histogram name="Apps.AppList.SearchResultRemovalDecision" - enum="AppListResultRemovalConfirmation" expires_after="2024-03-17"> + enum="AppListResultRemovalConfirmation" expires_after="2024-05-19"> <owner>tbarzic@chromium.org</owner> <owner>gzadina@google.com</owner> <summary> @@ -1701,7 +1701,7 @@ </histogram> <histogram name="Apps.AppListLauncherClickedSearchQueryLength" - units="characters" expires_after="2024-03-17"> + units="characters" expires_after="2024-05-19"> <owner>laurencom@chromium.org</owner> <owner>tby@chromium.org</owner> <summary> @@ -2376,7 +2376,7 @@ </histogram> <histogram name="Apps.QuickAppIconLoadTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mmourgos@chromium.org</owner> <owner>src/ash/app_list/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/arc/histograms.xml b/tools/metrics/histograms/metadata/arc/histograms.xml index 45595fd..b1a8f0af 100644 --- a/tools/metrics/histograms/metadata/arc/histograms.xml +++ b/tools/metrics/histograms/metadata/arc/histograms.xml
@@ -261,7 +261,7 @@ </histogram> <histogram name="Arc.Accessibility.WindowCount" enum="ArcAccessibilityFeature" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sahok@chromium.org</owner> <owner>arc-framework@google.com</owner> <summary> @@ -1360,7 +1360,7 @@ </histogram> <histogram name="Arc.LaunchedWithGhostWindow" units="apps" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sstan@chromium.org</owner> <owner>nancylingwang@chromium.org</owner> <summary>The number of ARC apps launched with ghost window.</summary> @@ -1512,7 +1512,7 @@ </histogram> <histogram name="Arc.Net.ArcNetworkEvent" enum="ArcNetworkEvent" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>hugobenichi@google.com</owner> <owner>cros-networking@google.com</owner> <summary> @@ -2034,7 +2034,7 @@ </histogram> <histogram name="Arc.SdkVersionUpgradeType" enum="ArcSdkVersionUpgradeType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>niwa@google.com</owner> <owner>arcvm-eng@google.com</owner> <summary> @@ -2598,7 +2598,7 @@ </histogram> <histogram name="Arc.Wayland.LateTiming.Duration{WaylandEventType}" units="ms" - expires_after="2024-03-16"> + expires_after="2024-05-19"> <owner>alanding@google.com</owner> <owner>arc-performance@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/ash/histograms.xml b/tools/metrics/histograms/metadata/ash/histograms.xml index 1e01362b..50e0dfc 100644 --- a/tools/metrics/histograms/metadata/ash/histograms.xml +++ b/tools/metrics/histograms/metadata/ash/histograms.xml
@@ -1713,7 +1713,7 @@ <histogram name="Ash.CaptureModeController.DemoToolsEnabledOnRecordingStart.{TabletOrClamshell}" - enum="BooleanEnabled" expires_after="2024-03-17"> + enum="BooleanEnabled" expires_after="2024-05-19"> <owner>michelefan@chromium.org</owner> <owner>gzadina@google.com</owner> <summary> @@ -1838,7 +1838,7 @@ </histogram> <histogram name="Ash.CaptureModeController.QuickAction" - enum="CaptureQuickAction" expires_after="2024-03-17"> + enum="CaptureQuickAction" expires_after="2024-05-19"> <owner>shidi@chromium.org</owner> <summary> Track all quick actions on screenshot notification. Including: Edit in @@ -1932,7 +1932,7 @@ </histogram> <histogram name="Ash.CaptureModeController.ScreenshotsPerWeek" units="int" - expires_after="2024-03-10"> + expires_after="2024-05-19"> <owner>afakhry@chromium.org</owner> <owner>gzadina@google.com</owner> <summary> @@ -2039,7 +2039,7 @@ </histogram> <histogram name="Ash.DarkTheme.SystemTray.IsDarkModeEnabled" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>minch@chromium.org</owner> <owner>changmar@chromium.org</owner> <summary> @@ -2088,7 +2088,7 @@ </histogram> <histogram name="Ash.Desks.AnimationLatency.DeskActivation" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>afakhry@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> <owner>chromeos-wmp@google.com</owner> @@ -2161,7 +2161,7 @@ </histogram> <histogram name="Ash.Desks.CloseAllTotal" enum="BooleanHit" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>aprilzhou@google.com</owner> <owner>janetmac@chromium.org</owner> <summary> @@ -2173,7 +2173,7 @@ </histogram> <histogram name="Ash.Desks.CloseAllUndo" enum="BooleanHit" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>aprilzhou@google.com</owner> <owner>janetmac@chromium.org</owner> <summary> @@ -2287,7 +2287,7 @@ </histogram> <histogram name="Ash.Desks.DeskLifetime_{DeskIndex}" units="hr" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>afakhry@chromium.org</owner> <owner>janetmac@chromium.org</owner> <summary> @@ -2320,7 +2320,7 @@ </histogram> <histogram name="Ash.Desks.DesksSwitch" enum="DesksSwitchSource" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>afakhry@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> <summary> @@ -2589,7 +2589,7 @@ </histogram> <histogram name="Ash.Desks.RemoveDesk" enum="DesksCreationRemovalSource" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>afakhry@chromium.org</owner> <owner>janetmac@chromium.org</owner> <summary> @@ -2599,7 +2599,7 @@ </histogram> <histogram name="Ash.Desks.RemoveDeskType" enum="DeskCloseType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>aprilzhou@google.com</owner> <owner>janetmac@chromium.org</owner> <summary> @@ -2943,7 +2943,7 @@ </histogram> <histogram name="Ash.Display.InternalDisplay.ActiveEffectiveResolution" - enum="EffectiveResolution" expires_after="2024-03-17"> + enum="EffectiveResolution" expires_after="2024-05-19"> <owner>malaykeshav@chromium.org</owner> <owner>oshima@chromium.org</owner> <summary> @@ -3914,7 +3914,7 @@ </histogram> <histogram name="Ash.Login.Login.AuthMethod.Used.TabletMode" enum="AuthMethod" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>emaamari@google.com</owner> <owner>cros-lurs@google.com</owner> <summary> @@ -4056,7 +4056,7 @@ </histogram> <histogram base="true" name="Ash.LoginAnimation.Smoothness" units="%" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>oshima@chromium.org</owner> <owner>chromeos-wmp@google.com</owner> <!-- Name completed by histogram_suffixes @@ -4296,7 +4296,7 @@ </histogram> <histogram name="Ash.NightLight.ScheduleType" enum="AshNightLightScheduleType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>afakhry@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> <summary> @@ -4407,7 +4407,7 @@ </histogram> <histogram name="Ash.NotificationPopup.AnimationSmoothness" units="%" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>leandre@chromium.org</owner> <owner>amehfooz@chromium.org</owner> <owner>tbarzic@chromium.org</owner> @@ -4606,7 +4606,7 @@ </histogram> <histogram name="Ash.NotifierFramework.Nudge.ShownCount" - enum="NudgeCatalogName" expires_after="2024-03-17"> + enum="NudgeCatalogName" expires_after="2024-05-19"> <owner>kradtke@chromium.org</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -4616,7 +4616,7 @@ </histogram> <histogram name="Ash.NotifierFramework.Nudge.TimeToAction.{TimeRange}" - enum="NudgeCatalogName" expires_after="2024-03-17"> + enum="NudgeCatalogName" expires_after="2024-05-19"> <owner>kradtke@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -4663,7 +4663,7 @@ </histogram> <histogram name="Ash.NotifierFramework.Toast.ShownCount" - enum="ToastCatalogName" expires_after="2024-03-17"> + enum="ToastCatalogName" expires_after="2024-05-19"> <owner>kradtke@chromium.org</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -4673,7 +4673,7 @@ </histogram> <histogram name="Ash.NotifierFramework.Toast.TimeInQueue" units="seconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>kradtke@chromium.org</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -4683,7 +4683,7 @@ <histogram name="Ash.NotifierFramework.{UnpinnedOrPinned}SystemNotification.Added" - enum="NotificationCatalogName" expires_after="2024-03-17"> + enum="NotificationCatalogName" expires_after="2024-05-19"> <owner>kradtke@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -4720,7 +4720,7 @@ <histogram name="Ash.NotifierFramework.{UnpinnedOrPinned}SystemNotification.Popup.Dismissed.{TimeRange}" - enum="NotificationCatalogName" expires_after="2024-03-17"> + enum="NotificationCatalogName" expires_after="2024-05-19"> <owner>kradtke@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -4743,7 +4743,7 @@ <histogram name="Ash.NotifierFramework.{UnpinnedOrPinned}SystemNotification.Popup.ShownCount" - enum="NotificationCatalogName" expires_after="2024-03-17"> + enum="NotificationCatalogName" expires_after="2024-05-19"> <owner>kradtke@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -5245,7 +5245,7 @@ </histogram> <histogram name="Ash.Personalization.KeyboardBacklight.OpenZoneCustomization" - units="BooleanHit" expires_after="2024-03-20"> + units="BooleanHit" expires_after="2024-05-19"> <owner>thuongphan@chromium.org</owner> <owner>assistive-eng@google.com</owner> <summary> @@ -5343,7 +5343,7 @@ </histogram> <histogram name="Ash.PostLoginGlanceables.HypotheticalFetchEvent.{Delay}" - enum="DataFetchEventSource" expires_after="2024-03-17"> + enum="DataFetchEventSource" expires_after="2024-05-19"> <owner>mmourgos@chromium.org</owner> <owner>chromeos-launcher@google.com</owner> <summary> @@ -6287,7 +6287,7 @@ </histogram> <histogram name="Ash.SplitView.TimeInSplitView" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>xdai@chromium.org</owner> <owner>nupurjain@chromim.org</owner> <owner>fanafan@chromium.org</owner> @@ -6536,7 +6536,7 @@ </histogram> <histogram name="Ash.SwipeHomeToOverviewGesture" - enum="SwipeHomeToOverviewResult" expires_after="2024-03-17"> + enum="SwipeHomeToOverviewResult" expires_after="2024-05-19"> <owner>andrewxu@chromium.org</owner> <owner>tbarzic@chromium.org</owner> <summary> @@ -6820,7 +6820,7 @@ </histogram> <histogram name="Ash.VideoConference.NumberOfRepeatedShows" units="shows" - expires_after="2024-03-16"> + expires_after="2024-05-19"> <owner>leandre@chromium.org</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -6831,7 +6831,7 @@ </histogram> <histogram name="Ash.VideoConference.ReturnToApp.Click" - enum="VideoConferenceAppType" expires_after="2024-03-16"> + enum="VideoConferenceAppType" expires_after="2024-05-19"> <owner>leandre@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -6880,7 +6880,7 @@ </histogram> <histogram name="Ash.VideoConferenceTray.BackgroundBlur.Click" - enum="BackgroundBlurState" expires_after="2024-03-16"> + enum="BackgroundBlurState" expires_after="2024-05-19"> <owner>leandre@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -6891,7 +6891,7 @@ </histogram> <histogram name="Ash.VideoConferenceTray.BackgroundBlur.InitialState" - enum="BackgroundBlurState" expires_after="2024-03-16"> + enum="BackgroundBlurState" expires_after="2024-05-19"> <owner>newcomer@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -6911,7 +6911,7 @@ </histogram> <histogram name="Ash.VideoConferenceTray.ToggleBubbleButton.Click" - enum="BooleanOpened" expires_after="2024-03-16"> + enum="BooleanOpened" expires_after="2024-05-19"> <owner>leandre@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -6921,7 +6921,7 @@ </histogram> <histogram name="Ash.VideoConferenceTray.{Device}MuteButton.Click" - enum="BooleanMuted" expires_after="2024-03-16"> + enum="BooleanMuted" expires_after="2024-05-19"> <owner>leandre@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -6936,7 +6936,7 @@ </histogram> <histogram name="Ash.VideoConferenceTray.{EffectName}.Click" - enum="BooleanEnabled" expires_after="2024-03-16"> + enum="BooleanEnabled" expires_after="2024-05-19"> <owner>leandre@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -6982,7 +6982,7 @@ </histogram> <histogram name="Ash.Wallpaper.CustomLayout" enum="WallpaperLayout" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>xiaohuic@chromium.org</owner> <owner>assistive-eng@chromium.org</owner> <summary> @@ -7111,7 +7111,7 @@ </histogram> <histogram name="Ash.Wallpaper.Type" enum="WallpaperType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>kuscher@google.com</owner> <owner>assistive-eng@google.com</owner> <summary> @@ -7286,7 +7286,7 @@ </histogram> <histogram name="Ash.Window.Snap.DeviceOrientation" enum="DeviceOrientation" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>cattalyya@chromium.org</owner> <owner>afakhry@chromium.org</owner> <owner>nupurjain@chromium.org</owner> @@ -7488,7 +7488,7 @@ </histogram> <histogram name="Ash.Wm.MultiWindowResizerClickTwoWindowsSnapped" - enum="Boolean" expires_after="2024-03-17"> + enum="Boolean" expires_after="2024-05-19"> <owner>michelefan@chromium.org</owner> <owner>xdai@chromium.org</owner> <summary> @@ -7498,7 +7498,7 @@ </histogram> <histogram name="Ash.Wm.MultiWindowResizerShow" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>michelefan@chromium.org</owner> <owner>xdai@chromium.org</owner> <summary> @@ -7507,7 +7507,7 @@ </histogram> <histogram name="Ash.Wm.MultiWindowResizerShowTwoWindowsSnapped" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>michelefan@chromium.org</owner> <owner>xdai@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/ash_clipboard/histograms.xml b/tools/metrics/histograms/metadata/ash_clipboard/histograms.xml index 4298bb7..a944a75 100644 --- a/tools/metrics/histograms/metadata/ash_clipboard/histograms.xml +++ b/tools/metrics/histograms/metadata/ash_clipboard/histograms.xml
@@ -36,7 +36,7 @@ </histogram> <histogram name="Ash.Clipboard.ConsecutivePastes" units="times" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -46,7 +46,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ConsecutivePastes" units="times" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -61,7 +61,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ContextMenu.DisplayFormatDeleted" - enum="ClipboardHistoryDisplayFormat" expires_after="2024-03-17"> + enum="ClipboardHistoryDisplayFormat" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -75,7 +75,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ContextMenu.DisplayFormatPasted" - enum="ClipboardHistoryDisplayFormat" expires_after="2024-03-17"> + enum="ClipboardHistoryDisplayFormat" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -90,7 +90,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ContextMenu.DisplayFormatShown" - enum="ClipboardHistoryDisplayFormat" expires_after="2024-03-17"> + enum="ClipboardHistoryDisplayFormat" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -100,7 +100,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ContextMenu.MenuOptionSelected" - units="index" expires_after="2024-03-17"> + units="index" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -110,7 +110,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ContextMenu.NumberOfItemsShown" - units="Items Shown" expires_after="2024-03-17"> + units="Items Shown" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -120,7 +120,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ContextMenu.ShowMenu" - enum="ClipboardHistoryTriggerType" expires_after="2024-03-17"> + enum="ClipboardHistoryTriggerType" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -130,7 +130,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ContextMenu.UserJourneyTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -141,7 +141,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ControlToVDelayV2" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -158,7 +158,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ControlVHeldTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -169,7 +169,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ImageModelRequest.Lifetime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -182,7 +182,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ImageModelRequest.Runtime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -193,7 +193,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ImageModelRequest.StopReason" - enum="RequestStopReason" expires_after="2024-03-17"> + enum="RequestStopReason" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -203,7 +203,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.Nudges.{NudgeType}.ShownCount" - enum="BooleanHit" expires_after="2024-03-17"> + enum="BooleanHit" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -225,7 +225,7 @@ <histogram name="Ash.ClipboardHistory.Nudges.{NudgeType}.ToFeature{Action}TimeV2" - units="seconds" expires_after="2024-03-17"> + units="seconds" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -252,7 +252,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.Operation" - enum="ClipboardHistoryOperation" expires_after="2024-03-17"> + enum="ClipboardHistoryOperation" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -271,7 +271,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.PasteSource" - enum="ClipboardHistoryTriggerType" expires_after="2024-03-17"> + enum="ClipboardHistoryTriggerType" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -282,7 +282,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.PasteType" - enum="ClipboardHistoryPasteType" expires_after="2024-03-17"> + enum="ClipboardHistoryPasteType" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -292,7 +292,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.ReorderType" - enum="ClipboardHistoryReorderType" expires_after="2024-03-17"> + enum="ClipboardHistoryReorderType" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -302,7 +302,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.UrlTitleFetcher.IsPrimaryProfileActive" - enum="BooleanActive" expires_after="2024-03-17"> + enum="BooleanActive" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -313,7 +313,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.UrlTitleFetcher.NumProfiles" - units="count" expires_after="2024-03-17"> + units="count" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary> @@ -324,7 +324,7 @@ </histogram> <histogram name="Ash.ClipboardHistory.UrlTitleFetcher.UrlFound" - enum="BooleanHit" expires_after="2024-03-17"> + enum="BooleanHit" expires_after="2024-05-19"> <owner>ckincaid@chromium.org</owner> <owner>multipaste@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/ash_user_education/histograms.xml b/tools/metrics/histograms/metadata/ash_user_education/histograms.xml index 32a512f..e13a74a 100644 --- a/tools/metrics/histograms/metadata/ash_user_education/histograms.xml +++ b/tools/metrics/histograms/metadata/ash_user_education/histograms.xml
@@ -49,14 +49,14 @@ </histogram> <histogram name="Ash.WelcomeTour.Step.Aborted" enum="WelcomeTourStep" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>angusmclean@google.com</owner> <owner>dmblack@google.com</owner> <summary>Records that the Welcome Tour was aborted on a given step.</summary> </histogram> <histogram name="Ash.WelcomeTour.Step.Duration.{Step}" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>angusmclean@google.com</owner> <owner>dmblack@google.com</owner> <summary> @@ -86,7 +86,7 @@ </histogram> <histogram name="Ash.WelcomeTour.{Completion}.Duration" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>angusmclean@google.com</owner> <owner>dmblack@google.com</owner> <summary> @@ -97,7 +97,7 @@ </histogram> <histogram name="Ash.WelcomeTour.{Completion}.Interaction.Count" - enum="WelcomeTourInteraction" expires_after="2024-03-17"> + enum="WelcomeTourInteraction" expires_after="2024-05-19"> <owner>angusmclean@google.com</owner> <owner>dmblack@google.com</owner> <summary> @@ -109,7 +109,7 @@ <histogram name="Ash.WelcomeTour.{Completion}.Interaction.FirstTime.{Interaction}" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>angusmclean@google.com</owner> <owner>dmblack@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/assistant/histograms.xml b/tools/metrics/histograms/metadata/assistant/histograms.xml index 9f34bbb3..303ff92a 100644 --- a/tools/metrics/histograms/metadata/assistant/histograms.xml +++ b/tools/metrics/histograms/metadata/assistant/histograms.xml
@@ -35,7 +35,7 @@ </variants> <histogram name="Assistant.BetterOnboarding.Click" - enum="AssistantBetterOnboardingType" expires_after="2024-03-17"> + enum="AssistantBetterOnboardingType" expires_after="2024-05-19"> <owner>xiaohuic@chromium.org</owner> <owner>croissant-eng@chromium.org</owner> <summary> @@ -105,7 +105,7 @@ </histogram> <histogram name="Assistant.Interaction.Resolution" - enum="AssistantInteractionResolution" expires_after="2024-03-17"> + enum="AssistantInteractionResolution" expires_after="2024-05-19"> <owner>xiaohuic@chromium.org</owner> <owner>croissant-eng@chromium.org</owner> <summary> @@ -116,7 +116,7 @@ </histogram> <histogram name="Assistant.Libassistant.DlcInstallResult" - enum="Assistant.LibassistantDlcInstallResult" expires_after="2024-03-17"> + enum="Assistant.LibassistantDlcInstallResult" expires_after="2024-05-19"> <owner>wutao@chromium.org</owner> <owner>assistive-eng@google.com</owner> <summary> @@ -126,7 +126,7 @@ </histogram> <histogram name="Assistant.Libassistant.DlcLoadStatus" - enum="Assistant.LibassistantDlcLoadStatus" expires_after="2024-03-17"> + enum="Assistant.LibassistantDlcLoadStatus" expires_after="2024-05-19"> <owner>wutao@chromium.org</owner> <owner>assistive-eng@google.com</owner> <summary> @@ -179,7 +179,7 @@ </histogram> <histogram name="Assistant.QuerySource" enum="AssistantQuerySource" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>xiaohuic@chromium.org</owner> <owner>croissant-eng@chromium.org</owner> <summary> @@ -189,7 +189,7 @@ </histogram> <histogram name="Assistant.ServiceEnabledUserCount" enum="BooleanEnabled" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>xiaohuic@chromium.org</owner> <owner>croissant-eng@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/autofill/histograms.xml b/tools/metrics/histograms/metadata/autofill/histograms.xml index d0bb003..69ed997 100644 --- a/tools/metrics/histograms/metadata/autofill/histograms.xml +++ b/tools/metrics/histograms/metadata/autofill/histograms.xml
@@ -170,6 +170,14 @@ summary="Progress dialog for the VCN Card Unmask Flow"/> </variants> +<variants name="Autofill.ServerCardUnmaskFlowType"> + <variant name="Fido" summary="FIDO authentication only"/> + <variant name="Otp" summary="OTP auth only"/> + <variant name="OtpFallbackFromFido" + summary="OTP fallback from FIDO authentication"/> + <variant name="UnspecifiedFlowType" summary="No authentication specified"/> +</variants> + <variants name="Autofill.SettingsPage.VirtualCardDialogType"> <variant name="SettingsPageEnrollment" summary="the virtual card enrollment dialog"/> @@ -232,14 +240,6 @@ <variant name="Upstream" summary="credit card uploading enrollment flow"/> </variants> -<variants name="Autofill.VirtualCardUnmaskFlowType"> - <variant name="Fido" summary="FIDO authentication only"/> - <variant name="Otp" summary="OTP auth only"/> - <variant name="OtpFallbackFromFido" - summary="OTP fallback from FIDO authentication"/> - <variant name="UnspecifiedFlowType" summary="No authentication specified"/> -</variants> - <variants name="AutofillCreditCardWebauthnOptInOrigin"> <variant name=".FromCheckoutFlow" summary="Opt-in from a checkout flow"/> <variant name=".FromSettingsPage" summary="Opt-in from settings page"/> @@ -1741,7 +1741,7 @@ </histogram> <histogram name="Autofill.FieldContextMenuImpressions.ByAutocomplete" - enum="AutofillAutocompleteState" expires_after="2024-03-17"> + enum="AutofillAutocompleteState" expires_after="2024-05-19"> <owner>vidhanj@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -1751,7 +1751,7 @@ </histogram> <histogram name="Autofill.FieldContextMenuImpressions.ByAutofillType" - enum="AutofillServerFieldType" expires_after="2024-03-17"> + enum="AutofillServerFieldType" expires_after="2024-05-19"> <owner>vidhanj@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -1925,7 +1925,7 @@ </histogram> <histogram name="Autofill.FormContextMenuImpressions.ByNumberOfFields" - units="fields" expires_after="2024-03-17"> + units="fields" expires_after="2024-05-19"> <owner>vidhanj@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -2039,7 +2039,7 @@ </histogram> <histogram name="Autofill.FormForest.GetBrowserFormOfRendererForm.Duration" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>schwering@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -2053,7 +2053,7 @@ </histogram> <histogram name="Autofill.FormForest.GetRendererFormsOfBrowserForm.Duration" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>schwering@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -2067,7 +2067,7 @@ </histogram> <histogram name="Autofill.FormForest.UpdateTreeOfRendererForm.Duration" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>schwering@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -2079,7 +2079,7 @@ </histogram> <histogram name="Autofill.FormForest.UpdateTreeOfRendererForm.Visits" - units="node-visits" expires_after="2024-03-17"> + units="node-visits" expires_after="2024-05-19"> <owner>schwering@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -2090,7 +2090,7 @@ </histogram> <histogram name="Autofill.FormSubmission.PerProfileType" - enum="BrowserProfileType" expires_after="2024-03-17"> + enum="BrowserProfileType" expires_after="2024-05-19"> <owner>rhalavati@chromium.org</owner> <owner>chrome-privacy-core@google.com</owner> <summary> @@ -3330,7 +3330,7 @@ </histogram> <histogram name="Autofill.PopupHidingReason" enum="AutofillPopupHidingReason" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>koerber@google.com</owner> <owner>mamir@chromium.org</owner> <summary> @@ -3461,7 +3461,7 @@ </histogram> <histogram name="Autofill.ProfileImport.ProfileImportType" - enum="AutofillProfileImportType" expires_after="2024-03-17"> + enum="AutofillProfileImportType" expires_after="2024-05-19"> <owner>koerber@google.com</owner> <owner>src/components/autofill/OWNERS</owner> <summary> @@ -3616,7 +3616,7 @@ </histogram> <histogram name="Autofill.ProfilesDifferOnAddressLineOnly" enum="Boolean" - expires_after="2024-03-13"> + expires_after="2024-05-19"> <owner>jihadghanna@chromium.org</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -3794,6 +3794,18 @@ </summary> </histogram> +<histogram name="Autofill.RiskBasedAuth.{CardType}.Result" + enum="AutofillRiskBasedAuthEvent" expires_after="2024-11-14"> + <owner>junhuihe@google.com</owner> + <owner>payments-autofill-team@google.com</owner> + <summary> + Logs the result of a risk-based unmasking process when the unmasking is + finished (whether it succeeded or the failure reason). Broken down by the + type of card to be unmasked. + </summary> + <token key="CardType" variants="Autofill.PaymentsRpcCardType"/> +</histogram> + <histogram name="Autofill.SaveCardCardholderNamePrefilled" enum="Boolean" expires_after="2024-07-01"> <owner>jsaul@google.com</owner> @@ -4033,7 +4045,7 @@ authentication used) in the unmasking. </summary> <token key="CardType" variants="Autofill.PaymentsRpcCardType"/> - <token key="FlowType" variants="Autofill.VirtualCardUnmaskFlowType"/> + <token key="FlowType" variants="Autofill.ServerCardUnmaskFlowType"/> </histogram> <histogram name="Autofill.ServerQueryResponse" enum="AutofillQueryResult" @@ -4485,7 +4497,7 @@ </histogram> <histogram name="Autofill.SuggestionAccepted.OffTheRecord" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rhalavati@chromium.org</owner> <owner>chrome-privacy-core@google.com</owner> <summary> @@ -4588,7 +4600,7 @@ </histogram> <histogram name="Autofill.TouchToFill.CreditCard.FillingCorrectness" - enum="BooleanAutofillFillingCorrectness" expires_after="2024-03-17"> + enum="BooleanAutofillFillingCorrectness" expires_after="2024-05-19"> <owner>mlerman@google.com</owner> <owner>tchudakov@google.com</owner> <owner>vykochko@google.com</owner> @@ -4613,7 +4625,7 @@ </histogram> <histogram name="Autofill.TouchToFill.CreditCard.Outcome" - enum="TouchToFill.CreditCard.Outcome" expires_after="2024-03-17"> + enum="TouchToFill.CreditCard.Outcome" expires_after="2024-05-19"> <owner>mlerman@google.com</owner> <owner>tchudakov@google.com</owner> <owner>vykochko@google.com</owner> @@ -4634,7 +4646,7 @@ </histogram> <histogram name="Autofill.TouchToFill.CreditCard.Outcome2" - enum="TouchToFill.CreditCard.Outcome" expires_after="2024-03-17"> + enum="TouchToFill.CreditCard.Outcome" expires_after="2024-05-19"> <owner>mlerman@google.com</owner> <owner>tchudakov@google.com</owner> <owner>vykochko@google.com</owner> @@ -4655,7 +4667,7 @@ </histogram> <histogram name="Autofill.TouchToFill.CreditCard.PerfectFilling" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mlerman@google.com</owner> <owner>tchudakov@google.com</owner> <owner>vykochko@google.com</owner> @@ -4669,7 +4681,7 @@ </histogram> <histogram name="Autofill.TouchToFill.CreditCard.SelectedIndex" units="index" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mlerman@google.com</owner> <owner>tchudakov@google.com</owner> <owner>vykochko@google.com</owner> @@ -4681,7 +4693,7 @@ </histogram> <histogram name="Autofill.TouchToFill.CreditCard.TriggerOutcome" - enum="TouchToFill.CreditCard.TriggerOutcome" expires_after="2024-03-17"> + enum="TouchToFill.CreditCard.TriggerOutcome" expires_after="2024-05-19"> <owner>mlerman@google.com</owner> <owner>tchudakov@google.com</owner> <owner>vykochko@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/blink/histograms.xml b/tools/metrics/histograms/metadata/blink/histograms.xml index ff70268f..9eca4aa9 100644 --- a/tools/metrics/histograms/metadata/blink/histograms.xml +++ b/tools/metrics/histograms/metadata/blink/histograms.xml
@@ -651,7 +651,7 @@ </histogram> <histogram name="Blink.Canvas.WebGPUMaxRecycledResourcesCount" - units="Recyclable resources" expires_after="2024-03-17"> + units="Recyclable resources" expires_after="2024-05-19"> <owner>magchen@chromium.org</owner> <owner>enga@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> @@ -1083,7 +1083,7 @@ </histogram> <histogram name="Blink.DecodedImage.WebPFileFormat" enum="WebPFileFormat" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mcasas@chromium.org</owner> <owner>andrescj@chromium.org</owner> <summary> @@ -1093,7 +1093,7 @@ </histogram> <histogram name="Blink.DecodedImageType" enum="DecodedImageType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>urvang@chromium.org</owner> <summary> Image codec inferred during decode. The histogram is incremented when enough @@ -1164,7 +1164,7 @@ </histogram> <histogram name="Blink.Experimental.Cookies.CacheLookupResult2" - enum="CookieCacheLookupResult" expires_after="2024-03-17"> + enum="CookieCacheLookupResult" expires_after="2024-05-19"> <owner>carlscab@google.com</owner> <owner>woa-performance@google</owner> <summary> @@ -1320,7 +1320,7 @@ </histogram> <histogram name="Blink.FedCm.ClosedSheetType.Desktop" enum="FedCmSheetType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>npm@chromium.org</owner> <owner>web-identity-eng@google.com</owner> <summary> @@ -1391,7 +1391,7 @@ </histogram> <histogram name="Blink.FedCm.IdpSigninRequestInitiatedByUser" - enum="BooleanYesNo" expires_after="2024-03-17"> + enum="BooleanYesNo" expires_after="2024-05-19"> <owner>cbiesinger@chromium.org</owner> <owner>web-identity-eng@google.com</owner> <summary> @@ -1457,7 +1457,7 @@ </histogram> <histogram name="Blink.FedCm.IdpSignoutRequestInitiatedByUser" - enum="BooleanYesNo" expires_after="2024-03-17"> + enum="BooleanYesNo" expires_after="2024-05-19"> <owner>cbiesinger@chromium.org</owner> <owner>web-identity-eng@google.com</owner> <summary> @@ -1966,7 +1966,7 @@ </histogram> <histogram name="Blink.Fonts.DecodeTime" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>gjc@chromium.org</owner> <owner>blink-network-dev@chromium.org</owner> <summary> @@ -2266,7 +2266,7 @@ </histogram> <histogram name="Blink.HTMLParsing.ParsingTimeMin4" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>masonf@chromium.org</owner> <owner>dom-dev@chromium.org</owner> <summary> @@ -2311,7 +2311,7 @@ </histogram> <histogram name="Blink.HTMLParsing.TokensParsedAverage4" units="tokens" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>masonf@chromium.org</owner> <owner>dom-dev@chromium.org</owner> <summary> @@ -2350,7 +2350,7 @@ </histogram> <histogram name="Blink.HTMLParsing.TokensParsedTotal4" units="tokens" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>masonf@chromium.org</owner> <owner>dom-dev@chromium.org</owner> <summary> @@ -3533,7 +3533,7 @@ </histogram> <histogram name="Blink.Sms.Receive.Outcome" enum="WebOTPServiceOutcome" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>yigu@chromium.org</owner> <owner>goto@chromium.org</owner> <owner>web-identity-eng@google.com</owner> @@ -4084,7 +4084,7 @@ </histogram> <histogram name="Blink.UseCounter.PermissionsPolicy.Header2" - enum="FeaturePolicyFeature" expires_after="2024-03-17"> + enum="FeaturePolicyFeature" expires_after="2024-05-19"> <owner>iclelland@chromium.org</owner> <owner>feature-control@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/bluetooth/histograms.xml b/tools/metrics/histograms/metadata/bluetooth/histograms.xml index bf882bd..576caa8 100644 --- a/tools/metrics/histograms/metadata/bluetooth/histograms.xml +++ b/tools/metrics/histograms/metadata/bluetooth/histograms.xml
@@ -946,7 +946,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.MessageStream.ConnectToService.Result" - enum="BooleanSuccess" expires_after="2024-03-17"> + enum="BooleanSuccess" expires_after="2024-05-19"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1086,7 +1086,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.PairingMethod" - enum="FastPairPairingMethod" expires_after="2024-03-17"> + enum="FastPairPairingMethod" expires_after="2024-05-19"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1371,7 +1371,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.RetroactivePairing.Result" - enum="BooleanSuccess" expires_after="2024-03-17"> + enum="BooleanSuccess" expires_after="2024-05-19"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1764,7 +1764,7 @@ </histogram> <histogram name="Bluetooth.ConnectedDeviceCount" units="devices" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>adlr@chromium.org</owner> <summary> Counts the number of simulataneously connected Bluetooth devices. Used to @@ -1878,7 +1878,7 @@ </histogram> <histogram name="Bluetooth.Web.Characteristic.WriteValue.Outcome" - enum="WebBluetoothGATTOperationOutcome" expires_after="2024-03-17"> + enum="WebBluetoothGATTOperationOutcome" expires_after="2024-05-19"> <owner>cmumford@chromium.org</owner> <owner>deviceapi-team@google.com</owner> <summary> @@ -1890,7 +1890,7 @@ </histogram> <histogram name="Bluetooth.Web.ConnectGATT.Outcome" - enum="WebBluetoothConnectGATTOutcome" expires_after="2024-03-17"> + enum="WebBluetoothConnectGATTOutcome" expires_after="2024-05-19"> <owner>reillyg@chromium.org</owner> <owner>deviceapi-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/bookmarks/histograms.xml b/tools/metrics/histograms/metadata/bookmarks/histograms.xml index f12f2da..6bcea381 100644 --- a/tools/metrics/histograms/metadata/bookmarks/histograms.xml +++ b/tools/metrics/histograms/metadata/bookmarks/histograms.xml
@@ -61,7 +61,7 @@ </histogram> <histogram name="Bookmarks.AddedPerProfileType" enum="BrowserProfileType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rhalavati@chromium.org</owner> <owner>chrome-privacy-core@google.com</owner> <component>UI>Browser>Bookmarks</component> @@ -226,7 +226,7 @@ </histogram> <histogram name="Bookmarks.Count.OnProfileLoad3" units="bookmarks" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>supertri@chromium.org</owner> <owner>isherman@chromium.org</owner> <owner>aidanday@google.com</owner> @@ -281,7 +281,7 @@ </histogram> <histogram name="Bookmarks.LaunchLocation" enum="BookmarkLaunchLocation" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ianwen@chromium.org</owner> <component>UI>Browser>Bookmarks</component> <summary>Logs a UI location from which a bookmark is launched.</summary> @@ -312,7 +312,7 @@ </histogram> <histogram name="Bookmarks.MobileBookmarkManager.FilterUsed2" - enum="MobileBookmarkManagerFilter" expires_after="2024-01-14"> + enum="MobileBookmarkManagerFilter" expires_after="2024-05-19"> <owner>wylieb@chromium.org</owner> <owner>chrome-collections@google.com</owner> <component>UI>Browser>Bookmarks</component> @@ -323,7 +323,7 @@ </histogram> <histogram name="Bookmarks.MobileBookmarkManager.SortOptionUsed" - enum="MobileBookmarkManagerBookmarkRowSortOrder" expires_after="2024-01-14"> + enum="MobileBookmarkManagerBookmarkRowSortOrder" expires_after="2024-05-19"> <owner>wylieb@chromium.org</owner> <owner>chrome-collections@google.com</owner> <component>UI>Browser>Bookmarks</component>
diff --git a/tools/metrics/histograms/metadata/borealis/histograms.xml b/tools/metrics/histograms/metadata/borealis/histograms.xml index 9fb3d60..efd6907a 100644 --- a/tools/metrics/histograms/metadata/borealis/histograms.xml +++ b/tools/metrics/histograms/metadata/borealis/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="Borealis.Audio.UsedPath.{Direction}" enum="BorealisAudioPath" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>normanbt@google.com</owner> <owner>src/chrome/browser/ash/borealis/OWNERS</owner> <summary> @@ -38,7 +38,7 @@ </histogram> <histogram name="Borealis.Audio.UsedSubdevices" units="count" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>normanbt@google.com</owner> <owner>src/chrome/browser/ash/borealis/OWNERS</owner> <summary> @@ -48,7 +48,7 @@ </histogram> <histogram name="Borealis.Audio.Xrun.Alsa.Output" units="count" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>normanbt@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 20f4b28f..aba984c 100644 --- a/tools/metrics/histograms/metadata/browser/histograms.xml +++ b/tools/metrics/histograms/metadata/browser/histograms.xml
@@ -74,7 +74,7 @@ </histogram> <histogram name="Browser.DarkModeStatus" enum="DarkModeStatus" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>lgrey@chromium.org</owner> <owner>robliao@chromium.org</owner> <summary> @@ -617,7 +617,7 @@ </histogram> <histogram name="Browser.Responsiveness.IOJanksTotalPerMinute" units="janks" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>gab@chromium.org</owner> <owner>olivierli@chromium.org</owner> <summary> @@ -631,7 +631,7 @@ </histogram> <histogram name="Browser.Responsiveness.IOJankyIntervalsPerMinute" - units="janks" expires_after="2024-03-17"> + units="janks" expires_after="2024-05-19"> <owner>gab@chromium.org</owner> <owner>olivierli@chromium.org</owner> <summary> @@ -763,7 +763,7 @@ </histogram> <histogram name="Browser.WindowCount.Guest" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rhalavati@chromium.org</owner> <owner>chrome-privacy-core@google.com</owner> <summary> @@ -775,7 +775,7 @@ </histogram> <histogram name="Browser.WindowCount.Incognito" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rhalavati@chromium.org</owner> <owner>chrome-privacy-core@google.com</owner> <summary> @@ -1233,7 +1233,7 @@ </histogram> <histogram name="SidePanel.ComboboxMenuShown" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>corising@chromium.org</owner> <owner>chrome-desktop-ui-sea@google.com</owner> <summary>Records true when the side panel combobox is opened.</summary>
diff --git a/tools/metrics/histograms/metadata/browsing_topics/histograms.xml b/tools/metrics/histograms/metadata/browsing_topics/histograms.xml index 3550318..a63ced45 100644 --- a/tools/metrics/histograms/metadata/browsing_topics/histograms.xml +++ b/tools/metrics/histograms/metadata/browsing_topics/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="BrowsingTopics.ApiActionType" - enum="BrowsingTopicsApiActionType" expires_after="2024-03-17"> + enum="BrowsingTopicsApiActionType" expires_after="2024-05-19"> <owner>yaoxia@chromium.org</owner> <owner>jkarlin@chromium.org</owner> <summary> @@ -109,7 +109,7 @@ <histogram name="BrowsingTopics.EpochTopicsCalculation.TopTopicsCountBeforePadding" - units="topics" expires_after="2024-03-17"> + units="topics" expires_after="2024-05-19"> <owner>yaoxia@chromium.org</owner> <owner>jkarlin@chromium.org</owner> <summary> @@ -132,7 +132,7 @@ </histogram> <histogram name="BrowsingTopics.JavaScriptAPI.TimeToResolve" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>yaoxia@chromium.org</owner> <owner>jkarlin@chromium.org</owner> <summary> @@ -207,7 +207,7 @@ </histogram> <histogram name="BrowsingTopics.SiteDataStorage.InitStatus" - enum="BooleanSuccess" expires_after="2024-01-21"> + enum="BooleanSuccess" expires_after="2024-05-19"> <owner>yaoxia@chromium.org</owner> <owner>jkarlin@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/chrome/histograms.xml b/tools/metrics/histograms/metadata/chrome/histograms.xml index 1f75be2..35c64f5 100644 --- a/tools/metrics/histograms/metadata/chrome/histograms.xml +++ b/tools/metrics/histograms/metadata/chrome/histograms.xml
@@ -102,7 +102,7 @@ </histogram> <histogram name="Chrome.KAnonymityService.QuerySet.Latency" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>behamilton@google.com</owner> <owner>pauljensen@chromium.org</owner> <summary> @@ -282,7 +282,7 @@ </histogram> <histogram name="Chrome.SystemNetworkContextManager.NetworkSandboxState" - enum="NetworkSandboxState" expires_after="2024-03-17"> + enum="NetworkSandboxState" expires_after="2024-05-19"> <owner>wfh@chromium.org</owner> <owner>mmenke@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/chromeos/histograms.xml b/tools/metrics/histograms/metadata/chromeos/histograms.xml index b1a316f..89cf0ec 100644 --- a/tools/metrics/histograms/metadata/chromeos/histograms.xml +++ b/tools/metrics/histograms/metadata/chromeos/histograms.xml
@@ -282,7 +282,7 @@ </histogram> <histogram name="ChromeOS.Camera.AutoFraming.EnabledTime" units="%" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>kamesan@chromium.org</owner> <owner>chromeos-camera-eng@google.com</owner> <summary> @@ -761,7 +761,7 @@ </histogram> <histogram name="ChromeOS.Camera.PortraitMode.NumStillShotsTaken" - units="captures" expires_after="2024-03-17"> + units="captures" expires_after="2024-05-19"> <owner>julianachang@google.com</owner> <owner>chromeos-camera-eng@google.com</owner> <summary> @@ -854,7 +854,7 @@ </histogram> <histogram name="ChromeOS.CWP.CollectPerf" - enum="ChromeOSProfileCollectionStatus" expires_after="2024-03-17"> + enum="ChromeOSProfileCollectionStatus" expires_after="2024-05-19"> <owner>aalexand@google.com</owner> <owner>gmx@chromium.org</owner> <owner>cwp-team@google.com</owner> @@ -889,7 +889,7 @@ </histogram> <histogram name="ChromeOS.CWP.ParseCPUFrequencies" - enum="ChromeOSParseCPUFrequencyStatus" expires_after="2024-03-17"> + enum="ChromeOSParseCPUFrequencyStatus" expires_after="2024-05-19"> <owner>gmx@chromium.org</owner> <owner>cwp-team@google.com</owner> <summary> @@ -1261,7 +1261,7 @@ </histogram> <histogram name="ChromeOS.Gaia.Done.ElapsedTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bchikhaoui@google.com</owner> <owner>cros-oac@google.com</owner> <summary> @@ -1302,7 +1302,7 @@ </histogram> <histogram base="true" name="ChromeOS.HardwareVerifier.Report" - enum="HardwareVerifierQualificationStatus" expires_after="2024-03-17"> + enum="HardwareVerifierQualificationStatus" expires_after="2024-05-19"> <!-- Name completed by histogram_suffixes name="HardwareVerifierSupportCategory" --> <owner>itspeter@chromium.org</owner> @@ -1315,7 +1315,7 @@ </histogram> <histogram name="ChromeOS.HardwareVerifier.Report.IsCompliant" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>itspeter@chromium.org</owner> <owner>stimim@chromium.org</owner> <owner>chromeos-runtime-probe@google.com</owner> @@ -2021,7 +2021,7 @@ </histogram> <histogram name="ChromeOS.PrivacyHub.LearnMorePage.Opened" - enum="PrivacyHubLearnMoreSensor" expires_after="2024-03-17"> + enum="PrivacyHubLearnMoreSensor" expires_after="2024-05-19"> <owner>cschlosser@chromium.org</owner> <owner>chromeos-privacyhub@google.com</owner> <summary> @@ -2037,7 +2037,7 @@ </histogram> <histogram name="ChromeOS.PrivacyHub.Opened" enum="PrivacyHubNavigationOrigin" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>zauri@google.com</owner> <owner>chromeos-privacyhub@google.com</owner> <summary> @@ -2132,14 +2132,14 @@ </histogram> <histogram name="ChromeOS.SAML.Provider" enum="ChromeOSSamlProvider" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mslus@chromium.org</owner> <owner>mohammedabdon@chromium.org</owner> <summary>Records SAML provider when SAML login flow is used.</summary> </histogram> <histogram name="ChromeOS.SAML.Scraping.PasswordCountAll" units="passwords" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mslus@chromium.org</owner> <owner>emaxx@chromium.org</owner> <summary> @@ -3142,7 +3142,7 @@ </histogram> <histogram name="ChromeOS.Sharesheet.LaunchSource" - enum="ChromeOSSharesheetLaunchSource" expires_after="2024-03-17"> + enum="ChromeOSSharesheetLaunchSource" expires_after="2024-05-19"> <owner>tsergeant@chromium.org</owner> <owner>chromeos-apps-foundation-team@google.com</owner> <summary> @@ -3164,14 +3164,14 @@ </histogram> <histogram name="ChromeOS.Sharesheet.UserAction" - enum="ChromeOSSharesheetAction" expires_after="2024-03-17"> + enum="ChromeOSSharesheetAction" expires_after="2024-05-19"> <owner>tsergeant@chromium.org</owner> <owner>chromeos-apps-foundation-team@google.com</owner> <summary>Records user action on sharesheet invocations.</summary> </histogram> <histogram name="ChromeOS.Sharesheet.{Location}.MimeType" - enum="ChromeOSSharesheetMimeType" expires_after="2024-03-17"> + enum="ChromeOSSharesheetMimeType" expires_after="2024-05-19"> <owner>tsergeant@chromium.org</owner> <owner>chromeos-apps-foundation-team@google.com</owner> <summary> @@ -3555,7 +3555,7 @@ </histogram> <histogram name="ChromeOS.UserTypeByDeviceType.LogSegment" - enum="UserDeviceMatrix" expires_after="2024-03-17"> + enum="UserDeviceMatrix" expires_after="2024-05-19"> <owner>bmalcolm@chromium.org</owner> <owner>cros-client-wa@google.com</owner> <summary> @@ -3648,7 +3648,7 @@ </histogram> <histogram name="ChromeOS.Zram.{HugePageActivityMetric}" units="pages" - expires_after="2024-01-10"> + expires_after="2024-05-19"> <owner>ctshao@google.com</owner> <owner>raging@google.com</owner> <owner>bgeffon@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml b/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml index 6e4fb9ba..1f5a860 100644 --- a/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml +++ b/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml
@@ -276,7 +276,7 @@ </histogram> <histogram name="ChromeOS.Settings.LoadCompletedTime" units="ms" - expires_after="2024-03-14"> + expires_after="2024-05-19"> <owner>wesokuhara@google.com</owner> <owner>xiaohuic@chromium.org</owner> <owner>cros-settings@google.com</owner> @@ -609,7 +609,7 @@ </histogram> <histogram name="ChromeOS.Settings.Wifi.Hidden" enum="BooleanToggled" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jonmann@chromium.org</owner> <owner>khorimoto@chromium.org</owner> <owner>tnagel@chromium.org</owner> @@ -622,7 +622,7 @@ </histogram> <histogram name="ChromeOS.Settings.WindowOpenDuration" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>wesokuhara@google.com</owner> <owner>xiaohuic@chromium.org</owner> <owner>cros-settings@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/commerce/histograms.xml b/tools/metrics/histograms/metadata/commerce/histograms.xml index b55b0dfd..ebe4308f 100644 --- a/tools/metrics/histograms/metadata/commerce/histograms.xml +++ b/tools/metrics/histograms/metadata/commerce/histograms.xml
@@ -198,7 +198,7 @@ </histogram> <histogram name="Commerce.Heuristics.PartnerMerchantPatternSource" - enum="CommerceHeuristicsDataSource" expires_after="2024-03-17"> + enum="CommerceHeuristicsDataSource" expires_after="2024-05-19"> <owner>yuezhanggg@chromium.org</owner> <owner>wychen@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -456,7 +456,7 @@ </histogram> <histogram name="Commerce.PriceInsights.OmniboxIconClicked" - enum="PriceInsightsIconLabelType" expires_after="2024-05-12"> + enum="PriceInsightsIconLabelType" expires_after="2024-05-19"> <owner>zhiyuancai@chromium.org</owner> <owner>ayman@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -468,7 +468,7 @@ </histogram> <histogram name="Commerce.PriceInsights.OmniboxIconShown" - enum="PriceInsightsIconLabelType" expires_after="2024-05-12"> + enum="PriceInsightsIconLabelType" expires_after="2024-05-19"> <owner>zhiyuancai@chromium.org</owner> <owner>ayman@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -634,7 +634,7 @@ </histogram> <histogram name="Commerce.ShoppingService.ProductInfo.JavascriptExecutionTime" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>ayman@chromium.org</owner> <owner>mdjones@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -664,7 +664,7 @@ </histogram> <histogram name="Commerce.Subscriptions.TrackResult" - enum="ShoppingSubscriptionsRequestStatus" expires_after="2024-03-17"> + enum="ShoppingSubscriptionsRequestStatus" expires_after="2024-05-19"> <owner>zhiyuancai@chromium.org</owner> <owner>ayman@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -675,7 +675,7 @@ </histogram> <histogram name="Commerce.Subscriptions.UntrackResult" - enum="ShoppingSubscriptionsRequestStatus" expires_after="2024-03-17"> + enum="ShoppingSubscriptionsRequestStatus" expires_after="2024-05-19"> <owner>zhiyuancai@chromium.org</owner> <owner>ayman@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -862,7 +862,7 @@ </histogram> <histogram name="MerchantTrust.PageInfo.IsStoreInfoVisible" - enum="BooleanVisible" expires_after="2024-03-17"> + enum="BooleanVisible" expires_after="2024-05-19"> <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 224bd54b..79d585ae 100644 --- a/tools/metrics/histograms/metadata/companion/histograms.xml +++ b/tools/metrics/histograms/metadata/companion/histograms.xml
@@ -128,7 +128,7 @@ </histogram> <histogram name="Companion.SidePanel.ShowUiSuccess" enum="BooleanSuccess" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mercerd@google.com</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 7c85c0f7..fbeec66 100644 --- a/tools/metrics/histograms/metadata/compositing/histograms.xml +++ b/tools/metrics/histograms/metadata/compositing/histograms.xml
@@ -198,7 +198,7 @@ </histogram> <histogram name="Compositing.DirectRenderer.PartialSwap.RootDamage" units="%" - expires_after="2024-03-16"> + expires_after="2024-05-19"> <owner>vasilyt@chromium.org</owner> <owner>petermcneeley@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> @@ -211,7 +211,7 @@ </histogram> <histogram name="Compositing.DirectRenderer.PartialSwap.TotalDamage" units="%" - expires_after="2024-03-16"> + expires_after="2024-05-19"> <owner>vasilyt@chromium.org</owner> <owner>petermcneeley@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> @@ -611,7 +611,7 @@ </histogram> <histogram name="Compositing.Renderer.CALayer.ChangedIOSurfacesPerFrame" - units="surfaces" expires_after="2024-01-14"> + units="surfaces" expires_after="2024-05-19"> <owner>magchen@chromium.org</owner> <owner>ccameron@chromium.org</owner> <summary> @@ -683,7 +683,7 @@ </histogram> <histogram name="Compositing.Renderer.NumActiveLayers" units="layers" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>pdr@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <summary> @@ -693,7 +693,7 @@ </histogram> <histogram name="Compositing.Renderer.NumActivePictureLayers" units="layers" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>pdr@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <summary> @@ -704,7 +704,7 @@ </histogram> <histogram name="Compositing.Renderer.NumRenderSurfaces" units="surfaces" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>pdr@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <summary> @@ -975,7 +975,7 @@ </histogram> <histogram name="CompositorLatency.Type" enum="FrameReportType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1113,7 +1113,7 @@ </histogram> <histogram name="Graphics.Smoothness.95pctPercentDroppedFrames_1sWindow" - units="%" expires_after="2024-03-17"> + units="%" expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1245,7 +1245,7 @@ </histogram> <histogram name="Graphics.Smoothness.MaxStale" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>mjzhang@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> @@ -1328,7 +1328,7 @@ </histogram> <histogram name="Graphics.Smoothness.Stale" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>mjzhang@chromium.org</owner> <owner>graphics-dev@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/content/histograms.xml b/tools/metrics/histograms/metadata/content/histograms.xml index 511e713..0f4f88a 100644 --- a/tools/metrics/histograms/metadata/content/histograms.xml +++ b/tools/metrics/histograms/metadata/content/histograms.xml
@@ -204,7 +204,7 @@ </histogram> <histogram name="ContentSettings.Popups.StrongBlockerActions" - enum="StrongPopupBlockerAction" expires_after="2024-03-17"> + enum="StrongPopupBlockerAction" expires_after="2024-05-19"> <owner>csharrison@chromium.org</owner> <summary> Counts of various events related to the strong popup blocker (aka abusive @@ -1011,7 +1011,7 @@ </histogram> <histogram base="true" name="ContentSuggestions.Feed.LoadStepLatency" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>harringtond@chromium.org</owner> <owner>feed@chromium.org</owner> <summary> @@ -1159,7 +1159,7 @@ </histogram> <histogram name="ContentSuggestions.Feed.NoticeCardFulfilled2" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>vincb@google.com</owner> <owner>feed@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/content_creation/histograms.xml b/tools/metrics/histograms/metadata/content_creation/histograms.xml index 3998cae..c2a69aa 100644 --- a/tools/metrics/histograms/metadata/content_creation/histograms.xml +++ b/tools/metrics/histograms/metadata/content_creation/histograms.xml
@@ -109,7 +109,7 @@ </histogram> <histogram name="SharedHighlights.AndroidShareSheet.SharedState" - enum="LinkGenerationSharedStatus" expires_after="2024-03-17"> + enum="LinkGenerationSharedStatus" expires_after="2024-05-19"> <owner>sebsg@chromium.org</owner> <owner>jeffreycohen@chromium.org</owner> <owner>chrome-shared-highlighting@google.com</owner> @@ -142,7 +142,7 @@ </histogram> <histogram name="SharedHighlights.Desktop.CopiedLinkType" - enum="LinkGenerationCopiedLinkType" expires_after="2024-03-17"> + enum="LinkGenerationCopiedLinkType" expires_after="2024-05-19"> <owner>sebsg@chromium.org</owner> <owner>jeffreycohen@chromium.org</owner> <owner>chrome-shared-highlighting@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/cookie/histograms.xml b/tools/metrics/histograms/metadata/cookie/histograms.xml index 923ac92..9fa805b 100644 --- a/tools/metrics/histograms/metadata/cookie/histograms.xml +++ b/tools/metrics/histograms/metadata/cookie/histograms.xml
@@ -111,7 +111,7 @@ </histogram> <histogram name="Cookie.CookiePrefix.CaseVariant" enum="CookiePrefix" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bingler@chromium.org</owner> <owner>miketaylr@chromium.org</owner> <summary> @@ -129,7 +129,7 @@ </histogram> <histogram name="Cookie.CookiePrefix.CaseVariantCount" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bingler@chromium.org</owner> <owner>miketaylr@chromium.org</owner> <summary> @@ -144,7 +144,7 @@ </histogram> <histogram name="Cookie.CookiePrefix.CaseVariantValid" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bingler@chromium.org</owner> <owner>miketaylr@chromium.org</owner> <summary> @@ -191,7 +191,7 @@ </summary> </histogram> -<histogram name="Cookie.Count2" units="units" expires_after="2024-03-17"> +<histogram name="Cookie.Count2" units="units" expires_after="2024-05-19"> <owner>bingler@chromium.org</owner> <owner>morlovich@chromium.org</owner> <summary> @@ -321,7 +321,7 @@ </histogram> <histogram name="Cookie.ErrorInitializeDB" enum="SqliteLoggedResultCode" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>wfh@chromium.org</owner> <owner>src/net/cookies/OWNERS</owner> <summary> @@ -648,7 +648,7 @@ </histogram> <histogram name="Cookie.LoadProblem" enum="CookieLoadProblem" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>morlovich@chromium.org</owner> <summary> Recorded when a problem is recorded when loading the persistent cookie @@ -852,7 +852,7 @@ </histogram> <histogram name="Cookie.Port.Read.{HostType}" enum="InterestingCookiePorts" - expires_after="2024-02-20"> + expires_after="2024-05-19"> <owner>bingler@chromium.org</owner> <owner>miketaylr@chromium.org</owner> <summary> @@ -939,7 +939,7 @@ </histogram> <histogram name="Cookie.SameSiteAttributeValue" enum="CookieSameSiteString" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bingler@chromium.org</owner> <owner>miketaylr@chromium.org</owner> <summary> @@ -973,7 +973,7 @@ </histogram> <histogram name="Cookie.TimeBlockedOnLoad" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>nharper@chromium.org</owner> <summary> The amount of time (ms) between the cookie store load starting and @@ -1011,7 +1011,7 @@ </summary> </histogram> -<histogram name="Cookie.TimeInitializeDB" units="ms" expires_after="2024-03-17"> +<histogram name="Cookie.TimeInitializeDB" units="ms" expires_after="2024-05-19"> <owner>bingler@chromium.org</owner> <owner>src/net/cookies/OWNERS</owner> <summary>The amount of time (ms) to initialize the cookies database.</summary> @@ -1037,13 +1037,13 @@ </summary> </histogram> -<histogram name="Cookie.Type" enum="CookieType" expires_after="2024-03-17"> +<histogram name="Cookie.Type" enum="CookieType" expires_after="2024-05-19"> <owner>mkwst@chromium.org</owner> <summary>For each cookie added to the store, record it's type(s).</summary> </histogram> <histogram name="Cookie.WinGetLastErrorInitializeDB" enum="WinGetLastError" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>wfh@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 fb0995e..6dc1a1c 100644 --- a/tools/metrics/histograms/metadata/cras/histograms.xml +++ b/tools/metrics/histograms/metadata/cras/histograms.xml
@@ -28,7 +28,7 @@ </variants> <histogram name="Cras.A2dp100msFailureOverStream" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>hychao@chromium.org</owner> <owner>chromeos-audio@google.com</owner> <summary> @@ -39,7 +39,7 @@ </histogram> <histogram name="Cras.A2dp20msFailureOverStream" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>hychao@chromium.org</owner> <owner>chromeos-audio@google.com</owner> <summary> @@ -50,7 +50,7 @@ </histogram> <histogram name="Cras.A2dpExitCode" enum="CrasA2dpExitCode" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>hychao@chromium.org</owner> <owner>chromeos-audio@google.com</owner> <summary> @@ -76,7 +76,7 @@ </summary> </histogram> -<histogram name="Cras.Busyloop" units="units" expires_after="2024-03-17"> +<histogram name="Cras.Busyloop" units="units" expires_after="2024-05-19"> <!-- Name completed by histogram_suffixes name="Cras.TimePeriod" --> @@ -102,7 +102,7 @@ <histogram name="Cras.DeviceConfigureTime{Direction}{Device}{HostCapability}{PeripheralCapability}" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>hychao@google.com</owner> <owner>chromeos-audio@google.com</owner> <summary> @@ -172,7 +172,7 @@ </histogram> <histogram name="Cras.DeviceNoiseCancellationStatus" - enum="CrasNoiseCancellationStatus" expires_after="2024-03-17"> + enum="CrasNoiseCancellationStatus" expires_after="2024-05-19"> <!-- Name completed by histogram_suffixes name="Cras.DeviceType" --> @@ -197,7 +197,7 @@ <histogram name="Cras.DeviceRuntime{Direction}{Device}{HostCapability}{PeripheralCapability}" - units="seconds" expires_after="2024-03-17"> + units="seconds" expires_after="2024-05-19"> <owner>jrwu@google.com</owner> <owner>chromeos-audio@google.com</owner> <summary> @@ -379,7 +379,7 @@ </histogram> <histogram name="Cras.HfpScoConnectionError" enum="CrasHfpScoError" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>enshuo@chromium.org</owner> <owner>chromeos-audio@google.com</owner> <summary> @@ -389,7 +389,7 @@ </histogram> <histogram name="Cras.HfpWidebandSpeechPacketLoss" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>enshuo@chromium.org</owner> <owner>chromeos-audio@google.com</owner> <summary> @@ -410,7 +410,7 @@ </histogram> <histogram name="Cras.HighestDeviceDelayInput" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>yuhsuan@chromium.org</owner> <owner>chromeos-audio@google.com</owner> <summary> @@ -423,7 +423,7 @@ </histogram> <histogram name="Cras.HighestDeviceDelayOutput" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>yuhsuan@chromium.org</owner> <owner>chromeos-audio@google.com</owner> <summary> @@ -436,7 +436,7 @@ </histogram> <histogram name="Cras.HighestInputHardwareLevel" units="frames" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>yuhsuan@chromium.org</owner> <owner>chromeos-audio@google.com</owner> <summary> @@ -447,7 +447,7 @@ </histogram> <histogram name="Cras.HighestOutputHardwareLevel" units="frames" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>yuhsuan@chromium.org</owner> <owner>chromeos-audio@google.com</owner> <summary> @@ -721,7 +721,7 @@ </histogram> <histogram name="Cras.StreamCallbackThreshold" units="frames" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <!-- Name completed by histogram_suffixes name="Cras.Direction" and name="Cras.ClientType" --> @@ -787,7 +787,7 @@ <summary>Record the errors happen when CRAS server creats a stream.</summary> </histogram> -<histogram name="Cras.StreamEffects" units="value" expires_after="2024-03-16"> +<histogram name="Cras.StreamEffects" units="value" expires_after="2024-05-19"> <!-- Name completed by histogram_suffixes name="Cras.Direction" and name="Cras.ClientType" --> @@ -882,7 +882,7 @@ </histogram> <histogram name="Cras.StreamSamplingFormat" enum="AlsaSampleFormatType" - expires_after="2024-03-16"> + expires_after="2024-05-19"> <!-- Name completed by histogram_suffixes name="Cras.Direction" and name="Cras.ClientType" -->
diff --git a/tools/metrics/histograms/metadata/cros_ml/histograms.xml b/tools/metrics/histograms/metadata/cros_ml/histograms.xml index 215ac53..ceea88d 100644 --- a/tools/metrics/histograms/metadata/cros_ml/histograms.xml +++ b/tools/metrics/histograms/metadata/cros_ml/histograms.xml
@@ -51,6 +51,50 @@ </summary> </histogram> +<histogram name="FederatedService.TrainingConditionToContinue" + enum="FederatedTrainingConditionResult" expires_after="2024-04-28"> + <owner>alanlxl@chromium.org</owner> + <owner>amoylan@chromium.org</owner> + <owner>amandadeacon@chromium.org</owner> + <owner>cros-federated-team@google.com</owner> + <summary> + Logs training condition check results during a federated round, including + the overall result (Pass/Failed) and particular reasons of failure. Libfcp + calls training condition check periodically during a round and once the + check fails, it aborts the round. Interpret the histogram with the following + formulas: + + #all_calls = #Pass + #Failed; Failure rate = #Failed / (#Pass + #Failed) + + weight of one reason = #this_reason / #Failed + + Note: in one check, all failed conditions are logged as reasons (v.s. the + first failed one only). Therefore the sum of all reasons can be greater than + the number of Failed. + </summary> +</histogram> + +<histogram name="FederatedService.TrainingConditionToStart" + enum="FederatedTrainingConditionResult" expires_after="2024-04-28"> + <owner>alanlxl@chromium.org</owner> + <owner>amoylan@chromium.org</owner> + <owner>amandadeacon@chromium.org</owner> + <owner>cros-federated-team@google.com</owner> + <summary> + Logs training condition check results before a federated round, including + the overall result (Pass/Failed) and particular reasons of failure. + Interpret the histogram with the following formulas: + + #all_calls = #Pass + #Failed; Failure rate = #Failed / (#Pass + #Failed) + + weight of one reason = #this_reason / #Failed + + Note: in one check, all failed conditions are logged as reasons (v.s. the + first failed one only). Therefore the sum of all reasons can be greater than + the number of Failed. + </summary> +</histogram> + <histogram name="FederatedService.{Population}.CpuTimeMicrosec" units="microseconds" expires_after="2024-04-28"> <owner>amoylan@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/crostini/histograms.xml b/tools/metrics/histograms/metadata/crostini/histograms.xml index dcf8ea5..ba55d82a 100644 --- a/tools/metrics/histograms/metadata/crostini/histograms.xml +++ b/tools/metrics/histograms/metadata/crostini/histograms.xml
@@ -306,7 +306,7 @@ </histogram> <histogram name="Crostini.Restarter.Started" enum="BooleanAttempted" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>davidmunro@google.com</owner> <owner>clumptini@google.com</owner> <summary> @@ -327,7 +327,7 @@ </histogram> <histogram name="Crostini.RestarterResult.Installer" enum="CrostiniResult" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>timloh@google.com</owner> <owner>clumptini@google.com</owner> <summary> @@ -362,7 +362,7 @@ </histogram> <histogram name="Crostini.Restore" enum="CrostiniImportContainerResult" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>davidmunro@google.com</owner> <owner>clumptini@google.com</owner> <summary>Result of crostini restore.</summary> @@ -572,7 +572,7 @@ </histogram> <histogram base="true" name="Crostini.UnsupportedNotification.Reason" - enum="CrostiniUnsupportedNotificationReason" expires_after="2024-03-17"> + enum="CrostiniUnsupportedNotificationReason" expires_after="2024-05-19"> <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 4c4db091..426b79eb 100644 --- a/tools/metrics/histograms/metadata/cryptohome/histograms.xml +++ b/tools/metrics/histograms/metadata/cryptohome/histograms.xml
@@ -97,7 +97,7 @@ </histogram> <histogram name="Cryptohome.DiskCleanupProgress" - enum="CryptohomeDiskCleanupProgress" expires_after="2024-04-28"> + enum="CryptohomeDiskCleanupProgress" expires_after="2024-12-01"> <owner>vsavu@google.com</owner> <owner>chromeos-disk-cleanup@google.com</owner> <summary> @@ -109,7 +109,7 @@ </histogram> <histogram name="Cryptohome.DiskCleanupResult" - enum="CryptohomeDiskCleanupResult" expires_after="2024-04-28"> + enum="CryptohomeDiskCleanupResult" expires_after="2024-12-01"> <owner>vsavu@google.com</owner> <owner>chromeos-disk-cleanup@google.com</owner> <summary>Records the result of triggering disk cleanup.</summary> @@ -151,7 +151,7 @@ </histogram> <histogram name="Cryptohome.FreedCacheVaultDiskSpaceInMb" units="MB" - expires_after="2023-12-01"> + expires_after="2024-12-01"> <owner>vsavu@google.com</owner> <owner>chromeos-disk-cleanup@google.com</owner> <summary> @@ -162,7 +162,7 @@ </histogram> <histogram name="Cryptohome.FreeDiskSpaceDuringLoginTotalFreedInMb" units="MiB" - expires_after="2024-04-28"> + expires_after="2024-12-01"> <owner>vsavu@google.com</owner> <owner>chromeos-disk-cleanup@google.com</owner> <summary> @@ -177,7 +177,7 @@ </histogram> <histogram name="Cryptohome.FreeDiskSpaceTotalFreedInMb" units="MiB" - expires_after="2024-04-28"> + expires_after="2024-12-01"> <owner>vsavu@google.com</owner> <owner>chromeos-disk-cleanup@google.com</owner> <summary> @@ -191,7 +191,7 @@ </histogram> <histogram name="Cryptohome.FreeDiskSpaceTotalTime2" units="ms" - expires_after="2024-04-28"> + expires_after="2024-12-01"> <owner>vsavu@google.com</owner> <owner>chromeos-disk-cleanup@google.com</owner> <summary> @@ -203,7 +203,7 @@ </histogram> <histogram name="Cryptohome.GCache.FreedDiskSpaceInMb" units="MB" - expires_after="2024-04-28"> + expires_after="2024-12-01"> <owner>vsavu@google.com</owner> <owner>chromeos-disk-cleanup@google.com</owner> <summary> @@ -214,7 +214,7 @@ </histogram> <histogram name="Cryptohome.HomedirEncryptionType" enum="HomedirEncryptionType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dspaid@chromium.org</owner> <summary> The encryption type used for a user's cryptohome directory. This is logged @@ -267,7 +267,7 @@ fully migrated pinweaver_manager to libhwsec (target: M120)--> <histogram name="Cryptohome.LECredential.{Operation}{Action}" - enum="CryptohomeLECredError" expires_after="2024-03-17"> + enum="CryptohomeLECredError" expires_after="2024-05-19"> <owner>hcyang@google.com</owner> <owner>cros-hwsec+uma@google.com</owner> <summary> @@ -318,7 +318,7 @@ </histogram> <histogram name="Cryptohome.LoginDiskCleanupAvailableSpace" units="MiB" - expires_after="2024-04-28"> + expires_after="2024-12-01"> <owner>vsavu@google.com</owner> <owner>chromeos-disk-cleanup@google.com</owner> <summary> @@ -328,7 +328,7 @@ </histogram> <histogram name="Cryptohome.LoginDiskCleanupProgress" - enum="CryptohomeLoginDiskCleanupProgress" expires_after="2024-04-28"> + enum="CryptohomeLoginDiskCleanupProgress" expires_after="2024-12-01"> <owner>vsavu@google.com</owner> <owner>chromeos-disk-cleanup@google.com</owner> <summary> @@ -343,7 +343,7 @@ </histogram> <histogram name="Cryptohome.LoginDiskCleanupResult" - enum="CryptohomeDiskCleanupResult" expires_after="2024-04-28"> + enum="CryptohomeDiskCleanupResult" expires_after="2024-12-01"> <owner>vsavu@google.com</owner> <owner>chromeos-disk-cleanup@google.com</owner> <summary> @@ -354,7 +354,7 @@ </histogram> <histogram name="Cryptohome.LoginDiskCleanupTotalTime" units="ms" - expires_after="2024-04-28"> + expires_after="2024-12-01"> <owner>vsavu@google.com</owner> <owner>chromeos-disk-cleanup@google.com</owner> <summary> @@ -483,7 +483,7 @@ </histogram> <histogram name="Cryptohome.TimeBetweenFreeDiskSpace" units="s" - expires_after="2024-04-28"> + expires_after="2024-12-01"> <owner>vsavu@google.com</owner> <owner>chromeos-disk-cleanup@google.com</owner> <summary> @@ -544,7 +544,7 @@ </histogram> <histogram name="Cryptohome.TimeToInitPkcs11" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>apronin@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 e6152ae..17a6667 100644 --- a/tools/metrics/histograms/metadata/custom_tabs/histograms.xml +++ b/tools/metrics/histograms/metadata/custom_tabs/histograms.xml
@@ -223,7 +223,7 @@ </histogram> <histogram name="CustomTabs.DetachedResourceRequest.FinalStatus" - enum="NetErrorCodes" expires_after="2024-03-17"> + enum="NetErrorCodes" expires_after="2024-05-19"> <owner>lizeb@chromium.org</owner> <owner>cct-team@google.com</owner> <summary> @@ -260,7 +260,7 @@ </histogram> <histogram name="CustomTabs.FeatureUsage" enum="CustomTabsFeatureUsed" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>donnd@chromium.org</owner> <owner>chrome-connective-tissue@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/data/histograms.xml b/tools/metrics/histograms/metadata/data/histograms.xml index 9ca5f4b..4a9e32a 100644 --- a/tools/metrics/histograms/metadata/data/histograms.xml +++ b/tools/metrics/histograms/metadata/data/histograms.xml
@@ -95,7 +95,7 @@ </histogram> <histogram name="DataUse.BytesReceived3.Delegate" units="bytes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>curranmax@chromium.org</owner> <owner>ryansturm@chromium.org</owner> <owner>spelchat@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/dev/histograms.xml b/tools/metrics/histograms/metadata/dev/histograms.xml index 283d6d6..5bd8ff4 100644 --- a/tools/metrics/histograms/metadata/dev/histograms.xml +++ b/tools/metrics/histograms/metadata/dev/histograms.xml
@@ -355,7 +355,7 @@ </histogram> <histogram base="true" name="DevTools.Launch" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <!-- Name completed by histogram_suffixes name="DevToolsLaunchPanels" --> <owner>yangguo@chromium.org</owner> @@ -461,9 +461,9 @@ </histogram> <histogram name="DevTools.NetworkPanelResponsePreviewOpened" - enum="DevToolsMediaType" expires_after="2023-12-31"> - <owner>yangguo@chromium.org</owner> + enum="DevToolsMediaType" expires_after="2024-12-31"> <owner>bmeurer@chromium.org</owner> + <owner>szuend@chromium.org</owner> <summary> Records the media types of files opened in the DevTools Network panel response preview. @@ -498,7 +498,7 @@ </histogram> <histogram name="DevTools.RecordingAssertion" enum="DevToolsRecordingAssertion" - expires_after="2024-03-13"> + expires_after="2024-05-19"> <owner>jrandolf@chromium.org</owner> <owner>mathias@chromium.org</owner> <owner>yangguo@chromium.org</owner> @@ -619,7 +619,7 @@ </histogram> <histogram name="DevTools.SourcesPanelFileDebugged" enum="DevToolsMediaType" - expires_after="2024-05-05"> + expires_after="2024-12-31"> <owner>bmeurer@chromium.org</owner> <owner>szuend@chromium.org</owner> <summary> @@ -630,9 +630,9 @@ </histogram> <histogram name="DevTools.SourcesPanelFileOpened" enum="DevToolsMediaType" - expires_after="2024-05-05"> - <owner>yangguo@chromium.org</owner> + expires_after="2024-12-31"> <owner>bmeurer@chromium.org</owner> + <owner>szuend@chromium.org</owner> <summary> Records the media types of files opened in the DevTools Sources panel. </summary>
diff --git a/tools/metrics/histograms/metadata/download/histograms.xml b/tools/metrics/histograms/metadata/download/histograms.xml index a4e41d5..2dc143b 100644 --- a/tools/metrics/histograms/metadata/download/histograms.xml +++ b/tools/metrics/histograms/metadata/download/histograms.xml
@@ -124,7 +124,7 @@ </histogram> <histogram name="Download.Bubble.PartialToFullViewLatency" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -331,7 +331,7 @@ </histogram> <histogram name="Download.DownloadDangerPrompt" - enum="SBClientDownloadExtensions" expires_after="2024-03-17"> + enum="SBClientDownloadExtensions" expires_after="2024-05-19"> <owner>vakh@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 b53c2c96..3a14214f 100644 --- a/tools/metrics/histograms/metadata/enterprise/histograms.xml +++ b/tools/metrics/histograms/metadata/enterprise/histograms.xml
@@ -1223,7 +1223,7 @@ </histogram> <histogram name="Enterprise.Dlp.ConfidentialContentsCount" units="entries" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>aidazolic@chromium.org</owner> <owner>chromeos-dlp@google.com</owner> <summary> @@ -2338,7 +2338,7 @@ </histogram> <histogram name="Enterprise.OnBulkDataEntry.DataSize" units="bytes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>domfc@chromium.org</owner> <owner>webprotect-team@google.com</owner> <summary> @@ -2473,7 +2473,7 @@ </histogram> <histogram name="Enterprise.PolicyRefresh2" enum="EnterprisePolicyRefresh" - expires_after="2023-12-01"> + expires_after="2024-06-01"> <owner>asumaneev@google.com</owner> <owner>chromeos-commercial-remote-management@google.com</owner> <summary> @@ -2599,7 +2599,7 @@ </histogram> <histogram name="Enterprise.RegularUserSession.SessionLength" units="minutes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bfranz@chromium.org</owner> <owner>chromeos-kiosk-eng@google.com</owner> <summary> @@ -2958,7 +2958,7 @@ </histogram> <histogram name="Enterprise.UserPolicyChromeOS.ChildUser.OAuthTokenError" - enum="GoogleServiceAuthError" expires_after="2024-03-17"> + enum="GoogleServiceAuthError" expires_after="2024-05-19"> <owner>agawronska@chromium.org</owner> <owner>michaelpg@chromium.org</owner> <summary>Failure reason for OAuth token fetch for child user.</summary> @@ -3017,7 +3017,7 @@ </histogram> <histogram name="Enterprise.UserRemoteCommandInvalidations" - enum="EnterprisePolicyInvalidations" expires_after="2023-12-01"> + enum="EnterprisePolicyInvalidations" expires_after="2024-06-01"> <owner>asumaneev@google.com</owner> <owner>chromeos-commercial-remote-management@google.com</owner> <summary> @@ -3165,7 +3165,7 @@ </histogram> <histogram name="EnterpriseCheck.IsFullyManaged2" enum="IsFullyManagedBoolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>twellington@google.com</owner> <owner>tedchcoc@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/event/histograms.xml b/tools/metrics/histograms/metadata/event/histograms.xml index a03090b..60b9a65 100644 --- a/tools/metrics/histograms/metadata/event/histograms.xml +++ b/tools/metrics/histograms/metadata/event/histograms.xml
@@ -244,7 +244,7 @@ </histogram> <histogram name="Event.Jank.PredictorJankyFramePercentage" units="%" - expires_after="2024-03-20"> + expires_after="2024-05-19"> <owner>mekk@google.com</owner> <owner>woa-performance@google.com</owner> <summary> @@ -313,7 +313,7 @@ <histogram name="Event.Jank.ScrollUpdate.{ScrollSpeed}.{VsyncStatus}.FrameAboveJankyThreshold2" - units="ratio * 100" expires_after="2024-03-20"> + units="ratio * 100" expires_after="2024-05-19"> <owner>mekk@google.com</owner> <owner>woa-performance@google.com</owner> <summary> @@ -652,7 +652,7 @@ </histogram> <histogram name="Event.Latency.ScrollUpdate.TimeToScrollUpdateSwapBegin2" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>nzolghadr@chromium.org</owner> <summary> NOTE: This metric is deprecated in favor of @@ -679,7 +679,7 @@ </histogram> <histogram name="Event.Latency.ScrollUpdate.TotalEvents" units="counts" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ddrone@google.com</owner> <owner>chrometto-team@google.com</owner> <summary> @@ -920,7 +920,7 @@ </histogram> <histogram name="Event.PassiveListeners" enum="EventResultType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dtapuska@chromium.org</owner> <summary> The result of handling of MouseWheel, TouchStart, TouchMove, TouchEnd events @@ -931,7 +931,7 @@ </histogram> <histogram name="Event.ScrollJank.DelayedFramesPercentage.FixedWindow" - units="%" expires_after="2024-03-20"> + units="%" expires_after="2024-05-19"> <owner>kartarsingh@google.com</owner> <owner>mekk@google.com</owner> <owner>woa-performance-team@google.com</owner> @@ -951,7 +951,7 @@ </histogram> <histogram name="Event.ScrollJank.DelayedFramesPercentage.PerScroll{Length}" - units="%" expires_after="2024-03-20"> + units="%" expires_after="2024-05-19"> <owner>kartarsingh@google.com</owner> <owner>mekk@google.com</owner> <owner>woa-performance-team@google.com</owner> @@ -972,7 +972,7 @@ </histogram> <histogram name="Event.ScrollJank.MissedVsyncs.PerFrame" units="counts" - expires_after="2024-03-20"> + expires_after="2024-05-19"> <owner>kartarsingh@google.com</owner> <owner>mekk@google.com</owner> <owner>woa-performance-team@google.com</owner> @@ -996,7 +996,7 @@ </histogram> <histogram name="Event.ScrollJank.MissedVsyncsPercentage.FixedWindow" units="%" - expires_after="2024-03-20"> + expires_after="2024-05-19"> <owner>mekk@google.com</owner> <owner>woa-performance-team@google.com</owner> <summary> @@ -1018,7 +1018,7 @@ </histogram> <histogram name="Event.ScrollJank.MissedVsyncsPercentage.PerScroll{Length}" - units="%" expires_after="2024-03-20"> + units="%" expires_after="2024-05-19"> <owner>kartarsingh@google.com</owner> <owner>mekk@google.com</owner> <owner>woa-performance-team@google.com</owner> @@ -1043,7 +1043,7 @@ </histogram> <histogram name="Event.ScrollJank.MissedVsyncs{Operator}.FixedWindow" - units="counts" expires_after="2024-03-20"> + units="counts" expires_after="2024-05-19"> <owner>kartarsingh@google.com</owner> <owner>mekk@google.com</owner> <owner>woa-performance-team@google.com</owner> @@ -1068,7 +1068,7 @@ </histogram> <histogram name="Event.ScrollJank.MissedVsyncs{Operator}.FixedWindow2" - units="counts" expires_after="2024-03-20"> + units="counts" expires_after="2024-05-19"> <owner>mekk@google.com</owner> <owner>woa-performance-team@google.com</owner> <summary> @@ -1092,7 +1092,7 @@ </histogram> <histogram name="Event.ScrollJank.MissedVsyncs{Operator}.PerScroll{Length}" - units="counts" expires_after="2024-03-20"> + units="counts" expires_after="2024-05-19"> <owner>kartarsingh@google.com</owner> <owner>mekk@google.com</owner> <owner>woa-performance-team@google.com</owner> @@ -1238,7 +1238,7 @@ </histogram> <histogram name="EventLatency.GestureScrollUpdate.Touchscreen.TotalLatency2" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1260,7 +1260,7 @@ <histogram name="EventLatency.GestureScrollUpdate.{NonTouchscreenScrollInputType}.TotalLatency{Version}" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1284,7 +1284,7 @@ </histogram> <histogram name="EventLatency.TotalLatency" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1298,7 +1298,7 @@ <histogram name="EventLatency.{NonGsuScrollEventType}.{ScrollInputType}.TotalLatency{Version}" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1337,7 +1337,7 @@ </histogram> <histogram name="EventLatency.{NonScrollPinchEventType}.TotalLatency" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1373,7 +1373,7 @@ </histogram> <histogram name="EventLatency.{PinchEventType}.{PinchInputType}.TotalLatency" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1424,7 +1424,7 @@ </histogram> <histogram name="EventLatency.{ScrollEventType}.TotalLatency{Version}" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/extensions/histograms.xml b/tools/metrics/histograms/metadata/extensions/histograms.xml index 05245a7..6a989fc8 100644 --- a/tools/metrics/histograms/metadata/extensions/histograms.xml +++ b/tools/metrics/histograms/metadata/extensions/histograms.xml
@@ -181,7 +181,7 @@ </histogram> <histogram name="Extensions.BackgroundHostCreatedForExtension" - enum="BackgroundHostCreatedForExtensionValues" expires_after="2024-03-17"> + enum="BackgroundHostCreatedForExtensionValues" expires_after="2024-05-19"> <owner>fdoray@chromium.org</owner> <owner>catan-team@chromium.org</owner> <summary> @@ -359,7 +359,7 @@ </histogram> <histogram name="Extensions.ContentVerification.FetchResult" - enum="BooleanSuccess" expires_after="2024-03-17"> + enum="BooleanSuccess" expires_after="2024-05-19"> <owner>vkovalova@google.com</owner> <owner>lazyboy@chromium.org</owner> <owner>rdevlin.cronin@chromium.org</owner> @@ -590,7 +590,7 @@ </histogram> <histogram name="Extensions.DeclarativeNetRequest.CreateVerifiedMatcherTime" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>kelvinjiang@chromium.org</owner> <owner>src/extensions/OWNERS</owner> <summary> @@ -2177,7 +2177,7 @@ </histogram> <histogram name="Extensions.Functions.SynchronousExecutionTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rdevlin.cronin@chromium.org</owner> <owner>extensions-core@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/feature_engagement/histograms.xml b/tools/metrics/histograms/metadata/feature_engagement/histograms.xml index 0c78a29..50670538 100644 --- a/tools/metrics/histograms/metadata/feature_engagement/histograms.xml +++ b/tools/metrics/histograms/metadata/feature_engagement/histograms.xml
@@ -606,7 +606,7 @@ </histogram> <histogram name="Tutorial{TutorialID}.AbortStep" units="int" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dpenning@chromium.org</owner> <owner>dfried@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/file/histograms.xml b/tools/metrics/histograms/metadata/file/histograms.xml index 9c430dac..25521f4 100644 --- a/tools/metrics/histograms/metadata/file/histograms.xml +++ b/tools/metrics/histograms/metadata/file/histograms.xml
@@ -162,7 +162,7 @@ </histogram> <histogram name="DriveCommon.LocalSearch.OfflineSearchTime" units="ms" - expires_after="M124"> + expires_after="2024-05-19"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -182,7 +182,7 @@ </histogram> <histogram name="DriveCommon.LocalSearch.TextSearchTime" units="ms" - expires_after="M124"> + expires_after="2024-05-19"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -210,7 +210,7 @@ </histogram> <histogram name="FileBrowser.ChangeDirectory.RootType" - enum="FileManagerRootType" expires_after="2024-03-17"> + enum="FileManagerRootType" expires_after="2024-05-19"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -327,7 +327,7 @@ </histogram> <histogram name="FileBrowser.DownloadsCount" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -472,7 +472,7 @@ </histogram> <histogram name="FileBrowser.Glitch" enum="FileManagerGlitch" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>majewski@chromium.org</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -788,7 +788,7 @@ </histogram> <histogram name="FileBrowser.Notification.Show" - enum="FileManagerNotificationType" expires_after="2024-03-17"> + enum="FileManagerNotificationType" expires_after="2024-05-19"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -1343,7 +1343,7 @@ </histogram> <histogram name="FileBrowser.Recent.LoadArcMedia" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -1353,7 +1353,7 @@ </histogram> <histogram name="FileBrowser.Recent.LoadCrostini" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -1373,7 +1373,7 @@ </histogram> <histogram name="FileBrowser.Recent.LoadDrive" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -1394,7 +1394,7 @@ </histogram> <histogram name="FileBrowser.Recent.LoadTotal" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -1465,7 +1465,7 @@ </histogram> <histogram name="FileBrowser.ToggleFileListType" enum="FileManagerListType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <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 76238997..68801b6 100644 --- a/tools/metrics/histograms/metadata/gcm/histograms.xml +++ b/tools/metrics/histograms/metadata/gcm/histograms.xml
@@ -175,7 +175,7 @@ </histogram> <histogram name="GCM.SendWebPushMessageResult" enum="SendWebPushMessageResult" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>knollr@chromium.org</owner> <owner>peter@chromium.org</owner> <summary> @@ -193,15 +193,6 @@ </summary> </histogram> -<histogram name="GCM.StoreUpdateSucceeded" enum="BooleanSuccess" - expires_after="2018-08-30"> - <owner>zea@chromium.org</owner> - <summary> - Success indicates successfully updating the GCM persistent store on message - update. Failure indicates a failure updating the persistence store. - </summary> -</histogram> - <histogram name="GCM.WebPushReceived.DeviceState" enum="WebPushDeviceState" expires_after="2022-01-02"> <owner>knollr@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/gpu/histograms.xml b/tools/metrics/histograms/metadata/gpu/histograms.xml index b08cf2e..d05f314 100644 --- a/tools/metrics/histograms/metadata/gpu/histograms.xml +++ b/tools/metrics/histograms/metadata/gpu/histograms.xml
@@ -432,7 +432,7 @@ </histogram> <histogram name="GPU.CanvasOopRaster.OopRasterAndGpuAcceleration" - enum="CanvasOopRasterAndGpuAcceleration" expires_after="2024-03-17"> + enum="CanvasOopRasterAndGpuAcceleration" expires_after="2024-05-19"> <owner>vasilyt@chromium.org</owner> <owner>nazabris@microsoft.com</owner> <owner>jochin@microsoft.com</owner> @@ -455,7 +455,7 @@ </histogram> <histogram name="GPU.ContextLost" enum="ContextLostReason" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sievers@chromium.org</owner> <summary> The reason a GPU command buffer context of a given type was lost. @@ -648,7 +648,7 @@ </histogram> <histogram name="GPU.DirectComposition.OverlayFormatUsed3" enum="DXGI_FORMAT" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sunnyps@chromium.org</owner> <owner>zmo@chromium.org</owner> <owner>magchen@chromium.org</owner> @@ -661,7 +661,7 @@ </histogram> <histogram name="GPU.DirectComposition.OverlaysSupported" - enum="BooleanOverlaySupported" expires_after="2024-03-17"> + enum="BooleanOverlaySupported" expires_after="2024-05-19"> <owner>sunnyps@chromium.org</owner> <owner>zmo@chromium.org</owner> <owner>magchen@chromium.org</owner> @@ -724,7 +724,7 @@ </histogram> <histogram name="GPU.EGLDisplayType" enum="EGLDisplayType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>zmo@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary>The display type used to ask for an EGLDisplay.</summary> @@ -797,7 +797,7 @@ </histogram> <histogram name="GPU.GLImplementation" enum="GLImplementation" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>magchen@chromium.org</owner> <owner>zmo@chromium.org</owner> <summary> @@ -836,7 +836,7 @@ </histogram> <histogram name="GPU.GPUProcessExitCode" enum="GPUProcessExitCode" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>zmo@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -854,7 +854,7 @@ </histogram> <histogram name="GPU.GPUProcessLaunchTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>vmiura@chromium.org</owner> <summary> Startup time of the GPU process as measured by the GPU process host. @@ -879,7 +879,7 @@ </histogram> <histogram name="GPU.GPUProcessTerminationStatus2" enum="GpuTerminationStatus" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>vmiura@chromium.org</owner> <summary> Counts for each time the GPU Process Host detects the process dies. @@ -934,7 +934,7 @@ </histogram> <histogram name="GPU.IntelGpuGeneration" enum="IntelGpuGeneration" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>zmo@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -944,7 +944,7 @@ </histogram> <histogram name="GPU.IntelGpuSeriesType" enum="IntelGpuSeriesType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sunnyps@chromium.org</owner> <owner>zmo@chromium.org</owner> <summary> @@ -1142,7 +1142,7 @@ </summary> </histogram> -<histogram name="GPU.Output.HDR" enum="Boolean" expires_after="2024-03-17"> +<histogram name="GPU.Output.HDR" enum="Boolean" expires_after="2024-05-19"> <owner>hubbe@chromium.org</owner> <owner>cassew@chromium.org</owner> <owner>media-dev-uma@chromium.org</owner> @@ -1190,7 +1190,7 @@ </histogram> <histogram name="GPU.ProcessLifetimeEvents.HardwareAccelerated" - enum="GPUProcessLifetimeEvent" expires_after="2024-03-17"> + enum="GPUProcessLifetimeEvent" expires_after="2024-05-19"> <owner>vmiura@chromium.org</owner> <summary> Recorded once for every GPU process launch and crash when GPU process is @@ -1201,7 +1201,7 @@ </histogram> <histogram name="GPU.ProcessLifetimeEvents.SwiftShader" - enum="GPUProcessLifetimeEvent" expires_after="2024-03-17"> + enum="GPUProcessLifetimeEvent" expires_after="2024-05-19"> <owner>vmiura@chromium.org</owner> <summary> Recorded once for every GPU process launch and crash when GPU process is @@ -1355,7 +1355,7 @@ </histogram> <histogram name="GPU.SoftwareRendering" enum="BooleanSoftwareRendering" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>zmo@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1799,7 +1799,7 @@ </histogram> <histogram name="Viz.BeginFrameSource.Accuracy.AverageDelta" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>magchen@chromium.org</owner> <owner>ccameron@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> @@ -1852,7 +1852,7 @@ </histogram> <histogram name="Viz.DisplayCompositor.OverlayNumProposedCandidates" - units="units" expires_after="2024-03-17"> + units="units" expires_after="2024-05-19"> <owner>petermcneeley@chromium.org</owner> <owner>khaslett@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> @@ -1898,7 +1898,7 @@ </histogram> <histogram name="Viz.DisplayCompositor.RootDamageRect.Overlay" - enum="BooleanOverlayDamageRect" expires_after="2024-03-17"> + enum="BooleanOverlayDamageRect" expires_after="2024-05-19"> <owner>magchen@chromium.org</owner> <owner>zmo@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/history/histograms.xml b/tools/metrics/histograms/metadata/history/histograms.xml index b047051..4bc8f1ba 100644 --- a/tools/metrics/histograms/metadata/history/histograms.xml +++ b/tools/metrics/histograms/metadata/history/histograms.xml
@@ -440,7 +440,7 @@ </histogram> <histogram name="History.ClearBrowsingData.UserDeletedFromTab" - enum="ClearBrowsingDataTab" expires_after="2024-03-17"> + enum="ClearBrowsingDataTab" expires_after="2024-05-19"> <owner>dullweber@chromium.org</owner> <owner>msramek@chromium.org</owner> <component>UI>Browser>History</component> @@ -451,7 +451,7 @@ </histogram> <histogram name="History.Clusters.Actions.DidMakeQuery" enum="BooleanQueried" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mcrouse@chromium.org</owner> <owner>chrome-journeys@google.com</owner> <component>UI>Browser>Journeys</component> @@ -1582,7 +1582,7 @@ </histogram> <histogram name="History.DatabaseBasicMetricsTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sophiechang@chromium.org</owner> <owner>tommycli@chromium.org</owner> <owner>treib@chromium.org</owner> @@ -1632,7 +1632,7 @@ </histogram> <histogram name="History.DatabaseSqliteError" enum="SqliteLoggedResultCode" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sophiechang@chromium.org</owner> <owner>asully@chromium.org</owner> <component>UI>Browser>History</component> @@ -1643,7 +1643,7 @@ </histogram> <histogram name="History.DomainCount1Day_V2" units="domains" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mpearson@chromium.org</owner> <owner>mjzhang@chromium.org</owner> <owner>chrome-analysis-team@google.com</owner> @@ -1705,7 +1705,7 @@ </histogram> <histogram name="History.DomainCount28Day_V2" units="domains" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mpearson@chromium.org</owner> <owner>mjzhang@chromium.org</owner> <owner>chrome-analysis-team@google.com</owner> @@ -1767,7 +1767,7 @@ </histogram> <histogram name="History.DomainCount7Day_V2" units="domains" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mpearson@chromium.org</owner> <owner>mjzhang@chromium.org</owner> <owner>chrome-analysis-team@google.com</owner> @@ -2033,7 +2033,7 @@ </histogram> <histogram name="History.MonthlyHostCount" units="hosts" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mpearson@chromium.org</owner> <owner>sky@chromium.org</owner> <component>UI>Browser>History</component> @@ -2222,7 +2222,7 @@ </histogram> <histogram name="History.WeeklyHostCount" units="hosts" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mpearson@chromium.org</owner> <owner>sky@chromium.org</owner> <component>UI>Browser>History</component>
diff --git a/tools/metrics/histograms/metadata/image/histograms.xml b/tools/metrics/histograms/metadata/image/histograms.xml index 0350dc22..7a52044 100644 --- a/tools/metrics/histograms/metadata/image/histograms.xml +++ b/tools/metrics/histograms/metadata/image/histograms.xml
@@ -88,7 +88,7 @@ </variants> <histogram name="ImageAnnotationService.AccessibilityV1.CacheHit" - enum="BooleanCacheHit" expires_after="2024-03-17"> + enum="BooleanCacheHit" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -104,7 +104,7 @@ </histogram> <histogram name="ImageAnnotationService.AccessibilityV1.ClientResult" - enum="ImageAnnotationServiceClientResult" expires_after="2024-03-17"> + enum="ImageAnnotationServiceClientResult" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -119,7 +119,7 @@ </histogram> <histogram name="ImageAnnotationService.AccessibilityV1.DescFailure" - enum="DescFailureReason" expires_after="2024-03-17"> + enum="DescFailureReason" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -131,7 +131,7 @@ </histogram> <histogram name="ImageAnnotationService.AccessibilityV1.DescType" - enum="ImageAnnotationServiceDescType" expires_after="2024-03-17"> + enum="ImageAnnotationServiceDescType" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -146,7 +146,7 @@ </histogram> <histogram name="ImageAnnotationService.AccessibilityV1.EncodedJpegSizeKB" - units="KB" expires_after="2024-03-17"> + units="KB" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -161,7 +161,7 @@ </histogram> <histogram name="ImageAnnotationService.AccessibilityV1.EngineKnown" - enum="BooleanKnown" expires_after="2024-03-17"> + enum="BooleanKnown" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -177,7 +177,7 @@ <histogram name="ImageAnnotationService.AccessibilityV1.ImageRequestIncludesDesc" - enum="BooleanIncluded" expires_after="2024-03-17"> + enum="BooleanIncluded" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -197,7 +197,7 @@ <histogram name="ImageAnnotationService.AccessibilityV1.ImageRequestIncludesIcon" - enum="BooleanIncluded" expires_after="2024-03-17"> + enum="BooleanIncluded" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -215,7 +215,7 @@ </histogram> <histogram name="ImageAnnotationService.AccessibilityV1.JsonParseSuccess" - enum="BooleanSuccess" expires_after="2024-03-17"> + enum="BooleanSuccess" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -230,7 +230,7 @@ </histogram> <histogram name="ImageAnnotationService.AccessibilityV1.PixelFetchSuccess" - enum="BooleanSuccess" expires_after="2024-03-17"> + enum="BooleanSuccess" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -246,7 +246,7 @@ </histogram> <histogram name="ImageAnnotationService.AccessibilityV1.ServerHttpResponseCode" - enum="HttpResponseCode" expires_after="2024-03-17"> + enum="HttpResponseCode" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -261,7 +261,7 @@ </histogram> <histogram name="ImageAnnotationService.AccessibilityV1.ServerLatencyMs" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -276,7 +276,7 @@ </histogram> <histogram name="ImageAnnotationService.AccessibilityV1.ServerNetError" - enum="NetErrorCodes" expires_after="2024-03-17"> + enum="NetErrorCodes" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -291,7 +291,7 @@ </histogram> <histogram name="ImageAnnotationService.AccessibilityV1.ServerRequestSizeKB" - units="KB" expires_after="2024-03-17"> + units="KB" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -308,7 +308,7 @@ <histogram name="ImageAnnotationService.AccessibilityV1.ServerResponseSizeBytes" - units="bytes" expires_after="2024-03-17"> + units="bytes" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner> @@ -323,7 +323,7 @@ </histogram> <histogram name="ImageAnnotationService.AccessibilityV1.SourcePixelCount" - units="pixels" expires_after="2024-03-17"> + units="pixels" expires_after="2024-05-19"> <owner>dtseng@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>mschillaci@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/input/histograms.xml b/tools/metrics/histograms/metadata/input/histograms.xml index 08d8da2..c9147831 100644 --- a/tools/metrics/histograms/metadata/input/histograms.xml +++ b/tools/metrics/histograms/metadata/input/histograms.xml
@@ -46,7 +46,7 @@ </histogram> <histogram name="Input.UnrecognizedToolType.Android" units="tool type" - expires_after="2024-01-15"> + expires_after="2024-05-19"> <owner>alexmitra@chromium.org</owner> <owner>flackr@chromium.org</owner> <owner>peconn@chromium.org</owner> @@ -931,16 +931,6 @@ </summary> </histogram> -<histogram name="InputMethod.CompositionWithImm32BasedIme" enum="Boolean" - expires_after="M78"> - <owner>lanwei@chromium.org</owner> - <owner>siliu@microsoft.com</owner> - <summary> - Whether the composition is composed by IMM32-based input method processor - when TSF is disabled on Windows. Recorded when user starts new composition. - </summary> -</histogram> - <histogram name="InputMethod.Handwriting.Actions" enum="ImeHandwritingActions" expires_after="2022-04-10"> <owner>shend@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/interstitial/histograms.xml b/tools/metrics/histograms/metadata/interstitial/histograms.xml index 09c0633..06a3d90d 100644 --- a/tools/metrics/histograms/metadata/interstitial/histograms.xml +++ b/tools/metrics/histograms/metadata/interstitial/histograms.xml
@@ -249,7 +249,7 @@ </histogram> <histogram name="TypedNavigationUpgradeThrottle.Event" - enum="TypedNavigationUpgradeThrottleEvent" expires_after="2024-03-17"> + enum="TypedNavigationUpgradeThrottleEvent" expires_after="2024-05-19"> <owner>meacer@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/ios/histograms.xml b/tools/metrics/histograms/metadata/ios/histograms.xml index ca575896..89f84ac 100644 --- a/tools/metrics/histograms/metadata/ios/histograms.xml +++ b/tools/metrics/histograms/metadata/ios/histograms.xml
@@ -984,7 +984,7 @@ </histogram> <histogram name="IOS.Fullscreen.State" enum="CrFullscreenState" - expires_after="2024-03-10"> + expires_after="2024-05-19"> <owner>joemerramos@chromium.org</owner> <owner>ajuma@chromium.org</owner> <summary> @@ -2150,7 +2150,7 @@ </histogram> <histogram name="IOS.PasswordManager.WidgetPromo.Action" - enum="PromoWithInstructionsAction" expires_after="2024-03-12"> + enum="PromoWithInstructionsAction" expires_after="2024-05-19"> <owner>noemies@google.com</owner> <owner>bling-transactions@google.com</owner> <summary> @@ -2534,7 +2534,7 @@ </histogram> <histogram name="IOS.SadTab.FileIsPDF" enum="Boolean" - expires_after="2024-03-20"> + expires_after="2024-05-19"> <owner>ajuma@chromium.org</owner> <owner>gambard@chromium.org</owner> <summary> @@ -2867,7 +2867,7 @@ </histogram> <histogram name="IOS.SaveToPhotos.Settings" enum="IOSSaveToPhotosSettingsType" - expires_after="2024-03-19"> + expires_after="2024-05-19"> <owner>qpubert@chromium.org</owner> <owner>djean@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/leveldb_proto/histograms.xml b/tools/metrics/histograms/metadata/leveldb_proto/histograms.xml index 1a7b0606..cb8c79c 100644 --- a/tools/metrics/histograms/metadata/leveldb_proto/histograms.xml +++ b/tools/metrics/histograms/metadata/leveldb_proto/histograms.xml
@@ -116,7 +116,7 @@ </variants> <histogram name="LevelDB.ApproximateMemTableMemoryUse.{LevelDBClient}" - units="bytes" expires_after="2024-03-17"> + units="bytes" expires_after="2024-05-19"> <owner>nyquist@chromium.org</owner> <owner>salg@google.com</owner> <owner>chrome-owp-storage@google.com</owner> @@ -170,7 +170,7 @@ </histogram> <histogram name="ProtoDB.LoadEntriesSuccess.{LevelDBClient}" - enum="BooleanSuccess" expires_after="2024-03-17"> + enum="BooleanSuccess" expires_after="2024-05-19"> <owner>nyquist@chromium.org</owner> <owner>ssid@chromium.org</owner> <summary>Whether a ProtoDB LoadEntries call was successful or not.</summary> @@ -196,7 +196,7 @@ </histogram> <histogram name="ProtoDB.SharedDbInitStatus" enum="ProtoDatabaseInitState" - expires_after="2024-01-14"> + expires_after="2024-05-19"> <owner>ssid@chromium.org</owner> <owner>salg@chromium.org</owner> <summary> @@ -220,7 +220,7 @@ </histogram> <histogram name="ProtoDB.UpdateSuccess.{LevelDBClient}" enum="BooleanSuccess" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>nyquist@chromium.org</owner> <owner>ssid@chromium.org</owner> <summary>Whether a ProtoDB UpdateEntries call was successful or not.</summary>
diff --git a/tools/metrics/histograms/metadata/login/histograms.xml b/tools/metrics/histograms/metadata/login/histograms.xml index fffae912..b3e91ff 100644 --- a/tools/metrics/histograms/metadata/login/histograms.xml +++ b/tools/metrics/histograms/metadata/login/histograms.xml
@@ -59,7 +59,7 @@ </histogram> <histogram name="Login.BrowserShutdownTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>xiyuan@chromium.org</owner> <owner>cros-oac@google.com</owner> <summary> @@ -325,7 +325,7 @@ </histogram> <histogram name="Login.TokenCheckResponseTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>antrim@chromium.org</owner> <owner>cros-lurs@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/media/enums.xml b/tools/metrics/histograms/metadata/media/enums.xml index 9d67933..e2d791772 100644 --- a/tools/metrics/histograms/metadata/media/enums.xml +++ b/tools/metrics/histograms/metadata/media/enums.xml
@@ -1166,6 +1166,8 @@ <int value="12" label="FailedToCreateMediaEngine"/> <int value="13" label="FailedToCreateDCompTextureWrapper"/> <int value="14" label="FailedToInitDCompTextureWrapper"/> + <int value="15" label="FailedToSetPlaybackRate"/> + <int value="16" label="FailedToGetMediaEngineEx"/> </enum> <enum name="MediaGalleriesUsageType">
diff --git a/tools/metrics/histograms/metadata/media/histograms.xml b/tools/metrics/histograms/metadata/media/histograms.xml index da65be2..025f601 100644 --- a/tools/metrics/histograms/metadata/media/histograms.xml +++ b/tools/metrics/histograms/metadata/media/histograms.xml
@@ -312,7 +312,7 @@ </histogram> <histogram name="Media.AImageReaderGLOwner.AcquireImageResult" - enum="MediaStatus" expires_after="2024-03-17"> + enum="MediaStatus" expires_after="2024-05-19"> <owner>vikassoni@chromium.org</owner> <owner>media-dev-uma@chromium.org</owner> <summary> @@ -357,7 +357,7 @@ </histogram> <histogram name="Media.Android.MediaPlayerSuccess" enum="MediaPlayerExitStatus" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tguilbert@chromium.org</owner> <owner>media-dev-uma@chromium.org</owner> <summary>Android: Whether MediaPlayer exited without errors.</summary> @@ -431,7 +431,7 @@ </histogram> <histogram name="Media.Audio.Capture.DetectedMissingCallbacks" - enum="BooleanMissingCallbacks" expires_after="2024-03-17"> + enum="BooleanMissingCallbacks" expires_after="2024-05-19"> <owner>guidou@chromium.org</owner> <owner>olka@chromium.org</owner> <owner>webrtc-audio-uma@google.com</owner> @@ -692,7 +692,7 @@ </histogram> <histogram name="Media.Audio.Capture.Win.InitError" enum="Hresult" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>olka@chromium.org</owner> <owner>tommi@chromium.org</owner> <owner>guidou@chromium.org</owner> @@ -896,7 +896,7 @@ </histogram> <histogram name="Media.Audio.OutputDeviceAuthorizationTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>guidou@chromium.org</owner> <owner>olka@chromium.org</owner> <owner>webrtc-audio-uma@google.com</owner> @@ -1259,7 +1259,7 @@ </histogram> <histogram name="Media.Audio.TabAudioMuted" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>evliu@google.com</owner> <owner>chrome-media-ux@google.com</owner> <summary> @@ -2551,7 +2551,7 @@ </histogram> <histogram name="Media.EME.CrosCdmType" enum="CrosCdmType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jkardatzke@chromium.org</owner> <owner>cros-gfx-video@google.com</owner> <summary> @@ -3670,7 +3670,7 @@ </histogram> <histogram name="Media.MediaDevices.EnumerateDevices.Latency" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>toprice@chromium.org</owner> <owner>agpalak@chromium.org</owner> <summary> @@ -3682,7 +3682,7 @@ </histogram> <histogram name="Media.MediaDevices.EnumerateDevices.Result" - enum="EnumerateDevicesResult" expires_after="2024-03-17"> + enum="EnumerateDevicesResult" expires_after="2024-05-19"> <owner>toprice@chromium.org</owner> <owner>agpalak@chromium.org</owner> <summary> @@ -3741,7 +3741,7 @@ </histogram> <histogram name="Media.MediaDevices.GetUserMedia.Latency" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>toprice@chromium.org</owner> <owner>agpalak@chromium.org</owner> <owner>video-cmi-apis@google.com</owner> @@ -3754,7 +3754,7 @@ </histogram> <histogram name="Media.MediaDevices.GetUserMedia.Result" - enum="UserMediaRequestResult" expires_after="2024-03-17"> + enum="UserMediaRequestResult" expires_after="2024-05-19"> <owner>toprice@chromium.org</owner> <owner>agpalak@chromium.org</owner> <owner>video-cmi-apis@google.com</owner> @@ -3776,7 +3776,7 @@ </histogram> <histogram name="Media.MediaDevicesManager.VideoDeviceEnumeration.Result" - enum="DeviceEnumerationResult" expires_after="2024-03-17"> + enum="DeviceEnumerationResult" expires_after="2024-05-19"> <owner>toprice@chromium.org</owner> <owner>agpalak@chromium.org</owner> <summary> @@ -4131,7 +4131,7 @@ </histogram> <histogram name="Media.Notification.Cast.Count" units="count" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>takumif@chromium.org</owner> <owner>openscreen-eng@google.com</owner> <owner>media-dev-uma@chromium.org</owner> @@ -4142,7 +4142,7 @@ </histogram> <histogram name="Media.Notification.Cast.UserAction" enum="MediaSessionAction" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>takumif@chromium.org</owner> <owner>openscreen-eng@google.com</owner> <owner>media-dev-uma@chromium.org</owner> @@ -4206,7 +4206,7 @@ </histogram> <histogram name="Media.OutputStreamDuration" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>guidou@chromium.org</owner> <owner>olka@chromium.org</owner> <owner>webrtc-audio-uma@google.com</owner> @@ -4989,7 +4989,7 @@ <histogram name="Media.Ui.GetDisplayMedia.BasicFlow.UserInteraction" enum="MediaUiGetDisplayMediaBasicFlowUserInteraction" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>eladalon@chromium.org</owner> <owner>fbeaufort@chromium.org</owner> <summary> @@ -5011,7 +5011,7 @@ <histogram name="Media.Ui.GetDisplayMedia.PreferCurrentTabFlow.UserInteraction" enum="MediaUiGetDisplayMediaPreferCurrentTabFlowUserInteraction" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>eladalon@chromium.org</owner> <owner>fbeaufort@chromium.org</owner> <summary> @@ -5087,7 +5087,7 @@ </histogram> <histogram name="Media.V4l2VideoDecoder.VidiocIoctlError" - enum="VidiocIoctlRequests" expires_after="2024-01-26"> + enum="VidiocIoctlRequests" expires_after="2024-05-19"> <owner>stevecho@chromium.org</owner> <owner>chromeos-gfx-video@google.com</owner> <summary> @@ -5170,7 +5170,7 @@ </histogram> <histogram name="Media.Video.Autoplay" enum="AutoplaySource" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dalecurtis@chromium.org</owner> <owner>evliu@google.com</owner> <owner>media-dev-uma@chromium.org</owner> @@ -5298,7 +5298,7 @@ </summary> </histogram> -<histogram name="Media.Video.Roughness" units="ms" expires_after="2024-03-17"> +<histogram name="Media.Video.Roughness" units="ms" expires_after="2024-05-19"> <owner>eugene@chromium.org</owner> <owner>media-dev-uma@chromium.org</owner> <summary> @@ -5643,7 +5643,7 @@ </histogram> <histogram name="Media.VideoCapture.Win.Device.CapturePixelFormat" - enum="VideoPixelFormatUnion" expires_after="2024-03-19"> + enum="VideoPixelFormatUnion" expires_after="2024-05-19"> <owner>ilnik@google.com</owner> <owner>video-cmi-mpp@google.com</owner> <summary> @@ -6403,7 +6403,7 @@ </histogram> <histogram name="MediaRouter.Cast.Channel.ConnectResult" enum="BooleanSuccess" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mfoltz@chromium.org</owner> <owner>openscreen-eng@google.com</owner> <summary> @@ -6413,7 +6413,7 @@ </histogram> <histogram name="MediaRouter.Cast.Channel.Error" - enum="MediaRouterCastChannelError" expires_after="2024-03-17"> + enum="MediaRouterCastChannelError" expires_after="2024-05-19"> <owner>mfoltz@chromium.org</owner> <owner>openscreen-eng@google.com</owner> <summary> @@ -6454,7 +6454,7 @@ </histogram> <histogram name="MediaRouter.Cast.Discovery.SinkSource" - enum="MediaRouterCastSinkSource" expires_after="2024-03-17"> + enum="MediaRouterCastSinkSource" expires_after="2024-05-19"> <owner>takumif@chromium.org</owner> <owner>openscreen-eng@google.com</owner> <summary>The source of discovery for a newly-created Cast sink.</summary> @@ -6623,7 +6623,7 @@ </histogram> <histogram name="MediaRouter.CastStreaming.Start.Success" enum="MirrorType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>takumif@chromium.org</owner> <owner>openscreen-eng@google.com</owner> <summary> @@ -6901,7 +6901,7 @@ </histogram> <histogram name="MediaRouter.Source.CastingSource" - enum="MediaRouterSourceTypes" expires_after="2024-03-17"> + enum="MediaRouterSourceTypes" expires_after="2024-05-19"> <owner>takumif@chromium.org</owner> <owner>openscreen-eng@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/memory/histograms.xml b/tools/metrics/histograms/metadata/memory/histograms.xml index 5aa85582b1..05c33c0 100644 --- a/tools/metrics/histograms/metadata/memory/histograms.xml +++ b/tools/metrics/histograms/metadata/memory/histograms.xml
@@ -1635,7 +1635,7 @@ </histogram> <histogram name="Memory.ParkableString.Compression.Latency" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>lizeb@chromium.org</owner> <owner>thiabaud@google.com</owner> <summary> @@ -1752,7 +1752,7 @@ </histogram> <histogram name="Memory.PartitionAlloc.PeriodicPurge" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>lizeb@chromium.org</owner> <owner>bartekn@chromium.org</owner> <summary> @@ -1822,7 +1822,7 @@ </histogram> <histogram base="true" name="Memory.PressureWindowDuration" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <!-- Name completed by histogram_suffixes name="Memory.Pressure.TransitionType" --> <owner>fdoray@chromium.org</owner> @@ -2103,7 +2103,7 @@ </histogram> <histogram name="Memory.System.AvailableMB" units="MB" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>fdoray@chromium.org</owner> <owner>catan-team@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/mobile/histograms.xml b/tools/metrics/histograms/metadata/mobile/histograms.xml index c539e22c..d2283acf 100644 --- a/tools/metrics/histograms/metadata/mobile/histograms.xml +++ b/tools/metrics/histograms/metadata/mobile/histograms.xml
@@ -435,7 +435,7 @@ </histogram> <histogram name="Mobile.Share.EntryPoints" enum="IOSActivityScenario" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dimich@chromium.org</owner> <owner>bling-team@google.com</owner> <owner>chrome-with-friends-robots@google.com</owner> @@ -875,7 +875,7 @@ </histogram> <histogram name="MobileFre.NativeInitialized" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>skym@chromium.org</owner> <owner>wenyufu@chromium.org</owner> <summary> @@ -1160,7 +1160,7 @@ </histogram> <histogram name="MobileStartup.DailyLaunchCount" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tedchoc@chromium.org</owner> <owner>twellington@chromium.org</owner> <summary> @@ -1205,7 +1205,7 @@ </histogram> <histogram name="MobileStartup.LaunchCause" enum="LaunchCause" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mthiesse@chromium.org</owner> <owner>tedchoc@chromium.org</owner> <owner>yfriedman@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/navigation/histograms.xml b/tools/metrics/histograms/metadata/navigation/histograms.xml index 977ab8f..214729b 100644 --- a/tools/metrics/histograms/metadata/navigation/histograms.xml +++ b/tools/metrics/histograms/metadata/navigation/histograms.xml
@@ -437,7 +437,7 @@ </histogram> <histogram name="BackForwardCache.Restore.NavigationToFirstPaint" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sreejakshetty@chromium.org</owner> <owner>altimin@chromium.org</owner> <owner>bfcache-dev@chromium.org</owner> @@ -950,7 +950,7 @@ </histogram> <histogram name="Navigation.MainFrameHasRTLDomain2" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>cthomp@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary> @@ -961,7 +961,7 @@ </histogram> <histogram name="Navigation.MainFrameHasRTLDomainDifferentPage2" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>cthomp@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary> @@ -974,7 +974,7 @@ </histogram> <histogram name="Navigation.MainFrameProfileType2" enum="BrowserProfileType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rhalavati@chromium.org</owner> <owner>chrome-privacy-core@google.com</owner> <summary> @@ -1011,7 +1011,7 @@ </histogram> <histogram name="Navigation.MainFrameSchemeDifferentPageOTR2" - enum="NavigationScheme" expires_after="2024-03-17"> + enum="NavigationScheme" expires_after="2024-05-19"> <owner>estark@chromium.org</owner> <owner>elawrence@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> @@ -1103,7 +1103,7 @@ </histogram> <histogram name="Navigation.OriginAgentCluster.Result" - enum="OriginAgentClusterEndResult" expires_after="2024-03-17"> + enum="OriginAgentClusterEndResult" expires_after="2024-05-19"> <owner>alexmos@chromium.org</owner> <owner>creis@chromium.org</owner> <owner>wjmaclean@chromium.org</owner> @@ -1407,7 +1407,7 @@ </histogram> <histogram name="Navigation.StartToCommit" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>nasko@chromium.org</owner> <owner>csharrison@chromium.org</owner> <summary> @@ -1475,7 +1475,7 @@ </histogram> <histogram name="Navigation.TimeToReadyToCommit2" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>clamy@chromium.org</owner> <owner>nasko@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/net/histograms.xml b/tools/metrics/histograms/metadata/net/histograms.xml index 2cb4eb2..ced3f344f 100644 --- a/tools/metrics/histograms/metadata/net/histograms.xml +++ b/tools/metrics/histograms/metadata/net/histograms.xml
@@ -408,7 +408,7 @@ </histogram> <histogram name="HttpCache.Pattern" enum="HttpCachePattern" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>morlovich@chromium.org</owner> <owner>jkarlin@chromium.org</owner> <summary>For each http cache transaction, the recorded pattern.</summary> @@ -572,7 +572,7 @@ </histogram> <histogram name="Net.CertificateTransparency.SCTOrigin" enum="SCTOrigin" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>estark@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary> @@ -862,7 +862,7 @@ </histogram> <histogram name="Net.DNS.DnsConfig.AdditionalDnsQueryTypesEnabled" - enum="BooleanEnabled" expires_after="2024-03-17"> + enum="BooleanEnabled" expires_after="2024-05-19"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -944,7 +944,7 @@ </histogram> <histogram name="Net.DNS.DnsConfig.Resolv.Compatible" enum="BooleanValid" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -999,7 +999,7 @@ </histogram> <histogram name="Net.DNS.DnsConfig.Windows.Compatibility" - enum="DNS.WindowsCompatibility" expires_after="2024-03-17"> + enum="DNS.WindowsCompatibility" expires_after="2024-05-19"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -1052,7 +1052,7 @@ </histogram> <histogram name="Net.DNS.DnsTask.AdditionalHttps.Unsolicited" - enum="UnsolicitedHttpsRecordStatus" expires_after="2024-03-17"> + enum="UnsolicitedHttpsRecordStatus" expires_after="2024-05-19"> <owner>awillia@chromium.org</owner> <owner>src/net/dns/OWNERS</owner> <summary> @@ -1062,7 +1062,7 @@ </histogram> <histogram name="Net.DNS.DnsTask.SuccessTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -1073,7 +1073,7 @@ </histogram> <histogram name="Net.DNS.DnsTask.SvcbHttpsTransactionError" - enum="DNS.SvcbHttpsTransactionError" expires_after="2024-03-17"> + enum="DNS.SvcbHttpsTransactionError" expires_after="2024-05-19"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -1084,7 +1084,7 @@ </histogram> <histogram name="Net.DNS.DnsTransaction.AttemptType" enum="DNS.AttemptType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>horo@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -1676,7 +1676,7 @@ </histogram> <histogram name="Net.ErrorCodesForIsolatedAppScheme" enum="NetErrorCodes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>cmfcmf@chromium.org</owner> <owner>peletskyi@chromium.org</owner> <summary> @@ -1712,7 +1712,7 @@ </histogram> <histogram name="Net.ErrorPageCounts" enum="NetErrorPageEvents" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>edwardjung@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -1777,7 +1777,7 @@ </histogram> <histogram name="Net.HttpAuthCount" enum="HttpAuthCount" - expires_after="2024-02-29"> + expires_after="2024-05-19"> <owner>mpdenton@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -1906,7 +1906,7 @@ </histogram> <histogram name="Net.HttpJob.MainJobWaitTimeWithAvailableSpdySession" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>fayang@chromium.org</owner> <owner>src/net/quic/OWNERS</owner> <summary> @@ -1916,7 +1916,7 @@ </histogram> <histogram name="Net.HttpJob.MainJobWaitTimeWithoutAvailableSpdySession" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>fayang@chromium.org</owner> <owner>src/net/quic/OWNERS</owner> <summary> @@ -1991,7 +1991,7 @@ </histogram> <histogram name="Net.HttpJob.TotalTime.TLS13.Google" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>davidben@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary> @@ -2121,7 +2121,7 @@ </histogram> <histogram name="Net.HttpTimeToFirstByte.TLS13.Google" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>davidben@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary> @@ -4349,7 +4349,7 @@ </histogram> <histogram name="Net.QuicSession.WriteError" enum="NetErrorCodes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dschinazi@chromium.org</owner> <owner>src/net/quic/OWNERS</owner> <summary> @@ -4421,7 +4421,7 @@ </histogram> <histogram name="Net.QuicSession.ZeroRttState" enum="ZeroRttState" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>renjietang@chromium.org</owner> <owner>src/net/quic/OWNERS</owner> <summary>Whether 0-RTT was successfully used in the connection.</summary> @@ -4609,7 +4609,7 @@ </histogram> <histogram name="Net.Reporting.UploadHeaderType" - enum="NetReportingUploadHeaderType" expires_after="2024-03-17"> + enum="NetReportingUploadHeaderType" expires_after="2024-05-19"> <owner>rodneyding@google.com</owner> <owner>src/net/reporting/OWNERS</owner> <summary> @@ -5142,7 +5142,7 @@ </histogram> <histogram name="Net.SpdySession.ServerSupportsWebSocket" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dschinazi@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -5171,7 +5171,7 @@ </histogram> <histogram name="Net.SpdySessionGet" enum="SpdySessionGet" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dschinazi@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary>The type of SPDY Session used when looking up a session.</summary> @@ -5204,7 +5204,7 @@ </histogram> <histogram name="Net.SSL.ECHResult" enum="SSLECHResult" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>davidben@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary> @@ -5237,7 +5237,7 @@ </histogram> <histogram name="Net.SSL_Connection_Error_ECH" enum="NetErrorCodes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>davidben@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary> @@ -5256,7 +5256,7 @@ </histogram> <histogram name="Net.SSL_Connection_Latency_ECH" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>davidben@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary> @@ -5281,7 +5281,7 @@ </histogram> <histogram name="Net.SSLClientCertSignatureAlgorithm" - enum="SSLSignatureAlgorithm" expires_after="2024-03-17"> + enum="SSLSignatureAlgorithm" expires_after="2024-05-19"> <owner>davidben@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> @@ -5291,7 +5291,7 @@ </histogram> <histogram name="Net.SSLHandshakeDetails" enum="SSLHandshakeDetails" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>davidben@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/network/histograms.xml b/tools/metrics/histograms/metadata/network/histograms.xml index 321ca84..0ec22c0 100644 --- a/tools/metrics/histograms/metadata/network/histograms.xml +++ b/tools/metrics/histograms/metadata/network/histograms.xml
@@ -712,7 +712,7 @@ </histogram> <histogram name="Network.Ash.{NetworkType}.ConnectionResult.NonUserInitiated" - enum="ShillConnectResult" expires_after="2024-03-17"> + enum="ShillConnectResult" expires_after="2024-05-19"> <owner>jiajunz@chromium.org</owner> <owner>cros-connectivity@google.com</owner> <summary> @@ -1647,7 +1647,7 @@ </histogram> <histogram name="Network.DnsProxy.DnsOverHttpsMode" - enum="DnsProxy.DnsOverHttpsMode" expires_after="2024-03-17"> + enum="DnsProxy.DnsOverHttpsMode" expires_after="2024-05-19"> <owner>garrick@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -1667,7 +1667,7 @@ </histogram> <histogram name="Network.DnsProxy.NameserverTypes" - enum="DnsProxy.NameserverType" expires_after="2024-03-17"> + enum="DnsProxy.NameserverType" expires_after="2024-05-19"> <owner>garrick@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -2067,7 +2067,7 @@ </histogram> <histogram name="Network.NetworkPortalDetectorHasProxy" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>stevenjb@chromium.org</owner> <owner>cros-network-health-team@google.com</owner> <summary> @@ -2078,7 +2078,7 @@ </histogram> <histogram name="Network.NetworkPortalDetectorResult" - enum="NetworkPortalStatus" expires_after="2024-03-17"> + enum="NetworkPortalStatus" expires_after="2024-05-19"> <owner>stevenjb@chromium.org</owner> <owner>cros-network-health-team@google.com</owner> <summary> @@ -2089,7 +2089,7 @@ </histogram> <histogram name="Network.NetworkPortalDetectorRunCount" units="attempts" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>stevenjb@chromium.org</owner> <owner>cros-network-health-team@google.com</owner> <summary> @@ -2132,7 +2132,7 @@ </histogram> <histogram name="Network.NetworkPortalSigninSource" - enum="NetworkPortalSigninSource" expires_after="2024-03-10"> + enum="NetworkPortalSigninSource" expires_after="2024-05-19"> <owner>stevenjb@chromium.org</owner> <owner>cros-network-health-team@google.com</owner> <summary> @@ -2288,7 +2288,7 @@ </histogram> <histogram name="Network.Shill.Cellular.DevicePresenceStatus" - enum="BooleanPresent" expires_after="2024-03-17"> + enum="BooleanPresent" expires_after="2024-05-19"> <owner>ejcaruso@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -2477,7 +2477,7 @@ </histogram> <histogram name="Network.Shill.ConnectionDiagnosticsIssue" - enum="ConnectionDiagnosticsIssue" expires_after="2024-03-17"> + enum="ConnectionDiagnosticsIssue" expires_after="2024-05-19"> <owner>hugobenichi@google.com</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -2490,7 +2490,7 @@ </histogram> <histogram name="Network.Shill.Ethernet.DevicePresenceStatus" - enum="BooleanPresent" expires_after="2024-03-17"> + enum="BooleanPresent" expires_after="2024-05-19"> <owner>hugobenichi@google.com</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -2787,7 +2787,7 @@ <histogram name="Network.Shill.PortalDetector.{AttemptResult}Duration.{Technology}" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>hugobenichi@google.com</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -2803,7 +2803,7 @@ </histogram> <histogram name="Network.Shill.PortalDetector.{ProbeType}Duration.{Technology}" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>hugobenichi@google.com</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -2871,7 +2871,7 @@ </histogram> <histogram name="Network.Shill.Vpn.Driver" enum="VPNDriver" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jiejiang@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -2903,7 +2903,7 @@ </histogram> <histogram name="Network.Shill.Vpn.L2tpIpsec.SwanctlEndReason" - enum="NetworkServiceError" expires_after="2024-03-17"> + enum="NetworkServiceError" expires_after="2024-05-19"> <owner>jiejiang@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -3224,7 +3224,7 @@ </histogram> <histogram name="Network.Shill.WiFi.AuthFailureType" enum="WiFiStatusCode" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>norvez@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -3436,7 +3436,7 @@ </histogram> <histogram name="Network.Shill.WiFi.HiddenSSIDNetworkCount" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tnagel@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <owner>cros-privacy-core@google.com</owner> @@ -3474,7 +3474,7 @@ </histogram> <histogram name="Network.Shill.Wifi.NeighborLinkMonitorFailure" - enum="NeighborLinkMonitorFailureType" expires_after="2024-03-17"> + enum="NeighborLinkMonitorFailureType" expires_after="2024-05-19"> <owner>jiejiang@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -3592,7 +3592,7 @@ </histogram> <histogram name="Network.Shill.WiFi.Passpoint.ProvisioningResult" - enum="PasspointProvisioningResult" expires_after="2024-03-10"> + enum="PasspointProvisioningResult" expires_after="2024-05-19"> <owner>hugobenichi@google.com</owner> <owner>cros-networking@google.com</owner> <owner>cros-network-metrics@google.com</owner> @@ -3714,7 +3714,7 @@ </histogram> <histogram name="Network.Shill.WiFi.RememberedSystemNetworkCount" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>matthewmwang@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary> @@ -3754,7 +3754,7 @@ </histogram> <histogram base="true" name="Network.Shill.WiFi.RoamComplete" - enum="WiFiRoamComplete" expires_after="2024-03-17"> + enum="WiFiRoamComplete" expires_after="2024-05-19"> <!-- Name completed by histogram_suffixes name="RoamSecurityType" --> <owner>matthewmwang@chromium.org</owner> @@ -4089,7 +4089,7 @@ </histogram> <histogram name="Network.Shill.WiFi.UserInitiatedConnectionFailureReason" - enum="ConnectionFailureReason" expires_after="2024-03-17"> + enum="ConnectionFailureReason" expires_after="2024-05-19"> <owner>norvez@chromium.org</owner> <owner>cros-network-metrics@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/new_tab_page/histograms.xml b/tools/metrics/histograms/metadata/new_tab_page/histograms.xml index 94c6c38a..122db68 100644 --- a/tools/metrics/histograms/metadata/new_tab_page/histograms.xml +++ b/tools/metrics/histograms/metadata/new_tab_page/histograms.xml
@@ -215,7 +215,7 @@ </histogram> <histogram name="NewTabPage.Carts.DataRequest" enum="CartDiscountDataType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>meiliang@chromium.org</owner> <owner>yuezhanggg@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -329,7 +329,7 @@ </histogram> <histogram name="NewTabPage.Carts.DiscountCountAtLoad" units="count" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>meiliang@chromium.org</owner> <owner>yuezhanggg@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -368,7 +368,7 @@ </summary> </histogram> -<histogram name="NewTabPage.Click" enum="NTPElement" expires_after="2024-03-17"> +<histogram name="NewTabPage.Click" enum="NTPElement" expires_after="2024-05-19"> <owner>tiborg@chromium.org</owner> <owner>yyushkina@chromium.org</owner> <owner>chrome-desktop-ntp@google.com</owner> @@ -381,7 +381,7 @@ </histogram> <histogram name="NewTabPage.Collections.IdOnLoad" enum="NTPCollectionId" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>danpeng@google.com</owner> <owner>pauladedeji@google.com</owner> <owner>chrome-desktop-ntp@google.com</owner> @@ -536,7 +536,7 @@ </histogram> <histogram name="NewTabPage.Drive.FileClick" units="index" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tiborg@chromium.org</owner> <owner>aee@chromium.org</owner> <owner>andrevincent@google.com</owner> @@ -868,7 +868,7 @@ </histogram> <histogram name="NewTabPage.Lens.UploadDialog.DialogAction" - enum="NewTabPageLensUploadDialogActions" expires_after="2024-03-17"> + enum="NewTabPageLensUploadDialogActions" expires_after="2024-05-19"> <owner>nguyenbryan@google.com</owner> <owner>yowakita@google.com</owner> <owner>bbonnet@google.com</owner> @@ -983,7 +983,7 @@ </histogram> <histogram name="NewTabPage.MainUi.ShownTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tiborg@chromium.org</owner> <owner>chrome-desktop-ntp@google.com</owner> <summary> @@ -1665,7 +1665,7 @@ </histogram> <histogram name="NewTabPage.SuggestionsImpression" enum="MostVisitedTileIndex" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tiborg@chromium.org</owner> <owner>yyushkina@chromium.org</owner> <owner>chrome-desktop-ntp@google.com</owner> @@ -1720,7 +1720,7 @@ </histogram> <histogram name="NewTabPage.TileTitle" enum="NTPTileTitleSource" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tiborg@chromium.org</owner> <owner>yyushkina@chromium.org</owner> <owner>chrome-desktop-ntp@google.com</owner> @@ -1742,7 +1742,7 @@ </histogram> <histogram name="NewTabPage.TileType" enum="NTPTileVisualType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>danpeng@google.com</owner> <owner>tiborg@chromium.org</owner> <owner>yyushkina@chromium.org</owner> @@ -1830,7 +1830,7 @@ </histogram> <histogram name="NewTabPage.VoiceActions" enum="NewTabPageVoiceAction" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tiborg@chromium.org</owner> <owner>yyushkina@chromium.org</owner> <owner>chrome-desktop-ntp@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/notifications/histograms.xml b/tools/metrics/histograms/metadata/notifications/histograms.xml index 03649b5..14cc408 100644 --- a/tools/metrics/histograms/metadata/notifications/histograms.xml +++ b/tools/metrics/histograms/metadata/notifications/histograms.xml
@@ -744,7 +744,7 @@ </histogram> <histogram name="Notifications.PersistentNotificationThirdPartyCount" - enum="Boolean" expires_after="2024-03-17"> + enum="Boolean" expires_after="2024-05-19"> <owner>awillia@chromium.org</owner> <owner>peter@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/offline/histograms.xml b/tools/metrics/histograms/metadata/offline/histograms.xml index c5f2993..d9f8f317 100644 --- a/tools/metrics/histograms/metadata/offline/histograms.xml +++ b/tools/metrics/histograms/metadata/offline/histograms.xml
@@ -138,7 +138,7 @@ </histogram> <histogram name="OfflinePages.DidNavigationThrottleCancelNavigation" - enum="Boolean" expires_after="2024-03-17"> + enum="Boolean" expires_after="2024-05-19"> <owner>curranmax@chromium.org</owner> <owner>tbansal@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/omnibox/histograms.xml b/tools/metrics/histograms/metadata/omnibox/histograms.xml index c6c8231..ec78060 100644 --- a/tools/metrics/histograms/metadata/omnibox/histograms.xml +++ b/tools/metrics/histograms/metadata/omnibox/histograms.xml
@@ -606,7 +606,7 @@ </histogram> <histogram name="Omnibox.CutOrCopyAllText" units="count" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jdonnelly@chromium.org</owner> <owner>mpearson@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> @@ -789,7 +789,7 @@ </histogram> <histogram name="Omnibox.FocusResultedInNavigation" enum="BooleanNavigated" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ender@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> <owner>mpearson@chromium.org</owner> @@ -939,7 +939,7 @@ </histogram> <histogram name="Omnibox.InputType" enum="OmniboxInputType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jdonnelly@chromium.org</owner> <owner>mpearson@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> @@ -1005,7 +1005,7 @@ </histogram> <histogram name="Omnibox.JustDeletedText" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jdonnelly@chromium.org</owner> <owner>mpearson@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> @@ -1355,7 +1355,7 @@ </histogram> <histogram name="Omnibox.ResumeJourneyShown" units="position" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tommycli@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> <summary> @@ -1372,7 +1372,7 @@ </histogram> <histogram name="Omnibox.ResumeJourneyShown.ClusterKeywordType" - enum="HistoryClusterKeywordType" expires_after="2024-02-25"> + enum="HistoryClusterKeywordType" expires_after="2024-05-19"> <owner>junzou@chromium.org</owner> <owner>chrome-intelligence-core@google.com</owner> <summary> @@ -1389,7 +1389,7 @@ </histogram> <histogram name="Omnibox.ResumeJourneyShown.PageEntityCollection" - enum="OptimizationGuidePageEntityCollection" expires_after="2024-02-25"> + enum="OptimizationGuidePageEntityCollection" expires_after="2024-05-19"> <owner>junzou@chromium.org</owner> <owner>chrome-intelligence-core@google.com</owner> <summary> @@ -1684,7 +1684,7 @@ </histogram> <histogram name="Omnibox.SuggestionUsed.AnswerInSuggest" - enum="SuggestionAnswerOptionalType" expires_after="2024-03-17"> + enum="SuggestionAnswerOptionalType" expires_after="2024-05-19"> <owner>jdonnelly@chromium.org</owner> <owner>mpearson@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> @@ -1697,7 +1697,7 @@ </histogram> <histogram name="Omnibox.SuggestionUsed.ClientSummarizedResultType" - enum="ClientSummarizedResultType" expires_after="2024-03-17"> + enum="ClientSummarizedResultType" expires_after="2024-05-19"> <owner>nyquist@chromium.org</owner> <owner>ssid@chromium.org</owner> <owner>tommycli@chromium.org</owner> @@ -1759,7 +1759,7 @@ </histogram> <histogram name="Omnibox.SuggestionUsed.ResumeJourney" units="position" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tommycli@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> <owner>chrome-journeys@google.com</owner> @@ -2037,7 +2037,7 @@ <histogram name="Omnibox.SuggestionUsed.Search.NavigationToLargestContentfulPaint2.1" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>lingqi@chromium.org</owner> <owner>chrome-prerendering@google.com</owner> <owner>chrome-omnibox-team@google.com</owner> @@ -2096,7 +2096,7 @@ <histogram name="Omnibox.SuggestionUsed.URL.Experimental.NavigationToFirstMeaningfulPaint" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>jdonnelly@chromium.org</owner> <owner>mpearson@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner> @@ -2119,7 +2119,7 @@ </histogram> <histogram name="Omnibox.SuggestionUsed.URL.NavigationToFirstContentfulPaint" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>jdonnelly@chromium.org</owner> <owner>mpearson@chromium.org</owner> <owner>chrome-omnibox-team@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/oobe/histograms.xml b/tools/metrics/histograms/metadata/oobe/histograms.xml index 4d823e4f..d7294a77 100644 --- a/tools/metrics/histograms/metadata/oobe/histograms.xml +++ b/tools/metrics/histograms/metadata/oobe/histograms.xml
@@ -640,7 +640,7 @@ </histogram> <histogram name="OOBE.HidDetectionScreen.BluetoothPairing.Result" - enum="HidDetectionBluetoothPairingResult" expires_after="2024-03-17"> + enum="HidDetectionBluetoothPairingResult" expires_after="2024-05-19"> <owner>gordonseto@google.com</owner> <owner>cros-connectivity@google.com</owner> <summary> @@ -663,7 +663,7 @@ </histogram> <histogram name="OOBE.HidDetectionScreen.BluetoothPairingAttempts" - units="attempts" expires_after="2024-03-10"> + units="attempts" expires_after="2024-05-19"> <owner>gordonseto@google.com</owner> <owner>cros-connectivity@google.com</owner> <summary> @@ -756,7 +756,7 @@ </histogram> <histogram name="OOBE.OnboardingFlowDuration.{OnboardingType}" units="ms" - expires_after="2024-03-18"> + expires_after="2024-05-19"> <owner>osamafathy@google.com</owner> <owner>cros-oobe@google.com</owner> <summary> @@ -770,7 +770,7 @@ </histogram> <histogram name="OOBE.OnboardingFlowStatus.{OnboardingType}" - enum="BooleanStartedCompleted" expires_after="2024-03-18"> + enum="BooleanStartedCompleted" expires_after="2024-05-19"> <owner>osamafathy@google.com</owner> <owner>cros-oobe@google.com</owner> <summary> @@ -783,7 +783,7 @@ <token key="OnboardingType" variants="OnboardingType"/> </histogram> -<histogram name="OOBE.OobeFlowDuration" units="ms" expires_after="2024-03-18"> +<histogram name="OOBE.OobeFlowDuration" units="ms" expires_after="2024-05-19"> <owner>osamafathy@google.com</owner> <owner>cros-oobe@google.com</owner> <summary> @@ -796,7 +796,7 @@ </histogram> <histogram name="OOBE.OobeFlowStatus" enum="BooleanStartedCompleted" - expires_after="2024-03-18"> + expires_after="2024-05-19"> <owner>osamafathy@google.com</owner> <owner>cros-oobe@google.com</owner> <summary> @@ -809,7 +809,7 @@ </histogram> <histogram name="OOBE.OobeStartToOnboardingStartTime" units="ms" - expires_after="2024-03-18"> + expires_after="2024-05-19"> <owner>osamafathy@google.com</owner> <owner>cros-oobe@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/optimization/histograms.xml b/tools/metrics/histograms/metadata/optimization/histograms.xml index 797d6dce..532cef4 100644 --- a/tools/metrics/histograms/metadata/optimization/histograms.xml +++ b/tools/metrics/histograms/metadata/optimization/histograms.xml
@@ -258,7 +258,7 @@ <histogram name="OptimizationGuide.HintCacheLevelDBStore.LoadMetadataResult" enum="OptimizationGuideHintCacheLevelDBStoreLoadMetadataResult" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mcrouse@chromium.org</owner> <owner>sophiechang@chromium.org</owner> <summary> @@ -370,7 +370,7 @@ </histogram> <histogram name="OptimizationGuide.HintsFetcher.GetHintsRequest.UrlCount" - units="total url count" expires_after="2024-03-17"> + units="total url count" expires_after="2024-05-19"> <owner>mcrouse@chromium.org</owner> <owner>sophiechang@chromium.org</owner> <summary> @@ -429,7 +429,7 @@ <histogram name="OptimizationGuide.HintsManager.RaceNavigationFetchAttemptStatus" enum="OptimizationGuideRaceNavigationFetchAttemptStatus" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mcrouse@chromium.org</owner> <owner>sophiechang@chromium.org</owner> <summary> @@ -1348,7 +1348,7 @@ </histogram> <histogram name="OptimizationGuide.ProcessHintsResult" - enum="OptimizationGuideProcessHintsResult" expires_after="2024-03-17"> + enum="OptimizationGuideProcessHintsResult" expires_after="2024-05-19"> <owner>mcrouse@chromium.org</owner> <owner>sophiechang@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml index 81f1adb..bb17e9f 100644 --- a/tools/metrics/histograms/metadata/others/histograms.xml +++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -205,7 +205,7 @@ </histogram> <histogram name="AccessCodeCast.Discovery.RememberedDevicesCount" - units="cast devices" expires_after="2024-03-17"> + units="cast devices" expires_after="2024-05-19"> <owner>bzielinski@google.com</owner> <owner>cros-edu-eng@google.com</owner> <summary> @@ -788,7 +788,7 @@ </histogram> <histogram name="Ads.InterestGroup.Auction.ParseBaServerResponseDuration" - units="ms" expires_after="2024-03-10"> + units="ms" expires_after="2024-05-19"> <owner>behamilton@google.com</owner> <owner>pauljensen@chromium.org</owner> <owner>privacy-sandbox-dev@chromium.org</owner> @@ -1178,7 +1178,7 @@ </histogram> <histogram name="Ads.InterestGroup.ServerAuction.EndToEndTimeNoWinner" - units="ms" expires_after="M121"> + units="ms" expires_after="2024-05-19"> <owner>behamilton@google.com</owner> <owner>pauljensen@chromium.org</owner> <owner>privacy-sandbox-dev@chromium.org</owner> @@ -1923,7 +1923,7 @@ </histogram> <histogram name="ChildProcess.Launched.UtilityProcessHash" - enum="UtilityProcessNameHash" expires_after="2024-03-17"> + enum="UtilityProcessNameHash" expires_after="2024-05-19"> <owner>wfh@chromium.org</owner> <summary> Count of child utility process launches, bucketed by the hash of their @@ -2251,14 +2251,14 @@ </histogram> <histogram name="ComponentUpdater.UpdateCompleteError" - enum="UpdateClientErrors" expires_after="2024-03-17"> + enum="UpdateClientErrors" expires_after="2024-05-19"> <owner>sorin@chromium.org</owner> <owner>src/components/component_updater/OWNERS</owner> <summary>The result of an install or an update check.</summary> </histogram> <histogram name="ComponentUpdater.UpdateCompleteResult" enum="BooleanError" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sorin@chromium.org</owner> <owner>src/components/component_updater/OWNERS</owner> <summary>The result of an install or an update check.</summary> @@ -2839,7 +2839,7 @@ </histogram> <histogram name="Conversions.DelayOnAttestationsLoaded" units="ms" - expires_after="2024-03-10"> + expires_after="2024-05-19"> <owner>linnan@chromium.org</owner> <owner>johnidel@chromium.org</owner> <owner>measurement-api-dev+metrics@google.com</owner> @@ -3302,7 +3302,7 @@ </histogram> <histogram name="Conversions.SourceStoredStatus8" - enum="ConversionStorageSourceStatus" expires_after="2024-03-10"> + enum="ConversionStorageSourceStatus" expires_after="2024-05-19"> <owner>tquintanilla@chromium.org</owner> <owner>anthonygarant@chromium.org</owner> <owner>measurement-api-dev+metrics@google.com</owner> @@ -3360,7 +3360,7 @@ </histogram> <histogram name="Conversions.Storage.Sql.FileSize2.PerSource" units="bytes" - expires_after="M121"> + expires_after="2024-05-19"> <owner>anthonygarant@chromium.org</owner> <owner>johnidel@chromium.org</owner> <owner>measurement-api-dev+metrics@google.com</owner> @@ -3972,7 +3972,7 @@ </histogram> <histogram name="DemoMode.Setup.NumRetries" units="units" - expires_after="2024-03-10"> + expires_after="2024-05-19"> <owner>llin@chromium.org</owner> <owner>xiqiruan@chromium.org</owner> <owner>yilkal@chromium.org</owner> @@ -4163,7 +4163,7 @@ </histogram> <histogram name="DocumentScan.ScanFailed" enum="DocumentScanSaneBackend" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bmgordon@chromium.org</owner> <owner>project-bolton@google.com</owner> <summary> @@ -4192,7 +4192,7 @@ </histogram> <histogram name="DocumentScan.ScanRequested" enum="DocumentScanSaneBackend" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bmgordon@chromium.org</owner> <owner>project-bolton@google.com</owner> <summary> @@ -4202,7 +4202,7 @@ </histogram> <histogram name="DocumentScan.ScanSucceeded" enum="DocumentScanSaneBackend" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bmgordon@chromium.org</owner> <owner>project-bolton@google.com</owner> <summary> @@ -4245,7 +4245,7 @@ </histogram> <histogram name="Drive.PushNotificationRegistered" enum="BooleanRegistered" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -5050,7 +5050,7 @@ </histogram> <histogram name="Feedback.ReportSending.Online" units="boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>xiangdongkong@google.com</owner> <owner>cros-feedback-app@google.com</owner> <summary> @@ -5059,7 +5059,7 @@ </histogram> <histogram name="Feedback.ReportSending.Result" - enum="FeedbackReportSendingResult" expires_after="2024-03-17"> + enum="FeedbackReportSendingResult" expires_after="2024-05-19"> <owner>xiangdongkong@google.com</owner> <owner>cros-feedback-app@google.com</owner> <summary> @@ -5099,7 +5099,7 @@ </histogram> <histogram name="Feedback.TrustSafetySentiment.TriggerOccurred" - enum="TrustSafetySentimentFeatureArea" expires_after="2024-03-17"> + enum="TrustSafetySentimentFeatureArea" expires_after="2024-05-19"> <owner>sauski@google.com</owner> <owner>chrome-hats-eng@google.com</owner> <summary> @@ -5440,7 +5440,7 @@ </histogram> <histogram name="FirstRun.NewUserExperience.NtpBackgroundInteraction" - enum="NuxNtpBackgroundInteractions" expires_after="2024-03-17"> + enum="NuxNtpBackgroundInteractions" expires_after="2024-05-19"> <owner>johntlee@chromium.org</owner> <owner>dpapad@chromium.org</owner> <summary> @@ -5727,7 +5727,7 @@ </histogram> <histogram name="Hardware.Display.Count.OnChange" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sashamcintosh@chromium.org</owner> <owner>chromeos-gfx@chromium.org</owner> <summary> @@ -5737,7 +5737,7 @@ </histogram> <histogram name="Hardware.Display.Count.OnStartup" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sashamcintosh@chromium.org</owner> <owner>chromeos-gfx@chromium.org</owner> <summary> @@ -5747,7 +5747,7 @@ </histogram> <histogram name="Hardware.Display.SupportsHDR" enum="BooleanSupported" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>cassew@google.com</owner> <owner>media-dev-uma@chromium.org</owner> <summary> @@ -5759,7 +5759,7 @@ </summary> </histogram> -<histogram name="Hardware.TotalDiskSpace" units="GB" expires_after="2024-03-17"> +<histogram name="Hardware.TotalDiskSpace" units="GB" expires_after="2024-05-19"> <owner>zmo@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -6687,7 +6687,7 @@ </histogram> <histogram name="Mojo.Channel.WriteMessageSize" units="bytes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>amistry@chromium.org</owner> <owner>bgeffon@chromium.org</owner> <owner>rockot@google.com</owner> @@ -6760,7 +6760,7 @@ </histogram> <histogram name="Mouse.PointerSensitivity.Changed" enum="PointerSensitivity" - expires_after="2024-02-25"> + expires_after="2024-05-19"> <owner>zentaro@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary> @@ -6817,7 +6817,7 @@ </histogram> <histogram name="MPArch.ChildProcessLaunchSubsequent" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>pasko@chromium.org</owner> <owner>yfriedman@chromium.org</owner> <summary> @@ -7187,7 +7187,7 @@ </histogram> <histogram name="OSCrypt.Linux.DecryptedWithEmptyKey" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>cfroussios@chromium.org</owner> <owner>thestig@chromium.org</owner> <summary> @@ -7198,7 +7198,7 @@ </histogram> <histogram name="OSCrypt.Win.Decrypt.Result" enum="BooleanSuccess" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>wfh@chromium.org</owner> <owner>nparker@chromium.org</owner> <summary> @@ -7218,7 +7218,7 @@ </histogram> <histogram name="OSCrypt.Win.Encrypt.Result" enum="BooleanSuccess" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>wfh@chromium.org</owner> <owner>nparker@chromium.org</owner> <summary> @@ -7667,7 +7667,7 @@ </histogram> <histogram name="Pepper.InterfaceUsed" enum="PepperInterface" - expires_after="2024-01-15"> + expires_after="2024-05-19"> <owner>fabiansommer@chromium.org</owner> <owner>dschuff@chromium.org</owner> <summary> @@ -8144,7 +8144,7 @@ </histogram> <histogram name="ReadingList.Read.Number" units="count" - expires_after="2024-03-15"> + expires_after="2024-05-19"> <owner>gambard@chromium.org</owner> <owner>bling-team@google.com</owner> <summary>Number of read entries in reading list.</summary> @@ -8160,7 +8160,7 @@ </histogram> <histogram name="ReadingList.Unread.Number" units="count" - expires_after="2024-03-15"> + expires_after="2024-05-19"> <owner>gambard@chromium.org</owner> <owner>bling-team@google.com</owner> <summary>Number of unread entries in reading list.</summary> @@ -8189,7 +8189,7 @@ </histogram> <histogram name="ReadingList.WebUI.LoadDocumentTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>corising@chromium.org</owner> <owner>chrome-desktop-ui-sea@google.com</owner> <summary> @@ -8238,12 +8238,6 @@ </token> </histogram> -<histogram name="RecoveryComponent.Event" enum="RecoveryComponentEvent" - expires_after="M77"> - <owner>robertshield@chromium.org</owner> - <summary>Log each stage of a recovery component event.</summary> -</histogram> - <histogram name="ReduceAcceptLanguage.AcceptLanguageNegotiationRestart" enum="AcceptLanguageNegotiationRestart" expires_after="2024-04-28"> <owner>awillia@chromium.org</owner> @@ -8392,7 +8386,7 @@ </histogram> <histogram name="ReportingAndNEL.ErrorInitializeDB" - enum="SqliteLoggedResultCode" expires_after="2024-03-17"> + enum="SqliteLoggedResultCode" expires_after="2024-05-19"> <owner>wfh@chromium.org</owner> <owner>src/net/reporting/OWNERS</owner> <summary> @@ -8712,7 +8706,7 @@ </histogram> <histogram name="SB2.RemoteCall.CheckDelta" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>vakh@chromium.org</owner> <owner>csharrison@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> @@ -8771,7 +8765,7 @@ </histogram> <histogram base="true" name="SB2.RequestDestination" enum="RequestDestination" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -9055,7 +9049,7 @@ </histogram> <histogram name="ShortcutsProvider.DatabaseSize" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mpearson@chromium.org</owner> <summary> The number of entries in shortcuts backend's database when initialized, @@ -9064,7 +9058,7 @@ </histogram> <histogram name="Shutdown.BrowserExit.Time2" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>etienneb@chromium.org</owner> <owner>gab@chromium.org</owner> <summary> @@ -9075,7 +9069,7 @@ </histogram> <histogram name="Shutdown.EndSession.Time2" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>etienneb@chromium.org</owner> <owner>gab@chromium.org</owner> <summary> @@ -9109,7 +9103,7 @@ </histogram> <histogram name="Shutdown.ShutdownType2" enum="ShutdownType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>etienneb@chromium.org</owner> <owner>gab@chromium.org</owner> <summary> @@ -9134,7 +9128,7 @@ </histogram> <histogram name="Shutdown.WindowClose.Time2" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>etienneb@chromium.org</owner> <owner>gab@chromium.org</owner> <summary> @@ -9352,7 +9346,7 @@ </histogram> <histogram name="SiteIsolatedCodeCache.JS.PotentialMemoryBackedCodeCacheSize2" - units="counts" expires_after="2024-03-17"> + units="counts" expires_after="2024-05-19"> <owner>yhirano@chromium.org</owner> <owner>loading-dev@chromium.org</owner> <summary> @@ -9741,7 +9735,7 @@ </histogram> <histogram name="Style.InvalidationTime" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>futhark@chromium.org</owner> <summary> Microseconds spent in StyleEngine::InvalidateStyle. Only samples from high @@ -9750,7 +9744,7 @@ </histogram> <histogram name="Style.RebuildLayoutTreeTime" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>futhark@chromium.org</owner> <summary> Microseconds spent in RebuildLayoutTree called from Document::UpdateStyle. @@ -9758,7 +9752,7 @@ </histogram> <histogram name="Style.RecalcTime" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>futhark@chromium.org</owner> <summary> Microseconds spent in RecalcStyle called from Document::UpdateStyle. @@ -10796,7 +10790,7 @@ </histogram> <histogram name="UsageStats.Events" enum="UsageStatsEvents" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>pnoland@chromium.org</owner> <owner>fgorski@chromium.org</owner> <summary> @@ -10944,7 +10938,7 @@ </histogram> <histogram name="VoiceInteraction.DismissedEventSource" - enum="VoiceInteractionEventSource" expires_after="2024-03-17"> + enum="VoiceInteractionEventSource" expires_after="2024-05-19"> <owner>basiaz@google.com</owner> <owner>chrome-language@google.com</owner> <summary> @@ -10989,7 +10983,7 @@ </histogram> <histogram name="VoiceInteraction.FinishEventSource" - enum="VoiceInteractionEventSource" expires_after="2024-03-17"> + enum="VoiceInteractionEventSource" expires_after="2024-05-19"> <owner>basiaz@google.com</owner> <owner>chrome-language@google.com</owner> <summary> @@ -10999,7 +10993,7 @@ </histogram> <histogram name="VoiceInteraction.FinishEventTarget" enum="VoiceIntentTarget" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>basiaz@google.com</owner> <owner>chrome-language@google.com</owner> <summary> @@ -11066,7 +11060,7 @@ </histogram> <histogram name="VoiceInteraction.StartEventSource" - enum="VoiceInteractionEventSource" expires_after="2024-03-17"> + enum="VoiceInteractionEventSource" expires_after="2024-05-19"> <owner>basiaz@google.com</owner> <owner>chrome-language@google.com</owner> <summary> @@ -11076,7 +11070,7 @@ </histogram> <histogram name="VoiceInteraction.StartEventTarget" enum="VoiceIntentTarget" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>basiaz@google.com</owner> <owner>chrome-language@google.com</owner> <summary> @@ -11139,7 +11133,7 @@ </histogram> <histogram name="VoiceInteraction.VoiceSearchResult" enum="BooleanSuccess" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>basiaz@google.com</owner> <owner>chrome-language@google.com</owner> <summary> @@ -11366,7 +11360,7 @@ </histogram> <histogram name="WebUI.Settings.PathVisited" enum="WebUISettingsPathHashes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dschuyler@chromium.org</owner> <owner>tbuckley@chromium.org</owner> <owner>bettes@chromium.org</owner> @@ -11653,7 +11647,7 @@ </histogram> <histogram name="WrenchMenu.MenuAction" enum="WrenchMenuAction" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ainslie@chromium.org</owner> <owner>edwardjung@chromium.org</owner> <summary>Number of times that each menu item is clicked.</summary>
diff --git a/tools/metrics/histograms/metadata/page/histograms.xml b/tools/metrics/histograms/metadata/page/histograms.xml index e0567c8..d767514 100644 --- a/tools/metrics/histograms/metadata/page/histograms.xml +++ b/tools/metrics/histograms/metadata/page/histograms.xml
@@ -454,7 +454,7 @@ <histogram name="PageLoad.Clients.AMP.InteractiveTiming.NumInteractions.Subframe" - units="Count" expires_after="2024-03-17"> + units="Count" expires_after="2024-05-19"> <owner>sullivan@chromium.org</owner> <owner>speed-metrics-dev@chromium.org</owner> <summary> @@ -800,7 +800,7 @@ <histogram name="PageLoad.Clients.GoogleSearch.PaintTiming.NavigationToFirstContentfulPaint" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>spelchat@chromium.org</owner> <owner>chrome-brapp-loading@google.com</owner> <summary> @@ -814,7 +814,7 @@ <histogram name="PageLoad.Clients.GoogleSearch.PaintTiming.NavigationToLargestContentfulPaint" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>spelchat@chromium.org</owner> <owner>chrome-brapp-loading@google.com</owner> <summary> @@ -1161,7 +1161,7 @@ <histogram name="PageLoad.Clients.ServiceWorker2.PaintTiming.{Timing}.RaceNetworkRequestEligible" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>sisidovski@chromium.org</owner> <owner>chrome-worker@google.com</owner> <summary> @@ -1530,7 +1530,7 @@ </summary> </histogram> -<histogram name="PageLoad.Cpu.TotalUsage" units="ms" expires_after="2024-03-17"> +<histogram name="PageLoad.Cpu.TotalUsage" units="ms" expires_after="2024-05-19"> <owner>alexmt@chromium.org</owner> <owner>johnidel@chromium.org</owner> <summary> @@ -1554,7 +1554,7 @@ <histogram name="PageLoad.DocumentTiming.NavigationToDOMContentLoadedEventFired" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>bmcquade@chromium.org</owner> <owner>csharrison@chromium.org</owner> <summary> @@ -1612,7 +1612,7 @@ <histogram name="PageLoad.Experimental.InputTiming.InputToNavigationStart.FromLinkClick" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>spelchat@chromium.org</owner> <owner>chrome-brapp-loading@google.com</owner> <summary> @@ -1623,7 +1623,7 @@ <histogram name="PageLoad.Experimental.InputTiming.InputToNavigationStart.FromOmnibox" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>spelchat@chromium.org</owner> <owner>chrome-brapp-loading@google.com</owner> <summary> @@ -1800,7 +1800,7 @@ <histogram name="PageLoad.Experimental.NavigationTiming.NavigationStartToFirstRequestStart" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>nhiroki@chromium.org</owner> <owner>chrome-loading@google.com</owner> <summary> @@ -1811,7 +1811,7 @@ <histogram name="PageLoad.Experimental.NavigationTiming.NavigationStartToFirstResponseStart" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>nhiroki@chromium.org</owner> <owner>chrome-loading@google.com</owner> <summary> @@ -1822,7 +1822,7 @@ <histogram name="PageLoad.Experimental.NavigationTiming.NavigationStartToNavigationCommitSent" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>nhiroki@chromium.org</owner> <owner>chrome-loading@google.com</owner> <summary> @@ -2280,7 +2280,7 @@ </histogram> <histogram name="PageLoad.InteractiveTiming.ProcessingTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>iclelland@chromium.org</owner> <owner>speed-metrics-dev@chromium.org</owner> <summary> @@ -2293,7 +2293,7 @@ </histogram> <histogram name="PageLoad.InteractiveTiming.TimeToNextPaint" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>iclelland@chromium.org</owner> <owner>speed-metrics-dev@chromium.org</owner> <summary> @@ -2340,7 +2340,7 @@ </histogram> <histogram name="PageLoad.Internal.ErrorCode" enum="InternalErrorLoadEvent" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>csharrison@chromium.org</owner> <owner>bmcquade@chromium.org</owner> <summary> @@ -2499,7 +2499,7 @@ </histogram> <histogram name="PageLoad.Internal.Renderer.PresentationTime.Valid" - enum="Boolean" expires_after="2024-03-17"> + enum="Boolean" expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -2792,7 +2792,7 @@ </histogram> <histogram name="PageLoad.PageTiming.ForegroundDuration" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bmcquade@chromium.org</owner> <summary> For page loads that start in the foreground, measures the duration of time @@ -2829,7 +2829,7 @@ </histogram> <histogram name="PageLoad.PaintTiming.ForegroundToFirstContentfulPaint" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>sullivan@chromium.org</owner> <owner>speed-metrics-dev@chromium.org</owner> <summary> @@ -3009,7 +3009,7 @@ <histogram name="PageLoad.PaintTiming.NavigationToLargestContentfulPaint2.CrossSiteSubFrame" - units="ms" expires_after="2024-03-17"> + units="ms" expires_after="2024-05-19"> <owner>sisidovski@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> @@ -3035,7 +3035,7 @@ <histogram name="PageLoad.PaintTiming.NavigationToLargestContentfulPaint2AtFirstOnHidden" - units="ms" expires_after="2024-02-09"> + units="ms" expires_after="2024-05-19"> <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 a332003..5d62994f 100644 --- a/tools/metrics/histograms/metadata/password/histograms.xml +++ b/tools/metrics/histograms/metadata/password/histograms.xml
@@ -240,7 +240,7 @@ </histogram> <histogram name="PasswordBubble.BiometricAuthenticationPromo.AcceptClicked" - enum="BooleanSuccess" expires_after="2024-03-17"> + enum="BooleanSuccess" expires_after="2024-05-19"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -270,7 +270,7 @@ </histogram> <histogram name="PasswordBubble.DisplayDisposition" - enum="PasswordBubbleDisplayDisposition" expires_after="2024-03-17"> + enum="PasswordBubbleDisplayDisposition" expires_after="2024-05-19"> <owner>vasilii@chromium.org</owner> <summary> When the password management bubble opened, what state was it in? @@ -330,7 +330,7 @@ </histogram> <histogram name="PasswordGeneration.Event" enum="PasswordGenerationEvent" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>kazinova@google.com</owner> <owner>kolos@chromium.org</owner> <owner>vasilii@chromium.org</owner> @@ -356,7 +356,7 @@ </histogram> <histogram name="PasswordGeneration.PopupShown" - enum="PasswordGenerationPopupShown" expires_after="2024-03-17"> + enum="PasswordGenerationPopupShown" expires_after="2024-05-19"> <owner>kazinova@google.com</owner> <owner>vasilii@chromium.org</owner> <summary>Records an entry if (and only if) a popup was shown.</summary> @@ -386,7 +386,7 @@ </histogram> <histogram name="PasswordGeneration.UserDecision" - enum="PasswordGenerationUserEvent" expires_after="2024-03-17"> + enum="PasswordGenerationUserEvent" expires_after="2024-05-19"> <owner>ioanap@chromium.org</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -404,7 +404,7 @@ </histogram> <histogram name="PasswordManager.AbleToSavePasswordsOnSuccessfulLogin" - enum="BooleanSuccess" expires_after="2024-03-17"> + enum="BooleanSuccess" expires_after="2024-05-19"> <owner>vasilii@chromium.org</owner> <owner>src/components/password_manager/OWNERS</owner> <summary> @@ -426,7 +426,7 @@ </histogram> <histogram name="PasswordManager.AccessPasswordInSettings" - enum="AccessPasswordInSettingsEvent" expires_after="2024-03-17"> + enum="AccessPasswordInSettingsEvent" expires_after="2024-05-19"> <owner>kazinova@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -675,7 +675,7 @@ </histogram> <histogram name="PasswordManager.AffiliationDatabase.Error" - enum="SqliteLoggedResultCode" expires_after="2024-03-17"> + enum="SqliteLoggedResultCode" expires_after="2024-05-19"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -860,7 +860,7 @@ </histogram> <histogram name="PasswordManager.BiometricAvailabilityWin" - enum="BiometricAuthenticationStatusWin" expires_after="2024-03-17"> + enum="BiometricAuthenticationStatusWin" expires_after="2024-05-19"> <owner>vasilii@chromium.org</owner> <owner>vsemeniuk@google.com</owner> <summary> @@ -894,7 +894,7 @@ </histogram> <histogram name="PasswordManager.BulkCheck.CheckedCredentials" - units="credentials" expires_after="2024-03-17"> + units="credentials" expires_after="2024-05-19"> <owner>vasilii@chromium.org</owner> <owner>vsemeniuk@google.com</owner> <summary> @@ -920,7 +920,7 @@ </histogram> <histogram name="PasswordManager.BulkCheck.Error" - enum="PasswordLeakDetectionError" expires_after="2024-03-17"> + enum="PasswordLeakDetectionError" expires_after="2024-05-19"> <owner>vasilii@chromium.org</owner> <owner>vsemeniuk@google.com</owner> <summary>Error encountered during the password bulk check.</summary> @@ -948,7 +948,7 @@ </histogram> <histogram name="PasswordManager.BulkCheck.LeaksFound" units="credentials" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>vasilii@chromium.org</owner> <owner>vsemeniuk@google.com</owner> <summary> @@ -960,7 +960,7 @@ </histogram> <histogram name="PasswordManager.BulkCheck.PasswordCheckReferrer" - enum="PasswordCheckReferrer" expires_after="2024-03-17"> + enum="PasswordCheckReferrer" expires_after="2024-05-19"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -970,7 +970,7 @@ </histogram> <histogram name="PasswordManager.BulkCheck.PasswordCheckReferrerAndroid2" - enum="PasswordCheckReferrerAndroid" expires_after="2024-03-17"> + enum="PasswordCheckReferrerAndroid" expires_after="2024-05-19"> <owner>ioanap@chromium.org</owner> <owner>fhorschig@chromium.org</owner> <summary> @@ -983,7 +983,7 @@ </histogram> <histogram name="PasswordManager.BulkCheck.Time" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>vasilii@chromium.org</owner> <owner>vsemeniuk@google.com</owner> <summary> @@ -1049,7 +1049,7 @@ </histogram> <histogram name="PasswordManager.BulkCheck.UserActionAndroid" - enum="PasswordCheckUIUserActionAndroid" expires_after="2024-03-17"> + enum="PasswordCheckUIUserActionAndroid" expires_after="2024-05-19"> <owner>ioanap@chromium.org</owner> <owner>fhorschigg@chromium.org</owner> <summary>User actions performed on the Password Check settings view.</summary> @@ -1080,7 +1080,7 @@ </histogram> <histogram name="PasswordManager.CredentialEditError" - enum="CredentialEditError" expires_after="2024-03-17"> + enum="CredentialEditError" expires_after="2024-05-19"> <owner>ioanap@chromium.org</owner> <owner>fhorschig@chromium.org</owner> <summary> @@ -1332,7 +1332,7 @@ </histogram> <histogram name="PasswordManager.FieldNameCollisionInVotes" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>kolos@chromium.org</owner> <owner>khamutov@google.com</owner> <summary> @@ -1422,7 +1422,7 @@ </histogram> <histogram name="PasswordManager.FirstWaitForUsernameReason" - enum="PasswordManagerFirstWaitForUsernameReason" expires_after="2024-03-17"> + enum="PasswordManagerFirstWaitForUsernameReason" expires_after="2024-05-19"> <owner>kazinova@google.com</owner> <owner>battre@chromium.org</owner> <summary> @@ -1435,7 +1435,7 @@ </histogram> <histogram name="PasswordManager.FormVisited.PerProfileType" - enum="BrowserProfileType" expires_after="2024-03-17"> + enum="BrowserProfileType" expires_after="2024-05-19"> <owner>rhalavati@chromium.org</owner> <owner>chrome-privacy-core@google.com</owner> <summary> @@ -1467,7 +1467,7 @@ </histogram> <histogram name="PasswordManager.HttpCredentials2" - enum="PasswordManagerHttpCredentialType" expires_after="2024-02-04"> + enum="PasswordManagerHttpCredentialType" expires_after="2024-05-19"> <owner>kazinova@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -1613,7 +1613,7 @@ </histogram> <histogram name="PasswordManager.ImportedPasswordsPerUserInCSV" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>vasilii@chromium.org</owner> <owner>src/components/password_manager/OWNERS</owner> <summary> @@ -1623,7 +1623,7 @@ </histogram> <histogram name="PasswordManager.ImportEntryStatus" - enum="PasswordManagerImportEntryStatus" expires_after="2024-03-17"> + enum="PasswordManagerImportEntryStatus" expires_after="2024-05-19"> <owner>eliaskh@chromium.org</owner> <owner>natiahlyi@google.com</owner> <summary> @@ -1755,7 +1755,7 @@ </histogram> <histogram name="PasswordManager.LeakDetection.AnalyzeSingleLeakResponseResult" - enum="PasswordAnalyzeLeakResponseResult" expires_after="2024-03-17"> + enum="PasswordAnalyzeLeakResponseResult" expires_after="2024-05-19"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary>Result of analyzing a single leak response.</summary> @@ -1851,7 +1851,7 @@ </histogram> <histogram name="PasswordManager.LoginDatabase.DeleteFromKeychain" - enum="ErrSecOSStatus" expires_after="2024-03-17"> + enum="ErrSecOSStatus" expires_after="2024-05-19"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -1871,7 +1871,7 @@ </histogram> <histogram name="PasswordManager.ManagePasswordsReferrer" - enum="ManagePasswordsReferrer" expires_after="2024-03-17"> + enum="ManagePasswordsReferrer" expires_after="2024-05-19"> <owner>kazinova@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -1882,7 +1882,7 @@ </histogram> <histogram name="PasswordManager.MatchedFormType" - enum="PasswordManagerMatchedFormType" expires_after="2024-03-17"> + enum="PasswordManagerMatchedFormType" expires_after="2024-05-19"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -1948,7 +1948,7 @@ <histogram name="PasswordManager.MigrationToOSCrypt.{Store}DeletedPasswordCount" - units="count" expires_after="2024-03-17"> + units="count" expires_after="2024-05-19"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -1983,7 +1983,7 @@ <histogram name="PasswordManager.MigrationToOSCrypt.{Store}MigratedPasswordCount" - units="count" expires_after="2024-03-17"> + units="count" expires_after="2024-05-19"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -2167,7 +2167,7 @@ </histogram> <histogram name="PasswordManager.PasswordDropdownItemSelected" - enum="PasswordDropdownSelectedOption" expires_after="2024-03-17"> + enum="PasswordDropdownSelectedOption" expires_after="2024-05-19"> <owner>kazinova@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -2293,7 +2293,7 @@ <histogram name="PasswordManager.PasswordNotesMigrationToOSCrypt.{Store}DeletedNotesCount" - units="count" expires_after="2024-03-17"> + units="count" expires_after="2024-05-19"> <owner>rgod@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -2317,7 +2317,7 @@ <histogram name="PasswordManager.PasswordNotesMigrationToOSCrypt.{Store}MigratedNotesCount" - units="count" expires_after="2024-03-17"> + units="count" expires_after="2024-05-19"> <owner>rgod@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -2328,7 +2328,7 @@ </histogram> <histogram name="PasswordManager.PasswordNotesMigrationToOSCrypt{StoreType}" - enum="PasswordNotesMigrationToOSCryptEnum" expires_after="2024-03-17"> + enum="PasswordNotesMigrationToOSCryptEnum" expires_after="2024-05-19"> <owner>rgod@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -2373,7 +2373,7 @@ </histogram> <histogram name="PasswordManager.PasswordReuse.TotalPasswords" - units="credentials" expires_after="2024-03-17"> + units="credentials" expires_after="2024-05-19"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2464,7 +2464,7 @@ </histogram> <histogram name="PasswordManager.PasswordsGrouping.Time" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -2965,7 +2965,7 @@ </histogram> <histogram name="PasswordManager.ReuseCheck.CheckedPasswords" units="passwords" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -2976,7 +2976,7 @@ </histogram> <histogram name="PasswordManager.ReuseCheck.ReusedPasswords" units="passwords" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -2987,7 +2987,7 @@ </histogram> <histogram name="PasswordManager.ReuseCheck.Time" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>vsemeniuk@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -3230,7 +3230,7 @@ </histogram> <histogram name="PasswordManager.SubmittedFormFrame2" - enum="SubmittedPasswordFormFrame" expires_after="2024-03-17"> + enum="SubmittedPasswordFormFrame" expires_after="2024-05-19"> <owner>kazinova@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -3253,7 +3253,7 @@ </histogram> <histogram name="PasswordManager.SuccessfulLoginHappened" - enum="BooleanSuccessfulLoginHappenedOnHttps" expires_after="2024-03-17"> + enum="BooleanSuccessfulLoginHappenedOnHttps" expires_after="2024-05-19"> <owner>kazinova@google.com</owner> <owner>kolos@chromium.org</owner> <summary> @@ -3356,7 +3356,7 @@ </histogram> <histogram name="PasswordManager.TouchToFill.CredentialIndex" units="index" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ioanap@chromium.org</owner> <owner>fhorschig@chromium.org</owner> <owner>kolos@chromium.org</owner> @@ -3367,7 +3367,7 @@ </histogram> <histogram name="PasswordManager.TouchToFill.DismissalReason" - enum="BottomSheet.StateChangeReason" expires_after="2024-03-17"> + enum="BottomSheet.StateChangeReason" expires_after="2024-05-19"> <owner>ioanap@chromium.org</owner> <owner>fhorschig@chromium.org</owner> <owner>kolos@chromium.org</owner> @@ -3378,7 +3378,7 @@ </histogram> <histogram name="PasswordManager.TouchToFill.Outcome" - enum="TouchToFill.Outcome" expires_after="2024-03-17"> + enum="TouchToFill.Outcome" expires_after="2024-05-19"> <owner>ioanap@chromium.org</owner> <owner>fhorschig@chromium.org</owner> <owner>kolos@chromium.org</owner> @@ -3419,7 +3419,7 @@ </histogram> <histogram name="PasswordManager.TouchToFill.SubmissionReadiness" - enum="TouchToFill.SubmissionReadiness" expires_after="2024-03-17"> + enum="TouchToFill.SubmissionReadiness" expires_after="2024-05-19"> <owner>kolos@chromium.org</owner> <owner>fhorschig@chromium.org</owner> <summary> @@ -3431,7 +3431,7 @@ </histogram> <histogram name="PasswordManager.TouchToFill.SuccessfulSubmissionWasObserved" - enum="Boolean" expires_after="2024-03-17"> + enum="Boolean" expires_after="2024-05-19"> <owner>ioanap@chromium.org</owner> <owner>fhorschig@chromium.org</owner> <owner>kolos@chromium.org</owner> @@ -3451,7 +3451,7 @@ </histogram> <histogram name="PasswordManager.TouchToFill.TimeToSuccessfulLogin" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ioanap@chromium.org</owner> <owner>fhorschig@chromium.org</owner> <owner>kolos@chromium.org</owner> @@ -3550,13 +3550,13 @@ </histogram> <histogram name="PasswordManager.UpdateUIDismissalReason" - enum="PasswordManagerUIDismissalReason" expires_after="2024-03-17"> + enum="PasswordManagerUIDismissalReason" expires_after="2024-05-19"> <owner>vasilii@chromium.org</owner> <summary>Why was the update password UI (bubble or infobar) closed?</summary> </histogram> <histogram name="PasswordManager.UPMUnenrollmentReason" - enum="PasswordStoreAndroidBackendAPIError" expires_after="2024-03-17"> + enum="PasswordStoreAndroidBackendAPIError" expires_after="2024-05-19"> <owner>ioanap@chromium.org</owner> <owner>izuzic@google.com</owner> <summary> @@ -3612,7 +3612,7 @@ </histogram> <histogram name="PasswordManager.WeakCheck.SingleCheckTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jkeitel@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -3622,14 +3622,14 @@ </histogram> <histogram name="PasswordManager.WeakCheck.Time" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>kazinova@google.com</owner> <owner>vasilii@chromium.org</owner> <summary>The time it took to complete the passwords weak check.</summary> </histogram> <histogram name="PasswordManager.WeakCheck.WeakPasswords" units="passwords" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>kazinova@google.com</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -3859,7 +3859,7 @@ </histogram> <histogram name="PasswordProtection.ModalWarningDialogAction" - enum="PasswordProtectionWarningAction" expires_after="2024-03-17"> + enum="PasswordProtectionWarningAction" expires_after="2024-05-19"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -3929,7 +3929,7 @@ </histogram> <histogram name="PasswordProtection.RequestNetworkDuration" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/payment/histograms.xml b/tools/metrics/histograms/metadata/payment/histograms.xml index 9069f89..339af03d 100644 --- a/tools/metrics/histograms/metadata/payment/histograms.xml +++ b/tools/metrics/histograms/metadata/payment/histograms.xml
@@ -88,7 +88,7 @@ </histogram> <histogram name="PaymentRequest.Events2" units="bitfield value" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rouslan@chromium.org</owner> <owner>web-payments-team@google.com</owner> <summary> @@ -166,7 +166,7 @@ </histogram> <histogram name="PaymentRequest.PaymentHandlerInstallSuccess" - enum="BooleanSuccess" expires_after="2024-03-17"> + enum="BooleanSuccess" expires_after="2024-05-19"> <owner>rouslan@chromium.org</owner> <owner>web-payments-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/pdf/histograms.xml b/tools/metrics/histograms/metadata/pdf/histograms.xml index bcaac63f..541e6949 100644 --- a/tools/metrics/histograms/metadata/pdf/histograms.xml +++ b/tools/metrics/histograms/metadata/pdf/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="PDF.Actions" enum="ChromePDFViewerActions" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>hnakashima@chromium.org</owner> <summary> Tracks user actions in the PDF viewer. Logged when the document is opened @@ -36,7 +36,7 @@ </histogram> <histogram name="PDF.AttachmentType" enum="ViewFileType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>nigi@chromium.org</owner> <owner>thestig@chromium.org</owner> <summary> @@ -59,7 +59,7 @@ </summary> </histogram> -<histogram name="PDF.HasAttachment" enum="Boolean" expires_after="2024-03-17"> +<histogram name="PDF.HasAttachment" enum="Boolean" expires_after="2024-05-19"> <owner>nigi@chromium.org</owner> <owner>thestig@chromium.org</owner> <summary> @@ -79,7 +79,7 @@ </summary> </histogram> -<histogram name="PDF.PageCount" units="pages" expires_after="2024-03-17"> +<histogram name="PDF.PageCount" units="pages" expires_after="2024-05-19"> <owner>hnakashima@chromium.org</owner> <owner>thestig@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/performance_controls/histograms.xml b/tools/metrics/histograms/metadata/performance_controls/histograms.xml index 1324695..ebd91e9 100644 --- a/tools/metrics/histograms/metadata/performance_controls/histograms.xml +++ b/tools/metrics/histograms/metadata/performance_controls/histograms.xml
@@ -29,7 +29,7 @@ </histogram> <histogram name="PerformanceControls.BatterySaver.IPHOpenSettings" - units="BooleanSettingsOpened" expires_after="2024-03-17"> + units="BooleanSettingsOpened" expires_after="2024-05-19"> <owner>agale@chromium.org</owner> <owner>estalin@chromium.org</owner> <owner>chrome-performance-ui-sea@google.com</owner> @@ -42,7 +42,7 @@ </histogram> <histogram name="PerformanceControls.BatterySaver.SettingsChangeMode" - enum="BatterySaverModeState" expires_after="2024-03-17"> + enum="BatterySaverModeState" expires_after="2024-05-19"> <owner>charlesmeng@chromium.org</owner> <owner>chrome-performance-ui-sea@google.com</owner> <summary> @@ -53,7 +53,7 @@ </histogram> <histogram name="PerformanceControls.HighEfficiency.BubbleAction" - enum="HighEfficiencyBubbleActionType" expires_after="2024-03-17"> + enum="HighEfficiencyBubbleActionType" expires_after="2024-05-19"> <owner>agale@chromium.org</owner> <owner>chrome-performance-ui-sea@google.com</owner> <summary> @@ -65,7 +65,7 @@ </histogram> <histogram name="PerformanceControls.HighEfficiency.ChipState" - enum="HighEfficiencyChipState" expires_after="2024-03-17"> + enum="HighEfficiencyChipState" expires_after="2024-05-19"> <owner>agale@chromium.org</owner> <owner>chrome-performance-ui-sea@google.com</owner> <summary> @@ -90,7 +90,7 @@ <histogram name="PerformanceControls.HighEfficiency.SettingsChangeExceptionList" - enum="HighEfficiencyModeExceptionListAction" expires_after="2024-03-17"> + enum="HighEfficiencyModeExceptionListAction" expires_after="2024-05-19"> <owner>charlesmeng@chromium.org</owner> <owner>chrome-performance-ui-sea@google.com</owner> <summary> @@ -102,7 +102,7 @@ </histogram> <histogram name="PerformanceControls.HighEfficiency.SettingsChangeMode2" - enum="HighEfficiencyModeState" expires_after="2024-03-17"> + enum="HighEfficiencyModeState" expires_after="2024-05-19"> <owner>charlesmeng@chromium.org</owner> <owner>chrome-performance-ui-sea@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/performance_manager/histograms.xml b/tools/metrics/histograms/metadata/performance_manager/histograms.xml index b8d977bb..769b39b 100644 --- a/tools/metrics/histograms/metadata/performance_manager/histograms.xml +++ b/tools/metrics/histograms/metadata/performance_manager/histograms.xml
@@ -321,7 +321,7 @@ </histogram> <histogram name="PerformanceManager.UserTuning.EfficiencyMode" - enum="EfficiencyMode" expires_after="2024-03-17"> + enum="EfficiencyMode" expires_after="2024-05-19"> <owner>anthonyvd@chromium.org</owner> <owner>chrome-catan@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/permissions/histograms.xml b/tools/metrics/histograms/metadata/permissions/histograms.xml index cec31d3..2d1b387 100644 --- a/tools/metrics/histograms/metadata/permissions/histograms.xml +++ b/tools/metrics/histograms/metadata/permissions/histograms.xml
@@ -508,7 +508,7 @@ </histogram> <histogram name="Permissions.MissingOSLevelPermission.Action" - enum="PermissionAction" expires_after="2024-03-17"> + enum="PermissionAction" expires_after="2024-05-19"> <owner>andypaicu@chromium.org</owner> <owner>engedy@chromium.org</owner> <owner>hkamila@chromium.org</owner> @@ -655,7 +655,7 @@ </histogram> <histogram name="Permissions.Prompt.Accepted" enum="PermissionRequestType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>engedy@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -729,7 +729,7 @@ </histogram> <histogram name="Permissions.Prompt.Denied" enum="PermissionRequestType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>engedy@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -857,7 +857,7 @@ </histogram> <histogram name="Permissions.Prompt.Shown" enum="PermissionRequestType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>engedy@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -1123,7 +1123,7 @@ </histogram> <histogram name="Permissions.Request.CrossOrigin" enum="PermissionType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>elklm@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -1192,7 +1192,7 @@ </histogram> <histogram base="true" name="Permissions.Usage.ElapsedTimeSinceGrant" - units="seconds" expires_after="2024-03-17"> + units="seconds" expires_after="2024-05-19"> <owner>engedy@chromium.org</owner> <owner>src/components/permissions/PERMISSIONS_OWNERS</owner> <summary> @@ -1214,7 +1214,7 @@ </histogram> <histogram name="Permissions.WebHid.ChooserClosed" enum="WebHidChooserClosed" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mattreynolds@chromium.org</owner> <owner>deviceapi-team@google.com</owner> <summary> @@ -1266,7 +1266,7 @@ </histogram> <histogram name="SiteEngagementService.OriginsEngaged" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>calamity@chromium.org</owner> <owner>dominickn@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/platform/histograms.xml b/tools/metrics/histograms/metadata/platform/histograms.xml index dc06c794..8ab774cb 100644 --- a/tools/metrics/histograms/metadata/platform/histograms.xml +++ b/tools/metrics/histograms/metadata/platform/histograms.xml
@@ -1319,7 +1319,7 @@ </summary> </histogram> -<histogram name="Platform.Meminfo" units="KB" expires_after="2024-03-17"> +<histogram name="Platform.Meminfo" units="KB" expires_after="2024-05-19"> <owner>hajimehoshi@chromium.org</owner> <owner>kouhei@chromium.org</owner> <owner>sonnyrao@chromium.org</owner> @@ -1611,7 +1611,7 @@ </histogram> <histogram name="Platform.Missive.StorageUsage" units="MiB" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>xuhong@chromium.org</owner> <owner>lbaraz@chromium.org</owner> <owner>cros-reporting-team@google.com</owner> @@ -1734,7 +1734,7 @@ </histogram> <histogram name="Platform.MountEncrypted.EncryptionKeyStatus" - enum="MountEncryptedEncryptionKeyStatus" expires_after="2024-03-17"> + enum="MountEncryptedEncryptionKeyStatus" expires_after="2024-05-19"> <owner>apronin@chromium.org</owner> <owner>cros-hwsec+uma@google.com</owner> <summary> @@ -1745,7 +1745,7 @@ </histogram> <histogram name="Platform.MountEncrypted.SystemKeyStatus" - enum="MountEncryptedSystemKeyStatus" expires_after="2024-03-17"> + enum="MountEncryptedSystemKeyStatus" expires_after="2024-05-19"> <owner>apronin@chromium.org</owner> <owner>cros-hwsec+uma@google.com</owner> <summary> @@ -1975,7 +1975,7 @@ </histogram> <histogram name="Platform.StatefulWritesDaily" units="KiB" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>asavery@chromium.org</owner> <owner>gwendal@chromium.org</owner> <owner>chromeos-storage@google.com</owner> @@ -2031,7 +2031,7 @@ </summary> </histogram> -<histogram name="Platform.SwapInDaily" units="pages" expires_after="2024-03-17"> +<histogram name="Platform.SwapInDaily" units="pages" expires_after="2024-05-19"> <owner>asavery@chromium.org</owner> <owner>chromeos-memory@google.com</owner> <summary>Number of pages swapped IN over a day, sampled daily.</summary> @@ -2054,7 +2054,7 @@ </histogram> <histogram name="Platform.TPM.AuthErrorCode" enum="TPMResultCodeEnum" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>yich@google.com</owner> <owner>cros-hwsec-userland-eng+uma@google.com</owner> <summary> @@ -2087,7 +2087,7 @@ </histogram> <histogram name="Platform.TPM.DictionaryAttackCounter" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>yich@google.com</owner> <owner>cros-hwsec-userland-eng+uma@google.com</owner> <summary> @@ -2107,7 +2107,7 @@ </histogram> <histogram name="Platform.TPM.ErrorCode" enum="TPMResultCodeEnum" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>yich@google.com</owner> <owner>cros-hwsec-userland-eng+uma@google.com</owner> <summary> @@ -2204,7 +2204,7 @@ </histogram> <histogram name="Platform.TPM.VersionFingerprint" enum="TPMVersionFingerprint" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>apronin@chromium.org</owner> <owner>cros-hwsec+uma@google.com</owner> <summary> @@ -2261,7 +2261,7 @@ </histogram> <histogram name="Platform.Trunks.FirstTimeoutWritingTime" units="seconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>chingkang@chromium.org</owner> <owner>cros-hwsec+uma@google.com</owner> <summary>System uptime when first timeout writing TPM command occurs</summary>
diff --git a/tools/metrics/histograms/metadata/plugin_vm/histograms.xml b/tools/metrics/histograms/metadata/plugin_vm/histograms.xml index 5d95f02..bb2b576 100644 --- a/tools/metrics/histograms/metadata/plugin_vm/histograms.xml +++ b/tools/metrics/histograms/metadata/plugin_vm/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="PluginVm.DlcUseResult" enum="PluginVmDlcUseResult" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>kimjae@google.com</owner> <owner>timloh@google.com</owner> <summary>Recorded at each time PluginVM DLC is installed.</summary> @@ -94,7 +94,7 @@ </histogram> <histogram name="PluginVm.SetupResult" enum="PluginVmSetupResult" - expires_after="2024-01-14"> + expires_after="2024-05-19"> <owner>joelhockey@chromium.org</owner> <owner>okalitova@chromium.org</owner> <owner>timloh@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/power/histograms.xml b/tools/metrics/histograms/metadata/power/histograms.xml index a695e8d..1b467147 100644 --- a/tools/metrics/histograms/metadata/power/histograms.xml +++ b/tools/metrics/histograms/metadata/power/histograms.xml
@@ -691,7 +691,7 @@ </histogram> <histogram name="Power.AmbientLightOnResume" units="lux" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bkersten@chromium.org</owner> <owner>slangley@chromium.org</owner> <summary> @@ -1098,7 +1098,7 @@ </summary> </histogram> -<histogram name="Power.BatteryPercentDrop" units="%" expires_after="2024-03-17"> +<histogram name="Power.BatteryPercentDrop" units="%" expires_after="2024-05-19"> <owner>ryansturm@chromium.org</owner> <owner>tbansal@chromium.org</owner> <summary> @@ -1782,7 +1782,7 @@ </histogram> <histogram name="Power.PC10inS0ixRuntimeResidencyRate" units="%" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>skardach@google.com</owner> <owner>svenva@google.com</owner> <owner>chromeos-platform-power@google.com</owner> @@ -1801,7 +1801,7 @@ </histogram> <histogram name="Power.PC10RuntimeResidencyRate" units="%" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>skardach@google.com</owner> <owner>svenva@google.com</owner> <owner>chromeos-platform-power@google.com</owner> @@ -2033,7 +2033,7 @@ </histogram> <histogram name="PowerML.ModelDim.Result" enum="PowerMLFinalResult" - expires_after="2024-01-07"> + expires_after="2024-05-19"> <owner>napper@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <summary> @@ -2121,7 +2121,7 @@ </histogram> <histogram name="PowerML.SmartDimModel.RequestCanceledDuration" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>amoylan@chromium.org</owner> <owner>napper@chromium.org</owner> <owner>napper@chromium.org</owner> @@ -2133,7 +2133,7 @@ </histogram> <histogram name="PowerML.SmartDimModel.RequestCompleteDuration" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>amoylan@chromium.org</owner> <owner>napper@chromium.org</owner> <owner>napper@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/prefetch/histograms.xml b/tools/metrics/histograms/metadata/prefetch/histograms.xml index f63d6938..436d8af9 100644 --- a/tools/metrics/histograms/metadata/prefetch/histograms.xml +++ b/tools/metrics/histograms/metadata/prefetch/histograms.xml
@@ -76,7 +76,7 @@ </histogram> <histogram name="PrefetchProxy.AfterClick.Mainframe.CookieCopyTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>liviutinta@chromium.org</owner> <owner>jbroman@chromium.org</owner> <owner>curranmax@chromium.org</owner> @@ -93,7 +93,7 @@ </histogram> <histogram name="PrefetchProxy.AfterClick.Mainframe.CookieReadTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>liviutinta@chromium.org</owner> <owner>jbroman@chromium.org</owner> <owner>curranmax@chromium.org</owner> @@ -112,7 +112,7 @@ </histogram> <histogram name="PrefetchProxy.AfterClick.Mainframe.CookieWaitTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>liviutinta@chromium.org</owner> <owner>jbroman@chromium.org</owner> <owner>curranmax@chromium.org</owner> @@ -130,7 +130,7 @@ </histogram> <histogram name="PrefetchProxy.AfterClick.Mainframe.CookieWriteTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>liviutinta@chromium.org</owner> <owner>jbroman@chromium.org</owner> <owner>curranmax@chromium.org</owner> @@ -323,7 +323,7 @@ </histogram> <histogram name="PrefetchProxy.Prefetch.Mainframe.BodyLength" units="bytes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>liviutinta@chromium.org</owner> <owner>jbroman@chromium.org</owner> <owner>curranmax@chromium.org</owner> @@ -335,7 +335,7 @@ </histogram> <histogram name="PrefetchProxy.Prefetch.Mainframe.ConnectTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>liviutinta@chromium.org</owner> <owner>jbroman@chromium.org</owner> <owner>curranmax@chromium.org</owner> @@ -358,7 +358,7 @@ </histogram> <histogram name="PrefetchProxy.Prefetch.Mainframe.NetError" - enum="NetErrorCodes" expires_after="2024-03-17"> + enum="NetErrorCodes" expires_after="2024-05-19"> <owner>liviutinta@chromium.org</owner> <owner>jbroman@chromium.org</owner> <owner>curranmax@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/print/histograms.xml b/tools/metrics/histograms/metadata/print/histograms.xml index df6d911a..4da09933 100644 --- a/tools/metrics/histograms/metadata/print/histograms.xml +++ b/tools/metrics/histograms/metadata/print/histograms.xml
@@ -68,7 +68,7 @@ </histogram> <histogram name="PrintPreview.NumberOfPrinters" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>thestig@chromium.org</owner> <owner>dhoss@chromium.org</owner> <summary> @@ -89,7 +89,7 @@ </histogram> <histogram name="PrintPreview.PrintDocumentType" - enum="PrintPreviewPrintDocumentTypeBuckets" expires_after="2024-03-17"> + enum="PrintPreviewPrintDocumentTypeBuckets" expires_after="2024-05-19"> <owner>rbpotter@chromium.org</owner> <owner>awscreen@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/printing/histograms.xml b/tools/metrics/histograms/metadata/printing/histograms.xml index ed74778..c06cba0 100644 --- a/tools/metrics/histograms/metadata/printing/histograms.xml +++ b/tools/metrics/histograms/metadata/printing/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="Printing.ConversionSize.Emf" units="KB" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>thestig@chromium.org</owner> <owner>awscreen@chromium.org</owner> <summary> @@ -228,7 +228,7 @@ </histogram> <histogram name="Printing.CUPS.NearbyNetworkPrintersCount" units="printers" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bmgordon@chromium.org</owner> <owner>project-bolton@google.com</owner> <summary> @@ -239,7 +239,7 @@ </histogram> <histogram name="Printing.CUPS.PrintDocumentSize" units="KB" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bmgordon@chromium.org</owner> <owner>project-bolton@google.com</owner> <summary> @@ -249,7 +249,7 @@ </histogram> <histogram name="Printing.CUPS.PrinterAdded" enum="PrinterProtocol" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bmgordon@chromium.org</owner> <owner>src/chromeos/printing/OWNERS</owner> <summary> @@ -283,7 +283,7 @@ </histogram> <histogram name="Printing.CUPS.PrintersDiscovered" units="printers" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bmgordon@chromium.org</owner> <owner>src/chromeos/printing/OWNERS</owner> <summary> @@ -307,7 +307,7 @@ </histogram> <histogram name="Printing.CUPS.PrinterSetupResult.PrintPreview" - enum="PrinterSetupResult" expires_after="2024-03-17"> + enum="PrinterSetupResult" expires_after="2024-05-19"> <owner>bmgordon@chromium.org</owner> <owner>cros-printing-dev@chromium.org</owner> <summary> @@ -364,7 +364,7 @@ </histogram> <histogram name="Printing.CUPS.ProtocolUsed" enum="PrinterProtocol" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bmgordon@chromium.org</owner> <owner>cros-printing-dev@chromium.org</owner> <summary> @@ -458,7 +458,7 @@ </histogram> <histogram name="Printing.CUPS.ZeroconfPrinterSetupResult.PrintPreview" - enum="PrinterSetupResult" expires_after="2024-03-17"> + enum="PrinterSetupResult" expires_after="2024-05-19"> <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 70af4b5..63e54ef 100644 --- a/tools/metrics/histograms/metadata/privacy/histograms.xml +++ b/tools/metrics/histograms/metadata/privacy/histograms.xml
@@ -357,7 +357,7 @@ </histogram> <histogram name="Privacy.DIPS.DIPSErrorCodes" enum="DIPSErrorCode" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>wanderview@chromium.org</owner> <owner>src/chrome/browser/dips/OWNERS</owner> <summary> @@ -518,7 +518,7 @@ <histogram name="PrivacySandbox.AggregationService.ScheduledRequests.NumRetriesBeforeSuccess" - units="retries" expires_after="2024-03-17"> + units="retries" expires_after="2024-05-19"> <owner>alexmt@chromium.org</owner> <owner>linnan@chromium.org</owner> <summary> @@ -529,7 +529,7 @@ </histogram> <histogram name="PrivacySandbox.AggregationService.ScheduledRequests.Status" - enum="AggregationServiceObserverReportStatus" expires_after="2024-03-17"> + enum="AggregationServiceObserverReportStatus" expires_after="2024-05-19"> <owner>alexmt@chromium.org</owner> <owner>linnan@chromium.org</owner> <summary> @@ -564,7 +564,7 @@ <histogram name="PrivacySandbox.AggregationService.Storage.Sql.StoreRequestHasCapacity" - enum="Boolean" expires_after="2024-03-17"> + enum="Boolean" expires_after="2024-05-19"> <owner>alexmt@chromium.org</owner> <owner>linnan@chromium.org</owner> <summary> @@ -575,7 +575,7 @@ </histogram> <histogram name="PrivacySandbox.AggregationService.UnscheduledRequests.Status" - enum="AggregationServiceObserverReportStatus" expires_after="2024-03-17"> + enum="AggregationServiceObserverReportStatus" expires_after="2024-05-19"> <owner>alexmt@chromium.org</owner> <owner>linnan@chromium.org</owner> <summary> @@ -778,7 +778,7 @@ <histogram name="PrivacySandbox.PrivateAggregation.BudgetStorage.ShutdownBeforeFinishingInitialization" - enum="Boolean" expires_after="2024-03-17"> + enum="Boolean" expires_after="2024-05-19"> <owner>alexmt@chromium.org</owner> <owner>linnan@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/privacy_budget/histograms.xml b/tools/metrics/histograms/metadata/privacy_budget/histograms.xml index f4106d2..87691e5 100644 --- a/tools/metrics/histograms/metadata/privacy_budget/histograms.xml +++ b/tools/metrics/histograms/metadata/privacy_budget/histograms.xml
@@ -17,7 +17,7 @@ <histograms> <histogram name="PrivacyBudget.ClockDrift.FetchLatencyVariance" units="ms^2" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>antoniosartori@chromium.org</owner> <owner>areimers@chromium.org</owner> <summary> @@ -29,7 +29,7 @@ </histogram> <histogram name="PrivacyBudget.ClockDrift.Magnitude.Negative" - units="microseconds/s" expires_after="2024-03-17"> + units="microseconds/s" expires_after="2024-05-19"> <owner>antoniosartori@chromium.org</owner> <owner>areimers@chromium.org</owner> <summary> @@ -41,7 +41,7 @@ </histogram> <histogram name="PrivacyBudget.ClockDrift.Magnitude.Positive" - units="microseconds/s" expires_after="2024-03-17"> + units="microseconds/s" expires_after="2024-05-19"> <owner>antoniosartori@chromium.org</owner> <owner>areimers@chromium.org</owner> <summary> @@ -76,7 +76,7 @@ </histogram> <histogram name="PrivacyBudget.ClockSkew.Magnitude.Negative" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>antoniosartori@chromium.org</owner> <owner>areimers@chromium.org</owner> <summary> @@ -87,7 +87,7 @@ </histogram> <histogram name="PrivacyBudget.ClockSkew.Magnitude.Positive" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>antoniosartori@chromium.org</owner> <owner>areimers@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/profile/histograms.xml b/tools/metrics/histograms/metadata/profile/histograms.xml index d3cad5e..924a6fd 100644 --- a/tools/metrics/histograms/metadata/profile/histograms.xml +++ b/tools/metrics/histograms/metadata/profile/histograms.xml
@@ -61,7 +61,7 @@ </histogram> <histogram name="Profile.Avatar" enum="ProfileAvatar" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>droger@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> <summary>The frequency of selection of each avatar.</summary> @@ -74,7 +74,7 @@ </histogram> <histogram name="Profile.BrowserActive.PerProfile" enum="Profile" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>msarda@chromium.org</owner> <owner>tangltom@chromium.org</owner> <summary> @@ -198,7 +198,7 @@ </histogram> <histogram name="Profile.Incognito.MainFrameNavigationsPerSession" - units="navigations" expires_after="2024-02-11"> + units="navigations" expires_after="2024-05-19"> <owner>rhalavati@chromium.org</owner> <owner>chrome-incognito@google.com</owner> <summary> @@ -348,7 +348,7 @@ </histogram> <histogram name="Profile.NetUserCount" enum="ProfileNetUserCount" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rogerta@chromium.org</owner> <summary> Counts of users added and deleted. Percentages are not meaningful. Please @@ -371,7 +371,7 @@ </histogram> <histogram name="Profile.NumberOfAccountsPerProfile" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>msarda@chromium.org</owner> <owner>droger@chromium.org</owner> <summary> @@ -434,7 +434,7 @@ </histogram> <histogram name="Profile.NumberOfSignedInProfiles" units="profiles" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>droger@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> <summary> @@ -519,7 +519,7 @@ </histogram> <histogram base="true" name="Profile.State.SyncEnabled" enum="BooleanEnabled" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>droger@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> <summary> @@ -906,7 +906,7 @@ </histogram> <histogram name="ProfilePicker.UserAction" enum="ProfilePickerAction" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>msalama@chromium.org</owner> <owner>chrome-signin-team@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 46fe780..74086ad 100644 --- a/tools/metrics/histograms/metadata/quick_answers/histograms.xml +++ b/tools/metrics/histograms/metadata/quick_answers/histograms.xml
@@ -273,7 +273,7 @@ </histogram> <histogram name="QuickAnswers.SelectedContent.Length" units="characters" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <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 26882f9..af80ce8 100644 --- a/tools/metrics/histograms/metadata/quota/histograms.xml +++ b/tools/metrics/histograms/metadata/quota/histograms.xml
@@ -43,7 +43,7 @@ </histogram> <histogram name="Quota.AvailableDiskSpace" units="MB" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ayui@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary> @@ -173,7 +173,7 @@ </histogram> <histogram name="Quota.GlobalTemporaryPoolSize" units="MB" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ayui@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary> @@ -237,7 +237,7 @@ </histogram> <histogram name="Quota.QuotaDatabaseDisabled" - enum="QuotaDatabaseDisabledReason" expires_after="2024-03-17"> + enum="QuotaDatabaseDisabledReason" expires_after="2024-05-19"> <owner>estade@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary> @@ -253,7 +253,7 @@ </histogram> <histogram name="Quota.QuotaDatabaseReset" enum="QuotaDatabaseResetReason" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ayui@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary> @@ -277,7 +277,7 @@ </histogram> <histogram name="Quota.SkippedEvictionRoundsPerHour" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ayui@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary> @@ -300,7 +300,7 @@ </histogram> <histogram name="Quota.StorageKeyNonceCount" units="buckets" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ayui@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary> @@ -311,7 +311,7 @@ </histogram> <histogram name="Quota.TimeDeltaOfEvictionRounds" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ayui@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary> @@ -321,7 +321,7 @@ </histogram> <histogram name="Quota.TimeSpentToAEvictionRound" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ayui@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary> @@ -331,7 +331,7 @@ </histogram> <histogram name="Quota.TotalBucketCount" units="buckets" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ayui@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary> @@ -349,7 +349,7 @@ </histogram> <histogram name="Quota.TotalDiskSpaceIsZero" enum="BooleanVolumeZero" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <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 b77a1d2..475f98e 100644 --- a/tools/metrics/histograms/metadata/renderer/histograms.xml +++ b/tools/metrics/histograms/metadata/renderer/histograms.xml
@@ -417,7 +417,7 @@ </histogram> <histogram name="Renderer.Images.OverfetchedPixels" units="px^2" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>yoavweiss@chromium.org</owner> <owner>speed-metrics-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/renderer4/histograms.xml b/tools/metrics/histograms/metadata/renderer4/histograms.xml index 435326d..e979314 100644 --- a/tools/metrics/histograms/metadata/renderer4/histograms.xml +++ b/tools/metrics/histograms/metadata/renderer4/histograms.xml
@@ -52,7 +52,7 @@ </histogram> <histogram name="Renderer4.GpuImageDecodeState" enum="GpuImageUsageState" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>vmpstr@chromium.org</owner> <owner>thiabaud@google.com</owner> <summary> @@ -115,7 +115,7 @@ </histogram> <histogram name="Renderer4.GpuRasterizationEnabled" enum="BooleanEnabled" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jonross@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -125,7 +125,7 @@ </histogram> <histogram base="true" name="Renderer4.ImageDecodeTaskDurationUs" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <!-- Name completed by histogram_suffixes name="DecodedImageType" --> <!-- Name completed by histogram_suffixes name="OutOfRaster" --> @@ -260,7 +260,7 @@ </histogram> <histogram name="Renderer4.ScrollingThread" enum="ScrollingThreadStatus" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <!-- Name completed by histogram_suffixes name="ScrollSourceDevice" --> <owner>bokan@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/safe_browsing/histograms.xml b/tools/metrics/histograms/metadata/safe_browsing/histograms.xml index e2e9b3d..be499f6 100644 --- a/tools/metrics/histograms/metadata/safe_browsing/histograms.xml +++ b/tools/metrics/histograms/metadata/safe_browsing/histograms.xml
@@ -227,7 +227,7 @@ </histogram> <histogram name="SafeBrowsing.BlockingPage.RequestDestination" - enum="RequestDestination" expires_after="2024-03-17"> + enum="RequestDestination" expires_after="2024-05-19"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -360,7 +360,7 @@ </histogram> <histogram name="SafeBrowsing.CheckUrl.UrlScheme" enum="SafeBrowsingUrlScheme" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>thefrog@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -832,7 +832,7 @@ <histogram name="SafeBrowsing.ExtensionTelemetry.OffstoreExtensionReenabled_PastDisabledReason" - enum="SBExtensionTelemetryDisableReason" expires_after="2024-02-22"> + enum="SBExtensionTelemetryDisableReason" expires_after="2024-05-19"> <owner>richche@google.com</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -977,7 +977,7 @@ </histogram> <histogram name="SafeBrowsing.FileTypeUpdate.ResourceBundleVersion" - units="FileTypePolicies Version" expires_after="2024-03-17"> + units="FileTypePolicies Version" expires_after="2024-05-19"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -1042,7 +1042,7 @@ <histogram name="SafeBrowsing.GmsSafeBrowsingApi.JavaValidationResult{Protocol}" - enum="SafeBrowsingApiJavaValidationResult" expires_after="2024-03-01"> + enum="SafeBrowsingApiJavaValidationResult" expires_after="2024-05-19"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -1366,7 +1366,7 @@ </histogram> <histogram name="SafeBrowsing.HPRT.Network.Result.WhenEnteringBackoff" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2024-03-17"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2024-05-19"> <owner>thefrog@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -1905,7 +1905,7 @@ </histogram> <histogram name="SafeBrowsing.Pref.Daily.Extended" enum="BooleanEnabled" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2030,7 +2030,7 @@ </histogram> <histogram name="SafeBrowsing.RendererThrottle.TotalDelay" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2042,7 +2042,7 @@ </histogram> <histogram name="SafeBrowsing.RendererThrottle.TotalDelay3" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2121,7 +2121,7 @@ </histogram> <histogram name="SafeBrowsing.RT.ConsumerVersionReason" - enum="SafeBrowsingRTConsumerVersionReason" expires_after="2024-03-17"> + enum="SafeBrowsingRTConsumerVersionReason" expires_after="2024-05-19"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2181,7 +2181,7 @@ </histogram> <histogram name="SafeBrowsing.RT.HasTokenFromFetcher" enum="BooleanHasToken" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2345,7 +2345,7 @@ </histogram> <histogram name="SafeBrowsing.RT.RequestDestinations.Checked" - enum="RequestDestination" expires_after="2024-03-17"> + enum="RequestDestination" expires_after="2024-05-19"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2356,7 +2356,7 @@ </histogram> <histogram name="SafeBrowsing.RT.RequestDestinations.Requested" - enum="RequestDestination" expires_after="2024-03-17"> + enum="RequestDestination" expires_after="2024-05-19"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2541,7 +2541,7 @@ </histogram> <histogram name="SafeBrowsing.TailoredSecurityUnconsentedModalOutcome" - enum="SafeBrowsingTailoredSecurityOutcome" expires_after="2024-02-04"> + enum="SafeBrowsingTailoredSecurityOutcome" expires_after="2024-05-19"> <owner>jacastro@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2553,7 +2553,7 @@ <histogram name="SafeBrowsing.TailoredSecurityUnconsentedPromotionNotificationOutcome" - enum="SafeBrowsingTailoredSecurityOutcome" expires_after="2024-03-17"> + enum="SafeBrowsingTailoredSecurityOutcome" expires_after="2024-05-19"> <owner>jacastro@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -3204,7 +3204,7 @@ </histogram> <histogram name="SafeBrowsingBinaryUploadRequest.Duration" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -3215,7 +3215,7 @@ </histogram> <histogram name="SafeBrowsingBinaryUploadRequest.MalwareResult" - enum="BooleanSuccess" expires_after="2024-03-17"> + enum="BooleanSuccess" expires_after="2024-05-19"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -3226,7 +3226,7 @@ </histogram> <histogram name="SafeBrowsingBinaryUploadRequest.Result" - enum="SafeBrowsingBinaryUploadResult" expires_after="2024-03-17"> + enum="SafeBrowsingBinaryUploadResult" expires_after="2024-05-19"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -3237,7 +3237,7 @@ </histogram> <histogram name="SafeBrowsingBinaryUploadRequest.TimeToGetFCMToken" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>drubery@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 6c2ac93..b65bd43 100644 --- a/tools/metrics/histograms/metadata/sb_client/histograms.xml +++ b/tools/metrics/histograms/metadata/sb_client/histograms.xml
@@ -108,7 +108,7 @@ </histogram> <histogram name="SBClientDownload.DownloadExtensions" - enum="SBClientDownloadExtensions" expires_after="2024-03-17"> + enum="SBClientDownloadExtensions" expires_after="2024-05-19"> <owner>vakh@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <owner>mattm@chromium.org</owner> @@ -134,7 +134,7 @@ </histogram> <histogram name="SBClientDownload.DownloadRequestDuration.{Analysis}" - units="ms" expires_after="2024-03-16"> + units="ms" expires_after="2024-05-19"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -504,7 +504,7 @@ </histogram> <histogram name="SBClientPhishing.ClassificationStart" enum="BooleanHit" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -518,7 +518,7 @@ </histogram> <histogram name="SBClientPhishing.Classifier.Event" - enum="SBPhishingClassifierEvent" expires_after="2024-03-17"> + enum="SBPhishingClassifierEvent" expires_after="2024-05-19"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -538,7 +538,7 @@ </histogram> <histogram name="SBClientPhishing.ClassifyThresholdsResult" - enum="SBClientDetectionClassifyThresholdsResult" expires_after="2024-03-17"> + enum="SBClientDetectionClassifyThresholdsResult" expires_after="2024-05-19"> <owner>andysjlim@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -665,7 +665,7 @@ </histogram> <histogram name="SBClientPhishing.OptimizationGuide.ModelFetchTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>andysjlim@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -675,7 +675,7 @@ </histogram> <histogram name="SBClientPhishing.PhishingDetectionDuration" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -710,7 +710,7 @@ <histogram name="SBClientPhishing.PreClassificationCheckResult" enum="SBClientDetectionPreClassificationCheckResult" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>drubery@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/search/histograms.xml b/tools/metrics/histograms/metadata/search/histograms.xml index 4d04c0a..093e26e 100644 --- a/tools/metrics/histograms/metadata/search/histograms.xml +++ b/tools/metrics/histograms/metadata/search/histograms.xml
@@ -274,7 +274,7 @@ </histogram> <histogram name="Search.ContextualSearch.NetError" enum="NetErrorCodes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>donnd@chromium.org</owner> <owner>basiaz@google.com</owner> <summary> @@ -355,7 +355,7 @@ </histogram> <histogram name="Search.ContextualSearch.SelectionExpanded" - enum="ContextualSearchGestureIsTap" expires_after="2024-03-17"> + enum="ContextualSearchGestureIsTap" expires_after="2024-05-19"> <owner>donnd@chromium.org</owner> <owner>twellington@chromium.org</owner> <summary> @@ -957,7 +957,7 @@ </histogram> <histogram name="Search.QueryTiles.TrendingTileEvent" enum="TrendingTileEvent" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>qinmin@chromium.org</owner> <owner>chrome-upboarding-eng@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/security/histograms.xml b/tools/metrics/histograms/metadata/security/histograms.xml index b3141ff..120a749 100644 --- a/tools/metrics/histograms/metadata/security/histograms.xml +++ b/tools/metrics/histograms/metadata/security/histograms.xml
@@ -193,7 +193,7 @@ </histogram> <histogram name="Security.HttpsFirstMode.SettingChanged" enum="BooleanEnabled" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>cthomp@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary> @@ -216,7 +216,7 @@ </histogram> <histogram name="Security.HttpsFirstMode.SettingEnabledAtStartup" - enum="BooleanEnabled" expires_after="2024-03-17"> + enum="BooleanEnabled" expires_after="2024-05-19"> <owner>cthomp@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary> @@ -336,7 +336,7 @@ </histogram> <histogram base="true" name="Security.PageEndReason" enum="PageEndReason" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>cthomp@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary> @@ -407,7 +407,7 @@ </histogram> <histogram name="Security.PageInfo.TimeOpen.Action" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>cthomp@chromium.org</owner> <owner>security-enamel@chromium.org</owner> <summary> @@ -535,7 +535,7 @@ </histogram> <histogram name="Security.SCTAuditing.NumPersistedReportsLoaded" - units="reports" expires_after="2024-03-17"> + units="reports" expires_after="2024-05-19"> <owner>cthomp@chromium.org</owner> <owner>trusty-transport@chromium.org</owner> <summary> @@ -767,7 +767,7 @@ </histogram> <histogram name="SiteIsolation.BrowsingInstanceCount" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>alexmos@chromium.org</owner> <owner>creis@chromium.org</owner> <summary> @@ -776,7 +776,7 @@ </histogram> <histogram name="SiteIsolation.IsolatableSandboxedIframes" units="processes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>wjmaclean@chromium.org</owner> <owner>alexmos@chromium.org</owner> <owner>creis@chromium.org</owner> @@ -795,7 +795,7 @@ </histogram> <histogram name="SiteIsolation.IsolatableSandboxedIframes.UniqueOrigins" - units="processes" expires_after="2024-03-17"> + units="processes" expires_after="2024-05-19"> <owner>wjmaclean@chromium.org</owner> <owner>alexmos@chromium.org</owner> <owner>creis@chromium.org</owner> @@ -810,7 +810,7 @@ </histogram> <histogram name="SiteIsolation.IsolatableSandboxedIframes.UniqueSites" - units="processes" expires_after="2024-03-17"> + units="processes" expires_after="2024-05-19"> <owner>wjmaclean@chromium.org</owner> <owner>alexmos@chromium.org</owner> <owner>creis@chromium.org</owner> @@ -885,7 +885,7 @@ </histogram> <histogram name="SiteIsolation.OutOfProcessInnerFrameTrees" units="frame trees" - expires_after="2024-03-14"> + expires_after="2024-05-19"> <owner>alexmos@chromium.org</owner> <owner>creis@chromium.org</owner> <owner>lukasza@chromium.org</owner> @@ -910,7 +910,7 @@ </histogram> <histogram name="SiteIsolation.ProxyCount" units="proxies" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>alexmos@chromium.org</owner> <owner>creis@chromium.org</owner> <owner>lukasza@chromium.org</owner> @@ -996,7 +996,7 @@ </histogram> <histogram name="SiteIsolation.SiteInstancesPerBrowsingInstance" units="units" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>alexmos@chromium.org</owner> <owner>creis@chromium.org</owner> <owner>lukasza@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/service/histograms.xml b/tools/metrics/histograms/metadata/service/histograms.xml index 6b727e8..cdebe29 100644 --- a/tools/metrics/histograms/metadata/service/histograms.xml +++ b/tools/metrics/histograms/metadata/service/histograms.xml
@@ -1188,7 +1188,7 @@ </histogram> <histogram name="ServiceWorker.RouterEvaluator.Error" - enum="ServiceWorkerRouterEvaluatorErrorEnums" expires_after="2023-12-31"> + enum="ServiceWorkerRouterEvaluatorErrorEnums" expires_after="2024-04-01"> <owner>yyanagisawa@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 f936d58..e266ec2 100644 --- a/tools/metrics/histograms/metadata/session/histograms.xml +++ b/tools/metrics/histograms/metadata/session/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="Session.Background.TotalDuration" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -53,7 +53,7 @@ </histogram> <histogram name="Session.IsActive" enum="BooleanActive" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rogerm@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/settings/histograms.xml b/tools/metrics/histograms/metadata/settings/histograms.xml index 262671f..9f4d2b8 100644 --- a/tools/metrics/histograms/metadata/settings/histograms.xml +++ b/tools/metrics/histograms/metadata/settings/histograms.xml
@@ -131,7 +131,7 @@ </histogram> <histogram name="Settings.Homepage.LocationType" enum="HomepageLocationType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>bttk@chromium.org</owner> <owner>twellington@chromium.org</owner> <owner>wenyufu@chromium.org</owner> @@ -188,7 +188,7 @@ </histogram> <histogram name="Settings.PinUnlockSetup" enum="LockScreenProgress" - expires_after="2024-02-25"> + expires_after="2024-05-19"> <owner>anastasiian@chromium.org</owner> <owner>teresachow@google.com</owner> <owner>cros-lurs@google.com</owner> @@ -290,7 +290,7 @@ </histogram> <histogram name="Settings.PrivacySandbox.AdMeasurement.Enabled" - enum="BooleanEnabled" expires_after="2024-03-17"> + enum="BooleanEnabled" expires_after="2024-05-19"> <owner>sauski@google.com</owner> <owner>olesiamarukhno@chromium.org</owner> <owner>msramek@chromium.org</owner> @@ -375,7 +375,7 @@ </histogram> <histogram name="Settings.PrivacySandbox.Enabled" - enum="SettingsPrivacySandboxEnabled" expires_after="2024-03-17"> + enum="SettingsPrivacySandboxEnabled" expires_after="2024-05-19"> <owner>harrisonsean@chromium.org</owner> <owner>msramek@chromium.org</owner> <owner>chrome-privacy-controls@google.com</owner> @@ -387,7 +387,7 @@ </histogram> <histogram name="Settings.PrivacySandbox.Fledge.Enabled" enum="BooleanEnabled" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sauski@google.com</owner> <owner>olesiamarukhno@chromium.org</owner> <owner>msramek@chromium.org</owner> @@ -889,7 +889,7 @@ </histogram> <histogram name="Settings.TrackedPreferenceChanged" enum="TrackedPreference" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>proberge@chromium.org</owner> <owner>junhao.huang@microsoft.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/sharing/histograms.xml b/tools/metrics/histograms/metadata/sharing/histograms.xml index d72f912..5a78bbe 100644 --- a/tools/metrics/histograms/metadata/sharing/histograms.xml +++ b/tools/metrics/histograms/metadata/sharing/histograms.xml
@@ -151,7 +151,7 @@ </histogram> <histogram name="Sharing.QRCodeGeneration.Duration" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>danakj@chromium.org</owner> <owner>lukasza@chromium.org</owner> <owner>petewil@chromium.org</owner> @@ -170,7 +170,7 @@ </histogram> <histogram name="Sharing.QRCodeGeneration.Duration.BytesToQrPixels2" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>danakj@chromium.org</owner> <owner>lukasza@chromium.org</owner> <owner>petewil@chromium.org</owner> @@ -192,7 +192,7 @@ </histogram> <histogram name="Sharing.QRCodeGeneration.Duration.QrPixelsToQrImage2" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>danakj@chromium.org</owner> <owner>lukasza@chromium.org</owner> <owner>petewil@chromium.org</owner> @@ -270,7 +270,7 @@ </histogram> <histogram name="Sharing.SendTabToSelf.NotificationStatus" - enum="SendTabToSelfNotificationStatus" expires_after="2024-03-17"> + enum="SendTabToSelfNotificationStatus" expires_after="2024-05-19"> <owner>jeffreycohen@chromium.org</owner> <owner>src/chrome/browser/share/OWNERS</owner> <summary> @@ -381,7 +381,7 @@ </histogram> <histogram name="Sharing.SharingHubDesktop.CrOSSharesheetResult" - enum="SharingHubSharesheetResult" expires_after="2024-03-17"> + enum="SharingHubSharesheetResult" expires_after="2024-05-19"> <owner>tsergeant@chromium.org</owner> <owner>src/chrome/browser/share/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/signin/histograms.xml b/tools/metrics/histograms/metadata/signin/histograms.xml index 87ff9a95..294c601a 100644 --- a/tools/metrics/histograms/metadata/signin/histograms.xml +++ b/tools/metrics/histograms/metadata/signin/histograms.xml
@@ -277,7 +277,7 @@ </histogram> <histogram name="Signin.AccountFetcher.AccountUserInfoFetchTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>triploblastic@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> <summary> @@ -434,7 +434,7 @@ </histogram> <histogram base="true" name="Signin.AndroidGetAccountsTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>alexilin@chromium.org</owner> <owner>bsazonov@chromium.org</owner> <summary> @@ -454,7 +454,7 @@ </histogram> <histogram name="Signin.AndroidNumberOfDeviceAccounts" units="accounts" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>triploblastic@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> <summary> @@ -463,7 +463,7 @@ </histogram> <histogram name="Signin.AuthError" enum="GoogleServiceAuthError" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>msarda@chromium.org</owner> <owner>droger@chromium.org</owner> <summary> @@ -764,7 +764,7 @@ </histogram> <histogram name="Signin.Extensions.LaunchWebAuthFlowResult" - enum="LaunchWebAuthFlowResult" expires_after="2024-03-17"> + enum="LaunchWebAuthFlowResult" expires_after="2024-05-19"> <owner>alexilin@chromium.org</owner> <owner>rsult@google.com</owner> <owner>chrome-signin-team@google.com</owner> @@ -1242,7 +1242,7 @@ </histogram> <histogram name="Signin.OAuth2MintToken.ApiCallResult" - enum="OAuth2MintTokenApiCallResult" expires_after="2024-03-17"> + enum="OAuth2MintTokenApiCallResult" expires_after="2024-05-19"> <owner>alexilin@chromium.org</owner> <owner>droger@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/stability/histograms.xml b/tools/metrics/histograms/metadata/stability/histograms.xml index ccee73b7..c5507e4 100644 --- a/tools/metrics/histograms/metadata/stability/histograms.xml +++ b/tools/metrics/histograms/metadata/stability/histograms.xml
@@ -63,7 +63,7 @@ </histogram> <histogram name="Stability.Android.RendererCrash" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>wnwen@chromium.org</owner> <summary> Counts renderer crashes including OOMs. Android only. Mirrors old stability
diff --git a/tools/metrics/histograms/metadata/start_surface/histograms.xml b/tools/metrics/histograms/metadata/start_surface/histograms.xml index c7a435a1..9bb1c3d 100644 --- a/tools/metrics/histograms/metadata/start_surface/histograms.xml +++ b/tools/metrics/histograms/metadata/start_surface/histograms.xml
@@ -34,7 +34,7 @@ </histogram> <histogram name="StartSurface.Module.Click" enum="ModuleTypeOnStartAndNTP" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>hanxi@chromium.org</owner> <owner>xinyiji@chromium.org</owner> <summary> @@ -57,7 +57,7 @@ </histogram> <histogram name="StartSurface.Show.State" enum="StartSurfaceState" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>hanxi@chromium.org</owner> <owner>xinyiji@chromium.org</owner> <summary> @@ -71,7 +71,7 @@ </histogram> <histogram name="StartSurface.SpareTab.TimeBetweenShowAndCreate" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sreejakshetty@chromium.org</owner> <owner>hanxi@chromium.org</owner> <summary> @@ -81,7 +81,7 @@ </summary> </histogram> -<histogram name="StartSurface.TimeSpent" units="ms" expires_after="2024-03-17"> +<histogram name="StartSurface.TimeSpent" units="ms" expires_after="2024-05-19"> <owner>hanxi@chromium.org</owner> <owner>xinyiji@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/startup/histograms.xml b/tools/metrics/histograms/metadata/startup/histograms.xml index 8aa8497..2919eed 100644 --- a/tools/metrics/histograms/metadata/startup/histograms.xml +++ b/tools/metrics/histograms/metadata/startup/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="Startup.AfterStartupTaskCount" units="units" - expires_after="2024-03-14"> + expires_after="2024-05-19"> <owner>michaeln@chromium.org</owner> <summary> The number of after-startup tasks that were queued prior to startup @@ -32,7 +32,7 @@ </histogram> <histogram name="Startup.AfterStartupTaskDelayedUntilTime" units="ms" - expires_after="2024-03-14"> + expires_after="2024-05-19"> <owner>michaeln@chromium.org</owner> <summary> Time from the process creation until deferred after-startup tasks began @@ -94,7 +94,7 @@ </histogram> <histogram name="Startup.Android.Cold.FirstSafeBrowsingApiResponseTime.Tabbed" - units="ms" expires_after="2024-03-18"> + units="ms" expires_after="2024-05-19"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -545,7 +545,7 @@ </histogram> <histogram name="Startup.BrowserMainRunnerImplInitializeLongTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>robliao@chromium.org</owner> <summary> The amount of time that elapsed during BrowserMainRunnerImpl::Initialize. @@ -553,7 +553,7 @@ </histogram> <histogram name="Startup.BrowserMessageLoopFirstIdle" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>gab@chromium.org</owner> <owner>etienneb@chromium.org</owner> <summary> @@ -638,7 +638,7 @@ </histogram> <histogram name="Startup.BrowserWindow.FirstPaint" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>gab@chromium.org</owner> <owner>mblsha@yandex-team.ru</owner> <summary> @@ -1071,7 +1071,7 @@ </histogram> <histogram name="Startup.Temperature" enum="StartupTemperature" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <!-- expires-after: Diagnosis metric for changes in StartupTemperature suffix. Shouldn't truly expire but kColdStartHardFaultCountThreshold should be surveyed yearly. -->
diff --git a/tools/metrics/histograms/metadata/subresource/histograms.xml b/tools/metrics/histograms/metadata/subresource/histograms.xml index f922661c..1601e9dc 100644 --- a/tools/metrics/histograms/metadata/subresource/histograms.xml +++ b/tools/metrics/histograms/metadata/subresource/histograms.xml
@@ -86,7 +86,7 @@ </histogram> <histogram name="SubresourceFilter.DocumentLoad.SubframeFilteringDelay.Allowed" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>alexmt@chromium.org</owner> <owner>chrome-ads-histograms@google.com</owner> <summary> @@ -200,7 +200,7 @@ </histogram> <histogram name="SubresourceFilter.IndexRuleset.Verify.Status" - enum="SubresourceFilterVerifyStatus" expires_after="2024-03-17"> + enum="SubresourceFilterVerifyStatus" expires_after="2024-05-19"> <owner>alexmt@chromium.org</owner> <owner>chrome-ads-histograms@google.com</owner> <summary> @@ -435,7 +435,7 @@ </histogram> <histogram name="SubresourceFilter.SafeBrowsing.TotalCheckTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>alexmt@chromium.org</owner> <owner>chrome-ads-histograms@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/sync/histograms.xml b/tools/metrics/histograms/metadata/sync/histograms.xml index c5a901a..8b063248 100644 --- a/tools/metrics/histograms/metadata/sync/histograms.xml +++ b/tools/metrics/histograms/metadata/sync/histograms.xml
@@ -113,7 +113,7 @@ </variants> <histogram name="Sync.BackedOffModelType" enum="SyncModelTypes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>victorvianna@google.com</owner> <owner>src/components/sync/OWNERS</owner> <component>Services>Sync</component> @@ -327,7 +327,7 @@ </histogram> <histogram name="Sync.ConfigureDataTypes" enum="SyncModelTypes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mastiz@chromium.org</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component> @@ -361,7 +361,7 @@ </histogram> <histogram name="Sync.CrossUserSharingPublicPrivateKeyInitializedOnStartup" - enum="Boolean" expires_after="2024-03-17"> + enum="Boolean" expires_after="2024-05-19"> <owner>rushans@google.com</owner> <owner>mmoskvitin@google.com</owner> <component>Services>Sync</component> @@ -372,7 +372,7 @@ </histogram> <histogram name="Sync.CrossUserSharingPublicPrivateKeyInitSuccess" - enum="Boolean" expires_after="2024-03-17"> + enum="Boolean" expires_after="2024-05-19"> <owner>eliaskh@chromium.org</owner> <owner>rushans@google.com</owner> <component>Services>Sync</component> @@ -462,7 +462,7 @@ </histogram> <histogram name="Sync.CustomSync3" enum="SyncModelTypes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>treib@chromium.org</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -496,7 +496,7 @@ </histogram> <histogram name="Sync.DataTypeRunFailures2" enum="SyncModelTypes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rushans@google.com</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -509,7 +509,7 @@ </histogram> <histogram name="Sync.DataTypeStartFailures2" enum="SyncModelTypes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rushans@google.com</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -671,7 +671,7 @@ </histogram> <histogram name="Sync.InitialState2" enum="SyncInitialState" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>treib@chromium.org</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -915,7 +915,7 @@ </histogram> <histogram name="Sync.ModelTypeEntityMetadataWithoutInitialSync" - enum="SyncModelTypes" expires_after="2024-03-17"> + enum="SyncModelTypes" expires_after="2024-05-19"> <owner>mastiz@chromium.org</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component> @@ -1159,7 +1159,7 @@ </histogram> <histogram name="Sync.PassphraseType" enum="SyncPassphraseType" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>treib@chromium.org</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -1177,7 +1177,7 @@ </histogram> <histogram name="Sync.PassphraseTypeUponNotMyBirthdayOrEncryptionObsolete" - enum="SyncPassphraseType" expires_after="2024-03-17"> + enum="SyncPassphraseType" expires_after="2024-05-19"> <owner>mastiz@chromium.org</owner> <owner>mmoskvitin@google.com</owner> <component>Services>Sync</component> @@ -1214,7 +1214,7 @@ </histogram> <histogram name="Sync.PendingInvalidationStatus" - enum="PendingInvalidationStatus" expires_after="2024-03-17"> + enum="PendingInvalidationStatus" expires_after="2024-05-19"> <owner>shabdan@google.com</owner> <owner>rushans@google.com</owner> <component>Services>Sync</component> @@ -1648,7 +1648,7 @@ </histogram> <histogram name="Sync.TrustedVaultDegradedRecoverabilityValue2" - enum="TrustedVaultDegradedRecoverabilityValue" expires_after="2024-03-17"> + enum="TrustedVaultDegradedRecoverabilityValue" expires_after="2024-05-19"> <owner>mmrashad@google.com</owner> <owner>mmoskvitin@google.com</owner> <component>Services>Sync</component> @@ -1733,7 +1733,7 @@ <histogram name="Sync.TrustedVaultErrorShownOnStartup{TrustedVaultTimeSinceMigrationSuffix}" - enum="Boolean" expires_after="2024-03-17"> + enum="Boolean" expires_after="2024-05-19"> <owner>mmoskvitin@google.com</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -1907,7 +1907,7 @@ <histogram name="Sync.TrustedVaultRecoverabilityDegradedOnStartup{TrustedVaultTimeSinceMigrationSuffix}" - enum="Boolean" expires_after="2024-03-17"> + enum="Boolean" expires_after="2024-05-19"> <owner>mmoskvitin@google.com</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -2007,7 +2007,7 @@ </histogram> <histogram name="Sync.URLFetchTimedOut" enum="BooleanTimedOut" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mastiz@chromium.org</owner> <owner>treib@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 7293c2f..8338cfa 100644 --- a/tools/metrics/histograms/metadata/tab/histograms.xml +++ b/tools/metrics/histograms/metadata/tab/histograms.xml
@@ -161,7 +161,7 @@ </token> </histogram> -<histogram name="Tab.Count.Guest" units="units" expires_after="2024-03-17"> +<histogram name="Tab.Count.Guest" units="units" expires_after="2024-05-19"> <owner>rhalavati@chromium.org</owner> <owner>chrome-incognito@google.com</owner> <summary> @@ -177,7 +177,7 @@ </summary> </histogram> -<histogram name="Tab.Count.Incognito" units="units" expires_after="2024-03-17"> +<histogram name="Tab.Count.Incognito" units="units" expires_after="2024-05-19"> <owner>rhalavati@chromium.org</owner> <owner>chrome-incognito@google.com</owner> <summary> @@ -263,7 +263,7 @@ </histogram> <histogram name="Tab.PerceivedRestoreTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ckitagawa@chromium.org</owner> <owner>dtrainor@chromium.org</owner> <owner>yfriedman@chromium.org</owner> @@ -376,7 +376,7 @@ </histogram> <histogram name="Tab.StatusWhenSwitchedBackToForeground" enum="TabStatus" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ckitagawa@chromium.org</owner> <owner>marq@chromium.org</owner> <summary> @@ -556,7 +556,7 @@ </histogram> <histogram name="TabGroups.UserCustomizedGroupCountPerLoad" units="groups" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dpenning@chromium.org</owner> <owner>chrome-desktop-ui-sea@google.com</owner> <summary> @@ -586,7 +586,7 @@ </histogram> <histogram name="TabGroups.UserPinnedTabCountPerLoad" units="tabs" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dpenning@chromium.org</owner> <owner>chrome-desktop-ui-sea@google.com</owner> <summary> @@ -694,7 +694,7 @@ </histogram> <histogram name="TabManager.Discarding.InactiveToReloadTime" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>chrisha@chromium.org</owner> <owner>catan-team@chromium.org</owner> <summary> @@ -797,7 +797,7 @@ </summary> </histogram> -<histogram name="Tabs.CountAtResume" units="tabs" expires_after="2024-03-17"> +<histogram name="Tabs.CountAtResume" units="tabs" expires_after="2024-05-19"> <!-- This histogram was expired between 2022-11-02 and M111 --> <owner>marq@chromium.org</owner> @@ -807,7 +807,7 @@ </summary> </histogram> -<histogram name="Tabs.CountAtStartup" units="tabs" expires_after="2024-03-17"> +<histogram name="Tabs.CountAtStartup" units="tabs" expires_after="2024-05-19"> <owner>marq@chromium.org</owner> <owner>chromeleon@google.com</owner> <summary>[Android and iOS] The number of tabs opened at cold launch.</summary> @@ -843,7 +843,7 @@ </histogram> <histogram name="Tabs.DuplicatesCountAtStartup" units="tabs" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ewannpv@chromium.org</owner> <owner>lpromero@google.com</owner> <owner>chromeleon@google.com</owner> @@ -1277,7 +1277,7 @@ </histogram> <histogram name="Tabs.RestoreTabStateException" enum="RestoreTabStateException" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ckitagawa@chromium.org</owner> <owner>fredmello@chromium.org</owner> <summary> @@ -1290,7 +1290,7 @@ </histogram> <histogram name="Tabs.SadTab.Feedback.Event" enum="SadTabEvent" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sonnyrao@chromium.org</owner> <owner>jamescook@chromium.org</owner> <summary> @@ -1301,7 +1301,7 @@ </histogram> <histogram name="Tabs.SadTab.Reload.Event" enum="SadTabEvent" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>sonnyrao@chromium.org</owner> <owner>jamescook@chromium.org</owner> <summary> @@ -1493,7 +1493,7 @@ </token> </histogram> -<histogram name="Tabs.TabCountPerLoad" units="tabs" expires_after="2024-03-17"> +<histogram name="Tabs.TabCountPerLoad" units="tabs" expires_after="2024-05-19"> <owner>mpearson@chromium.org</owner> <owner>chrome-desktop-ui-sea@google.com</owner> <owner>sbirch@google.com</owner> @@ -1506,7 +1506,7 @@ </histogram> <histogram name="Tabs.TabCountPerWindow" units="tabs" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mpearson@chromium.org</owner> <owner>chrome-desktop-ui-sea@google.com</owner> <summary> @@ -1554,7 +1554,7 @@ </histogram> <histogram name="Tabs.TabRestoreMethod" enum="TabRestoreMethod" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>davidjm@chromium.org</owner> <owner>dtrainor@chromium.org</owner> <owner>nyquist@chromium.org</owner> @@ -2038,7 +2038,7 @@ </histogram> <histogram name="Tabs.TimeSinceCreationAtStartup" enum="IOSAllOpenTabsAge" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ewannpv@chromium.org</owner> <owner>chromeleon@google.com</owner> <summary> @@ -2048,7 +2048,7 @@ </histogram> <histogram name="Tabs.UnusedCountAtStartup" units="tabs" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>ewannpv@chromium.org</owner> <owner>chromeleon@google.com</owner> <summary> @@ -2069,7 +2069,7 @@ <token key="BatteryState" variants="BatteryState"/> </histogram> -<histogram name="Tabs.WindowWidth" units="DIPs" expires_after="2024-03-17"> +<histogram name="Tabs.WindowWidth" units="DIPs" expires_after="2024-05-19"> <owner>collinbaker@chromium.org</owner> <owner>chrome-desktop-ui-sea@google.com</owner> <summary> @@ -2170,7 +2170,7 @@ </histogram> <histogram name="TabStrip.TabCountOnPageLoad" units="tabs" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>yusufo@chromium.org</owner> <owner>wychen@chromium.org</owner> <summary> @@ -2182,7 +2182,7 @@ </histogram> <histogram name="TabStrip.TimeToCreateNewTabFromPress" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>robliao@chromium.org</owner> <owner>chrome-desktop-ui-sea@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/ukm/histograms.xml b/tools/metrics/histograms/metadata/ukm/histograms.xml index 9713209..a7bdb0a1 100644 --- a/tools/metrics/histograms/metadata/ukm/histograms.xml +++ b/tools/metrics/histograms/metadata/ukm/histograms.xml
@@ -91,7 +91,7 @@ </histogram> <histogram name="UKM.Entries.Dropped.ByEntryHash" enum="UkmEventNameHash" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jwd@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -103,7 +103,7 @@ </histogram> <histogram name="UKM.Entries.Dropped.MaxHit.ByEntryHash" - enum="UkmEventNameHash" expires_after="2024-03-17"> + enum="UkmEventNameHash" expires_after="2024-05-19"> <owner>lucnguyen@google.com</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -128,7 +128,7 @@ </histogram> <histogram name="UKM.Entries.Dropped.SampledOut.ByEntryHash" - enum="UkmEventNameHash" expires_after="2024-03-17"> + enum="UkmEventNameHash" expires_after="2024-05-19"> <owner>lucnguyen@google.com</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -159,7 +159,7 @@ </histogram> <histogram name="UKM.Entries.SerializedCountFCP" units="entries" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rkaplow@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -302,7 +302,7 @@ </histogram> <histogram name="UKM.Sources.Dropped" enum="UkmDataDroppedReason" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rkaplow@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -361,7 +361,7 @@ </histogram> <histogram name="UKM.UnsentLogs.DroppedSize" units="bytes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>rkaplow@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/uma/histograms.xml b/tools/metrics/histograms/metadata/uma/histograms.xml index d9c703a..48575f46 100644 --- a/tools/metrics/histograms/metadata/uma/histograms.xml +++ b/tools/metrics/histograms/metadata/uma/histograms.xml
@@ -352,7 +352,7 @@ </histogram> <histogram name="UMA.IsClonedInstall" enum="BooleanCloned" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -935,7 +935,7 @@ </histogram> <histogram name="UMA.TruncatedEvents.UserAction" units="events" - expires_after="2024-05-12"> + expires_after="2024-05-19"> <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 54aed5023..a8f5424 100644 --- a/tools/metrics/histograms/metadata/v8/histograms.xml +++ b/tools/metrics/histograms/metadata/v8/histograms.xml
@@ -350,7 +350,7 @@ </histogram> <histogram name="V8.CompileSerializeMicroSeconds" units="microseconds" - expires_after="2024-03-14"> + expires_after="2024-05-19"> <owner>jgruber@chromium.org</owner> <owner>leszeks@chromium.org</owner> <summary> @@ -388,7 +388,7 @@ </histogram> <histogram name="V8.ExecuteMicroSeconds" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>cbruni@chromium.org</owner> <owner>v8-runtime@google.com</owner> <summary> @@ -1332,7 +1332,7 @@ </histogram> <histogram name="V8.SnapshotDeserializeContextMicroSeconds" - units="microseconds" expires_after="2024-03-14"> + units="microseconds" expires_after="2024-05-19"> <owner>jgruber@chromium.org</owner> <owner>leszeks@chromium.org</owner> <summary> @@ -1347,7 +1347,7 @@ </histogram> <histogram name="V8.SnapshotDeserializeIsolateMicroSeconds" - units="microseconds" expires_after="2024-03-14"> + units="microseconds" expires_after="2024-05-19"> <owner>jgruber@chromium.org</owner> <owner>leszeks@chromium.org</owner> <summary> @@ -1403,7 +1403,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeExecute" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tebbi@chromium.org</owner> <owner>mslekova@chromium.org</owner> <summary> @@ -1415,7 +1415,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeFinalize" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tebbi@chromium.org</owner> <owner>mslekova@chromium.org</owner> <summary> @@ -1427,7 +1427,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeForOnStackReplacementExecute" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>tebbi@chromium.org</owner> <owner>mslekova@chromium.org</owner> <summary> @@ -1440,7 +1440,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeForOnStackReplacementFinalize" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>tebbi@chromium.org</owner> <owner>mslekova@chromium.org</owner> <summary> @@ -1453,7 +1453,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeForOnStackReplacementPrepare" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>tebbi@chromium.org</owner> <owner>mslekova@chromium.org</owner> <summary> @@ -1466,7 +1466,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeForOnStackReplacementTotalTime" - units="microseconds" expires_after="2024-03-17"> + units="microseconds" expires_after="2024-05-19"> <owner>tebbi@chromium.org</owner> <owner>mslekova@chromium.org</owner> <summary> @@ -1491,7 +1491,7 @@ </histogram> <histogram name="V8.TurboFanOptimizePrepare" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>tebbi@chromium.org</owner> <owner>mslekova@chromium.org</owner> <summary> @@ -1652,7 +1652,7 @@ </histogram> <histogram name="V8.WasmCompileHugeFunctionMilliSeconds" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>clemensb@chromium.org</owner> <owner>ecmziegler@chromium.org</owner> <owner>wasm-v8@google.com</owner> @@ -1664,7 +1664,7 @@ </histogram> <histogram name="V8.WasmCompileHugeFunctionPeakMemoryBytes" units="bytes" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>clemensb@chromium.org</owner> <owner>ecmziegler@chromium.org</owner> <owner>wasm-v8@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/variations/histograms.xml b/tools/metrics/histograms/metadata/variations/histograms.xml index 02aaa0a9..ef1f8c8 100644 --- a/tools/metrics/histograms/metadata/variations/histograms.xml +++ b/tools/metrics/histograms/metadata/variations/histograms.xml
@@ -225,7 +225,7 @@ </histogram> <histogram name="Variations.Headers.HasLowEntropySourceValue" - enum="BooleanPresent" expires_after="2024-03-17"> + enum="BooleanPresent" expires_after="2024-05-19"> <owner>mpearson@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -394,7 +394,7 @@ </histogram> <histogram name="Variations.SafeMode.StoreSafeSeed.Result" - enum="VariationsSeedStoreResult" expires_after="2024-03-17"> + enum="VariationsSeedStoreResult" expires_after="2024-05-19"> <owner>isherman@chromium.org</owner> <owner>asvitkine@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 048b55b6..37c00d2d 100644 --- a/tools/metrics/histograms/metadata/web_apk/histograms.xml +++ b/tools/metrics/histograms/metadata/web_apk/histograms.xml
@@ -124,7 +124,7 @@ </histogram> <histogram name="WebApk.Install.InstallEvent" enum="WebApkInstallEvent" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>hartmanng@chromium.org</owner> <owner>src/chrome/android/webapk/OWNERS</owner> <summary> @@ -158,7 +158,7 @@ </histogram> <histogram name="WebApk.Install.PathToInstall" enum="PwaInstallPath" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>finnur@chromium.org</owner> <owner>peter@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 632f409..32dd2109 100644 --- a/tools/metrics/histograms/metadata/web_audio/histograms.xml +++ b/tools/metrics/histograms/metadata/web_audio/histograms.xml
@@ -80,7 +80,7 @@ </histogram> <histogram name="WebAudio.AudioContext.HardwareSampleRate" units="Hz" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mjwilson@chromium.org</owner> <owner>hongchan@chromium.org</owner> <owner>src/third_party/blink/renderer/modules/webaudio/OWNERS</owner> @@ -297,7 +297,7 @@ </histogram> <histogram name="WebAudio.PushPullFIFO.UnderflowGlitches" enum="Boolean" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mjwilson@chromium.org</owner> <owner>hongchan@chromium.org</owner> <owner>src/third_party/blink/renderer/modules/webaudio/OWNERS</owner> @@ -309,7 +309,7 @@ </histogram> <histogram name="WebAudio.PushPullFIFO.UnderflowPercentage" units="%" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>mjwilson@chromium.org</owner> <owner>hongchan@chromium.org</owner> <owner>src/third_party/blink/renderer/modules/webaudio/OWNERS</owner>
diff --git a/tools/metrics/histograms/metadata/web_core/histograms.xml b/tools/metrics/histograms/metadata/web_core/histograms.xml index 3e6dc9cf..7fb92b2 100644 --- a/tools/metrics/histograms/metadata/web_core/histograms.xml +++ b/tools/metrics/histograms/metadata/web_core/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="WebCore.DistillabilityUs" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>wychen@chromium.org</owner> <owner>gilmanmh@google.com</owner> <summary> @@ -60,7 +60,7 @@ </histogram> <histogram name="WebCore.FindInPage.DurationBetweenKeystrokes" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>jarhar@chromium.org</owner> <owner>vmpstr@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/web_rtc/histograms.xml b/tools/metrics/histograms/metadata/web_rtc/histograms.xml index b000c386..dfbb8c9 100644 --- a/tools/metrics/histograms/metadata/web_rtc/histograms.xml +++ b/tools/metrics/histograms/metadata/web_rtc/histograms.xml
@@ -242,7 +242,7 @@ </histogram> <histogram name="WebRTC.Audio.ApmCaptureInputLevelAverageRms" - units="dBFS (negated)" expires_after="2024-03-17"> + units="dBFS (negated)" expires_after="2024-05-19"> <owner>hlundin@chromium.org</owner> <owner>webrtc-audio-uma@google.com</owner> <summary> @@ -255,7 +255,7 @@ </histogram> <histogram name="WebRTC.Audio.ApmCaptureInputLevelPeakRms" - units="dBFS (negated)" expires_after="2024-03-17"> + units="dBFS (negated)" expires_after="2024-05-19"> <owner>hlundin@chromium.org</owner> <owner>webrtc-audio-uma@google.com</owner> <summary> @@ -685,7 +685,7 @@ </histogram> <histogram name="WebRTC.Audio.TargetJitterBufferDelayMs" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>hlundin@chromium.org</owner> <owner>webrtc-audio-uma@google.com</owner> <summary> @@ -763,14 +763,14 @@ </histogram> <histogram name="WebRTC.BWE.InitiallyLostPackets" units="packets" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>holmer@chromium.org</owner> <summary> The number of video packets lost durig the first 2 seconds in a WebRTC call. </summary> </histogram> -<histogram name="WebRTC.BWE.InitialRtt" units="ms" expires_after="2024-03-17"> +<histogram name="WebRTC.BWE.InitialRtt" units="ms" expires_after="2024-05-19"> <owner>holmer@chromium.org</owner> <summary> The round-trip time as measured 2 seconds into a WebRTC call. @@ -778,7 +778,7 @@ </histogram> <histogram name="WebRTC.BWE.InitialVsConvergedDiff" units="kbps" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>holmer@chromium.org</owner> <summary> The difference between the bandwidth estimate at 2 seconds and 20 seconds @@ -829,7 +829,7 @@ </histogram> <histogram name="WebRTC.Call.AudioBitrateReceivedInKbps" units="kbps" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>holmer@chromium.org</owner> <summary> Average audio bitrate received during a call, counted from first packet @@ -859,7 +859,7 @@ </histogram> <histogram name="WebRTC.Call.LifetimeInSeconds" units="seconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>asapersson@chromium.org</owner> <summary> The lifetime of a call. Recorded when a Call instance is destroyed. @@ -877,7 +877,7 @@ </histogram> <histogram name="WebRTC.Call.RtcpBitrateReceivedInBps" units="bits/s" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>holmer@chromium.org</owner> <summary> Average RTCP bitrate received during a call, counted from first packet @@ -1259,7 +1259,7 @@ </histogram> <histogram name="WebRTC.PeerConnection.Duration.Signaling" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>handellm@chromium.org</owner> <owner>webrtc-dev@chromium.org</owner> <summary> @@ -1373,7 +1373,7 @@ </histogram> <histogram name="WebRTC.PeerConnection.Latency.Worker" units="microseconds" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>handellm@chromium.org</owner> <owner>webrtc-dev@chromium.org</owner> <summary> @@ -3670,7 +3670,7 @@ </histogram> <histogram name="WebRTC.webkitApiCount" enum="RTCAPIName" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>toprice@chromium.org</owner> <owner>hbos@chromium.org</owner> <owner>mcasas@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/webapps/histograms.xml b/tools/metrics/histograms/metadata/webapps/histograms.xml index 540792a..de3ccd1 100644 --- a/tools/metrics/histograms/metadata/webapps/histograms.xml +++ b/tools/metrics/histograms/metadata/webapps/histograms.xml
@@ -133,7 +133,7 @@ </histogram> <histogram name="Launch.HomeScreen" enum="LaunchFromHomeScreen" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dominickn@chromium.org</owner> <owner>hartmanng@chromium.org</owner> <owner>peconn@chromium.org</owner> @@ -143,7 +143,7 @@ </histogram> <histogram name="Launch.HomeScreenSource" enum="LaunchFromHomeScreenSource" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dominickn@chromium.org</owner> <owner>hartmanng@chromium.org</owner> <owner>peconn@chromium.org</owner> @@ -181,7 +181,7 @@ </histogram> <histogram name="Launch.WebAppLaunchHandlerClientMode" - enum="WebAppLaunchHandlerClientMode" expires_after="2024-03-17"> + enum="WebAppLaunchHandlerClientMode" expires_after="2024-05-19"> <owner>alancutter@chromium.org</owner> <owner>desktop-pwas-team@google.com</owner> <summary> @@ -351,7 +351,7 @@ </histogram> <histogram name="Webapp.CheckServiceWorker.Time" units="ms" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>asamidoi@chromium.org</owner> <owner>chrome-worker@google.com</owner> <summary> @@ -375,7 +375,7 @@ </histogram> <histogram name="WebApp.DedupeInstallUrls.AppsDeduped" units="apps" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>alancutter@chromium.org</owner> <owner>desktop-pwas-team@google.com</owner> <summary> @@ -387,7 +387,7 @@ </histogram> <histogram name="WebApp.DedupeInstallUrls.InstallUrlsDeduped" - units="install URLs" expires_after="2024-03-17"> + units="install URLs" expires_after="2024-05-19"> <owner>alancutter@chromium.org</owner> <owner>desktop-pwas-team@google.com</owner> <summary> @@ -399,7 +399,7 @@ </histogram> <histogram name="WebApp.DedupeInstallUrls.SessionRunCount" units="runs" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>alancutter@chromium.org</owner> <owner>desktop-pwas-team@google.com</owner> <summary> @@ -439,7 +439,7 @@ </histogram> <histogram base="true" name="WebApp.Engagement" - enum="SiteEngagementServiceEngagementType" expires_after="2024-03-17"> + enum="SiteEngagementServiceEngagementType" expires_after="2024-05-19"> <owner>mgiuca@chromium.org</owner> <owner>desktop-pwas-team@google.com</owner> <summary> @@ -978,7 +978,7 @@ </histogram> <histogram name="WebApp.LaunchSource" enum="LaunchSource" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>phillis@chromium.org</owner> <owner>desktop-pwas-team@google.com</owner> <summary> @@ -1398,14 +1398,14 @@ </histogram> <histogram name="WebApp.ShortcutsMenuRegistration.Result" enum="BooleanSuccess" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dibyapal@chromium.org</owner> <owner>desktop-pwas-team@google.com</owner> <summary>Records the result of shortcuts menu registration for PWAs.</summary> </histogram> <histogram name="WebApp.ShortcutsMenuUnregistered.Result" enum="BooleanSuccess" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>dibyapal@chromium.org</owner> <owner>desktop-pwas-team@google.com</owner> <summary> @@ -1451,7 +1451,7 @@ </histogram> <histogram name="Webapp.SystemApps.IconsAreHealthyInSession" - enum="BooleanSuccess" expires_after="2024-03-17"> + enum="BooleanSuccess" expires_after="2024-05-19"> <owner>qjw@chromium.org</owner> <owner>dominicschulz@chromium.org</owner> <summary> @@ -1462,7 +1462,7 @@ </histogram> <histogram name="Webapp.SystemApps.IconsFixedOnReinstall" enum="BooleanSuccess" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>qjw@chromium.org</owner> <owner>clamclamyan@google.com</owner> <owner>dominicschulz@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/webauthn/histograms.xml b/tools/metrics/histograms/metadata/webauthn/histograms.xml index 8f6fe58..585d5c6 100644 --- a/tools/metrics/histograms/metadata/webauthn/histograms.xml +++ b/tools/metrics/histograms/metadata/webauthn/histograms.xml
@@ -176,7 +176,7 @@ </histogram> <histogram name="WebAuthentication.ConditionalUiPasskeyCount" units="passkeys" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>kenrb@chromium.org</owner> <owner>nsatragno@chromium.org</owner> <owner>chrome-webauthn@google.com</owner> @@ -193,7 +193,7 @@ </histogram> <histogram name="WebAuthentication.GetAssertionRequestTransport" - enum="WebAuthenticationFidoTransport" expires_after="2024-03-17"> + enum="WebAuthenticationFidoTransport" expires_after="2024-05-19"> <owner>kenrb@chromium.org</owner> <owner>martinkr@google.com</owner> <summary> @@ -204,7 +204,7 @@ </histogram> <histogram name="WebAuthentication.GetAssertionResponseTransport" - enum="WebAuthenticationFidoTransport" expires_after="2024-03-17"> + enum="WebAuthenticationFidoTransport" expires_after="2024-05-19"> <owner>kenrb@chromium.org</owner> <owner>martinkr@google.com</owner> <summary> @@ -247,7 +247,7 @@ </histogram> <histogram name="WebAuthentication.MakeCredentialResponseTransport" - enum="WebAuthenticationFidoTransport" expires_after="2024-03-17"> + enum="WebAuthenticationFidoTransport" expires_after="2024-05-19"> <owner>kenrb@chromium.org</owner> <owner>martinkr@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/windows/histograms.xml b/tools/metrics/histograms/metadata/windows/histograms.xml index 6717c9eb..1a4d21e 100644 --- a/tools/metrics/histograms/metadata/windows/histograms.xml +++ b/tools/metrics/histograms/metadata/windows/histograms.xml
@@ -91,7 +91,7 @@ </histogram> <histogram name="Windows.HighResolutionTimerUsage" units="%" - expires_after="2024-03-17"> + expires_after="2024-05-19"> <owner>olivierli@chromium.org</owner> <owner>catan-team@chromium.org</owner> <summary>
diff --git a/ui/base/ime/win/input_method_win_imm32.cc b/ui/base/ime/win/input_method_win_imm32.cc index 23149743..0aa096d 100644 --- a/ui/base/ime/win/input_method_win_imm32.cc +++ b/ui/base/ime/win/input_method_win_imm32.cc
@@ -10,7 +10,6 @@ #include "base/auto_reset.h" #include "base/command_line.h" #include "base/functional/bind.h" -#include "base/metrics/histogram_macros.h" #include "ui/base/ime/text_input_client.h" #include "ui/base/ime/win/tsf_input_scope.h" #include "ui/display/win/screen_win.h" @@ -203,8 +202,6 @@ composing_window_handle_ = window_handle; imm32_manager_.CreateImeWindow(window_handle); imm32_manager_.ResetComposition(window_handle); - UMA_HISTOGRAM_BOOLEAN("InputMethod.CompositionWithImm32BasedIme", - imm32_manager_.IsImm32ImeActive()); return 0; }
diff --git a/ui/chromeos/styles/cros_ref_colors.json5 b/ui/chromeos/styles/cros_ref_colors.json5 index f670b6eb..52a58444 100644 --- a/ui/chromeos/styles/cros_ref_colors.json5 +++ b/ui/chromeos/styles/cros_ref_colors.json5
@@ -83,6 +83,7 @@ neutral0: '#000000', neutral8: '#161818', neutral10: '#1f1f1f', + neutral15: '#282828', neutral20: '#303030', neutral25: '#3c3c3c', neutral30: '#474747',
diff --git a/ui/file_manager/file_manager/foreground/js/ui/actions_submenu.js b/ui/file_manager/file_manager/foreground/js/ui/actions_submenu.js index dfde328..8c31163f 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/actions_submenu.js +++ b/ui/file_manager/file_manager/foreground/js/ui/actions_submenu.js
@@ -46,7 +46,7 @@ // 'Menu'. const menuItem = this.menu_.addMenuItem(options); FilesMenuItem.decorate(menuItem); - menuItem.parentNode.insertBefore(menuItem, this.separator_); + menuItem.parentNode?.insertBefore(menuItem, this.separator_); this.items_.push(menuItem); return menuItem; }
diff --git a/ui/file_manager/file_manager/foreground/js/ui/command.d.ts b/ui/file_manager/file_manager/foreground/js/ui/command.d.ts index 37be8d1..da011ee 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/command.d.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/command.d.ts
@@ -10,6 +10,6 @@ checked: boolean; shortcut: string; hideShortcutText: boolean; - execute(element?: HTMLElement): void; + execute(element?: HTMLElement|null): void; canExecuteChange(node?: Node|null): void; }
diff --git a/ui/file_manager/file_manager/foreground/js/ui/default_task_dialog.js b/ui/file_manager/file_manager/foreground/js/ui/default_task_dialog.js index 93be910..a20e494a 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/default_task_dialog.js +++ b/ui/file_manager/file_manager/foreground/js/ui/default_task_dialog.js
@@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {getPropertyDescriptor, PropertyKind} from 'chrome://resources/ash/common/cr_deprecated.js'; - import {ArrayDataModel} from '../../../common/js/array_data_model.js'; import {FileManagerDialogBase} from './file_manager_dialog_base.js'; import {createList, List} from './list.js'; +import {createListItem} from './list_item.js'; import {ListSingleSelectionModel} from './list_single_selection_model.js'; @@ -98,7 +97,7 @@ * @param {Object} item Item to render. */ renderItem(item) { - const result = this.document_.createElement('li'); + const result = createListItem(); // Task label. const labelSpan = this.document_.createElement('span'); @@ -139,12 +138,6 @@ // A11y - make it focusable and readable. result.setAttribute('tabindex', '-1'); - Object.defineProperty( - result, 'lead', getPropertyDescriptor('lead', PropertyKind.BOOL_ATTR)); - Object.defineProperty( - result, 'selected', - getPropertyDescriptor('selected', PropertyKind.BOOL_ATTR)); - return result; }
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_table_list.ts b/ui/file_manager/file_manager/foreground/js/ui/file_table_list.ts index eb03ed5..b123f300 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/file_table_list.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/file_table_list.ts
@@ -380,27 +380,6 @@ } else { li.removeAttribute('aria-disabled'); } - - Object.defineProperty(li, 'selected', { - /** - * @this {ListItem} - * @return True if the list item is selected. - */ - get: function(): boolean { - return this.hasAttribute('selected'); - }, - - /** - * @this {ListItem} - */ - set: function(v) { - if (v) { - this.setAttribute('selected', ''); - } else { - this.removeAttribute('selected'); - } - }, - }); } /**
diff --git a/ui/file_manager/file_manager/foreground/js/ui/list.ts b/ui/file_manager/file_manager/foreground/js/ui/list.ts index 854deb5..37a78df 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/list.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/list.ts
@@ -356,7 +356,11 @@ this.fixedHeight_ = true; this.remainingSpace_ = true; this.batchCount_ = 0; - this.itemConstructor_ = createListItem; + this.itemConstructor_ = (label: string) => { + const item = createListItem(); + item.label = label; + return item; + }; const length = this.dataModel ? this.dataModel.length : 0; this.selectionModel = new ListSelectionModel(length); @@ -898,10 +902,6 @@ */ createItem(label: string): ListItem { const item = this.itemConstructor_(label); - item.label = label; - if (typeof item.decorate === 'function') { - item.decorate(); - } return item; }
diff --git a/ui/file_manager/file_manager/foreground/js/ui/menu.js b/ui/file_manager/file_manager/foreground/js/ui/menu.js deleted file mode 100644 index 8aa5ea05..0000000 --- a/ui/file_manager/file_manager/foreground/js/ui/menu.js +++ /dev/null
@@ -1,581 +0,0 @@ -// Copyright 2012 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {assert, assertInstanceof} from 'chrome://resources/ash/common/assert.js'; -import {getPropertyDescriptor, PropertyKind} from 'chrome://resources/ash/common/cr_deprecated.js'; - -import {define as crUiDefine, decorate} from '../../../common/js/ui.js'; -import {MenuItem} from './menu_item.js'; - - - /** - * Creates a new menu element. Menu dispatches all commands on the element it - * was shown for. - * - * @param {Object=} opt_propertyBag Optional properties. - * @constructor - * @extends {HTMLElement} - */ -// @ts-ignore: error TS8022: JSDoc '@extends' is not attached to a class. -export const Menu = crUiDefine('cr-menu'); - -Menu.prototype = { - __proto__: HTMLElement.prototype, - - selectedIndex_: -1, - - /** - * Element for which menu is being shown. - */ - contextElement: null, - - /** - * Initializes the menu element. - */ - decorate() { - // @ts-ignore: error TS2339: Property 'addEventListener' does not exist on - // type '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: - // null; decorate(): void; addMenuItem(item: Object): MenuItem; - // addSeparator(): void; ... 15 more ...; updateCommands(node?: Node | - // undefined): void; }'. - this.addEventListener('mouseover', this.handleMouseOver_); - // @ts-ignore: error TS2339: Property 'addEventListener' does not exist on - // type '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: - // null; decorate(): void; addMenuItem(item: Object): MenuItem; - // addSeparator(): void; ... 15 more ...; updateCommands(node?: Node | - // undefined): void; }'. - this.addEventListener('mouseout', this.handleMouseOut_); - // @ts-ignore: error TS2339: Property 'addEventListener' does not exist on - // type '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: - // null; decorate(): void; addMenuItem(item: Object): MenuItem; - // addSeparator(): void; ... 15 more ...; updateCommands(node?: Node | - // undefined): void; }'. - this.addEventListener('mouseup', this.handleMouseUp_, true); - - // @ts-ignore: error TS2339: Property 'classList' does not exist on type '{ - // __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - this.classList.add('decorated'); - // @ts-ignore: error TS2339: Property 'setAttribute' does not exist on type - // '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - this.setAttribute('role', 'menu'); - // @ts-ignore: error TS2551: Property 'hidden' does not exist on type '{ - // __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - // Did you mean 'hide'? - this.hidden = true; // Hide the menu by default. - - // Decorate the children as menu items. - const menuItems = this.menuItems; - for (let i = 0, menuItem; menuItem = menuItems[i]; i++) { - decorate(menuItem, MenuItem); - } - }, - - /** - * Adds menu item at the end of the list. - * @param {Object} item Menu item properties. - * @return {!MenuItem} The created menu item. - */ - addMenuItem(item) { - const menuItem = /** @type {!MenuItem} */ ( - // @ts-ignore: error TS2339: Property 'ownerDocument' does not exist on - // type '{ __proto__: HTMLElement; selectedIndex_: number; - // contextElement: null; decorate(): void; addMenuItem(item: Object): - // MenuItem; addSeparator(): void; ... 15 more ...; - // updateCommands(node?: Node | undefined): void; }'. - this.ownerDocument.createElement('cr-menu-item')); - // @ts-ignore: error TS2339: Property 'appendChild' does not exist on type - // '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - this.appendChild(menuItem); - - decorate(menuItem, MenuItem); - - // @ts-ignore: error TS2339: Property 'label' does not exist on type - // 'Object'. - if (item.label) { - // @ts-ignore: error TS2339: Property 'label' does not exist on type - // 'Object'. - menuItem.label = item.label; - } - - // @ts-ignore: error TS2339: Property 'iconUrl' does not exist on type - // 'Object'. - if (item.iconUrl) { - // @ts-ignore: error TS2339: Property 'iconUrl' does not exist on type - // 'Object'. - menuItem.iconUrl = item.iconUrl; - } - - return menuItem; - }, - - /** - * Adds separator at the end of the list. - */ - addSeparator() { - // @ts-ignore: error TS2339: Property 'ownerDocument' does not exist on type - // '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - const separator = this.ownerDocument.createElement('hr'); - decorate(separator, MenuItem); - // @ts-ignore: error TS2339: Property 'appendChild' does not exist on type - // '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - this.appendChild(separator); - }, - - /** - * Clears menu. - */ - clear() { - // @ts-ignore: error TS2322: Type 'null' is not assignable to type - // 'MenuItem'. - this.selectedItem = null; - // @ts-ignore: error TS2339: Property 'textContent' does not exist on type - // '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - this.textContent = ''; - }, - - /** - * Walks up the ancestors of |node| until a menu item belonging to this menu - * is found. - * @param {Node} node The node to start searching from. - * @return {MenuItem} The found menu item or null. - * @private - */ - findMenuItem_(node) { - // @ts-ignore: error TS2367: This comparison appears to be unintentional - // because the types 'ParentNode | null' and '{ __proto__: HTMLElement; - // selectedIndex_: number; contextElement: null; decorate(): void; - // addMenuItem(item: Object): MenuItem; addSeparator(): void; ... 15 more - // ...; updateCommands(node?: Node | undefined): void; }' have no overlap. - while (node && node.parentNode !== this && !(node instanceof MenuItem)) { - // @ts-ignore: error TS2322: Type 'ParentNode | null' is not assignable to - // type 'Node'. - node = node.parentNode; - } - // @ts-ignore: error TS2322: Type 'MenuItem | null' is not assignable to - // type 'MenuItem'. - return node ? assertInstanceof(node, MenuItem) : null; - }, - - /** - * Handles mouseover events and selects the hovered item. - * @param {Event} e The mouseover event. - * @private - */ - handleMouseOver_(e) { - const overItem = this.findMenuItem_(/** @type {Element} */ (e.target)); - this.selectedItem = overItem; - }, - - /** - * Handles mouseout events and deselects any selected item. - * @param {Event} e The mouseout event. - * @private - */ - // @ts-ignore: error TS6133: 'e' is declared but its value is never read. - handleMouseOut_(e) { - // @ts-ignore: error TS2322: Type 'null' is not assignable to type - // 'MenuItem'. - this.selectedItem = null; - }, - - /** - * If there's a mouseup that happens quickly in about the same position, - * stop it from propagating to items. This is to prevent accidentally - * selecting a menu item that's created under the mouse cursor. - * @param {Event} e A mouseup event on the menu (in capturing phase). - * @private - */ - handleMouseUp_(e) { - // @ts-ignore: error TS2339: Property 'contains' does not exist on type '{ - // __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - assert(this.contains(/** @type {Element} */ (e.target))); - - // @ts-ignore: error TS2551: Property 'shown_' does not exist on type '{ - // __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - // Did you mean 'show'? - if (!this.trustEvent_(e) || Date.now() - this.shown_.time > 200) { - return; - } - - // @ts-ignore: error TS2551: Property 'shown_' does not exist on type '{ - // __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - // Did you mean 'show'? - const pos = this.shown_.mouseDownPos; - if (!pos || - // @ts-ignore: error TS2339: Property 'screenY' does not exist on type - // 'Event'. - Math.abs(pos.x - e.screenX) + Math.abs(pos.y - e.screenY) > 4) { - return; - } - - e.preventDefault(); - e.stopPropagation(); - }, - - /** - * @param {!Event} e - * @return {boolean} Whether |e| can be trusted. - * @private - * @suppress {checkTypes} - */ - trustEvent_(e) { - // @ts-ignore: error TS2339: Property 'isTrustedForTesting' does not exist - // on type 'Event'. - return e.isTrusted || e.isTrustedForTesting; - }, - - get menuItems() { - // @ts-ignore: error TS2339: Property 'menuItemSelector' does not exist on - // type '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: - // null; decorate(): void; addMenuItem(item: Object): MenuItem; - // addSeparator(): void; ... 15 more ...; updateCommands(node?: Node | - // undefined): void; }'. - return this.querySelectorAll(this.menuItemSelector || '*'); - }, - - /** - * The selected menu item or null if none. - * @type {MenuItem} - */ - get selectedItem() { - // @ts-ignore: error TS2551: Property 'selectedIndex' does not exist on type - // '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - // Did you mean 'selectedIndex_'? - return this.menuItems[this.selectedIndex]; - }, - set selectedItem(item) { - const index = Array.prototype.indexOf.call(this.menuItems, item); - // @ts-ignore: error TS2551: Property 'selectedIndex' does not exist on type - // '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - // Did you mean 'selectedIndex_'? - this.selectedIndex = index; - }, - - /** - * Focuses the selected item. If selectedIndex is invalid, set it to 0 - * first. - */ - focusSelectedItem() { - const items = this.menuItems; - // @ts-ignore: error TS2551: Property 'selectedIndex' does not exist on type - // '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - // Did you mean 'selectedIndex_'? - if (this.selectedIndex < 0 || this.selectedIndex > items.length) { - // Find first visible item to focus by default. - for (let idx = 0; idx < items.length; idx++) { - const item = items[idx]; - if (item.hasAttribute('hidden') || item.isSeparator()) { - continue; - } - // If the item is disabled we accept it, but try to find the next - // enabled item, but keeping the first disabled item. - if (!item.disabled) { - // @ts-ignore: error TS2551: Property 'selectedIndex' does not exist - // on type '{ __proto__: HTMLElement; selectedIndex_: number; - // contextElement: null; decorate(): void; addMenuItem(item: Object): - // MenuItem; addSeparator(): void; ... 15 more ...; - // updateCommands(node?: Node | undefined): void; }'. Did you mean - // 'selectedIndex_'? - this.selectedIndex = idx; - break; - // @ts-ignore: error TS2551: Property 'selectedIndex' does not exist - // on type '{ __proto__: HTMLElement; selectedIndex_: number; - // contextElement: null; decorate(): void; addMenuItem(item: Object): - // MenuItem; addSeparator(): void; ... 15 more ...; - // updateCommands(node?: Node | undefined): void; }'. Did you mean - // 'selectedIndex_'? - } else if (this.selectedIndex === -1) { - // @ts-ignore: error TS2551: Property 'selectedIndex' does not exist - // on type '{ __proto__: HTMLElement; selectedIndex_: number; - // contextElement: null; decorate(): void; addMenuItem(item: Object): - // MenuItem; addSeparator(): void; ... 15 more ...; - // updateCommands(node?: Node | undefined): void; }'. Did you mean - // 'selectedIndex_'? - this.selectedIndex = idx; - } - } - } - - if (this.selectedItem) { - this.selectedItem.focus(); - // @ts-ignore: error TS2339: Property 'setAttribute' does not exist on - // type '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: - // null; decorate(): void; addMenuItem(item: Object): MenuItem; - // addSeparator(): void; ... 15 more ...; updateCommands(node?: Node | - // undefined): void; }'. - this.setAttribute('aria-activedescendant', this.selectedItem.id); - } - }, - - /** - * Menu length - */ - get length() { - return this.menuItems.length; - }, - - /** - * Returns whether the given menu item is visible. - * @param {!MenuItem} menuItem - * @return {boolean} - * @private - */ - isItemVisible_(menuItem) { - if (menuItem.hidden) { - return false; - } - if (menuItem.offsetParent) { - return true; - } - // A "position: fixed" element won't have an offsetParent, so we have to - // do the full style computation. - return window.getComputedStyle(menuItem).display !== 'none'; - }, - - /** - * Returns whether the menu has any visible items. - * @return {boolean} True if the menu has visible item. Otherwise, false. - */ - hasVisibleItems() { - // Inspect items in reverse order to determine if the separator above each - // set of items is required. - for (const menuItem of this.menuItems) { - if (this.isItemVisible_(menuItem)) { - return true; - } - } - return false; - }, - - /** - * This is the function that handles keyboard navigation. This is usually - * called by the element responsible for managing the menu. - * @param {Event} e The keydown event object. - * @return {boolean} Whether the event was handled be the menu. - */ - handleKeyDown(e) { - let item = this.selectedItem; - - const self = this; - // @ts-ignore: error TS7006: Parameter 'm' implicitly has an 'any' type. - const selectNextAvailable = function(m) { - const menuItems = self.menuItems; - const len = menuItems.length; - if (!len) { - // Edge case when there are no items. - return; - } - // @ts-ignore: error TS2551: Property 'selectedIndex' does not exist on - // type '{ __proto__: HTMLElement; selectedIndex_: number; contextElement: - // null; decorate(): void; addMenuItem(item: Object): MenuItem; - // addSeparator(): void; ... 15 more ...; updateCommands(node?: Node | - // undefined): void; }'. Did you mean 'selectedIndex_'? - let i = self.selectedIndex; - if (i === -1 && m === -1) { - // Edge case when needed to go the last item first. - i = 0; - } - - // "i" may be negative(-1), so modulus operation and cycle below - // wouldn't work as assumed. This trick makes startPosition positive - // without altering it's modulo. - const startPosition = (i + len) % len; - - while (true) { - i = (i + m + len) % len; - - // Check not to enter into infinite loop if all items are hidden or - // disabled. - if (i === startPosition) { - break; - } - - item = menuItems[i]; - // @ts-ignore: error TS2339: Property 'isSeparator' does not exist on - // type 'MenuItem'. - if (item && !item.isSeparator() && !item.disabled && - // @ts-ignore: error TS2683: 'this' implicitly has type 'any' - // because it does not have a type annotation. - this.isItemVisible_(item)) { - break; - } - } - if (item && !item.disabled) { - // @ts-ignore: error TS2551: Property 'selectedIndex' does not exist on - // type '{ __proto__: HTMLElement; selectedIndex_: number; - // contextElement: null; decorate(): void; addMenuItem(item: Object): - // MenuItem; addSeparator(): void; ... 15 more ...; - // updateCommands(node?: Node | undefined): void; }'. Did you mean - // 'selectedIndex_'? - self.selectedIndex = i; - } - }.bind(this); - - // @ts-ignore: error TS2339: Property 'key' does not exist on type 'Event'. - switch (e.key) { - case 'ArrowDown': - selectNextAvailable(1); - this.focusSelectedItem(); - return true; - case 'ArrowUp': - selectNextAvailable(-1); - this.focusSelectedItem(); - return true; - case 'Enter': - case ' ': - if (item) { - // Store |contextElement| since it'll be removed when handling the - // 'activate' event. - const contextElement = this.contextElement; - const activationEvent = document.createEvent('Event'); - activationEvent.initEvent('activate', true, true); - // @ts-ignore: error TS2339: Property 'originalEvent' does not exist - // on type 'Event'. - activationEvent.originalEvent = e; - if (item.dispatchEvent(activationEvent)) { - // @ts-ignore: error TS2339: Property 'command' does not exist on - // type 'MenuItem'. - if (item.command) { - // @ts-ignore: error TS2339: Property 'command' does not exist on - // type 'MenuItem'. - item.command.execute(contextElement); - } - } - } - return true; - } - - return false; - }, - - hide() { - // @ts-ignore: error TS2551: Property 'hidden' does not exist on type '{ - // __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - // Did you mean 'hide'? - this.hidden = true; - // @ts-ignore: error TS2551: Property 'shown_' does not exist on type '{ - // __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - // Did you mean 'show'? - delete this.shown_; - }, - - /** @param {{x: number, y: number}=} opt_mouseDownPos */ - show(opt_mouseDownPos) { - // @ts-ignore: error TS2551: Property 'shown_' does not exist on type '{ - // __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - // Did you mean 'show'? - this.shown_ = {mouseDownPos: opt_mouseDownPos, time: Date.now()}; - // @ts-ignore: error TS2551: Property 'hidden' does not exist on type '{ - // __proto__: HTMLElement; selectedIndex_: number; contextElement: null; - // decorate(): void; addMenuItem(item: Object): MenuItem; addSeparator(): - // void; ... 15 more ...; updateCommands(node?: Node | undefined): void; }'. - // Did you mean 'hide'? - this.hidden = false; - }, - - /** - * Updates menu items command according to context. - * @param {Node=} node Node for which to actuate commands state. - */ - updateCommands(node) { - const menuItems = this.menuItems; - - for (const menuItem of menuItems) { - if (!menuItem.isSeparator()) { - menuItem.updateCommand(node); - } - } - - let separatorRequired = false; - let lastSeparator = null; - // Hide any separators without a visible item between them and the next - // separator or the end of the menu. - for (const menuItem of menuItems) { - if (menuItem.isSeparator()) { - if (separatorRequired) { - lastSeparator = menuItem; - } - menuItem.hidden = true; - separatorRequired = false; - continue; - } - if (this.isItemVisible_(menuItem)) { - if (lastSeparator) { - lastSeparator.hidden = false; - } - separatorRequired = true; - } - } - }, -}; - -/** @suppress {globalThis} This standalone function is used like method. */ -// @ts-ignore: error TS7006: Parameter 'oldSelectedIndex' implicitly has an -// 'any' type. -function selectedIndexChanged(selectedIndex, oldSelectedIndex) { - // @ts-ignore: error TS2683: 'this' implicitly has type 'any' because it does - // not have a type annotation. - const oldSelectedItem = this.menuItems[oldSelectedIndex]; - if (oldSelectedItem) { - oldSelectedItem.selected = false; - oldSelectedItem.blur(); - } - // @ts-ignore: error TS2683: 'this' implicitly has type 'any' because it does - // not have a type annotation. - const item = this.selectedItem; - if (item) { - item.selected = true; - } -} - - /** - * The selected menu item. - * @type {number} - */ - Menu.prototype.selectedIndex; - Object.defineProperty( - Menu.prototype, 'selectedIndex', - getPropertyDescriptor( - 'selectedIndex', PropertyKind.JS, selectedIndexChanged)); - - /** - * Selector for children which are menu items. - * @type {string} - */ - Menu.prototype.menuItemSelector; - Object.defineProperty( - Menu.prototype, 'menuItemSelector', - getPropertyDescriptor('menuItemSelector', PropertyKind.ATTR));
diff --git a/ui/file_manager/file_manager/foreground/js/ui/menu.ts b/ui/file_manager/file_manager/foreground/js/ui/menu.ts new file mode 100644 index 0000000..877d1f7 --- /dev/null +++ b/ui/file_manager/file_manager/foreground/js/ui/menu.ts
@@ -0,0 +1,406 @@ +// Copyright 2012 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {dispatchPropertyChange} from 'chrome://resources/ash/common/cr_deprecated.js'; +import {assert, assertInstanceof} from 'chrome://resources/js/assert.js'; + +import {convertToKebabCase, decorate, domAttrSetter} from '../../../common/js/cr_ui.js'; + +import {MenuItem, MenuItemActivationEvent} from './menu_item.js'; + +export interface ShownPosition { + mouseDownPos?: { + x: number, + y: number, + }; + + // Time from Date.now(). + time: number; +} + +export class Menu extends HTMLElement { + private selectedIndex_: number = -1; + + /** + * Element for which menu is being shown. + */ + contextElement: HTMLElement|null = null; + + private shown_: ShownPosition|null = null; + + static decorate(el: HTMLElement) { + decorate(el, Menu); + } + + /** + * Initializes the menu element. + */ + decorate() { + this.selectedIndex_ = -1; + this.contextElement = null; + this.shown_ = null; + + this.addEventListener('mouseover', this.handleMouseOver_); + this.addEventListener('mouseout', this.handleMouseOut_); + this.addEventListener('mouseup', this.handleMouseUp_, true); + + this.classList.add('decorated'); + this.setAttribute('role', 'menu'); + this.hidden = true; // Hide the menu by default. + + // Decorate the children as menu items. + for (const item of this.menuItems) { + decorate(item, MenuItem); + } + } + + /** + * Adds menu item at the end of the list. + * @param item Menu item properties. + * @return The created menu item. + */ + addMenuItem(item: {label?: string, iconUrl?: string} = {}): MenuItem { + const menuItem = + this.ownerDocument.createElement('cr-menu-item') as MenuItem; + this.appendChild(menuItem); + decorate(menuItem, MenuItem); + + if (item.label) { + menuItem.label = item.label; + } + + if (item.iconUrl) { + menuItem.iconUrl = item.iconUrl; + } + + return menuItem; + } + + /** + * Adds separator at the end of the list. + */ + addSeparator() { + const separator = this.ownerDocument.createElement('hr'); + decorate(separator, MenuItem); + this.appendChild(separator); + } + + /** + * Clears menu. + */ + clear() { + this.selectedItem = undefined; + this.textContent = ''; + } + + /** + * Walks up the ancestors of |node| until a menu item belonging to this menu + * is found. + * @param node The node to start searching from. + * @return The found menu item or undefined. + */ + private findMenuItem_(node: Node): MenuItem|undefined { + while (node && node.parentNode !== this && !(node instanceof MenuItem)) { + node = node.parentNode!; + } + + if (node) { + assertInstanceof(node, MenuItem); + return node; + } + + return undefined; + } + + /** + * Handles mouseover events and selects the hovered item. + */ + private handleMouseOver_(e: Event) { + const target = e.target as HTMLElement; + const overItem = this.findMenuItem_(target); + this.selectedItem = overItem; + } + + /** + * Handles mouseout events and deselects any selected item. + * @param e The mouseout event. + */ + private handleMouseOut_(_e: Event) { + this.selectedItem = undefined; + } + + /** + * If there's a mouseup that happens quickly in about the same position, + * stop it from propagating to items. This is to prevent accidentally + * selecting a menu item that's created under the mouse cursor. + * @param e A mouseup event on the menu (in capturing phase). + */ + private handleMouseUp_(e: MouseEvent) { + const target = e.target as HTMLElement; + + assert(this.contains(target)); + assert(this.shown_); + if (!this.trustEvent_(e) || Date.now() - this.shown_.time > 200) { + return; + } + + const pos = this.shown_.mouseDownPos; + if (!pos || Math.abs(pos.x - e.screenX) + Math.abs(pos.y - e.screenY) > 4) { + return; + } + + e.preventDefault(); + e.stopPropagation(); + } + + /** + * @return Whether `e` can be trusted. + */ + private trustEvent_(e: Event): boolean { + return e.isTrusted || (e as any).isTrustedForTesting; + } + + get menuItems(): MenuItem[] { + return Array.from(this.querySelectorAll(this.menuItemSelector || '*')); + } + + /** + * The selected menu item or undefined if none. + */ + get selectedItem(): MenuItem|undefined { + return this.menuItems[this.selectedIndex]; + } + + set selectedItem(item: MenuItem|undefined) { + const index = this.menuItems.indexOf(item!); + this.selectedIndex = index; + } + + /** + * Focuses the selected item. If selectedIndex is invalid, set it to 0 + * first. + */ + focusSelectedItem() { + const items = this.menuItems; + if (this.selectedIndex < 0 || this.selectedIndex > items.length) { + // Find first visible item to focus by default. + for (const [idx, item] of items.entries()) { + if (item.hasAttribute('hidden') || item.isSeparator()) { + continue; + } + // If the item is disabled we accept it, but try to find the next + // enabled item, but keeping the first disabled item. + if (!item.disabled) { + this.selectedIndex = idx; + break; + } else if (this.selectedIndex === -1) { + this.selectedIndex = idx; + } + } + } + + if (this.selectedItem) { + this.selectedItem.focus(); + this.setAttribute('aria-activedescendant', this.selectedItem.id); + } + } + + /** + * Menu length + */ + get length() { + return this.menuItems.length; + } + + /** + * Returns whether the given menu item is visible. + */ + private isItemVisible_(menuItem: MenuItem): boolean { + if (menuItem.hidden) { + return false; + } + if (menuItem.offsetParent) { + return true; + } + // A "position: fixed" element won't have an offsetParent, so we have to + // do the full style computation. + return window.getComputedStyle(menuItem).display !== 'none'; + } + + /** + * Returns whether the menu has any visible items. + * @return True if the menu has visible item. Otherwise, false. + */ + hasVisibleItems(): boolean { + // Inspect items in reverse order to determine if the separator above each + // set of items is required. + for (const menuItem of this.menuItems) { + if (this.isItemVisible_(menuItem)) { + return true; + } + } + return false; + } + + /** + * This is the function that handles keyboard navigation. This is usually + * called by the element responsible for managing the menu. + * @param e The keydown event object. + * @return Whether the event was handled be the menu. + */ + handleKeyDown(e: KeyboardEvent): boolean { + let item = this.selectedItem; + + const self = this; + const selectNextAvailable = (m: number) => { + const menuItems = self.menuItems; + const len = menuItems.length; + if (!len) { + // Edge case when there are no items. + return; + } + let i = self.selectedIndex; + if (i === -1 && m === -1) { + // Edge case when needed to go the last item first. + i = 0; + } + + // `i` may be negative(-1), so modulus operation and cycle below + // wouldn't work as assumed. This trick makes startPosition positive + // without altering it's modulo. + const startPosition = (i + len) % len; + + while (true) { + i = (i + m + len) % len; + + // Check not to enter into infinite loop if all items are hidden or + // disabled. + if (i === startPosition) { + break; + } + + item = menuItems[i]; + if (item && !item.isSeparator() && !item.disabled && + this.isItemVisible_(item)) { + break; + } + } + if (item && !item.disabled) { + self.selectedIndex = i; + } + }; + + switch (e.key) { + case 'ArrowDown': + selectNextAvailable(1); + this.focusSelectedItem(); + return true; + case 'ArrowUp': + selectNextAvailable(-1); + this.focusSelectedItem(); + return true; + case 'Enter': + case ' ': + if (item) { + // Store |contextElement| since it'll be removed when handling the + // 'activate' event. + const contextElement = this.contextElement; + const activationEvent = + document.createEvent('Event') as MenuItemActivationEvent; + activationEvent.initEvent('activate', true, true); + activationEvent.originalEvent = e; + if (item.dispatchEvent(activationEvent)) { + if (item.command) { + item.command.execute(contextElement); + } + } + } + return true; + } + + return false; + } + + hide() { + this.hidden = true; + this.shown_ = null; + } + + show(mouseDownPos?: {x: number, y: number}) { + this.shown_ = {mouseDownPos: mouseDownPos, time: Date.now()}; + this.hidden = false; + } + + /** + * Updates menu items command according to context. + * @param node Node for which to actuate commands state. + */ + updateCommands(node?: Node) { + const menuItems = this.menuItems; + + for (const menuItem of menuItems) { + if (!menuItem.isSeparator()) { + menuItem.updateCommand(node); + } + } + + let separatorRequired = false; + let lastSeparator = null; + // Hide any separators without a visible item between them and the next + // separator or the end of the menu. + for (const menuItem of menuItems) { + if (menuItem.isSeparator()) { + if (separatorRequired) { + lastSeparator = menuItem; + } + menuItem.hidden = true; + separatorRequired = false; + continue; + } + if (this.isItemVisible_(menuItem)) { + if (lastSeparator) { + lastSeparator.hidden = false; + } + separatorRequired = true; + } + } + } + + private selectedIndexChanged_(oldSelectedIndex: number) { + const oldSelectedItem = this.menuItems[oldSelectedIndex]; + if (oldSelectedItem) { + oldSelectedItem.selected = false; + oldSelectedItem.blur(); + } + const item = this.selectedItem; + if (item) { + item.selected = true; + } + } + + /** + * The selected menu item. + */ + get selectedIndex(): number { + return this.selectedIndex_; + } + + set selectedIndex(value: number) { + const oldValue = this.selectedIndex_; + this.selectedIndex_ = value; + this.selectedIndexChanged_(oldValue); + dispatchPropertyChange(this, 'selectedIndex', value, oldValue); + } + + /** + * Selector for children which are menu items. + */ + get menuItemSelector(): string { + return this.getAttribute(convertToKebabCase('menuItemSelector')) ?? ''; + } + + set menuItemSelector(value: string) { + domAttrSetter(this, 'menuItemSelector', value); + } +}
diff --git a/ui/file_manager/file_manager/foreground/js/ui/menu_unittest.js b/ui/file_manager/file_manager/foreground/js/ui/menu_unittest.js deleted file mode 100644 index dd17b1f..0000000 --- a/ui/file_manager/file_manager/foreground/js/ui/menu_unittest.js +++ /dev/null
@@ -1,350 +0,0 @@ -// Copyright 2020 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// clang-format off -import {decorate} from '../../../common/js/ui.js'; - -import {Command} from './command.js'; -import {Menu} from './menu.js'; -import {MenuItem, createMenuItem} from './menu_item.js'; - -import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js'; -// clang-format on - -/** @type {Menu} */ -let menu; - -/** - * @param {number} x The screenX coord of the mouseup event. - * @param {number} y The screenY coord of the mouseup event. - * @return {boolean} The return value is false if event is cancelable and at - * least one of the event handlers which received event called - * Event.preventDefault(). Otherwise it returns true. - * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent - */ -function mouseUpAt(x, y) { - const mouseUpEvent = new MouseEvent('mouseup', { - bubbles: true, - cancelable: true, - // @ts-ignore: error TS2345: Argument of type '{ bubbles: true; cancelable: - // true; target: Menu; screenX: number; screenY: number; }' is not - // assignable to parameter of type 'MouseEventInit'. - target: menu, - screenX: x, - screenY: y, - }); - // @ts-ignore: error TS2339: Property 'isTrustedForTesting' does not exist on - // type 'MouseEvent'. - mouseUpEvent.isTrustedForTesting = true; - // @ts-ignore: error TS2339: Property 'dispatchEvent' does not exist on type - // 'Menu'. - return menu.dispatchEvent(mouseUpEvent); -} - -export function setUp() { - // @ts-ignore: error TS2673: Constructor of class 'Menu' is private and only - // accessible within the class declaration. - menu = new Menu(); -} - -/** @suppress {visibility} Allow test to reach to private properties. */ -export function testHandleMouseOver() { - let called = false; - // @ts-ignore: error TS2339: Property 'findMenuItem_' does not exist on type - // 'Menu'. - menu.findMenuItem_ = function() { - called = true; - // @ts-ignore: error TS2339: Property 'findMenuItem_' does not exist on type - // 'Menu'. - return Menu.prototype.findMenuItem_.apply(this, arguments); - }; - - const over = - // @ts-ignore: error TS2345: Argument of type '{ bubbles: true; target: - // HTMLElement; }' is not assignable to parameter of type - // 'MouseEventInit'. - new MouseEvent('mouseover', {bubbles: true, target: document.body}); - assertFalse(called); - // @ts-ignore: error TS2339: Property 'dispatchEvent' does not exist on type - // 'Menu'. - menu.dispatchEvent(over); - assertTrue(called); -} - -export function testHandleMouseUp() { - const realNow = Date.now; - Date.now = function() { - return 10; - }; - - // @ts-ignore: error TS2339: Property 'show' does not exist on type 'Menu'. - menu.show({x: 5, y: 5}); - - // Stop mouseups at the same time and position. - assertFalse(mouseUpAt(5, 5)); - - // Allow mouseups with different positions but the same time. - assertTrue(mouseUpAt(50, 50)); - - // Alow mouseups with the same position but different times. - Date.now = function() { - return 1000; - }; - assertTrue(mouseUpAt(5, 5)); - - Date.now = realNow; -} - -export function testShowViaKeyboardIgnoresMouseUps() { - // @ts-ignore: error TS2339: Property 'show' does not exist on type 'Menu'. - menu.show(); - assertTrue(mouseUpAt(0, 0)); -} - -/** - * Tests that if the command attributes are spacified, they are copied to the - * corresponding menuitem. - */ -export function testCommandMenuItem() { - // Test 1: The case that the command label is set and other attributes copied. - const command = new Command(); - command.id = 'the-command'; - command.label = 'CommandLabel'; - command.disabled = true; - command.hidden = true; - command.checked = true; - document.body.appendChild(command); - - const menuItem = createMenuItem(); - // @ts-ignore: error TS2339: Property 'command' does not exist on type - // 'MenuItem'. - menuItem.command = '#the-command'; - - // Confirms the label is copied from the command. - // @ts-ignore: error TS2339: Property 'label' does not exist on type - // 'MenuItem'. - assertEquals('CommandLabel', menuItem.label); - // Confirms the attributes are copied from the command. - assertEquals(true, menuItem.disabled); - assertEquals(true, menuItem.hidden); - // @ts-ignore: error TS2339: Property 'checked' does not exist on type - // 'MenuItem'. - assertEquals(true, menuItem.checked); - - // Test 2: The case that the command label is not set, and other attributes - // have default values. - const command2 = new Command(); - command2.id = 'the-command2'; - document.body.appendChild(command2); - - const menuItem2 = createMenuItem(); - // @ts-ignore: error TS2339: Property 'label' does not exist on type - // 'MenuItem'. - menuItem2.label = 'MenuLabel'; - // @ts-ignore: error TS2339: Property 'command' does not exist on type - // 'MenuItem'. - menuItem2.command = '#the-command2'; - - // Confirms the label is not copied, keeping the original label. - // @ts-ignore: error TS2339: Property 'label' does not exist on type - // 'MenuItem'. - assertEquals('MenuLabel', menuItem2.label); - // Confirms the attributes are copied from the command. - assertEquals(false, menuItem2.disabled); - assertEquals(false, menuItem2.hidden); - // @ts-ignore: error TS2339: Property 'checked' does not exist on type - // 'MenuItem'. - assertEquals(false, menuItem2.checked); -} - -/** - * Mark all menu items other than |hiddenItems| as visible and check that the - * expected number of separators are visible. - */ -// @ts-ignore: error TS7006: Parameter 'expectedSeparators' implicitly has an -// 'any' type. -function runSeparatorTest(items, hiddenItems, expectedSeparators) { - // @ts-ignore: error TS2339: Property 'menuItems' does not exist on type - // 'Menu'. - for (const item of menu.menuItems) { - item.hidden = false; - } - for (const i of hiddenItems) { - items[i].hidden = true; - } - // @ts-ignore: error TS2339: Property 'updateCommands' does not exist on type - // 'Menu'. - menu.updateCommands(); - // @ts-ignore: error TS2339: Property 'hasVisibleItems' does not exist on type - // 'Menu'. - assertEquals(hiddenItems.length !== items.length, menu.hasVisibleItems()); - assertEquals( - // @ts-ignore: error TS2339: Property 'querySelectorAll' does not exist on - // type 'Menu'. - expectedSeparators, menu.querySelectorAll('hr:not([hidden])').length); - - // The separators at the ends are always hidden. - // @ts-ignore: error TS2339: Property 'menuItems' does not exist on type - // 'Menu'. - assertTrue(menu.menuItems[0].hidden); - // @ts-ignore: error TS2339: Property 'menuItems' does not exist on type - // 'Menu'. - assertTrue(menu.menuItems[6].hidden); -} - -/** - * Tests that separators are only displayed when there is a visible - * non-separator item on both sides of it. Further, ensure that multiple - * separators will not be displayed adjacent to each other. - */ -export function testSeparators() { - const menuItems = []; - // @ts-ignore: error TS2339: Property 'addSeparator' does not exist on type - // 'Menu'. - menu.addSeparator(); - // @ts-ignore: error TS2339: Property 'addMenuItem' does not exist on type - // 'Menu'. - menuItems.push(menu.addMenuItem({label: 'a'})); - // @ts-ignore: error TS2339: Property 'addSeparator' does not exist on type - // 'Menu'. - menu.addSeparator(); - // @ts-ignore: error TS2339: Property 'addMenuItem' does not exist on type - // 'Menu'. - menuItems.push(menu.addMenuItem({label: 'b'})); - // @ts-ignore: error TS2339: Property 'addSeparator' does not exist on type - // 'Menu'. - menu.addSeparator(); - // @ts-ignore: error TS2339: Property 'addMenuItem' does not exist on type - // 'Menu'. - menuItems.push(menu.addMenuItem({label: 'c'})); - // @ts-ignore: error TS2339: Property 'addSeparator' does not exist on type - // 'Menu'. - menu.addSeparator(); - - runSeparatorTest(menuItems, [0, 1, 2], 0); - runSeparatorTest(menuItems, [0, 1], 0); - runSeparatorTest(menuItems, [0, 2], 0); - runSeparatorTest(menuItems, [1, 2], 0); - runSeparatorTest(menuItems, [0], 1); - runSeparatorTest(menuItems, [1], 1); - runSeparatorTest(menuItems, [2], 1); - runSeparatorTest(menuItems, [], 2); -} - -/** - * Tests that focusSelectedItem() ignores hidden and disabled items. - */ -export function testFocusSelectedItems() { - const menu = document.createElement('div'); - decorate(menu, Menu); - // @ts-ignore: error TS2339: Property 'addMenuItem' does not exist on type - // 'HTMLDivElement'. - const item1 = menu.addMenuItem({label: 'item1'}); - // @ts-ignore: error TS2339: Property 'addSeparator' does not exist on type - // 'HTMLDivElement'. - menu.addSeparator(); - // @ts-ignore: error TS2339: Property 'addMenuItem' does not exist on type - // 'HTMLDivElement'. - const item2 = menu.addMenuItem({label: 'item2'}); - // @ts-ignore: error TS2339: Property 'addMenuItem' does not exist on type - // 'HTMLDivElement'. - const item3 = menu.addMenuItem({label: 'item3'}); - document.body.appendChild(menu); - - // Nothing is selected in the menu it should focus the first item. - // @ts-ignore: error TS2339: Property 'selectedIndex' does not exist on type - // 'HTMLDivElement'. - assertEquals(-1, menu.selectedIndex); - // @ts-ignore: error TS2339: Property 'focusSelectedItem' does not exist on - // type 'HTMLDivElement'. - menu.focusSelectedItem(); - // Focus the first item. - // @ts-ignore: error TS2339: Property 'selectedIndex' does not exist on type - // 'HTMLDivElement'. - assertEquals(0, menu.selectedIndex); - - // Hide the first item, it should focus the second item. - // @ts-ignore: error TS2339: Property 'selectedIndex' does not exist on type - // 'HTMLDivElement'. - menu.selectedIndex = -1; - item1.hidden = true; - // @ts-ignore: error TS2339: Property 'focusSelectedItem' does not exist on - // type 'HTMLDivElement'. - menu.focusSelectedItem(); - // Focus the second item, index=1 is the separator. - // @ts-ignore: error TS2339: Property 'selectedIndex' does not exist on type - // 'HTMLDivElement'. - assertEquals(2, menu.selectedIndex); - - // First item is visible but disabled, it should focus the second item. - // @ts-ignore: error TS2339: Property 'selectedIndex' does not exist on type - // 'HTMLDivElement'. - menu.selectedIndex = -1; - item1.hidden = false; - item1.disabled = true; - // @ts-ignore: error TS2339: Property 'focusSelectedItem' does not exist on - // type 'HTMLDivElement'. - menu.focusSelectedItem(); - // Focus the second item, index=1 is the separator. - // @ts-ignore: error TS2339: Property 'selectedIndex' does not exist on type - // 'HTMLDivElement'. - assertEquals(2, menu.selectedIndex); - - // All items are visible but disabled, it should focus the first item. - // @ts-ignore: error TS2339: Property 'selectedIndex' does not exist on type - // 'HTMLDivElement'. - menu.selectedIndex = -1; - item1.disabled = true; - item2.disabled = true; - item3.disabled = true; - // @ts-ignore: error TS2339: Property 'focusSelectedItem' does not exist on - // type 'HTMLDivElement'. - menu.focusSelectedItem(); - // Focus the first item. - // @ts-ignore: error TS2339: Property 'selectedIndex' does not exist on type - // 'HTMLDivElement'. - assertEquals(0, menu.selectedIndex); - - // If selectedIndex is already set, focusSelectedItem doesn't change it. - // @ts-ignore: error TS2339: Property 'selectedIndex' does not exist on type - // 'HTMLDivElement'. - assertEquals(0, menu.selectedIndex); - item1.disabled = true; - item2.disabled = false; - item3.disabled = false; - // @ts-ignore: error TS2339: Property 'focusSelectedItem' does not exist on - // type 'HTMLDivElement'. - menu.focusSelectedItem(); - // Focus remains in the first item. - // @ts-ignore: error TS2339: Property 'selectedIndex' does not exist on type - // 'HTMLDivElement'. - assertEquals(0, menu.selectedIndex); -} - -/** - * Tests that MenuItem defaults to tabindex=-1. - */ -export function testMenuItemTabIndex() { - // Defaults to -1. - // @ts-ignore: error TS2339: Property 'addMenuItem' does not exist on type - // 'Menu'. - const item1 = menu.addMenuItem({label: 'item 1'}); - assertEquals('-1', item1.getAttribute('tabindex')); - - // Keeps previously set tabindex. - const itemDiv = document.createElement('div'); - itemDiv.setAttribute('tabindex', '0'); - decorate(itemDiv, MenuItem); - assertEquals('0', itemDiv.getAttribute('tabindex')); - - // Separator doesn't get tabindex. - // @ts-ignore: error TS2339: Property 'addSeparator' does not exist on type - // 'Menu'. - menu.addSeparator(); - // @ts-ignore: error TS2339: Property 'menuItems' does not exist on type - // 'Menu'. - const separator = menu.menuItems[menu.menuItems.length - 1]; - assertTrue(separator.isSeparator()); - assertFalse(separator.hasAttribute('tabindex')); -}
diff --git a/ui/file_manager/file_manager/foreground/js/ui/menu_unittest.ts b/ui/file_manager/file_manager/foreground/js/ui/menu_unittest.ts new file mode 100644 index 0000000..2899f1fa --- /dev/null +++ b/ui/file_manager/file_manager/foreground/js/ui/menu_unittest.ts
@@ -0,0 +1,241 @@ +// Copyright 2020 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js'; + +import {decorate} from '../../../common/js/ui.js'; + +import {Command} from './command.js'; +import {Menu} from './menu.js'; +import {createMenuItem, MenuItem} from './menu_item.js'; + + +let menu: Menu; + +/** + * @param x The screenX coord of the mouseup event. + * @param y The screenY coord of the mouseup event. + * @return The return value is false if event is cancelable and at + * least one of the event handlers which received event called + * Event.preventDefault(). Otherwise it returns true. + * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent + */ +function mouseUpAt(x: number, y: number): boolean { + const mouseUpEvent = new MouseEvent('mouseup', { + bubbles: true, + cancelable: true, + screenX: x, + screenY: y, + }); + (mouseUpEvent as any).isTrustedForTesting = true; + return menu.dispatchEvent(mouseUpEvent); +} + +export function setUp() { + menu = document.createElement('cr-menu') as Menu; + decorate(menu, Menu); +} + +export function testHandleMouseOver() { + let called = false; + menu['findMenuItem_'] = function(node: Node) { + called = true; + return Menu.prototype['findMenuItem_'].apply(this, [node]); + }; + + const over = new MouseEvent('mouseover', {bubbles: true}); + assertFalse(called); + menu.dispatchEvent(over); + assertTrue(called); +} + +export function testHandleMouseUp() { + const realNow = Date.now; + Date.now = function() { + return 10; + }; + + menu.show({x: 5, y: 5}); + + // Stop mouseups at the same time and position. + assertFalse(mouseUpAt(5, 5)); + + // Allow mouseups with different positions but the same time. + assertTrue(mouseUpAt(50, 50)); + + // Allow mouseups with the same position but different times. + Date.now = function() { + return 1000; + }; + assertTrue(mouseUpAt(5, 5)); + + Date.now = realNow; +} + +export function testShowViaKeyboardIgnoresMouseUps() { + menu.show(); + assertTrue(mouseUpAt(0, 0)); +} + +/** + * Tests that if the command attributes are specified, they are copied to the + * corresponding menuitem. + */ +export function testCommandMenuItem() { + // Test 1: The case that the command label is set and other attributes copied. + const command = new Command(); + command.id = 'the-command'; + command.label = 'CommandLabel'; + command.disabled = true; + command.hidden = true; + command.checked = true; + document.body.appendChild(command); + + const menuItem = createMenuItem(); + menuItem.command = '#the-command'; + + // Confirms the label is copied from the command. + assertEquals('CommandLabel', menuItem.label); + // Confirms the attributes are copied from the command. + assertEquals(true, menuItem.disabled); + assertEquals(true, menuItem.hidden); + assertEquals(true, menuItem.checked); + + // Test 2: The case that the command label is not set, and other attributes + // have default values. + const command2 = new Command(); + command2.id = 'the-command2'; + document.body.appendChild(command2); + + const menuItem2 = createMenuItem(); + menuItem2.label = 'MenuLabel'; + menuItem2.command = '#the-command2'; + + // Confirms the label is not copied, keeping the original label. + assertEquals('MenuLabel', menuItem2.label); + // Confirms the attributes are copied from the command. + assertEquals(false, menuItem2.disabled); + assertEquals(false, menuItem2.hidden); + assertEquals(false, menuItem2.checked); +} + +/** + * Mark all menu items other than |hiddenItems| as visible and check that the + * expected number of separators are visible. + */ +function runSeparatorTest( + items: MenuItem[], hiddenItems: number[], expectedSeparators: number) { + for (const item of menu.menuItems) { + item.hidden = false; + } + for (const i of hiddenItems) { + items[i]!.hidden = true; + } + menu.updateCommands(); + assertEquals(hiddenItems.length !== items.length, menu.hasVisibleItems()); + assertEquals( + expectedSeparators, menu.querySelectorAll('hr:not([hidden])').length); + + // The separators at the ends are always hidden. + assertTrue(menu.menuItems[0]!.hidden); + assertTrue(menu.menuItems[6]!.hidden); +} + +/** + * Tests that separators are only displayed when there is a visible + * non-separator item on both sides of it. Further, ensure that multiple + * separators will not be displayed adjacent to each other. + */ +export function testSeparators() { + const menuItems = []; + menu.addSeparator(); + menuItems.push(menu.addMenuItem({label: 'a'})); + menu.addSeparator(); + menuItems.push(menu.addMenuItem({label: 'b'})); + menu.addSeparator(); + menuItems.push(menu.addMenuItem({label: 'c'})); + menu.addSeparator(); + + runSeparatorTest(menuItems, [0, 1, 2], 0); + runSeparatorTest(menuItems, [0, 1], 0); + runSeparatorTest(menuItems, [0, 2], 0); + runSeparatorTest(menuItems, [1, 2], 0); + runSeparatorTest(menuItems, [0], 1); + runSeparatorTest(menuItems, [1], 1); + runSeparatorTest(menuItems, [2], 1); + runSeparatorTest(menuItems, [], 2); +} + +/** + * Tests that focusSelectedItem() ignores hidden and disabled items. + */ +export function testFocusSelectedItems() { + const menu = document.createElement('div') as unknown as Menu; + decorate(menu, Menu); + const item1 = menu.addMenuItem({label: 'item1'}); + menu.addSeparator(); + const item2 = menu.addMenuItem({label: 'item2'}); + const item3 = menu.addMenuItem({label: 'item3'}); + document.body.appendChild(menu); + + // Nothing is selected in the menu it should focus the first item. + assertEquals(-1, menu.selectedIndex); + menu.focusSelectedItem(); + // Focus the first item. + assertEquals(0, menu.selectedIndex); + + // Hide the first item, it should focus the second item. + menu.selectedIndex = -1; + item1.hidden = true; + menu.focusSelectedItem(); + // Focus the second item, index=1 is the separator. + assertEquals(2, menu.selectedIndex); + + // First item is visible but disabled, it should focus the second item. + menu.selectedIndex = -1; + item1.hidden = false; + item1.disabled = true; + menu.focusSelectedItem(); + // Focus the second item, index=1 is the separator. + assertEquals(2, menu.selectedIndex); + + // All items are visible but disabled, it should focus the first item. + menu.selectedIndex = -1; + item1.disabled = true; + item2.disabled = true; + item3.disabled = true; + menu.focusSelectedItem(); + // Focus the first item. + assertEquals(0, menu.selectedIndex); + + // If selectedIndex is already set, focusSelectedItem doesn't change it. + assertEquals(0, menu.selectedIndex); + item1.disabled = true; + item2.disabled = false; + item3.disabled = false; + menu.focusSelectedItem(); + // Focus remains in the first item. + assertEquals(0, menu.selectedIndex); +} + +/** + * Tests that MenuItem defaults to tabindex=-1. + */ +export function testMenuItemTabIndex() { + // Defaults to -1. + const item1 = menu.addMenuItem({label: 'item 1'}); + assertEquals('-1', item1.getAttribute('tabindex')); + + // Keeps previously set tabindex. + const itemDiv = document.createElement('div'); + itemDiv.setAttribute('tabindex', '0'); + decorate(itemDiv, MenuItem); + assertEquals('0', itemDiv.getAttribute('tabindex')); + + // Separator doesn't get tabindex. + menu.addSeparator(); + const separator = menu.menuItems[menu.menuItems.length - 1]!; + assertTrue(separator.isSeparator()); + assertFalse(separator.hasAttribute('tabindex')); +}
diff --git a/ui/file_manager/file_names.gni b/ui/file_manager/file_names.gni index dd971b3..38b1a13 100644 --- a/ui/file_manager/file_names.gni +++ b/ui/file_manager/file_names.gni
@@ -139,7 +139,6 @@ "file_manager/foreground/js/ui/gear_menu.js", "file_manager/foreground/js/ui/import_crostini_image_dialog.js", "file_manager/foreground/js/ui/install_linux_package_dialog.js", - "file_manager/foreground/js/ui/menu.js", "file_manager/foreground/js/ui/menu_button.js", "file_manager/foreground/js/ui/multi_menu.js", "file_manager/foreground/js/ui/multi_menu_button.js", @@ -261,6 +260,7 @@ "file_manager/foreground/js/ui/list_single_selection_model.ts", "file_manager/foreground/js/ui/list_selection_controller.ts", "file_manager/foreground/js/ui/list_selection_model.ts", + "file_manager/foreground/js/ui/menu.ts", "file_manager/foreground/js/ui/menu_item.ts", "file_manager/foreground/js/ui/splitter.ts", "file_manager/foreground/js/ui/table/table_column.ts", @@ -526,6 +526,7 @@ "file_manager/foreground/js/ui/file_table_list_unittest.ts", "file_manager/foreground/js/ui/file_table_unittest.ts", "file_manager/foreground/js/ui/grid_unittest.ts", + "file_manager/foreground/js/ui/menu_unittest.ts", "file_manager/foreground/js/ui/list_single_selection_model_unittest.ts", "file_manager/foreground/js/ui/list_selection_model_test_util.ts", "file_manager/foreground/js/ui/list_selection_model_unittest.ts", @@ -633,7 +634,6 @@ "file_manager/foreground/js/ui/context_menu_handler_unittest.js", "file_manager/foreground/js/ui/file_tap_handler_unittest.js", "file_manager/foreground/js/ui/install_linux_package_dialog_unittest.js", - "file_manager/foreground/js/ui/menu_unittest.js", "file_manager/foreground/js/ui/menu_button_unittest.js", "file_manager/foreground/js/ui/multi_menu_unittest.js", "file_manager/foreground/js/ui/position_util_unittest.js",
diff --git a/url/origin.cc b/url/origin.cc index 6650e42..f4dc2d4 100644 --- a/url/origin.cc +++ b/url/origin.cc
@@ -261,6 +261,10 @@ return Origin(Nonce(), tuple_); } +const base::UnguessableToken* Origin::GetNonceForTesting() const { + return GetNonceForSerialization(); +} + std::string Origin::GetDebugString(bool include_nonce) const { // Handle non-opaque origins first, as they are simpler. if (!opaque()) {
diff --git a/url/origin.h b/url/origin.h index 01cd57f..3e639b0 100644 --- a/url/origin.h +++ b/url/origin.h
@@ -37,6 +37,10 @@ class StorageKeyTest; } // namespace blink +namespace content { +class SiteInfo; +} // namespace content + namespace IPC { template <class P> struct ParamTraits; @@ -301,6 +305,10 @@ // |d|, and |d| is cross-origin to |a| and |c|. Origin DeriveNewOpaqueOrigin() const; + // Returns the nonce associated with the origin, if it is opaque, or nullptr + // otherwise. This is only for use in tests. + const base::UnguessableToken* GetNonceForTesting() const; + // Creates a string representation of the object that can be used for logging // and debugging. It serializes the internal state, such as the nonce value // and precursor information. @@ -336,6 +344,9 @@ friend class blink::SecurityOrigin; friend class blink::SecurityOriginTest; friend class blink::StorageKey; + // SiteInfo needs the nonce to compute the site URL for some opaque origins, + // like data: URLs. + friend class content::SiteInfo; // SchemefulSite needs access to the serialization/deserialization logic which // includes the nonce. friend class net::SchemefulSite;
diff --git a/v8 b/v8 index ebf02ba..21cb77a 160000 --- a/v8 +++ b/v8
@@ -1 +1 @@ -Subproject commit ebf02ba08602e6e8d46a85c1035663f497a40d22 +Subproject commit 21cb77a290b0f8d9174e681e9994fd0789957c0b