diff --git a/AUTHORS b/AUTHORS index 22e8e1f..2389965 100644 --- a/AUTHORS +++ b/AUTHORS
@@ -1208,6 +1208,7 @@ Sam Larison <qufighter@gmail.com> Sam McDonald <sam@sammcd.com> Samuel Attard <samuel.r.attard@gmail.com> +Samuel Maddock <samuelmaddock@electronjs.org> Sanfeng Liao <sanfengliao@gmail.com> Sanggi Hong <sanggi.hong11@gmail.com> Sanghee Lee <sanghee.lee1992@gmail.com>
diff --git a/DEPS b/DEPS index c2059137..2e87ee4 100644 --- a/DEPS +++ b/DEPS
@@ -288,7 +288,7 @@ 'sysroots_json_path': 'build/linux/sysroot_scripts/sysroots.json', # siso CIPD package version. - 'siso_version': 'git_revision:366e623c64429778827e021672a260553c7bd068', + 'siso_version': 'git_revision:70d9e16bcc9dff0264905018f5a5652b37ed0e10', # download libaom test data 'download_libaom_testdata': False, @@ -308,19 +308,19 @@ # 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': '6015cc82ed055a33d04a0ebc3febc8038288f114', + 'src_internal_revision': '86024ec8f24dadbe2937c11b92d6e0acd82d4b4c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '510b6766d90700a4581c2a3b3829c775e4a1c8d3', + 'skia_revision': '15da9c78ddbd184784fb31cbd6d7230bbe655ea2', # 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': '176cc80784780eba961f5a771e360eab581416f0', + 'v8_revision': '11f0340b178419d19933cc12066683648b4a2d4b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': 'a443959993c4ed30d8e2310e5b3c7d6dabb0d462', + 'angle_revision': '9c2632b3df7e49e8c51d39a6234887535e5d5978', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -383,7 +383,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': 'acbc4b1e3c39143cd2902cf7be091c5e84bae613', + 'catapult_revision': '01d7072ad67e17b1ba7dded7955e399f29859bd6', # 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. @@ -403,7 +403,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': '57aae6355b4f6475d7c9890144f86a25ce43d1a9', + 'devtools_frontend_revision': '05a061038727599586ae07a46e7408a1083cef94', # 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. @@ -427,11 +427,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': 'ceaa4ebd3f266ebcd71627fb58517ad774b55c43', + 'dawn_revision': '2f3cdea8d70c3504bbfa06bfde136c87f3f4b1f1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'quiche_revision': '996eb304c694f34aa8d855ca12f5173697b2574f', + 'quiche_revision': 'ee429dd8e97c8bcc4d4373847f7a982f6fb14da5', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ios_webkit # and whatever else without interference from each other. @@ -475,7 +475,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': '3d5fbf62d7c7d34b1ecf72dd09577117ed370343', + 'cros_components_revision': 'bf7ce66098c3f9f28fb211f7f625d99a20cca5d3', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -834,7 +834,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - '5adefb939901b88ee5b674e74bc2223694aa45b1', + 'e746c821dc691b97bd4ad986c2d1c735f79ef884', 'condition': 'checkout_android and checkout_src_internal', }, @@ -989,7 +989,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'zjTkDjEytq8UvMcux37svh6JASctwxfi7K-XJ3tY-CEC', + 'version': 'vH4-Dcmlv3sN2aI4cWGkJcLoqSzpbyetwkVKIqmzvooC', }, ], 'condition': 'checkout_android', @@ -1199,13 +1199,13 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '13f6ecbbbb132e471ed2dda5e7d0aba5c7061249', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'fb94001f066d0e38ab14c7413714ed17bfa34082', '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' + '@' + '0b0e6ad1a48238320459d614924bd71c5b11310c', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '6a4a154f0261a27786fcd3cdc4ae40248c2367ec', 'condition': 'checkout_src_internal', }, @@ -1662,7 +1662,7 @@ Var('chromium_git') + '/external/github.com/cisco/openh264' + '@' + '09a4f3ec842a8932341b195c5b01e141c8a16eb7', 'src/third_party/openscreen/src': - Var('chromium_git') + '/openscreen' + '@' + '5aa9736c70d5374fd4b1aab1fbeeb3599353ed60', + Var('chromium_git') + '/openscreen' + '@' + 'b2f1cb493bd278159520aed705714c86225e167e', 'src/third_party/openxr/src': { 'url': Var('chromium_git') + '/external/github.com/KhronosGroup/OpenXR-SDK' + '@' + '95fe35ffb383710a6e0567e958ead9a3b66e930c', @@ -1673,7 +1673,7 @@ Var('pdfium_git') + '/pdfium.git' + '@' + Var('pdfium_revision'), 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '196f4d514c286377a44fd10762b7e33e81c38e23', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '234fd02711c642ec5211da272283db8fd8d91af4', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '8ef97ff3b7332e38e61b347a2fbed425a4617151', @@ -1861,7 +1861,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'bf1843b38f586e55fd1fa6f6a084f3a5f92f3047', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '0a8703b5c117ea8a6bd5eb7fa6d350681126cb20', + Var('webrtc_git') + '/src.git' + '@' + 'caa1201a080044dc9dd71d6c5abaef1d21782e7a', # 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. @@ -1995,7 +1995,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'RSTmRq1VYCOjfui1Ojwt7N8AC2PdjJR2AxTmhCwh-fsC', + 'version': 'x51W3cWkkkJH91KyNgQ4NVXbcdVfed7BlrqJq3F_KCAC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -2028,7 +2028,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/projector_app/app', - 'version': '7pRCUCi-rbKicyrTuwvChRxijVPZGUel3I7KuO1nwHsC', + 'version': 'MOlgl1DphgLlbQvFdJVW3hHR3IgBGUIYCUKuK1-KZWEC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -3864,7 +3864,7 @@ # Dependencies from src_internal 'src/chromeos/ash/resources/internal': { 'url': Var('chrome_git') + '/chrome/chromeos/ash/resources/internal.git' + '@' + - '3a961174a24cfda9e444f54e3f1c783f75838b41', + 'bc844cc95077f161fff18f57fee76b33303d48c2', 'condition': 'checkout_src_internal and checkout_chromeos', }, @@ -4081,7 +4081,7 @@ 'src/components/optimization_guide/internal': { 'url': Var('chrome_git') + '/chrome/components/optimization_guide.git' + '@' + - '607dfc435ce5ae150eb6625806ea0dfc3a698707', + '73f3778a3e87a9ce13ab216756311a61eeb2ee47', 'condition': 'checkout_src_internal', }, @@ -4141,7 +4141,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - '41b4928328ee54a1c5d0942b67c3b0e61cbfa803', + '6fcbad302d63b7780d0873442c45b64f3605518e', 'condition': 'checkout_ios and checkout_src_internal', }, @@ -5561,6 +5561,7 @@ 'download', '--depot-tools', 'src/third_party/depot_tools', + '--quiet', ], },
diff --git a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java index 56a3f1ac..aa8ed4e3 100644 --- a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java +++ b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java
@@ -767,6 +767,9 @@ "Straightens free lists for larger slot spans in PartitionRoot::PurgeMemory() -> " + "... -> PartitionPurgeSlotSpan()."), Flag.baseFeature( + "PartitionAllocUsePoolOffsetFreelists", + "Activates an alternative freelist implementation in PartitionAlloc."), + Flag.baseFeature( BlinkFeatures.FORM_CONTROLS_VERTICAL_WRITING_MODE_TEXT_SUPPORT, "Enables support for CSS vertical writing mode on text-based form controls."), Flag.baseFeature(
diff --git a/ash/accessibility/autoclick/autoclick_ring_handler.cc b/ash/accessibility/autoclick/autoclick_ring_handler.cc index 51ef37c..bb1a47b 100644 --- a/ash/accessibility/autoclick/autoclick_ring_handler.cc +++ b/ash/accessibility/autoclick/autoclick_ring_handler.cc
@@ -115,7 +115,8 @@ private: // Overridden from views::View. - gfx::Size CalculatePreferredSize() const override { + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override { return gfx::Size(2 * (radius_ + kAutoclickRingArcWidth * 2), 2 * (radius_ + kAutoclickRingArcWidth * 2)); }
diff --git a/ash/accessibility/magnifier/magnifier_test_utils.cc b/ash/accessibility/magnifier/magnifier_test_utils.cc index 0161983..badfb12 100644 --- a/ash/accessibility/magnifier/magnifier_test_utils.cc +++ b/ash/accessibility/magnifier/magnifier_test_utils.cc
@@ -50,7 +50,8 @@ TestTextInputView& operator=(const TestTextInputView&) = delete; ~TestTextInputView() override = default; - gfx::Size CalculatePreferredSize() const override { + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override { return gfx::Size(50, 50); }
diff --git a/ash/accessibility/mouse_keys/mouse_keys_unittest.cc b/ash/accessibility/mouse_keys/mouse_keys_unittest.cc index 8116cc21..daffd18 100644 --- a/ash/accessibility/mouse_keys/mouse_keys_unittest.cc +++ b/ash/accessibility/mouse_keys/mouse_keys_unittest.cc
@@ -51,7 +51,8 @@ TestTextInputView& operator=(const TestTextInputView&) = delete; ~TestTextInputView() override = default; - gfx::Size CalculatePreferredSize() const override { + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override { return gfx::Size(50, 50); }
diff --git a/ash/app_list/views/app_list_bubble_view.cc b/ash/app_list/views/app_list_bubble_view.cc index 28fb05e..5f16543 100644 --- a/ash/app_list/views/app_list_bubble_view.cc +++ b/ash/app_list/views/app_list_bubble_view.cc
@@ -115,7 +115,8 @@ ~SeparatorWithLayer() override = default; // views::View: - gfx::Size CalculatePreferredSize() const override { + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override { // The parent's layout manager will stretch it horizontally. return gfx::Size(1, 1); }
diff --git a/ash/app_list/views/app_list_item_view.cc b/ash/app_list/views/app_list_item_view.cc index 0590207..7f8af2d4 100644 --- a/ash/app_list/views/app_list_item_view.cc +++ b/ash/app_list/views/app_list_item_view.cc
@@ -1537,7 +1537,8 @@ } } -gfx::Size AppListItemView::CalculatePreferredSize() const { +gfx::Size AppListItemView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return gfx::Size(app_list_config_->grid_tile_width(), app_list_config_->grid_tile_height()); }
diff --git a/ash/app_list/views/app_list_item_view.h b/ash/app_list/views/app_list_item_view.h index 811c261..f9bd521 100644 --- a/ash/app_list/views/app_list_item_view.h +++ b/ash/app_list/views/app_list_item_view.h
@@ -418,7 +418,8 @@ // views::View overrides: void Layout(PassKey) override; - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; bool OnKeyPressed(const ui::KeyEvent& event) override; bool OnMousePressed(const ui::MouseEvent& event) override; void OnMouseReleased(const ui::MouseEvent& event) override;
diff --git a/ash/app_list/views/app_list_toast_view.cc b/ash/app_list/views/app_list_toast_view.cc index 4b79c90..a96722d4 100644 --- a/ash/app_list/views/app_list_toast_view.cc +++ b/ash/app_list/views/app_list_toast_view.cc
@@ -330,7 +330,8 @@ available_width_ = width; } -gfx::Size AppListToastView::CalculatePreferredSize() const { +gfx::Size AppListToastView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { const int available_width = std::min( kToastMaximumWidth, available_width_.value_or(kToastMaximumWidth));
diff --git a/ash/app_list/views/app_list_toast_view.h b/ash/app_list/views/app_list_toast_view.h index 84dbdcc..01e901b 100644 --- a/ash/app_list/views/app_list_toast_view.h +++ b/ash/app_list/views/app_list_toast_view.h
@@ -85,7 +85,8 @@ ~AppListToastView() override; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; void SetButton(std::u16string button_text,
diff --git a/ash/app_list/views/apps_collections_dismiss_dialog.cc b/ash/app_list/views/apps_collections_dismiss_dialog.cc index 21f821ee7..f81516e 100644 --- a/ash/app_list/views/apps_collections_dismiss_dialog.cc +++ b/ash/app_list/views/apps_collections_dismiss_dialog.cc
@@ -150,9 +150,12 @@ AppsCollectionsDismissDialog::~AppsCollectionsDismissDialog() {} -gfx::Size AppsCollectionsDismissDialog::CalculatePreferredSize() const { +gfx::Size AppsCollectionsDismissDialog::CalculatePreferredSize( + const views::SizeBounds& available_size) const { const int default_width = kDialogWidth; - return gfx::Size(default_width, GetHeightForWidth(default_width)); + return gfx::Size( + default_width, + GetLayoutManager()->GetPreferredHeightForWidth(this, default_width)); } BEGIN_METADATA(AppsCollectionsDismissDialog)
diff --git a/ash/app_list/views/apps_collections_dismiss_dialog.h b/ash/app_list/views/apps_collections_dismiss_dialog.h index aa016b238..4d56552 100644 --- a/ash/app_list/views/apps_collections_dismiss_dialog.h +++ b/ash/app_list/views/apps_collections_dismiss_dialog.h
@@ -37,7 +37,8 @@ ~AppsCollectionsDismissDialog() override; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; views::Button* cancel_button_for_test() { return cancel_button_; } views::Button* accept_button_for_test() { return accept_button_; }
diff --git a/ash/app_list/views/apps_grid_view.cc b/ash/app_list/views/apps_grid_view.cc index bb470a63..05d971c 100644 --- a/ash/app_list/views/apps_grid_view.cc +++ b/ash/app_list/views/apps_grid_view.cc
@@ -1124,7 +1124,8 @@ return view->layer() && view->layer()->GetAnimator()->is_animating(); } -gfx::Size AppsGridView::CalculatePreferredSize() const { +gfx::Size AppsGridView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return GetTileGridSize(); }
diff --git a/ash/app_list/views/apps_grid_view.h b/ash/app_list/views/apps_grid_view.h index b942605..0ce17ac 100644 --- a/ash/app_list/views/apps_grid_view.h +++ b/ash/app_list/views/apps_grid_view.h
@@ -173,7 +173,8 @@ const AppListItem* drag_item() const { return drag_item_; } // Overridden from views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; bool OnKeyPressed(const ui::KeyEvent& event) override; bool OnKeyReleased(const ui::KeyEvent& event) override; void ViewHierarchyChanged(
diff --git a/ash/app_list/views/assistant/assistant_dialog_plate.cc b/ash/app_list/views/assistant/assistant_dialog_plate.cc index 61e9e92..7ebc553 100644 --- a/ash/app_list/views/assistant/assistant_dialog_plate.cc +++ b/ash/app_list/views/assistant/assistant_dialog_plate.cc
@@ -124,8 +124,10 @@ AssistantInteractionController::Get()->GetModel()->RemoveObserver(this); } -gfx::Size AssistantDialogPlate::CalculatePreferredSize() const { - return gfx::Size(INT_MAX, GetHeightForWidth(INT_MAX)); +gfx::Size AssistantDialogPlate::CalculatePreferredSize( + const views::SizeBounds& available_size) const { + return gfx::Size( + INT_MAX, GetLayoutManager()->GetPreferredHeightForWidth(this, INT_MAX)); } void AssistantDialogPlate::OnButtonPressed(AssistantButtonId button_id) {
diff --git a/ash/app_list/views/assistant/assistant_dialog_plate.h b/ash/app_list/views/assistant/assistant_dialog_plate.h index ec15361..933890e 100644 --- a/ash/app_list/views/assistant/assistant_dialog_plate.h +++ b/ash/app_list/views/assistant/assistant_dialog_plate.h
@@ -58,7 +58,8 @@ ~AssistantDialogPlate() override; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void RequestFocus() override; void OnThemeChanged() override;
diff --git a/ash/app_list/views/continue_task_view.cc b/ash/app_list/views/continue_task_view.cc index 1048cdd..bfe95e8 100644 --- a/ash/app_list/views/continue_task_view.cc +++ b/ash/app_list/views/continue_task_view.cc
@@ -197,7 +197,8 @@ GetLayoutManager()->GetPreferredSize(this).height()); } -gfx::Size ContinueTaskView::CalculatePreferredSize() const { +gfx::Size ContinueTaskView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return GetMinimumSize(); }
diff --git a/ash/app_list/views/continue_task_view.h b/ash/app_list/views/continue_task_view.h index 1f6650d4..254680e 100644 --- a/ash/app_list/views/continue_task_view.h +++ b/ash/app_list/views/continue_task_view.h
@@ -56,7 +56,8 @@ ~ContinueTaskView() override; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; gfx::Size GetMinimumSize() const override; gfx::Size GetMaximumSize() const override; void OnThemeChanged() override;
diff --git a/ash/app_list/views/folder_header_view.cc b/ash/app_list/views/folder_header_view.cc index 93df4646..5637dc7 100644 --- a/ash/app_list/views/folder_header_view.cc +++ b/ash/app_list/views/folder_header_view.cc
@@ -509,7 +509,8 @@ return folder_name_view_->GetEnabled(); } -gfx::Size FolderHeaderView::CalculatePreferredSize() const { +gfx::Size FolderHeaderView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return gfx::Size(kMaxFolderHeaderWidth, folder_name_view_->GetPreferredSize().height()); }
diff --git a/ash/app_list/views/folder_header_view.h b/ash/app_list/views/folder_header_view.h index bee22f8..10a332e 100644 --- a/ash/app_list/views/folder_header_view.h +++ b/ash/app_list/views/folder_header_view.h
@@ -42,7 +42,8 @@ bool is_tablet_mode() const { return is_tablet_mode_; } // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void OnBoundsChanged(const gfx::Rect& previous_bounds) override; views::Textfield* GetFolderNameViewForTest() const;
diff --git a/ash/app_list/views/page_switcher.cc b/ash/app_list/views/page_switcher.cc index 4b82888..d155c0b 100644 --- a/ash/app_list/views/page_switcher.cc +++ b/ash/app_list/views/page_switcher.cc
@@ -152,11 +152,20 @@ model_->RemoveObserver(this); } -gfx::Size PageSwitcher::CalculatePreferredSize() const { +gfx::Size PageSwitcher::CalculatePreferredSize( + const views::SizeBounds& available_size) const { + views::SizeBounds content_available_size(available_size); + content_available_size.set_width(2 * PageSwitcher::kMaxButtonRadius); + + gfx::Insets insets = GetInsets(); + content_available_size.Enlarge(-insets.width(), -insets.height()); + + gfx::Size buttons_size = buttons_->GetPreferredSize(content_available_size); + // Always return a size with correct width so that container resize is not // needed when more pages are added. return gfx::Size(2 * PageSwitcher::kMaxButtonRadius, - buttons_->GetPreferredSize().height()); + buttons_size.height() + insets.height()); } void PageSwitcher::Layout(PassKey) {
diff --git a/ash/app_list/views/page_switcher.h b/ash/app_list/views/page_switcher.h index d5c5a76..c101a86b 100644 --- a/ash/app_list/views/page_switcher.h +++ b/ash/app_list/views/page_switcher.h
@@ -34,7 +34,8 @@ ~PageSwitcher() override; // Overridden from views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; void OnThemeChanged() override;
diff --git a/ash/app_list/views/remove_query_confirmation_dialog.cc b/ash/app_list/views/remove_query_confirmation_dialog.cc index 13bc54a8..85b570e 100644 --- a/ash/app_list/views/remove_query_confirmation_dialog.cc +++ b/ash/app_list/views/remove_query_confirmation_dialog.cc
@@ -168,9 +168,12 @@ RemoveQueryConfirmationDialog::~RemoveQueryConfirmationDialog() = default; -gfx::Size RemoveQueryConfirmationDialog::CalculatePreferredSize() const { +gfx::Size RemoveQueryConfirmationDialog::CalculatePreferredSize( + const views::SizeBounds& available_size) const { const int default_width = kDialogWidth; - return gfx::Size(default_width, GetHeightForWidth(default_width)); + return gfx::Size( + default_width, + GetLayoutManager()->GetPreferredHeightForWidth(this, default_width)); } void RemoveQueryConfirmationDialog::GetAccessibleNodeData(
diff --git a/ash/app_list/views/remove_query_confirmation_dialog.h b/ash/app_list/views/remove_query_confirmation_dialog.h index d53053a..c0de040 100644 --- a/ash/app_list/views/remove_query_confirmation_dialog.h +++ b/ash/app_list/views/remove_query_confirmation_dialog.h
@@ -43,7 +43,8 @@ ~RemoveQueryConfirmationDialog() override; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; views::Button* cancel_button_for_test() { return cancel_button_; }
diff --git a/ash/app_list/views/search_result_image_view.cc b/ash/app_list/views/search_result_image_view.cc index 8322ff66..98263f26b 100644 --- a/ash/app_list/views/search_result_image_view.cc +++ b/ash/app_list/views/search_result_image_view.cc
@@ -116,7 +116,8 @@ true /* by_button_press */); } -gfx::Size SearchResultImageView::CalculatePreferredSize() const { +gfx::Size SearchResultImageView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { // Keep the ratio of the width and height be 3:2. return gfx::Size(preferred_width_, 2 * preferred_width_ / 3); }
diff --git a/ash/app_list/views/search_result_image_view.h b/ash/app_list/views/search_result_image_view.h index ca08a3e..e879f8d 100644 --- a/ash/app_list/views/search_result_image_view.h +++ b/ash/app_list/views/search_result_image_view.h
@@ -34,7 +34,8 @@ void OnImageViewPressed(const ui::Event& event); // Overridden from views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; // Updates `preferred_width_`. void ConfigureLayoutForAvailableWidth(int width);
diff --git a/ash/app_list/views/search_result_list_view.cc b/ash/app_list/views/search_result_list_view.cc index ea18d5f..d581305 100644 --- a/ash/app_list/views/search_result_list_view.cc +++ b/ash/app_list/views/search_result_list_view.cc
@@ -334,8 +334,9 @@ results_container_->SetBoundsRect(GetLocalBounds()); } -gfx::Size SearchResultListView::CalculatePreferredSize() const { - return results_container_->GetPreferredSize(); +gfx::Size SearchResultListView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { + return results_container_->GetPreferredSize(available_size); } int SearchResultListView::GetHeightForWidth(int w) const {
diff --git a/ash/app_list/views/search_result_list_view.h b/ash/app_list/views/search_result_list_view.h index aae400d..dc5c80f 100644 --- a/ash/app_list/views/search_result_list_view.h +++ b/ash/app_list/views/search_result_list_view.h
@@ -96,7 +96,8 @@ SearchResultActionType action); // Overridden from views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; // Overridden from SearchResultContainerView: SearchResultView* GetResultViewAt(size_t index) override;
diff --git a/ash/app_list/views/search_result_page_view.cc b/ash/app_list/views/search_result_page_view.cc index 437ea56..9ca24c1 100644 --- a/ash/app_list/views/search_result_page_view.cc +++ b/ash/app_list/views/search_result_page_view.cc
@@ -133,7 +133,8 @@ } } -gfx::Size SearchResultPageView::CalculatePreferredSize() const { +gfx::Size SearchResultPageView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { int adjusted_height = std::min(std::max(kMinHeight, search_view_->TabletModePreferredHeight() + kActiveSearchBoxHeight + @@ -399,9 +400,10 @@ bounding_rect.Inset( gfx::Insets::TLBR(0, 0, kSearchResultPageMinimumBottomMargin, 0)); - gfx::Rect preferred_bounds = gfx::Rect( - search_box_bounds.origin(), - gfx::Size(search_box_bounds.width(), CalculatePreferredSize().height())); + gfx::Rect preferred_bounds = + gfx::Rect(search_box_bounds.origin(), + gfx::Size(search_box_bounds.width(), + CalculatePreferredSize({}).height())); preferred_bounds.Intersect(bounding_rect); return preferred_bounds;
diff --git a/ash/app_list/views/search_result_page_view.h b/ash/app_list/views/search_result_page_view.h index e17c3ce..17e1ab8 100644 --- a/ash/app_list/views/search_result_page_view.h +++ b/ash/app_list/views/search_result_page_view.h
@@ -38,7 +38,8 @@ // Overridden from views::View: void VisibilityChanged(View* starting_from, bool is_visible) override; - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void OnBoundsChanged(const gfx::Rect& previous_bounds) override; // AppListPage overrides:
diff --git a/ash/app_list/views/search_result_view.cc b/ash/app_list/views/search_result_view.cc index 0f02d7ec..c16807e 100644 --- a/ash/app_list/views/search_result_view.cc +++ b/ash/app_list/views/search_result_view.cc
@@ -1301,7 +1301,8 @@ } } -gfx::Size SearchResultView::CalculatePreferredSize() const { +gfx::Size SearchResultView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return gfx::Size(kPreferredWidth, PreferredHeight()); }
diff --git a/ash/app_list/views/search_result_view.h b/ash/app_list/views/search_result_view.h index 60eae3e..3c118c9b 100644 --- a/ash/app_list/views/search_result_view.h +++ b/ash/app_list/views/search_result_view.h
@@ -262,7 +262,8 @@ void OnSelectedResultChanged(); // views::View overrides: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; bool OnKeyPressed(const ui::KeyEvent& event) override; void PaintButtonContents(gfx::Canvas* canvas) override;
diff --git a/ash/app_list/views/top_icon_animation_view.cc b/ash/app_list/views/top_icon_animation_view.cc index 6bde220..0ca34784 100644 --- a/ash/app_list/views/top_icon_animation_view.cc +++ b/ash/app_list/views/top_icon_animation_view.cc
@@ -223,7 +223,8 @@ } } -gfx::Size TopIconAnimationView::CalculatePreferredSize() const { +gfx::Size TopIconAnimationView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return gfx::Size(grid_->app_list_config()->grid_tile_width(), grid_->app_list_config()->grid_tile_height()); }
diff --git a/ash/app_list/views/top_icon_animation_view.h b/ash/app_list/views/top_icon_animation_view.h index 4757e1a..534d288 100644 --- a/ash/app_list/views/top_icon_animation_view.h +++ b/ash/app_list/views/top_icon_animation_view.h
@@ -73,7 +73,8 @@ private: // views::View overrides: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; void OnThemeChanged() override;
diff --git a/ash/components/arc/compat_mode/arc_splash_screen_dialog_view.cc b/ash/components/arc/compat_mode/arc_splash_screen_dialog_view.cc index e76490ee..5725111 100644 --- a/ash/components/arc/compat_mode/arc_splash_screen_dialog_view.cc +++ b/ash/components/arc/compat_mode/arc_splash_screen_dialog_view.cc
@@ -296,7 +296,8 @@ ArcSplashScreenDialogView::~ArcSplashScreenDialogView() = default; -gfx::Size ArcSplashScreenDialogView::CalculatePreferredSize() const { +gfx::Size ArcSplashScreenDialogView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { auto width = views::LayoutProvider::Get()->GetDistanceMetric( views::DistanceMetric::DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH); const auto* widget = GetWidget(); @@ -307,7 +308,8 @@ kHorizontalMarginDp * 2, width); } - return gfx::Size(width, GetHeightForWidth(width)); + return gfx::Size(width, + GetLayoutManager()->GetPreferredHeightForWidth(this, width)); } gfx::Rect ArcSplashScreenDialogView::GetBubbleBounds() {
diff --git a/ash/components/arc/compat_mode/arc_splash_screen_dialog_view.h b/ash/components/arc/compat_mode/arc_splash_screen_dialog_view.h index 0369e348..7b6e6c22 100644 --- a/ash/components/arc/compat_mode/arc_splash_screen_dialog_view.h +++ b/ash/components/arc/compat_mode/arc_splash_screen_dialog_view.h
@@ -64,7 +64,8 @@ static void Show(aura::Window* parent, bool is_for_unresizable); // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void AddedToWidget() override; void OnThemeChanged() override;
diff --git a/ash/components/arc/compat_mode/resize_confirmation_dialog_view.cc b/ash/components/arc/compat_mode/resize_confirmation_dialog_view.cc index 37311be..37661d40 100644 --- a/ash/components/arc/compat_mode/resize_confirmation_dialog_view.cc +++ b/ash/components/arc/compat_mode/resize_confirmation_dialog_view.cc
@@ -101,7 +101,8 @@ ResizeConfirmationDialogView::~ResizeConfirmationDialogView() = default; -gfx::Size ResizeConfirmationDialogView::CalculatePreferredSize() const { +gfx::Size ResizeConfirmationDialogView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { views::LayoutProvider* provider = views::LayoutProvider::Get(); int width = provider->GetDistanceMetric( views::DistanceMetric::DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH); @@ -114,7 +115,8 @@ std::min(width, widget->parent()->GetWindowBoundsInScreen().width() - kHorizontalMarginDp * 2); } - return gfx::Size(width, GetHeightForWidth(width)); + return gfx::Size(width, + GetLayoutManager()->GetPreferredHeightForWidth(this, width)); } void ResizeConfirmationDialogView::AddedToWidget() {
diff --git a/ash/components/arc/compat_mode/resize_confirmation_dialog_view.h b/ash/components/arc/compat_mode/resize_confirmation_dialog_view.h index 6dde0c7a5..abd9f44 100644 --- a/ash/components/arc/compat_mode/resize_confirmation_dialog_view.h +++ b/ash/components/arc/compat_mode/resize_confirmation_dialog_view.h
@@ -58,7 +58,8 @@ static void Show(views::Widget* parent, ResizeConfirmationCallback callback); // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void AddedToWidget() override; void OnThemeChanged() override;
diff --git a/ash/components/arc/compat_mode/resize_toggle_menu.cc b/ash/components/arc/compat_mode/resize_toggle_menu.cc index 1711907..cb40cda4 100644 --- a/ash/components/arc/compat_mode/resize_toggle_menu.cc +++ b/ash/components/arc/compat_mode/resize_toggle_menu.cc
@@ -158,9 +158,11 @@ UpdateColors(); } -gfx::Size ResizeToggleMenu::MenuButtonView::CalculatePreferredSize() const { +gfx::Size ResizeToggleMenu::MenuButtonView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { constexpr int kWidth = 96; - return gfx::Size(kWidth, GetHeightForWidth(kWidth)); + return gfx::Size( + kWidth, GetLayoutManager()->GetPreferredHeightForWidth(this, kWidth)); } void ResizeToggleMenu::MenuButtonView::UpdateColors() {
diff --git a/ash/components/arc/compat_mode/resize_toggle_menu.h b/ash/components/arc/compat_mode/resize_toggle_menu.h index 6c2db573..06160e8 100644 --- a/ash/components/arc/compat_mode/resize_toggle_menu.h +++ b/ash/components/arc/compat_mode/resize_toggle_menu.h
@@ -54,7 +54,8 @@ private: // views::View: void OnThemeChanged() override; - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void UpdateColors(); void UpdateState();
diff --git a/ash/constants/ash_pref_names.h b/ash/constants/ash_pref_names.h index aada57af..19f9161 100644 --- a/ash/constants/ash_pref_names.h +++ b/ash/constants/ash_pref_names.h
@@ -1927,10 +1927,6 @@ inline constexpr char kInputForceRespectUiGainsEnabled[] = "ash.input_force_respect_ui_gains_enabled"; -// A boolean pref indicating whether the glanceables feature is allowed to be -// used for managed device. -inline constexpr char kGlanceablesEnabled[] = "ash.glanceables_enabled"; - // An integer pref that tracks how many times (3) we'll show the user a // notification when an incoming event would have been remapped to a right // click but either the user's setting is inconsistent with the matched
diff --git a/ash/display/display_alignment_indicator.cc b/ash/display/display_alignment_indicator.cc index 904e718b..9919d91a 100644 --- a/ash/display/display_alignment_indicator.cc +++ b/ash/display/display_alignment_indicator.cc
@@ -250,15 +250,13 @@ ~IndicatorPillView() override = default; // views::View: - gfx::Size CalculatePreferredSize() const override { + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override { // Pill is laid out as: // ( | | text ) // Has max width of kMaxPillWidth. - const int text_width = text_label_ - ->CalculatePreferredSize( - views::SizeBounds(text_label_->width(), {})) - .width(); + const int text_width = text_label_->CalculatePreferredSize({}).width(); const int width = kArrowAllocatedWidth + text_width + kTextMarginNormal; return gfx::Size(std::min(width, kMaxPillWidth), kPillHeight); @@ -281,7 +279,7 @@ // If width of the pill is equal or greater than the max pill width, then // text is elided and thus side margin must be reduced. - const int side_margin = CalculatePreferredSize().width() >= kMaxPillWidth + const int side_margin = CalculatePreferredSize({}).width() >= kMaxPillWidth ? kTextMarginElided : kTextMarginNormal;
diff --git a/ash/display/display_change_dialog.cc b/ash/display/display_change_dialog.cc index 3c03a2f08..68a31fa 100644 --- a/ash/display/display_change_dialog.cc +++ b/ash/display/display_change_dialog.cc
@@ -73,7 +73,8 @@ std::move(on_cancel_callback_).Run(/*display_was_removed=*/false); } -gfx::Size DisplayChangeDialog::CalculatePreferredSize() const { +gfx::Size DisplayChangeDialog::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return gfx::Size(350, 100); }
diff --git a/ash/display/display_change_dialog.h b/ash/display/display_change_dialog.h index 812aafc..d559c44 100644 --- a/ash/display/display_change_dialog.h +++ b/ash/display/display_change_dialog.h
@@ -37,7 +37,8 @@ DisplayChangeDialog& operator=(const DisplayChangeDialog&) = delete; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; base::WeakPtr<DisplayChangeDialog> GetWeakPtr();
diff --git a/ash/events/peripheral_customization_event_rewriter.cc b/ash/events/peripheral_customization_event_rewriter.cc index 0a1ebdbb..abb18e2 100644 --- a/ash/events/peripheral_customization_event_rewriter.cc +++ b/ash/events/peripheral_customization_event_rewriter.cc
@@ -652,10 +652,23 @@ } auto* mouse = controller->GetMouse(key_event.source_device_id()); + auto* keyboard = controller->GetKeyboard(key_event.source_device_id()); if (!mouse) { return; } + if (mouse && keyboard) { + base::UmaHistogramSparse("ChromeOS.Inputs.Mouse.InvalidRegistration.Combo", + key_event.key_code()); + return; + } + + if (mouse) { + base::UmaHistogramSparse( + "ChromeOS.Inputs.Mouse.InvalidRegistration.NonCombo", + key_event.key_code()); + } + LOG(WARNING) << base::StringPrintf( "Mouse '%s' with identifier '%s' attempted to register keyboard code " "'%04x'.",
diff --git a/ash/events/peripheral_customization_event_rewriter_unittest.cc b/ash/events/peripheral_customization_event_rewriter_unittest.cc index 4d7e6f22..176ec433 100644 --- a/ash/events/peripheral_customization_event_rewriter_unittest.cc +++ b/ash/events/peripheral_customization_event_rewriter_unittest.cc
@@ -56,6 +56,7 @@ constexpr int kMouseDeviceId = 1; constexpr int kGraphicsTabletDeviceId = 2; constexpr int kRandomKeyboardDeviceId = 3; +constexpr int kComboDeviceId = 4; class TestEventSink : public ui::EventSink { public: @@ -540,10 +541,14 @@ .WillByDefault(testing::Return(keyboard_->settings.get())); ON_CALL(*controller_, GetKeyboard(kRandomKeyboardDeviceId)) .WillByDefault(testing::Return(keyboard_.get())); + ON_CALL(*controller_, GetKeyboard(kComboDeviceId)) + .WillByDefault(testing::Return(keyboard_.get())); ON_CALL(*controller_, GetGraphicsTablet(kGraphicsTabletDeviceId)) .WillByDefault(testing::Return(graphics_tablet_.get())); ON_CALL(*controller_, GetMouse(kMouseDeviceId)) .WillByDefault(testing::Return(mouse_.get())); + ON_CALL(*controller_, GetMouse(kComboDeviceId)) + .WillByDefault(testing::Return(mouse_.get())); rewriter_ = std::make_unique<PeripheralCustomizationEventRewriter>( controller_.get()); metrics_manager_ = std::make_unique<InputDeviceSettingsMetricsManager>(); @@ -1062,6 +1067,41 @@ "ChromeOS.Inputs.Mouse.InvalidRegistration", KeyB::Pressed().keycode, 1); } +TEST_F(PeripheralCustomizationEventRewriterTest, + ComboMouseInvalidRegistrationMetric) { + base::HistogramTester histogram_tester; + + rewriter_->StartObservingMouse( + kComboDeviceId, + mojom::CustomizationRestriction::kDisableKeyEventRewrites); + + EXPECT_EQ(KeyA::Typed(), + RunRewriter(KeyA::Typed(), ui::EF_NONE, kComboDeviceId)); + histogram_tester.ExpectBucketCount( + "ChromeOS.Inputs.Mouse.InvalidRegistration.Combo", + KeyA::Pressed().keycode, 1); + + EXPECT_EQ(KeyB::Typed(), + RunRewriter(KeyB::Typed(), ui::EF_NONE, kComboDeviceId)); + histogram_tester.ExpectBucketCount( + "ChromeOS.Inputs.Mouse.InvalidRegistration.Combo", + KeyB::Pressed().keycode, 1); + + rewriter_->StartObservingMouse( + kMouseDeviceId, + mojom::CustomizationRestriction::kDisableKeyEventRewrites); + + EXPECT_EQ(KeyA::Typed(), RunRewriter(KeyA::Typed())); + histogram_tester.ExpectBucketCount( + "ChromeOS.Inputs.Mouse.InvalidRegistration.NonCombo", + KeyA::Pressed().keycode, 1); + + EXPECT_EQ(KeyB::Typed(), RunRewriter(KeyB::Typed())); + histogram_tester.ExpectBucketCount( + "ChromeOS.Inputs.Mouse.InvalidRegistration.NonCombo", + KeyB::Pressed().keycode, 1); +} + class MouseButtonObserverTest : public PeripheralCustomizationEventRewriterTest, public testing::WithParamInterface<EventRewriterTestData> {};
diff --git a/ash/glanceables/glanceables_controller.cc b/ash/glanceables/glanceables_controller.cc index 16b9a563..df93c33 100644 --- a/ash/glanceables/glanceables_controller.cc +++ b/ash/glanceables/glanceables_controller.cc
@@ -35,8 +35,6 @@ // static void GlanceablesController::RegisterUserProfilePrefs( PrefRegistrySimple* registry) { - registry->RegisterBooleanPref(prefs::kGlanceablesEnabled, true); - base::Value::List default_integrations; default_integrations.Append(prefs::kGoogleCalendarIntegrationName); default_integrations.Append(prefs::kGoogleClassroomIntegrationName);
diff --git a/ash/glanceables/post_login_glanceables_metrics_recorder_unittest.cc b/ash/glanceables/post_login_glanceables_metrics_recorder_unittest.cc index 68e4a71..a52516f 100644 --- a/ash/glanceables/post_login_glanceables_metrics_recorder_unittest.cc +++ b/ash/glanceables/post_login_glanceables_metrics_recorder_unittest.cc
@@ -4,19 +4,35 @@ #include "ash/glanceables/post_login_glanceables_metrics_recorder.h" +#include <list> + #include "ash/calendar/calendar_controller.h" #include "ash/shell.h" #include "ash/system/status_area_widget_test_helper.h" +#include "ash/system/time/calendar_list_model.h" #include "ash/system/time/calendar_unittest_utils.h" #include "ash/system/unified/date_tray.h" #include "ash/test/ash_test_base.h" #include "base/test/metrics/histogram_tester.h" +#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/time/time.h" #include "components/account_id/account_id.h" namespace ash { +namespace { + +using ::google_apis::calendar::SingleCalendar; + +constexpr char kCalendarId1[] = "user1@email.com"; +constexpr char kCalendarSummary1[] = "user1@email.com"; +constexpr char kCalendarColorId1[] = "12"; +bool kCalendarSelected1 = true; +bool kCalendarPrimary1 = true; + +} // namespace + class PostLoginGlanceablesMetricsRecorderTest : public AshTestBase { public: PostLoginGlanceablesMetricsRecorderTest() @@ -25,24 +41,9 @@ void SetUp() override { AshTestBase::SetUp(); - AccountId account_id = AccountId::FromUserEmail("user1@email.com"); - calendar_client_ = - std::make_unique<calendar_test_utils::CalendarClientTestImpl>(); - Shell::Get()->calendar_controller()->SetActiveUserAccountIdForTesting( - account_id); - Shell::Get()->calendar_controller()->RegisterClientForUser( - account_id, calendar_client_.get()); - histogram_tester_ = std::make_unique<base::HistogramTester>(); } - void ToggleDateTray() { - DateTray* date_tray = - StatusAreaWidgetTestHelper::GetStatusAreaWidget()->date_tray(); - LeftClickOn(date_tray); - LeftClickOn(date_tray); - } - void ToggleOverview() { auto* overview_controller = Shell::Get()->overview_controller(); overview_controller->StartOverview(OverviewStartAction::kTests); @@ -67,8 +68,6 @@ private: std::unique_ptr<base::HistogramTester> histogram_tester_; - - std::unique_ptr<calendar_test_utils::CalendarClientTestImpl> calendar_client_; }; TEST_F(PostLoginGlanceablesMetricsRecorderTest, OverviewFetch) { @@ -108,7 +107,104 @@ /*thirty_second_delay_sample_count=*/2); } -TEST_F(PostLoginGlanceablesMetricsRecorderTest, CalendarFetch) { +TEST_F(PostLoginGlanceablesMetricsRecorderTest, FullRestore) { + ExpectBucketCounts(PostLoginGlanceablesMetricsRecorder::DataFetchEventSource:: + kPostLoginFullRestore, + /*no_delay_sample_count=*/0, + /*fifteen_second_delay_sample_count=*/0, + /*thirty_second_delay_sample_count=*/0); + + Shell::Get() + ->post_login_glanceables_metrics_reporter() + ->RecordPostLoginFullRestoreShown(); + + ExpectBucketCounts(PostLoginGlanceablesMetricsRecorder::DataFetchEventSource:: + kPostLoginFullRestore, + /*no_delay_sample_count=*/1, + /*fifteen_second_delay_sample_count=*/1, + /*thirty_second_delay_sample_count=*/1); +} + +class PostLoginGlanceablesMetricsRecorderCalendarTest + : public AshTestBase, + public testing::WithParamInterface</*multi_calendar_enabled=*/bool> { + public: + PostLoginGlanceablesMetricsRecorderCalendarTest() + : AshTestBase(base::test::TaskEnvironment::TimeSource::MOCK_TIME) { + scoped_feature_list_.InitWithFeatureState(features::kMultiCalendarSupport, + IsMultiCalendarEnabled()); + } + + void SetUp() override { + AshTestBase::SetUp(); + + AccountId account_id = AccountId::FromUserEmail("user1@email.com"); + calendar_client_ = + std::make_unique<calendar_test_utils::CalendarClientTestImpl>(); + Shell::Get()->calendar_controller()->SetActiveUserAccountIdForTesting( + account_id); + Shell::Get()->calendar_controller()->RegisterClientForUser( + account_id, calendar_client_.get()); + + if (IsMultiCalendarEnabled()) { + // A calendar list is fetched prior to the event fetch. Set a mock result + // so the calendar list fetch is successful. + SetCalendarList(); + // Shorten the response delay so the calendar list fetch returns quickly. + calendar_client_->SetResponseDelay(base::Milliseconds(100)); + } + + histogram_tester_ = std::make_unique<base::HistogramTester>(); + } + + bool IsMultiCalendarEnabled() { return GetParam(); } + + void SetCalendarList() { + // Sets a mock calendar list. + std::list<std::unique_ptr<google_apis::calendar::SingleCalendar>> calendars; + calendars.push_back(calendar_test_utils::CreateCalendar( + kCalendarId1, kCalendarSummary1, kCalendarColorId1, kCalendarSelected1, + kCalendarPrimary1)); + calendar_client_->SetCalendarList( + calendar_test_utils::CreateMockCalendarList(std::move(calendars))); + } + + void ToggleDateTray() { + DateTray* date_tray = + StatusAreaWidgetTestHelper::GetStatusAreaWidget()->date_tray(); + LeftClickOn(date_tray); + task_environment()->FastForwardBy(base::Milliseconds(300)); + LeftClickOn(date_tray); + } + + void ExpectBucketCounts( + PostLoginGlanceablesMetricsRecorder::DataFetchEventSource source, + int no_delay_sample_count, + int fifteen_second_delay_sample_count, + int thirty_second_delay_sample_count) { + histogram_tester_->ExpectBucketCount( + "Ash.PostLoginGlanceables.HypotheticalFetchEvent.NoDelay", source, + /*expected_bucket_count=*/no_delay_sample_count); + histogram_tester_->ExpectBucketCount( + "Ash.PostLoginGlanceables.HypotheticalFetchEvent.15SecondDelay", source, + /*expected_bucket_count=*/fifteen_second_delay_sample_count); + histogram_tester_->ExpectBucketCount( + "Ash.PostLoginGlanceables.HypotheticalFetchEvent.30SecondDelay", source, + /*expected_bucket_count=*/thirty_second_delay_sample_count); + } + + private: + std::unique_ptr<base::HistogramTester> histogram_tester_; + + std::unique_ptr<calendar_test_utils::CalendarClientTestImpl> calendar_client_; + base::test::ScopedFeatureList scoped_feature_list_; +}; + +INSTANTIATE_TEST_SUITE_P(MultiCalendar, + PostLoginGlanceablesMetricsRecorderCalendarTest, + testing::Bool()); + +TEST_P(PostLoginGlanceablesMetricsRecorderCalendarTest, CalendarFetch) { ToggleDateTray(); ExpectBucketCounts( @@ -145,22 +241,4 @@ /*thirty_second_delay_sample_count=*/2); } -TEST_F(PostLoginGlanceablesMetricsRecorderTest, FullRestore) { - ExpectBucketCounts(PostLoginGlanceablesMetricsRecorder::DataFetchEventSource:: - kPostLoginFullRestore, - /*no_delay_sample_count=*/0, - /*fifteen_second_delay_sample_count=*/0, - /*thirty_second_delay_sample_count=*/0); - - Shell::Get() - ->post_login_glanceables_metrics_reporter() - ->RecordPostLoginFullRestoreShown(); - - ExpectBucketCounts(PostLoginGlanceablesMetricsRecorder::DataFetchEventSource:: - kPostLoginFullRestore, - /*no_delay_sample_count=*/1, - /*fifteen_second_delay_sample_count=*/1, - /*thirty_second_delay_sample_count=*/1); -} - } // namespace ash
diff --git a/ash/login/ui/animated_auth_factors_label_wrapper.cc b/ash/login/ui/animated_auth_factors_label_wrapper.cc index 975cd43..c35e71e 100644 --- a/ash/login/ui/animated_auth_factors_label_wrapper.cc +++ b/ash/login/ui/animated_auth_factors_label_wrapper.cc
@@ -201,7 +201,8 @@ current_label_opacity_seq.release()); } -gfx::Size AnimatedAuthFactorsLabelWrapper::CalculatePreferredSize() const { +gfx::Size AnimatedAuthFactorsLabelWrapper::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return gfx::Size(kAuthFactorsViewWidthDp, kLabelWrapperHeightDp); }
diff --git a/ash/login/ui/animated_auth_factors_label_wrapper.h b/ash/login/ui/animated_auth_factors_label_wrapper.h index 56e0e58..8857d80e 100644 --- a/ash/login/ui/animated_auth_factors_label_wrapper.h +++ b/ash/login/ui/animated_auth_factors_label_wrapper.h
@@ -38,7 +38,8 @@ views::Label* label() { return current_label_; } // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; private: int previous_label_id_ = 0;
diff --git a/ash/login/ui/animated_rounded_image_view.cc b/ash/login/ui/animated_rounded_image_view.cc index e5d2daf..0e3b38b9 100644 --- a/ash/login/ui/animated_rounded_image_view.cc +++ b/ash/login/ui/animated_rounded_image_view.cc
@@ -71,7 +71,8 @@ StartOrStopAnimation(); } -gfx::Size AnimatedRoundedImageView::CalculatePreferredSize() const { +gfx::Size AnimatedRoundedImageView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return gfx::Size(image_size_.width() + GetInsets().width(), image_size_.height() + GetInsets().height()); }
diff --git a/ash/login/ui/animated_rounded_image_view.h b/ash/login/ui/animated_rounded_image_view.h index 630d05ad..2824323 100644 --- a/ash/login/ui/animated_rounded_image_view.h +++ b/ash/login/ui/animated_rounded_image_view.h
@@ -56,7 +56,8 @@ void SetAnimationPlayback(Playback playback); // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void OnPaint(gfx::Canvas* canvas) override; private:
diff --git a/ash/login/ui/auth_icon_view.cc b/ash/login/ui/auth_icon_view.cc index ea8f7e4f..64cfab9d 100644 --- a/ash/login/ui/auth_icon_view.cc +++ b/ash/login/ui/auth_icon_view.cc
@@ -302,7 +302,8 @@ } } -gfx::Size AuthIconView::CalculatePreferredSize() const { +gfx::Size AuthIconView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return gfx::Size(kAuthIconViewDp, kAuthIconViewDp); }
diff --git a/ash/login/ui/auth_icon_view.h b/ash/login/ui/auth_icon_view.h index cf95c2d..b11ca8eb 100644 --- a/ash/login/ui/auth_icon_view.h +++ b/ash/login/ui/auth_icon_view.h
@@ -89,7 +89,8 @@ void AddedToWidget() override; void OnThemeChanged() override; void OnPaint(gfx::Canvas* canvas) override; - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void OnGestureEvent(ui::GestureEvent* event) override; bool OnMousePressed(const ui::MouseEvent& event) override;
diff --git a/ash/login/ui/kiosk_app_default_message.cc b/ash/login/ui/kiosk_app_default_message.cc index 4ef60008..1369c43 100644 --- a/ash/login/ui/kiosk_app_default_message.cc +++ b/ash/login/ui/kiosk_app_default_message.cc
@@ -75,7 +75,8 @@ KioskAppDefaultMessage::~KioskAppDefaultMessage() = default; -gfx::Size KioskAppDefaultMessage::CalculatePreferredSize() const { +gfx::Size KioskAppDefaultMessage::CalculatePreferredSize( + const views::SizeBounds& available_size) const { auto* layout_provider = views::LayoutProvider::Get(); // width = left_margin + icon_width + component_distance + title_width +
diff --git a/ash/login/ui/kiosk_app_default_message.h b/ash/login/ui/kiosk_app_default_message.h index 7c41a094..e003cc3 100644 --- a/ash/login/ui/kiosk_app_default_message.h +++ b/ash/login/ui/kiosk_app_default_message.h
@@ -36,7 +36,8 @@ ~KioskAppDefaultMessage() override; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; // LoginBaseBubbleView gfx::Point CalculatePosition() override;
diff --git a/ash/login/ui/local_authentication_request_view.cc b/ash/login/ui/local_authentication_request_view.cc index 82b72722..6423dfb3 100644 --- a/ash/login/ui/local_authentication_request_view.cc +++ b/ash/login/ui/local_authentication_request_view.cc
@@ -349,7 +349,8 @@ description_label_->SetEnabledColorId(color_id); } -gfx::Size LocalAuthenticationRequestView::CalculatePreferredSize() const { +gfx::Size LocalAuthenticationRequestView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return GetLocalAuthenticationRequestViewSize(); } @@ -372,7 +373,7 @@ } void LocalAuthenticationRequestView::UpdatePreferredSize() { - SetPreferredSize(CalculatePreferredSize()); + SetPreferredSize(CalculatePreferredSize({})); if (GetWidget()) { GetWidget()->CenterWindow(GetPreferredSize()); }
diff --git a/ash/login/ui/local_authentication_request_view.h b/ash/login/ui/local_authentication_request_view.h index f1c1dea..756e3507 100644 --- a/ash/login/ui/local_authentication_request_view.h +++ b/ash/login/ui/local_authentication_request_view.h
@@ -91,7 +91,8 @@ // views::DialogDelegateView: void GetAccessibleNodeData(ui::AXNodeData* node_data) override; void RequestFocus() override; - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; views::View* GetInitiallyFocusedView() override; std::u16string GetAccessibleWindowTitle() const override;
diff --git a/ash/login/ui/lock_contents_view.cc b/ash/login/ui/lock_contents_view.cc index 28502e8..6e35739 100644 --- a/ash/login/ui/lock_contents_view.cc +++ b/ash/login/ui/lock_contents_view.cc
@@ -255,9 +255,11 @@ ~UserAddingScreenIndicator() override = default; // views::View: - gfx::Size CalculatePreferredSize() const override { + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override { return gfx::Size(kUserAddingScreenIndicatorWidth, - GetHeightForWidth(kUserAddingScreenIndicatorWidth)); + GetLayoutManager()->GetPreferredHeightForWidth( + this, kUserAddingScreenIndicatorWidth)); } private:
diff --git a/ash/login/ui/lock_screen_media_controls_view.cc b/ash/login/ui/lock_screen_media_controls_view.cc index a5d8db6a..03b3d450 100644 --- a/ash/login/ui/lock_screen_media_controls_view.cc +++ b/ash/login/ui/lock_screen_media_controls_view.cc
@@ -457,8 +457,9 @@ base::PowerMonitor::RemovePowerSuspendObserver(this); } -gfx::Size LockScreenMediaControlsView::CalculatePreferredSize() const { - return contents_view_->GetPreferredSize(); +gfx::Size LockScreenMediaControlsView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { + return contents_view_->GetPreferredSize(available_size); } void LockScreenMediaControlsView::Layout(PassKey) {
diff --git a/ash/login/ui/lock_screen_media_controls_view.h b/ash/login/ui/lock_screen_media_controls_view.h index be21d5a2..faa8a64 100644 --- a/ash/login/ui/lock_screen_media_controls_view.h +++ b/ash/login/ui/lock_screen_media_controls_view.h
@@ -98,7 +98,8 @@ ~LockScreenMediaControlsView() override; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; void OnMouseEntered(const ui::MouseEvent& event) override;
diff --git a/ash/login/ui/lock_screen_media_view.cc b/ash/login/ui/lock_screen_media_view.cc index 22e9eeab..9f7bf179b 100644 --- a/ash/login/ui/lock_screen_media_view.cc +++ b/ash/login/ui/lock_screen_media_view.cc
@@ -143,7 +143,8 @@ /////////////////////////////////////////////////////////////////////////////// // views::View implementations: -gfx::Size LockScreenMediaView::CalculatePreferredSize() const { +gfx::Size LockScreenMediaView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return global_media_controls::kCrOSMediaItemUpdatedUISize; }
diff --git a/ash/login/ui/lock_screen_media_view.h b/ash/login/ui/lock_screen_media_view.h index 2973c526..2e32509 100644 --- a/ash/login/ui/lock_screen_media_view.h +++ b/ash/login/ui/lock_screen_media_view.h
@@ -48,7 +48,8 @@ ~LockScreenMediaView() override; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; // media_session::mojom::MediaControllerObserver:
diff --git a/ash/login/ui/login_auth_factors_view.cc b/ash/login/ui/login_auth_factors_view.cc index 532c063..76f5559 100644 --- a/ash/login/ui/login_auth_factors_view.cc +++ b/ash/login/ui/login_auth_factors_view.cc
@@ -499,8 +499,11 @@ } // views::View: -gfx::Size LoginAuthFactorsView::CalculatePreferredSize() const { - gfx::Size size = views::View::CalculatePreferredSize(); +gfx::Size LoginAuthFactorsView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { + views::SizeBounds content_available_size(available_size); + content_available_size.set_width(kAuthFactorsViewWidthDp); + gfx::Size size = views::View::CalculatePreferredSize(content_available_size); size.set_width(kAuthFactorsViewWidthDp); return size; }
diff --git a/ash/login/ui/login_auth_factors_view.h b/ash/login/ui/login_auth_factors_view.h index a57b3f7..b1fdb43 100644 --- a/ash/login/ui/login_auth_factors_view.h +++ b/ash/login/ui/login_auth_factors_view.h
@@ -67,7 +67,8 @@ void AddAuthFactor(std::unique_ptr<AuthFactorModel> auth_factor); // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void OnThemeChanged() override; // Should be called when the visibility of PIN authentication changes.
diff --git a/ash/login/ui/login_auth_user_view.cc b/ash/login/ui/login_auth_user_view.cc index 1f6418d..720cd4f 100644 --- a/ash/login/ui/login_auth_user_view.cc +++ b/ash/login/ui/login_auth_user_view.cc
@@ -1031,8 +1031,9 @@ return password_view_ != nullptr ? password_view_->AsWeakPtr() : nullptr; } -gfx::Size LoginAuthUserView::CalculatePreferredSize() const { - gfx::Size size = views::View::CalculatePreferredSize(); +gfx::Size LoginAuthUserView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { + gfx::Size size = views::View::CalculatePreferredSize(available_size); // Make sure we are at least as big as the user view. If we do not do this // the view will be below minimum size when no auth methods are displayed. size.SetToMax(user_view_->GetPreferredSize());
diff --git a/ash/login/ui/login_auth_user_view.h b/ash/login/ui/login_auth_user_view.h index 9f66206..8fa265c9 100644 --- a/ash/login/ui/login_auth_user_view.h +++ b/ash/login/ui/login_auth_user_view.h
@@ -215,7 +215,8 @@ views::Button* pin_password_toggle() { return pin_password_toggle_; } // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void RequestFocus() override; void OnGestureEvent(ui::GestureEvent* event) override;
diff --git a/ash/login/ui/login_base_bubble_view.cc b/ash/login/ui/login_base_bubble_view.cc index 8bf882a..368c070 100644 --- a/ash/login/ui/login_base_bubble_view.cc +++ b/ash/login/ui/login_base_bubble_view.cc
@@ -294,10 +294,12 @@ NOTREACHED(); } -gfx::Size LoginBaseBubbleView::CalculatePreferredSize() const { +gfx::Size LoginBaseBubbleView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { gfx::Size size; size.set_width(kBubbleTotalWidthDp); - size.set_height(GetHeightForWidth(kBubbleTotalWidthDp)); + size.set_height(GetLayoutManager()->GetPreferredHeightForWidth( + this, kBubbleTotalWidthDp)); return size; }
diff --git a/ash/login/ui/login_base_bubble_view.h b/ash/login/ui/login_base_bubble_view.h index 5f6b7a8..a028212 100644 --- a/ash/login/ui/login_base_bubble_view.h +++ b/ash/login/ui/login_base_bubble_view.h
@@ -69,7 +69,8 @@ ui::LayerAnimationSequence* sequence) override {} // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; void OnBlur() override;
diff --git a/ash/login/ui/login_password_view.cc b/ash/login/ui/login_password_view.cc index 7e0b2ce..6e699cc5 100644 --- a/ash/login/ui/login_password_view.cc +++ b/ash/login/ui/login_password_view.cc
@@ -530,8 +530,11 @@ return textfield_->GetReadOnly(); } -gfx::Size LoginPasswordView::CalculatePreferredSize() const { - gfx::Size size = views::View::CalculatePreferredSize(); +gfx::Size LoginPasswordView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { + views::SizeBounds content_available_size(available_size); + content_available_size.set_width(kPasswordTotalWidthDp); + gfx::Size size = views::View::CalculatePreferredSize(content_available_size); size.set_width(kPasswordTotalWidthDp); return size; }
diff --git a/ash/login/ui/login_password_view.h b/ash/login/ui/login_password_view.h index d0adb84..eed1b38 100644 --- a/ash/login/ui/login_password_view.h +++ b/ash/login/ui/login_password_view.h
@@ -129,7 +129,8 @@ bool IsReadOnly() const; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void RequestFocus() override; bool OnKeyPressed(const ui::KeyEvent& event) override;
diff --git a/ash/login/ui/login_pin_input_view.cc b/ash/login/ui/login_pin_input_view.cc index c2c641e..bfe9245 100644 --- a/ash/login/ui/login_pin_input_view.cc +++ b/ash/login/ui/login_pin_input_view.cc
@@ -277,7 +277,8 @@ return is_read_only_; } -gfx::Size LoginPinInputView::CalculatePreferredSize() const { +gfx::Size LoginPinInputView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { const int ideal_size = kFieldWidth * length_ + kFieldSpace * (length_ - 1); return gfx::Size(std::min(kMaxWidthPinInputDp, ideal_size), kPinInputTotalHeightDp);
diff --git a/ash/login/ui/login_pin_input_view.h b/ash/login/ui/login_pin_input_view.h index 9014fd2..2297b3d 100644 --- a/ash/login/ui/login_pin_input_view.h +++ b/ash/login/ui/login_pin_input_view.h
@@ -88,7 +88,8 @@ void SetReadOnly(bool read_only); bool IsReadOnly() const; // views::View - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void RequestFocus() override; bool OnKeyPressed(const ui::KeyEvent& event) override;
diff --git a/ash/login/ui/login_public_account_user_view.cc b/ash/login/ui/login_public_account_user_view.cc index 6c8d6e7..d8b8080 100644 --- a/ash/login/ui/login_public_account_user_view.cc +++ b/ash/login/ui/login_public_account_user_view.cc
@@ -157,8 +157,9 @@ return user_view_->current_user(); } -gfx::Size LoginPublicAccountUserView::CalculatePreferredSize() const { - gfx::Size size = views::View::CalculatePreferredSize(); +gfx::Size LoginPublicAccountUserView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { + gfx::Size size = views::View::CalculatePreferredSize(available_size); // Make sure we are at least as big as the user view. If we do not do this the // view will be below minimum size when no auth methods are displayed. size.SetToMax(user_view_->GetPreferredSize());
diff --git a/ash/login/ui/login_public_account_user_view.h b/ash/login/ui/login_public_account_user_view.h index c82bffa..20c6d13 100644 --- a/ash/login/ui/login_public_account_user_view.h +++ b/ash/login/ui/login_public_account_user_view.h
@@ -62,7 +62,8 @@ const LoginUserInfo& current_user() const; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; bool auth_enabled() const { return auth_enabled_; } LoginUserView* user_view() { return user_view_; }
diff --git a/ash/login/ui/login_user_view.cc b/ash/login/ui/login_user_view.cc index 58432ef..f3671cd 100644 --- a/ash/login/ui/login_user_view.cc +++ b/ash/login/ui/login_user_view.cc
@@ -587,7 +587,8 @@ return dropdown_; } -gfx::Size LoginUserView::CalculatePreferredSize() const { +gfx::Size LoginUserView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { switch (display_style_) { case LoginDisplayStyle::kLarge: return gfx::Size(kLargeUserViewWidthDp, kLargeUserViewHeightDp);
diff --git a/ash/login/ui/login_user_view.h b/ash/login/ui/login_user_view.h index 75e99189..dcfa023 100644 --- a/ash/login/ui/login_user_view.h +++ b/ash/login/ui/login_user_view.h
@@ -93,7 +93,8 @@ LoginButton* GetDropdownButton(); // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; void RequestFocus() override; views::View::Views GetChildrenInZOrder() override;
diff --git a/ash/login/ui/management_bubble.cc b/ash/login/ui/management_bubble.cc index 199b2538..9e8a66b 100644 --- a/ash/login/ui/management_bubble.cc +++ b/ash/login/ui/management_bubble.cc
@@ -34,9 +34,11 @@ set_positioning_strategy(PositioningStrategy::kShowAbove); } -gfx::Size ManagementBubble::CalculatePreferredSize() const { +gfx::Size ManagementBubble::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return gfx::Size(kManagementBubbleWidth, - GetHeightForWidth(kManagementBubbleWidth)); + GetLayoutManager()->GetPreferredHeightForWidth( + this, kManagementBubbleWidth)); } BEGIN_METADATA(ManagementBubble)
diff --git a/ash/login/ui/management_bubble.h b/ash/login/ui/management_bubble.h index 722491d..5784035 100644 --- a/ash/login/ui/management_bubble.h +++ b/ash/login/ui/management_bubble.h
@@ -22,7 +22,8 @@ public: ManagementBubble(const std::u16string& message, base::WeakPtr<views::View> anchor_view); - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; }; } // namespace ash
diff --git a/ash/login/ui/pin_request_view.cc b/ash/login/ui/pin_request_view.cc index 1c99f93..33f425c 100644 --- a/ash/login/ui/pin_request_view.cc +++ b/ash/login/ui/pin_request_view.cc
@@ -426,7 +426,8 @@ access_code_view_->RequestFocus(); } -gfx::Size PinRequestView::CalculatePreferredSize() const { +gfx::Size PinRequestView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return GetPinRequestViewSize(); } @@ -522,7 +523,7 @@ } void PinRequestView::UpdatePreferredSize() { - SetPreferredSize(CalculatePreferredSize()); + SetPreferredSize(CalculatePreferredSize({})); if (GetWidget()) { GetWidget()->CenterWindow(GetPreferredSize()); }
diff --git a/ash/login/ui/pin_request_view.h b/ash/login/ui/pin_request_view.h index 207ef645..bef052c 100644 --- a/ash/login/ui/pin_request_view.h +++ b/ash/login/ui/pin_request_view.h
@@ -132,7 +132,8 @@ // views::View: void RequestFocus() override; - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; // views::DialogDelegateView:
diff --git a/ash/login/ui/public_account_monitoring_info_dialog.cc b/ash/login/ui/public_account_monitoring_info_dialog.cc index 9ff511ee..4ece6b2 100644 --- a/ash/login/ui/public_account_monitoring_info_dialog.cc +++ b/ash/login/ui/public_account_monitoring_info_dialog.cc
@@ -139,8 +139,10 @@ frame_view->SetTitleView(std::move(title_label)); } -gfx::Size PublicAccountMonitoringInfoDialog::CalculatePreferredSize() const { - return {kDialogWidthDp, GetHeightForWidth(kDialogWidthDp)}; +gfx::Size PublicAccountMonitoringInfoDialog::CalculatePreferredSize( + const views::SizeBounds& available_size) const { + return {kDialogWidthDp, + GetLayoutManager()->GetPreferredHeightForWidth(this, kDialogWidthDp)}; } BEGIN_METADATA(PublicAccountMonitoringInfoDialog)
diff --git a/ash/login/ui/public_account_monitoring_info_dialog.h b/ash/login/ui/public_account_monitoring_info_dialog.h index 3c79cae9..fc2a577 100644 --- a/ash/login/ui/public_account_monitoring_info_dialog.h +++ b/ash/login/ui/public_account_monitoring_info_dialog.h
@@ -36,7 +36,8 @@ void AddedToWidget() override; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; private: base::WeakPtr<LoginExpandedPublicAccountView> controller_;
diff --git a/ash/shelf/drag_window_from_shelf_controller_unittest.cc b/ash/shelf/drag_window_from_shelf_controller_unittest.cc index ea7ac031..b370c1c 100644 --- a/ash/shelf/drag_window_from_shelf_controller_unittest.cc +++ b/ash/shelf/drag_window_from_shelf_controller_unittest.cc
@@ -42,6 +42,7 @@ #include "ui/compositor/layer.h" #include "ui/compositor/layer_animator.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" +#include "ui/compositor/test/layer_animation_stopped_waiter.h" #include "ui/compositor/test/test_utils.h" #include "ui/gfx/geometry/point_f.h" #include "ui/views/test/views_test_utils.h" @@ -116,18 +117,20 @@ void CancelDrag() { window_drag_controller_->CancelDrag(); } void WaitForHomeLauncherAnimationToFinish() { // Wait until home launcher animation finishes. - ui::Layer* layer = + ui::Layer* const layer = GetAppListTestHelper()->GetAppListView()->GetWidget()->GetLayer(); - ui::Compositor* compositor = layer->GetCompositor(); + ui::Compositor* const compositor = layer->GetCompositor(); - while (layer->GetAnimator()->is_animating()) { - EXPECT_TRUE(ui::WaitForNextFrameToBePresented(compositor)); + ui::LayerAnimationStoppedWaiter animation_waiter; + animation_waiter.Wait(layer); + + // Force frames and wait for all throughput trackers to be gone to allow + // animation throughput data to be passed from cc to ui. + while (compositor->has_throughput_trackers_for_testing()) { + compositor->ScheduleFullRedraw(); + std::ignore = ui::WaitForNextFrameToBePresented(compositor, + base::Milliseconds(500)); } - - // Ensure there is one more frame presented after animation finishes - // to allow animation throughput data is passed from cc to ui. - std::ignore = - ui::WaitForNextFrameToBePresented(compositor, base::Milliseconds(200)); } SplitViewController* split_view_controller() { @@ -507,18 +510,9 @@ EXPECT_TRUE(WindowState::Get(window.get())->IsMinimized()); } -// TODO(crbug.com/1473400): Re-enable the test once the bug is fixed. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -#define MAYBE_VerifyHomeLauncherAnimationMetrics \ - DISABLED_VerifyHomeLauncherAnimationMetrics -#else -#define MAYBE_VerifyHomeLauncherAnimationMetrics \ - VerifyHomeLauncherAnimationMetrics -#endif // Verify that metrics of home launcher animation are recorded correctly when // swiping up from shelf with sufficient velocity. -TEST_F(DragWindowFromShelfControllerTest, - MAYBE_VerifyHomeLauncherAnimationMetrics) { +TEST_F(DragWindowFromShelfControllerTest, VerifyHomeLauncherAnimationMetrics) { // Set non-zero animation duration to report animation metrics. ui::ScopedAnimationDurationScaleMode non_zero_duration_mode( ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION);
diff --git a/ash/shelf/scrollable_shelf_view.cc b/ash/shelf/scrollable_shelf_view.cc index 04675ba..d26f586 100644 --- a/ash/shelf/scrollable_shelf_view.cc +++ b/ash/shelf/scrollable_shelf_view.cc
@@ -1692,6 +1692,13 @@ return std::clamp(static_cast<float>(position) / total, 0.f, 1.f); }; + // Do not add gradient if visible height is too small. + if (visible_space_.bottom() < + visible_space_.y() + + 2 * scrollable_shelf_constants::kGradientZoneLength) { + return; + } + float gradient_start, gradient_end; DCHECK(!ShouldAdaptToRTL());
diff --git a/ash/shelf/scrollable_shelf_view_unittest.cc b/ash/shelf/scrollable_shelf_view_unittest.cc index 7586d6b..d302634 100644 --- a/ash/shelf/scrollable_shelf_view_unittest.cc +++ b/ash/shelf/scrollable_shelf_view_unittest.cc
@@ -27,6 +27,7 @@ #include "ash/wm/tablet_mode/tablet_mode_controller_test_api.h" #include "base/i18n/rtl.h" #include "base/memory/raw_ptr.h" +#include "base/strings/stringprintf.h" #include "base/test/icu_test_util.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" @@ -308,6 +309,29 @@ EXPECT_FALSE(scrollable_shelf_view_->ShouldAdjustForTest()); } +// Verifies that the gradient calculation for vertical scrollable shelf does not +// crash for minimum shelf height (b/319527955). +TEST_F(ScrollableShelfViewTest, + GradientCalculationDoesNotCrashForMinimumShelfHeight) { + const size_t initial_display_height = 400; + UpdateDisplay(base::StringPrintf("600x%zu", initial_display_height)); + + auto* const prefs = + Shell::Get()->session_controller()->GetLastActiveUserPrefService(); + SetShelfAlignmentPref(prefs, GetPrimaryDisplay().id(), ShelfAlignment::kLeft); + AddAppShortcutsUntilOverflow(); + + // Reduce the screen height (this can also happen with the maximum size of the + // docked magnifier), so the height of `scrollable_shelf_view_` is only 1 px, + // this is where the crash happened before. + const size_t new_display_height = + initial_display_height - + scrollable_shelf_view_->visible_space().height() + 1; + UpdateDisplay(base::StringPrintf("600x%zu", new_display_height)); + + // No crash. +} + // TODO(crbug.com/40867071): Enable when the bug is fixed. // Verifies that the display rotation from the long side to the short side // should not break the scrollable shelf's UI behavior
diff --git a/ash/style/combobox.cc b/ash/style/combobox.cc index 78bad48..d558b3c 100644 --- a/ash/style/combobox.cc +++ b/ash/style/combobox.cc
@@ -236,8 +236,9 @@ return nullptr; } - gfx::Size CalculatePreferredSize() const override { - gfx::Size size = views::View::CalculatePreferredSize(); + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override { + gfx::Size size = views::View::CalculatePreferredSize(available_size); size.SetToMin(gfx::Size(kMaxMenuWidth, kMaxMenuHeight)); return size; }
diff --git a/ash/style/pagination_view.cc b/ash/style/pagination_view.cc index 50a8f6b..654b6b9e 100644 --- a/ash/style/pagination_view.cc +++ b/ash/style/pagination_view.cc
@@ -94,7 +94,8 @@ } // views::Button: - gfx::Size CalculatePreferredSize() const override { + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override { return gfx::Size(kIndicatorButtonSize, kIndicatorButtonSize); } @@ -340,7 +341,8 @@ PaginationView::~PaginationView() = default; -gfx::Size PaginationView::CalculatePreferredSize() const { +gfx::Size PaginationView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { const int total_pages = model_->total_pages(); if (total_pages < kMinNumPages) { return gfx::Size();
diff --git a/ash/style/pagination_view.h b/ash/style/pagination_view.h index e16102c..1cc4833 100644 --- a/ash/style/pagination_view.h +++ b/ash/style/pagination_view.h
@@ -60,7 +60,8 @@ ~PaginationView() override; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; private:
diff --git a/ash/style/system_dialog_delegate_view.cc b/ash/style/system_dialog_delegate_view.cc index a333799..412bf8f 100644 --- a/ash/style/system_dialog_delegate_view.cc +++ b/ash/style/system_dialog_delegate_view.cc
@@ -346,12 +346,13 @@ SetViewLayoutSpecs(title_, margins); } -gfx::Size SystemDialogDelegateView::CalculatePreferredSize() const { +gfx::Size SystemDialogDelegateView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { auto* host_window = GetDialogHostWindow(GetWidget()); // If the delegate view is not added to a widget or parented to a host window, // return the default preferred size. if (!host_window) { - return views::WidgetDelegateView::CalculatePreferredSize(); + return views::WidgetDelegateView::CalculatePreferredSize(available_size); } // Otherwise, calculate the preferred size according to its host window size. @@ -379,7 +380,8 @@ dialog_width = host_width - kDialogHostPaddingSmall * 2; } - return gfx::Size(dialog_width, GetHeightForWidth(dialog_width)); + return gfx::Size(dialog_width, GetLayoutManager()->GetPreferredHeightForWidth( + this, dialog_width)); } gfx::Size SystemDialogDelegateView::GetMinimumSize() const {
diff --git a/ash/style/system_dialog_delegate_view.h b/ash/style/system_dialog_delegate_view.h index 957c044e8..26030d5 100644 --- a/ash/style/system_dialog_delegate_view.h +++ b/ash/style/system_dialog_delegate_view.h
@@ -142,7 +142,8 @@ void SetTitleMargins(const gfx::Insets& margins); // views::WidgetDelegateView: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; gfx::Size GetMinimumSize() const override; gfx::Size GetMaximumSize() const override; void OnWidgetInitialized() override;
diff --git a/ash/style/tab_slider_button.cc b/ash/style/tab_slider_button.cc index 762f7136..d35e357 100644 --- a/ash/style/tab_slider_button.cc +++ b/ash/style/tab_slider_button.cc
@@ -204,14 +204,20 @@ return kLabelButtonHeight; } -gfx::Size LabelSliderButton::CalculatePreferredSize() const { +gfx::Size LabelSliderButton::CalculatePreferredSize( + const views::SizeBounds& available_size) const { + gfx::Insets insets = GetInsets(); // The width of the container equals to the label width with horizontal // padding. + views::SizeBound label_available_width = std::max<views::SizeBound>( + kLabelButtonMinWidth, available_size.width() - insets.width()); + return gfx::Size( - std::max(label_->GetPreferredSize(views::SizeBounds(label_->width(), {})) - .width() + - GetInsets().width(), - kLabelButtonMinWidth), + std::max( + label_->GetPreferredSize(views::SizeBounds(label_available_width, {})) + .width() + + GetInsets().width(), + kLabelButtonMinWidth), kLabelButtonHeight); }
diff --git a/ash/style/tab_slider_button.h b/ash/style/tab_slider_button.h index 3aa9c1b..a8ca2d45 100644 --- a/ash/style/tab_slider_button.h +++ b/ash/style/tab_slider_button.h
@@ -115,7 +115,8 @@ // views::Button: int GetHeightForWidth(int w) const override; - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void StateChanged(ButtonState old_state) override; // Owned by the view hierarchy.
diff --git a/ash/system/media/quick_settings_media_view.cc b/ash/system/media/quick_settings_media_view.cc index ffbc55c..c7487b1 100644 --- a/ash/system/media/quick_settings_media_view.cc +++ b/ash/system/media/quick_settings_media_view.cc
@@ -135,7 +135,8 @@ /////////////////////////////////////////////////////////////////////////////// // views::View implementations: -gfx::Size QuickSettingsMediaView::CalculatePreferredSize() const { +gfx::Size QuickSettingsMediaView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return gfx::Size(kMediaViewWidth, GetMediaViewHeight()); } @@ -143,7 +144,7 @@ media_scroll_view_->SetBounds(0, 0, kMediaViewWidth, GetMediaViewHeight()); // Place the pagination dots view on top of the media view. - gfx::Size pagination_view_size = pagination_view_->CalculatePreferredSize(); + gfx::Size pagination_view_size = pagination_view_->CalculatePreferredSize({}); pagination_view_->SetBounds( (kMediaViewWidth - pagination_view_size.width()) / 2, kPaginationViewHeight, pagination_view_size.width(),
diff --git a/ash/system/media/quick_settings_media_view.h b/ash/system/media/quick_settings_media_view.h index f0a6fc27..d3d4d1e 100644 --- a/ash/system/media/quick_settings_media_view.h +++ b/ash/system/media/quick_settings_media_view.h
@@ -38,7 +38,8 @@ ~QuickSettingsMediaView() override; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; void OnGestureEvent(ui::GestureEvent* event) override;
diff --git a/ash/system/media/quick_settings_media_view_container.cc b/ash/system/media/quick_settings_media_view_container.cc index c1d6d51..c8c4b7a1 100644 --- a/ash/system/media/quick_settings_media_view_container.cc +++ b/ash/system/media/quick_settings_media_view_container.cc
@@ -39,11 +39,12 @@ : 0; } -gfx::Size QuickSettingsMediaViewContainer::CalculatePreferredSize() const { +gfx::Size QuickSettingsMediaViewContainer::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return gfx::Size(kTrayMenuWidth, GetExpandedHeight()); } BEGIN_METADATA(QuickSettingsMediaViewContainer) END_METADATA -} // namespace ash \ No newline at end of file +} // namespace ash
diff --git a/ash/system/media/quick_settings_media_view_container.h b/ash/system/media/quick_settings_media_view_container.h index 30a3ed6..9fef462e 100644 --- a/ash/system/media/quick_settings_media_view_container.h +++ b/ash/system/media/quick_settings_media_view_container.h
@@ -38,7 +38,8 @@ int GetExpandedHeight() const; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; private: const raw_ptr<UnifiedSystemTrayController> controller_;
diff --git a/ash/system/media/unified_media_controls_container.cc b/ash/system/media/unified_media_controls_container.cc index cbd2360..a52a1d0 100644 --- a/ash/system/media/unified_media_controls_container.cc +++ b/ash/system/media/unified_media_controls_container.cc
@@ -55,7 +55,8 @@ LayoutSuperclass<views::View>(this); } -gfx::Size UnifiedMediaControlsContainer::CalculatePreferredSize() const { +gfx::Size UnifiedMediaControlsContainer::CalculatePreferredSize( + const views::SizeBounds& available_size) const { return gfx::Size(kTrayMenuWidth, GetExpandedHeight() * expanded_amount_); }
diff --git a/ash/system/media/unified_media_controls_container.h b/ash/system/media/unified_media_controls_container.h index 6da78e4a..8c36149 100644 --- a/ash/system/media/unified_media_controls_container.h +++ b/ash/system/media/unified_media_controls_container.h
@@ -33,7 +33,8 @@ // views::View void Layout(PassKey) override; - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; private: double expanded_amount_;
diff --git a/ash/system/phonehub/app_stream_connection_error_dialog.cc b/ash/system/phonehub/app_stream_connection_error_dialog.cc index 157f03e..0ff94018 100644 --- a/ash/system/phonehub/app_stream_connection_error_dialog.cc +++ b/ash/system/phonehub/app_stream_connection_error_dialog.cc
@@ -227,8 +227,11 @@ ~ConnectionErrorDialogDelegateView() override = default; - gfx::Size CalculatePreferredSize() const override { - return gfx::Size(kDialogWidth, GetHeightForWidth(kDialogWidth)); + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override { + return gfx::Size( + kDialogWidth, + GetLayoutManager()->GetPreferredHeightForWidth(this, kDialogWidth)); } void OnStartTetheringClicked(const ui::Event& event) {
diff --git a/ash/system/phonehub/camera_roll_view.cc b/ash/system/phonehub/camera_roll_view.cc index ec834e1..fa61a11 100644 --- a/ash/system/phonehub/camera_roll_view.cc +++ b/ash/system/phonehub/camera_roll_view.cc
@@ -121,7 +121,8 @@ } // views::View: -gfx::Size CameraRollView::CameraRollItemsView::CalculatePreferredSize() const { +gfx::Size CameraRollView::CameraRollItemsView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { auto item_size = GetCameraRollItemSize(); int width = item_size.width() * kCameraRollItemsInRow + kCameraRollItemHorizontalSpacing * (kCameraRollItemsInRow - 1) +
diff --git a/ash/system/phonehub/camera_roll_view.h b/ash/system/phonehub/camera_roll_view.h index e4ec2d2..5d4cc33 100644 --- a/ash/system/phonehub/camera_roll_view.h +++ b/ash/system/phonehub/camera_roll_view.h
@@ -57,7 +57,8 @@ void Reset(); // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; private:
diff --git a/ash/system/phonehub/camera_roll_view_unittest.cc b/ash/system/phonehub/camera_roll_view_unittest.cc index 6f4002a..5ebef8a 100644 --- a/ash/system/phonehub/camera_roll_view_unittest.cc +++ b/ash/system/phonehub/camera_roll_view_unittest.cc
@@ -175,7 +175,7 @@ // intentionally changed this test will need to be updated. fake_camera_roll_manager()->SetCurrentItems(CreateFakeItems(4)); views::test::RunScheduledLayout(GetItemsView()); - EXPECT_EQ(GetItemsView()->CalculatePreferredSize(), gfx::Size(328, 82)); + EXPECT_EQ(GetItemsView()->CalculatePreferredSize({}), gfx::Size(328, 82)); EXPECT_EQ(GetThumbnailView(0)->bounds(), gfx::Rect(4, 4, 74, 74)); EXPECT_EQ(GetThumbnailView(1)->bounds(), gfx::Rect(86, 4, 74, 74)); EXPECT_EQ(GetThumbnailView(2)->bounds(), gfx::Rect(168, 4, 74, 74));
diff --git a/ash/system/phonehub/phone_hub_recent_apps_view.cc b/ash/system/phonehub/phone_hub_recent_apps_view.cc index 3872f65..428e4be 100644 --- a/ash/system/phonehub/phone_hub_recent_apps_view.cc +++ b/ash/system/phonehub/phone_hub_recent_apps_view.cc
@@ -270,8 +270,8 @@ } // views::View: -gfx::Size PhoneHubRecentAppsView::RecentAppButtonsView::CalculatePreferredSize() - const { +gfx::Size PhoneHubRecentAppsView::RecentAppButtonsView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { int width = kTrayMenuWidth - kBubbleHorizontalSidePaddingDip * 2; int height = kRecentAppButtonSize + kRecentAppButtonFocusPadding.height() + kRecentAppButtonsViewTopPadding; @@ -323,7 +323,8 @@ PhoneHubRecentAppsView::LoadingView::~LoadingView() = default; -gfx::Size PhoneHubRecentAppsView::LoadingView::CalculatePreferredSize() const { +gfx::Size PhoneHubRecentAppsView::LoadingView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { int width = kTrayMenuWidth - kBubbleHorizontalSidePaddingDip * 2; int height = kMoreAppsButtonSize + kRecentAppButtonFocusPadding.height() + kRecentAppButtonsViewTopPadding;
diff --git a/ash/system/phonehub/phone_hub_recent_apps_view.h b/ash/system/phonehub/phone_hub_recent_apps_view.h index cbeb650..669307f3 100644 --- a/ash/system/phonehub/phone_hub_recent_apps_view.h +++ b/ash/system/phonehub/phone_hub_recent_apps_view.h
@@ -98,7 +98,8 @@ RecentAppButtonsView operator=(RecentAppButtonsView&) = delete; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; views::View* AddRecentAppButton( @@ -121,7 +122,8 @@ LoadingView operator=(LoadingView&) = delete; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; void StartLoadingAnimation();
diff --git a/ash/system/phonehub/sub_feature_opt_in_view.cc b/ash/system/phonehub/sub_feature_opt_in_view.cc index 4f82f922..55366f4 100644 --- a/ash/system/phonehub/sub_feature_opt_in_view.cc +++ b/ash/system/phonehub/sub_feature_opt_in_view.cc
@@ -210,7 +210,7 @@ base::Unretained(this)), l10n_util::GetStringUTF16( IDS_ASH_PHONE_HUB_NOTIFICATION_OPT_IN_SET_UP_BUTTON), - PillButton::Type::kDefaultWithoutIcon, /*icon=*/nullptr)); + PillButton::Type::kPrimaryWithoutIcon, /*icon=*/nullptr)); set_up_button_->SetID(kSubFeatureOptInConfirmButton); set_up_button_->SetAccessibleName( l10n_util::GetStringUTF16(set_up_button_accessible_name_string_id_));
diff --git a/ash/system/phonehub/task_continuation_view.cc b/ash/system/phonehub/task_continuation_view.cc index 5d71003..2eafdf5 100644 --- a/ash/system/phonehub/task_continuation_view.cc +++ b/ash/system/phonehub/task_continuation_view.cc
@@ -108,7 +108,8 @@ } // views::View: -gfx::Size TaskContinuationView::TaskChipsView::CalculatePreferredSize() const { +gfx::Size TaskContinuationView::TaskChipsView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { auto chip_size = GetTaskContinuationChipSize(); int width = chip_size.width() * kTaskContinuationChipsInRow + kTaskContinuationChipSpacing +
diff --git a/ash/system/phonehub/task_continuation_view.h b/ash/system/phonehub/task_continuation_view.h index 1a59c91b..2d02b9a 100644 --- a/ash/system/phonehub/task_continuation_view.h +++ b/ash/system/phonehub/task_continuation_view.h
@@ -50,7 +50,8 @@ void AddTaskChip(views::View* task_chip); // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; // Clear all existing tasks in the view and in |task_chips_|.
diff --git a/ash/system/privacy_screen/privacy_screen_toast_controller.cc b/ash/system/privacy_screen/privacy_screen_toast_controller.cc index aa4c5ba..e73f5ec 100644 --- a/ash/system/privacy_screen/privacy_screen_toast_controller.cc +++ b/ash/system/privacy_screen/privacy_screen_toast_controller.cc
@@ -102,7 +102,7 @@ std::u16string PrivacyScreenToastController::GetAccessibleNameForBubble() { if (!toast_view_) return std::u16string(); - return toast_view_->GetAccessibleName(); + return toast_view_->accessible_name(); } void PrivacyScreenToastController::HideBubble(
diff --git a/ash/system/privacy_screen/privacy_screen_toast_view.cc b/ash/system/privacy_screen/privacy_screen_toast_view.cc index 90a0110..d105813 100644 --- a/ash/system/privacy_screen/privacy_screen_toast_view.cc +++ b/ash/system/privacy_screen/privacy_screen_toast_view.cc
@@ -166,9 +166,9 @@ button_->SetTooltipText(l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_PRIVACY_SCREEN_TOOLTIP, enabled_state)); - SetAccessibleName(l10n_util::GetStringFUTF16( + accessible_name_ = l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_PRIVACY_SCREEN_TOAST_ACCESSIBILITY_TEXT, - enabled_state, managed_state)); + enabled_state, managed_state); DeprecatedLayoutImmediately(); }
diff --git a/ash/system/privacy_screen/privacy_screen_toast_view.h b/ash/system/privacy_screen/privacy_screen_toast_view.h index 185c2225..da60b97 100644 --- a/ash/system/privacy_screen/privacy_screen_toast_view.h +++ b/ash/system/privacy_screen/privacy_screen_toast_view.h
@@ -36,11 +36,17 @@ // Returns true if the toggle button is focused. bool IsButtonFocused() const; + const std::u16string& accessible_name() const { return accessible_name_; } + private: // views::ViewObserver: void OnViewFocused(views::View* observed_view) override; void OnViewBlurred(views::View* observed_view) override; + // TODO(ViewsAX): Remove this member and update the accessible name directly + // in the cache of the RootView that needs it. + std::u16string accessible_name_; + raw_ptr<PrivacyScreenToastController> controller_ = nullptr; raw_ptr<FeaturePodIconButton> button_ = nullptr; raw_ptr<PrivacyScreenToastLabelView> label_ = nullptr;
diff --git a/ash/system/scheduled_feature/schedule_utils.cc b/ash/system/scheduled_feature/schedule_utils.cc index 909fabe..5d02792e 100644 --- a/ash/system/scheduled_feature/schedule_utils.cc +++ b/ash/system/scheduled_feature/schedule_utils.cc
@@ -63,13 +63,31 @@ // // `end_time` must first be shifted by a whole number of days such that // `end_time` <= `now` < `end_time + kOneDay`. + // + // Example with `schedule_type` == `kSunsetToSunrise`: + // Start (sunset): 6:00 PM, End (sunrise): 6:00 AM, Now: 3:00 AM + // + // 3:00 6:00 18:00 + // <---------------------------------- + ----- + --------------- + -----> + // | | | + // now end_time start_time const base::TimeDelta amount_to_advance_end_time = (now - end_time).FloorToMultiple(kOneDay); end_time += amount_to_advance_end_time; + // 6:00 3:00 18:00 + // <-- + ----------------------------- + ---------------------- + -----> + // | | | + // end_time now start_time + // (previous day) // Shift `start_time` such that // `end_time` <= `start_time` < `end_time + kOneDay`. start_time = ShiftWithinOneDayFrom(end_time, start_time); + // 6:00 18:00 3:00 6:00 + // <-- + ----------------- + --------- + ----- + ----------------------> + // | | | | + // end_time start_time now end_time + // (previous day) (current day) std::vector<Slot> schedule; switch (schedule_type) { @@ -93,6 +111,11 @@ "feature changes"; break; } + // 6:00 10:00 16:00 18:00 3:00 6:00 + // <-- + --- + ----- + --- + ---------- + ----- + ----------------------> + // | | | | | | + // end_time morning late sunset now end_time + // (previous day) afternoon (current day) DVLOG(1) << "Schedule: " << ToString(schedule); return schedule; }
diff --git a/ash/system/time/calendar_event_fetch.cc b/ash/system/time/calendar_event_fetch.cc index 5ae70f4..e77806eab 100644 --- a/ash/system/time/calendar_event_fetch.cc +++ b/ash/system/time/calendar_event_fetch.cc
@@ -8,6 +8,7 @@ #include "ash/calendar/calendar_controller.h" #include "ash/glanceables/post_login_glanceables_metrics_recorder.h" #include "ash/shell.h" +#include "ash/system/time/calendar_metrics.h" #include "ash/system/time/calendar_utils.h" #include "base/check.h" #include "base/functional/bind.h" @@ -30,7 +31,7 @@ time_range_(calendar_utils::GetFetchStartEndTimes(start_of_month)), complete_callback_(std::move(complete_callback)), internal_error_callback_(std::move(internal_error_callback)), - fetch_start_time_(base::Time::Now()), + fetch_start_time_(base::TimeTicks::Now()), timeout_(tick_clock), calendar_id_(google_apis::calendar::kPrimaryCalendarId) { SendFetchRequest(); @@ -50,7 +51,7 @@ time_range_(calendar_utils::GetFetchStartEndTimes(start_of_month)), complete_callback_(std::move(complete_callback)), internal_error_callback_(std::move(internal_error_callback)), - fetch_start_time_(base::Time::Now()), + fetch_start_time_(base::TimeTicks::Now()), timeout_(tick_clock), calendar_id_(calendar_id), calendar_color_id_(calendar_color_id) { @@ -109,9 +110,9 @@ // Cancel timeout timer. timeout_.Stop(); - base::UmaHistogramTimes("Ash.Calendar.FetchEvents.FetchDuration", - base::Time::Now() - fetch_start_time_); - base::UmaHistogramBoolean("Ash.Calendar.FetchEvents.Timeout", false); + calendar_metrics::RecordEventListFetchDuration(base::TimeTicks::Now() - + fetch_start_time_); + calendar_metrics::RecordEventListFetchTimeout(false); // IMPORTANT: 'this' is NOT safe to use after `complete_callback_` has been // executed, as the last thing it does is destroy its @@ -121,7 +122,7 @@ } void CalendarEventFetch::OnTimeout() { - base::UmaHistogramBoolean("Ash.Calendar.FetchEvents.Timeout", true); + calendar_metrics::RecordEventListFetchTimeout(true); // IMPORTANT: 'this' is NOT safe to use after `internal_error_callback_` has // been executed, as the last thing it does is destroy its
diff --git a/ash/system/time/calendar_event_fetch.h b/ash/system/time/calendar_event_fetch.h index 7228ec8..ab583f7 100644 --- a/ash/system/time/calendar_event_fetch.h +++ b/ash/system/time/calendar_event_fetch.h
@@ -87,7 +87,7 @@ FetchInternalErrorCallback internal_error_callback_; // Timestamp of the start of the fetch, used for duration metrics. - const base::Time fetch_start_time_; + const base::TimeTicks fetch_start_time_; // Timer we run at the start of a fetch, to ensure that we terminate if we // go too long without a response.
diff --git a/ash/system/time/calendar_list_model.cc b/ash/system/time/calendar_list_model.cc index b3793f74..439e36b 100644 --- a/ash/system/time/calendar_list_model.cc +++ b/ash/system/time/calendar_list_model.cc
@@ -14,10 +14,13 @@ #include "ash/public/cpp/session/session_observer.h" #include "ash/shell.h" #include "ash/system/time/calendar_event_fetch_types.h" +#include "ash/system/time/calendar_metrics.h" #include "ash/system/time/calendar_utils.h" #include "base/check_is_test.h" #include "base/functional/bind.h" +#include "base/metrics/histogram_functions.h" #include "base/strings/string_util.h" +#include "base/time/time.h" #include "base/timer/timer.h" #include "google_apis/calendar/calendar_api_response_types.h" #include "google_apis/common/api_error_codes.h" @@ -84,6 +87,7 @@ CancelFetch(); fetch_in_progress_ = true; + fetch_start_time_ = base::TimeTicks::Now(); CalendarClient* client = Shell::Get()->calendar_controller()->GetClient(); @@ -114,7 +118,6 @@ // Since the calendar list is kept until it is replaced during a re-fetch // (or removed during a session change), we check is_cached_ before returning // the list. - // TODO(b/331841398): Consider different error behavior. if (get_is_cached()) { return calendar_list_; } @@ -130,8 +133,10 @@ timeout_.Stop(); } - // TODO(b/308699414): Add Fetch Duration metric. Also record here that a - // timeout did not occur. + calendar_metrics::RecordCalendarListFetchDuration(base::TimeTicks::Now() - + fetch_start_time_); + calendar_metrics::RecordCalendarListFetchErrorCode(error); + calendar_metrics::RecordCalendarListFetchTimeout(false); if (error == google_apis::HTTP_SUCCESS) { if (calendars && !calendars->items().empty()) { @@ -141,6 +146,8 @@ } FilterForSelectedCalendars(calendar_list_); + calendar_metrics::RecordTotalSelectedCalendars(calendar_list_.size()); + // The ordering of the calendar list is not always consistent between // API calls, so calendar lists are sorted to maintain consistency of // which events are shown. The sorter also moves the primary calendar @@ -154,7 +161,6 @@ } // In case of error, we fallback to a previously cached calendar list if it // exists. So we still notify observers of completion in all cases. - // TODO(b/331841398): Consider different error behavior. fetch_in_progress_ = false; for (auto& observer : observers_) { observer.OnCalendarListFetchComplete(); @@ -162,7 +168,8 @@ } void CalendarListModel::OnCalendarListFetchTimeout() { - // TODO(b/308699414): Record timeout. + calendar_metrics::RecordCalendarListFetchTimeout(true); + fetch_in_progress_ = false; for (auto& observer : observers_) { observer.OnCalendarListFetchComplete();
diff --git a/ash/system/time/calendar_list_model.h b/ash/system/time/calendar_list_model.h index b02dfc9..89bb2c8 100644 --- a/ash/system/time/calendar_list_model.h +++ b/ash/system/time/calendar_list_model.h
@@ -15,6 +15,7 @@ #include "base/functional/callback.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" +#include "base/time/time.h" #include "base/timer/timer.h" #include "google_apis/calendar/calendar_api_response_types.h" #include "google_apis/common/api_error_codes.h" @@ -104,6 +105,9 @@ // Indicates whether the calendar list is currently cached. bool is_cached_ = false; + // Timestamp of the start of the fetch, used for duration metrics. + base::TimeTicks fetch_start_time_; + // Timer we run at the start of a fetch, to ensure that we terminate if we // go too long without a response. base::OneShotTimer timeout_;
diff --git a/ash/system/time/calendar_list_model_unittest.cc b/ash/system/time/calendar_list_model_unittest.cc index 22d4de1..868d1e0 100644 --- a/ash/system/time/calendar_list_model_unittest.cc +++ b/ash/system/time/calendar_list_model_unittest.cc
@@ -19,11 +19,14 @@ #include "ash/session/session_controller_impl.h" #include "ash/shell.h" #include "ash/system/time/calendar_unittest_utils.h" +#include "ash/system/time/calendar_utils.h" #include "ash/test/ash_test_base.h" #include "base/run_loop.h" +#include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "components/session_manager/session_manager_types.h" #include "google_apis/calendar/calendar_api_response_types.h" +#include "google_apis/common/api_error_codes.h" namespace ash { @@ -404,6 +407,93 @@ EXPECT_EQ(0u, calendar_list.size()); } -// TODO(b/308699414): Add metrics tests. +TEST_F(CalendarListModelTest, RecordFetchResultHistogram_Success) { + base::HistogramTester histogram_tester; + + histogram_tester.ExpectBucketCount("Ash.Calendar.FetchCalendars.Result", + google_apis::HTTP_SUCCESS, + /*expected_count=*/0); + + calendar_list_model()->FetchCalendars(); + + WaitUntilFetched(); + + histogram_tester.ExpectBucketCount("Ash.Calendar.FetchCalendars.Result", + google_apis::HTTP_SUCCESS, + /*expected_count=*/1); +} + +TEST_F(CalendarListModelTest, RecordFetchResultHistogram_Failure) { + base::HistogramTester histogram_tester; + + histogram_tester.ExpectBucketCount("Ash.Calendar.FetchCalendars.Result", + google_apis::HTTP_SUCCESS, + /*expected_count=*/0); + + client()->SetError(google_apis::NO_CONNECTION); + calendar_list_model()->FetchCalendars(); + + WaitUntilFetched(); + + histogram_tester.ExpectBucketCount("Ash.Calendar.FetchCalendars.Result", + google_apis::NO_CONNECTION, + /*expected_count=*/1); + + histogram_tester.ExpectBucketCount("Ash.Calendar.FetchCalendars.Result", + google_apis::HTTP_SUCCESS, + /*expected_count=*/0); +} + +TEST_F(CalendarListModelTest, RecordFetchResultHistogram_Cancelled) { + base::HistogramTester histogram_tester; + + // Set mock calendar list and error code in the client. + client()->SetCalendarList(CreateMockCalendarList()); + client()->SetError(google_apis::CANCELLED); + calendar_list_model()->FetchCalendars(); + + calendar_list_model()->CancelFetch(); + + WaitUntilFetched(); + + // There should be no calendar list cached despite a calendar list being set + // in the client. + EXPECT_FALSE(calendar_list_model()->get_is_cached()); + + histogram_tester.ExpectBucketCount("Ash.Calendar.FetchCalendars.Result", + google_apis::CANCELLED, + /*expected_count=*/1); + + histogram_tester.ExpectBucketCount("Ash.Calendar.FetchCalendars.Result", + google_apis::HTTP_SUCCESS, + /*expected_count=*/0); +} + +TEST_F(CalendarListModelTest, RecordFetchTimeout) { + base::HistogramTester histogram_tester; + + // No timeout has been recorded yet. + histogram_tester.ExpectBucketCount("Ash.Calendar.FetchCalendars.Timeout", + true, + /*expected_count=*/0); + + client()->SetCalendarList(CreateMockCalendarList()); + + // Delay the response until after the model declares a timeout. + client()->SetResponseDelay(calendar_utils::kCalendarDataFetchTimeout + + base::Milliseconds(100)); + + calendar_list_model()->FetchCalendars(); + + task_environment()->FastForwardBy(calendar_utils::kCalendarDataFetchTimeout); + + // There should be no calendar list cached due to the timeout. + EXPECT_FALSE(calendar_list_model()->get_is_cached()); + + // A timeout should be recorded. + histogram_tester.ExpectBucketCount("Ash.Calendar.FetchCalendars.Timeout", + true, + /*expected_count=*/1); +} } // namespace ash
diff --git a/ash/system/time/calendar_metrics.cc b/ash/system/time/calendar_metrics.cc index fdf17c7..1eac510 100644 --- a/ash/system/time/calendar_metrics.cc +++ b/ash/system/time/calendar_metrics.cc
@@ -8,6 +8,7 @@ #include "base/metrics/histogram_functions.h" #include "base/notreached.h" #include "base/time/time.h" +#include "google_apis/common/api_error_codes.h" #include "ui/compositor/animation_throughput_reporter.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animator.h" @@ -47,6 +48,29 @@ constexpr char kCalendarUserAction[] = "Ash.Calendar.UserAction"; constexpr char kCalendarWebUiOpened[] = "Ash.Calendar.UserActionToOpenCalendarWebUi"; +constexpr char kCalendarFetchCalendarsFetchDuration[] = + "Ash.Calendar.FetchCalendars.FetchDuration"; +constexpr char kCalendarFetchCalendarsResult[] = + "Ash.Calendar.FetchCalendars.Result"; +constexpr char kCalendarFetchCalendarsTimeout[] = + "Ash.Calendar.FetchCalendars.Timeout"; +constexpr char kCalendarFetchEventsFetchDuration[] = + "Ash.Calendar.FetchEvents.FetchDuration"; +constexpr char kCalendarFetchEventsResult[] = "Ash.Calendar.FetchEvents.Result"; +constexpr char kCalendarFetchEventsSingleMonthSize[] = + "Ash.Calendar.FetchEvents.SingleMonthSize"; +constexpr char kCalendarFetchEventsTimeout[] = + "Ash.Calendar.FetchEvents.Timeout"; +constexpr char kCalendarFetchEventsTotalCacheSizeMonths[] = + "Ash.Calendar.FetchEvents.TotalCacheSizeMonths"; +constexpr char kCalendarFetchEventsTotalFetchDuration[] = + "Ash.Calendar.FetchEvents.TotalFetchDuration"; +constexpr char kCalendarFetchCalendarsTotalSelectedCalendars[] = + "Ash.Calendar.FetchCalendars.TotalSelectedCalendars"; +constexpr char kCalendarTimeToSeeTodaysEventDots[] = + "Ash.Calendar.TimeToSeeTodaysEventDots"; +constexpr char kCalendarTimeToSeeTodaysEventDotsForMultiCalendar[] = + "Ash.Calendar.TimeToSeeTodaysEventDotsForMultiCalendar"; // This enum is used in histograms. These values are persisted to logs. Entries // should not be renumbered and numeric values should never be reused, only add @@ -253,6 +277,61 @@ RecordCalendarUserAction(CalendarUserActionType::kSettingsButtonPressed); } +void RecordCalendarListFetchDuration(const base::TimeDelta fetch_duration) { + base::UmaHistogramTimes(kCalendarFetchCalendarsFetchDuration, fetch_duration); +} + +void RecordCalendarListFetchErrorCode(google_apis::ApiErrorCode error) { + base::UmaHistogramSparse(kCalendarFetchCalendarsResult, error); +} + +void RecordCalendarListFetchTimeout(bool fetch_timed_out) { + base::UmaHistogramBoolean(kCalendarFetchCalendarsTimeout, fetch_timed_out); +} + +void RecordEventListFetchDuration(const base::TimeDelta fetch_duration) { + base::UmaHistogramTimes(kCalendarFetchEventsFetchDuration, fetch_duration); +} + +void RecordEventListFetchErrorCode(google_apis::ApiErrorCode error) { + base::UmaHistogramSparse(kCalendarFetchEventsResult, error); +} + +void RecordEventListFetchTimeout(bool fetch_timed_out) { + base::UmaHistogramBoolean(kCalendarFetchEventsTimeout, fetch_timed_out); +} + +void RecordEventListFetchesTotalDuration(const base::TimeDelta fetch_duration) { + base::UmaHistogramTimes(kCalendarFetchEventsTotalFetchDuration, + fetch_duration); +} + +void RecordSingleMonthSizeInBytes(size_t single_month_cache_size) { + base::UmaHistogramCounts1M(kCalendarFetchEventsSingleMonthSize, + single_month_cache_size); +} + +void RecordTotalEventsCacheSizeInMonths(unsigned int events_cache_size) { + base::UmaHistogramCounts100000(kCalendarFetchEventsTotalCacheSizeMonths, + events_cache_size); +} + +void RecordTotalSelectedCalendars(unsigned int selected_calendars) { + base::UmaHistogramCounts100000(kCalendarFetchCalendarsTotalSelectedCalendars, + selected_calendars); +} + +void RecordTimeToSeeTodaysEventDots(const base::TimeDelta time_elapsed, + bool multi_calendar_enabled) { + if (multi_calendar_enabled) { + base::UmaHistogramMediumTimes( + kCalendarTimeToSeeTodaysEventDotsForMultiCalendar, time_elapsed); + } else { + base::UmaHistogramMediumTimes(kCalendarTimeToSeeTodaysEventDots, + time_elapsed); + } +} + } // namespace calendar_metrics } // namespace ash
diff --git a/ash/system/time/calendar_metrics.h b/ash/system/time/calendar_metrics.h index 8230666..4365e61 100644 --- a/ash/system/time/calendar_metrics.h +++ b/ash/system/time/calendar_metrics.h
@@ -5,8 +5,11 @@ #ifndef ASH_SYSTEM_TIME_CALENDAR_METRICS_H_ #define ASH_SYSTEM_TIME_CALENDAR_METRICS_H_ +#include <cstddef> #include <string> +#include "google_apis/common/api_error_codes.h" + namespace ui { class AnimationThroughputReporter; class Event; @@ -14,6 +17,7 @@ namespace base { class TimeDelta; +class TimeTicks; } // namespace base namespace views { @@ -120,6 +124,35 @@ void RecordSettingsButtonPressed(); +void RecordCalendarListFetchDuration(const base::TimeDelta fetch_duration); + +void RecordCalendarListFetchErrorCode(google_apis::ApiErrorCode error); + +void RecordCalendarListFetchTimeout(bool fetch_timed_out); + +void RecordEventListFetchDuration(const base::TimeDelta fetch_duration); + +void RecordEventListFetchErrorCode(google_apis::ApiErrorCode error); + +void RecordEventListFetchTimeout(bool fetch_timed_out); + +void RecordEventListFetchesTotalDuration(const base::TimeDelta fetch_duration); + +void RecordSingleMonthSizeInBytes(size_t single_month_cache_size); + +void RecordTotalEventsCacheSizeInMonths(unsigned int events_cache_size); + +void RecordTotalSelectedCalendars(unsigned int selected_calendars); + +void RecordTimeToSeeTodaysEventDots(const base::TimeDelta time_elapsed, + bool multi_calendar_enabled); + +void RecordTimeToSeeTodaysPrimaryCalendarEventDots( + const base::TimeTicks time_elapsed); + +void RecordTimeToSeeTodaysMultiCalendarEventDots( + const base::TimeTicks time_elapsed); + } // namespace calendar_metrics } // namespace ash
diff --git a/ash/system/time/calendar_model.cc b/ash/system/time/calendar_model.cc index 84aa259..e361ddd 100644 --- a/ash/system/time/calendar_model.cc +++ b/ash/system/time/calendar_model.cc
@@ -16,6 +16,7 @@ #include "ash/system/model/system_tray_model.h" #include "ash/system/time/calendar_event_fetch.h" #include "ash/system/time/calendar_list_model.h" +#include "ash/system/time/calendar_metrics.h" #include "ash/system/time/calendar_utils.h" #include "base/check.h" #include "base/containers/contains.h" @@ -258,8 +259,7 @@ } void CalendarModel::UploadLifetimeMetrics() { - base::UmaHistogramCounts100000( - "Ash.Calendar.FetchEvents.TotalCacheSizeMonths", event_months_.size()); + calendar_metrics::RecordTotalEventsCacheSizeInMonths(event_months_.size()); } void CalendarModel::MaybeFetchEvents(base::Time start_of_month) { @@ -304,6 +304,8 @@ ->GetCachedCalendarList(); if (!calendar_list.empty()) { + fetches_start_time_ = base::TimeTicks::Now(); + // Create event fetch requests for up to `kMultipleCalendarsLimit` // calendars. Expects a calendar list trimmed to be within the calendar // limit. @@ -403,10 +405,18 @@ std::string calendar_id, google_apis::ApiErrorCode error, const google_apis::calendar::EventList* events) { - base::UmaHistogramSparse("Ash.Calendar.FetchEvents.Result", error); + calendar_metrics::RecordEventListFetchErrorCode(error); fetch_error_codes_[start_of_month].emplace(error); + if (calendar_utils::IsMultiCalendarEnabled() && + pending_fetches_[start_of_month].empty()) { + // On the completion of the final calendar event fetch, record the time + // elapsed from the start of the first fetch. + calendar_metrics::RecordEventListFetchesTotalDuration( + base::TimeTicks::Now() - fetches_start_time_); + } + if (error == google_apis::CANCELLED) { return; } @@ -464,8 +474,8 @@ months_fetched_.emplace(start_of_month); // Record the size of the month, and the total number of months. - base::UmaHistogramCounts1M("Ash.Calendar.FetchEvents.SingleMonthSize", - GetEventMapSize(event_months_[start_of_month])); + calendar_metrics::RecordSingleMonthSizeInBytes( + GetEventMapSize(event_months_[start_of_month])); } }
diff --git a/ash/system/time/calendar_model.h b/ash/system/time/calendar_model.h index 10cffdf..44130bb1 100644 --- a/ash/system/time/calendar_model.h +++ b/ash/system/time/calendar_model.h
@@ -224,6 +224,10 @@ // fetches. std::map<base::Time, std::set<google_apis::ApiErrorCode>> fetch_error_codes_; + // Timestamp of the start of the first event fetch created, for use in + // duration metrics when Multi-Calendar is enabled. + base::TimeTicks fetches_start_time_; + // Maps a non-prunable month to an indicator that equals true if new event // fetches for the month have completed successfully. std::map<base::Time, bool> events_have_fetched_;
diff --git a/ash/system/time/calendar_unittest_utils.h b/ash/system/time/calendar_unittest_utils.h index d645622..f059a12 100644 --- a/ash/system/time/calendar_unittest_utils.h +++ b/ash/system/time/calendar_unittest_utils.h
@@ -339,6 +339,10 @@ // `google_apis::HTTP_SUCCESS` by default. void SetError(google_apis::ApiErrorCode error) { error_ = error; } + // Sets `delay` as the response delay. By default, the response delay is + // `kAnimationSettleDownDuration` plus 2 seconds. + void SetResponseDelay(const base::TimeDelta delay) { task_delay_ = delay; } + // Force the task to take longer than the default timeout, causing an internal // error to be propagated. void ForceTimeout() {
diff --git a/ash/system/time/calendar_view_controller.cc b/ash/system/time/calendar_view_controller.cc index 5efb0f1..8043cc3 100644 --- a/ash/system/time/calendar_view_controller.cc +++ b/ash/system/time/calendar_view_controller.cc
@@ -257,8 +257,9 @@ if (todays_date_cell_fetch_recorded_) return; - UmaHistogramMediumTimes("Ash.Calendar.TimeToSeeTodaysEventDots", - base::TimeTicks::Now() - calendar_open_time_); + calendar_metrics::RecordTimeToSeeTodaysEventDots( + base::TimeTicks::Now() - calendar_open_time_, + /*multi_calendar_enabled=*/calendar_utils::IsMultiCalendarEnabled()); todays_date_cell_fetch_recorded_ = true; }
diff --git a/ash/system/toast/system_toast_view.cc b/ash/system/toast/system_toast_view.cc index 3de562a..42edeac 100644 --- a/ash/system/toast/system_toast_view.cc +++ b/ash/system/toast/system_toast_view.cc
@@ -34,7 +34,7 @@ constexpr gfx::Insets kToastInteriorMargin = gfx::Insets::VH(8, 16); constexpr gfx::Insets kMultilineToastInteriorMargin = gfx::Insets::VH(8, 24); constexpr gfx::Insets kToastWithButtonInteriorMargin = - gfx::Insets::TLBR(2, 16, 2, 0); + gfx::Insets::TLBR(2, 16, 2, 2); constexpr gfx::Insets kMultilineToastWithButtonInteriorMargin = gfx::Insets::TLBR(8, 24, 8, 12); @@ -47,6 +47,15 @@ } // namespace SystemToastView::SystemToastView(const ToastData& toast_data) + : SystemToastView(toast_data.text, + toast_data.dismiss_text, + toast_data.dismiss_callback, + toast_data.leading_icon) {} + +SystemToastView::SystemToastView(const std::u16string& text, + const std::u16string& dismiss_text, + base::RepeatingClosure dismiss_callback, + const gfx::VectorIcon* leading_icon) : scoped_a11y_overrider_( std::make_unique<ScopedA11yOverrideWindowSetter>()) { // Paint to layer so the background can be transparent. @@ -58,15 +67,14 @@ SetOrientation(views::LayoutOrientation::kHorizontal); SetCrossAxisAlignment(views::LayoutAlignment::kCenter); - if (!toast_data.leading_icon->is_empty()) { - AddChildView( - views::Builder<views::ImageView>() - .SetID(VIEW_ID_TOAST_IMAGE_VIEW) - .SetPreferredSize( - gfx::Size(kToastLeadingIconSize, kToastLeadingIconSize)) - .SetImage(ui::ImageModel::FromVectorIcon( - *toast_data.leading_icon, cros_tokens::kCrosSysOnSurface)) - .Build()); + if (!leading_icon->is_empty()) { + AddChildView(views::Builder<views::ImageView>() + .SetID(VIEW_ID_TOAST_IMAGE_VIEW) + .SetPreferredSize(gfx::Size(kToastLeadingIconSize, + kToastLeadingIconSize)) + .SetImage(ui::ImageModel::FromVectorIcon( + *leading_icon, cros_tokens::kCrosSysOnSurface)) + .Build()); auto* icon_padding = AddChildView(std::make_unique<views::View>()); icon_padding->SetPreferredSize( @@ -76,8 +84,8 @@ auto* label = AddChildView( views::Builder<views::Label>() .SetID(VIEW_ID_TOAST_LABEL) - .SetText(toast_data.text) - .SetTooltipText(toast_data.text) + .SetText(text) + .SetTooltipText(text) .SetHorizontalAlignment(gfx::ALIGN_LEFT) .SetEnabledColorId(cros_tokens::kCrosSysOnSurface) .SetAutoColorReadabilityEnabled(false) @@ -88,15 +96,15 @@ .SetMaxLines(2) .Build()); - const bool has_button = !toast_data.dismiss_text.empty(); + const bool has_button = !dismiss_text.empty(); if (has_button) { AddChildView( views::Builder<PillButton>() .CopyAddressTo(&dismiss_button_) .SetID(VIEW_ID_TOAST_BUTTON) - .SetCallback(std::move(toast_data.dismiss_callback)) - .SetText(toast_data.dismiss_text) - .SetTooltipText(toast_data.dismiss_text) + .SetCallback(std::move(dismiss_callback)) + .SetText(dismiss_text) + .SetTooltipText(dismiss_text) .SetPillButtonType(PillButton::Type::kAccentFloatingWithoutIcon) .SetFocusBehavior(views::View::FocusBehavior::ALWAYS) .Build());
diff --git a/ash/system/toast/system_toast_view.h b/ash/system/toast/system_toast_view.h index 6fa3ace..02705691 100644 --- a/ash/system/toast/system_toast_view.h +++ b/ash/system/toast/system_toast_view.h
@@ -8,6 +8,7 @@ #include "ash/ash_export.h" #include "base/memory/raw_ptr.h" #include "ui/base/metadata/metadata_header_macros.h" +#include "ui/gfx/paint_vector_icon.h" #include "ui/views/layout/flex_layout_view.h" namespace views { @@ -29,6 +30,10 @@ public: explicit SystemToastView(const ToastData& toast_data); + SystemToastView(const std::u16string& text, + const std::u16string& dismiss_text = std::u16string(), + base::RepeatingClosure dismiss_callback = base::DoNothing(), + const gfx::VectorIcon* leading_icon = &gfx::kNoneIcon); SystemToastView(const SystemToastView&) = delete; SystemToastView& operator=(const SystemToastView&) = delete; ~SystemToastView() override;
diff --git a/ash/system/toast/system_toast_view_pixeltest.cc b/ash/system/toast/system_toast_view_pixeltest.cc index 8eedcf9..c6a2291 100644 --- a/ash/system/toast/system_toast_view_pixeltest.cc +++ b/ash/system/toast/system_toast_view_pixeltest.cc
@@ -104,7 +104,7 @@ std::make_unique<SystemToastView>(toast_data)); EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( - "screenshot", /*revision_number=*/4, GetContentsView())); + "screenshot", /*revision_number=*/5, GetContentsView())); } TEST_F(SystemToastViewPixelTest, WithLeadingIconAndButton) { @@ -117,7 +117,7 @@ std::make_unique<SystemToastView>(toast_data)); EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( - "screenshot", /*revision_number=*/4, GetContentsView())); + "screenshot", /*revision_number=*/5, GetContentsView())); } TEST_F(SystemToastViewPixelTest, Multiline_TextOnly) {
diff --git a/ash/system/video_conference/bubble/bubble_view.cc b/ash/system/video_conference/bubble/bubble_view.cc index 33e3c9e..17e68afe 100644 --- a/ash/system/video_conference/bubble/bubble_view.cc +++ b/ash/system/video_conference/bubble/bubble_view.cc
@@ -45,7 +45,7 @@ constexpr int kLinuxAppWarningViewTopPadding = 12; constexpr int kLinuxAppWarningViewSpacing = 1; constexpr int kLinuxAppWarningIconSize = 16; -constexpr int kScrollViewBetweenChildSpacing = 10; +constexpr int kScrollViewBetweenChildSpacing = 16; CameraEffectsController* GetCameraEffectsController() { return Shell::Get()->camera_effects_controller();
diff --git a/ash/system/video_conference/bubble/bubble_view_pixeltest.cc b/ash/system/video_conference/bubble/bubble_view_pixeltest.cc index 2d2301f..073206d 100644 --- a/ash/system/video_conference/bubble/bubble_view_pixeltest.cc +++ b/ash/system/video_conference/bubble/bubble_view_pixeltest.cc
@@ -222,7 +222,7 @@ EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_bubble_view_basic", - /*revision_number=*/11, bubble_view())); + /*revision_number=*/12, bubble_view())); } // Pixel test that tests toggled on/off and focused/not focused for the toggle @@ -246,14 +246,14 @@ EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_bubble_view_no_focus_not_toggled", - /*revision_number=*/11, toggle_effect_button_container)); + /*revision_number=*/12, toggle_effect_button_container)); // Toggle the first button, the UI should change. LeftClickOn(first_toggle_effect_button); ASSERT_EQ(1, office_bunny()->num_activations_for_testing()); EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_bubble_view_no_focus_toggled", - /*revision_number=*/8, toggle_effect_button_container)); + /*revision_number=*/9, toggle_effect_button_container)); // Un-toggle the button, then keyboard focus it. LeftClickOn(first_toggle_effect_button); @@ -265,7 +265,7 @@ EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_bubble_view_with_focus_not_toggled", - /*revision_number=*/11, toggle_effect_button_container)); + /*revision_number=*/12, toggle_effect_button_container)); // Re-toggle the button. event_generator->PressAndReleaseKey(ui::KeyboardCode::VKEY_RETURN); @@ -274,7 +274,7 @@ EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_bubble_view_with_focus_toggled", - /*revision_number=*/10, toggle_effect_button_container)); + /*revision_number=*/11, toggle_effect_button_container)); } // Pixel test that tests the expanded/collapsed state of the return to app panel @@ -295,7 +295,7 @@ EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_tray_return_to_app_one_app", - /*revision_number=*/5, GetReturnToAppPanel())); + /*revision_number=*/6, GetReturnToAppPanel())); controller()->AddMediaApp(CreateFakeMediaApp( /*is_capturing_camera=*/false, /*is_capturing_microphone=*/true, @@ -311,7 +311,7 @@ EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_tray_return_to_app_two_apps_collapsed", - /*revision_number=*/5, return_to_app_panel)); + /*revision_number=*/6, return_to_app_panel)); // Click the summary row to expand the panel. auto* summary_row = static_cast<video_conference::ReturnToAppButton*>( @@ -321,7 +321,7 @@ EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_tray_return_to_app_two_apps_expanded", - /*revision_number=*/5, return_to_app_panel)); + /*revision_number=*/6, return_to_app_panel)); } TEST_P(BubbleViewPixelTest, ReturnToAppLinux) { @@ -341,7 +341,7 @@ EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_tray_linux_bubble_one_app", - /*revision_number=*/8, video_conference_tray()->GetBubbleView())); + /*revision_number=*/9, video_conference_tray()->GetBubbleView())); controller()->AddMediaApp(CreateFakeMediaApp( /*is_capturing_camera=*/true, /*is_capturing_microphone=*/true, @@ -356,7 +356,7 @@ EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_tray_linux_bubble_two_app", - /*revision_number=*/8, video_conference_tray()->GetBubbleView())); + /*revision_number=*/9, video_conference_tray()->GetBubbleView())); } TEST_P(BubbleViewPixelTest, OneToggleEffects) { @@ -370,7 +370,7 @@ EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_bubble_view_one_toggle_effect", - /*revision_number=*/5, GetToggleEffectsView())); + /*revision_number=*/6, GetToggleEffectsView())); } TEST_P(BubbleViewPixelTest, TwoToggleEffects) { @@ -385,7 +385,7 @@ EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_bubble_view_two_toggle_effects", - /*revision_number=*/5, GetToggleEffectsView())); + /*revision_number=*/6, GetToggleEffectsView())); } TEST_P(BubbleViewPixelTest, ThreeToggleEffects) { @@ -405,7 +405,7 @@ EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( "video_conference_bubble_view_three_toggle_effects", - /*revision_number=*/5, GetToggleEffectsView())); + /*revision_number=*/6, GetToggleEffectsView())); } } // namespace ash::video_conference
diff --git a/ash/system/video_conference/bubble/set_camera_background_view.cc b/ash/system/video_conference/bubble/set_camera_background_view.cc index d8d2a08..863a50c4 100644 --- a/ash/system/video_conference/bubble/set_camera_background_view.cc +++ b/ash/system/video_conference/bubble/set_camera_background_view.cc
@@ -50,21 +50,21 @@ constexpr char kCreateWithAiButtonHistogramName[] = "Ash.VideoConferenceTray.CreateWithAiButton.Click"; -// Decides the margin for the `SetCameraBackgroundView`. -constexpr gfx::Insets kSetCameraBackgroundViewInsideBorderInsets = - gfx::Insets::TLBR(10, 0, 0, 0); - +// This extra border is added to `CreateImageButton` to make it consistent with +// other buttons in the video conference bubble. constexpr gfx::Insets kImageLabelContainerInsideBorderInsets = - gfx::Insets::TLBR(6, 0, 6, 0); + gfx::Insets::VH(8, 0); +// Distance between the wand icon and the "Create with AI" label constexpr int kCreateImageButtonBetweenChildSpacing = 12; -constexpr int kSetCameraBackgroundViewBetweenChildSpacing = 10; -constexpr int kSetCameraBackgroundViewRadius = 16; +// Vertical Distance between Recently used image and Create with AI button +constexpr int kSetCameraBackgroundViewBetweenChildSpacing = 16; +constexpr int kSetCameraBackgroundViewRadius = 18; constexpr int kButtonHeight = 20; constexpr int kMaxRecentBackgroundToDislay = 4; -constexpr int kRecentlyUsedImagesFullLength = 336; -constexpr int kRecentlyUsedImagesHeight = 64; +constexpr int kRecentlyUsedImagesFullLength = 368; +constexpr int kRecentlyUsedImagesHeight = 76; constexpr int kRecentlyUsedImagesSpacing = 10; constexpr int kRecentlyUsedImageButtonId[] = { @@ -489,7 +489,7 @@ // vertically. auto* layout = SetLayoutManager(std::make_unique<views::BoxLayout>( views::BoxLayout::Orientation::kVertical, - /*inside_border_insets=*/kSetCameraBackgroundViewInsideBorderInsets, + /*inside_border_insets=*/gfx::Insets(), /*between_child_spacing=*/kSetCameraBackgroundViewBetweenChildSpacing)); layout->set_cross_axis_alignment( views::BoxLayout::CrossAxisAlignment::kStretch);
diff --git a/ash/system/video_conference/bubble/set_value_effects_view.cc b/ash/system/video_conference/bubble/set_value_effects_view.cc index 91b0c4a..40dc55db 100644 --- a/ash/system/video_conference/bubble/set_value_effects_view.cc +++ b/ash/system/video_conference/bubble/set_value_effects_view.cc
@@ -192,7 +192,8 @@ SetID(BubbleViewID::kSingleSetValueEffectView); auto* layout = SetLayoutManager(std::make_unique<views::BoxLayout>( views::BoxLayout::Orientation::kVertical, - /*inside_border_insets=*/gfx::Insets(), /*between_child_spacing=*/8)); + /*inside_border_insets=*/gfx::Insets(), + /*between_child_spacing=*/16)); layout->set_cross_axis_alignment( views::BoxLayout::CrossAxisAlignment::kStretch); @@ -202,7 +203,7 @@ label_container->SetOrientation(views::BoxLayout::Orientation::kHorizontal); label_container->SetMainAxisAlignment( views::BoxLayout::MainAxisAlignment::kStart); - label_container->SetInsideBorderInsets(gfx::Insets::TLBR(0, 8, 0, 0)); + label_container->SetInsideBorderInsets(gfx::Insets::TLBR(0, 4, 0, 0)); auto* label = label_container->AddChildView( std::make_unique<views::Label>(effect->label_text()));
diff --git a/ash/system/video_conference/bubble/toggle_effects_view.cc b/ash/system/video_conference/bubble/toggle_effects_view.cc index e062e0f..4298d93 100644 --- a/ash/system/video_conference/bubble/toggle_effects_view.cc +++ b/ash/system/video_conference/bubble/toggle_effects_view.cc
@@ -292,7 +292,8 @@ .SetMainAxisAlignment(views::LayoutAlignment::kCenter) .SetCrossAxisAlignment(views::LayoutAlignment::kStretch) .SetDefault(views::kMarginsKey, - gfx::Insets::TLBR(0, 0, kButtonContainerSpacing, 0)); + gfx::Insets::TLBR(0, 0, kButtonContainerSpacing, 0)) + .SetIgnoreDefaultMainAxisMargins(true); // The effects manager provides the toggle effects in rows. auto& effects_manager = controller->GetEffectsManager(); @@ -307,7 +308,8 @@ .SetCrossAxisAlignment(views::LayoutAlignment::kStretch) .SetDefault(views::kMarginsKey, gfx::Insets::TLBR(0, kButtonContainerSpacing / 2, 0, - kButtonContainerSpacing / 2)); + kButtonContainerSpacing / 2)) + .SetIgnoreDefaultMainAxisMargins(true); // Add a button for each item in the row. for (auto* tile : row) {
diff --git a/ash/system/video_conference/resources/create_with_ai_button_gradient.json b/ash/system/video_conference/resources/create_with_ai_button_gradient.json index 3d65be3..22b3faf7 100644 --- a/ash/system/video_conference/resources/create_with_ai_button_gradient.json +++ b/ash/system/video_conference/resources/create_with_ai_button_gradient.json
@@ -1 +1 @@ -{"v":"5.9.3","fr":60,"ip":0,"op":193,"w":336,"h":33,"nm":"Pod panel toggle tile","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"Null 13","sr":1,"ks":{"o":{"a":0,"k":0,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":0,"s":[271.5,15.5,0],"to":[0,0,0],"ti":[0,0,0]},{"t":180,"s":[2363.5,17.5,0]}],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[125,125,100],"ix":6,"l":2}},"ao":0,"ip":0,"op":253,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":1,"nm":"White Solid 13","parent":4,"td":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":148,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":180,"s":[100]},{"t":212,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[919.65,119,0],"ix":2,"l":2},"a":{"a":0,"k":[307,119,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Gradient Ramp","np":10,"mn":"ADBE Ramp","ix":1,"en":1,"ef":[{"ty":3,"nm":"Start of Ramp","mn":"ADBE Ramp-0001","ix":1,"v":{"a":0,"k":[128,60],"ix":1}},{"ty":2,"nm":"Start Color","mn":"ADBE Ramp-0002","ix":2,"v":{"a":0,"k":[0,0,0,1],"ix":2}},{"ty":3,"nm":"End of Ramp","mn":"ADBE Ramp-0003","ix":3,"v":{"a":0,"k":[472,210],"ix":3}},{"ty":2,"nm":"End Color","mn":"ADBE Ramp-0004","ix":4,"v":{"a":0,"k":[1,1,1,1],"ix":4}},{"ty":7,"nm":"Ramp Shape","mn":"ADBE Ramp-0005","ix":5,"v":{"a":0,"k":1,"ix":5}},{"ty":0,"nm":"Ramp Scatter","mn":"ADBE Ramp-0006","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"nm":"Blend With Original","mn":"ADBE Ramp-0007","ix":7,"v":{"a":0,"k":0,"ix":7}},{"ty":6,"nm":"","mn":"ADBE Ramp-0008","ix":8,"v":0}]}],"sw":614,"sh":238,"sc":"#ffffff","ip":56,"op":198,"st":90,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Layer 1 Outlines 7","tt":3,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":159,"s":[100]},{"t":192,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[168,16.5,0],"ix":2,"l":2},"a":{"a":0,"k":[186.25,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[90.323,91.667,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-168,-18],[-186,0],[-168,18],[168,18],[186,0],[168,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.701960802078,0.941176474094,0.827450990677,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.illo.complement","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys complement"},{"ty":"tr","p":{"a":0,"k":[186.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1125,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":4,"ty":1,"nm":"White Solid 13","parent":6,"td":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":160,"s":[100]},{"t":192,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[915.672,119,0],"ix":2,"l":2},"a":{"a":0,"k":[307,119,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Gradient Ramp","np":10,"mn":"ADBE Ramp","ix":1,"en":1,"ef":[{"ty":3,"nm":"Start of Ramp","mn":"ADBE Ramp-0001","ix":1,"v":{"a":0,"k":[128,60],"ix":1}},{"ty":2,"nm":"Start Color","mn":"ADBE Ramp-0002","ix":2,"v":{"a":0,"k":[1,1,1,1],"ix":2}},{"ty":3,"nm":"End of Ramp","mn":"ADBE Ramp-0003","ix":3,"v":{"a":0,"k":[472,210],"ix":3}},{"ty":2,"nm":"End Color","mn":"ADBE Ramp-0004","ix":4,"v":{"a":0,"k":[0,0,0,1],"ix":4}},{"ty":7,"nm":"Ramp Shape","mn":"ADBE Ramp-0005","ix":5,"v":{"a":0,"k":1,"ix":5}},{"ty":0,"nm":"Ramp Scatter","mn":"ADBE Ramp-0006","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"nm":"Blend With Original","mn":"ADBE Ramp-0007","ix":7,"v":{"a":0,"k":0,"ix":7}},{"ty":6,"nm":"","mn":"ADBE Ramp-0008","ix":8,"v":0}]}],"sw":614,"sh":238,"sc":"#ffffff","ip":56,"op":198,"st":90,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"Layer 1 Outlines 6","tt":3,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":160,"s":[100]},{"t":192,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[168,16.5,0],"ix":2,"l":2},"a":{"a":0,"k":[186.25,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[90.323,91.667,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-168,-18],[-186,0],[-168,18],[168,18],[186,0],[168,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.701960802078,0.941176474094,0.827450990677,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.illo.complement","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys complement"},{"ty":"tr","p":{"a":0,"k":[186.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1125,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":6,"ty":1,"nm":"White Solid 13","parent":1,"td":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":171,"s":[100]},{"t":192,"s":[0]}],"ix":11},"r":{"a":0,"k":180,"ix":10},"p":{"a":0,"k":[-1086.762,-0.396,0],"ix":2,"l":2},"a":{"a":0,"k":[307,119,0],"ix":1,"l":2},"s":{"a":0,"k":[54,54,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Gradient Ramp","np":10,"mn":"ADBE Ramp","ix":1,"en":1,"ef":[{"ty":3,"nm":"Start of Ramp","mn":"ADBE Ramp-0001","ix":1,"v":{"a":0,"k":[128,60],"ix":1}},{"ty":2,"nm":"Start Color","mn":"ADBE Ramp-0002","ix":2,"v":{"a":0,"k":[0,0,0,1],"ix":2}},{"ty":3,"nm":"End of Ramp","mn":"ADBE Ramp-0003","ix":3,"v":{"a":0,"k":[472,210],"ix":3}},{"ty":2,"nm":"End Color","mn":"ADBE Ramp-0004","ix":4,"v":{"a":0,"k":[1,1,1,1],"ix":4}},{"ty":7,"nm":"Ramp Shape","mn":"ADBE Ramp-0005","ix":5,"v":{"a":0,"k":1,"ix":5}},{"ty":0,"nm":"Ramp Scatter","mn":"ADBE Ramp-0006","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"nm":"Blend With Original","mn":"ADBE Ramp-0007","ix":7,"v":{"a":0,"k":0,"ix":7}},{"ty":6,"nm":"","mn":"ADBE Ramp-0008","ix":8,"v":0}]}],"sw":614,"sh":238,"sc":"#ffffff","ip":56,"op":149,"st":90,"bm":0},{"ddd":0,"ind":7,"ty":4,"nm":"Layer 1 Outlines 5","tt":3,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[168,16.5,0],"ix":2,"l":2},"a":{"a":0,"k":[186.25,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[90.323,91.667,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-168,-18],[-186,0],[-168,18],[168,18],[186,0],[168,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.701960802078,0.941176474094,0.827450990677,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.illo.complement","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys complement"},{"ty":"tr","p":{"a":0,"k":[186.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":149,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":8,"ty":1,"nm":"White Solid 14","parent":1,"td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[-96.341,-1.826,0],"ix":2,"l":2},"a":{"a":0,"k":[307,119,0],"ix":1,"l":2},"s":{"a":0,"k":[54,54,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Gradient Ramp","np":10,"mn":"ADBE Ramp","ix":1,"en":1,"ef":[{"ty":3,"nm":"Start of Ramp","mn":"ADBE Ramp-0001","ix":1,"v":{"a":0,"k":[128,60],"ix":1}},{"ty":2,"nm":"Start Color","mn":"ADBE Ramp-0002","ix":2,"v":{"a":0,"k":[0,0,0,1],"ix":2}},{"ty":3,"nm":"End of Ramp","mn":"ADBE Ramp-0003","ix":3,"v":{"a":0,"k":[472,210],"ix":3}},{"ty":2,"nm":"End Color","mn":"ADBE Ramp-0004","ix":4,"v":{"a":0,"k":[1,1,1,1],"ix":4}},{"ty":7,"nm":"Ramp Shape","mn":"ADBE Ramp-0005","ix":5,"v":{"a":0,"k":1,"ix":5}},{"ty":0,"nm":"Ramp Scatter","mn":"ADBE Ramp-0006","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"nm":"Blend With Original","mn":"ADBE Ramp-0007","ix":7,"v":{"a":0,"k":0,"ix":7}},{"ty":6,"nm":"","mn":"ADBE Ramp-0008","ix":8,"v":0}]}],"sw":614,"sh":238,"sc":"#ffffff","ip":0,"op":149,"st":0,"bm":0},{"ddd":0,"ind":9,"ty":4,"nm":"Layer 1 Outlines 4","tt":3,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[168,16.5,0],"ix":2,"l":2},"a":{"a":0,"k":[186.25,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[90.323,91.667,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-168,-18],[-186,0],[-168,18],[168,18],[186,0],[168,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.701960802078,0.941176474094,0.827450990677,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.illo.complement","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys complement"},{"ty":"tr","p":{"a":0,"k":[186.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":149,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":10,"ty":1,"nm":"White Solid 13","parent":8,"td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[-304.791,119,0],"ix":2,"l":2},"a":{"a":0,"k":[307,119,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Gradient Ramp","np":10,"mn":"ADBE Ramp","ix":1,"en":1,"ef":[{"ty":3,"nm":"Start of Ramp","mn":"ADBE Ramp-0001","ix":1,"v":{"a":0,"k":[128,60],"ix":1}},{"ty":2,"nm":"Start Color","mn":"ADBE Ramp-0002","ix":2,"v":{"a":0,"k":[1,1,1,1],"ix":2}},{"ty":3,"nm":"End of Ramp","mn":"ADBE Ramp-0003","ix":3,"v":{"a":0,"k":[472,210],"ix":3}},{"ty":2,"nm":"End Color","mn":"ADBE Ramp-0004","ix":4,"v":{"a":0,"k":[0,0,0,1],"ix":4}},{"ty":7,"nm":"Ramp Shape","mn":"ADBE Ramp-0005","ix":5,"v":{"a":0,"k":1,"ix":5}},{"ty":0,"nm":"Ramp Scatter","mn":"ADBE Ramp-0006","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"nm":"Blend With Original","mn":"ADBE Ramp-0007","ix":7,"v":{"a":0,"k":0,"ix":7}},{"ty":6,"nm":"","mn":"ADBE Ramp-0008","ix":8,"v":0}]}],"sw":614,"sh":238,"sc":"#ffffff","ip":0,"op":149,"st":0,"bm":0},{"ddd":0,"ind":11,"ty":4,"nm":"Layer 1 Outlines 3","tt":3,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[168,16.5,0],"ix":2,"l":2},"a":{"a":0,"k":[186.25,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[90.323,91.667,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-168,-18],[-186,0],[-168,18],[168,18],[186,0],[168,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.701960802078,0.941176474094,0.827450990677,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.illo.complement","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys complement"},{"ty":"tr","p":{"a":0,"k":[186.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":149,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":12,"ty":1,"nm":"White Solid 13","parent":10,"td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[-301.865,119,0],"ix":2,"l":2},"a":{"a":0,"k":[307,119,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Gradient Ramp","np":10,"mn":"ADBE Ramp","ix":1,"en":1,"ef":[{"ty":3,"nm":"Start of Ramp","mn":"ADBE Ramp-0001","ix":1,"v":{"a":0,"k":[128,60],"ix":1}},{"ty":2,"nm":"Start Color","mn":"ADBE Ramp-0002","ix":2,"v":{"a":0,"k":[0,0,0,1],"ix":2}},{"ty":3,"nm":"End of Ramp","mn":"ADBE Ramp-0003","ix":3,"v":{"a":0,"k":[472,210],"ix":3}},{"ty":2,"nm":"End Color","mn":"ADBE Ramp-0004","ix":4,"v":{"a":0,"k":[1,1,1,1],"ix":4}},{"ty":7,"nm":"Ramp Shape","mn":"ADBE Ramp-0005","ix":5,"v":{"a":0,"k":1,"ix":5}},{"ty":0,"nm":"Ramp Scatter","mn":"ADBE Ramp-0006","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"nm":"Blend With Original","mn":"ADBE Ramp-0007","ix":7,"v":{"a":0,"k":0,"ix":7}},{"ty":6,"nm":"","mn":"ADBE Ramp-0008","ix":8,"v":0}]}],"sw":614,"sh":238,"sc":"#ffffff","ip":0,"op":149,"st":0,"bm":0},{"ddd":0,"ind":13,"ty":4,"nm":"Layer 1 Outlines 2","tt":3,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[168,16.5,0],"ix":2,"l":2},"a":{"a":0,"k":[186.25,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[90.323,91.667,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-168,-18],[-186,0],[-168,18],[168,18],[186,0],[168,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.701960802078,0.941176474094,0.827450990677,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.illo.complement","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys complement"},{"ty":"tr","p":{"a":0,"k":[186.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":149,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":14,"ty":4,"nm":"Layer 1 Outlines","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":12,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":148,"s":[100]},{"t":180,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[168,16.5,0],"ix":2,"l":2},"a":{"a":0,"k":[186.25,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[90.323,91.667,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-168,-18],[-186,0],[-168,18],[168,18],[186,0],[168,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.61960786581,0.639215707779,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.illo.analog","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys analog"},{"ty":"tr","p":{"a":0,"k":[186.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1125,"st":0,"ct":1,"bm":0}],"markers":[{"tm":192,"cm":"7","dr":0}]} \ No newline at end of file +{"v":"5.9.3","fr":60,"ip":0,"op":193,"w":368,"h":36,"nm":"Pod panel toggle tile","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"Null 13","sr":1,"ks":{"o":{"a":0,"k":0,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":0,"s":[287.5,17,0],"to":[0,0,0],"ti":[0,0,0]},{"t":180,"s":[2379.5,19,0]}],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[125,125,100],"ix":6,"l":2}},"ao":0,"ip":0,"op":253,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":1,"nm":"White Solid 13","parent":4,"td":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":148,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":180,"s":[100]},{"t":212,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[919.65,119,0],"ix":2,"l":2},"a":{"a":0,"k":[307,119,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Gradient Ramp","np":10,"mn":"ADBE Ramp","ix":1,"en":1,"ef":[{"ty":3,"nm":"Start of Ramp","mn":"ADBE Ramp-0001","ix":1,"v":{"a":0,"k":[128,60],"ix":1}},{"ty":2,"nm":"Start Color","mn":"ADBE Ramp-0002","ix":2,"v":{"a":0,"k":[0,0,0,1],"ix":2}},{"ty":3,"nm":"End of Ramp","mn":"ADBE Ramp-0003","ix":3,"v":{"a":0,"k":[472,210],"ix":3}},{"ty":2,"nm":"End Color","mn":"ADBE Ramp-0004","ix":4,"v":{"a":0,"k":[1,1,1,1],"ix":4}},{"ty":7,"nm":"Ramp Shape","mn":"ADBE Ramp-0005","ix":5,"v":{"a":0,"k":1,"ix":5}},{"ty":0,"nm":"Ramp Scatter","mn":"ADBE Ramp-0006","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"nm":"Blend With Original","mn":"ADBE Ramp-0007","ix":7,"v":{"a":0,"k":0,"ix":7}},{"ty":6,"nm":"","mn":"ADBE Ramp-0008","ix":8,"v":0}]}],"sw":614,"sh":238,"sc":"#ffffff","ip":56,"op":198,"st":90,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Layer 1 Outlines 8","tt":3,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[184,18,0],"ix":2,"l":2},"a":{"a":0,"k":[184.253,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-166,-18],[-184,0],[-166,18],[166,18],[184,0],[166,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.701960802078,0.941176474094,0.827450990677,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.complement","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys complement"},{"ty":"tr","p":{"a":0,"k":[184.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1125,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":4,"ty":1,"nm":"White Solid 13","parent":6,"td":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":160,"s":[100]},{"t":192,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[915.672,119,0],"ix":2,"l":2},"a":{"a":0,"k":[307,119,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Gradient Ramp","np":10,"mn":"ADBE Ramp","ix":1,"en":1,"ef":[{"ty":3,"nm":"Start of Ramp","mn":"ADBE Ramp-0001","ix":1,"v":{"a":0,"k":[128,60],"ix":1}},{"ty":2,"nm":"Start Color","mn":"ADBE Ramp-0002","ix":2,"v":{"a":0,"k":[1,1,1,1],"ix":2}},{"ty":3,"nm":"End of Ramp","mn":"ADBE Ramp-0003","ix":3,"v":{"a":0,"k":[472,210],"ix":3}},{"ty":2,"nm":"End Color","mn":"ADBE Ramp-0004","ix":4,"v":{"a":0,"k":[0,0,0,1],"ix":4}},{"ty":7,"nm":"Ramp Shape","mn":"ADBE Ramp-0005","ix":5,"v":{"a":0,"k":1,"ix":5}},{"ty":0,"nm":"Ramp Scatter","mn":"ADBE Ramp-0006","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"nm":"Blend With Original","mn":"ADBE Ramp-0007","ix":7,"v":{"a":0,"k":0,"ix":7}},{"ty":6,"nm":"","mn":"ADBE Ramp-0008","ix":8,"v":0}]}],"sw":614,"sh":238,"sc":"#ffffff","ip":56,"op":198,"st":90,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"Layer 1 Outlines 9","tt":3,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[184,18,0],"ix":2,"l":2},"a":{"a":0,"k":[184.253,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-166,-18],[-184,0],[-166,18],[166,18],[184,0],[166,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.701960802078,0.941176474094,0.827450990677,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.complement","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys complement"},{"ty":"tr","p":{"a":0,"k":[184.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1125,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":6,"ty":1,"nm":"White Solid 13","parent":1,"td":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":171,"s":[100]},{"t":192,"s":[0]}],"ix":11},"r":{"a":0,"k":180,"ix":10},"p":{"a":0,"k":[-1086.762,-0.396,0],"ix":2,"l":2},"a":{"a":0,"k":[307,119,0],"ix":1,"l":2},"s":{"a":0,"k":[54,54,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Gradient Ramp","np":10,"mn":"ADBE Ramp","ix":1,"en":1,"ef":[{"ty":3,"nm":"Start of Ramp","mn":"ADBE Ramp-0001","ix":1,"v":{"a":0,"k":[128,60],"ix":1}},{"ty":2,"nm":"Start Color","mn":"ADBE Ramp-0002","ix":2,"v":{"a":0,"k":[0,0,0,1],"ix":2}},{"ty":3,"nm":"End of Ramp","mn":"ADBE Ramp-0003","ix":3,"v":{"a":0,"k":[472,210],"ix":3}},{"ty":2,"nm":"End Color","mn":"ADBE Ramp-0004","ix":4,"v":{"a":0,"k":[1,1,1,1],"ix":4}},{"ty":7,"nm":"Ramp Shape","mn":"ADBE Ramp-0005","ix":5,"v":{"a":0,"k":1,"ix":5}},{"ty":0,"nm":"Ramp Scatter","mn":"ADBE Ramp-0006","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"nm":"Blend With Original","mn":"ADBE Ramp-0007","ix":7,"v":{"a":0,"k":0,"ix":7}},{"ty":6,"nm":"","mn":"ADBE Ramp-0008","ix":8,"v":0}]}],"sw":614,"sh":238,"sc":"#ffffff","ip":56,"op":149,"st":90,"bm":0},{"ddd":0,"ind":7,"ty":4,"nm":"Layer 1 Outlines 10","tt":3,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[184,18,0],"ix":2,"l":2},"a":{"a":0,"k":[184.253,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-166,-18],[-184,0],[-166,18],[166,18],[184,0],[166,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.701960802078,0.941176474094,0.827450990677,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.complement","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys complement"},{"ty":"tr","p":{"a":0,"k":[184.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1125,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":8,"ty":1,"nm":"White Solid 14","parent":1,"td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[-96.341,-1.826,0],"ix":2,"l":2},"a":{"a":0,"k":[307,119,0],"ix":1,"l":2},"s":{"a":0,"k":[54,54,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Gradient Ramp","np":10,"mn":"ADBE Ramp","ix":1,"en":1,"ef":[{"ty":3,"nm":"Start of Ramp","mn":"ADBE Ramp-0001","ix":1,"v":{"a":0,"k":[128,60],"ix":1}},{"ty":2,"nm":"Start Color","mn":"ADBE Ramp-0002","ix":2,"v":{"a":0,"k":[0,0,0,1],"ix":2}},{"ty":3,"nm":"End of Ramp","mn":"ADBE Ramp-0003","ix":3,"v":{"a":0,"k":[472,210],"ix":3}},{"ty":2,"nm":"End Color","mn":"ADBE Ramp-0004","ix":4,"v":{"a":0,"k":[1,1,1,1],"ix":4}},{"ty":7,"nm":"Ramp Shape","mn":"ADBE Ramp-0005","ix":5,"v":{"a":0,"k":1,"ix":5}},{"ty":0,"nm":"Ramp Scatter","mn":"ADBE Ramp-0006","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"nm":"Blend With Original","mn":"ADBE Ramp-0007","ix":7,"v":{"a":0,"k":0,"ix":7}},{"ty":6,"nm":"","mn":"ADBE Ramp-0008","ix":8,"v":0}]}],"sw":614,"sh":238,"sc":"#ffffff","ip":0,"op":149,"st":0,"bm":0},{"ddd":0,"ind":9,"ty":4,"nm":"Layer 1 Outlines 11","tt":3,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[184,18,0],"ix":2,"l":2},"a":{"a":0,"k":[184.253,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-166,-18],[-184,0],[-166,18],[166,18],[184,0],[166,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.701960802078,0.941176474094,0.827450990677,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.complement","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys complement"},{"ty":"tr","p":{"a":0,"k":[184.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1125,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":10,"ty":1,"nm":"White Solid 13","parent":8,"td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[-304.791,119,0],"ix":2,"l":2},"a":{"a":0,"k":[307,119,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Gradient Ramp","np":10,"mn":"ADBE Ramp","ix":1,"en":1,"ef":[{"ty":3,"nm":"Start of Ramp","mn":"ADBE Ramp-0001","ix":1,"v":{"a":0,"k":[128,60],"ix":1}},{"ty":2,"nm":"Start Color","mn":"ADBE Ramp-0002","ix":2,"v":{"a":0,"k":[1,1,1,1],"ix":2}},{"ty":3,"nm":"End of Ramp","mn":"ADBE Ramp-0003","ix":3,"v":{"a":0,"k":[472,210],"ix":3}},{"ty":2,"nm":"End Color","mn":"ADBE Ramp-0004","ix":4,"v":{"a":0,"k":[0,0,0,1],"ix":4}},{"ty":7,"nm":"Ramp Shape","mn":"ADBE Ramp-0005","ix":5,"v":{"a":0,"k":1,"ix":5}},{"ty":0,"nm":"Ramp Scatter","mn":"ADBE Ramp-0006","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"nm":"Blend With Original","mn":"ADBE Ramp-0007","ix":7,"v":{"a":0,"k":0,"ix":7}},{"ty":6,"nm":"","mn":"ADBE Ramp-0008","ix":8,"v":0}]}],"sw":614,"sh":238,"sc":"#ffffff","ip":0,"op":149,"st":0,"bm":0},{"ddd":0,"ind":11,"ty":4,"nm":"Layer 1 Outlines 12","tt":3,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[184,18,0],"ix":2,"l":2},"a":{"a":0,"k":[184.253,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-166,-18],[-184,0],[-166,18],[166,18],[184,0],[166,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.701960802078,0.941176474094,0.827450990677,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.complement","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys complement"},{"ty":"tr","p":{"a":0,"k":[184.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1125,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":12,"ty":1,"nm":"White Solid 13","parent":10,"td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[-301.865,119,0],"ix":2,"l":2},"a":{"a":0,"k":[307,119,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ef":[{"ty":5,"nm":"Gradient Ramp","np":10,"mn":"ADBE Ramp","ix":1,"en":1,"ef":[{"ty":3,"nm":"Start of Ramp","mn":"ADBE Ramp-0001","ix":1,"v":{"a":0,"k":[128,60],"ix":1}},{"ty":2,"nm":"Start Color","mn":"ADBE Ramp-0002","ix":2,"v":{"a":0,"k":[0,0,0,1],"ix":2}},{"ty":3,"nm":"End of Ramp","mn":"ADBE Ramp-0003","ix":3,"v":{"a":0,"k":[472,210],"ix":3}},{"ty":2,"nm":"End Color","mn":"ADBE Ramp-0004","ix":4,"v":{"a":0,"k":[1,1,1,1],"ix":4}},{"ty":7,"nm":"Ramp Shape","mn":"ADBE Ramp-0005","ix":5,"v":{"a":0,"k":1,"ix":5}},{"ty":0,"nm":"Ramp Scatter","mn":"ADBE Ramp-0006","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"nm":"Blend With Original","mn":"ADBE Ramp-0007","ix":7,"v":{"a":0,"k":0,"ix":7}},{"ty":6,"nm":"","mn":"ADBE Ramp-0008","ix":8,"v":0}]}],"sw":614,"sh":238,"sc":"#ffffff","ip":0,"op":149,"st":0,"bm":0},{"ddd":0,"ind":13,"ty":4,"nm":"Layer 1 Outlines 14","tt":3,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[184,18,0],"ix":2,"l":2},"a":{"a":0,"k":[184.253,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-166,-18],[-184,0],[-166,18],[166,18],[184,0],[166,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.701960802078,0.941176474094,0.827450990677,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.complement","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys complement"},{"ty":"tr","p":{"a":0,"k":[184.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1125,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":14,"ty":4,"nm":"Layer 1 Outlines 15","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[184,18,0],"ix":2,"l":2},"a":{"a":0,"k":[184.253,18.25,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,-9.941],[-9.941,0],[0,0],[0,9.941],[9.941,0]],"o":[[-9.941,0],[0,9.941],[0,0],[9.941,0],[0,-9.941],[0,0]],"v":[[-166,-18],[-184,0],[-166,18],[166,18],[184,0],[166,-18]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":4,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.61960786581,0.639215707779,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"cros.sys.analog","mn":"ADBE Vector Graphic - Fill","hd":false,"cl":"sys analog"},{"ty":"tr","p":{"a":0,"k":[184.25,18.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1125,"st":0,"ct":1,"bm":0}],"markers":[{"tm":192,"cm":"7","dr":0}]} \ No newline at end of file
diff --git a/ash/system/video_conference/video_conference_common.h b/ash/system/video_conference/video_conference_common.h index 59fce84..babbeae 100644 --- a/ash/system/video_conference/video_conference_common.h +++ b/ash/system/video_conference/video_conference_common.h
@@ -14,7 +14,7 @@ namespace ash { -constexpr int kVideoConferenceBubbleHorizontalPadding = 12; +constexpr int kVideoConferenceBubbleHorizontalPadding = 16; const int kReturnToAppIconSize = 20;
diff --git a/ash/system/video_conference/video_conference_tray.cc b/ash/system/video_conference/video_conference_tray.cc index 2a6c89a..1aa3ca2 100644 --- a/ash/system/video_conference/video_conference_tray.cc +++ b/ash/system/video_conference/video_conference_tray.cc
@@ -525,6 +525,7 @@ std::unique_ptr<TrayBubbleView> bubble_view; auto init_params = CreateInitParamsForTrayBubble(/*tray=*/this); + init_params.preferred_width = kWideTrayMenuWidth; // If all of the apps are Linux apps, we will just use `LinuxAppsBubbleView` // specifically for this situation.
diff --git a/ash/webui/common/resources/network/apn_list_item.html b/ash/webui/common/resources/network/apn_list_item.html index 4c3ae86..7b6350b3 100644 --- a/ash/webui/common/resources/network/apn_list_item.html +++ b/ash/webui/common/resources/network/apn_list_item.html
@@ -69,7 +69,7 @@ <cr-action-menu id="dotsMenu"> <button id="detailsButton" class="dropdown-item" on-click="onDetailsClicked_"> - [[getDetailsMenuItemLabel_(apn)]] + [[getDetailsMenuItemLabel_(apn, shouldDisallowApnModification)]] </button> <template is="dom-if" if="[[shouldShowDisableMenuItem_(apn)]]" restamp> <button id="disableButton" class="dropdown-item"
diff --git a/ash/webui/common/resources/network/apn_list_item.js b/ash/webui/common/resources/network/apn_list_item.js index a5a5645e..7e53057 100644 --- a/ash/webui/common/resources/network/apn_list_item.js +++ b/ash/webui/common/resources/network/apn_list_item.js
@@ -16,6 +16,7 @@ import {ApnProperties, ApnState, ApnType, CrosNetworkConfigInterface} from '//resources/mojo/chromeos/services/network_config/public/mojom/cros_network_config.mojom-webui.js'; import {PortalState} from '//resources/mojo/chromeos/services/network_config/public/mojom/network_types.mojom-webui.js'; import {mixinBehaviors, PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {getTemplate} from './apn_list_item.html.js'; @@ -84,6 +85,14 @@ type: Boolean, computed: 'computeIsDisabled_(apn)', }, + + isApnPoliciesEnabled_: { + type: Boolean, + value() { + return loadTimeData.valueExists('isApnPoliciesEnabled') && + loadTimeData.getBoolean('isApnPoliciesEnabled'); + }, + }, }; } @@ -148,12 +157,34 @@ detail: /** @type {!ApnEventData} */ ({ apn: this.apn, // Only allow editing if the APN is a custom APN. - mode: this.apn.id ? ApnDetailDialogMode.EDIT : ApnDetailDialogMode.VIEW, + mode: this.getDetailDialogMode_(), }), })); } /** + * Returns the mode the APN detail dialog should be if opened. + * @private + */ + getDetailDialogMode_() { + if (!this.apn) { + return ApnDetailDialogMode.VIEW; + } + + // Only allow editing if the APN is a user-created custom APN and + // |AllowAPNModification| is true. + if (!this.apn.id) { + return ApnDetailDialogMode.VIEW; + } + if (this.isApnPoliciesEnabled_) { + if (this.shouldDisallowApnModification) { + return ApnDetailDialogMode.VIEW; + } + } + return ApnDetailDialogMode.EDIT; + } + + /** * Disables the selected APN. * @private */ @@ -287,7 +318,9 @@ * @private */ getDetailsMenuItemLabel_() { - return this.apn.id ? this.i18n('apnMenuEdit') : this.i18n('apnMenuDetails'); + return this.getDetailDialogMode_() === ApnDetailDialogMode.EDIT ? + this.i18n('apnMenuEdit') : + this.i18n('apnMenuDetails'); } /**
diff --git a/ash/webui/shimless_rma/mojom/BUILD.gn b/ash/webui/shimless_rma/mojom/BUILD.gn index 828aaca..4760d024 100644 --- a/ash/webui/shimless_rma/mojom/BUILD.gn +++ b/ash/webui/shimless_rma/mojom/BUILD.gn
@@ -11,7 +11,7 @@ sources = [ "shimless_rma.mojom" ] webui_module_path = "/ash/webui/shimless_rma" - generate_webui_js_bindings = true + public_deps = [ "//mojo/public/mojom/base" ] cpp_typemaps = [
diff --git a/ash/webui/shimless_rma/resources/BUILD.gn b/ash/webui/shimless_rma/resources/BUILD.gn index 486add1..4c7d771 100644 --- a/ash/webui/shimless_rma/resources/BUILD.gn +++ b/ash/webui/shimless_rma/resources/BUILD.gn
@@ -75,9 +75,11 @@ "shimless_rma_util.ts", ] - mojo_files = [ "$root_gen_dir/mojom-webui/ash/webui/shimless_rma/mojom/shimless_rma.mojom-webui.js" ] + mojo_files = [ + "$root_gen_dir/ash/webui/shimless_rma/mojom/shimless_rma.mojom-webui.ts", + ] - mojo_files_deps = [ "//ash/webui/shimless_rma/mojom:mojom_webui_js" ] + mojo_files_deps = [ "//ash/webui/shimless_rma/mojom:mojom_ts__generator" ] ts_composite = true ts_definitions = [ "//tools/typescript/definitions/chrome_send.d.ts" ]
diff --git a/ash/webui/shimless_rma/resources/data.ts b/ash/webui/shimless_rma/resources/data.ts index 32b4ff2..7649daf 100644 --- a/ash/webui/shimless_rma/resources/data.ts +++ b/ash/webui/shimless_rma/resources/data.ts
@@ -5,6 +5,7 @@ import {ComponentType} from './shimless_rma.mojom-webui.js'; export const ComponentTypeToId: {[key in ComponentType]: string} = { + [ComponentType.kComponentUnknown]: '', [ComponentType.kAudioCodec]: 'componentAudio', [ComponentType.kBattery]: 'componentBattery', [ComponentType.kStorage]: 'componentStorage',
diff --git a/ash/webui/shimless_rma/resources/onboarding_wp_disable_complete_page.ts b/ash/webui/shimless_rma/resources/onboarding_wp_disable_complete_page.ts index e9016df..8b68281 100644 --- a/ash/webui/shimless_rma/resources/onboarding_wp_disable_complete_page.ts +++ b/ash/webui/shimless_rma/resources/onboarding_wp_disable_complete_page.ts
@@ -18,12 +18,14 @@ }; const disableActionTextKeys: DisableActionTextKeys = { + [WriteProtectDisableCompleteAction.kUnknown]: '', [WriteProtectDisableCompleteAction.kSkippedAssembleDevice]: 'wpDisableReassembleNowText', [WriteProtectDisableCompleteAction.kCompleteAssembleDevice]: 'wpDisableReassembleNowText', [WriteProtectDisableCompleteAction.kCompleteKeepDeviceOpen]: 'wpDisableLeaveDisassembledText', + [WriteProtectDisableCompleteAction.kCompleteNoOp]: '', }; /**
diff --git a/ash/webui/shimless_rma/resources/reimaging_firmware_update_page.ts b/ash/webui/shimless_rma/resources/reimaging_firmware_update_page.ts index a395352..731ff27 100644 --- a/ash/webui/shimless_rma/resources/reimaging_firmware_update_page.ts +++ b/ash/webui/shimless_rma/resources/reimaging_firmware_update_page.ts
@@ -17,25 +17,30 @@ import {executeThenTransitionState, focusPageTitle} from './shimless_rma_util.js'; const STATUS_TEXT_KEY_MAP: {[key in UpdateRoFirmwareStatus]: string} = { - // kDownloading state is not used in V1. - [UpdateRoFirmwareStatus.kDownloading]: '', + [UpdateRoFirmwareStatus.kUnknown]: '', [UpdateRoFirmwareStatus.kWaitUsb]: 'firmwareUpdateWaitForUsbText', [UpdateRoFirmwareStatus.kFileNotFound]: 'firmwareUpdateFileNotFoundText', + [UpdateRoFirmwareStatus.kDownloading]: '', [UpdateRoFirmwareStatus.kUpdating]: 'firmwareUpdatingText', [UpdateRoFirmwareStatus.kRebooting]: 'firmwareUpdateRebootText', [UpdateRoFirmwareStatus.kComplete]: 'firmwareUpdateCompleteText', }; const STATUS_IMG_MAP: {[key in UpdateRoFirmwareStatus]: string} = { + [UpdateRoFirmwareStatus.kUnknown]: '', [UpdateRoFirmwareStatus.kWaitUsb]: 'insert_usb', [UpdateRoFirmwareStatus.kFileNotFound]: 'error', + [UpdateRoFirmwareStatus.kDownloading]: '', + [UpdateRoFirmwareStatus.kUpdating]: '', [UpdateRoFirmwareStatus.kRebooting]: 'downloading', [UpdateRoFirmwareStatus.kComplete]: 'downloading', }; const STATUS_ALT_MAP: {[key in UpdateRoFirmwareStatus]: string} = { + [UpdateRoFirmwareStatus.kUnknown]: '', [UpdateRoFirmwareStatus.kWaitUsb]: 'insertUsbAltText', [UpdateRoFirmwareStatus.kFileNotFound]: 'errorAltText', + [UpdateRoFirmwareStatus.kDownloading]: '', [UpdateRoFirmwareStatus.kUpdating]: 'updateOsAltText', [UpdateRoFirmwareStatus.kRebooting]: 'downloadingAltText', [UpdateRoFirmwareStatus.kComplete]: 'downloadingAltText',
diff --git a/ash/webui/shimless_rma/resources/shimless_3p_diagnostics.ts b/ash/webui/shimless_rma/resources/shimless_3p_diagnostics.ts index 11ec5ed7..ea6e458 100644 --- a/ash/webui/shimless_rma/resources/shimless_3p_diagnostics.ts +++ b/ash/webui/shimless_rma/resources/shimless_3p_diagnostics.ts
@@ -9,7 +9,7 @@ import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js'; import {CrDialogElement} from 'chrome://resources/ash/common/cr_elements/cr_dialog/cr_dialog.js'; import {I18nMixin} from 'chrome://resources/ash/common/cr_elements/i18n_mixin.js'; -import {assert, assertNotReached} from 'chrome://resources/js/assert.js'; +import {assert} from 'chrome://resources/js/assert.js'; import {FilePath} from 'chrome://resources/mojo/mojo/public/mojom/base/file_path.mojom-webui.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -176,7 +176,6 @@ '3pFailedToLoadDialogTitle', '3pFailedToLoadDialogMessage'); return; } - assertNotReached(); }); }
diff --git a/ash/webui/shimless_rma/resources/wrapup_finalize_page.ts b/ash/webui/shimless_rma/resources/wrapup_finalize_page.ts index e5f7404..4b6e1dc 100644 --- a/ash/webui/shimless_rma/resources/wrapup_finalize_page.ts +++ b/ash/webui/shimless_rma/resources/wrapup_finalize_page.ts
@@ -24,6 +24,8 @@ const finalizationStatusTextKeys: {[key in FinalizationStatus]: string} = { [FinalizationStatus.kInProgress]: 'finalizePageProgressText', [FinalizationStatus.kComplete]: 'finalizePageCompleteText', + [FinalizationStatus.kFailedBlocking]: '', + [FinalizationStatus.kFailedNonBlocking]: '', }; /**
diff --git a/ash/wm/desks/desk.cc b/ash/wm/desks/desk.cc index c555128..f276fb2 100644 --- a/ash/wm/desks/desk.cc +++ b/ash/wm/desks/desk.cc
@@ -688,6 +688,13 @@ continue; } + // It's possible the `window` was already moved to the `target_desk` + // indirectly, such as when one window in a Snap Group moves and the other + // will follow. If this is the case, skip the explicit window move. + if (base::Contains(target_desk->windows(), window)) { + continue; + } + // Note that windows that belong to the same container in `windows_to_move` // are sorted from top-most to bottom-most, hence calling // `StackChildAtBottom()` on each in this order will maintain that same
diff --git a/ash/wm/desks/desk_button/desk_button.cc b/ash/wm/desks/desk_button/desk_button.cc index 9db8d1228..ab45877 100644 --- a/ash/wm/desks/desk_button/desk_button.cc +++ b/ash/wm/desks/desk_button/desk_button.cc
@@ -62,7 +62,8 @@ DeskButton::~DeskButton() {} -gfx::Size DeskButton::CalculatePreferredSize() const { +gfx::Size DeskButton::CalculatePreferredSize( + const views::SizeBounds& available_size) const { if (zero_state_) { return {kDeskButtonWidthVertical, kDeskButtonHeightVertical}; }
diff --git a/ash/wm/desks/desk_button/desk_button.h b/ash/wm/desks/desk_button/desk_button.h index 256bde8..12ce91c 100644 --- a/ash/wm/desks/desk_button/desk_button.h +++ b/ash/wm/desks/desk_button/desk_button.h
@@ -46,7 +46,8 @@ void set_zero_state(bool zero_state) { zero_state_ = zero_state; } // views::Button: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; void OnMouseEvent(ui::MouseEvent* event) override;
diff --git a/ash/wm/desks/desk_button/desk_button_container.cc b/ash/wm/desks/desk_button/desk_button_container.cc index 257db53b..6301e017 100644 --- a/ash/wm/desks/desk_button/desk_button_container.cc +++ b/ash/wm/desks/desk_button/desk_button_container.cc
@@ -72,7 +72,8 @@ } } -gfx::Size DeskButtonContainer::CalculatePreferredSize() const { +gfx::Size DeskButtonContainer::CalculatePreferredSize( + const views::SizeBounds& available_size) const { if (zero_state_) { return {kDeskButtonContainerWidthVertical, GetPreferredLength()}; }
diff --git a/ash/wm/desks/desk_button/desk_button_container.h b/ash/wm/desks/desk_button/desk_button_container.h index 9ef157cf..9084e3f 100644 --- a/ash/wm/desks/desk_button/desk_button_container.h +++ b/ash/wm/desks/desk_button/desk_button_container.h
@@ -68,7 +68,8 @@ void OnFirstSessionStarted() override; // views::View: - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void Layout(PassKey) override; // Invoked after the shelf alignment change. It's used to update the container
diff --git a/ash/wm/desks/desk_mini_view.cc b/ash/wm/desks/desk_mini_view.cc index cddbc86..b3278a3a 100644 --- a/ash/wm/desks/desk_mini_view.cc +++ b/ash/wm/desks/desk_mini_view.cc
@@ -554,7 +554,8 @@ } } -gfx::Size DeskMiniView::CalculatePreferredSize() const { +gfx::Size DeskMiniView::CalculatePreferredSize( + const views::SizeBounds& available_size) const { const gfx::Rect preview_bounds = GetDeskPreviewBounds(root_window_); // The preferred size takes into account only the width of the preview
diff --git a/ash/wm/desks/desk_mini_view.h b/ash/wm/desks/desk_mini_view.h index a2ce9973c..3fa1c1b9 100644 --- a/ash/wm/desks/desk_mini_view.h +++ b/ash/wm/desks/desk_mini_view.h
@@ -143,7 +143,8 @@ // views::View: void Layout(PassKey) override; - gfx::Size CalculatePreferredSize() const override; + gfx::Size CalculatePreferredSize( + const views::SizeBounds& available_size) const override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; void OnThemeChanged() override;
diff --git a/ash/wm/snap_group/snap_group.cc b/ash/wm/snap_group/snap_group.cc index c8fc0506..886b5fff 100644 --- a/ash/wm/snap_group/snap_group.cc +++ b/ash/wm/snap_group/snap_group.cc
@@ -6,6 +6,7 @@ #include <optional> +#include "ash/screen_util.h" #include "ash/shell.h" #include "ash/wm/desks/desks_util.h" #include "ash/wm/overview/scoped_overview_hide_windows.h" @@ -55,14 +56,27 @@ StartObservingWindows(); ShowDivider(); + + // We manually add ourselves as a display observer so we can early remove + // ourselves in `Shutdown()`. + display::Screen::GetScreen()->AddObserver(this); } SnapGroup::~SnapGroup() { + if (!is_shutting_down_) { + Shutdown(); + } +} + +void SnapGroup::Shutdown() { + is_shutting_down_ = true; + + display::Screen::GetScreen()->RemoveObserver(this); + // Restore the snapped window bounds that were adjusted to make room for // divider when snap group was created. UpdateGroupWindowsBounds(/*account_for_divider_width=*/false); - // `SplitViewDivider::MaybeRemoveObservedWindow()` will close the divider. StopObservingWindows(); } @@ -138,7 +152,8 @@ void SnapGroup::OnWindowDestroying(aura::Window* window) { DCHECK(window == window1_ || window == window2_); - // `this` will be destroyed after this line. + // `this` will be shut down and removed from the controller immediately, and + // then destroyed asynchronously soon. SnapGroupController::Get()->RemoveSnapGroup(this); } @@ -184,8 +199,8 @@ // Restore the divider visibility after both windows are moved to the target // display. snap_group_divider_.SetVisible(cached_divider_visibility); - ApplyPrimarySnapRatio(WindowState::Get(window1_)->snap_ratio().value_or( - chromeos::kDefaultSnapRatio)); + + RefreshSnapGroup(); } void SnapGroup::OnPreWindowStateTypeChange(WindowState* window_state, @@ -193,6 +208,8 @@ CHECK(old_type == WindowStateType::kPrimarySnapped || old_type == WindowStateType::kSecondarySnapped); if (window_state->GetStateType() != old_type) { + // `this` will be shut down and removed from the controller immediately, and + // then destroyed asynchronously soon. SnapGroupController::Get()->RemoveSnapGroup(this); } } @@ -277,12 +294,7 @@ return; } - const auto window1_snap_ratio = WindowState::Get(window1_)->snap_ratio(); - CHECK(window1_snap_ratio); - - // Update the bounds of the snapped window and divider while preserving the - // snap ratio. - ApplyPrimarySnapRatio(*window1_snap_ratio); + RefreshSnapGroup(); } void SnapGroup::StartObservingWindows() { @@ -296,6 +308,9 @@ } void SnapGroup::StopObservingWindows() { + // Hide the divider first to avoid unnecessary updates while we're removing + // the observers. + HideDivider(); for (aura::Window* window : {window1_, window2_}) { if (window) { window->RemoveObserver(this); @@ -335,6 +350,7 @@ } void SnapGroup::ApplyPrimarySnapRatio(float primary_snap_ratio) { + CHECK(CanWindowsFitInWorkArea(window1_, window2_)); const int upper_limit = GetDividerPositionUpperLimit(GetRootWindow()); const int requested_divider_position = upper_limit * primary_snap_ratio - kSplitviewDividerShortSideLength / 2.f; @@ -351,6 +367,22 @@ 1 - primary_snap_ratio); } +void SnapGroup::RefreshSnapGroup() { + CHECK_EQ(window1_->GetRootWindow(), window2_->GetRootWindow()); + // If the windows + divider no longer fit in the work area, break the group. + if (!CanWindowsFitInWorkArea(window1_, window2_)) { + // `this` will be shut down and removed from the controller immediately, and + // then destroyed asynchronously soon. + SnapGroupController::Get()->RemoveSnapGroup(this); + return; + } + + // Otherwise call `ApplyPrimarySnapRatio()`, which will clamp the divider + // position to between the windows' minimum sizes. + ApplyPrimarySnapRatio(WindowState::Get(window1_)->snap_ratio().value_or( + chromeos::kDefaultSnapRatio)); +} + void SnapGroup::OnOverviewModeStarting() { SplitViewController* split_view_constroller = SplitViewController::Get(GetRootWindow());
diff --git a/ash/wm/snap_group/snap_group.h b/ash/wm/snap_group/snap_group.h index 0ed4567..a5979eee 100644 --- a/ash/wm/snap_group/snap_group.h +++ b/ash/wm/snap_group/snap_group.h
@@ -36,6 +36,9 @@ SnapGroup& operator=(const SnapGroup&) = delete; ~SnapGroup() override; + // Cleans up prior to deletion. Must be called before the object is destroyed. + void Shutdown(); + aura::Window* window1() const { return window1_; } aura::Window* window2() const { return window2_; } SplitViewDivider* snap_group_divider() { return &snap_group_divider_; } @@ -114,9 +117,13 @@ std::optional<float> snap_ratio); // Adjusts snapped windows and divider bounds to match the given - // `primary_snap_ratio`. + // `primary_snap_ratio`. Note the windows and divider must fit the work area. void ApplyPrimarySnapRatio(float primary_snap_ratio); + // Refreshes the window and divider bounds. Note `this` may be destroyed if + // the windows are no longer valid for a snap group. + void RefreshSnapGroup(); + // Hides scoped windows in a snap group in partial overview, restores their // visibility when partial overview ends. void OnOverviewModeStarting(); @@ -140,7 +147,8 @@ // The secondary snapped window in the group. raw_ptr<aura::Window> window2_; - display::ScopedDisplayObserver display_observer_{this}; + // True if the shutting down process has been triggered. + bool is_shutting_down_ = false; }; } // namespace ash
diff --git a/ash/wm/snap_group/snap_group_controller.cc b/ash/wm/snap_group/snap_group_controller.cc index cc39187..314ff36 100644 --- a/ash/wm/snap_group/snap_group_controller.cc +++ b/ash/wm/snap_group/snap_group_controller.cc
@@ -111,13 +111,18 @@ CHECK(snap_group); aura::Window* window1 = snap_group->window1(); aura::Window* window2 = snap_group->window2(); - CHECK(base::Contains(window_to_snap_group_map_, window1) && - base::Contains(window_to_snap_group_map_, window2)); - window_to_snap_group_map_.erase(window1); - window_to_snap_group_map_.erase(window2); + CHECK_EQ(window_to_snap_group_map_.erase(window1), 1u); + CHECK_EQ(window_to_snap_group_map_.erase(window2), 1u); - std::erase_if(snap_groups_, base::MatchesUniquePtr(snap_group)); + auto iter = + base::ranges::find_if(snap_groups_, base::MatchesUniquePtr(snap_group)); + DCHECK(iter != snap_groups_.end()); + auto group_to_remove = std::move(*iter); + snap_groups_.erase(iter); + group_to_remove->Shutdown(); + base::SequencedTaskRunner::GetCurrentDefault()->DeleteSoon( + FROM_HERE, std::move(group_to_remove)); return true; } @@ -204,6 +209,11 @@ } } + // If the new windows can't fit, do not allow snap to replace. + if (!CanWindowsFitInWorkArea(new_primary_window, new_secondary_window)) { + return false; + } + // TODO(b/331470570): Consider directly replacing the `to_be_snapped_window` // within the `snap_group`. RemoveSnapGroup(group_to_replace);
diff --git a/ash/wm/snap_group/snap_group_unittest.cc b/ash/wm/snap_group/snap_group_unittest.cc index bdb3198..e153d04 100644 --- a/ash/wm/snap_group/snap_group_unittest.cc +++ b/ash/wm/snap_group/snap_group_unittest.cc
@@ -324,6 +324,39 @@ } } +// TestWidgetDelegate that can set app window minimum sizes. Needed since only +// app windows can be dragged by the header view and process certain +// accelerators, e.g. `ZoomDisplay()`. +class TestWidgetDelegate : public views::WidgetDelegateView { + public: + TestWidgetDelegate(const gfx::Size& minimum_size) + : minimum_size_(minimum_size) { + SetCanFullscreen(true); + SetCanMaximize(true); + SetCanMinimize(true); + SetCanResize(true); + } + + // views::View: + // Returns the minimum size the client view requests. This represents the + // minimum content area needed to display its elements correctly. + gfx::Size GetMinimumSize() const override { return minimum_size_; } + + // Returns the actual minimum size of the window, which includes the client + // view and any additional non-client view elements elements (title bar, + // borders, etc.). This is equivalent to calling + // `GetWidget()->GetContentsView()->GetMinimumSize()`. + gfx::Size GetWindowMinimumSize() const { + return GetWidget() + ->non_client_view() + ->GetWindowBoundsForClientBounds(gfx::Rect(minimum_size_)) + .size(); + } + + private: + const gfx::Size minimum_size_; +}; + } // namespace // ----------------------------------------------------------------------------- @@ -2106,6 +2139,12 @@ return child; } + std::unique_ptr<aura::Window> CreateAppWindowWithDelegate( + views::WidgetDelegate* delegate) { + return CreateAppWindow(gfx::Rect(800, 600), AppType::SYSTEM_APP, + kShellWindowId_Invalid, delegate); + } + private: base::test::ScopedFeatureList scoped_feature_list_; }; @@ -2716,6 +2755,8 @@ MaximizeToClearTheSession(w1.get()); MaximizeToClearTheSession(w2.get()); + ASSERT_FALSE( + SnapGroupController::Get()->GetSnapGroupForGivenWindow(w1.get())); } } @@ -4198,14 +4239,7 @@ // Tests that pressing the 'Close All' button closes both windows in a Snap // Group. -// TODO(crbug.com/335001236): Re-enable this test -#if defined(MEMORY_SANITIZER) || defined(ADDRESS_SANITIZER) || \ - defined(LEAK_SANITIZER) -#define MAYBE_CloseAll DISABLED_CloseAll -#else -#define MAYBE_CloseAll CloseAll -#endif -TEST_F(SnapGroupDesksTest, MAYBE_CloseAll) { +TEST_F(SnapGroupDesksTest, CloseAll) { auto* desks_controller = DesksController::Get(); desks_controller->NewDesk(DesksCreationRemovalSource::kButton); ASSERT_EQ(2u, desks_controller->desks().size()); @@ -4239,7 +4273,6 @@ w1.release(); RemoveDesk(desk0, DeskCloseType::kCloseAllWindows); - ASSERT_TRUE(desk0->is_desk_being_removed()); EXPECT_EQ(1u, desks_controller->desks().size()); // Widget closure is asynchronous and may not finish immediately. For @@ -4290,6 +4323,39 @@ EXPECT_EQ(desk0, desks_util::GetDeskForContext(w1.get())); } +// Test that merging a desk with a Snap Group into another desk doesn't cause +// crash and correctly moves all windows to the destination desk. +TEST_F(SnapGroupDesksTest, DesksMerge) { + auto* desks_controller = DesksController::Get(); + desks_controller->NewDesk(DesksCreationRemovalSource::kButton); + ASSERT_EQ(2u, desks_controller->desks().size()); + const Desk* desk0 = desks_controller->GetDeskAtIndex(0); + const Desk* desk1 = desks_controller->GetDeskAtIndex(1); + ActivateDesk(desk1); + ASSERT_TRUE(desk1->is_active()); + ASSERT_FALSE(desk0->is_active()); + + std::unique_ptr<aura::Window> w0(CreateAppWindow()); + std::unique_ptr<aura::Window> w1(CreateAppWindow()); + SnapTwoTestWindows(w0.get(), w1.get()); + SnapGroup* snap_group = + SnapGroupController::Get()->GetSnapGroupForGivenWindow(w0.get()); + ASSERT_TRUE(snap_group); + ASSERT_EQ(desk1, desks_util::GetDeskForContext(w0.get())); + ASSERT_EQ(desk1, desks_util::GetDeskForContext(w1.get())); + + ToggleOverview(); + ASSERT_TRUE(IsInOverviewSession()); + + // Merge `desk1` into `desk0`. + RemoveDesk(desk1, DeskCloseType::kCombineDesks); + + // Verify that windows in the Snap Group are properly moved to the new desk. + EXPECT_EQ(1u, desks_controller->desks().size()); + ASSERT_EQ(desk0, desks_util::GetDeskForContext(w0.get())); + ASSERT_EQ(desk0, desks_util::GetDeskForContext(w1.get())); +} + // ----------------------------------------------------------------------------- // SnapGroupWindowCycleTest: @@ -4953,6 +5019,72 @@ EXPECT_FALSE(split_view_controller()->InSplitViewMode()); } +// Tests if the window being snapped to replace has a min size, it is snapped at +// its min size. +TEST_F(SnapGroupSnapToReplaceTest, WindowWithMinimumSize) { + std::unique_ptr<aura::Window> w1(CreateAppWindow()); + std::unique_ptr<aura::Window> w2(CreateAppWindow()); + SnapTwoTestWindows(w1.get(), w2.get()); + SnapGroupController* snap_group_controller = SnapGroupController::Get(); + ASSERT_TRUE(snap_group_controller->AreWindowsInSnapGroup(w1.get(), w2.get())); + + // Create a new `w3` with min size > 0.5f. + const gfx::Size min_size(work_area_bounds().width() * 0.6f, 0); + TestWidgetDelegate* delegate = new TestWidgetDelegate(min_size); + std::unique_ptr<aura::Window> w3(CreateAppWindowWithDelegate(delegate)); + + // Snap to replace `w3` on top of the group. + const gfx::Rect window_bounds(w3->GetBoundsInScreen()); + const gfx::Point drag_point(window_bounds.CenterPoint().x(), + window_bounds.y() + 10); + auto* event_generator = GetEventGenerator(); + event_generator->set_current_screen_location(drag_point); + event_generator->DragMouseTo(0, 100); + EXPECT_EQ(WindowStateType::kPrimarySnapped, + WindowState::Get(w3.get())->GetStateType()); + + // Test `w3` snaps at its min size and the group bounds are updated. + EXPECT_TRUE(snap_group_controller->AreWindowsInSnapGroup(w2.get(), w3.get())); + EXPECT_FALSE( + snap_group_controller->AreWindowsInSnapGroup(w1.get(), w2.get())); + EXPECT_EQ(delegate->GetWindowMinimumSize().width(), + w3->GetBoundsInScreen().width()); + UnionBoundsEqualToWorkAreaBounds(w2.get(), w3.get(), snap_group_divider()); +} + +// Test that if both the window being snapped to replace and the opposite window +// in the group to replace have min sizes that can't fit, we don't allow snap to +// replace. +TEST_F(SnapGroupSnapToReplaceTest, BothWindowsMinimumSizes) { + // Create a snap group where `w2` has min size 0.45f. + const int work_area_length = work_area_bounds().width(); + std::unique_ptr<aura::Window> w1(CreateAppWindow()); + std::unique_ptr<aura::Window> w2(CreateAppWindowWithDelegate( + new TestWidgetDelegate(gfx::Size(work_area_length * 0.45f, 0)))); + SnapTwoTestWindows(w1.get(), w2.get()); + SnapGroupController* snap_group_controller = SnapGroupController::Get(); + ASSERT_TRUE(snap_group_controller->AreWindowsInSnapGroup(w1.get(), w2.get())); + + // Create `w3` with min size 0.6f. + std::unique_ptr<aura::Window> w3(CreateAppWindowWithDelegate( + new TestWidgetDelegate(gfx::Size(work_area_length * 0.6f, 0)))); + + // Snap to replace `w3` over `w1`. Since `w3` and `w2` would not fit, test we + // don't replace `w1` in the group. + const gfx::Rect window_bounds(w3->GetBoundsInScreen()); + const gfx::Point drag_point(window_bounds.CenterPoint().x(), + window_bounds.y() + 10); + auto* event_generator = GetEventGenerator(); + event_generator->set_current_screen_location(drag_point); + event_generator->DragMouseTo(0, 100); + EXPECT_EQ(WindowStateType::kPrimarySnapped, + WindowState::Get(w3.get())->GetStateType()); + EXPECT_TRUE(w2->GetBoundsInScreen().Intersects(w3->GetBoundsInScreen())); + EXPECT_FALSE( + snap_group_controller->AreWindowsInSnapGroup(w2.get(), w3.get())); + EXPECT_TRUE(snap_group_controller->AreWindowsInSnapGroup(w1.get(), w2.get())); +} + // Tests that if a third window is snapped via any method except the window // layout menu, it should allow 'snap to replace' regardless of snap ratio // difference, the previous snap group's layout will be preserved. @@ -5118,13 +5250,40 @@ // http://b/331991853. TEST_F(SnapGroupDisplayMetricsTest, ScaleUpWorkArea) { UpdateDisplay("800x600"); - std::unique_ptr<aura::Window> w1(CreateAppWindow()); - std::unique_ptr<aura::Window> w2(CreateAppWindow()); - SnapTwoTestWindows(w1.get(), w2.get()); - EXPECT_TRUE( - SnapGroupController::Get()->AreWindowsInSnapGroup(w1.get(), w2.get())); - UpdateDisplay("800x600*4"); + // Set the min width so that the windows fit in `zoom_factor_1` but not + // `zoom_factor_2`. + const gfx::Size min_size(360, 0); + std::unique_ptr<aura::Window> w1( + CreateAppWindowWithDelegate(new TestWidgetDelegate(min_size))); + std::unique_ptr<aura::Window> w2( + CreateAppWindowWithDelegate(new TestWidgetDelegate(min_size))); + + SnapTwoTestWindows(w1.get(), w2.get()); + auto* snap_group_controller = SnapGroupController::Get(); + EXPECT_TRUE(snap_group_controller->AreWindowsInSnapGroup(w1.get(), w2.get())); + UnionBoundsEqualToWorkAreaBounds(w1.get(), w2.get(), snap_group_divider()); + + // Zoom in once. Test we update the group bounds. + PressAndReleaseKey(ui::VKEY_OEM_PLUS, + ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN); + const int64_t primary_id = + display::Screen::GetScreen()->GetPrimaryDisplay().id(); + const float zoom_factor_1 = 1.05f; + ASSERT_EQ(zoom_factor_1, + display_manager()->GetDisplayInfo(primary_id).zoom_factor()); + ASSERT_FALSE(w1->GetBoundsInScreen().Intersects(w2->GetBoundsInScreen())); + UnionBoundsEqualToWorkAreaBounds(w1.get(), w2.get(), snap_group_divider()); + + // Zoom in again. Since the windows no longer fit, test we break the group. + PressAndReleaseKey(ui::VKEY_OEM_PLUS, + ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN); + const float zoom_factor_2 = 1.1f; + ASSERT_EQ(zoom_factor_2, + display_manager()->GetDisplayInfo(primary_id).zoom_factor()); + ASSERT_TRUE(w1->GetBoundsInScreen().Intersects(w2->GetBoundsInScreen())); + EXPECT_FALSE( + snap_group_controller->AreWindowsInSnapGroup(w1.get(), w2.get())); } // Tests that there is no crash when work area changed after snapping two
diff --git a/ash/wm/splitview/split_view_controller_unittest.cc b/ash/wm/splitview/split_view_controller_unittest.cc index 7d88d34..9c87383 100644 --- a/ash/wm/splitview/split_view_controller_unittest.cc +++ b/ash/wm/splitview/split_view_controller_unittest.cc
@@ -3454,8 +3454,11 @@ ->GetDividerBoundsInScreen( /*is_dragging=*/false) .x(); - // TODO(sammiequon): Investigate why these are off by 1 pixel but were not - // earlier. + + // These are off by 1 pixel because the original snap ratio was 0.66repeating. + // When swapping windows, we go through another code path that updates the + // snap ratio based on the window dimensions, resulting in a similar but + // slightly different snap ratio of 0.6625. EXPECT_NEAR( divider_origin_x, std::round(work_area_bounds.width() * chromeos::kOneThirdSnapRatio) -
diff --git a/ash/wm/splitview/split_view_utils.cc b/ash/wm/splitview/split_view_utils.cc index bbe06d35..3512a63e 100644 --- a/ash/wm/splitview/split_view_utils.cc +++ b/ash/wm/splitview/split_view_utils.cc
@@ -80,14 +80,15 @@ constexpr char kExitPointRootWord[] = "ExitPoint"; -// Gets the duration, tween type and delay before animation based on |type|. -void GetAnimationValuesForType( - SplitviewAnimationType type, - base::TimeDelta* out_duration, - gfx::Tween::Type* out_tween_type, - ui::LayerAnimator::PreemptionStrategy* out_preemption_strategy, - base::TimeDelta* out_delay) { - *out_preemption_strategy = ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET; +struct AnimationValues { + base::TimeDelta duration; + gfx::Tween::Type tween_type; + ui::LayerAnimator::PreemptionStrategy preemption_strategy = + ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET; + base::TimeDelta delay; +}; + +AnimationValues GetAnimationValuesForType(SplitviewAnimationType type) { switch (type) { case SPLITVIEW_ANIMATION_HIGHLIGHT_FADE_IN: case SPLITVIEW_ANIMATION_HIGHLIGHT_FADE_IN_CANNOT_SNAP: @@ -101,65 +102,58 @@ case SPLITVIEW_ANIMATION_PREVIEW_AREA_SLIDE_OUT: case SPLITVIEW_ANIMATION_PREVIEW_AREA_TEXT_SLIDE_IN: case SPLITVIEW_ANIMATION_PREVIEW_AREA_TEXT_SLIDE_OUT: - *out_duration = kHighlightsFadeInOut; - *out_tween_type = gfx::Tween::FAST_OUT_SLOW_IN; - return; + return {.duration = kHighlightsFadeInOut, + .tween_type = gfx::Tween::FAST_OUT_SLOW_IN}; case SPLITVIEW_ANIMATION_OTHER_HIGHLIGHT_FADE_IN: case SPLITVIEW_ANIMATION_OTHER_HIGHLIGHT_FADE_IN_CANNOT_SNAP: case SPLITVIEW_ANIMATION_OTHER_HIGHLIGHT_SLIDE_IN: case SPLITVIEW_ANIMATION_OTHER_HIGHLIGHT_TEXT_SLIDE_IN: - *out_delay = kOtherFadeInDelay; - *out_duration = kOtherFadeInOut; - *out_tween_type = gfx::Tween::LINEAR_OUT_SLOW_IN; - *out_preemption_strategy = ui::LayerAnimator::ENQUEUE_NEW_ANIMATION; - return; + return {.duration = kOtherFadeInOut, + .tween_type = gfx::Tween::LINEAR_OUT_SLOW_IN, + .preemption_strategy = ui::LayerAnimator::ENQUEUE_NEW_ANIMATION, + .delay = kOtherFadeInDelay}; case SPLITVIEW_ANIMATION_OTHER_HIGHLIGHT_FADE_OUT: case SPLITVIEW_ANIMATION_OTHER_HIGHLIGHT_SLIDE_OUT: case SPLITVIEW_ANIMATION_OTHER_HIGHLIGHT_TEXT_SLIDE_OUT: - *out_duration = kOtherFadeInOut; - *out_tween_type = gfx::Tween::FAST_OUT_LINEAR_IN; - return; + return {.duration = kOtherFadeInOut, + .tween_type = gfx::Tween::FAST_OUT_LINEAR_IN}; case SPLITVIEW_ANIMATION_PREVIEW_AREA_FADE_OUT: case SPLITVIEW_ANIMATION_PREVIEW_AREA_NIX_INSET: - *out_duration = kPreviewAreaFadeOut; - *out_tween_type = gfx::Tween::FAST_OUT_LINEAR_IN; - return; + return {.duration = kPreviewAreaFadeOut, + .tween_type = gfx::Tween::FAST_OUT_LINEAR_IN}; case SPLITVIEW_ANIMATION_TEXT_FADE_IN: - *out_delay = kLabelAnimationDelay; - *out_duration = kLabelAnimation; - *out_tween_type = gfx::Tween::LINEAR_OUT_SLOW_IN; - *out_preemption_strategy = ui::LayerAnimator::ENQUEUE_NEW_ANIMATION; - return; + return {.duration = kLabelAnimation, + .tween_type = gfx::Tween::LINEAR_OUT_SLOW_IN, + .preemption_strategy = ui::LayerAnimator::ENQUEUE_NEW_ANIMATION, + .delay = kLabelAnimationDelay}; case SPLITVIEW_ANIMATION_TEXT_FADE_OUT: - *out_duration = kLabelAnimation; - *out_tween_type = gfx::Tween::FAST_OUT_LINEAR_IN; - return; + return {.duration = kLabelAnimation, + .tween_type = gfx::Tween::FAST_OUT_LINEAR_IN}; case SPLITVIEW_ANIMATION_SET_WINDOW_TRANSFORM: - *out_duration = kSplitviewWindowTransformDuration; - *out_tween_type = gfx::Tween::FAST_OUT_SLOW_IN; - *out_preemption_strategy = - ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET; - return; + return {.duration = kSplitviewWindowTransformDuration, + .tween_type = gfx::Tween::FAST_OUT_SLOW_IN, + .preemption_strategy = + ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET}; } - NOTREACHED(); + NOTREACHED_NORETURN(); } -// Helper function to apply animation values to |settings|. void ApplyAnimationSettings( - ui::ScopedLayerAnimationSettings* settings, ui::LayerAnimator* animator, ui::LayerAnimationElement::AnimatableProperties animated_property, base::TimeDelta duration, gfx::Tween::Type tween, ui::LayerAnimator::PreemptionStrategy preemption_strategy, - base::TimeDelta delay) { - DCHECK_EQ(settings->GetAnimator(), animator); - settings->SetTransitionDuration(duration); - settings->SetTweenType(tween); - settings->SetPreemptionStrategy(preemption_strategy); - if (!delay.is_zero()) + base::TimeDelta delay, + ui::ScopedLayerAnimationSettings& out_settings) { + CHECK_EQ(out_settings.GetAnimator(), animator); + out_settings.SetTransitionDuration(duration); + out_settings.SetTweenType(tween); + out_settings.SetPreemptionStrategy(preemption_strategy); + if (!delay.is_zero()) { animator->SchedulePauseForProperties(delay, animated_property); + } } // Returns BubbleDialogDelegateView if |transient_window| is a bubble dialog. @@ -311,18 +305,12 @@ if (layer->GetTargetOpacity() == target_opacity) return; - base::TimeDelta duration; - gfx::Tween::Type tween; - ui::LayerAnimator::PreemptionStrategy preemption_strategy; - base::TimeDelta delay; - GetAnimationValuesForType(type, &duration, &tween, &preemption_strategy, - &delay); - + const AnimationValues values = GetAnimationValuesForType(type); ui::LayerAnimator* animator = layer->GetAnimator(); ui::ScopedLayerAnimationSettings settings(animator); - ApplyAnimationSettings(&settings, animator, - ui::LayerAnimationElement::OPACITY, duration, tween, - preemption_strategy, delay); + ApplyAnimationSettings(animator, ui::LayerAnimationElement::OPACITY, + values.duration, values.tween_type, + values.preemption_strategy, values.delay, settings); layer->SetOpacity(target_opacity); } @@ -347,20 +335,16 @@ return; } - base::TimeDelta duration; - gfx::Tween::Type tween; - ui::LayerAnimator::PreemptionStrategy preemption_strategy; - base::TimeDelta delay; - GetAnimationValuesForType(type, &duration, &tween, &preemption_strategy, - &delay); - + const AnimationValues values = GetAnimationValuesForType(type); ui::LayerAnimator* animator = layer->GetAnimator(); ui::ScopedLayerAnimationSettings settings(animator); - for (ui::ImplicitAnimationObserver* animation_observer : animation_observers) + for (ui::ImplicitAnimationObserver* animation_observer : + animation_observers) { settings.AddObserver(animation_observer); - ApplyAnimationSettings(&settings, animator, - ui::LayerAnimationElement::TRANSFORM, duration, tween, - preemption_strategy, delay); + } + ApplyAnimationSettings(animator, ui::LayerAnimationElement::TRANSFORM, + values.duration, values.tween_type, + values.preemption_strategy, values.delay, settings); layer->SetTransform(target_transform); } @@ -385,18 +369,14 @@ return; } - base::TimeDelta duration; - gfx::Tween::Type tween; - ui::LayerAnimator::PreemptionStrategy preemption_strategy; - base::TimeDelta delay; - GetAnimationValuesForType(type, &duration, &tween, &preemption_strategy, - &delay); - + const AnimationValues values = GetAnimationValuesForType(type); ui::ScopedLayerAnimationSettings settings(animator); - if (animation_observer.get()) + if (animation_observer.get()) { settings.AddObserver(animation_observer.release()); - ApplyAnimationSettings(&settings, animator, ui::LayerAnimationElement::CLIP, - duration, tween, preemption_strategy, delay); + } + ApplyAnimationSettings(animator, ui::LayerAnimationElement::CLIP, + values.duration, values.tween_type, + values.preemption_strategy, values.delay, settings); layer->SetClipRect(target_clip_rect); }
diff --git a/base/android/bundle_utils.cc b/base/android/bundle_utils.cc index c9f3f3a..9a376a4 100644 --- a/base/android/bundle_utils.cc +++ b/base/android/bundle_utils.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/android/bundle_utils.h" #include <android/dlext.h>
diff --git a/base/android/jni_array.cc b/base/android/jni_array.cc index 42fed82..f680e24 100644 --- a/base/android/jni_array.cc +++ b/base/android/jni_array.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/android/jni_array.h" #include "base/android/jni_android.h"
diff --git a/base/android/jni_array_unittest.cc b/base/android/jni_array_unittest.cc index 100b10f..3c4e253a 100644 --- a/base/android/jni_array_unittest.cc +++ b/base/android/jni_array_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/android/jni_array.h" #include <stddef.h>
diff --git a/base/android/jni_registrar.cc b/base/android/jni_registrar.cc index 9172a93..3615d4a4 100644 --- a/base/android/jni_registrar.cc +++ b/base/android/jni_registrar.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/android/jni_registrar.h" #include "base/android/jni_android.h"
diff --git a/base/android/library_loader/library_prefetcher.cc b/base/android/library_loader/library_prefetcher.cc index b0fc3fd..c720333 100644 --- a/base/android/library_loader/library_prefetcher.cc +++ b/base/android/library_loader/library_prefetcher.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/android/library_loader/library_prefetcher.h" #include <stddef.h>
diff --git a/base/android/linker/linker_jni.cc b/base/android/linker/linker_jni.cc index b53da73..aa96bc1 100644 --- a/base/android/linker/linker_jni.cc +++ b/base/android/linker/linker_jni.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/android/linker/linker_jni.h" #include <android/dlext.h>
diff --git a/base/android/linker/linker_unittest.cc b/base/android/linker/linker_unittest.cc index 9672232..8f969fa 100644 --- a/base/android/linker/linker_unittest.cc +++ b/base/android/linker/linker_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <link.h> #include <sys/mman.h> #include <sys/prctl.h>
diff --git a/base/android/pmf_utils.cc b/base/android/pmf_utils.cc index 8bcf121..b8cbd4a 100644 --- a/base/android/pmf_utils.cc +++ b/base/android/pmf_utils.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/android/pmf_utils.h" #include <fcntl.h>
diff --git a/base/android/scoped_java_ref_unittest.cc b/base/android/scoped_java_ref_unittest.cc index bf6223f..8afc11e 100644 --- a/base/android/scoped_java_ref_unittest.cc +++ b/base/android/scoped_java_ref_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/android/scoped_java_ref.h" #include <iterator>
diff --git a/base/base64.cc b/base/base64.cc index 96ae77f..c877aaa5 100644 --- a/base/base64.cc +++ b/base/base64.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/base64.h" #include <stddef.h>
diff --git a/base/base64_unittest.cc b/base/base64_unittest.cc index 948bf622..1b110c8e 100644 --- a/base/base64_unittest.cc +++ b/base/base64_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/base64.h" #include <string_view>
diff --git a/base/check_op.cc b/base/check_op.cc index 108339261..c4eed43 100644 --- a/base/check_op.cc +++ b/base/check_op.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/check_op.h" #include <string.h>
diff --git a/base/command_line.cc b/base/command_line.cc index 22f83e2..3596432c 100644 --- a/base/command_line.cc +++ b/base/command_line.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/command_line.h" #include <ostream>
diff --git a/base/command_line_unittest.cc b/base/command_line_unittest.cc index d36a398a..b67a7a6 100644 --- a/base/command_line_unittest.cc +++ b/base/command_line_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/command_line.h" #include <memory>
diff --git a/base/containers/checked_iterators.h b/base/containers/checked_iterators.h index ee9859b..59654830 100644 --- a/base/containers/checked_iterators.h +++ b/base/containers/checked_iterators.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_CONTAINERS_CHECKED_ITERATORS_H_ #define BASE_CONTAINERS_CHECKED_ITERATORS_H_
diff --git a/base/containers/checked_iterators_unittest.cc b/base/containers/checked_iterators_unittest.cc index 3387231..4bae4f2 100644 --- a/base/containers/checked_iterators_unittest.cc +++ b/base/containers/checked_iterators_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/containers/checked_iterators.h" #include <algorithm>
diff --git a/base/containers/circular_deque.h b/base/containers/circular_deque.h index d9607159..6ba5a93 100644 --- a/base/containers/circular_deque.h +++ b/base/containers/circular_deque.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_CONTAINERS_CIRCULAR_DEQUE_H_ #define BASE_CONTAINERS_CIRCULAR_DEQUE_H_
diff --git a/base/containers/circular_deque_unittest.cc b/base/containers/circular_deque_unittest.cc index d9f5aa7..d7a9ae3 100644 --- a/base/containers/circular_deque_unittest.cc +++ b/base/containers/circular_deque_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/containers/circular_deque.h" #include "base/memory/raw_ptr.h"
diff --git a/base/containers/fixed_flat_map.h b/base/containers/fixed_flat_map.h index 92a6724..e73a87ed 100644 --- a/base/containers/fixed_flat_map.h +++ b/base/containers/fixed_flat_map.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_CONTAINERS_FIXED_FLAT_MAP_H_ #define BASE_CONTAINERS_FIXED_FLAT_MAP_H_
diff --git a/base/containers/fixed_flat_set.h b/base/containers/fixed_flat_set.h index 55aa7b8..f0b9f7c 100644 --- a/base/containers/fixed_flat_set.h +++ b/base/containers/fixed_flat_set.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_CONTAINERS_FIXED_FLAT_SET_H_ #define BASE_CONTAINERS_FIXED_FLAT_SET_H_
diff --git a/base/containers/flat_tree.h b/base/containers/flat_tree.h index 30e9881..a0f4a54 100644 --- a/base/containers/flat_tree.h +++ b/base/containers/flat_tree.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_CONTAINERS_FLAT_TREE_H_ #define BASE_CONTAINERS_FLAT_TREE_H_
diff --git a/base/containers/flat_tree_unittest.cc b/base/containers/flat_tree_unittest.cc index c208339..653c75a5 100644 --- a/base/containers/flat_tree_unittest.cc +++ b/base/containers/flat_tree_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/containers/flat_tree.h" // Following tests are ported and extended tests from libcpp for std::set.
diff --git a/base/containers/heap_array.h b/base/containers/heap_array.h index 9869f83..223f06b 100644 --- a/base/containers/heap_array.h +++ b/base/containers/heap_array.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_CONTAINERS_HEAP_ARRAY_H_ #define BASE_CONTAINERS_HEAP_ARRAY_H_
diff --git a/base/containers/heap_array_unittest.cc b/base/containers/heap_array_unittest.cc index 4c43f91..5fd6071 100644 --- a/base/containers/heap_array_unittest.cc +++ b/base/containers/heap_array_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/containers/heap_array.h" #include <stdint.h>
diff --git a/base/containers/id_map_unittest.cc b/base/containers/id_map_unittest.cc index 65236bd..1dd69b6 100644 --- a/base/containers/id_map_unittest.cc +++ b/base/containers/id_map_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/containers/id_map.h" #include <stdint.h>
diff --git a/base/containers/intrusive_heap.h b/base/containers/intrusive_heap.h index be26335f..8e75013 100644 --- a/base/containers/intrusive_heap.h +++ b/base/containers/intrusive_heap.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_CONTAINERS_INTRUSIVE_HEAP_H_ #define BASE_CONTAINERS_INTRUSIVE_HEAP_H_
diff --git a/base/containers/intrusive_heap_unittest.cc b/base/containers/intrusive_heap_unittest.cc index 6c76d1a..6681c17 100644 --- a/base/containers/intrusive_heap_unittest.cc +++ b/base/containers/intrusive_heap_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/containers/intrusive_heap.h" #include "base/check_op.h"
diff --git a/base/containers/linked_list_unittest.cc b/base/containers/linked_list_unittest.cc index 6acedf5..bd1e3614 100644 --- a/base/containers/linked_list_unittest.cc +++ b/base/containers/linked_list_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/containers/linked_list.h" #include "base/test/gtest_util.h"
diff --git a/base/containers/ring_buffer.h b/base/containers/ring_buffer.h index cae30fb..021ca9ff 100644 --- a/base/containers/ring_buffer.h +++ b/base/containers/ring_buffer.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_CONTAINERS_RING_BUFFER_H_ #define BASE_CONTAINERS_RING_BUFFER_H_
diff --git a/base/containers/small_map.h b/base/containers/small_map.h index 3aa67ff..b7429ce0d6 100644 --- a/base/containers/small_map.h +++ b/base/containers/small_map.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_CONTAINERS_SMALL_MAP_H_ #define BASE_CONTAINERS_SMALL_MAP_H_
diff --git a/base/containers/span_unittest.cc b/base/containers/span_unittest.cc index c5afb87..a58e4c2 100644 --- a/base/containers/span_unittest.cc +++ b/base/containers/span_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/containers/span.h" #include <stdint.h>
diff --git a/base/containers/vector_buffer.h b/base/containers/vector_buffer.h index 60d905f..2fa93cd6 100644 --- a/base/containers/vector_buffer.h +++ b/base/containers/vector_buffer.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_CONTAINERS_VECTOR_BUFFER_H_ #define BASE_CONTAINERS_VECTOR_BUFFER_H_
diff --git a/base/containers/vector_buffer_unittest.cc b/base/containers/vector_buffer_unittest.cc index af42a2b..05cc055d 100644 --- a/base/containers/vector_buffer_unittest.cc +++ b/base/containers/vector_buffer_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/containers/vector_buffer.h" #include "base/compiler_specific.h"
diff --git a/base/cpu.cc b/base/cpu.cc index 53008f3..8e1713ca 100644 --- a/base/cpu.cc +++ b/base/cpu.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/cpu.h" #include <stdint.h>
diff --git a/base/cpu_unittest.cc b/base/cpu_unittest.cc index 674bee044..23997fb 100644 --- a/base/cpu_unittest.cc +++ b/base/cpu_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/cpu.h" #include "base/containers/contains.h"
diff --git a/base/debug/allocation_trace_unittest.cc b/base/debug/allocation_trace_unittest.cc index 485edca8..0dbc7602 100644 --- a/base/debug/allocation_trace_unittest.cc +++ b/base/debug/allocation_trace_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/allocation_trace.h" #include <algorithm>
diff --git a/base/debug/asan_invalid_access.cc b/base/debug/asan_invalid_access.cc index c703cac..777a0b1 100644 --- a/base/debug/asan_invalid_access.cc +++ b/base/debug/asan_invalid_access.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/asan_invalid_access.h" #include <stddef.h>
diff --git a/base/debug/asan_service.cc b/base/debug/asan_service.cc index 395d9013..503034c 100644 --- a/base/debug/asan_service.cc +++ b/base/debug/asan_service.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/asan_service.h" #if defined(ADDRESS_SANITIZER)
diff --git a/base/debug/buffered_dwarf_reader.cc b/base/debug/buffered_dwarf_reader.cc index 7c7a0559..8dc7428 100644 --- a/base/debug/buffered_dwarf_reader.cc +++ b/base/debug/buffered_dwarf_reader.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/buffered_dwarf_reader.h" #ifdef USE_SYMBOLIZE
diff --git a/base/debug/debugger_posix.cc b/base/debug/debugger_posix.cc index 489b86e..45398652 100644 --- a/base/debug/debugger_posix.cc +++ b/base/debug/debugger_posix.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/debugger.h" #include <errno.h>
diff --git a/base/debug/dwarf_line_no.cc b/base/debug/dwarf_line_no.cc index f61791c..16c41fe 100644 --- a/base/debug/dwarf_line_no.cc +++ b/base/debug/dwarf_line_no.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/dwarf_line_no.h" #include "partition_alloc/pointers/raw_ref.h"
diff --git a/base/debug/elf_reader.cc b/base/debug/elf_reader.cc index 5b01a20..98a9ce2 100644 --- a/base/debug/elf_reader.cc +++ b/base/debug/elf_reader.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/elf_reader.h" #include <arpa/inet.h>
diff --git a/base/debug/elf_reader_unittest.cc b/base/debug/elf_reader_unittest.cc index 3ddda76..0b969777 100644 --- a/base/debug/elf_reader_unittest.cc +++ b/base/debug/elf_reader_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/elf_reader.h" #include <dlfcn.h>
diff --git a/base/debug/invalid_access_win.cc b/base/debug/invalid_access_win.cc index 36e2ec80..b67db7f 100644 --- a/base/debug/invalid_access_win.cc +++ b/base/debug/invalid_access_win.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/invalid_access_win.h" #include <windows.h>
diff --git a/base/debug/proc_maps_linux.cc b/base/debug/proc_maps_linux.cc index eb731e0..409ad72 100644 --- a/base/debug/proc_maps_linux.cc +++ b/base/debug/proc_maps_linux.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/proc_maps_linux.h" #include <fcntl.h>
diff --git a/base/debug/proc_maps_linux_unittest.cc b/base/debug/proc_maps_linux_unittest.cc index b529d9c..34349b8b 100644 --- a/base/debug/proc_maps_linux_unittest.cc +++ b/base/debug/proc_maps_linux_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/proc_maps_linux.h" #include <stddef.h>
diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc index 99ef792..4883b39 100644 --- a/base/debug/stack_trace.cc +++ b/base/debug/stack_trace.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/stack_trace.h" #include <string.h>
diff --git a/base/debug/stack_trace.h b/base/debug/stack_trace.h index 1fbf685..fae5c87 100644 --- a/base/debug/stack_trace.h +++ b/base/debug/stack_trace.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_DEBUG_STACK_TRACE_H_ #define BASE_DEBUG_STACK_TRACE_H_
diff --git a/base/debug/stack_trace_android.cc b/base/debug/stack_trace_android.cc index fe5e3ad..38d4897 100644 --- a/base/debug/stack_trace_android.cc +++ b/base/debug/stack_trace_android.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/stack_trace.h" #include <android/log.h>
diff --git a/base/debug/stack_trace_fuchsia.cc b/base/debug/stack_trace_fuchsia.cc index c51dc0a7..cdc0d66 100644 --- a/base/debug/stack_trace_fuchsia.cc +++ b/base/debug/stack_trace_fuchsia.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/stack_trace.h" #include <elf.h>
diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc index fc1090a0..f962f27 100644 --- a/base/debug/stack_trace_posix.cc +++ b/base/debug/stack_trace_posix.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/stack_trace.h" #include <errno.h>
diff --git a/base/debug/stack_trace_unittest.cc b/base/debug/stack_trace_unittest.cc index e54452fe..e003e82 100644 --- a/base/debug/stack_trace_unittest.cc +++ b/base/debug/stack_trace_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <stddef.h> #include <limits>
diff --git a/base/debug/stack_trace_win.cc b/base/debug/stack_trace_win.cc index 10d09cba..80e9375 100644 --- a/base/debug/stack_trace_win.cc +++ b/base/debug/stack_trace_win.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/stack_trace.h" #include <windows.h>
diff --git a/base/debug/test_elf_image_builder.cc b/base/debug/test_elf_image_builder.cc index 05b16d9..757b5322 100644 --- a/base/debug/test_elf_image_builder.cc +++ b/base/debug/test_elf_image_builder.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/debug/test_elf_image_builder.h" #include <cstring>
diff --git a/base/feature_list.cc b/base/feature_list.cc index 2262ecd..eced7a3 100644 --- a/base/feature_list.cc +++ b/base/feature_list.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/feature_list.h" #include <stddef.h> @@ -363,21 +358,21 @@ } bool FeatureList::IsFeatureOverridden(const std::string& feature_name) const { - return overrides_.count(feature_name); + return GetOverrideEntryByFeatureName(feature_name); } bool FeatureList::IsFeatureOverriddenFromCommandLine( const std::string& feature_name) const { - auto it = overrides_.find(feature_name); - return it != overrides_.end() && !it->second.overridden_by_field_trial; + const OverrideEntry* entry = GetOverrideEntryByFeatureName(feature_name); + return entry && !entry->overridden_by_field_trial; } bool FeatureList::IsFeatureOverriddenFromCommandLine( const std::string& feature_name, OverrideState state) const { - auto it = overrides_.find(feature_name); - return it != overrides_.end() && !it->second.overridden_by_field_trial && - it->second.overridden_state == state; + const OverrideEntry* entry = GetOverrideEntryByFeatureName(feature_name); + return entry && !entry->overridden_by_field_trial && + entry->overridden_state == state; } void FeatureList::AssociateReportingFieldTrial( @@ -783,17 +778,16 @@ DCHECK(initialized_); DCHECK(IsValidFeatureOrFieldTrialName(feature_name)) << feature_name; - auto it = overrides_.find(feature_name); - if (it != overrides_.end()) { - const OverrideEntry& entry = it->second; - + if (const OverrideEntry* entry = + GetOverrideEntryByFeatureName(feature_name)) { // Activate the corresponding field trial, if necessary. - if (entry.field_trial) - entry.field_trial->Activate(); + if (entry->field_trial) { + entry->field_trial->Activate(); + } // TODO(asvitkine) Expand this section as more support is added. - return entry.overridden_state; + return entry->overridden_state; } // Otherwise, report that we want to use the default state. return OVERRIDE_USE_DEFAULT; @@ -808,7 +802,6 @@ const base::FeatureList::OverrideEntry* FeatureList::GetOverrideEntryByFeatureName(std::string_view name) const { - DCHECK(initialized_); DCHECK(IsValidFeatureOrFieldTrialName(name)) << name; auto it = overrides_.find(name); @@ -823,9 +816,7 @@ std::string_view name) const { DCHECK(initialized_); - const base::FeatureList::OverrideEntry* entry = - GetOverrideEntryByFeatureName(name); - if (entry) { + if (const OverrideEntry* entry = GetOverrideEntryByFeatureName(name)) { return entry->field_trial; } return nullptr; @@ -834,8 +825,9 @@ bool FeatureList::HasAssociatedFieldTrialByFeatureName( std::string_view name) const { DCHECK(!initialized_); - auto entry = overrides_.find(name); - return entry != overrides_.end() && entry->second.field_trial != nullptr; + + const OverrideEntry* entry = GetOverrideEntryByFeatureName(name); + return entry && entry->field_trial; } FieldTrial* FeatureList::GetEnabledFieldTrialByFeatureName(
diff --git a/base/feature_list_unittest.cc b/base/feature_list_unittest.cc index 7f020aa8..989d705 100644 --- a/base/feature_list_unittest.cc +++ b/base/feature_list_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/feature_list.h" #include <stddef.h>
diff --git a/base/file_version_info_win_unittest.cc b/base/file_version_info_win_unittest.cc index bba5c18..7d7d7ae 100644 --- a/base/file_version_info_win_unittest.cc +++ b/base/file_version_info_win_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/file_version_info_win.h" #include <windows.h>
diff --git a/base/files/dir_reader_linux.h b/base/files/dir_reader_linux.h index 2bd9c45..4675e222 100644 --- a/base/files/dir_reader_linux.h +++ b/base/files/dir_reader_linux.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_FILES_DIR_READER_LINUX_H_ #define BASE_FILES_DIR_READER_LINUX_H_
diff --git a/base/files/file_descriptor_watcher_posix_unittest.cc b/base/files/file_descriptor_watcher_posix_unittest.cc index 472516d..7950867 100644 --- a/base/files/file_descriptor_watcher_posix_unittest.cc +++ b/base/files/file_descriptor_watcher_posix_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/file_descriptor_watcher_posix.h" #include <unistd.h>
diff --git a/base/files/file_path.cc b/base/files/file_path.cc index 2131146..8f8c351 100644 --- a/base/files/file_path.cc +++ b/base/files/file_path.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/file_path.h" #include <string.h>
diff --git a/base/files/file_path_unittest.cc b/base/files/file_path_unittest.cc index dfe2e7a..65552188 100644 --- a/base/files/file_path_unittest.cc +++ b/base/files/file_path_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/file_path.h" #include <stddef.h>
diff --git a/base/files/file_path_watcher_fsevents.cc b/base/files/file_path_watcher_fsevents.cc index 9713de4b..0b30e82 100644 --- a/base/files/file_path_watcher_fsevents.cc +++ b/base/files/file_path_watcher_fsevents.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/file_path_watcher_fsevents.h" #include <dispatch/dispatch.h>
diff --git a/base/files/file_path_watcher_kqueue.cc b/base/files/file_path_watcher_kqueue.cc index 18476de..3e911fe1 100644 --- a/base/files/file_path_watcher_kqueue.cc +++ b/base/files/file_path_watcher_kqueue.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/file_path_watcher_kqueue.h" #include <fcntl.h>
diff --git a/base/files/file_posix.cc b/base/files/file_posix.cc index 33a5628..b60e6f9 100644 --- a/base/files/file_posix.cc +++ b/base/files/file_posix.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/file.h" // The only 32-bit platform that uses this file is Android. On Android APIs
diff --git a/base/files/file_proxy_unittest.cc b/base/files/file_proxy_unittest.cc index 50a49b7..df1ca30 100644 --- a/base/files/file_proxy_unittest.cc +++ b/base/files/file_proxy_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/file_proxy.h" #include <stddef.h>
diff --git a/base/files/file_unittest.cc b/base/files/file_unittest.cc index 505f111..98e2fa8 100644 --- a/base/files/file_unittest.cc +++ b/base/files/file_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/file.h" #include <stdint.h>
diff --git a/base/files/file_util.cc b/base/files/file_util.cc index d5117b4..567fa76 100644 --- a/base/files/file_util.cc +++ b/base/files/file_util.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/file_util.h" #include "base/task/sequenced_task_runner.h"
diff --git a/base/files/file_util_posix.cc b/base/files/file_util_posix.cc index 4466db1b..6da729a 100644 --- a/base/files/file_util_posix.cc +++ b/base/files/file_util_posix.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/file_util.h" #include <dirent.h>
diff --git a/base/files/file_util_unittest.cc b/base/files/file_util_unittest.cc index 8290052..89c5dd7 100644 --- a/base/files/file_util_unittest.cc +++ b/base/files/file_util_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/file_util.h" #include <stddef.h>
diff --git a/base/files/file_util_win.cc b/base/files/file_util_win.cc index a7a9216..60df40b 100644 --- a/base/files/file_util_win.cc +++ b/base/files/file_util_win.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/file_util.h" #include <windows.h>
diff --git a/base/files/important_file_writer.cc b/base/files/important_file_writer.cc index 576692bb..ba84a7d 100644 --- a/base/files/important_file_writer.cc +++ b/base/files/important_file_writer.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/important_file_writer.h" #include <stddef.h>
diff --git a/base/files/memory_mapped_file_unittest.cc b/base/files/memory_mapped_file_unittest.cc index 6215e8f9..b22194a 100644 --- a/base/files/memory_mapped_file_unittest.cc +++ b/base/files/memory_mapped_file_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/files/memory_mapped_file.h" #include <stddef.h>
diff --git a/base/functional/bind_unittest.cc b/base/functional/bind_unittest.cc index 48db7da7..8d95152 100644 --- a/base/functional/bind_unittest.cc +++ b/base/functional/bind_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/functional/bind.h" #include <functional>
diff --git a/base/hash/hash.cc b/base/hash/hash.cc index b3711c3..7af76f96 100644 --- a/base/hash/hash.cc +++ b/base/hash/hash.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/hash/hash.h" #include <string_view>
diff --git a/base/hash/md5_constexpr_unittest.cc b/base/hash/md5_constexpr_unittest.cc index 2bf3725d..9b741b7 100644 --- a/base/hash/md5_constexpr_unittest.cc +++ b/base/hash/md5_constexpr_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/hash/md5_constexpr.h" #include "base/hash/md5.h"
diff --git a/base/hash/md5_unittest.cc b/base/hash/md5_unittest.cc index 0496724..b6328f82d 100644 --- a/base/hash/md5_unittest.cc +++ b/base/hash/md5_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/hash/md5.h" #include <string.h>
diff --git a/base/hash/sha1_unittest.cc b/base/hash/sha1_unittest.cc index 15f04c9..77d2f60 100644 --- a/base/hash/sha1_unittest.cc +++ b/base/hash/sha1_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/hash/sha1.h" #include <stddef.h>
diff --git a/base/i18n/build_utf8_validator_tables.cc b/base/i18n/build_utf8_validator_tables.cc index 1a8d0cf..72b5619 100644 --- a/base/i18n/build_utf8_validator_tables.cc +++ b/base/i18n/build_utf8_validator_tables.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // Create a state machine for validating UTF-8. The algorithm in brief: // 1. Convert the complete unicode range of code points, except for the // surrogate code points, to an ordered array of sequences of bytes in
diff --git a/base/i18n/char_iterator.cc b/base/i18n/char_iterator.cc index f77d392e..3c15299 100644 --- a/base/i18n/char_iterator.cc +++ b/base/i18n/char_iterator.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/i18n/char_iterator.h" #include <string_view>
diff --git a/base/i18n/file_util_icu.cc b/base/i18n/file_util_icu.cc index 8e1c2868..fa931635 100644 --- a/base/i18n/file_util_icu.cc +++ b/base/i18n/file_util_icu.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // File utilities that use the ICU library go in this file. #include "base/i18n/file_util_icu.h"
diff --git a/base/i18n/file_util_icu_unittest.cc b/base/i18n/file_util_icu_unittest.cc index d86f8af7..a30be7c 100644 --- a/base/i18n/file_util_icu_unittest.cc +++ b/base/i18n/file_util_icu_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/i18n/file_util_icu.h" #include <stddef.h>
diff --git a/base/i18n/icu_mergeable_data_file.cc b/base/i18n/icu_mergeable_data_file.cc index 4228fcc..5df7635 100644 --- a/base/i18n/icu_mergeable_data_file.cc +++ b/base/i18n/icu_mergeable_data_file.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/i18n/icu_mergeable_data_file.h" #include <sys/mman.h>
diff --git a/base/i18n/icu_mergeable_data_file_unittest.cc b/base/i18n/icu_mergeable_data_file_unittest.cc index f0177be..69503708 100644 --- a/base/i18n/icu_mergeable_data_file_unittest.cc +++ b/base/i18n/icu_mergeable_data_file_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/i18n/icu_mergeable_data_file.h" #include "base/debug/proc_maps_linux.h"
diff --git a/base/i18n/icu_string_conversions_unittest.cc b/base/i18n/icu_string_conversions_unittest.cc index dacc5ae8..277225b 100644 --- a/base/i18n/icu_string_conversions_unittest.cc +++ b/base/i18n/icu_string_conversions_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/i18n/icu_string_conversions.h" #include <math.h>
diff --git a/base/i18n/rtl.cc b/base/i18n/rtl.cc index f9fb6f6..b1abf6f 100644 --- a/base/i18n/rtl.cc +++ b/base/i18n/rtl.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/i18n/rtl.h" #include <stddef.h>
diff --git a/base/i18n/streaming_utf8_validator.cc b/base/i18n/streaming_utf8_validator.cc index cf35ec6..2f4ff73 100644 --- a/base/i18n/streaming_utf8_validator.cc +++ b/base/i18n/streaming_utf8_validator.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // This implementation doesn't use ICU. The ICU macros are oriented towards // character-at-a-time processing, whereas byte-at-a-time processing is easier // with streaming input.
diff --git a/base/i18n/streaming_utf8_validator_perftest.cc b/base/i18n/streaming_utf8_validator_perftest.cc index 1c10511..a0b2116 100644 --- a/base/i18n/streaming_utf8_validator_perftest.cc +++ b/base/i18n/streaming_utf8_validator_perftest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // All data that is passed through a WebSocket with type "Text" needs to be // validated as UTF8. Since this is done on the IO thread, it needs to be // reasonably fast.
diff --git a/base/i18n/streaming_utf8_validator_unittest.cc b/base/i18n/streaming_utf8_validator_unittest.cc index 7774cd4..3a66205 100644 --- a/base/i18n/streaming_utf8_validator_unittest.cc +++ b/base/i18n/streaming_utf8_validator_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/i18n/streaming_utf8_validator.h" #include <stddef.h>
diff --git a/base/i18n/string_search_unittest.cc b/base/i18n/string_search_unittest.cc index 0e3a95d..a2c4933 100644 --- a/base/i18n/string_search_unittest.cc +++ b/base/i18n/string_search_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/i18n/string_search.h" #include <stddef.h>
diff --git a/base/immediate_crash_unittest.cc b/base/immediate_crash_unittest.cc index edf5051..7ba79004 100644 --- a/base/immediate_crash_unittest.cc +++ b/base/immediate_crash_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/immediate_crash.h" #include <stdint.h>
diff --git a/base/ios/device_util.mm b/base/ios/device_util.mm index 946b527..8bd38bf 100644 --- a/base/ios/device_util.mm +++ b/base/ios/device_util.mm
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/ios/device_util.h" #include <CommonCrypto/CommonDigest.h>
diff --git a/base/ios/ios_util.mm b/base/ios/ios_util.mm index 129e8e9..9570ec8 100644 --- a/base/ios/ios_util.mm +++ b/base/ios/ios_util.mm
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/ios/ios_util.h" #import <Foundation/Foundation.h>
diff --git a/base/json/json_correctness_fuzzer.cc b/base/json/json_correctness_fuzzer.cc index 0f49de3..532d037 100644 --- a/base/json/json_correctness_fuzzer.cc +++ b/base/json/json_correctness_fuzzer.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // A fuzzer that checks correctness of json parser/writer. // The fuzzer input is passed through parsing twice, // so that presumably valid json is parsed/written again.
diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc index 97d0f6bd..4406549 100644 --- a/base/json/json_parser.cc +++ b/base/json/json_parser.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/json/json_parser.h" #include <cmath>
diff --git a/base/json/json_reader_fuzzer.cc b/base/json/json_reader_fuzzer.cc index c20a285..396b434 100644 --- a/base/json/json_reader_fuzzer.cc +++ b/base/json/json_reader_fuzzer.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/json/json_reader.h" #include <optional>
diff --git a/base/json/json_reader_unittest.cc b/base/json/json_reader_unittest.cc index 0dd46bd..6ef8d83 100644 --- a/base/json/json_reader_unittest.cc +++ b/base/json/json_reader_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/json/json_reader.h" #include <stddef.h>
diff --git a/base/json/json_writer_unittest.cc b/base/json/json_writer_unittest.cc index 6e1c1ae..49d93dd 100644 --- a/base/json/json_writer_unittest.cc +++ b/base/json/json_writer_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/json/json_writer.h" #include <optional>
diff --git a/base/json/string_escape_fuzzer.cc b/base/json/string_escape_fuzzer.cc index 360b085..dd67a32 100644 --- a/base/json/string_escape_fuzzer.cc +++ b/base/json/string_escape_fuzzer.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <memory> #include <string_view>
diff --git a/base/location.cc b/base/location.cc index 917460f..b38ec16 100644 --- a/base/location.cc +++ b/base/location.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/location.h" #include "base/compiler_specific.h"
diff --git a/base/logging.cc b/base/logging.cc index 8158823..998d814 100644 --- a/base/logging.cc +++ b/base/logging.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/logging.h" #ifdef BASE_CHECK_H_
diff --git a/base/logging_unittest.cc b/base/logging_unittest.cc index 81a9502..f3fc6c7 100644 --- a/base/logging_unittest.cc +++ b/base/logging_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/logging.h" #include <sstream>
diff --git a/base/logging_win.cc b/base/logging_win.cc index c2d18a9..6e8100c 100644 --- a/base/logging_win.cc +++ b/base/logging_win.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/logging_win.h" #include <initguid.h>
diff --git a/base/mac/authorization_util.mm b/base/mac/authorization_util.mm index 6c7da8b5..e276960 100644 --- a/base/mac/authorization_util.mm +++ b/base/mac/authorization_util.mm
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/mac/authorization_util.h" #import <Foundation/Foundation.h>
diff --git a/base/mac/mac_util_unittest.mm b/base/mac/mac_util_unittest.mm index 6f5889ef..5ed5e4e 100644 --- a/base/mac/mac_util_unittest.mm +++ b/base/mac/mac_util_unittest.mm
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/mac/mac_util.h" #import <Cocoa/Cocoa.h>
diff --git a/base/mac/mach_port_rendezvous_unittest.cc b/base/mac/mach_port_rendezvous_unittest.cc index 5eed1f57..ddfb06f4 100644 --- a/base/mac/mach_port_rendezvous_unittest.cc +++ b/base/mac/mach_port_rendezvous_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/mac/mach_port_rendezvous.h" #include <mach/mach.h>
diff --git a/base/mac/os_crash_dumps.cc b/base/mac/os_crash_dumps.cc index 23c45c1..d529e45 100644 --- a/base/mac/os_crash_dumps.cc +++ b/base/mac/os_crash_dumps.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/mac/os_crash_dumps.h" #include <signal.h>
diff --git a/base/mac/test/launch_application_test_helper_main.m b/base/mac/test/launch_application_test_helper_main.m index a30e1c0..a43bf1f 100644 --- a/base/mac/test/launch_application_test_helper_main.m +++ b/base/mac/test/launch_application_test_helper_main.m
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // This is a helper application for launch_application_unittest.mm. This // application records several events by writing them to a named pipe; // the unit tests then use this information to verify that this helper was
diff --git a/base/memory/discardable_memory_backing_field_trial_unittest.cc b/base/memory/discardable_memory_backing_field_trial_unittest.cc index 8fbcfad6b..8d765dbc 100644 --- a/base/memory/discardable_memory_backing_field_trial_unittest.cc +++ b/base/memory/discardable_memory_backing_field_trial_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/memory/discardable_memory.h" #include "base/memory/discardable_memory_internal.h" #include "base/metrics/field_trial.h"
diff --git a/base/memory/discardable_shared_memory.cc b/base/memory/discardable_shared_memory.cc index 42617c8..ad513558 100644 --- a/base/memory/discardable_shared_memory.cc +++ b/base/memory/discardable_shared_memory.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/memory/discardable_shared_memory.h" #include <stdint.h>
diff --git a/base/memory/madv_free_discardable_memory_posix.cc b/base/memory/madv_free_discardable_memory_posix.cc index d572a3f..a72aee6 100644 --- a/base/memory/madv_free_discardable_memory_posix.cc +++ b/base/memory/madv_free_discardable_memory_posix.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/memory/madv_free_discardable_memory_posix.h" #include <errno.h>
diff --git a/base/memory/platform_shared_memory_mapper_android.cc b/base/memory/platform_shared_memory_mapper_android.cc index c1cf53e..3e5370f2 100644 --- a/base/memory/platform_shared_memory_mapper_android.cc +++ b/base/memory/platform_shared_memory_mapper_android.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/memory/platform_shared_memory_mapper.h" #include "base/logging.h"
diff --git a/base/memory/platform_shared_memory_mapper_fuchsia.cc b/base/memory/platform_shared_memory_mapper_fuchsia.cc index db6bd7c..8925593 100644 --- a/base/memory/platform_shared_memory_mapper_fuchsia.cc +++ b/base/memory/platform_shared_memory_mapper_fuchsia.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/memory/platform_shared_memory_mapper.h" #include "base/logging.h"
diff --git a/base/memory/platform_shared_memory_mapper_posix.cc b/base/memory/platform_shared_memory_mapper_posix.cc index 192f5d17..a4a2a8e 100644 --- a/base/memory/platform_shared_memory_mapper_posix.cc +++ b/base/memory/platform_shared_memory_mapper_posix.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/memory/platform_shared_memory_mapper.h" #include "base/logging.h"
diff --git a/base/memory/platform_shared_memory_mapper_win.cc b/base/memory/platform_shared_memory_mapper_win.cc index eef28ad..6e70d44b 100644 --- a/base/memory/platform_shared_memory_mapper_win.cc +++ b/base/memory/platform_shared_memory_mapper_win.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/memory/platform_shared_memory_mapper.h" #include "base/logging.h"
diff --git a/base/memory/protected_memory.h b/base/memory/protected_memory.h index 710f6c8..be79e9e 100644 --- a/base/memory/protected_memory.h +++ b/base/memory/protected_memory.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // Protected memory is memory holding security-sensitive data intended to be // left read-only for the majority of its lifetime to avoid being overwritten // by attackers. ProtectedMemory is a simple wrapper around platform-specific
diff --git a/base/memory/protected_memory_unittest.cc b/base/memory/protected_memory_unittest.cc index b742661..555ddf9 100644 --- a/base/memory/protected_memory_unittest.cc +++ b/base/memory/protected_memory_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/memory/protected_memory.h" #include <stddef.h>
diff --git a/base/memory/raw_ptr_asan_service.cc b/base/memory/raw_ptr_asan_service.cc index 351e081..194c9c6 100644 --- a/base/memory/raw_ptr_asan_service.cc +++ b/base/memory/raw_ptr_asan_service.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/memory/raw_ptr_asan_service.h" #if BUILDFLAG(USE_ASAN_BACKUP_REF_PTR)
diff --git a/base/memory/ref_counted_memory.h b/base/memory/ref_counted_memory.h index f388c46..aebcebd 100644 --- a/base/memory/ref_counted_memory.h +++ b/base/memory/ref_counted_memory.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_MEMORY_REF_COUNTED_MEMORY_H_ #define BASE_MEMORY_REF_COUNTED_MEMORY_H_
diff --git a/base/memory/ref_counted_memory_unittest.cc b/base/memory/ref_counted_memory_unittest.cc index 59caad6..f2ffe2c 100644 --- a/base/memory/ref_counted_memory_unittest.cc +++ b/base/memory/ref_counted_memory_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/memory/ref_counted_memory.h" #include <stdint.h>
diff --git a/base/memory/shared_memory_mapping.cc b/base/memory/shared_memory_mapping.cc index 868493f..0fc4ba5 100644 --- a/base/memory/shared_memory_mapping.cc +++ b/base/memory/shared_memory_mapping.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/memory/shared_memory_mapping.h" #include <cstdint>
diff --git a/base/memory/shared_memory_region_unittest.cc b/base/memory/shared_memory_region_unittest.cc index 52eff96..48c67cc9 100644 --- a/base/memory/shared_memory_region_unittest.cc +++ b/base/memory/shared_memory_region_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <utility> #include "base/memory/platform_shared_memory_region.h"
diff --git a/base/message_loop/message_pump_apple.mm b/base/message_loop/message_pump_apple.mm index 982084d..5e9d5f08 100644 --- a/base/message_loop/message_pump_apple.mm +++ b/base/message_loop/message_pump_apple.mm
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #import "base/message_loop/message_pump_apple.h" #import <Foundation/Foundation.h>
diff --git a/base/message_loop/message_pump_glib_unittest.cc b/base/message_loop/message_pump_glib_unittest.cc index 1cf43e38..a7d7a253 100644 --- a/base/message_loop/message_pump_glib_unittest.cc +++ b/base/message_loop/message_pump_glib_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/message_loop/message_pump_glib.h" #include <glib.h>
diff --git a/base/message_loop/message_pump_kqueue.cc b/base/message_loop/message_pump_kqueue.cc index 20394a37..9529305 100644 --- a/base/message_loop/message_pump_kqueue.cc +++ b/base/message_loop/message_pump_kqueue.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/message_loop/message_pump_kqueue.h" #include <sys/errno.h>
diff --git a/base/metrics/crc32.cc b/base/metrics/crc32.cc index 5708c6d..e273d16 100644 --- a/base/metrics/crc32.cc +++ b/base/metrics/crc32.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/metrics/crc32.h" namespace base {
diff --git a/base/metrics/crc32_unittest.cc b/base/metrics/crc32_unittest.cc index b6e7728..1110e10 100644 --- a/base/metrics/crc32_unittest.cc +++ b/base/metrics/crc32_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/metrics/crc32.h" #include <stdint.h>
diff --git a/base/metrics/field_trial.h b/base/metrics/field_trial.h index 6e9825d..d29313a0 100644 --- a/base/metrics/field_trial.h +++ b/base/metrics/field_trial.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // The FieldTrial class handles the lower level configuration of running A/B // tests. //
diff --git a/base/metrics/field_trial_params.h b/base/metrics/field_trial_params.h index 8c16d55..1cf2bf4c 100644 --- a/base/metrics/field_trial_params.h +++ b/base/metrics/field_trial_params.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_METRICS_FIELD_TRIAL_PARAMS_H_ #define BASE_METRICS_FIELD_TRIAL_PARAMS_H_
diff --git a/base/metrics/histogram_threadsafe_unittest.cc b/base/metrics/histogram_threadsafe_unittest.cc index 098808b..85b7c48 100644 --- a/base/metrics/histogram_threadsafe_unittest.cc +++ b/base/metrics/histogram_threadsafe_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/metrics/histogram.h" #include <memory>
diff --git a/base/metrics/metrics_hashes_unittest.cc b/base/metrics/metrics_hashes_unittest.cc index f7500638..a122f85 100644 --- a/base/metrics/metrics_hashes_unittest.cc +++ b/base/metrics/metrics_hashes_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/metrics/metrics_hashes.h" #include <stddef.h>
diff --git a/base/metrics/persistent_histogram_allocator.cc b/base/metrics/persistent_histogram_allocator.cc index c4b0a46..0ca09f60 100644 --- a/base/metrics/persistent_histogram_allocator.cc +++ b/base/metrics/persistent_histogram_allocator.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/metrics/persistent_histogram_allocator.h" #include <atomic>
diff --git a/base/metrics/persistent_histogram_allocator_fuzzer.cc b/base/metrics/persistent_histogram_allocator_fuzzer.cc index c714e602..1c68e20 100644 --- a/base/metrics/persistent_histogram_allocator_fuzzer.cc +++ b/base/metrics/persistent_histogram_allocator_fuzzer.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/logging.h" #include "base/metrics/histogram.h" #include "base/metrics/histogram_functions.h"
diff --git a/base/metrics/persistent_histogram_allocator_unittest.cc b/base/metrics/persistent_histogram_allocator_unittest.cc index 84a1570..ef2cecb 100644 --- a/base/metrics/persistent_histogram_allocator_unittest.cc +++ b/base/metrics/persistent_histogram_allocator_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/metrics/persistent_histogram_allocator.h" #include "base/files/file.h"
diff --git a/base/metrics/persistent_memory_allocator.cc b/base/metrics/persistent_memory_allocator.cc index 5889b5df..1950ba4 100644 --- a/base/metrics/persistent_memory_allocator.cc +++ b/base/metrics/persistent_memory_allocator.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/metrics/persistent_memory_allocator.h" #include <assert.h>
diff --git a/base/metrics/persistent_memory_allocator.h b/base/metrics/persistent_memory_allocator.h index 1349d0f..0862206 100644 --- a/base/metrics/persistent_memory_allocator.h +++ b/base/metrics/persistent_memory_allocator.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_METRICS_PERSISTENT_MEMORY_ALLOCATOR_H_ #define BASE_METRICS_PERSISTENT_MEMORY_ALLOCATOR_H_
diff --git a/base/metrics/persistent_memory_allocator_unittest.cc b/base/metrics/persistent_memory_allocator_unittest.cc index e60e990..15c1562 100644 --- a/base/metrics/persistent_memory_allocator_unittest.cc +++ b/base/metrics/persistent_memory_allocator_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/metrics/persistent_memory_allocator.h" #include <memory>
diff --git a/base/metrics/sample_vector.h b/base/metrics/sample_vector.h index 75d049f..55facb7 100644 --- a/base/metrics/sample_vector.h +++ b/base/metrics/sample_vector.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // SampleVector implements HistogramSamples interface. It is used by all // Histogram based classes to store samples.
diff --git a/base/metrics/sparse_histogram_unittest.cc b/base/metrics/sparse_histogram_unittest.cc index 20f6ac1..86b7eae0 100644 --- a/base/metrics/sparse_histogram_unittest.cc +++ b/base/metrics/sparse_histogram_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/metrics/sparse_histogram.h" #include <memory>
diff --git a/base/moving_window_unittest.cc b/base/moving_window_unittest.cc index a99745e0..a306d5a 100644 --- a/base/moving_window_unittest.cc +++ b/base/moving_window_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/moving_window.h" #include "base/time/time.h"
diff --git a/base/nix/mime_util_xdg.cc b/base/nix/mime_util_xdg.cc index d0fe2d0..e150d6d 100644 --- a/base/nix/mime_util_xdg.cc +++ b/base/nix/mime_util_xdg.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/nix/mime_util_xdg.h" #include <arpa/inet.h>
diff --git a/base/nix/mime_util_xdg_fuzzer.cc b/base/nix/mime_util_xdg_fuzzer.cc index 98e8658..3efd6a0 100644 --- a/base/nix/mime_util_xdg_fuzzer.cc +++ b/base/nix/mime_util_xdg_fuzzer.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <stdlib.h> #include <string>
diff --git a/base/os_compat_android.cc b/base/os_compat_android.cc index 92baf28..9e95a84 100644 --- a/base/os_compat_android.cc +++ b/base/os_compat_android.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/os_compat_android.h" #include <asm/unistd.h>
diff --git a/base/pickle.cc b/base/pickle.cc index e67971e..8419856 100644 --- a/base/pickle.cc +++ b/base/pickle.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/pickle.h" #include <algorithm>
diff --git a/base/pickle.h b/base/pickle.h index ec297d38..5b355b58 100644 --- a/base/pickle.h +++ b/base/pickle.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_PICKLE_H_ #define BASE_PICKLE_H_
diff --git a/base/pickle_fuzzer.cc b/base/pickle_fuzzer.cc index fd76b82..26008c1 100644 --- a/base/pickle_fuzzer.cc +++ b/base/pickle_fuzzer.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <fuzzer/FuzzedDataProvider.h> #include <tuple>
diff --git a/base/pickle_unittest.cc b/base/pickle_unittest.cc index 572799e4f..006114b1 100644 --- a/base/pickle_unittest.cc +++ b/base/pickle_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/pickle.h" #include <limits.h>
diff --git a/base/posix/safe_strerror.cc b/base/posix/safe_strerror.cc index 837412b..d9242fa 100644 --- a/base/posix/safe_strerror.cc +++ b/base/posix/safe_strerror.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/posix/safe_strerror.h" #include <errno.h>
diff --git a/base/posix/unix_domain_socket.cc b/base/posix/unix_domain_socket.cc index 3482f49d..cb3b0a4 100644 --- a/base/posix/unix_domain_socket.cc +++ b/base/posix/unix_domain_socket.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/posix/unix_domain_socket.h" #include <errno.h>
diff --git a/base/posix/unix_domain_socket_unittest.cc b/base/posix/unix_domain_socket_unittest.cc index 35cb4210..9f716e17c 100644 --- a/base/posix/unix_domain_socket_unittest.cc +++ b/base/posix/unix_domain_socket_unittest.cc
@@ -2,12 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - -#include "base/posix/unix_domain_socket.h" +#include "build/build_config.h" #include <stddef.h> #include <stdint.h> @@ -21,10 +16,10 @@ #include "base/functional/callback_helpers.h" #include "base/location.h" #include "base/pickle.h" +#include "base/posix/unix_domain_socket.h" #include "base/synchronization/waitable_event.h" #include "base/task/single_thread_task_runner.h" #include "base/threading/thread.h" -#include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" namespace base {
diff --git a/base/process/environment_internal.cc b/base/process/environment_internal.cc index f5532f84..c1dacc43 100644 --- a/base/process/environment_internal.cc +++ b/base/process/environment_internal.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/process/environment_internal.h" #include <stddef.h>
diff --git a/base/process/internal_linux.cc b/base/process/internal_linux.cc index f818141..67d3528 100644 --- a/base/process/internal_linux.cc +++ b/base/process/internal_linux.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/process/internal_linux.h" #include <limits.h>
diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc index 0e53a62..11b5bac1 100644 --- a/base/process/launch_posix.cc +++ b/base/process/launch_posix.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/process/launch.h" #include <dirent.h>
diff --git a/base/process/memory_unittest.cc b/base/process/memory_unittest.cc index 1dd8e4af..a453d81 100644 --- a/base/process/memory_unittest.cc +++ b/base/process/memory_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #define _CRT_SECURE_NO_WARNINGS #include "base/process/memory.h"
diff --git a/base/process/process_metrics_linux.cc b/base/process/process_metrics_linux.cc index db603cc1..7bc2350 100644 --- a/base/process/process_metrics_linux.cc +++ b/base/process/process_metrics_linux.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/process/process_metrics.h" #include <dirent.h>
diff --git a/base/process/process_metrics_unittest.cc b/base/process/process_metrics_unittest.cc index f93901e..5917f8d 100644 --- a/base/process/process_metrics_unittest.cc +++ b/base/process/process_metrics_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/process/process_metrics.h" #include <stddef.h>
diff --git a/base/process/set_process_title_linux.cc b/base/process/set_process_title_linux.cc index a3c3d19e..434b3ca 100644 --- a/base/process/set_process_title_linux.cc +++ b/base/process/set_process_title_linux.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // This file implements BSD-style setproctitle() for Linux. // It is written such that it can easily be compiled outside Chromium. //
diff --git a/base/profiler/chrome_unwinder_android.cc b/base/profiler/chrome_unwinder_android.cc index ba8314a..2a4afa1 100644 --- a/base/profiler/chrome_unwinder_android.cc +++ b/base/profiler/chrome_unwinder_android.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/profiler/chrome_unwinder_android.h" #include <algorithm>
diff --git a/base/profiler/chrome_unwinder_android_unittest.cc b/base/profiler/chrome_unwinder_android_unittest.cc index 731b60b2..89f639ea 100644 --- a/base/profiler/chrome_unwinder_android_unittest.cc +++ b/base/profiler/chrome_unwinder_android_unittest.cc
@@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifdef UNSAFE_BUFFERS_BUILD +// TODO(crbug.com/40284755): Remove this and use spans. +#pragma allow_unsafe_buffers +#endif + #include "base/profiler/chrome_unwinder_android.h" #include "base/memory/aligned_memory.h"
diff --git a/base/profiler/frame_pointer_unwinder.cc b/base/profiler/frame_pointer_unwinder.cc index c520ba3..372e5eef 100644 --- a/base/profiler/frame_pointer_unwinder.cc +++ b/base/profiler/frame_pointer_unwinder.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/profiler/frame_pointer_unwinder.h" #include "base/check_op.h"
diff --git a/base/profiler/module_cache_apple.cc b/base/profiler/module_cache_apple.cc index 29b90fa2f..5428779 100644 --- a/base/profiler/module_cache_apple.cc +++ b/base/profiler/module_cache_apple.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/profiler/module_cache.h" #include <dlfcn.h>
diff --git a/base/profiler/native_unwinder_android_unittest.cc b/base/profiler/native_unwinder_android_unittest.cc index c84b3e8..c32f66a 100644 --- a/base/profiler/native_unwinder_android_unittest.cc +++ b/base/profiler/native_unwinder_android_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/profiler/native_unwinder_android.h" #include <sys/mman.h>
diff --git a/base/profiler/register_context.h b/base/profiler/register_context.h index e034bd0..34a2ed48 100644 --- a/base/profiler/register_context.h +++ b/base/profiler/register_context.h
@@ -1,12 +1,7 @@ // Copyright 2019 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - +// // This file provides the RegisterContext cross-platform typedef that represents // the native register context for the platform, plus functions that provide // access to key registers in the context.
diff --git a/base/profiler/stack_buffer.cc b/base/profiler/stack_buffer.cc index ae866b8..a47cd04 100644 --- a/base/profiler/stack_buffer.cc +++ b/base/profiler/stack_buffer.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/profiler/stack_buffer.h" #include <bit>
diff --git a/base/profiler/stack_buffer_unittest.cc b/base/profiler/stack_buffer_unittest.cc index bf7d9352..7cef14c2 100644 --- a/base/profiler/stack_buffer_unittest.cc +++ b/base/profiler/stack_buffer_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/profiler/stack_buffer.h" #include "base/memory/aligned_memory.h"
diff --git a/base/profiler/stack_copier.cc b/base/profiler/stack_copier.cc index 16144dca..7d04c61 100644 --- a/base/profiler/stack_copier.cc +++ b/base/profiler/stack_copier.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/profiler/stack_copier.h" #include "base/bits.h"
diff --git a/base/profiler/stack_copier_signal_unittest.cc b/base/profiler/stack_copier_signal_unittest.cc index e7fa571..495edef 100644 --- a/base/profiler/stack_copier_signal_unittest.cc +++ b/base/profiler/stack_copier_signal_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <string.h> #include <algorithm> #include <utility>
diff --git a/base/profiler/stack_copier_suspend_unittest.cc b/base/profiler/stack_copier_suspend_unittest.cc index 9fe8776d..46de91d 100644 --- a/base/profiler/stack_copier_suspend_unittest.cc +++ b/base/profiler/stack_copier_suspend_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <algorithm> #include <cstring> #include <memory>
diff --git a/base/profiler/stack_copier_unittest.cc b/base/profiler/stack_copier_unittest.cc index 5cad54c6..2d6790f 100644 --- a/base/profiler/stack_copier_unittest.cc +++ b/base/profiler/stack_copier_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <cstring> #include <iterator> #include <memory>
diff --git a/base/profiler/stack_sampler_unittest.cc b/base/profiler/stack_sampler_unittest.cc index 3f6e41e..c5b9b5f 100644 --- a/base/profiler/stack_sampler_unittest.cc +++ b/base/profiler/stack_sampler_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <algorithm> #include <cstring> #include <iterator>
diff --git a/base/profiler/stack_sampling_profiler_test_util.cc b/base/profiler/stack_sampling_profiler_test_util.cc index 2beaba4..05be06ba 100644 --- a/base/profiler/stack_sampling_profiler_test_util.cc +++ b/base/profiler/stack_sampling_profiler_test_util.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/profiler/stack_sampling_profiler_test_util.h" #include <string_view>
diff --git a/base/profiler/suspendable_thread_delegate_mac.cc b/base/profiler/suspendable_thread_delegate_mac.cc index c8a042e..760a61c 100644 --- a/base/profiler/suspendable_thread_delegate_mac.cc +++ b/base/profiler/suspendable_thread_delegate_mac.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/profiler/suspendable_thread_delegate_mac.h" #include <mach/mach.h>
diff --git a/base/profiler/thread_delegate_posix.cc b/base/profiler/thread_delegate_posix.cc index fa21a28f..cc08595 100644 --- a/base/profiler/thread_delegate_posix.cc +++ b/base/profiler/thread_delegate_posix.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/profiler/thread_delegate_posix.h" #include <inttypes.h>
diff --git a/base/rand_util_fuchsia.cc b/base/rand_util_fuchsia.cc index b9bc7f1..ee94589 100644 --- a/base/rand_util_fuchsia.cc +++ b/base/rand_util_fuchsia.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/rand_util.h" #include <zircon/syscalls.h>
diff --git a/base/rand_util_posix.cc b/base/rand_util_posix.cc index f508322d..d186c28 100644 --- a/base/rand_util_posix.cc +++ b/base/rand_util_posix.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/rand_util.h" #include <errno.h>
diff --git a/base/rand_util_unittest.cc b/base/rand_util_unittest.cc index 0e4bfda..7f304e90 100644 --- a/base/rand_util_unittest.cc +++ b/base/rand_util_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/rand_util.h" #include <stddef.h>
diff --git a/base/rand_util_win.cc b/base/rand_util_win.cc index 2cb531c7..299e543 100644 --- a/base/rand_util_win.cc +++ b/base/rand_util_win.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/rand_util.h" #include <windows.h>
diff --git a/base/ranges/algorithm.h b/base/ranges/algorithm.h index 6dcf6af..6d86351 100644 --- a/base/ranges/algorithm.h +++ b/base/ranges/algorithm.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_RANGES_ALGORITHM_H_ #define BASE_RANGES_ALGORITHM_H_
diff --git a/base/ranges/algorithm_unittest.cc b/base/ranges/algorithm_unittest.cc index ab3b959..3bdbb300 100644 --- a/base/ranges/algorithm_unittest.cc +++ b/base/ranges/algorithm_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/ranges/algorithm.h" #include <algorithm>
diff --git a/base/ranges/ranges.h b/base/ranges/ranges.h index 8835ac3..2d8f23d7 100644 --- a/base/ranges/ranges.h +++ b/base/ranges/ranges.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_RANGES_RANGES_H_ #define BASE_RANGES_RANGES_H_
diff --git a/base/ranges/ranges_unittest.cc b/base/ranges/ranges_unittest.cc index b2fed08c..5d7493d 100644 --- a/base/ranges/ranges_unittest.cc +++ b/base/ranges/ranges_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/ranges/ranges.h" #include <array>
diff --git a/base/safe_numerics_unittest.cc b/base/safe_numerics_unittest.cc index d6ffcbd..daadf65 100644 --- a/base/safe_numerics_unittest.cc +++ b/base/safe_numerics_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <stddef.h> #include <stdint.h>
diff --git a/base/sampling_heap_profiler/sampling_heap_profiler.cc b/base/sampling_heap_profiler/sampling_heap_profiler.cc index 0361076..44e029a 100644 --- a/base/sampling_heap_profiler/sampling_heap_profiler.cc +++ b/base/sampling_heap_profiler/sampling_heap_profiler.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/sampling_heap_profiler/sampling_heap_profiler.h" #include <algorithm>
diff --git a/base/stack_canary_linux.cc b/base/stack_canary_linux.cc index f293f0f..ace6c11 100644 --- a/base/stack_canary_linux.cc +++ b/base/stack_canary_linux.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/stack_canary_linux.h" #include <dlfcn.h>
diff --git a/base/strings/escape.cc b/base/strings/escape.cc index c131d57..210f23a 100644 --- a/base/strings/escape.cc +++ b/base/strings/escape.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/escape.h" #include <ostream>
diff --git a/base/strings/latin1_string_conversions.cc b/base/strings/latin1_string_conversions.cc index 7210930..4261146 100644 --- a/base/strings/latin1_string_conversions.cc +++ b/base/strings/latin1_string_conversions.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/latin1_string_conversions.h" namespace base {
diff --git a/base/strings/pattern.cc b/base/strings/pattern.cc index ffa9e01..cc747aa 100644 --- a/base/strings/pattern.cc +++ b/base/strings/pattern.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/pattern.h" #include "base/third_party/icu/icu_utf.h"
diff --git a/base/strings/safe_sprintf.cc b/base/strings/safe_sprintf.cc index d3f5fa7..0afbb7ba 100644 --- a/base/strings/safe_sprintf.cc +++ b/base/strings/safe_sprintf.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/safe_sprintf.h" #include <errno.h>
diff --git a/base/strings/safe_sprintf_unittest.cc b/base/strings/safe_sprintf_unittest.cc index 60ced3c6..5ab8a9f 100644 --- a/base/strings/safe_sprintf_unittest.cc +++ b/base/strings/safe_sprintf_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/safe_sprintf.h" #include <stddef.h>
diff --git a/base/strings/strcat_internal.h b/base/strings/strcat_internal.h index 0cd3b12..f54b069 100644 --- a/base/strings/strcat_internal.h +++ b/base/strings/strcat_internal.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_STRINGS_STRCAT_INTERNAL_H_ #define BASE_STRINGS_STRCAT_INTERNAL_H_
diff --git a/base/strings/string_number_conversions.h b/base/strings/string_number_conversions.h index c59423f0..55c28d66 100644 --- a/base/strings/string_number_conversions.h +++ b/base/strings/string_number_conversions.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_STRINGS_STRING_NUMBER_CONVERSIONS_H_ #define BASE_STRINGS_STRING_NUMBER_CONVERSIONS_H_
diff --git a/base/strings/string_number_conversions_internal.h b/base/strings/string_number_conversions_internal.h index edf71f0..a7981e66 100644 --- a/base/strings/string_number_conversions_internal.h +++ b/base/strings/string_number_conversions_internal.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_STRINGS_STRING_NUMBER_CONVERSIONS_INTERNAL_H_ #define BASE_STRINGS_STRING_NUMBER_CONVERSIONS_INTERNAL_H_
diff --git a/base/strings/string_number_conversions_unittest.cc b/base/strings/string_number_conversions_unittest.cc index 9b03835f5..421b443 100644 --- a/base/strings/string_number_conversions_unittest.cc +++ b/base/strings/string_number_conversions_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/string_number_conversions.h" #include <errno.h>
diff --git a/base/strings/string_piece_unittest.cc b/base/strings/string_piece_unittest.cc index 2e4a0a2..7a082f0 100644 --- a/base/strings/string_piece_unittest.cc +++ b/base/strings/string_piece_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <stddef.h> #include <string>
diff --git a/base/strings/string_tokenizer.h b/base/strings/string_tokenizer.h index 89b20b05..5d4e8bc 100644 --- a/base/strings/string_tokenizer.h +++ b/base/strings/string_tokenizer.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_STRINGS_STRING_TOKENIZER_H_ #define BASE_STRINGS_STRING_TOKENIZER_H_
diff --git a/base/strings/string_tokenizer_fuzzer.cc b/base/strings/string_tokenizer_fuzzer.cc index 4c78568..55fcd8f 100644 --- a/base/strings/string_tokenizer_fuzzer.cc +++ b/base/strings/string_tokenizer_fuzzer.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <stddef.h> #include <stdint.h>
diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc index 3221c67..ca5d9ff 100644 --- a/base/strings/string_util.cc +++ b/base/strings/string_util.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/string_util.h" #include <errno.h>
diff --git a/base/strings/string_util.h b/base/strings/string_util.h index 07b31fa..f1a9b7b 100644 --- a/base/strings/string_util.h +++ b/base/strings/string_util.h
@@ -4,11 +4,6 @@ // // This file defines utility functions for working with strings. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_STRINGS_STRING_UTIL_H_ #define BASE_STRINGS_STRING_UTIL_H_
diff --git a/base/strings/string_util_impl_helpers.h b/base/strings/string_util_impl_helpers.h index ecf2911..96140e82 100644 --- a/base/strings/string_util_impl_helpers.h +++ b/base/strings/string_util_impl_helpers.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_STRINGS_STRING_UTIL_IMPL_HELPERS_H_ #define BASE_STRINGS_STRING_UTIL_IMPL_HELPERS_H_
diff --git a/base/strings/string_util_unittest.cc b/base/strings/string_util_unittest.cc index eb2b0e4..e862fb51 100644 --- a/base/strings/string_util_unittest.cc +++ b/base/strings/string_util_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/string_util.h" #include <math.h>
diff --git a/base/strings/stringprintf_unittest.cc b/base/strings/stringprintf_unittest.cc index 51ac583..93e8b67 100644 --- a/base/strings/stringprintf_unittest.cc +++ b/base/strings/stringprintf_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/stringprintf.h" #include <errno.h>
diff --git a/base/strings/sys_string_conversions_posix.cc b/base/strings/sys_string_conversions_posix.cc index 8772b5b..82215c5 100644 --- a/base/strings/sys_string_conversions_posix.cc +++ b/base/strings/sys_string_conversions_posix.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/sys_string_conversions.h" #include <stddef.h>
diff --git a/base/strings/utf_offset_string_conversions_unittest.cc b/base/strings/utf_offset_string_conversions_unittest.cc index 537167c..932a072 100644 --- a/base/strings/utf_offset_string_conversions_unittest.cc +++ b/base/strings/utf_offset_string_conversions_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/utf_offset_string_conversions.h" #include <stddef.h>
diff --git a/base/strings/utf_string_conversion_utils.cc b/base/strings/utf_string_conversion_utils.cc index 6dc798f..38d54b9a 100644 --- a/base/strings/utf_string_conversion_utils.cc +++ b/base/strings/utf_string_conversion_utils.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/utf_string_conversion_utils.h" #include "base/third_party/icu/icu_utf.h"
diff --git a/base/strings/utf_string_conversions.cc b/base/strings/utf_string_conversions.cc index eb9365c2..feca3b3 100644 --- a/base/strings/utf_string_conversions.cc +++ b/base/strings/utf_string_conversions.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/strings/utf_string_conversions.h" #include <limits.h>
diff --git a/base/substring_set_matcher/substring_set_matcher.cc b/base/substring_set_matcher/substring_set_matcher.cc index 7837f7a..7e228d3 100644 --- a/base/substring_set_matcher/substring_set_matcher.cc +++ b/base/substring_set_matcher/substring_set_matcher.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/substring_set_matcher/substring_set_matcher.h" #include <stddef.h>
diff --git a/base/substring_set_matcher/substring_set_matcher.h b/base/substring_set_matcher/substring_set_matcher.h index 195822239..3dd00dc 100644 --- a/base/substring_set_matcher/substring_set_matcher.h +++ b/base/substring_set_matcher/substring_set_matcher.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_SUBSTRING_SET_MATCHER_SUBSTRING_SET_MATCHER_H_ #define BASE_SUBSTRING_SET_MATCHER_SUBSTRING_SET_MATCHER_H_
diff --git a/base/sync_socket_posix.cc b/base/sync_socket_posix.cc index 34ef872..0a8d673f 100644 --- a/base/sync_socket_posix.cc +++ b/base/sync_socket_posix.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/sync_socket.h" #include <errno.h>
diff --git a/base/sync_socket_unittest.cc b/base/sync_socket_unittest.cc index a3a6739..6e6ead4 100644 --- a/base/sync_socket_unittest.cc +++ b/base/sync_socket_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/sync_socket.h" #include "base/memory/raw_ptr.h"
diff --git a/base/sync_socket_win.cc b/base/sync_socket_win.cc index b658d07..defc8aa 100644 --- a/base/sync_socket_win.cc +++ b/base/sync_socket_win.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/sync_socket.h" #include <limits.h>
diff --git a/base/synchronization/waitable_event.cc b/base/synchronization/waitable_event.cc index 0f63410..9089ba4 100644 --- a/base/synchronization/waitable_event.cc +++ b/base/synchronization/waitable_event.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/synchronization/waitable_event.h" #include "base/check.h"
diff --git a/base/synchronization/waitable_event_apple.cc b/base/synchronization/waitable_event_apple.cc index c7dd4bb..080c5db 100644 --- a/base/synchronization/waitable_event_apple.cc +++ b/base/synchronization/waitable_event_apple.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/synchronization/waitable_event.h" #include <mach/mach.h>
diff --git a/base/synchronization/waitable_event_posix.cc b/base/synchronization/waitable_event_posix.cc index 4c204c4..fa7928b5 100644 --- a/base/synchronization/waitable_event_posix.cc +++ b/base/synchronization/waitable_event_posix.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/synchronization/waitable_event.h" #include <stddef.h>
diff --git a/base/synchronization/waitable_event_unittest.cc b/base/synchronization/waitable_event_unittest.cc index d9bc7b0..95053c4 100644 --- a/base/synchronization/waitable_event_unittest.cc +++ b/base/synchronization/waitable_event_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/synchronization/waitable_event.h" #include <stddef.h>
diff --git a/base/synchronization/waitable_event_win.cc b/base/synchronization/waitable_event_win.cc index c6a6471..a3d403dc 100644 --- a/base/synchronization/waitable_event_win.cc +++ b/base/synchronization/waitable_event_win.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/synchronization/waitable_event.h" #include <windows.h>
diff --git a/base/system/sys_info_chromeos.cc b/base/system/sys_info_chromeos.cc index b6b0f5b..3f8c6b5 100644 --- a/base/system/sys_info_chromeos.cc +++ b/base/system/sys_info_chromeos.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/system/sys_info.h" #include <stddef.h>
diff --git a/base/system/sys_info_win.cc b/base/system/sys_info_win.cc index 4ec2986..0ceb85a 100644 --- a/base/system/sys_info_win.cc +++ b/base/system/sys_info_win.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/system/sys_info.h" #include <windows.h>
diff --git a/base/system/system_monitor_unittest.cc b/base/system/system_monitor_unittest.cc index 30913a8d..3b8a6fc2 100644 --- a/base/system/system_monitor_unittest.cc +++ b/base/system/system_monitor_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <memory> #include "base/system/system_monitor.h"
diff --git a/base/task/post_job_unittest.cc b/base/task/post_job_unittest.cc index 307cfa7..143b1f6 100644 --- a/base/task/post_job_unittest.cc +++ b/base/task/post_job_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/task/post_job.h" #include <atomic>
diff --git a/base/task/sequence_manager/atomic_flag_set.cc b/base/task/sequence_manager/atomic_flag_set.cc index e707bab..5d405c2 100644 --- a/base/task/sequence_manager/atomic_flag_set.cc +++ b/base/task/sequence_manager/atomic_flag_set.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/task/sequence_manager/atomic_flag_set.h" #include <bit>
diff --git a/base/task/sequence_manager/sequence_manager_impl.cc b/base/task/sequence_manager/sequence_manager_impl.cc index 417229d..829e999 100644 --- a/base/task/sequence_manager/sequence_manager_impl.cc +++ b/base/task/sequence_manager/sequence_manager_impl.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/task/sequence_manager/sequence_manager_impl.h" #include <array>
diff --git a/base/task/sequence_manager/task_queue_selector_unittest.cc b/base/task/sequence_manager/task_queue_selector_unittest.cc index a9d1a2fe..5fc46f9 100644 --- a/base/task/sequence_manager/task_queue_selector_unittest.cc +++ b/base/task/sequence_manager/task_queue_selector_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/task/sequence_manager/task_queue_selector.h" #include <stddef.h>
diff --git a/base/task/sequence_manager/thread_controller_with_message_pump_impl_unittest.cc b/base/task/sequence_manager/thread_controller_with_message_pump_impl_unittest.cc index a9fe599..e4489af 100644 --- a/base/task/sequence_manager/thread_controller_with_message_pump_impl_unittest.cc +++ b/base/task/sequence_manager/thread_controller_with_message_pump_impl_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h" #include <optional>
diff --git a/base/task/sequence_manager/work_queue_sets_unittest.cc b/base/task/sequence_manager/work_queue_sets_unittest.cc index c7968c7..6f7ea1f7 100644 --- a/base/task/sequence_manager/work_queue_sets_unittest.cc +++ b/base/task/sequence_manager/work_queue_sets_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/task/sequence_manager/work_queue_sets.h" #include <stddef.h>
diff --git a/base/task/thread_pool/pooled_single_thread_task_runner_manager.cc b/base/task/thread_pool/pooled_single_thread_task_runner_manager.cc index 4d49a379..2dd617d 100644 --- a/base/task/thread_pool/pooled_single_thread_task_runner_manager.cc +++ b/base/task/thread_pool/pooled_single_thread_task_runner_manager.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/task/thread_pool/pooled_single_thread_task_runner_manager.h" #include <memory>
diff --git a/base/task/thread_pool/task_source_sort_key_unittest.cc b/base/task/thread_pool/task_source_sort_key_unittest.cc index 4572267..095d47d6 100644 --- a/base/task/thread_pool/task_source_sort_key_unittest.cc +++ b/base/task/thread_pool/task_source_sort_key_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/task/thread_pool/task_source_sort_key.h" #include <iterator>
diff --git a/base/task/thread_pool/thread_pool_impl_unittest.cc b/base/task/thread_pool/thread_pool_impl_unittest.cc index edbc01f7..a014bfc 100644 --- a/base/task/thread_pool/thread_pool_impl_unittest.cc +++ b/base/task/thread_pool/thread_pool_impl_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/task/thread_pool/thread_pool_impl.h" #include <stddef.h>
diff --git a/base/test/gmock_expected_support_unittest.cc b/base/test/gmock_expected_support_unittest.cc index 4734ad1e..8776a624 100644 --- a/base/test/gmock_expected_support_unittest.cc +++ b/base/test/gmock_expected_support_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/test/gmock_expected_support.h" #include <string>
diff --git a/base/test/gtest_xml_unittest_result_printer.cc b/base/test/gtest_xml_unittest_result_printer.cc index 9358480..fdd83ff7 100644 --- a/base/test/gtest_xml_unittest_result_printer.cc +++ b/base/test/gtest_xml_unittest_result_printer.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/test/gtest_xml_unittest_result_printer.h" #include "base/base64.h"
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc index 633a4875..9fcc6a8f 100644 --- a/base/test/launcher/test_launcher.cc +++ b/base/test/launcher/test_launcher.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/test/launcher/test_launcher.h" #include <stdio.h>
diff --git a/base/test/launcher/test_results_tracker.cc b/base/test/launcher/test_results_tracker.cc index 29413172..2b11316 100644 --- a/base/test/launcher/test_results_tracker.cc +++ b/base/test/launcher/test_results_tracker.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/test/launcher/test_results_tracker.h" #include <stddef.h>
diff --git a/base/test/perf_log.cc b/base/test/perf_log.cc index 14d4c74..9b63f96 100644 --- a/base/test/perf_log.cc +++ b/base/test/perf_log.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/test/perf_log.h" #include "base/files/file_util.h"
diff --git a/base/test/test_child_process.cc b/base/test/test_child_process.cc index 095d9d14..56bdecb 100644 --- a/base/test/test_child_process.cc +++ b/base/test/test_child_process.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <stdio.h> #include <stdlib.h> #include <string.h>
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc index d4f76e1..0d7330e 100644 --- a/base/test/test_suite.cc +++ b/base/test/test_suite.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/test/test_suite.h" #include <signal.h>
diff --git a/base/test/test_timeouts.cc b/base/test/test_timeouts.cc index 8198218..2abfc7b 100644 --- a/base/test/test_timeouts.cc +++ b/base/test/test_timeouts.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/test/test_timeouts.h" #include <algorithm>
diff --git a/base/test/with_feature_override.cc b/base/test/with_feature_override.cc index f64fe9d1..ee84abd 100644 --- a/base/test/with_feature_override.cc +++ b/base/test/with_feature_override.cc
@@ -22,7 +22,7 @@ } } -bool WithFeatureOverride::IsParamFeatureEnabled() { +bool WithFeatureOverride::IsParamFeatureEnabled() const { return GetParam(); }
diff --git a/base/test/with_feature_override.h b/base/test/with_feature_override.h index e396c2a..af09131 100644 --- a/base/test/with_feature_override.h +++ b/base/test/with_feature_override.h
@@ -45,7 +45,7 @@ // Use to know if the configured feature provided in the constructor is // enabled or not. - bool IsParamFeatureEnabled(); + bool IsParamFeatureEnabled() const; private: base::test::ScopedFeatureList scoped_feature_list_;
diff --git a/base/threading/platform_thread_unittest.cc b/base/threading/platform_thread_unittest.cc index 62405e11..ec57b267 100644 --- a/base/threading/platform_thread_unittest.cc +++ b/base/threading/platform_thread_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/threading/platform_thread.h" #include <stddef.h>
diff --git a/base/threading/scoped_blocking_call_internal.cc b/base/threading/scoped_blocking_call_internal.cc index fad2090..695e743 100644 --- a/base/threading/scoped_blocking_call_internal.cc +++ b/base/threading/scoped_blocking_call_internal.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/threading/scoped_blocking_call_internal.h" #include <algorithm>
diff --git a/base/threading/scoped_blocking_call_unittest.cc b/base/threading/scoped_blocking_call_unittest.cc index fc92e64..fd65a9458 100644 --- a/base/threading/scoped_blocking_call_unittest.cc +++ b/base/threading/scoped_blocking_call_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/threading/scoped_blocking_call.h" #include <memory>
diff --git a/base/threading/sequence_local_storage_slot_unittest.cc b/base/threading/sequence_local_storage_slot_unittest.cc index 3410319..52c606e 100644 --- a/base/threading/sequence_local_storage_slot_unittest.cc +++ b/base/threading/sequence_local_storage_slot_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/threading/sequence_local_storage_slot.h" #include <utility>
diff --git a/base/threading/thread_local_storage.cc b/base/threading/thread_local_storage.cc index 0303a121..8dc21cdc 100644 --- a/base/threading/thread_local_storage.cc +++ b/base/threading/thread_local_storage.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/threading/thread_local_storage.h" #include <algorithm>
diff --git a/base/threading/thread_local_storage_unittest.cc b/base/threading/thread_local_storage_unittest.cc index 8a65ac80..c51b390 100644 --- a/base/threading/thread_local_storage_unittest.cc +++ b/base/threading/thread_local_storage_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/threading/thread_local_storage.h" #include "base/memory/raw_ptr.h"
diff --git a/base/time/time_win_unittest.cc b/base/time/time_win_unittest.cc index f72cca0d..df0b6fca 100644 --- a/base/time/time_win_unittest.cc +++ b/base/time/time_win_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/time/time.h" #include <windows.h>
diff --git a/base/token.cc b/base/token.cc index 3ad4428..ccdb1709 100644 --- a/base/token.cc +++ b/base/token.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/token.h" #include <inttypes.h>
diff --git a/base/token.h b/base/token.h index 2d9d039..faa2dde 100644 --- a/base/token.h +++ b/base/token.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_TOKEN_H_ #define BASE_TOKEN_H_
diff --git a/base/tools_sanity_unittest.cc b/base/tools_sanity_unittest.cc index d29572ba..2817c98 100644 --- a/base/tools_sanity_unittest.cc +++ b/base/tools_sanity_unittest.cc
@@ -1,12 +1,7 @@ // 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. - -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - +// // This file contains intentional memory errors, some of which may lead to // crashes if the test is ran without special memory testing tools. We use these // errors to verify the sanity of the tools.
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h index e1a44c5..9ed5e18f 100644 --- a/base/trace_event/builtin_categories.h +++ b/base/trace_event/builtin_categories.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_TRACE_EVENT_BUILTIN_CATEGORIES_H_ #define BASE_TRACE_EVENT_BUILTIN_CATEGORIES_H_
diff --git a/base/trace_event/category_registry.cc b/base/trace_event/category_registry.cc index e487354..73e4179 100644 --- a/base/trace_event/category_registry.cc +++ b/base/trace_event/category_registry.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/category_registry.h" #include <string.h>
diff --git a/base/trace_event/category_registry.h b/base/trace_event/category_registry.h index 7b5ef21..8a1c06d5 100644 --- a/base/trace_event/category_registry.h +++ b/base/trace_event/category_registry.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_TRACE_EVENT_CATEGORY_REGISTRY_H_ #define BASE_TRACE_EVENT_CATEGORY_REGISTRY_H_
diff --git a/base/trace_event/cfi_backtrace_android.cc b/base/trace_event/cfi_backtrace_android.cc index 74e46641..7118194 100644 --- a/base/trace_event/cfi_backtrace_android.cc +++ b/base/trace_event/cfi_backtrace_android.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/cfi_backtrace_android.h" #include <sys/mman.h>
diff --git a/base/trace_event/cfi_backtrace_android_unittest.cc b/base/trace_event/cfi_backtrace_android_unittest.cc index 757a99f..1d150b4 100644 --- a/base/trace_event/cfi_backtrace_android_unittest.cc +++ b/base/trace_event/cfi_backtrace_android_unittest.cc
@@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifdef UNSAFE_BUFFERS_BUILD +// TODO(crbug.com/40284755): Remove this and use spans. +#pragma allow_unsafe_buffers +#endif + #include "base/trace_event/cfi_backtrace_android.h" #include "base/files/file_util.h"
diff --git a/base/trace_event/cpufreq_monitor_android.cc b/base/trace_event/cpufreq_monitor_android.cc index 64aa665..48d773f 100644 --- a/base/trace_event/cpufreq_monitor_android.cc +++ b/base/trace_event/cpufreq_monitor_android.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/cpufreq_monitor_android.h" #include <fcntl.h>
diff --git a/base/trace_event/heap_profiler_allocation_context.cc b/base/trace_event/heap_profiler_allocation_context.cc index 9c38bbe..377929f 100644 --- a/base/trace_event/heap_profiler_allocation_context.cc +++ b/base/trace_event/heap_profiler_allocation_context.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/heap_profiler_allocation_context.h" #include <algorithm>
diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc index 55a654f..d0da628b 100644 --- a/base/trace_event/malloc_dump_provider.cc +++ b/base/trace_event/malloc_dump_provider.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/malloc_dump_provider.h" #include <stddef.h>
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc index deca421..70e5443 100644 --- a/base/trace_event/memory_dump_manager.cc +++ b/base/trace_event/memory_dump_manager.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/memory_dump_manager.h" #include <inttypes.h>
diff --git a/base/trace_event/memory_infra_background_allowlist.cc b/base/trace_event/memory_infra_background_allowlist.cc index 389d2f3..62990290 100644 --- a/base/trace_event/memory_infra_background_allowlist.cc +++ b/base/trace_event/memory_infra_background_allowlist.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/memory_infra_background_allowlist.h" #include <string.h>
diff --git a/base/trace_event/memory_usage_estimator.h b/base/trace_event/memory_usage_estimator.h index e5306664..d4b8b9d 100644 --- a/base/trace_event/memory_usage_estimator.h +++ b/base/trace_event/memory_usage_estimator.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_TRACE_EVENT_MEMORY_USAGE_ESTIMATOR_H_ #define BASE_TRACE_EVENT_MEMORY_USAGE_ESTIMATOR_H_
diff --git a/base/trace_event/process_memory_dump.cc b/base/trace_event/process_memory_dump.cc index 3ac1a676..7856fb7 100644 --- a/base/trace_event/process_memory_dump.cc +++ b/base/trace_event/process_memory_dump.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/process_memory_dump.h" #include <errno.h>
diff --git a/base/trace_event/trace_arguments.cc b/base/trace_event/trace_arguments.cc index 9626a022..81c5306 100644 --- a/base/trace_event/trace_arguments.cc +++ b/base/trace_event/trace_arguments.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/trace_arguments.h" #include <inttypes.h>
diff --git a/base/trace_event/trace_arguments.h b/base/trace_event/trace_arguments.h index 5deccada..03ed6710 100644 --- a/base/trace_event/trace_arguments.h +++ b/base/trace_event/trace_arguments.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_TRACE_EVENT_TRACE_ARGUMENTS_H_ #define BASE_TRACE_EVENT_TRACE_ARGUMENTS_H_
diff --git a/base/trace_event/trace_arguments_unittest.cc b/base/trace_event/trace_arguments_unittest.cc index c166c906..be06300 100644 --- a/base/trace_event/trace_arguments_unittest.cc +++ b/base/trace_event/trace_arguments_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/trace_arguments.h" #include <gtest/gtest.h>
diff --git a/base/trace_event/trace_buffer.cc b/base/trace_event/trace_buffer.cc index 39d1875..b3b8692 100644 --- a/base/trace_event/trace_buffer.cc +++ b/base/trace_event/trace_buffer.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/trace_buffer.h" #include <memory>
diff --git a/base/trace_event/trace_buffer.h b/base/trace_event/trace_buffer.h index ea213983..19bd133 100644 --- a/base/trace_event/trace_buffer.h +++ b/base/trace_event/trace_buffer.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_TRACE_EVENT_TRACE_BUFFER_H_ #define BASE_TRACE_EVENT_TRACE_BUFFER_H_
diff --git a/base/trace_event/trace_category_unittest.cc b/base/trace_event/trace_category_unittest.cc index f2ac51f..4d4d0bf1 100644 --- a/base/trace_event/trace_category_unittest.cc +++ b/base/trace_event/trace_category_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include <string.h> #include <memory>
diff --git a/base/trace_event/trace_event_etw_export_win.cc b/base/trace_event/trace_event_etw_export_win.cc index 99293cd5..dc6fccb1 100644 --- a/base/trace_event/trace_event_etw_export_win.cc +++ b/base/trace_event/trace_event_etw_export_win.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/trace_event_etw_export_win.h" #include <windows.h>
diff --git a/base/trace_event/trace_event_etw_export_win.h b/base/trace_event/trace_event_etw_export_win.h index 96d39b3d..119ee4f 100644 --- a/base/trace_event/trace_event_etw_export_win.h +++ b/base/trace_event/trace_event_etw_export_win.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // This file contains the Windows-specific exporting to ETW. #ifndef BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_ #define BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_
diff --git a/base/trace_event/trace_event_impl.h b/base/trace_event/trace_event_impl.h index 8a2bdce1..3c4fae7 100644 --- a/base/trace_event/trace_event_impl.h +++ b/base/trace_event/trace_event_impl.h
@@ -2,10 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif #ifndef BASE_TRACE_EVENT_TRACE_EVENT_IMPL_H_ #define BASE_TRACE_EVENT_TRACE_EVENT_IMPL_H_
diff --git a/base/trace_event/trace_event_memory_overhead.cc b/base/trace_event/trace_event_memory_overhead.cc index 69998f2..0c2dfc8 100644 --- a/base/trace_event/trace_event_memory_overhead.cc +++ b/base/trace_event/trace_event_memory_overhead.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/trace_event_memory_overhead.h" #include <algorithm>
diff --git a/base/trace_event/trace_event_unittest.cc b/base/trace_event/trace_event_unittest.cc index e91699c..c9711b9 100644 --- a/base/trace_event/trace_event_unittest.cc +++ b/base/trace_event/trace_event_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/trace_event.h" #include <inttypes.h>
diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc index 6414640..8465a63 100644 --- a/base/trace_event/trace_log.cc +++ b/base/trace_event/trace_log.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/trace_log.h" #include <cmath>
diff --git a/base/trace_event/trace_logging_minimal_win.cc b/base/trace_event/trace_logging_minimal_win.cc index 64cdb54..5e3aa3c 100644 --- a/base/trace_event/trace_logging_minimal_win.cc +++ b/base/trace_event/trace_logging_minimal_win.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/trace_logging_minimal_win.h" #include <evntrace.h>
diff --git a/base/trace_event/trace_logging_minimal_win.h b/base/trace_event/trace_logging_minimal_win.h index 175ffa80..8c517f3 100644 --- a/base/trace_event/trace_logging_minimal_win.h +++ b/base/trace_event/trace_logging_minimal_win.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_TRACE_EVENT_TRACE_LOGGING_MINIMAL_WIN_H_ #define BASE_TRACE_EVENT_TRACE_LOGGING_MINIMAL_WIN_H_
diff --git a/base/trace_event/traced_value.cc b/base/trace_event/traced_value.cc index df17fa8..d8228d0 100644 --- a/base/trace_event/traced_value.cc +++ b/base/trace_event/traced_value.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/traced_value.h" #include <inttypes.h>
diff --git a/base/trace_event/traced_value_unittest.cc b/base/trace_event/traced_value_unittest.cc index fbd95ca..b68a9fde 100644 --- a/base/trace_event/traced_value_unittest.cc +++ b/base/trace_event/traced_value_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/trace_event/traced_value.h" #include <cmath>
diff --git a/base/types/expected_macros_perftest.cc b/base/types/expected_macros_perftest.cc index c257746..e7524bfb 100644 --- a/base/types/expected_macros_perftest.cc +++ b/base/types/expected_macros_perftest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/types/expected_macros.h" #include <stddef.h>
diff --git a/base/types/expected_macros_unittest.cc b/base/types/expected_macros_unittest.cc index 695f84d0..33f7d82 100644 --- a/base/types/expected_macros_unittest.cc +++ b/base/types/expected_macros_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/types/expected_macros.h" #include <memory>
diff --git a/base/values.cc b/base/values.cc index d66a2e1a..619ddbce 100644 --- a/base/values.cc +++ b/base/values.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/values.h" #include <cmath>
diff --git a/base/values_unittest.cc b/base/values_unittest.cc index 5a43d5d..953bc60 100644 --- a/base/values_unittest.cc +++ b/base/values_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/values.h" #include <stddef.h>
diff --git a/base/win/access_control_list_unittest.cc b/base/win/access_control_list_unittest.cc index 951dc0b..0cbea70 100644 --- a/base/win/access_control_list_unittest.cc +++ b/base/win/access_control_list_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/access_control_list.h" // clang-format off
diff --git a/base/win/access_token.cc b/base/win/access_token.cc index 72b092e6..2e309daa 100644 --- a/base/win/access_token.cc +++ b/base/win/access_token.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/access_token.h" #include <windows.h>
diff --git a/base/win/com_init_check_hook.cc b/base/win/com_init_check_hook.cc index 3d7841e..598c86cc 100644 --- a/base/win/com_init_check_hook.cc +++ b/base/win/com_init_check_hook.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/com_init_check_hook.h" #include <objbase.h>
diff --git a/base/win/dllmain.cc b/base/win/dllmain.cc index 1d6a2ed2db..0c5546f 100644 --- a/base/win/dllmain.cc +++ b/base/win/dllmain.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // Windows doesn't support pthread_key_create's destr_function, and in fact // it's a bit tricky to get code to run when a thread exits. This is // cargo-cult magic from http://www.codeproject.com/threads/tls.asp.
diff --git a/base/win/enum_variant.cc b/base/win/enum_variant.cc index a168b4d..aaabe72 100644 --- a/base/win/enum_variant.cc +++ b/base/win/enum_variant.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/enum_variant.h" #include <wrl/client.h>
diff --git a/base/win/enum_variant_unittest.cc b/base/win/enum_variant_unittest.cc index 7eaaab0..264167db 100644 --- a/base/win/enum_variant_unittest.cc +++ b/base/win/enum_variant_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/enum_variant.h" #include <wrl/client.h>
diff --git a/base/win/event_trace_controller.cc b/base/win/event_trace_controller.cc index 5630e28..e44ed3e6 100644 --- a/base/win/event_trace_controller.cc +++ b/base/win/event_trace_controller.cc
@@ -1,12 +1,7 @@ // Copyright 2009 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - +// // Implementation of a Windows event trace controller class. #include "base/win/event_trace_controller.h"
diff --git a/base/win/event_trace_controller.h b/base/win/event_trace_controller.h index e749016..46bfde0 100644 --- a/base/win/event_trace_controller.h +++ b/base/win/event_trace_controller.h
@@ -1,12 +1,7 @@ // Copyright 2011 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - +// // Declaration of a Windows event trace controller class. // The controller takes care of creating and manipulating event trace // sessions.
diff --git a/base/win/event_trace_provider.h b/base/win/event_trace_provider.h index ea4249f0..a680ba8 100644 --- a/base/win/event_trace_provider.h +++ b/base/win/event_trace_provider.h
@@ -1,12 +1,7 @@ // Copyright 2011 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - +// // Declaration of a Windows event trace provider class, to allow using // Windows Event Tracing for logging transport and control. #ifndef BASE_WIN_EVENT_TRACE_PROVIDER_H_
diff --git a/base/win/pe_image.cc b/base/win/pe_image.cc index 34180da..7aad8ae 100644 --- a/base/win/pe_image.cc +++ b/base/win/pe_image.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // This file implements PEImage, a generic class to manipulate PE files. // This file was adapted from GreenBorder's Code.
diff --git a/base/win/pe_image_reader.cc b/base/win/pe_image_reader.cc index 17c4a09..05ecc12 100644 --- a/base/win/pe_image_reader.cc +++ b/base/win/pe_image_reader.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/pe_image_reader.h" #include <wintrust.h>
diff --git a/base/win/pe_image_reader_unittest.cc b/base/win/pe_image_reader_unittest.cc index 553d55e..f13a012 100644 --- a/base/win/pe_image_reader_unittest.cc +++ b/base/win/pe_image_reader_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/pe_image_reader.h" #include <windows.h>
diff --git a/base/win/registry_unittest.cc b/base/win/registry_unittest.cc index 65f0f584..cea15e4d 100644 --- a/base/win/registry_unittest.cc +++ b/base/win/registry_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/registry.h" #include <windows.h>
diff --git a/base/win/scoped_bstr.cc b/base/win/scoped_bstr.cc index af6f977..1927dd0 100644 --- a/base/win/scoped_bstr.cc +++ b/base/win/scoped_bstr.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/scoped_bstr.h" #include <stdint.h>
diff --git a/base/win/scoped_handle_verifier.h b/base/win/scoped_handle_verifier.h index 7224b06..2925136 100644 --- a/base/win/scoped_handle_verifier.h +++ b/base/win/scoped_handle_verifier.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_WIN_SCOPED_HANDLE_VERIFIER_H_ #define BASE_WIN_SCOPED_HANDLE_VERIFIER_H_
diff --git a/base/win/scoped_hglobal.h b/base/win/scoped_hglobal.h index 9cf1649..00629915 100644 --- a/base/win/scoped_hglobal.h +++ b/base/win/scoped_hglobal.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_WIN_SCOPED_HGLOBAL_H_ #define BASE_WIN_SCOPED_HGLOBAL_H_
diff --git a/base/win/scoped_safearray.h b/base/win/scoped_safearray.h index 86b356743..cd9e604 100644 --- a/base/win/scoped_safearray.h +++ b/base/win/scoped_safearray.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_WIN_SCOPED_SAFEARRAY_H_ #define BASE_WIN_SCOPED_SAFEARRAY_H_
diff --git a/base/win/scoped_safearray_unittest.cc b/base/win/scoped_safearray_unittest.cc index 3a534e9..e1de0d93 100644 --- a/base/win/scoped_safearray_unittest.cc +++ b/base/win/scoped_safearray_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/scoped_safearray.h" #include <stddef.h>
diff --git a/base/win/sid.cc b/base/win/sid.cc index 181677c7..ccaf033 100644 --- a/base/win/sid.cc +++ b/base/win/sid.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/sid.h" // clang-format off
diff --git a/base/win/sid_unittest.cc b/base/win/sid_unittest.cc index 097026e..edc3d43 100644 --- a/base/win/sid_unittest.cc +++ b/base/win/sid_unittest.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - // This file contains unit tests for the sid class. #include "base/win/sid.h"
diff --git a/base/win/variant_vector.cc b/base/win/variant_vector.cc index 9722481..55ba46f 100644 --- a/base/win/variant_vector.cc +++ b/base/win/variant_vector.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/variant_vector.h" #include <optional>
diff --git a/base/win/win_util.cc b/base/win/win_util.cc index 754936d..a896b2ab 100644 --- a/base/win/win_util.cc +++ b/base/win/win_util.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #include "base/win/win_util.h" #include <objbase.h>
diff --git a/base/win/winrt_foundation_helpers.h b/base/win/winrt_foundation_helpers.h index e5154c0..2f17e68 100644 --- a/base/win/winrt_foundation_helpers.h +++ b/base/win/winrt_foundation_helpers.h
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/40284755): Remove this and spanify to fix the errors. -#pragma allow_unsafe_buffers -#endif - #ifndef BASE_WIN_WINRT_FOUNDATION_HELPERS_H_ #define BASE_WIN_WINRT_FOUNDATION_HELPERS_H_
diff --git a/build/android/pylib/local/emulator/local_emulator_environment.py b/build/android/pylib/local/emulator/local_emulator_environment.py index 518f8e5..b5dd350a 100644 --- a/build/android/pylib/local/emulator/local_emulator_environment.py +++ b/build/android/pylib/local/emulator/local_emulator_environment.py
@@ -43,6 +43,7 @@ self._emulator_instances = [] self._device_serials = [] + self._emulator_start_timeout = 60 #override def SetUp(self): @@ -53,6 +54,10 @@ for _ in range(self._emulator_count) ] + if 'car' in self._avd_config.avd_name or self._writable_system: + logging.info("Use longer timeout for AVD") + self._emulator_start_timeout = 120 + def start_emulator_instance(inst): def is_timeout_error(exc): return isinstance( @@ -72,12 +77,13 @@ except base_error.BaseError as e: # Timeout error usually indicates the emulator is not responding. # In this case, we should stop it forcely. + logging.info("Force stop the emulator") inst.Stop(force=is_timeout_error(e)) raise return inst return timeout_retry.Run(impl, - timeout=120 if self._writable_system else 60, + timeout=self._emulator_start_timeout, retries=2, args=[inst], retry_if_func=is_timeout_error)
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni index fcfe27c..f508cad 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni
@@ -4034,12 +4034,6 @@ } } - if (_skip_header_jar) { - group(_header_target_name) { - public_deps = [ ":$_compile_java_target" ] - } - } - if (_enable_errorprone) { _compile_java_errorprone_target = "${_main_target_name}__errorprone" compile_java_helper(_compile_java_errorprone_target) { @@ -4216,6 +4210,12 @@ _process_device_jar_deps = _unprocessed_jar_deps } + if (_skip_header_jar) { + group(_header_target_name) { + public_deps = [ ":$_process_device_jar_target_name" ] + } + } + _dex_target_name = "${target_name}__dex" dex(_dex_target_name) { forward_variables_from(invoker,
diff --git a/build/config/clang/BUILD.gn b/build/config/clang/BUILD.gn index cffc4ef..8cbeb6e 100644 --- a/build/config/clang/BUILD.gn +++ b/build/config/clang/BUILD.gn
@@ -98,8 +98,6 @@ if (clang_use_chrome_plugins && clang_unsafe_buffers_paths != "" && !use_goma) { cflags = [ - "-DUNSAFE_BUFFERS_BUILD", - "-Xclang", "-add-plugin", "-Xclang",
diff --git a/build/config/unsafe_buffers_paths.txt b/build/config/unsafe_buffers_paths.txt index 0c576c7..b7319dc 100644 --- a/build/config/unsafe_buffers_paths.txt +++ b/build/config/unsafe_buffers_paths.txt
@@ -25,9 +25,9 @@ # the `+` line takes precedence and the file will be checked. # # To opt individual files out of checks, place `#pragma allow_unsafe_buffers` -# anywhere in the (source or header) file, guarded by -# `#ifdef UNSAFE_BUFFERS_BUILD`. These pragmas represent the technical debt and -# security risk present in the file through unsafe pointer usage. +# anywhere in the (source or header) file. These pragmas represent the +# technical debt and security risk present in the file through unsafe +# pointer usage. # # *** # Recommended process for removing a `-dir/` line from this file: @@ -37,13 +37,7 @@ # like `-dir/sub_dir/`. # 2. Add `#pragma allow_unsafe_buffers` to every file in the directory that now # has a compilation error, with a TODO to the tracking bug for the -# directory: -# ``` -# #ifdef UNSAFE_BUFFERS_BUILD -# // TODO(crbug.com/ABC): Remove this and convert code to safer constructs. -# #pragma allow_unsafe_buffers -# #endif -# ``` +# directory. # 3. Work through the files in the directory, converting pointers to spans, or # to owning containers like HeapArray and vector. Remove the pragmas from # the files when there is no unsafe pointer usage left in each one. @@ -53,8 +47,14 @@ -android_webview/ -apps/ -ash/ --base/allocator --base/third_party + +-base/ ++base/containers/buffer_iterator_nocompile.nc ++base/containers/span.h ++base/strings/cstring_view ++base/unsafe_buffers_unittest.cc ++base/unsafe_buffers_nocompile.nc + -build/ -build_overrides/ -buildtools/
diff --git a/build/ios/update_bundle_filelist.py b/build/ios/update_bundle_filelist.py index 2e21205..f8d8f12 100755 --- a/build/ios/update_bundle_filelist.py +++ b/build/ios/update_bundle_filelist.py
@@ -82,8 +82,13 @@ def get_tracked_files(directory, globroot, repository_root_relative, verbose): try: - git_cmd = get_git_command_name() - with subprocess.Popen([git_cmd, 'ls-files', '--error-unmatch', directory], + if os.getcwd().startswith('/google/cog/cloud'): + files = [] + for root, _, filenames in os.walk(directory): + files.extend([os.path.join(root, f) for f in filenames]) + return set(files) + cmd = [get_git_command_name(), 'ls-files', '--error-unmatch', directory] + with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=globroot) as p:
diff --git a/chrome/VERSION b/chrome/VERSION index d37ba091..4df68f70 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=126 MINOR=0 -BUILD=6439 +BUILD=6440 PATCH=0
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni index bb21c5b3..42d856f 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni
@@ -335,6 +335,7 @@ "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelInflater.java", "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelManager.java", "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelRepaddingTextView.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelStateProvider.java", "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelTextViewInflater.java", "java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchBarControl.java", "java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchCaptionControl.java",
diff --git a/chrome/android/features/keyboard_accessory/javatests/src/org/chromium/chrome/browser/keyboard_accessory/PasswordGenerationIntegrationTest.java b/chrome/android/features/keyboard_accessory/javatests/src/org/chromium/chrome/browser/keyboard_accessory/PasswordGenerationIntegrationTest.java index 239a800..62746ed 100644 --- a/chrome/android/features/keyboard_accessory/javatests/src/org/chromium/chrome/browser/keyboard_accessory/PasswordGenerationIntegrationTest.java +++ b/chrome/android/features/keyboard_accessory/javatests/src/org/chromium/chrome/browser/keyboard_accessory/PasswordGenerationIntegrationTest.java
@@ -46,11 +46,9 @@ import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.infobar.InfoBarContainer; import org.chromium.chrome.browser.keyboard_accessory.button_group_component.KeyboardAccessoryButtonGroupView; -import org.chromium.chrome.browser.password_manager.FakePasswordSyncControllerDelegateFactoryImpl; import org.chromium.chrome.browser.password_manager.PasswordManagerTestHelper; import org.chromium.chrome.browser.password_manager.PasswordStoreBridge; import org.chromium.chrome.browser.password_manager.PasswordStoreCredential; -import org.chromium.chrome.browser.password_manager.PasswordSyncControllerDelegateFactory; import org.chromium.chrome.browser.sync.SyncTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.util.ChromeTabUtils; @@ -117,9 +115,6 @@ @Before public void setUp() throws InterruptedException { PasswordManagerTestHelper.setAccountForPasswordStore(SigninTestRule.TEST_ACCOUNT_EMAIL); - PasswordSyncControllerDelegateFactory.setFactoryInstanceForTesting( - new FakePasswordSyncControllerDelegateFactoryImpl()); - mSyncTestRule.setUpAccountAndEnableSyncForTesting(); ManualFillingTestHelper.disableServerPredictions();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java index d1a461d..01a91cd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java
@@ -15,6 +15,7 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.MathUtils; +import org.chromium.base.ObserverList; import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.chrome.R; @@ -26,7 +27,7 @@ import org.chromium.ui.resources.dynamics.DynamicResourceLoader; /** Base abstract class for the Overlay Panel. */ -abstract class OverlayPanelBase { +abstract class OverlayPanelBase implements OverlayPanelStateProvider { /** The side padding of Bar icons in dps. */ private static final float BAR_ICON_SIDE_PADDING_DP = 12.f; @@ -133,11 +134,14 @@ protected final int mButtonPaddingDps; /** - * Indicates whether the Toolbar is allowed to hide vs cannot ever be hidden. - * @see OverlayPanel#shouldHideAndroidBrowserControls + * Indicates whether the Toolbar is allowed to hide vs cannot ever be hidden. + * + * @see OverlayPanel#shouldHideAndroidBrowserControls */ protected boolean mCanHideAndroidBrowserControls = true; + protected ObserverList<OverlayPanelStateProvider.Observer> mObservers = new ObserverList<>(); + // ============================================================================================ // Constructor // ============================================================================================ @@ -204,6 +208,7 @@ /** * Handles when the Panel's container view size changes. + * * @param width The new width of the Panel's container view. * @param height The new height of the Panel's container view. * @param previousWidth The previous width of the Panel's container view. @@ -211,6 +216,20 @@ protected abstract void handleSizeChanged(float width, float height, float previousWidth); // ============================================================================================ + // OverlayPanelStateProvider + // ============================================================================================ + + @Override + public void addObserver(Observer observer) { + mObservers.addObserver(observer); + } + + @Override + public void removeObserver(Observer observer) { + mObservers.removeObserver(observer); + } + + // ============================================================================================ // Layout Integration // ============================================================================================ @@ -676,11 +695,15 @@ // some flakiness on tests since they rely on changes of state to determine when a // particular action has been completed. mPanelState = state; + for (Observer observer : mObservers) { + observer.onOverlayPanelStateChanged(state, mBarBackgroundColor); + } } /** - * Determines if a given {@code PanelState} is a valid UI state. The UNDEFINED state - * should never be considered a valid UI state. + * Determines if a given {@code PanelState} is a valid UI state. The UNDEFINED state should + * never be considered a valid UI state. + * * @param state The given state. * @return Whether the state is valid. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelStateProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelStateProvider.java new file mode 100644 index 0000000..470d746c --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelStateProvider.java
@@ -0,0 +1,30 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.compositor.bottombar; + +import androidx.annotation.ColorInt; + +public interface OverlayPanelStateProvider { + /** An observer to be notified of changes to the overlay panel. */ + interface Observer { + /** Called when the {@link OverlayPanel.PanelState} state of the Overlay Panel changes. */ + default void onOverlayPanelStateChanged( + @OverlayPanel.PanelState int state, @ColorInt int color) {} + } + + /** + * Add an observer to be notified of changes to the overlay panel. + * + * @param observer The observer to add. + */ + void addObserver(Observer observer); + + /** + * Remove a previously added observer. + * + * @param observer The observer to remove. + */ + void removeObserver(Observer observer); +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java index 7c6591c2..177c2ca 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
@@ -25,6 +25,7 @@ import org.chromium.base.ObserverList; import org.chromium.base.SysUtils; import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.base.supplier.Supplier; import org.chromium.blink_public.input.SelectionGranularity; import org.chromium.cc.input.BrowserControlsState; @@ -34,6 +35,7 @@ import org.chromium.chrome.browser.compositor.bottombar.OverlayContentDelegate; import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.PanelState; import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChangeReason; +import org.chromium.chrome.browser.compositor.bottombar.OverlayPanelStateProvider; import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.ContextualSearchPanel; import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.RelatedSearchesControl; import org.chromium.chrome.browser.compositor.layouts.LayoutManagerImpl; @@ -170,6 +172,8 @@ // The panel. private ContextualSearchPanel mSearchPanel; + private ObservableSupplierImpl<OverlayPanelStateProvider> mOverlayPanelStateProviderSupplier = + new ObservableSupplierImpl<>(); // The native manager associated with this object. private long mNativeContextualSearchManagerPtr; @@ -413,12 +417,14 @@ if (mSearchPanel != null) mSearchPanel.destroy(); mSearchPanel = null; + mOverlayPanelStateProviderSupplier.set(null); } @Override public void setContextualSearchPanel(ContextualSearchPanel panel) { assert panel != null; mSearchPanel = panel; + mOverlayPanelStateProviderSupplier.set(mSearchPanel); mPolicy.setContextualSearchPanel(panel); } @@ -2045,7 +2051,17 @@ return mSearchPanel; } - /** @return The selection controller, for testing purposes. */ + /** + * @return the {@link OverlayPanelStateProvider} for observing changes to the Overlay Panel + * state. + */ + public ObservableSupplier<OverlayPanelStateProvider> getOverlayPanelStateProviderSupplier() { + return mOverlayPanelStateProviderSupplier; + } + + /** + * @return The selection controller, for testing purposes. + */ @VisibleForTesting ContextualSearchSelectionController getSelectionController() { return mSelectionController;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java index 2b71f03..9f6e1fb5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java
@@ -171,7 +171,7 @@ @NonNull ObservableSupplier<Profile> profileSupplier, @NonNull ObservableSupplier<BookmarkModel> bookmarkModelSupplier, @NonNull ObservableSupplier<TabBookmarker> tabBookmarkerSupplier, - @NonNull Supplier<ContextualSearchManager> contextualSearchManagerSupplier, + @NonNull ObservableSupplier<ContextualSearchManager> contextualSearchManagerSupplier, @NonNull ObservableSupplier<TabModelSelector> tabModelSelectorSupplier, @NonNull BrowserControlsManager browserControlsManager, @NonNull ActivityWindowAndroid windowAndroid,
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryAdapter.java index 62902b2..d1ac598 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryAdapter.java
@@ -194,6 +194,7 @@ } startLoadingItems(); updateClearBrowsingDataButtonVisibility(); + updatePrivacyDisclaimerBottomSpace(); } /** @@ -364,6 +365,7 @@ updateClearBrowsingDataButtonVisibility(); setPrivacyDisclaimer(); + updatePrivacyDisclaimerBottomSpace(); } ViewGroup getClearBrowsingDataButtonContainer(ViewGroup parent) { @@ -452,6 +454,11 @@ mPrivacyDisclaimerTextView.setText(text); } + private void updatePrivacyDisclaimerBottomSpace() { + boolean hideBottomSpace = mClearBrowsingDataButtonVisible || mManager.launchedForApp(); + mPrivacyDisclaimerBottomSpace.setVisibility(hideBottomSpace ? View.GONE : View.VISIBLE); + } + private CharSequence getPrivacyDisclaimerClickableSpanString( Context context, @StringRes int resId) { var s = context.getResources().getString(resId); @@ -520,7 +527,6 @@ boolean shouldShowButton = mManager.getShouldShowClearData(); if (mClearBrowsingDataButtonVisible == shouldShowButton) return; mClearBrowsingDataButtonVisible = shouldShowButton; - mPrivacyDisclaimerBottomSpace.setVisibility(shouldShowButton ? View.GONE : View.VISIBLE); if (mAreHeadersInitialized) setHeaders(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java index 37a8bafc..8cc2ded 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
@@ -75,6 +75,8 @@ import org.chromium.chrome.browser.safety_check.SafetyCheckCoordinator; import org.chromium.chrome.browser.safety_check.SafetyCheckSettingsFragment; import org.chromium.chrome.browser.safety_check.SafetyCheckUpdatesDelegateImpl; +import org.chromium.chrome.browser.safety_hub.SafetyHubFragment; +import org.chromium.chrome.browser.safety_hub.SafetyHubModuleDelegateImpl; import org.chromium.chrome.browser.search_engines.settings.SearchEngineSettings; import org.chromium.chrome.browser.signin.SyncConsentActivityLauncherImpl; import org.chromium.chrome.browser.site_settings.ChromeSiteSettingsDelegate; @@ -665,6 +667,12 @@ ((AutofillIbanEditor) fragment) .setModalDialogManagerSupplier(getModalDialogManagerSupplier()); } + if (fragment instanceof SafetyHubFragment) { + ((SafetyHubFragment) fragment) + .setDelegate( + new SafetyHubModuleDelegateImpl( + mProfile, getModalDialogManagerSupplier())); + } } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninAndHistoryOptInActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninAndHistoryOptInActivity.java index f220c33..d5a47d3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninAndHistoryOptInActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninAndHistoryOptInActivity.java
@@ -79,6 +79,7 @@ @Override protected void onPreCreate() { + super.onPreCreate(); // Temporarily ensure that the native is initialized before calling super.onCreate(). // TODO(https://crbug.com/1520783): Handle the case where the UI is shown before the end of // native initialization. @@ -215,17 +216,18 @@ super.onDestroy(); } + /** Implements {@link FirstRunActivityBase} */ @Override - public int handleBackPress() { - // TODO(b/41493788): Implement this method to handle back press correctly from the re-FRE - // and the usual flow. + public @BackPressResult int handleBackPress() { + if (mUpgradePromoCoordinator != null) { + mUpgradePromoCoordinator.handleBackPress(); + return BackPressResult.SUCCESS; + } return BackPressResult.UNKNOWN; } @Override - public int getSecondaryActivity() { - // TODO(b/41493788): Move the logic from the coordinator here (or vice-versa) to avoid - // redundant code. + public @SecondaryActivityBackPressUma.SecondaryActivity int getSecondaryActivity() { return SecondaryActivityBackPressUma.SecondaryActivity.SIGNIN_AND_HISTORY_OPT_IN; } @@ -271,7 +273,10 @@ return intent; } - /** Implements {@link UpgradePromoCoordinator.Delegate} */ + /** + * Implements {@link UpgradePromoCoordinator.Delegate} and {@link + * SigninAndHistoryOptInCoordinator.Delegate} + */ @Override public void addAccount() { // TODO(crbug.com/41493767): Handle result in onActivityResult rather than using
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabBuilder.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabBuilder.java index b210ee1..243d3d8e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabBuilder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabBuilder.java
@@ -4,6 +4,8 @@ package org.chromium.chrome.browser.tab; +import androidx.annotation.Nullable; + import org.chromium.base.Callback; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.content_public.browser.LoadUrlParams; @@ -25,6 +27,7 @@ private Integer mCreationType; private boolean mFromFrozenState; private LoadUrlParams mLoadUrlParams; + private String mTitle; private WebContents mWebContents; private TabDelegateFactory mDelegateFactory; @@ -187,6 +190,7 @@ parent, mCreationType, mLoadUrlParams, + mTitle, mWebContents, mDelegateFactory, mInitiallyHidden, @@ -210,6 +214,11 @@ return this; } + private TabBuilder setTitle(String title) { + mTitle = title; + return this; + } + /** * Creates a TabBuilder for a new, "frozen" tab from a saved state. This can be used for * background tabs restored on cold start that should be loaded when switched to. initialize() @@ -231,10 +240,13 @@ * * @param profile The Profile associated with the Tab. * @param loadUrlParams Params specifying the conditions for loading url. + * @param title The title to use for the load. */ - public static TabBuilder createForLazyLoad(Profile profile, LoadUrlParams loadUrlParams) { + public static TabBuilder createForLazyLoad( + Profile profile, LoadUrlParams loadUrlParams, @Nullable String title) { return new TabBuilder(profile) .setLoadUrlParams(loadUrlParams) + .setTitle(title) .setCreationType(TabCreationState.FROZEN_FOR_LAZY_LOAD); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java index f00be491..05828da0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java
@@ -980,6 +980,8 @@ * @param creationState State in which the tab is created. * @param loadUrlParams Parameters used for a lazily loaded Tab or null if we initialize a tab * without an URL. + * @param pendingTitle The title used for a lazily load Tab. Ignored if {@code loadUrlParams} is + * {@code null}. * @param webContents A {@link WebContents} object or {@code null} if one should be created. * @param delegateFactory The {@link TabDelegateFactory} to be used for delegate creation. * @param initiallyHidden Only used if {@code webContents} is {@code null}. Determines whether @@ -993,6 +995,7 @@ Tab parent, @Nullable @TabCreationState Integer creationState, @Nullable LoadUrlParams loadUrlParams, + @Nullable String pendingTitle, WebContents webContents, @Nullable TabDelegateFactory delegateFactory, boolean initiallyHidden, @@ -1007,9 +1010,14 @@ mTabLaunchTypeAtCreation = mLaunchType; mCreationState = creationState; + + // If applicable set up for a lazy background tab load. mPendingLoadParams = loadUrlParams; if (loadUrlParams != null) { mUrl = new GURL(loadUrlParams.getUrl()); + if (pendingTitle != null) { + setTitle(pendingTitle); + } } // The {@link mDelegateFactory} needs to be set before calling
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabStateExtractor.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabStateExtractor.java index 792519c..b253d0b4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabStateExtractor.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabStateExtractor.java
@@ -71,6 +71,7 @@ } else { Referrer referrer = pendingLoadParams.getReferrer(); return WebContentsStateBridge.createSingleNavigationStateAsByteBuffer( + tab.getTitle(), pendingLoadParams.getUrl(), referrer != null ? referrer.getUrl() : null, // Policy will be ignored for null referrer url, 0 is just a placeholder.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserver.java index 7a19a5f..b6f8d6d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserver.java
@@ -5,10 +5,15 @@ package org.chromium.chrome.browser.tabbed_mode; import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; import androidx.annotation.Nullable; import org.chromium.base.ObserverList; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider; +import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel; +import org.chromium.chrome.browser.compositor.bottombar.OverlayPanelStateProvider; +import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarStateProvider; /** @@ -18,7 +23,9 @@ * navigation bar. */ public class BottomAttachedUiObserver - implements BrowserControlsStateProvider.Observer, SnackbarStateProvider.Observer { + implements BrowserControlsStateProvider.Observer, + SnackbarStateProvider.Observer, + OverlayPanelStateProvider.Observer { /** * An observer to be notified of changes to what kind of UI is currently bordering the bottom of * the screen. @@ -39,6 +46,11 @@ private @Nullable @ColorInt Integer mSnackbarColor; private boolean mSnackbarVisible; + private OverlayPanelStateProvider mOverlayPanelStateProvider; + private @Nullable @ColorInt Integer mOverlayPanelColor; + private boolean mOverlayPanelVisible; + private boolean mOverlayPanelPeeked; + /** * Build the observer that listens to changes in the UI bordering the bottom. * @@ -49,7 +61,8 @@ */ public BottomAttachedUiObserver( BrowserControlsStateProvider browserControlsStateProvider, - SnackbarStateProvider snackbarStateProvider) { + SnackbarStateProvider snackbarStateProvider, + @NonNull ObservableSupplier<ContextualSearchManager> contextualSearchManagerSupplier) { mObservers = new ObserverList<>(); mBrowserControlsStateProvider = browserControlsStateProvider; @@ -57,6 +70,22 @@ mSnackbarStateProvider = snackbarStateProvider; mSnackbarStateProvider.addObserver(this); + + contextualSearchManagerSupplier.addObserver( + (manager) -> { + if (manager == null) return; + manager.getOverlayPanelStateProviderSupplier() + .addObserver( + (provider) -> { + if (mOverlayPanelStateProvider != null) { + mOverlayPanelStateProvider.removeObserver(this); + } + mOverlayPanelStateProvider = provider; + if (mOverlayPanelStateProvider != null) { + mOverlayPanelStateProvider.addObserver(this); + } + }); + }); } /** @@ -74,9 +103,14 @@ } public void destroy() { + if (mOverlayPanelStateProvider != null) { + mOverlayPanelStateProvider.removeObserver(this); + } + if (mBrowserControlsStateProvider != null) { mBrowserControlsStateProvider.removeObserver(this); } + if (mSnackbarStateProvider != null) { mSnackbarStateProvider.removeObserver(this); } @@ -99,6 +133,11 @@ } private @Nullable @ColorInt Integer calculateBottomAttachedColor() { + if (mOverlayPanelVisible) { + // Return null if the overlay panel is visible but not peeked - the overlay panel's + // content will be "bottom attached". + return mOverlayPanelPeeked ? mOverlayPanelColor : null; + } if (mBottomControlsAreVisible) { return mBottomControlsColor; } @@ -156,4 +195,17 @@ mSnackbarColor = color; updateBottomAttachedColor(); } + + // Overlay Panel + + @Override + public void onOverlayPanelStateChanged(@OverlayPanel.PanelState int state, int color) { + mOverlayPanelColor = color; + mOverlayPanelVisible = + (state == OverlayPanel.PanelState.PEEKED) + || (state == OverlayPanel.PanelState.EXPANDED) + || (state == OverlayPanel.PanelState.MAXIMIZED); + mOverlayPanelPeeked = (state == OverlayPanel.PanelState.PEEKED); + updateBottomAttachedColor(); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java index cbc4ed6..e4ee012 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java
@@ -24,6 +24,7 @@ import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider; +import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.fullscreen.FullscreenManager; import org.chromium.chrome.browser.fullscreen.FullscreenOptions; @@ -100,8 +101,9 @@ ObservableSupplier<LayoutManager> layoutManagerSupplier, FullscreenManager fullscreenManager, ObservableSupplier<EdgeToEdgeController> edgeToEdgeControllerSupplier, - BrowserControlsStateProvider browserControlsStateProvider, - @NonNull Supplier<SnackbarManager> snackbarManagerSupplier) { + @NonNull BrowserControlsStateProvider browserControlsStateProvider, + @NonNull Supplier<SnackbarManager> snackbarManagerSupplier, + @NonNull ObservableSupplier<ContextualSearchManager> contextualSearchManagerSupplier) { this( window, tabModelSelector, @@ -109,7 +111,9 @@ fullscreenManager, edgeToEdgeControllerSupplier, new BottomAttachedUiObserver( - browserControlsStateProvider, snackbarManagerSupplier.get())); + browserControlsStateProvider, + snackbarManagerSupplier.get(), + contextualSearchManagerSupplier)); } @VisibleForTesting
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java index f345abe..600fd935 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
@@ -302,7 +302,7 @@ @NonNull ObservableSupplier<Profile> profileSupplier, @NonNull ObservableSupplier<BookmarkModel> bookmarkModelSupplier, @NonNull ObservableSupplier<TabBookmarker> tabBookmarkerSupplier, - @NonNull Supplier<ContextualSearchManager> contextualSearchManagerSupplier, + @NonNull ObservableSupplier<ContextualSearchManager> contextualSearchManagerSupplier, @NonNull ObservableSupplier<TabModelSelector> tabModelSelectorSupplier, @NonNull OneshotSupplier<StartSurface> startSurfaceSupplier, @NonNull OneshotSupplier<TabSwitcher> tabSwitcherSupplier, @@ -547,7 +547,8 @@ mFullscreenManager, mEdgeToEdgeControllerSupplier, mBrowserControlsManager, - mSnackbarManagerSupplier); + mSnackbarManagerSupplier, + mContextualSearchManagerSupplier); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedSystemUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedSystemUiCoordinator.java index 5960125..65883272 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedSystemUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedSystemUiCoordinator.java
@@ -13,6 +13,7 @@ import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider; +import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager; import org.chromium.chrome.browser.fullscreen.FullscreenManager; import org.chromium.chrome.browser.layouts.LayoutManager; import org.chromium.chrome.browser.tabmodel.TabModelSelector; @@ -48,8 +49,9 @@ @Nullable ObservableSupplier<LayoutManager> layoutManagerSupplier, FullscreenManager fullscreenManager, ObservableSupplier<EdgeToEdgeController> edgeToEdgeControllerSupplier, - BrowserControlsStateProvider browserControlsStateProvider, - @NonNull Supplier<SnackbarManager> snackbarManagerSupplier) { + @NonNull BrowserControlsStateProvider browserControlsStateProvider, + @NonNull Supplier<SnackbarManager> snackbarManagerSupplier, + @NonNull ObservableSupplier<ContextualSearchManager> contextualSearchManagerSupplier) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { assert layoutManagerSupplier != null; mNavigationBarColorController = @@ -60,7 +62,8 @@ fullscreenManager, edgeToEdgeControllerSupplier, browserControlsStateProvider, - snackbarManagerSupplier); + snackbarManagerSupplier, + contextualSearchManagerSupplier); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ArchivedTabCreator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ArchivedTabCreator.java index 025bace3..33e58c2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ArchivedTabCreator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ArchivedTabCreator.java
@@ -48,11 +48,21 @@ @Override public @Nullable Tab createNewTab( LoadUrlParams loadUrlParams, @TabLaunchType int type, Tab parent, int index) { + return createNewTab(loadUrlParams, /* title= */ null, type, parent, index); + } + + @Override + public @Nullable Tab createNewTab( + LoadUrlParams loadUrlParams, + String title, + @TabLaunchType int type, + Tab parent, + int index) { // TODO(crbug.com/331827001): Also possible to change the entire restore path. assert type == TabLaunchType.FROM_RESTORE : "ArchivedTabCreator only supports #createNewTab calls as a restore fallback."; Tab tab = - TabBuilder.createForLazyLoad(mTabModel.getProfile(), loadUrlParams) + TabBuilder.createForLazyLoad(mTabModel.getProfile(), loadUrlParams, title) .setWindow(mWindow) .setLaunchType(TabLaunchType.FROM_RESTORE) .setTabResolver((tabId) -> TabModelUtils.getTabById(mTabModel, tabId))
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ArchivedTabModelSelectorImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ArchivedTabModelSelectorImpl.java index f9aeb53..c3526a6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ArchivedTabModelSelectorImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ArchivedTabModelSelectorImpl.java
@@ -86,7 +86,8 @@ mNextTabPolicySupplier, mAsyncTabParamsManager, this, - /* supportUndo= */ true); + /* supportUndo= */ true, + /* trackInNativeModelList= */ false); ((ArchivedTabCreator) tabCreator).setTabModel(normalModel); onNativeLibraryReadyInternal(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java index 310ed34..12282ce 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
@@ -208,6 +208,7 @@ /** * Creates a new tab and posts to UI. + * * @param loadUrlParams parameters of the url load. * @param type Information about how the tab was launched. * @param parent the parent tab, if present. @@ -217,11 +218,32 @@ @Override public Tab createNewTab( LoadUrlParams loadUrlParams, @TabLaunchType int type, Tab parent, int position) { - return createNewTab(loadUrlParams, type, parent, position, null); + return createNewTab(loadUrlParams, null, type, parent, position, null); } /** * Creates a new tab and posts to UI. + * + * @param loadUrlParams parameters of the url load. + * @param title The title of the tab if lazily loaded. + * @param type Information about how the tab was launched. + * @param parent the parent tab, if present. + * @param position the requested position (index in the tab model) + * @return The new tab. + */ + @Override + public Tab createNewTab( + LoadUrlParams loadUrlParams, + String title, + @TabLaunchType int type, + Tab parent, + int position) { + return createNewTab(loadUrlParams, title, type, parent, position, null); + } + + /** + * Creates a new tab and posts to UI. + * * @param loadUrlParams parameters of the url load. * @param type Information about how the tab was launched. * @param parent the parent tab, if present. @@ -241,12 +263,14 @@ if (index != TabModel.INVALID_TAB_INDEX) position = index + 1; } - return createNewTab(loadUrlParams, type, parent, position, intent); + return createNewTab(loadUrlParams, null, type, parent, position, intent); } /** * Creates a new tab and posts to UI. + * * @param loadUrlParams parameters of the url load. + * @param title the title to use for a lazily loaded tab. * @param type Information about how the tab was launched. * @param parent the parent tab, if present. * @param position the requested position (index in the tab model) @@ -255,6 +279,7 @@ */ private Tab createNewTab( LoadUrlParams loadUrlParams, + String title, @TabLaunchType int type, Tab parent, int position, @@ -345,7 +370,7 @@ // to preserve resources (cpu, memory, strong renderer binding) for the foreground // tab. tab = - TabBuilder.createForLazyLoad(getProfile(), loadUrlParams) + TabBuilder.createForLazyLoad(getProfile(), loadUrlParams, title) .setParent(parent) .setWindow(mNativeWindow) .setLaunchType(type) @@ -544,7 +569,12 @@ // contents (we would not want the previous content to show). Tab newTab = createNewTab( - loadUrlParams, TabLaunchType.FROM_EXTERNAL_APP, null, i, intent); + loadUrlParams, + null, + TabLaunchType.FROM_EXTERNAL_APP, + null, + i, + intent); TabAssociatedApp.from(newTab).setAppId(appId); mTabModel.closeTab(tab, false, false, false); return newTab;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/IncognitoTabModelImplCreator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/IncognitoTabModelImplCreator.java index 58b03a3..8ae0061 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/IncognitoTabModelImplCreator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/IncognitoTabModelImplCreator.java
@@ -73,6 +73,7 @@ mNextTabPolicySupplier, mAsyncTabParamsManager, mModelDelegate, - false); + /* supportUndo= */ false, + /* trackInNativeModelList= */ true); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java index af6c77b..6ed232b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java
@@ -169,8 +169,9 @@ NextTabPolicySupplier nextTabPolicySupplier, AsyncTabParamsManager asyncTabParamsManager, TabModelDelegate modelDelegate, - boolean supportUndo) { - super(profile, activityType); + boolean supportUndo, + boolean trackInNativeModelList) { + super(profile, activityType, trackInNativeModelList); mRegularTabCreator = regularTabCreator; mIncognitoTabCreator = incognitoTabCreator; mOrderController = orderController;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelJniBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelJniBridge.java index 19f9510..8a6bc985 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelJniBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelJniBridge.java
@@ -32,19 +32,38 @@ /** The type of the Activity for which this tab model works. */ private final @ActivityType int mActivityType; + /** Whether the model should be tracked in native. */ + private final boolean mTrackInNativeModelList; + /** Native TabModelJniBridge pointer, which will be set by {@link #initializeNative()}. */ private long mNativeTabModelJniBridge; - public TabModelJniBridge(@NonNull Profile profile, @ActivityType int activityType) { + /** + * @param profile The profile this TabModel belongs to. + * @param activityType The type of activity this TabModel was created in. + * @param trackInNativeModelList Whether this TabModel should be tracked in the native + * TabModelList. TabModelList is used to track tabs for sync (e.g. sessions, send tab to + * self). + */ + public TabModelJniBridge( + @NonNull Profile profile, + @ActivityType int activityType, + boolean trackInNativeModelList) { mProfile = profile; mActivityType = activityType; + mTrackInNativeModelList = trackInNativeModelList; } /** Initializes the native-side counterpart to this class. */ protected void initializeNative(Profile profile) { assert mNativeTabModelJniBridge == 0; mNativeTabModelJniBridge = - TabModelJniBridgeJni.get().init(TabModelJniBridge.this, profile, mActivityType); + TabModelJniBridgeJni.get() + .init( + TabModelJniBridge.this, + profile, + mActivityType, + mTrackInNativeModelList); } /** Returns whether the native-side pointer has been initialized. */ @@ -204,7 +223,8 @@ long init( TabModelJniBridge caller, @JniType("Profile*") Profile profile, - @ActivityType int activityType); + @ActivityType int activityType, + boolean trackInNativeModelList); void broadcastSessionRestoreComplete( long nativeTabModelJniBridge, TabModelJniBridge caller);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorImpl.java index db4f5f9..1934c62 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorImpl.java
@@ -125,7 +125,8 @@ mNextTabPolicySupplier, mAsyncTabParamsManager, this, - mIsUndoSupported); + mIsUndoSupported, + /* trackInNativeModelList= */ true); regularTabCreator.setTabModel(normalModel, mOrderController); IncognitoTabModel incognitoModel =
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java index 05c7354..97db1add 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
@@ -124,6 +124,7 @@ import org.chromium.chrome.browser.tab.TabObscuringHandler; import org.chromium.chrome.browser.tab.TabObscuringHandlerSupplier; import org.chromium.chrome.browser.tab_group_sync.TabGroupSyncController; +import org.chromium.chrome.browser.tab_group_sync.TabGroupSyncFeatures; import org.chromium.chrome.browser.tab_group_sync.TabGroupSyncServiceFactory; import org.chromium.chrome.browser.tab_ui.RecyclerViewPosition; import org.chromium.chrome.browser.tab_ui.TabContentManager; @@ -279,7 +280,7 @@ private final ObservableSupplier<TabBookmarker> mTabBookmarkerSupplier; private final OneshotSupplierImpl<AppMenuCoordinator> mAppMenuSupplier; private BottomSheetObserver mBottomSheetObserver; - protected final Supplier<ContextualSearchManager> mContextualSearchManagerSupplier; + protected final ObservableSupplier<ContextualSearchManager> mContextualSearchManagerSupplier; protected final CallbackController mCallbackController; protected final BrowserControlsManager mBrowserControlsManager; private BrowserControlsStateProvider.Observer mBrowserControlsObserver; @@ -402,7 +403,7 @@ @NonNull ObservableSupplier<Profile> profileSupplier, @NonNull ObservableSupplier<BookmarkModel> bookmarkModelSupplier, @NonNull ObservableSupplier<TabBookmarker> tabBookmarkerSupplier, - @NonNull Supplier<ContextualSearchManager> contextualSearchManagerSupplier, + @NonNull ObservableSupplier<ContextualSearchManager> contextualSearchManagerSupplier, @NonNull ObservableSupplier<TabModelSelector> tabModelSelectorSupplier, @NonNull OneshotSupplier<StartSurface> startSurfaceSupplier, @NonNull OneshotSupplier<TabSwitcher> tabSwitcherSupplier, @@ -963,7 +964,7 @@ @CallSuper protected void initProfileDependentFeatures(Profile currentlySelectedProfile) { Profile originalProfile = currentlySelectedProfile.getOriginalProfile(); - if (ChromeFeatureList.isEnabled(ChromeFeatureList.TAB_GROUP_SYNC_ANDROID)) { + if (TabGroupSyncFeatures.isTabGroupSyncEnabled()) { mTabGroupSyncController = new TabGroupSyncController( mTabModelSelectorSupplier.get(),
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/settings/SettingsActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/settings/SettingsActivityTest.java index ce41220..f82cd4b8 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/settings/SettingsActivityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/settings/SettingsActivityTest.java
@@ -24,7 +24,9 @@ import org.chromium.base.test.util.CriteriaHelper; import org.chromium.base.test.util.DoNotBatch; import org.chromium.base.test.util.Feature; +import org.chromium.base.test.util.Features.DisableFeatures; import org.chromium.base.test.util.Restriction; +import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.profiles.ProfileManager; @@ -56,6 +58,9 @@ @Policies.Item(key = "PasswordManagerEnabled", string = "false"), @Policies.Item(key = "BrowserSignin", string = "0") }) + @DisableFeatures({ + ChromeFeatureList.UNIFIED_PASSWORD_MANAGER_LOCAL_PASSWORDS_ANDROID_NO_MIGRATION + }) public void testPasswordSettings_ManagedAndDisabled() { TestThreadUtils.runOnUiThreadBlocking( () -> {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/UpgradePromoIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/UpgradePromoIntegrationTest.java index bbc754e..bf8f2283 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/UpgradePromoIntegrationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/UpgradePromoIntegrationTest.java
@@ -29,6 +29,7 @@ import android.widget.ProgressBar; import androidx.test.core.app.ApplicationProvider; +import androidx.test.espresso.Espresso; import androidx.test.filters.MediumTest; import androidx.test.runner.lifecycle.Stage; @@ -66,6 +67,7 @@ import org.chromium.content_public.browser.test.NativeLibraryTestUtils; import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.ui.base.DeviceFormFactor; +import org.chromium.ui.test.util.BlankUiTestActivity; import org.chromium.ui.test.util.DeviceRestriction; import org.chromium.ui.test.util.ViewUtils; @@ -89,6 +91,10 @@ public final SigninTestRule mSigninTestRule = new SigninTestRule(); @Rule(order = 1) + public final BaseActivityTestRule<BlankUiTestActivity> mBlankUiActivityTestRule = + new BaseActivityTestRule(BlankUiTestActivity.class); + + @Rule(order = 2) public final BaseActivityTestRule<SigninAndHistoryOptInActivity> mActivityTestRule = new BaseActivityTestRule(SigninAndHistoryOptInActivity.class); @@ -272,6 +278,54 @@ onView(withText(secondAccountEmail)).check(matches(isDisplayed())); } + @Test + @MediumTest + public void testBackPress() { + mBlankUiActivityTestRule.launchActivity(null); + when(mHistorySyncHelperMock.shouldSuppressHistorySync()).thenReturn(false); + + launchActivity(); + + // Verify that the fullscreen sign-in promo is shown and accept. + onView(withId(R.id.fullscreen_signin)).check(matches(isDisplayed())); + onView(withId(R.id.signin_fre_continue_button)).perform(click()); + mSigninTestRule.waitForSignin(AccountManagerTestRule.TEST_ACCOUNT_1); + + // Verify that the history opt-in dialog is shown press back. + onView(withId(R.id.history_sync)).check(matches(isDisplayed())); + Espresso.pressBack(); + + // Verify that the fullscreen sign-in promo is shown and press back again. + onView(withId(R.id.fullscreen_signin)).check(matches(isDisplayed())); + Espresso.pressBack(); + + // Verify that the flow completion callback, which finishes the activity, is called and that + // the user was signed out. + ApplicationTestUtils.waitForActivityState(mActivity, Stage.DESTROYED); + assertFalse(SyncTestUtil.isHistorySyncEnabled()); + Assert.assertNull(mSigninTestRule.getPrimaryAccount(ConsentLevel.SIGNIN)); + } + + @Test + @MediumTest + public void testUserAlreadySignedIn_backpress() { + mBlankUiActivityTestRule.launchActivity(null); + mSigninTestRule.addTestAccountThenSignin(); + when(mHistorySyncHelperMock.shouldSuppressHistorySync()).thenReturn(false); + + launchActivity(/* shouldReplaceProgressBars= */ false); + + // Verify that the history opt-in dialog is shown and press back. + onView(withId(R.id.history_sync)).check(matches(isDisplayed())); + Espresso.pressBack(); + + // Verify that the flow completion callback, which finishes the activity, is called and that + // history sync was not enabled. + ApplicationTestUtils.waitForActivityState(mActivity, Stage.DESTROYED); + assertFalse(SyncTestUtil.isHistorySyncEnabled()); + Assert.assertNotNull(mSigninTestRule.getPrimaryAccount(ConsentLevel.SIGNIN)); + } + private void launchActivity() { launchActivity(true); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabArchiverTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabArchiverTest.java index 04929ce..ab7ea7d85 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabArchiverTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabArchiverTest.java
@@ -54,7 +54,10 @@ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) @Batch(Batch.PER_CLASS) -@EnableFeatures(ChromeFeatureList.ANDROID_TAB_DECLUTTER) +@EnableFeatures({ + ChromeFeatureList.ANDROID_TAB_DECLUTTER, + ChromeFeatureList.ANDROID_TAB_DECLUTTER_RESCUE_KILLSWITCH +}) public class TabArchiverTest { @ClassRule public static ChromeTabbedActivityTestRule sActivityTestRule =
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabUmaTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabUmaTest.java index a75220c..1e31ca5 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabUmaTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tab/TabUmaTest.java
@@ -110,7 +110,8 @@ Tab bgTab = TabBuilder.createForLazyLoad( sActivityTestRule.getProfile(false), - new LoadUrlParams(mTestUrl)) + new LoadUrlParams(mTestUrl), + /* title= */ null) .setWindow(sActivityTestRule.getActivity().getWindowAndroid()) .setLaunchType(TabLaunchType.FROM_LONGPRESS_BACKGROUND) .setDelegateFactory(createTabDelegateFactory())
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/ArchivedTabCreatorTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/ArchivedTabCreatorTest.java index 479634f..d6c2e1484 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/ArchivedTabCreatorTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/ArchivedTabCreatorTest.java
@@ -43,7 +43,10 @@ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) @Batch(Batch.PER_CLASS) -@EnableFeatures(ChromeFeatureList.ANDROID_TAB_DECLUTTER) +@EnableFeatures({ + ChromeFeatureList.ANDROID_TAB_DECLUTTER, + ChromeFeatureList.ANDROID_TAB_DECLUTTER_RESCUE_KILLSWITCH +}) public class ArchivedTabCreatorTest { @ClassRule public static ChromeTabbedActivityTestRule sActivityTestRule =
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreatorTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreatorTest.java index 9bffafc..4c023741 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreatorTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreatorTest.java
@@ -212,17 +212,23 @@ @Feature({"Browser"}) public void testCreateNewTabWithSyncBackgroundFrozen() throws ExecutionException { final String url = mTestServer.getURL(TEST_PATH); + final String title = "BAR"; final Tab bgTab = TestThreadUtils.runOnUiThreadBlocking( () -> { - return sActivityTestRule - .getActivity() - .getCurrentTabCreator() - .createNewTab( - new LoadUrlParams(url), - TabLaunchType.FROM_SYNC_BACKGROUND, - null); + Tab tab = + sActivityTestRule + .getActivity() + .getCurrentTabCreator() + .createNewTab( + new LoadUrlParams(url), + title, + TabLaunchType.FROM_SYNC_BACKGROUND, + null, + TabModel.INVALID_TAB_INDEX); + return tab; }); + Assert.assertEquals(title, ChromeTabUtils.getTitleOnUiThread(bgTab)); // Verify that the background tab is not loading. Assert.assertFalse(bgTab.isLoading()); @@ -240,6 +246,9 @@ }; ChromeTabUtils.waitForTabPageLoaded(bgTab, url, loadPage); Assert.assertNotNull(bgTab.getView()); + + // Title should change when the page loads. + Assert.assertNotEquals(title, ChromeTabUtils.getTitleOnUiThread(bgTab)); } private Intent createIntent(int tabIndex) {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorObserverTestRule.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorObserverTestRule.java index 0330c75e..6cba2a5 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorObserverTestRule.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorObserverTestRule.java
@@ -177,7 +177,8 @@ nextTabPolicySupplier, asyncTabParamsManager, modelDelegate, - false); + /* supportUndo= */ false, + /* trackInNativeModelList= */ true); } @Override
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java index 36fc5b9..dc57031 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java
@@ -181,7 +181,8 @@ nextTabPolicySupplier, AsyncTabParamsManagerSingleton.getInstance(), TestTabModelSelector.this, - true); + /* supportUndo= */ true, + /* trackInNativeModelList= */ true); } }; TabModelImpl regularTabModel = TestThreadUtils.runOnUiThreadBlocking(callable);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabbedModeTabPersistencePolicyTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabbedModeTabPersistencePolicyTest.java index f225ab1..7af511e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabbedModeTabPersistencePolicyTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabbedModeTabPersistencePolicyTest.java
@@ -135,7 +135,7 @@ return new GURL("https://www.google.com"); } }; - tab.initialize(null, null, null, null, null, false, null, false); + tab.initialize(null, null, null, null, null, null, false, null, false); return tab; } };
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/tab/TabStateExtractorTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/tab/TabStateExtractorTest.java index 5311347..576698e 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/tab/TabStateExtractorTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/tab/TabStateExtractorTest.java
@@ -34,6 +34,7 @@ @Config(manifest = Config.NONE) public class TabStateExtractorTest { private static final int REFERRER_POLICY = 123; + private static final String TITLE = "test_title"; private static final String URL = "test_url"; private static final String REFERRER_URL = "referrer_url"; @@ -77,11 +78,17 @@ loadUrlParams.setReferrer(new Referrer(REFERRER_URL, REFERRER_POLICY)); loadUrlParams.setInitiatorOrigin(mMockOrigin); doReturn(loadUrlParams).when(mTabMock).getPendingLoadParams(); + doReturn(TITLE).when(mTabMock).getTitle(); doReturn(true).when(mTabMock).isIncognito(); doReturn(mByteBuffer) .when(mWebContentsBridgeJni) .createSingleNavigationStateAsByteBuffer( - eq(URL), eq(REFERRER_URL), eq(REFERRER_POLICY), eq(mMockOrigin), eq(true)); + eq(TITLE), + eq(URL), + eq(REFERRER_URL), + eq(REFERRER_POLICY), + eq(mMockOrigin), + eq(true)); WebContentsState result = TabStateExtractor.getWebContentsState(mTabMock);
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserverTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserverTest.java index 9fb1746..6931705 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserverTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/BottomAttachedUiObserverTest.java
@@ -7,6 +7,7 @@ import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import android.graphics.Color; @@ -19,8 +20,12 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider; +import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel; +import org.chromium.chrome.browser.compositor.bottombar.OverlayPanelStateProvider; +import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; @RunWith(BaseRobolectricTestRunner.class) @@ -28,18 +33,33 @@ private static final int BOTTOM_CONTROLS_HEIGHT = 100; private static final int BROWSER_CONTROLS_COLOR = Color.RED; private static final int SNACKBAR_COLOR = Color.GREEN; + private static final int OVERLAY_PANEL_COLOR = Color.BLUE; private BottomAttachedUiObserver mBottomAttachedUiObserver; private MockColorChangeObserver mColorChangeObserver; @Mock private BrowserControlsStateProvider mBrowserControlsStateProvider; @Mock private SnackbarManager mSnackbarManager; + private ObservableSupplierImpl<ContextualSearchManager> mContextualSearchManagerSupplier = + new ObservableSupplierImpl<>(); + @Mock private ContextualSearchManager mContextualSearchManager; + private ObservableSupplierImpl<OverlayPanelStateProvider> mOverlayPanelStateProviderSupplier = + new ObservableSupplierImpl<>(); + @Mock private OverlayPanelStateProvider mOverlayPanelStateProvider; + @Before public void setUp() { MockitoAnnotations.initMocks(this); mBottomAttachedUiObserver = - new BottomAttachedUiObserver(mBrowserControlsStateProvider, mSnackbarManager); + new BottomAttachedUiObserver( + mBrowserControlsStateProvider, + mSnackbarManager, + mContextualSearchManagerSupplier); + + when(mContextualSearchManager.getOverlayPanelStateProviderSupplier()) + .thenReturn(mOverlayPanelStateProviderSupplier); + mColorChangeObserver = new MockColorChangeObserver(); mBottomAttachedUiObserver.addObserver(mColorChangeObserver); } @@ -89,6 +109,47 @@ } @Test + public void testSetOverlayPanelObserver() { + setOverlayPanelObserver(); + verify(mOverlayPanelStateProvider).addObserver(eq(mBottomAttachedUiObserver)); + + mOverlayPanelStateProviderSupplier.set(null); + verify(mOverlayPanelStateProvider).removeObserver(eq(mBottomAttachedUiObserver)); + } + + private void setOverlayPanelObserver() { + mContextualSearchManagerSupplier.set(mContextualSearchManager); + mOverlayPanelStateProviderSupplier.set(mOverlayPanelStateProvider); + } + + @Test + public void testAdaptsColorToOverlayPanel() { + mBottomAttachedUiObserver.onOverlayPanelStateChanged( + OverlayPanel.PanelState.CLOSED, OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertColor(null); + + mBottomAttachedUiObserver.onOverlayPanelStateChanged( + OverlayPanel.PanelState.PEEKED, OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertColor(OVERLAY_PANEL_COLOR); + + mBottomAttachedUiObserver.onOverlayPanelStateChanged( + OverlayPanel.PanelState.EXPANDED, OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertColor(null); + + mBottomAttachedUiObserver.onOverlayPanelStateChanged( + OverlayPanel.PanelState.MAXIMIZED, OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertColor(null); + + mBottomAttachedUiObserver.onOverlayPanelStateChanged( + OverlayPanel.PanelState.PEEKED, OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertColor(OVERLAY_PANEL_COLOR); + + mBottomAttachedUiObserver.onOverlayPanelStateChanged( + OverlayPanel.PanelState.CLOSED, OVERLAY_PANEL_COLOR); + mColorChangeObserver.assertColor(null); + } + + @Test public void testColorPrioritization() { mColorChangeObserver.assertColor(null); @@ -108,8 +169,12 @@ @Test public void testDestroy() { + setOverlayPanelObserver(); + mBottomAttachedUiObserver.destroy(); verify(mBrowserControlsStateProvider).removeObserver(eq(mBottomAttachedUiObserver)); + verify(mSnackbarManager).removeObserver(eq(mBottomAttachedUiObserver)); + verify(mOverlayPanelStateProvider).removeObserver(eq(mBottomAttachedUiObserver)); } private static class MockColorChangeObserver implements BottomAttachedUiObserver.Observer {
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/tabmodel/TabModelImplUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/tabmodel/TabModelImplUnitTest.java index 5291e303..fb0df64 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/tabmodel/TabModelImplUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/tabmodel/TabModelImplUnitTest.java
@@ -86,7 +86,8 @@ PriceTrackingFeatures.setPriceTrackingEnabledForTesting(false); mJniMocker.mock(TabModelJniBridgeJni.TEST_HOOKS, mTabModelJniBridge); - when(mTabModelJniBridge.init(any(), any(), anyInt())).thenReturn(FAKE_NATIVE_ADDRESS); + when(mTabModelJniBridge.init(any(), any(), anyInt(), anyBoolean())) + .thenReturn(FAKE_NATIVE_ADDRESS); when(mTabModelDelegate.isReparentingInProgress()).thenReturn(false); @@ -138,7 +139,8 @@ () -> NextTabPolicy.HIERARCHICAL, realAsyncTabParamsManager, mTabModelDelegate, - /* supportsUndo= */ true); + /* supportUndo= */ true, + /* trackInNativeModelList= */ true); when(mTabModelSelector.getModel(isIncognito)).thenReturn(tabModel); tabModel.setActive(isActive); if (isActive) {
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/tabmodel/UndoTabModelUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/tabmodel/UndoTabModelUnitTest.java index e0b308f..d0125d6 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/tabmodel/UndoTabModelUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/tabmodel/UndoTabModelUnitTest.java
@@ -101,7 +101,8 @@ PriceTrackingFeatures.setPriceTrackingEnabledForTesting(false); mJniMocker.mock(TabModelJniBridgeJni.TEST_HOOKS, mTabModelJniBridge); - when(mTabModelJniBridge.init(any(), any(), anyInt())).thenReturn(FAKE_NATIVE_ADDRESS); + when(mTabModelJniBridge.init(any(), any(), anyInt(), anyBoolean())) + .thenReturn(FAKE_NATIVE_ADDRESS); when(mTabModelDelegate.isReparentingInProgress()).thenReturn(false); @@ -121,7 +122,7 @@ TabModelOrderControllerImpl orderController = new TabModelOrderControllerImpl(mTabModelSelector); TabModel tabModel; - final boolean supportsUndo = !isIncognito; + final boolean supportUndo = !isIncognito; if (isIncognito) { // TODO(crbug.com/40222755): Consider using an incognito tab model. tabModel = @@ -135,7 +136,8 @@ () -> NextTabPolicy.HIERARCHICAL, realAsyncTabParamsManager, mTabModelDelegate, - supportsUndo); + supportUndo, + /* trackInNativeModelList= */ true); when(mTabModelSelector.getModel(true)).thenReturn(tabModel); } else { tabModel = @@ -149,7 +151,8 @@ () -> NextTabPolicy.HIERARCHICAL, realAsyncTabParamsManager, mTabModelDelegate, - supportsUndo); + supportUndo, + /* trackInNativeModelList= */ true); when(mTabModelSelector.getModel(false)).thenReturn(tabModel); } // Assume the model is the current and active model.
diff --git a/chrome/android/profiles/newest.txt b/chrome/android/profiles/newest.txt index 7544f28..02a1ec5 100644 --- a/chrome/android/profiles/newest.txt +++ b/chrome/android/profiles/newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-126.0.6434.0_rc-r2-merged.afdo.bz2 +chromeos-chrome-amd64-126.0.6437.0_rc-r1-merged.afdo.bz2
diff --git a/chrome/app/BUILD.gn b/chrome/app/BUILD.gn index 39cd9b1..b551d58 100644 --- a/chrome/app/BUILD.gn +++ b/chrome/app/BUILD.gn
@@ -15,12 +15,10 @@ import("//tools/grit/grit_rule.gni") import("//tools/ipc_fuzzer/ipc_fuzzer.gni") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + if (is_android) { import("//build/config/android/rules.gni") -} else if (is_fuchsia) { - import("//build/config/fuchsia/packaged_content_embedder_excluded_dirs.gni") - import("//third_party/fuchsia-gn-sdk/src/component.gni") - import("//third_party/fuchsia-gn-sdk/src/package.gni") } # This target is for dependency tracking for the command ID header. @@ -159,6 +157,8 @@ "//chrome/renderer", "//chrome/utility", "//components/about_ui", + "//components/crash/core/app", + "//components/crash/core/app:test_support", "//components/devtools/devtools_pipe", "//components/memory_system", "//components/nacl/common:buildflags", @@ -174,14 +174,6 @@ ] public_deps = [] - if (!is_fuchsia) { - # TODO(crbug.com/40188745): Complete crash reporting integration on Fuchsia. - deps += [ - "//components/crash/core/app", - "//components/crash/core/app:test_support", - ] - } - if (is_android) { deps += [ "//chrome/browser/flags:flags_android",
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index e6555f37..00ef90c4 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -9153,6 +9153,9 @@ <message name="IDS_READING_MODE_LANGUAGE_MENU_DOWNLOADING" desc="Label for status text when a voice is downloading from the Read Aloud language menu."> Downloading voices... </message> + <message name="IDS_READING_MODE_VOICE_MENU_DOWNLOADING" desc="Label for status text when a voice is downloading from the Read Aloud voice menu."> + Downloading <ph name="LANGUAGE">$1<ex>English</ex></ph> voices... + </message> <message name="IDS_READING_MODE_LANGUAGE_MENU_VOICES_UNAVAILABLE" desc="Label for status text when a voice attempted to be downloaded from the Read Aloud language menu is unavailable."> Some Google voices may not be available right now </message> @@ -11180,6 +11183,9 @@ </if> <!-- Saved Tab Group V2 --> + <message name="IDS_TABS_TITLE_CXMENU" desc="The label of the 'Tabs' title in the context menu of a saved tab group."> + Tabs + </message> <if expr="not use_titlecase"> <message name="IDS_SAVED_TAB_GROUP_TABS_COUNT" desc="Title of unnamed saved tab group in Everything menu. [ICU_Syntax]"> {NUM_TABS, plural, =1 {1 tab} other {# tabs}}
diff --git a/chrome/app/generated_resources_grd/IDS_READING_MODE_VOICE_MENU_DOWNLOADING.png.sha1 b/chrome/app/generated_resources_grd/IDS_READING_MODE_VOICE_MENU_DOWNLOADING.png.sha1 new file mode 100644 index 0000000..f25d1cf --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_READING_MODE_VOICE_MENU_DOWNLOADING.png.sha1
@@ -0,0 +1 @@ +8d896dee490e987f94cf005a8650c2a782d43bfd \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_TABS_TITLE_CXMENU.png.sha1 b/chrome/app/generated_resources_grd/IDS_TABS_TITLE_CXMENU.png.sha1 new file mode 100644 index 0000000..962eda4 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_TABS_TITLE_CXMENU.png.sha1
@@ -0,0 +1 @@ +229effe0a163b245740e904e03fc077750d136e1 \ No newline at end of file
diff --git a/chrome/app/resources/BUILD.gn b/chrome/app/resources/BUILD.gn index a23342f7..d896c75f 100644 --- a/chrome/app/resources/BUILD.gn +++ b/chrome/app/resources/BUILD.gn
@@ -9,6 +9,7 @@ import("//tools/grit/grit_rule.gni") assert(!is_ios, "Chromium/iOS shouldn't use anything in //chrome") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") grit("locale_settings") { source = "locale_settings.grd" @@ -31,7 +32,7 @@ } else { source = "locale_settings_chromiumos.grd" } - } else if (is_posix || is_fuchsia) { + } else if (is_posix) { # All other POSIX systems and Fuchsia use the Linux one. source = "locale_settings_linux.grd" }
diff --git a/chrome/app/vector_icons/account_add_chrome_refresh.icon b/chrome/app/vector_icons/account_add_chrome_refresh.icon index ae84257..800a01d 100644 --- a/chrome/app/vector_icons/account_add_chrome_refresh.icon +++ b/chrome/app/vector_icons/account_add_chrome_refresh.icon
@@ -1,177 +1,66 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -CANVAS_DIMENSIONS, 24, -MOVE_TO, 18.11f, 13.74f, -V_LINE_TO, 10.79f, -R_H_LINE_TO, -2.95f, -V_LINE_TO, 8.7f, -R_H_LINE_TO, 2.95f, -V_LINE_TO, 5.74f, -R_H_LINE_TO, 2.09f, -R_V_LINE_TO, 2.95f, -R_H_LINE_TO, 2.95f, -R_V_LINE_TO, 2.09f, -R_H_LINE_TO, -2.95f, -R_V_LINE_TO, 2.95f, -CLOSE, -R_MOVE_TO, -9.09f, -1.84f, -R_CUBIC_TO, -1.16f, 0, -2.15f, -0.41f, -2.97f, -1.23f, -R_CUBIC_TO, -0.82f, -0.82f, -1.23f, -1.81f, -1.23f, -2.97f, -R_CUBIC_TO, 0, -1.16f, 0.41f, -2.15f, 1.23f, -2.97f, -R_CUBIC_TO, 0.82f, -0.82f, 1.81f, -1.23f, 2.97f, -1.23f, -R_CUBIC_TO, 1.16f, 0, 2.15f, 0.41f, 2.97f, 1.23f, -R_CUBIC_TO, 0.83f, 0.82f, 1.24f, 1.81f, 1.24f, 2.97f, -R_CUBIC_TO, 0, 1.16f, -0.41f, 2.15f, -1.24f, 2.97f, -R_CUBIC_TO, -0.82f, 0.82f, -1.81f, 1.23f, -2.97f, 1.23f, -CLOSE, -MOVE_TO, 0.82f, 20.31f, -R_V_LINE_TO, -3.02f, -R_CUBIC_TO, 0, -0.6f, 0.16f, -1.16f, 0.47f, -1.66f, -R_CUBIC_TO, 0.31f, -0.51f, 0.73f, -0.89f, 1.24f, -1.16f, -R_CUBIC_TO, 1.05f, -0.52f, 2.11f, -0.91f, 3.19f, -1.17f, -R_ARC_TO, 14, 14, 0, 0, 1, 3.3f, -0.39f, -R_CUBIC_TO, 1.12f, 0, 2.23f, 0.13f, 3.31f, 0.39f, -R_CUBIC_TO, 1.08f, 0.26f, 2.14f, 0.65f, 3.18f, 1.17f, -R_CUBIC_TO, 0.52f, 0.27f, 0.93f, 0.65f, 1.25f, 1.16f, -R_CUBIC_TO, 0.31f, 0.5f, 0.47f, 1.06f, 0.47f, 1.67f, -R_V_LINE_TO, 3.02f, -CLOSE, -MOVE_TO, 3.09f, 18.03f, -R_H_LINE_TO, 11.86f, -R_V_LINE_TO, -0.71f, -R_ARC_TO, 0.91f, 0.91f, 0, 0, 0, -0.14f, -0.49f, -R_ARC_TO, 0.93f, 0.93f, 0, 0, 0, -0.36f, -0.34f, -R_ARC_TO, 12.99f, 12.99f, 0, 0, 0, -2.67f, -0.98f, -R_ARC_TO, 11.65f, 11.65f, 0, 0, 0, -2.75f, -0.33f, -R_CUBIC_TO, -0.93f, 0, -1.85f, 0.11f, -2.76f, 0.33f, -R_ARC_TO, 12.66f, 12.66f, 0, 0, 0, -2.67f, 0.98f, -R_ARC_TO, 0.99f, 0.99f, 0, 0, 0, -0.36f, 0.34f, -R_ARC_TO, 0.91f, 0.91f, 0, 0, 0, -0.14f, 0.49f, -CLOSE, -R_MOVE_TO, 5.93f, -8.41f, -R_CUBIC_TO, 0.53f, 0, 0.98f, -0.19f, 1.36f, -0.57f, -R_CUBIC_TO, 0.38f, -0.38f, 0.57f, -0.83f, 0.57f, -1.36f, -R_ARC_TO, 1.84f, 1.84f, 0, 0, 0, -0.57f, -1.36f, -R_ARC_TO, 1.86f, 1.86f, 0, 0, 0, -1.36f, -0.56f, -R_CUBIC_TO, -0.53f, 0, -0.98f, 0.19f, -1.36f, 0.56f, -R_ARC_TO, 1.85f, 1.85f, 0, 0, 0, -0.57f, 1.36f, -R_CUBIC_TO, 0, 0.53f, 0.19f, 0.98f, 0.57f, 1.36f, -R_ARC_TO, 1.87f, 1.87f, 0, 0, 0, 1.36f, 0.57f, -CLOSE - -CANVAS_DIMENSIONS, 20, -MOVE_TO, 14.84f, 10.79f, -R_V_LINE_TO, -1.71f, -R_H_LINE_TO, -1.71f, -V_LINE_TO, 7.5f, -R_H_LINE_TO, 1.71f, -R_V_LINE_TO, -1.71f, -R_H_LINE_TO, 1.58f, -R_V_LINE_TO, 1.71f, -R_H_LINE_TO, 1.71f, -R_V_LINE_TO, 1.58f, -R_H_LINE_TO, -1.71f, -R_V_LINE_TO, 1.71f, -CLOSE, -R_MOVE_TO, -6.82f, -0.87f, -R_CUBIC_TO, -0.88f, 0, -1.63f, -0.31f, -2.25f, -0.92f, -R_CUBIC_TO, -0.62f, -0.61f, -0.93f, -1.36f, -0.93f, -2.25f, -R_CUBIC_TO, 0, -0.89f, 0.31f, -1.63f, 0.93f, -2.25f, -R_CUBIC_TO, 0.61f, -0.61f, 1.36f, -0.92f, 2.25f, -0.92f, -R_CUBIC_TO, 0.88f, 0, 1.63f, 0.31f, 2.25f, 0.92f, -R_CUBIC_TO, 0.61f, 0.61f, 0.92f, 1.36f, 0.92f, 2.25f, -R_CUBIC_TO, 0, 0.89f, -0.31f, 1.63f, -0.92f, 2.25f, -R_CUBIC_TO, -0.61f, 0.62f, -1.36f, 0.92f, -2.25f, 0.92f, -CLOSE, -R_MOVE_TO, -6.17f, 6.34f, -R_V_LINE_TO, -2.1f, -R_CUBIC_TO, 0, -0.39f, 0.1f, -0.75f, 0.29f, -1.07f, -R_CUBIC_TO, 0.19f, -0.33f, 0.45f, -0.59f, 0.79f, -0.78f, -R_CUBIC_TO, 0.77f, -0.45f, 1.59f, -0.79f, 2.45f, -1.03f, -R_ARC_TO, 9.86f, 9.86f, 0, 0, 1, 2.65f, -0.36f, -R_CUBIC_TO, 0.91f, 0, 1.79f, 0.12f, 2.65f, 0.36f, -R_ARC_TO, 9.96f, 9.96f, 0, 0, 1, 2.44f, 1.03f, -R_CUBIC_TO, 0.34f, 0.19f, 0.6f, 0.45f, 0.79f, 0.78f, -R_CUBIC_TO, 0.19f, 0.32f, 0.28f, 0.68f, 0.28f, 1.08f, -R_V_LINE_TO, 2.1f, -CLOSE, -R_MOVE_TO, 1.73f, -1.73f, -R_H_LINE_TO, 8.88f, -R_V_LINE_TO, -0.34f, -R_ARC_TO, 0.46f, 0.46f, 0, 0, 0, -0.07f, -0.24f, -R_ARC_TO, 0.44f, 0.44f, 0, 0, 0, -0.16f, -0.16f, -R_ARC_TO, 8.75f, 8.75f, 0, 0, 0, -2.02f, -0.84f, -R_ARC_TO, 8.08f, 8.08f, 0, 0, 0, -2.19f, -0.3f, -R_CUBIC_TO, -0.74f, 0, -1.48f, 0.1f, -2.2f, 0.3f, -R_CUBIC_TO, -0.72f, 0.2f, -1.39f, 0.48f, -2.01f, 0.84f, -R_ARC_TO, 0.45f, 0.45f, 0, 0, 0, -0.23f, 0.4f, -CLOSE, -MOVE_TO, 8.02f, 8.19f, -R_CUBIC_TO, 0.4f, 0, 0.73f, -0.14f, 1.01f, -0.43f, -R_CUBIC_TO, 0.28f, -0.28f, 0.42f, -0.62f, 0.42f, -1.02f, -R_CUBIC_TO, 0, -0.4f, -0.14f, -0.73f, -0.43f, -1.01f, -R_ARC_TO, 1.41f, 1.41f, 0, 0, 0, -1.02f, -0.41f, -R_CUBIC_TO, -0.4f, 0, -0.74f, 0.14f, -1.01f, 0.42f, -R_ARC_TO, 1.39f, 1.39f, 0, 0, 0, -0.42f, 1.02f, -R_CUBIC_TO, 0, 0.4f, 0.14f, 0.73f, 0.43f, 1.02f, -R_CUBIC_TO, 0.28f, 0.28f, 0.62f, 0.42f, 1.02f, 0.42f, -CLOSE - CANVAS_DIMENSIONS, 16, -MOVE_TO, 11.97f, 8.4f, -V_LINE_TO, 7.07f, -R_H_LINE_TO, -1.32f, -V_LINE_TO, 5.72f, -R_H_LINE_TO, 1.32f, -V_LINE_TO, 4.39f, -R_H_LINE_TO, 1.35f, -R_V_LINE_TO, 1.32f, -R_H_LINE_TO, 1.33f, -V_LINE_TO, 7.07f, -H_LINE_TO, 13.32f, -R_V_LINE_TO, 1.33f, +FILL_RULE_NONZERO, +MOVE_TO, 11.87f, 8.63f, +V_LINE_TO, 7.26f, +R_H_LINE_TO, -1.37f, +V_LINE_TO, 6, +R_H_LINE_TO, 1.37f, +V_LINE_TO, 4.63f, +R_H_LINE_TO, 1.27f, +R_V_LINE_TO, 1.37f, +R_H_LINE_TO, 1.37f, +R_V_LINE_TO, 1.27f, +R_H_LINE_TO, -1.37f, +R_V_LINE_TO, 1.37f, CLOSE, -R_MOVE_TO, -5.54f, -0.56f, -R_CUBIC_TO, -0.76f, 0, -1.41f, -0.26f, -1.93f, -0.79f, -R_ARC_TO, 2.64f, 2.64f, 0, 0, 1, -0.79f, -1.93f, -R_CUBIC_TO, 0, -0.76f, 0.27f, -1.41f, 0.79f, -1.93f, -R_CUBIC_TO, 0.53f, -0.52f, 1.17f, -0.78f, 1.93f, -0.78f, -R_CUBIC_TO, 0.76f, 0, 1.4f, 0.26f, 1.93f, 0.79f, -R_CUBIC_TO, 0.53f, 0.52f, 0.79f, 1.16f, 0.79f, 1.93f, -R_CUBIC_TO, 0, 0.76f, -0.26f, 1.4f, -0.79f, 1.93f, -R_CUBIC_TO, -0.53f, 0.53f, -1.17f, 0.79f, -1.93f, 0.79f, +R_MOVE_TO, -5.46f, -0.69f, +R_ARC_TO, 2.45f, 2.45f, 0, 0, 1, -1.8f, -0.74f, +R_ARC_TO, 2.45f, 2.45f, 0, 0, 1, -0.74f, -1.8f, +R_CUBIC_TO, 0, -0.71f, 0.25f, -1.31f, 0.74f, -1.8f, +R_ARC_TO, 2.45f, 2.45f, 0, 0, 1, 1.8f, -0.74f, +R_CUBIC_TO, 0.71f, 0, 1.31f, 0.25f, 1.8f, 0.74f, +R_CUBIC_TO, 0.49f, 0.49f, 0.74f, 1.09f, 0.74f, 1.8f, +R_ARC_TO, 2.45f, 2.45f, 0, 0, 1, -0.74f, 1.8f, +R_ARC_TO, 2.45f, 2.45f, 0, 0, 1, -1.8f, 0.74f, CLOSE, -MOVE_TO, 1.31f, 13.28f, -R_V_LINE_TO, -1.87f, -R_CUBIC_TO, 0, -0.34f, 0.09f, -0.66f, 0.26f, -0.95f, -R_CUBIC_TO, 0.17f, -0.29f, 0.41f, -0.52f, 0.7f, -0.69f, -R_ARC_TO, 8.57f, 8.57f, 0, 0, 1, 2, -0.84f, -R_ARC_TO, 8.03f, 8.03f, 0, 0, 1, 2.16f, -0.29f, -R_CUBIC_TO, 0.75f, 0, 1.47f, 0.09f, 2.17f, 0.29f, -R_ARC_TO, 8.2f, 8.2f, 0, 0, 1, 1.98f, 0.83f, -R_CUBIC_TO, 0.3f, 0.17f, 0.54f, 0.4f, 0.71f, 0.69f, -R_CUBIC_TO, 0.17f, 0.28f, 0.25f, 0.61f, 0.25f, 0.96f, -R_V_LINE_TO, 1.88f, +R_MOVE_TO, -4.93f, 5.07f, +R_V_LINE_TO, -1.68f, +R_CUBIC_TO, 0, -0.31f, 0.08f, -0.6f, 0.23f, -0.86f, +R_CUBIC_TO, 0.15f, -0.26f, 0.36f, -0.47f, 0.63f, -0.62f, +R_ARC_TO, 8.32f, 8.32f, 0, 0, 1, 1.96f, -0.82f, +R_ARC_TO, 7.86f, 7.86f, 0, 0, 1, 2.11f, -0.29f, +R_ARC_TO, 8.04f, 8.04f, 0, 0, 1, 4.08f, 1.11f, +R_CUBIC_TO, 0.27f, 0.16f, 0.48f, 0.36f, 0.63f, 0.62f, +R_CUBIC_TO, 0.15f, 0.26f, 0.23f, 0.55f, 0.23f, 0.87f, +R_V_LINE_TO, 1.68f, CLOSE, -R_MOVE_TO, 1.63f, -1.63f, -R_H_LINE_TO, 6.97f, -R_V_LINE_TO, -0.19f, -R_ARC_TO, 0.31f, 0.31f, 0, 0, 0, -0.05f, -0.18f, -R_ARC_TO, 0.35f, 0.35f, 0, 0, 0, -0.13f, -0.13f, -R_ARC_TO, 6.99f, 6.99f, 0, 0, 0, -1.56f, -0.64f, -R_ARC_TO, 6.7f, 6.7f, 0, 0, 0, -5.04f, 0.65f, -R_ARC_TO, 0.35f, 0.35f, 0, 0, 0, -0.13f, 0.13f, -R_ARC_TO, 0.31f, 0.31f, 0, 0, 0, -0.05f, 0.18f, +R_MOVE_TO, 1.38f, -1.38f, +R_H_LINE_TO, 7.11f, +R_V_LINE_TO, -0.27f, +R_ARC_TO, 0.36f, 0.36f, 0, 0, 0, -0.05f, -0.19f, +R_ARC_TO, 0.39f, 0.39f, 0, 0, 0, -0.13f, -0.13f, +R_ARC_TO, 7.14f, 7.14f, 0, 0, 0, -1.61f, -0.67f, +R_ARC_TO, 6.62f, 6.62f, 0, 0, 0, -1.76f, -0.23f, +R_CUBIC_TO, -0.59f, 0, -1.18f, 0.08f, -1.75f, 0.24f, +R_ARC_TO, 6.93f, 6.93f, 0, 0, 0, -1.61f, 0.67f, +R_ARC_TO, 0.39f, 0.39f, 0, 0, 0, -0.13f, 0.13f, +R_ARC_TO, 0.36f, 0.36f, 0, 0, 0, -0.05f, 0.19f, CLOSE, -MOVE_TO, 6.43f, 6.21f, -R_CUBIC_TO, 0.3f, 0, 0.56f, -0.1f, 0.77f, -0.32f, -R_CUBIC_TO, 0.21f, -0.21f, 0.32f, -0.47f, 0.32f, -0.77f, -R_CUBIC_TO, 0, -0.3f, -0.11f, -0.55f, -0.32f, -0.76f, -R_ARC_TO, 1.05f, 1.05f, 0, 0, 0, -0.77f, -0.31f, -R_CUBIC_TO, -0.3f, 0, -0.56f, 0.11f, -0.77f, 0.32f, -R_ARC_TO, 1.03f, 1.03f, 0, 0, 0, -0.32f, 0.77f, -R_CUBIC_TO, 0, 0.3f, 0.11f, 0.56f, 0.32f, 0.77f, -R_CUBIC_TO, 0.22f, 0.21f, 0.47f, 0.32f, 0.77f, 0.32f, -CLOSE \ No newline at end of file +R_MOVE_TO, 3.56f, -5.07f, +R_CUBIC_TO, 0.32f, 0, 0.59f, -0.11f, 0.81f, -0.34f, +R_CUBIC_TO, 0.23f, -0.23f, 0.34f, -0.5f, 0.34f, -0.82f, +R_CUBIC_TO, 0, -0.32f, -0.11f, -0.59f, -0.33f, -0.81f, +R_ARC_TO, 1.12f, 1.12f, 0, 0, 0, -0.82f, -0.33f, +R_CUBIC_TO, -0.32f, 0, -0.59f, 0.11f, -0.81f, 0.34f, +R_ARC_TO, 1.1f, 1.1f, 0, 0, 0, -0.34f, 0.81f, +R_CUBIC_TO, 0, 0.32f, 0.11f, 0.59f, 0.34f, 0.82f, +R_CUBIC_TO, 0.23f, 0.22f, 0.5f, 0.34f, 0.82f, 0.34f, +CLOSE, +MOVE_TO, 6.41f, 5.38f, +CLOSE, +R_MOVE_TO, 0, 6.24f, +CLOSE
diff --git a/chrome/app/vector_icons/account_manage_chrome_refresh.icon b/chrome/app/vector_icons/account_manage_chrome_refresh.icon index 1c5c34b2..01b51bb 100644 --- a/chrome/app/vector_icons/account_manage_chrome_refresh.icon +++ b/chrome/app/vector_icons/account_manage_chrome_refresh.icon
@@ -1,246 +1,90 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -CANVAS_DIMENSIONS, 24, -MOVE_TO, 10, 11.9f, -R_CUBIC_TO, -1.16f, 0, -2.15f, -0.41f, -2.97f, -1.23f, -R_CUBIC_TO, -0.82f, -0.82f, -1.23f, -1.81f, -1.23f, -2.97f, -R_CUBIC_TO, 0, -1.16f, 0.41f, -2.15f, 1.23f, -2.97f, -R_CUBIC_TO, 0.83f, -0.82f, 1.81f, -1.23f, 2.97f, -1.23f, -R_CUBIC_TO, 1.16f, 0, 2.15f, 0.41f, 2.97f, 1.23f, -R_CUBIC_TO, 0.82f, 0.82f, 1.23f, 1.81f, 1.23f, 2.97f, -R_CUBIC_TO, 0, 1.16f, -0.41f, 2.15f, -1.23f, 2.97f, -R_CUBIC_TO, -0.82f, 0.82f, -1.81f, 1.23f, -2.97f, 1.23f, -CLOSE, -R_MOVE_TO, -8.2f, 8.41f, -R_V_LINE_TO, -3.02f, -R_CUBIC_TO, 0, -0.61f, 0.16f, -1.17f, 0.48f, -1.68f, -R_CUBIC_TO, 0.33f, -0.51f, 0.74f, -0.89f, 1.24f, -1.14f, -R_CUBIC_TO, 0.85f, -0.43f, 1.82f, -0.8f, 2.92f, -1.11f, -R_CUBIC_TO, 1.1f, -0.3f, 2.29f, -0.46f, 3.57f, -0.46f, -R_H_LINE_TO, 0.4f, -R_CUBIC_TO, 0.13f, 0, 0.26f, 0.02f, 0.38f, 0.05f, -R_CUBIC_TO, -0.14f, 0.3f, -0.27f, 0.65f, -0.39f, 1.06f, -R_CUBIC_TO, -0.12f, 0.41f, -0.21f, 0.8f, -0.27f, 1.17f, -R_H_LINE_TO, -0.1f, -R_CUBIC_TO, -1.15f, 0, -2.2f, 0.15f, -3.14f, 0.44f, -R_CUBIC_TO, -0.94f, 0.29f, -1.71f, 0.58f, -2.31f, 0.88f, -R_ARC_TO, 0.97f, 0.97f, 0, 0, 0, -0.36f, 0.34f, -R_ARC_TO, 0.89f, 0.89f, 0, 0, 0, -0.14f, 0.49f, -R_V_LINE_TO, 0.71f, -R_H_LINE_TO, 6.22f, -R_CUBIC_TO, 0.11f, 0.39f, 0.26f, 0.79f, 0.47f, 1.19f, -R_CUBIC_TO, 0.2f, 0.4f, 0.42f, 0.76f, 0.65f, 1.08f, -CLOSE, -R_MOVE_TO, 14.29f, 0.9f, -R_LINE_TO, -0.3f, -1.53f, -R_ARC_TO, 4.88f, 4.88f, 0, 0, 1, -1.03f, -0.56f, -R_LINE_TO, -1.48f, 0.46f, -R_LINE_TO, -1.07f, -1.83f, -R_LINE_TO, 1.17f, -1.01f, -R_ARC_TO, 3.39f, 3.39f, 0, 0, 1, -0.05f, -0.61f, -R_CUBIC_TO, 0, -0.19f, 0.02f, -0.4f, 0.05f, -0.61f, -LINE_TO, 12.2f, 14.48f, -R_LINE_TO, 1.07f, -1.83f, -R_LINE_TO, 1.48f, 0.47f, -R_ARC_TO, 4.88f, 4.88f, 0, 0, 1, 0.51f, -0.32f, -R_CUBIC_TO, 0.17f, -0.09f, 0.34f, -0.17f, 0.53f, -0.25f, -R_LINE_TO, 0.31f, -1.53f, -R_H_LINE_TO, 2.15f, -R_LINE_TO, 0.31f, 1.53f, -R_ARC_TO, 3.92f, 3.92f, 0, 0, 1, 1.04f, 0.61f, -R_LINE_TO, 1.47f, -0.51f, -R_LINE_TO, 1.08f, 1.88f, -R_LINE_TO, -1.18f, 1.02f, -R_CUBIC_TO, 0.04f, 0.18f, 0.06f, 0.38f, 0.06f, 0.59f, -R_CUBIC_TO, 0, 0.21f, -0.02f, 0.4f, -0.05f, 0.59f, -R_LINE_TO, 1.18f, 1.01f, -R_LINE_TO, -1.08f, 1.83f, -R_LINE_TO, -1.47f, -0.46f, -R_ARC_TO, 4.92f, 4.92f, 0, 0, 1, -1.04f, 0.56f, -R_LINE_TO, -0.31f, 1.53f, -CLOSE, -R_MOVE_TO, 1.08f, -3.14f, -R_CUBIC_TO, 0.54f, 0, 0.99f, -0.19f, 1.38f, -0.58f, -R_CUBIC_TO, 0.38f, -0.39f, 0.58f, -0.85f, 0.58f, -1.38f, -R_CUBIC_TO, 0, -0.53f, -0.19f, -1, -0.58f, -1.38f, -R_ARC_TO, 1.87f, 1.87f, 0, 0, 0, -1.37f, -0.57f, -R_CUBIC_TO, -0.53f, 0, -1, 0.19f, -1.38f, 0.57f, -R_ARC_TO, 1.87f, 1.87f, 0, 0, 0, -0.58f, 1.38f, -R_CUBIC_TO, 0, 0.53f, 0.19f, 0.99f, 0.58f, 1.38f, -R_CUBIC_TO, 0.38f, 0.38f, 0.84f, 0.58f, 1.38f, 0.58f, -CLOSE, -MOVE_TO, 10, 9.63f, -R_ARC_TO, 1.87f, 1.87f, 0, 0, 0, 1.36f, -0.57f, -R_ARC_TO, 1.87f, 1.87f, 0, 0, 0, 0.57f, -1.36f, -R_CUBIC_TO, 0, -0.53f, -0.19f, -0.98f, -0.57f, -1.36f, -ARC_TO, 1.87f, 1.87f, 0, 0, 0, 10, 5.77f, -R_CUBIC_TO, -0.53f, 0, -0.98f, 0.19f, -1.36f, 0.56f, -R_ARC_TO, 1.87f, 1.87f, 0, 0, 0, -0.57f, 1.36f, -R_CUBIC_TO, 0, 0.53f, 0.19f, 0.98f, 0.57f, 1.36f, -ARC_TO, 1.87f, 1.87f, 0, 0, 0, 10, 9.63f, -CLOSE - -CANVAS_DIMENSIONS, 20, -MOVE_TO, 8, 9.91f, -R_CUBIC_TO, -0.88f, 0, -1.63f, -0.3f, -2.25f, -0.92f, -R_CUBIC_TO, -0.62f, -0.61f, -0.92f, -1.36f, -0.92f, -2.25f, -R_CUBIC_TO, 0, -0.89f, 0.31f, -1.63f, 0.92f, -2.25f, -R_CUBIC_TO, 0.61f, -0.61f, 1.36f, -0.92f, 2.25f, -0.92f, -R_CUBIC_TO, 0.89f, 0, 1.63f, 0.31f, 2.25f, 0.92f, -R_CUBIC_TO, 0.62f, 0.61f, 0.92f, 1.36f, 0.92f, 2.25f, -R_CUBIC_TO, 0, 0.89f, -0.3f, 1.63f, -0.92f, 2.25f, -R_CUBIC_TO, -0.61f, 0.62f, -1.36f, 0.92f, -2.25f, 0.92f, -CLOSE, -R_MOVE_TO, -6.17f, 6.34f, -R_V_LINE_TO, -2.1f, -R_CUBIC_TO, 0, -0.41f, 0.1f, -0.78f, 0.31f, -1.1f, -R_CUBIC_TO, 0.21f, -0.32f, 0.46f, -0.57f, 0.77f, -0.75f, -R_ARC_TO, 10.31f, 10.31f, 0, 0, 1, 2.45f, -1.03f, -R_ARC_TO, 9.81f, 9.81f, 0, 0, 1, 3.11f, -0.35f, -R_CUBIC_TO, 0.16f, 0.01f, 0.32f, 0.02f, 0.49f, 0.03f, -R_ARC_TO, 4.93f, 4.93f, 0, 0, 0, -0.27f, 0.83f, -R_CUBIC_TO, -0.07f, 0.32f, -0.12f, 0.61f, -0.16f, 0.88f, -R_LINE_TO, -0.52f, -0.02f, -R_CUBIC_TO, -0.72f, 0, -1.44f, 0.09f, -2.16f, 0.28f, -R_ARC_TO, 7.96f, 7.96f, 0, 0, 0, -2.06f, 0.86f, -R_ARC_TO, 0.48f, 0.48f, 0, 0, 0, -0.17f, 0.16f, -R_ARC_TO, 0.48f, 0.48f, 0, 0, 0, -0.06f, 0.24f, -R_V_LINE_TO, 0.34f, -R_H_LINE_TO, 5.16f, -R_CUBIC_TO, 0.07f, 0.3f, 0.18f, 0.59f, 0.33f, 0.9f, -R_CUBIC_TO, 0.14f, 0.3f, 0.3f, 0.58f, 0.48f, 0.83f, -CLOSE, -R_MOVE_TO, 11.56f, 0.91f, -R_LINE_TO, -0.25f, -1.19f, -R_ARC_TO, 3.15f, 3.15f, 0, 0, 1, -0.99f, -0.55f, -R_LINE_TO, -1.17f, 0.36f, -R_LINE_TO, -0.73f, -1.26f, -R_LINE_TO, 0.87f, -0.85f, -R_ARC_TO, 1.6f, 1.6f, 0, 0, 1, -0.07f, -0.57f, -R_CUBIC_TO, 0.01f, -0.2f, 0.04f, -0.39f, 0.07f, -0.57f, -R_LINE_TO, -0.87f, -0.84f, -R_LINE_TO, 0.73f, -1.27f, -R_LINE_TO, 1.15f, 0.34f, -R_CUBIC_TO, 0.14f, -0.13f, 0.3f, -0.25f, 0.48f, -0.35f, -R_CUBIC_TO, 0.17f, -0.1f, 0.35f, -0.18f, 0.53f, -0.23f, -R_LINE_TO, 0.27f, -1.19f, -R_H_LINE_TO, 1.46f, -R_LINE_TO, 0.27f, 1.19f, -R_CUBIC_TO, 0.18f, 0.06f, 0.36f, 0.14f, 0.54f, 0.23f, -R_CUBIC_TO, 0.18f, 0.09f, 0.34f, 0.21f, 0.48f, 0.34f, -R_LINE_TO, 1.15f, -0.32f, -R_LINE_TO, 0.73f, 1.25f, -R_LINE_TO, -0.86f, 0.81f, -R_CUBIC_TO, 0.03f, 0.2f, 0.05f, 0.39f, 0.04f, 0.59f, -R_CUBIC_TO, 0, 0.2f, -0.02f, 0.39f, -0.06f, 0.57f, -R_LINE_TO, 0.88f, 0.83f, -R_LINE_TO, -0.73f, 1.26f, -R_LINE_TO, -1.17f, -0.34f, -R_CUBIC_TO, -0.14f, 0.11f, -0.3f, 0.22f, -0.46f, 0.32f, -R_CUBIC_TO, -0.17f, 0.1f, -0.34f, 0.18f, -0.53f, 0.23f, -R_LINE_TO, -0.3f, 1.19f, -CLOSE, -R_MOVE_TO, 0.76f, -2.61f, -R_CUBIC_TO, 0.4f, 0, 0.74f, -0.14f, 1.03f, -0.43f, -R_CUBIC_TO, 0.28f, -0.29f, 0.43f, -0.64f, 0.43f, -1.03f, -R_CUBIC_TO, 0, -0.4f, -0.14f, -0.74f, -0.43f, -1.03f, -R_ARC_TO, 1.42f, 1.42f, 0, 0, 0, -1.03f, -0.43f, -R_CUBIC_TO, -0.4f, 0, -0.75f, 0.14f, -1.03f, 0.43f, -R_CUBIC_TO, -0.29f, 0.28f, -0.43f, 0.63f, -0.43f, 1.03f, -R_CUBIC_TO, 0, 0.4f, 0.14f, 0.75f, 0.43f, 1.03f, -R_CUBIC_TO, 0.29f, 0.28f, 0.63f, 0.43f, 1.04f, 0.43f, -CLOSE, -MOVE_TO, 8, 8.19f, -R_CUBIC_TO, 0.4f, 0, 0.73f, -0.14f, 1.02f, -0.43f, -R_CUBIC_TO, 0.28f, -0.28f, 0.42f, -0.62f, 0.42f, -1.02f, -R_CUBIC_TO, 0, -0.4f, -0.14f, -0.73f, -0.42f, -1.01f, -R_ARC_TO, 1.4f, 1.4f, 0, 0, 0, -1.02f, -0.41f, -R_CUBIC_TO, -0.4f, 0, -0.73f, 0.14f, -1.02f, 0.42f, -ARC_TO, 1.39f, 1.39f, 0, 0, 0, 6.56f, 6.75f, -R_CUBIC_TO, 0, 0.4f, 0.14f, 0.73f, 0.43f, 1.02f, -R_CUBIC_TO, 0.28f, 0.28f, 0.62f, 0.42f, 1.02f, 0.42f, -CLOSE - CANVAS_DIMENSIONS, 16, -MOVE_TO, 6.4f, 7.84f, -R_CUBIC_TO, -0.76f, 0, -1.4f, -0.26f, -1.93f, -0.79f, -R_CUBIC_TO, -0.53f, -0.53f, -0.79f, -1.17f, -0.79f, -1.93f, -R_CUBIC_TO, 0, -0.76f, 0.26f, -1.41f, 0.79f, -1.93f, -R_CUBIC_TO, 0.53f, -0.52f, 1.17f, -0.78f, 1.93f, -0.78f, -R_CUBIC_TO, 0.76f, 0, 1.41f, 0.26f, 1.93f, 0.79f, -R_CUBIC_TO, 0.52f, 0.52f, 0.79f, 1.16f, 0.79f, 1.93f, -R_CUBIC_TO, 0, 0.76f, -0.27f, 1.4f, -0.79f, 1.93f, -R_CUBIC_TO, -0.53f, 0.53f, -1.17f, 0.79f, -1.93f, 0.79f, +FILL_RULE_NONZERO, +MOVE_TO, 6.4f, 7.93f, +R_ARC_TO, 2.45f, 2.45f, 0, 0, 1, -1.8f, -0.74f, +R_ARC_TO, 2.45f, 2.45f, 0, 0, 1, -0.74f, -1.8f, +R_CUBIC_TO, 0, -0.71f, 0.25f, -1.31f, 0.74f, -1.8f, +R_ARC_TO, 2.45f, 2.45f, 0, 0, 1, 1.8f, -0.74f, +R_CUBIC_TO, 0.71f, 0, 1.31f, 0.25f, 1.8f, 0.74f, +R_CUBIC_TO, 0.49f, 0.49f, 0.74f, 1.09f, 0.74f, 1.8f, +R_CUBIC_TO, 0, 0.7f, -0.24f, 1.31f, -0.73f, 1.8f, +R_ARC_TO, 2.45f, 2.45f, 0, 0, 1, -1.8f, 0.74f, CLOSE, -MOVE_TO, 1.28f, 13.28f, -R_V_LINE_TO, -1.87f, -R_CUBIC_TO, 0, -0.38f, 0.1f, -0.71f, 0.3f, -1, -R_CUBIC_TO, 0.2f, -0.28f, 0.42f, -0.5f, 0.66f, -0.64f, -R_ARC_TO, 8.33f, 8.33f, 0, 0, 1, 2, -0.83f, -R_ARC_TO, 8.1f, 8.1f, 0, 0, 1, 2.15f, -0.3f, -R_CUBIC_TO, 0.13f, 0, 0.27f, 0, 0.42f, 0.01f, -R_CUBIC_TO, 0.16f, 0, 0.31f, 0.01f, 0.46f, 0.02f, -R_CUBIC_TO, -0.09f, 0.19f, -0.18f, 0.45f, -0.26f, 0.77f, -R_ARC_TO, 7.76f, 7.76f, 0, 0, 0, -0.18f, 0.84f, +R_MOVE_TO, -4.93f, 5.07f, +R_V_LINE_TO, -1.68f, +R_CUBIC_TO, 0, -0.33f, 0.08f, -0.62f, 0.25f, -0.88f, +R_ARC_TO, 1.84f, 1.84f, 0, 0, 1, 0.61f, -0.6f, +R_ARC_TO, 8.2f, 8.2f, 0, 0, 1, 1.96f, -0.82f, +R_ARC_TO, 7.81f, 7.81f, 0, 0, 1, 2.11f, -0.29f, +R_CUBIC_TO, 0.13f, 0, 0.25f, 0, 0.38f, 0.01f, +R_CUBIC_TO, 0.12f, 0, 0.26f, 0.01f, 0.39f, 0.02f, +R_CUBIC_TO, -0.09f, 0.19f, -0.16f, 0.41f, -0.21f, 0.66f, +R_ARC_TO, 7.18f, 7.18f, 0, 0, 0, -0.13f, 0.7f, R_LINE_TO, -0.41f, -0.02f, -R_CUBIC_TO, -0.55f, 0, -1.11f, 0.07f, -1.68f, 0.21f, -R_ARC_TO, 5.97f, 5.97f, 0, 0, 0, -1.64f, 0.67f, -R_ARC_TO, 0.36f, 0.36f, 0, 0, 0, -0.13f, 0.12f, -R_ARC_TO, 0.31f, 0.31f, 0, 0, 0, -0.05f, 0.18f, -R_V_LINE_TO, 0.19f, -R_H_LINE_TO, 4.05f, -R_CUBIC_TO, 0.07f, 0.27f, 0.18f, 0.56f, 0.32f, 0.86f, -R_CUBIC_TO, 0.15f, 0.3f, 0.31f, 0.56f, 0.47f, 0.78f, +R_CUBIC_TO, -0.58f, 0, -1.16f, 0.07f, -1.73f, 0.22f, +R_ARC_TO, 6.36f, 6.36f, 0, 0, 0, -1.64f, 0.69f, +R_ARC_TO, 0.38f, 0.38f, 0, 0, 0, -0.13f, 0.13f, +R_ARC_TO, 0.34f, 0.34f, 0, 0, 0, -0.05f, 0.19f, +R_V_LINE_TO, 0.27f, +R_H_LINE_TO, 4.13f, +R_CUBIC_TO, 0.06f, 0.23f, 0.14f, 0.47f, 0.26f, 0.72f, +R_CUBIC_TO, 0.11f, 0.24f, 0.24f, 0.47f, 0.38f, 0.67f, CLOSE, -R_MOVE_TO, 9.51f, 0.64f, -R_LINE_TO, -0.21f, -0.98f, -R_ARC_TO, 1.91f, 1.91f, 0, 0, 1, -0.39f, -0.18f, -R_ARC_TO, 4.04f, 4.04f, 0, 0, 1, -0.34f, -0.23f, -R_LINE_TO, -0.96f, 0.3f, -R_LINE_TO, -0.64f, -1.12f, -R_LINE_TO, 0.72f, -0.69f, -R_ARC_TO, 0.96f, 0.96f, 0, 0, 1, -0.07f, -0.42f, -R_ARC_TO, 2.17f, 2.17f, 0, 0, 1, 0.07f, -0.42f, -R_LINE_TO, -0.72f, -0.69f, -R_LINE_TO, 0.65f, -1.13f, -R_LINE_TO, 0.95f, 0.28f, -R_CUBIC_TO, 0.1f, -0.09f, 0.22f, -0.18f, 0.35f, -0.26f, -R_CUBIC_TO, 0.13f, -0.08f, 0.27f, -0.13f, 0.4f, -0.17f, -R_LINE_TO, 0.23f, -0.98f, -R_H_LINE_TO, 1.3f, -R_LINE_TO, 0.23f, 0.98f, -R_CUBIC_TO, 0.13f, 0.04f, 0.26f, 0.1f, 0.4f, 0.17f, -R_CUBIC_TO, 0.14f, 0.07f, 0.25f, 0.16f, 0.36f, 0.26f, -R_LINE_TO, 0.94f, -0.27f, -R_LINE_TO, 0.65f, 1.11f, -R_LINE_TO, -0.71f, 0.67f, -R_ARC_TO, 2, 2, 0, 0, 1, -0.02f, 0.86f, -R_LINE_TO, 0.73f, 0.68f, -R_LINE_TO, -0.65f, 1.12f, -R_LINE_TO, -0.96f, -0.28f, -R_ARC_TO, 4.81f, 4.81f, 0, 0, 1, -0.35f, 0.24f, -R_ARC_TO, 1.53f, 1.53f, 0, 0, 1, -0.39f, 0.17f, -R_LINE_TO, -0.24f, 0.98f, +R_MOVE_TO, 9.25f, 0.73f, +R_LINE_TO, -0.21f, -0.95f, +R_ARC_TO, 2.64f, 2.64f, 0, 0, 1, -0.79f, -0.44f, +R_LINE_TO, -0.93f, 0.29f, +R_LINE_TO, -0.58f, -1, +R_LINE_TO, 0.7f, -0.68f, +R_ARC_TO, 1.36f, 1.36f, 0, 0, 1, -0.06f, -0.46f, +R_ARC_TO, 2.43f, 2.43f, 0, 0, 1, 0.06f, -0.46f, +LINE_TO, 8.2f, 9.37f, +R_LINE_TO, 0.58f, -1.01f, +R_LINE_TO, 0.92f, 0.27f, +R_CUBIC_TO, 0.11f, -0.1f, 0.24f, -0.19f, 0.38f, -0.28f, +R_CUBIC_TO, 0.14f, -0.08f, 0.28f, -0.14f, 0.43f, -0.18f, +R_LINE_TO, 0.22f, -0.95f, +R_H_LINE_TO, 1.17f, +R_LINE_TO, 0.22f, 0.95f, +R_CUBIC_TO, 0.14f, 0.05f, 0.29f, 0.11f, 0.43f, 0.19f, +R_CUBIC_TO, 0.14f, 0.08f, 0.27f, 0.17f, 0.38f, 0.27f, +R_LINE_TO, 0.92f, -0.26f, +R_LINE_TO, 0.59f, 1, +R_LINE_TO, -0.69f, 0.65f, +R_CUBIC_TO, 0.02f, 0.16f, 0.04f, 0.32f, 0.04f, 0.48f, +R_CUBIC_TO, 0, 0.16f, -0.02f, 0.31f, -0.05f, 0.46f, +R_LINE_TO, 0.7f, 0.66f, +R_LINE_TO, -0.59f, 1, +R_LINE_TO, -0.93f, -0.27f, +R_CUBIC_TO, -0.11f, 0.09f, -0.24f, 0.18f, -0.37f, 0.26f, +R_CUBIC_TO, -0.13f, 0.08f, -0.27f, 0.14f, -0.42f, 0.18f, +R_LINE_TO, -0.24f, 0.95f, CLOSE, -R_MOVE_TO, 0.68f, -2.22f, -R_CUBIC_TO, 0.3f, 0, 0.57f, -0.11f, 0.79f, -0.34f, -R_CUBIC_TO, 0.22f, -0.23f, 0.33f, -0.49f, 0.33f, -0.8f, -R_CUBIC_TO, 0, -0.3f, -0.11f, -0.57f, -0.34f, -0.79f, -R_ARC_TO, 1.08f, 1.08f, 0, 0, 0, -0.79f, -0.33f, -R_CUBIC_TO, -0.3f, 0, -0.57f, 0.11f, -0.8f, 0.34f, -R_ARC_TO, 1.08f, 1.08f, 0, 0, 0, -0.34f, 0.79f, -R_CUBIC_TO, 0, 0.31f, 0.11f, 0.57f, 0.34f, 0.79f, -R_CUBIC_TO, 0.23f, 0.22f, 0.49f, 0.34f, 0.8f, 0.34f, +R_MOVE_TO, 0.61f, -2.09f, +R_CUBIC_TO, 0.32f, 0, 0.59f, -0.12f, 0.82f, -0.35f, +R_CUBIC_TO, 0.23f, -0.23f, 0.34f, -0.51f, 0.34f, -0.83f, +R_CUBIC_TO, 0, -0.32f, -0.12f, -0.59f, -0.35f, -0.82f, +R_ARC_TO, 1.13f, 1.13f, 0, 0, 0, -0.82f, -0.34f, +R_CUBIC_TO, -0.32f, 0, -0.6f, 0.11f, -0.82f, 0.34f, +R_ARC_TO, 1.13f, 1.13f, 0, 0, 0, -0.34f, 0.83f, +R_CUBIC_TO, 0, 0.32f, 0.11f, 0.59f, 0.35f, 0.82f, +R_CUBIC_TO, 0.23f, 0.23f, 0.51f, 0.34f, 0.83f, 0.34f, CLOSE, -MOVE_TO, 6.4f, 6.21f, -R_CUBIC_TO, 0.3f, 0, 0.56f, -0.1f, 0.77f, -0.32f, -R_CUBIC_TO, 0.22f, -0.21f, 0.32f, -0.47f, 0.32f, -0.77f, -R_CUBIC_TO, 0, -0.3f, -0.11f, -0.55f, -0.32f, -0.76f, -R_ARC_TO, 1.06f, 1.06f, 0, 0, 0, -0.77f, -0.31f, -R_CUBIC_TO, -0.3f, 0, -0.56f, 0.11f, -0.77f, 0.32f, -R_ARC_TO, 1.04f, 1.04f, 0, 0, 0, -0.32f, 0.77f, -R_CUBIC_TO, 0, 0.3f, 0.11f, 0.56f, 0.32f, 0.77f, -R_CUBIC_TO, 0.22f, 0.21f, 0.47f, 0.32f, 0.77f, 0.32f, -CLOSE \ No newline at end of file +MOVE_TO, 6.4f, 6.55f, +R_CUBIC_TO, 0.32f, 0, 0.59f, -0.11f, 0.81f, -0.34f, +R_CUBIC_TO, 0.23f, -0.23f, 0.34f, -0.5f, 0.34f, -0.82f, +R_CUBIC_TO, 0, -0.32f, -0.11f, -0.59f, -0.34f, -0.81f, +R_ARC_TO, 1.11f, 1.11f, 0, 0, 0, -0.81f, -0.33f, +R_CUBIC_TO, -0.32f, 0, -0.59f, 0.11f, -0.82f, 0.34f, +R_ARC_TO, 1.12f, 1.12f, 0, 0, 0, -0.34f, 0.81f, +R_CUBIC_TO, 0, 0.32f, 0.11f, 0.59f, 0.34f, 0.82f, +R_CUBIC_TO, 0.23f, 0.22f, 0.5f, 0.34f, 0.82f, 0.34f, +CLOSE, +R_MOVE_TO, 0, -1.15f, +CLOSE, +R_MOVE_TO, 0.58f, 6.22f, +CLOSE
diff --git a/chrome/app/vector_icons/bookmark_all_tabs_chrome_refresh.icon b/chrome/app/vector_icons/bookmark_all_tabs_chrome_refresh.icon index 21767f0..7e4c74a 100644 --- a/chrome/app/vector_icons/bookmark_all_tabs_chrome_refresh.icon +++ b/chrome/app/vector_icons/bookmark_all_tabs_chrome_refresh.icon
@@ -1,45 +1,42 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -R_MOVE_TO, 15.82f, 7.41f, -R_LINE_TO, -1.91f, -0.16f, -R_LINE_TO, -2.64f, 2.26f, -R_LINE_TO, 0.84f, 3.57f, -R_LINE_TO, 1.54f, 0.92f, -R_LINE_TO, -0.93f, -3.94f, -R_LINE_TO, 3.1f, -2.65f, +FILL_RULE_NONZERO, +R_MOVE_TO, 11.23f, 9.52f, +R_LINE_TO, 2.43f, -2.08f, +R_LINE_TO, 2.02f, 0.18f, +R_LINE_TO, -2.91f, 2.49f, +R_LINE_TO, 0.89f, 3.71f, +R_LINE_TO, -1.64f, -1, CLOSE, -MOVE_TO, 11.41f, 4.86f, -LINE_TO, 9.76f, 1, -R_LINE_TO, -0.83f, 1.93f, -R_LINE_TO, 0.77f, 1.79f, -R_LINE_TO, 1.71f, 0.14f, +MOVE_TO, 9.7f, 4.84f, +R_LINE_TO, -0.69f, -1.59f, +R_LINE_TO, 0.86f, -1.98f, +LINE_TO, 11.46f, 4.98f, CLOSE, -NEW_PATH, -R_MOVE_TO, 14.18f, 5.95f, -R_LINE_TO, -5.03f, -0.42f, -LINE_TO, 7.18f, 1, -LINE_TO, 5.21f, 5.54f, -R_LINE_TO, -5.03f, 0.41f, -LINE_TO, 4, 9.19f, -LINE_TO, 2.85f, 14, -R_LINE_TO, 4.33f, -2.55f, -LINE_TO, 11.51f, 14, -R_LINE_TO, -1.15f, -4.81f, -R_LINE_TO, 3.82f, -3.24f, +R_MOVE_TO, -4.55f, 6.17f, +R_LINE_TO, 2.06f, -1.22f, +R_LINE_TO, 2.07f, 1.22f, +R_LINE_TO, -0.55f, -2.31f, +R_LINE_TO, 1.79f, -1.53f, +R_LINE_TO, -2.36f, -0.21f, +R_LINE_TO, -0.95f, -2.2f, +R_LINE_TO, -0.94f, 2.2f, +R_LINE_TO, -2.36f, 0.2f, +R_LINE_TO, 1.8f, 1.52f, CLOSE, -R_MOVE_TO, -4.95f, 4.96f, -LINE_TO, 7.18f, 9.7f, -R_LINE_TO, -2.05f, 1.21f, -R_LINE_TO, 0.54f, -2.27f, -R_LINE_TO, -1.76f, -1.49f, -R_LINE_TO, 2.32f, -0.19f, -R_LINE_TO, 0.95f, -2.19f, -R_LINE_TO, 0.95f, 2.19f, -R_LINE_TO, 2.32f, 0.19f, -R_LINE_TO, -1.76f, 1.49f, -R_LINE_TO, 0.54f, 2.27f, +R_MOVE_TO, -2.09f, 2.87f, +R_LINE_TO, 1.11f, -4.66f, +R_LINE_TO, -3.68f, -3.14f, +LINE_TO, 5.31f, 5.66f, +R_LINE_TO, 1.89f, -4.4f, +R_LINE_TO, 1.89f, 4.41f, +R_LINE_TO, 4.83f, 0.4f, +R_LINE_TO, -3.68f, 3.14f, +R_LINE_TO, 1.11f, 4.66f, +R_LINE_TO, -4.15f, -2.47f, CLOSE, -NEW_PATH \ No newline at end of file +R_MOVE_TO, 4.15f, -5.65f, +CLOSE
diff --git a/chrome/app/vector_icons/bookmarks_lists_menu.icon b/chrome/app/vector_icons/bookmarks_lists_menu.icon index 1bbf604..9006134 100644 --- a/chrome/app/vector_icons/bookmarks_lists_menu.icon +++ b/chrome/app/vector_icons/bookmarks_lists_menu.icon
@@ -1,30 +1,30 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -R_MOVE_TO, 15, 5.95f, -R_LINE_TO, -5.03f, -0.42f, -LINE_TO, 8, 1, -LINE_TO, 6.03f, 5.54f, -LINE_TO, 1, 5.96f, -LINE_TO, 4.82f, 9.2f, -R_LINE_TO, -1.15f, 4.81f, -LINE_TO, 8, 11.46f, -R_LINE_TO, 4.33f, 2.55f, -R_LINE_TO, -1.15f, -4.81f, -LINE_TO, 15, 5.96f, -R_V_LINE_TO, -0.01f, +FILL_RULE_NONZERO, +MOVE_TO, 5.94f, 11.01f, +LINE_TO, 8, 9.79f, +R_LINE_TO, 2.07f, 1.22f, +R_LINE_TO, -0.55f, -2.31f, +R_LINE_TO, 1.79f, -1.53f, +R_LINE_TO, -2.36f, -0.21f, +LINE_TO, 8, 4.76f, +LINE_TO, 7.05f, 6.97f, +R_LINE_TO, -2.36f, 0.2f, +R_LINE_TO, 1.8f, 1.52f, CLOSE, -R_MOVE_TO, -4.95f, 4.96f, -LINE_TO, 8, 9.7f, -R_LINE_TO, -2.05f, 1.21f, -R_LINE_TO, 0.54f, -2.27f, -R_LINE_TO, -1.76f, -1.49f, -R_LINE_TO, 2.32f, -0.19f, -LINE_TO, 8, 4.77f, -R_LINE_TO, 0.95f, 2.19f, -R_LINE_TO, 2.32f, 0.19f, -R_LINE_TO, -1.76f, 1.49f, -R_LINE_TO, 0.54f, 2.27f, +R_MOVE_TO, -2.09f, 2.87f, +R_LINE_TO, 1.11f, -4.66f, +R_LINE_TO, -3.68f, -3.14f, +LINE_TO, 6.11f, 5.66f, +LINE_TO, 8, 1.26f, +R_LINE_TO, 1.89f, 4.41f, +R_LINE_TO, 4.83f, 0.4f, +R_LINE_TO, -3.68f, 3.14f, +R_LINE_TO, 1.11f, 4.66f, +LINE_TO, 8, 11.4f, +CLOSE, +MOVE_TO, 8, 8.06f, CLOSE
diff --git a/chrome/app/vector_icons/bookmarks_manager.icon b/chrome/app/vector_icons/bookmarks_manager.icon index 9ff8962..a65021a 100644 --- a/chrome/app/vector_icons/bookmarks_manager.icon +++ b/chrome/app/vector_icons/bookmarks_manager.icon
@@ -1,65 +1,58 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 20, -MOVE_TO, 3.6f, 14.4f, -V_LINE_TO, 5.6f, -V_LINE_TO, 14.4f, +FILL_RULE_NONZERO, +MOVE_TO, 3.5f, 14.5f, +R_V_LINE_TO, -9, CLOSE, -MOVE_TO, 3.6f, 16.2f, -R_CUBIC_TO, -0.5f, 0, -0.9f, -0.2f, -1.2f, -0.5f, -R_CUBIC_TO, -0.3f, -0.3f, -0.5f, -0.7f, -0.5f, -1.2f, -V_LINE_TO, 5.6f, -R_CUBIC_TO, 0, -0.5f, 0.2f, -0.9f, 0.5f, -1.2f, -CUBIC_TO, 2.7f, 4, 3.1f, 3.8f, 3.6f, 3.8f, -R_H_LINE_TO, 4.4f, -LINE_TO, 10, 5.9f, -R_H_LINE_TO, 6.4f, -R_CUBIC_TO, 0.5f, 0, 0.9f, 0.2f, 1.2f, 0.5f, -R_CUBIC_TO, 0.3f, 0.3f, 0.5f, 0.7f, 0.5f, 1.2f, -R_V_LINE_TO, 2.1f, -R_CUBIC_TO, -0.3f, -0.1f, -0.6f, -0.2f, -0.9f, -0.2f, -R_CUBIC_TO, -0.3f, 0, -0.6f, 0, -0.9f, 0.1f, -V_LINE_TO, 7.6f, -H_LINE_TO, 9.3f, -LINE_TO, 7.2f, 5.6f, -H_LINE_TO, 3.6f, -R_V_LINE_TO, 8.9f, -R_H_LINE_TO, 7.5f, -R_LINE_TO, -0.6f, 0.6f, -R_V_LINE_TO, 1.1f, -CUBIC_TO, 10.5f, 16.2f, 3.6f, 16.2f, 3.6f, 16.2f, +R_MOVE_TO, 0, 1.5f, +R_ARC_TO, 1.45f, 1.45f, 0, 0, 1, -1.05f, -0.44f, +CUBIC_TO, 2.15f, 15.27f, 2, 14.91f, 2, 14.5f, +V_LINE_TO, 5.49f, +R_CUBIC_TO, 0, -0.41f, 0.15f, -0.76f, 0.44f, -1.05f, +ARC_TO, 1.44f, 1.44f, 0, 0, 1, 3.5f, 4, +H_LINE_TO, 8, +R_LINE_TO, 2, 2, +R_H_LINE_TO, 6.5f, +R_CUBIC_TO, 0.41f, 0, 0.77f, 0.15f, 1.06f, 0.44f, +R_CUBIC_TO, 0.29f, 0.29f, 0.44f, 0.65f, 0.44f, 1.06f, +R_V_LINE_TO, 2.19f, +R_ARC_TO, 2.83f, 2.83f, 0, 0, 0, -0.74f, -0.18f, +R_ARC_TO, 1.92f, 1.92f, 0, 0, 0, -0.76f, 0.06f, +V_LINE_TO, 7.5f, +H_LINE_TO, 9.38f, +R_LINE_TO, -2, -2, +H_LINE_TO, 3.5f, +R_V_LINE_TO, 9, +R_H_LINE_TO, 7.52f, +R_LINE_TO, -0.52f, 0.52f, +V_LINE_TO, 16, CLOSE, -MOVE_TO, 12, 18.2f, -R_V_LINE_TO, -2.5f, -R_LINE_TO, 4.4f, -4.4f, -R_CUBIC_TO, 0.1f, -0.1f, 0.2f, -0.2f, 0.4f, -0.2f, -CUBIC_TO, 16.9f, 11, 17, 11, 17.1f, 11, -R_CUBIC_TO, 0.1f, 0, 0.3f, 0, 0.4f, 0.1f, -R_CUBIC_TO, 0.1f, 0.1f, 0.3f, 0.1f, 0.4f, 0.2f, -R_LINE_TO, 0.9f, 0.9f, -R_CUBIC_TO, 0.1f, 0.1f, 0.2f, 0.2f, 0.2f, 0.4f, -R_CUBIC_TO, 0.1f, 0.1f, 0.1f, 0.3f, 0.1f, 0.4f, -R_CUBIC_TO, 0, 0.1f, 0, 0.3f, -0.1f, 0.4f, -R_CUBIC_TO, -0.1f, 0.1f, -0.1f, 0.3f, -0.2f, 0.4f, -R_LINE_TO, -4.4f, 4.4f, -CUBIC_TO, 14.5f, 18.2f, 12, 18.2f, 12, 18.2f, +R_MOVE_TO, 8.5f, 2, +R_V_LINE_TO, -2.35f, +R_LINE_TO, 4.38f, -4.35f, +R_ARC_TO, 0.84f, 0.84f, 0, 0, 1, 0.34f, -0.22f, +R_CUBIC_TO, 0.13f, -0.05f, 0.25f, -0.07f, 0.37f, -0.07f, +R_ARC_TO, 1, 1, 0, 0, 1, 0.72f, 0.29f, +R_LINE_TO, 0.91f, 0.94f, +R_CUBIC_TO, 0.09f, 0.1f, 0.16f, 0.21f, 0.22f, 0.34f, +R_ARC_TO, 0.96f, 0.96f, 0, 0, 1, 0.01f, 0.74f, +R_ARC_TO, 0.81f, 0.81f, 0, 0, 1, -0.22f, 0.34f, +LINE_TO, 14.36f, 18, CLOSE, -MOVE_TO, 18.1f, 13, -R_LINE_TO, -0.9f, -0.9f, -LINE_TO, 18.1f, 13, +R_MOVE_TO, 6, -5.06f, +LINE_TO, 17.06f, 12, CLOSE, -MOVE_TO, 13.1f, 17.1f, -H_LINE_TO, 14, -R_LINE_TO, 2.4f, -2.4f, -R_LINE_TO, -0.5f, -0.5f, -R_LINE_TO, -0.5f, -0.5f, -R_LINE_TO, -2.4f, 2.4f, -V_LINE_TO, 17.1f, +MOVE_TO, 13, 17, +R_H_LINE_TO, 0.94f, +R_LINE_TO, 2.39f, -2.39f, +R_LINE_TO, -0.46f, -0.48f, +R_LINE_TO, -0.46f, -0.46f, +LINE_TO, 13, 16.06f, CLOSE, -MOVE_TO, 15.9f, 14.2f, -R_LINE_TO, -0.5f, -0.5f, -R_LINE_TO, 0.9f, 0.9f, -LINE_TO, 15.9f, 14.2f, -CLOSE \ No newline at end of file +R_MOVE_TO, 2.88f, -2.87f, +R_LINE_TO, -0.46f, -0.46f, +R_LINE_TO, 0.91f, 0.94f, +CLOSE
diff --git a/chrome/app/vector_icons/browser_tools_update_chrome_refresh.icon b/chrome/app/vector_icons/browser_tools_update_chrome_refresh.icon index 3743f86..3768031 100644 --- a/chrome/app/vector_icons/browser_tools_update_chrome_refresh.icon +++ b/chrome/app/vector_icons/browser_tools_update_chrome_refresh.icon
@@ -3,76 +3,77 @@ // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -R_MOVE_TO, 4.11f, 6.58f, -R_LINE_TO, 1.09f, 0.35f, -R_CUBIC_TO, 0.13f, -0.24f, 0.27f, -0.48f, 0.41f, -0.71f, -R_CUBIC_TO, 0.14f, -0.23f, 0.29f, -0.47f, 0.45f, -0.7f, -R_LINE_TO, -0.78f, -0.09f, +FILL_RULE_NONZERO, +R_MOVE_TO, 4.06f, 6.75f, +R_LINE_TO, 1.21f, 0.4f, +R_CUBIC_TO, 0.15f, -0.28f, 0.31f, -0.55f, 0.47f, -0.82f, +R_CUBIC_TO, 0.16f, -0.27f, 0.33f, -0.54f, 0.52f, -0.8f, +R_LINE_TO, -0.86f, -0.1f, CLOSE, -R_MOVE_TO, 2.43f, 1.24f, -LINE_TO, 8.16f, 9.45f, -R_CUBIC_TO, 0.57f, -0.32f, 1.08f, -0.63f, 1.53f, -0.93f, -R_CUBIC_TO, 0.45f, -0.3f, 0.88f, -0.66f, 1.29f, -1.07f, -R_ARC_TO, 9.7f, 9.7f, 0, 0, 0, 1.6f, -2.1f, -R_CUBIC_TO, 0.43f, -0.77f, 0.66f, -1.64f, 0.69f, -2.61f, -R_CUBIC_TO, -0.99f, 0.02f, -1.86f, 0.25f, -2.62f, 0.68f, -R_ARC_TO, 9.72f, 9.72f, 0, 0, 0, -2.09f, 1.59f, -ARC_TO, 9.16f, 9.16f, 0, 0, 0, 7.47f, 6.3f, -R_CUBIC_TO, -0.3f, 0.45f, -0.61f, 0.95f, -0.92f, 1.52f, +R_MOVE_TO, 2.36f, 1.15f, +R_LINE_TO, 1.66f, 1.67f, +R_ARC_TO, 17.77f, 17.77f, 0, 0, 0, 1.52f, -0.92f, +R_ARC_TO, 9.17f, 9.17f, 0, 0, 0, 1.32f, -1.1f, +R_ARC_TO, 9.62f, 9.62f, 0, 0, 0, 1.64f, -2.17f, +R_CUBIC_TO, 0.43f, -0.79f, 0.66f, -1.66f, 0.67f, -2.61f, +R_CUBIC_TO, -0.96f, 0.01f, -1.84f, 0.23f, -2.63f, 0.66f, +R_CUBIC_TO, -0.79f, 0.43f, -1.51f, 0.97f, -2.16f, 1.63f, +R_CUBIC_TO, -0.42f, 0.42f, -0.79f, 0.86f, -1.11f, 1.33f, +R_ARC_TO, 13.83f, 13.83f, 0, 0, 0, -0.91f, 1.52f, CLOSE, -MOVE_TO, 9.49f, 6.52f, -R_ARC_TO, 1.1f, 1.1f, 0, 0, 1, -0.33f, -0.8f, -R_CUBIC_TO, 0, -0.32f, 0.11f, -0.58f, 0.33f, -0.8f, -R_CUBIC_TO, 0.22f, -0.22f, 0.49f, -0.33f, 0.8f, -0.33f, -R_CUBIC_TO, 0.31f, 0, 0.57f, 0.11f, 0.8f, 0.33f, -R_CUBIC_TO, 0.22f, 0.22f, 0.33f, 0.49f, 0.33f, 0.81f, -R_CUBIC_TO, 0, 0.31f, -0.11f, 0.58f, -0.33f, 0.8f, -R_ARC_TO, 1.09f, 1.09f, 0, 0, 1, -0.8f, 0.33f, -R_CUBIC_TO, -0.31f, 0, -0.58f, -0.11f, -0.8f, -0.33f, +R_MOVE_TO, 2.88f, -1.19f, +R_ARC_TO, 1.13f, 1.13f, 0, 0, 1, -0.34f, -0.83f, +R_CUBIC_TO, 0, -0.32f, 0.11f, -0.6f, 0.34f, -0.83f, +R_CUBIC_TO, 0.23f, -0.23f, 0.5f, -0.34f, 0.83f, -0.34f, +R_CUBIC_TO, 0.32f, 0, 0.6f, 0.12f, 0.83f, 0.34f, +R_CUBIC_TO, 0.23f, 0.23f, 0.34f, 0.5f, 0.34f, 0.83f, +R_CUBIC_TO, 0, 0.33f, -0.12f, 0.61f, -0.34f, 0.83f, +R_CUBIC_TO, -0.23f, 0.23f, -0.5f, 0.34f, -0.83f, 0.34f, +R_CUBIC_TO, -0.32f, 0, -0.6f, -0.11f, -0.83f, -0.34f, CLOSE, -R_MOVE_TO, -0.08f, 5.37f, -R_LINE_TO, 1.16f, -1.16f, -R_LINE_TO, -0.09f, -0.78f, -R_ARC_TO, 19.24f, 19.24f, 0, 0, 1, -1.41f, 0.87f, +R_MOVE_TO, -0.05f, 5.23f, +R_LINE_TO, 1.34f, -1.34f, +R_LINE_TO, -0.1f, -0.86f, +R_CUBIC_TO, -0.27f, 0.18f, -0.54f, 0.36f, -0.8f, 0.52f, +R_CUBIC_TO, -0.27f, 0.16f, -0.54f, 0.32f, -0.82f, 0.47f, CLOSE, -R_MOVE_TO, 5.39f, -10.69f, -R_CUBIC_TO, 0.27f, 1.38f, 0.15f, 2.71f, -0.36f, 3.97f, -R_CUBIC_TO, -0.51f, 1.27f, -1.21f, 2.35f, -2.1f, 3.24f, -R_LINE_TO, -0.18f, 0.19f, -R_LINE_TO, -0.18f, 0.19f, -R_LINE_TO, 0.2f, 1.72f, -R_ARC_TO, 1.6f, 1.6f, 0, 0, 1, -0.07f, 0.75f, -R_ARC_TO, 1.61f, 1.61f, 0, 0, 1, -0.41f, 0.65f, -R_LINE_TO, -2.97f, 2.97f, -R_LINE_TO, -1.33f, -3.85f, -R_LINE_TO, -2.4f, -2.42f, -R_LINE_TO, -3.87f, -1.33f, -R_LINE_TO, 2.98f, -2.99f, -R_CUBIC_TO, 0.19f, -0.19f, 0.41f, -0.32f, 0.65f, -0.4f, -R_CUBIC_TO, 0.24f, -0.08f, 0.48f, -0.1f, 0.74f, -0.07f, -R_LINE_TO, 1.72f, 0.22f, -R_CUBIC_TO, 0.01f, -0.01f, 0.08f, -0.07f, 0.2f, -0.18f, -R_CUBIC_TO, 0.12f, -0.11f, 0.19f, -0.17f, 0.2f, -0.18f, -R_CUBIC_TO, 0.9f, -0.89f, 1.97f, -1.6f, 3.23f, -2.11f, -R_CUBIC_TO, 1.25f, -0.52f, 2.57f, -0.63f, 3.96f, -0.35f, +R_MOVE_TO, 5.24f, -10.43f, +R_CUBIC_TO, 0.28f, 1.24f, 0.17f, 2.47f, -0.33f, 3.7f, +R_ARC_TO, 9.47f, 9.47f, 0, 0, 1, -2.1f, 3.19f, +R_CUBIC_TO, 0, 0.01f, -0.05f, 0.06f, -0.15f, 0.16f, +R_LINE_TO, -0.15f, 0.16f, +R_LINE_TO, 0.2f, 1.7f, +R_CUBIC_TO, 0.03f, 0.22f, 0.01f, 0.43f, -0.06f, 0.63f, +R_CUBIC_TO, -0.07f, 0.2f, -0.18f, 0.38f, -0.34f, 0.54f, +R_LINE_TO, -2.89f, 2.89f, +R_LINE_TO, -1.22f, -3.59f, +LINE_TO, 5.12f, 8.57f, +LINE_TO, 1.52f, 7.35f, +R_LINE_TO, 2.9f, -2.91f, +R_CUBIC_TO, 0.16f, -0.16f, 0.34f, -0.27f, 0.54f, -0.34f, +R_CUBIC_TO, 0.2f, -0.07f, 0.41f, -0.09f, 0.63f, -0.06f, +R_LINE_TO, 1.69f, 0.22f, +R_ARC_TO, 39.7f, 39.7f, 0, 0, 1, 0.35f, -0.33f, +R_ARC_TO, 9.59f, 9.59f, 0, 0, 1, 3.17f, -2.1f, +R_CUBIC_TO, 1.22f, -0.5f, 2.44f, -0.61f, 3.68f, -0.32f, CLOSE, -MOVE_TO, 2.58f, 10.53f, -R_CUBIC_TO, 0.42f, -0.4f, 0.9f, -0.59f, 1.46f, -0.59f, -R_CUBIC_TO, 0.56f, 0, 1.04f, 0.22f, 1.46f, 0.64f, -R_CUBIC_TO, 0.4f, 0.4f, 0.6f, 0.86f, 0.6f, 1.41f, -R_ARC_TO, 2.07f, 2.07f, 0, 0, 1, -0.55f, 1.44f, -R_CUBIC_TO, -0.53f, 0.6f, -1.21f, 0.98f, -2.06f, 1.15f, -R_CUBIC_TO, -0.84f, 0.18f, -1.65f, 0.31f, -2.41f, 0.41f, -R_CUBIC_TO, 0.1f, -0.75f, 0.23f, -1.55f, 0.4f, -2.39f, -R_CUBIC_TO, 0.16f, -0.83f, 0.53f, -1.52f, 1.11f, -2.07f, +MOVE_TO, 2.81f, 10.51f, +R_ARC_TO, 1.85f, 1.85f, 0, 0, 1, 1.34f, -0.53f, +R_CUBIC_TO, 0.51f, 0, 0.96f, 0.2f, 1.34f, 0.58f, +R_CUBIC_TO, 0.36f, 0.36f, 0.54f, 0.79f, 0.55f, 1.29f, +R_CUBIC_TO, 0.01f, 0.5f, -0.16f, 0.95f, -0.5f, 1.33f, +R_CUBIC_TO, -0.5f, 0.57f, -1.14f, 0.93f, -1.91f, 1.08f, +R_CUBIC_TO, -0.77f, 0.15f, -1.52f, 0.28f, -2.26f, 0.4f, +R_ARC_TO, 58.28f, 58.28f, 0, 0, 1, 0.39f, -2.23f, +R_ARC_TO, 3.5f, 3.5f, 0, 0, 1, 1.04f, -1.92f, CLOSE, -R_MOVE_TO, 1.06f, 1.26f, -R_CUBIC_TO, -0.18f, 0.18f, -0.28f, 0.36f, -0.32f, 0.54f, -R_ARC_TO, 4.15f, 4.15f, 0, 0, 1, -0.17f, 0.6f, -R_CUBIC_TO, 0.21f, -0.07f, 0.41f, -0.12f, 0.59f, -0.17f, -R_CUBIC_TO, 0.18f, -0.05f, 0.35f, -0.16f, 0.52f, -0.34f, -R_ARC_TO, 0.72f, 0.72f, 0, 0, 0, 0.18f, -0.36f, -R_ARC_TO, 0.36f, 0.36f, 0, 0, 0, -0.11f, -0.34f, -R_ARC_TO, 0.36f, 0.36f, 0, 0, 0, -0.33f, -0.11f, -R_ARC_TO, 0.69f, 0.69f, 0, 0, 0, -0.35f, 0.18f, -CLOSE \ No newline at end of file +R_MOVE_TO, 0.88f, 1.08f, +R_CUBIC_TO, -0.18f, 0.18f, -0.3f, 0.39f, -0.35f, 0.61f, +R_ARC_TO, 6.42f, 6.42f, 0, 0, 1, -0.19f, 0.7f, +R_ARC_TO, 49.4f, 49.4f, 0, 0, 1, 0.69f, -0.19f, +R_CUBIC_TO, 0.22f, -0.06f, 0.42f, -0.18f, 0.59f, -0.36f, +R_ARC_TO, 0.78f, 0.78f, 0, 0, 0, 0.2f, -0.42f, +R_ARC_TO, 0.43f, 0.43f, 0, 0, 0, -0.13f, -0.4f, +R_ARC_TO, 0.44f, 0.44f, 0, 0, 0, -0.39f, -0.14f, +R_ARC_TO, 0.78f, 0.78f, 0, 0, 0, -0.41f, 0.2f, +CLOSE
diff --git a/chrome/app/vector_icons/cast_chrome_refresh.icon b/chrome/app/vector_icons/cast_chrome_refresh.icon index a9ef2c5..ca4c9c9 100644 --- a/chrome/app/vector_icons/cast_chrome_refresh.icon +++ b/chrome/app/vector_icons/cast_chrome_refresh.icon
@@ -1,50 +1,50 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, +FILL_RULE_NONZERO, MOVE_TO, 8, 8, CLOSE, -R_MOVE_TO, 5.09f, 5.12f, -H_LINE_TO, 9.31f, -R_CUBIC_TO, 0, -0.28f, -0.01f, -0.55f, -0.04f, -0.82f, -R_ARC_TO, 8.38f, 8.38f, 0, 0, 0, -0.13f, -0.81f, -R_H_LINE_TO, 3.95f, -V_LINE_TO, 4.51f, -H_LINE_TO, 2.91f, -R_V_LINE_TO, 0.75f, -R_ARC_TO, 8.65f, 8.65f, 0, 0, 0, -0.82f, -0.13f, -R_ARC_TO, 8.23f, 8.23f, 0, 0, 0, -0.82f, -0.04f, -R_V_LINE_TO, -0.57f, -R_CUBIC_TO, 0, -0.45f, 0.16f, -0.84f, 0.47f, -1.16f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 1.16f, -0.48f, -R_H_LINE_TO, 10.17f, -R_CUBIC_TO, 0.46f, 0, 0.84f, 0.16f, 1.16f, 0.48f, -R_CUBIC_TO, 0.32f, 0.32f, 0.47f, 0.7f, 0.47f, 1.16f, -R_V_LINE_TO, 6.98f, -R_CUBIC_TO, 0, 0.46f, -0.16f, 0.84f, -0.47f, 1.16f, -R_ARC_TO, 1.59f, 1.59f, 0, 0, 1, -1.16f, 0.47f, +R_MOVE_TO, 5.15f, 4.93f, +H_LINE_TO, 9.25f, +R_CUBIC_TO, 0, -0.23f, -0.01f, -0.46f, -0.03f, -0.69f, +R_ARC_TO, 8.41f, 8.41f, 0, 0, 0, -0.1f, -0.69f, +R_H_LINE_TO, 4.04f, +V_LINE_TO, 4.45f, +H_LINE_TO, 2.85f, +R_V_LINE_TO, 0.84f, +R_ARC_TO, 7.02f, 7.02f, 0, 0, 0, -1.38f, -0.13f, +V_LINE_TO, 4.45f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.71f, 0.4f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.4f, 0.98f, -0.4f, +R_H_LINE_TO, 10.31f, +R_CUBIC_TO, 0.38f, 0, 0.71f, 0.13f, 0.98f, 0.4f, +R_CUBIC_TO, 0.27f, 0.27f, 0.4f, 0.6f, 0.4f, 0.98f, +R_V_LINE_TO, 7.11f, +R_CUBIC_TO, 0, 0.38f, -0.13f, 0.71f, -0.4f, 0.98f, +R_CUBIC_TO, -0.27f, 0.27f, -0.6f, 0.4f, -0.98f, 0.4f, CLOSE, -R_MOVE_TO, -11.8f, 0, -R_V_LINE_TO, -1.75f, -R_CUBIC_TO, 0.49f, 0, 0.9f, 0.17f, 1.24f, 0.51f, -R_CUBIC_TO, 0.34f, 0.34f, 0.51f, 0.75f, 0.51f, 1.24f, +R_MOVE_TO, -11.69f, 0, +R_V_LINE_TO, -1.66f, +R_CUBIC_TO, 0.46f, 0, 0.86f, 0.16f, 1.18f, 0.48f, +R_CUBIC_TO, 0.32f, 0.32f, 0.48f, 0.72f, 0.48f, 1.18f, CLOSE, -R_MOVE_TO, 2.95f, 0, -R_CUBIC_TO, 0, -0.82f, -0.29f, -1.52f, -0.86f, -2.09f, -R_ARC_TO, 2.85f, 2.85f, 0, 0, 0, -2.09f, -0.86f, -R_V_LINE_TO, -1.34f, -R_CUBIC_TO, 1.19f, 0, 2.2f, 0.42f, 3.04f, 1.25f, -R_CUBIC_TO, 0.84f, 0.83f, 1.25f, 1.85f, 1.25f, 3.04f, +R_MOVE_TO, 2.86f, 0, +R_CUBIC_TO, 0, -0.79f, -0.28f, -1.47f, -0.84f, -2.03f, +R_ARC_TO, 2.78f, 2.78f, 0, 0, 0, -2.03f, -0.84f, +V_LINE_TO, 8.81f, +R_CUBIC_TO, 1.14f, 0, 2.12f, 0.4f, 2.92f, 1.2f, +R_CUBIC_TO, 0.8f, 0.8f, 1.2f, 1.77f, 1.2f, 2.92f, CLOSE, -R_MOVE_TO, 2.54f, 0, -R_CUBIC_TO, 0, -0.76f, -0.14f, -1.47f, -0.43f, -2.13f, -R_ARC_TO, 5.54f, 5.54f, 0, 0, 0, -1.18f, -1.75f, -R_ARC_TO, 5.53f, 5.53f, 0, 0, 0, -1.75f, -1.18f, -R_ARC_TO, 5.35f, 5.35f, 0, 0, 0, -2.13f, -0.43f, -V_LINE_TO, 6.29f, -R_CUBIC_TO, 0.95f, 0, 1.84f, 0.18f, 2.66f, 0.54f, -R_CUBIC_TO, 0.83f, 0.36f, 1.55f, 0.84f, 2.17f, 1.46f, -R_ARC_TO, 6.93f, 6.93f, 0, 0, 1, 1.46f, 2.17f, -R_CUBIC_TO, 0.36f, 0.83f, 0.54f, 1.72f, 0.54f, 2.67f, +R_MOVE_TO, 2.46f, 0, +R_CUBIC_TO, 0, -0.73f, -0.14f, -1.42f, -0.42f, -2.07f, +R_ARC_TO, 5.43f, 5.43f, 0, 0, 0, -1.14f, -1.69f, +R_ARC_TO, 5.42f, 5.42f, 0, 0, 0, -1.69f, -1.14f, +R_ARC_TO, 5.19f, 5.19f, 0, 0, 0, -2.07f, -0.41f, +V_LINE_TO, 6.35f, +R_CUBIC_TO, 0.91f, 0, 1.77f, 0.17f, 2.57f, 0.52f, +R_ARC_TO, 6.64f, 6.64f, 0, 0, 1, 2.09f, 1.41f, +R_ARC_TO, 6.58f, 6.58f, 0, 0, 1, 1.41f, 2.09f, +R_ARC_TO, 6.41f, 6.41f, 0, 0, 1, 0.52f, 2.57f, CLOSE
diff --git a/chrome/app/vector_icons/chrome_labs_chrome_refresh.icon b/chrome/app/vector_icons/chrome_labs_chrome_refresh.icon index b6ddd51..3a1063f 100644 --- a/chrome/app/vector_icons/chrome_labs_chrome_refresh.icon +++ b/chrome/app/vector_icons/chrome_labs_chrome_refresh.icon
@@ -1,43 +1,45 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 20, -MOVE_TO, 4.5f, 17.17f, -R_CUBIC_TO, -0.71f, 0, -1.22f, -0.31f, -1.53f, -0.94f, -R_CUBIC_TO, -0.31f, -0.62f, -0.24f, -1.21f, 0.21f, -1.75f, -LINE_TO, 7.33f, 9.44f, -V_LINE_TO, 4.61f, -R_H_LINE_TO, -0.59f, -R_ARC_TO, 0.85f, 0.85f, 0, 0, 1, -0.61f, -0.25f, -R_ARC_TO, 0.82f, 0.82f, 0, 0, 1, -0.25f, -0.61f, -R_ARC_TO, 0.83f, 0.83f, 0, 0, 1, 0.25f, -0.61f, -R_ARC_TO, 0.82f, 0.82f, 0, 0, 1, 0.61f, -0.25f, -R_H_LINE_TO, 6.53f, -R_CUBIC_TO, 0.24f, 0, 0.45f, 0.08f, 0.61f, 0.25f, -R_ARC_TO, 0.83f, 0.83f, 0, 0, 1, 0.25f, 0.61f, -R_ARC_TO, 0.83f, 0.83f, 0, 0, 1, -0.25f, 0.61f, -R_ARC_TO, 0.82f, 0.82f, 0, 0, 1, -0.61f, 0.25f, -R_H_LINE_TO, -0.6f, -R_V_LINE_TO, 4.83f, -R_LINE_TO, 4.15f, 5.04f, -R_CUBIC_TO, 0.44f, 0.54f, 0.5f, 1.12f, 0.19f, 1.75f, -R_CUBIC_TO, -0.31f, 0.63f, -0.81f, 0.94f, -1.51f, 0.94f, +FILL_RULE_NONZERO, +MOVE_TO, 4.5f, 17, +R_CUBIC_TO, -0.64f, 0, -1.1f, -0.28f, -1.37f, -0.84f, +R_CUBIC_TO, -0.28f, -0.56f, -0.21f, -1.09f, 0.19f, -1.58f, +LINE_TO, 7.5f, 9.5f, +R_V_LINE_TO, -5, +R_H_LINE_TO, -0.75f, +R_CUBIC_TO, -0.21f, 0, -0.39f, -0.07f, -0.53f, -0.21f, +ARC_TO, 0.72f, 0.72f, 0, 0, 1, 6, 3.75f, +R_CUBIC_TO, 0, -0.21f, 0.07f, -0.39f, 0.22f, -0.53f, +ARC_TO, 0.73f, 0.73f, 0, 0, 1, 6.75f, 3, +R_H_LINE_TO, 6.5f, +R_CUBIC_TO, 0.21f, 0, 0.39f, 0.07f, 0.54f, 0.22f, +R_CUBIC_TO, 0.14f, 0.14f, 0.22f, 0.32f, 0.22f, 0.53f, +R_CUBIC_TO, 0, 0.21f, -0.07f, 0.39f, -0.21f, 0.54f, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 1, -0.53f, 0.22f, +R_H_LINE_TO, -0.75f, +R_V_LINE_TO, 5, +R_LINE_TO, 4.19f, 5.08f, +R_CUBIC_TO, 0.39f, 0.49f, 0.45f, 1.01f, 0.17f, 1.57f, +R_CUBIC_TO, -0.28f, 0.56f, -0.73f, 0.84f, -1.35f, 0.84f, CLOSE, -R_MOVE_TO, 0.13f, -1.73f, -H_LINE_TO, 15.37f, -R_LINE_TO, -4.43f, -5.42f, -R_V_LINE_TO, -5.41f, -H_LINE_TO, 9.06f, -R_V_LINE_TO, 5.41f, +R_MOVE_TO, 0, -1.5f, +R_H_LINE_TO, 11, +LINE_TO, 11, 10, +V_LINE_TO, 4.5f, +H_LINE_TO, 9, +V_LINE_TO, 10, CLOSE, -R_MOVE_TO, 5.39f, -5.42f, +R_MOVE_TO, 5.52f, -5.5f, CLOSE CANVAS_DIMENSIONS, 16, +FILL_RULE_NONZERO, MOVE_TO, 3.6f, 13.73f, -R_CUBIC_TO, -0.56f, 0, -0.96f, -0.25f, -1.21f, -0.75f, -R_CUBIC_TO, -0.25f, -0.5f, -0.2f, -0.97f, 0.15f, -1.4f, +R_CUBIC_TO, -0.57f, 0, -0.98f, -0.25f, -1.22f, -0.75f, +R_CUBIC_TO, -0.25f, -0.5f, -0.19f, -0.97f, 0.17f, -1.41f, R_LINE_TO, 3.32f, -4.03f, V_LINE_TO, 3.69f, R_H_LINE_TO, -0.47f, @@ -53,18 +55,15 @@ R_H_LINE_TO, -0.48f, R_V_LINE_TO, 3.86f, R_LINE_TO, 3.32f, 4.03f, -R_CUBIC_TO, 0.36f, 0.43f, 0.41f, 0.9f, 0.17f, 1.41f, -R_CUBIC_TO, -0.25f, 0.5f, -0.65f, 0.75f, -1.22f, 0.75f, +R_CUBIC_TO, 0.35f, 0.43f, 0.4f, 0.9f, 0.15f, 1.4f, +R_CUBIC_TO, -0.25f, 0.5f, -0.65f, 0.75f, -1.21f, 0.75f, CLOSE, -R_MOVE_TO, 1.8f, -2.18f, -R_H_LINE_TO, 5.2f, -LINE_TO, 8.61f, 9.11f, -H_LINE_TO, 7.39f, -CLOSE, -R_MOVE_TO, -1.7f, 0.8f, +R_MOVE_TO, 0.1f, -1.38f, R_H_LINE_TO, 8.59f, LINE_TO, 8.75f, 8.02f, V_LINE_TO, 3.69f, H_LINE_TO, 7.25f, V_LINE_TO, 8.02f, +CLOSE, +MOVE_TO, 8.02f, 8.02f, CLOSE
diff --git a/chrome/app/vector_icons/copy_menu.icon b/chrome/app/vector_icons/copy_menu.icon index a7cb611..b228389 100644 --- a/chrome/app/vector_icons/copy_menu.icon +++ b/chrome/app/vector_icons/copy_menu.icon
@@ -1,30 +1,36 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 3.5f, 13.5f, -H_LINE_TO, 11, -V_LINE_TO, 15, -H_LINE_TO, 3, -R_CUBIC_TO, -0.55f, 0, -1, -0.45f, -1, -1, -V_LINE_TO, 4, -R_H_LINE_TO, 1.5f, -R_V_LINE_TO, 9.5f, +FILL_RULE_NONZERO, +MOVE_TO, 6.14f, 12.04f, +R_CUBIC_TO, -0.38f, 0, -0.71f, -0.13f, -0.98f, -0.4f, +R_ARC_TO, 1.34f, 1.34f, 0, 0, 1, -0.4f, -0.98f, +V_LINE_TO, 2.76f, +R_CUBIC_TO, 0, -0.39f, 0.13f, -0.71f, 0.4f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.41f, 0.98f, -0.41f, +R_H_LINE_TO, 6.31f, +R_CUBIC_TO, 0.38f, 0, 0.71f, 0.14f, 0.98f, 0.41f, +R_CUBIC_TO, 0.27f, 0.27f, 0.41f, 0.59f, 0.41f, 0.98f, +R_V_LINE_TO, 7.9f, +R_CUBIC_TO, 0, 0.38f, -0.14f, 0.71f, -0.41f, 0.98f, +R_CUBIC_TO, -0.27f, 0.27f, -0.59f, 0.4f, -0.98f, 0.4f, CLOSE, -MOVE_TO, 14, 2, -R_V_LINE_TO, 9, -R_CUBIC_TO, 0, 0.55f, -0.45f, 1, -1, 1, -H_LINE_TO, 6, -R_CUBIC_TO, -0.55f, 0, -1, -0.45f, -1, -1, -V_LINE_TO, 2, -R_CUBIC_TO, 0, -0.55f, 0.45f, -1, 1, -1, -R_H_LINE_TO, 7, -R_CUBIC_TO, 0.55f, 0, 1, 0.45f, 1, 1, +R_MOVE_TO, 0, -1.38f, +R_H_LINE_TO, 6.31f, +V_LINE_TO, 2.76f, +H_LINE_TO, 6.14f, CLOSE, -R_MOVE_TO, -1.5f, 0.5f, -R_H_LINE_TO, -6, -R_V_LINE_TO, 8, -R_H_LINE_TO, 6, -R_V_LINE_TO, -8, +MOVE_TO, 3.56f, 14.63f, +R_ARC_TO, 1.33f, 1.33f, 0, 0, 1, -0.98f, -0.41f, +R_ARC_TO, 1.33f, 1.33f, 0, 0, 1, -0.41f, -0.98f, +V_LINE_TO, 3.96f, +R_H_LINE_TO, 1.38f, +R_V_LINE_TO, 9.29f, +R_H_LINE_TO, 7.69f, +R_V_LINE_TO, 1.39f, +CLOSE, +MOVE_TO, 6.14f, 10.66f, +V_LINE_TO, 2.76f, CLOSE
diff --git a/chrome/app/vector_icons/credit_card_chrome_refresh.icon b/chrome/app/vector_icons/credit_card_chrome_refresh.icon index b32eb1a..fcc4563f 100644 --- a/chrome/app/vector_icons/credit_card_chrome_refresh.icon +++ b/chrome/app/vector_icons/credit_card_chrome_refresh.icon
@@ -1,32 +1,33 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 20, -MOVE_TO, 18.17f, 5.56f, -R_V_LINE_TO, 8.88f, -R_CUBIC_TO, 0, 0.47f, -0.17f, 0.88f, -0.5f, 1.22f, -R_ARC_TO, 1.65f, 1.65f, 0, 0, 1, -1.22f, 0.51f, -H_LINE_TO, 3.56f, -R_CUBIC_TO, -0.47f, 0, -0.87f, -0.17f, -1.22f, -0.51f, -R_ARC_TO, 1.65f, 1.65f, 0, 0, 1, -0.51f, -1.22f, -V_LINE_TO, 5.56f, -R_CUBIC_TO, 0, -0.47f, 0.17f, -0.87f, 0.51f, -1.22f, -R_CUBIC_TO, 0.34f, -0.34f, 0.75f, -0.51f, 1.22f, -0.51f, -H_LINE_TO, 16.44f, -R_CUBIC_TO, 0.48f, 0, 0.89f, 0.17f, 1.22f, 0.51f, -R_CUBIC_TO, 0.34f, 0.34f, 0.5f, 0.75f, 0.5f, 1.22f, +FILL_RULE_NONZERO, +MOVE_TO, 18, 5.5f, +R_V_LINE_TO, 9, +R_CUBIC_TO, 0, 0.4f, -0.15f, 0.75f, -0.44f, 1.05f, +R_CUBIC_TO, -0.29f, 0.3f, -0.64f, 0.45f, -1.06f, 0.45f, +R_H_LINE_TO, -13, +R_CUBIC_TO, -0.4f, 0, -0.75f, -0.15f, -1.05f, -0.45f, +R_CUBIC_TO, -0.3f, -0.3f, -0.45f, -0.65f, -0.45f, -1.05f, +R_V_LINE_TO, -9, +R_CUBIC_TO, 0, -0.4f, 0.15f, -0.75f, 0.45f, -1.05f, +R_CUBIC_TO, 0.3f, -0.3f, 0.65f, -0.45f, 1.05f, -0.45f, +R_H_LINE_TO, 13, +R_CUBIC_TO, 0.41f, 0, 0.77f, 0.15f, 1.06f, 0.45f, +R_CUBIC_TO, 0.29f, 0.3f, 0.44f, 0.65f, 0.44f, 1.05f, CLOSE, -MOVE_TO, 3.56f, 6.98f, -R_H_LINE_TO, 12.88f, -V_LINE_TO, 5.56f, -H_LINE_TO, 3.56f, +MOVE_TO, 3.5f, 7, +R_H_LINE_TO, 13, +V_LINE_TO, 5.5f, +R_H_LINE_TO, -13, CLOSE, R_MOVE_TO, 0, 3, -R_V_LINE_TO, 4.46f, -R_H_LINE_TO, 12.88f, -V_LINE_TO, 9.98f, +R_V_LINE_TO, 4.5f, +R_H_LINE_TO, 13, +V_LINE_TO, 10, CLOSE, -R_MOVE_TO, 0, 4.46f, -V_LINE_TO, 5.56f, +R_MOVE_TO, 0, 4.5f, +R_V_LINE_TO, -9, CLOSE
diff --git a/chrome/app/vector_icons/cut_menu.icon b/chrome/app/vector_icons/cut_menu.icon index 36d3d86..2c05c49 100644 --- a/chrome/app/vector_icons/cut_menu.icon +++ b/chrome/app/vector_icons/cut_menu.icon
@@ -1,48 +1,67 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 12.94f, 2, -LINE_TO, 8.68f, 6.24f, -R_LINE_TO, 1.06f, 1.05f, -LINE_TO, 15, 2.06f, -V_LINE_TO, 2, -R_H_LINE_TO, -2.06f, +FILL_RULE_NONZERO, +MOVE_TO, 12.36f, 13.66f, +LINE_TO, 7.98f, 9.3f, +LINE_TO, 6.58f, 10.72f, +R_CUBIC_TO, 0.08f, 0.18f, 0.14f, 0.35f, 0.18f, 0.54f, +R_CUBIC_TO, 0.04f, 0.18f, 0.06f, 0.36f, 0.06f, 0.54f, +R_CUBIC_TO, 0, 0.74f, -0.25f, 1.36f, -0.76f, 1.87f, +R_CUBIC_TO, -0.51f, 0.51f, -1.13f, 0.77f, -1.87f, 0.77f, +R_ARC_TO, 2.54f, 2.54f, 0, 0, 1, -1.86f, -0.77f, +R_ARC_TO, 2.53f, 2.53f, 0, 0, 1, -0.77f, -1.86f, +R_CUBIC_TO, 0, -0.73f, 0.26f, -1.36f, 0.77f, -1.87f, +R_CUBIC_TO, 0.51f, -0.51f, 1.13f, -0.77f, 1.87f, -0.77f, +R_CUBIC_TO, 0.18f, 0, 0.36f, 0.02f, 0.54f, 0.07f, +R_CUBIC_TO, 0.18f, 0.04f, 0.36f, 0.11f, 0.54f, 0.18f, +R_LINE_TO, 1.42f, -1.4f, +R_LINE_TO, -1.42f, -1.42f, +R_CUBIC_TO, -0.18f, 0.08f, -0.36f, 0.14f, -0.54f, 0.18f, +R_CUBIC_TO, -0.18f, 0.04f, -0.36f, 0.05f, -0.54f, 0.05f, +R_CUBIC_TO, -0.74f, 0, -1.36f, -0.25f, -1.87f, -0.77f, +ARC_TO, 2.55f, 2.55f, 0, 0, 1, 1.55f, 4.2f, +R_CUBIC_TO, 0, -0.73f, 0.26f, -1.35f, 0.77f, -1.86f, +R_ARC_TO, 2.53f, 2.53f, 0, 0, 1, 1.86f, -0.77f, +R_CUBIC_TO, 0.73f, 0, 1.36f, 0.26f, 1.87f, 0.77f, +R_ARC_TO, 2.55f, 2.55f, 0, 0, 1, 0.77f, 1.87f, +R_CUBIC_TO, 0, 0.18f, -0.02f, 0.36f, -0.06f, 0.54f, +R_ARC_TO, 2.26f, 2.26f, 0, 0, 1, -0.18f, 0.53f, +R_LINE_TO, 7.86f, 7.83f, +R_V_LINE_TO, 0.55f, CLOSE, -NEW_PATH, -MOVE_TO, 4, 2.5f, -R_CUBIC_TO, 0.83f, 0, 1.5f, 0.67f, 1.5f, 1.5f, -R_CUBIC_TO, 0, 0.26f, -0.07f, 0.52f, -0.22f, 0.77f, -R_LINE_TO, -0.2f, 0.33f, -R_LINE_TO, -0.34f, 0.2f, -R_CUBIC_TO, -0.24f, 0.14f, -0.49f, 0.21f, -0.74f, 0.21f, -R_CUBIC_TO, -0.83f, 0, -1.5f, -0.67f, -1.5f, -1.5f, -CUBIC_TO_SHORTHAND, 3.17f, 2.51f, 4, 2.5f, -R_MOVE_TO, 0, 8.01f, -R_CUBIC_TO, 0.25f, 0, 0.5f, 0.07f, 0.74f, 0.21f, -R_LINE_TO, 0.34f, 0.2f, -R_LINE_TO, 0.2f, 0.33f, -R_CUBIC_TO, 0.15f, 0.25f, 0.22f, 0.5f, 0.22f, 0.77f, -R_CUBIC_TO, 0, 0.83f, -0.67f, 1.5f, -1.5f, 1.5f, -R_CUBIC_TO, -0.83f, 0, -1.5f, -0.67f, -1.5f, -1.5f, -R_CUBIC_TO, 0, -0.83f, 0.67f, -1.5f, 1.5f, -1.5f, -MOVE_TO, 4, 1, -CUBIC_TO, 2.34f, 1, 1, 2.34f, 1, 4, -R_CUBIC_TO, 0, 1.66f, 1.34f, 3, 3, 3, -R_CUBIC_TO, 0.55f, 0, 1.05f, -0.16f, 1.49f, -0.41f, -LINE_TO, 6.91f, 8, -LINE_TO, 5.49f, 9.41f, -CUBIC_TO, 5.05f, 9.16f, 4.54f, 9, 4, 9, -R_CUBIC_TO, -1.66f, 0, -3, 1.34f, -3, 3, -R_CUBIC_TO, 0, 1.66f, 1.34f, 3, 3, 3, -R_CUBIC_TO, 1.66f, 0, 3, -1.34f, 3, -3, -R_CUBIC_TO, 0, -0.57f, -0.17f, -1.09f, -0.44f, -1.54f, -R_LINE_TO, 1.41f, -1.4f, -LINE_TO, 12.94f, 14, -H_LINE_TO, 15, -R_V_LINE_TO, -0.06f, -R_LINE_TO, -8.44f, -8.4f, -CUBIC_TO, 6.83f, 5.09f, 7, 4.57f, 7, 4, -R_CUBIC_TO, 0, -1.66f, -1.34f, -3, -3, -3, +MOVE_TO, 9.99f, 7.33f, +R_LINE_TO, -1.32f, -1.32f, +R_LINE_TO, 3.69f, -3.68f, +R_H_LINE_TO, 2.09f, +R_V_LINE_TO, 0.55f, +CLOSE, +R_MOVE_TO, -5.8f, -1.77f, +R_CUBIC_TO, 0.38f, 0, 0.7f, -0.13f, 0.97f, -0.4f, +R_CUBIC_TO, 0.27f, -0.27f, 0.4f, -0.59f, 0.4f, -0.97f, +R_ARC_TO, 1.3f, 1.3f, 0, 0, 0, -0.4f, -0.96f, +R_ARC_TO, 1.34f, 1.34f, 0, 0, 0, -0.97f, -0.4f, +R_ARC_TO, 1.3f, 1.3f, 0, 0, 0, -0.96f, 0.4f, +R_CUBIC_TO, -0.27f, 0.27f, -0.4f, 0.59f, -0.4f, 0.97f, +R_CUBIC_TO, 0, 0.38f, 0.13f, 0.7f, 0.4f, 0.96f, +R_CUBIC_TO, 0.27f, 0.26f, 0.59f, 0.4f, 0.97f, 0.4f, +CLOSE, +R_MOVE_TO, 3.8f, 2.93f, +R_CUBIC_TO, 0.13f, 0, 0.25f, -0.05f, 0.34f, -0.14f, +R_ARC_TO, 0.48f, 0.48f, 0, 0, 0, 0, -0.7f, +R_ARC_TO, 0.48f, 0.48f, 0, 0, 0, -0.34f, -0.14f, +R_ARC_TO, 0.49f, 0.49f, 0, 0, 0, -0.35f, 0.84f, +R_ARC_TO, 0.49f, 0.49f, 0, 0, 0, 0.35f, 0.14f, +CLOSE, +R_MOVE_TO, -3.8f, 4.68f, +R_CUBIC_TO, 0.38f, 0, 0.7f, -0.13f, 0.97f, -0.4f, +R_CUBIC_TO, 0.27f, -0.27f, 0.4f, -0.59f, 0.4f, -0.97f, +R_ARC_TO, 1.3f, 1.3f, 0, 0, 0, -0.4f, -0.96f, +R_ARC_TO, 1.34f, 1.34f, 0, 0, 0, -0.97f, -0.4f, +R_ARC_TO, 1.3f, 1.3f, 0, 0, 0, -0.96f, 0.4f, +R_CUBIC_TO, -0.27f, 0.27f, -0.4f, 0.59f, -0.4f, 0.97f, +R_CUBIC_TO, 0, 0.38f, 0.13f, 0.7f, 0.4f, 0.97f, +R_CUBIC_TO, 0.27f, 0.27f, 0.59f, 0.4f, 0.97f, 0.4f, CLOSE
diff --git a/chrome/app/vector_icons/desktop_windows_chrome_refresh.icon b/chrome/app/vector_icons/desktop_windows_chrome_refresh.icon index fc11bbd5..55fa601 100644 --- a/chrome/app/vector_icons/desktop_windows_chrome_refresh.icon +++ b/chrome/app/vector_icons/desktop_windows_chrome_refresh.icon
@@ -1,34 +1,35 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 5.46f, 13.9f, -V_LINE_TO, 12.27f, -H_LINE_TO, 6.66f, +FILL_RULE_NONZERO, +MOVE_TO, 5.54f, 13.72f, +R_V_LINE_TO, -1.38f, +R_H_LINE_TO, 1.2f, R_V_LINE_TO, -1.2f, -H_LINE_TO, 2.91f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, -1.16f, -0.48f, -R_ARC_TO, 1.57f, 1.57f, 0, 0, 1, -0.47f, -1.16f, -V_LINE_TO, 3.71f, -R_CUBIC_TO, 0, -0.46f, 0.16f, -0.84f, 0.47f, -1.16f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 1.16f, -0.47f, -R_H_LINE_TO, 10.17f, -R_CUBIC_TO, 0.46f, 0, 0.84f, 0.16f, 1.16f, 0.47f, -R_CUBIC_TO, 0.32f, 0.32f, 0.47f, 0.7f, 0.47f, 1.16f, -R_V_LINE_TO, 5.73f, -R_CUBIC_TO, 0, 0.45f, -0.16f, 0.84f, -0.47f, 1.16f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, -1.16f, 0.48f, -H_LINE_TO, 9.34f, +R_H_LINE_TO, -3.89f, +R_CUBIC_TO, -0.38f, 0, -0.71f, -0.14f, -0.98f, -0.41f, +R_ARC_TO, 1.33f, 1.33f, 0, 0, 1, -0.4f, -0.98f, +V_LINE_TO, 3.64f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.71f, 0.4f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.41f, 0.98f, -0.41f, +R_H_LINE_TO, 10.31f, +R_CUBIC_TO, 0.38f, 0, 0.71f, 0.14f, 0.98f, 0.41f, +R_CUBIC_TO, 0.27f, 0.27f, 0.4f, 0.6f, 0.4f, 0.98f, +R_V_LINE_TO, 6.12f, +R_CUBIC_TO, 0, 0.38f, -0.13f, 0.71f, -0.4f, 0.98f, +R_CUBIC_TO, -0.27f, 0.27f, -0.6f, 0.41f, -0.98f, 0.41f, +H_LINE_TO, 9.26f, R_V_LINE_TO, 1.2f, R_H_LINE_TO, 1.2f, -R_V_LINE_TO, 1.63f, +R_V_LINE_TO, 1.38f, CLOSE, -MOVE_TO, 2.91f, 9.44f, -R_H_LINE_TO, 10.17f, -V_LINE_TO, 3.71f, -H_LINE_TO, 2.91f, +MOVE_TO, 2.85f, 9.75f, +R_H_LINE_TO, 10.3f, +V_LINE_TO, 3.64f, +H_LINE_TO, 2.85f, CLOSE, R_MOVE_TO, 0, 0, -V_LINE_TO, 3.71f, +V_LINE_TO, 3.64f, CLOSE
diff --git a/chrome/app/vector_icons/devices_chrome_refresh.icon b/chrome/app/vector_icons/devices_chrome_refresh.icon index 34cc7ba..17c3b50a 100644 --- a/chrome/app/vector_icons/devices_chrome_refresh.icon +++ b/chrome/app/vector_icons/devices_chrome_refresh.icon
@@ -1,71 +1,75 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 20, -MOVE_TO, 1.93f, 16.23f, -V_LINE_TO, 14, +FILL_RULE_NONZERO, +MOVE_TO, 2, 16, +R_V_LINE_TO, -2, R_H_LINE_TO, 2, V_LINE_TO, 5.5f, -R_CUBIC_TO, 0, -0.48f, 0.17f, -0.89f, 0.5f, -1.22f, -R_CUBIC_TO, 0.34f, -0.34f, 0.75f, -0.51f, 1.23f, -0.51f, +R_CUBIC_TO, 0, -0.41f, 0.15f, -0.77f, 0.44f, -1.06f, +ARC_TO, 1.44f, 1.44f, 0, 0, 1, 5.5f, 4, H_LINE_TO, 17, -V_LINE_TO, 5.5f, -H_LINE_TO, 5.66f, +R_V_LINE_TO, 1.5f, +H_LINE_TO, 5.5f, V_LINE_TO, 14, -R_H_LINE_TO, 4.27f, -R_V_LINE_TO, 2.23f, +H_LINE_TO, 10, +R_V_LINE_TO, 2, CLOSE, -R_MOVE_TO, 10.96f, 0, -R_CUBIC_TO, -0.3f, 0, -0.54f, -0.1f, -0.74f, -0.3f, -R_CUBIC_TO, -0.2f, -0.2f, -0.3f, -0.45f, -0.3f, -0.74f, -V_LINE_TO, 7.96f, -R_CUBIC_TO, 0, -0.29f, 0.1f, -0.54f, 0.3f, -0.74f, -R_CUBIC_TO, 0.2f, -0.2f, 0.45f, -0.3f, 0.74f, -0.3f, -R_H_LINE_TO, 4.15f, -R_CUBIC_TO, 0.29f, 0, 0.54f, 0.1f, 0.74f, 0.3f, -R_CUBIC_TO, 0.2f, 0.2f, 0.3f, 0.45f, 0.3f, 0.74f, -R_V_LINE_TO, 7.23f, -R_CUBIC_TO, 0, 0.3f, -0.1f, 0.54f, -0.3f, 0.74f, -R_CUBIC_TO, -0.2f, 0.2f, -0.44f, 0.3f, -0.74f, 0.3f, +R_MOVE_TO, 10.76f, 0, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 1, -0.54f, -0.21f, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 1, -0.22f, -0.53f, +V_LINE_TO, 7.76f, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 1, 0.22f, -0.54f, +ARC_TO, 0.73f, 0.73f, 0, 0, 1, 12.75f, 7, +R_H_LINE_TO, 4.49f, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 1, 0.54f, 0.22f, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 1, 0.22f, 0.54f, +R_V_LINE_TO, 7.49f, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 1, -0.21f, 0.54f, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 1, -0.53f, 0.22f, CLOSE, -R_MOVE_TO, 0.54f, -2.23f, -H_LINE_TO, 16.5f, +R_MOVE_TO, 0.74f, -2, +R_H_LINE_TO, 3, V_LINE_TO, 8.5f, -R_H_LINE_TO, -3.07f, +R_H_LINE_TO, -3, +CLOSE, +R_MOVE_TO, 0, 0, +R_H_LINE_TO, 3, CLOSE CANVAS_DIMENSIONS, 16, -MOVE_TO, 1.46f, 13.23f, -V_LINE_TO, 11.2f, +FILL_RULE_NONZERO, +MOVE_TO, 1.47f, 12.93f, +R_V_LINE_TO, -1.78f, R_H_LINE_TO, 1.6f, -V_LINE_TO, 4.4f, -R_CUBIC_TO, 0, -0.45f, 0.16f, -0.84f, 0.48f, -1.16f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 1.16f, -0.48f, -R_H_LINE_TO, 8.91f, -R_V_LINE_TO, 1.63f, -R_H_LINE_TO, -8.91f, -V_LINE_TO, 11.2f, -H_LINE_TO, 7.86f, -R_V_LINE_TO, 2.04f, +V_LINE_TO, 4.45f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.71f, 0.4f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.4f, 0.98f, -0.4f, +R_H_LINE_TO, 9.29f, +V_LINE_TO, 4.45f, +H_LINE_TO, 4.45f, +R_V_LINE_TO, 6.7f, +R_H_LINE_TO, 3.5f, +R_V_LINE_TO, 1.78f, CLOSE, -R_MOVE_TO, 8.73f, 0, -R_ARC_TO, 0.85f, 0.85f, 0, 0, 1, -0.62f, -0.25f, -R_ARC_TO, 0.84f, 0.84f, 0, 0, 1, -0.25f, -0.62f, -V_LINE_TO, 6.32f, -R_CUBIC_TO, 0, -0.25f, 0.08f, -0.45f, 0.25f, -0.62f, -R_ARC_TO, 0.86f, 0.86f, 0, 0, 1, 0.63f, -0.25f, -R_H_LINE_TO, 3.49f, -R_CUBIC_TO, 0.25f, 0, 0.45f, 0.09f, 0.62f, 0.25f, -R_CUBIC_TO, 0.16f, 0.17f, 0.25f, 0.37f, 0.25f, 0.62f, -R_V_LINE_TO, 6.04f, -R_ARC_TO, 0.86f, 0.86f, 0, 0, 1, -0.25f, 0.62f, -R_ARC_TO, 0.84f, 0.84f, 0, 0, 1, -0.62f, 0.25f, +R_MOVE_TO, 8.79f, 0, +R_ARC_TO, 0.68f, 0.68f, 0, 0, 1, -0.7f, -0.69f, +V_LINE_TO, 6.34f, +R_CUBIC_TO, 0, -0.19f, 0.07f, -0.36f, 0.2f, -0.49f, +R_ARC_TO, 0.66f, 0.66f, 0, 0, 1, 0.49f, -0.2f, +R_H_LINE_TO, 3.6f, +R_CUBIC_TO, 0.19f, 0, 0.36f, 0.07f, 0.49f, 0.2f, +R_ARC_TO, 0.66f, 0.66f, 0, 0, 1, 0.2f, 0.49f, +R_V_LINE_TO, 5.9f, +R_ARC_TO, 0.68f, 0.68f, 0, 0, 1, -0.69f, 0.7f, CLOSE, -R_MOVE_TO, 0.48f, -2.03f, -R_H_LINE_TO, 2.54f, -V_LINE_TO, 6.8f, -R_H_LINE_TO, -2.54f, +R_MOVE_TO, 0.61f, -1.78f, +R_H_LINE_TO, 2.38f, +V_LINE_TO, 6.95f, +R_H_LINE_TO, -2.37f, CLOSE, R_MOVE_TO, 0, 0, +R_H_LINE_TO, 2.38f, CLOSE
diff --git a/chrome/app/vector_icons/download_menu.icon b/chrome/app/vector_icons/download_menu.icon index f815c8e..1ad3104 100644 --- a/chrome/app/vector_icons/download_menu.icon +++ b/chrome/app/vector_icons/download_menu.icon
@@ -1,28 +1,29 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 11.5f, 10, -R_V_LINE_TO, 1.5f, -R_H_LINE_TO, -7, -V_LINE_TO, 10, -H_LINE_TO, 3, -R_V_LINE_TO, 2, -R_CUBIC_TO, 0, 0.55f, 0.45f, 1, 1, 1, -R_H_LINE_TO, 8, -R_CUBIC_TO, 0.55f, 0, 1, -0.45f, 1, -1, -R_V_LINE_TO, -2, -R_H_LINE_TO, -1.5f, +FILL_RULE_NONZERO, +MOVE_TO, 8, 10.35f, +LINE_TO, 4.61f, 6.96f, +R_LINE_TO, 0.98f, -0.97f, +R_LINE_TO, 1.72f, 1.72f, +V_LINE_TO, 2.27f, +H_LINE_TO, 8.69f, +V_LINE_TO, 7.71f, +R_LINE_TO, 1.72f, -1.72f, +R_LINE_TO, 0.98f, 0.97f, CLOSE, -R_MOVE_TO, 0, -3.44f, -LINE_TO, 10.44f, 5.5f, -LINE_TO, 8.75f, 7.15f, -V_LINE_TO, 2, -R_H_LINE_TO, -1.5f, -R_V_LINE_TO, 5.15f, -LINE_TO, 5.56f, 5.5f, -LINE_TO, 4.5f, 6.56f, -LINE_TO, 8, 10, -R_LINE_TO, 3.5f, -3.44f, -CLOSE \ No newline at end of file +R_MOVE_TO, -3.56f, 2.58f, +R_CUBIC_TO, -0.38f, 0, -0.71f, -0.13f, -0.98f, -0.4f, +R_ARC_TO, 1.35f, 1.35f, 0, 0, 1, -0.4f, -0.98f, +R_V_LINE_TO, -1.2f, +H_LINE_TO, 4.45f, +R_V_LINE_TO, 1.2f, +R_H_LINE_TO, 7.1f, +R_V_LINE_TO, -1.2f, +R_H_LINE_TO, 1.38f, +R_V_LINE_TO, 1.2f, +R_CUBIC_TO, 0, 0.38f, -0.13f, 0.71f, -0.4f, 0.98f, +R_CUBIC_TO, -0.27f, 0.27f, -0.6f, 0.4f, -0.98f, 0.4f, +CLOSE
diff --git a/chrome/app/vector_icons/drive_shortcut_chrome_refresh.icon b/chrome/app/vector_icons/drive_shortcut_chrome_refresh.icon index b21ec37f..f4fbde02 100644 --- a/chrome/app/vector_icons/drive_shortcut_chrome_refresh.icon +++ b/chrome/app/vector_icons/drive_shortcut_chrome_refresh.icon
@@ -1,21 +1,22 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 10.62f, 14.82f, -R_CUBIC_TO, -1.58f, -0.42f, -2.87f, -1.24f, -3.87f, -2.47f, -R_CUBIC_TO, -1, -1.23f, -1.5f, -2.68f, -1.5f, -4.35f, -R_CUBIC_TO, 0, -0.98f, 0.2f, -1.92f, 0.61f, -2.81f, -R_ARC_TO, 7.11f, 7.11f, 0, 0, 1, 1.67f, -2.31f, -R_H_LINE_TO, -2.14f, -V_LINE_TO, 1.24f, -R_H_LINE_TO, 5.23f, -R_V_LINE_TO, 5.24f, -H_LINE_TO, 8.98f, -V_LINE_TO, 3.77f, -R_ARC_TO, 5.88f, 5.88f, 0, 0, 0, -1.52f, 1.86f, -ARC_TO, 4.95f, 4.95f, 0, 0, 0, 6.88f, 8, -R_CUBIC_TO, 0, 1.2f, 0.35f, 2.26f, 1.04f, 3.17f, -R_CUBIC_TO, 0.69f, 0.91f, 1.59f, 1.56f, 2.7f, 1.94f, +FILL_RULE_NONZERO, +MOVE_TO, 10.49f, 14.54f, +R_CUBIC_TO, -1.49f, -0.41f, -2.7f, -1.22f, -3.64f, -2.43f, +R_ARC_TO, 6.55f, 6.55f, 0, 0, 1, -1.4f, -4.11f, +R_CUBIC_TO, 0, -0.99f, 0.21f, -1.93f, 0.63f, -2.83f, +R_ARC_TO, 6.6f, 6.6f, 0, 0, 1, 1.78f, -2.31f, +H_LINE_TO, 5.51f, +V_LINE_TO, 1.47f, +R_H_LINE_TO, 4.98f, +R_V_LINE_TO, 4.98f, +H_LINE_TO, 9.11f, +V_LINE_TO, 3.63f, +R_ARC_TO, 5.56f, 5.56f, 0, 0, 0, -1.66f, 1.91f, +R_ARC_TO, 5.12f, 5.12f, 0, 0, 0, -0.61f, 2.44f, +R_CUBIC_TO, 0, 1.16f, 0.34f, 2.2f, 1.01f, 3.13f, +R_ARC_TO, 5.37f, 5.37f, 0, 0, 0, 2.65f, 1.96f, CLOSE
diff --git a/chrome/app/vector_icons/exit_menu.icon b/chrome/app/vector_icons/exit_menu.icon index 28aecbc..db199250 100644 --- a/chrome/app/vector_icons/exit_menu.icon +++ b/chrome/app/vector_icons/exit_menu.icon
@@ -1,36 +1,37 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 3.72f, 13.92f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, -1.16f, -0.48f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, -0.48f, -1.16f, -V_LINE_TO, 9.82f, -R_H_LINE_TO, 1.64f, -R_V_LINE_TO, 2.47f, -R_H_LINE_TO, 8.57f, -V_LINE_TO, 3.71f, -R_H_LINE_TO, -8.57f, -R_V_LINE_TO, 2.47f, -H_LINE_TO, 2.08f, -R_V_LINE_TO, -2.47f, -R_CUBIC_TO, 0, -0.46f, 0.16f, -0.84f, 0.48f, -1.16f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 1.16f, -0.48f, -R_H_LINE_TO, 8.57f, -R_CUBIC_TO, 0.46f, 0, 0.84f, 0.16f, 1.16f, 0.48f, -R_CUBIC_TO, 0.32f, 0.32f, 0.48f, 0.7f, 0.48f, 1.16f, -R_V_LINE_TO, 8.57f, -R_CUBIC_TO, 0, 0.46f, -0.16f, 0.84f, -0.48f, 1.16f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, -1.16f, 0.48f, +FILL_RULE_NONZERO, +MOVE_TO, 3.65f, 13.73f, +R_CUBIC_TO, -0.38f, 0, -0.71f, -0.13f, -0.98f, -0.4f, +R_ARC_TO, 1.34f, 1.34f, 0, 0, 1, -0.4f, -0.98f, +R_V_LINE_TO, -2.66f, +R_H_LINE_TO, 1.38f, +R_V_LINE_TO, 2.66f, +R_H_LINE_TO, 8.7f, +V_LINE_TO, 3.65f, +H_LINE_TO, 3.65f, +R_V_LINE_TO, 2.66f, +H_LINE_TO, 2.27f, +R_V_LINE_TO, -2.66f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.71f, 0.4f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.4f, 0.98f, -0.4f, +R_H_LINE_TO, 8.7f, +R_CUBIC_TO, 0.38f, 0, 0.71f, 0.13f, 0.98f, 0.4f, +R_CUBIC_TO, 0.27f, 0.27f, 0.4f, 0.6f, 0.4f, 0.98f, +R_V_LINE_TO, 8.7f, +R_CUBIC_TO, 0, 0.38f, -0.13f, 0.71f, -0.4f, 0.98f, +R_CUBIC_TO, -0.27f, 0.27f, -0.6f, 0.4f, -0.98f, 0.4f, CLOSE, -R_MOVE_TO, 3.66f, -2.34f, -LINE_TO, 6.22f, 10.43f, -R_LINE_TO, 1.62f, -1.62f, -H_LINE_TO, 2.08f, -V_LINE_TO, 7.18f, -R_H_LINE_TO, 5.76f, -LINE_TO, 6.22f, 5.57f, -LINE_TO, 7.37f, 4.42f, -LINE_TO, 10.95f, 8, -CLOSE \ No newline at end of file +R_MOVE_TO, 3.63f, -2.37f, +R_LINE_TO, -0.98f, -0.97f, +LINE_TO, 7.99f, 8.69f, +H_LINE_TO, 2.27f, +V_LINE_TO, 7.31f, +R_H_LINE_TO, 5.72f, +LINE_TO, 6.29f, 5.61f, +R_LINE_TO, 0.98f, -0.97f, +LINE_TO, 10.63f, 8, +CLOSE
diff --git a/chrome/app/vector_icons/file_save_chrome_refresh.icon b/chrome/app/vector_icons/file_save_chrome_refresh.icon index 00bb841..b260c09 100644 --- a/chrome/app/vector_icons/file_save_chrome_refresh.icon +++ b/chrome/app/vector_icons/file_save_chrome_refresh.icon
@@ -1,92 +1,56 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -CANVAS_DIMENSIONS, 24, -R_MOVE_TO, 18, 21, -R_LINE_TO, 4.01f, -4.01f, -R_LINE_TO, -1.4f, -1.4f, -LINE_TO, 19, 17.2f, -R_V_LINE_TO, -4.18f, -R_H_LINE_TO, -2, -V_LINE_TO, 17.2f, -R_LINE_TO, -1.61f, -1.61f, -R_LINE_TO, -1.4f, 1.4f, -CLOSE, -R_MOVE_TO, -4, 3, -R_V_LINE_TO, -2, -R_H_LINE_TO, 8, -R_V_LINE_TO, 2, -CLOSE, -R_MOVE_TO, -7.86f, -3.86f, -R_ARC_TO, 2.2f, 2.2f, 0, 0, 1, -1.61f, -0.66f, -R_ARC_TO, 2.2f, 2.2f, 0, 0, 1, -0.66f, -1.61f, -V_LINE_TO, 4.14f, -R_CUBIC_TO, 0, -0.63f, 0.22f, -1.16f, 0.66f, -1.61f, -R_CUBIC_TO, 0.45f, -0.44f, 0.98f, -0.66f, 1.61f, -0.66f, -R_H_LINE_TO, 7.01f, -R_LINE_TO, 5.99f, 5.99f, -R_V_LINE_TO, 3.17f, -R_H_LINE_TO, -2.27f, -V_LINE_TO, 9.05f, -R_H_LINE_TO, -4.91f, -R_V_LINE_TO, -4.91f, -H_LINE_TO, 6.14f, -R_V_LINE_TO, 13.73f, -H_LINE_TO, 12, -R_V_LINE_TO, 2.27f, -CLOSE, -R_MOVE_TO, 0, -2.27f, -V_LINE_TO, 4.14f, -CLOSE - CANVAS_DIMENSIONS, 20, +FILL_RULE_NONZERO, R_MOVE_TO, 15.25f, 17.5f, -R_LINE_TO, 3.01f, -3.01f, +R_LINE_TO, 3, -3, R_LINE_TO, -1.06f, -1.06f, LINE_TO, 16, 14.63f, V_LINE_TO, 11.5f, R_H_LINE_TO, -1.5f, R_V_LINE_TO, 3.13f, -R_LINE_TO, -1.2f, -1.2f, -R_LINE_TO, -1.06f, 1.06f, +R_LINE_TO, -1.19f, -1.19f, +LINE_TO, 12.25f, 14.5f, CLOSE, R_MOVE_TO, -3, 2.5f, R_V_LINE_TO, -1.5f, R_H_LINE_TO, 6, V_LINE_TO, 20, CLOSE, -R_MOVE_TO, -6.64f, -2.89f, -R_CUBIC_TO, -0.47f, 0, -0.87f, -0.17f, -1.22f, -0.51f, -R_ARC_TO, 1.65f, 1.65f, 0, 0, 1, -0.51f, -1.22f, -V_LINE_TO, 3.61f, -R_CUBIC_TO, 0, -0.47f, 0.17f, -0.87f, 0.51f, -1.22f, -R_CUBIC_TO, 0.34f, -0.34f, 0.75f, -0.51f, 1.22f, -0.51f, -R_H_LINE_TO, 6.51f, -R_LINE_TO, 3.99f, 3.99f, -V_LINE_TO, 10, -R_H_LINE_TO, -1.73f, -V_LINE_TO, 7.04f, -H_LINE_TO, 10.96f, -V_LINE_TO, 3.61f, -H_LINE_TO, 5.61f, -R_V_LINE_TO, 11.77f, +MOVE_TO, 5.5f, 17, +R_CUBIC_TO, -0.4f, 0, -0.75f, -0.15f, -1.05f, -0.45f, +R_CUBIC_TO, -0.3f, -0.3f, -0.45f, -0.65f, -0.45f, -1.05f, +R_V_LINE_TO, -12, +R_CUBIC_TO, 0, -0.4f, 0.15f, -0.75f, 0.45f, -1.05f, +R_CUBIC_TO, 0.3f, -0.3f, 0.65f, -0.45f, 1.05f, -0.45f, +H_LINE_TO, 12, +R_LINE_TO, 4, 4, +R_V_LINE_TO, 4, +R_H_LINE_TO, -1.5f, +V_LINE_TO, 7, H_LINE_TO, 11, -R_V_LINE_TO, 1.73f, +V_LINE_TO, 3.5f, +H_LINE_TO, 5.5f, +R_V_LINE_TO, 12, +H_LINE_TO, 11, +V_LINE_TO, 17, CLOSE, -R_MOVE_TO, 0, -1.73f, -V_LINE_TO, 3.61f, +R_MOVE_TO, 0, -1.5f, +R_V_LINE_TO, -12, CLOSE CANVAS_DIMENSIONS, 16, +FILL_RULE_NONZERO, R_MOVE_TO, 12.2f, 14, -R_LINE_TO, 2.42f, -2.42f, +R_LINE_TO, 2.41f, -2.41f, R_LINE_TO, -0.85f, -0.85f, -R_LINE_TO, -0.97f, 0.97f, +R_LINE_TO, -0.96f, 0.96f, V_LINE_TO, 9.2f, R_H_LINE_TO, -1.2f, R_V_LINE_TO, 2.5f, -R_LINE_TO, -0.97f, -0.97f, +R_LINE_TO, -0.96f, -0.96f, R_LINE_TO, -0.85f, 0.85f, CLOSE, R_MOVE_TO, -2.4f, 2, @@ -94,24 +58,25 @@ R_H_LINE_TO, 4.8f, V_LINE_TO, 16, CLOSE, -R_MOVE_TO, -5.18f, -2.18f, -R_CUBIC_TO, -0.45f, 0, -0.83f, -0.16f, -1.15f, -0.48f, -R_ARC_TO, 1.57f, 1.57f, 0, 0, 1, -0.48f, -1.15f, -V_LINE_TO, 3.02f, -R_CUBIC_TO, 0, -0.45f, 0.16f, -0.83f, 0.48f, -1.15f, -R_CUBIC_TO, 0.32f, -0.32f, 0.7f, -0.48f, 1.15f, -0.48f, -R_H_LINE_TO, 5.22f, -R_LINE_TO, 3.18f, 3.18f, +R_MOVE_TO, -5.31f, -2.31f, +R_CUBIC_TO, -0.37f, 0, -0.7f, -0.14f, -0.97f, -0.41f, +R_ARC_TO, 1.33f, 1.33f, 0, 0, 1, -0.41f, -0.97f, +V_LINE_TO, 2.89f, +R_CUBIC_TO, 0, -0.37f, 0.14f, -0.7f, 0.41f, -0.97f, +R_ARC_TO, 1.33f, 1.33f, 0, 0, 1, 0.97f, -0.41f, +H_LINE_TO, 9.7f, +R_LINE_TO, 3.19f, 3.19f, V_LINE_TO, 8, -R_H_LINE_TO, -1.63f, -V_LINE_TO, 5.68f, -H_LINE_TO, 8.73f, -R_V_LINE_TO, -2.66f, -R_H_LINE_TO, -4.11f, -R_V_LINE_TO, 9.17f, -R_H_LINE_TO, 4.18f, -R_V_LINE_TO, 1.63f, +R_H_LINE_TO, -1.38f, +V_LINE_TO, 5.63f, +H_LINE_TO, 8.77f, +V_LINE_TO, 2.89f, +H_LINE_TO, 4.49f, +R_V_LINE_TO, 9.42f, +R_H_LINE_TO, 4.31f, +R_V_LINE_TO, 1.38f, CLOSE, -R_MOVE_TO, 0, -1.63f, -V_LINE_TO, 3.02f, +R_MOVE_TO, 0, -1.38f, +V_LINE_TO, 2.89f, CLOSE +
diff --git a/chrome/app/vector_icons/help_menu.icon b/chrome/app/vector_icons/help_menu.icon index eb6f8dbb..2160c357 100644 --- a/chrome/app/vector_icons/help_menu.icon +++ b/chrome/app/vector_icons/help_menu.icon
@@ -1,38 +1,66 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 8, 1, -CUBIC_TO, 4.13f, 1, 1, 4.13f, 1, 8, -R_CUBIC_TO, 0, 3.87f, 3.13f, 7, 7, 7, -R_CUBIC_TO, 3.87f, 0, 7, -3.13f, 7, -7, -R_CUBIC_TO, 0, -3.87f, -3.13f, -7, -7, -7, +FILL_RULE_NONZERO, +MOVE_TO, 7.99f, 12, +R_ARC_TO, 0.82f, 0.82f, 0, 0, 0, 0.6f, -0.25f, +R_ARC_TO, 0.82f, 0.82f, 0, 0, 0, 0.25f, -0.6f, +R_ARC_TO, 0.8f, 0.8f, 0, 0, 0, -0.25f, -0.59f, +R_ARC_TO, 0.82f, 0.82f, 0, 0, 0, -0.6f, -0.25f, +R_ARC_TO, 0.81f, 0.81f, 0, 0, 0, -0.6f, 0.25f, +R_ARC_TO, 0.8f, 0.8f, 0, 0, 0, -0.25f, 0.59f, +R_CUBIC_TO, 0, 0.24f, 0.08f, 0.43f, 0.25f, 0.6f, +R_ARC_TO, 0.81f, 0.81f, 0, 0, 0, 0.6f, 0.25f, CLOSE, -R_MOVE_TO, 0, 12.5f, -ARC_TO, 5.51f, 5.51f, 0, 0, 1, 2.5f, 8, -R_CUBIC_TO, 0, -3.03f, 2.47f, -5.5f, 5.5f, -5.5f, -R_CUBIC_TO, 3.03f, 0, 5.5f, 2.47f, 5.5f, 5.5f, -R_CUBIC_TO, 0, 3.03f, -2.47f, 5.5f, -5.5f, 5.5f, +R_MOVE_TO, -0.64f, -2.55f, +H_LINE_TO, 8.64f, +R_CUBIC_TO, 0, -0.4f, 0.04f, -0.69f, 0.11f, -0.86f, +R_CUBIC_TO, 0.07f, -0.18f, 0.24f, -0.39f, 0.51f, -0.64f, +R_CUBIC_TO, 0.38f, -0.37f, 0.64f, -0.69f, 0.79f, -0.96f, +R_CUBIC_TO, 0.15f, -0.27f, 0.22f, -0.57f, 0.22f, -0.9f, +R_CUBIC_TO, 0, -0.62f, -0.2f, -1.12f, -0.61f, -1.51f, +R_CUBIC_TO, -0.41f, -0.39f, -0.94f, -0.58f, -1.59f, -0.58f, +R_CUBIC_TO, -0.58f, 0, -1.08f, 0.16f, -1.51f, 0.47f, +R_CUBIC_TO, -0.43f, 0.31f, -0.73f, 0.73f, -0.9f, 1.26f, +R_LINE_TO, 1.17f, 0.48f, +R_CUBIC_TO, 0.11f, -0.32f, 0.26f, -0.56f, 0.47f, -0.73f, +R_CUBIC_TO, 0.21f, -0.17f, 0.45f, -0.25f, 0.72f, -0.25f, +R_CUBIC_TO, 0.28f, 0, 0.52f, 0.08f, 0.7f, 0.25f, +ARC_TO, 0.83f, 0.83f, 0, 0, 1, 9, 6.12f, +R_CUBIC_TO, 0, 0.24f, -0.08f, 0.46f, -0.25f, 0.66f, +R_ARC_TO, 6.56f, 6.56f, 0, 0, 1, -0.54f, 0.56f, +R_CUBIC_TO, -0.38f, 0.35f, -0.62f, 0.65f, -0.71f, 0.88f, +R_CUBIC_TO, -0.1f, 0.24f, -0.15f, 0.65f, -0.15f, 1.24f, CLOSE, -NEW_PATH, -MOVE_TO, 8, 10.5f, -R_CUBIC_TO, -0.42f, 0, -0.75f, 0.32f, -0.75f, 0.75f, -R_CUBIC_TO, 0, 0.43f, 0.33f, 0.75f, 0.75f, 0.75f, -R_CUBIC_TO, 0.42f, 0, 0.75f, -0.34f, 0.75f, -0.75f, -R_CUBIC_TO, 0, -0.41f, -0.32f, -0.75f, -0.75f, -0.75f, +MOVE_TO, 8, 14.53f, +R_ARC_TO, 6.32f, 6.32f, 0, 0, 1, -2.54f, -0.51f, +R_ARC_TO, 6.52f, 6.52f, 0, 0, 1, -2.08f, -1.4f, +R_ARC_TO, 6.52f, 6.52f, 0, 0, 1, -1.4f, -2.08f, +ARC_TO, 6.32f, 6.32f, 0, 0, 1, 1.47f, 8, +R_ARC_TO, 6.3f, 6.3f, 0, 0, 1, 0.51f, -2.55f, +ARC_TO, 6.53f, 6.53f, 0, 0, 1, 3.38f, 3.38f, +ARC_TO, 6.52f, 6.52f, 0, 0, 1, 5.46f, 1.98f, +ARC_TO, 6.32f, 6.32f, 0, 0, 1, 8, 1.47f, +R_ARC_TO, 6.3f, 6.3f, 0, 0, 1, 2.55f, 0.51f, +R_CUBIC_TO, 0.79f, 0.34f, 1.48f, 0.8f, 2.07f, 1.4f, +R_ARC_TO, 6.53f, 6.53f, 0, 0, 1, 1.4f, 2.07f, +ARC_TO, 6.3f, 6.3f, 0, 0, 1, 14.54f, 8, +R_CUBIC_TO, 0, 0.9f, -0.17f, 1.75f, -0.51f, 2.54f, +R_ARC_TO, 6.52f, 6.52f, 0, 0, 1, -1.4f, 2.08f, +R_ARC_TO, 6.53f, 6.53f, 0, 0, 1, -2.07f, 1.4f, +ARC_TO, 6.3f, 6.3f, 0, 0, 1, 8, 14.54f, CLOSE, -MOVE_TO, 7.99f, 4, -CUBIC_TO, 6.81f, 4, 6, 4.77f, 5.71f, 5.66f, -R_LINE_TO, 1.09f, 0.46f, -R_CUBIC_TO, 0.15f, -0.45f, 0.49f, -0.98f, 1.2f, -0.98f, -R_CUBIC_TO, 1.08f, 0, 1.29f, 1.01f, 0.91f, 1.55f, -R_CUBIC_TO, -0.36f, 0.51f, -0.98f, 0.86f, -1.31f, 1.44f, -R_CUBIC_TO, -0.26f, 0.46f, -0.21f, 0.99f, -0.21f, 1.32f, -H_LINE_TO, 8.6f, -R_CUBIC_TO, 0, -0.62f, 0.04f, -0.75f, 0.15f, -0.94f, -R_CUBIC_TO, 0.26f, -0.48f, 0.74f, -0.71f, 1.25f, -1.45f, -R_CUBIC_TO, 0.46f, -0.67f, 0.28f, -1.57f, -0.01f, -2.05f, -CUBIC_TO, 9.65f, 4.45f, 8.97f, 4, 7.98f, 4, -R_H_LINE_TO, 0.01f, +R_MOVE_TO, 0, -1.38f, +R_CUBIC_TO, 1.43f, 0, 2.65f, -0.5f, 3.65f, -1.5f, +R_CUBIC_TO, 1, -1, 1.5f, -2.22f, 1.5f, -3.65f, +R_CUBIC_TO, 0, -1.43f, -0.5f, -2.65f, -1.5f, -3.65f, +CUBIC_TO_SHORTHAND, 9.43f, 2.85f, 8, 2.85f, +R_CUBIC_TO, -1.43f, 0, -2.65f, 0.5f, -3.65f, 1.5f, +CUBIC_TO_SHORTHAND, 2.85f, 6.57f, 2.85f, 8, +R_CUBIC_TO, 0, 1.43f, 0.5f, 2.65f, 1.5f, 3.65f, +R_CUBIC_TO, 1, 1, 2.22f, 1.5f, 3.65f, 1.5f, +CLOSE, +MOVE_TO, 8, 8, CLOSE
diff --git a/chrome/app/vector_icons/history.icon b/chrome/app/vector_icons/history.icon index 1defbdf25..b0a75bc 100644 --- a/chrome/app/vector_icons/history.icon +++ b/chrome/app/vector_icons/history.icon
@@ -1,41 +1,42 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 7.98f, 13.92f, -R_CUBIC_TO, -1.64f, 0, -3.04f, -0.57f, -4.19f, -1.72f, -CUBIC_TO, 2.64f, 11.05f, 2.06f, 9.65f, 2.07f, 8, -R_H_LINE_TO, 1.63f, -R_CUBIC_TO, 0, 1.18f, 0.43f, 2.19f, 1.26f, 3.03f, -R_CUBIC_TO, 0.84f, 0.84f, 1.84f, 1.26f, 3.02f, 1.26f, -R_CUBIC_TO, 1.18f, 0, 2.19f, -0.42f, 3.03f, -1.26f, -R_CUBIC_TO, 0.84f, -0.84f, 1.26f, -1.85f, 1.26f, -3.03f, -R_CUBIC_TO, 0, -1.18f, -0.42f, -2.19f, -1.26f, -3.03f, -R_CUBIC_TO, -0.84f, -0.84f, -1.85f, -1.26f, -3.03f, -1.26f, -R_CUBIC_TO, -0.61f, 0, -1.19f, 0.11f, -1.72f, 0.34f, -R_CUBIC_TO, -0.53f, 0.23f, -0.99f, 0.56f, -1.37f, 0.98f, -R_H_LINE_TO, 1.52f, -V_LINE_TO, 6.4f, -H_LINE_TO, 2.15f, -V_LINE_TO, 2.16f, -R_H_LINE_TO, 1.34f, -R_V_LINE_TO, 2.03f, -R_ARC_TO, 5.88f, 5.88f, 0, 0, 1, 1.97f, -1.55f, -R_ARC_TO, 5.68f, 5.68f, 0, 0, 1, 2.52f, -0.57f, -R_CUBIC_TO, 0.82f, 0, 1.58f, 0.16f, 2.3f, 0.47f, -R_ARC_TO, 6.04f, 6.04f, 0, 0, 1, 1.88f, 1.27f, -R_CUBIC_TO, 0.53f, 0.53f, 0.96f, 1.16f, 1.27f, 1.88f, -R_CUBIC_TO, 0.31f, 0.72f, 0.47f, 1.49f, 0.47f, 2.31f, -R_CUBIC_TO, 0, 0.82f, -0.16f, 1.58f, -0.47f, 2.31f, -R_ARC_TO, 5.96f, 5.96f, 0, 0, 1, -1.27f, 1.88f, -R_ARC_TO, 6.04f, 6.04f, 0, 0, 1, -1.88f, 1.27f, -R_ARC_TO, 5.74f, 5.74f, 0, 0, 1, -2.31f, 0.47f, +FILL_RULE_NONZERO, +MOVE_TO, 7.99f, 13.73f, +R_CUBIC_TO, -1.59f, 0, -2.94f, -0.55f, -4.06f, -1.67f, +CUBIC_TO, 2.81f, 10.95f, 2.26f, 9.59f, 2.26f, 8, +H_LINE_TO, 3.64f, +R_CUBIC_TO, 0, 1.2f, 0.43f, 2.22f, 1.28f, 3.07f, +R_CUBIC_TO, 0.85f, 0.85f, 1.88f, 1.28f, 3.07f, 1.28f, +R_CUBIC_TO, 1.2f, 0, 2.22f, -0.43f, 3.07f, -1.28f, +R_CUBIC_TO, 0.85f, -0.85f, 1.28f, -1.87f, 1.28f, -3.07f, +R_CUBIC_TO, 0, -1.2f, -0.43f, -2.22f, -1.28f, -3.07f, +R_CUBIC_TO, -0.85f, -0.85f, -1.87f, -1.28f, -3.07f, -1.28f, +R_CUBIC_TO, -0.66f, 0, -1.26f, 0.13f, -1.83f, 0.39f, +ARC_TO, 4.16f, 4.16f, 0, 0, 0, 4.73f, 5.13f, +R_H_LINE_TO, 1.67f, +R_V_LINE_TO, 1.26f, +H_LINE_TO, 2.3f, +V_LINE_TO, 2.3f, +R_H_LINE_TO, 1.26f, +R_V_LINE_TO, 2.11f, +ARC_TO, 5.75f, 5.75f, 0, 0, 1, 5.49f, 2.84f, +R_ARC_TO, 5.51f, 5.51f, 0, 0, 1, 2.5f, -0.57f, +R_CUBIC_TO, 0.79f, 0, 1.54f, 0.15f, 2.24f, 0.45f, +R_CUBIC_TO, 0.7f, 0.3f, 1.3f, 0.71f, 1.82f, 1.23f, +R_ARC_TO, 5.77f, 5.77f, 0, 0, 1, 1.23f, 1.82f, +R_CUBIC_TO, 0.31f, 0.7f, 0.45f, 1.44f, 0.45f, 2.24f, +R_CUBIC_TO, 0, 0.79f, -0.15f, 1.54f, -0.45f, 2.23f, +R_CUBIC_TO, -0.3f, 0.7f, -0.71f, 1.31f, -1.23f, 1.82f, +R_ARC_TO, 5.77f, 5.77f, 0, 0, 1, -1.82f, 1.23f, +R_ARC_TO, 5.51f, 5.51f, 0, 0, 1, -2.23f, 0.45f, CLOSE, -R_MOVE_TO, 1.62f, -3.58f, -R_LINE_TO, -2.27f, -2.27f, -V_LINE_TO, 4.8f, -R_H_LINE_TO, 1.34f, +R_MOVE_TO, 1.65f, -3.44f, +LINE_TO, 7.37f, 8.03f, +R_V_LINE_TO, -3.23f, +R_H_LINE_TO, 1.26f, V_LINE_TO, 7.5f, -R_LINE_TO, 1.89f, 1.88f, -CLOSE \ No newline at end of file +R_LINE_TO, 1.9f, 1.9f, +CLOSE
diff --git a/chrome/app/vector_icons/incognito_refresh_menu.icon b/chrome/app/vector_icons/incognito_refresh_menu.icon index 9c192369..56e6599 100644 --- a/chrome/app/vector_icons/incognito_refresh_menu.icon +++ b/chrome/app/vector_icons/incognito_refresh_menu.icon
@@ -1,53 +1,73 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 10.75f, 9, -R_CUBIC_TO, -0.83f, 0, -1.55f, 0.46f, -1.94f, 1.13f, -R_CUBIC_TO, -0.26f, -0.08f, -0.53f, -0.13f, -0.81f, -0.13f, -R_CUBIC_TO, -0.28f, 0, -0.55f, 0.05f, -0.81f, 0.13f, -ARC_TO, 2.25f, 2.25f, 0, 0, 0, 5.25f, 9, -CUBIC_TO, 4.01f, 9, 3, 10.01f, 3, 11.25f, -R_CUBIC_TO, 0, 1.24f, 1.01f, 2.25f, 2.25f, 2.25f, -R_CUBIC_TO, 1.12f, 0, 2.04f, -0.82f, 2.21f, -1.89f, -R_CUBIC_TO, 0.17f, -0.07f, 0.35f, -0.11f, 0.54f, -0.11f, -R_CUBIC_TO, 0.19f, 0, 0.37f, 0.05f, 0.54f, 0.11f, -R_CUBIC_TO, 0.17f, 1.07f, 1.1f, 1.89f, 2.21f, 1.89f, -R_CUBIC_TO, 1.24f, 0, 2.25f, -1.01f, 2.25f, -2.25f, -CUBIC_TO_SHORTHAND, 11.99f, 9, 10.75f, 9, +FILL_RULE_NONZERO, +MOVE_TO, 5.16f, 12.83f, +R_ARC_TO, 1.95f, 1.95f, 0, 0, 1, -1.44f, -0.59f, +R_ARC_TO, 1.96f, 1.96f, 0, 0, 1, -0.59f, -1.44f, +R_CUBIC_TO, 0, -0.57f, 0.2f, -1.05f, 0.59f, -1.44f, +R_CUBIC_TO, 0.39f, -0.39f, 0.87f, -0.59f, 1.44f, -0.59f, +R_CUBIC_TO, 0.42f, 0, 0.8f, 0.12f, 1.14f, 0.36f, +R_CUBIC_TO, 0.34f, 0.24f, 0.59f, 0.55f, 0.75f, 0.93f, +R_CUBIC_TO, 0.14f, -0.06f, 0.29f, -0.11f, 0.44f, -0.13f, +R_CUBIC_TO, 0.16f, -0.03f, 0.32f, -0.04f, 0.47f, -0.04f, +R_ARC_TO, 2.43f, 2.43f, 0, 0, 1, 0.92f, 0.18f, +R_ARC_TO, 2.1f, 2.1f, 0, 0, 1, 0.74f, -0.93f, +R_CUBIC_TO, 0.34f, -0.24f, 0.72f, -0.36f, 1.14f, -0.36f, +R_CUBIC_TO, 0.57f, 0, 1.04f, 0.2f, 1.44f, 0.59f, +R_CUBIC_TO, 0.4f, 0.4f, 0.59f, 0.88f, 0.59f, 1.44f, +R_CUBIC_TO, 0, 0.57f, -0.2f, 1.05f, -0.59f, 1.44f, +R_CUBIC_TO, -0.39f, 0.4f, -0.87f, 0.59f, -1.44f, 0.59f, +R_CUBIC_TO, -0.43f, 0, -0.82f, -0.12f, -1.16f, -0.36f, +R_ARC_TO, 1.89f, 1.89f, 0, 0, 1, -0.73f, -0.95f, +R_ARC_TO, 1.25f, 1.25f, 0, 0, 0, -1.41f, -0.28f, +R_CUBIC_TO, -0.16f, 0.07f, -0.29f, 0.16f, -0.41f, 0.28f, +R_CUBIC_TO, -0.14f, 0.39f, -0.38f, 0.71f, -0.73f, 0.95f, +R_ARC_TO, 2, 2, 0, 0, 1, -1.16f, 0.36f, CLOSE, -R_MOVE_TO, -5.5f, 3, -R_CUBIC_TO, -0.41f, 0, -0.75f, -0.34f, -0.75f, -0.75f, -R_CUBIC_TO, 0, -0.41f, 0.34f, -0.75f, 0.75f, -0.75f, -R_CUBIC_TO, 0.41f, 0, 0.75f, 0.34f, 0.75f, 0.75f, -R_CUBIC_TO, 0, 0.41f, -0.34f, 0.75f, -0.75f, 0.75f, +R_MOVE_TO, 0, -1.27f, +R_CUBIC_TO, 0.21f, 0, 0.4f, -0.07f, 0.54f, -0.22f, +R_ARC_TO, 0.74f, 0.74f, 0, 0, 0, 0.23f, -0.54f, +R_ARC_TO, 0.74f, 0.74f, 0, 0, 0, -0.23f, -0.54f, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 0, -0.54f, -0.23f, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 0, -0.54f, 0.23f, +R_ARC_TO, 0.75f, 0.75f, 0, 0, 0, -0.23f, 0.54f, +R_CUBIC_TO, 0, 0.21f, 0.08f, 0.39f, 0.23f, 0.54f, +R_ARC_TO, 0.74f, 0.74f, 0, 0, 0, 0.54f, 0.22f, CLOSE, -R_MOVE_TO, 5.5f, 0, -R_CUBIC_TO, -0.41f, 0, -0.75f, -0.34f, -0.75f, -0.75f, -R_CUBIC_TO, 0, -0.41f, 0.34f, -0.75f, 0.75f, -0.75f, -R_CUBIC_TO, 0.41f, 0, 0.75f, 0.34f, 0.75f, 0.75f, -R_CUBIC_TO, 0, 0.41f, -0.34f, 0.75f, -0.75f, 0.75f, +R_MOVE_TO, 5.6f, 0, +R_ARC_TO, 0.75f, 0.75f, 0, 0, 0, 0.54f, -0.22f, +R_ARC_TO, 0.74f, 0.74f, 0, 0, 0, 0.23f, -0.54f, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 0, -0.23f, -0.54f, +R_ARC_TO, 0.74f, 0.74f, 0, 0, 0, -0.54f, -0.23f, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 0, -0.54f, 0.23f, +R_ARC_TO, 0.73f, 0.73f, 0, 0, 0, -0.23f, 0.54f, +R_CUBIC_TO, 0, 0.21f, 0.08f, 0.39f, 0.23f, 0.54f, +R_ARC_TO, 0.74f, 0.74f, 0, 0, 0, 0.54f, 0.22f, CLOSE, -R_MOVE_TO, 0.87f, -5.5f, -R_LINE_TO, -1.41f, -4, -R_ARC_TO, 0.76f, 0.76f, 0, 0, 0, -0.43f, -0.45f, -R_ARC_TO, 0.79f, 0.79f, 0, 0, 0, -0.62f, 0.02f, -LINE_TO, 8, 2.65f, -R_LINE_TO, -1.16f, -0.58f, -R_ARC_TO, 0.76f, 0.76f, 0, 0, 0, -1.05f, 0.43f, -R_LINE_TO, -1.41f, 4, -H_LINE_TO, 2, +MOVE_TO, 2.3f, 8, +V_LINE_TO, 6.68f, +R_H_LINE_TO, 2.04f, +LINE_TO, 5.59f, 2.78f, +R_CUBIC_TO, 0.1f, -0.24f, 0.25f, -0.41f, 0.45f, -0.52f, +R_CUBIC_TO, 0.2f, -0.11f, 0.42f, -0.14f, 0.68f, -0.08f, +R_LINE_TO, 1.25f, 0.33f, +R_LINE_TO, 1.25f, -0.33f, +R_ARC_TO, 0.91f, 0.91f, 0, 0, 1, 0.67f, 0.08f, +R_CUBIC_TO, 0.2f, 0.11f, 0.35f, 0.28f, 0.45f, 0.52f, +R_LINE_TO, 1.26f, 3.9f, +R_H_LINE_TO, 2.12f, V_LINE_TO, 8, -R_H_LINE_TO, 12, -V_LINE_TO, 6.5f, -R_H_LINE_TO, -2.38f, CLOSE, -R_MOVE_TO, -5.65f, 0, -R_LINE_TO, 0.95f, -2.7f, -R_LINE_TO, 0.74f, 0.37f, -R_CUBIC_TO, 0.21f, 0.11f, 0.46f, 0.11f, 0.67f, 0, -R_LINE_TO, 0.74f, -0.37f, -R_LINE_TO, 0.95f, 2.7f, -H_LINE_TO, 5.97f, +R_MOVE_TO, 3.5f, -1.32f, +R_H_LINE_TO, 4.33f, +R_LINE_TO, -0.99f, -3.05f, +R_LINE_TO, -1.18f, 0.31f, +R_LINE_TO, -1.18f, -0.31f, +CLOSE, +R_MOVE_TO, 2.18f, -0.07f, +R_H_LINE_TO, 2.19f, +R_H_LINE_TO, -4.39f, CLOSE
diff --git a/chrome/app/vector_icons/link_chrome_refresh.icon b/chrome/app/vector_icons/link_chrome_refresh.icon index 1856b251c..62a6026 100644 --- a/chrome/app/vector_icons/link_chrome_refresh.icon +++ b/chrome/app/vector_icons/link_chrome_refresh.icon
@@ -1,77 +1,79 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 20, -MOVE_TO, 8.93f, 14.17f, +FILL_RULE_NONZERO, +MOVE_TO, 9, 14, H_LINE_TO, 6, -R_CUBIC_TO, -1.15f, 0, -2.14f, -0.41f, -2.95f, -1.22f, -R_CUBIC_TO, -0.81f, -0.82f, -1.22f, -1.8f, -1.22f, -2.95f, -R_CUBIC_TO, 0, -1.15f, 0.41f, -2.14f, 1.22f, -2.95f, -CUBIC_TO, 3.86f, 6.24f, 4.85f, 5.83f, 6, 5.83f, -R_H_LINE_TO, 2.93f, -R_V_LINE_TO, 1.73f, +R_CUBIC_TO, -1.1f, 0, -2.05f, -0.39f, -2.83f, -1.17f, +CUBIC_TO, 2.39f, 12.05f, 2, 11.1f, 2, 10, +R_CUBIC_TO, 0, -1.11f, 0.39f, -2.05f, 1.17f, -2.83f, +CUBIC_TO, 3.95f, 6.39f, 4.89f, 6, 6, 6, +R_H_LINE_TO, 3, +R_V_LINE_TO, 1.5f, H_LINE_TO, 6, -R_CUBIC_TO, -0.68f, 0, -1.26f, 0.24f, -1.73f, 0.71f, -ARC_TO, 2.34f, 2.34f, 0, 0, 0, 3.56f, 10, -R_CUBIC_TO, 0, 0.68f, 0.24f, 1.25f, 0.71f, 1.73f, -R_CUBIC_TO, 0.47f, 0.48f, 1.05f, 0.71f, 1.73f, 0.71f, -R_H_LINE_TO, 2.92f, +R_CUBIC_TO, -0.69f, 0, -1.28f, 0.24f, -1.77f, 0.73f, +ARC_TO, 2.4f, 2.4f, 0, 0, 0, 3.5f, 10, +R_CUBIC_TO, 0, 0.7f, 0.24f, 1.29f, 0.73f, 1.77f, +R_CUBIC_TO, 0.49f, 0.49f, 1.08f, 0.73f, 1.77f, 0.73f, +R_H_LINE_TO, 3, CLOSE, -R_MOVE_TO, -2.04f, -3.38f, -V_LINE_TO, 9.21f, -R_H_LINE_TO, 6.23f, -R_V_LINE_TO, 1.58f, +R_MOVE_TO, -2, -3.25f, +R_V_LINE_TO, -1.5f, +R_H_LINE_TO, 6, +R_V_LINE_TO, 1.5f, CLOSE, -R_MOVE_TO, 4.19f, 3.38f, -R_V_LINE_TO, -1.73f, -R_H_LINE_TO, 2.92f, -R_CUBIC_TO, 0.68f, 0, 1.26f, -0.24f, 1.73f, -0.71f, -ARC_TO, 2.34f, 2.34f, 0, 0, 0, 16.44f, 10, -R_CUBIC_TO, 0, -0.68f, -0.24f, -1.25f, -0.71f, -1.73f, -R_ARC_TO, 2.35f, 2.35f, 0, 0, 0, -1.73f, -0.71f, -R_H_LINE_TO, -2.92f, -V_LINE_TO, 5.83f, -H_LINE_TO, 14, -R_CUBIC_TO, 1.15f, 0, 2.14f, 0.41f, 2.95f, 1.22f, -R_CUBIC_TO, 0.81f, 0.82f, 1.22f, 1.8f, 1.22f, 2.95f, -R_CUBIC_TO, 0, 1.15f, -0.41f, 2.14f, -1.22f, 2.95f, -R_CUBIC_TO, -0.81f, 0.81f, -1.8f, 1.21f, -2.95f, 1.21f, +MOVE_TO, 11, 14, +R_V_LINE_TO, -1.5f, +R_H_LINE_TO, 3, +R_CUBIC_TO, 0.7f, 0, 1.29f, -0.24f, 1.77f, -0.73f, +R_CUBIC_TO, 0.49f, -0.48f, 0.73f, -1.07f, 0.73f, -1.77f, +R_CUBIC_TO, 0, -0.69f, -0.24f, -1.28f, -0.73f, -1.77f, +ARC_TO, 2.4f, 2.4f, 0, 0, 0, 14, 7.5f, +R_H_LINE_TO, -3, +V_LINE_TO, 6, +R_H_LINE_TO, 3, +R_CUBIC_TO, 1.11f, 0, 2.05f, 0.39f, 2.83f, 1.17f, +CUBIC_TO, 17.61f, 7.95f, 18, 8.9f, 18, 10, +R_CUBIC_TO, 0, 1.11f, -0.39f, 2.05f, -1.17f, 2.83f, +CUBIC_TO, 16.05f, 13.61f, 15.11f, 14, 14, 14, CLOSE CANVAS_DIMENSIONS, 16, -MOVE_TO, 7.06f, 11.52f, +FILL_RULE_NONZERO, +MOVE_TO, 7.14f, 11.34f, H_LINE_TO, 4.8f, -R_ARC_TO, 3.39f, 3.39f, 0, 0, 1, -2.49f, -1.03f, -CUBIC_TO, 1.62f, 9.8f, 1.28f, 8.97f, 1.28f, 8, -R_CUBIC_TO, 0, -0.97f, 0.34f, -1.8f, 1.03f, -2.49f, -CUBIC_TO, 3, 4.82f, 3.82f, 4.48f, 4.8f, 4.48f, -R_H_LINE_TO, 2.26f, -R_V_LINE_TO, 1.63f, -H_LINE_TO, 4.81f, -R_CUBIC_TO, -0.53f, 0, -0.97f, 0.18f, -1.34f, 0.55f, -ARC_TO, 1.82f, 1.82f, 0, 0, 0, 2.92f, 8, -R_CUBIC_TO, 0, 0.52f, 0.18f, 0.97f, 0.55f, 1.34f, -R_CUBIC_TO, 0.37f, 0.37f, 0.81f, 0.55f, 1.34f, 0.55f, -R_H_LINE_TO, 2.25f, +R_CUBIC_TO, -0.92f, 0, -1.71f, -0.32f, -2.36f, -0.98f, +R_ARC_TO, 3.21f, 3.21f, 0, 0, 1, -0.98f, -2.36f, +R_CUBIC_TO, 0, -0.92f, 0.32f, -1.71f, 0.98f, -2.36f, +R_ARC_TO, 3.22f, 3.22f, 0, 0, 1, 2.36f, -0.97f, +R_H_LINE_TO, 2.34f, +R_V_LINE_TO, 1.38f, +H_LINE_TO, 4.8f, +R_CUBIC_TO, -0.54f, 0, -1, 0.19f, -1.38f, 0.57f, +R_CUBIC_TO, -0.38f, 0.38f, -0.57f, 0.84f, -0.57f, 1.38f, +R_CUBIC_TO, 0, 0.54f, 0.19f, 1, 0.57f, 1.38f, +R_CUBIC_TO, 0.38f, 0.38f, 0.84f, 0.57f, 1.38f, 0.57f, +R_H_LINE_TO, 2.34f, CLOSE, -MOVE_TO, 5.38f, 8.68f, -V_LINE_TO, 7.32f, -R_H_LINE_TO, 5.23f, -R_V_LINE_TO, 1.35f, +MOVE_TO, 5.51f, 8.63f, +V_LINE_TO, 7.37f, +R_H_LINE_TO, 4.98f, +R_V_LINE_TO, 1.27f, CLOSE, -MOVE_TO, 8.94f, 11.52f, -V_LINE_TO, 9.89f, -R_H_LINE_TO, 2.25f, -R_CUBIC_TO, 0.53f, 0, 0.97f, -0.18f, 1.34f, -0.55f, -ARC_TO, 1.82f, 1.82f, 0, 0, 0, 13.09f, 8, -R_ARC_TO, 1.82f, 1.82f, 0, 0, 0, -0.55f, -1.34f, -R_ARC_TO, 1.82f, 1.82f, 0, 0, 0, -1.34f, -0.55f, -H_LINE_TO, 8.94f, -V_LINE_TO, 4.48f, -H_LINE_TO, 11.2f, -R_CUBIC_TO, 0.98f, 0, 1.81f, 0.34f, 2.49f, 1.03f, -R_CUBIC_TO, 0.69f, 0.69f, 1.03f, 1.52f, 1.03f, 2.49f, -R_CUBIC_TO, 0, 0.97f, -0.34f, 1.81f, -1.03f, 2.49f, -R_CUBIC_TO, -0.69f, 0.69f, -1.51f, 1.03f, -2.49f, 1.03f, +R_MOVE_TO, 3.35f, 2.7f, +V_LINE_TO, 9.95f, +R_H_LINE_TO, 2.34f, +R_CUBIC_TO, 0.54f, 0, 1, -0.19f, 1.38f, -0.57f, +R_CUBIC_TO, 0.38f, -0.38f, 0.57f, -0.84f, 0.57f, -1.38f, +R_CUBIC_TO, 0, -0.54f, -0.19f, -1, -0.57f, -1.38f, +R_ARC_TO, 1.88f, 1.88f, 0, 0, 0, -1.38f, -0.57f, +H_LINE_TO, 8.86f, +V_LINE_TO, 4.66f, +R_H_LINE_TO, 2.34f, +R_CUBIC_TO, 0.92f, 0, 1.71f, 0.32f, 2.36f, 0.98f, +R_CUBIC_TO, 0.65f, 0.65f, 0.98f, 1.44f, 0.98f, 2.36f, +R_CUBIC_TO, 0, 0.92f, -0.32f, 1.71f, -0.98f, 2.36f, +R_ARC_TO, 3.22f, 3.22f, 0, 0, 1, -2.36f, 0.97f, CLOSE
diff --git a/chrome/app/vector_icons/menu_book_chrome_refresh.icon b/chrome/app/vector_icons/menu_book_chrome_refresh.icon index 532ec2a..875aef1e 100644 --- a/chrome/app/vector_icons/menu_book_chrome_refresh.icon +++ b/chrome/app/vector_icons/menu_book_chrome_refresh.icon
@@ -1,84 +1,93 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 20, -MOVE_TO, 11.75f, 8.14f, -V_LINE_TO, 6.56f, +FILL_RULE_NONZERO, +MOVE_TO, 11.75f, 7.96f, +V_LINE_TO, 6.38f, R_CUBIC_TO, 0.43f, -0.14f, 0.88f, -0.24f, 1.33f, -0.3f, R_CUBIC_TO, 0.46f, -0.06f, 0.93f, -0.09f, 1.42f, -0.09f, R_CUBIC_TO, 0.32f, 0, 0.64f, 0.02f, 0.97f, 0.05f, -R_CUBIC_TO, 0.33f, 0.03f, 0.67f, 0.09f, 1.03f, 0.16f, -R_V_LINE_TO, 1.54f, -R_ARC_TO, 11.46f, 11.46f, 0, 0, 0, -1.1f, -0.21f, -R_ARC_TO, 6.95f, 6.95f, 0, 0, 0, -0.9f, -0.06f, -R_ARC_TO, 7.79f, 7.79f, 0, 0, 0, -2.75f, 0.5f, +R_CUBIC_TO, 0.33f, 0.04f, 0.67f, 0.09f, 1.03f, 0.16f, +V_LINE_TO, 7.73f, +R_ARC_TO, 11.87f, 11.87f, 0, 0, 0, -1.1f, -0.21f, +R_ARC_TO, 7.39f, 7.39f, 0, 0, 0, -0.89f, -0.06f, +R_CUBIC_TO, -0.47f, 0, -0.94f, 0.04f, -1.39f, 0.13f, +R_CUBIC_TO, -0.46f, 0.09f, -0.91f, 0.21f, -1.35f, 0.38f, CLOSE, R_MOVE_TO, 0, 4.92f, R_V_LINE_TO, -1.58f, -R_ARC_TO, 9.15f, 9.15f, 0, 0, 1, 1.25f, -0.3f, -R_ARC_TO, 8.9f, 8.9f, 0, 0, 1, 1.5f, -0.11f, +R_CUBIC_TO, 0.39f, -0.12f, 0.81f, -0.23f, 1.25f, -0.3f, +R_ARC_TO, 9.16f, 9.16f, 0, 0, 1, 1.5f, -0.11f, R_CUBIC_TO, 0.38f, 0, 0.73f, 0.02f, 1.05f, 0.06f, -R_CUBIC_TO, 0.33f, 0.04f, 0.64f, 0.1f, 0.95f, 0.17f, +R_CUBIC_TO, 0.33f, 0.04f, 0.65f, 0.1f, 0.95f, 0.17f, R_V_LINE_TO, 1.54f, -R_ARC_TO, 11.45f, 11.45f, 0, 0, 0, -1.1f, -0.21f, -R_ARC_TO, 6.96f, 6.96f, 0, 0, 0, -0.9f, -0.06f, -R_ARC_TO, 7.79f, 7.79f, 0, 0, 0, -2.75f, 0.5f, +R_ARC_TO, 11.73f, 11.73f, 0, 0, 0, -1.1f, -0.21f, +R_ARC_TO, 6.68f, 6.68f, 0, 0, 0, -0.89f, -0.06f, +R_CUBIC_TO, -0.47f, 0, -0.94f, 0.04f, -1.39f, 0.13f, +R_CUBIC_TO, -0.46f, 0.08f, -0.91f, 0.21f, -1.35f, 0.38f, CLOSE, R_MOVE_TO, 0, -2.46f, -V_LINE_TO, 9.02f, -ARC_TO, 9.38f, 9.38f, 0, 0, 1, 14.5f, 8.6f, +V_LINE_TO, 8.83f, +R_ARC_TO, 9.45f, 9.45f, 0, 0, 1, 1.36f, -0.31f, +R_CUBIC_TO, 0.47f, -0.07f, 0.93f, -0.1f, 1.39f, -0.1f, R_CUBIC_TO, 0.38f, 0, 0.73f, 0.02f, 1.05f, 0.06f, -R_CUBIC_TO, 0.33f, 0.04f, 0.64f, 0.1f, 0.95f, 0.17f, +R_CUBIC_TO, 0.33f, 0.04f, 0.65f, 0.1f, 0.95f, 0.17f, R_V_LINE_TO, 1.54f, -R_ARC_TO, 7.77f, 7.77f, 0, 0, 0, -1.03f, -0.21f, -R_ARC_TO, 7.39f, 7.39f, 0, 0, 0, -2.31f, 0.06f, -R_CUBIC_TO, -0.45f, 0.08f, -0.92f, 0.21f, -1.41f, 0.37f, +R_ARC_TO, 7.19f, 7.19f, 0, 0, 0, -1.03f, -0.21f, +R_ARC_TO, 7.42f, 7.42f, 0, 0, 0, -2.31f, 0.06f, +R_ARC_TO, 9.42f, 9.42f, 0, 0, 0, -1.41f, 0.38f, CLOSE, -MOVE_TO, 5.5f, 14.18f, -R_ARC_TO, 7.41f, 7.41f, 0, 0, 1, 1.92f, 0.25f, -R_CUBIC_TO, 0.63f, 0.17f, 1.24f, 0.38f, 1.83f, 0.63f, -V_LINE_TO, 5.6f, -R_ARC_TO, 7.98f, 7.98f, 0, 0, 0, -3.75f, -0.92f, -R_CUBIC_TO, -0.51f, 0, -1.02f, 0.05f, -1.53f, 0.14f, -R_ARC_TO, 6.41f, 6.41f, 0, 0, 0, -1.47f, 0.45f, -R_V_LINE_TO, 9.42f, -R_ARC_TO, 7.49f, 7.49f, 0, 0, 1, 1.48f, -0.38f, -R_CUBIC_TO, 0.5f, -0.08f, 1.01f, -0.11f, 1.52f, -0.11f, +MOVE_TO, 5.5f, 14, +R_CUBIC_TO, 0.65f, 0, 1.29f, 0.08f, 1.92f, 0.25f, +R_CUBIC_TO, 0.63f, 0.17f, 1.23f, 0.38f, 1.83f, 0.63f, +V_LINE_TO, 5.42f, +R_ARC_TO, 7.79f, 7.79f, 0, 0, 0, -1.81f, -0.69f, +ARC_TO, 8.15f, 8.15f, 0, 0, 0, 5.5f, 4.5f, +R_CUBIC_TO, -0.52f, 0, -1.02f, 0.05f, -1.53f, 0.14f, +R_ARC_TO, 6.44f, 6.44f, 0, 0, 0, -1.47f, 0.45f, +V_LINE_TO, 14.5f, +R_CUBIC_TO, 0.48f, -0.18f, 0.98f, -0.31f, 1.48f, -0.39f, +CUBIC_TO, 4.48f, 14.04f, 4.98f, 14, 5.5f, 14, CLOSE, R_MOVE_TO, 5.25f, 0.88f, -R_ARC_TO, 9.94f, 9.94f, 0, 0, 1, 1.83f, -0.64f, -R_ARC_TO, 8.04f, 8.04f, 0, 0, 1, 1.92f, -0.23f, -R_CUBIC_TO, 0.51f, 0, 1.02f, 0.03f, 1.53f, 0.09f, +R_ARC_TO, 9.92f, 9.92f, 0, 0, 1, 1.83f, -0.64f, +ARC_TO, 8.08f, 8.08f, 0, 0, 1, 14.5f, 14, +R_CUBIC_TO, 0.52f, 0, 1.02f, 0.03f, 1.53f, 0.09f, R_CUBIC_TO, 0.51f, 0.06f, 1, 0.2f, 1.47f, 0.41f, -V_LINE_TO, 5.27f, -R_CUBIC_TO, -0.49f, -0.18f, -0.98f, -0.32f, -1.48f, -0.43f, -R_ARC_TO, 7.44f, 7.44f, 0, 0, 0, -1.52f, -0.16f, -R_ARC_TO, 7.98f, 7.98f, 0, 0, 0, -3.75f, 0.92f, -R_V_LINE_TO, 9.46f, +V_LINE_TO, 5.08f, +R_CUBIC_TO, -0.48f, -0.18f, -0.98f, -0.32f, -1.48f, -0.43f, +ARC_TO, 7.32f, 7.32f, 0, 0, 0, 14.5f, 4.5f, +R_CUBIC_TO, -0.67f, 0, -1.31f, 0.08f, -1.94f, 0.23f, +R_ARC_TO, 7.79f, 7.79f, 0, 0, 0, -1.81f, 0.69f, CLOSE, -R_MOVE_TO, -0.73f, 2.31f, -R_CUBIC_TO, -0.68f, -0.44f, -1.4f, -0.81f, -2.15f, -1.1f, -R_ARC_TO, 6.48f, 6.48f, 0, 0, 0, -2.37f, -0.44f, -R_ARC_TO, 7.97f, 7.97f, 0, 0, 0, -3.04f, 0.62f, -R_CUBIC_TO, -0.38f, 0.16f, -0.74f, 0.14f, -1.09f, -0.08f, -R_ARC_TO, 1.03f, 1.03f, 0, 0, 1, -0.52f, -0.93f, -V_LINE_TO, 4.97f, -R_CUBIC_TO, 0, -0.24f, 0.06f, -0.46f, 0.18f, -0.67f, -R_CUBIC_TO, 0.12f, -0.2f, 0.29f, -0.36f, 0.51f, -0.46f, -R_ARC_TO, 9.71f, 9.71f, 0, 0, 1, 1.93f, -0.61f, -R_ARC_TO, 10.05f, 10.05f, 0, 0, 1, 4.35f, 0.08f, -R_CUBIC_TO, 0.76f, 0.19f, 1.49f, 0.47f, 2.18f, 0.86f, -R_CUBIC_TO, 0.71f, -0.37f, 1.44f, -0.65f, 2.19f, -0.85f, -R_ARC_TO, 9.17f, 9.17f, 0, 0, 1, 2.33f, -0.29f, -R_ARC_TO, 9.71f, 9.71f, 0, 0, 1, 3.95f, 0.81f, -R_CUBIC_TO, 0.22f, 0.1f, 0.39f, 0.26f, 0.52f, 0.46f, -R_CUBIC_TO, 0.13f, 0.2f, 0.19f, 0.43f, 0.19f, 0.67f, -R_V_LINE_TO, 10.55f, -R_CUBIC_TO, 0, 0.38f, -0.13f, 0.68f, -0.39f, 0.9f, -R_CUBIC_TO, -0.26f, 0.22f, -0.54f, 0.26f, -0.82f, 0.12f, -R_ARC_TO, 7.88f, 7.88f, 0, 0, 0, -1.69f, -0.53f, -R_ARC_TO, 9.23f, 9.23f, 0, 0, 0, -1.77f, -0.17f, -R_CUBIC_TO, -0.82f, 0, -1.6f, 0.15f, -2.35f, 0.44f, -R_CUBIC_TO, -0.74f, 0.29f, -1.46f, 0.66f, -2.14f, 1.1f, -CLOSE \ No newline at end of file +MOVE_TO, 10, 17, +R_ARC_TO, 10.62f, 10.62f, 0, 0, 0, -2.14f, -1.08f, +ARC_TO, 6.74f, 6.74f, 0, 0, 0, 5.5f, 15.5f, +R_CUBIC_TO, -0.53f, 0, -1.05f, 0.05f, -1.58f, 0.16f, +R_ARC_TO, 7.82f, 7.82f, 0, 0, 0, -1.52f, 0.47f, +R_ARC_TO, 0.97f, 0.97f, 0, 0, 1, -0.95f, -0.07f, +R_ARC_TO, 0.91f, 0.91f, 0, 0, 1, -0.45f, -0.82f, +V_LINE_TO, 4.75f, +R_CUBIC_TO, 0, -0.19f, 0.05f, -0.37f, 0.16f, -0.54f, +R_CUBIC_TO, 0.11f, -0.16f, 0.25f, -0.29f, 0.43f, -0.37f, +ARC_TO, 9.82f, 9.82f, 0, 0, 1, 3.5f, 3.21f, +R_ARC_TO, 9.73f, 9.73f, 0, 0, 1, 4.32f, 0.07f, +R_CUBIC_TO, 0.75f, 0.19f, 1.48f, 0.47f, 2.18f, 0.84f, +R_ARC_TO, 10.63f, 10.63f, 0, 0, 1, 2.19f, -0.83f, +ARC_TO, 9.13f, 9.13f, 0, 0, 1, 14.5f, 3, +R_CUBIC_TO, 0.68f, 0, 1.35f, 0.07f, 2, 0.21f, +R_CUBIC_TO, 0.65f, 0.14f, 1.29f, 0.35f, 1.92f, 0.63f, +R_CUBIC_TO, 0.18f, 0.09f, 0.32f, 0.21f, 0.44f, 0.38f, +R_CUBIC_TO, 0.11f, 0.17f, 0.17f, 0.35f, 0.17f, 0.54f, +R_V_LINE_TO, 10.48f, +R_CUBIC_TO, 0, 0.35f, -0.11f, 0.63f, -0.32f, 0.83f, +R_CUBIC_TO, -0.22f, 0.21f, -0.44f, 0.26f, -0.68f, 0.14f, +R_ARC_TO, 7.5f, 7.5f, 0, 0, 0, -1.72f, -0.54f, +R_ARC_TO, 9.54f, 9.54f, 0, 0, 0, -1.8f, -0.17f, +R_CUBIC_TO, -0.82f, 0, -1.6f, 0.14f, -2.35f, 0.42f, +R_CUBIC_TO, -0.75f, 0.28f, -1.46f, 0.64f, -2.14f, 1.08f, +CLOSE, +MOVE_TO, 5.9f, 9.69f, +CLOSE
diff --git a/chrome/app/vector_icons/more_tools_menu.icon b/chrome/app/vector_icons/more_tools_menu.icon index d810063d..1666bff0 100644 --- a/chrome/app/vector_icons/more_tools_menu.icon +++ b/chrome/app/vector_icons/more_tools_menu.icon
@@ -1,53 +1,56 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 2.04f, 13.16f, -V_LINE_TO, 6.87f, -R_CUBIC_TO, 0, -0.46f, 0.16f, -0.84f, 0.47f, -1.16f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 1.16f, -0.47f, -R_H_LINE_TO, 1.17f, -V_LINE_TO, 4.32f, -R_CUBIC_TO, 0, -0.46f, 0.16f, -0.84f, 0.47f, -1.16f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 1.16f, -0.47f, -R_H_LINE_TO, 3.05f, -R_CUBIC_TO, 0.46f, 0, 0.84f, 0.16f, 1.16f, 0.48f, -R_CUBIC_TO, 0.32f, 0.32f, 0.47f, 0.7f, 0.47f, 1.16f, -R_V_LINE_TO, 0.92f, -R_H_LINE_TO, 1.17f, -R_CUBIC_TO, 0.46f, 0, 0.84f, 0.16f, 1.16f, 0.48f, -R_CUBIC_TO, 0.32f, 0.32f, 0.47f, 0.7f, 0.47f, 1.16f, -R_V_LINE_TO, 6.28f, +FILL_RULE_NONZERO, +MOVE_TO, 8, 9.23f, CLOSE, -R_MOVE_TO, 1.63f, -1.63f, -R_H_LINE_TO, 8.65f, -R_V_LINE_TO, -1.51f, -R_H_LINE_TO, -0.72f, -R_V_LINE_TO, 0.6f, -H_LINE_TO, 9.97f, -R_V_LINE_TO, -0.6f, -H_LINE_TO, 6.05f, -R_V_LINE_TO, 0.6f, -H_LINE_TO, 4.42f, -R_V_LINE_TO, -0.6f, -R_H_LINE_TO, -0.74f, +R_MOVE_TO, -5.73f, 3.7f, +V_LINE_TO, 6.91f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.71f, 0.4f, -0.98f, +R_ARC_TO, 1.35f, 1.35f, 0, 0, 1, 0.98f, -0.4f, +R_H_LINE_TO, 1.42f, +V_LINE_TO, 4.45f, +R_CUBIC_TO, 0, -0.39f, 0.13f, -0.71f, 0.4f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.4f, 0.98f, -0.4f, +R_H_LINE_TO, 3.1f, +R_CUBIC_TO, 0.38f, 0, 0.71f, 0.13f, 0.98f, 0.4f, +R_CUBIC_TO, 0.27f, 0.27f, 0.4f, 0.6f, 0.4f, 0.98f, +R_V_LINE_TO, 1.08f, +R_H_LINE_TO, 1.42f, +R_CUBIC_TO, 0.38f, 0, 0.71f, 0.14f, 0.98f, 0.41f, +R_CUBIC_TO, 0.27f, 0.27f, 0.4f, 0.59f, 0.4f, 0.98f, +R_V_LINE_TO, 6.02f, CLOSE, -R_MOVE_TO, 0, -4.65f, -R_V_LINE_TO, 1.51f, -R_H_LINE_TO, 0.74f, -R_V_LINE_TO, -0.6f, -R_H_LINE_TO, 1.63f, +MOVE_TO, 6.15f, 9.91f, R_V_LINE_TO, 0.6f, -R_H_LINE_TO, 3.91f, -R_V_LINE_TO, -0.6f, -R_H_LINE_TO, 1.64f, +H_LINE_TO, 4.77f, +V_LINE_TO, 9.91f, +H_LINE_TO, 3.65f, +R_V_LINE_TO, 1.64f, +R_H_LINE_TO, 8.7f, +V_LINE_TO, 9.91f, +H_LINE_TO, 11.23f, R_V_LINE_TO, 0.6f, -R_H_LINE_TO, 0.72f, -V_LINE_TO, 6.88f, +H_LINE_TO, 9.85f, +V_LINE_TO, 9.91f, CLOSE, -R_MOVE_TO, 2.8f, -1.63f, -R_H_LINE_TO, 3.05f, -R_V_LINE_TO, -0.92f, -H_LINE_TO, 6.48f, +R_MOVE_TO, -2.5f, -3, +R_V_LINE_TO, 1.64f, +H_LINE_TO, 4.77f, +R_V_LINE_TO, -0.6f, +R_H_LINE_TO, 1.38f, +R_V_LINE_TO, 0.6f, +R_H_LINE_TO, 3.7f, +R_V_LINE_TO, -0.6f, +R_H_LINE_TO, 1.38f, +R_V_LINE_TO, 0.6f, +R_H_LINE_TO, 1.12f, +V_LINE_TO, 6.91f, +CLOSE, +MOVE_TO, 6.45f, 5.53f, +R_H_LINE_TO, 3.1f, +V_LINE_TO, 4.45f, +H_LINE_TO, 6.45f, CLOSE
diff --git a/chrome/app/vector_icons/name_window.icon b/chrome/app/vector_icons/name_window.icon index fcc3088..a37e545 100644 --- a/chrome/app/vector_icons/name_window.icon +++ b/chrome/app/vector_icons/name_window.icon
@@ -1,23 +1,24 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 3.72f, 13.92f, -R_CUBIC_TO, -0.46f, 0, -0.84f, -0.16f, -1.16f, -0.48f, -R_ARC_TO, 1.6f, 1.6f, 0, 0, 1, -0.48f, -1.16f, -R_V_LINE_TO, -8.57f, -R_CUBIC_TO, 0, -0.45f, 0.16f, -0.83f, 0.48f, -1.16f, -R_CUBIC_TO, 0.32f, -0.32f, 0.7f, -0.48f, 1.16f, -0.48f, -R_H_LINE_TO, 8.57f, -R_CUBIC_TO, 0.46f, 0, 0.84f, 0.16f, 1.16f, 0.48f, -R_CUBIC_TO, 0.32f, 0.32f, 0.48f, 0.71f, 0.48f, 1.16f, -R_V_LINE_TO, 8.57f, -R_CUBIC_TO, 0, 0.45f, -0.16f, 0.83f, -0.48f, 1.16f, -R_CUBIC_TO, -0.32f, 0.32f, -0.7f, 0.48f, -1.16f, 0.48f, +FILL_RULE_NONZERO, +MOVE_TO, 2.85f, 12.93f, +R_CUBIC_TO, -0.38f, 0, -0.71f, -0.13f, -0.98f, -0.4f, +R_ARC_TO, 1.34f, 1.34f, 0, 0, 1, -0.4f, -0.98f, +V_LINE_TO, 4.44f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.71f, 0.4f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.4f, 0.98f, -0.4f, +R_H_LINE_TO, 10.31f, +R_CUBIC_TO, 0.38f, 0, 0.71f, 0.13f, 0.98f, 0.4f, +R_CUBIC_TO, 0.27f, 0.27f, 0.4f, 0.6f, 0.4f, 0.98f, +R_V_LINE_TO, 7.11f, +R_CUBIC_TO, 0, 0.38f, -0.13f, 0.71f, -0.4f, 0.98f, +R_CUBIC_TO, -0.27f, 0.27f, -0.6f, 0.4f, -0.98f, 0.4f, CLOSE, -R_MOVE_TO, -0.11f, -1.52f, -R_H_LINE_TO, 8.8f, -V_LINE_TO, 5.54f, -H_LINE_TO, 3.6f, +R_MOVE_TO, 0, -1.38f, +R_H_LINE_TO, 10.3f, +V_LINE_TO, 5.73f, +H_LINE_TO, 2.85f, CLOSE
diff --git a/chrome/app/vector_icons/new_tab_refresh.icon b/chrome/app/vector_icons/new_tab_refresh.icon index af730d57..58d78e5 100644 --- a/chrome/app/vector_icons/new_tab_refresh.icon +++ b/chrome/app/vector_icons/new_tab_refresh.icon
@@ -1,23 +1,29 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 14, 2.5f, -H_LINE_TO, 2, -R_CUBIC_TO, -0.55f, 0, -1, 0.45f, -1, 1, -R_V_LINE_TO, 9, -R_CUBIC_TO, 0, 0.55f, 0.45f, 1, 1, 1, -R_H_LINE_TO, 12, -R_CUBIC_TO, 0.55f, 0, 1, -0.45f, 1, -1, -R_V_LINE_TO, -9, -R_CUBIC_TO, 0, -0.55f, -0.45f, -1, -1, -1, +FILL_RULE_NONZERO, +MOVE_TO, 2.85f, 11.55f, +R_H_LINE_TO, 10.3f, +V_LINE_TO, 7.2f, +H_LINE_TO, 8.8f, +V_LINE_TO, 4.45f, +H_LINE_TO, 2.85f, CLOSE, -MOVE_TO, 2.5f, 12, -V_LINE_TO, 4, -H_LINE_TO, 8, -R_V_LINE_TO, 2.5f, -R_H_LINE_TO, 5.5f, -V_LINE_TO, 12, -R_H_LINE_TO, -11, +R_MOVE_TO, 0, 1.38f, +R_CUBIC_TO, -0.38f, 0, -0.71f, -0.13f, -0.98f, -0.4f, +R_ARC_TO, 1.34f, 1.34f, 0, 0, 1, -0.4f, -0.98f, +V_LINE_TO, 4.44f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.71f, 0.4f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.4f, 0.98f, -0.4f, +R_H_LINE_TO, 10.31f, +R_CUBIC_TO, 0.38f, 0, 0.71f, 0.13f, 0.98f, 0.4f, +R_CUBIC_TO, 0.27f, 0.27f, 0.4f, 0.6f, 0.4f, 0.98f, +R_V_LINE_TO, 7.11f, +R_CUBIC_TO, 0, 0.38f, -0.13f, 0.71f, -0.4f, 0.98f, +R_CUBIC_TO, -0.27f, 0.27f, -0.6f, 0.4f, -0.98f, 0.4f, +CLOSE, +R_MOVE_TO, 0, -1.38f, +V_LINE_TO, 4.45f, CLOSE
diff --git a/chrome/app/vector_icons/new_window.icon b/chrome/app/vector_icons/new_window.icon index 3c295cd..6711ec8 100644 --- a/chrome/app/vector_icons/new_window.icon +++ b/chrome/app/vector_icons/new_window.icon
@@ -1,35 +1,36 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 12.5f, 12.5f, -R_H_LINE_TO, -9, -R_V_LINE_TO, -9, -R_H_LINE_TO, 3, -V_LINE_TO, 2, -H_LINE_TO, 3, -R_CUBIC_TO, -0.55f, 0, -1, 0.45f, -1, 1, -R_V_LINE_TO, 10, -R_CUBIC_TO, 0, 0.55f, 0.45f, 1, 1, 1, -R_H_LINE_TO, 10, -R_CUBIC_TO, 0.55f, 0, 1, -0.45f, 1, -1, -V_LINE_TO, 9.5f, -R_H_LINE_TO, -1.5f, -R_V_LINE_TO, 3, +FILL_RULE_NONZERO, +MOVE_TO, 3.65f, 13.73f, +R_CUBIC_TO, -0.38f, 0, -0.71f, -0.13f, -0.98f, -0.4f, +R_ARC_TO, 1.34f, 1.34f, 0, 0, 1, -0.4f, -0.98f, +V_LINE_TO, 3.65f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.71f, 0.4f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.4f, 0.98f, -0.4f, +R_H_LINE_TO, 3.99f, +R_V_LINE_TO, 1.38f, +H_LINE_TO, 3.65f, +R_V_LINE_TO, 8.7f, +R_H_LINE_TO, 8.7f, +V_LINE_TO, 8.37f, +R_H_LINE_TO, 1.38f, +R_V_LINE_TO, 3.99f, +R_CUBIC_TO, 0, 0.39f, -0.13f, 0.71f, -0.4f, 0.98f, +R_CUBIC_TO, -0.27f, 0.27f, -0.6f, 0.4f, -0.98f, 0.4f, CLOSE, -NEW_PATH, -MOVE_TO, 14, 4.25f, -R_H_LINE_TO, -2.25f, -V_LINE_TO, 2, -R_H_LINE_TO, -1.5f, -R_V_LINE_TO, 2.25f, -H_LINE_TO, 8, -R_V_LINE_TO, 1.5f, -R_H_LINE_TO, 2.25f, -V_LINE_TO, 8, -R_H_LINE_TO, 1.5f, -V_LINE_TO, 5.75f, -H_LINE_TO, 14, -R_V_LINE_TO, -1.5f, +R_MOVE_TO, 6.99f, -6.57f, +R_V_LINE_TO, -1.8f, +H_LINE_TO, 8.83f, +V_LINE_TO, 4.07f, +R_H_LINE_TO, 1.8f, +R_V_LINE_TO, -1.8f, +R_H_LINE_TO, 1.3f, +R_V_LINE_TO, 1.8f, +R_H_LINE_TO, 1.8f, +R_V_LINE_TO, 1.3f, +R_H_LINE_TO, -1.8f, +R_V_LINE_TO, 1.8f, CLOSE
diff --git a/chrome/app/vector_icons/paste_menu.icon b/chrome/app/vector_icons/paste_menu.icon index c706390..aa41503 100644 --- a/chrome/app/vector_icons/paste_menu.icon +++ b/chrome/app/vector_icons/paste_menu.icon
@@ -1,34 +1,43 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 13, 2, -H_LINE_TO, 9.93f, -CUBIC_TO, 9.71f, 1.14f, 8.93f, 0.5f, 8, 0.5f, -CUBIC_TO_SHORTHAND, 6.29f, 1.14f, 6.07f, 2, -H_LINE_TO, 3, -R_CUBIC_TO, -0.55f, 0, -1, 0.45f, -1, 1, -R_V_LINE_TO, 10, -R_CUBIC_TO, 0, 0.55f, 0.45f, 1, 1, 1, -R_H_LINE_TO, 10, -R_CUBIC_TO, 0.55f, 0, 1, -0.45f, 1, -1, -V_LINE_TO, 3, -R_CUBIC_TO, 0, -0.55f, -0.45f, -1, -1, -1, +FILL_RULE_NONZERO, +MOVE_TO, 3.65f, 13.73f, +R_CUBIC_TO, -0.38f, 0, -0.71f, -0.13f, -0.98f, -0.41f, +R_ARC_TO, 1.32f, 1.32f, 0, 0, 1, -0.41f, -0.98f, +V_LINE_TO, 3.65f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.71f, 0.41f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.59f, -0.41f, 0.98f, -0.41f, +R_H_LINE_TO, 2.7f, +R_CUBIC_TO, 0.11f, -0.36f, 0.3f, -0.64f, 0.61f, -0.87f, +R_CUBIC_TO, 0.3f, -0.23f, 0.65f, -0.35f, 1.05f, -0.35f, +R_CUBIC_TO, 0.39f, 0, 0.74f, 0.12f, 1.04f, 0.35f, +R_CUBIC_TO, 0.3f, 0.23f, 0.51f, 0.52f, 0.61f, 0.88f, +R_H_LINE_TO, 2.7f, +R_CUBIC_TO, 0.38f, 0, 0.71f, 0.13f, 0.98f, 0.41f, +R_CUBIC_TO, 0.27f, 0.27f, 0.41f, 0.59f, 0.41f, 0.98f, +R_V_LINE_TO, 8.7f, +R_CUBIC_TO, 0, 0.38f, -0.13f, 0.71f, -0.41f, 0.98f, +R_CUBIC_TO, -0.27f, 0.27f, -0.59f, 0.41f, -0.98f, 0.41f, CLOSE, -R_MOVE_TO, -4.25f, 0.75f, -R_CUBIC_TO, 0, 0.41f, -0.34f, 0.75f, -0.75f, 0.75f, -R_CUBIC_TO, -0.41f, 0, -0.75f, -0.34f, -0.75f, -0.75f, -CUBIC_TO_SHORTHAND, 7.59f, 2, 8, 2, -R_CUBIC_TO, 0.41f, 0, 0.75f, 0.34f, 0.75f, 0.75f, +R_MOVE_TO, 0, -1.38f, +R_H_LINE_TO, 8.7f, +V_LINE_TO, 3.65f, +H_LINE_TO, 11.18f, +R_V_LINE_TO, 2.06f, +H_LINE_TO, 4.82f, +V_LINE_TO, 3.65f, +H_LINE_TO, 3.65f, CLOSE, -R_MOVE_TO, 3.75f, 9.75f, -R_H_LINE_TO, -9, -R_V_LINE_TO, -9, -H_LINE_TO, 5, -V_LINE_TO, 6, -R_H_LINE_TO, 6, -V_LINE_TO, 3.5f, -R_H_LINE_TO, 1.5f, -R_V_LINE_TO, 9, +MOVE_TO, 8, 3.59f, +R_ARC_TO, 0.6f, 0.6f, 0, 0, 0, 0.43f, -0.17f, +R_ARC_TO, 0.58f, 0.58f, 0, 0, 0, 0.18f, -0.43f, +R_ARC_TO, 0.6f, 0.6f, 0, 0, 0, -0.17f, -0.43f, +R_ARC_TO, 0.58f, 0.58f, 0, 0, 0, -0.43f, -0.17f, +R_ARC_TO, 0.6f, 0.6f, 0, 0, 0, -0.43f, 0.17f, +R_ARC_TO, 0.58f, 0.58f, 0, 0, 0, -0.18f, 0.43f, +R_CUBIC_TO, 0, 0.17f, 0.06f, 0.31f, 0.17f, 0.43f, +R_ARC_TO, 0.58f, 0.58f, 0, 0, 0, 0.43f, 0.18f, CLOSE
diff --git a/chrome/app/vector_icons/performance.icon b/chrome/app/vector_icons/performance.icon index 4613e20..3166765 100644 --- a/chrome/app/vector_icons/performance.icon +++ b/chrome/app/vector_icons/performance.icon
@@ -1,45 +1,46 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, +FILL_RULE_NONZERO, MOVE_TO, 7.15f, 10.04f, -R_CUBIC_TO, 0.25f, 0.24f, 0.57f, 0.36f, 0.94f, 0.34f, -R_CUBIC_TO, 0.37f, -0.02f, 0.65f, -0.16f, 0.84f, -0.43f, -R_LINE_TO, 3.71f, -5.39f, +R_CUBIC_TO, 0.25f, 0.24f, 0.57f, 0.36f, 0.95f, 0.34f, +R_CUBIC_TO, 0.38f, -0.02f, 0.66f, -0.16f, 0.84f, -0.43f, +R_LINE_TO, 3.57f, -5.25f, LINE_TO, 7.25f, 8.27f, -R_CUBIC_TO, -0.27f, 0.2f, -0.43f, 0.48f, -0.44f, 0.85f, -R_CUBIC_TO, -0.02f, 0.37f, 0.09f, 0.67f, 0.35f, 0.91f, +R_CUBIC_TO, -0.27f, 0.19f, -0.43f, 0.47f, -0.44f, 0.84f, +R_CUBIC_TO, -0.02f, 0.37f, 0.09f, 0.68f, 0.35f, 0.92f, CLOSE, -R_MOVE_TO, 0.87f, -7.16f, -R_CUBIC_TO, 0.71f, 0, 1.36f, 0.1f, 1.96f, 0.29f, -R_ARC_TO, 7.18f, 7.18f, 0, 0, 1, 1.56f, 0.69f, -LINE_TO, 9.98f, 4.91f, -R_ARC_TO, 5.29f, 5.29f, 0, 0, 0, -0.91f, -0.3f, -R_ARC_TO, 5.16f, 5.16f, 0, 0, 0, -1.05f, -0.1f, -R_CUBIC_TO, -1.4f, 0, -2.6f, 0.51f, -3.6f, 1.53f, -R_CUBIC_TO, -1, 1.02f, -1.5f, 2.2f, -1.5f, 3.56f, -R_CUBIC_TO, 0, 0.42f, 0.03f, 0.75f, 0.08f, 0.99f, -R_CUBIC_TO, 0.06f, 0.24f, 0.14f, 0.54f, 0.26f, 0.9f, -R_H_LINE_TO, 9.47f, -R_CUBIC_TO, 0.14f, -0.37f, 0.24f, -0.68f, 0.29f, -0.95f, -R_CUBIC_TO, 0.05f, -0.27f, 0.07f, -0.58f, 0.07f, -0.93f, -R_CUBIC_TO, 0, -0.43f, -0.05f, -0.87f, -0.17f, -1.32f, -R_ARC_TO, 4.78f, 4.78f, 0, 0, 0, -0.51f, -1.25f, -R_LINE_TO, 1.01f, -1.46f, -R_CUBIC_TO, 0.43f, 0.56f, 0.75f, 1.19f, 0.98f, 1.89f, -R_CUBIC_TO, 0.23f, 0.7f, 0.34f, 1.41f, 0.33f, 2.11f, -R_ARC_TO, 7.39f, 7.39f, 0, 0, 1, -0.16f, 1.56f, -R_ARC_TO, 4.36f, 4.36f, 0, 0, 1, -0.48f, 1.25f, -R_ARC_TO, 1.54f, 1.54f, 0, 0, 1, -0.55f, 0.56f, -R_CUBIC_TO, -0.22f, 0.13f, -0.46f, 0.19f, -0.72f, 0.19f, +R_MOVE_TO, 0.87f, -6.97f, +R_CUBIC_TO, 0.69f, 0, 1.31f, 0.09f, 1.87f, 0.27f, +R_CUBIC_TO, 0.56f, 0.18f, 1.06f, 0.4f, 1.5f, 0.66f, +R_LINE_TO, -1.32f, 0.88f, +R_ARC_TO, 5.13f, 5.13f, 0, 0, 0, -0.95f, -0.32f, +R_ARC_TO, 5.18f, 5.18f, 0, 0, 0, -1.1f, -0.11f, +R_CUBIC_TO, -1.43f, 0, -2.64f, 0.51f, -3.65f, 1.54f, +R_CUBIC_TO, -1.01f, 1.03f, -1.51f, 2.23f, -1.51f, 3.61f, +R_CUBIC_TO, 0, 0.42f, 0.03f, 0.76f, 0.09f, 1.02f, +R_CUBIC_TO, 0.06f, 0.26f, 0.15f, 0.57f, 0.28f, 0.93f, +R_H_LINE_TO, 9.56f, +R_ARC_TO, 5.93f, 5.93f, 0, 0, 0, 0.3f, -0.98f, +R_ARC_TO, 5.35f, 5.35f, 0, 0, 0, -0.1f, -2.33f, +R_ARC_TO, 4.71f, 4.71f, 0, 0, 0, -0.54f, -1.27f, +R_LINE_TO, 0.84f, -1.24f, +R_ARC_TO, 6.26f, 6.26f, 0, 0, 1, 0.94f, 1.82f, +R_CUBIC_TO, 0.22f, 0.67f, 0.33f, 1.34f, 0.33f, 2.03f, +R_ARC_TO, 7.24f, 7.24f, 0, 0, 1, -0.15f, 1.52f, +R_ARC_TO, 4.09f, 4.09f, 0, 0, 1, -0.47f, 1.2f, +R_ARC_TO, 1.32f, 1.32f, 0, 0, 1, -0.48f, 0.49f, +R_CUBIC_TO, -0.19f, 0.11f, -0.41f, 0.16f, -0.64f, 0.16f, H_LINE_TO, 3.2f, -R_ARC_TO, 1.44f, 1.44f, 0, 0, 1, -0.73f, -0.2f, -R_ARC_TO, 1.4f, 1.4f, 0, 0, 1, -0.54f, -0.55f, -R_ARC_TO, 4.5f, 4.5f, 0, 0, 1, -0.48f, -1.24f, -R_ARC_TO, 6.77f, 6.77f, 0, 0, 1, -0.16f, -1.57f, -R_CUBIC_TO, 0, -0.92f, 0.18f, -1.79f, 0.53f, -2.61f, -R_ARC_TO, 6.77f, 6.77f, 0, 0, 1, 1.44f, -2.12f, -R_ARC_TO, 6.79f, 6.79f, 0, 0, 1, 2.14f, -1.43f, -R_ARC_TO, 6.59f, 6.59f, 0, 0, 1, 2.63f, -0.53f, +R_ARC_TO, 1.26f, 1.26f, 0, 0, 1, -1.11f, -0.65f, +R_ARC_TO, 4.25f, 4.25f, 0, 0, 1, -0.47f, -1.2f, +R_ARC_TO, 7, 7, 0, 0, 1, -0.15f, -1.52f, +R_CUBIC_TO, 0, -0.9f, 0.17f, -1.75f, 0.52f, -2.54f, +R_ARC_TO, 6.59f, 6.59f, 0, 0, 1, 1.4f, -2.06f, +R_ARC_TO, 6.62f, 6.62f, 0, 0, 1, 2.08f, -1.39f, +R_ARC_TO, 6.43f, 6.43f, 0, 0, 1, 2.55f, -0.51f, +CLOSE, +R_MOVE_TO, 0.06f, 4.71f, CLOSE
diff --git a/chrome/app/vector_icons/print_menu.icon b/chrome/app/vector_icons/print_menu.icon index e939022..35e22cf7 100644 --- a/chrome/app/vector_icons/print_menu.icon +++ b/chrome/app/vector_icons/print_menu.icon
@@ -1,50 +1,57 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 15, 6.5f, -R_CUBIC_TO, 0, -0.83f, -0.67f, -1.5f, -1.5f, -1.5f, -H_LINE_TO, 12, -V_LINE_TO, 2, -H_LINE_TO, 4, -R_V_LINE_TO, 3, -H_LINE_TO, 2.5f, -CUBIC_TO, 1.67f, 5, 1, 5.67f, 1, 6.5f, -V_LINE_TO, 12, -R_H_LINE_TO, 3, -R_V_LINE_TO, 2, -R_H_LINE_TO, 8, -R_V_LINE_TO, -2, -R_H_LINE_TO, 3, -V_LINE_TO, 6.5f, +FILL_RULE_NONZERO, +MOVE_TO, 10.75f, 5.47f, +V_LINE_TO, 3.65f, +H_LINE_TO, 5.25f, +R_V_LINE_TO, 1.82f, +H_LINE_TO, 3.86f, +R_V_LINE_TO, -3.2f, +R_H_LINE_TO, 8.27f, +R_V_LINE_TO, 3.2f, CLOSE, -R_MOVE_TO, -9.5f, -3, -R_H_LINE_TO, 5, -V_LINE_TO, 5, -R_H_LINE_TO, -5, -V_LINE_TO, 3.5f, +MOVE_TO, 2.85f, 6.85f, +R_H_LINE_TO, 10.32f, CLOSE, -R_MOVE_TO, 5, 9, -R_H_LINE_TO, -5, -R_V_LINE_TO, -2, -R_H_LINE_TO, 5, -R_V_LINE_TO, 2, +R_MOVE_TO, 8.86f, 1.72f, +R_ARC_TO, 0.65f, 0.65f, 0, 0, 0, 0.66f, -0.66f, +R_ARC_TO, 0.66f, 0.66f, 0, 0, 0, -0.19f, -0.47f, +R_ARC_TO, 0.63f, 0.63f, 0, 0, 0, -0.47f, -0.19f, +R_ARC_TO, 0.67f, 0.67f, 0, 0, 0, -0.47f, 0.19f, +R_ARC_TO, 0.64f, 0.64f, 0, 0, 0, -0.19f, 0.47f, +R_ARC_TO, 0.66f, 0.66f, 0, 0, 0, 0.66f, 0.66f, CLOSE, -R_MOVE_TO, 3, -2, -H_LINE_TO, 12, -V_LINE_TO, 9, -H_LINE_TO, 4, -R_V_LINE_TO, 1.5f, -H_LINE_TO, 2.5f, -R_V_LINE_TO, -4, -R_H_LINE_TO, 11, -R_V_LINE_TO, 4, +R_MOVE_TO, -0.95f, 3.88f, +R_V_LINE_TO, -2.1f, +H_LINE_TO, 5.25f, +R_V_LINE_TO, 2.09f, CLOSE, -NEW_PATH, -MOVE_TO, 12, 8.5f, -R_CUBIC_TO, 0.41f, 0, 0.75f, -0.34f, 0.75f, -0.75f, -CUBIC_TO_SHORTHAND, 12.41f, 7, 12, 7, -R_CUBIC_TO, -0.41f, 0, -0.75f, 0.34f, -0.75f, 0.75f, -R_CUBIC_TO, 0, 0.41f, 0.34f, 0.75f, 0.75f, 0.75f, +R_MOVE_TO, 1.38f, 1.36f, +H_LINE_TO, 3.86f, +R_V_LINE_TO, -2.49f, +H_LINE_TO, 1.47f, +V_LINE_TO, 7.2f, +R_CUBIC_TO, 0, -0.48f, 0.17f, -0.89f, 0.5f, -1.23f, +R_CUBIC_TO, 0.33f, -0.34f, 0.74f, -0.51f, 1.22f, -0.51f, +R_H_LINE_TO, 9.63f, +R_CUBIC_TO, 0.48f, 0, 0.89f, 0.17f, 1.22f, 0.51f, +R_CUBIC_TO, 0.33f, 0.34f, 0.5f, 0.75f, 0.5f, 1.23f, +R_V_LINE_TO, 4.11f, +R_H_LINE_TO, -2.4f, +CLOSE, +R_MOVE_TO, 1.03f, -3.87f, +R_V_LINE_TO, -2.5f, +R_ARC_TO, 0.53f, 0.53f, 0, 0, 0, -0.18f, -0.41f, +R_ARC_TO, 0.61f, 0.61f, 0, 0, 0, -0.42f, -0.17f, +H_LINE_TO, 3.42f, +R_CUBIC_TO, -0.16f, 0, -0.3f, 0.06f, -0.41f, 0.17f, +R_ARC_TO, 0.58f, 0.58f, 0, 0, 0, -0.16f, 0.42f, +V_LINE_TO, 9.93f, +R_H_LINE_TO, 1.01f, +R_V_LINE_TO, -0.96f, +R_H_LINE_TO, 8.27f, +R_V_LINE_TO, 0.96f, CLOSE
diff --git a/chrome/app/vector_icons/qr_code_chrome_refresh.icon b/chrome/app/vector_icons/qr_code_chrome_refresh.icon index abeb974..f273c77 100644 --- a/chrome/app/vector_icons/qr_code_chrome_refresh.icon +++ b/chrome/app/vector_icons/qr_code_chrome_refresh.icon
@@ -1,147 +1,149 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 20, -MOVE_TO, 2.77f, 9, -V_LINE_TO, 2.77f, -H_LINE_TO, 9, -V_LINE_TO, 9, +FILL_RULE_NONZERO, +MOVE_TO, 3, 9, +V_LINE_TO, 3, +R_H_LINE_TO, 6, +R_V_LINE_TO, 6, CLOSE, -MOVE_TO, 4.5f, 7.27f, -R_H_LINE_TO, 2.77f, -V_LINE_TO, 4.5f, -H_LINE_TO, 4.5f, +R_MOVE_TO, 1.5f, -1.5f, +R_H_LINE_TO, 3, +R_V_LINE_TO, -3, +R_H_LINE_TO, -3, CLOSE, -R_MOVE_TO, -1.73f, 9.96f, -V_LINE_TO, 11, -H_LINE_TO, 9, -R_V_LINE_TO, 6.23f, +MOVE_TO, 3, 17, +R_V_LINE_TO, -6, +R_H_LINE_TO, 6, +R_V_LINE_TO, 6, CLOSE, -MOVE_TO, 4.5f, 15.5f, -R_H_LINE_TO, 2.77f, -R_V_LINE_TO, -2.77f, -H_LINE_TO, 4.5f, +R_MOVE_TO, 1.5f, -1.5f, +R_H_LINE_TO, 3, +R_V_LINE_TO, -3, +R_H_LINE_TO, -3, CLOSE, MOVE_TO, 11, 9, -V_LINE_TO, 2.77f, -R_H_LINE_TO, 6.23f, -V_LINE_TO, 9, +V_LINE_TO, 3, +R_H_LINE_TO, 6, +R_V_LINE_TO, 6, CLOSE, -R_MOVE_TO, 1.73f, -1.73f, -R_H_LINE_TO, 2.77f, -V_LINE_TO, 4.5f, -R_H_LINE_TO, -2.77f, +R_MOVE_TO, 1.5f, -1.5f, +R_H_LINE_TO, 3, +R_V_LINE_TO, -3, +R_H_LINE_TO, -3, CLOSE, -R_MOVE_TO, 2.95f, 9.96f, -R_V_LINE_TO, -1.56f, -R_H_LINE_TO, 1.55f, -R_V_LINE_TO, 1.56f, +R_MOVE_TO, 3, 9.5f, +R_V_LINE_TO, -1.5f, +H_LINE_TO, 17, +V_LINE_TO, 17, CLOSE, -MOVE_TO, 11, 12.56f, +MOVE_TO, 11, 12.5f, V_LINE_TO, 11, -R_H_LINE_TO, 1.56f, -R_V_LINE_TO, 1.56f, +R_H_LINE_TO, 1.5f, +R_V_LINE_TO, 1.5f, CLOSE, -R_MOVE_TO, 1.56f, 1.56f, -R_V_LINE_TO, -1.56f, -R_H_LINE_TO, 1.55f, -R_V_LINE_TO, 1.56f, +R_MOVE_TO, 1.5f, 1.5f, +R_V_LINE_TO, -1.5f, +H_LINE_TO, 14, +V_LINE_TO, 14, CLOSE, -MOVE_TO, 11, 15.67f, -R_V_LINE_TO, -1.55f, -R_H_LINE_TO, 1.56f, -R_V_LINE_TO, 1.56f, +MOVE_TO, 11, 15.5f, +V_LINE_TO, 14, +R_H_LINE_TO, 1.5f, +R_V_LINE_TO, 1.5f, CLOSE, -R_MOVE_TO, 1.56f, 1.56f, -R_V_LINE_TO, -1.56f, -R_H_LINE_TO, 1.55f, -R_V_LINE_TO, 1.56f, +R_MOVE_TO, 1.5f, 1.5f, +R_V_LINE_TO, -1.5f, +H_LINE_TO, 14, +V_LINE_TO, 17, CLOSE, -R_MOVE_TO, 1.55f, -1.56f, -R_V_LINE_TO, -1.55f, -R_H_LINE_TO, 1.56f, -R_V_LINE_TO, 1.56f, +R_MOVE_TO, 1.5f, -1.5f, +V_LINE_TO, 14, +R_H_LINE_TO, 1.5f, +R_V_LINE_TO, 1.5f, CLOSE, -R_MOVE_TO, 0, -3.11f, +R_MOVE_TO, 0, -3, V_LINE_TO, 11, -R_H_LINE_TO, 1.56f, -R_V_LINE_TO, 1.56f, +R_H_LINE_TO, 1.5f, +R_V_LINE_TO, 1.5f, CLOSE, -R_MOVE_TO, 1.56f, 1.56f, -R_V_LINE_TO, -1.56f, -R_H_LINE_TO, 1.55f, -R_V_LINE_TO, 1.56f, +R_MOVE_TO, 1.5f, 1.5f, +R_V_LINE_TO, -1.5f, +H_LINE_TO, 17, +V_LINE_TO, 14, CLOSE CANVAS_DIMENSIONS, 16, -MOVE_TO, 1.97f, 7.2f, -V_LINE_TO, 1.96f, -R_H_LINE_TO, 5.23f, -R_V_LINE_TO, 5.23f, +FILL_RULE_NONZERO, +MOVE_TO, 2.22f, 7.2f, +V_LINE_TO, 2.21f, +R_H_LINE_TO, 4.98f, +R_V_LINE_TO, 4.98f, CLOSE, -R_MOVE_TO, 1.64f, -1.63f, -R_H_LINE_TO, 1.96f, +R_MOVE_TO, 1.39f, -1.38f, +R_H_LINE_TO, 2.21f, V_LINE_TO, 3.6f, H_LINE_TO, 3.6f, CLOSE, -R_MOVE_TO, -1.64f, 8.47f, +R_MOVE_TO, -1.39f, 7.97f, V_LINE_TO, 8.8f, -R_H_LINE_TO, 5.23f, -R_V_LINE_TO, 5.23f, +R_H_LINE_TO, 4.98f, +R_V_LINE_TO, 4.98f, CLOSE, -R_MOVE_TO, 1.64f, -1.64f, -R_H_LINE_TO, 1.96f, -R_V_LINE_TO, -1.96f, +R_MOVE_TO, 1.39f, -1.39f, +R_H_LINE_TO, 2.21f, +R_V_LINE_TO, -2.21f, H_LINE_TO, 3.6f, CLOSE, MOVE_TO, 8.8f, 7.2f, -V_LINE_TO, 1.97f, -R_H_LINE_TO, 5.23f, -R_V_LINE_TO, 5.23f, +V_LINE_TO, 2.22f, +R_H_LINE_TO, 4.98f, +R_V_LINE_TO, 4.98f, CLOSE, -R_MOVE_TO, 1.63f, -1.63f, -R_H_LINE_TO, 1.96f, +R_MOVE_TO, 1.38f, -1.38f, +R_H_LINE_TO, 2.21f, V_LINE_TO, 3.6f, -R_H_LINE_TO, -1.96f, +R_H_LINE_TO, -2.21f, CLOSE, -R_MOVE_TO, 2.3f, 8.47f, -R_V_LINE_TO, -1.32f, -R_H_LINE_TO, 1.31f, -R_V_LINE_TO, 1.32f, +R_MOVE_TO, 2.36f, 7.97f, +R_V_LINE_TO, -1.25f, +R_H_LINE_TO, 1.25f, +R_V_LINE_TO, 1.25f, CLOSE, -R_MOVE_TO, -3.93f, -3.93f, +R_MOVE_TO, -3.74f, -3.74f, V_LINE_TO, 8.8f, -R_H_LINE_TO, 1.31f, -R_V_LINE_TO, 1.3f, +R_H_LINE_TO, 1.25f, +R_V_LINE_TO, 1.24f, CLOSE, -R_MOVE_TO, 1.31f, 1.31f, -R_V_LINE_TO, -1.31f, -R_H_LINE_TO, 1.31f, -R_V_LINE_TO, 1.31f, +R_MOVE_TO, 1.25f, 1.25f, +R_V_LINE_TO, -1.25f, +R_H_LINE_TO, 1.25f, +R_V_LINE_TO, 1.25f, CLOSE, -R_MOVE_TO, -1.31f, 1.3f, -R_V_LINE_TO, -1.3f, -R_H_LINE_TO, 1.31f, -R_V_LINE_TO, 1.3f, +MOVE_TO, 8.8f, 12.54f, +R_V_LINE_TO, -1.24f, +R_H_LINE_TO, 1.25f, +R_V_LINE_TO, 1.24f, CLOSE, -R_MOVE_TO, 1.31f, 1.32f, -V_LINE_TO, 12.72f, -R_H_LINE_TO, 1.31f, -R_V_LINE_TO, 1.32f, +R_MOVE_TO, 1.25f, 1.25f, +R_V_LINE_TO, -1.25f, +R_H_LINE_TO, 1.25f, +R_V_LINE_TO, 1.25f, CLOSE, -R_MOVE_TO, 1.31f, -1.32f, -R_V_LINE_TO, -1.3f, -R_H_LINE_TO, 1.31f, -R_V_LINE_TO, 1.3f, +R_MOVE_TO, 1.25f, -1.25f, +R_V_LINE_TO, -1.24f, +R_H_LINE_TO, 1.25f, +R_V_LINE_TO, 1.24f, CLOSE, -R_MOVE_TO, 0, -2.61f, +R_MOVE_TO, 0, -2.49f, V_LINE_TO, 8.8f, -R_H_LINE_TO, 1.31f, -R_V_LINE_TO, 1.3f, +R_H_LINE_TO, 1.25f, +R_V_LINE_TO, 1.24f, CLOSE, -R_MOVE_TO, 1.31f, 1.31f, -R_V_LINE_TO, -1.31f, -R_H_LINE_TO, 1.31f, -R_V_LINE_TO, 1.31f, +R_MOVE_TO, 1.25f, 1.25f, +R_V_LINE_TO, -1.25f, +R_H_LINE_TO, 1.25f, +R_V_LINE_TO, 1.25f, CLOSE
diff --git a/chrome/app/vector_icons/read_later_add.icon b/chrome/app/vector_icons/read_later_add.icon index 2abaaab..56d46006 100644 --- a/chrome/app/vector_icons/read_later_add.icon +++ b/chrome/app/vector_icons/read_later_add.icon
@@ -1,70 +1,86 @@ -// Copyright 2020 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 13.54f, 0, -R_H_LINE_TO, -1.23f, -V_LINE_TO, 2.46f, -H_LINE_TO, 9.85f, -R_V_LINE_TO, 1.23f, -R_H_LINE_TO, 2.46f, -R_V_LINE_TO, 2.46f, -R_H_LINE_TO, 1.23f, -V_LINE_TO, 3.69f, -H_LINE_TO, 16, -R_V_LINE_TO, -1.23f, -R_H_LINE_TO, -2.46f, -V_LINE_TO, 0, +FILL_RULE_NONZERO, +MOVE_TO, 11.52f, 15.41f, +R_V_LINE_TO, -1.8f, +H_LINE_TO, 9.72f, +R_V_LINE_TO, -1.3f, +R_H_LINE_TO, 1.8f, +R_V_LINE_TO, -1.8f, +R_H_LINE_TO, 1.31f, +R_V_LINE_TO, 1.8f, +R_H_LINE_TO, 1.8f, +R_V_LINE_TO, 1.3f, +R_H_LINE_TO, -1.8f, +R_V_LINE_TO, 1.8f, CLOSE, -R_MOVE_TO, -1.23f, 14.77f, -H_LINE_TO, 1.23f, -V_LINE_TO, 3.69f, -R_H_LINE_TO, 7.38f, -R_V_LINE_TO, -1.23f, -H_LINE_TO, 1.23f, -CUBIC_TO, 0.55f, 2.46f, 0, 3.01f, 0, 3.69f, -V_LINE_TO, 14.77f, -CUBIC_TO, 0, 15.45f, 0.55f, 16, 1.23f, 16, -R_H_LINE_TO, 11.08f, -R_CUBIC_TO, 0.68f, 0, 1.23f, -0.55f, 1.23f, -1.23f, -V_LINE_TO, 7.38f, -R_H_LINE_TO, -1.23f, -R_V_LINE_TO, 7.38f, +R_MOVE_TO, -7.87f, -3.06f, +V_LINE_TO, 3.65f, CLOSE, -MOVE_TO, 5, 6.15f, -R_V_LINE_TO, 1.23f, -R_H_LINE_TO, 6, -R_V_LINE_TO, -1.23f, -H_LINE_TO, 5, +R_MOVE_TO, 0, 1.38f, +R_CUBIC_TO, -0.39f, 0, -0.72f, -0.13f, -0.98f, -0.4f, +R_ARC_TO, 1.34f, 1.34f, 0, 0, 1, -0.4f, -0.98f, +V_LINE_TO, 3.65f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.71f, 0.4f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.4f, 0.98f, -0.4f, +R_H_LINE_TO, 8.7f, +R_CUBIC_TO, 0.38f, 0, 0.71f, 0.13f, 0.98f, 0.4f, +R_CUBIC_TO, 0.27f, 0.27f, 0.4f, 0.6f, 0.4f, 0.98f, +R_V_LINE_TO, 5.59f, +R_ARC_TO, 3.43f, 3.43f, 0, 0, 0, -0.67f, -0.22f, +R_ARC_TO, 3.92f, 3.92f, 0, 0, 0, -0.71f, -0.08f, +V_LINE_TO, 3.65f, +H_LINE_TO, 3.65f, +R_V_LINE_TO, 8.7f, +R_H_LINE_TO, 4.52f, +R_CUBIC_TO, -0.04f, 0.23f, -0.06f, 0.46f, -0.05f, 0.69f, +R_CUBIC_TO, 0, 0.23f, 0.03f, 0.46f, 0.08f, 0.69f, CLOSE, -R_MOVE_TO, -2, 0, -R_V_LINE_TO, 1.23f, -R_H_LINE_TO, 1.23f, -R_V_LINE_TO, -1.23f, -H_LINE_TO, 3, +R_MOVE_TO, 1.74f, -2.56f, +R_ARC_TO, 0.59f, 0.59f, 0, 0, 0, 0.43f, -0.17f, +R_ARC_TO, 0.57f, 0.57f, 0, 0, 0, 0.18f, -0.43f, +R_ARC_TO, 0.59f, 0.59f, 0, 0, 0, -0.17f, -0.43f, +R_ARC_TO, 0.57f, 0.57f, 0, 0, 0, -0.43f, -0.17f, +R_ARC_TO, 0.58f, 0.58f, 0, 0, 0, -0.42f, 0.17f, +R_ARC_TO, 0.57f, 0.57f, 0, 0, 0, -0.18f, 0.43f, +R_CUBIC_TO, 0, 0.17f, 0.05f, 0.31f, 0.17f, 0.43f, +R_ARC_TO, 0.56f, 0.56f, 0, 0, 0, 0.42f, 0.18f, CLOSE, -R_MOVE_TO, 2, 2.46f, -R_H_LINE_TO, 6, -R_V_LINE_TO, 1.23f, -H_LINE_TO, 5, -R_V_LINE_TO, -1.23f, +R_MOVE_TO, 0, -2.57f, +ARC_TO, 0.59f, 0.59f, 0, 0, 0, 6, 8, +R_ARC_TO, 0.6f, 0.6f, 0, 0, 0, -0.17f, -0.43f, +R_ARC_TO, 0.57f, 0.57f, 0, 0, 0, -0.43f, -0.18f, +R_ARC_TO, 0.58f, 0.58f, 0, 0, 0, -0.42f, 0.17f, +R_ARC_TO, 0.58f, 0.58f, 0, 0, 0, -0.18f, 0.43f, +R_CUBIC_TO, 0, 0.17f, 0.05f, 0.31f, 0.17f, 0.43f, +R_ARC_TO, 0.56f, 0.56f, 0, 0, 0, 0.42f, 0.18f, CLOSE, -R_MOVE_TO, -0.77f, 0, -H_LINE_TO, 3, -R_V_LINE_TO, 1.23f, -R_H_LINE_TO, 1.23f, -R_V_LINE_TO, -1.23f, +R_MOVE_TO, 0, -2.58f, +R_ARC_TO, 0.59f, 0.59f, 0, 0, 0, 0.43f, -0.17f, +ARC_TO, 0.57f, 0.57f, 0, 0, 0, 6, 5.43f, +ARC_TO, 0.59f, 0.59f, 0, 0, 0, 5.83f, 5, +R_ARC_TO, 0.57f, 0.57f, 0, 0, 0, -0.43f, -0.18f, +R_ARC_TO, 0.58f, 0.58f, 0, 0, 0, -0.42f, 0.17f, +R_ARC_TO, 0.57f, 0.57f, 0, 0, 0, -0.18f, 0.43f, +R_CUBIC_TO, 0, 0.17f, 0.05f, 0.31f, 0.17f, 0.43f, +R_ARC_TO, 0.56f, 0.56f, 0, 0, 0, 0.42f, 0.18f, CLOSE, -MOVE_TO, 5, 11.08f, -R_H_LINE_TO, 6, -R_V_LINE_TO, 1.23f, -H_LINE_TO, 5, -R_V_LINE_TO, -1.23f, +R_MOVE_TO, 1.8f, 2.58f, +R_H_LINE_TO, 4, +V_LINE_TO, 7.4f, +R_H_LINE_TO, -4, CLOSE, -R_MOVE_TO, -0.77f, 0, -H_LINE_TO, 3, -R_V_LINE_TO, 1.23f, -R_H_LINE_TO, 1.23f, -R_V_LINE_TO, -1.23f, -CLOSE \ No newline at end of file +R_MOVE_TO, 0, -2.58f, +R_H_LINE_TO, 4, +V_LINE_TO, 4.82f, +R_H_LINE_TO, -4, +CLOSE, +R_MOVE_TO, 0, 5.15f, +R_H_LINE_TO, 1.33f, +R_CUBIC_TO, 0.12f, -0.22f, 0.25f, -0.44f, 0.41f, -0.64f, +R_CUBIC_TO, 0.16f, -0.2f, 0.33f, -0.39f, 0.51f, -0.56f, +H_LINE_TO, 7.2f, +CLOSE
diff --git a/chrome/app/vector_icons/reading_list.icon b/chrome/app/vector_icons/reading_list.icon index 3fe2f817..c7c57180 100644 --- a/chrome/app/vector_icons/reading_list.icon +++ b/chrome/app/vector_icons/reading_list.icon
@@ -1,73 +1,72 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 20, -MOVE_TO, 6.75f, 13.97f, +FILL_RULE_NONZERO, +MOVE_TO, 6.75f, 14, R_CUBIC_TO, 0.21f, 0, 0.39f, -0.07f, 0.54f, -0.21f, -R_ARC_TO, 0.71f, 0.71f, 0, 0, 0, 0.22f, -0.53f, -R_ARC_TO, 0.74f, 0.74f, 0, 0, 0, -0.21f, -0.54f, -R_ARC_TO, 0.71f, 0.71f, 0, 0, 0, -0.53f, -0.22f, -R_ARC_TO, 0.74f, 0.74f, 0, 0, 0, -0.53f, 0.21f, -R_ARC_TO, 0.71f, 0.71f, 0, 0, 0, -0.22f, 0.53f, -R_CUBIC_TO, 0, 0.21f, 0.07f, 0.39f, 0.21f, 0.54f, -R_CUBIC_TO, 0.14f, 0.15f, 0.32f, 0.22f, 0.53f, 0.22f, +R_ARC_TO, 0.72f, 0.72f, 0, 0, 0, 0.22f, -0.53f, +R_CUBIC_TO, 0, -0.21f, -0.07f, -0.39f, -0.21f, -0.53f, +R_ARC_TO, 0.72f, 0.72f, 0, 0, 0, -0.53f, -0.22f, +R_CUBIC_TO, -0.21f, 0, -0.39f, 0.07f, -0.53f, 0.22f, +R_ARC_TO, 0.72f, 0.72f, 0, 0, 0, -0.22f, 0.53f, +R_CUBIC_TO, 0, 0.21f, 0.07f, 0.39f, 0.22f, 0.54f, +R_CUBIC_TO, 0.14f, 0.14f, 0.32f, 0.22f, 0.53f, 0.22f, CLOSE, -R_MOVE_TO, 0, -3.22f, +R_MOVE_TO, 0, -3.25f, R_CUBIC_TO, 0.21f, 0, 0.39f, -0.07f, 0.54f, -0.21f, -R_ARC_TO, 0.71f, 0.71f, 0, 0, 0, 0.22f, -0.53f, -R_ARC_TO, 0.74f, 0.74f, 0, 0, 0, -0.21f, -0.53f, -R_ARC_TO, 0.71f, 0.71f, 0, 0, 0, -0.53f, -0.22f, -R_ARC_TO, 0.74f, 0.74f, 0, 0, 0, -0.53f, 0.21f, -R_ARC_TO, 0.71f, 0.71f, 0, 0, 0, -0.22f, 0.53f, -R_CUBIC_TO, 0, 0.21f, 0.07f, 0.39f, 0.21f, 0.54f, -R_CUBIC_TO, 0.14f, 0.15f, 0.32f, 0.22f, 0.53f, 0.22f, +R_ARC_TO, 0.72f, 0.72f, 0, 0, 0, 0.22f, -0.53f, +R_CUBIC_TO, 0, -0.21f, -0.07f, -0.39f, -0.21f, -0.53f, +R_ARC_TO, 0.72f, 0.72f, 0, 0, 0, -0.53f, -0.22f, +R_CUBIC_TO, -0.21f, 0, -0.39f, 0.07f, -0.53f, 0.22f, +ARC_TO, 0.72f, 0.72f, 0, 0, 0, 6, 10, +R_CUBIC_TO, 0, 0.21f, 0.07f, 0.39f, 0.22f, 0.54f, +R_CUBIC_TO, 0.14f, 0.14f, 0.32f, 0.22f, 0.53f, 0.22f, CLOSE, -R_MOVE_TO, 0, -3.22f, +R_MOVE_TO, 0, -3.25f, R_CUBIC_TO, 0.21f, 0, 0.39f, -0.07f, 0.54f, -0.21f, -R_ARC_TO, 0.71f, 0.71f, 0, 0, 0, 0.22f, -0.53f, -R_ARC_TO, 0.74f, 0.74f, 0, 0, 0, -0.21f, -0.53f, -R_ARC_TO, 0.71f, 0.71f, 0, 0, 0, -0.53f, -0.22f, -R_ARC_TO, 0.74f, 0.74f, 0, 0, 0, -0.53f, 0.22f, -R_ARC_TO, 0.71f, 0.71f, 0, 0, 0, -0.22f, 0.53f, -R_CUBIC_TO, 0, 0.21f, 0.07f, 0.39f, 0.21f, 0.54f, -R_CUBIC_TO, 0.14f, 0.15f, 0.32f, 0.22f, 0.53f, 0.22f, +R_ARC_TO, 0.72f, 0.72f, 0, 0, 0, 0.22f, -0.53f, +R_CUBIC_TO, 0, -0.21f, -0.07f, -0.39f, -0.21f, -0.53f, +ARC_TO, 0.72f, 0.72f, 0, 0, 0, 6.75f, 6, +R_CUBIC_TO, -0.21f, 0, -0.39f, 0.07f, -0.53f, 0.22f, +ARC_TO, 0.72f, 0.72f, 0, 0, 0, 6, 6.75f, +R_CUBIC_TO, 0, 0.21f, 0.07f, 0.39f, 0.22f, 0.54f, +R_CUBIC_TO, 0.14f, 0.14f, 0.32f, 0.22f, 0.53f, 0.22f, CLOSE, -MOVE_TO, 9, 13.97f, +MOVE_TO, 9, 14, R_H_LINE_TO, 5, R_V_LINE_TO, -1.5f, H_LINE_TO, 9, -R_V_LINE_TO, 1.5f, CLOSE, -R_MOVE_TO, 0, -3.22f, +R_MOVE_TO, 0, -3.25f, R_H_LINE_TO, 5, R_V_LINE_TO, -1.5f, H_LINE_TO, 9, -R_V_LINE_TO, 1.5f, CLOSE, -R_MOVE_TO, 0, -3.22f, +MOVE_TO, 9, 7.5f, R_H_LINE_TO, 5, -R_V_LINE_TO, -1.5f, +V_LINE_TO, 6, H_LINE_TO, 9, -R_V_LINE_TO, 1.5f, CLOSE, -R_MOVE_TO, -4.44f, 9.64f, -R_CUBIC_TO, -0.48f, 0, -0.89f, -0.17f, -1.22f, -0.51f, -R_ARC_TO, 1.67f, 1.67f, 0, 0, 1, -0.5f, -1.22f, -V_LINE_TO, 4.56f, -R_CUBIC_TO, 0, -0.48f, 0.17f, -0.89f, 0.51f, -1.22f, -R_ARC_TO, 1.67f, 1.67f, 0, 0, 1, 1.22f, -0.5f, -R_H_LINE_TO, 10.88f, -R_CUBIC_TO, 0.48f, 0, 0.89f, 0.17f, 1.22f, 0.51f, -R_CUBIC_TO, 0.34f, 0.34f, 0.51f, 0.75f, 0.51f, 1.22f, -R_V_LINE_TO, 10.88f, -R_CUBIC_TO, 0, 0.48f, -0.17f, 0.89f, -0.5f, 1.22f, -R_ARC_TO, 1.67f, 1.67f, 0, 0, 1, -1.22f, 0.51f, -H_LINE_TO, 4.56f, +MOVE_TO, 4.5f, 17, +R_CUBIC_TO, -0.41f, 0, -0.77f, -0.15f, -1.06f, -0.44f, +ARC_TO, 1.44f, 1.44f, 0, 0, 1, 3, 15.5f, +R_V_LINE_TO, -11, +R_CUBIC_TO, 0, -0.41f, 0.15f, -0.77f, 0.44f, -1.06f, +ARC_TO, 1.44f, 1.44f, 0, 0, 1, 4.5f, 3, +R_H_LINE_TO, 11, +R_CUBIC_TO, 0.41f, 0, 0.77f, 0.15f, 1.06f, 0.44f, +R_CUBIC_TO, 0.29f, 0.29f, 0.44f, 0.65f, 0.44f, 1.06f, +R_V_LINE_TO, 11, +R_CUBIC_TO, 0, 0.41f, -0.15f, 0.77f, -0.44f, 1.06f, +ARC_TO, 1.44f, 1.44f, 0, 0, 1, 15.5f, 17, CLOSE, -R_MOVE_TO, 0, -1.73f, -R_H_LINE_TO, 10.88f, -V_LINE_TO, 4.56f, -H_LINE_TO, 4.56f, -R_V_LINE_TO, 10.88f, -CLOSE \ No newline at end of file +R_MOVE_TO, 0, -1.5f, +R_H_LINE_TO, 11, +R_V_LINE_TO, -11, +R_H_LINE_TO, -11, +CLOSE, +R_MOVE_TO, 0, -11, +R_V_LINE_TO, 11, +CLOSE
diff --git a/chrome/app/vector_icons/request_mobile_site_checked.icon b/chrome/app/vector_icons/request_mobile_site_checked.icon index c81b33b..709c238 100644 --- a/chrome/app/vector_icons/request_mobile_site_checked.icon +++ b/chrome/app/vector_icons/request_mobile_site_checked.icon
@@ -1,49 +1,50 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 3.74f, 15.49f, -R_CUBIC_TO, -0.45f, 0, -0.84f, -0.16f, -1.16f, -0.48f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, -0.48f, -1.15f, -V_LINE_TO, 2.14f, -R_CUBIC_TO, 0, -0.45f, 0.16f, -0.83f, 0.48f, -1.15f, -R_CUBIC_TO, 0.32f, -0.32f, 0.71f, -0.48f, 1.16f, -0.48f, -R_H_LINE_TO, 6.92f, -R_CUBIC_TO, 0.45f, 0, 0.83f, 0.16f, 1.15f, 0.48f, -R_CUBIC_TO, 0.32f, 0.32f, 0.48f, 0.7f, 0.48f, 1.15f, +FILL_RULE_NONZERO, +MOVE_TO, 3.66f, 15.32f, +R_CUBIC_TO, -0.38f, 0, -0.71f, -0.14f, -0.98f, -0.41f, +R_ARC_TO, 1.33f, 1.33f, 0, 0, 1, -0.41f, -0.98f, +V_LINE_TO, 2.06f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.7f, 0.41f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.41f, 0.98f, -0.41f, +R_H_LINE_TO, 7.08f, +R_CUBIC_TO, 0.38f, 0, 0.71f, 0.14f, 0.98f, 0.41f, +R_CUBIC_TO, 0.27f, 0.27f, 0.41f, 0.6f, 0.41f, 0.98f, V_LINE_TO, 4.8f, -H_LINE_TO, 10.66f, -R_V_LINE_TO, -0.66f, -H_LINE_TO, 3.74f, -R_V_LINE_TO, 7.72f, -R_H_LINE_TO, 6.92f, -R_V_LINE_TO, -0.66f, -R_H_LINE_TO, 1.63f, -R_V_LINE_TO, 2.66f, -R_CUBIC_TO, 0, 0.45f, -0.16f, 0.83f, -0.48f, 1.15f, -R_CUBIC_TO, -0.32f, 0.32f, -0.7f, 0.48f, -1.15f, 0.48f, +R_H_LINE_TO, -1.39f, +R_V_LINE_TO, -0.74f, +H_LINE_TO, 3.66f, +R_V_LINE_TO, 7.88f, +R_H_LINE_TO, 7.08f, +V_LINE_TO, 11.2f, +R_H_LINE_TO, 1.39f, +R_V_LINE_TO, 2.74f, +R_CUBIC_TO, 0, 0.38f, -0.14f, 0.7f, -0.41f, 0.98f, +R_CUBIC_TO, -0.27f, 0.27f, -0.6f, 0.41f, -0.98f, 0.41f, CLOSE, -R_MOVE_TO, 0, -2.43f, +R_MOVE_TO, 0, -2.18f, R_V_LINE_TO, 0.8f, -R_H_LINE_TO, 6.92f, +R_H_LINE_TO, 7.08f, R_V_LINE_TO, -0.8f, CLOSE, -R_MOVE_TO, 6.5f, -2.61f, -R_LINE_TO, -2.96f, -2.98f, -R_LINE_TO, 1.11f, -1.11f, -R_LINE_TO, 1.85f, 1.86f, -R_LINE_TO, 3.57f, -3.56f, -R_LINE_TO, 1.11f, 1.1f, +R_MOVE_TO, 6.37f, -2.72f, +LINE_TO, 7.15f, 7.52f, +R_LINE_TO, 0.96f, -0.96f, +R_LINE_TO, 1.92f, 1.93f, +R_LINE_TO, 3.63f, -3.63f, +R_LINE_TO, 0.96f, 0.96f, CLOSE, -R_MOVE_TO, -6.5f, -7.5f, -R_H_LINE_TO, 6.92f, +MOVE_TO, 3.66f, 2.86f, +R_H_LINE_TO, 7.08f, R_V_LINE_TO, -0.8f, -H_LINE_TO, 3.74f, +H_LINE_TO, 3.66f, CLOSE, R_MOVE_TO, 0, 0, R_V_LINE_TO, -0.8f, CLOSE, -R_MOVE_TO, 0, 10.12f, +R_MOVE_TO, 0, 10.28f, R_V_LINE_TO, 0.8f, -CLOSE \ No newline at end of file +CLOSE
diff --git a/chrome/app/vector_icons/request_mobile_site_unchecked.icon b/chrome/app/vector_icons/request_mobile_site_unchecked.icon index 8fd6930..7ec72cb9a 100644 --- a/chrome/app/vector_icons/request_mobile_site_unchecked.icon +++ b/chrome/app/vector_icons/request_mobile_site_unchecked.icon
@@ -1,39 +1,40 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 4.54f, 15.49f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, -1.16f, -0.48f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, -0.48f, -1.16f, -V_LINE_TO, 2.14f, -R_CUBIC_TO, 0, -0.45f, 0.16f, -0.84f, 0.48f, -1.16f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 1.16f, -0.48f, -R_H_LINE_TO, 6.91f, -R_CUBIC_TO, 0.46f, 0, 0.84f, 0.16f, 1.16f, 0.48f, -R_CUBIC_TO, 0.32f, 0.32f, 0.48f, 0.7f, 0.48f, 1.16f, -R_V_LINE_TO, 11.72f, -R_CUBIC_TO, 0, 0.45f, -0.16f, 0.84f, -0.48f, 1.16f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, -1.16f, 0.48f, +FILL_RULE_NONZERO, +MOVE_TO, 4.46f, 15.32f, +R_CUBIC_TO, -0.38f, 0, -0.71f, -0.14f, -0.98f, -0.41f, +R_ARC_TO, 1.33f, 1.33f, 0, 0, 1, -0.4f, -0.98f, +V_LINE_TO, 2.06f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.71f, 0.4f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.41f, 0.98f, -0.41f, +R_H_LINE_TO, 7.08f, +R_CUBIC_TO, 0.38f, 0, 0.71f, 0.14f, 0.98f, 0.41f, +R_CUBIC_TO, 0.27f, 0.27f, 0.4f, 0.59f, 0.4f, 0.98f, +V_LINE_TO, 13.94f, +R_CUBIC_TO, 0, 0.38f, -0.13f, 0.71f, -0.4f, 0.98f, +R_CUBIC_TO, -0.27f, 0.27f, -0.6f, 0.41f, -0.98f, 0.41f, CLOSE, -R_MOVE_TO, 0, -2.43f, +R_MOVE_TO, 0, -2.18f, R_V_LINE_TO, 0.8f, -R_H_LINE_TO, 6.91f, +R_H_LINE_TO, 7.08f, R_V_LINE_TO, -0.8f, CLOSE, R_MOVE_TO, 0, -1.2f, -R_H_LINE_TO, 6.91f, -V_LINE_TO, 4.14f, -H_LINE_TO, 4.54f, +R_H_LINE_TO, 7.08f, +V_LINE_TO, 4.06f, +H_LINE_TO, 4.46f, CLOSE, -R_MOVE_TO, 0, -8.92f, -R_H_LINE_TO, 6.91f, +R_MOVE_TO, 0, -9.08f, +R_H_LINE_TO, 7.08f, R_V_LINE_TO, -0.8f, -H_LINE_TO, 4.54f, +H_LINE_TO, 4.46f, CLOSE, R_MOVE_TO, 0, 0, R_V_LINE_TO, -0.8f, CLOSE, -R_MOVE_TO, 0, 10.12f, +R_MOVE_TO, 0, 10.28f, R_V_LINE_TO, 0.8f, -CLOSE \ No newline at end of file +CLOSE
diff --git a/chrome/app/vector_icons/saved_tab_group_bar_everything.icon b/chrome/app/vector_icons/saved_tab_group_bar_everything.icon index 75aa3ca9..6ab18b9 100644 --- a/chrome/app/vector_icons/saved_tab_group_bar_everything.icon +++ b/chrome/app/vector_icons/saved_tab_group_bar_everything.icon
@@ -3,53 +3,52 @@ // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 2.25f, 6.95f, -R_V_LINE_TO, -4.7f, -R_H_LINE_TO, 4.7f, -R_V_LINE_TO, 4.7f, +FILL_RULE_NONZERO, +MOVE_TO, 2.27f, 7.2f, +V_LINE_TO, 2.27f, +R_H_LINE_TO, 4.93f, +R_V_LINE_TO, 4.93f, CLOSE, -R_MOVE_TO, 1.54f, -1.54f, -R_H_LINE_TO, 1.62f, -V_LINE_TO, 3.79f, -H_LINE_TO, 3.79f, +R_MOVE_TO, 0, 6.53f, +V_LINE_TO, 8.8f, +R_H_LINE_TO, 4.93f, +R_V_LINE_TO, 4.93f, CLOSE, -R_MOVE_TO, -1.54f, 8.34f, -R_V_LINE_TO, -4.7f, -R_H_LINE_TO, 4.7f, -R_V_LINE_TO, 4.7f, +MOVE_TO, 8.8f, 7.2f, +V_LINE_TO, 2.27f, +R_H_LINE_TO, 4.93f, +R_V_LINE_TO, 4.93f, CLOSE, -R_MOVE_TO, 1.54f, -1.54f, -R_H_LINE_TO, 1.62f, -R_V_LINE_TO, -1.62f, -H_LINE_TO, 3.79f, +R_MOVE_TO, 0, 6.54f, +V_LINE_TO, 8.8f, +R_H_LINE_TO, 4.93f, +R_V_LINE_TO, 4.93f, CLOSE, -R_MOVE_TO, 5.26f, -5.26f, -R_V_LINE_TO, -4.7f, -R_H_LINE_TO, 4.7f, -R_V_LINE_TO, 4.7f, +MOVE_TO, 3.65f, 5.82f, +R_H_LINE_TO, 2.17f, +V_LINE_TO, 3.65f, +H_LINE_TO, 3.65f, CLOSE, -R_MOVE_TO, 1.54f, -1.54f, -R_H_LINE_TO, 1.62f, -V_LINE_TO, 3.79f, -R_H_LINE_TO, -1.62f, +R_MOVE_TO, 6.54f, 0, +R_H_LINE_TO, 2.17f, +V_LINE_TO, 3.65f, +R_H_LINE_TO, -2.17f, CLOSE, -R_MOVE_TO, -1.54f, 8.34f, -R_V_LINE_TO, -4.7f, -R_H_LINE_TO, 4.7f, -R_V_LINE_TO, 4.7f, +R_MOVE_TO, 0, 6.54f, +R_H_LINE_TO, 2.17f, +R_V_LINE_TO, -2.17f, +R_H_LINE_TO, -2.17f, CLOSE, -R_MOVE_TO, 1.54f, -1.54f, -R_H_LINE_TO, 1.62f, -R_V_LINE_TO, -1.62f, -R_H_LINE_TO, -1.62f, +R_MOVE_TO, -6.54f, 0, +R_H_LINE_TO, 2.17f, +R_V_LINE_TO, -2.17f, +H_LINE_TO, 3.65f, CLOSE, -R_MOVE_TO, -5.18f, -6.8f, +R_MOVE_TO, 6.54f, -6.54f, CLOSE, -R_MOVE_TO, 0, 5.18f, +R_MOVE_TO, 0, 4.37f, CLOSE, -R_MOVE_TO, 5.18f, -5.18f, +R_MOVE_TO, -4.37f, 0, CLOSE, -R_MOVE_TO, 0, 5.18f, -CLOSE, -R_MOVE_TO, 0, 0, -CLOSE \ No newline at end of file +R_MOVE_TO, 0, -4.37f, +CLOSE
diff --git a/chrome/app/vector_icons/search_menu.icon b/chrome/app/vector_icons/search_menu.icon index 363fed82..6491050d 100644 --- a/chrome/app/vector_icons/search_menu.icon +++ b/chrome/app/vector_icons/search_menu.icon
@@ -1,45 +1,48 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -R_MOVE_TO, 9.45f, 13.09f, -R_LINE_TO, 1.63f, 1.63f, -H_LINE_TO, 4.51f, -R_CUBIC_TO, -0.45f, 0, -0.84f, -0.16f, -1.16f, -0.47f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, -0.48f, -1.16f, -V_LINE_TO, 2.91f, -R_CUBIC_TO, 0, -0.46f, 0.16f, -0.84f, 0.48f, -1.16f, -R_ARC_TO, 1.57f, 1.57f, 0, 0, 1, 1.16f, -0.47f, -H_LINE_TO, 9.73f, -R_LINE_TO, 3.39f, 3.39f, -R_V_LINE_TO, 8.07f, -R_CUBIC_TO, 0, 0.44f, -0.05f, 0.78f, -0.14f, 1.02f, -R_CUBIC_TO, -0.09f, 0.25f, -0.23f, 0.43f, -0.41f, 0.56f, -R_LINE_TO, -3.28f, -3.3f, -R_CUBIC_TO, -0.17f, 0.12f, -0.36f, 0.2f, -0.58f, 0.25f, -R_CUBIC_TO, -0.21f, 0.05f, -0.45f, 0.07f, -0.71f, 0.07f, -R_CUBIC_TO, -0.72f, 0, -1.33f, -0.25f, -1.83f, -0.74f, -R_CUBIC_TO, -0.49f, -0.5f, -0.74f, -1.11f, -0.74f, -1.83f, -R_CUBIC_TO, 0, -0.72f, 0.25f, -1.33f, 0.74f, -1.82f, -R_CUBIC_TO, 0.5f, -0.5f, 1.11f, -0.75f, 1.83f, -0.75f, -R_CUBIC_TO, 0.72f, 0, 1.33f, 0.25f, 1.83f, 0.75f, -R_CUBIC_TO, 0.49f, 0.49f, 0.74f, 1.1f, 0.74f, 1.83f, -R_ARC_TO, 2.8f, 2.8f, 0, 0, 1, -0.09f, 0.73f, +FILL_RULE_NONZERO, +R_MOVE_TO, 9.69f, 13.15f, +R_LINE_TO, 1.38f, 1.38f, +H_LINE_TO, 4.45f, +R_CUBIC_TO, -0.38f, 0, -0.71f, -0.13f, -0.98f, -0.4f, +R_ARC_TO, 1.34f, 1.34f, 0, 0, 1, -0.4f, -0.98f, +V_LINE_TO, 2.85f, +R_CUBIC_TO, 0, -0.38f, 0.13f, -0.71f, 0.4f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.4f, 0.98f, -0.4f, +R_H_LINE_TO, 5.21f, +R_LINE_TO, 3.28f, 3.28f, +R_V_LINE_TO, 7.99f, +R_CUBIC_TO, 0, 0.41f, -0.04f, 0.73f, -0.11f, 0.95f, +R_CUBIC_TO, -0.07f, 0.22f, -0.18f, 0.38f, -0.33f, 0.49f, +LINE_TO, 9.25f, 10.92f, +R_CUBIC_TO, -0.17f, 0.11f, -0.36f, 0.2f, -0.57f, 0.25f, +R_CUBIC_TO, -0.21f, 0.05f, -0.44f, 0.07f, -0.68f, 0.07f, +R_ARC_TO, 2.38f, 2.38f, 0, 0, 1, -1.75f, -0.72f, +R_CUBIC_TO, -0.48f, -0.48f, -0.72f, -1.06f, -0.72f, -1.75f, +R_CUBIC_TO, 0, -0.69f, 0.24f, -1.27f, 0.72f, -1.75f, +ARC_TO, 2.39f, 2.39f, 0, 0, 1, 8, 6.3f, +R_CUBIC_TO, 0.69f, 0, 1.27f, 0.24f, 1.75f, 0.72f, +R_CUBIC_TO, 0.48f, 0.48f, 0.72f, 1.06f, 0.72f, 1.75f, +R_CUBIC_TO, 0, 0.25f, -0.03f, 0.47f, -0.09f, 0.69f, R_CUBIC_TO, -0.06f, 0.22f, -0.14f, 0.41f, -0.25f, 0.57f, -R_LINE_TO, 1.25f, 1.22f, +R_LINE_TO, 1.41f, 1.4f, V_LINE_TO, 5.3f, -LINE_TO, 9.1f, 2.91f, -R_H_LINE_TO, -4.59f, -R_V_LINE_TO, 10.17f, +LINE_TO, 9.1f, 2.85f, +H_LINE_TO, 4.45f, +R_V_LINE_TO, 10.3f, CLOSE, -R_MOVE_TO, -1.45f, -3.23f, -R_CUBIC_TO, 0.31f, 0, 0.56f, -0.11f, 0.77f, -0.32f, -R_CUBIC_TO, 0.21f, -0.21f, 0.31f, -0.47f, 0.31f, -0.78f, -R_CUBIC_TO, 0, -0.3f, -0.11f, -0.56f, -0.32f, -0.77f, -R_ARC_TO, 1.06f, 1.06f, 0, 0, 0, -0.77f, -0.31f, -R_CUBIC_TO, -0.3f, 0, -0.56f, 0.11f, -0.77f, 0.32f, -R_CUBIC_TO, -0.21f, 0.21f, -0.31f, 0.47f, -0.31f, 0.77f, -R_CUBIC_TO, 0, 0.3f, 0.11f, 0.56f, 0.32f, 0.77f, -R_CUBIC_TO, 0.21f, 0.21f, 0.47f, 0.31f, 0.77f, 0.31f, +MOVE_TO, 8, 9.92f, +R_CUBIC_TO, 0.32f, 0, 0.59f, -0.11f, 0.81f, -0.34f, +R_CUBIC_TO, 0.22f, -0.23f, 0.34f, -0.5f, 0.34f, -0.82f, +R_CUBIC_TO, 0, -0.32f, -0.11f, -0.59f, -0.34f, -0.81f, +R_ARC_TO, 1.13f, 1.13f, 0, 0, 0, -0.82f, -0.34f, +R_CUBIC_TO, -0.32f, 0, -0.59f, 0.11f, -0.81f, 0.34f, +R_ARC_TO, 1.11f, 1.11f, 0, 0, 0, -0.34f, 0.82f, +R_CUBIC_TO, 0, 0.32f, 0.11f, 0.59f, 0.34f, 0.82f, +R_CUBIC_TO, 0.23f, 0.22f, 0.5f, 0.33f, 0.82f, 0.33f, +CLOSE, +MOVE_TO, 8, 8.6f, CLOSE
diff --git a/chrome/app/vector_icons/settings_menu.icon b/chrome/app/vector_icons/settings_menu.icon index 88bb786..08e4ec6 100644 --- a/chrome/app/vector_icons/settings_menu.icon +++ b/chrome/app/vector_icons/settings_menu.icon
@@ -1,62 +1,86 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -R_MOVE_TO, 12.97f, 7.7f, -R_LINE_TO, 1.84f, -1.9f, -R_LINE_TO, -1.5f, -2.6f, -R_LINE_TO, -2.55f, 0.64f, -R_CUBIC_TO, -0.17f, -0.11f, -0.36f, -0.2f, -0.54f, -0.29f, -LINE_TO, 9.49f, 1, -R_H_LINE_TO, -3, -R_LINE_TO, -0.73f, 2.55f, -R_CUBIC_TO, -0.18f, 0.09f, -0.37f, 0.18f, -0.54f, 0.29f, -LINE_TO, 2.67f, 3.2f, -R_LINE_TO, -1.5f, 2.6f, -R_LINE_TO, 1.84f, 1.9f, -R_V_LINE_TO, 0.59f, -R_LINE_TO, -1.84f, 1.9f, -R_LINE_TO, 1.5f, 2.6f, -R_LINE_TO, 2.55f, -0.64f, -R_CUBIC_TO, 0.17f, 0.11f, 0.36f, 0.2f, 0.54f, 0.29f, -R_LINE_TO, 0.73f, 2.55f, -R_H_LINE_TO, 3, -R_LINE_TO, 0.73f, -2.55f, -R_CUBIC_TO, 0.18f, -0.09f, 0.37f, -0.18f, 0.54f, -0.29f, -R_LINE_TO, 2.55f, 0.64f, -R_LINE_TO, 1.5f, -2.6f, -R_LINE_TO, -1.84f, -1.9f, -V_LINE_TO, 7.7f, +FILL_RULE_NONZERO, +R_MOVE_TO, 6.6f, 14.54f, +R_LINE_TO, -0.37f, -1.94f, +R_CUBIC_TO, -0.23f, -0.09f, -0.46f, -0.2f, -0.68f, -0.32f, +R_ARC_TO, 3.78f, 3.78f, 0, 0, 1, -0.62f, -0.43f, +R_LINE_TO, -1.87f, 0.64f, +R_LINE_TO, -1.4f, -2.43f, +R_LINE_TO, 1.48f, -1.29f, +R_ARC_TO, 6.3f, 6.3f, 0, 0, 1, -0.05f, -0.37f, +ARC_TO, 4.13f, 4.13f, 0, 0, 1, 3.06f, 8, +R_CUBIC_TO, 0, -0.13f, 0.01f, -0.26f, 0.02f, -0.39f, +R_CUBIC_TO, 0.01f, -0.12f, 0.03f, -0.24f, 0.05f, -0.37f, +LINE_TO, 1.64f, 5.96f, +R_LINE_TO, 1.4f, -2.43f, +R_LINE_TO, 1.88f, 0.63f, +R_CUBIC_TO, 0.2f, -0.16f, 0.4f, -0.3f, 0.62f, -0.43f, +R_CUBIC_TO, 0.22f, -0.12f, 0.45f, -0.23f, 0.68f, -0.32f, +R_LINE_TO, 0.38f, -1.95f, +R_H_LINE_TO, 2.8f, +R_LINE_TO, 0.38f, 1.95f, +R_CUBIC_TO, 0.24f, 0.09f, 0.46f, 0.2f, 0.68f, 0.32f, +R_CUBIC_TO, 0.22f, 0.12f, 0.43f, 0.26f, 0.63f, 0.43f, +R_LINE_TO, 1.88f, -0.63f, +R_LINE_TO, 1.4f, 2.43f, +R_LINE_TO, -1.49f, 1.29f, +R_ARC_TO, 4.15f, 4.15f, 0, 0, 1, 0.06f, 0.75f, +R_ARC_TO, 4.15f, 4.15f, 0, 0, 1, -0.06f, 0.75f, +R_LINE_TO, 1.49f, 1.29f, +R_LINE_TO, -1.41f, 2.43f, +R_LINE_TO, -1.88f, -0.64f, +R_ARC_TO, 4.07f, 4.07f, 0, 0, 1, -0.62f, 0.43f, +R_ARC_TO, 5.2f, 5.2f, 0, 0, 1, -0.68f, 0.32f, +R_LINE_TO, -0.37f, 1.95f, CLOSE, -R_MOVE_TO, -1.54f, 1.16f, -R_LINE_TO, 1.51f, 1.56f, -R_LINE_TO, -0.37f, 0.64f, -R_LINE_TO, -2.09f, -0.52f, -R_CUBIC_TO, -0.74f, 0.49f, -0.4f, 0.3f, -1.52f, 0.86f, -R_LINE_TO, -0.6f, 2.09f, -R_H_LINE_TO, -0.74f, -R_LINE_TO, -0.6f, -2.09f, -R_CUBIC_TO, -1.12f, -0.56f, -0.78f, -0.37f, -1.52f, -0.86f, -R_LINE_TO, -2.09f, 0.52f, -R_LINE_TO, -0.37f, -0.64f, -R_LINE_TO, 1.5f, -1.57f, -R_CUBIC_TO, -0.04f, -1.02f, -0.04f, -0.81f, 0.01f, -1.73f, -LINE_TO, 3.04f, 5.56f, -R_LINE_TO, 0.37f, -0.64f, -R_LINE_TO, 2.09f, 0.52f, -R_CUBIC_TO, 0.74f, -0.49f, 0.4f, -0.3f, 1.52f, -0.86f, -R_LINE_TO, 0.6f, -2.09f, -R_H_LINE_TO, 0.74f, -R_LINE_TO, 0.6f, 2.09f, -R_CUBIC_TO, 1.12f, 0.56f, 0.78f, 0.37f, 1.52f, 0.86f, -R_LINE_TO, 2.09f, -0.52f, -R_LINE_TO, 0.37f, 0.64f, -R_LINE_TO, -1.5f, 1.57f, -R_CUBIC_TO, 0.04f, 1.02f, 0.04f, 0.81f, -0.01f, 1.73f, +R_MOVE_TO, 1.14f, -1.38f, +R_H_LINE_TO, 0.51f, +R_LINE_TO, 0.32f, -1.64f, +R_ARC_TO, 3.73f, 3.73f, 0, 0, 0, 1.2f, -0.44f, +R_ARC_TO, 3.28f, 3.28f, 0, 0, 0, 0.96f, -0.82f, +R_LINE_TO, 1.59f, 0.53f, +R_LINE_TO, 0.25f, -0.43f, +R_LINE_TO, -1.25f, -1.11f, +R_CUBIC_TO, 0.07f, -0.19f, 0.12f, -0.39f, 0.16f, -0.6f, +R_CUBIC_TO, 0.04f, -0.21f, 0.06f, -0.42f, 0.06f, -0.65f, +R_CUBIC_TO, 0, -0.23f, -0.02f, -0.44f, -0.06f, -0.65f, +R_CUBIC_TO, -0.04f, -0.21f, -0.09f, -0.41f, -0.16f, -0.61f, +R_LINE_TO, 1.26f, -1.11f, +R_LINE_TO, -0.26f, -0.42f, +R_LINE_TO, -1.59f, 0.53f, +R_ARC_TO, 3.4f, 3.4f, 0, 0, 0, -0.96f, -0.82f, +R_ARC_TO, 3.72f, 3.72f, 0, 0, 0, -1.2f, -0.44f, +R_LINE_TO, -0.32f, -1.64f, +R_H_LINE_TO, -0.52f, +LINE_TO, 7.43f, 4.48f, +R_ARC_TO, 3.76f, 3.76f, 0, 0, 0, -1.21f, 0.44f, +R_ARC_TO, 3.42f, 3.42f, 0, 0, 0, -0.96f, 0.82f, +R_LINE_TO, -1.59f, -0.53f, +R_LINE_TO, -0.26f, 0.43f, +R_LINE_TO, 1.25f, 1.11f, +R_ARC_TO, 4.45f, 4.45f, 0, 0, 0, -0.16f, 0.61f, +R_CUBIC_TO, -0.04f, 0.21f, -0.06f, 0.43f, -0.06f, 0.65f, +R_CUBIC_TO, 0, 0.23f, 0.02f, 0.44f, 0.06f, 0.65f, +R_CUBIC_TO, 0.04f, 0.21f, 0.09f, 0.41f, 0.16f, 0.61f, +R_LINE_TO, -1.25f, 1.1f, +R_LINE_TO, 0.26f, 0.43f, +R_LINE_TO, 1.59f, -0.53f, +R_CUBIC_TO, 0.27f, 0.33f, 0.59f, 0.6f, 0.97f, 0.81f, +R_CUBIC_TO, 0.38f, 0.22f, 0.78f, 0.36f, 1.2f, 0.44f, CLOSE, -NEW_PATH, -MOVE_TO, 8, 10.5f, -R_ARC_TO, 2.5f, 2.5f, 0, 1, 0, 0, -5, -R_ARC_TO, 2.5f, 2.5f, 0, 0, 0, 0, 5, +R_MOVE_TO, 0.25f, -2.75f, +R_ARC_TO, 2.3f, 2.3f, 0, 0, 0, 1.7f, -0.7f, +ARC_TO, 2.3f, 2.3f, 0, 0, 0, 10.39f, 8, +R_ARC_TO, 2.3f, 2.3f, 0, 0, 0, -0.7f, -1.7f, +R_ARC_TO, 2.3f, 2.3f, 0, 0, 0, -1.7f, -0.7f, +R_CUBIC_TO, -0.66f, 0, -1.23f, 0.23f, -1.7f, 0.7f, +ARC_TO, 2.3f, 2.3f, 0, 0, 0, 5.59f, 8, +R_ARC_TO, 2.3f, 2.3f, 0, 0, 0, 0.7f, 1.7f, +R_CUBIC_TO, 0.47f, 0.47f, 1.03f, 0.7f, 1.7f, 0.7f, +CLOSE, +MOVE_TO, 8, 8, CLOSE
diff --git a/chrome/app/vector_icons/sync_refresh.icon b/chrome/app/vector_icons/sync_refresh.icon index 2024902d..aac2dd5 100644 --- a/chrome/app/vector_icons/sync_refresh.icon +++ b/chrome/app/vector_icons/sync_refresh.icon
@@ -1,42 +1,43 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 3.62f, 12.99f, -R_V_LINE_TO, -1.34f, -R_H_LINE_TO, 0.93f, -R_LINE_TO, 0.12f, 0.09f, -R_ARC_TO, 5.92f, 5.92f, 0, 0, 1, -1.23f, -1.68f, -ARC_TO, 4.62f, 4.62f, 0, 0, 1, 2.96f, 8, -R_CUBIC_TO, 0, -1.22f, 0.39f, -2.29f, 1.17f, -3.2f, -R_ARC_TO, 5.07f, 5.07f, 0, 0, 1, 2.91f, -1.73f, -R_V_LINE_TO, 1.68f, -R_CUBIC_TO, -0.71f, 0.2f, -1.29f, 0.59f, -1.75f, 1.19f, -ARC_TO, 3.28f, 3.28f, 0, 0, 0, 4.6f, 8, -R_CUBIC_TO, 0, 0.5f, 0.11f, 0.96f, 0.31f, 1.38f, -R_CUBIC_TO, 0.21f, 0.43f, 0.48f, 0.8f, 0.82f, 1.11f, -R_LINE_TO, -0.07f, -0.07f, -R_V_LINE_TO, -0.81f, -R_H_LINE_TO, 1.34f, -R_V_LINE_TO, 3.39f, +FILL_RULE_NONZERO, +MOVE_TO, 3.61f, 12.88f, +V_LINE_TO, 11.62f, +R_H_LINE_TO, 1.1f, +R_LINE_TO, 0.05f, 0.04f, +R_ARC_TO, 5.3f, 5.3f, 0, 0, 1, -1.21f, -1.63f, +ARC_TO, 4.57f, 4.57f, 0, 0, 1, 3.1f, 8, +R_CUBIC_TO, 0, -1.16f, 0.36f, -2.18f, 1.08f, -3.06f, +R_ARC_TO, 4.88f, 4.88f, 0, 0, 1, 2.72f, -1.7f, +R_V_LINE_TO, 1.43f, +R_ARC_TO, 3.49f, 3.49f, 0, 0, 0, -1.73f, 1.25f, +R_CUBIC_TO, -0.45f, 0.6f, -0.68f, 1.29f, -0.68f, 2.07f, +R_CUBIC_TO, 0, 0.52f, 0.11f, 1, 0.32f, 1.44f, +R_CUBIC_TO, 0.22f, 0.45f, 0.5f, 0.83f, 0.86f, 1.14f, +R_LINE_TO, -0.03f, -0.03f, +V_LINE_TO, 9.6f, +R_H_LINE_TO, 1.26f, +R_V_LINE_TO, 3.28f, CLOSE, -R_MOVE_TO, 5.35f, -0.06f, -R_V_LINE_TO, -1.68f, -R_CUBIC_TO, 0.71f, -0.2f, 1.29f, -0.59f, 1.75f, -1.19f, -ARC_TO, 3.28f, 3.28f, 0, 0, 0, 11.4f, 8, -R_CUBIC_TO, 0, -0.5f, -0.1f, -0.96f, -0.31f, -1.38f, -R_ARC_TO, 3.57f, 3.57f, 0, 0, 0, -0.82f, -1.1f, -R_LINE_TO, 0.07f, 0.07f, -R_V_LINE_TO, 0.81f, -R_H_LINE_TO, -1.34f, -V_LINE_TO, 3.01f, -R_H_LINE_TO, 3.38f, -R_V_LINE_TO, 1.34f, -R_H_LINE_TO, -0.93f, -R_LINE_TO, -0.12f, -0.09f, -R_CUBIC_TO, 0.52f, 0.47f, 0.93f, 1.03f, 1.24f, 1.67f, -R_CUBIC_TO, 0.31f, 0.64f, 0.46f, 1.33f, 0.46f, 2.07f, -R_CUBIC_TO, 0, 1.22f, -0.39f, 2.29f, -1.16f, 3.2f, -R_ARC_TO, 5.07f, 5.07f, 0, 0, 1, -2.91f, 1.73f, -CLOSE \ No newline at end of file +R_MOVE_TO, 5.49f, -0.12f, +R_V_LINE_TO, -1.43f, +R_ARC_TO, 3.49f, 3.49f, 0, 0, 0, 1.73f, -1.25f, +R_CUBIC_TO, 0.45f, -0.6f, 0.68f, -1.29f, 0.68f, -2.07f, +R_CUBIC_TO, 0, -0.52f, -0.11f, -1, -0.32f, -1.44f, +R_ARC_TO, 3.61f, 3.61f, 0, 0, 0, -0.85f, -1.14f, +R_LINE_TO, 0.03f, 0.03f, +R_V_LINE_TO, 0.95f, +H_LINE_TO, 9.12f, +V_LINE_TO, 3.12f, +R_H_LINE_TO, 3.27f, +V_LINE_TO, 4.38f, +R_H_LINE_TO, -1.1f, +R_LINE_TO, -0.05f, -0.04f, +R_CUBIC_TO, 0.51f, 0.46f, 0.91f, 1, 1.21f, 1.63f, +R_CUBIC_TO, 0.3f, 0.63f, 0.45f, 1.31f, 0.45f, 2.04f, +R_CUBIC_TO, 0, 1.16f, -0.36f, 2.18f, -1.08f, 3.06f, +R_ARC_TO, 4.88f, 4.88f, 0, 0, 1, -2.72f, 1.7f, +CLOSE
diff --git a/chrome/app/vector_icons/task_manager.icon b/chrome/app/vector_icons/task_manager.icon index 3ac5ba0..c90f61b5 100644 --- a/chrome/app/vector_icons/task_manager.icon +++ b/chrome/app/vector_icons/task_manager.icon
@@ -1,39 +1,40 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 13.09f, 13.92f, -H_LINE_TO, 3.72f, -R_CUBIC_TO, -0.45f, 0, -0.83f, -0.16f, -1.16f, -0.48f, -R_ARC_TO, 1.59f, 1.59f, 0, 0, 1, -0.48f, -1.16f, -R_V_LINE_TO, -8.57f, -R_CUBIC_TO, 0, -0.46f, 0.16f, -0.84f, 0.48f, -1.16f, -R_ARC_TO, 1.6f, 1.6f, 0, 0, 1, 1.16f, -0.48f, -R_H_LINE_TO, 9.37f, -R_CUBIC_TO, 0.45f, 0, 0.83f, 0.16f, 1.15f, 0.48f, -R_CUBIC_TO, 0.32f, 0.32f, 0.48f, 0.7f, 0.48f, 1.16f, -R_V_LINE_TO, 8.57f, -R_CUBIC_TO, 0, 0.45f, -0.16f, 0.83f, -0.48f, 1.16f, -R_CUBIC_TO, -0.32f, 0.32f, -0.7f, 0.48f, -1.15f, 0.48f, +FILL_RULE_NONZERO, +MOVE_TO, 12.35f, 13.73f, +H_LINE_TO, 3.65f, +R_CUBIC_TO, -0.37f, 0, -0.7f, -0.14f, -0.97f, -0.41f, +R_ARC_TO, 1.33f, 1.33f, 0, 0, 1, -0.41f, -0.97f, +V_LINE_TO, 3.65f, +R_CUBIC_TO, 0, -0.38f, 0.14f, -0.71f, 0.41f, -0.98f, +R_CUBIC_TO, 0.27f, -0.27f, 0.6f, -0.4f, 0.97f, -0.4f, +R_H_LINE_TO, 8.7f, +R_CUBIC_TO, 0.38f, 0, 0.7f, 0.13f, 0.97f, 0.4f, +R_CUBIC_TO, 0.27f, 0.27f, 0.41f, 0.6f, 0.41f, 0.98f, +R_V_LINE_TO, 8.7f, +R_CUBIC_TO, 0, 0.38f, -0.14f, 0.7f, -0.41f, 0.97f, +R_ARC_TO, 1.33f, 1.33f, 0, 0, 1, -0.97f, 0.41f, CLOSE, -MOVE_TO, 3.72f, 5.43f, -R_H_LINE_TO, 9.37f, -V_LINE_TO, 3.72f, -R_H_LINE_TO, -9.37f, +MOVE_TO, 3.65f, 5.41f, +R_H_LINE_TO, 8.7f, +V_LINE_TO, 3.65f, +H_LINE_TO, 3.65f, CLOSE, -R_MOVE_TO, 1.66f, 1.2f, -H_LINE_TO, 3.72f, -R_V_LINE_TO, 5.66f, -R_H_LINE_TO, 1.66f, +R_MOVE_TO, 1.57f, 1.2f, +R_H_LINE_TO, -1.57f, +R_V_LINE_TO, 5.74f, +R_H_LINE_TO, 1.57f, CLOSE, -R_MOVE_TO, 6.04f, 0, -R_V_LINE_TO, 5.66f, -R_H_LINE_TO, 1.67f, -V_LINE_TO, 6.63f, +R_MOVE_TO, 5.56f, 0, +R_V_LINE_TO, 5.74f, +R_H_LINE_TO, 1.57f, +V_LINE_TO, 6.61f, CLOSE, R_MOVE_TO, -1.2f, 0, -H_LINE_TO, 6.58f, -R_V_LINE_TO, 5.66f, -R_H_LINE_TO, 3.64f, -CLOSE \ No newline at end of file +H_LINE_TO, 6.42f, +R_V_LINE_TO, 5.74f, +R_H_LINE_TO, 3.16f, +CLOSE
diff --git a/chrome/app/vector_icons/translate.icon b/chrome/app/vector_icons/translate.icon index 72b26ba..8e98dd1f 100644 --- a/chrome/app/vector_icons/translate.icon +++ b/chrome/app/vector_icons/translate.icon
@@ -1,74 +1,85 @@ -// Copyright 2015 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 13.6f, 3.1f, -LINE_TO, 7.22f, 3.1f, -LINE_TO, 6.6f, 1, -LINE_TO, 2.4f, 1, -CUBIC_TO, 1.63f, 1, 1, 1.63f, 1, 2.4f, -LINE_TO, 1, 11.5f, -CUBIC_TO, 1, 12.27f, 1.63f, 12.9f, 2.4f, 12.9f, -LINE_TO, 7.3f, 12.9f, -LINE_TO, 8, 15, -LINE_TO, 13.6f, 15, -CUBIC_TO, 14.37f, 15, 15, 14.37f, 15, 13.6f, -LINE_TO, 15, 4.5f, -CUBIC_TO, 15, 3.73f, 14.37f, 3.1f, 13.6f, 3.1f, -LINE_TO, 13.6f, 3.1f, +FILL_RULE_NONZERO, +R_MOVE_TO, 8, 14.52f, +R_LINE_TO, -0.81f, -2.44f, +H_LINE_TO, 2.7f, +R_ARC_TO, 1.25f, 1.25f, 0, 0, 1, -0.87f, -0.36f, +R_ARC_TO, 1.16f, 1.16f, 0, 0, 1, -0.35f, -0.86f, +V_LINE_TO, 2.7f, +R_CUBIC_TO, 0, -0.33f, 0.12f, -0.62f, 0.36f, -0.86f, +R_CUBIC_TO, 0.24f, -0.24f, 0.53f, -0.37f, 0.87f, -0.37f, +R_H_LINE_TO, 3.67f, +R_LINE_TO, 0.81f, 2.44f, +H_LINE_TO, 13.3f, +R_CUBIC_TO, 0.33f, 0, 0.62f, 0.12f, 0.86f, 0.36f, +R_CUBIC_TO, 0.24f, 0.24f, 0.36f, 0.53f, 0.36f, 0.86f, +R_V_LINE_TO, 8.16f, +R_CUBIC_TO, 0, 0.34f, -0.12f, 0.63f, -0.36f, 0.87f, +R_ARC_TO, 1.19f, 1.19f, 0, 0, 1, -0.86f, 0.36f, CLOSE, -MOVE_TO, 4.62f, 9.81f, -CUBIC_TO, 3.04f, 9.81f, 1.76f, 8.53f, 1.76f, 6.95f, -CUBIC_TO, 1.76f, 5.37f, 3.04f, 4.09f, 4.62f, 4.09f, -CUBIC_TO, 5.35f, 4.09f, 6.01f, 4.35f, 6.54f, 4.84f, -LINE_TO, 6.59f, 4.88f, -LINE_TO, 5.73f, 5.7f, -LINE_TO, 5.68f, 5.67f, -CUBIC_TO, 5.48f, 5.48f, 5.14f, 5.26f, 4.62f, 5.26f, -CUBIC_TO, 3.7f, 5.26f, 2.95f, 6.02f, 2.95f, 6.95f, -CUBIC_TO, 2.95f, 7.88f, 3.7f, 8.64f, 4.62f, 8.64f, -CUBIC_TO, 5.58f, 8.64f, 5.99f, 8.04f, 6.1f, 7.62f, -LINE_TO, 4.56f, 7.62f, -LINE_TO, 4.56f, 6.54f, -LINE_TO, 7.32f, 6.54f, -LINE_TO, 7.33f, 6.59f, -CUBIC_TO, 7.36f, 6.73f, 7.36f, 6.87f, 7.36f, 7.01f, -CUBIC_TO, 7.36f, 8.66f, 6.24f, 9.81f, 4.62f, 9.81f, -LINE_TO, 4.62f, 9.81f, +R_MOVE_TO, -3.21f, -4.89f, +R_CUBIC_TO, 0.65f, 0, 1.2f, -0.21f, 1.66f, -0.63f, +R_CUBIC_TO, 0.46f, -0.42f, 0.69f, -1.01f, 0.69f, -1.77f, +R_CUBIC_TO, 0, -0.08f, 0, -0.16f, -0.01f, -0.23f, +R_ARC_TO, 1.33f, 1.33f, 0, 0, 0, -0.04f, -0.25f, +H_LINE_TO, 4.79f, +R_V_LINE_TO, 0.83f, +R_H_LINE_TO, 1.43f, +R_CUBIC_TO, -0.04f, 0.38f, -0.19f, 0.66f, -0.46f, 0.88f, +R_ARC_TO, 1.56f, 1.56f, 0, 0, 1, -0.97f, 0.31f, +R_CUBIC_TO, -0.43f, 0, -0.79f, -0.15f, -1.09f, -0.46f, +R_ARC_TO, 1.55f, 1.55f, 0, 0, 1, -0.45f, -1.12f, +R_CUBIC_TO, 0, -0.43f, 0.15f, -0.8f, 0.45f, -1.11f, +R_CUBIC_TO, 0.3f, -0.31f, 0.67f, -0.46f, 1.1f, -0.46f, +R_CUBIC_TO, 0.18f, 0, 0.36f, 0.03f, 0.53f, 0.1f, +R_CUBIC_TO, 0.17f, 0.07f, 0.32f, 0.16f, 0.46f, 0.29f, +R_LINE_TO, 0.65f, -0.63f, +R_ARC_TO, 2.18f, 2.18f, 0, 0, 0, -0.77f, -0.47f, +R_ARC_TO, 2.58f, 2.58f, 0, 0, 0, -0.87f, -0.16f, +R_CUBIC_TO, -0.68f, 0, -1.26f, 0.24f, -1.74f, 0.72f, +R_ARC_TO, 2.37f, 2.37f, 0, 0, 0, -0.71f, 1.73f, +R_CUBIC_TO, 0, 0.68f, 0.24f, 1.25f, 0.71f, 1.73f, +R_ARC_TO, 2.37f, 2.37f, 0, 0, 0, 1.74f, 0.72f, CLOSE, -MOVE_TO, 8.84f, 8.62f, -CUBIC_TO, 9.07f, 9.04f, 9.36f, 9.44f, 9.67f, 9.81f, -LINE_TO, 9.3f, 10.18f, -LINE_TO, 8.84f, 8.62f, -LINE_TO, 8.84f, 8.62f, +R_MOVE_TO, 4.31f, 0.57f, +R_LINE_TO, 0.33f, -0.32f, +R_CUBIC_TO, -0.16f, -0.17f, -0.3f, -0.35f, -0.43f, -0.53f, +R_ARC_TO, 7.06f, 7.06f, 0, 0, 1, -0.36f, -0.59f, CLOSE, -MOVE_TO, 13.6f, 14.3f, -LINE_TO, 8.7f, 14.3f, -LINE_TO, 10.1f, 12.9f, -LINE_TO, 9.53f, 10.96f, -LINE_TO, 10.18f, 10.32f, -LINE_TO, 12.05f, 12.2f, -LINE_TO, 12.56f, 11.69f, -LINE_TO, 10.67f, 9.81f, -CUBIC_TO, 11.3f, 9.09f, 11.79f, 8.24f, 12.01f, 7.36f, -LINE_TO, 12.9f, 7.36f, -LINE_TO, 12.9f, 6.63f, -LINE_TO, 10.35f, 6.63f, -LINE_TO, 10.35f, 5.9f, -LINE_TO, 9.62f, 5.9f, -LINE_TO, 9.62f, 6.63f, -LINE_TO, 8.25f, 6.63f, -LINE_TO, 7.43f, 3.8f, -LINE_TO, 13.6f, 3.8f, -CUBIC_TO, 13.99f, 3.8f, 14.3f, 4.12f, 14.3f, 4.5f, -LINE_TO, 14.3f, 13.6f, -CUBIC_TO, 14.3f, 13.99f, 13.99f, 14.3f, 13.6f, 14.3f, +R_MOVE_TO, 0.8f, -0.83f, +R_CUBIC_TO, 0.23f, -0.27f, 0.44f, -0.56f, 0.63f, -0.86f, +R_CUBIC_TO, 0.2f, -0.3f, 0.34f, -0.63f, 0.43f, -0.99f, +H_LINE_TO, 8.26f, +R_LINE_TO, 0.24f, 0.71f, +R_LINE_TO, 0.66f, -0.02f, +R_CUBIC_TO, 0.1f, 0.22f, 0.21f, 0.42f, 0.33f, 0.61f, +R_CUBIC_TO, 0.12f, 0.19f, 0.26f, 0.37f, 0.42f, 0.54f, CLOSE, -MOVE_TO, 8.69f, 8.08f, -LINE_TO, 8.47f, 7.36f, -LINE_TO, 11.26f, 7.36f, -CUBIC_TO, 11.26f, 7.36f, 11.02f, 8.27f, 10.17f, 9.27f, -CUBIC_TO, 9.81f, 8.84f, 9.55f, 8.41f, 9.38f, 8.08f, -LINE_TO, 8.69f, 8.08f, +R_MOVE_TO, -1.09f, 4.34f, +R_H_LINE_TO, 4.49f, +R_ARC_TO, 0.41f, 0.41f, 0, 0, 0, 0.29f, -0.11f, +R_ARC_TO, 0.4f, 0.4f, 0, 0, 0, 0.12f, -0.3f, +V_LINE_TO, 5.14f, +R_ARC_TO, 0.4f, 0.4f, 0, 0, 0, -0.12f, -0.29f, +R_ARC_TO, 0.4f, 0.4f, 0, 0, 0, -0.29f, -0.12f, +H_LINE_TO, 7.39f, +R_LINE_TO, 0.65f, 2.1f, +R_H_LINE_TO, 1.36f, +V_LINE_TO, 6.13f, +R_H_LINE_TO, 0.68f, +R_V_LINE_TO, 0.7f, +R_H_LINE_TO, 2.46f, +R_V_LINE_TO, 0.7f, +R_H_LINE_TO, -0.86f, +R_ARC_TO, 4.86f, 4.86f, 0, 0, 1, -0.51f, 1.26f, +R_ARC_TO, 7.07f, 7.07f, 0, 0, 1, -0.78f, 1.1f, +R_LINE_TO, 1.84f, 1.8f, +R_LINE_TO, -0.49f, 0.49f, +R_LINE_TO, -1.8f, -1.8f, +R_LINE_TO, -0.59f, 0.58f, +R_LINE_TO, 0.61f, 1.93f, CLOSE
diff --git a/chrome/app/vector_icons/trash_can_refresh.icon b/chrome/app/vector_icons/trash_can_refresh.icon index b85b647..6e3c8bf 100644 --- a/chrome/app/vector_icons/trash_can_refresh.icon +++ b/chrome/app/vector_icons/trash_can_refresh.icon
@@ -1,40 +1,41 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 5.1f, 13.92f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, -1.16f, -0.48f, -R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, -0.47f, -1.16f, -V_LINE_TO, 4.5f, -R_H_LINE_TO, -1.02f, -V_LINE_TO, 2.87f, -R_H_LINE_TO, 3.74f, -V_LINE_TO, 1.86f, -R_H_LINE_TO, 3.61f, -R_V_LINE_TO, 1.02f, -R_H_LINE_TO, 3.76f, -R_V_LINE_TO, 1.63f, -R_H_LINE_TO, -1.02f, -R_V_LINE_TO, 7.78f, -R_CUBIC_TO, 0, 0.46f, -0.16f, 0.85f, -0.47f, 1.17f, -R_ARC_TO, 1.59f, 1.59f, 0, 0, 1, -1.16f, 0.47f, +FILL_RULE_NONZERO, +MOVE_TO, 5.16f, 13.73f, +R_CUBIC_TO, -0.38f, 0, -0.71f, -0.13f, -0.98f, -0.4f, +R_ARC_TO, 1.34f, 1.34f, 0, 0, 1, -0.4f, -0.98f, +V_LINE_TO, 4.45f, +R_H_LINE_TO, -0.89f, +V_LINE_TO, 3.06f, +R_H_LINE_TO, 3.43f, +R_V_LINE_TO, -0.89f, +R_H_LINE_TO, 3.38f, +R_V_LINE_TO, 0.89f, +R_H_LINE_TO, 3.43f, +R_V_LINE_TO, 1.39f, +R_H_LINE_TO, -0.89f, +R_V_LINE_TO, 7.9f, +R_CUBIC_TO, 0, 0.39f, -0.13f, 0.72f, -0.4f, 0.99f, +R_CUBIC_TO, -0.27f, 0.27f, -0.6f, 0.4f, -0.98f, 0.4f, CLOSE, -R_MOVE_TO, 5.8f, -9.42f, -H_LINE_TO, 5.1f, -R_V_LINE_TO, 7.78f, -R_H_LINE_TO, 5.8f, +R_MOVE_TO, 5.69f, -9.29f, +H_LINE_TO, 5.16f, +R_V_LINE_TO, 7.91f, +R_H_LINE_TO, 5.69f, CLOSE, -MOVE_TO, 6.23f, 11.19f, -R_H_LINE_TO, 1.42f, -V_LINE_TO, 5.59f, -H_LINE_TO, 6.23f, +R_MOVE_TO, -4.52f, 6.75f, +R_H_LINE_TO, 1.29f, +V_LINE_TO, 5.6f, +H_LINE_TO, 6.33f, CLOSE, -R_MOVE_TO, 2.12f, 0, -H_LINE_TO, 9.77f, -V_LINE_TO, 5.59f, -H_LINE_TO, 8.35f, +R_MOVE_TO, 2.05f, 0, +R_H_LINE_TO, 1.29f, +V_LINE_TO, 5.6f, +H_LINE_TO, 8.38f, CLOSE, -MOVE_TO, 5.1f, 4.5f, -R_V_LINE_TO, 7.78f, -CLOSE \ No newline at end of file +R_MOVE_TO, -3.22f, -6.75f, +R_V_LINE_TO, 7.91f, +CLOSE
diff --git a/chrome/app/vector_icons/zoom_in.icon b/chrome/app/vector_icons/zoom_in.icon index 515a55d..b90818e5 100644 --- a/chrome/app/vector_icons/zoom_in.icon +++ b/chrome/app/vector_icons/zoom_in.icon
@@ -1,35 +1,43 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 10.16f, 9.1f, -R_CUBIC_TO, 1.25f, -1.76f, 1.1f, -4.2f, -0.48f, -5.78f, -R_ARC_TO, 4.49f, 4.49f, 0, 0, 0, -6.36f, 0, -R_ARC_TO, 4.49f, 4.49f, 0, 0, 0, 0, 6.36f, -R_ARC_TO, 4.49f, 4.49f, 0, 0, 0, 5.78f, 0.48f, -LINE_TO, 12.94f, 14, -LINE_TO, 14, 12.94f, -LINE_TO, 10.16f, 9.1f, +FILL_RULE_NONZERO, +MOVE_TO, 12.74f, 13.75f, +LINE_TO, 8.73f, 9.72f, +R_ARC_TO, 4.03f, 4.03f, 0, 0, 1, -1.09f, 0.57f, +R_CUBIC_TO, -0.4f, 0.13f, -0.82f, 0.2f, -1.27f, 0.2f, +R_CUBIC_TO, -1.13f, 0, -2.1f, -0.4f, -2.89f, -1.2f, +R_CUBIC_TO, -0.8f, -0.8f, -1.2f, -1.76f, -1.2f, -2.9f, +R_CUBIC_TO, 0, -1.13f, 0.4f, -2.1f, 1.2f, -2.89f, +R_CUBIC_TO, 0.79f, -0.8f, 1.76f, -1.19f, 2.89f, -1.19f, +R_CUBIC_TO, 1.14f, 0, 2.1f, 0.4f, 2.9f, 1.2f, +R_CUBIC_TO, 0.8f, 0.8f, 1.2f, 1.76f, 1.2f, 2.9f, +R_CUBIC_TO, 0, 0.45f, -0.07f, 0.88f, -0.2f, 1.27f, +R_ARC_TO, 4.1f, 4.1f, 0, 0, 1, -0.55f, 1.08f, +R_LINE_TO, 4.02f, 4.02f, CLOSE, -R_MOVE_TO, -1.54f, -0.48f, -R_ARC_TO, 3, 3, 0, 0, 1, -4.24f, 0, -R_ARC_TO, 3, 3, 0, 0, 1, 0, -4.24f, -R_ARC_TO, 3, 3, 0, 0, 1, 4.24f, 0, -R_ARC_TO, 3, 3, 0, 0, 1, 0, 4.24f, +MOVE_TO, 6.37f, 9.11f, +R_ARC_TO, 2.63f, 2.63f, 0, 0, 0, 1.92f, -0.79f, +R_ARC_TO, 2.63f, 2.63f, 0, 0, 0, 0.79f, -1.92f, +R_CUBIC_TO, 0, -0.75f, -0.27f, -1.39f, -0.79f, -1.92f, +R_ARC_TO, 2.62f, 2.62f, 0, 0, 0, -1.92f, -0.79f, +R_CUBIC_TO, -0.75f, 0, -1.39f, 0.26f, -1.92f, 0.79f, +R_ARC_TO, 2.61f, 2.61f, 0, 0, 0, -0.79f, 1.92f, +R_CUBIC_TO, 0, 0.75f, 0.26f, 1.4f, 0.79f, 1.92f, +R_CUBIC_TO, 0.52f, 0.52f, 1.16f, 0.79f, 1.92f, 0.79f, CLOSE, -NEW_PATH, -MOVE_TO, 7, 4.5f, -H_LINE_TO, 6, -V_LINE_TO, 6, -H_LINE_TO, 4.5f, -R_V_LINE_TO, 1, -H_LINE_TO, 6, -R_V_LINE_TO, 1.5f, -R_H_LINE_TO, 1, +R_MOVE_TO, -0.6f, -0.93f, V_LINE_TO, 7, -R_H_LINE_TO, 1.5f, -V_LINE_TO, 6, -H_LINE_TO, 7, -V_LINE_TO, 4.5f, +H_LINE_TO, 4.59f, +V_LINE_TO, 5.8f, +H_LINE_TO, 5.77f, +V_LINE_TO, 4.63f, +R_H_LINE_TO, 1.2f, +R_V_LINE_TO, 1.18f, +R_H_LINE_TO, 1.18f, +V_LINE_TO, 7, +H_LINE_TO, 6.97f, +R_V_LINE_TO, 1.18f, CLOSE
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 57652f99..06d3ce0d 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -2360,6 +2360,7 @@ "//components/password_manager/content/browser", "//components/password_manager/content/common", "//components/password_manager/core/browser", + "//components/password_manager/core/browser:password_manager_buildflags", "//components/password_manager/core/browser/affiliation:affiliation_fetching", "//components/password_manager/core/browser/export", "//components/password_manager/core/browser/features:password_features", @@ -8491,7 +8492,6 @@ "fast_checkout/mock_fast_checkout_capabilities_fetcher.cc", "fast_checkout/mock_fast_checkout_capabilities_fetcher.h", ] - deps += [ "//chrome/android:test_support_jni_headers" ] } else { sources += [ "apps/intent_helper/preferred_apps_test_util.cc",
diff --git a/chrome/browser/ash/BUILD.gn b/chrome/browser/ash/BUILD.gn index 15b237b1..4ef0cc8 100644 --- a/chrome/browser/ash/BUILD.gn +++ b/chrome/browser/ash/BUILD.gn
@@ -5326,7 +5326,6 @@ "app_list/search/search_engine_unittest.cc", "app_list/search/search_metrics_manager_unittest.cc", "app_list/search/search_session_metrics_manager_unittest.cc", - "app_list/search/system_info/cpu_usage_data_unittest.cc", "app_list/search/system_info/system_info_answer_result_unittest.cc", "app_list/search/system_info/system_info_card_provider_unittest.cc", "app_list/search/test/ranking_test_util.cc", @@ -6465,6 +6464,7 @@ "//chromeos/ash/components/game_mode", "//chromeos/ash/components/install_attributes", "//chromeos/ash/components/install_attributes:test_support", + "//chromeos/ash/components/launcher_search", "//chromeos/ash/components/local_search_service", "//chromeos/ash/components/local_search_service/public/cpp", "//chromeos/ash/components/local_search_service/public/mojom", @@ -6497,6 +6497,7 @@ "//chromeos/ash/components/string_matching", "//chromeos/ash/components/sync_wifi:test_support", "//chromeos/ash/components/system", + "//chromeos/ash/components/system_info", "//chromeos/ash/components/tether", "//chromeos/ash/components/tether:test_support", "//chromeos/ash/components/tpm",
diff --git a/chrome/browser/ash/PRESUBMIT.py b/chrome/browser/ash/PRESUBMIT.py index 54ab747..8058e82 100644 --- a/chrome/browser/ash/PRESUBMIT.py +++ b/chrome/browser/ash/PRESUBMIT.py
@@ -34,25 +34,28 @@ if len(splitPath) <= 1: continue + # DEPS relative to chrome/browser/ash. relative_deps_files_path = input_api.os_path.join(splitPath[0], 'DEPS') + # Absolute DEPS path. deps_file_path = input_api.os_path.join(input_api.PresubmitLocalPath(), relative_deps_files_path) + # DEPS relative to repo root. + local_deps_file_path = input_api.os_path.join(_CHROME_BROWSER_ASH, + relative_deps_files_path) if not input_api.os_path.exists(deps_file_path): - missing_deps_files.add( - input_api.os_path.join(_CHROME_BROWSER_ASH, relative_deps_files_path)) + missing_deps_files.add(local_deps_file_path) continue # If the affected file is not a DEPS file, move onto the next file to check. - if f.LocalPath() != deps_file_path: + if f.LocalPath() != local_deps_file_path: continue # If the affected file *is* a DEPS file, confirm that it has a "-chrome" # rule, prohibiting new //chrome dependencies. prohibit_chrome_pattern = input_api.re.compile(r'\"\-chrome\"') if not prohibit_chrome_pattern.search(input_api.ReadFile(deps_file_path)): - deps_files_not_prohibiting_chrome.add( - input_api.os_path.join(_CHROME_BROWSER_ASH, relative_deps_files_path)) + deps_files_not_prohibiting_chrome.add(local_deps_file_path) results = [] if missing_deps_files:
diff --git a/chrome/browser/ash/app_list/search/DEPS b/chrome/browser/ash/app_list/search/DEPS index 3f8cac7..109148c5 100644 --- a/chrome/browser/ash/app_list/search/DEPS +++ b/chrome/browser/ash/app_list/search/DEPS
@@ -73,5 +73,7 @@ "+ash/assistant/util", "+ash/strings/grit", "+chromeos/ui/vector_icons", + "+chromeos/ash/components/launcher_search", + "+chromeos/ash/components/system_info", "+third_party/omnibox_proto", ]
diff --git a/chrome/browser/ash/app_list/search/system_info/battery_answer_result.cc b/chrome/browser/ash/app_list/search/system_info/battery_answer_result.cc index a0ad874..f1296bf 100644 --- a/chrome/browser/ash/app_list/search/system_info/battery_answer_result.cc +++ b/chrome/browser/ash/app_list/search/system_info/battery_answer_result.cc
@@ -6,7 +6,8 @@ #include "ash/public/cpp/app_list/app_list_types.h" #include "chrome/browser/ash/app_list/search/system_info/system_info_answer_result.h" -#include "chrome/browser/ash/app_list/search/system_info/system_info_util.h" +#include "chromeos/ash/components/launcher_search/system_info/launcher_util.h" +#include "chromeos/ash/components/system_info/battery_health.h" namespace app_list { namespace { @@ -54,9 +55,10 @@ if (calculating) { return; } - std::unique_ptr<BatteryHealth> new_battery_health = - std::make_unique<BatteryHealth>(); - PopulatePowerStatus(power_supply_properties, *new_battery_health.get()); + std::unique_ptr<system_info::BatteryHealth> new_battery_health = + std::make_unique<system_info::BatteryHealth>(); + launcher_search::PopulatePowerStatus(power_supply_properties, + *new_battery_health.get()); UpdateTitleAndDetails(/*title=*/std::u16string(), new_battery_health->GetPowerTime(), new_battery_health->GetAccessibilityLabel());
diff --git a/chrome/browser/ash/app_list/search/system_info/system_info_card_provider.cc b/chrome/browser/ash/app_list/search/system_info/system_info_card_provider.cc index 9495b50f..dc9870349 100644 --- a/chrome/browser/ash/app_list/search/system_info/system_info_card_provider.cc +++ b/chrome/browser/ash/app_list/search/system_info/system_info_card_provider.cc
@@ -17,17 +17,18 @@ #include "chrome/browser/ash/app_list/search/common/icon_constants.h" #include "chrome/browser/ash/app_list/search/system_info/battery_answer_result.h" #include "chrome/browser/ash/app_list/search/system_info/cpu_answer_result.h" -#include "chrome/browser/ash/app_list/search/system_info/cpu_data.h" -#include "chrome/browser/ash/app_list/search/system_info/cpu_usage_data.h" #include "chrome/browser/ash/app_list/search/system_info/memory_answer_result.h" #include "chrome/browser/ash/app_list/search/system_info/system_info_answer_result.h" -#include "chrome/browser/ash/app_list/search/system_info/system_info_util.h" #include "chrome/browser/ash/app_list/vector_icons/vector_icons.h" #include "chrome/browser/ui/webui/ash/settings/calculator/size_calculator.h" #include "chrome/browser/ui/webui/ash/settings/pages/storage/device_storage_util.h" #include "chrome/common/channel_info.h" #include "chrome/grit/generated_resources.h" +#include "chromeos/ash/components/launcher_search/system_info/launcher_util.h" #include "chromeos/ash/components/string_matching/fuzzy_tokenized_string_match.h" +#include "chromeos/ash/components/system_info/cpu_data.h" +#include "chromeos/ash/components/system_info/cpu_usage_data.h" +#include "chromeos/ash/components/system_info/system_info_util.h" #include "chromeos/ash/services/cros_healthd/public/cpp/service_connection.h" #include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom-shared.h" #include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" @@ -58,6 +59,15 @@ constexpr double kRelevanceThreshold = 0.79; constexpr double kMinimumQueryLength = 3; +constexpr char kHistogramMemoryCrosHealthdProbeErrorPrefix[] = + "Apps.AppList.SystemInfoProvider.CrosHealthdProbeError.MemoryInfo"; +constexpr char kHistogramCpuCrosHealthdProbeErrorPrefix[] = + "Apps.AppList.SystemInfoProvider.CrosHealthdProbeError.CpuInfo"; +constexpr char kHistogramBatteryCrosHealthdProbeErrorPrefix[] = + "Apps.AppList.SystemInfoProvider.CrosHealthdProbeError.BatteryInfo"; +constexpr char kHistogramBatteryErrorPrefix[] = + "Apps.AppList.SystemInfoProvider.Error.Battery"; + double ConvertKBtoBytes(uint32_t amount) { return static_cast<double>(amount) * 1024; } @@ -73,7 +83,7 @@ browsing_data_size_calculator_(profile), crostini_size_calculator_(profile), profile_(profile), - keywords_(GetSystemInfoKeywordVector()) { + keywords_(launcher_search::GetSystemInfoKeywordVector()) { DCHECK(profile_); ash::cros_healthd::ServiceConnection::GetInstance()->BindProbeService( probe_service_.BindNewPipeAndPassReceiver()); @@ -103,8 +113,8 @@ } double max_relevance = 0; - SystemInfoKeywordInput* most_relevant_keyword_input; - for (SystemInfoKeywordInput& keyword_input : keywords_) { + launcher_search::SystemInfoKeywordInput* most_relevant_keyword_input; + for (launcher_search::SystemInfoKeywordInput& keyword_input : keywords_) { double relevance = CalculateRelevance(query, keyword_input.GetKeyword()); if (relevance > kRelevanceThreshold && relevance > max_relevance) { max_relevance = relevance; @@ -115,26 +125,26 @@ if (max_relevance > kRelevanceThreshold) { relevance_ = max_relevance; switch (most_relevant_keyword_input->GetInputType()) { - case SystemInfoInputType::kMemory: + case launcher_search::SystemInfoInputType::kMemory: UpdateMemoryUsage(/*create_result=*/true); break; - case SystemInfoInputType::kCPU: + case launcher_search::SystemInfoInputType::kCPU: UpdateCpuUsage(/*create_result=*/true); break; - case SystemInfoInputType::kVersion: + case launcher_search::SystemInfoInputType::kVersion: UpdateChromeOsVersion(); break; // Do not calculate the storage size again if already // calculated recently. // TODO(b/263994165): Add in a refresh period here. - case SystemInfoInputType::kStorage: + case launcher_search::SystemInfoInputType::kStorage: if (!calculation_state_.all()) { UpdateStorageInfo(); } else { CreateStorageAnswerCard(); } break; - case SystemInfoInputType::kBattery: + case launcher_search::SystemInfoInputType::kBattery: UpdateBatteryInfo(); break; } @@ -184,7 +194,8 @@ return; } - memory_info_ = GetMemoryInfo(*info_ptr); + memory_info_ = system_info::GetMemoryInfo( + *info_ptr, kHistogramMemoryCrosHealthdProbeErrorPrefix); if (!memory_info_) { LOG(ERROR) << "Memory information not provided by croshealthd"; return; @@ -250,7 +261,8 @@ return; } - const CpuInfo* cpu_info = GetCpuInfo(*info_ptr); + const CpuInfo* cpu_info = system_info::GetCpuInfo( + *info_ptr, kHistogramCpuCrosHealthdProbeErrorPrefix); if (cpu_info == nullptr) { LOG(ERROR) << "No CpuInfo in response from cros_healthd."; return; @@ -274,14 +286,15 @@ const PhysicalCpuInfoPtr& physical_cpu_ptr = cpu_info->physical_cpus[0]; - CpuUsageData new_cpu_usage_data = - CalculateCpuUsage(physical_cpu_ptr->logical_cpus); - std::unique_ptr<CpuData> new_cpu_usage = std::make_unique<CpuData>(); + system_info::CpuUsageData new_cpu_usage_data = + system_info::CalculateCpuUsage(physical_cpu_ptr->logical_cpus); + std::unique_ptr<system_info::CpuData> new_cpu_usage = + std::make_unique<system_info::CpuData>(); - PopulateCpuUsage(new_cpu_usage_data, previous_cpu_usage_data_, - *new_cpu_usage.get()); - PopulateAverageCpuTemperature(*cpu_info, *new_cpu_usage.get()); - PopulateAverageScaledClockSpeed(*cpu_info, *new_cpu_usage.get()); + system_info::PopulateCpuUsage(new_cpu_usage_data, previous_cpu_usage_data_, + *new_cpu_usage.get()); + system_info::PopulateAverageCpuTemperature(*cpu_info, *new_cpu_usage.get()); + system_info::PopulateAverageScaledClockSpeed(*cpu_info, *new_cpu_usage.get()); previous_cpu_usage_data_ = new_cpu_usage_data; std::u16string cpu_temp = @@ -348,25 +361,30 @@ return; } - const BatteryInfo* battery_info_ptr = GetBatteryInfo(*info_ptr); + const BatteryInfo* battery_info_ptr = system_info::GetBatteryInfo( + *info_ptr, kHistogramBatteryCrosHealthdProbeErrorPrefix, + kHistogramBatteryErrorPrefix); if (!battery_info_ptr) { LOG(ERROR) << "BatteryInfo requested by device does not have a battery."; return; } - std::unique_ptr<BatteryHealth> new_battery_health = - std::make_unique<BatteryHealth>(); + std::unique_ptr<system_info::BatteryHealth> new_battery_health = + std::make_unique<system_info::BatteryHealth>(); - PopulateBatteryHealth(*battery_info_ptr, *new_battery_health.get()); + system_info::PopulateBatteryHealth(*battery_info_ptr, + *new_battery_health.get()); const std::optional<power_manager::PowerSupplyProperties>& proto = chromeos::PowerManagerClient::Get()->GetLastStatus(); if (!proto) { - EmitBatteryDataError(BatteryDataError::kNoData); + system_info::EmitBatteryDataError(system_info::BatteryDataError::kNoData, + kHistogramBatteryErrorPrefix); return; } - PopulatePowerStatus(proto.value(), *new_battery_health.get()); + launcher_search::PopulatePowerStatus(proto.value(), + *new_battery_health.get()); std::u16string battery_health_info = l10n_util::GetStringFUTF16( IDS_ASH_BATTERY_STATUS_IN_LAUNCHER_DESCRIPTION_RIGHT,
diff --git a/chrome/browser/ash/app_list/search/system_info/system_info_card_provider.h b/chrome/browser/ash/app_list/search/system_info/system_info_card_provider.h index 16b7a30..65d8641 100644 --- a/chrome/browser/ash/app_list/search/system_info/system_info_card_provider.h +++ b/chrome/browser/ash/app_list/search/system_info/system_info_card_provider.h
@@ -13,11 +13,11 @@ #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" #include "chrome/browser/ash/app_list/search/search_provider.h" -#include "chrome/browser/ash/app_list/search/system_info/battery_health.h" -#include "chrome/browser/ash/app_list/search/system_info/cpu_usage_data.h" -#include "chrome/browser/ash/app_list/search/system_info/system_info_keyword_input.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/ash/settings/calculator/size_calculator.h" +#include "chromeos/ash/components/launcher_search/system_info/system_info_keyword_input.h" +#include "chromeos/ash/components/system_info/battery_health.h" +#include "chromeos/ash/components/system_info/cpu_usage_data.h" #include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd.mojom.h" #include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" #include "mojo/public/cpp/bindings/remote.h" @@ -137,13 +137,14 @@ mojo::Remote<ash::cros_healthd::mojom::CrosHealthdProbeService> probe_service_; std::string chromeOS_version_{""}; - CpuUsageData previous_cpu_usage_data_{CpuUsageData()}; + system_info::CpuUsageData previous_cpu_usage_data_{ + system_info::CpuUsageData()}; raw_ptr<ash::cros_healthd::mojom::MemoryInfo, DanglingUntriaged> memory_info_{ nullptr}; - std::unique_ptr<BatteryHealth> battery_health_{nullptr}; + std::unique_ptr<system_info::BatteryHealth> battery_health_{nullptr}; gfx::ImageSkia os_settings_icon_; gfx::ImageSkia diagnostics_icon_; - std::vector<SystemInfoKeywordInput> keywords_; + std::vector<launcher_search::SystemInfoKeywordInput> keywords_; std::unique_ptr<base::RepeatingTimer> cpu_usage_timer_; std::unique_ptr<base::RepeatingTimer> memory_timer_; base::ObserverList<SystemInfoCardProvider::CpuDataObserver> cpu_observers_;
diff --git a/chrome/browser/ash/app_list/search/system_info/system_info_card_provider_unittest.cc b/chrome/browser/ash/app_list/search/system_info/system_info_card_provider_unittest.cc index b7b7aeb..d7192d4 100644 --- a/chrome/browser/ash/app_list/search/system_info/system_info_card_provider_unittest.cc +++ b/chrome/browser/ash/app_list/search/system_info/system_info_card_provider_unittest.cc
@@ -19,7 +19,6 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_running_on_chromeos.h" #include "base/timer/mock_timer.h" -#include "chrome/browser/ash/app_list/search/system_info/system_info_util.h" #include "chrome/browser/ash/app_list/search/test/test_search_controller.h" #include "chrome/browser/ash/file_manager/path_util.h" #include "chrome/browser/ui/webui/ash/settings/pages/storage/device_storage_util.h" @@ -29,7 +28,11 @@ #include "chromeos/ash/components/dbus/spaced/spaced_client.h" #include "chromeos/ash/components/disks/disk_mount_manager.h" #include "chromeos/ash/components/disks/fake_disk_mount_manager.h" +#include "chromeos/ash/components/launcher_search/system_info/launcher_util.h" #include "chromeos/ash/components/mojo_service_manager/fake_mojo_service_manager.h" +#include "chromeos/ash/components/system_info/cpu_data.h" +#include "chromeos/ash/components/system_info/cpu_usage_data.h" +#include "chromeos/ash/components/system_info/system_info_util.h" #include "chromeos/ash/services/cros_healthd/public/cpp/fake_cros_healthd.h" #include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom-forward.h" #include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" @@ -80,7 +83,7 @@ } void SetCrosHealthdCpuResponse( - const std::vector<CpuUsageData>& usage_data, + const std::vector<system_info::CpuUsageData>& usage_data, const std::vector<int32_t>& cpu_temps, const std::vector<uint32_t>& scaled_cpu_clock_speed) { auto cpu_info_ptr = healthd_mojom::CpuInfo::New(); @@ -278,12 +281,14 @@ size_t expected_no_data_error, size_t expected_not_a_number_error, size_t expected_expectation_not_met_error) { - tester.ExpectBucketCount(kBatteryDataError, BatteryDataError::kNoData, + tester.ExpectBucketCount(kBatteryDataError, + system_info::BatteryDataError::kNoData, expected_no_data_error); - tester.ExpectBucketCount(kBatteryDataError, BatteryDataError::kNotANumber, + tester.ExpectBucketCount(kBatteryDataError, + system_info::BatteryDataError::kNotANumber, expected_not_a_number_error); tester.ExpectBucketCount(kBatteryDataError, - BatteryDataError::kExpectationNotMet, + system_info::BatteryDataError::kExpectationNotMet, expected_expectation_not_met_error); } @@ -408,8 +413,8 @@ int temp_3 = 15; uint32_t core_1_speed = 4000000; uint32_t core_2_speed = 2000000; - CpuUsageData core_1(1000, 1000, 1000); - CpuUsageData core_2(2000, 2000, 2000); + system_info::CpuUsageData core_1(1000, 1000, 1000); + system_info::CpuUsageData core_2(2000, 2000, 2000); SetCrosHealthdCpuResponse({core_1, core_2}, {temp_1, temp_2, temp_3}, {core_1_speed, core_2_speed}); @@ -437,8 +442,8 @@ int temp_3 = 15; uint32_t core_1_speed = 4000000; uint32_t core_2_speed = 2000000; - CpuUsageData core_1(1000, 1000, 1000); - CpuUsageData core_2(2000, 2000, 2000); + system_info::CpuUsageData core_1(1000, 1000, 1000); + system_info::CpuUsageData core_2(2000, 2000, 2000); SetCrosHealthdCpuResponse({core_1, core_2}, {temp_1, temp_2, temp_3}, {core_1_speed, core_2_speed}); @@ -474,8 +479,8 @@ core_1_speed = 5000000; core_2_speed = 6000000; - CpuUsageData core_1_delta(3000, 2500, 4500); - CpuUsageData core_2_delta(1000, 5500, 3500); + system_info::CpuUsageData core_1_delta(3000, 2500, 4500); + system_info::CpuUsageData core_2_delta(1000, 5500, 3500); SetCrosHealthdCpuResponse({core_1 + core_1_delta, core_2 + core_2_delta}, {new_temp_1, new_temp_2, new_temp_3},
diff --git a/chrome/browser/ash/app_list/search/system_info/system_info_keyword_input.h b/chrome/browser/ash/app_list/search/system_info/system_info_keyword_input.h deleted file mode 100644 index 770fc2cc..0000000 --- a/chrome/browser/ash/app_list/search/system_info/system_info_keyword_input.h +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_SYSTEM_INFO_KEYWORD_INPUT_H_ -#define CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_SYSTEM_INFO_KEYWORD_INPUT_H_ - -#include <string> - -namespace app_list { - -// This enum represents which type of System Info will be displayed. -enum class SystemInfoInputType { kCPU, kVersion, kMemory, kBattery, kStorage }; - -struct SystemInfoKeywordInput { - SystemInfoKeywordInput() = default; - SystemInfoKeywordInput(SystemInfoInputType input_type, - std::u16string keyword); - - ~SystemInfoKeywordInput() = default; - - SystemInfoInputType GetInputType(); - std::u16string GetKeyword(); - - private: - SystemInfoInputType input_type_; - std::u16string keyword_; -}; - -} // namespace app_list - -#endif // CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_SYSTEM_INFO_KEYWORD_INPUT_H_
diff --git a/chrome/browser/ash/app_list/search/system_info/system_info_util.cc b/chrome/browser/ash/app_list/search/system_info/system_info_util.cc deleted file mode 100644 index 02b83a9bc..0000000 --- a/chrome/browser/ash/app_list/search/system_info/system_info_util.cc +++ /dev/null
@@ -1,312 +0,0 @@ -// 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/app_list/search/system_info/system_info_util.h" - -#include <string> -#include <string_view> -#include <vector> - -#include "ash/public/cpp/power_utils.h" -#include "ash/strings/grit/ash_strings.h" -#include "base/metrics/histogram_functions.h" -#include "base/time/time.h" -#include "chrome/browser/ash/app_list/search/system_info/cpu_usage_data.h" -#include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" -#include "chromeos/dbus/power_manager/power_supply_properties.pb.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/base/l10n/time_format.h" - -namespace app_list { -namespace { - -namespace healthd = ash::cros_healthd::mojom; - -constexpr int kMilliampsInAnAmp = 1000; - -const std::string GetMetricNameForSourceType( - const std::string_view source_type) { - if (source_type == "cpu info") { - return "Apps.AppList.SystemInfoProvider.CrosHealthdProbeError.CpuInfo"; - } - if (source_type == "memory info") { - return "Apps.AppList.SystemInfoProvider.CrosHealthdProbeError.MemoryInfo"; - } - if (source_type == "battery info") { - return "Apps.AppList.SystemInfoProvider.CrosHealthdProbeError.BatteryInfo"; - } - NOTREACHED(); - return ""; -} - -void EmitCrosHealthdProbeError(const std::string_view source_type, - healthd::ErrorType error_type) { - const std::string& metric_name = GetMetricNameForSourceType(source_type); - - // `metric_name` may be empty in which case we do not want a metric send - // attempted. - if (metric_name.empty()) { - LOG(WARNING) - << "Ignoring request to record metric for ProbeError of error_type: " - << error_type << " for unknown source_stuct: " << source_type; - return; - } - - base::UmaHistogramEnumeration(metric_name, error_type); -} - -template <typename TResult, typename TTag> - -bool CheckResponse(const TResult& result, - TTag expected_tag, - std::string_view type_name) { - if (result.is_null()) { - LOG(ERROR) << type_name << "not found in croshealthd response."; - return false; - } - - auto tag = result->which(); - if (tag == TTag::kError) { - EmitCrosHealthdProbeError(type_name, result->get_error()->type); - LOG(ERROR) << "Error retrieving " << type_name - << "from croshealthd: " << result->get_error()->msg; - return false; - } - - DCHECK_EQ(tag, expected_tag); - - return true; -} - -} // namespace - -void EmitBatteryDataError(BatteryDataError error) { - base::UmaHistogramEnumeration("Apps.AppList.SystemInfoProvider.Error.Battery", - error); -} - -healthd::MemoryInfo* GetMemoryInfo(const healthd::TelemetryInfo& info) { - const healthd::MemoryResultPtr& memory_result = info.memory_result; - if (!CheckResponse(memory_result, healthd::MemoryResult::Tag::kMemoryInfo, - "memory info")) { - return nullptr; - } - - return memory_result->get_memory_info().get(); -} - -const healthd::BatteryInfo* GetBatteryInfo(const healthd::TelemetryInfo& info) { - const healthd::BatteryResultPtr& battery_result = info.battery_result; - if (!CheckResponse(battery_result, healthd::BatteryResult::Tag::kBatteryInfo, - "battery info")) { - return nullptr; - } - - const healthd::BatteryInfo* battery_info = - battery_result->get_battery_info().get(); - if (battery_info->charge_full == 0) { - LOG(ERROR) << "charge_full from battery_info should not be zero."; - EmitBatteryDataError(BatteryDataError::kExpectationNotMet); - return nullptr; - } - - // Handle values in battery_info which could cause a SIGFPE. See b/227485637. - if (isnan(battery_info->charge_full) || - isnan(battery_info->charge_full_design) || - battery_info->charge_full_design == 0) { - LOG(ERROR) << "battery_info values could cause SIGFPE crash: { " - << "charge_full_design: " << battery_info->charge_full_design - << ", charge_full: " << battery_info->charge_full << " }"; - return nullptr; - } - - return battery_info; -} - -healthd::CpuInfo* GetCpuInfo(const healthd::TelemetryInfo& info) { - const healthd::CpuResultPtr& cpu_result = info.cpu_result; - if (!CheckResponse(cpu_result, healthd::CpuResult::Tag::kCpuInfo, - "cpu info")) { - return nullptr; - } - - return cpu_result->get_cpu_info().get(); -} - -CpuUsageData CalculateCpuUsage( - const std::vector<healthd::LogicalCpuInfoPtr>& logical_cpu_infos) { - CpuUsageData new_usage_data; - - DCHECK_GE(logical_cpu_infos.size(), 1u); - for (const auto& logical_cpu_ptr : logical_cpu_infos) { - new_usage_data += CpuUsageData(logical_cpu_ptr->user_time_user_hz, - logical_cpu_ptr->system_time_user_hz, - logical_cpu_ptr->idle_time_user_hz); - } - - return new_usage_data; -} - -void PopulateCpuUsage(CpuUsageData new_cpu_usage_data, - CpuUsageData previous_cpu_usage_data, - CpuData& cpu_usage) { - CpuUsageData delta = new_cpu_usage_data - previous_cpu_usage_data; - - const uint64_t total_delta = delta.GetTotalTime(); - if (total_delta == 0) { - LOG(ERROR) << "Device reported having zero logical CPUs."; - return; - } - cpu_usage.SetPercentUsageUser(100 * delta.GetUserTime() / total_delta); - cpu_usage.SetPercentUsageSystem(100 * delta.GetSystemTime() / total_delta); - cpu_usage.SetPercentUsageFree(100 * delta.GetIdleTime() / total_delta); -} - -void PopulateAverageCpuTemperature( - const ash::cros_healthd::mojom::CpuInfo& cpu_info, - CpuData& cpu_usage) { - if (cpu_info.temperature_channels.empty()) { - LOG(ERROR) << "Device reported having 0 temperature channels."; - return; - } - - uint32_t cumulative_total = 0; - for (const auto& temp_channel_ptr : cpu_info.temperature_channels) { - cumulative_total += temp_channel_ptr->temperature_celsius; - } - - // Integer division. - cpu_usage.SetAverageCpuTempCelsius(cumulative_total / - cpu_info.temperature_channels.size()); -} - -void PopulateAverageScaledClockSpeed(const healthd::CpuInfo& cpu_info, - CpuData& cpu_usage) { - if (cpu_info.physical_cpus.empty() || - cpu_info.physical_cpus[0]->logical_cpus.empty()) { - LOG(ERROR) << "Device reported having 0 logical CPUs."; - return; - } - - uint32_t total_scaled_ghz = 0; - for (const auto& logical_cpu_ptr : cpu_info.physical_cpus[0]->logical_cpus) { - total_scaled_ghz += logical_cpu_ptr->scaling_current_frequency_khz; - } - - // Integer division. - cpu_usage.SetScalingAverageCurrentFrequencyKhz( - total_scaled_ghz / cpu_info.physical_cpus[0]->logical_cpus.size()); -} - -void PopulateBatteryHealth(const healthd::BatteryInfo& battery_info, - BatteryHealth& battery_health) { - battery_health.SetCycleCount(battery_info.cycle_count); - - double charge_full_now_milliamp_hours = - battery_info.charge_full * kMilliampsInAnAmp; - double charge_full_design_milliamp_hours = - battery_info.charge_full_design * kMilliampsInAnAmp; - battery_health.SetBatteryWearPercentage( - std::min({(100 * charge_full_now_milliamp_hours / - charge_full_design_milliamp_hours), - 100.0})); -} - -std::u16string GetBatteryTimeText(base::TimeDelta time_left) { - int hour = 0; - int min = 0; - ash::power_utils::SplitTimeIntoHoursAndMinutes(time_left, &hour, &min); - - std::u16string time_text; - if (hour == 0 || min == 0) { - // Display only one unit ("2 hours" or "10 minutes"). - return ui::TimeFormat::Simple(ui::TimeFormat::FORMAT_DURATION, - ui::TimeFormat::LENGTH_LONG, time_left); - } - - return ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION, - ui::TimeFormat::LENGTH_LONG, - -1, // force hour and minute output - time_left); -} - -void PopulatePowerStatus(const power_manager::PowerSupplyProperties& proto, - BatteryHealth& battery_health) { - bool charging = proto.battery_state() == - power_manager::PowerSupplyProperties_BatteryState_CHARGING; - bool calculating = proto.is_calculating_battery_time(); - int percent = - ash::power_utils::GetRoundedBatteryPercent(proto.battery_percent()); - DCHECK(percent <= 100 && percent >= 0); - base::TimeDelta time_left; - bool show_time = false; - - if (!calculating) { - time_left = base::Seconds(charging ? proto.battery_time_to_full_sec() - : proto.battery_time_to_empty_sec()); - show_time = ash::power_utils::ShouldDisplayBatteryTime(time_left); - } - - std::u16string status_text; - std::u16string accessibility_string; - if (show_time) { - status_text = l10n_util::GetStringFUTF16( - charging ? IDS_ASH_BATTERY_STATUS_CHARGING_IN_LAUNCHER_DESCRIPTION_LEFT - : IDS_ASH_BATTERY_STATUS_IN_LAUNCHER_DESCRIPTION_LEFT, - base::NumberToString16(percent), GetBatteryTimeText(time_left)); - accessibility_string = l10n_util::GetStringFUTF16( - charging - ? IDS_ASH_BATTERY_STATUS_CHARGING_IN_LAUNCHER_ACCESSIBILITY_LABEL - : IDS_ASH_BATTERY_STATUS_IN_LAUNCHER_ACCESSIBILITY_LABEL, - base::NumberToString16(percent), GetBatteryTimeText(time_left)); - } else { - status_text = l10n_util::GetStringFUTF16( - IDS_ASH_BATTERY_STATUS_IN_LAUNCHER_DESCRIPTION_LEFT_SHORT, - base::NumberToString16(percent)); - accessibility_string = l10n_util::GetStringFUTF16( - IDS_ASH_BATTERY_STATUS_IN_LAUNCHER_ACCESSIBILITY_LABEL_SHORT, - base::NumberToString16(percent)); - } - - battery_health.SetPowerTime(status_text); - battery_health.SetAccessibilityLabel(accessibility_string); - battery_health.SetBatteryPercentage(percent); -} - -std::vector<SystemInfoKeywordInput> GetSystemInfoKeywordVector() { - return { - SystemInfoKeywordInput( - SystemInfoInputType::kVersion, - l10n_util::GetStringUTF16(IDS_ASH_VERSION_KEYWORD_FOR_LAUNCHER)), - SystemInfoKeywordInput( - SystemInfoInputType::kVersion, - l10n_util::GetStringUTF16(IDS_ASH_DEVICE_KEYWORD_FOR_LAUNCHER)), - SystemInfoKeywordInput( - SystemInfoInputType::kVersion, - l10n_util::GetStringUTF16(IDS_ASH_ABOUT_KEYWORD_FOR_LAUNCHER)), - SystemInfoKeywordInput( - SystemInfoInputType::kBattery, - l10n_util::GetStringUTF16(IDS_ASH_BATTERY_KEYWORD_FOR_LAUNCHER)), - SystemInfoKeywordInput( - SystemInfoInputType::kMemory, - l10n_util::GetStringUTF16(IDS_ASH_MEMORY_KEYWORD_FOR_LAUNCHER)), - SystemInfoKeywordInput( - SystemInfoInputType::kMemory, - l10n_util::GetStringUTF16(IDS_ASH_RAM_KEYWORD_FOR_LAUNCHER)), - SystemInfoKeywordInput( - SystemInfoInputType::kCPU, - l10n_util::GetStringUTF16( - IDS_ASH_ACTIVITY_MONITOR_KEYWORD_FOR_LAUNCHER)), - SystemInfoKeywordInput( - SystemInfoInputType::kStorage, - l10n_util::GetStringUTF16(IDS_ASH_STORAGE_KEYWORD_FOR_LAUNCHER)), - SystemInfoKeywordInput( - SystemInfoInputType::kCPU, - l10n_util::GetStringUTF16(IDS_ASH_CPU_KEYWORD_FOR_LAUNCHER)), - SystemInfoKeywordInput( - SystemInfoInputType::kCPU, - l10n_util::GetStringUTF16(IDS_ASH_DEVICE_SLOW_KEYWORD_FOR_LAUNCHER))}; -} - -} // namespace app_list
diff --git a/chrome/browser/ash/app_list/search/system_info/system_info_util.h b/chrome/browser/ash/app_list/search/system_info/system_info_util.h deleted file mode 100644 index 716d119..0000000 --- a/chrome/browser/ash/app_list/search/system_info/system_info_util.h +++ /dev/null
@@ -1,80 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_SYSTEM_INFO_UTIL_H_ -#define CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_SYSTEM_INFO_UTIL_H_ - -#include <string> -#include <vector> - -#include "base/time/time.h" -#include "chrome/browser/ash/app_list/search/system_info/battery_health.h" -#include "chrome/browser/ash/app_list/search/system_info/cpu_data.h" -#include "chrome/browser/ash/app_list/search/system_info/cpu_usage_data.h" -#include "chrome/browser/ash/app_list/search/system_info/system_info_keyword_input.h" -#include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" -#include "chromeos/dbus/power_manager/power_supply_properties.pb.h" - -namespace app_list { - -// The enums below are used in histograms, do not remove/renumber entries. If -// you're adding to any of these enums, update the corresponding enum listing in -// tools/metrics/histograms/enums.xml: CrosDiagnosticsDataError. -enum class BatteryDataError { - // Null or nullptr value. - kNoData = 0, - // For numeric values that are NaN. - kNotANumber = 1, - // Expectation about data not met. Ex. routing prefix is between zero and - // thirty-two. - kExpectationNotMet = 2, - kMaxValue = kExpectationNotMet, -}; - -void EmitBatteryDataError(BatteryDataError error); - -// Extracts MemoryInfo from `info`. Logs and returns a nullptr if MemoryInfo -// in not present. -ash::cros_healthd::mojom::MemoryInfo* GetMemoryInfo( - const ash::cros_healthd::mojom::TelemetryInfo& info); - -// Extracts CpuInfo from `info`. Logs and returns a nullptr if CpuInfo -// in not present. -ash::cros_healthd::mojom::CpuInfo* GetCpuInfo( - const ash::cros_healthd::mojom::TelemetryInfo& info); - -// Extracts BatteryInfo from `info`. Logs and returns a nullptr if -// BatteryInfo in not present. -const ash::cros_healthd::mojom::BatteryInfo* GetBatteryInfo( - const ash::cros_healthd::mojom::TelemetryInfo& info); - -CpuUsageData CalculateCpuUsage( - const std::vector<ash::cros_healthd::mojom::LogicalCpuInfoPtr>& - logical_cpu_infos); - -void PopulateCpuUsage(CpuUsageData new_cpu_usage_data, - CpuUsageData previous_cpu_usage_data, - CpuData& cpu_usage); -void PopulateAverageCpuTemperature( - const ash::cros_healthd::mojom::CpuInfo& cpu_info, - CpuData& cpu_usage); -void PopulateAverageScaledClockSpeed( - const ash::cros_healthd::mojom::CpuInfo& cpu_info, - CpuData& out_cpu_usage); - -void PopulateBatteryHealth( - const ash::cros_healthd::mojom::BatteryInfo& battery_info, - BatteryHealth& battery_health); - -void PopulatePowerStatus( - const power_manager::PowerSupplyProperties& power_supply_properties, - BatteryHealth& battery_health); - -std::u16string GetBatteryTimeText(base::TimeDelta time_left); - -std::vector<SystemInfoKeywordInput> GetSystemInfoKeywordVector(); - -} // namespace app_list - -#endif // CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_SYSTEM_INFO_UTIL_H_
diff --git a/chrome/browser/ash/arc/intent_helper/custom_tab_session_impl_browsertest.cc b/chrome/browser/ash/arc/intent_helper/custom_tab_session_impl_browsertest.cc index 2f0e6b74..6a1f06f 100644 --- a/chrome/browser/ash/arc/intent_helper/custom_tab_session_impl_browsertest.cc +++ b/chrome/browser/ash/arc/intent_helper/custom_tab_session_impl_browsertest.cc
@@ -87,7 +87,7 @@ // The base class has already attached a WebContents with the Browser object. // We replace it, to simulate the single-tab ARC custom tab browser. ASSERT_EQ(browser()->tab_strip_model()->count(), 1); - browser()->tab_strip_model()->ReplaceWebContentsAt(0, + browser()->tab_strip_model()->DiscardWebContentsAt(0, std::move(web_contents)); base::RunLoop webcontents_run_loop; web_contents_destroyed_closure_ = webcontents_run_loop.QuitClosure();
diff --git a/chrome/browser/ash/customization/customization_document_unittest.cc b/chrome/browser/ash/customization/customization_document_unittest.cc index 71b0517..2845be8 100644 --- a/chrome/browser/ash/customization/customization_document_unittest.cc +++ b/chrome/browser/ash/customization/customization_document_unittest.cc
@@ -211,8 +211,7 @@ default_network ? default_network->guid() : std::string(); network_portal_detector_.SetDefaultNetworkForTesting(guid); if (!guid.empty()) { - network_portal_detector_.SetDetectionResultsForTesting( - guid, NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204); + network_portal_detector_.SetDetectionResultsForTesting(guid, 204); } TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_);
diff --git a/chrome/browser/ash/events/event_rewriter_unittest.cc b/chrome/browser/ash/events/event_rewriter_unittest.cc index 23746db..5461f9b 100644 --- a/chrome/browser/ash/events/event_rewriter_unittest.cc +++ b/chrome/browser/ash/events/event_rewriter_unittest.cc
@@ -108,6 +108,11 @@ constexpr char kKbdDefaultCustomTopRowLayout[] = "01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f"; +// Tag used to mark events as being for right alt. +constexpr std::pair<std::string, std::vector<uint8_t>> kPropertyRightAlt = { + "right_alt_event", + {}}; + #if BUILDFLAG(GOOGLE_CHROME_BRANDING) constexpr char kCros1pInputMethodIdPrefix[] = "_comp_ime_jkghodnilhceideoidjikpgommlajknk"; @@ -195,6 +200,7 @@ ui::KeyboardCode keycode; ui::EventFlags flags = ui::EF_NONE; uint32_t scan_code = kNoScanCode; + std::vector<std::pair<std::string, std::vector<uint8_t>>> properties; std::string ToString() const; }; @@ -202,19 +208,27 @@ std::string TestKeyEvent::ToString() const { std::string type_name(ui::EventTypeName(type)); std::string flags_name = base::JoinString(ui::EventFlagsNames(flags), "|"); + + std::string property_dump; + for (const auto& property : properties) { + property_dump += (property_dump.empty() ? "" : "|") + property.first; + property_dump += "=" + base::HexEncode(property.second); + } + return base::StringPrintf( "type=%s(%d) " "code=%s(0x%06X) " "key=%s(0x%08X) " "keycode=0x%02X " "flags=%s(0x%X) " - "scan_code=0x%08X", + "scan_code=0x%08X " + "properties=%s", type_name.c_str(), type, ui::KeycodeConverter::DomCodeToCodeString(code).c_str(), static_cast<uint32_t>(code), ui::KeycodeConverter::DomKeyToKeyString(key).c_str(), - static_cast<uint32_t>(key), keycode, flags_name.c_str(), flags, - scan_code); + static_cast<uint32_t>(key), keycode, flags_name.c_str(), flags, scan_code, + property_dump.data()); } inline std::ostream& operator<<(std::ostream& os, const TestKeyEvent& event) { @@ -224,7 +238,7 @@ inline bool operator==(const TestKeyEvent& e1, const TestKeyEvent& e2) { return e1.type == e2.type && e1.code == e2.code && e1.key == e2.key && e1.keycode == e2.keycode && e1.flags == e2.flags && - e1.scan_code == e2.scan_code; + e1.scan_code == e2.scan_code && e1.properties == e2.properties; } // Factory template of TestKeyEvents just to reduce a lot of code/data @@ -236,22 +250,40 @@ ui::DomKey::Base shifted_key = key> struct TestKey { // Returns press key event. - static constexpr TestKeyEvent Pressed(ui::EventFlags flags = ui::EF_NONE) { - return {ui::ET_KEY_PRESSED, code, - (flags & ui::EF_SHIFT_DOWN) ? shifted_key : key, keycode, - flags | modifier_flag}; + static constexpr TestKeyEvent Pressed( + ui::EventFlags flags = ui::EF_NONE, + std::vector<std::pair<std::string, std::vector<uint8_t>>> properties = + {}) { + return {ui::ET_KEY_PRESSED, + code, + (flags & ui::EF_SHIFT_DOWN) ? shifted_key : key, + keycode, + flags | modifier_flag, + kNoScanCode, + std::move(properties)}; } // Returns release key event. - static constexpr TestKeyEvent Released(ui::EventFlags flags = ui::EF_NONE) { + static constexpr TestKeyEvent Released( + ui::EventFlags flags = ui::EF_NONE, + std::vector<std::pair<std::string, std::vector<uint8_t>>> properties = + {}) { // Note: modifier flag should not be present on release events. - return {ui::ET_KEY_RELEASED, code, - (flags & ui::EF_SHIFT_DOWN) ? shifted_key : key, keycode, flags}; + return {ui::ET_KEY_RELEASED, + code, + (flags & ui::EF_SHIFT_DOWN) ? shifted_key : key, + keycode, + flags, + kNoScanCode, + std::move(properties)}; } // Returns press then release key events. - static std::vector<TestKeyEvent> Typed(ui::EventFlags flags = ui::EF_NONE) { - return {Pressed(flags), Released(flags)}; + static std::vector<TestKeyEvent> Typed( + ui::EventFlags flags = ui::EF_NONE, + std::vector<std::pair<std::string, std::vector<uint8_t>>> properties = + {}) { + return {Pressed(flags, properties), Released(flags, std::move(properties))}; } }; @@ -395,6 +427,12 @@ using KeyLaunchAssistant = TestKey<ui::DomCode::LAUNCH_ASSISTANT, ui::DomKey::LAUNCH_ASSISTANT, ui::VKEY_ASSISTANT>; +using KeyRightAlt = TestKey<ui::DomCode::LAUNCH_ASSISTANT, + ui::DomKey::LAUNCH_ASSISTANT, + ui::VKEY_ASSISTANT, + ui::EF_NONE, + ui::DomKey::LAUNCH_ASSISTANT>; + using KeyHangulMode = TestKey<ui::DomCode::ALT_RIGHT, ui::DomKey::HANGUL_MODE, ui::VKEY_HANGUL>; @@ -722,9 +760,9 @@ // Add extra_flags to each TestkeyEvent. std::vector<TestKeyEvent> key_events; for (const auto& event : events) { - key_events.push_back( - TestKeyEvent{event.type, event.code, event.key, event.keycode, - event.flags | current_flags, event.scan_code}); + key_events.push_back(TestKeyEvent{ + event.type, event.code, event.key, event.keycode, + event.flags | current_flags, event.scan_code, event.properties}); } auto result = SendKeyEvents(key_events, device_id); @@ -780,10 +818,17 @@ << rewritten_event->ToString(); continue; } + std::vector<std::pair<std::string, std::vector<uint8_t>>> properties; + if (rewritten_key_event->properties()) { + for (const auto& property : *rewritten_key_event->properties()) { + properties.push_back(property); + } + } result.push_back( {rewritten_key_event->type(), rewritten_key_event->code(), rewritten_key_event->GetDomKey(), rewritten_key_event->key_code(), - rewritten_key_event->flags(), rewritten_key_event->scan_code()}); + rewritten_key_event->flags(), rewritten_key_event->scan_code(), + std::move(properties)}); } return result; } @@ -1717,6 +1762,30 @@ input_method_manager_mock_->set_mod3_used(false); } +TEST_P(EventRewriterTest, TestRewriteToRightAlt) { + // Remap RightAlt to Control + Preferences::RegisterProfilePrefs(prefs()->registry()); + IntegerPrefMember control; + InitModifierKeyPref(&control, ::prefs::kLanguageRemapControlKeyTo, + ui::mojom::ModifierKey::kControl, + ui::mojom::ModifierKey::kRightAlt); + + IntegerPrefMember search; + InitModifierKeyPref(&search, ::prefs::kLanguageRemapSearchKeyTo, + ui::mojom::ModifierKey::kMeta, + ui::mojom::ModifierKey::kRightAlt); + + for (const auto& keyboard : kChromeKeyboardVariants) { + SCOPED_TRACE(keyboard.name); + SetUpKeyboard(keyboard); + + EXPECT_EQ(KeyRightAlt::Typed(ui::EF_NONE, {kPropertyRightAlt}), + RunRewriter(KeyLControl::Typed())); + EXPECT_EQ(KeyRightAlt::Typed(ui::EF_NONE, {kPropertyRightAlt}), + RunRewriter(KeyLMeta::Typed())); + } +} + TEST_P(EventRewriterTest, TestRewriteToFunction) { // Remap RightAlt to Control Preferences::RegisterProfilePrefs(prefs()->registry()); @@ -1797,6 +1866,48 @@ scoped_feature_list_.Reset(); } +TEST_P(EventRewriterTest, TestRewriteFromRightAlt) { + // RightAlt is only available when InputDeviceSettingsSplit is enabled. + scoped_feature_list_.InitWithFeatures( + {features::kModifierSplit, features::kInputDeviceSettingsSplit}, {}); + auto reset = switches::SetIgnoreModifierSplitSecretKeyForTest(); + + SetUpKeyboard(kInternalChromeSplitModifierLayoutKeyboard); + + // Test that identity is working as expected. + EXPECT_EQ(KeyRightAlt::Typed(ui::EF_NONE, {kPropertyRightAlt}), + RunRewriter(KeyLaunchAssistant::Typed())); + + // Remap RightAlt to Control + InitModifierKeyPref(nullptr, "", ui::mojom::ModifierKey::kRightAlt, + ui::mojom::ModifierKey::kControl); + + EXPECT_EQ(KeyLControl::Typed(), RunRewriter(KeyRightAlt::Typed())); + + // Test RightAlt remapped to Control properly applies the flag to other + // events. + EXPECT_EQ((std::vector<TestKeyEvent>{KeyLControl::Pressed()}), + (RunRewriter(std::vector<TestKeyEvent>{KeyRightAlt::Pressed()}))); + EXPECT_EQ(KeyA::Typed(ui::EF_CONTROL_DOWN), RunRewriter(KeyA::Typed())); + EXPECT_EQ((std::vector<TestKeyEvent>{KeyLControl::Released()}), + (RunRewriter(std::vector<TestKeyEvent>{KeyRightAlt::Released()}))); + + // Remap RightAlt to CapsLock + InitModifierKeyPref(nullptr, "", ui::mojom::ModifierKey::kRightAlt, + ui::mojom::ModifierKey::kCapsLock); + // Toggle CapsLock on/off + EXPECT_EQ(KeyCapsLock::Typed(ui::EF_CAPS_LOCK_ON), + RunRewriter(KeyRightAlt::Typed(ui::EF_CAPS_LOCK_ON))); + EXPECT_EQ(KeyCapsLock::Typed(), RunRewriter(KeyRightAlt::Typed())); + + // Remap RightAlt to Void + InitModifierKeyPref(nullptr, "", ui::mojom::ModifierKey::kRightAlt, + ui::mojom::ModifierKey::kVoid); + EXPECT_EQ(KeyUnknown::Typed(), RunRewriter(KeyRightAlt::Typed())); + + scoped_feature_list_.Reset(); +} + // TODO(crbug.com/1179893): Remove once the feature is enabled permanently. TEST_P(EventRewriterTest, TestRewriteExtendedKeysAltVariantsOld) { Preferences::RegisterProfilePrefs(prefs()->registry()); @@ -2297,13 +2408,13 @@ KeyF6::Typed, KeyF7::Typed, KeyF8::Typed, KeyF9::Typed, KeyF10::Typed, KeyF11::Typed, KeyF12::Typed, KeyF13::Typed, KeyF14::Typed, KeyF15::Typed}) { - EXPECT_EQ(typed(ui::EF_NONE), RunRewriter(typed(ui::EF_NONE))); - EXPECT_EQ(typed(ui::EF_CONTROL_DOWN), - RunRewriter(typed(ui::EF_NONE), ui::EF_CONTROL_DOWN)); - EXPECT_EQ(typed(ui::EF_ALT_DOWN), - RunRewriter(typed(ui::EF_NONE), ui::EF_ALT_DOWN)); - EXPECT_EQ(typed(ui::EF_COMMAND_DOWN), - RunRewriter(typed(ui::EF_NONE), ui::EF_COMMAND_DOWN)); + EXPECT_EQ(typed(ui::EF_NONE, {}), RunRewriter(typed(ui::EF_NONE, {}))); + EXPECT_EQ(typed(ui::EF_CONTROL_DOWN, {}), + RunRewriter(typed(ui::EF_NONE, {}), ui::EF_CONTROL_DOWN)); + EXPECT_EQ(typed(ui::EF_ALT_DOWN, {}), + RunRewriter(typed(ui::EF_NONE, {}), ui::EF_ALT_DOWN)); + EXPECT_EQ(typed(ui::EF_COMMAND_DOWN, {}), + RunRewriter(typed(ui::EF_NONE, {}), ui::EF_COMMAND_DOWN)); } } } @@ -2415,7 +2526,9 @@ .has_custom_top_row = true}); struct TestCase { - std::vector<TestKeyEvent> (*pressed)(ui::EventFlags); + std::vector<TestKeyEvent> (*pressed)( + ui::EventFlags, + std::vector<std::pair<std::string, std::vector<uint8_t>>>); uint32_t scan_code; }; // Action -> F1..F15 @@ -2443,7 +2556,7 @@ for (auto& unknown : unknowns_with_function) { unknown.scan_code = scan_code; } - auto expected_events = typed(ui::EF_NONE); + auto expected_events = typed(ui::EF_NONE, {}); for (auto& event : expected_events) { event.scan_code = scan_code; } @@ -2472,7 +2585,9 @@ .has_function_key = true}); struct TestCase { - std::vector<TestKeyEvent> (*pressed)(ui::EventFlags); + std::vector<TestKeyEvent> (*pressed)( + ui::EventFlags, + std::vector<std::pair<std::string, std::vector<uint8_t>>>); uint32_t scan_code; }; // Action -> F1..F15 @@ -2500,7 +2615,7 @@ for (auto& unknown : unknowns_with_search) { unknown.scan_code = scan_code; } - auto expected_events = typed(ui::EF_NONE); + auto expected_events = typed(ui::EF_NONE, {}); for (auto& event : expected_events) { event.scan_code = scan_code; }
diff --git a/chrome/browser/ash/login/screens/consumer_update_screen.cc b/chrome/browser/ash/login/screens/consumer_update_screen.cc index 804e0bc21..7892b4ee 100644 --- a/chrome/browser/ash/login/screens/consumer_update_screen.cc +++ b/chrome/browser/ash/login/screens/consumer_update_screen.cc
@@ -223,6 +223,11 @@ } else if (action_id == kUserActionSkipUpdate) { RecordIsOptionalUpdateSkipped(/*skipped=*/true); version_updater_->StopObserving(); + if (did_prepare_quick_start_for_update_) { + WizardController::default_controller() + ->quick_start_controller() + ->ResumeSessionAfterCancelledUpdate(); + } exit_callback_.Run(Result::SKIPPED); } else if (action_id == kUserActionBackButton) { version_updater_->RejectUpdateOverCellular(); @@ -238,12 +243,6 @@ } void ConsumerUpdateScreen::FinishExitUpdate(VersionUpdater::Result result) { - if (did_prepare_quick_start_for_update_) { - WizardController::default_controller() - ->quick_start_controller() - ->ResumeSessionAfterCancelledUpdate(); - } - switch (result) { case VersionUpdater::Result::UPDATE_NOT_REQUIRED: RecordOobeConsumerUpdateScreenSkippedReasonHistogram(
diff --git a/chrome/browser/ash/login/test/network_portal_detector_mixin.cc b/chrome/browser/ash/login/test/network_portal_detector_mixin.cc index 29c6e8f..91312bd 100644 --- a/chrome/browser/ash/login/test/network_portal_detector_mixin.cc +++ b/chrome/browser/ash/login/test/network_portal_detector_mixin.cc
@@ -35,22 +35,6 @@ } } -// TODO(b/331264838): Remove once CaptivePortalStatus is eliminated. -NetworkPortalDetector::CaptivePortalStatus CaptivePortalStatusForNetworkStatus( - NetworkPortalDetectorMixin::NetworkStatus status) { - using NetworkStatus = NetworkPortalDetectorMixin::NetworkStatus; - switch (status) { - case NetworkStatus::kUnknown: - return NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN; - case NetworkStatus::kOffline: - return NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE; - case NetworkStatus::kOnline: - return NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; - case NetworkStatus::kPortal: - return NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL; - } -} - } // namespace NetworkPortalDetectorMixin::NetworkPortalDetectorMixin( @@ -107,9 +91,8 @@ } } - network_portal_detector_->SetDetectionResultsForTesting( - default_network_guid, CaptivePortalStatusForNetworkStatus(status), - response_code); + network_portal_detector_->SetDetectionResultsForTesting(default_network_guid, + response_code); } void NetworkPortalDetectorMixin::SetUpOnMainThread() {
diff --git a/chrome/browser/ash/login/wizard_controller_browsertest.cc b/chrome/browser/ash/login/wizard_controller_browsertest.cc index 1c87699..1fa0b5d 100644 --- a/chrome/browser/ash/login/wizard_controller_browsertest.cc +++ b/chrome/browser/ash/login/wizard_controller_browsertest.cc
@@ -754,8 +754,7 @@ network_portal_detector_->SetDefaultNetworkForTesting( default_network->guid()); network_portal_detector_->SetDetectionResultsForTesting( - default_network->guid(), - NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204); + default_network->guid(), 204); } void WaitUntilTimezoneResolved() {
diff --git a/chrome/browser/ash/net/network_portal_detector_impl.cc b/chrome/browser/ash/net/network_portal_detector_impl.cc index ba0946b..442768f3 100644 --- a/chrome/browser/ash/net/network_portal_detector_impl.cc +++ b/chrome/browser/ash/net/network_portal_detector_impl.cc
@@ -34,7 +34,7 @@ using ::captive_portal::CaptivePortalDetector; // Default delay between portal detection attempts when Chrome portal detection -// is used (for detecting proxy auth or when Shill portal state is unknown). +// is used. constexpr base::TimeDelta kDefaultAttemptDelay = base::Seconds(1); // Timeout for attempts. @@ -155,12 +155,6 @@ handler->RequestPortalDetection(); } -NetworkPortalDetector::CaptivePortalStatus -NetworkPortalDetectorImpl::GetCaptivePortalStatus() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return default_portal_status_; -} - void NetworkPortalDetectorImpl::PortalStateChanged( const NetworkState* default_network, NetworkState::PortalState portal_state) { @@ -174,7 +168,6 @@ (default_network && default_network->guid() != default_network_id_)) { default_network_id_ = std::string(); StopDetection(); - default_portal_status_ = CAPTIVE_PORTAL_STATUS_OFFLINE; } return; } @@ -198,16 +191,13 @@ // portal. if (has_proxy) { schedule_attempt = true; - } else { - default_portal_status_ = CAPTIVE_PORTAL_STATUS_ONLINE; } break; case NetworkState::PortalState::kPortalSuspected: + break; case NetworkState::PortalState::kPortal: - default_portal_status_ = CAPTIVE_PORTAL_STATUS_PORTAL; break; case NetworkState::PortalState::kNoInternet: - default_portal_status_ = CAPTIVE_PORTAL_STATUS_OFFLINE; break; } @@ -234,7 +224,6 @@ attempt_task_.Cancel(); attempt_timeout_task_.Cancel(); captive_portal_detector_->Cancel(); - default_portal_status_ = CAPTIVE_PORTAL_STATUS_UNKNOWN; state_ = STATE_IDLE; ResetCountersAndSendMetrics(); } @@ -325,44 +314,32 @@ const NetworkState* network = DefaultNetwork(); - bool shill_is_captive_portal = false; - if (network) { - switch (network->shill_portal_state()) { - case NetworkState::PortalState::kUnknown: - case NetworkState::PortalState::kOnline: - break; - // TODO(b/207069182): Handle each state correctly. - case NetworkState::PortalState::kPortalSuspected: - case NetworkState::PortalState::kPortal: - case NetworkState::PortalState::kNoInternet: - shill_is_captive_portal = true; - break; - } - } - state_ = STATE_IDLE; attempt_timeout_task_.Cancel(); - CaptivePortalStatus status = CAPTIVE_PORTAL_STATUS_UNKNOWN; + bool detection_completed = false; + + // |portal_state| defaults to kUnknown which will cause the Chrome portal + // state to be ignored in favor of the Shill portal state. + // See NetworkState::GetPortalState for details. + NetworkState::PortalState portal_state = NetworkState::PortalState::kUnknown; + switch (result) { case captive_portal::RESULT_NO_RESPONSE: + // Do not override shill results. if (response_code == net::HTTP_PROXY_AUTHENTICATION_REQUIRED) { - status = CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED; - } else if (shill_is_captive_portal) { - // Take into account shill's detection results. - status = CAPTIVE_PORTAL_STATUS_PORTAL; - } else { - // We should only get here if Shill does not detect a portal but the - // Chrome detector does not receive a response. Use 'offline' to - // trigger continued detection. - status = CAPTIVE_PORTAL_STATUS_OFFLINE; + detection_completed = true; } break; case captive_portal::RESULT_INTERNET_CONNECTED: - status = CAPTIVE_PORTAL_STATUS_ONLINE; + // Do not set a portal state. + detection_completed = true; break; case captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL: - status = CAPTIVE_PORTAL_STATUS_PORTAL; + // Override shill results with kPortal. + // TODO(b/292141089): This should only happen when a proxy is configured + // and Shill is unable to perform accurate portal detection. + portal_state = NetworkState::PortalState::kPortal; break; case captive_portal::RESULT_COUNT: NOTREACHED(); @@ -372,26 +349,25 @@ NET_LOG(EVENT) << "NetworkPortalDetector: AttemptCompleted: id=" << NetworkGuidId(default_network_id_) << ", result=" << captive_portal::CaptivePortalResultToString(result) - << ", status=" << status << ", response_code=" << response_code + << ", response_code=" << response_code << ", content_length=" << results.content_length.value_or(-1); - base::UmaHistogramEnumeration("Network.NetworkPortalDetectorResult", status); NetworkState::NetworkTechnologyType type = NetworkState::NetworkTechnologyType::kUnknown; - if (status == CAPTIVE_PORTAL_STATUS_PORTAL) { - if (network) + if (portal_state == NetworkState::PortalState::kPortal) { + if (network) { type = network->GetNetworkTechnologyType(); + } base::UmaHistogramEnumeration("Network.NetworkPortalDetectorType", type); } captive_portal_detector_run_count_++; - if (status == CAPTIVE_PORTAL_STATUS_ONLINE || - status == CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED) { - // Chrome positively identified an online or proxy-auth state. + if (detection_completed) { + // Chrome positively identified an online or proxy-auth (407) response. // No need to continue detection. response_code_for_testing_ = response_code; - DetectionCompleted(network, status); + DetectionCompleted(network, portal_state); return; } @@ -400,46 +376,24 @@ } // Set network portal state and continue scheduling attempts until online. - if (status == CAPTIVE_PORTAL_STATUS_PORTAL) { + if (portal_state == NetworkState::PortalState::kPortal) { response_code_for_testing_ = response_code; - default_portal_status_ = CAPTIVE_PORTAL_STATUS_PORTAL; - SetNetworkPortalState(network, NetworkState::PortalState::kPortal); + SetNetworkPortalState(network, portal_state); } ScheduleAttempt(results.retry_after_delta); } void NetworkPortalDetectorImpl::DetectionCompleted( const NetworkState* network, - const CaptivePortalStatus& status) { + NetworkState::PortalState portal_state) { NET_LOG(EVENT) << "NetworkPortalDetector: DetectionCompleted: id=" << (network ? NetworkGuidId(network->guid()) : "<none>") - << ", status=" << status; + << ", PortalState=" << portal_state; - default_portal_status_ = status; if (network) { - NetworkState::PortalState portal_state; - switch (status) { - case CAPTIVE_PORTAL_STATUS_UNKNOWN: - case CAPTIVE_PORTAL_STATUS_COUNT: - case CAPTIVE_PORTAL_STATUS_OFFLINE: - portal_state = NetworkState::PortalState::kUnknown; - break; - case CAPTIVE_PORTAL_STATUS_ONLINE: - // TODO(b/207069182): This should state PortalState::kOnline. - portal_state = NetworkState::PortalState::kUnknown; - break; - case CAPTIVE_PORTAL_STATUS_PORTAL: - portal_state = NetworkState::PortalState::kPortal; - break; - case CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED: - // This case is unused and is orthogonal to captive portal detection. - portal_state = NetworkState::PortalState::kUnknown; - break; - } // Note: setting an unknown portal state will ignore the Chrome result and // fall back to the Shill result. SetNetworkPortalState(network, portal_state); - base::UmaHistogramBoolean("Network.NetworkPortalDetectorHasProxy", network->proxy_config().has_value()); } @@ -462,7 +416,6 @@ } void NetworkPortalDetectorImpl::StartDetectionForTesting() { - default_portal_status_ = CAPTIVE_PORTAL_STATUS_UNKNOWN; ScheduleAttempt(); }
diff --git a/chrome/browser/ash/net/network_portal_detector_impl.h b/chrome/browser/ash/net/network_portal_detector_impl.h index 1adb236d..25d30d1 100644 --- a/chrome/browser/ash/net/network_portal_detector_impl.h +++ b/chrome/browser/ash/net/network_portal_detector_impl.h
@@ -44,9 +44,6 @@ // 3. Observes the NetworkStateHandler class and triggers Chrome captive portal // detection (captive_portal::CaptivePortalService) when the Shill state // changes (if required) then updates NetworkStateHandler accordingly. -// It also maintains a separate CaptivePortalStatus for historical reasons. -// The status reflects the combined Shill + Chrome detection results -// (as does NetworkState::GetPortalState()). class NetworkPortalDetectorImpl : public NetworkPortalDetector, public NetworkStateHandlerObserver { public: @@ -60,7 +57,6 @@ ~NetworkPortalDetectorImpl() override; // NetworkPortalDetector implementation: - CaptivePortalStatus GetCaptivePortalStatus() override; bool IsEnabled() override; void Enable() override; void RequestCaptivePortalDetection() override; @@ -104,7 +100,7 @@ NetworkState::PortalState portal_state) override; void DetectionCompleted(const NetworkState* network, - const CaptivePortalStatus& results); + NetworkState::PortalState portal_state); void ResetCountersAndSendMetrics(); @@ -149,7 +145,6 @@ // Unique identifier of the default network. std::string default_network_id_; - CaptivePortalStatus default_portal_status_ = CAPTIVE_PORTAL_STATUS_UNKNOWN; int response_code_for_testing_ = -1; State state_ = STATE_IDLE;
diff --git a/chrome/browser/ash/net/network_portal_detector_impl_browsertest.cc b/chrome/browser/ash/net/network_portal_detector_impl_browsertest.cc index b562341..66532c5 100644 --- a/chrome/browser/ash/net/network_portal_detector_impl_browsertest.cc +++ b/chrome/browser/ash/net/network_portal_detector_impl_browsertest.cc
@@ -121,8 +121,6 @@ EXPECT_EQ(default_network->GetPortalState(), NetworkState::PortalState::kOnline); EXPECT_FALSE(display_service_->GetNotification(kNotificationId)); - EXPECT_EQ(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, - network_portal_detector::GetInstance()->GetCaptivePortalStatus()); // Setting a shill portal state should set portal detection and display a // notification @@ -350,8 +348,6 @@ // Check that the network is behind a portal and a notification is displayed. EXPECT_TRUE(display_service_->GetNotification(kNotificationId)); - EXPECT_EQ(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL, - network_portal_detector::GetInstance()->GetCaptivePortalStatus()); EXPECT_EQ(default_network->GetPortalState(), NetworkState::PortalState::kPortal);
diff --git a/chrome/browser/ash/net/network_portal_detector_impl_unittest.cc b/chrome/browser/ash/net/network_portal_detector_impl_unittest.cc index bb0f749..0d08661 100644 --- a/chrome/browser/ash/net/network_portal_detector_impl_unittest.cc +++ b/chrome/browser/ash/net/network_portal_detector_impl_unittest.cc
@@ -102,6 +102,9 @@ network_portal_detector_->enabled_ = true; set_detector(network_portal_detector_->captive_portal_detector_.get()); + + ASSERT_EQ(State::STATE_IDLE, state()); + ASSERT_EQ(GetPortalState(), NetworkState::PortalState::kOnline); } void TearDown() override { @@ -111,17 +114,13 @@ ConciergeClient::Shutdown(); } - bool CheckPortalState(NetworkPortalDetector::CaptivePortalStatus status, - int response_code, + bool CheckPortalState(int response_code, NetworkState::PortalState portal_state, const std::string& guid) { - NetworkPortalDetector::CaptivePortalStatus detector_status = - network_portal_detector()->GetCaptivePortalStatus(); int detector_response_code = network_portal_detector()->response_code_for_testing(); std::string default_network_id = network_portal_detector()->default_network_id_for_testing(); - EXPECT_EQ(status, detector_status); EXPECT_EQ(response_code, detector_response_code); EXPECT_EQ(guid, default_network_id); const NetworkState* default_network = @@ -133,8 +132,7 @@ } EXPECT_EQ(default_network_portal_state, portal_state); - return status == detector_status && - response_code == detector_response_code && + return response_code == detector_response_code && guid == default_network_id && default_network_portal_state == portal_state; } @@ -149,8 +147,13 @@ return network_portal_detector()->state(); } - NetworkPortalDetector::CaptivePortalStatus status() { - return network_portal_detector()->GetCaptivePortalStatus(); + NetworkState::PortalState GetPortalState() { + const NetworkState* default_network = + NetworkHandler::Get()->network_state_handler()->DefaultNetwork(); + if (!default_network) { + return NetworkState::PortalState::kUnknown; + } + return default_network->GetPortalState(); } void StopDetection() { network_portal_detector()->StopDetection(); } @@ -262,9 +265,6 @@ }; TEST_F(NetworkPortalDetectorImplTest, NoPortal) { - ASSERT_EQ(State::STATE_IDLE, state()); - ASSERT_EQ(status(), NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN); - // Connect with a proxy to trigger Chrome portal detection. SetConnectedWithProxy(kStubWireless1); EXPECT_EQ(State::STATE_CHECKING_FOR_PORTAL, state()); @@ -272,15 +272,11 @@ // Check HTTP 204 response code. CompleteURLFetch(net::OK, /*status_code=*/204, /*content_length=*/0, nullptr); EXPECT_EQ(State::STATE_IDLE, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, - NetworkState::PortalState::kOnline, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(204, NetworkState::PortalState::kOnline, + kStubWireless1)); } TEST_F(NetworkPortalDetectorImplTest, Portal200) { - ASSERT_EQ(State::STATE_IDLE, state()); - ASSERT_EQ(status(), NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN); - // Connect with a proxy to trigger Chrome portal detection. SetConnectedWithProxy(kStubWireless1); EXPECT_EQ(State::STATE_CHECKING_FOR_PORTAL, state()); @@ -288,15 +284,11 @@ // Check HTTP 200 response code. CompleteURLFetch(net::OK, /*status_code=*/200, /*content_length=*/2, nullptr); EXPECT_EQ(State::STATE_PORTAL_CHECK_PENDING, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL, 200, - NetworkState::PortalState::kPortal, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(200, NetworkState::PortalState::kPortal, + kStubWireless1)); } TEST_F(NetworkPortalDetectorImplTest, Portal302) { - ASSERT_EQ(State::STATE_IDLE, state()); - ASSERT_EQ(status(), NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN); - // Connect with a proxy to trigger Chrome portal detection. SetConnectedWithProxy(kStubWireless1); EXPECT_EQ(State::STATE_CHECKING_FOR_PORTAL, state()); @@ -304,15 +296,11 @@ // Check HTTP 302 response code. CompleteURLFetch(net::OK, /*status_code=*/302, /*content_length=*/0, nullptr); EXPECT_EQ(State::STATE_PORTAL_CHECK_PENDING, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL, 302, - NetworkState::PortalState::kPortal, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(302, NetworkState::PortalState::kPortal, + kStubWireless1)); } TEST_F(NetworkPortalDetectorImplTest, Online200WithContentLength1) { - ASSERT_EQ(State::STATE_IDLE, state()); - ASSERT_EQ(status(), NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN); - // Connect with a proxy to trigger Chrome portal detection. SetConnectedWithProxy(kStubWireless1); EXPECT_EQ(State::STATE_CHECKING_FOR_PORTAL, state()); @@ -320,15 +308,11 @@ // Check HTTP 302 response code. CompleteURLFetch(net::OK, /*status_code=*/200, /*content_length=*/1, nullptr); EXPECT_EQ(State::STATE_IDLE, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 200, - NetworkState::PortalState::kOnline, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(200, NetworkState::PortalState::kOnline, + kStubWireless1)); } TEST_F(NetworkPortalDetectorImplTest, Online200WithContentLength0) { - ASSERT_EQ(State::STATE_IDLE, state()); - ASSERT_EQ(status(), NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN); - // Connect with a proxy to trigger Chrome portal detection. SetConnectedWithProxy(kStubWireless1); EXPECT_EQ(State::STATE_CHECKING_FOR_PORTAL, state()); @@ -336,15 +320,11 @@ // Check HTTP 302 response code. CompleteURLFetch(net::OK, /*status_code=*/200, /*content_length=*/0, nullptr); EXPECT_EQ(State::STATE_IDLE, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 200, - NetworkState::PortalState::kOnline, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(200, NetworkState::PortalState::kOnline, + kStubWireless1)); } TEST_F(NetworkPortalDetectorImplTest, Online2Offline) { - ASSERT_EQ(State::STATE_IDLE, state()); - ASSERT_EQ(status(), NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN); - // WiFi is in online state with a proxy configured to trigger Chrome portal // detection. SetConnectedWithProxy(kStubWireless1); @@ -352,18 +332,17 @@ CompleteURLFetch(net::OK, /*status_code=*/204, /*content_length=*/0, nullptr); EXPECT_EQ(State::STATE_IDLE, state()); - EXPECT_EQ(status(), NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE); + EXPECT_EQ(GetPortalState(), NetworkState::PortalState::kOnline); // WiFi is turned off. SetDisconnected(kStubWireless1); EXPECT_EQ(State::STATE_IDLE, state()); - EXPECT_EQ(status(), NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE); + + // When the network is disconnected, the portal state is unknown. + EXPECT_EQ(GetPortalState(), NetworkState::PortalState::kUnknown); } TEST_F(NetworkPortalDetectorImplTest, NetworkChanged) { - ASSERT_EQ(State::STATE_IDLE, state()); - ASSERT_EQ(status(), NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN); - // Connect with a proxy to trigger Chrome portal detection. SetConnectedWithProxy(kStubWireless1); @@ -390,15 +369,11 @@ // ethernet is in online state. CompleteURLFetch(net::OK, /*status_code=*/204, /*content_length=*/0, nullptr); EXPECT_EQ(State::STATE_IDLE, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, - NetworkState::PortalState::kOnline, kStubWireless2)); + EXPECT_TRUE(CheckPortalState(204, NetworkState::PortalState::kOnline, + kStubWireless2)); } TEST_F(NetworkPortalDetectorImplTest, NetworkStateReconnect) { - ASSERT_EQ(State::STATE_IDLE, state()); - ASSERT_EQ(status(), NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN); - // Connect with a proxy to trigger Chrome portal detection. SetConnectedWithProxy(kStubWireless1); EXPECT_EQ(State::STATE_CHECKING_FOR_PORTAL, state()); @@ -406,9 +381,8 @@ CompleteURLFetch(net::OK, /*status_code=*/204, /*content_length=*/0, nullptr); EXPECT_EQ(State::STATE_IDLE, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, - NetworkState::PortalState::kOnline, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(204, NetworkState::PortalState::kOnline, + kStubWireless1)); // Reconnecting to the same network will trigger another portal check with the // same results. @@ -420,14 +394,12 @@ CompleteURLFetch(net::OK, /*status_code=*/204, /*content_length=*/0, nullptr); EXPECT_EQ(State::STATE_IDLE, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, - NetworkState::PortalState::kOnline, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(204, NetworkState::PortalState::kOnline, + kStubWireless1)); } TEST_F(NetworkPortalDetectorImplTest, NetworkStateChanged) { // Test for Portal -> Online -> Portal network state transitions. - ASSERT_EQ(State::STATE_IDLE, state()); // Connect with a proxy to trigger Chrome portal detection. SetConnectedWithProxy(kStubWireless1); @@ -439,9 +411,8 @@ // Find a portal from the portal detection. CompleteURLFetch(net::OK, /*status_code=*/200, /*content_length=*/2, nullptr); EXPECT_EQ(State::STATE_PORTAL_CHECK_PENDING, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL, 200, - NetworkState::PortalState::kPortal, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(200, NetworkState::PortalState::kPortal, + kStubWireless1)); // Setting the state to kStateNoConnectivity with a proxy should not trigger // chrome detection. @@ -461,14 +432,11 @@ // Chrome detects that the network is in a portal state. CompleteURLFetch(net::OK, /*status_code=*/200, /*content_length=*/2, nullptr); EXPECT_EQ(State::STATE_PORTAL_CHECK_PENDING, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL, 200, - NetworkState::PortalState::kPortal, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(200, NetworkState::PortalState::kPortal, + kStubWireless1)); } TEST_F(NetworkPortalDetectorImplTest, PortalDetectionTimeout) { - ASSERT_EQ(State::STATE_IDLE, state()); - // For instantaneous timeout. set_attempt_timeout(base::Seconds(0)); @@ -484,8 +452,6 @@ } TEST_F(NetworkPortalDetectorImplTest, PortalDetectionRetryAfter) { - ASSERT_EQ(State::STATE_IDLE, state()); - const int retry_delay = 101; std::string retry_response = GetRetryResponse(retry_delay); @@ -506,8 +472,6 @@ } TEST_F(NetworkPortalDetectorImplTest, PortalDetectionRetryAfterIsSmall) { - ASSERT_EQ(State::STATE_IDLE, state()); - const int retry_delay = 1; std::string retry_response = GetRetryResponse(retry_delay); @@ -527,7 +491,6 @@ } TEST_F(NetworkPortalDetectorImplTest, FirstAttemptFailed) { - ASSERT_EQ(State::STATE_IDLE, state()); ASSERT_EQ(0, captive_portal_detector_run_count()); base::HistogramTester histogram_tester; @@ -550,9 +513,8 @@ CompleteURLFetch(net::OK, /*status_code=*/204, /*content_length=*/0, nullptr); EXPECT_EQ(State::STATE_IDLE, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, - NetworkState::PortalState::kOnline, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(204, NetworkState::PortalState::kOnline, + kStubWireless1)); // Metric records the number of probes. histogram_tester.ExpectUniqueSample("Network.NetworkPortalDetectorRunCount", @@ -565,9 +527,8 @@ CompleteURLFetch(net::OK, /*status_code=*/204, /*content_length=*/0, nullptr); EXPECT_EQ(State::STATE_IDLE, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, - NetworkState::PortalState::kOnline, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(204, NetworkState::PortalState::kOnline, + kStubWireless1)); EXPECT_THAT( histogram_tester.GetAllSamples("Network.NetworkPortalDetectorRunCount"), @@ -575,7 +536,6 @@ } TEST_F(NetworkPortalDetectorImplTest, MultipleAttemptsFailed) { - ASSERT_EQ(State::STATE_IDLE, state()); ASSERT_EQ(0, captive_portal_detector_run_count()); base::HistogramTester histogram_tester; @@ -618,9 +578,8 @@ CompleteURLFetch(net::OK, /*status_code=*/204, /*content_length=*/0, nullptr); EXPECT_EQ(State::STATE_IDLE, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, - NetworkState::PortalState::kOnline, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(204, NetworkState::PortalState::kOnline, + kStubWireless1)); EXPECT_THAT( histogram_tester.GetAllSamples("Network.NetworkPortalDetectorRunCount"), @@ -628,7 +587,6 @@ } TEST_F(NetworkPortalDetectorImplTest, MultipleRetries) { - ASSERT_EQ(State::STATE_IDLE, state()); ASSERT_EQ(0, captive_portal_detector_run_count()); base::HistogramTester histogram_tester; @@ -669,9 +627,8 @@ EXPECT_EQ(State::STATE_CHECKING_FOR_PORTAL, state()); CompleteURLFetch(net::OK, /*status_code=*/204, /*content_length=*/0, nullptr); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, - NetworkState::PortalState::kOnline, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(204, NetworkState::PortalState::kOnline, + kStubWireless1)); EXPECT_THAT( histogram_tester.GetAllSamples("Network.NetworkPortalDetectorRunCount"), ElementsAre(base::Bucket(4, 1))); @@ -690,13 +647,11 @@ // To run CaptivePortalDetector::DetectCaptivePortal(). base::RunLoop().RunUntilIdle(); EXPECT_EQ(State::STATE_IDLE, state()); - EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, - NetworkState::PortalState::kOnline, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(204, NetworkState::PortalState::kOnline, + kStubWireless1)); } TEST_F(NetworkPortalDetectorImplTest, ProxyAuthRequired) { - ASSERT_EQ(State::STATE_IDLE, state()); set_attempt_delay(base::TimeDelta()); // Connect with a proxy to trigger Chrome portal detection. @@ -711,13 +666,11 @@ // To run CaptivePortalDetector::DetectCaptivePortal(). base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(CheckPortalState( - NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED, 407, - NetworkState::PortalState::kOnline, kStubWireless1)); + EXPECT_TRUE(CheckPortalState(407, NetworkState::PortalState::kOnline, + kStubWireless1)); } TEST_F(NetworkPortalDetectorImplTest, NoResponseDefaultToShillOnlineState) { - ASSERT_EQ(State::STATE_IDLE, state()); set_attempt_delay(base::TimeDelta()); // Connect with a proxy to trigger Chrome portal detection. @@ -733,20 +686,17 @@ base::RunLoop().RunUntilIdle(); EXPECT_TRUE( - CheckPortalState(NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, -1, - NetworkState::PortalState::kOnline, kStubWireless1)); + CheckPortalState(-1, NetworkState::PortalState::kOnline, kStubWireless1)); } TEST_F(NetworkPortalDetectorImplTest, DetectionTimeoutIsCancelled) { - ASSERT_EQ(State::STATE_IDLE, state()); set_attempt_delay(base::TimeDelta()); // Connect with a proxy to trigger Chrome portal detection. SetConnectedWithProxy(kStubWireless1); EXPECT_EQ(State::STATE_CHECKING_FOR_PORTAL, state()); EXPECT_TRUE(CheckPortalState( - NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, kStatusCodeUnset, - NetworkState::PortalState::kOnline, kStubWireless1)); + kStatusCodeUnset, NetworkState::PortalState::kOnline, kStubWireless1)); // Stop Chrome portal detection before it completes, the attempt should be // cancelled and the result 'unknown'. @@ -755,8 +705,7 @@ EXPECT_EQ(State::STATE_IDLE, state()); EXPECT_TRUE(attempt_timeout_is_cancelled()); EXPECT_TRUE(CheckPortalState( - NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN, kStatusCodeUnset, - NetworkState::PortalState::kOnline, kStubWireless1)); + kStatusCodeUnset, NetworkState::PortalState::kOnline, kStubWireless1)); } TEST_F(NetworkPortalDetectorImplTest, RequestCaptivePortalDetection) {
diff --git a/chrome/browser/ash/net/network_portal_detector_test_impl.cc b/chrome/browser/ash/net/network_portal_detector_test_impl.cc index 7358571a..f9b774d9 100644 --- a/chrome/browser/ash/net/network_portal_detector_test_impl.cc +++ b/chrome/browser/ash/net/network_portal_detector_test_impl.cc
@@ -31,31 +31,19 @@ void NetworkPortalDetectorTestImpl::SetDetectionResultsForTesting( const std::string& guid, - CaptivePortalStatus status, int response_code) { DVLOG(1) << "SetDetectionResultsForTesting: " << guid << " = " - << NetworkPortalDetector::CaptivePortalStatusString(status); - if (!guid.empty()) - portal_status_map_[guid] = status; + << response_code; } std::string NetworkPortalDetectorTestImpl::GetDefaultNetworkGuid() const { - if (!default_network_) + if (!default_network_) { return ""; + } return default_network_->guid(); } -NetworkPortalDetector::CaptivePortalStatus -NetworkPortalDetectorTestImpl::GetCaptivePortalStatus() { - if (!default_network_) - return CAPTIVE_PORTAL_STATUS_UNKNOWN; - auto it = portal_status_map_.find(default_network_->guid()); - if (it == portal_status_map_.end()) - return CAPTIVE_PORTAL_STATUS_UNKNOWN; - return it->second; -} - bool NetworkPortalDetectorTestImpl::IsEnabled() { return enabled_; }
diff --git a/chrome/browser/ash/net/network_portal_detector_test_impl.h b/chrome/browser/ash/net/network_portal_detector_test_impl.h index 6079c8e..47ddb988 100644 --- a/chrome/browser/ash/net/network_portal_detector_test_impl.h +++ b/chrome/browser/ash/net/network_portal_detector_test_impl.h
@@ -28,15 +28,15 @@ ~NetworkPortalDetectorTestImpl() override; void SetDefaultNetworkForTesting(const std::string& guid); + + // TODO(b/331264838): Remove. Response code is not used in any tests. void SetDetectionResultsForTesting(const std::string& guid, - CaptivePortalStatus status, int response_code); // Returns the GUID of the network the detector considers to be default. std::string GetDefaultNetworkGuid() const; // NetworkPortalDetector implementation: - CaptivePortalStatus GetCaptivePortalStatus() override; bool IsEnabled() override; void Enable() override; void RequestCaptivePortalDetection() override; @@ -48,7 +48,6 @@ private: bool enabled_ = false; std::unique_ptr<NetworkState> default_network_; - std::map<std::string, CaptivePortalStatus> portal_status_map_; int captive_portal_detection_requested_ = 0; };
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc index c5342c2..7aa74794 100644 --- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc +++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
@@ -27,6 +27,7 @@ #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/history/top_sites_factory.h" #include "chrome/browser/history_clusters/history_clusters_service_factory.h" +#include "chrome/browser/history_embeddings/history_embeddings_service_factory.h" #include "chrome/browser/prefs/incognito_mode_prefs.h" #include "chrome/browser/preloading/prefetch/search_prefetch/search_prefetch_service.h" #include "chrome/browser/preloading/prefetch/search_prefetch/search_prefetch_service_factory.h" @@ -185,6 +186,11 @@ return HistoryClustersServiceFactory::GetForBrowserContext(profile_); } +history_embeddings::HistoryEmbeddingsService* +ChromeAutocompleteProviderClient::GetHistoryEmbeddingsService() { + return HistoryEmbeddingsServiceFactory::GetForProfile(profile_); +} + scoped_refptr<history::TopSites> ChromeAutocompleteProviderClient::GetTopSites() { return TopSitesFactory::GetForProfile(profile_);
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h index 688e515..04dc66e 100644 --- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h +++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h
@@ -54,6 +54,8 @@ history::HistoryService* GetHistoryService() override; history_clusters::HistoryClustersService* GetHistoryClustersService() override; + history_embeddings::HistoryEmbeddingsService* GetHistoryEmbeddingsService() + override; scoped_refptr<history::TopSites> GetTopSites() override; bookmarks::CoreBookmarkModel* GetBookmarkModel() override; history::URLDatabase* GetInMemoryDatabase() override;
diff --git a/chrome/browser/autofill/BUILD.gn b/chrome/browser/autofill/BUILD.gn index d2e4d17..60acd69 100644 --- a/chrome/browser/autofill/BUILD.gn +++ b/chrome/browser/autofill/BUILD.gn
@@ -8,6 +8,8 @@ import("//components/optimization_guide/features.gni") import("//extensions/buildflags/buildflags.gni") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + static_library("autofill") { sources = [ "address_normalizer_factory.cc", @@ -147,7 +149,6 @@ "mock_manual_filling_view.h", ] deps += [ - "//chrome/android:test_support_jni_headers", "//chrome/browser", "//chrome/browser/autofill", "//chrome/browser/keyboard_accessory/test_utils/android", @@ -195,25 +196,17 @@ "autofill_flow_test_util.h", "autofill_uitest.cc", "autofill_uitest.h", + "captured_sites_test_utils.cc", + "captured_sites_test_utils.h", ] deps = [ "//chrome/browser/autofill", "//chrome/test:test_support", + "//chrome/test:test_support", "//chrome/test:test_support_ui", + "//components/javascript_dialogs", ] - - if (!is_fuchsia) { - sources += [ - "captured_sites_test_utils.cc", - "captured_sites_test_utils.h", - ] - - deps += [ - "//chrome/test:test_support", - "//components/javascript_dialogs", - ] - } } source_set("interactive_ui_tests") { @@ -270,7 +263,7 @@ } } -if (!is_android && !is_fuchsia) { +if (!is_android) { source_set("captured_sites_interactive_tests") { testonly = true
diff --git a/chrome/browser/autofill/form_structure_browsertest.cc b/chrome/browser/autofill/form_structure_browsertest.cc index 986bf50..b676068 100644 --- a/chrome/browser/autofill/form_structure_browsertest.cc +++ b/chrome/browser/autofill/form_structure_browsertest.cc
@@ -236,11 +236,7 @@ features::kAutofillConsiderPhoneNumberSeparatorsValidLabels, // TODO(crbug.com/40222716): Remove once launched. This feature is // disabled since it is not supported on iOS. - features::kAutofillAlwaysParsePlaceholders, - // TODO(crbug.com/1493145): Remove when/if launched. This feature changes - // default parsing behavior, so must be disabled to avoid - // fieldtrial_testing_config interference. - features::kAutofillEnableEmailHeuristicOnlyAddressForms}); + features::kAutofillAlwaysParsePlaceholders}); } FormStructureBrowserTest::~FormStructureBrowserTest() = default;
diff --git a/chrome/browser/breadcrumbs/BUILD.gn b/chrome/browser/breadcrumbs/BUILD.gn index 960cdc84..184b8cb 100644 --- a/chrome/browser/breadcrumbs/BUILD.gn +++ b/chrome/browser/breadcrumbs/BUILD.gn
@@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + source_set("breadcrumbs") { deps = [ "//base", @@ -36,14 +38,10 @@ "//testing/gtest", ] - sources = [ "breadcrumb_manager_tab_helper_unittest.cc" ] - - # Chrome on Fuchsia uses the system crash handler. - # TODO(crbug.com/40172607): Enable when the implementation is capable of - # including CrashKeys in reports. - if (!is_fuchsia) { - sources += [ "crash_reporter_breadcrumb_observer_unittest.cc" ] - } + sources = [ + "breadcrumb_manager_tab_helper_unittest.cc", + "crash_reporter_breadcrumb_observer_unittest.cc", + ] } if (!is_android) {
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 4cd78b0..adc67d91 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -5643,8 +5643,6 @@ profile->IsOffTheRecord(), profile->GetPrefs(), safe_browsing::hash_realtime_utils::GetCountryCode( g_browser_process->variations_service()), - safe_browsing::hash_realtime_utils::GetLatestCountryCode( - g_browser_process->variations_service()), /*log_usage_histograms=*/true); safe_browsing::AsyncCheckTracker* async_check_tracker = GetAsyncCheckTracker(wc_getter, is_enterprise_lookup_enabled,
diff --git a/chrome/browser/crash_upload_list/BUILD.gn b/chrome/browser/crash_upload_list/BUILD.gn index 93092a60..5b7df2b 100644 --- a/chrome/browser/crash_upload_list/BUILD.gn +++ b/chrome/browser/crash_upload_list/BUILD.gn
@@ -6,6 +6,8 @@ import("//extensions/buildflags/buildflags.gni") import("//testing/test.gni") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + static_library("crash_upload_list") { sources = [ "crash_upload_list.cc", @@ -26,15 +28,9 @@ ] } - if (is_fuchsia) { - sources += [ - "crash_upload_list_fuchsia.cc", - "crash_upload_list_fuchsia.h", - ] - } - deps = [ "//chrome/common:constants", + "//components/crash/core/app:app", "//components/crash/core/browser:browser", "//components/upload_list", ] @@ -43,10 +39,6 @@ deps += [ "//chrome/android:chrome_jni_headers" ] } - if (!is_fuchsia) { - deps += [ "//components/crash/core/app:app" ] - } - public_deps = [ "//base", "//third_party/abseil-cpp:absl",
diff --git a/chrome/browser/crash_upload_list/crash_upload_list_fuchsia.cc b/chrome/browser/crash_upload_list/crash_upload_list_fuchsia.cc deleted file mode 100644 index 8ee7374..0000000 --- a/chrome/browser/crash_upload_list/crash_upload_list_fuchsia.cc +++ /dev/null
@@ -1,30 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/crash_upload_list/crash_upload_list_fuchsia.h" - -#include "base/notreached.h" -#include "base/time/time.h" - -CrashUploadListFuchsia::CrashUploadListFuchsia() = default; - -CrashUploadListFuchsia::~CrashUploadListFuchsia() = default; - -std::vector<std::unique_ptr<UploadList::UploadInfo>> -CrashUploadListFuchsia::LoadUploadList() { - // TODO(crbug.com/1234373): Implement using the crash system component. - NOTIMPLEMENTED_LOG_ONCE(); - return {}; -} - -void CrashUploadListFuchsia::ClearUploadList(const base::Time& begin, - const base::Time& end) { - // TODO(crbug.com/1234373): Implement using the crash system component. - NOTIMPLEMENTED_LOG_ONCE(); -} - -void CrashUploadListFuchsia::RequestSingleUpload(const std::string& local_id) { - // TODO(crbug.com/1234373): Implement using the crash system component. - NOTIMPLEMENTED_LOG_ONCE(); -}
diff --git a/chrome/browser/crash_upload_list/crash_upload_list_fuchsia.h b/chrome/browser/crash_upload_list/crash_upload_list_fuchsia.h deleted file mode 100644 index 0b7c425..0000000 --- a/chrome/browser/crash_upload_list/crash_upload_list_fuchsia.h +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright 2016 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_CRASH_UPLOAD_LIST_CRASH_UPLOAD_LIST_FUCHSIA_H_ -#define CHROME_BROWSER_CRASH_UPLOAD_LIST_CRASH_UPLOAD_LIST_FUCHSIA_H_ - -#include "components/upload_list/upload_list.h" - -namespace base { -class Time; -} - -// An UploadList that retrieves the list of crash reports from the -// Fuchsia crash component. -class CrashUploadListFuchsia : public UploadList { - public: - CrashUploadListFuchsia(); - - protected: - ~CrashUploadListFuchsia() override; - - std::vector<std::unique_ptr<UploadList::UploadInfo>> LoadUploadList() - override; - void ClearUploadList(const base::Time& begin, const base::Time& end) override; - void RequestSingleUpload(const std::string& local_id) override; - - CrashUploadListFuchsia(const CrashUploadListFuchsia&) = delete; - CrashUploadListFuchsia& operator=(const CrashUploadListFuchsia&) = delete; -}; - -#endif // CHROME_BROWSER_CRASH_UPLOAD_LIST_CRASH_UPLOAD_LIST_FUCHSIA_H_
diff --git a/chrome/browser/devtools/BUILD.gn b/chrome/browser/devtools/BUILD.gn index f0c07ca..053199e 100644 --- a/chrome/browser/devtools/BUILD.gn +++ b/chrome/browser/devtools/BUILD.gn
@@ -117,6 +117,7 @@ "//chrome/browser/autofill:autofill", "//components/autofill/content/browser:browser", "//components/autofill/core/browser:browser", + "//components/enterprise/buildflags", "//components/paint_preview/buildflags:buildflags", "//components/variations/service:service", "//components/webapps/common:common",
diff --git a/chrome/browser/download/download_item_warning_data.cc b/chrome/browser/download/download_item_warning_data.cc index 557ea29..3e51b34 100644 --- a/chrome/browser/download/download_item_warning_data.cc +++ b/chrome/browser/download/download_item_warning_data.cc
@@ -2,11 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <functional> - #include "chrome/browser/download/download_item_warning_data.h" +#include <functional> + #include "base/metrics/histogram_functions.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_util.h" #include "components/download/public/common/download_item.h" using download::DownloadItem; @@ -353,3 +355,62 @@ action(action), action_latency_msec(action_latency_msec), is_terminal_action(is_terminal_action) {} + +std::string DownloadItemWarningData::WarningActionEvent::ToString() const { + std::string surface_string, action_string; + switch (surface) { + case WarningSurface::BUBBLE_MAINPAGE: + surface_string = "BUBBLE_MAINPAGE"; + break; + case WarningSurface::BUBBLE_SUBPAGE: + surface_string = "BUBBLE_SUBPAGE"; + break; + case WarningSurface::DOWNLOADS_PAGE: + surface_string = "DOWNLOADS_PAGE"; + break; + case WarningSurface::DOWNLOAD_PROMPT: + surface_string = "DOWNLOAD_PROMPT"; + break; + case WarningSurface::DOWNLOAD_NOTIFICATION: + surface_string = "DOWNLOAD_NOTIFICATION"; + break; + } + switch (action) { + case WarningAction::SHOWN: + action_string = "SHOWN"; + break; + case WarningAction::PROCEED: + action_string = "PROCEED"; + break; + case WarningAction::DISCARD: + action_string = "DISCARD"; + break; + case WarningAction::KEEP: + action_string = "KEEP"; + break; + case WarningAction::CLOSE: + action_string = "CLOSE"; + break; + case WarningAction::CANCEL: + action_string = "CANCEL"; + break; + case WarningAction::DISMISS: + action_string = "DISMISS"; + break; + case WarningAction::BACK: + action_string = "BACK"; + break; + case WarningAction::OPEN_SUBPAGE: + action_string = "OPEN_SUBPAGE"; + break; + case WarningAction::PROCEED_DEEP_SCAN: + action_string = "PROCEED_DEEP_SCAN"; + break; + case WarningAction::OPEN_LEARN_MORE_LINK: + action_string = "OPEN_LEARN_MORE_LINK"; + break; + } + return base::JoinString({surface_string, action_string, + base::NumberToString(action_latency_msec)}, + ":"); +}
diff --git a/chrome/browser/download/download_item_warning_data.h b/chrome/browser/download/download_item_warning_data.h index b06f382..5ae6114 100644 --- a/chrome/browser/download/download_item_warning_data.h +++ b/chrome/browser/download/download_item_warning_data.h
@@ -107,6 +107,10 @@ WarningAction action, int64_t action_latency_msec, bool is_terminal_action); + + // Serializes the surface, action, and action_latency_msec into a string + // in a colon-separated format such as "DOWNLOADS_PAGE:DISCARD:10000". + std::string ToString() const; }; // Enum representing the trigger of the scan request.
diff --git a/chrome/browser/download/download_item_warning_data_unittest.cc b/chrome/browser/download/download_item_warning_data_unittest.cc index f2b8303..654ccff 100644 --- a/chrome/browser/download/download_item_warning_data_unittest.cc +++ b/chrome/browser/download/download_item_warning_data_unittest.cc
@@ -207,3 +207,21 @@ WarningSurface::DOWNLOAD_NOTIFICATION); EXPECT_EQ(DownloadItemWarningData::WarningFirstShownTime(&download_), now); } + +TEST_F(DownloadItemWarningDataTest, EventToString) { + FastForwardAndAddEvent(base::Seconds(0), WarningSurface::BUBBLE_MAINPAGE, + WarningAction::SHOWN); + FastForwardAndAddEvent(base::Seconds(5), WarningSurface::BUBBLE_SUBPAGE, + WarningAction::CLOSE); + FastForwardAndAddEvent(base::Seconds(10), WarningSurface::DOWNLOAD_PROMPT, + WarningAction::CANCEL); + FastForwardAndAddEvent(base::Seconds(15), WarningSurface::DOWNLOADS_PAGE, + WarningAction::DISCARD); + + std::vector<WarningActionEvent> events = GetEvents(); + + // The initial SHOWN event is not included. + EXPECT_EQ(events[0].ToString(), "BUBBLE_SUBPAGE:CLOSE:5000"); + EXPECT_EQ(events[1].ToString(), "DOWNLOAD_PROMPT:CANCEL:15000"); + EXPECT_EQ(events[2].ToString(), "DOWNLOADS_PAGE:DISCARD:30000"); +}
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn index 9fafd4edb..7284176 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn
@@ -21,6 +21,7 @@ assert(enable_extensions) assert(enable_supervised_users) +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") static_library("extensions") { sources = [ @@ -1441,6 +1442,8 @@ testonly = true sources = [ + "api/messaging/native_messaging_test_util.cc", + "api/messaging/native_messaging_test_util.h", "api/passwords_private/test_passwords_private_delegate.cc", "api/passwords_private/test_passwords_private_delegate.h", "chrome_extension_test_notification_observer.cc", @@ -1498,14 +1501,6 @@ "//services/data_decoder/public/cpp:test_support", ] - if (!is_fuchsia) { - # Native Messaging is not available under Fuchsia. - sources += [ - "api/messaging/native_messaging_test_util.cc", - "api/messaging/native_messaging_test_util.h", - ] - } - if (is_chromeos) { sources += [ "api/document_scan/document_scan_test_utils.cc",
diff --git a/chrome/browser/extensions/api/context_menus/extension_context_menu_browsertest.cc b/chrome/browser/extensions/api/context_menus/extension_context_menu_browsertest.cc index af2b721..bad256edd 100644 --- a/chrome/browser/extensions/api/context_menus/extension_context_menu_browsertest.cc +++ b/chrome/browser/extensions/api/context_menus/extension_context_menu_browsertest.cc
@@ -6,6 +6,7 @@ #include <memory> #include <set> +#include <string_view> #include "base/functional/bind.h" #include "base/memory/raw_ptr.h" @@ -244,7 +245,7 @@ protected: const extensions::Extension* LoadContextMenuExtension( - base::StringPiece subdirectory) { + std::string_view subdirectory) { base::FilePath extension_dir = GetRootDir().AppendASCII(subdirectory); return LoadExtension(extension_dir); } @@ -252,14 +253,14 @@ // Helper to load an extension from context_menus/top_level/|subdirectory| in // the extensions test data dir. const extensions::Extension* LoadTopLevelContextMenuExtension( - base::StringPiece subdirectory) { + std::string_view subdirectory) { base::FilePath extension_dir = GetRootDir().AppendASCII("top_level").AppendASCII(subdirectory); return LoadExtension(extension_dir, {}); } const extensions::Extension* LoadContextMenuExtensionWithIncognitoFlags( - base::StringPiece subdirectory) { + std::string_view subdirectory) { base::FilePath extension_dir = GetRootDir().AppendASCII(subdirectory); return LoadExtension(extension_dir, {.allow_in_incognito = true}); } @@ -305,7 +306,7 @@ // Helper to load an extension from context_menus/|subdirectory| in the // extensions test data dir. const extensions::Extension* LoadContextMenuExtension( - base::StringPiece subdirectory) { + std::string_view subdirectory) { base::FilePath extension_dir = GetRootDir().AppendASCII(subdirectory); return LoadExtension(extension_dir); }
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc index 8e5a1c9..60768501 100644 --- a/chrome/browser/extensions/api/debugger/debugger_api.cc +++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -12,6 +12,7 @@ #include <memory> #include <optional> #include <set> +#include <string_view> #include <utility> #include "base/command_line.h" @@ -525,8 +526,7 @@ if (!EventRouter::Get(profile_)) return; - base::StringPiece message_str(reinterpret_cast<const char*>(message.data()), - message.size()); + std::string_view message_str = base::as_string_view(message); std::optional<base::Value> result = base::JSONReader::Read( message_str, base::JSON_REPLACE_INVALID_CHARACTERS); if (!result || !result->is_dict()) {
diff --git a/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc b/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc index 8e676ee..3970d78 100644 --- a/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc +++ b/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc
@@ -4,10 +4,11 @@ #include <stdint.h> +#include <string_view> + #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" -#include "base/strings/string_piece.h" #include "base/strings/stringprintf.h" #include "base/threading/thread_restrictions.h" #include "build/build_config.h" @@ -161,7 +162,7 @@ const BrowserActionApiTestWithContextType&) = delete; protected: - void RunUpdateTest(base::StringPiece path, bool expect_failure) { + void RunUpdateTest(std::string_view path, bool expect_failure) { ExtensionTestMessageListener ready_listener("ready", ReplyBehavior::kWillReply); ASSERT_TRUE(embedded_test_server()->Start()); @@ -201,7 +202,7 @@ action->GetBadgeBackgroundColor(ExtensionAction::kDefaultTabId)); } - void RunEnableTest(base::StringPiece path, bool start_enabled) { + void RunEnableTest(std::string_view path, bool start_enabled) { ExtensionTestMessageListener ready_listener("ready", ReplyBehavior::kWillReply); const Extension* extension =
diff --git a/chrome/browser/extensions/api/favicon/favicon_util_unittest.cc b/chrome/browser/extensions/api/favicon/favicon_util_unittest.cc index 503b2c4..1ee2cad0 100644 --- a/chrome/browser/extensions/api/favicon/favicon_util_unittest.cc +++ b/chrome/browser/extensions/api/favicon/favicon_util_unittest.cc
@@ -4,7 +4,8 @@ #include "chrome/browser/extensions/api/favicon/favicon_util.h" -#include "base/strings/string_piece.h" +#include <string_view> + #include "components/favicon_base/favicon_url_parser.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -14,7 +15,7 @@ TEST(FaviconUtilUnittest, Parse) { const struct { bool parse_should_succeed; - base::StringPiece url; + std::string_view url; } test_cases[] = { {false, "chrome-extension://id"}, {false, "chrome-extension://id/"},
diff --git a/chrome/browser/extensions/api/identity/gaia_remote_consent_flow_browsertest.cc b/chrome/browser/extensions/api/identity/gaia_remote_consent_flow_browsertest.cc index 8cb0f556..d3f5b8b 100644 --- a/chrome/browser/extensions/api/identity/gaia_remote_consent_flow_browsertest.cc +++ b/chrome/browser/extensions/api/identity/gaia_remote_consent_flow_browsertest.cc
@@ -63,11 +63,6 @@ mock_network_portal_detector_ = std::make_unique<ash::MockNetworkPortalDetector>(); - EXPECT_CALL(*mock_network_portal_detector_, GetCaptivePortalStatus()) - .Times(testing::AnyNumber()) - .WillRepeatedly( - testing::Return(ash::NetworkPortalDetector::CaptivePortalStatus:: - CAPTIVE_PORTAL_STATUS_ONLINE)); ash::network_portal_detector::InitializeForTesting( mock_network_portal_detector_.release()); #endif // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc index 639bfe2..13b5594 100644 --- a/chrome/browser/extensions/api/identity/identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/identity_apitest.cc
@@ -149,9 +149,7 @@ auto* portal_detector = new ash::NetworkPortalDetectorTestImpl(); portal_detector->SetDefaultNetworkForTesting(default_network->guid()); - portal_detector->SetDetectionResultsForTesting( - default_network->guid(), - ash::NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204); + portal_detector->SetDetectionResultsForTesting(default_network->guid(), 204); ash::network_portal_detector::InitializeForTesting(portal_detector); }
diff --git a/chrome/browser/extensions/api/idltest/idltest_api.cc b/chrome/browser/extensions/api/idltest/idltest_api.cc index 3a3f57d..dbe1c726 100644 --- a/chrome/browser/extensions/api/idltest/idltest_api.cc +++ b/chrome/browser/extensions/api/idltest/idltest_api.cc
@@ -7,10 +7,10 @@ #include <stddef.h> #include <memory> +#include <string_view> #include <utility> #include "base/containers/span.h" -#include "base/strings/string_piece.h" #include "base/values.h" namespace { @@ -43,7 +43,7 @@ } ExtensionFunction::ResponseAction IdltestGetArrayBufferFunction::Run() { - static constexpr base::StringPiece kHello = "hello world"; + static constexpr std::string_view kHello = "hello world"; return RespondNow( WithArguments(base::Value(base::as_bytes(base::make_span(kHello))))); }
diff --git a/chrome/browser/extensions/api/image_writer_private/operation.cc b/chrome/browser/extensions/api/image_writer_private/operation.cc index f43363b..2e91ccfe 100644 --- a/chrome/browser/extensions/api/image_writer_private/operation.cc +++ b/chrome/browser/extensions/api/image_writer_private/operation.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/extensions/api/image_writer_private/operation.h" +#include <string_view> #include <utility> #include "base/files/file_util.h" @@ -313,7 +314,7 @@ if (len == read_size) { // Process data. - base::MD5Update(&md5_context_, base::StringPiece(buffer.get(), len)); + base::MD5Update(&md5_context_, std::string_view(buffer.get(), len)); int percent_curr = ((bytes_processed + len) * progress_scale) / bytes_total + progress_offset;
diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.cc b/chrome/browser/extensions/api/omnibox/omnibox_api.cc index 0c5017f..abfa0c1d 100644 --- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc +++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
@@ -9,6 +9,7 @@ #include <memory> #include <optional> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -284,7 +285,7 @@ EXTENSION_FUNCTION_VALIDATE(params_); if (is_from_service_worker() && !params_->suggest_results.empty()) { - std::vector<base::StringPiece> inputs; + std::vector<std::string_view> inputs; inputs.reserve(params_->suggest_results.size()); for (const auto& suggestion : params_->suggest_results) inputs.push_back(suggestion.description);
diff --git a/chrome/browser/extensions/api/omnibox/suggestion_parser.cc b/chrome/browser/extensions/api/omnibox/suggestion_parser.cc index 71b9623..37bbf48 100644 --- a/chrome/browser/extensions/api/omnibox/suggestion_parser.cc +++ b/chrome/browser/extensions/api/omnibox/suggestion_parser.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/extensions/api/omnibox/suggestion_parser.h" +#include <string_view> + #include "base/functional/callback.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" @@ -179,7 +181,7 @@ // A helper method for ParseDescriptionsAndStyles(). `contains_multiple_entries` // indicates whether `xml_input` contains a single suggestion or multiple // suggestions that have been wrapped in individual XML elements. -void ParseDescriptionAndStylesImpl(base::StringPiece xml_input, +void ParseDescriptionAndStylesImpl(std::string_view xml_input, bool contains_multiple_entries, DescriptionAndStylesCallback callback) { std::string wrapped_xml = @@ -206,14 +208,14 @@ DescriptionAndStylesResult&&) = default; DescriptionAndStylesResult::~DescriptionAndStylesResult() = default; -void ParseDescriptionAndStyles(base::StringPiece str, +void ParseDescriptionAndStyles(std::string_view str, DescriptionAndStylesCallback callback) { constexpr bool kContainsMultipleEntries = false; ParseDescriptionAndStylesImpl(str, kContainsMultipleEntries, std::move(callback)); } -void ParseDescriptionsAndStyles(const std::vector<base::StringPiece>& strs, +void ParseDescriptionsAndStyles(const std::vector<std::string_view>& strs, DescriptionAndStylesCallback callback) { // When passed multiple suggestions, we synthesize them into a single XML // document. This allows us to parse all of them with a single call to the
diff --git a/chrome/browser/extensions/api/omnibox/suggestion_parser.h b/chrome/browser/extensions/api/omnibox/suggestion_parser.h index f258502..0f46120c 100644 --- a/chrome/browser/extensions/api/omnibox/suggestion_parser.h +++ b/chrome/browser/extensions/api/omnibox/suggestion_parser.h
@@ -7,6 +7,7 @@ #include <memory> #include <string> +#include <string_view> #include <vector> #include "base/functional/callback_forward.h" @@ -56,10 +57,10 @@ // potentially contains XML markup (e.g., the string may be // "visit <url>https://example.com</url>"). This parses the string in an // isolated process and asynchronously returns the parse result via `callback`. -void ParseDescriptionAndStyles(base::StringPiece str, +void ParseDescriptionAndStyles(std::string_view str, DescriptionAndStylesCallback callback); // Same as above, but takes in multiple string inputs. -void ParseDescriptionsAndStyles(const std::vector<base::StringPiece>& strs, +void ParseDescriptionsAndStyles(const std::vector<std::string_view>& strs, DescriptionAndStylesCallback callback); } // namespace extensions
diff --git a/chrome/browser/extensions/api/omnibox/suggestion_parser_unittest.cc b/chrome/browser/extensions/api/omnibox/suggestion_parser_unittest.cc index 11b2844..4bbe7c8 100644 --- a/chrome/browser/extensions/api/omnibox/suggestion_parser_unittest.cc +++ b/chrome/browser/extensions/api/omnibox/suggestion_parser_unittest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/extensions/api/omnibox/suggestion_parser.h" #include <memory> +#include <string_view> #include "base/run_loop.h" #include "base/test/bind.h" @@ -48,7 +49,7 @@ // A helper method to synchronously parses `str` as input and return the // result. - DescriptionAndStyles ParseSingleInput(base::StringPiece str) { + DescriptionAndStyles ParseSingleInput(std::string_view str) { DescriptionAndStylesResult result; ParseImpl({str}, &result); if (result.descriptions_and_styles.size() != 1) { @@ -61,7 +62,7 @@ } // Same as above, accepting multiple string inputs. std::vector<DescriptionAndStyles> ParseInputs( - const std::vector<base::StringPiece>& strs) { + const std::vector<std::string_view>& strs) { DescriptionAndStylesResult result; ParseImpl(strs, &result); EXPECT_EQ(std::string(), result.error); @@ -69,14 +70,14 @@ } // Returns the parsing error from attempting to parse `strs`. - std::string GetParseError(const std::vector<base::StringPiece>& strs) { + std::string GetParseError(const std::vector<std::string_view>& strs) { DescriptionAndStylesResult result; ParseImpl(strs, &result); return result.error; } private: - void ParseImpl(const std::vector<base::StringPiece>& strs, + void ParseImpl(const std::vector<std::string_view>& strs, DescriptionAndStylesResult* result_out) { base::test::TestFuture<DescriptionAndStylesResult> parse_future; if (strs.size() == 1) {
diff --git a/chrome/browser/extensions/api/permissions/permissions_api_helpers.cc b/chrome/browser/extensions/api/permissions/permissions_api_helpers.cc index d200ead..c98933d 100644 --- a/chrome/browser/extensions/api/permissions/permissions_api_helpers.cc +++ b/chrome/browser/extensions/api/permissions/permissions_api_helpers.cc
@@ -7,6 +7,7 @@ #include <stddef.h> #include <memory> +#include <string_view> #include "base/json/json_reader.h" #include "base/json/json_writer.h" @@ -42,8 +43,8 @@ // Extracts an API permission that supports arguments. In practice, this is // restricted to the UsbDevicePermission. std::unique_ptr<APIPermission> UnpackPermissionWithArguments( - base::StringPiece permission_name, - base::StringPiece permission_arg, + std::string_view permission_name, + std::string_view permission_arg, const std::string& permission_str, std::string* error) { std::optional<base::Value> permission_json = @@ -95,7 +96,7 @@ // http://code.google.com/p/chromium/issues/detail?id=162042 size_t delimiter = permission_str.find(kDelimiter); if (delimiter != std::string::npos) { - base::StringPiece permission_piece(permission_str); + std::string_view permission_piece(permission_str); std::unique_ptr<APIPermission> permission = UnpackPermissionWithArguments( permission_piece.substr(0, delimiter), permission_piece.substr(delimiter + 1), permission_str, error);
diff --git a/chrome/browser/extensions/api/runtime/runtime_apitest.cc b/chrome/browser/extensions/api/runtime/runtime_apitest.cc index a87a3a4..c57c1c54 100644 --- a/chrome/browser/extensions/api/runtime/runtime_apitest.cc +++ b/chrome/browser/extensions/api/runtime/runtime_apitest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <memory> +#include <string_view> #include "base/json/json_reader.h" #include "base/memory/raw_ptr.h" @@ -669,7 +670,7 @@ // Runs `chrome.runtime.getContexts()` and returns the result as a // base::Value. - base::Value GetContexts(base::StringPiece filter) { + base::Value GetContexts(std::string_view filter) { static constexpr char kScriptTemplate[] = R"((async () => { chrome.test.sendScriptResult( @@ -685,7 +686,7 @@ // of strongly-typed `ExtensionContext`s. Expects the getContexts() call to // return a valid value (i.e., not throw an error). std::vector<api::runtime::ExtensionContext> GetContextStructs( - base::StringPiece filter) { + std::string_view filter) { base::Value value = GetContexts(filter); return ContextValueToContextStructs(value); }
diff --git a/chrome/browser/extensions/api/runtime/runtime_interactive_apitest.cc b/chrome/browser/extensions/api/runtime/runtime_interactive_apitest.cc index fc24c0a..be08998 100644 --- a/chrome/browser/extensions/api/runtime/runtime_interactive_apitest.cc +++ b/chrome/browser/extensions/api/runtime/runtime_interactive_apitest.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string_view> + #include "base/test/values_test_util.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/extensions/extension_tab_util.h" @@ -32,8 +34,7 @@ // Runs `chrome.runtime.getContexts()` and returns the result as a // base::Value. - base::Value GetContexts(const Extension& extension, - base::StringPiece filter) { + base::Value GetContexts(const Extension& extension, std::string_view filter) { static constexpr char kScriptTemplate[] = R"((async () => { chrome.test.sendScriptResult(
diff --git a/chrome/browser/extensions/api/search/search_api_unittest.cc b/chrome/browser/extensions/api/search/search_api_unittest.cc index 8cc9dcf..7932a1d 100644 --- a/chrome/browser/extensions/api/search/search_api_unittest.cc +++ b/chrome/browser/extensions/api/search/search_api_unittest.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/extensions/api/search/search_api.h" +#include <string_view> + #include "base/memory/scoped_refptr.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/extension_service_test_base.h" @@ -63,7 +65,7 @@ TabStripModel* GetTabStripModel() { return browser_->tab_strip_model(); } extensions::SearchQueryFunction* function() { return function_.get(); } void RunFunctionAndExpectError(const std::string& input, - const base::StringPiece expected); + const std::string_view expected); private: void SetUp() override; @@ -110,7 +112,7 @@ void SearchApiUnitTest::RunFunctionAndExpectError( const std::string& input, - const base::StringPiece expected) { + const std::string_view expected) { auto result = api_test_utils::RunFunctionAndReturnError(function(), input, browser()->profile()); EXPECT_EQ(expected, result);
diff --git a/chrome/browser/extensions/back_forward_cache_browsertest.cc b/chrome/browser/extensions/back_forward_cache_browsertest.cc index 29ce437..ae533d5 100644 --- a/chrome/browser/extensions/back_forward_cache_browsertest.cc +++ b/chrome/browser/extensions/back_forward_cache_browsertest.cc
@@ -2,7 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "content/public/browser/back_forward_cache.h" + #include <string> +#include <string_view> #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" @@ -14,7 +17,6 @@ #include "chrome/test/base/ui_test_utils.h" #include "components/back_forward_cache/back_forward_cache_disable.h" #include "components/ukm/test_ukm_recorder.h" -#include "content/public/browser/back_forward_cache.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_features.h" @@ -1199,7 +1201,7 @@ // Enable extension sync, otherwise the new source url entry will be // dropped. test_ukm_recorder_->SetIsWebstoreExtensionCallback( - base::BindRepeating([](base::StringPiece) { return true; })); + base::BindRepeating([](std::string_view) { return true; })); } protected:
diff --git a/chrome/browser/extensions/cache_wasm_extension_browsertest.cc b/chrome/browser/extensions/cache_wasm_extension_browsertest.cc index e4565006..d0cf7da 100644 --- a/chrome/browser/extensions/cache_wasm_extension_browsertest.cc +++ b/chrome/browser/extensions/cache_wasm_extension_browsertest.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string_view> + #include "base/base_paths.h" #include "base/files/file_util.h" #include "base/path_service.h" @@ -24,7 +26,7 @@ WasmExtensionCachingBrowserTest() = default; ~WasmExtensionCachingBrowserTest() override = default; - static constexpr base::StringPiece kHistogram = "V8.WasmCodeCaching"; + static constexpr std::string_view kHistogram = "V8.WasmCodeCaching"; // The enum values need to match "WasmCodeCaching" in // tools/metrics/histograms/metadata/v8/enums.xml. @@ -70,7 +72,7 @@ // Fetch the `bucket` from the `histogram` in every renderer process until // reaching, but not exceeding, `expected_samples`. - void WaitForHistogramSamples(base::StringPiece histogram, + void WaitForHistogramSamples(std::string_view histogram, int expected_samples) { // We sleep for an increasing amount of time for the background task to // finish.
diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc index ba9775d88a..d401778 100644 --- a/chrome/browser/extensions/component_loader.cc +++ b/chrome/browser/extensions/component_loader.cc
@@ -6,6 +6,7 @@ #include <optional> #include <string> +#include <string_view> #include "base/command_line.h" #include "base/feature_list.h" @@ -217,7 +218,7 @@ } std::optional<base::Value::Dict> ComponentLoader::ParseManifest( - base::StringPiece manifest_contents) const { + std::string_view manifest_contents) const { JSONStringValueDeserializer deserializer(manifest_contents); std::unique_ptr<base::Value> manifest = deserializer.Deserialize(nullptr, nullptr); @@ -237,7 +238,7 @@ return std::string(); } - base::StringPiece manifest_contents = + std::string_view manifest_contents = ui::ResourceBundle::GetSharedInstance().GetRawDataResource( manifest_resource_id); return Add(manifest_contents, root_directory, true); @@ -248,12 +249,12 @@ return Add(std::move(manifest), root_directory, false); } -ExtensionId ComponentLoader::Add(const base::StringPiece& manifest_contents, +ExtensionId ComponentLoader::Add(std::string_view manifest_contents, const base::FilePath& root_directory) { return Add(manifest_contents, root_directory, false); } -ExtensionId ComponentLoader::Add(const base::StringPiece& manifest_contents, +ExtensionId ComponentLoader::Add(std::string_view manifest_contents, const base::FilePath& root_directory, bool skip_allowlist) { // The Value is kept for the lifetime of the ComponentLoader. This is @@ -388,7 +389,7 @@ return; } - base::StringPiece manifest_contents = + std::string_view manifest_contents = ui::ResourceBundle::GetSharedInstance().GetRawDataResource( manifest_resource_id);
diff --git a/chrome/browser/extensions/component_loader.h b/chrome/browser/extensions/component_loader.h index 7767305..d24e5b1f 100644 --- a/chrome/browser/extensions/component_loader.h +++ b/chrome/browser/extensions/component_loader.h
@@ -9,6 +9,7 @@ #include <optional> #include <string> +#include <string_view> #include <vector> #include "base/files/file_path.h" @@ -59,7 +60,7 @@ // // ssh-keygen -t rsa -b 1024 -N '' -f /tmp/key.pem // openssl rsa -pubout -outform DER < /tmp/key.pem 2>/dev/null | base64 -w 0 - ExtensionId Add(const base::StringPiece& manifest_contents, + ExtensionId Add(std::string_view manifest_contents, const base::FilePath& root_directory); // Convenience method for registering a component extension by resource id. @@ -175,9 +176,9 @@ // Parses the given JSON manifest. Returns `std::nullopt` if it cannot be // parsed or if the result is not a base::Value::Dict. std::optional<base::Value::Dict> ParseManifest( - base::StringPiece manifest_contents) const; + std::string_view manifest_contents) const; - ExtensionId Add(const base::StringPiece& manifest_contents, + ExtensionId Add(std::string_view manifest_contents, const base::FilePath& root_directory, bool skip_allowlist); ExtensionId Add(base::Value::Dict parsed_manifest,
diff --git a/chrome/browser/extensions/content_capabilities_browsertest.cc b/chrome/browser/extensions/content_capabilities_browsertest.cc index 3c671ed..2058525b 100644 --- a/chrome/browser/extensions/content_capabilities_browsertest.cc +++ b/chrome/browser/extensions/content_capabilities_browsertest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <string> +#include <string_view> #include <vector> #include "base/command_line.h" @@ -10,7 +11,6 @@ #include "base/files/file_util.h" #include "base/path_service.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "chrome/browser/extensions/extension_apitest.h" @@ -82,7 +82,7 @@ std::string MakeJSONList(const std::string& s0 = "", const std::string& s1 = "", const std::string& s2 = "") { - std::vector<base::StringPiece> v; + std::vector<std::string_view> v; if (!s0.empty()) v.push_back(s0); if (!s1.empty())
diff --git a/chrome/browser/extensions/cws_info_service.cc b/chrome/browser/extensions/cws_info_service.cc index 3c61fdb..3cb4380d 100644 --- a/chrome/browser/extensions/cws_info_service.cc +++ b/chrome/browser/extensions/cws_info_service.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/extensions/cws_info_service.h" +#include <string_view> + #include "base/containers/contains.h" #include "base/containers/fixed_flat_map.h" #include "base/containers/queue.h" @@ -550,7 +552,7 @@ CWSInfoService::CWSViolationType CWSInfoService::GetViolationTypeFromString( const std::string& violation_type_str) { static constexpr auto violation_type_str_map = - base::MakeFixedFlatMap<base::StringPiece, + base::MakeFixedFlatMap<std::string_view, CWSInfoService::CWSViolationType>( {{"none", CWSInfoService::CWSViolationType::kNone}, {"malware", CWSInfoService::CWSViolationType::kMalware},
diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc index c28d637..a2d02c17 100644 --- a/chrome/browser/extensions/extension_apitest.cc +++ b/chrome/browser/extensions/extension_apitest.cc
@@ -7,6 +7,7 @@ #include <stddef.h> #include <memory> +#include <string_view> #include <utility> #include "base/base_switches.h" @@ -278,7 +279,7 @@ return true; } -void ExtensionApiTest::SetCustomArg(base::StringPiece custom_arg) { +void ExtensionApiTest::SetCustomArg(std::string_view custom_arg) { test_config_->Set(kTestCustomArg, base::Value(custom_arg)); }
diff --git a/chrome/browser/extensions/extension_apitest.h b/chrome/browser/extensions/extension_apitest.h index 16ac7eb8..4304af4 100644 --- a/chrome/browser/extensions/extension_apitest.h +++ b/chrome/browser/extensions/extension_apitest.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ #include <string> +#include <string_view> -#include "base/strings/string_piece.h" #include "base/values.h" #include "chrome/browser/extensions/extension_browsertest.h" #include "net/test/spawned_test_server/spawned_test_server.h" @@ -116,7 +116,7 @@ // Sets the additional string argument |customArg| to the test config object, // which is available to javascript tests using chrome.test.getConfig(). - void SetCustomArg(base::StringPiece custom_arg); + void SetCustomArg(std::string_view custom_arg); // Test that exactly one extension loaded. If so, return a pointer to // the extension. If not, return NULL and set message_.
diff --git a/chrome/browser/extensions/extension_keeplist_ash_browsertest.cc b/chrome/browser/extensions/extension_keeplist_ash_browsertest.cc index d816173..e275027 100644 --- a/chrome/browser/extensions/extension_keeplist_ash_browsertest.cc +++ b/chrome/browser/extensions/extension_keeplist_ash_browsertest.cc
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string_view> #include <vector> #include "ash/constants/ash_switches.h" #include "base/containers/contains.h" -#include "base/strings/string_piece.h" #include "base/test/test_future.h" #include "chrome/browser/ash/crosapi/ash_requires_lacros_extension_apitest.h" #include "chrome/browser/extensions/extension_keeplist_chromeos.h" @@ -19,7 +19,7 @@ namespace { -bool IsIdenticalList(base::span<const base::StringPiece> keep_list_from_ash, +bool IsIdenticalList(base::span<const std::string_view> keep_list_from_ash, const std::vector<std::string>& keep_list_from_lacros) { if (keep_list_from_ash.size() != keep_list_from_lacros.size()) return false;
diff --git a/chrome/browser/extensions/extension_keeplist_chromeos.cc b/chrome/browser/extensions/extension_keeplist_chromeos.cc index 019cb32..653eedb 100644 --- a/chrome/browser/extensions/extension_keeplist_chromeos.cc +++ b/chrome/browser/extensions/extension_keeplist_chromeos.cc
@@ -5,13 +5,14 @@ #include "chrome/browser/extensions/extension_keeplist_chromeos.h" #include <stddef.h> + +#include <string_view> #include <vector> #include "base/command_line.h" #include "base/containers/contains.h" #include "base/containers/span.h" #include "base/no_destructor.h" -#include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "build/chromeos_buildflags.h" #include "chrome/common/buildflags.h" @@ -40,7 +41,7 @@ // can be passed by ash commandline switches, but this is ONLY allowed // for testing use. std::vector<std::string> GetIdsFromCmdlineSwitch( - const base::StringPiece ash_switch) { + const std::string_view ash_switch) { std::vector<std::string> ids; if (base::CommandLine::ForCurrentProcess()->HasSwitch(ash_switch)) { ids = base::SplitString( @@ -54,15 +55,15 @@ // For any extension running in both Ash and Lacros, if it needs to be published // in app service, it must be added to one of app service block lists (Ash or // Lacros), so that it won't be published by both. -base::span<const base::StringPiece> +base::span<const std::string_view> ExtensionsRunInOSAndStandaloneBrowserAllowlist() { - static const base::StringPiece kKeeplist[] = { + static const std::string_view kKeeplist[] = { extension_misc::kGnubbyV3ExtensionId, extension_misc::kPdfExtensionId, }; - static const base::NoDestructor<std::vector<base::StringPiece>> keep_list([] { - std::vector<base::StringPiece> ids; + static const base::NoDestructor<std::vector<std::string_view>> keep_list([] { + std::vector<std::string_view> ids; for (const auto& id : kKeeplist) { ids.push_back(id); } @@ -77,17 +78,17 @@ // For any extension apps running in both Ash and Lacros, it must be added to // one of app service block lists (Ash or Lacros), so that it won't be published // by both. -base::span<const base::StringPiece> +base::span<const std::string_view> ExtensionAppsRunInOSAndStandaloneBrowserAllowlist() { - static const base::StringPiece kKeeplist[] = { + static const std::string_view kKeeplist[] = { extension_misc::kGnubbyAppId, }; return base::make_span(kKeeplist); } -base::span<const base::StringPiece> ExtensionsRunInOSOnlyAllowlist() { - static const base::StringPiece kKeeplist[] = { +base::span<const std::string_view> ExtensionsRunInOSOnlyAllowlist() { + static const std::string_view kKeeplist[] = { extension_misc::kAccessibilityCommonExtensionId, extension_misc::kEnhancedNetworkTtsExtensionId, extension_misc::kEspeakSpeechSynthesisExtensionId, @@ -106,8 +107,8 @@ return base::make_span(kKeeplist); } -base::span<const base::StringPiece> ExtensionAppsRunInOSOnlyAllowlist() { - static const base::StringPiece kKeeplist[] = { +base::span<const std::string_view> ExtensionAppsRunInOSOnlyAllowlist() { + static const std::string_view kKeeplist[] = { arc::kPlayStoreAppId, extension_misc::kFilesManagerAppId, }; @@ -119,12 +120,12 @@ // The app on the block list can run in Ash but can't be published to app // service by Ash. For an app running in both Ash and Lacros, if it should be // published by Lacros, it must be blocked in Ash. -base::span<const base::StringPiece> ExtensionAppsAppServiceBlocklistInOS() { +base::span<const std::string_view> ExtensionAppsAppServiceBlocklistInOS() { // Note: gnubbyd chrome app is running in both Ash and Lacros, but only the // app running in Lacros should be published in app service so that it can be // launched by users, the one running in Ash is blocked from app service and // is invisible to users. - static const base::StringPiece kBlocklist[] = { + static const std::string_view kBlocklist[] = { extension_misc::kGnubbyAppId, }; @@ -135,9 +136,9 @@ // The extension on the block list can run in Ash but can't be published to app // service by Ash. For an extension running in both Ash and Lacros, if it should // be published by Lacros, it must be blocked in Ash. -const std::vector<base::StringPiece>& ExtensionsAppServiceBlocklistInOS() { +const std::vector<std::string_view>& ExtensionsAppServiceBlocklistInOS() { // Note: Add extensions to be blocked if there are any in the future. - static const base::NoDestructor<std::vector<base::StringPiece>> block_list; + static const base::NoDestructor<std::vector<std::string_view>> block_list; return *block_list; } @@ -145,10 +146,10 @@ // The app on the block list can run in Lacros but can't be published to app // service by Lacros. For an app running in both Ash and Lacros, if it should be // published by Ash, it must be blocked in Lacros. -const std::vector<base::StringPiece>& +const std::vector<std::string_view>& ExtensionAppsAppServiceBlocklistInStandaloneBrowser() { // Note: Add extension apps to be blocked if there are any in the future. - static const base::NoDestructor<std::vector<base::StringPiece>> block_list; + static const base::NoDestructor<std::vector<std::string_view>> block_list; return *block_list; } @@ -156,10 +157,10 @@ // The extension on the block list can run in Lacros but can't be published to // app service by Lacros. For an extension running in both Ash and Lacros, if it // should be published by Ash, it must be blocked in Lacros. -const std::vector<base::StringPiece>& +const std::vector<std::string_view>& ExtensionsAppServiceBlocklistInStandaloneBrowser() { // Note: Add extensions to be blocked if there are any in the future. - static const base::NoDestructor<std::vector<base::StringPiece>> block_list; + static const base::NoDestructor<std::vector<std::string_view>> block_list; return *block_list; } @@ -174,14 +175,14 @@ // crosapi::mojom:::BrowserInitParams. bool g_set_empty_ash_keeplist_for_test = false; -const std::vector<base::StringPiece>& +const std::vector<std::string_view>& ExtensionsRunInOSAndStandaloneBrowserFromBrowserInitParams() { // Cache the ash extension keeplist data (passed from Ash to Lacros) provided // by chromeos::BrowserParamsProxy. chromeos::BrowserParamsProxy::Get() // accesses a static object constructed with base::NoDestructor, which is // guaranteed not to be destroyed when it is accessed. - static const base::NoDestructor<std::vector<base::StringPiece>> keep_list([] { - std::vector<base::StringPiece> ids; + static const base::NoDestructor<std::vector<std::string_view>> keep_list([] { + std::vector<std::string_view> ids; auto& ash_keep_list_param = chromeos::BrowserParamsProxy::Get()->ExtensionKeepList(); CHECK(!ash_keep_list_param.is_null()); @@ -194,14 +195,14 @@ return *keep_list; } -const std::vector<base::StringPiece>& +const std::vector<std::string_view>& ExtensionAppsRunInOSAndStandaloneBrowserFromBrowserInitParams() { // Cache the ash extension keeplist data (passed from Ash to Lacros) provided // by chromeos::BrowserParamsProxy. chromeos::BrowserParamsProxy::Get() // accesses a static object constructed with base::NoDestructor, which is // guaranteed not to be destroyed when it is accessed. - static const base::NoDestructor<std::vector<base::StringPiece>> keep_list([] { - std::vector<base::StringPiece> ids; + static const base::NoDestructor<std::vector<std::string_view>> keep_list([] { + std::vector<std::string_view> ids; auto& ash_keep_list_param = chromeos::BrowserParamsProxy::Get()->ExtensionKeepList(); CHECK(!ash_keep_list_param.is_null()); @@ -214,14 +215,14 @@ return *keep_list; } -const std::vector<base::StringPiece>& +const std::vector<std::string_view>& ExtensionsRunInOSOnlyFromBrowserInitParams() { // Cache the ash extension keeplist data (passed from Ash to Lacros) provided // by chromeos::BrowserParamsProxy. chromeos::BrowserParamsProxy::Get() // accesses a static object constructed with base::NoDestructor, which is // guaranteed not to be destroyed when it is accessed. - static const base::NoDestructor<std::vector<base::StringPiece>> keep_list([] { - std::vector<base::StringPiece> ids; + static const base::NoDestructor<std::vector<std::string_view>> keep_list([] { + std::vector<std::string_view> ids; auto& ash_keep_list_param = chromeos::BrowserParamsProxy::Get()->ExtensionKeepList(); CHECK(!ash_keep_list_param.is_null()); @@ -233,14 +234,14 @@ return *keep_list; } -const std::vector<base::StringPiece>& +const std::vector<std::string_view>& ExtensionAppsRunInOSOnlyFromBrowserInitParams() { // Cache the ash extension keeplist data (passed from Ash to Lacros) provided // by chromeos::BrowserParamsProxy. chromeos::BrowserParamsProxy::Get() // accesses a static object constructed with base::NoDestructor, which is // guaranteed not to be destroyed when it is accessed. - static const base::NoDestructor<std::vector<base::StringPiece>> keep_list([] { - std::vector<base::StringPiece> ids; + static const base::NoDestructor<std::vector<std::string_view>> keep_list([] { + std::vector<std::string_view> ids; auto& ash_keep_list_param = chromeos::BrowserParamsProxy::Get()->ExtensionKeepList(); CHECK(!ash_keep_list_param.is_null()); @@ -252,10 +253,10 @@ return *keep_list; } -base::span<const base::StringPiece> +base::span<const std::string_view> GetExtensionsRunInOSAndStandaloneBrowserLacros() { if (g_set_empty_ash_keeplist_for_test) { - return base::span<const base::StringPiece>(); + return base::span<const std::string_view>(); } return base::make_span( @@ -263,10 +264,10 @@ ExtensionsRunInOSAndStandaloneBrowserFromBrowserInitParams().size()); } -base::span<const base::StringPiece> +base::span<const std::string_view> GetExtensionAppsRunInOSAndStandaloneBrowserLacros() { if (g_set_empty_ash_keeplist_for_test) { - return base::span<const base::StringPiece>(); + return base::span<const std::string_view>(); } return base::make_span( @@ -274,16 +275,16 @@ ExtensionAppsRunInOSAndStandaloneBrowserFromBrowserInitParams().size()); } -base::span<const base::StringPiece> GetExtensionsRunInOSOnlyLacros() { +base::span<const std::string_view> GetExtensionsRunInOSOnlyLacros() { if (g_set_empty_ash_keeplist_for_test) { - return base::span<const base::StringPiece>(); + return base::span<const std::string_view>(); } return ExtensionsRunInOSOnlyFromBrowserInitParams(); } -base::span<const base::StringPiece> GetExtensionAppsRunInOSOnlyLacros() { +base::span<const std::string_view> GetExtensionAppsRunInOSOnlyLacros() { if (g_set_empty_ash_keeplist_for_test) { - return base::span<const base::StringPiece>(); + return base::span<const std::string_view>(); } return ExtensionAppsRunInOSOnlyFromBrowserInitParams(); } @@ -355,7 +356,7 @@ } #endif // BUILDFLAG(IS_CHROMEOS_ASH) -base::span<const base::StringPiece> +base::span<const std::string_view> GetExtensionAppsRunInOSAndStandaloneBrowser() { #if BUILDFLAG(IS_CHROMEOS_ASH) return ExtensionAppsRunInOSAndStandaloneBrowserAllowlist(); @@ -364,7 +365,7 @@ #endif } -base::span<const base::StringPiece> GetExtensionAppsRunInOSOnly() { +base::span<const std::string_view> GetExtensionAppsRunInOSOnly() { #if BUILDFLAG(IS_CHROMEOS_ASH) return ExtensionAppsRunInOSOnlyAllowlist(); #else // IS_CHROMEOS_LACROS @@ -372,7 +373,7 @@ #endif } -base::span<const base::StringPiece> GetExtensionsRunInOSAndStandaloneBrowser() { +base::span<const std::string_view> GetExtensionsRunInOSAndStandaloneBrowser() { #if BUILDFLAG(IS_CHROMEOS_ASH) return ExtensionsRunInOSAndStandaloneBrowserAllowlist(); #else // IS_CHROMEOS_LACROS @@ -380,7 +381,7 @@ #endif } -base::span<const base::StringPiece> GetExtensionsRunInOSOnly() { +base::span<const std::string_view> GetExtensionsRunInOSOnly() { #if BUILDFLAG(IS_CHROMEOS_ASH) return ExtensionsRunInOSOnlyAllowlist(); #else // IS_CHROMEOS_LACROS @@ -435,7 +436,7 @@ base::Contains(GetExtensionAppsRunInOSOnly(), app_id); } -bool ExtensionAppRunsInOSOnly(base::StringPiece app_id) { +bool ExtensionAppRunsInOSOnly(std::string_view app_id) { #if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_CHROMEOS_DEVICE) return base::Contains(GetExtensionAppsRunInOSOnly(), app_id); #else @@ -446,7 +447,7 @@ #endif } -bool ExtensionRunsInOSOnly(base::StringPiece extension_id) { +bool ExtensionRunsInOSOnly(std::string_view extension_id) { #if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_CHROMEOS_DEVICE) return base::Contains(GetExtensionsRunInOSOnly(), extension_id); #else @@ -465,7 +466,7 @@ } bool ExtensionAppBlockListedForAppServiceInStandaloneBrowser( - base::StringPiece app_id) { + std::string_view app_id) { const auto* block_list = chromeos::BrowserParamsProxy::Get() ->StandaloneBrowserAppServiceBlockList(); DCHECK(block_list); @@ -473,7 +474,7 @@ } bool ExtensionBlockListedForAppServiceInStandaloneBrowser( - base::StringPiece extension_id) { + std::string_view extension_id) { const auto* block_list = chromeos::BrowserParamsProxy::Get() ->StandaloneBrowserAppServiceBlockList(); DCHECK(block_list); @@ -486,7 +487,7 @@ #endif // BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS_ASH) -bool ExtensionAppBlockListedForAppServiceInOS(base::StringPiece app_id) { +bool ExtensionAppBlockListedForAppServiceInOS(std::string_view app_id) { #if BUILDFLAG(IS_CHROMEOS_DEVICE) return base::Contains(ExtensionAppsAppServiceBlocklistInOS(), app_id); #else @@ -498,7 +499,7 @@ #endif } -bool ExtensionBlockListedForAppServiceInOS(base::StringPiece extension_id) { +bool ExtensionBlockListedForAppServiceInOS(std::string_view extension_id) { return base::Contains(ExtensionsAppServiceBlocklistInOS(), extension_id); }
diff --git a/chrome/browser/extensions/extension_keeplist_chromeos.h b/chrome/browser/extensions/extension_keeplist_chromeos.h index 474e5ac..af05d0c 100644 --- a/chrome/browser/extensions/extension_keeplist_chromeos.h +++ b/chrome/browser/extensions/extension_keeplist_chromeos.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_KEEPLIST_CHROMEOS_H_ #include <string> +#include <string_view> #include <vector> #include "build/chromeos_buildflags.h" @@ -21,17 +22,17 @@ #endif // BUILDFLAG(IS_CHROMEOS_ASH) // Returns ids of the extensions that are allow to run in both Ash and Lacros. -base::span<const base::StringPiece> GetExtensionsRunInOSAndStandaloneBrowser(); +base::span<const std::string_view> GetExtensionsRunInOSAndStandaloneBrowser(); // Returns ids of the chrome apps that are allow to run in both Ash and Lacros. -base::span<const base::StringPiece> +base::span<const std::string_view> GetExtensionAppsRunInOSAndStandaloneBrowser(); // Returns ids of the extensions that are allow to run in Ash only. -base::span<const base::StringPiece> GetExtensionsRunInOSOnly(); +base::span<const std::string_view> GetExtensionsRunInOSOnly(); // Returns ids of the chrome apps that are allow to run in Ash only. -base::span<const base::StringPiece> GetExtensionAppsRunInOSOnly(); +base::span<const std::string_view> GetExtensionAppsRunInOSOnly(); // By default an extension should only be enabled in either Ash or Lacros, but // not both. Some extensions may not work properly if enabled in both. This is @@ -62,14 +63,14 @@ // used to support Chrome OS features such as text to speech or vox, or they are // not compatible with Lacros yet. When this method is invoked in Lacros, it may // not know about OS-specific extension apps that are compiled into ash. -bool ExtensionAppRunsInOSOnly(base::StringPiece app_id); +bool ExtensionAppRunsInOSOnly(std::string_view app_id); // Returns true if the extension is kept to run in Ash ONLY. A small list of // 1st party extensions will continue to run in Ash either since they are // used to support Chrome OS features such as text to speech or vox, or they are // not compatible with Lacros yet. When this method is invoked in Lacros, it may // not know about OS-specific extensions that are compiled into ash. -bool ExtensionRunsInOSOnly(base::StringPiece extension_id); +bool ExtensionRunsInOSOnly(std::string_view extension_id); #if BUILDFLAG(IS_CHROMEOS_LACROS) bool IsAppServiceBlocklistCrosapiSupported(); @@ -77,12 +78,12 @@ // Returns true if the app is on app service block list in Lacros, i.e., // the app can't be published in app service by Lacros. bool ExtensionAppBlockListedForAppServiceInStandaloneBrowser( - base::StringPiece app_id); + std::string_view app_id); // Returns true if the extension is on app service block list in Lacros, i.e., // the extension can't be published in app service by Lacros. bool ExtensionBlockListedForAppServiceInStandaloneBrowser( - base::StringPiece extension_id); + std::string_view extension_id); // Some Lacros chrome apps related browser tests and unit tests run without Ash, // therefore, Lacros won't get the Ash extension keeplist data from Ash via @@ -96,11 +97,11 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) // Returns true if the app is on app service block list in Ash, i.e., // the app can't be published in app service by Ash. -bool ExtensionAppBlockListedForAppServiceInOS(base::StringPiece app_id); +bool ExtensionAppBlockListedForAppServiceInOS(std::string_view app_id); // Returns true if the extension is on app service block list in Ash, i.e., // the extension can't be published in app service by Ash. -bool ExtensionBlockListedForAppServiceInOS(base::StringPiece extension_id); +bool ExtensionBlockListedForAppServiceInOS(std::string_view extension_id); // Returns ids of the extensions and extension apps that are allow to run in // both Ash and Lacros.
diff --git a/chrome/browser/extensions/extension_management_internal_fuzzer.cc b/chrome/browser/extensions/extension_management_internal_fuzzer.cc index 7248d1d..ecb6a60 100644 --- a/chrome/browser/extensions/extension_management_internal_fuzzer.cc +++ b/chrome/browser/extensions/extension_management_internal_fuzzer.cc
@@ -7,9 +7,9 @@ #include <stdint.h> #include <optional> +#include <string_view> #include "base/json/json_reader.h" -#include "base/strings/string_piece.h" #include "base/values.h" #include "third_party/icu/fuzzers/fuzzer_utils.h" @@ -38,7 +38,7 @@ if (size > 100 * 1024) return 0; - base::StringPiece json(reinterpret_cast<const char*>(data), size); + std::string_view json(reinterpret_cast<const char*>(data), size); std::optional<base::Value> value = base::JSONReader::Read(json); if (!value || !value->is_dict()) return 0;
diff --git a/chrome/browser/extensions/extension_management_test_util.cc b/chrome/browser/extensions/extension_management_test_util.cc index 2e9cc3f..93998ab1 100644 --- a/chrome/browser/extensions/extension_management_test_util.cc +++ b/chrome/browser/extensions/extension_management_test_util.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/extensions/extension_management_test_util.h" #include <string> +#include <string_view> #include <utility> #include "base/containers/contains.h" @@ -31,11 +32,11 @@ return a + "." + b; } -void RemoveDictionaryPath(base::Value::Dict& dict, base::StringPiece path) { - base::StringPiece current_path(path); +void RemoveDictionaryPath(base::Value::Dict& dict, std::string_view path) { + std::string_view current_path(path); base::Value::Dict* current_dictionary = &dict; size_t delimiter_position = current_path.rfind('.'); - if (delimiter_position != base::StringPiece::npos) { + if (delimiter_position != std::string_view::npos) { current_dictionary = dict.FindDictByDottedPath(current_path.substr(0, delimiter_position)); if (!current_dictionary)
diff --git a/chrome/browser/extensions/extension_management_unittest.cc b/chrome/browser/extensions/extension_management_unittest.cc index f1b2f3f0..f4a8d1b 100644 --- a/chrome/browser/extensions/extension_management_unittest.cc +++ b/chrome/browser/extensions/extension_management_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <string_view> #include <vector> #include "base/containers/contains.h" @@ -223,7 +224,7 @@ return GetBlockedAPIPermissions(kNonExistingExtension, update_url); } - void SetExampleDictPref(const base::StringPiece example_dict_preference) { + void SetExampleDictPref(const std::string_view example_dict_preference) { auto result = base::JSONReader::ReadAndReturnValueWithError( example_dict_preference, base::JSONParserOptions::JSON_ALLOW_TRAILING_COMMAS);
diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc index c772a3b..18e8cb5c 100644 --- a/chrome/browser/extensions/external_provider_impl.cc +++ b/chrome/browser/extensions/external_provider_impl.cc
@@ -8,6 +8,7 @@ #include <memory> #include <set> +#include <string_view> #include <utility> #include <vector> @@ -458,7 +459,7 @@ base::FilePath path = base::FilePath::FromUTF8Unsafe(*external_crx); if (path.value().find(base::FilePath::kParentDirectory) != - base::StringPiece::npos) { + std::string_view::npos) { install_stage_tracker->ReportFailure( extension_id, InstallStageTracker::FailureReason:: MALFORMED_EXTENSION_DICT_FILE_PATH);
diff --git a/chrome/browser/extensions/omnibox_focus_interactive_test.cc b/chrome/browser/extensions/omnibox_focus_interactive_test.cc index 9c51721f..0e8080d 100644 --- a/chrome/browser/extensions/omnibox_focus_interactive_test.cc +++ b/chrome/browser/extensions/omnibox_focus_interactive_test.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string_view> + #include "base/ranges/algorithm.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" @@ -33,7 +35,7 @@ protected: void WriteExtensionFile(const base::FilePath::StringType& filename, - base::StringPiece contents) { + std::string_view contents) { test_dir_.WriteFile(filename, contents); }
diff --git a/chrome/browser/extensions/orb_and_cors_extension_browsertest.cc b/chrome/browser/extensions/orb_and_cors_extension_browsertest.cc index a715e73..e52f3ab5 100644 --- a/chrome/browser/extensions/orb_and_cors_extension_browsertest.cc +++ b/chrome/browser/extensions/orb_and_cors_extension_browsertest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <string> +#include <string_view> #include <vector> #include "base/containers/to_vector.h" @@ -357,7 +358,7 @@ return browser()->tab_strip_model()->GetActiveWebContents(); } - const Extension* InstallExtensionWithManifest(base::StringPiece manifest) { + const Extension* InstallExtensionWithManifest(std::string_view manifest) { dir_.WriteManifest(manifest); dir_.WriteFile(FILE_PATH_LITERAL("background_script.js"), ""); dir_.WriteFile(FILE_PATH_LITERAL("page.html"), "");
diff --git a/chrome/browser/extensions/permissions/site_permissions_helper_browsertest.cc b/chrome/browser/extensions/permissions/site_permissions_helper_browsertest.cc index 1e9ca8b..0bdaf887 100644 --- a/chrome/browser/extensions/permissions/site_permissions_helper_browsertest.cc +++ b/chrome/browser/extensions/permissions/site_permissions_helper_browsertest.cc
@@ -4,11 +4,12 @@ #include "chrome/browser/extensions/permissions/site_permissions_helper.h" +#include <string_view> + #include "base/run_loop.h" -#include "base/strings/string_piece.h" #include "chrome/browser/extensions/browsertest_util.h" -#include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/extensions/extension_action_runner.h" +#include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/extensions/permissions/scripting_permissions_modifier.h" #include "chrome/browser/extensions/tab_helper.h" #include "chrome/browser/profiles/profile.h" @@ -324,7 +325,7 @@ // Navigates to `host_name` with `relative_url`. `host_name` must be added as // a rule in SetUpOnMainThread(). - void NavigateTo(base::StringPiece host_name, base::StringPiece relative_url) { + void NavigateTo(std::string_view host_name, std::string_view relative_url) { GURL url = embedded_test_server()->GetURL(host_name, relative_url); ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url)); }
diff --git a/chrome/browser/extensions/policy_handlers.cc b/chrome/browser/extensions/policy_handlers.cc index 9b576a2..644bc0ce 100644 --- a/chrome/browser/extensions/policy_handlers.cc +++ b/chrome/browser/extensions/policy_handlers.cc
@@ -9,6 +9,7 @@ #include <memory> #include <optional> #include <string> +#include <string_view> #include <unordered_set> #include <utility> #include <vector> @@ -16,7 +17,6 @@ #include "base/check.h" #include "base/notreached.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "base/values.h" #include "build/build_config.h" @@ -49,7 +49,7 @@ // Returns true if extensions_ids contains a list of valid extension ids, // divided by comma. bool IsValidIdList(const std::string& extension_ids) { - std::vector<base::StringPiece> ids = base::SplitStringPiece( + std::vector<std::string_view> ids = base::SplitStringPiece( extension_ids, ",", base::WhitespaceHandling::TRIM_WHITESPACE, base::SplitResult::SPLIT_WANT_NONEMPTY); if (ids.size() == 0) {
diff --git a/chrome/browser/extensions/pref_mapping.cc b/chrome/browser/extensions/pref_mapping.cc index fd882fc4..8c597cb 100644 --- a/chrome/browser/extensions/pref_mapping.cc +++ b/chrome/browser/extensions/pref_mapping.cc
@@ -6,6 +6,7 @@ #include <optional> #include <span> // std::size. +#include <string_view> #include "base/containers/contains.h" #include "base/strings/stringprintf.h" @@ -219,7 +220,7 @@ crosapi::mojom::PrefPath PrefMapping::GetPrefPathForPrefName( const std::string& pref_name) const { static constexpr auto name_to_extension_prefpath = base::MakeFixedFlatMap< - base::StringPiece, crosapi::mojom::PrefPath>( + std::string_view, crosapi::mojom::PrefPath>( {{chromeos::prefs::kDockedMagnifierEnabled, crosapi::mojom::PrefPath::kDockedMagnifierEnabled}, {chromeos::prefs::kAccessibilityAutoclickEnabled,
diff --git a/chrome/browser/extensions/process_map_browsertest.cc b/chrome/browser/extensions/process_map_browsertest.cc index dfa9250b..a56a015 100644 --- a/chrome/browser/extensions/process_map_browsertest.cc +++ b/chrome/browser/extensions/process_map_browsertest.cc
@@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "extensions/browser/process_map.h" + #include <memory> +#include <string_view> #include <vector> -#include "base/strings/string_piece.h" #include "base/strings/stringprintf.h" #include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/profiles/profile.h" @@ -23,7 +25,6 @@ #include "extensions/browser/app_window/app_window.h" #include "extensions/browser/app_window/app_window_registry.h" #include "extensions/browser/guest_view/web_view/web_view_guest.h" -#include "extensions/browser/process_map.h" #include "extensions/common/constants.h" #include "extensions/common/mojom/context_type.mojom.h" #include "extensions/test/extension_test_message_listener.h" @@ -62,8 +63,8 @@ // Adds a new extension with the given `extension_name` and host permission to // the given `host_pattern`. const Extension* AddExtensionWithHostPermission( - base::StringPiece extension_name, - base::StringPiece host_pattern) { + std::string_view extension_name, + std::string_view host_pattern) { static constexpr char kManifestTemplate[] = R"({ "name": "%s", @@ -83,8 +84,8 @@ // that runs on `content_script_pattern`, sending a message when the script // injects. const Extension* AddExtensionWithContentScript( - base::StringPiece extension_name, - base::StringPiece content_script_pattern) { + std::string_view extension_name, + std::string_view content_script_pattern) { static constexpr char kManifestTemplate[] = R"({ "name": "%s", @@ -416,7 +417,7 @@ } // Opens a new tab to the given `domain`. - void OpenDomain(base::StringPiece domain) { + void OpenDomain(std::string_view domain) { ASSERT_TRUE(ui_test_utils::NavigateToURL( browser(), embedded_test_server()->GetURL(domain, "/simple.html"))); } @@ -435,7 +436,7 @@ // Opens a new tab to the given `domain` and waits for a content script to // inject. - void OpenDomainAndWaitForContentScript(base::StringPiece domain) { + void OpenDomainAndWaitForContentScript(std::string_view domain) { ExtensionTestMessageListener listener("script injected"); OpenDomain(domain); ASSERT_TRUE(listener.WaitUntilSatisfied()); @@ -489,7 +490,7 @@ const Extension* extension, const content::RenderProcessHost& process, const std::vector<mojom::ContextType>& allowed_contexts, - base::StringPiece debug_string) { + std::string_view debug_string) { std::vector<mojom::ContextType> all_types = { mojom::ContextType::kUnspecified, mojom::ContextType::kPrivilegedExtension,
diff --git a/chrome/browser/extensions/script_injection_tracker_browsertest.cc b/chrome/browser/extensions/script_injection_tracker_browsertest.cc index a77f4716..fccc856 100644 --- a/chrome/browser/extensions/script_injection_tracker_browsertest.cc +++ b/chrome/browser/extensions/script_injection_tracker_browsertest.cc
@@ -2,7 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "extensions/browser/script_injection_tracker.h" + #include <string> +#include <string_view> #include <vector> #include "base/files/file_path.h" @@ -35,7 +38,6 @@ #include "extensions/browser/extension_system.h" #include "extensions/browser/process_manager.h" #include "extensions/browser/script_executor.h" -#include "extensions/browser/script_injection_tracker.h" #include "extensions/browser/user_script_manager.h" #include "extensions/common/extension_features.h" #include "extensions/common/features/feature_channel.h" @@ -148,8 +150,8 @@ // Navigates to url for given `hostname` and `relative_url`. Returns whether // the navigation is in a new process compared to the currently active tab. - [[nodiscard]] bool NavigateToURLInNewProcess(base::StringPiece hostname, - base::StringPiece relative_url) { + [[nodiscard]] bool NavigateToURLInNewProcess(std::string_view hostname, + std::string_view relative_url) { content::WebContents* original_web_contents = GetActiveWebContents(); // Opening the URL in a new tab should force it into a new process.
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc index 4eadeb55..3853744 100644 --- a/chrome/browser/extensions/webstore_installer.cc +++ b/chrome/browser/extensions/webstore_installer.cc
@@ -10,6 +10,7 @@ #include <limits> #include <memory> #include <set> +#include <string_view> #include <utility> #include <vector> @@ -21,7 +22,6 @@ #include "base/rand_util.h" #include "base/strings/escape.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -191,7 +191,7 @@ return GURL(base::StringPrintfNonConstexpr(download_url.c_str(), extension_id.c_str())); } - std::vector<base::StringPiece> params; + std::vector<std::string_view> params; std::string extension_param = "id=" + extension_id; std::string installsource_param = "installsource=" + install_source; params.push_back(extension_param);
diff --git a/chrome/browser/file_system_access/file_system_access_features.cc b/chrome/browser/file_system_access/file_system_access_features.cc index e830c94b..3d737ae 100644 --- a/chrome/browser/file_system_access/file_system_access_features.cc +++ b/chrome/browser/file_system_access/file_system_access_features.cc
@@ -23,7 +23,7 @@ // Enables the updated Page Info UI for the persistent permissions feature. BASE_FEATURE(kFileSystemAccessPersistentPermissionsUpdatedPageInfo, "kFileSystemAccessPersistentPermissionsUpdatedPageInfo", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); // Enables performing the blocklist check on a full absolute path, which // resolves any symbolic link.
diff --git a/chrome/browser/file_system_access/file_system_file_handle_browsertest.cc b/chrome/browser/file_system_access/file_system_file_handle_browsertest.cc new file mode 100644 index 0000000..e37f340e --- /dev/null +++ b/chrome/browser/file_system_access/file_system_file_handle_browsertest.cc
@@ -0,0 +1,211 @@ +// Copyright 2024 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/content_settings/cookie_settings_factory.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/ui_test_utils.h" +#include "components/content_settings/core/browser/cookie_settings.h" +#include "components/content_settings/core/common/content_settings.h" +#include "content/public/test/browser_test.h" +#include "content/public/test/browser_test_utils.h" +#include "net/dns/mock_host_resolver.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" + +namespace { + +constexpr char kInitialUrl[] = "/run_async_code_on_worker.html"; +constexpr char kSuccessMessage[] = "success"; +constexpr char kSecurityErrorMessage[] = + "SecurityError: File System access is denied."; + +} // namespace + +class FileSystemFileHandleBrowserTest : public InProcessBrowserTest { + public: + FileSystemFileHandleBrowserTest() = default; + ~FileSystemFileHandleBrowserTest() override = default; + + FileSystemFileHandleBrowserTest(const FileSystemFileHandleBrowserTest&) = + delete; + FileSystemFileHandleBrowserTest& operator=( + const FileSystemFileHandleBrowserTest&) = delete; + + void SetUpOnMainThread() override { + host_resolver()->AddRule("*", "127.0.0.1"); + ASSERT_TRUE(embedded_test_server()->Start()); + } + + content::WebContents* GetWebContents() { + return browser()->tab_strip_model()->GetActiveWebContents(); + } + + void ConfigureCookieSetting(const GURL& url, ContentSetting setting) { + CookieSettingsFactory::GetForProfile(browser()->profile()) + ->SetCookieSetting(url, setting); + } + + // Initialize a file handle via the File System Access API. + void InitializeFileHandle() { + std::string script = R"(runOnWorkerAndWaitForResult(` + const root = await navigator.storage.getDirectory(); + fileSystemFileHandle = + await root.getFileHandle('draft.txt', { create: true }); + `);)"; + std::ignore = EvalJs(GetWebContents(), script); + } +}; + +IN_PROC_BROWSER_TEST_F(FileSystemFileHandleBrowserTest, StorageAccessBlocked) { + GURL initial_url = embedded_test_server()->GetURL(kInitialUrl); + ASSERT_NE(ui_test_utils::NavigateToURL(browser(), initial_url), nullptr); + + ConfigureCookieSetting(initial_url, CONTENT_SETTING_ALLOW); + InitializeFileHandle(); + + // Block the storage access by blocking the cookie setting. This will prevent + // `createSyncAccessHandle()` to succeed. + ConfigureCookieSetting(initial_url, CONTENT_SETTING_BLOCK); + + // Try to create a sync access handle from the file handle + // `fileSystemFileHandle` created from InitializeFileHandle(). This + // should fail as the storage access is blocked. + std::string script = R"( + runOnWorkerAndWaitForResult(` + try { + syncAccessHandle = + await fileSystemFileHandle.createSyncAccessHandle(); + } catch(e) { + return e.toString(); + } + return "success"; + `); + )"; + + EXPECT_EQ(EvalJs(GetWebContents(), script), kSecurityErrorMessage); +} + +IN_PROC_BROWSER_TEST_F(FileSystemFileHandleBrowserTest, + StorageAccessBlockedWithMultipleCall) { + GURL initial_url = embedded_test_server()->GetURL(kInitialUrl); + ASSERT_NE(ui_test_utils::NavigateToURL(browser(), initial_url), nullptr); + + ConfigureCookieSetting(initial_url, CONTENT_SETTING_ALLOW); + InitializeFileHandle(); + + // Block the storage access by blocking the cookie setting. This will prevent + // `createSyncAccessHandle()` to succeed. + ConfigureCookieSetting(initial_url, CONTENT_SETTING_BLOCK); + + // Try to create a sync access handle from the file handle + // `fileSystemFileHandle` created from InitializeFileHandle(). This + // should fail as the storage access is blocked. + std::string script = R"( + runOnWorkerAndWaitForResult(` + try { + syncAccessHandle = + await fileSystemFileHandle.createSyncAccessHandle(); + } catch(e) { + return e.toString(); + } + return "success"; + `); + )"; + + EXPECT_EQ(EvalJs(GetWebContents(), script), kSecurityErrorMessage); + + // The content setting is still blocked and the cache will be hit. + EXPECT_EQ(EvalJs(GetWebContents(), script), kSecurityErrorMessage); +} + +IN_PROC_BROWSER_TEST_F(FileSystemFileHandleBrowserTest, StorageAccessAllowed) { + GURL initial_url = embedded_test_server()->GetURL(kInitialUrl); + ASSERT_NE(ui_test_utils::NavigateToURL(browser(), initial_url), nullptr); + + ConfigureCookieSetting(initial_url, CONTENT_SETTING_ALLOW); + InitializeFileHandle(); + + // Try to create a sync access handle from the file handle + // `fileSystemFileHandle` created from InitializeFileHandle(). This + // should succeed as the storage access is allowed. + std::string script = R"( + runOnWorkerAndWaitForResult(` + try { + syncAccessHandle = + await fileSystemFileHandle.createSyncAccessHandle(); + syncAccessHandle.close(); + } catch(e) { + return e.toString(); + } + return "success"; + `); + )"; + + EXPECT_EQ(EvalJs(GetWebContents(), script), kSuccessMessage); +} + +IN_PROC_BROWSER_TEST_F(FileSystemFileHandleBrowserTest, + StorageAccessAllowedWithMultipleCall) { + GURL initial_url = embedded_test_server()->GetURL(kInitialUrl); + ASSERT_NE(ui_test_utils::NavigateToURL(browser(), initial_url), nullptr); + + ConfigureCookieSetting(initial_url, CONTENT_SETTING_ALLOW); + InitializeFileHandle(); + + // Try to create a sync access handle from the file handle + // `fileSystemFileHandle` created from InitializeFileHandle(). This + // should succeed as the storage access is allowed. + std::string script = R"( + runOnWorkerAndWaitForResult(` + try { + syncAccessHandle = + await fileSystemFileHandle.createSyncAccessHandle(); + syncAccessHandle.close(); + } catch(e) { + return e.toString(); + } + return "success"; + `); + )"; + + EXPECT_EQ(EvalJs(GetWebContents(), script), kSuccessMessage); + + // The content setting is still allowed and the cache will be hit. + EXPECT_EQ(EvalJs(GetWebContents(), script), kSuccessMessage); +} + +IN_PROC_BROWSER_TEST_F(FileSystemFileHandleBrowserTest, + StateChangeFromAllowToBlock) { + GURL initial_url = embedded_test_server()->GetURL(kInitialUrl); + ASSERT_NE(ui_test_utils::NavigateToURL(browser(), initial_url), nullptr); + + ConfigureCookieSetting(initial_url, CONTENT_SETTING_ALLOW); + InitializeFileHandle(); + + // Try to create a sync access handle from the file handle + // `fileSystemFileHandle` created from InitializeFileHandle(). This + // should succeed as the storage access is allowed. + std::string script = R"( + runOnWorkerAndWaitForResult(` + try { + syncAccessHandle = + await fileSystemFileHandle.createSyncAccessHandle(); + syncAccessHandle.close(); + } catch(e) { + return e.toString(); + } + return "success"; + `); + )"; + + EXPECT_EQ(EvalJs(GetWebContents(), script), kSuccessMessage); + + // Block the storage access by blocking the cookie setting. This will prevent + // `createSyncAccessHandle()` to succeed. + ConfigureCookieSetting(initial_url, CONTENT_SETTING_BLOCK); + + // The cache will hit. Therefore, the new status will be ignored. + EXPECT_EQ(EvalJs(GetWebContents(), script), kSuccessMessage); +}
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 73733e3..5faab98 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -1215,8 +1215,8 @@ }, { "name": "cast-mirroring-target-playout-delay", - "owners": [ "gbj@google.com", "cros-edu-eng@google.com" ], - "expiry_milestone": 125 + "owners": [ "gbj@google.com", "jophba@chromium.org", "cros-edu-eng@google.com" ], + "expiry_milestone": 150 }, { "name": "cast-streaming-hardware-h264",
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 58ed89e..226e3049 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
@@ -793,7 +793,7 @@ public static final MutableFlagWithSafeDefault sAndroidTabDeclutter = newMutableFlagWithSafeDefault(ANDROID_TAB_DECLUTTER, false); public static final MutableFlagWithSafeDefault sAndroidTabDeclutterRescueKillSwitch = - newMutableFlagWithSafeDefault(ANDROID_TAB_DECLUTTER_RESCUE_KILLSWITCH, false); + newMutableFlagWithSafeDefault(ANDROID_TAB_DECLUTTER_RESCUE_KILLSWITCH, true); public static final MutableFlagWithSafeDefault sBrowserControlsEarlyResize = newMutableFlagWithSafeDefault(BROWSER_CONTROLS_EARLY_RESIZE, false); public static final MutableFlagWithSafeDefault sIncognitoNtpRevamp =
diff --git a/chrome/browser/google/BUILD.gn b/chrome/browser/google/BUILD.gn index f139ba0..22ea55b 100644 --- a/chrome/browser/google/BUILD.gn +++ b/chrome/browser/google/BUILD.gn
@@ -5,6 +5,8 @@ import("//build/config/chrome_build.gni") import("//build/config/chromeos/ui_mode.gni") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + source_set("google") { sources = [ "google_brand.cc", @@ -68,7 +70,7 @@ deps += [ "//chrome/common:channel_info" ] } - if (is_posix || is_fuchsia) { + if (is_posix) { sources += [ "google_update_settings_posix.cc" ] } if (is_posix) {
diff --git a/chrome/browser/headless/headless_mode_command_browsertest.cc b/chrome/browser/headless/headless_mode_command_browsertest.cc index 0259212..835795f 100644 --- a/chrome/browser/headless/headless_mode_command_browsertest.cc +++ b/chrome/browser/headless/headless_mode_command_browsertest.cc
@@ -66,6 +66,7 @@ } protected: + // Override this to provide the test specific target page. virtual std::string GetTargetPage() { return "/hello.html"; } GURL GetTargetUrl(const std::string& url) { @@ -477,6 +478,8 @@ command_line->AppendSwitchPath(switches::kPrintToPDF, print_to_pdf_filename_); command_line->AppendSwitch(switches::kNoPDFHeaderFooter); + + command_line->AppendArg(GetTargetUrl(GetTargetPage()).spec()); } protected: @@ -488,12 +491,7 @@ public: HeadlessModePrintToPdfCommandBrowserTest() = default; - void SetUpCommandLine(base::CommandLine* command_line) override { - HeadlessModePrintToPdfCommandBrowserTestBase::SetUpCommandLine( - command_line); - - command_line->AppendArg(GetTargetUrl("/centered_blue_box.html").spec()); - } + std::string GetTargetPage() override { return "/centered_blue_box.html"; } }; // TODO(crbug.com/1440917): Reenable once deflaked. @@ -521,20 +519,10 @@ SkColorSetRGB(0xff, 0xff, 0xff))); } -class HeadlessModeLazyLoadingPrintToPdfCommandBrowserTest - : public HeadlessModePrintToPdfCommandBrowserTestBase { - public: - HeadlessModeLazyLoadingPrintToPdfCommandBrowserTest() = default; - - void SetUpCommandLine(base::CommandLine* command_line) override { - HeadlessModePrintToPdfCommandBrowserTestBase::SetUpCommandLine( - command_line); - command_line->AppendArg(GetTargetUrl("/page_with_lazy_image.html").spec()); - } -}; - -IN_PROC_BROWSER_TEST_F(HeadlessModeLazyLoadingPrintToPdfCommandBrowserTest, - HeadlessLazyLoadingPrintToPdf) { +HEADLESS_MODE_COMMAND_BROWSER_TEST_WITH_TARGET_URL( + HeadlessModePrintToPdfCommandBrowserTestBase, + PrintToPdfWithLazyLoading, + "/page_with_lazy_image.html") { ASSERT_THAT(ProcessCommands(), testing::Eq(HeadlessCommandHandler::Result::kSuccess)); @@ -560,11 +548,11 @@ bool generate_tagged_pdf() { return GetParam(); } + std::string GetTargetPage() override { return "/hello.html"; } + void SetUpCommandLine(base::CommandLine* command_line) override { HeadlessModePrintToPdfCommandBrowserTestBase::SetUpCommandLine( command_line); - command_line->AppendArg(GetTargetUrl("/hello.html").spec()); - if (!generate_tagged_pdf()) { command_line->AppendSwitch(switches::kDisablePDFTagging); }
diff --git a/chrome/browser/image_editor/BUILD.gn b/chrome/browser/image_editor/BUILD.gn index 3acbdae3..0ca8249 100644 --- a/chrome/browser/image_editor/BUILD.gn +++ b/chrome/browser/image_editor/BUILD.gn
@@ -3,8 +3,9 @@ # found in the LICENSE file. import("//build/config/ui.gni") -assert(is_chromeos || is_linux || is_mac || is_win || is_fuchsia, +assert(is_chromeos || is_linux || is_mac || is_win, "Image Editor is for desktop plaforms only") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") static_library("image_editor_component_util") { sources = [
diff --git a/chrome/browser/ip_protection/ip_protection_config_http.cc b/chrome/browser/ip_protection/ip_protection_config_http.cc index 9e6047f0..008df24 100644 --- a/chrome/browser/ip_protection/ip_protection_config_http.cc +++ b/chrome/browser/ip_protection/ip_protection_config_http.cc
@@ -76,19 +76,19 @@ IpProtectionConfigHttp::~IpProtectionConfigHttp() = default; void IpProtectionConfigHttp::DoRequest( - quiche::BlindSignHttpRequestType request_type, + quiche::BlindSignMessageRequestType request_type, std::optional<std::string_view> authorization_header, const std::string& body, - quiche::BlindSignHttpCallback callback) { + quiche::BlindSignMessageCallback callback) { GURL::Replacements replacements; switch (request_type) { - case quiche::BlindSignHttpRequestType::kGetInitialData: + case quiche::BlindSignMessageRequestType::kGetInitialData: replacements.SetPathStr(ip_protection_server_get_initial_data_path_); break; - case quiche::BlindSignHttpRequestType::kAuthAndSign: + case quiche::BlindSignMessageRequestType::kAuthAndSign: replacements.SetPathStr(ip_protection_server_get_tokens_path_); break; - case quiche::BlindSignHttpRequestType::kUnknown: + case quiche::BlindSignMessageRequestType::kUnknown: NOTREACHED_NORETURN(); } @@ -129,7 +129,7 @@ void IpProtectionConfigHttp::OnDoRequestCompleted( std::unique_ptr<network::SimpleURLLoader> url_loader, - quiche::BlindSignHttpCallback callback, + quiche::BlindSignMessageCallback callback, std::unique_ptr<std::string> response) { int response_code = 0; if (url_loader->ResponseInfo() && url_loader->ResponseInfo()->headers) { @@ -138,7 +138,9 @@ // Short-circuit non-200 HTTP responses to an OK response with that code. if (response_code != 200 && response_code != 0) { - std::move(callback)(quiche::BlindSignHttpResponse(response_code, "")); + std::move(callback)(quiche::BlindSignMessageResponse( + quiche::BlindSignMessageResponse::HttpCodeToStatusCode(response_code), + "")); return; } @@ -148,8 +150,9 @@ return; } - quiche::BlindSignHttpResponse bsa_response(response_code, - std::move(*response)); + quiche::BlindSignMessageResponse bsa_response( + quiche::BlindSignMessageResponse::HttpCodeToStatusCode(response_code), + std::move(*response)); std::move(callback)(std::move(bsa_response)); }
diff --git a/chrome/browser/ip_protection/ip_protection_config_http.h b/chrome/browser/ip_protection/ip_protection_config_http.h index 2090991..831a67b 100644 --- a/chrome/browser/ip_protection/ip_protection_config_http.h +++ b/chrome/browser/ip_protection/ip_protection_config_http.h
@@ -20,8 +20,8 @@ class SimpleURLLoader; } // namespace network -// HTTP Fetching for IP Protection. This implements the `BlindSignHttpInterface` -// for use by the BSA library. +// HTTP Fetching for IP Protection. This implements the +// `BlindSignMessageInterface` for use by the BSA library. class IpProtectionConfigHttp : public quiche::BlindSignMessageInterface { public: explicit IpProtectionConfigHttp( @@ -29,15 +29,15 @@ ~IpProtectionConfigHttp() override; // quiche::BlindSignMessageInterface implementation: - void DoRequest(quiche::BlindSignHttpRequestType request_type, + void DoRequest(quiche::BlindSignMessageRequestType request_type, std::optional<std::string_view> authorization_header, const std::string& body, - quiche::BlindSignHttpCallback callback) override; + quiche::BlindSignMessageCallback callback) override; private: void OnDoRequestCompleted( std::unique_ptr<network::SimpleURLLoader> url_loader, - quiche::BlindSignHttpCallback callback, + quiche::BlindSignMessageCallback callback, std::unique_ptr<std::string> response); scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
diff --git a/chrome/browser/ip_protection/ip_protection_config_http_unittest.cc b/chrome/browser/ip_protection/ip_protection_config_http_unittest.cc index 5fcf029..7c9a28d 100644 --- a/chrome/browser/ip_protection/ip_protection_config_http_unittest.cc +++ b/chrome/browser/ip_protection/ip_protection_config_http_unittest.cc
@@ -52,7 +52,7 @@ }; TEST_F(IpProtectionConfigHttpTest, DoRequestSendsCorrectRequest) { - auto request_type = quiche::BlindSignHttpRequestType::kGetInitialData; + auto request_type = quiche::BlindSignMessageRequestType::kGetInitialData; std::string authorization_header = "token"; std::string body = "body"; @@ -63,21 +63,22 @@ token_server_get_initial_data_url_, std::move(head), response_body, network::URLLoaderCompletionStatus(net::OK)); - base::test::TestFuture<absl::StatusOr<quiche::BlindSignHttpResponse>> + base::test::TestFuture<absl::StatusOr<quiche::BlindSignMessageResponse>> result_future; // Note: We use a lambda expression and `TestFuture::SetValue()` instead of // `TestFuture::GetCallback()` to avoid having to convert the // `base::OnceCallback` to a `quiche::SignedTokenCallback` (an // `absl::AnyInvocable` behind the scenes). auto callback = - [&result_future](absl::StatusOr<quiche::BlindSignHttpResponse> response) { + [&result_future]( + absl::StatusOr<quiche::BlindSignMessageResponse> response) { result_future.SetValue(std::move(response)); }; http_fetcher_->DoRequest(request_type, authorization_header, body, std::move(callback)); - absl::StatusOr<quiche::BlindSignHttpResponse> result = result_future.Get(); + absl::StatusOr<quiche::BlindSignMessageResponse> result = result_future.Get(); ASSERT_TRUE(result.ok()); EXPECT_EQ("Response body", result->body()); @@ -85,7 +86,7 @@ TEST_F(IpProtectionConfigHttpTest, DoRequestFailsToConnectReturnsFailureStatus) { - auto request_type = quiche::BlindSignHttpRequestType::kAuthAndSign; + auto request_type = quiche::BlindSignMessageRequestType::kAuthAndSign; std::string authorization_header = "token"; std::string body = "body"; @@ -96,17 +97,18 @@ token_server_get_tokens_url_, std::move(head), response_body, network::URLLoaderCompletionStatus(net::ERR_FAILED)); - base::test::TestFuture<absl::StatusOr<quiche::BlindSignHttpResponse>> + base::test::TestFuture<absl::StatusOr<quiche::BlindSignMessageResponse>> result_future; auto callback = - [&result_future](absl::StatusOr<quiche::BlindSignHttpResponse> response) { + [&result_future]( + absl::StatusOr<quiche::BlindSignMessageResponse> response) { result_future.SetValue(std::move(response)); }; http_fetcher_->DoRequest(request_type, authorization_header, body, std::move(callback)); - absl::StatusOr<quiche::BlindSignHttpResponse> result = result_future.Get(); + absl::StatusOr<quiche::BlindSignMessageResponse> result = result_future.Get(); EXPECT_EQ("Failed Request to Authentication Server", result.status().message()); @@ -129,28 +131,29 @@ base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>( &test_url_loader_factory_)); - auto request_type = quiche::BlindSignHttpRequestType::kGetInitialData; + auto request_type = quiche::BlindSignMessageRequestType::kGetInitialData; std::string authorization_header = "token"; std::string body = "body"; - base::test::TestFuture<absl::StatusOr<quiche::BlindSignHttpResponse>> + base::test::TestFuture<absl::StatusOr<quiche::BlindSignMessageResponse>> result_future; auto callback = - [&result_future](absl::StatusOr<quiche::BlindSignHttpResponse> response) { + [&result_future]( + absl::StatusOr<quiche::BlindSignMessageResponse> response) { result_future.SetValue(std::move(response)); }; http_fetcher->DoRequest(request_type, authorization_header, body, std::move(callback)); - absl::StatusOr<quiche::BlindSignHttpResponse> result = result_future.Get(); + absl::StatusOr<quiche::BlindSignMessageResponse> result = result_future.Get(); EXPECT_EQ("Invalid IP Protection Token URL", result.status().message()); EXPECT_EQ(absl::StatusCode::kInternal, result.status().code()); } TEST_F(IpProtectionConfigHttpTest, DoRequestHttpFailureStatus) { - auto request_type = quiche::BlindSignHttpRequestType::kAuthAndSign; + auto request_type = quiche::BlindSignMessageRequestType::kAuthAndSign; std::string authorization_header = "token"; std::string body = "body"; @@ -160,18 +163,21 @@ test_url_loader_factory_.AddResponse(token_server_get_tokens_url_.spec(), response_body, net::HTTP_BAD_REQUEST); - base::test::TestFuture<absl::StatusOr<quiche::BlindSignHttpResponse>> + base::test::TestFuture<absl::StatusOr<quiche::BlindSignMessageResponse>> result_future; auto callback = - [&result_future](absl::StatusOr<quiche::BlindSignHttpResponse> response) { + [&result_future]( + absl::StatusOr<quiche::BlindSignMessageResponse> response) { result_future.SetValue(std::move(response)); }; http_fetcher_->DoRequest(request_type, authorization_header, body, std::move(callback)); - absl::StatusOr<quiche::BlindSignHttpResponse> result = result_future.Get(); + absl::StatusOr<quiche::BlindSignMessageResponse> result = result_future.Get(); EXPECT_TRUE(result.ok()); - EXPECT_EQ(net::HTTP_BAD_REQUEST, result.value().status_code()); + EXPECT_EQ(quiche::BlindSignMessageResponse::HttpCodeToStatusCode( + net::HTTP_BAD_REQUEST), + result.value().status_code()); }
diff --git a/chrome/browser/lens/lens_overlay/lens_overlay_proto_converter.cc b/chrome/browser/lens/lens_overlay/lens_overlay_proto_converter.cc index ad462c2..ffac94ef 100644 --- a/chrome/browser/lens/lens_overlay/lens_overlay_proto_converter.cc +++ b/chrome/browser/lens/lens_overlay/lens_overlay_proto_converter.cc
@@ -62,7 +62,9 @@ lens::mojom::GeometryPtr CreateGeometryMojomFromProto( lens::Geometry response_geometry) { lens::mojom::GeometryPtr geometry = lens::mojom::Geometry::New(); - CHECK(response_geometry.has_bounding_box()); + if (!response_geometry.has_bounding_box()) { + return geometry; + } auto bounding_box_response = response_geometry.bounding_box(); lens::mojom::CenterRotatedBoxPtr center_rotated_box =
diff --git a/chrome/browser/magic_stack/android/java/src/org/chromium/chrome/browser/magic_stack/HomeModulesCoordinator.java b/chrome/browser/magic_stack/android/java/src/org/chromium/chrome/browser/magic_stack/HomeModulesCoordinator.java index 7e292e3b..e0c062e 100644 --- a/chrome/browser/magic_stack/android/java/src/org/chromium/chrome/browser/magic_stack/HomeModulesCoordinator.java +++ b/chrome/browser/magic_stack/android/java/src/org/chromium/chrome/browser/magic_stack/HomeModulesCoordinator.java
@@ -11,7 +11,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.annotation.VisibleForTesting; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.PagerSnapHelper; import androidx.recyclerview.widget.RecyclerView; @@ -19,7 +18,6 @@ import org.chromium.base.Callback; import org.chromium.base.supplier.ObservableSupplier; -import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.magic_stack.ModuleRegistry.OnViewCreatedCallback; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.segmentation_platform.SegmentationPlatformServiceFactory; @@ -27,19 +25,14 @@ import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.components.browser_ui.widget.displaystyle.DisplayStyleObserver; import org.chromium.components.browser_ui.widget.displaystyle.UiConfig; -import org.chromium.components.segmentation_platform.ClassificationResult; -import org.chromium.components.segmentation_platform.PredictionOptions; import org.chromium.components.segmentation_platform.SegmentationPlatformService; -import org.chromium.components.segmentation_platform.prediction_status.PredictionStatus; import org.chromium.ui.base.DeviceFormFactor; import org.chromium.ui.modelutil.MVCListAdapter.ModelList; import org.chromium.ui.modelutil.PropertyModel; import org.chromium.ui.modelutil.SimpleRecyclerViewAdapter; import org.chromium.url.GURL; -import java.util.ArrayList; import java.util.List; -import java.util.Set; /** Root coordinator which is responsible for showing modules on home surfaces. */ public class HomeModulesCoordinator implements ModuleDelegate, OnViewCreatedCallback { @@ -57,7 +50,6 @@ private SnapHelper mSnapHelper; private boolean mIsSnapHelperAttached; private int mItemPerScreen; - private Set<Integer> mEnabledModuleSet; private HomeModulesConfigManager mHomeModulesConfigManager; private HomeModulesConfigManager.HomeModulesStateListener mHomeModulesStateListener; private SegmentationPlatformService mSegmentationPlatformService; @@ -123,7 +115,9 @@ } }; - mMediator = new HomeModulesMediator(mModel, moduleRegistry); + mMediator = + new HomeModulesMediator( + mModel, moduleRegistry, mModuleDelegateHost, mHomeModulesConfigManager); } // Creates an Adapter and attaches it to the recyclerview if it hasn't yet. @@ -223,7 +217,8 @@ } if (mProfileSupplier.hasValue()) { - showImpl(onHomeModulesShownCallback); + mMediator.showModules( + onHomeModulesShownCallback, this, getSegmentationPlatformService()); } else { long waitForProfileStartTimeMs = SystemClock.elapsedRealtime(); mOnProfileAvailableObserver = @@ -236,28 +231,12 @@ } } - /** Shows the magic stack with profile ready. */ - private void showImpl(Callback<Boolean> onHomeModulesShownCallback) { - // Initializing segmentation service since profile is available. - assert mProfileSupplier.hasValue(); - mSegmentationPlatformService = - SegmentationPlatformServiceFactory.getForProfile(mProfileSupplier.get()); - if (mSegmentationPlatformService == null - || !ChromeFeatureList.isEnabled( - ChromeFeatureList.SEGMENTATION_PLATFORM_ANDROID_HOME_MODULE_RANKER)) { - buildModulesAndShow( - getFixedModuleList(), onHomeModulesShownCallback, /* durationMs= */ 0); - return; - } - getSegmentationRanking(onHomeModulesShownCallback); - } - private void onProfileAvailable( Profile profile, Callback<Boolean> onHomeModulesShownCallback, long waitForProfileStartTimeMs) { long delay = SystemClock.elapsedRealtime() - waitForProfileStartTimeMs; - showImpl(onHomeModulesShownCallback); + mMediator.showModules(onHomeModulesShownCallback, this, getSegmentationPlatformService()); mProfileSupplier.removeObserver(mOnProfileAvailableObserver); mOnProfileAvailableObserver = null; @@ -266,31 +245,12 @@ /** Reacts when the home modules' specific module type is disabled or enabled. */ void onModuleConfigChanged(@ModuleType int moduleType, boolean isEnabled) { + // Updates the enabled module list. + mMediator.onModuleConfigChanged(moduleType, isEnabled); + // The single tab module and the tab resumption modules are controlled by the same // preference key. Once it is turned on or off, both modules will be enabled or disabled. - if (isEnabled) { - // If the mEnabledModuleSet hasn't been initialized yet, skip here. - if (mEnabledModuleSet != null) { - if (moduleType == ModuleType.SINGLE_TAB - || moduleType == ModuleType.TAB_RESUMPTION) { - mEnabledModuleSet.add(ModuleType.SINGLE_TAB); - mEnabledModuleSet.add(ModuleType.TAB_RESUMPTION); - } else { - mEnabledModuleSet.add(moduleType); - } - } - } else { - // If the mEnabledModuleSet hasn't been initialized yet, skip here. - if (mEnabledModuleSet != null) { - if (moduleType == ModuleType.SINGLE_TAB - || moduleType == ModuleType.TAB_RESUMPTION) { - mEnabledModuleSet.remove(ModuleType.SINGLE_TAB); - mEnabledModuleSet.remove(ModuleType.TAB_RESUMPTION); - } else { - mEnabledModuleSet.remove(moduleType); - } - } - + if (!isEnabled) { removeModule(moduleType); if (moduleType == ModuleType.SINGLE_TAB) { removeModule(ModuleType.TAB_RESUMPTION); @@ -377,6 +337,12 @@ return mModuleDelegateHost.getTrackingTab(); } + @Override + public void prepareBuildAndShow() { + maybeSetUpAdapter(); + mRecyclerView.addOnScrollListener(mOnScrollListener); + } + // OnViewCreatedCallback implementation. @Override @@ -423,138 +389,6 @@ } /** - * This method returns the list of enabled modules based on surface (Start/NTP). The list - * returned is the intersection of modules that are enabled and available for the surface. - */ - @VisibleForTesting - List<Integer> getFixedModuleList() { - List<Integer> generalModuleList = new ArrayList<>(); - - boolean addAll = HomeModulesMetricsUtils.HOME_MODULES_SHOW_ALL_MODULES.getValue(); - boolean combineTabs = HomeModulesMetricsUtils.HOME_MODULES_COMBINE_TABS.getValue(); - boolean isHomeSurface = mModuleDelegateHost.isHomeSurface(); - boolean isTabResumptionEnabled = ChromeFeatureList.sTabResumptionModuleAndroid.isEnabled(); - - generalModuleList.add(ModuleType.PRICE_CHANGE); - if (combineTabs) { - if (isTabResumptionEnabled) { - generalModuleList.add(ModuleType.TAB_RESUMPTION); - } else { - generalModuleList.add(ModuleType.SINGLE_TAB); - } - } else { - if (addAll || isHomeSurface) { - generalModuleList.add(ModuleType.SINGLE_TAB); - } - // Make tab resumption module NTP-only. - if (addAll - || (!isHomeSurface - && ChromeFeatureList.sTabResumptionModuleAndroid.isEnabled())) { - generalModuleList.add(ModuleType.TAB_RESUMPTION); - } - } - - ensureEnabledModuleSetCreated(); - List<Integer> moduleList = new ArrayList<>(); - for (int i = 0; i < generalModuleList.size(); i++) { - @ModuleType int currentModuleType = generalModuleList.get(i); - if (mEnabledModuleSet.contains(currentModuleType)) { - moduleList.add(currentModuleType); - } - } - return moduleList; - } - - private void buildModulesAndShow( - List<Integer> moduleList, - Callback<Boolean> onHomeModulesShownCallback, - long durationMs) { - // Record only if ranking is fetched from segmentation service. - if (durationMs > 0) { - HomeModulesMetricsUtils.recordSegmentationFetchRankingDuration( - getHostSurfaceType(), durationMs); - } - if (moduleList == null) { - onHomeModulesShownCallback.onResult(false); - return; - } - - maybeSetUpAdapter(); - - mRecyclerView.addOnScrollListener(mOnScrollListener); - mMediator.buildModulesAndShow( - moduleList, - this, - (isVisible) -> { - onHomeModulesShownCallback.onResult(isVisible); - }); - } - - private void getSegmentationRanking(Callback<Boolean> onHomeModulesShownCallback) { - PredictionOptions options = new PredictionOptions(false); - long segmentationServiceCallTimeMs = SystemClock.elapsedRealtime(); - mSegmentationPlatformService.getClassificationResult( - "android_home_module_ranker", - options, - /* inputContext= */ null, - result -> { - // It is possible that the result is received after the magic stack has been - // hidden, exit now. - long durationMs = SystemClock.elapsedRealtime() - segmentationServiceCallTimeMs; - if (mHomeModulesConfigManager == null) { - HomeModulesMetricsUtils.recordSegmentationFetchRankingDuration( - getHostSurfaceType(), durationMs); - return; - } - buildModulesAndShow( - onGetClassificationResult(result), - onHomeModulesShownCallback, - durationMs); - }); - } - - @VisibleForTesting - List<Integer> onGetClassificationResult(ClassificationResult result) { - List<Integer> moduleList; - // If segmentation service fails, fallback to return fixed module list. - if (result.status != PredictionStatus.SUCCEEDED || result.orderedLabels.isEmpty()) { - moduleList = getFixedModuleList(); - } else { - moduleList = filterEnabledModuleList(result.orderedLabels); - } - return moduleList; - } - - /** - * This method gets the list of enabled modules based on surface (Start/NTP) and returns the - * list of modules which are present in both the previous list and the module list from the - * model. - */ - private List<Integer> filterEnabledModuleList(List<String> orderedModuleLabels) { - List<Integer> localEnabledModuleList = getFixedModuleList(); - List<Integer> moduleList = new ArrayList<>(); - for (String label : orderedModuleLabels) { - @ModuleType - int currentModuleType = HomeModulesMetricsUtils.convertLabelToModuleType(label); - if (localEnabledModuleList.contains(currentModuleType)) { - moduleList.add(currentModuleType); - } - } - return moduleList; - } - - /** - * Initializes the mEnabledModuleSet if hasn't yet. The mEnabledModuleSet should only be created - * after Profile is ready. - */ - @VisibleForTesting - void ensureEnabledModuleSetCreated() { - if (mEnabledModuleSet != null) return; - - mEnabledModuleSet = mHomeModulesConfigManager.getEnabledModuleSet(); - } - - /** * Records whether the magic stack is scrollable and has been scrolled or not before it is * hidden or destroyed and remove the on scroll listener. */ @@ -572,7 +406,15 @@ mAdapter = null; } + private SegmentationPlatformService getSegmentationPlatformService() { + return SegmentationPlatformServiceFactory.getForProfile(mProfileSupplier.get()); + } + void setMediatorForTesting(HomeModulesMediator mediator) { mMediator = mediator; } + + List<Integer> getFixedModuleListForTesting() { + return mMediator.getFixedModuleList(); + } }
diff --git a/chrome/browser/magic_stack/android/java/src/org/chromium/chrome/browser/magic_stack/HomeModulesMediator.java b/chrome/browser/magic_stack/android/java/src/org/chromium/chrome/browser/magic_stack/HomeModulesMediator.java index 5546367..a9054c9 100644 --- a/chrome/browser/magic_stack/android/java/src/org/chromium/chrome/browser/magic_stack/HomeModulesMediator.java +++ b/chrome/browser/magic_stack/android/java/src/org/chromium/chrome/browser/magic_stack/HomeModulesMediator.java
@@ -12,18 +12,26 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.Callback; +import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.magic_stack.ModuleDelegate.ModuleType; import org.chromium.chrome.browser.util.BrowserUiUtils.HostSurface; +import org.chromium.components.segmentation_platform.ClassificationResult; +import org.chromium.components.segmentation_platform.PredictionOptions; +import org.chromium.components.segmentation_platform.SegmentationPlatformService; +import org.chromium.components.segmentation_platform.prediction_status.PredictionStatus; import org.chromium.ui.modelutil.MVCListAdapter.ModelList; import org.chromium.ui.modelutil.PropertyModel; import org.chromium.ui.modelutil.SimpleRecyclerViewAdapter; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** The mediator which implements the logic to add, update and remove modules. */ public class HomeModulesMediator { + private static final int INVALID_INDEX = -1; /** Time to wait before rejecting any module response in milliseconds. */ @@ -31,6 +39,8 @@ private final ModelList mModel; private final ModuleRegistry mModuleRegistry; + private final ModuleDelegateHost mModuleDelegateHost; + private final HomeModulesConfigManager mHomeModulesConfigManager; /** A map of <ModuleType, ModuleProvider>. */ private final Map<Integer, ModuleProvider> mModuleTypeToModuleProviderMap = new HashMap<>(); @@ -65,13 +75,65 @@ private long[] mShowModuleStartTimeMs; private List<Integer> mModuleListToShow; private @HostSurface int mHostSurface; + private SegmentationPlatformService mSegmentationPlatformService; + private Set<Integer> mEnabledModuleSet; /** * @param model The instance of {@link ModelList} of the RecyclerView. */ - public HomeModulesMediator(@NonNull ModelList model, @NonNull ModuleRegistry moduleRegistry) { + public HomeModulesMediator( + @NonNull ModelList model, + @NonNull ModuleRegistry moduleRegistry, + @NonNull ModuleDelegateHost moduleDelegateHost, + @NonNull HomeModulesConfigManager homeModulesConfigManager) { mModel = model; mModuleRegistry = moduleRegistry; + mModuleDelegateHost = moduleDelegateHost; + mHomeModulesConfigManager = homeModulesConfigManager; + } + + /** Shows the magic stack with profile ready. */ + void showModules( + Callback<Boolean> onHomeModulesShownCallback, + ModuleDelegate moduleDelegate, + SegmentationPlatformService segmentationPlatformService) { + mSegmentationPlatformService = segmentationPlatformService; + if (mSegmentationPlatformService == null + || !ChromeFeatureList.isEnabled( + ChromeFeatureList.SEGMENTATION_PLATFORM_ANDROID_HOME_MODULE_RANKER)) { + buildModulesAndShow( + getFixedModuleList(), + moduleDelegate, + onHomeModulesShownCallback, + /* durationMs= */ 0); + return; + } + getSegmentationRanking(moduleDelegate, onHomeModulesShownCallback); + } + + private void buildModulesAndShow( + List<Integer> moduleList, + ModuleDelegate moduleDelegate, + Callback<Boolean> onHomeModulesShownCallback, + long durationMs) { + // Record only if ranking is fetched from segmentation service. + if (durationMs > 0) { + HomeModulesMetricsUtils.recordSegmentationFetchRankingDuration( + mModuleDelegateHost.getHostSurfaceType(), durationMs); + } + if (moduleList == null) { + onHomeModulesShownCallback.onResult(false); + return; + } + + moduleDelegate.prepareBuildAndShow(); + + buildModulesAndShow( + moduleList, + moduleDelegate, + (isVisible) -> { + onHomeModulesShownCallback.onResult(isVisible); + }); } /** @@ -80,6 +142,7 @@ * @param moduleList The list of sorted modules to show. * @param moduleDelegate The instance of the magic stack {@link ModuleDelegate}. */ + @VisibleForTesting void buildModulesAndShow( @NonNull @ModuleType List<Integer> moduleList, @NonNull ModuleDelegate moduleDelegate, @@ -236,7 +299,9 @@ private void updateRecyclerView( @ModuleType int moduleType, int index, @NonNull PropertyModel propertyModel) { int position = findModuleIndexInRecyclerView(moduleType, index); - if (position == INVALID_INDEX) return; + if (position == INVALID_INDEX) { + return; + } mModel.update(position, new SimpleRecyclerViewAdapter.ListItem(moduleType, propertyModel)); } @@ -262,7 +327,9 @@ /** Adds the cached responses to the RecyclerView if exist. */ private void maybeMoveEarlyReceivedModulesToRecyclerView() { while (mModuleResultsWaitingIndex < mModuleFetchResultsIndicator.length) { - if (mModuleFetchResultsIndicator[mModuleResultsWaitingIndex] == null) return; + if (mModuleFetchResultsIndicator[mModuleResultsWaitingIndex] == null) { + return; + } if (mModuleFetchResultsIndicator[mModuleResultsWaitingIndex]) { append(mModuleFetchResultsCache[mModuleResultsWaitingIndex]); @@ -276,7 +343,9 @@ void onModuleFetchTimeOut() { // It is possible that onModuleFetchTimeOut() is called after home modules hide, early exits // here. - if (!mIsFetchingModules) return; + if (!mIsFetchingModules) { + return; + } // Will reject any late responses from modules. mIsFetchingModules = false; @@ -352,7 +421,9 @@ */ private boolean remove(@ModuleType int moduleType, int index) { int position = findModuleIndexInRecyclerView(moduleType, index); - if (position == INVALID_INDEX) return false; + if (position == INVALID_INDEX) { + return false; + } mModel.removeAt(position); ModuleProvider moduleProvider = mModuleTypeToModuleProviderMap.get(moduleType); @@ -372,7 +443,9 @@ * stack. */ void hide() { - if (!mIsShown) return; + if (!mIsShown) { + return; + } mIsFetchingModules = false; mIsShown = false; @@ -429,6 +502,164 @@ } } + /** + * Updates the mEnabledModuleSet when the home modules' specific module type is disabled or + * enabled. + */ + void onModuleConfigChanged(@ModuleType int moduleType, boolean isEnabled) { + // The single tab module and the tab resumption modules are controlled by the same + // preference key. Once it is turned on or off, both modules will be enabled or disabled. + + if (isEnabled) { + // If the mEnabledModuleSet hasn't been initialized yet, skip here. + if (mEnabledModuleSet != null) { + if (moduleType == ModuleType.SINGLE_TAB + || moduleType == ModuleType.TAB_RESUMPTION) { + mEnabledModuleSet.add(ModuleType.SINGLE_TAB); + mEnabledModuleSet.add(ModuleType.TAB_RESUMPTION); + } else { + mEnabledModuleSet.add(moduleType); + } + } + } else { + // If the mEnabledModuleSet hasn't been initialized yet, skip here. + if (mEnabledModuleSet != null) { + if (moduleType == ModuleType.SINGLE_TAB + || moduleType == ModuleType.TAB_RESUMPTION) { + mEnabledModuleSet.remove(ModuleType.SINGLE_TAB); + mEnabledModuleSet.remove(ModuleType.TAB_RESUMPTION); + } else { + mEnabledModuleSet.remove(moduleType); + } + } + } + } + + /** + * This method returns the list of enabled modules based on surface (Start/NTP). The list + * returned is the intersection of modules that are enabled and available for the surface. + */ + @VisibleForTesting + List<Integer> getFixedModuleList() { + List<Integer> generalModuleList = new ArrayList<>(); + + boolean addAll = HomeModulesMetricsUtils.HOME_MODULES_SHOW_ALL_MODULES.getValue(); + boolean isHomeSurface = mModuleDelegateHost.isHomeSurface(); + + generalModuleList.add(ModuleType.PRICE_CHANGE); + if (combinedTabModules()) { + generalModuleList.add(ModuleType.TAB_RESUMPTION); + } else { + if (isHomeSurface) { + generalModuleList.add(ModuleType.SINGLE_TAB); + } + // Make tab resumption module NTP-only. + if (addAll + || (!isHomeSurface + && ChromeFeatureList.sTabResumptionModuleAndroid.isEnabled())) { + generalModuleList.add(ModuleType.TAB_RESUMPTION); + } + } + + ensureEnabledModuleSetCreated(); + List<Integer> moduleList = new ArrayList<>(); + for (int i = 0; i < generalModuleList.size(); i++) { + @ModuleType int currentModuleType = generalModuleList.get(i); + if (mEnabledModuleSet.contains(currentModuleType)) { + moduleList.add(currentModuleType); + } + } + return moduleList; + } + + private void getSegmentationRanking( + ModuleDelegate moduleDelegate, Callback<Boolean> onHomeModulesShownCallback) { + PredictionOptions options = new PredictionOptions(false); + long segmentationServiceCallTimeMs = SystemClock.elapsedRealtime(); + mSegmentationPlatformService.getClassificationResult( + "android_home_module_ranker", + options, + /* inputContext= */ null, + result -> { + // It is possible that the result is received after the magic stack has been + // hidden, exit now. + long durationMs = SystemClock.elapsedRealtime() - segmentationServiceCallTimeMs; + if (mHomeModulesConfigManager == null) { + HomeModulesMetricsUtils.recordSegmentationFetchRankingDuration( + mModuleDelegateHost.getHostSurfaceType(), durationMs); + return; + } + buildModulesAndShow( + onGetClassificationResult(result), + moduleDelegate, + onHomeModulesShownCallback, + durationMs); + }); + } + + @VisibleForTesting + List<Integer> onGetClassificationResult(ClassificationResult result) { + List<Integer> moduleList; + // If segmentation service fails, fallback to return fixed module list. + if (result.status != PredictionStatus.SUCCEEDED || result.orderedLabels.isEmpty()) { + moduleList = getFixedModuleList(); + } else { + moduleList = filterEnabledModuleList(result.orderedLabels); + } + return moduleList; + } + + /** + * This method gets the list of enabled modules based on surface (Start/NTP) and returns the + * list of modules which are present in both the previous list and the module list from the + * model. + */ + private List<Integer> filterEnabledModuleList(List<String> orderedModuleLabels) { + boolean addAll = HomeModulesMetricsUtils.HOME_MODULES_SHOW_ALL_MODULES.getValue(); + boolean isHomeSurface = mModuleDelegateHost.isHomeSurface(); + boolean combineTabModules = combinedTabModules(); + + ensureEnabledModuleSetCreated(); + List<Integer> moduleList = new ArrayList<>(); + + for (String label : orderedModuleLabels) { + @ModuleType + int currentModuleType = HomeModulesMetricsUtils.convertLabelToModuleType(label); + if (combineTabModules) { + if (currentModuleType == ModuleType.SINGLE_TAB) { + continue; + } + } else { + if (isHomeSurface) { + if (!addAll && currentModuleType == ModuleType.TAB_RESUMPTION) { + continue; + } + } else if (!addAll && currentModuleType == ModuleType.SINGLE_TAB) { + continue; + } + } + if (mEnabledModuleSet.contains(currentModuleType)) { + moduleList.add(currentModuleType); + } + } + return moduleList; + } + + @VisibleForTesting + void ensureEnabledModuleSetCreated() { + if (mEnabledModuleSet != null) { + return; + } + + mEnabledModuleSet = mHomeModulesConfigManager.getEnabledModuleSet(); + } + + @VisibleForTesting + boolean combinedTabModules() { + return HomeModulesMetricsUtils.HOME_MODULES_COMBINE_TABS.getValue() + && ChromeFeatureList.sTabResumptionModuleAndroid.isEnabled(); + } + Map<Integer, ModuleProvider> getModuleTypeToModuleProviderMapForTesting() { return mModuleTypeToModuleProviderMap; }
diff --git a/chrome/browser/magic_stack/android/java/src/org/chromium/chrome/browser/magic_stack/ModuleDelegate.java b/chrome/browser/magic_stack/android/java/src/org/chromium/chrome/browser/magic_stack/ModuleDelegate.java index c413f7c9..281a41a 100644 --- a/chrome/browser/magic_stack/android/java/src/org/chromium/chrome/browser/magic_stack/ModuleDelegate.java +++ b/chrome/browser/magic_stack/android/java/src/org/chromium/chrome/browser/magic_stack/ModuleDelegate.java
@@ -90,4 +90,7 @@ /** Gets the local Tab that is showing on the magic stack. */ @Nullable Tab getTrackingTab(); + + /** Called before build and show modules. */ + void prepareBuildAndShow(); }
diff --git a/chrome/browser/magic_stack/android/junit/src/org/chromium/chrome/browser/magic_stack/HomeModulesCoordinatorUnitTest.java b/chrome/browser/magic_stack/android/junit/src/org/chromium/chrome/browser/magic_stack/HomeModulesCoordinatorUnitTest.java index 04fd77bf..14c1425 100644 --- a/chrome/browser/magic_stack/android/junit/src/org/chromium/chrome/browser/magic_stack/HomeModulesCoordinatorUnitTest.java +++ b/chrome/browser/magic_stack/android/junit/src/org/chromium/chrome/browser/magic_stack/HomeModulesCoordinatorUnitTest.java
@@ -49,7 +49,6 @@ import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.util.Features; import org.chromium.base.test.util.Features.DisableFeatures; -import org.chromium.base.test.util.Features.EnableFeatures; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.magic_stack.ModuleDelegate.ModuleType; import org.chromium.chrome.browser.profiles.Profile; @@ -61,9 +60,7 @@ import org.chromium.components.browser_ui.widget.displaystyle.UiConfig; import org.chromium.components.browser_ui.widget.displaystyle.UiConfig.DisplayStyle; import org.chromium.components.browser_ui.widget.displaystyle.VerticalDisplayStyle; -import org.chromium.components.segmentation_platform.ClassificationResult; import org.chromium.components.segmentation_platform.SegmentationPlatformService; -import org.chromium.components.segmentation_platform.prediction_status.PredictionStatus; import org.chromium.ui.base.DeviceFormFactor; import java.util.HashSet; @@ -206,192 +203,6 @@ @Test @SmallTest - @DisableFeatures({ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID}) - public void testGetModuleList_Default() { - when(mHomeModulesConfigManager.getEnabledModuleSet()) - .thenReturn( - new HashSet<>( - Set.of( - ModuleType.SINGLE_TAB, - ModuleType.PRICE_CHANGE, - ModuleType.TAB_RESUMPTION))); - assertFalse(DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)); - mCoordinator = createCoordinator(/* skipInitProfile= */ false); - - when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); - List<Integer> expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB); - assertEquals(expectedModuleList, mCoordinator.getFixedModuleList()); - - when(mModuleDelegateHost.isHomeSurface()).thenReturn(false); - expectedModuleList = List.of(ModuleType.PRICE_CHANGE); - assertEquals(expectedModuleList, mCoordinator.getFixedModuleList()); - } - - @Test - @SmallTest - @EnableFeatures({ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID}) - public void testGetModuleList_DefaultWithTabResumption() { - when(mHomeModulesConfigManager.getEnabledModuleSet()) - .thenReturn( - new HashSet<>( - Set.of( - ModuleType.SINGLE_TAB, - ModuleType.PRICE_CHANGE, - ModuleType.TAB_RESUMPTION))); - assertFalse(DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)); - mCoordinator = createCoordinator(/* skipInitProfile= */ false); - - when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); - List<Integer> expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB); - assertEquals(expectedModuleList, mCoordinator.getFixedModuleList()); - - when(mModuleDelegateHost.isHomeSurface()).thenReturn(false); - expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.TAB_RESUMPTION); - assertEquals(expectedModuleList, mCoordinator.getFixedModuleList()); - } - - @Test - @SmallTest - @DisableFeatures({ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID}) - @EnableFeatures({ChromeFeatureList.SEGMENTATION_PLATFORM_ANDROID_HOME_MODULE_RANKER}) - public void testGetModuleList_Segmentation() { - when(mHomeModulesConfigManager.getEnabledModuleSet()) - .thenReturn( - new HashSet<>( - Set.of( - ModuleType.SINGLE_TAB, - ModuleType.PRICE_CHANGE, - ModuleType.TAB_RESUMPTION))); - assertFalse(DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)); - mCoordinator = createCoordinator(/* skipInitProfile= */ false); - ClassificationResult classificationResult = - new ClassificationResult( - PredictionStatus.SUCCEEDED, - new String[] {"PriceChange", "SingleTab", "TabResumption"}); - - when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); - List<Integer> expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB); - assertEquals( - expectedModuleList, mCoordinator.onGetClassificationResult(classificationResult)); - - when(mModuleDelegateHost.isHomeSurface()).thenReturn(false); - expectedModuleList = List.of(ModuleType.PRICE_CHANGE); - assertEquals( - expectedModuleList, mCoordinator.onGetClassificationResult(classificationResult)); - } - - @Test - @SmallTest - @EnableFeatures({ - ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID, - ChromeFeatureList.SEGMENTATION_PLATFORM_ANDROID_HOME_MODULE_RANKER - }) - public void testGetModuleList_SegmentationWithTabResumption() { - when(mHomeModulesConfigManager.getEnabledModuleSet()) - .thenReturn( - new HashSet<>( - Set.of( - ModuleType.SINGLE_TAB, - ModuleType.PRICE_CHANGE, - ModuleType.TAB_RESUMPTION))); - assertFalse(DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)); - mCoordinator = createCoordinator(/* skipInitProfile= */ false); - ClassificationResult classificationResult = - new ClassificationResult( - PredictionStatus.SUCCEEDED, - new String[] {"PriceChange", "SingleTab", "TabResumption"}); - - when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); - List<Integer> expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB); - assertEquals( - expectedModuleList, mCoordinator.onGetClassificationResult(classificationResult)); - - when(mModuleDelegateHost.isHomeSurface()).thenReturn(false); - expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.TAB_RESUMPTION); - assertEquals( - expectedModuleList, mCoordinator.onGetClassificationResult(classificationResult)); - } - - @Test - @SmallTest - public void testGetModuleList() { - when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); - when(mHomeModulesConfigManager.getEnabledModuleSet()) - .thenReturn(new HashSet<>(Set.of(ModuleType.SINGLE_TAB))); - assertFalse(DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)); - mCoordinator = createCoordinator(/* skipInitProfile= */ false); - List<Integer> expectedModuleList = List.of(ModuleType.SINGLE_TAB); - assertEquals(expectedModuleList, mCoordinator.getFixedModuleList()); - } - - @Test - @SmallTest - public void testGetModuleList_AllModules() { - HomeModulesMetricsUtils.HOME_MODULES_SHOW_ALL_MODULES.setForTesting(true); - when(mHomeModulesConfigManager.getEnabledModuleSet()) - .thenReturn( - new HashSet<>( - Set.of( - ModuleType.SINGLE_TAB, - ModuleType.PRICE_CHANGE, - ModuleType.TAB_RESUMPTION))); - assertFalse(DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)); - mCoordinator = createCoordinator(/* skipInitProfile= */ false); - - when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); - List<Integer> expectedModuleList = - List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB, ModuleType.TAB_RESUMPTION); - assertEquals(expectedModuleList, mCoordinator.getFixedModuleList()); - - when(mModuleDelegateHost.isHomeSurface()).thenReturn(false); - assertEquals(expectedModuleList, mCoordinator.getFixedModuleList()); - } - - @Test - @SmallTest - @EnableFeatures({ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID}) - public void testGetModuleList_CombineTabs_TabResumptionEnabled() { - HomeModulesMetricsUtils.HOME_MODULES_COMBINE_TABS.setForTesting(true); - when(mHomeModulesConfigManager.getEnabledModuleSet()) - .thenReturn( - new HashSet<>( - Set.of( - ModuleType.SINGLE_TAB, - ModuleType.PRICE_CHANGE, - ModuleType.TAB_RESUMPTION))); - assertFalse(DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)); - mCoordinator = createCoordinator(/* skipInitProfile= */ false); - - // Verifies that the tab resumption module will be added to the list without the single tab - // module. - List<Integer> expectedModuleList = - List.of(ModuleType.PRICE_CHANGE, ModuleType.TAB_RESUMPTION); - assertEquals(expectedModuleList, mCoordinator.getFixedModuleList()); - } - - @Test - @SmallTest - @DisableFeatures({ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID}) - public void testGetModuleList_CombineTabs_TabResumptionDisabled() { - HomeModulesMetricsUtils.HOME_MODULES_COMBINE_TABS.setForTesting(true); - when(mHomeModulesConfigManager.getEnabledModuleSet()) - .thenReturn( - new HashSet<>( - Set.of( - ModuleType.SINGLE_TAB, - ModuleType.PRICE_CHANGE, - ModuleType.TAB_RESUMPTION))); - assertFalse(DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)); - mCoordinator = createCoordinator(/* skipInitProfile= */ false); - - // Verifies that the single tab module will be added to the list if the tab resumption - // feature flag is disabled. - List<Integer> expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB); - assertEquals(expectedModuleList, mCoordinator.getFixedModuleList()); - } - - @Test - @SmallTest public void testOnModuleConfigChanged() { assertFalse(DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)); when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); @@ -400,14 +211,17 @@ verify(mHomeModulesConfigManager).addListener(mHomeModulesStateListener.capture()); List<Integer> expectedModuleListBeforeHidingModule = List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB); - assertEquals(expectedModuleListBeforeHidingModule, mCoordinator.getFixedModuleList()); + assertEquals( + expectedModuleListBeforeHidingModule, mCoordinator.getFixedModuleListForTesting()); mHomeModulesStateListener.getValue().onModuleConfigChanged(ModuleType.PRICE_CHANGE, false); List<Integer> expectedModuleListAfterHidingModule = List.of(ModuleType.SINGLE_TAB); - assertEquals(expectedModuleListAfterHidingModule, mCoordinator.getFixedModuleList()); + assertEquals( + expectedModuleListAfterHidingModule, mCoordinator.getFixedModuleListForTesting()); mHomeModulesStateListener.getValue().onModuleConfigChanged(ModuleType.PRICE_CHANGE, true); - assertEquals(expectedModuleListBeforeHidingModule, mCoordinator.getFixedModuleList()); + assertEquals( + expectedModuleListBeforeHidingModule, mCoordinator.getFixedModuleListForTesting()); mCoordinator.destroy(); verify(mHomeModulesConfigManager).removeListener(mHomeModulesStateListener.capture()); @@ -446,12 +260,10 @@ ChromeFeatureList.SEGMENTATION_PLATFORM_ANDROID_HOME_MODULE_RANKER }) public void testRecordMagicStackScroll_Scrolled() { - when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); mCoordinator = createCoordinator(/* skipInitProfile= */ true); - Callback<Boolean> callback = Mockito.mock(Callback.class); - when(mProfileSupplier.hasValue()).thenReturn(true); mCoordinator.setMediatorForTesting(mMediator); - mCoordinator.show(callback); + + mCoordinator.prepareBuildAndShow(); // Besides the onScrollListener added in {@link HomeModulesCoordinator}, there is another // one added in {@link SnapHelper}. @@ -500,7 +312,6 @@ mHomeModulesConfigManager, mProfileSupplier, mModuleRegistry); - homeModulesCoordinator.ensureEnabledModuleSetCreated(); return homeModulesCoordinator; } }
diff --git a/chrome/browser/magic_stack/android/junit/src/org/chromium/chrome/browser/magic_stack/HomeModulesMediatorUnitTest.java b/chrome/browser/magic_stack/android/junit/src/org/chromium/chrome/browser/magic_stack/HomeModulesMediatorUnitTest.java index 2f11e7b7..a21e185 100644 --- a/chrome/browser/magic_stack/android/junit/src/org/chromium/chrome/browser/magic_stack/HomeModulesMediatorUnitTest.java +++ b/chrome/browser/magic_stack/android/junit/src/org/chromium/chrome/browser/magic_stack/HomeModulesMediatorUnitTest.java
@@ -25,6 +25,8 @@ import org.junit.Test; import org.junit.rules.TestRule; import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.Spy; @@ -35,19 +37,28 @@ import org.chromium.base.Callback; import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.util.Features; +import org.chromium.base.test.util.Features.DisableFeatures; +import org.chromium.base.test.util.Features.EnableFeatures; +import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.magic_stack.HomeModulesConfigManager.HomeModulesStateListener; +import org.chromium.chrome.browser.magic_stack.ModuleDelegate.ModuleType; import org.chromium.chrome.browser.util.BrowserUiUtils.HostSurface; +import org.chromium.components.segmentation_platform.ClassificationResult; import org.chromium.ui.modelutil.MVCListAdapter.ListItem; import org.chromium.ui.modelutil.MVCListAdapter.ModelList; import org.chromium.ui.modelutil.PropertyModel; import org.chromium.ui.modelutil.SimpleRecyclerViewAdapter; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; /** Unit tests for {@link HomeModulesMediator}. */ @RunWith(BaseRobolectricTestRunner.class) @Config(manifest = Config.NONE) public class HomeModulesMediatorUnitTest { + @Rule public TestRule mProcessor = new Features.JUnitProcessor(); @Rule public MockitoRule mMockitoRule = MockitoJUnit.rule(); @@ -55,7 +66,10 @@ @Mock private Callback<Boolean> mSetVisibilityCallback; @Mock private ModuleDelegate mModuleDelegate; @Mock private ModuleRegistry mModuleRegistry; + @Mock private ModuleDelegateHost mModuleDelegateHost; + @Mock private HomeModulesConfigManager mHomeModulesConfigManager; @Spy private ModelList mModel; + @Captor private ArgumentCaptor<HomeModulesStateListener> mHomeModulesStateListener; private int[] mModuleTypeList; private ListItem[] mListItems; @@ -80,7 +94,9 @@ mModuleProviders[i] = Mockito.mock(ModuleProvider.class); } when(mModuleDelegate.getHostSurfaceType()).thenReturn(mHostSurface); - mMediator = new HomeModulesMediator(mModel, mModuleRegistry); + mMediator = + new HomeModulesMediator( + mModel, mModuleRegistry, mModuleDelegateHost, mHomeModulesConfigManager); } @Test @@ -462,4 +478,231 @@ // After calling onModuleFetchTimeOut(), the mediator shouldn't throw any exception. mMediator.onModuleFetchTimeOut(); } + + @Test + @SmallTest + @DisableFeatures({ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID}) + public void testGetModuleList_Default() { + when(mHomeModulesConfigManager.getEnabledModuleSet()) + .thenReturn( + new HashSet<>( + Set.of( + ModuleType.SINGLE_TAB, + ModuleType.PRICE_CHANGE, + ModuleType.TAB_RESUMPTION))); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); + List<Integer> expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB); + assertEquals(expectedModuleList, mMediator.getFixedModuleList()); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(false); + expectedModuleList = List.of(ModuleType.PRICE_CHANGE); + assertEquals(expectedModuleList, mMediator.getFixedModuleList()); + } + + @Test + @SmallTest + @EnableFeatures({ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID}) + public void testGetModuleList_DefaultWithTabResumption() { + when(mHomeModulesConfigManager.getEnabledModuleSet()) + .thenReturn( + new HashSet<>( + Set.of( + ModuleType.SINGLE_TAB, + ModuleType.PRICE_CHANGE, + ModuleType.TAB_RESUMPTION))); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); + List<Integer> expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB); + assertEquals(expectedModuleList, mMediator.getFixedModuleList()); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(false); + expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.TAB_RESUMPTION); + assertEquals(expectedModuleList, mMediator.getFixedModuleList()); + } + + @Test + @SmallTest + @DisableFeatures({ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID}) + @EnableFeatures({ChromeFeatureList.SEGMENTATION_PLATFORM_ANDROID_HOME_MODULE_RANKER}) + public void testGetModuleList_Segmentation() { + when(mHomeModulesConfigManager.getEnabledModuleSet()) + .thenReturn(new HashSet<>(Set.of(ModuleType.SINGLE_TAB, ModuleType.PRICE_CHANGE))); + ClassificationResult classificationResult = + new ClassificationResult( + org.chromium.components.segmentation_platform.prediction_status + .PredictionStatus.SUCCEEDED, + new String[] {"PriceChange", "SingleTab", "TabResumption"}); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); + List<Integer> expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB); + assertEquals(expectedModuleList, mMediator.onGetClassificationResult(classificationResult)); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(false); + expectedModuleList = List.of(ModuleType.PRICE_CHANGE); + assertEquals(expectedModuleList, mMediator.onGetClassificationResult(classificationResult)); + } + + @Test + @SmallTest + @EnableFeatures({ + ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID, + ChromeFeatureList.SEGMENTATION_PLATFORM_ANDROID_HOME_MODULE_RANKER + }) + public void testGetModuleList_SegmentationWithTabResumption() { + when(mHomeModulesConfigManager.getEnabledModuleSet()) + .thenReturn( + new HashSet<>( + Set.of( + ModuleType.SINGLE_TAB, + ModuleType.PRICE_CHANGE, + ModuleType.TAB_RESUMPTION))); + ClassificationResult classificationResult = + new ClassificationResult( + org.chromium.components.segmentation_platform.prediction_status + .PredictionStatus.SUCCEEDED, + new String[] {"PriceChange", "SingleTab", "TabResumption"}); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); + List<Integer> expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB); + assertEquals(expectedModuleList, mMediator.onGetClassificationResult(classificationResult)); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(false); + expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.TAB_RESUMPTION); + assertEquals(expectedModuleList, mMediator.onGetClassificationResult(classificationResult)); + } + + @Test + @SmallTest + public void testGetModuleList() { + when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); + when(mHomeModulesConfigManager.getEnabledModuleSet()) + .thenReturn(new HashSet<>(Set.of(ModuleType.SINGLE_TAB))); + List<Integer> expectedModuleList = List.of(ModuleType.SINGLE_TAB); + assertEquals(expectedModuleList, mMediator.getFixedModuleList()); + } + + @Test + @SmallTest + public void testGetModuleList_AllModules() { + HomeModulesMetricsUtils.HOME_MODULES_SHOW_ALL_MODULES.setForTesting(true); + when(mHomeModulesConfigManager.getEnabledModuleSet()) + .thenReturn( + new HashSet<>( + Set.of( + ModuleType.SINGLE_TAB, + ModuleType.PRICE_CHANGE, + ModuleType.TAB_RESUMPTION))); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); + List<Integer> expectedModuleList = + List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB, ModuleType.TAB_RESUMPTION); + assertEquals(expectedModuleList, mMediator.getFixedModuleList()); + + // Verifies that the single tab module isn't shown if it isn't the home surface even with + // "show all modules" parameter is enabled. + when(mModuleDelegateHost.isHomeSurface()).thenReturn(false); + expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.TAB_RESUMPTION); + assertEquals(expectedModuleList, mMediator.getFixedModuleList()); + } + + @Test + @SmallTest + @EnableFeatures({ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID}) + @DisableFeatures({ChromeFeatureList.SEGMENTATION_PLATFORM_ANDROID_HOME_MODULE_RANKER}) + public void testGetModuleList_CombineTabs_TabResumptionEnabled() { + HomeModulesMetricsUtils.HOME_MODULES_COMBINE_TABS.setForTesting(true); + when(mHomeModulesConfigManager.getEnabledModuleSet()) + .thenReturn( + new HashSet<>( + Set.of( + ModuleType.SINGLE_TAB, + ModuleType.PRICE_CHANGE, + ModuleType.TAB_RESUMPTION))); + + // Verifies that the tab resumption module will be added to the list without the single tab + // module. + List<Integer> expectedModuleList = + List.of(ModuleType.PRICE_CHANGE, ModuleType.TAB_RESUMPTION); + assertEquals(expectedModuleList, mMediator.getFixedModuleList()); + } + + @Test + @SmallTest + @EnableFeatures({ + ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID, + ChromeFeatureList.SEGMENTATION_PLATFORM_ANDROID_HOME_MODULE_RANKER + }) + public void testGetModuleList_CombineTabs_TabResumptionEnabled_Segmentation() { + HomeModulesMetricsUtils.HOME_MODULES_COMBINE_TABS.setForTesting(true); + when(mHomeModulesConfigManager.getEnabledModuleSet()) + .thenReturn( + new HashSet<>( + Set.of( + ModuleType.SINGLE_TAB, + ModuleType.PRICE_CHANGE, + ModuleType.TAB_RESUMPTION))); + ClassificationResult classificationResult = + new ClassificationResult( + org.chromium.components.segmentation_platform.prediction_status + .PredictionStatus.SUCCEEDED, + new String[] {"PriceChange", "SingleTab", "TabResumption"}); + + // Verifies that the tab resumption module will be added to the list without the single tab + // module. + List<Integer> expectedModuleList = + List.of(ModuleType.PRICE_CHANGE, ModuleType.TAB_RESUMPTION); + assertEquals(expectedModuleList, mMediator.onGetClassificationResult(classificationResult)); + } + + @Test + @SmallTest + @DisableFeatures({ + ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID, + ChromeFeatureList.SEGMENTATION_PLATFORM_ANDROID_HOME_MODULE_RANKER + }) + public void testGetModuleList_CombineTabs_TabResumptionDisabled() { + HomeModulesMetricsUtils.HOME_MODULES_COMBINE_TABS.setForTesting(true); + when(mHomeModulesConfigManager.getEnabledModuleSet()) + .thenReturn(new HashSet<>(Set.of(ModuleType.SINGLE_TAB, ModuleType.PRICE_CHANGE))); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); + // Verifies that the single tab module will be added to the list if the tab resumption + // feature flag is disabled. + List<Integer> expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB); + assertEquals(expectedModuleList, mMediator.getFixedModuleList()); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(false); + // Verifies that the single tab module won't be added to the list if it isn't on home + // surface. + expectedModuleList = List.of(ModuleType.PRICE_CHANGE); + assertEquals(expectedModuleList, mMediator.getFixedModuleList()); + } + + @Test + @SmallTest + @DisableFeatures({ChromeFeatureList.TAB_RESUMPTION_MODULE_ANDROID}) + @EnableFeatures({ChromeFeatureList.SEGMENTATION_PLATFORM_ANDROID_HOME_MODULE_RANKER}) + public void testGetModuleList_CombineTabs_TabResumptionDisabled_Segmentation() { + HomeModulesMetricsUtils.HOME_MODULES_COMBINE_TABS.setForTesting(true); + when(mHomeModulesConfigManager.getEnabledModuleSet()) + .thenReturn(new HashSet<>(Set.of(ModuleType.SINGLE_TAB, ModuleType.PRICE_CHANGE))); + ClassificationResult classificationResult = + new ClassificationResult( + org.chromium.components.segmentation_platform.prediction_status + .PredictionStatus.SUCCEEDED, + new String[] {"PriceChange", "SingleTab", "TabResumption"}); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(true); + // Verifies that the single tab module will be added to the list if the tab resumption + // feature flag is disabled. + List<Integer> expectedModuleList = List.of(ModuleType.PRICE_CHANGE, ModuleType.SINGLE_TAB); + assertEquals(expectedModuleList, mMediator.onGetClassificationResult(classificationResult)); + + when(mModuleDelegateHost.isHomeSurface()).thenReturn(false); + // Verifies that the single tab module won't be added to the list if it isn't on home + // surface. + expectedModuleList = List.of(ModuleType.PRICE_CHANGE); + assertEquals(expectedModuleList, mMediator.onGetClassificationResult(classificationResult)); + } }
diff --git a/chrome/browser/media/router/BUILD.gn b/chrome/browser/media/router/BUILD.gn index 78c7aa9..bdbe4db4 100644 --- a/chrome/browser/media/router/BUILD.gn +++ b/chrome/browser/media/router/BUILD.gn
@@ -7,6 +7,8 @@ import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + declare_args() { # Set to true to build code that supports the Open Screen Protocol. # OSP is experimental and not yet feature-complete. @@ -383,10 +385,9 @@ } } -# TODO(crbug.com/40818202): Fails to link on Fuchsia builds. # TODO(issuetracker.google.com/236160471): CDDL compiler doesn't build # on Windows. -if (!is_fuchsia && !is_win) { +if (!is_win) { test("openscreen_unittests") { deps = [ "//base/test:run_all_unittests",
diff --git a/chrome/browser/media/router/discovery/BUILD.gn b/chrome/browser/media/router/discovery/BUILD.gn index 2f3c1aa3..51c2766 100644 --- a/chrome/browser/media/router/discovery/BUILD.gn +++ b/chrome/browser/media/router/discovery/BUILD.gn
@@ -5,6 +5,7 @@ import("//build/config/chromeos/ui_mode.gni") assert(!is_android) +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") static_library("discovery") { inputs = [ "$root_gen_dir/chrome/grit/generated_resources.h" ] @@ -93,10 +94,6 @@ sources += [ "discovery_network_list_posix.cc" ] } - if (is_fuchsia) { - sources += [ "discovery_network_list_fuchsia.cc" ] - } - if (is_mac) { sources += [ "discovery_network_list_wifi_mac.mm" ] frameworks = [ "CoreWLAN.framework" ]
diff --git a/chrome/browser/metrics/ukm_browsertest.cc b/chrome/browser/metrics/ukm_browsertest.cc index 5a496b4..c0d94f11 100644 --- a/chrome/browser/metrics/ukm_browsertest.cc +++ b/chrome/browser/metrics/ukm_browsertest.cc
@@ -355,10 +355,6 @@ // would need to remove the pre-existing TabModel and add a new one. // Having an empty TabModelList allows us to simply add the appropriate // TabModel. - if (base::FeatureList::IsEnabled(chrome::android::kAndroidTabDeclutter)) { - EXPECT_EQ(2U, TabModelList::models().size()); - TabModelList::RemoveTabModel(TabModelList::models()[1]); - } EXPECT_EQ(1U, TabModelList::models().size()); TabModelList::RemoveTabModel(TabModelList::models()[0]); EXPECT_EQ(0U, TabModelList::models().size());
diff --git a/chrome/browser/new_tab_page/modules/new_tab_page_modules_interactive_uitest.cc b/chrome/browser/new_tab_page/modules/new_tab_page_modules_interactive_uitest.cc index ab3e06d..ed2bb2d 100644 --- a/chrome/browser/new_tab_page/modules/new_tab_page_modules_interactive_uitest.cc +++ b/chrome/browser/new_tab_page/modules/new_tab_page_modules_interactive_uitest.cc
@@ -394,7 +394,7 @@ }; // TODO(crbug.com/335214502): Flaky on Linux/ChromeOS Tests. -#if BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) #define MAYBE_ClickingHistoryClustersRelatedSearchNavigatesToCorrectPage \ DISABLED_ClickingHistoryClustersRelatedSearchNavigatesToCorrectPage #else @@ -423,7 +423,7 @@ } // TODO(crbug.com/335214502): Flaky on Linux/ChromeOS Tests. -#if BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) #define MAYBE_ClickingHistoryClustersCartTileNavigatesToCorrectPage \ DISABLED_ClickingHistoryClustersCartTileNavigatesToCorrectPage #else
diff --git a/chrome/browser/optimization_guide/chrome_model_quality_logs_uploader_service.cc b/chrome/browser/optimization_guide/chrome_model_quality_logs_uploader_service.cc index 3072725f..1ce8b352 100644 --- a/chrome/browser/optimization_guide/chrome_model_quality_logs_uploader_service.cc +++ b/chrome/browser/optimization_guide/chrome_model_quality_logs_uploader_service.cc
@@ -24,15 +24,16 @@ #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" +namespace optimization_guide { + namespace { -void RecordUploadStatusHistogram( - optimization_guide::UserVisibleFeatureKey feature, - optimization_guide::ModelQualityLogsUploadStatus status) { +void RecordUploadStatusHistogram(UserVisibleFeatureKey feature, + ModelQualityLogsUploadStatus status) { base::UmaHistogramEnumeration( base::StrCat( {"OptimizationGuide.ModelQualityLogsUploaderService.UploadStatus.", - optimization_guide::GetStringNameForModelExecutionFeature(feature)}), + GetStringNameForModelExecutionFeature(feature)}), status); } @@ -52,8 +53,6 @@ } // namespace -namespace optimization_guide { - ChromeModelQualityLogsUploaderService::ChromeModelQualityLogsUploaderService( scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, PrefService* pref_service, @@ -66,14 +65,13 @@ ~ChromeModelQualityLogsUploaderService() = default; bool ChromeModelQualityLogsUploaderService::CanUploadLogs( - optimization_guide::UserVisibleFeatureKey feature) { - // Model quality logging requires user consent. Skip upload if consent is - // missing. + UserVisibleFeatureKey feature) { + // Model quality logging requires metrics reporting to be enabled. Skip upload + // if metrics reporting is disabled. if (!g_browser_process->GetMetricsServicesManager() ->IsMetricsConsentGiven()) { RecordUploadStatusHistogram( - feature, - optimization_guide::ModelQualityLogsUploadStatus::kNoMetricsConsent); + feature, ModelQualityLogsUploadStatus::kMetricsReportingDisabled); return false; } @@ -90,8 +88,7 @@ !model_execution_feature_controller_ ->ShouldFeatureBeCurrentlyAllowedForLogging(feature)) { RecordUploadStatusHistogram( - feature, optimization_guide::ModelQualityLogsUploadStatus:: - kDisabledDueToEnterprisePolicy); + feature, ModelQualityLogsUploadStatus::kDisabledDueToEnterprisePolicy); return false; }
diff --git a/chrome/browser/optimization_guide/model_execution/model_execution_browsertest.cc b/chrome/browser/optimization_guide/model_execution/model_execution_browsertest.cc index 1a283d25..91d47ba 100644 --- a/chrome/browser/optimization_guide/model_execution/model_execution_browsertest.cc +++ b/chrome/browser/optimization_guide/model_execution/model_execution_browsertest.cc
@@ -60,9 +60,7 @@ any_metadata->set_type_url("type.googleapis.com/" + compose_response.GetTypeName()); compose_response.SerializeToString(any_metadata->mutable_value()); - auto response_data = - optimization_guide::ParsedAnyMetadata<proto::ComposeResponse>( - *any_metadata); + auto response_data = ParsedAnyMetadata<proto::ComposeResponse>(*any_metadata); EXPECT_TRUE(response_data); return execute_response; } @@ -477,7 +475,7 @@ // The logs shouldn't be uploaded because there is no metrics consent. histogram_tester_.ExpectBucketCount( "OptimizationGuide.ModelQualityLogsUploaderService.UploadStatus.Compose", - optimization_guide::ModelQualityLogsUploadStatus::kNoMetricsConsent, 1); + ModelQualityLogsUploadStatus::kMetricsReportingDisabled, 1); } IN_PROC_BROWSER_TEST_F(ModelExecutionEnabledBrowserTest, @@ -564,9 +562,7 @@ // check. histogram_tester_.ExpectBucketCount( "OptimizationGuide.ModelQualityLogsUploaderService.UploadStatus.Compose", - optimization_guide::ModelQualityLogsUploadStatus:: - kDisabledDueToEnterprisePolicy, - 1); + ModelQualityLogsUploadStatus::kDisabledDueToEnterprisePolicy, 1); } class ModelExecutionInternalsPageBrowserTest @@ -714,7 +710,7 @@ // logging. histogram_tester_.ExpectBucketCount( "OptimizationGuide.ModelQualityLogsUploaderService.UploadStatus.Compose", - optimization_guide::ModelQualityLogsUploadStatus::kLoggingNotEnabled, 1); + ModelQualityLogsUploadStatus::kLoggingNotEnabled, 1); } class ModelExecutionNewFeaturesEnabledAutomaticallyTest @@ -747,7 +743,7 @@ browser()->profile()->GetPrefs()->SetInteger( prefs::kModelExecutionMainToggleSettingState, - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + static_cast<int>(prefs::FeatureOptInState::kEnabled)); EXPECT_TRUE(ShouldFeatureBeCurrentlyEnabledForUser( UserVisibleFeatureKey::kTabOrganization)); EXPECT_FALSE( @@ -802,7 +798,7 @@ auto* prefs = browser()->profile()->GetPrefs(); prefs->SetInteger( prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kTabOrganization), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); // Default policy value allows the feature. @@ -845,7 +841,7 @@ policy_provider_.UpdateChromePolicy(policies); prefs->SetInteger( prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kTabOrganization), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kTabOrganization)); EXPECT_TRUE(ShouldFeatureBeCurrentlyEnabledForUser( @@ -872,7 +868,7 @@ auto* prefs = browser()->profile()->GetPrefs(); prefs->SetInteger( prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kCompose), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); // Default policy value allows the feature. @@ -901,9 +897,7 @@ // The logs should be disabled via enterprise policy. histogram_tester_.ExpectBucketCount( "OptimizationGuide.ModelQualityLogsUploaderService.UploadStatus.Compose", - optimization_guide::ModelQualityLogsUploadStatus:: - kDisabledDueToEnterprisePolicy, - 1); + ModelQualityLogsUploadStatus::kDisabledDueToEnterprisePolicy, 1); // Enable via the enterprise policy and check upload. policies.Set( @@ -915,7 +909,7 @@ policy_provider_.UpdateChromePolicy(policies); prefs->SetInteger( prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kCompose), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kCompose)); EXPECT_TRUE( @@ -933,7 +927,7 @@ auto* prefs = browser()->profile()->GetPrefs(); prefs->SetInteger( prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kWallpaperSearch), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); // Default policy value allows the feature. @@ -966,7 +960,7 @@ policy_provider_.UpdateChromePolicy(policies); prefs->SetInteger( prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kWallpaperSearch), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kWallpaperSearch)); EXPECT_TRUE(ShouldFeatureBeCurrentlyEnabledForUser( @@ -980,7 +974,7 @@ auto* prefs = browser()->profile()->GetPrefs(); prefs->SetInteger( prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kTabOrganization), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); // EnableWithoutLogging via the enterprise policy. @@ -995,7 +989,7 @@ policy_provider_.UpdateChromePolicy(policies); prefs->SetInteger( prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kTabOrganization), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kTabOrganization)); EXPECT_TRUE(ShouldFeatureBeCurrentlyEnabledForUser(
diff --git a/chrome/browser/optimization_guide/optimization_guide_keyed_service.h b/chrome/browser/optimization_guide/optimization_guide_keyed_service.h index 4776f1b..808ccd4 100644 --- a/chrome/browser/optimization_guide/optimization_guide_keyed_service.h +++ b/chrome/browser/optimization_guide/optimization_guide_keyed_service.h
@@ -49,6 +49,7 @@ class ModelValidatorKeyedService; class OnDeviceModelComponentStateManager; class OptimizationGuideStore; +class OptimizationGuideKeyedServiceBrowserTest; class PredictionManager; class PredictionManagerBrowserTestBase; class PredictionModelDownloadClient; @@ -190,12 +191,12 @@ friend class ChromeBrowsingDataRemoverDelegate; friend class HintsFetcherBrowserTest; friend class OptimizationGuideInternalsUI; - friend class OptimizationGuideKeyedServiceBrowserTest; friend class OptimizationGuideMessageHandler; friend class OptimizationGuideWebContentsObserver; friend class optimization_guide::ModelExecutionEnabledBrowserTest; friend class optimization_guide::ModelExecutionLiveTest; friend class optimization_guide::ModelValidatorKeyedService; + friend class optimization_guide::OptimizationGuideKeyedServiceBrowserTest; friend class optimization_guide::PredictionManagerBrowserTestBase; friend class optimization_guide::PredictionModelDownloadClient; friend class optimization_guide::PredictionModelStoreBrowserTestBase;
diff --git a/chrome/browser/optimization_guide/optimization_guide_keyed_service_browsertest.cc b/chrome/browser/optimization_guide/optimization_guide_keyed_service_browsertest.cc index 65c6688..1f97771 100644 --- a/chrome/browser/optimization_guide/optimization_guide_keyed_service_browsertest.cc +++ b/chrome/browser/optimization_guide/optimization_guide_keyed_service_browsertest.cc
@@ -66,10 +66,10 @@ #include "services/network/public/cpp/network_connection_tracker.h" #include "services/network/test/test_network_connection_tracker.h" +namespace optimization_guide { namespace { -using optimization_guide::OnDeviceModelComponentStateManager; -using optimization_guide::proto::OptimizationType; +using proto::OptimizationType; class ScopedSetMetricsConsent { public: @@ -107,8 +107,7 @@ OptimizationGuideKeyedServiceFactory::GetForProfile( Profile::FromBrowserContext(web_contents()->GetBrowserContext())); service->CanApplyOptimization(navigation_handle->GetURL(), - optimization_guide::proto::NOSCRIPT, - std::move(callback_)); + proto::NOSCRIPT, std::move(callback_)); } } @@ -118,27 +117,24 @@ OptimizationGuideKeyedServiceFactory::GetForProfile( Profile::FromBrowserContext(web_contents()->GetBrowserContext())); last_can_apply_optimization_decision_ = service->CanApplyOptimization( - navigation_handle->GetURL(), optimization_guide::proto::NOSCRIPT, + navigation_handle->GetURL(), proto::NOSCRIPT, /*optimization_metadata=*/nullptr); } // Returns the last optimization guide decision that was returned by the // OptimizationGuideKeyedService's CanApplyOptimization() method. - optimization_guide::OptimizationGuideDecision - last_can_apply_optimization_decision() { + OptimizationGuideDecision last_can_apply_optimization_decision() { return last_can_apply_optimization_decision_; } - void set_callback( - optimization_guide::OptimizationGuideDecisionCallback callback) { + void set_callback(OptimizationGuideDecisionCallback callback) { callback_ = std::move(callback); } private: - optimization_guide::OptimizationGuideDecision - last_can_apply_optimization_decision_ = - optimization_guide::OptimizationGuideDecision::kUnknown; - optimization_guide::OptimizationGuideDecisionCallback callback_; + OptimizationGuideDecision last_can_apply_optimization_decision_ = + OptimizationGuideDecision::kUnknown; + OptimizationGuideDecisionCallback callback_; }; // A WebContentsObserver that specifically calls the new API that automatically @@ -148,7 +144,7 @@ public: OptimizationGuideNewApiConsumerWebContentsObserver( content::WebContents* web_contents, - optimization_guide::OptimizationGuideDecisionCallback callback) + OptimizationGuideDecisionCallback callback) : content::WebContentsObserver(web_contents), callback_(std::move(callback)) {} ~OptimizationGuideNewApiConsumerWebContentsObserver() override = default; @@ -160,13 +156,12 @@ OptimizationGuideKeyedServiceFactory::GetForProfile( Profile::FromBrowserContext(web_contents()->GetBrowserContext())); service->CanApplyOptimization(navigation_handle->GetURL(), - optimization_guide::proto::NOSCRIPT, - std::move(callback_)); + proto::NOSCRIPT, std::move(callback_)); } } private: - optimization_guide::OptimizationGuideDecisionCallback callback_; + OptimizationGuideDecisionCallback callback_; }; } // namespace @@ -175,8 +170,7 @@ : public InProcessBrowserTest { public: OptimizationGuideKeyedServiceDisabledBrowserTest() { - feature_list_.InitWithFeatures( - {}, {optimization_guide::features::kOptimizationHints}); + feature_list_.InitWithFeatures({}, {features::kOptimizationHints}); } private: @@ -197,21 +191,17 @@ network::TestNetworkConnectionTracker::CreateInstance()) { // Enable visibility of tab organization feature. scoped_feature_list_.InitWithFeaturesAndParameters( - {{optimization_guide::features::kOptimizationHints, {}}, - {optimization_guide::features::kOptimizationGuideModelExecution, {}}, - {optimization_guide::features::internal::kComposeSettingsVisibility, - {}}, - {optimization_guide::features::internal:: - kWallpaperSearchSettingsVisibility, - {}}, - {optimization_guide::features::kLogOnDeviceMetricsOnStartup, + {{features::kOptimizationHints, {}}, + {features::kOptimizationGuideModelExecution, {}}, + {features::internal::kComposeSettingsVisibility, {}}, + {features::internal::kWallpaperSearchSettingsVisibility, {}}, + {features::kLogOnDeviceMetricsOnStartup, { {"on_device_startup_metric_delay", "0"}, }}, - {optimization_guide::features::internal:: - kTabOrganizationSettingsVisibility, + {features::internal::kTabOrganizationSettingsVisibility, {{"allow_unsigned_user", "true"}}}}, - {optimization_guide::features::internal::kWallpaperSearchGraduated}); + {features::internal::kWallpaperSearchGraduated}); } OptimizationGuideKeyedServiceBrowserTest( @@ -222,7 +212,7 @@ ~OptimizationGuideKeyedServiceBrowserTest() override = default; void SetUpCommandLine(base::CommandLine* cmd) override { - cmd->AppendSwitch(optimization_guide::switches::kPurgeHintsStore); + cmd->AppendSwitch(switches::kPurgeHintsStore); } void SetUp() override { InProcessBrowserTest::SetUp(); } @@ -274,7 +264,7 @@ void RegisterWithKeyedService() { OptimizationGuideKeyedServiceFactory::GetForProfile(browser()->profile()) - ->RegisterOptimizationTypes({optimization_guide::proto::NOSCRIPT}); + ->RegisterOptimizationTypes({proto::NOSCRIPT}); // Set up an OptimizationGuideKeyedService consumer. consumer_ = std::make_unique<OptimizationGuideConsumerWebContentsObserver>( @@ -283,18 +273,15 @@ void CanApplyOptimizationOnDemand( const std::vector<GURL>& urls, - const std::vector<optimization_guide::proto::OptimizationType>& - optimization_types, - optimization_guide::OnDemandOptimizationGuideDecisionRepeatingCallback - callback) { + const std::vector<proto::OptimizationType>& optimization_types, + OnDemandOptimizationGuideDecisionRepeatingCallback callback) { OptimizationGuideKeyedServiceFactory::GetForProfile(browser()->profile()) - ->CanApplyOptimizationOnDemand( - urls, optimization_types, - optimization_guide::proto::CONTEXT_BATCH_UPDATE_ACTIVE_TABS, - callback); + ->CanApplyOptimizationOnDemand(urls, optimization_types, + proto::CONTEXT_BATCH_UPDATE_ACTIVE_TABS, + callback); } - optimization_guide::PredictionManager* prediction_manager() { + PredictionManager* prediction_manager() { auto* optimization_guide_keyed_service = OptimizationGuideKeyedServiceFactory::GetForProfile( browser()->profile()); @@ -302,7 +289,7 @@ } void PushHintsComponentAndWaitForCompletion() { - optimization_guide::RetryForHistogramUntilCountReached( + RetryForHistogramUntilCountReached( histogram_tester(), "OptimizationGuide.HintsManager.HintCacheInitialized", 1); @@ -311,12 +298,11 @@ ->GetHintsManager() ->ListenForNextUpdateForTesting(run_loop.QuitClosure()); - const optimization_guide::HintsComponentInfo& component_info = + const HintsComponentInfo& component_info = test_hints_component_creator_.CreateHintsComponentInfoWithPageHints( - optimization_guide::proto::NOSCRIPT, {url_with_hints_.host()}, - "simple.html"); + proto::NOSCRIPT, {url_with_hints_.host()}, "simple.html"); - optimization_guide::OptimizationHintsComponentUpdateListener::GetInstance() + OptimizationHintsComponentUpdateListener::GetInstance() ->MaybeUpdateHintsComponent(component_info); run_loop.Run(); @@ -329,8 +315,7 @@ // Sets the callback on the consumer of the OptimizationGuideKeyedService. If // set, this will call the async version of CanApplyOptimization. - void SetCallbackOnConsumer( - optimization_guide::OptimizationGuideDecisionCallback callback) { + void SetCallbackOnConsumer(OptimizationGuideDecisionCallback callback) { ASSERT_TRUE(consumer_); consumer_->set_callback(std::move(callback)); @@ -338,8 +323,7 @@ // Returns the last decision from the CanApplyOptimization() method seen by // the consumer of the OptimizationGuideKeyedService. - optimization_guide::OptimizationGuideDecision - last_can_apply_optimization_decision() { + OptimizationGuideDecision last_can_apply_optimization_decision() { return consumer_->last_can_apply_optimization_decision(); } @@ -350,14 +334,13 @@ return ogks; } - std::unique_ptr<optimization_guide::ModelQualityLogEntry> - GetModelQualityLogEntryForCompose() { - std::unique_ptr<optimization_guide::proto::LogAiDataRequest> - log_ai_data_request(new optimization_guide::proto::LogAiDataRequest()); - optimization_guide::proto::ComposeLoggingData compose_logging_data; + std::unique_ptr<ModelQualityLogEntry> GetModelQualityLogEntryForCompose() { + std::unique_ptr<proto::LogAiDataRequest> log_ai_data_request( + new proto::LogAiDataRequest()); + proto::ComposeLoggingData compose_logging_data; *(log_ai_data_request->mutable_compose()) = compose_logging_data; - return std::make_unique<optimization_guide::ModelQualityLogEntry>( + return std::make_unique<ModelQualityLogEntry>( std::move(log_ai_data_request), ogks()->GetChromeModelQualityLogsUploaderService()->GetWeakPtr()); } @@ -387,7 +370,7 @@ identity_test_env_adaptor_->identity_test_env()->ClearPrimaryAccount(); } - bool IsSettingVisible(optimization_guide::UserVisibleFeatureKey feature) { + bool IsSettingVisible(UserVisibleFeatureKey feature) { return OptimizationGuideKeyedServiceFactory::GetForProfile( browser()->profile()) ->IsSettingVisible(feature); @@ -399,7 +382,7 @@ protected: base::test::ScopedFeatureList scoped_feature_list_; - testing::NiceMock<policy::MockConfigurationPolicyProvider> policy_provider_; + ::testing::NiceMock<policy::MockConfigurationPolicyProvider> policy_provider_; private: std::unique_ptr<net::test_server::HttpResponse> HandleRequest( @@ -429,8 +412,7 @@ std::unique_ptr<network::TestNetworkConnectionTracker> network_connection_tracker_; - optimization_guide::testing::TestHintsComponentCreator - test_hints_component_creator_; + testing::TestHintsComponentCreator test_hints_component_creator_; std::unique_ptr<OptimizationGuideConsumerWebContentsObserver> consumer_; // Histogram tester used specifically to capture metrics that are recorded // during browser initialization. @@ -460,11 +442,9 @@ std::unique_ptr<base::RunLoop> run_loop = std::make_unique<base::RunLoop>(); SetCallbackOnConsumer(base::BindOnce( - [](base::RunLoop* run_loop, - optimization_guide::OptimizationGuideDecision decision, - const optimization_guide::OptimizationMetadata& metadata) { - EXPECT_EQ(optimization_guide::OptimizationGuideDecision::kFalse, - decision); + [](base::RunLoop* run_loop, OptimizationGuideDecision decision, + const OptimizationMetadata& metadata) { + EXPECT_EQ(OptimizationGuideDecision::kFalse, decision); run_loop->Quit(); }, run_loop.get())); @@ -481,11 +461,9 @@ std::unique_ptr<base::RunLoop> run_loop = std::make_unique<base::RunLoop>(); SetCallbackOnConsumer(base::BindOnce( - [](base::RunLoop* run_loop, - optimization_guide::OptimizationGuideDecision decision, - const optimization_guide::OptimizationMetadata& metadata) { - EXPECT_EQ(optimization_guide::OptimizationGuideDecision::kTrue, - decision); + [](base::RunLoop* run_loop, OptimizationGuideDecision decision, + const OptimizationMetadata& metadata) { + EXPECT_EQ(OptimizationGuideDecision::kTrue, decision); run_loop->Quit(); }, run_loop.get())); @@ -501,11 +479,9 @@ std::unique_ptr<base::RunLoop> run_loop = std::make_unique<base::RunLoop>(); SetCallbackOnConsumer(base::BindOnce( - [](base::RunLoop* run_loop, - optimization_guide::OptimizationGuideDecision decision, - const optimization_guide::OptimizationMetadata& metadata) { - EXPECT_EQ(optimization_guide::OptimizationGuideDecision::kFalse, - decision); + [](base::RunLoop* run_loop, OptimizationGuideDecision decision, + const OptimizationMetadata& metadata) { + EXPECT_EQ(OptimizationGuideDecision::kFalse, decision); run_loop->Quit(); }, run_loop.get())); @@ -525,7 +501,7 @@ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url_with_hints())); - EXPECT_GT(optimization_guide::RetryForHistogramUntilCountReached( + EXPECT_GT(RetryForHistogramUntilCountReached( &histogram_tester, "OptimizationGuide.LoadedHint.Result", 1), 0); // There is a hint that matches this URL, so there should be an attempt to @@ -533,7 +509,7 @@ histogram_tester.ExpectUniqueSample("OptimizationGuide.LoadedHint.Result", true, 1); // We had a hint and it was loaded. - EXPECT_EQ(optimization_guide::OptimizationGuideDecision::kTrue, + EXPECT_EQ(OptimizationGuideDecision::kTrue, last_can_apply_optimization_decision()); // Navigate away so metrics get recorded. @@ -551,7 +527,7 @@ const int64_t* entry_metric = ukm_recorder.GetEntryMetric( entry, ukm::builders::OptimizationGuide::kRegisteredOptimizationTypesName); - EXPECT_TRUE(*entry_metric & (1 << optimization_guide::proto::NOSCRIPT)); + EXPECT_TRUE(*entry_metric & (1 << proto::NOSCRIPT)); } IN_PROC_BROWSER_TEST_F(OptimizationGuideKeyedServiceBrowserTest, @@ -564,7 +540,7 @@ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url_with_hints())); - EXPECT_GT(optimization_guide::RetryForHistogramUntilCountReached( + EXPECT_GT(RetryForHistogramUntilCountReached( &histogram_tester, "OptimizationGuide.LoadedHint.Result", 1), 0); // There is a hint that matches this URL, so there should be an attempt to @@ -572,7 +548,7 @@ histogram_tester.ExpectUniqueSample("OptimizationGuide.LoadedHint.Result", true, 1); // We had a hint and it was loaded. - EXPECT_EQ(optimization_guide::OptimizationGuideDecision::kTrue, + EXPECT_EQ(OptimizationGuideDecision::kTrue, last_can_apply_optimization_decision()); // Make sure metrics get recorded when tab is hidden. @@ -589,7 +565,7 @@ const int64_t* entry_metric = ukm_recorder.GetEntryMetric( entry, ukm::builders::OptimizationGuide::kRegisteredOptimizationTypesName); - EXPECT_TRUE(*entry_metric & (1 << optimization_guide::proto::NOSCRIPT)); + EXPECT_TRUE(*entry_metric & (1 << proto::NOSCRIPT)); } IN_PROC_BROWSER_TEST_F( @@ -603,7 +579,7 @@ ASSERT_TRUE( ui_test_utils::NavigateToURL(browser(), url_that_redirects_to_hints())); - EXPECT_EQ(optimization_guide::RetryForHistogramUntilCountReached( + EXPECT_EQ(RetryForHistogramUntilCountReached( &histogram_tester, "OptimizationGuide.LoadedHint.Result", 2), 2); // Should attempt and succeed to load a hint once for the initial navigation @@ -611,7 +587,7 @@ histogram_tester.ExpectBucketCount("OptimizationGuide.LoadedHint.Result", true, 2); // Hint is still applicable so we expect it to be allowed to be applied. - EXPECT_EQ(optimization_guide::OptimizationGuideDecision::kTrue, + EXPECT_EQ(OptimizationGuideDecision::kTrue, last_can_apply_optimization_decision()); } @@ -625,20 +601,18 @@ ASSERT_TRUE( ui_test_utils::NavigateToURL(browser(), GURL("https://nohints.com/"))); - EXPECT_EQ(optimization_guide::RetryForHistogramUntilCountReached( + EXPECT_EQ(RetryForHistogramUntilCountReached( &histogram_tester, "OptimizationGuide.LoadedHint.Result", 1), 1); // There were no hints that match this URL, but there should still be an // attempt to load a hint but still fail. histogram_tester.ExpectUniqueSample("OptimizationGuide.LoadedHint.Result", false, 1); - EXPECT_EQ(optimization_guide::OptimizationGuideDecision::kFalse, + EXPECT_EQ(OptimizationGuideDecision::kFalse, last_can_apply_optimization_decision()); histogram_tester.ExpectUniqueSample( "OptimizationGuide.ApplyDecision.NoScript", - static_cast<int>( - optimization_guide::OptimizationTypeDecision::kNoHintAvailable), - 1); + static_cast<int>(OptimizationTypeDecision::kNoHintAvailable), 1); } IN_PROC_BROWSER_TEST_F(OptimizationGuideKeyedServiceBrowserTest, @@ -652,46 +626,44 @@ base::HistogramTester histogram_tester; // Register an optimization type with an optimization filter. - ogks->RegisterOptimizationTypes( - {optimization_guide::proto::FAST_HOST_HINTS}); + ogks->RegisterOptimizationTypes({proto::FAST_HOST_HINTS}); // Wait until filter is loaded. This histogram will record twice: once when // the config is found and once when the filter is created. - optimization_guide::RetryForHistogramUntilCountReached( + RetryForHistogramUntilCountReached( &histogram_tester, "OptimizationGuide.OptimizationFilterStatus.FastHostHints", 2); - EXPECT_EQ(optimization_guide::OptimizationGuideDecision::kFalse, - ogks->CanApplyOptimization( - GURL("https://blockedhost.com/whatever"), - optimization_guide::proto::FAST_HOST_HINTS, nullptr)); + EXPECT_EQ( + OptimizationGuideDecision::kFalse, + ogks->CanApplyOptimization(GURL("https://blockedhost.com/whatever"), + proto::FAST_HOST_HINTS, nullptr)); histogram_tester.ExpectUniqueSample( "OptimizationGuide.ApplyDecision.FastHostHints", - static_cast<int>(optimization_guide::OptimizationTypeDecision:: - kNotAllowedByOptimizationFilter), + static_cast<int>( + OptimizationTypeDecision::kNotAllowedByOptimizationFilter), 1); } // Register another type with optimization filter. { base::HistogramTester histogram_tester; - ogks->RegisterOptimizationTypes( - {optimization_guide::proto::LITE_PAGE_REDIRECT}); + ogks->RegisterOptimizationTypes({proto::LITE_PAGE_REDIRECT}); // Wait until filter is loaded. This histogram will record twice: once when // the config is found and once when the filter is created. - optimization_guide::RetryForHistogramUntilCountReached( + RetryForHistogramUntilCountReached( &histogram_tester, "OptimizationGuide.OptimizationFilterStatus.LitePageRedirect", 2); // The previously loaded filter should still be loaded and give the same // result. - EXPECT_EQ(optimization_guide::OptimizationGuideDecision::kFalse, - ogks->CanApplyOptimization( - GURL("https://blockedhost.com/whatever"), - optimization_guide::proto::FAST_HOST_HINTS, nullptr)); + EXPECT_EQ( + OptimizationGuideDecision::kFalse, + ogks->CanApplyOptimization(GURL("https://blockedhost.com/whatever"), + proto::FAST_HOST_HINTS, nullptr)); histogram_tester.ExpectUniqueSample( "OptimizationGuide.ApplyDecision.FastHostHints", - static_cast<int>(optimization_guide::OptimizationTypeDecision:: - kNotAllowedByOptimizationFilter), + static_cast<int>( + OptimizationTypeDecision::kNotAllowedByOptimizationFilter), 1); } } @@ -701,28 +673,26 @@ PushHintsComponentAndWaitForCompletion(); OptimizationGuideKeyedService* ogks = OptimizationGuideKeyedServiceFactory::GetForProfile(browser()->profile()); - ogks->RegisterOptimizationTypes( - {optimization_guide::proto::OptimizationType::NOSCRIPT, - optimization_guide::proto::OptimizationType::FAST_HOST_HINTS}); + ogks->RegisterOptimizationTypes({proto::OptimizationType::NOSCRIPT, + proto::OptimizationType::FAST_HOST_HINTS}); base::HistogramTester histogram_tester; ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url_with_hints())); - optimization_guide::RetryForHistogramUntilCountReached( - &histogram_tester, "OptimizationGuide.LoadedHint.Result", 1); + RetryForHistogramUntilCountReached(&histogram_tester, + "OptimizationGuide.LoadedHint.Result", 1); std::unique_ptr<base::RunLoop> run_loop = std::make_unique<base::RunLoop>(); base::flat_set<GURL> received_callbacks; CanApplyOptimizationOnDemand( {url_with_hints(), GURL("https://blockedhost.com/whatever")}, - {optimization_guide::proto::OptimizationType::NOSCRIPT, - optimization_guide::proto::OptimizationType::FAST_HOST_HINTS}, + {proto::OptimizationType::NOSCRIPT, + proto::OptimizationType::FAST_HOST_HINTS}, base::BindRepeating( [](base::RunLoop* run_loop, base::flat_set<GURL>* received_callbacks, const GURL& url, - const base::flat_map< - optimization_guide::proto::OptimizationType, - optimization_guide::OptimizationGuideDecisionWithMetadata>& + const base::flat_map<proto::OptimizationType, + OptimizationGuideDecisionWithMetadata>& decisions) { received_callbacks->insert(url); @@ -741,20 +711,17 @@ CanApplyOptimizationNewAPI) { OptimizationGuideKeyedService* ogks = OptimizationGuideKeyedServiceFactory::GetForProfile(browser()->profile()); - ogks->RegisterOptimizationTypes( - {optimization_guide::proto::OptimizationType::NOSCRIPT}); + ogks->RegisterOptimizationTypes({proto::OptimizationType::NOSCRIPT}); std::unique_ptr<base::RunLoop> run_loop = std::make_unique<base::RunLoop>(); // Before the hints or navigation are initiated, we should get a negative // response. ogks->CanApplyOptimization( - url_with_hints(), optimization_guide::proto::OptimizationType::NOSCRIPT, + url_with_hints(), proto::OptimizationType::NOSCRIPT, base::BindOnce( - [](base::RunLoop* run_loop, - optimization_guide::OptimizationGuideDecision decision, - const optimization_guide::OptimizationMetadata& metadata) { - EXPECT_EQ(decision, - optimization_guide::OptimizationGuideDecision::kFalse); + [](base::RunLoop* run_loop, OptimizationGuideDecision decision, + const OptimizationMetadata& metadata) { + EXPECT_EQ(decision, OptimizationGuideDecision::kFalse); run_loop->Quit(); }, @@ -767,11 +734,9 @@ OptimizationGuideNewApiConsumerWebContentsObserver observer( browser()->tab_strip_model()->GetActiveWebContents(), base::BindOnce( - [](base::RunLoop* run_loop, - optimization_guide::OptimizationGuideDecision decision, - const optimization_guide::OptimizationMetadata& metadata) { - EXPECT_EQ(optimization_guide::OptimizationGuideDecision::kTrue, - decision); + [](base::RunLoop* run_loop, OptimizationGuideDecision decision, + const OptimizationMetadata& metadata) { + EXPECT_EQ(OptimizationGuideDecision::kTrue, decision); run_loop->Quit(); }, run_loop.get())); @@ -785,13 +750,11 @@ // get the correct response. run_loop = std::make_unique<base::RunLoop>(); ogks->CanApplyOptimization( - url_with_hints(), optimization_guide::proto::OptimizationType::NOSCRIPT, + url_with_hints(), proto::OptimizationType::NOSCRIPT, base::BindOnce( - [](base::RunLoop* run_loop, - optimization_guide::OptimizationGuideDecision decision, - const optimization_guide::OptimizationMetadata& metadata) { - EXPECT_EQ(decision, - optimization_guide::OptimizationGuideDecision::kTrue); + [](base::RunLoop* run_loop, OptimizationGuideDecision decision, + const OptimizationMetadata& metadata) { + EXPECT_EQ(decision, OptimizationGuideDecision::kTrue); run_loop->Quit(); }, @@ -799,11 +762,9 @@ run_loop->Run(); } -class TestSettingsEnabledObserver - : public optimization_guide::SettingsEnabledObserver { +class TestSettingsEnabledObserver : public SettingsEnabledObserver { public: - explicit TestSettingsEnabledObserver( - optimization_guide::UserVisibleFeatureKey feature) + explicit TestSettingsEnabledObserver(UserVisibleFeatureKey feature) : SettingsEnabledObserver(feature) {} void OnChangeInFeatureCurrentlyEnabledState(bool is_now_enabled) override { count_feature_enabled_state_changes_++; @@ -817,39 +778,31 @@ IN_PROC_BROWSER_TEST_F(OptimizationGuideKeyedServiceBrowserTest, SettingsVisibilitySignedOutVsSignedIn) { // User is not signed-in. - EXPECT_FALSE(IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + EXPECT_FALSE(IsSettingVisible(UserVisibleFeatureKey::kWallpaperSearch)); // Visibility of tab organizer is allowed for unsigned users. - EXPECT_TRUE(IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kTabOrganization)); // Visibility of this feature is enabled via finch but the feature is still // not visible. - EXPECT_FALSE( - IsSettingVisible(optimization_guide::UserVisibleFeatureKey::kCompose)); + EXPECT_FALSE(IsSettingVisible(UserVisibleFeatureKey::kCompose)); // kCompose should now be visible after // sign-in. EnableSignIn(); - EXPECT_TRUE(IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kWallpaperSearch)); - EXPECT_TRUE(IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kTabOrganization)); - EXPECT_TRUE( - IsSettingVisible(optimization_guide::UserVisibleFeatureKey::kCompose)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kCompose)); #if !BUILDFLAG(IS_CHROMEOS) // SignOut not supported on ChromeOS. SignOut(); // Tab Organizer is visible to unsigned users. - EXPECT_TRUE(IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); - EXPECT_FALSE( - IsSettingVisible(optimization_guide::UserVisibleFeatureKey::kCompose)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kTabOrganization)); + EXPECT_FALSE(IsSettingVisible(UserVisibleFeatureKey::kCompose)); #endif } @@ -860,50 +813,38 @@ EnableSignIn(); // Visibility of wallpaper search is enabled on ToT. - EXPECT_TRUE(IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kWallpaperSearch)); // Visibility of tab organizer is enabled via finch. - EXPECT_TRUE(IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kTabOrganization)); // Visibility of compose is enabled via finch. - EXPECT_TRUE( - IsSettingVisible(optimization_guide::UserVisibleFeatureKey::kCompose)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kCompose)); auto* prefs = browser()->profile()->GetPrefs(); prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kWallpaperSearch), + static_cast<int>(prefs::FeatureOptInState::kEnabled)); // Restarting the browser should cause wallpaper setting to be visible since // the feature is enabled. - EXPECT_TRUE(IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kWallpaperSearch)); - EXPECT_TRUE(IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kTabOrganization)); - EXPECT_TRUE( - IsSettingVisible(optimization_guide::UserVisibleFeatureKey::kCompose)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kCompose)); prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch), - static_cast<int>( - optimization_guide::prefs::FeatureOptInState::kDisabled)); + prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kWallpaperSearch), + static_cast<int>(prefs::FeatureOptInState::kDisabled)); // Restarting the browser should cause wallpaper setting to still be visible // since the feature is still enabled. - EXPECT_TRUE(IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kWallpaperSearch)); - EXPECT_TRUE(IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kTabOrganization)); - EXPECT_TRUE( - IsSettingVisible(optimization_guide::UserVisibleFeatureKey::kCompose)); + EXPECT_TRUE(IsSettingVisible(UserVisibleFeatureKey::kCompose)); } IN_PROC_BROWSER_TEST_F(OptimizationGuideKeyedServiceBrowserTest, @@ -914,52 +855,50 @@ EnableSignIn(); TestSettingsEnabledObserver wallpaper_search_observer( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch); - TestSettingsEnabledObserver compose_observer( - optimization_guide::UserVisibleFeatureKey::kCompose); + UserVisibleFeatureKey::kWallpaperSearch); + TestSettingsEnabledObserver compose_observer(UserVisibleFeatureKey::kCompose); ogks->AddModelExecutionSettingsEnabledObserver(&wallpaper_search_observer); ogks->AddModelExecutionSettingsEnabledObserver(&compose_observer); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + UserVisibleFeatureKey::kWallpaperSearch)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + UserVisibleFeatureKey::kTabOrganization)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kCompose)); + UserVisibleFeatureKey::kCompose)); auto* prefs = browser()->profile()->GetPrefs(); prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kWallpaperSearch), + static_cast<int>(prefs::FeatureOptInState::kEnabled)); EXPECT_EQ(1, wallpaper_search_observer.count_feature_enabled_state_changes_); EXPECT_TRUE(wallpaper_search_observer.is_currently_enabled_); EXPECT_EQ(0, compose_observer.count_feature_enabled_state_changes_); EXPECT_TRUE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + UserVisibleFeatureKey::kWallpaperSearch)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + UserVisibleFeatureKey::kTabOrganization)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kCompose)); + UserVisibleFeatureKey::kCompose)); #if !BUILDFLAG(IS_CHROMEOS) // SignOut not supported on ChromeOS. SignOut(); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + UserVisibleFeatureKey::kWallpaperSearch)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + UserVisibleFeatureKey::kTabOrganization)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kCompose)); + UserVisibleFeatureKey::kCompose)); EXPECT_EQ(2, wallpaper_search_observer.count_feature_enabled_state_changes_); EXPECT_FALSE(wallpaper_search_observer.is_currently_enabled_); @@ -976,57 +915,53 @@ EnableSignIn(); TestSettingsEnabledObserver wallpaper_search_observer( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch); - TestSettingsEnabledObserver compose_observer( - optimization_guide::UserVisibleFeatureKey::kCompose); + UserVisibleFeatureKey::kWallpaperSearch); + TestSettingsEnabledObserver compose_observer(UserVisibleFeatureKey::kCompose); ogks->AddModelExecutionSettingsEnabledObserver(&wallpaper_search_observer); ogks->AddModelExecutionSettingsEnabledObserver(&compose_observer); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + UserVisibleFeatureKey::kWallpaperSearch)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + UserVisibleFeatureKey::kTabOrganization)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kCompose)); + UserVisibleFeatureKey::kCompose)); auto* prefs = browser()->profile()->GetPrefs(); prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kWallpaperSearch), + static_cast<int>(prefs::FeatureOptInState::kEnabled)); EXPECT_EQ(1, wallpaper_search_observer.count_feature_enabled_state_changes_); EXPECT_TRUE(wallpaper_search_observer.is_currently_enabled_); EXPECT_EQ(0, compose_observer.count_feature_enabled_state_changes_); EXPECT_TRUE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + UserVisibleFeatureKey::kWallpaperSearch)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + UserVisibleFeatureKey::kTabOrganization)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kCompose)); + UserVisibleFeatureKey::kCompose)); prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch), - static_cast<int>( - optimization_guide::prefs::FeatureOptInState::kDisabled)); + prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kWallpaperSearch), + static_cast<int>(prefs::FeatureOptInState::kDisabled)); EXPECT_EQ(2, wallpaper_search_observer.count_feature_enabled_state_changes_); EXPECT_FALSE(wallpaper_search_observer.is_currently_enabled_); EXPECT_EQ(0, compose_observer.count_feature_enabled_state_changes_); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + UserVisibleFeatureKey::kWallpaperSearch)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + UserVisibleFeatureKey::kTabOrganization)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kCompose)); + UserVisibleFeatureKey::kCompose)); } // Verifies that Model Execution Features Controller updates feature prefs @@ -1039,31 +974,29 @@ EnableSignIn(); TestSettingsEnabledObserver wallpaper_search_observer( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch); - TestSettingsEnabledObserver compose_observer( - optimization_guide::UserVisibleFeatureKey::kCompose); + UserVisibleFeatureKey::kWallpaperSearch); + TestSettingsEnabledObserver compose_observer(UserVisibleFeatureKey::kCompose); TestSettingsEnabledObserver tab_observer( - optimization_guide::UserVisibleFeatureKey::kTabOrganization); + UserVisibleFeatureKey::kTabOrganization); ogks->AddModelExecutionSettingsEnabledObserver(&wallpaper_search_observer); ogks->AddModelExecutionSettingsEnabledObserver(&compose_observer); ogks->AddModelExecutionSettingsEnabledObserver(&tab_observer); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + UserVisibleFeatureKey::kWallpaperSearch)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + UserVisibleFeatureKey::kTabOrganization)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kCompose)); + UserVisibleFeatureKey::kCompose)); // Enable the main feature toggle. This should enable the compose and tab // organizer features on restart. auto* prefs = browser()->profile()->GetPrefs(); - prefs->SetInteger( - optimization_guide::prefs::kModelExecutionMainToggleSettingState, - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + prefs->SetInteger(prefs::kModelExecutionMainToggleSettingState, + static_cast<int>(prefs::FeatureOptInState::kEnabled)); // Visibility of tab organizer feature is enabled via finch. Only tab // organizer feature should be enabled. EXPECT_EQ(1, wallpaper_search_observer.count_feature_enabled_state_changes_); @@ -1074,20 +1007,18 @@ EXPECT_TRUE(tab_observer.is_currently_enabled_); EXPECT_TRUE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + UserVisibleFeatureKey::kWallpaperSearch)); EXPECT_TRUE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + UserVisibleFeatureKey::kTabOrganization)); EXPECT_TRUE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kCompose)); + UserVisibleFeatureKey::kCompose)); // Disable main toggle. The tab organizer feature should be disabled on // restart. - prefs->SetInteger( - optimization_guide::prefs::kModelExecutionMainToggleSettingState, - static_cast<int>( - optimization_guide::prefs::FeatureOptInState::kDisabled)); + prefs->SetInteger(prefs::kModelExecutionMainToggleSettingState, + static_cast<int>(prefs::FeatureOptInState::kDisabled)); base::RunLoop().RunUntilIdle(); EXPECT_EQ(2, wallpaper_search_observer.count_feature_enabled_state_changes_); @@ -1098,13 +1029,13 @@ EXPECT_FALSE(tab_observer.is_currently_enabled_); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + UserVisibleFeatureKey::kWallpaperSearch)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + UserVisibleFeatureKey::kTabOrganization)); EXPECT_FALSE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kCompose)); + UserVisibleFeatureKey::kCompose)); } // Verifies that Model Execution Features Controller returns null for incognito @@ -1126,12 +1057,11 @@ auto* prefs = browser()->profile()->GetPrefs(); prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kWallpaperSearch), + static_cast<int>(prefs::FeatureOptInState::kEnabled)); EXPECT_FALSE(otr_ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + UserVisibleFeatureKey::kWallpaperSearch)); } IN_PROC_BROWSER_TEST_F(OptimizationGuideKeyedServiceBrowserTest, @@ -1206,25 +1136,23 @@ EnableSignIn(); prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kWallpaperSearch), + static_cast<int>(prefs::FeatureOptInState::kEnabled)); guest_prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + prefs::GetSettingEnabledPrefName(UserVisibleFeatureKey::kWallpaperSearch), + static_cast<int>(prefs::FeatureOptInState::kEnabled)); EXPECT_TRUE(ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + UserVisibleFeatureKey::kWallpaperSearch)); EXPECT_FALSE(guest_ogks->ShouldFeatureBeCurrentlyEnabledForUser( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + UserVisibleFeatureKey::kWallpaperSearch)); } #endif // Test the visibility of features with `kOptimizationGuideModelExecution` // enabled or disabled. class OptimizationGuideKeyedServiceBrowserWithModelExecutionFeatureDisabledTest - : public testing::WithParamInterface<bool>, + : public ::testing::WithParamInterface<bool>, public OptimizationGuideKeyedServiceBrowserTest { public: OptimizationGuideKeyedServiceBrowserWithModelExecutionFeatureDisabledTest() @@ -1234,19 +1162,17 @@ if (ShouldFeatureBeEnabled()) { scoped_feature_list_.InitWithFeatures( - {optimization_guide::features::kOptimizationHints, + {features::kOptimizationHints, // Enabled. - optimization_guide::features::kOptimizationGuideModelExecution, - optimization_guide::features::internal:: - kTabOrganizationSettingsVisibility}, + features::kOptimizationGuideModelExecution, + features::internal::kTabOrganizationSettingsVisibility}, {}); } else { scoped_feature_list_.InitWithFeatures( - {optimization_guide::features::kOptimizationHints, - optimization_guide::features::internal:: - kTabOrganizationSettingsVisibility}, + {features::kOptimizationHints, + features::internal::kTabOrganizationSettingsVisibility}, // Disabled. - {optimization_guide::features::kOptimizationGuideModelExecution}); + {features::kOptimizationGuideModelExecution}); } } @@ -1256,19 +1182,17 @@ INSTANTIATE_TEST_SUITE_P( All, OptimizationGuideKeyedServiceBrowserWithModelExecutionFeatureDisabledTest, - testing::Bool()); + ::testing::Bool()); IN_PROC_BROWSER_TEST_P( OptimizationGuideKeyedServiceBrowserWithModelExecutionFeatureDisabledTest, SettingsNotVisible) { EnableSignIn(); - EXPECT_FALSE(IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kWallpaperSearch)); + EXPECT_FALSE(IsSettingVisible(UserVisibleFeatureKey::kWallpaperSearch)); EXPECT_EQ(ShouldFeatureBeEnabled(), - IsSettingVisible( - optimization_guide::UserVisibleFeatureKey::kTabOrganization)); + IsSettingVisible(UserVisibleFeatureKey::kTabOrganization)); } class OptimizationGuideKeyedServicePermissionsCheckDisabledTest @@ -1280,7 +1204,7 @@ void SetUp() override { scoped_feature_list_.InitAndEnableFeature( - optimization_guide::features::kRemoteOptimizationGuideFetching); + features::kRemoteOptimizationGuideFetching); OptimizationGuideKeyedServiceBrowserTest::SetUp(); } @@ -1294,12 +1218,11 @@ void SetUpCommandLine(base::CommandLine* cmd) override { OptimizationGuideKeyedServiceBrowserTest::SetUpCommandLine(cmd); - cmd->AppendSwitch(optimization_guide::switches:: - kDisableCheckingUserPermissionsForTesting); + cmd->AppendSwitch(switches::kDisableCheckingUserPermissionsForTesting); // Add switch to avoid racing navigations in the test. - cmd->AppendSwitch(optimization_guide::switches:: - kDisableFetchingHintsAtNavigationStartForTesting); + cmd->AppendSwitch( + switches::kDisableFetchingHintsAtNavigationStartForTesting); } private: @@ -1335,19 +1258,18 @@ OptimizationGuideKeyedServiceFactory::GetForProfile( browser()->profile()->GetPrimaryOTRProfile( /*create_if_needed=*/true)); - otr_ogks->RegisterOptimizationTypes({optimization_guide::proto::NOSCRIPT}); + otr_ogks->RegisterOptimizationTypes({proto::NOSCRIPT}); // Navigate to a URL that has a hint from a component and wait for that hint // to have loaded. base::HistogramTester histogram_tester; ASSERT_TRUE(ui_test_utils::NavigateToURL(otr_browser, url_with_hints())); - optimization_guide::RetryForHistogramUntilCountReached( - &histogram_tester, "OptimizationGuide.LoadedHint.Result", 1); + RetryForHistogramUntilCountReached(&histogram_tester, + "OptimizationGuide.LoadedHint.Result", 1); - EXPECT_EQ( - optimization_guide::OptimizationGuideDecision::kTrue, - otr_ogks->CanApplyOptimization( - url_with_hints(), optimization_guide::proto::NOSCRIPT, nullptr)); + EXPECT_EQ(OptimizationGuideDecision::kTrue, + otr_ogks->CanApplyOptimization(url_with_hints(), proto::NOSCRIPT, + nullptr)); } IN_PROC_BROWSER_TEST_F( @@ -1366,22 +1288,21 @@ base::HistogramTester histogram_tester; // Register an optimization type with an optimization filter. - otr_ogks->RegisterOptimizationTypes( - {optimization_guide::proto::FAST_HOST_HINTS}); + otr_ogks->RegisterOptimizationTypes({proto::FAST_HOST_HINTS}); // Wait until filter is loaded. This histogram will record twice: once when // the config is found and once when the filter is created. - optimization_guide::RetryForHistogramUntilCountReached( + RetryForHistogramUntilCountReached( &histogram_tester, "OptimizationGuide.OptimizationFilterStatus.FastHostHints", 2); - EXPECT_EQ(optimization_guide::OptimizationGuideDecision::kFalse, - otr_ogks->CanApplyOptimization( - GURL("https://blockedhost.com/whatever"), - optimization_guide::proto::FAST_HOST_HINTS, nullptr)); + EXPECT_EQ( + OptimizationGuideDecision::kFalse, + otr_ogks->CanApplyOptimization(GURL("https://blockedhost.com/whatever"), + proto::FAST_HOST_HINTS, nullptr)); histogram_tester.ExpectUniqueSample( "OptimizationGuide.ApplyDecision.FastHostHints", - static_cast<int>(optimization_guide::OptimizationTypeDecision:: - kNotAllowedByOptimizationFilter), + static_cast<int>( + OptimizationTypeDecision::kNotAllowedByOptimizationFilter), 1); } @@ -1398,7 +1319,7 @@ // Create a new ModelQualityLogEntry and pass it to the // UploadModelQualityLogs. - std::unique_ptr<optimization_guide::ModelQualityLogEntry> log_entry_1 = + std::unique_ptr<ModelQualityLogEntry> log_entry_1 = GetModelQualityLogEntryForCompose(); ogks->UploadModelQualityLogs(std::move(log_entry_1)); @@ -1406,7 +1327,7 @@ // Upload shouldn't be blocked by metrics consent. histogram_tester()->ExpectBucketCount( "OptimizationGuide.ModelQualityLogsUploaderService.UploadStatus.Compose", - optimization_guide::ModelQualityLogsUploadStatus::kNoMetricsConsent, 0); + ModelQualityLogsUploadStatus::kMetricsReportingDisabled, 0); // Disable metrics consent. SetMetricsConsent(false); @@ -1415,7 +1336,7 @@ // Create a new ModelQualityLogEntry and pass it to the // UploadModelQualityLogs. - std::unique_ptr<optimization_guide::ModelQualityLogEntry> log_entry_2 = + std::unique_ptr<ModelQualityLogEntry> log_entry_2 = GetModelQualityLogEntryForCompose(); ogks->UploadModelQualityLogs(std::move(log_entry_2)); @@ -1424,7 +1345,7 @@ // histogram bucket count will be 1. histogram_tester()->ExpectBucketCount( "OptimizationGuide.ModelQualityLogsUploaderService.UploadStatus.Compose", - optimization_guide::ModelQualityLogsUploadStatus::kNoMetricsConsent, 1); + ModelQualityLogsUploadStatus::kMetricsReportingDisabled, 1); } IN_PROC_BROWSER_TEST_F(OptimizationGuideKeyedServiceBrowserTest, @@ -1438,15 +1359,14 @@ ASSERT_FALSE( g_browser_process->GetMetricsServicesManager()->IsMetricsConsentGiven()); - EXPECT_FALSE( - ogks->GetChromeModelQualityLogsUploaderService()->CanUploadLogs( - optimization_guide::UserVisibleFeatureKey::kCompose)); + EXPECT_FALSE(ogks->GetChromeModelQualityLogsUploaderService()->CanUploadLogs( + UserVisibleFeatureKey::kCompose)); // Upload should be disabled as there is no metrics consent, so total // histogram bucket count will be 1. histogram_tester()->ExpectBucketCount( "OptimizationGuide.ModelQualityLogsUploaderService.UploadStatus.Compose", - optimization_guide::ModelQualityLogsUploadStatus::kNoMetricsConsent, 1); + ModelQualityLogsUploadStatus::kMetricsReportingDisabled, 1); } IN_PROC_BROWSER_TEST_F(OptimizationGuideKeyedServiceBrowserTest, @@ -1457,7 +1377,7 @@ g_browser_process->GetMetricsServicesManager()->IsMetricsConsentGiven()); // Create a new ModelQualityLogEntry for compose. - std::unique_ptr<optimization_guide::ModelQualityLogEntry> log_entry = + std::unique_ptr<ModelQualityLogEntry> log_entry = GetModelQualityLogEntryForCompose(); // Destruct the log entry, this should trigger uploading the logs. @@ -1484,7 +1404,7 @@ } protected: - testing::NiceMock<policy::MockConfigurationPolicyProvider> policy_provider_; + ::testing::NiceMock<policy::MockConfigurationPolicyProvider> policy_provider_; }; IN_PROC_BROWSER_TEST_F(OptimizationGuideKeyedServiceEnterpriseBrowserTest, @@ -1496,24 +1416,23 @@ auto* profile = browser()->profile(); OptimizationGuideKeyedService* ogks = OptimizationGuideKeyedServiceFactory::GetForProfile(profile); - auto compose_feature = optimization_guide::UserVisibleFeatureKey::kCompose; + auto compose_feature = UserVisibleFeatureKey::kCompose; auto* prefs = profile->GetPrefs(); - prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName(compose_feature), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + prefs->SetInteger(prefs::GetSettingEnabledPrefName(compose_feature), + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); policy::PolicyMap policies; // Disable logging via via the enterprise policy to state // kAllowWithoutLogging. - policies.Set( - policy::key::kHelpMeWriteSettings, policy::POLICY_LEVEL_MANDATORY, - policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, - base::Value(static_cast<int>( - optimization_guide::model_execution::prefs:: - ModelExecutionEnterprisePolicyValue::kAllowWithoutLogging)), - nullptr); + policies.Set(policy::key::kHelpMeWriteSettings, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, + base::Value(static_cast<int>( + model_execution::prefs::ModelExecutionEnterprisePolicyValue:: + kAllowWithoutLogging)), + nullptr); policy_provider_.UpdateChromePolicy(policies); base::RunLoop().RunUntilIdle(); @@ -1522,7 +1441,7 @@ // Create a new ModelQualityLogEntry and pass it to the // UploadModelQualityLogs. - std::unique_ptr<optimization_guide::ModelQualityLogEntry> log_entry_1 = + std::unique_ptr<ModelQualityLogEntry> log_entry_1 = GetModelQualityLogEntryForCompose(); ogks->UploadModelQualityLogs(std::move(log_entry_1)); @@ -1532,8 +1451,8 @@ policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, base::Value(static_cast<int>( - optimization_guide::model_execution::prefs:: - ModelExecutionEnterprisePolicyValue::kDisable)), + model_execution::prefs::ModelExecutionEnterprisePolicyValue:: + kDisable)), nullptr); policy_provider_.UpdateChromePolicy(policies); base::RunLoop().RunUntilIdle(); @@ -1543,35 +1462,32 @@ // Create a new ModelQualityLogEntry and pass it to the // UploadModelQualityLogs. - std::unique_ptr<optimization_guide::ModelQualityLogEntry> log_entr_2 = + std::unique_ptr<ModelQualityLogEntry> log_entr_2 = GetModelQualityLogEntryForCompose(); ogks->UploadModelQualityLogs(std::move(log_entr_2)); // Enable logging via via the enterprise policy to state kAllow this shouldn't // stop upload. - policies.Set(policy::key::kHelpMeWriteSettings, - policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, - policy::POLICY_SOURCE_CLOUD, - base::Value(static_cast<int>( - optimization_guide::model_execution::prefs:: - ModelExecutionEnterprisePolicyValue::kAllow)), - nullptr); + policies.Set( + policy::key::kHelpMeWriteSettings, policy::POLICY_LEVEL_MANDATORY, + policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, + base::Value(static_cast<int>( + model_execution::prefs::ModelExecutionEnterprisePolicyValue::kAllow)), + nullptr); policy_provider_.UpdateChromePolicy(policies); - prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName(compose_feature), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + prefs->SetInteger(prefs::GetSettingEnabledPrefName(compose_feature), + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(ogks->ShouldFeatureBeCurrentlyAllowedForLogging(compose_feature)); - EXPECT_TRUE( - ogks->GetChromeModelQualityLogsUploaderService()->CanUploadLogs( - optimization_guide::UserVisibleFeatureKey::kCompose)); + EXPECT_TRUE(ogks->GetChromeModelQualityLogsUploaderService()->CanUploadLogs( + UserVisibleFeatureKey::kCompose)); // Create a new ModelQualityLogEntry and pass it to the // UploadModelQualityLogs. - std::unique_ptr<optimization_guide::ModelQualityLogEntry> log_entry_3 = + std::unique_ptr<ModelQualityLogEntry> log_entry_3 = GetModelQualityLogEntryForCompose(); ogks->UploadModelQualityLogs(std::move(log_entry_3)); @@ -1580,9 +1496,7 @@ // policy, total count should be 2. histogram_tester()->ExpectBucketCount( "OptimizationGuide.ModelQualityLogsUploaderService.UploadStatus.Compose", - optimization_guide::ModelQualityLogsUploadStatus:: - kDisabledDueToEnterprisePolicy, - 2); + ModelQualityLogsUploadStatus::kDisabledDueToEnterprisePolicy, 2); } IN_PROC_BROWSER_TEST_F(OptimizationGuideKeyedServiceEnterpriseBrowserTest, @@ -1594,11 +1508,10 @@ auto* profile = browser()->profile(); OptimizationGuideKeyedService* ogks = OptimizationGuideKeyedServiceFactory::GetForProfile(profile); - auto compose_feature = optimization_guide::UserVisibleFeatureKey::kCompose; + auto compose_feature = UserVisibleFeatureKey::kCompose; auto* prefs = profile->GetPrefs(); - prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName(compose_feature), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + prefs->SetInteger(prefs::GetSettingEnabledPrefName(compose_feature), + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); policy::PolicyMap policies; @@ -1606,22 +1519,21 @@ // Disable logging via via the enterprise policy to state // kAllowWithoutLogging this should return // ChromeModelQualityLogsUploaderService::CanUploadLogs to false. - policies.Set( - policy::key::kHelpMeWriteSettings, policy::POLICY_LEVEL_MANDATORY, - policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, - base::Value(static_cast<int>( - optimization_guide::model_execution::prefs:: - ModelExecutionEnterprisePolicyValue::kAllowWithoutLogging)), - nullptr); + policies.Set(policy::key::kHelpMeWriteSettings, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, + base::Value(static_cast<int>( + model_execution::prefs::ModelExecutionEnterprisePolicyValue:: + kAllowWithoutLogging)), + nullptr); policy_provider_.UpdateChromePolicy(policies); base::RunLoop().RunUntilIdle(); EXPECT_FALSE( ogks->ShouldFeatureBeCurrentlyAllowedForLogging(compose_feature)); - EXPECT_FALSE( - ogks->GetChromeModelQualityLogsUploaderService()->CanUploadLogs( - optimization_guide::UserVisibleFeatureKey::kCompose)); + EXPECT_FALSE(ogks->GetChromeModelQualityLogsUploaderService()->CanUploadLogs( + UserVisibleFeatureKey::kCompose)); // Disable logging via via the enterprise policy to kDisable state this should // return ChromeModelQualityLogsUploaderService::CanUploadLogs to false. @@ -1629,8 +1541,8 @@ policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, base::Value(static_cast<int>( - optimization_guide::model_execution::prefs:: - ModelExecutionEnterprisePolicyValue::kDisable)), + model_execution::prefs::ModelExecutionEnterprisePolicyValue:: + kDisable)), nullptr); policy_provider_.UpdateChromePolicy(policies); base::RunLoop().RunUntilIdle(); @@ -1638,39 +1550,33 @@ EXPECT_FALSE( ogks->ShouldFeatureBeCurrentlyAllowedForLogging(compose_feature)); - EXPECT_FALSE( - ogks->GetChromeModelQualityLogsUploaderService()->CanUploadLogs( - optimization_guide::UserVisibleFeatureKey::kCompose)); + EXPECT_FALSE(ogks->GetChromeModelQualityLogsUploaderService()->CanUploadLogs( + UserVisibleFeatureKey::kCompose)); // Enable logging via via the enterprise policy to state kAllow this shouldn't // stop upload and should return // ChromeModelQualityLogsUploaderService::CanUploadLogs to true. - policies.Set(policy::key::kHelpMeWriteSettings, - policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, - policy::POLICY_SOURCE_CLOUD, - base::Value(static_cast<int>( - optimization_guide::model_execution::prefs:: - ModelExecutionEnterprisePolicyValue::kAllow)), - nullptr); + policies.Set( + policy::key::kHelpMeWriteSettings, policy::POLICY_LEVEL_MANDATORY, + policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, + base::Value(static_cast<int>( + model_execution::prefs::ModelExecutionEnterprisePolicyValue::kAllow)), + nullptr); policy_provider_.UpdateChromePolicy(policies); - prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName(compose_feature), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + prefs->SetInteger(prefs::GetSettingEnabledPrefName(compose_feature), + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(ogks->ShouldFeatureBeCurrentlyAllowedForLogging(compose_feature)); - EXPECT_TRUE( - ogks->GetChromeModelQualityLogsUploaderService()->CanUploadLogs( - optimization_guide::UserVisibleFeatureKey::kCompose)); + EXPECT_TRUE(ogks->GetChromeModelQualityLogsUploaderService()->CanUploadLogs( + UserVisibleFeatureKey::kCompose)); // Upload should be disabled twice when logging is disabled via enterprise // policy, total count should be 2. histogram_tester()->ExpectBucketCount( "OptimizationGuide.ModelQualityLogsUploaderService.UploadStatus.Compose", - optimization_guide::ModelQualityLogsUploadStatus:: - kDisabledDueToEnterprisePolicy, - 2); + ModelQualityLogsUploadStatus::kDisabledDueToEnterprisePolicy, 2); } IN_PROC_BROWSER_TEST_F(OptimizationGuideKeyedServiceEnterpriseBrowserTest, @@ -1682,34 +1588,31 @@ auto* profile = browser()->profile(); OptimizationGuideKeyedService* ogks = OptimizationGuideKeyedServiceFactory::GetForProfile(profile); - auto compose_feature = optimization_guide::UserVisibleFeatureKey::kCompose; + auto compose_feature = UserVisibleFeatureKey::kCompose; auto* prefs = profile->GetPrefs(); policy::PolicyMap policies; // Enable logging via via the enterprise policy to state kAllow this shouldn't // stop upload and should return // ChromeModelQualityLogsUploaderService::CanUploadLogs to true. - policies.Set(policy::key::kHelpMeWriteSettings, - policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, - policy::POLICY_SOURCE_CLOUD, - base::Value(static_cast<int>( - optimization_guide::model_execution::prefs:: - ModelExecutionEnterprisePolicyValue::kAllow)), - nullptr); + policies.Set( + policy::key::kHelpMeWriteSettings, policy::POLICY_LEVEL_MANDATORY, + policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, + base::Value(static_cast<int>( + model_execution::prefs::ModelExecutionEnterprisePolicyValue::kAllow)), + nullptr); policy_provider_.UpdateChromePolicy(policies); - prefs->SetInteger( - optimization_guide::prefs::GetSettingEnabledPrefName(compose_feature), - static_cast<int>(optimization_guide::prefs::FeatureOptInState::kEnabled)); + prefs->SetInteger(prefs::GetSettingEnabledPrefName(compose_feature), + static_cast<int>(prefs::FeatureOptInState::kEnabled)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(ogks->ShouldFeatureBeCurrentlyAllowedForLogging(compose_feature)); - EXPECT_TRUE( - ogks->GetChromeModelQualityLogsUploaderService()->CanUploadLogs( - optimization_guide::UserVisibleFeatureKey::kCompose)); + EXPECT_TRUE(ogks->GetChromeModelQualityLogsUploaderService()->CanUploadLogs( + UserVisibleFeatureKey::kCompose)); // Create a new ModelQualityLogEntry for compose. - std::unique_ptr<optimization_guide::ModelQualityLogEntry> log_entry = + std::unique_ptr<ModelQualityLogEntry> log_entry = GetModelQualityLogEntryForCompose(); // Destruct the log entry, this should upload the logs. @@ -1722,3 +1625,5 @@ } #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) + +} // namespace optimization_guide
diff --git a/chrome/browser/os_crypt/app_bound_encryption_provider_win.cc b/chrome/browser/os_crypt/app_bound_encryption_provider_win.cc index 6e779e6..3da07040 100644 --- a/chrome/browser/os_crypt/app_bound_encryption_provider_win.cc +++ b/chrome/browser/os_crypt/app_bound_encryption_provider_win.cc
@@ -177,6 +177,10 @@ return g_enable_encryption_for_testing; } +bool AppBoundEncryptionProviderWin::IsCompatibleWithOsCryptSync() { + return false; +} + base::expected<std::vector<const uint8_t>, AppBoundEncryptionProviderWin::KeyRetrievalStatus> AppBoundEncryptionProviderWin::RetrieveEncryptedKey() {
diff --git a/chrome/browser/os_crypt/app_bound_encryption_provider_win.h b/chrome/browser/os_crypt/app_bound_encryption_provider_win.h index e481849a..26f8858 100644 --- a/chrome/browser/os_crypt/app_bound_encryption_provider_win.h +++ b/chrome/browser/os_crypt/app_bound_encryption_provider_win.h
@@ -52,6 +52,7 @@ // os_crypt_async::KeyProvider interface. void GetKey(KeyCallback callback) override; bool UseForEncryption() override; + bool IsCompatibleWithOsCryptSync() override; base::expected<std::vector<const uint8_t>, KeyRetrievalStatus> RetrieveEncryptedKey();
diff --git a/chrome/browser/password_manager/account_password_store_factory.cc b/chrome/browser/password_manager/account_password_store_factory.cc index 7bd8c4eb..44204ad 100644 --- a/chrome/browser/password_manager/account_password_store_factory.cc +++ b/chrome/browser/password_manager/account_password_store_factory.cc
@@ -27,6 +27,7 @@ #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/password_manager/core/browser/affiliation/password_affiliation_source_adapter.h" #include "components/password_manager/core/browser/features/password_features.h" +#include "components/password_manager/core/browser/password_manager_buildflags.h" #include "components/password_manager/core/browser/password_manager_constants.h" #include "components/password_manager/core/browser/password_reuse_manager.h" #include "components/password_manager/core/browser/password_store/login_database.h" @@ -42,6 +43,7 @@ #if BUILDFLAG(IS_ANDROID) #include "chrome/browser/password_manager/android/password_manager_android_util.h" +#include "chrome/browser/password_manager/android/password_manager_util_bridge.h" #include "chrome/browser/ui/android/tab_model/tab_model.h" #include "chrome/browser/ui/android/tab_model/tab_model_list.h" #else @@ -104,6 +106,17 @@ scoped_refptr<RefcountedKeyedService> BuildPasswordStore( content::BrowserContext* context) { +#if BUILDFLAG(IS_ANDROID) && !BUILDFLAG(USE_LOGIN_DATABASE_AS_BACKEND) + if (!password_manager_android_util::IsInternalBackendPresent()) { + LOG(ERROR) + << "Password store is not supported: use_login_database_as_backend is " + "false when Chrome's internal backend is not present. Please, set " + "use_login_database_as_backend=true in the args.gn file to enable " + "Chrome password store."; + return nullptr; + } +#endif + Profile* profile = Profile::FromBrowserContext(context); CHECK(password_manager::features_util::CanCreateAccountStore(
diff --git a/chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.cc b/chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.cc index 0b025ac..88825cc 100644 --- a/chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.cc +++ b/chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.cc
@@ -13,9 +13,10 @@ AllPasswordsBottomSheetHelper::AllPasswordsBottomSheetHelper( password_manager::PasswordStoreInterface* profile_store, password_manager::PasswordStoreInterface* account_store) { - DCHECK(profile_store); - profile_store->GetAllLoginsWithAffiliationAndBrandingInformation( - weak_ptr_factory_.GetWeakPtr()); + if (profile_store) { + profile_store->GetAllLoginsWithAffiliationAndBrandingInformation( + weak_ptr_factory_.GetWeakPtr()); + } if (account_store) { account_store->GetAllLoginsWithAffiliationAndBrandingInformation( weak_ptr_factory_.GetWeakPtr());
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc index 57bcedf..ae56a60 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.cc +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -78,6 +78,7 @@ #include "components/password_manager/core/browser/password_manager_setting.h" #include "components/password_manager/core/browser/password_manager_settings_service.h" #include "components/password_manager/core/browser/password_requirements_service.h" +#include "components/password_manager/core/browser/password_store/password_store_interface.h" #include "components/password_manager/core/browser/password_sync_util.h" #include "components/password_manager/core/common/password_manager_features.h" #include "components/prefs/pref_service.h" @@ -352,6 +353,10 @@ autofill::FieldRendererId focused_field_id, autofill::mojom::FocusedFieldType focused_field_type) { #if BUILDFLAG(IS_ANDROID) + // Suppress keyboard accessory if password store is not available. + if (GetProfilePasswordStore() == nullptr) { + return; + } ManualFillingController::GetOrCreate(web_contents()) ->NotifyFocusedInputChanged(focused_field_id, focused_field_type); GetOrCreatePasswordAccessory()->UpdateCredManReentryUi(focused_field_type); @@ -1705,12 +1710,17 @@ } void ChromePasswordManagerClient::TryToShowLocalPasswordMigrationWarning() { + password_manager::PasswordStoreInterface* profile_password_store = + GetProfilePasswordStore(); + if (profile_password_store == nullptr) { + return; + } password_migration_warning_startup_launcher_ = std::make_unique<PasswordMigrationWarningStartupLauncher>( web_contents(), profile_, base::BindOnce(&local_password_migration::ShowWarning)); password_migration_warning_startup_launcher_ - ->MaybeFetchPasswordsAndShowWarning(GetProfilePasswordStore()); + ->MaybeFetchPasswordsAndShowWarning(profile_password_store); } void ChromePasswordManagerClient::TryToShowPostPasswordMigrationSheet() {
diff --git a/chrome/browser/password_manager/profile_password_store_factory.cc b/chrome/browser/password_manager/profile_password_store_factory.cc index 2a869fea..ef6a995 100644 --- a/chrome/browser/password_manager/profile_password_store_factory.cc +++ b/chrome/browser/password_manager/profile_password_store_factory.cc
@@ -20,6 +20,8 @@ #include "chrome/common/chrome_paths_internal.h" #include "components/affiliations/core/browser/affiliation_service.h" #include "components/password_manager/core/browser/affiliation/password_affiliation_source_adapter.h" +#include "components/password_manager/core/browser/features/password_features.h" +#include "components/password_manager/core/browser/password_manager_buildflags.h" #include "components/password_manager/core/browser/password_manager_constants.h" #include "components/password_manager/core/browser/password_store/password_store.h" #include "components/password_manager/core/browser/password_store_factory_util.h" @@ -27,6 +29,9 @@ #include "content/public/browser/network_service_instance.h" #include "content/public/browser/storage_partition.h" #include "services/network/public/cpp/shared_url_loader_factory.h" +#if BUILDFLAG(IS_ANDROID) +#include "chrome/browser/password_manager/android/password_manager_util_bridge.h" +#endif // BUILDFLAG(IS_ANDROID) using password_manager::AffiliatedMatchHelper; using password_manager::PasswordStore; @@ -36,6 +41,17 @@ scoped_refptr<RefcountedKeyedService> BuildPasswordStore( content::BrowserContext* context) { +#if BUILDFLAG(IS_ANDROID) && !BUILDFLAG(USE_LOGIN_DATABASE_AS_BACKEND) + if (!password_manager_android_util::IsInternalBackendPresent()) { + LOG(ERROR) + << "Password store is not supported: use_login_database_as_backend is " + "false when Chrome's internal backend is not present. Please, set " + "use_login_database_as_backend=true in the args.gn file to enable " + "Chrome password store."; + return nullptr; + } +#endif + Profile* profile = Profile::FromBrowserContext(context); DCHECK(!profile->IsOffTheRecord());
diff --git a/chrome/browser/policy/BUILD.gn b/chrome/browser/policy/BUILD.gn index 18a3436..2215f9c 100644 --- a/chrome/browser/policy/BUILD.gn +++ b/chrome/browser/policy/BUILD.gn
@@ -8,13 +8,13 @@ import("//components/signin/features.gni") import("//extensions/buildflags/buildflags.gni") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + source_set("path_parser") { sources = [ "policy_path_parser.h" ] if (is_chromeos || is_linux) { sources += [ "policy_path_parser_linux.cc" ] - } else if (is_fuchsia) { - sources += [ "policy_path_parser_fuchsia.cc" ] } else if (is_mac) { sources += [ "policy_path_parser_mac.mm" ] } else if (is_win) {
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index ced82cac..4a1bcce 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -1624,9 +1624,6 @@ { key::kArcVmDataMigrationStrategy, arc::prefs::kArcVmDataMigrationStrategy, base::Value::Type::INTEGER }, - { key::kGlanceablesEnabled, - ash::prefs::kGlanceablesEnabled, - base::Value::Type::BOOLEAN }, { key::kFullRestoreMode, ash::prefs::kRestoreAppsAndPagesPrefName, base::Value::Type::INTEGER },
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index 4d3d0a7d2..43bdece 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc
@@ -1047,6 +1047,7 @@ // Deprecated 04/2024 constexpr char kMetricsUserInheritOwnerConsent[] = "metrics.user_inherit_owner_consent"; +constexpr char kGlanceablesEnabled[] = "ash.glanceables_enabled"; #endif // BUILDFLAG(IS_CHROMEOS_ASH) // Register local state used only for migration (clearing or moving to a new @@ -1495,6 +1496,7 @@ // Deprecated 04/2024. #if BUILDFLAG(IS_CHROMEOS_ASH) registry->RegisterBooleanPref(kMetricsUserInheritOwnerConsent, true); + registry->RegisterBooleanPref(kGlanceablesEnabled, true); #endif // BUILDFLAG(IS_CHROMEOS_ASH) } @@ -2819,6 +2821,7 @@ // Added 04/2024. #if BUILDFLAG(IS_CHROMEOS_ASH) profile_prefs->ClearPref(kMetricsUserInheritOwnerConsent); + profile_prefs->ClearPref(kGlanceablesEnabled); #endif // BUILDFLAG(IS_CHROMEOS_ASH) // Please don't delete the following line. It is used by PRESUBMIT.py.
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc index 9fb93f9..e1a2d2e1 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
@@ -546,7 +546,7 @@ null_contents->SetWasDiscarded(true); std::unique_ptr<content::WebContents> old_contents_deleter = - tab_strip_model_->ReplaceWebContentsAt(index, std::move(null_contents)); + tab_strip_model_->DiscardWebContentsAt(index, std::move(null_contents)); DCHECK_EQ(web_contents(), raw_null_contents); // Discard the old tab's renderer.
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc index 43d5eaf3..7d50f5fe 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
@@ -481,7 +481,7 @@ {first_lifecycle_unit}); } -TEST_F(TabLifecycleUnitSourceTest, ReplaceWebContents) { +TEST_F(TabLifecycleUnitSourceTest, DiscardWebContents) { LifecycleUnit* first_lifecycle_unit = nullptr; LifecycleUnit* second_lifecycle_unit = nullptr; CreateTwoTabs(true /* focus_tab_strip */, &first_lifecycle_unit, @@ -498,7 +498,7 @@ CreateTestWebContents(); content::WebContents* raw_new_web_contents = new_web_contents.get(); std::unique_ptr<content::WebContents> original_web_contents_deleter = - tab_strip_model_->ReplaceWebContentsAt(1, std::move(new_web_contents)); + tab_strip_model_->DiscardWebContentsAt(1, std::move(new_web_contents)); EXPECT_EQ(original_web_contents, original_web_contents_deleter.get()); EXPECT_FALSE(source_->GetTabLifecycleUnitExternal(original_web_contents)); EXPECT_EQ(tab_lifecycle_unit_external,
diff --git a/chrome/browser/resources/BUILD.gn b/chrome/browser/resources/BUILD.gn index 349be01..38f66d2 100644 --- a/chrome/browser/resources/BUILD.gn +++ b/chrome/browser/resources/BUILD.gn
@@ -13,6 +13,7 @@ import("//tools/grit/repack.gni") assert(!is_ios, "Chromium/iOS shouldn't use anything in //chrome") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") group("resources") { public_deps = [ @@ -104,15 +105,15 @@ public_deps += [ "dlp_internals:resources" ] } - if (is_win || is_mac || is_linux || is_chromeos_lacros || is_fuchsia) { + if (is_win || is_mac || is_linux || is_chromeos_lacros) { public_deps += [ "browser_switch:resources" ] } - if (is_win || is_mac || is_linux || is_chromeos || is_fuchsia) { + if (is_win || is_mac || is_linux || is_chromeos) { public_deps += [ "discards:resources" ] } - if (is_win || is_mac || is_linux || is_fuchsia) { + if (is_win || is_mac || is_linux) { public_deps += [ "app_home:resources", "app_settings:resources",
diff --git a/chrome/browser/resources/app_settings/BUILD.gn b/chrome/browser/resources/app_settings/BUILD.gn index 8288080..395e4557 100644 --- a/chrome/browser/resources/app_settings/BUILD.gn +++ b/chrome/browser/resources/app_settings/BUILD.gn
@@ -5,7 +5,8 @@ import("//chrome/common/features.gni") import("//ui/webui/resources/tools/build_webui.gni") -assert(is_win || is_mac || is_linux || is_fuchsia) +assert(is_win || is_mac || is_linux) +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") build_webui("build") { grd_prefix = "app_settings"
diff --git a/chrome/browser/resources/ash/settings/BUILD.gn b/chrome/browser/resources/ash/settings/BUILD.gn index 8bd6cfb..0d91d59 100644 --- a/chrome/browser/resources/ash/settings/BUILD.gn +++ b/chrome/browser/resources/ash/settings/BUILD.gn
@@ -51,6 +51,7 @@ "controls/settings_radio_group.ts", "controls/settings_slider.ts", "controls/settings_toggle_button.ts", + "controls/v2/settings_dropdown_v2.ts", "crostini_page/bruschetta_subpage.ts", "crostini_page/crostini_arc_adb.ts", "crostini_page/crostini_arc_adb_confirmation_dialog.ts",
diff --git a/chrome/browser/resources/ash/settings/controls/v2/settings_dropdown_v2.html b/chrome/browser/resources/ash/settings/controls/v2/settings_dropdown_v2.html new file mode 100644 index 0000000..272e551 --- /dev/null +++ b/chrome/browser/resources/ash/settings/controls/v2/settings_dropdown_v2.html
@@ -0,0 +1,19 @@ +<style include="md-select cros-color-overrides"> +</style> + +<select id="select" + class="md-select" + aria-label$="[[ariaLabel]]" + on-change="onChange_" + disabled="[[isSelectDisabled_(disabled, options)]]"> + <template is="dom-repeat" items="[[options]]" as="option"> + <option value="[[option.value]]" + hidden="[[option.hidden]]" + selected="[[isOptionSelected_(option, pref.*)]]"> + [[option.label]] + </option> + </template> + <option value="[[notFoundValue]]" hidden aria-hidden="true" + selected="[[isNotFoundOptionSelected_(pref.*)]]"> + </option> +</select>
diff --git a/chrome/browser/resources/ash/settings/controls/v2/settings_dropdown_v2.ts b/chrome/browser/resources/ash/settings/controls/v2/settings_dropdown_v2.ts new file mode 100644 index 0000000..4297579 --- /dev/null +++ b/chrome/browser/resources/ash/settings/controls/v2/settings_dropdown_v2.ts
@@ -0,0 +1,156 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview + * 'settings-dropdown-v2' is an element displaying a list of options. Works with + * or without a pref object. + */ + +import 'chrome://resources/ash/common/cr_elements/cr_shared_vars.css.js'; +import 'chrome://resources/ash/common/cr_elements/cros_color_overrides.css.js'; +import 'chrome://resources/ash/common/cr_elements/md_select.css.js'; +import 'chrome://resources/ash/common/cr_elements/policy/cr_policy_pref_indicator.js'; + +import {prefToString as prefValueToString, stringToPrefValue} from '/shared/settings/prefs/pref_util.js'; +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {PrefControlMixinInternal} from './pref_control_mixin_internal.js'; +import {getTemplate} from './settings_dropdown_v2.html.js'; + +/** + * - `label` is shown in the UI. + * - `value` is the underlying value for the option. + * - `hidden` specifies whether to hide this option in the UI. + */ +interface DropdownOption { + label: string; + value: number|string; + hidden?: boolean; +} + +export type DropdownOptionList = DropdownOption[]; + +export interface SettingsDropdownV2Element { + $: { + select: HTMLSelectElement, + }; +} + +const SettingsDropdownV2ElementBase = PrefControlMixinInternal(PolymerElement); + +export class SettingsDropdownV2Element extends SettingsDropdownV2ElementBase { + static get is() { + return 'settings-dropdown-v2' as const; + } + + static get template() { + return getTemplate(); + } + + static get properties() { + return { + /** + * List of options for the dropdown. + */ + options: { + type: Array, + value: () => { + return []; + }, + }, + + /** + * Label for a11y purposes. + */ + ariaLabel: { + type: String, + }, + + /** + * The value of the "not found" dropdown option. This option and value are + * used when there is no matching option for the dropdown's value. In this + * case, the selected value will appear blank in the UI. + */ + notFoundValue: { + type: String, + value: 'SETTINGS_DROPDOWN_NOT_FOUND', + readOnly: true, + }, + }; + } + + readonly notFoundValue: string; + options: DropdownOptionList; + override validPrefTypes: chrome.settingsPrivate.PrefType[] = [ + chrome.settingsPrivate.PrefType.NUMBER, + chrome.settingsPrivate.PrefType.STRING, + ]; + + override focus(): void { + this.$.select.focus(); + } + + /** + * Event handler for when a menu item is selected by user action. Dispatches a + * change event containing the newly selected value. + */ + private onChange_(event: Event): void { + event.stopPropagation(); + const selectedValue = this.$.select.value; + + if (this.pref) { + const prefValue = stringToPrefValue(selectedValue, this.pref); + if (prefValue === undefined) { + return; + } + + this.set('pref.value', prefValue); + this.dispatchPrefChange(prefValue); + this.dispatchEvent(new CustomEvent( + 'change', {bubbles: true, composed: true, detail: prefValue})); + } else { + // TODO(b/333454296) Support non-pref capability. + } + } + + /** + * Determines if the internal select element should be disabled. It should be + * disabled if there are no menu items. + */ + private isSelectDisabled_(): boolean { + return this.disabled || this.options.length === 0; + } + + /** + * Determines if the option with the given `value` is selected. If `value` + * matches the pref value, then the respective option is selected. + */ + private isOptionSelected_(option: DropdownOption): boolean { + if (this.pref) { + return prefValueToString(this.pref) === option.value.toString(); + } + + // TODO(b/333454296) Support non-pref capability. + return false; + } + + /** + * Determines if the "not found" option is selected. This option should be + * selected if no other options are selected. + */ + private isNotFoundOptionSelected_(): boolean { + return !this.options.some((option) => { + return this.isOptionSelected_(option); + }); + } +} + +declare global { + interface HTMLElementTagNameMap { + [SettingsDropdownV2Element.is]: SettingsDropdownV2Element; + } +} + +customElements.define(SettingsDropdownV2Element.is, SettingsDropdownV2Element);
diff --git a/chrome/browser/resources/ash/settings/device_page/audio.html b/chrome/browser/resources/ash/settings/device_page/audio.html index cd6a824..42b2417e 100644 --- a/chrome/browser/resources/ash/settings/device_page/audio.html +++ b/chrome/browser/resources/ash/settings/device_page/audio.html
@@ -192,7 +192,8 @@ </div> </div> <div id="audioInputNoiseCancellationSubsection" class="settings-box" - hidden="[[!isNoiseCancellationSupported_]]"> + hidden="[[!isNoiseCancellationSupported_]]" + on-click="onNoiseCancellationRowClicked_" actionable-row> <div id="audioInputNoiseCancellationLabel" class="settings-box-text start" aria-hidden="true"> $i18n{audioInputNoiseCancellationTitle}
diff --git a/chrome/browser/resources/ash/settings/device_page/audio.ts b/chrome/browser/resources/ash/settings/device_page/audio.ts index d80bc5ec..4f12c3dc 100644 --- a/chrome/browser/resources/ash/settings/device_page/audio.ts +++ b/chrome/browser/resources/ash/settings/device_page/audio.ts
@@ -16,8 +16,10 @@ import {PrefsMixin} from '/shared/settings/prefs/prefs_mixin.js'; import {CrSliderElement} from 'chrome://resources/ash/common/cr_elements/cr_slider/cr_slider.js'; +import {CrToggleElement} from 'chrome://resources/ash/common/cr_elements/cr_toggle/cr_toggle.js'; import {I18nMixin} from 'chrome://resources/ash/common/cr_elements/i18n_mixin.js'; import {WebUiListenerMixin} from 'chrome://resources/ash/common/cr_elements/web_ui_listener_mixin.js'; +import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js'; import {assert} from 'chrome://resources/js/assert.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -439,6 +441,13 @@ this.audioAndCaptionsBrowserProxy_.setStartupSoundEnabled( this.startupSoundEnabled_); } + + private onNoiseCancellationRowClicked_(): void { + const noiseCancellationToggle = strictQuery( + '#audioInputNoiseCancellationToggle', this.shadowRoot, CrToggleElement); + this.crosAudioConfig_.setNoiseCancellationEnabled( + !noiseCancellationToggle.checked); + } } declare global {
diff --git a/chrome/browser/resources/ash/settings/os_settings.ts b/chrome/browser/resources/ash/settings/os_settings.ts index bf98bdc0..02f73c82 100644 --- a/chrome/browser/resources/ash/settings/os_settings.ts +++ b/chrome/browser/resources/ash/settings/os_settings.ts
@@ -139,6 +139,7 @@ export {SettingsSliderElement} from './controls/settings_slider.js'; export {SettingsToggleButtonElement} from './controls/settings_toggle_button.js'; export {PrefControlMixinInternal} from './controls/v2/pref_control_mixin_internal.js'; +export {SettingsDropdownV2Element} from './controls/v2/settings_dropdown_v2.js'; export {SettingsAudioElement} from './device_page/audio.js'; export {setCrosAudioConfigForTesting} from './device_page/cros_audio_config.js'; export {SettingsDevicePageElement} from './device_page/device_page.js';
diff --git a/chrome/browser/resources/extensions/detail_view.html b/chrome/browser/resources/extensions/detail_view.html index 8195365..6c8b59a 100644 --- a/chrome/browser/resources/extensions/detail_view.html +++ b/chrome/browser/resources/extensions/detail_view.html
@@ -251,11 +251,11 @@ disabled$="[[!isEnableToggleEnabled_(data.*)]]" hidden$="[[!showEnableToggle_(data.*)]]"> </cr-toggle> - <paper-tooltip id="enable-toggle-tooltip" for="enableToggle" + <cr-tooltip id="enable-toggle-tooltip" for="enableToggle" position="left" aria-hidden="true" animation-delay="0" fit-to-visible-bounds> [[getEnableToggleTooltipText_(data.*)]] - </paper-tooltip> + </cr-tooltip> </div> </div> <div id="warnings" hidden$="[[!hasSevereWarnings_(data.*)]]">
diff --git a/chrome/browser/resources/extensions/detail_view.ts b/chrome/browser/resources/extensions/detail_view.ts index 609e34a6..e54118e 100644 --- a/chrome/browser/resources/extensions/detail_view.ts +++ b/chrome/browser/resources/extensions/detail_view.ts
@@ -7,6 +7,7 @@ import 'chrome://resources/cr_elements/cr_icons.css.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; +import 'chrome://resources/cr_elements/cr_tooltip/cr_tooltip.js'; import 'chrome://resources/cr_elements/icons.html.js'; import 'chrome://resources/cr_elements/policy/cr_tooltip_icon.js'; import 'chrome://resources/cr_elements/cr_shared_style.css.js';
diff --git a/chrome/browser/resources/extensions/item.html b/chrome/browser/resources/extensions/item.html index 73fb2ba..5d2ab64 100644 --- a/chrome/browser/resources/extensions/item.html +++ b/chrome/browser/resources/extensions/item.html
@@ -156,7 +156,7 @@ width: 16px; } - paper-tooltip { + cr-tooltip { --paper-tooltip-min-width: 0; } @@ -204,10 +204,10 @@ be contained inside of a position:relative parent element. --> <template is="dom-if" if="[[computeSourceIndicatorIcon_(data.*)]]"> - <paper-tooltip id="source-indicator-text" for="source-indicator" + <cr-tooltip id="source-indicator-text" for="source-indicator" position="top" fit-to-visible-bounds aria-hidden="true"> [[computeSourceIndicatorText_(data.*)]] - </paper-tooltip> + </cr-tooltip> </template> <div id="content"> <!--Note: We wrap inspect-views in a div so that the outer div @@ -338,10 +338,10 @@ icon-class="cr20:kite" icon-aria-label="$i18n{parentDisabledPermissions}"> </cr-tooltip-icon> - <paper-tooltip id="enable-toggle-tooltip" for="enableToggle" position="left" + <cr-tooltip id="enable-toggle-tooltip" for="enableToggle" position="left" aria-hidden="true" animation-delay="0" fit-to-visible-bounds> [[getEnableToggleTooltipText_(data.*)]] - </paper-tooltip> + </cr-tooltip> <cr-toggle id="enableToggle" aria-label$="[[getEnableToggleAriaLabel_(data.*)]]" aria-describedby="a11yAssociation enable-toggle-tooltip"
diff --git a/chrome/browser/resources/extensions/item.ts b/chrome/browser/resources/extensions/item.ts index 003232a..937278b 100644 --- a/chrome/browser/resources/extensions/item.ts +++ b/chrome/browser/resources/extensions/item.ts
@@ -6,6 +6,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons.css.js'; import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; +import 'chrome://resources/cr_elements/cr_tooltip/cr_tooltip.js'; import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/icons.html.js'; import 'chrome://resources/cr_elements/cr_shared_style.css.js'; @@ -18,7 +19,6 @@ import './strings.m.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; -import 'chrome://resources/polymer/v3_0/paper-tooltip/paper-tooltip.js'; import type {ChromeEvent} from '/tools/typescript/definitions/chrome_event.js'; import {getToastManager} from 'chrome://resources/cr_elements/cr_toast/cr_toast_manager.js';
diff --git a/chrome/browser/resources/history/app.ts b/chrome/browser/resources/history/app.ts index ebf907c..a03ed2aa 100644 --- a/chrome/browser/resources/history/app.ts +++ b/chrome/browser/resources/history/app.ts
@@ -251,7 +251,7 @@ queryStateAfterDate_: { type: Object, - computed: 'computeQueryStateAfterDate_(queryState_.after)', + computed: 'computeQueryStateAfterDate_(queryState_.*)', }, }; } @@ -727,6 +727,13 @@ const afterDate = new Date(afterString); afterDate.setHours(0, 0, 0, 0); + + // This compute function listens for any subproperty changes on the + // queryState_ so the `after` param may not have changed. + if (this.queryStateAfterDate_?.getTime() === afterDate.getTime()) { + return this.queryStateAfterDate_; + } + return afterDate; }
diff --git a/chrome/browser/resources/history/history_toolbar.ts b/chrome/browser/resources/history/history_toolbar.ts index a8e1de3..5de9eec 100644 --- a/chrome/browser/resources/history/history_toolbar.ts +++ b/chrome/browser/resources/history/history_toolbar.ts
@@ -138,7 +138,9 @@ } private onSearchChanged_(event: CustomEvent<string>) { - this.fire_('change-query', {search: event.detail}); + this.fire_( + 'change-query', + {search: event.detail, /* Prevent updating after date. */ after: null}); } private numberOfItemsSelected_(count: number): string {
diff --git a/chrome/browser/resources/lens/overlay/BUILD.gn b/chrome/browser/resources/lens/overlay/BUILD.gn index ef6dc6133..a5689c8 100644 --- a/chrome/browser/resources/lens/overlay/BUILD.gn +++ b/chrome/browser/resources/lens/overlay/BUILD.gn
@@ -11,6 +11,9 @@ static_files = [ "lens_overlay.html", + "lens.svg", + "text.svg", + "search.svg", "side_panel/side_panel.html", ]
diff --git a/chrome/browser/resources/lens/overlay/lens.svg b/chrome/browser/resources/lens/overlay/lens.svg new file mode 100644 index 0000000..d4c25df3 --- /dev/null +++ b/chrome/browser/resources/lens/overlay/lens.svg
@@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#005097" viewBox="0 -960 960 960"><path d="M480-320q-50 0-85-35t-35-85q0-50 35-85t85-35q50 0 85 35t35 85q0 50-35 85t-85 35Zm240 160q-33 0-56.5-23.5T640-240q0-33 23.5-56.5T720-320q33 0 56.5 23.5T800-240q0 33-23.5 56.5T720-160Zm-440 40q-66 0-113-47t-47-113v-80h80v80q0 33 23.5 56.5T280-200h200v80H280Zm480-320v-160q0-33-23.5-56.5T680-680H280q-33 0-56.5 23.5T200-600v120h-80v-120q0-66 47-113t113-47h80l40-80h160l40 80h80q66 0 113 47t47 113v160h-80Z"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/lens/overlay/lens_overlay_app.html b/chrome/browser/resources/lens/overlay/lens_overlay_app.html index 25d96fb..6b87ce2 100644 --- a/chrome/browser/resources/lens/overlay/lens_overlay_app.html +++ b/chrome/browser/resources/lens/overlay/lens_overlay_app.html
@@ -2,8 +2,8 @@ .app-container { width: 100%; height: 100%; - /* Make it evident what is the live page peeking through vs screenshot. */ - background-color: rgba(60, 60, 60, 0.5); + /* Background color #151C26 with 30% transparency */ + background-color: #151C264D; } #closeButton {
diff --git a/chrome/browser/resources/lens/overlay/object_layer.ts b/chrome/browser/resources/lens/overlay/object_layer.ts index b85e75cc..597ff5c 100644 --- a/chrome/browser/resources/lens/overlay/object_layer.ts +++ b/chrome/browser/resources/lens/overlay/object_layer.ts
@@ -10,7 +10,6 @@ import type {DomRepeat} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {BrowserProxyImpl} from './browser_proxy.js'; -import {toPercent} from './values_converter.js'; import {CenterRotatedBox_CoordinateType} from './geometry.mojom-webui.js'; import type {CenterRotatedBox} from './geometry.mojom-webui.js'; import type {LensPageCallbackRouter} from './lens.mojom-webui.js'; @@ -18,7 +17,9 @@ import type {OverlayObject} from './overlay_object.mojom-webui.js'; import {Polygon_CoordinateType} from './polygon.mojom-webui.js'; import type {PostSelectionBoundingBox} from './post_selection_renderer.js'; -import type {GestureEvent} from './selection_utils.js'; +import type {CursorData} from './selection_overlay.js'; +import {CursorType, type GestureEvent} from './selection_utils.js'; +import {toPercent} from './values_converter.js'; // The percent of the selection layer width and height the object needs to take // up to be considered full page. @@ -155,10 +156,16 @@ const object = this.$.objectsContainer.itemForElement(event.target); this.drawObject(object); + this.dispatchEvent(new CustomEvent<CursorData>( + 'set-cursor', + {bubbles: true, composed: true, detail: {cursor: CursorType.POINTER}})); } private handlePointerLeave() { this.clearCanvas(); + this.dispatchEvent(new CustomEvent<CursorData>( + 'set-cursor', + {bubbles: true, composed: true, detail: {cursor: CursorType.DEFAULT}})); } setCanvasSizeTo(width: number, height: number) {
diff --git a/chrome/browser/resources/lens/overlay/post_selection_renderer.html b/chrome/browser/resources/lens/overlay/post_selection_renderer.html index db2819d..362aa65 100644 --- a/chrome/browser/resources/lens/overlay/post_selection_renderer.html +++ b/chrome/browser/resources/lens/overlay/post_selection_renderer.html
@@ -9,6 +9,14 @@ position: relative; } + #postSelectionScrim { + background-color: #151C26; + height: 100%; + opacity: 20%; + transition: opacity cubic-bezier(0.2, 0.0, 0, 1.0) 400ms; + width: 100%; + } + /** Render the selected part of the image again so it appears glowing over the scrim */ #backgroundImage { @@ -87,6 +95,9 @@ transform: translate(-25%, 25%) } </style> +<div id="postSelectionScrim" + style$="[[getScrimStyleProperties(height, width)]]"> +</div> <div hidden$="[[!hasSelection(height, width)]]"> <img id="backgroundImage" src="[[screenshotDataUri]]"> <!-- This inner postSelection div isn't technically required, but helps make
diff --git a/chrome/browser/resources/lens/overlay/post_selection_renderer.ts b/chrome/browser/resources/lens/overlay/post_selection_renderer.ts index 8021cb0f..315eee3c 100644 --- a/chrome/browser/resources/lens/overlay/post_selection_renderer.ts +++ b/chrome/browser/resources/lens/overlay/post_selection_renderer.ts
@@ -372,6 +372,12 @@ }; } + private getScrimStyleProperties() { + // If there is no selection, set opacity to zero to trigger fade out + // CSS transition. + return !this.hasSelection() ? 'opacity: 0;' : ''; + } + // Used in HTML template to know if there is currently a selection to render. private hasSelection(): boolean { return this.width > 0 && this.height > 0;
diff --git a/chrome/browser/resources/lens/overlay/search.svg b/chrome/browser/resources/lens/overlay/search.svg new file mode 100644 index 0000000..0017a91 --- /dev/null +++ b/chrome/browser/resources/lens/overlay/search.svg
@@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#005097" viewBox="0 -960 960 960"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/lens/overlay/selection_overlay.html b/chrome/browser/resources/lens/overlay/selection_overlay.html index 4736b04..1490684 100644 --- a/chrome/browser/resources/lens/overlay/selection_overlay.html +++ b/chrome/browser/resources/lens/overlay/selection_overlay.html
@@ -8,6 +8,7 @@ } #selectionOverlay { + cursor: crosshair; display: grid; position: relative; @@ -40,21 +41,43 @@ max-height: calc(100vh - 24px); } + #selectionElements { + /* Background color #151C26 with 5% transparency */ + background-color: #151C260D; + } + #selectionElements > * { inset: 0; position: absolute; } - /* Temporary red scrim to make it evident the overlay is opened. */ - #scrim { - position: fixed; - inset: 0; - background-color: rgba(255, 0, 0, 0.15); + + #cursor { + align-items: center; + background: #ebf1ff; + border-radius: 2px 100px 100px 100px; + box-shadow: 0px 4px 12px 0px rgba(27, 28, 20, 0.24); + display: flex; + height: 32px; + justify-content: center; + left: 0; pointer-events: none; + position: fixed; + top: 0; + width: 32px; + } + + #cursorImg { + height: 20px; + width: 20px; + } + + #cursor.hidden { + visibility: hidden; } </style> -<div id="selectionOverlay"> +<div id="selectionOverlay" + on-pointerenter="handlePointerEnter" on-pointerleave="handlePointerLeave"> <img id="backgroundImage" draggable="false" src="[[screenshotDataUri]]"> - <div id="scrim"></div> <!-- Wrapper div is needed to stack the seleciton elements on top of background image. --> <div id="selectionElements"> @@ -68,3 +91,7 @@ <lens-text-layer id="textSelectionLayer"></lens-text-layer> </div> </div> +<div id="cursor" + class$="[[getHiddenCursorClass(isPointerInside, currentGesture.state)]]"> + <img id="cursorImg" src="[[cursorImgUri]]"> +</div>
diff --git a/chrome/browser/resources/lens/overlay/selection_overlay.ts b/chrome/browser/resources/lens/overlay/selection_overlay.ts index 0deba9c..e0722d5 100644 --- a/chrome/browser/resources/lens/overlay/selection_overlay.ts +++ b/chrome/browser/resources/lens/overlay/selection_overlay.ts
@@ -7,20 +7,26 @@ import './region_selection.js'; import './post_selection_renderer.js'; +import {EventTracker} from '//resources/js/event_tracker.js'; import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import type {ObjectLayerElement} from './object_layer.js'; import type {PostSelectionRendererElement} from './post_selection_renderer.js'; import type {RegionSelectionElement} from './region_selection.js'; import {getTemplate} from './selection_overlay.html.js'; -import {DRAG_THRESHOLD, DragFeature, emptyGestureEvent, type GestureEvent, GestureState} from './selection_utils.js'; +import {CursorType, DRAG_THRESHOLD, DragFeature, emptyGestureEvent, type GestureEvent, GestureState} from './selection_utils.js'; import type {TextLayerElement} from './text_layer.js'; const RESIZE_THRESHOLD = 8; +export interface CursorData { + cursor: CursorType; +} + export interface SelectionOverlayElement { $: { backgroundImage: HTMLImageElement, + cursor: HTMLElement, objectSelectionLayer: ObjectLayerElement, postSelectionRenderer: PostSelectionRendererElement, regionSelectionLayer: RegionSelectionElement, @@ -53,9 +59,13 @@ reflectToAttribute: true, }, screenshotDataUri: String, + cursorImgUri: String, + isPointerInside: Boolean, + currentGesture: emptyGestureEvent(), }; } + private eventTracker_: EventTracker = new EventTracker(); // The current gesture event. The coordinate values are only accurate if a // gesture has started. private currentGesture: GestureEvent = emptyGestureEvent(); @@ -78,22 +88,40 @@ private isResized: boolean; // The data URI of the current overlay screenshot. private screenshotDataUri: string; + private cursorImgUri: string = 'lens.svg'; + private cursorOffsetX: number = 3; + private cursorOffsetY: number = 6; + private isPointerInside = false; override connectedCallback() { super.connectedCallback(); this.resizeObserver.observe(this); this.selectionElementsResizeObserver.observe(this.$.selectionOverlay); + this.eventTracker_.add( + document, 'set-cursor', (e: CustomEvent<CursorData>) => { + if (e.detail.cursor === CursorType.POINTER) { + this.setCursorToPointer(); + } else if (e.detail.cursor === CursorType.CROSSHAIR) { + this.setCursorToCrosshair(); + } else if (e.detail.cursor === CursorType.TEXT) { + this.setCursorToText(); + } else { + this.resetCursor(); + } + }); } override disconnectedCallback() { super.disconnectedCallback(); this.resizeObserver.unobserve(this); this.selectionElementsResizeObserver.unobserve(this.$.selectionOverlay); + this.eventTracker_.removeAll(); } override ready() { super.ready(); this.addEventListener('pointerdown', this.onPointerDown.bind(this)); + this.addEventListener('pointermove', this.updateCursorPosition.bind(this)); } private addDragListeners() { @@ -108,6 +136,65 @@ this.removeEventListener('pointercancel', this.onPointerCancel); } + private updateCursorPosition(event: PointerEvent) { + const mouseX = event.clientX; + const mouseY = event.clientY; + + this.$.cursor.style.transform = `translate3d(${ + mouseX + this.cursorOffsetX}px, ${mouseY + this.cursorOffsetY}px, 0)`; + } + + private getHiddenCursorClass(isPointerInside: boolean, state: GestureState): + string { + // Always show when dragging, even if outside the selection overlay. + if (!isPointerInside && state !== GestureState.DRAGGING) { + return 'hidden'; + } else { + return ''; + } + } + + // Called on text hover and drag. + private setCursorToText() { + // Set body cursor style to handle dragging. + document.body.style.cursor = 'text'; + this.cursorImgUri = 'text.svg'; + this.cursorOffsetX = 3; + this.cursorOffsetY = 8; + } + + // Called on region selection drag. + private setCursorToCrosshair() { + // Set body cursor style to handle dragging. + document.body.style.cursor = 'crosshair'; + this.cursorOffsetX = 3; + this.cursorOffsetY = 6; + this.cursorImgUri = 'search.svg'; + } + + // Called on object hover. + private setCursorToPointer() { + // No dragging for objects, so no need to set body cursor style. + this.cursorOffsetX = 4; + this.cursorOffsetY = 8; + this.cursorImgUri = 'search.svg'; + } + + private resetCursor() { + document.body.style.cursor = 'unset'; + this.cursorImgUri = 'lens.svg'; + this.cursorOffsetX = 3; + this.cursorOffsetY = 6; + } + + private handlePointerEnter() { + this.isPointerInside = true; + } + + private handlePointerLeave() { + this.isPointerInside = false; + } + private onPointerDown(event: PointerEvent) { if (this.shouldIgnoreEvent(event)) { return; @@ -126,15 +213,11 @@ if (this.$.textSelectionLayer.handleDownGesture(this.currentGesture)) { // Text is responding to this sequence of gestures. this.draggingRespondent = DragFeature.TEXT; + this.$.postSelectionRenderer.clearSelection(); } else if (this.$.postSelectionRenderer.handleDownGesture( this.currentGesture)) { this.draggingRespondent = DragFeature.POST_SELECTION; } - - // Clear selection if user is dragging on anything but post selection. - if (this.draggingRespondent !== DragFeature.POST_SELECTION) { - this.$.postSelectionRenderer.clearSelection(); - } } private onPointerUp(event: PointerEvent) { @@ -164,6 +247,7 @@ this.currentGesture = emptyGestureEvent(); this.draggingRespondent = DragFeature.NONE; this.removeDragListeners(); + this.resetCursor(); } private onPointerMove(event: PointerEvent) { @@ -175,7 +259,7 @@ this.updateGestureCoordinates(event); if (this.isDragging()) { - this.currentGesture.state = GestureState.DRAGGING; + this.set('currentGesture.state', GestureState.DRAGGING); // Capture pointer events so gestures still work if the users pointer // leaves the selection overlay div. Pointer capture is implicitly @@ -183,12 +267,15 @@ this.setPointerCapture(event.pointerId); if (this.draggingRespondent === DragFeature.TEXT) { + this.setCursorToText(); this.$.textSelectionLayer.handleDragGesture(this.currentGesture); } else if (this.draggingRespondent === DragFeature.POST_SELECTION) { this.$.postSelectionRenderer.handleDragGesture(this.currentGesture); } else { // Let the features respond to the current drag if no other feature // responded first. + this.setCursorToCrosshair(); + this.$.postSelectionRenderer.clearSelection(); this.draggingRespondent = DragFeature.MANUAL_REGION; this.$.regionSelectionLayer.handleDragGesture(this.currentGesture); } @@ -204,6 +291,7 @@ this.currentGesture = emptyGestureEvent(); this.draggingRespondent = DragFeature.NONE; this.removeDragListeners(); + this.resetCursor(); } private handleResize() {
diff --git a/chrome/browser/resources/lens/overlay/selection_utils.ts b/chrome/browser/resources/lens/overlay/selection_utils.ts index 96b05d6..1c99e340 100644 --- a/chrome/browser/resources/lens/overlay/selection_utils.ts +++ b/chrome/browser/resources/lens/overlay/selection_utils.ts
@@ -29,6 +29,13 @@ FINISHED = 3, } +export enum CursorType { + DEFAULT = 0, + POINTER = 1, + CROSSHAIR = 2, + TEXT = 3, +} + export interface GestureEvent { // The state of this event. state: GestureState;
diff --git a/chrome/browser/resources/lens/overlay/text.svg b/chrome/browser/resources/lens/overlay/text.svg new file mode 100644 index 0000000..1384c6e --- /dev/null +++ b/chrome/browser/resources/lens/overlay/text.svg
@@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#005097" viewBox="0 -960 960 960"><path d="m64-132 191-508h91l191 508h-88l-46-130H198l-46 130H64Zm160-204h152l-74-210h-4l-74 210Zm480 216q-57 0-94.5-34.5T572-242q0-54 40.5-88T718-364q24 0 52.5 4.5T820-344v-20q0-32-24-53t-62-21q-27 0-52 11.5T640-392l-56-42q24-35 64-53.5t90-18.5q74 0 116 39.5T896-358v226h-76v-44h-4q-17 26-46.5 41T704-120Zm16-64q41 0 70.5-29.5T820-284q-18-9-40-14.5t-42-5.5q-42 0-64 15.5T652-244q0 27 19 43.5t49 16.5Zm20-375q0-75-53-128t-128-53q75 0 128-52.5T740-920q0 75 52.5 127.5T920-740q-75 0-127.5 53T740-559Z"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/lens/overlay/text_layer.html b/chrome/browser/resources/lens/overlay/text_layer.html index 3bf5cd0..53c88e9 100644 --- a/chrome/browser/resources/lens/overlay/text_layer.html +++ b/chrome/browser/resources/lens/overlay/text_layer.html
@@ -28,6 +28,7 @@ </style> <template id="wordsContainer" is="dom-repeat" items="[[renderedWords]]"> <div style$="[[getWordStyle_(item)]]" class$="word - [[getHighlightedCssClass_(index, selectionStartIndex, selectionEndIndex)]]"> + [[getHighlightedCssClass_(index, selectionStartIndex, selectionEndIndex)]]" + on-pointerenter="handlePointerEnter" on-pointerleave="handlePointerLeave"> </div> </template> \ No newline at end of file
diff --git a/chrome/browser/resources/lens/overlay/text_layer.ts b/chrome/browser/resources/lens/overlay/text_layer.ts index 3dda7d5..7f83004 100644 --- a/chrome/browser/resources/lens/overlay/text_layer.ts +++ b/chrome/browser/resources/lens/overlay/text_layer.ts
@@ -10,13 +10,14 @@ import type {DomRepeat} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {BrowserProxyImpl} from './browser_proxy.js'; -import {toPercent} from './values_converter.js'; import {CenterRotatedBox_CoordinateType} from './geometry.mojom-webui.js'; import {bestHit} from './hit.js'; import type {LensPageCallbackRouter} from './lens.mojom-webui.js'; -import type {GestureEvent} from './selection_utils.js'; +import type {CursorData} from './selection_overlay.js'; +import {CursorType, type GestureEvent} from './selection_utils.js'; import type {Text, Word} from './text.mojom-webui.js'; import {getTemplate} from './text_layer.html.js'; +import {toPercent} from './values_converter.js'; // Returns true if the word has a valid bounding box and is renderable by the // TextLayer. @@ -118,6 +119,18 @@ this.textReceivedListenerId = null; } + private handlePointerEnter() { + this.dispatchEvent(new CustomEvent<CursorData>( + 'set-cursor', + {bubbles: true, composed: true, detail: {cursor: CursorType.TEXT}})); + } + + private handlePointerLeave() { + this.dispatchEvent(new CustomEvent<CursorData>( + 'set-cursor', + {bubbles: true, composed: true, detail: {cursor: CursorType.DEFAULT}})); + } + handleDownGesture(event: GestureEvent): boolean { this.unselectWords();
diff --git a/chrome/browser/resources/new_tab_page_instant/BUILD.gn b/chrome/browser/resources/new_tab_page_instant/BUILD.gn index 83affcf9..d63f631 100644 --- a/chrome/browser/resources/new_tab_page_instant/BUILD.gn +++ b/chrome/browser/resources/new_tab_page_instant/BUILD.gn
@@ -4,7 +4,8 @@ import("//ui/webui/resources/tools/build_webui.gni") -assert(is_linux || is_chromeos || is_win || is_mac || is_fuchsia) +assert(is_linux || is_chromeos || is_win || is_mac) +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") build_webui("build") { grd_prefix = "new_tab_page_instant"
diff --git a/chrome/browser/resources/side_panel/commerce/app.html b/chrome/browser/resources/side_panel/commerce/app.html index 9249e58b..3381c77 100644 --- a/chrome/browser/resources/side_panel/commerce/app.html +++ b/chrome/browser/resources/side_panel/commerce/app.html
@@ -5,7 +5,7 @@ padding: 16px; } - :host-context([chrome-refresh-2023]) .sp-card { + .sp-card { padding: 16px; } @@ -27,18 +27,21 @@ margin-top: 4px; font-size: 12px; font-weight: 400; + line-height: 16px; } .section-title { color: var(--cr-primary-text-color); - font-size: 13px; + font-size: 14px; font-weight: 500; + line-height: 20px; } .history-subtitle { color: var(--cr-secondary-text-color); - margin-top: 4px; font-size: 12px; + line-height: 16px; + margin-top: 8px; } #titleSection > .section-details { @@ -52,23 +55,9 @@ .panel-subtitle, .section-title, .history-subtitle { - line-height: 20px; max-width: 100%; } - :host-context([chrome-refresh-2023]) .panel-subtitle { - line-height: 16px; - } - - :host-context([chrome-refresh-2023]) .section-title { - font-size: 14px; - } - - :host-context([chrome-refresh-2023]) .history-subtitle { - line-height: 16px; - margin-top: 8px; - } - #priceRange { overflow: hidden; }
diff --git a/chrome/browser/resources/side_panel/commerce/history_graph.html b/chrome/browser/resources/side_panel/commerce/history_graph.html index 2124d98..86ac81a 100644 --- a/chrome/browser/resources/side_panel/commerce/history_graph.html +++ b/chrome/browser/resources/side_panel/commerce/history_graph.html
@@ -1,10 +1,5 @@ <style> #historyGraph { - margin-top: 8px; - margin-bottom: 8px; - } - - :host-context([chrome-refresh-2023]) #historyGraph { margin-top: 16px; margin-bottom: 16px; } @@ -12,7 +7,7 @@ .tick { fill: var(--cr-secondary-text-color); font-size: 11px; - line-height: 20px; + line-height: 16px; user-select: none; } @@ -56,7 +51,7 @@ .tooltip-text { fill: var(--cr-primary-text-color); font-size: 11px; - line-height: 20px; + line-height: 16px; text-anchor: middle; } @@ -66,50 +61,26 @@ stroke: var(--google-blue-700); } - :host-context([chrome-refresh-2023]) .tick, - :host-context([chrome-refresh-2023]) .tooltip-text { - line-height: 16px; - } - @media (prefers-color-scheme: dark) { .axis, .divider { - stroke: var(--google-grey-800); + stroke: var(--color-side-panel-commerce-graph-axis); } .path, .dash-line, .circle { - stroke: var(--google-blue-300); + stroke: var(--color-side-panel-commerce-graph-line); } .circle { - fill: var(--google-grey-900); + fill: var(--color-side-panel-card-background); } .bubble { - fill: var(--google-grey-700); + fill: var(--color-side-panel-commerce-graph-bubble-background); } } - - :host-context([chrome-refresh-2023]) .axis, - :host-context([chrome-refresh-2023]) .divider { - stroke: var(--color-side-panel-commerce-graph-axis); - } - - :host-context([chrome-refresh-2023]) .bubble { - fill: var(--color-side-panel-commerce-graph-bubble-background); - } - - :host-context([chrome-refresh-2023]) .circle { - fill: var(--color-side-panel-card-background); - } - - :host-context([chrome-refresh-2023]) .path, - :host-context([chrome-refresh-2023]) .dash-line, - :host-context([chrome-refresh-2023]) .circle { - stroke: var(--color-side-panel-commerce-graph-line); - } </style> <div id="historyGraph" tabindex="0" aria-live="polite"></div> \ No newline at end of file
diff --git a/chrome/browser/resources/side_panel/commerce/history_graph.ts b/chrome/browser/resources/side_panel/commerce/history_graph.ts index 8492120..a036de1 100644 --- a/chrome/browser/resources/side_panel/commerce/history_graph.ts +++ b/chrome/browser/resources/side_panel/commerce/history_graph.ts
@@ -65,24 +65,16 @@ private resizeObserver_: ResizeObserver; private currentWidth_: number; private graphSvg_: any; - private dateTopMarginPx_ = 8; - private priceRightMarginPx_ = 4; - private bubbleHorizontalPaddingPx_ = 4; - private bubbleTopPaddingPx_ = 4; - private bubbleBottomPaddingPx_ = 4; + private dateTopMarginPx_ = 12; + private priceRightMarginPx_ = 8; + private bubbleHorizontalPaddingPx_ = 6; + private bubbleTopPaddingPx_ = 3; + private bubbleBottomPaddingPx_ = 2; private bubbleCornerRadiusPx_ = 3; override connectedCallback() { super.connectedCallback(); - if (document.documentElement.hasAttribute('chrome-refresh-2023')) { - this.dateTopMarginPx_ = 12; - this.priceRightMarginPx_ = 8; - this.bubbleHorizontalPaddingPx_ = 6; - this.bubbleTopPaddingPx_ = 3; - this.bubbleBottomPaddingPx_ = 2; - } - this.points = this.data.map( d => ({date: this.stringToDate_(d.date), price: d.price})); @@ -234,12 +226,10 @@ .attr('opacity', 0) .classed(CssClass.CIRCLE, true); - if (document.documentElement.hasAttribute('chrome-refresh-2023')) { - this.bubbleCornerRadiusPx_ = - (this.bubbleTopPaddingPx_ + this.bubbleBottomPaddingPx_ + - tooltipHeight) / - 2; - } + this.bubbleCornerRadiusPx_ = + (this.bubbleTopPaddingPx_ + this.bubbleBottomPaddingPx_ + + tooltipHeight) / + 2; const bubble = svg.append('rect') .attr('opacity', 0) .attr('y', 0)
diff --git a/chrome/browser/resources/side_panel/commerce/insights_comment_row.html b/chrome/browser/resources/side_panel/commerce/insights_comment_row.html index 88a5c10..46f29eac 100644 --- a/chrome/browser/resources/side_panel/commerce/insights_comment_row.html +++ b/chrome/browser/resources/side_panel/commerce/insights_comment_row.html
@@ -8,10 +8,6 @@ max-width: 100%; color: var(--cr-secondary-text-color); font-size: 11px; - line-height: 20px; - } - - :host-context([chrome-refresh-2023]) #commentRow { line-height: 16px; }
diff --git a/chrome/browser/resources/side_panel/commerce/price_tracking_section.html b/chrome/browser/resources/side_panel/commerce/price_tracking_section.html index dff6caa..0c582f1f 100644 --- a/chrome/browser/resources/side_panel/commerce/price_tracking_section.html +++ b/chrome/browser/resources/side_panel/commerce/price_tracking_section.html
@@ -7,13 +7,8 @@ #toggleTitle { color: var(--cr-primary-text-color); - font-size: 13px; - font-weight: 500; - margin-bottom: 4px; - } - - :host-context([chrome-refresh-2023]) #toggleTitle { font-size: 14px; + font-weight: 500; margin-bottom: 8px; } @@ -24,14 +19,10 @@ #toggleAnnotation { color: var(--cr-secondary-text-color); display: inline; - font-size: 11px; - overflow: hidden; - white-space: initial; - } - - :host-context([chrome-refresh-2023]) #toggleAnnotation { font-size: 12px; line-height: 16px; + overflow: hidden; + white-space: initial; } #toggleText { @@ -39,13 +30,9 @@ display: flex; flex-direction: column; line-height: 20px; - margin-right: 16px; - max-width: 100%; - } - - :host-context([chrome-refresh-2023]) #toggleText { margin-right: 10px; margin-top: -1px; + max-width: 100%; } #toggle {
diff --git a/chrome/browser/resources/side_panel/commerce/shopping_insights.html b/chrome/browser/resources/side_panel/commerce/shopping_insights.html index 0cfc9ebd..f0e8133c 100644 --- a/chrome/browser/resources/side_panel/commerce/shopping_insights.html +++ b/chrome/browser/resources/side_panel/commerce/shopping_insights.html
@@ -4,8 +4,7 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> -<html dir="$i18n{textdirection}" lang="$i18n{language}" - $i18n{chromeRefresh2023Attribute}> +<html dir="$i18n{textdirection}" lang="$i18n{language}"> <head> <meta charset="utf-8"> <meta name="color-scheme" content="light dark"> @@ -15,6 +14,7 @@ <style> html, body { + background: var(--color-side-panel-content-background); height: 100%; margin: 0; padding: 0; @@ -27,11 +27,6 @@ overflow-y: auto; } - html[chrome-refresh-2023], - html[chrome-refresh-2023] body { - background: var(--color-side-panel-content-background); - } - @media (prefers-color-scheme: dark) { body { background: var(--google-grey-900);
diff --git a/chrome/browser/resources/side_panel/read_anything/app.ts b/chrome/browser/resources/side_panel/read_anything/app.ts index 0f01b6c5..57ca776f 100644 --- a/chrome/browser/resources/side_panel/read_anything/app.ts +++ b/chrome/browser/resources/side_panel/read_anything/app.ts
@@ -20,7 +20,7 @@ import {getTemplate} from './app.html.js'; import {validatedFontName} from './common.js'; import type {ReadAnythingToolbarElement} from './read_anything_toolbar.js'; -import {areVoicesEqual, convertLangOrLocaleForVoicePackManager, createInitialListOfEnabledLanguages, isNatural, mojoVoicePackStatusToVoicePackStatusEnum, VoicePackStatus} from './voice_language_util.js'; +import {areVoicesEqual, convertLangOrLocaleForVoicePackManager, createInitialListOfEnabledLanguages, mojoVoicePackStatusToVoicePackStatusEnum, VoicePackStatus} from './voice_language_util.js'; const ReadAnythingElementBase = WebUiListenerMixin(PolymerElement); @@ -905,16 +905,15 @@ this.populateDisplayNamesForLocaleCodes(); - // Update natural voices install status if we're refreshing the list. + // Update voice pack install status if we're refreshing the list. if (refresh) { - const isNaturalVoiceDownloaded = (voice: SpeechSynthesisVoice) => - isNatural(voice) && - (this.voicePackInstallStatus[voice.lang] === - VoicePackStatus.DOWNLOADED); - availableVoices.filter(isNaturalVoiceDownloaded) - .forEach(downloadedNaturalVoice => { + this.availableLangs + .filter( + lang => this.voicePackInstallStatus[lang] === + VoicePackStatus.DOWNLOADED) + .forEach(downloadedLang => { this.setVoicePackStatus_( - downloadedNaturalVoice.lang, VoicePackStatus.INSTALLED); + downloadedLang, VoicePackStatus.INSTALLED); }); } }
diff --git a/chrome/browser/resources/side_panel/read_anything/language_menu.html b/chrome/browser/resources/side_panel/read_anything/language_menu.html index 0f761be..a22a4de 100644 --- a/chrome/browser/resources/side_panel/read_anything/language_menu.html +++ b/chrome/browser/resources/side_panel/read_anything/language_menu.html
@@ -100,12 +100,13 @@ localeToDisplayName, languageSearchValue_, enabledLanguagesInPref)]]"> <div class="language-line dropdown-line"> - <span class="language-name"> + <span id="language-name" class="language-name"> [[item.language]] </span> <cr-toggle checked="[[item.checked]]" - on-change="onToggleChange_"></cr-toggle> + on-change="onToggleChange_" + aria-labelledby="language-name"></cr-toggle> </div> <span id="notificationText">[[item.notificationText]]</span> </template>
diff --git a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html index 834773e..4e42381 100644 --- a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html +++ b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html
@@ -110,7 +110,8 @@ </style> <div id="toolbarContainer" class="toolbar-container" role="toolbar" aria-label="$i18n{readingModeToolbarLabel}" - on-keydown="onToolbarKeyDown_"> + on-keydown="onToolbarKeyDown_" on-reset-toolbar="onResetToolbar_" + on-toolbar-overflow="onToolbarOverflow_"> <template id="read-aloud-container" is="dom-if" if="[[isReadAloudEnabled_]]"> <span id="audio-controls" class$="audio-background-when-paused-[[paused]]"> <cr-icon-button @@ -233,7 +234,7 @@ </cr-icon-button> </template> - <template is="dom-repeat" items="[[textStyleOptions_]]" initial-count="2"> + <template is="dom-repeat" items="[[textStyleOptions_]]" initial-count="3"> <cr-icon-button class="toolbar-button" id="[[item.id]]" @@ -256,31 +257,25 @@ on-click="onMoreOptionsClick_"> </cr-icon-button> - <!-- The more options menu is a menu of cr-icon-buttons that should be - hidden behind a separate menu if the Read Anything toolbar overflows. - All Reading Mode menu items should be wrapped with a cr-lazy-render for - efficiency, but given that we must first render all the menu items - in the more options menu to handle menu positioning, it doesn't - make sense to lazily render the more options menu. Therefore, this - menu should just stay as a cr-action-menu, rendered on load. - TODO(b/329676284): Investigate refactor to handle the menu item - positioning via data binding, so that styling can happen without - rendering the menu. - --> - <cr-action-menu id="moreOptionsMenu" on-keydown="onToolbarKeyDown_" - hidden> - <template is="dom-repeat" items="[[moreOptionsButtons_]]" inital-count="3"> - <cr-icon-button - id="[[item.id]]" - class="more-options-icon" - aria-label="[[item.ariaLabel]]" - title="[[item.ariaLabel]]" - aria-haspopup="menu" - iron-icon="[[item.icon]]" - on-click="onTextStyleMenuButtonClick_"> - </cr-icon-button> + <cr-lazy-render id="moreOptionsMenu"> + <template> + <cr-action-menu on-keydown="onToolbarKeyDown_"> + <template is="dom-repeat" + items="[[moreOptionsButtons_]]" + inital-count="0"> + <cr-icon-button + id="[[item.id]]" + class="more-options-icon" + aria-label="[[item.ariaLabel]]" + title="[[item.ariaLabel]]" + aria-haspopup="menu" + iron-icon="[[item.icon]]" + on-click="onTextStyleMenuButtonClick_"> + </cr-icon-button> + </template> + </cr-action-menu> </template> - </cr-action-menu> + </cr-lazy-render> <cr-lazy-render id="rateMenu"> <template> <cr-action-menu>
diff --git a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.ts b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.ts index 33ed170..5e40e07f 100644 --- a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.ts +++ b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.ts
@@ -36,7 +36,7 @@ letterSpacingMenu: CrLazyRenderElement<CrActionMenuElement>, fontMenu: CrLazyRenderElement<CrActionMenuElement>, fontSizeMenu: CrLazyRenderElement<CrActionMenuElement>, - moreOptionsMenu: CrActionMenuElement, + moreOptionsMenu: CrLazyRenderElement<CrActionMenuElement>, voiceSelectionMenu: VoiceSelectionMenuElement, toolbarContainer: HTMLElement, more: CrIconButtonElement, @@ -83,7 +83,7 @@ } const SETTINGS_CHANGE_UMA = 'Accessibility.ReadAnything.SettingsChange'; -const moreOptionsClass = '.more-options-icon'; +export const moreOptionsClass = '.more-options-icon'; const activeClass = ' active'; // Link toggle button constants. @@ -144,17 +144,12 @@ assert(moreOptionsButton, 'more options button doesn\'t exist'); ReadAnythingToolbarElement.hideElement(moreOptionsButton, false); - // Show all the buttons that would go in the overflow menu to see if they - // fit - const buttons = Array.from(toolbar.querySelectorAll('.toolbar-button')); + // Show all the buttons to see if they fit. + const buttons = + Array.from(toolbar.querySelectorAll<HTMLElement>('.toolbar-button')); assert(buttons, 'no toolbar buttons'); - const moreOptionsButtons = toolbar.querySelectorAll(moreOptionsClass); - assert(moreOptionsButtons, 'no buttons to put in the more options menu'); - const buttonsOnToolbarToMaybeHide = - buttons.slice(buttons.length - moreOptionsButtons.length); - buttonsOnToolbarToMaybeHide.forEach(btn => { - ReadAnythingToolbarElement.showElement(btn as HTMLElement); - }); + buttons.forEach(btn => ReadAnythingToolbarElement.showElement(btn)); + toolbar.dispatchEvent(new CustomEvent('reset-toolbar')); if (!toolbar.offsetParent) { return; @@ -166,18 +161,31 @@ if (toolbar.clientWidth > parentWidth) { ReadAnythingToolbarElement.showElement(moreOptionsButton); - // Ensure the more options menu is visible. - const moreOptionsMenu = - toolbar.querySelector<HTMLElement>('#moreOptionsMenu'); - assert(moreOptionsMenu, 'more options menu doesn\'t exist'); - ReadAnythingToolbarElement.showElement(moreOptionsMenu); + // Hide at least 3 buttons and more if needed. + let numOverflowButtons = 3; + let nextOverflowButton = buttons[buttons.length - numOverflowButtons]; + // No need to hide a button if it only exceeds the width by a little (i.e. + // only the padding overflows). + const maxDiff = 10; + while ((nextOverflowButton.offsetLeft + nextOverflowButton.offsetWidth - + parentWidth) > maxDiff) { + numOverflowButtons++; + nextOverflowButton = buttons[buttons.length - numOverflowButtons]; + } - // Hide all the buttons on the toolbar that are in the more options menu - buttonsOnToolbarToMaybeHide.forEach(btn => { - ReadAnythingToolbarElement.hideElement(btn as HTMLElement, true); - }); - toolbar.insertBefore(moreOptionsButton, buttonsOnToolbarToMaybeHide[0]); - (moreOptionsButtons.item(0) as HTMLElement).style.marginLeft = '16px'; + // Notify the toolbar to populate the more options menu. + toolbar.dispatchEvent(new CustomEvent('toolbar-overflow', { + bubbles: true, + composed: true, + detail: {numOverflowButtons}, + })); + // Hide the overflowed buttons and show the more options button in front + // of them. + const overflowedButtons = + buttons.slice(buttons.length - numOverflowButtons); + overflowedButtons.forEach( + btn => ReadAnythingToolbarElement.hideElement(btn, true)); + toolbar.insertBefore(moreOptionsButton, overflowedButtons[0]); } } @@ -296,7 +304,9 @@ private rateOptions_: number[] = [0.5, 0.8, 1, 1.2, 1.5, 2, 3, 4]; - private moreOptionsButtons_: MenuButton[] = [ + private moreOptionsButtons_: MenuButton[] = []; + + private textStyleOptions_: MenuButton[] = [ { id: 'color', icon: 'read-anything:color', @@ -317,8 +327,6 @@ }, ]; - private textStyleOptions_: MenuButton[] = []; - private showAtPositionConfig_: ShowAtPositionConfig = { top: 20, left: 8, @@ -363,7 +371,7 @@ 'Accessibility.ReadAnything.' + 'TimeFromToolbarConstructorStartedToConnectedCallback'); if (this.isReadAloudEnabled_) { - this.textStyleOptions_.push( + this.textStyleOptions_.unshift( { id: 'font-size', icon: 'read-anything:font-size', @@ -384,8 +392,6 @@ this.windowResizeCallback_ = this.onWindowResize_.bind(this); window.addEventListener('resize', this.windowResizeCallback_); } - this.textStyleOptions_ = - this.textStyleOptions_.concat(this.moreOptionsButtons_); // TODO(b/329677511): Font names should be displayed as // "Font name (loading)" until the fonts have been loaded. @@ -426,6 +432,18 @@ this.areFontsLoaded_ = true; } + private onResetToolbar_() { + this.$.moreOptionsMenu.getIfExists()?.close(); + this.moreOptionsButtons_ = []; + } + + private onToolbarOverflow_(event: CustomEvent<{numOverflowButtons: number}>) { + const firstHiddenButton = + this.textStyleOptions_.length - event.detail.numOverflowButtons; + this.moreOptionsButtons_ = this.textStyleOptions_.slice(firstHiddenButton); + console.error('more options length', this.moreOptionsButtons_.length); + } + private onWindowResize_() { ReadAnythingToolbarElement.maybeUpdateMoreOptions(this.$.toolbarContainer); } @@ -607,7 +625,13 @@ } private onMoreOptionsClick_(event: MouseEvent) { - this.openMenu_(this.$.moreOptionsMenu, event.target as HTMLElement); + const menu = this.$.moreOptionsMenu.get(); + // The min width of the dialog can't be lowered so center the buttons if + // there are only 3 in the more options menu. There's an extra wrapper child + // in the menu so we check for 4 children, which indicates 3 buttons. + (menu.firstChild as HTMLElement).style.marginLeft = + (menu.children.length === 4) ? '16px' : '6px'; + this.openMenu_(menu, event.target as HTMLElement); } private openMenu_( @@ -917,9 +941,9 @@ const elementToFocus = focusableElements[newIndex]; assert(elementToFocus, 'no element to focus'); if (elementToFocus.className !== moreOptionsClass.slice(1)) { - this.$.moreOptionsMenu.close(); - } else if (!this.$.moreOptionsMenu.open) { - this.openMenu_(this.$.moreOptionsMenu, this.$.more); + this.$.moreOptionsMenu.getIfExists()?.close(); + } else if (!this.$.moreOptionsMenu.getIfExists()?.open) { + this.openMenu_(this.$.moreOptionsMenu.get(), this.$.more); } // When the user tabs away from the toolbar and then tabs back, we want to
diff --git a/chrome/browser/resources/signin/profile_picker/profile_card.html b/chrome/browser/resources/signin/profile_picker/profile_card.html index 3a9c318a..c056758b 100644 --- a/chrome/browser/resources/signin/profile_picker/profile_card.html +++ b/chrome/browser/resources/signin/profile_picker/profile_card.html
@@ -101,7 +101,7 @@ width: 130px; } - paper-tooltip { + cr-tooltip { --paper-tooltip-delay-in: 200ms; --paper-tooltip-duration-in: 200ms; --paper-tooltip-duration-out: 200ms; @@ -160,11 +160,11 @@ </div> <profile-card-menu profile-state="[[profileState]]"></profile-card-menu> </div> -<paper-tooltip id="gaiaNameTooltip" for="gaiaName" manual-mode offset="0" +<cr-tooltip id="gaiaNameTooltip" for="gaiaName" manual-mode offset="0" position="bottom" aria-hidden="true"> [[profileState.gaiaName]] -</paper-tooltip> -<paper-tooltip id="tooltip" for="nameInput" manual-mode offset="-10" +</cr-tooltip> +<cr-tooltip id="tooltip" for="nameInput" manual-mode offset="-10" aria-hidden="true"> [[profileState.localProfileName]] -</paper-tooltip> +</cr-tooltip>
diff --git a/chrome/browser/resources/signin/profile_picker/profile_card.ts b/chrome/browser/resources/signin/profile_picker/profile_card.ts index d1bc5647..6f7de5d 100644 --- a/chrome/browser/resources/signin/profile_picker/profile_card.ts +++ b/chrome/browser/resources/signin/profile_picker/profile_card.ts
@@ -9,11 +9,12 @@ import './profile_card_menu.js'; import './profile_picker_shared.css.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; -import 'chrome://resources/polymer/v3_0/paper-tooltip/paper-tooltip.js'; +import 'chrome://resources/cr_elements/cr_tooltip/cr_tooltip.js'; +import {assert} from 'chrome://resources/js/assert.js'; import type {CrInputElement} from 'chrome://resources/cr_elements/cr_input/cr_input.js'; +import type {CrTooltipElement} from 'chrome://resources/cr_elements/cr_tooltip/cr_tooltip.js'; import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js'; -import type {PaperTooltipElement} from 'chrome://resources/polymer/v3_0/paper-tooltip/paper-tooltip.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import type {ManageProfilesBrowserProxy, ProfileState} from './manage_profiles_browser_proxy.js'; @@ -23,9 +24,9 @@ export interface ProfileCardElement { $: { gaiaName: HTMLElement, - gaiaNameTooltip: PaperTooltipElement, + gaiaNameTooltip: CrTooltipElement, nameInput: CrInputElement, - tooltip: PaperTooltipElement, + tooltip: CrTooltipElement, }; } @@ -66,7 +67,9 @@ private addNameInputTooltipListeners_() { const showTooltip = () => { - const inputElement = this.$.tooltip.target.inputElement; + const target = this.$.tooltip.target; + assert(target); + const inputElement = (target as CrInputElement).inputElement; // Disable tooltip if the local name editing is in progress. if (this.isNameTruncated_(inputElement) && !this.$.nameInput.hasAttribute('focused_')) { @@ -77,6 +80,7 @@ }; const hideTooltip = () => this.$.tooltip.hide(); const target = this.$.tooltip.target; + assert(target); target.addEventListener('mouseenter', showTooltip); target.addEventListener('focus', hideTooltip); target.addEventListener('mouseleave', hideTooltip); @@ -94,6 +98,7 @@ }; const hideTooltip = () => this.$.gaiaNameTooltip.hide(); const target = this.$.gaiaNameTooltip.target; + assert(target); target.addEventListener('mouseenter', showTooltip); target.addEventListener('focus', showTooltip); target.addEventListener('mouseleave', hideTooltip);
diff --git a/chrome/browser/safe_browsing/ohttp_key_service_browsertest.cc b/chrome/browser/safe_browsing/ohttp_key_service_browsertest.cc new file mode 100644 index 0000000..c1f27818 --- /dev/null +++ b/chrome/browser/safe_browsing/ohttp_key_service_browsertest.cc
@@ -0,0 +1,67 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service.h" + +#include "base/test/mock_callback.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/safe_browsing/ohttp_key_service_factory.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "components/prefs/pref_service.h" +#include "components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h" +#include "components/variations/pref_names.h" +#include "content/public/test/browser_test.h" + +namespace safe_browsing { + +namespace { +const char kTestOhttpKey[] = "TestOhttpKey"; +} // namespace + +class SafeBrowsingOhttpKeyServiceTest : public InProcessBrowserTest { + public: + SafeBrowsingOhttpKeyServiceTest() = default; + SafeBrowsingOhttpKeyServiceTest(const SafeBrowsingOhttpKeyServiceTest&) = + delete; + SafeBrowsingOhttpKeyServiceTest& operator=( + const SafeBrowsingOhttpKeyServiceTest&) = delete; + + private: + OhttpKeyServiceAllowerForTesting allow_ohttp_key_service_; + hash_realtime_utils::GoogleChromeBrandingPretenderForTesting apply_branding_; +}; + +IN_PROC_BROWSER_TEST_F(SafeBrowsingOhttpKeyServiceTest, + ServiceRespectsLocationChanges) { + auto* ohttp_key_service = + OhttpKeyServiceFactory::GetForProfile(browser()->profile()); + ohttp_key_service->set_ohttp_key_for_testing( + {kTestOhttpKey, base::Time::Now() + base::Days(10)}); + + // By default, the service should be enabled. + base::MockCallback<OhttpKeyService::Callback> success_callback; + EXPECT_CALL(success_callback, + Run(testing::Optional(std::string(kTestOhttpKey)))) + .Times(1); + ohttp_key_service->GetOhttpKey(success_callback.Get()); + + // Changing to CN should disable the service. + g_browser_process->local_state()->SetString( + variations::prefs::kVariationsCountry, "cn"); + base::MockCallback<OhttpKeyService::Callback> empty_callback; + EXPECT_CALL(empty_callback, Run(testing::Eq(std::nullopt))).Times(1); + ohttp_key_service->GetOhttpKey(empty_callback.Get()); + + // Changing to US should re-enable the service. + g_browser_process->local_state()->SetString( + variations::prefs::kVariationsCountry, "us"); + base::MockCallback<OhttpKeyService::Callback> success_callback2; + EXPECT_CALL(success_callback2, + Run(testing::Optional(std::string(kTestOhttpKey)))) + .Times(1); + ohttp_key_service->GetOhttpKey(success_callback2.Get()); +} + +} // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/ohttp_key_service_factory.cc b/chrome/browser/safe_browsing/ohttp_key_service_factory.cc index 48a29341..a7613000 100644 --- a/chrome/browser/safe_browsing/ohttp_key_service_factory.cc +++ b/chrome/browser/safe_browsing/ohttp_key_service_factory.cc
@@ -57,8 +57,8 @@ profile)); return std::make_unique<OhttpKeyService>( network::SharedURLLoaderFactory::Create(std::move(url_loader_factory)), - profile->GetPrefs(), - base::BindRepeating(&OhttpKeyServiceFactory::GetStoredPermanentCountry)); + profile->GetPrefs(), g_browser_process->local_state(), + base::BindRepeating(&OhttpKeyServiceFactory::GetCountry)); #endif } @@ -79,7 +79,7 @@ } // static -std::optional<std::string> OhttpKeyServiceFactory::GetStoredPermanentCountry() { +std::optional<std::string> OhttpKeyServiceFactory::GetCountry() { return safe_browsing::hash_realtime_utils::GetCountryCode( g_browser_process->variations_service()); }
diff --git a/chrome/browser/safe_browsing/ohttp_key_service_factory.h b/chrome/browser/safe_browsing/ohttp_key_service_factory.h index 05114b2..af7b0c8 100644 --- a/chrome/browser/safe_browsing/ohttp_key_service_factory.h +++ b/chrome/browser/safe_browsing/ohttp_key_service_factory.h
@@ -46,7 +46,7 @@ bool ServiceIsCreatedWithBrowserContext() const override; bool ServiceIsNULLWhileTesting() const override; - static std::optional<std::string> GetStoredPermanentCountry(); + static std::optional<std::string> GetCountry(); }; // Used only for tests. By default, the OHTTP key service is null for tests,
diff --git a/chrome/browser/safety_hub/android/BUILD.gn b/chrome/browser/safety_hub/android/BUILD.gn index 7516d67c..da9ae72 100644 --- a/chrome/browser/safety_hub/android/BUILD.gn +++ b/chrome/browser/safety_hub/android/BUILD.gn
@@ -9,6 +9,7 @@ "java/src/org/chromium/chrome/browser/safety_hub/SafetyHubFetchService.java", "java/src/org/chromium/chrome/browser/safety_hub/SafetyHubFragment.java", "java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegate.java", + "java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegateImpl.java", "java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleProperties.java", "java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleViewBinder.java", ] @@ -43,6 +44,7 @@ resources_package = "org.chromium.chrome.browser.safety_hub" sources = [ "junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubFetchServiceTest.java", + "junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegateTest.java", "junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleViewBinderTest.java", ] deps = [
diff --git a/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubFragment.java b/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubFragment.java index ab66554..3d8a446 100644 --- a/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubFragment.java +++ b/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubFragment.java
@@ -8,21 +8,17 @@ import androidx.preference.Preference; -import org.chromium.chrome.browser.password_manager.PasswordManagerHelper; import org.chromium.chrome.browser.preferences.Pref; -import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.settings.ChromeBaseSettingsFragment; -import org.chromium.chrome.browser.sync.SyncServiceFactory; import org.chromium.components.browser_ui.settings.SettingsUtils; -import org.chromium.components.sync.SyncService; import org.chromium.components.user_prefs.UserPrefs; import org.chromium.ui.modelutil.PropertyModel; import org.chromium.ui.modelutil.PropertyModelChangeProcessor; /** Fragment containing Safety hub. */ -public class SafetyHubFragment extends ChromeBaseSettingsFragment - implements SafetyHubModuleDelegate { +public class SafetyHubFragment extends ChromeBaseSettingsFragment { private static final String PREF_PASSWORDS = "passwords_account"; + private SafetyHubModuleDelegate mDelegate; @Override public void onCreatePreferences(Bundle bundle, String s) { @@ -39,10 +35,13 @@ .with(SafetyHubModuleProperties.ICON, R.drawable.ic_vpn_key_grey) .with( SafetyHubModuleProperties.IS_VISIBLE, - shouldShowPasswordCheckModule(getProfile())) + mDelegate.shouldShowPasswordCheckModule()) .with( SafetyHubModuleProperties.COMPROMISED_PASSWORDS_COUNT, compromisedPasswordsCount) + .with( + SafetyHubModuleProperties.ON_CLICK_LISTENER, + () -> mDelegate.showPasswordCheckUI(getContext())) .build(); PropertyModelChangeProcessor.create( @@ -51,11 +50,7 @@ SafetyHubModuleViewBinder::bindPasswordCheckProperties); } - @Override - public boolean shouldShowPasswordCheckModule(Profile profile) { - SyncService syncService = SyncServiceFactory.getForProfile(profile); - PasswordManagerHelper passwordManagerHelper = PasswordManagerHelper.getForProfile(profile); - return PasswordManagerHelper.hasChosenToSyncPasswords(syncService) - && passwordManagerHelper.canUseUpm(); + public void setDelegate(SafetyHubModuleDelegate safetyHubModuleDelegate) { + mDelegate = safetyHubModuleDelegate; } }
diff --git a/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegate.java b/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegate.java index 6520698..49c50c42 100644 --- a/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegate.java +++ b/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegate.java
@@ -4,10 +4,21 @@ package org.chromium.chrome.browser.safety_hub; -import org.chromium.chrome.browser.profiles.Profile; +import android.content.Context; /** A delegate for Safety Hub to handle UI related behaviour. */ public interface SafetyHubModuleDelegate { - boolean shouldShowPasswordCheckModule(Profile profile); + /** + * @return A boolean indicating whether to show the account-level password check module in + * Safety Hub based on the Sync and UPM status. + */ + boolean shouldShowPasswordCheckModule(); + + /** + * Launches the Password Checkup UI from GMSCore. + * + * @param context used to show the dialog. + */ + void showPasswordCheckUI(Context context); }
diff --git a/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegateImpl.java b/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegateImpl.java new file mode 100644 index 0000000..701064a --- /dev/null +++ b/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegateImpl.java
@@ -0,0 +1,57 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.safety_hub; + +import android.content.Context; + +import androidx.annotation.NonNull; + +import org.chromium.base.supplier.Supplier; +import org.chromium.chrome.browser.password_manager.PasswordCheckReferrer; +import org.chromium.chrome.browser.password_manager.PasswordManagerHelper; +import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.sync.SyncServiceFactory; +import org.chromium.components.signin.base.CoreAccountInfo; +import org.chromium.components.sync.SyncService; +import org.chromium.ui.modaldialog.ModalDialogManager; + +/** An implementation of {@link SafetyHubModuleDelegate} */ +public class SafetyHubModuleDelegateImpl implements SafetyHubModuleDelegate { + private final @NonNull Profile mProfile; + private final @NonNull Supplier<ModalDialogManager> mModalDialogManagerSupplier; + + /** + * @param profile A supplier for {@link Profile} that owns the data being deleted. + * @param modalDialogManagerSupplier A supplier for {@link ModalDialogManager} that will be used + * to launch the password check UI. + */ + public SafetyHubModuleDelegateImpl( + @NonNull Profile profile, + @NonNull Supplier<ModalDialogManager> modalDialogManagerSupplier) { + mProfile = profile; + mModalDialogManagerSupplier = modalDialogManagerSupplier; + } + + @Override + public boolean shouldShowPasswordCheckModule() { + SyncService syncService = SyncServiceFactory.getForProfile(mProfile); + PasswordManagerHelper passwordManagerHelper = PasswordManagerHelper.getForProfile(mProfile); + return PasswordManagerHelper.hasChosenToSyncPasswords(syncService) + && passwordManagerHelper.canUseUpm(); + } + + @Override + public void showPasswordCheckUI(Context context) { + SyncService syncService = SyncServiceFactory.getForProfile(mProfile); + PasswordManagerHelper passwordManagerHelper = PasswordManagerHelper.getForProfile(mProfile); + + assert PasswordManagerHelper.hasChosenToSyncPasswords(syncService) + : "The password module should be hidden if the user is not syncing."; + String account = CoreAccountInfo.getEmailFrom(syncService.getAccountInfo()); + + passwordManagerHelper.showPasswordCheckup( + context, PasswordCheckReferrer.SAFETY_CHECK, mModalDialogManagerSupplier, account); + } +}
diff --git a/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleProperties.java b/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleProperties.java index c9993422..5d8b93d1 100644 --- a/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleProperties.java +++ b/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleProperties.java
@@ -15,10 +15,14 @@ public static final PropertyModel.WritableBooleanPropertyKey IS_VISIBLE = new PropertyModel.WritableBooleanPropertyKey(); + public static final PropertyModel.WritableObjectPropertyKey<Runnable> ON_CLICK_LISTENER = + new PropertyModel.WritableObjectPropertyKey<>(); public static final PropertyModel.WritableIntPropertyKey COMPROMISED_PASSWORDS_COUNT = new PropertyModel.WritableIntPropertyKey(); - public static final PropertyKey[] COMMON_SAFETY_HUB_MODULE_KEYS = {ICON, IS_VISIBLE}; + public static final PropertyKey[] COMMON_SAFETY_HUB_MODULE_KEYS = { + ICON, IS_VISIBLE, ON_CLICK_LISTENER + }; public static final PropertyKey[] PASSWORD_CHECK_SAFETY_HUB_MODULE_KEYS = PropertyModel.concatKeys(
diff --git a/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleViewBinder.java b/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleViewBinder.java index f2bdadc..2915417 100644 --- a/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleViewBinder.java +++ b/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleViewBinder.java
@@ -6,6 +6,7 @@ import android.graphics.drawable.Drawable; +import androidx.annotation.NonNull; import androidx.preference.Preference; import org.chromium.components.browser_ui.settings.SettingsUtils; @@ -17,6 +18,17 @@ PropertyModel model, Preference preference, PropertyKey propertyKey) { if (SafetyHubModuleProperties.IS_VISIBLE == propertyKey) { preference.setVisible(model.get(SafetyHubModuleProperties.IS_VISIBLE)); + } else if (SafetyHubModuleProperties.ON_CLICK_LISTENER == propertyKey) { + Runnable onClickListener = model.get(SafetyHubModuleProperties.ON_CLICK_LISTENER); + assert onClickListener != null; + preference.setOnPreferenceClickListener( + new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(@NonNull Preference preference) { + onClickListener.run(); + return true; + } + }); } }
diff --git a/chrome/browser/safety_hub/android/junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegateTest.java b/chrome/browser/safety_hub/android/junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegateTest.java new file mode 100644 index 0000000..17b0c72 --- /dev/null +++ b/chrome/browser/safety_hub/android/junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegateTest.java
@@ -0,0 +1,163 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.safety_hub; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import android.app.PendingIntent; +import android.content.Context; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +import org.chromium.base.CollectionUtil; +import org.chromium.base.ContextUtils; +import org.chromium.base.supplier.Supplier; +import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.base.test.util.Batch; +import org.chromium.base.test.util.JniMocker; +import org.chromium.chrome.browser.password_manager.FakePasswordCheckupClientHelper; +import org.chromium.chrome.browser.password_manager.FakePasswordCheckupClientHelperFactoryImpl; +import org.chromium.chrome.browser.password_manager.FakePasswordManagerBackendSupportHelper; +import org.chromium.chrome.browser.password_manager.PasswordCheckupClientHelperFactory; +import org.chromium.chrome.browser.password_manager.PasswordManagerBackendSupportHelper; +import org.chromium.chrome.browser.password_manager.PasswordManagerUtilBridge; +import org.chromium.chrome.browser.password_manager.PasswordManagerUtilBridgeJni; +import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.profiles.ProfileManager; +import org.chromium.chrome.browser.sync.SyncServiceFactory; +import org.chromium.components.prefs.PrefService; +import org.chromium.components.signin.base.CoreAccountInfo; +import org.chromium.components.sync.SyncService; +import org.chromium.components.sync.UserSelectableType; +import org.chromium.components.user_prefs.UserPrefs; +import org.chromium.components.user_prefs.UserPrefsJni; +import org.chromium.ui.modaldialog.ModalDialogManager; + +import java.util.HashSet; + +/** Tests {@link SafetyHubModuleDelegate} */ +@RunWith(BaseRobolectricTestRunner.class) +@Batch(Batch.PER_CLASS) +public class SafetyHubModuleDelegateTest { + private static final String TEST_EMAIL_ADDRESS = "test@email.com"; + + @Rule public MockitoRule mMockitoRule = MockitoJUnit.rule(); + + @Rule public JniMocker mJniMocker = new JniMocker(); + + @Mock private PendingIntent mPasswordCheckIntentForAccountCheckup; + @Mock private SyncService mSyncService; + @Mock private Profile mProfile; + @Mock private PrefService mPrefService; + @Mock private UserPrefs.Natives mUserPrefsNatives; + @Mock private PasswordManagerUtilBridge.Natives mPasswordManagerUtilBridgeNatives; + @Mock private Supplier<ModalDialogManager> mModalDialogManagerSupplier; + + private ModalDialogManager mModalDialogManager; + + private Context mContext; + + private SafetyHubModuleDelegate mSafetyHubModuleDelegate; + + @Before + public void setUp() { + mContext = ContextUtils.getApplicationContext(); + MockitoAnnotations.initMocks(this); + + mJniMocker.mock(UserPrefsJni.TEST_HOOKS, mUserPrefsNatives); + mJniMocker.mock(PasswordManagerUtilBridgeJni.TEST_HOOKS, mPasswordManagerUtilBridgeNatives); + + ProfileManager.setLastUsedProfileForTesting(mProfile); + when(mProfile.getOriginalProfile()).thenReturn(mProfile); + when(mUserPrefsNatives.get(mProfile)).thenReturn(mPrefService); + + SyncServiceFactory.setInstanceForTesting(mSyncService); + setUpPasswordManagerBackendForTesting(); + + mModalDialogManager = + new ModalDialogManager( + mock(ModalDialogManager.Presenter.class), + ModalDialogManager.ModalDialogType.APP); + when(mModalDialogManagerSupplier.get()).thenReturn(mModalDialogManager); + + mSafetyHubModuleDelegate = + new SafetyHubModuleDelegateImpl(mProfile, mModalDialogManagerSupplier); + } + + private void setPasswordSync(boolean isSyncing) { + when(mSyncService.isSyncFeatureEnabled()).thenReturn(isSyncing); + when(mSyncService.getSelectedTypes()) + .thenReturn( + isSyncing + ? CollectionUtil.newHashSet(UserSelectableType.PASSWORDS) + : new HashSet<>()); + when(mSyncService.getAccountInfo()) + .thenReturn(CoreAccountInfo.createFromEmailAndGaiaId(TEST_EMAIL_ADDRESS, "0")); + } + + private void setUPMStatus(boolean isUPMEnabled) { + when(mPasswordManagerUtilBridgeNatives.shouldUseUpmWiring(true, mPrefService)) + .thenReturn(isUPMEnabled); + } + + private void setUpPasswordManagerBackendForTesting() { + FakePasswordManagerBackendSupportHelper helper = + new FakePasswordManagerBackendSupportHelper(); + helper.setBackendPresent(true); + PasswordManagerBackendSupportHelper.setInstanceForTesting(helper); + + setUpFakePasswordCheckupClientHelper(); + } + + private void setUpFakePasswordCheckupClientHelper() { + FakePasswordCheckupClientHelperFactoryImpl passwordCheckupClientHelperFactory = + new FakePasswordCheckupClientHelperFactoryImpl(); + PasswordCheckupClientHelperFactory.setFactoryForTesting(passwordCheckupClientHelperFactory); + FakePasswordCheckupClientHelper fakePasswordCheckupClientHelper = + (FakePasswordCheckupClientHelper) passwordCheckupClientHelperFactory.createHelper(); + + fakePasswordCheckupClientHelper.setIntentForAccountCheckup( + mPasswordCheckIntentForAccountCheckup); + } + + @Test + public void testPasswordCheckModuleVisibility() { + setPasswordSync(false); + setUPMStatus(true); + + assertFalse(mSafetyHubModuleDelegate.shouldShowPasswordCheckModule()); + + setPasswordSync(true); + setUPMStatus(false); + + assertFalse(mSafetyHubModuleDelegate.shouldShowPasswordCheckModule()); + + setPasswordSync(true); + setUPMStatus(true); + + assertTrue(mSafetyHubModuleDelegate.shouldShowPasswordCheckModule()); + } + + @Test + public void testOpenPasswordCheckUI() throws PendingIntent.CanceledException { + setPasswordSync(true); + setUPMStatus(true); + + mSafetyHubModuleDelegate.showPasswordCheckUI(mContext); + verify(mPasswordCheckIntentForAccountCheckup, times(1)).send(); + } +}
diff --git a/chrome/browser/sessions/session_restore_browsertest.cc b/chrome/browser/sessions/session_restore_browsertest.cc index bbe57ab2..4d53ce3 100644 --- a/chrome/browser/sessions/session_restore_browsertest.cc +++ b/chrome/browser/sessions/session_restore_browsertest.cc
@@ -2063,7 +2063,7 @@ TabStripModel* tab_strip_model = browser()->tab_strip_model(); std::unique_ptr<content::WebContents> old_web_contents = - tab_strip_model->ReplaceWebContentsAt(tab_strip_model->active_index(), + tab_strip_model->DiscardWebContentsAt(tab_strip_model->active_index(), std::move(web_contents)); // Navigate with the new tab. ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), GetUrl2()));
diff --git a/chrome/browser/storage/shared_storage_browsertest.cc b/chrome/browser/storage/shared_storage_browsertest.cc index 652aeae..05a7b22b 100644 --- a/chrome/browser/storage/shared_storage_browsertest.cc +++ b/chrome/browser/storage/shared_storage_browsertest.cc
@@ -2337,7 +2337,7 @@ kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectBucketCount( - kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kRunNonWebVisibleOperationNotFound, @@ -2373,7 +2373,7 @@ kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectBucketCount( - kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kRunNonWebVisibleOther, 1); @@ -2408,7 +2408,7 @@ kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectBucketCount( - kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kRunNonWebVisibleOther, 1); @@ -2444,7 +2444,7 @@ kWorkletNumPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectBucketCount( - kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kRunNonWebVisibleOther, 1); @@ -2541,7 +2541,7 @@ kSelectUrlCallsPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectBucketCount( - kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType:: @@ -2601,7 +2601,7 @@ kSelectUrlCallsPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectBucketCount( - kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSelectURLNonWebVisibleOther, 1); @@ -2658,7 +2658,7 @@ kSelectUrlCallsPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectBucketCount( - kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSelectURLNonWebVisibleOther, 1); @@ -2716,7 +2716,7 @@ kSelectUrlCallsPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectBucketCount( - kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSelectURLNonWebVisibleOther, 1); @@ -2774,7 +2774,7 @@ kSelectUrlCallsPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectBucketCount( - kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType:: @@ -2834,7 +2834,7 @@ kSelectUrlCallsPerPageHistogram}); histogram_tester_.ExpectTotalCount(kTimingDocumentAddModuleHistogram, 1); histogram_tester_.ExpectBucketCount( - kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); histogram_tester_.ExpectBucketCount( kErrorTypeHistogram, blink::SharedStorageWorkletErrorType:: @@ -2865,14 +2865,26 @@ GetActiveWebContents() ->GetPrimaryMainFrame() ->GetStoragePartition())); + + WaitForHistograms({kErrorTypeHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, + blink::SharedStorageWorkletErrorType:: + kAddModuleNonWebVisibleCrossOriginSharedStorageDisabled, + 1); } IN_PROC_BROWSER_TEST_P(SharedStorageChromeBrowserTest, CrossOriginWorklet_SelectUrl_PrefsError) { Set3rdPartyCookieAndMainHostAttestationSettingsThenNavigateToMainHostPage(); - GURL script_url = https_server()->GetURL(kCrossOriginHost, - "/shared_storage/simple_module.js"); + GURL script_url = https_server()->GetURL( + kCrossOriginHost, + net::test_server::GetFilePathWithReplacements( + "/shared_storage/module_with_custom_header.js", + content::SharedStorageCrossOriginWorkletResponseHeaderReplacement( + "Access-Control-Allow-Origin: *", + "Shared-Storage-Cross-Origin-Worklet-Allowed: ?1"))); EXPECT_TRUE( content::ExecJs(GetActiveWebContents(), content::JsReplace(R"( @@ -2910,14 +2922,27 @@ run_loop.Run(); EXPECT_EQ(0u, console_observer.messages().size()); + WaitForHistograms({kErrorTypeHistogram}); + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, + blink::SharedStorageWorkletErrorType:: + kSelectURLNonWebVisibleCrossOriginSharedStorageDisabled, + 1); } IN_PROC_BROWSER_TEST_P(SharedStorageChromeBrowserTest, CrossOriginWorklet_Run_PrefsError) { Set3rdPartyCookieAndMainHostAttestationSettingsThenNavigateToMainHostPage(); - GURL script_url = https_server()->GetURL(kCrossOriginHost, - "/shared_storage/simple_module.js"); + GURL script_url = https_server()->GetURL( + kCrossOriginHost, + net::test_server::GetFilePathWithReplacements( + "/shared_storage/module_with_custom_header.js", + content::SharedStorageCrossOriginWorkletResponseHeaderReplacement( + "Access-Control-Allow-Origin: *", + "Shared-Storage-Cross-Origin-Worklet-Allowed: ?1"))); EXPECT_TRUE( content::ExecJs(GetActiveWebContents(), content::JsReplace(R"( @@ -2945,6 +2970,249 @@ run_loop.Run(); EXPECT_EQ(0u, console_observer.messages().size()); + WaitForHistograms({kErrorTypeHistogram}); + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, + blink::SharedStorageWorkletErrorType:: + kRunNonWebVisibleCrossOriginSharedStorageDisabled, + 1); +} + +IN_PROC_BROWSER_TEST_P( + SharedStorageChromeBrowserTest, + CrossOriginWorklet_CreateWorklet_NetworkError_MissingHeaders) { + Set3rdPartyCookieAndMainHostAttestationSettingsThenNavigateToMainHostPage(); + + // simple_module.js does not have the correct headers to be used to register + // cross-origin shared storage worklet. + GURL script_url = https_server()->GetURL(kCrossOriginHost, + "/shared_storage/simple_module.js"); + + // The network error for `createWorklet()` won't be revealed to the + // cross-origin caller. But we can verify the error indirectly, by running a + // subsequent operation and checking the console error. + EXPECT_TRUE( + content::ExecJs(GetActiveWebContents(), content::JsReplace(R"( + (async function() { + window.testWorklet = await sharedStorage.createWorklet($1); + })() + )", + script_url))); + + content::WebContentsConsoleObserver console_observer(GetActiveWebContents()); + console_observer.SetFilter(MakeFilter({"Cannot find operation name."})); + + EXPECT_TRUE(content::ExecJs(GetActiveWebContents(), R"( + window.testWorklet.run('test-operation') + )")); + + ASSERT_TRUE(console_observer.Wait()); + + EXPECT_EQ(1u, console_observer.messages().size()); + EXPECT_EQ("Cannot find operation name.", + base::UTF16ToUTF8(console_observer.messages()[0].message)); + + WaitForHistograms({kErrorTypeHistogram}); + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, + blink::SharedStorageWorkletErrorType::kAddModuleNonWebVisibleOther, 1); + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, + blink::SharedStorageWorkletErrorType::kRunNonWebVisibleOperationNotFound, + 1); +} + +IN_PROC_BROWSER_TEST_P(SharedStorageChromeBrowserTest, + CrossOriginWorklet_CreateWorklet_NetworkError_404) { + Set3rdPartyCookieAndMainHostAttestationSettingsThenNavigateToMainHostPage(); + + // nonexistent_module.js does not exist and should produce a 404 network + // error. + GURL script_url = https_server()->GetURL( + kCrossOriginHost, "/shared_storage/nonexistent_module.js"); + + // The network error for `createWorklet()` won't be revealed to the + // cross-origin caller. But we can verify the error indirectly, by running a + // subsequent operation and checking the console error. + EXPECT_TRUE( + content::ExecJs(GetActiveWebContents(), content::JsReplace(R"( + (async function() { + window.testWorklet = await sharedStorage.createWorklet($1); + })() + )", + script_url))); + + content::WebContentsConsoleObserver console_observer(GetActiveWebContents()); + console_observer.SetFilter(MakeFilter({"Cannot find operation name."})); + + EXPECT_TRUE(content::ExecJs(GetActiveWebContents(), R"( + window.testWorklet.run('test-operation') + )")); + + ASSERT_TRUE(console_observer.Wait()); + + EXPECT_EQ(1u, console_observer.messages().size()); + EXPECT_EQ("Cannot find operation name.", + base::UTF16ToUTF8(console_observer.messages()[0].message)); + + WaitForHistograms({kErrorTypeHistogram}); + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, + blink::SharedStorageWorkletErrorType::kAddModuleNonWebVisibleOther, 1); + histogram_tester_.ExpectBucketCount( + kErrorTypeHistogram, + blink::SharedStorageWorkletErrorType::kRunNonWebVisibleOperationNotFound, + 1); +} + +IN_PROC_BROWSER_TEST_P(SharedStorageChromeBrowserTest, + CrossOriginWorklet_CreateWorklet_Success) { + Set3rdPartyCookieAndMainHostAttestationSettingsThenNavigateToMainHostPage(); + + GURL script_url = https_server()->GetURL( + kCrossOriginHost, + net::test_server::GetFilePathWithReplacements( + "/shared_storage/module_with_custom_header.js", + content::SharedStorageCrossOriginWorkletResponseHeaderReplacement( + "Access-Control-Allow-Origin: *", + "Shared-Storage-Cross-Origin-Worklet-Allowed: ?1"))); + + content::WebContentsConsoleObserver console_observer(GetActiveWebContents()); + console_observer.SetFilter( + MakeFilter({"Finish executing module_with_custom_header.js"})); + + // The success for `createWorklet()` won't be revealed to the cross-origin + // caller definitively. But we can verify the success indirectly, by checking + // the console. + EXPECT_TRUE( + content::ExecJs(GetActiveWebContents(), content::JsReplace(R"( + (async function() { + window.testWorklet = await sharedStorage.createWorklet($1); + })() + )", + script_url))); + + ASSERT_TRUE(console_observer.Wait()); + EXPECT_EQ(1u, console_observer.messages().size()); + EXPECT_EQ("Finish executing module_with_custom_header.js", + base::UTF16ToUTF8(console_observer.messages()[0].message)); + + EXPECT_EQ(1u, content::GetAttachedSharedStorageWorkletHostsCount( + GetActiveWebContents() + ->GetPrimaryMainFrame() + ->GetStoragePartition())); + + WaitForHistograms({kErrorTypeHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 1); +} + +IN_PROC_BROWSER_TEST_P(SharedStorageChromeBrowserTest, + CrossOriginWorklet_SelectURL_Success) { + Set3rdPartyCookieAndMainHostAttestationSettingsThenNavigateToMainHostPage(); + + GURL script_url = https_server()->GetURL( + kCrossOriginHost, + net::test_server::GetFilePathWithReplacements( + "/shared_storage/module_with_custom_header.js", + content::SharedStorageCrossOriginWorkletResponseHeaderReplacement( + "Access-Control-Allow-Origin: *", + "Shared-Storage-Cross-Origin-Worklet-Allowed: ?1"))); + + EXPECT_TRUE( + content::ExecJs(GetActiveWebContents(), content::JsReplace(R"( + (async function() { + window.testWorklet = await sharedStorage.createWorklet($1); + })() + )", + script_url))); + + EXPECT_EQ(1u, content::GetAttachedSharedStorageWorkletHostsCount( + GetActiveWebContents() + ->GetPrimaryMainFrame() + ->GetStoragePartition())); + + content::WebContentsConsoleObserver console_observer(GetActiveWebContents()); + console_observer.SetFilter( + MakeFilter({"Finish executing 'test-url-selection-operation'"})); + + // The success for `selectURL()` won't be revealed to the cross-origin + // caller definitively. But we can verify the success indirectly, by checking + // the console. + EXPECT_TRUE(content::ExecJs(GetActiveWebContents(), R"( + window.testWorklet.selectURL( + 'test-url-selection-operation', + [ + { + url: "fenced_frames/title0.html" + } + ], + { + data: {'mockResult': 0} + } + ) + )")); + + ASSERT_TRUE(console_observer.Wait()); + EXPECT_EQ(1u, console_observer.messages().size()); + EXPECT_EQ("Finish executing 'test-url-selection-operation'", + base::UTF16ToUTF8(console_observer.messages()[0].message)); + + WaitForHistograms({kErrorTypeHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); +} + +IN_PROC_BROWSER_TEST_P(SharedStorageChromeBrowserTest, + CrossOriginWorklet_Run_Success) { + Set3rdPartyCookieAndMainHostAttestationSettingsThenNavigateToMainHostPage(); + + GURL script_url = https_server()->GetURL( + kCrossOriginHost, + net::test_server::GetFilePathWithReplacements( + "/shared_storage/module_with_custom_header.js", + content::SharedStorageCrossOriginWorkletResponseHeaderReplacement( + "Access-Control-Allow-Origin: *", + "Shared-Storage-Cross-Origin-Worklet-Allowed: ?1"))); + + EXPECT_TRUE( + content::ExecJs(GetActiveWebContents(), content::JsReplace(R"( + (async function() { + window.testWorklet = await sharedStorage.createWorklet($1); + })() + )", + script_url))); + + EXPECT_EQ(1u, content::GetAttachedSharedStorageWorkletHostsCount( + GetActiveWebContents() + ->GetPrimaryMainFrame() + ->GetStoragePartition())); + + content::WebContentsConsoleObserver console_observer(GetActiveWebContents()); + console_observer.SetFilter(MakeFilter({"Finish executing 'test-operation'"})); + + // The success for `run()` won't be revealed to the cross-origin caller + // definitively. But we can verify the success indirectly, by checking the + // console. + EXPECT_TRUE(content::ExecJs(GetActiveWebContents(), R"( + window.testWorklet.run( + 'test-operation', + { + data: {'customKey': 'customValue'} + } + ) + )")); + + ASSERT_TRUE(console_observer.Wait()); + EXPECT_EQ(1u, console_observer.messages().size()); + EXPECT_EQ("Finish executing 'test-operation'", + base::UTF16ToUTF8(console_observer.messages()[0].message)); + + WaitForHistograms({kErrorTypeHistogram}); + histogram_tester_.ExpectUniqueSample( + kErrorTypeHistogram, blink::SharedStorageWorkletErrorType::kSuccess, 2); } IN_PROC_BROWSER_TEST_P(SharedStorageChromeBrowserTest, DocumentTiming) {
diff --git a/chrome/browser/sync/test/integration/secondary_account_helper.cc b/chrome/browser/sync/test/integration/secondary_account_helper.cc index 030d9797..3ca021b5 100644 --- a/chrome/browser/sync/test/integration/secondary_account_helper.cc +++ b/chrome/browser/sync/test/integration/secondary_account_helper.cc
@@ -88,9 +88,7 @@ portal_detector->SetDefaultNetworkForTesting(default_network->guid()); - portal_detector->SetDetectionResultsForTesting( - default_network->guid(), - ash::NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204); + portal_detector->SetDetectionResultsForTesting(default_network->guid(), 204); // Takes ownership. ash::network_portal_detector::InitializeForTesting(portal_detector);
diff --git a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/Tab.java index 7047b33..9335745 100644 --- a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/Tab.java +++ b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/Tab.java
@@ -149,8 +149,8 @@ GURL getUrl(); /** - * @return Original url of the tab without any Chrome feature modifications applied - * (e.g. reader mode). + * @return Original url of the tab without any Chrome feature modifications applied (e.g. reader + * mode). */ GURL getOriginalUrl();
diff --git a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/WebContentsStateBridge.java b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/WebContentsStateBridge.java index 81e54b76..b127840 100644 --- a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/WebContentsStateBridge.java +++ b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/WebContentsStateBridge.java
@@ -64,6 +64,7 @@ /** * Creates a WebContentsState for a tab that will be loaded lazily. * + * @param title The title to display. * @param url URL that is pending. * @param referrerUrl URL for the referrer. * @param referrerPolicy Policy for the referrer. @@ -72,6 +73,7 @@ * @return ByteBuffer that represents a state representing a single pending URL. */ public static ByteBuffer createSingleNavigationStateAsByteBuffer( + String title, String url, String referrerUrl, int referrerPolicy, @@ -79,7 +81,7 @@ boolean isIncognito) { return WebContentsStateBridgeJni.get() .createSingleNavigationStateAsByteBuffer( - url, referrerUrl, referrerPolicy, initiatorOrigin, isIncognito); + title, url, referrerUrl, referrerPolicy, initiatorOrigin, isIncognito); } /** @@ -160,6 +162,7 @@ ByteBuffer deleteNavigationEntries(ByteBuffer state, int saveStateVersion, long predicate); ByteBuffer createSingleNavigationStateAsByteBuffer( + String title, String url, String referrerUrl, int referrerPolicy,
diff --git a/chrome/browser/tab/web_contents_state.cc b/chrome/browser/tab/web_contents_state.cc index 43ba07f4..474481d 100644 --- a/chrome/browser/tab/web_contents_state.cc +++ b/chrome/browser/tab/web_contents_state.cc
@@ -590,13 +590,14 @@ ScopedJavaLocalRef<jobject> WebContentsState::CreateSingleNavigationStateAsByteBuffer( JNIEnv* env, + jstring title, jstring url, jstring referrer_url, jint referrer_policy, const base::android::JavaParamRef<jobject>& jinitiator_origin, jboolean is_off_the_record) { std::unique_ptr<content::NavigationEntry> entry = - CreatePendingNavigationEntry(env, nullptr, url, referrer_url, + CreatePendingNavigationEntry(env, title, url, referrer_url, referrer_policy, jinitiator_origin, is_off_the_record); @@ -685,13 +686,14 @@ static ScopedJavaLocalRef<jobject> JNI_WebContentsStateBridge_CreateSingleNavigationStateAsByteBuffer( JNIEnv* env, + const JavaParamRef<jstring>& title, const JavaParamRef<jstring>& url, const JavaParamRef<jstring>& referrer_url, jint referrer_policy, const JavaParamRef<jobject>& initiator_origin, jboolean is_off_the_record) { return WebContentsState::CreateSingleNavigationStateAsByteBuffer( - env, url, referrer_url, referrer_policy, initiator_origin, + env, title, url, referrer_url, referrer_policy, initiator_origin, is_off_the_record); }
diff --git a/chrome/browser/tab/web_contents_state.h b/chrome/browser/tab/web_contents_state.h index db1ce308..7ff8f5a8 100644 --- a/chrome/browser/tab/web_contents_state.h +++ b/chrome/browser/tab/web_contents_state.h
@@ -111,6 +111,7 @@ static base::android::ScopedJavaLocalRef<jobject> CreateSingleNavigationStateAsByteBuffer( JNIEnv* env, + jstring title, jstring url, jstring referrer_url, jint referrer_policy,
diff --git a/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilter.java b/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilter.java index cb92c8c..7cabd9c 100644 --- a/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilter.java +++ b/chrome/browser/tab_group/java/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilter.java
@@ -1404,6 +1404,39 @@ TabGroupSyncIdUtils.putTabGroupSyncId(rootId, syncId); } + /** + * Given a tab group's stable ID, finds out the root ID, or {@link Tab.INVALID_TAB_ID} if the + * tab group doesn't exist in the model. + * + * @param stableId The stable ID of the tab group. + * @return The root ID of the tab group or {@link Tab.INVALID_TAB_ID} if the group isn't found + * in the tab model. + */ + public int getRootIdFromStableId(@NonNull Token stableId) { + for (int i = 0; i < getTabModel().getCount(); i++) { + Tab tab = getTabModel().getTabAt(i); + if (stableId.equals(tab.getTabGroupId())) return tab.getRootId(); + } + return Tab.INVALID_TAB_ID; + } + + /** + * Given a tab group's root ID, finds out the stable ID, or null if the tab group doesn't exist + * in the model. + * + * @param rootId The root ID of the tab group. + * @return The stable ID of the tab group or null if the group isn't found in the tab model. + */ + public @Nullable Token getStableIdFromRootId(int rootId) { + TabGroup tabGroup = mRootIdToGroupMap.get(rootId); + if (tabGroup == null) return null; + + Tab tab = TabModelUtils.getTabById(getTabModel(), tabGroup.getLastShownTabId()); + if (tab == null) return null; + + return tab.getTabGroupId(); + } + private static Token getOrCreateTabGroupId(@NonNull Tab tab) { return getOrCreateTabGroupIdWithDefault(tab, null); }
diff --git a/chrome/browser/tab_group/junit/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilterUnitTest.java b/chrome/browser/tab_group/junit/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilterUnitTest.java index a945bd4..bdac944f 100644 --- a/chrome/browser/tab_group/junit/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilterUnitTest.java +++ b/chrome/browser/tab_group/junit/src/org/chromium/chrome/browser/tasks/tab_groups/TabGroupModelFilterUnitTest.java
@@ -504,6 +504,21 @@ } @Test + public void rootIdToStableIdAndBackConversion() { + // Test existing IDs. + assertEquals(TAB2_ROOT_ID, mTabGroupModelFilter.getRootIdFromStableId(TAB2_TAB_GROUP_ID)); + assertEquals(TAB2_TAB_GROUP_ID, mTabGroupModelFilter.getStableIdFromRootId(TAB2_ROOT_ID)); + + assertEquals(null, mTabGroupModelFilter.getStableIdFromRootId(TAB1_ROOT_ID)); + + // Test non-existing IDs. + assertEquals( + Tab.INVALID_TAB_ID, + mTabGroupModelFilter.getRootIdFromStableId(new Token(93L, 42L))); + assertEquals(null, mTabGroupModelFilter.getStableIdFromRootId(1000)); + } + + @Test public void addTab_TabLaunchedFromTabGroupUi() { Tab newTab = prepareTab(NEW_TAB_ID_0, NEW_TAB_ID_0, null, TAB1_ID); doReturn(TabLaunchType.FROM_TAB_GROUP_UI).when(newTab).getLaunchType();
diff --git a/chrome/browser/tab_group_sync/BUILD.gn b/chrome/browser/tab_group_sync/BUILD.gn index e93aaef..9c15787 100644 --- a/chrome/browser/tab_group_sync/BUILD.gn +++ b/chrome/browser/tab_group_sync/BUILD.gn
@@ -37,12 +37,14 @@ "android/java/src/org/chromium/chrome/browser/tab_group_sync/RemoteTabGroupMutationHelper.java", "android/java/src/org/chromium/chrome/browser/tab_group_sync/StartupHelper.java", "android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncController.java", + "android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncFeatures.java", "android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncLocalObserver.java", "android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncRemoteObserver.java", ] deps = [ "//base:base_java", + "//chrome/browser/flags:java", "//chrome/browser/tab:java", "//chrome/browser/tab_group:java", "//chrome/browser/tabmodel:java",
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/LocalTabGroupMutationHelper.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/LocalTabGroupMutationHelper.java index fae57d25..f1eb65b 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/LocalTabGroupMutationHelper.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/LocalTabGroupMutationHelper.java
@@ -27,7 +27,7 @@ * Helper class to create, modify, overwrite local tab groups in response to sync updates and * startup. */ -public final class LocalTabGroupMutationHelper { +public class LocalTabGroupMutationHelper { private final TabGroupModelFilter mTabGroupModelFilter; private final TabGroupSyncService mTabGroupSyncService; private final TabCreationDelegate mTabCreationDelegate; @@ -69,35 +69,37 @@ // Create a new tab group and add the tabs just created. Group ID is the ID of the first new // tab. - int groupId = tabs.get(0).getId(); - updateTabGroupVisuals(tabGroup, groupId); + int rootId = tabs.get(0).getId(); + updateTabGroupVisuals(tabGroup, rootId); mTabGroupModelFilter.mergeListOfTabsToGroup( tabs, tabs.get(0), /* isSameGroup= */ true, /* notify= */ false); // Notify sync backend about IDs of the newly created group and tabs. - mTabGroupSyncService.updateLocalTabGroupMapping( - tabGroup.syncId, new LocalTabGroupId(groupId)); + LocalTabGroupId localTabGroupId = + new LocalTabGroupId(mTabGroupModelFilter.getStableIdFromRootId(rootId)); + mTabGroupSyncService.updateLocalTabGroupMapping(tabGroup.syncId, localTabGroupId); for (String syncTabId : tabIdMappings.keySet()) { mTabGroupSyncService.updateLocalTabId( - new LocalTabGroupId(groupId), syncTabId, tabIdMappings.get(syncTabId)); + localTabGroupId, syncTabId, tabIdMappings.get(syncTabId)); } - - // Update shared prefs about tab group mapping. - mTabGroupModelFilter.setTabGroupSyncId(groupId, tabGroup.syncId); } /** * Called in response to a tab group being updated from sync that is already mapped in memory. - * It will try to match the local tabs to the sync ones based on their IDs. Removes any tabs - * that don't have mapping in sync already. Updates the URLs and positions of the tabs to match - * sync. Creates new tabs for new incoming sync tabs. + * Also invoked on startup to force update local state to sync. It will try to match the local + * tabs to the sync ones based on their IDs. Removes any tabs that don't have mapping in sync + * already. Updates the URLs and positions of the tabs to match sync. Creates new tabs for new + * incoming sync tabs. */ public void updateTabGroup(SavedTabGroup tabGroup) { + assert tabGroup.localId != null; + // We got the updated tab group from sync. We need to update the local one to match. // First close any extra tabs that aren't in sync. closeLocalTabsNotInSync(tabGroup); - List<Tab> tabs = mTabGroupModelFilter.getRelatedTabListForRootId(tabGroup.localId.rootId); + int rootId = mTabGroupModelFilter.getRootIdFromStableId(tabGroup.localId.tabGroupId); + List<Tab> tabs = mTabGroupModelFilter.getRelatedTabListForRootId(rootId); if (tabs.isEmpty()) { return; } @@ -120,8 +122,7 @@ savedTab.url, parent, desiredTabIndex); mTabGroupModelFilter.mergeTabsToGroup( - /* sourceTabId= */ localTab.getId(), - /* destinationTabId= */ tabGroup.localId.rootId); + /* sourceTabId= */ localTab.getId(), /* destinationTabId= */ rootId); mTabGroupSyncService.updateLocalTabId( tabGroup.localId, savedTab.syncId, localTab.getId()); } @@ -130,7 +131,7 @@ getTabModel().moveTab(localTab.getId(), desiredTabIndex); } - updateTabGroupVisuals(tabGroup, tabGroup.localId.rootId); + updateTabGroupVisuals(tabGroup, rootId); } private void closeLocalTabsNotInSync(SavedTabGroup savedTabGroup) { @@ -139,6 +140,8 @@ } private List<Tab> findLocalTabsNotInSync(SavedTabGroup savedTabGroup) { + assert savedTabGroup.localId != null; + Set<Integer> savedTabIds = new HashSet<>(); for (SavedTabGroupTab savedTab : savedTabGroup.savedTabs) { if (savedTab.localId == null) continue; @@ -146,8 +149,8 @@ } List<Tab> tabsNotInSync = new ArrayList<>(); - for (Tab localTab : - mTabGroupModelFilter.getRelatedTabListForRootId(savedTabGroup.localId.rootId)) { + int rootId = mTabGroupModelFilter.getRootIdFromStableId(savedTabGroup.localId.tabGroupId); + for (Tab localTab : mTabGroupModelFilter.getRelatedTabListForRootId(rootId)) { if (!savedTabIds.contains(localTab.getId())) { tabsNotInSync.add(localTab); }
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/NavigationObserver.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/NavigationObserver.java index c4c42843..b185ae2 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/NavigationObserver.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/NavigationObserver.java
@@ -68,9 +68,8 @@ // Propagate the update to sync. We set the position argument as -1 so that it can be // ignored in native. - int rootId = tab.getRootId(); mTabGroupSyncService.updateTab( - new LocalTabGroupId(rootId), + new LocalTabGroupId(tab.getTabGroupId()), tab.getId(), tab.getTitle(), tab.getUrl(),
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/NavigationObserverUnitTest.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/NavigationObserverUnitTest.java index d7898a8..376be6f 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/NavigationObserverUnitTest.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/NavigationObserverUnitTest.java
@@ -37,6 +37,11 @@ @RunWith(BaseRobolectricTestRunner.class) @Config(manifest = Config.NONE) public class NavigationObserverUnitTest { + private static final int TAB_ID_1 = 5; + private static final int TAB_ID_2 = 6; + private static final Token TOKEN_1 = new Token(2, 3); + private static final Token TOKEN_2 = new Token(4, 5); + @Rule public MockitoRule mMockitoRule = MockitoJUnit.rule(); @Mock private Tab mTab; @Mock private TabGroupSyncService mTabGroupSyncService; @@ -59,13 +64,17 @@ } private void mockTab( - int tabId, int rootId, String title, GURL url, boolean isIncognito, boolean isGrouped) { + int tabId, + Token tabGroupId, + String title, + GURL url, + boolean isIncognito, + boolean isGrouped) { when(mTab.isIncognito()).thenReturn(isIncognito); when(mTab.getId()).thenReturn(tabId); - when((mTab.getRootId())).thenReturn(rootId); + when((mTab.getTabGroupId())).thenReturn(tabGroupId); when(mTab.getTitle()).thenReturn(title); when(mTab.getUrl()).thenReturn(url); - when(mTab.getTabGroupId()).thenReturn(isGrouped ? new Token(2, 3) : null); } private void simulateNavigation(GURL gurl, int transition) { @@ -85,34 +94,44 @@ public void testNavigationObserverBasic() { mNavigationObserver.enableObservers(true); mockTab( - /* tabId= */ 5, - /* rootId= */ 2, + TAB_ID_1, + TOKEN_1, mTestTitle, mTestUrl, /* isIncognito= */ false, /* isGrouped= */ true); simulateNavigation(mTestUrl, PageTransition.LINK); verify(mTabGroupSyncService) - .updateTab(eq(new LocalTabGroupId(2)), eq(5), eq(mTestTitle), eq(mTestUrl), eq(-1)); + .updateTab( + eq(new LocalTabGroupId(TOKEN_1)), + eq(TAB_ID_1), + eq(mTestTitle), + eq(mTestUrl), + eq(-1)); } @Test public void testMultipleNavigations() { mNavigationObserver.enableObservers(true); mockTab( - /* tabId= */ 5, - /* rootId= */ 2, + TAB_ID_1, + TOKEN_1, mTestTitle, mTestUrl, /* isIncognito= */ false, /* isGrouped= */ true); simulateNavigation(mTestUrl, PageTransition.LINK); verify(mTabGroupSyncService) - .updateTab(eq(new LocalTabGroupId(2)), eq(5), eq(mTestTitle), eq(mTestUrl), eq(-1)); + .updateTab( + eq(new LocalTabGroupId(TOKEN_1)), + eq(TAB_ID_1), + eq(mTestTitle), + eq(mTestUrl), + eq(-1)); mockTab( - /* tabId= */ 6, - /* rootId= */ 3, + TAB_ID_2, + TOKEN_2, mTestTitle, mTestUrl2, /* isIncognito= */ false, @@ -120,15 +139,19 @@ simulateNavigation(mTestUrl, PageTransition.LINK); verify(mTabGroupSyncService) .updateTab( - eq(new LocalTabGroupId(3)), eq(6), eq(mTestTitle), eq(mTestUrl2), eq(-1)); + eq(new LocalTabGroupId(TOKEN_2)), + eq(TAB_ID_2), + eq(mTestTitle), + eq(mTestUrl2), + eq(-1)); } @Test public void testDisableObserver() { mNavigationObserver.enableObservers(false); mockTab( - /* tabId= */ 5, - /* rootId= */ 2, + TAB_ID_1, + TOKEN_1, mTestTitle, mTestUrl, /* isIncognito= */ false, @@ -141,8 +164,8 @@ public void testIncognito() { mNavigationObserver.enableObservers(true); mockTab( - /* tabId= */ 5, - /* rootId= */ 2, + TAB_ID_1, + TOKEN_1, mTestTitle, mTestUrl, /* isIncognito= */ true, @@ -155,8 +178,8 @@ public void testRedirect() { mNavigationObserver.enableObservers(true); mockTab( - /* tabId= */ 5, - /* rootId= */ 2, + TAB_ID_1, + TOKEN_1, mTestTitle, mTestUrl, /* isIncognito= */ false, @@ -169,8 +192,8 @@ public void testSyncInitiatedNavigation() { mNavigationObserver.enableObservers(true); mockTab( - /* tabId= */ 5, - /* rootId= */ 2, + TAB_ID_1, + TOKEN_1, mTestTitle, mTestUrl, /* isIncognito= */ false,
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/RemoteTabGroupMutationHelper.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/RemoteTabGroupMutationHelper.java index 45452a3..e1f436f 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/RemoteTabGroupMutationHelper.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/RemoteTabGroupMutationHelper.java
@@ -41,37 +41,36 @@ /** * Creates a remote tab group corresponding to the given local tab group. * - * @param groupId The root ID of the local tab group. + * @param groupId The ID of the local tab group. */ - public void createRemoteTabGroup(int groupId) { - // Create an empty group and set visuals. - String syncId = mTabGroupSyncService.createGroup(new LocalTabGroupId(groupId)); + public void createRemoteTabGroup(LocalTabGroupId groupId) { + // Create an empty group and set visuals. This will create a mapping in native as well. + mTabGroupSyncService.createGroup(groupId); updateVisualData(groupId); // Add tabs to the group. - List<Tab> tabs = mTabGroupModelFilter.getRelatedTabList(groupId); + int rootId = mTabGroupModelFilter.getRootIdFromStableId(groupId.tabGroupId); + List<Tab> tabs = mTabGroupModelFilter.getRelatedTabList(rootId); for (int position = 0; position < tabs.size(); position++) { addTab(groupId, tabs.get(position), position); } - - // Persist sync ID mapping for the tab group in shared preference. - mapTabGroupId(groupId, syncId); } /** * Called to update the visual data of a remote tab group. Uses default values, if title or * color are still unset for the local tab group. * - * @param groupId The root ID of the local tab group. + * @param groupId The ID the local tab group. */ - public void updateVisualData(int groupId) { - String title = mTabGroupModelFilter.getTabGroupTitle(groupId); + public void updateVisualData(LocalTabGroupId groupId) { + int rootId = mTabGroupModelFilter.getRootIdFromStableId(groupId.tabGroupId); + String title = mTabGroupModelFilter.getTabGroupTitle(rootId); if (title == null) title = new String(); - int color = mTabGroupModelFilter.getTabGroupColor(groupId); + int color = mTabGroupModelFilter.getTabGroupColor(rootId); if (color == TabGroupColorUtils.INVALID_COLOR_ID) color = TabGroupColorId.GREY; - mTabGroupSyncService.updateVisualData(new LocalTabGroupId(groupId), title, color); + mTabGroupSyncService.updateVisualData(groupId, title, color); } /** @@ -79,80 +78,49 @@ * * @param groupId The local tab group ID. */ - public void removeGroup(int groupId) { - mTabGroupSyncService.removeGroup(new LocalTabGroupId(groupId)); + public void removeGroup(LocalTabGroupId groupId) { + mTabGroupSyncService.removeGroup(groupId); } - /** - * Updates the tab group ID mapping when the root ID of the group changes. - * - * @param oldGroupId The old local tab group ID. - * @param newGroupId The new local tab group ID. - */ - public void onLocalGroupIdChanged(int oldGroupId, int newGroupId) { - unmapTabGroupId(oldGroupId); - SavedTabGroup group = mTabGroupSyncService.getGroup(new LocalTabGroupId(oldGroupId)); - if (group == null) return; - mapTabGroupId(newGroupId, group.syncId); - } - - public void addTab(int tabGroupId, Tab tab, int position) { + public void addTab(LocalTabGroupId tabGroupId, Tab tab, int position) { mTabGroupSyncService.addTab( - new LocalTabGroupId(tabGroupId), - tab.getId(), - tab.getTitle(), - tab.getUrl(), - position); + tabGroupId, tab.getId(), tab.getTitle(), tab.getUrl(), position); } - public void updateTab(int tabGroupId, Tab tab, int position) { + public void updateTab(LocalTabGroupId tabGroupId, Tab tab, int position) { mTabGroupSyncService.updateTab( - new LocalTabGroupId(tabGroupId), - tab.getId(), - tab.getTitle(), - tab.getUrl(), - position); + tabGroupId, tab.getId(), tab.getTitle(), tab.getUrl(), position); } - public void removeTab(int tabGroupId, int tabId) { - mTabGroupSyncService.removeTab(new LocalTabGroupId(tabGroupId), tabId); + public void removeTab(LocalTabGroupId tabGroupId, int tabId) { + mTabGroupSyncService.removeTab(tabGroupId, tabId); } /** - * Updates ID mappings for the tab group ID and optionally tab IDs for a particular group in - * {@link TabGroupSyncService}. Doesn't update the mapping in the prefs as it's already stored. + * Updates tab ID mappings for a particular group. * - * @param syncGroupId The sync ID of the tab group. * @param localGroupId The local ID of the tab group. - * @param updateTabIds Whether or not the tab IDs should also be updated. */ - public void updateIdMappingForGroupOnStartup( - String syncGroupId, int localGroupId, boolean updateTabIds) { - // Update tab group ID mapping. - mTabGroupSyncService.updateLocalTabGroupMapping( - syncGroupId, new LocalTabGroupId(localGroupId)); - if (!updateTabIds) return; - + public void updateTabIdMappingsOnStartup(LocalTabGroupId localGroupId) { // Update tab ID mapping for tabs in the group. - SavedTabGroup group = mTabGroupSyncService.getGroup(new LocalTabGroupId(localGroupId)); - List<Integer> tabIds = mTabGroupModelFilter.getRelatedTabIds(localGroupId); + SavedTabGroup group = mTabGroupSyncService.getGroup(localGroupId); + int rootId = mTabGroupModelFilter.getRootIdFromStableId(localGroupId.tabGroupId); + List<Integer> tabIds = mTabGroupModelFilter.getRelatedTabIds(rootId); + // We just reconciled local state with sync. The tabs should match. + assert tabIds.size() == group.savedTabs.size() + : "Local tab count doesn't match with remote : " + + tabIds.size() + + " vs " + + group.savedTabs.size(); for (int i = 0; i < group.savedTabs.size() && i < tabIds.size(); i++) { SavedTabGroupTab savedTab = group.savedTabs.get(i); - mTabGroupSyncService.updateLocalTabId( - new LocalTabGroupId(localGroupId), savedTab.syncId, tabIds.get(i)); + mTabGroupSyncService.updateLocalTabId(localGroupId, savedTab.syncId, tabIds.get(i)); } } - /** Adds mapping for a tab group ID to the service and persistence. */ - public void mapTabGroupId(int groupId, String syncId) { - mTabGroupSyncService.updateLocalTabGroupMapping(syncId, new LocalTabGroupId(groupId)); - mTabGroupModelFilter.setTabGroupSyncId(groupId, syncId); - } - /** Removes mapping for a tab group ID from service and persistence. */ - public void unmapTabGroupId(int groupId) { - mTabGroupSyncService.removeLocalTabGroupMapping(new LocalTabGroupId(groupId)); - mTabGroupModelFilter.setTabGroupSyncId(groupId, null); + public void unmapTabGroupId(LocalTabGroupId groupId) { + mTabGroupSyncService.removeLocalTabGroupMapping(groupId); } /** @@ -172,14 +140,15 @@ // mapping from shared prefs and the service. Set<Integer> groupsClosing = findCompleteGroups(tabsInGroups); for (int groupId : groupsClosing) { - unmapTabGroupId(groupId); + unmapTabGroupId( + new LocalTabGroupId(mTabGroupModelFilter.getStableIdFromRootId(groupId))); } // The rest of the tabs are the ones that are being removed from their groups. Remove them // from sync. Set<Tab> tabsToRemove = findTabsNotInCompleteGroups(tabsInGroups, groupsClosing); for (Tab tab : tabsToRemove) { - mTabGroupSyncService.removeTab(new LocalTabGroupId(tab.getRootId()), tab.getId()); + mTabGroupSyncService.removeTab(new LocalTabGroupId(tab.getTabGroupId()), tab.getId()); } }
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/StartupHelper.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/StartupHelper.java index ae14b54..20ee485d 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/StartupHelper.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/StartupHelper.java
@@ -4,26 +4,26 @@ package org.chromium.chrome.browser.tab_group_sync; -import android.text.TextUtils; - import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter; +import org.chromium.components.tab_group_sync.LocalTabGroupId; +import org.chromium.components.tab_group_sync.SavedTabGroup; import org.chromium.components.tab_group_sync.TabGroupSyncService; -import java.util.HashMap; import java.util.HashSet; -import java.util.Map; +import java.util.List; import java.util.Set; /** * Handles startup flow. Invoked when both the {@link TabModel} and {@link TabGroupSyncService} have - * been initialized. Creates in-memory mapping of the local and sync tab group IDs. Additionally, if - * there are local only tab groups, adds them to sync. + * been initialized. Primarily reconciles remote group updates / deletions with the local model and + * local group additions to remote. Also initializes tab ID mappings for the session. */ public class StartupHelper { private final TabGroupModelFilter mTabGroupModelFilter; private final TabGroupSyncService mTabGroupSyncService; + private final LocalTabGroupMutationHelper mLocalTabGroupMutationHelper; private final RemoteTabGroupMutationHelper mRemoteTabGroupMutationHelper; /** @@ -31,76 +31,72 @@ * * @param tabGroupModelFilter The local tab group model. * @param tabGroupSyncService The sync back end. + * @param localTabGroupMutationHelper Helper to mutate local tab groups based on remote state. * @param remoteTabGroupMutationHelper Helper to mutate remote tab groups based on local state. */ public StartupHelper( TabGroupModelFilter tabGroupModelFilter, TabGroupSyncService tabGroupSyncService, + LocalTabGroupMutationHelper localTabGroupMutationHelper, RemoteTabGroupMutationHelper remoteTabGroupMutationHelper) { mTabGroupModelFilter = tabGroupModelFilter; mTabGroupSyncService = tabGroupSyncService; + mLocalTabGroupMutationHelper = localTabGroupMutationHelper; mRemoteTabGroupMutationHelper = remoteTabGroupMutationHelper; } /** - * Does startup routine. Few things: + * The startup routine that is executed in order: * * <ol> - * <li>Populate the in-memory mapping of the local tab group ID with sync ID. This will be - * stored in {@link TabGroupSyncService}. - * <li>For the first time migration, or if we signed in from a non-signed in state, we will - * have groups that don't exist in sync yet. This function will add these groups to sync. + * <li>Delete any tab groups from tab model that were deleted from sync. It could happen in + * multi-window situations where the deletion event was received when the window wasn't + * alive. + * <li>Add any tab group to sync that doesn't exist yet in sync. This is meant to handle when + * tab group sync feature is turned on for the first time or after a rollback. + * <li>Reconcile local state to be same as sync. We could have lost a update event from sync + * while the window wasn't running. + * <li>Populate tab ID mapping for {@link TabGroupSyncService}. We only persist tab group ID + * mapping in storage. Tab IDs are mapped on startup. * </ol> */ public void initializeTabGroupSync() { - // Read mappings from pref and build an in-memory map. - Map<String, Integer> idMappingsFromPref = readTabGroupIdMappingsFromPref(); + // First close the groups that were deleted remotely when the activity was not running. + closeDeletedGroupsFromTabModel(); - // Notify TabGroupSyncService about all the relevant local tab group IDs. - updateIdMappingsForAllGroups(idMappingsFromPref); - - // Do a one-time migration to local groups not in sync. Though unusual, it can happen - // because of one of the following: - // 1. They were created in pre-tabgroup-sync era. - // 2. A crash happened after tab group creation but before notifying sync service. - // In either case, create sync group counterparts for these groups. + // Add local groups that are not in sync. This can happen if: + // 1. The group was created before tab group sync feature was enabled. More prevalent + // if we are restoring a window created long back in history. + // 2. A crash happened after group creation so that we couldn't write it to sync. createRemoteTabGroupForNewGroups(); + + // Force update the local groups to be exactly same as sync. This accounts for any missing + // updates from sync when the current window wasn't alive. + reconcileGroupsToSync(); + + // Connect the tab IDs to their sync counterpart. This is an in-memory mapping maintained + // by {@link TabGroupSyncService}. + updateTabIdMappings(); } - /** Reads all tab group ID mappings from prefs and returns a map of sync ID -> local ID. */ - private Map<String, Integer> readTabGroupIdMappingsFromPref() { - // Find all local tab group IDs. - Set<Integer> localTabGroups = new HashSet<>(); - for (int i = 0; i < getTabModel().getCount(); i++) { - Tab tab = getTabModel().getTabAt(i); - if (tab.getTabGroupId() == null) continue; - localTabGroups.add(tab.getRootId()); + private void closeDeletedGroupsFromTabModel() { + for (LocalTabGroupId tabGroupId : mTabGroupSyncService.getDeletedGroupIds()) { + closeDeletedGroup(tabGroupId); } - - // Read sync ID for the local groups and build a map. - Map<String, Integer> idMappingsFromPref = new HashMap<>(); - for (int tabGroupId : localTabGroups) { - String syncId = mTabGroupModelFilter.getTabGroupSyncId(tabGroupId); - if (TextUtils.isEmpty(syncId)) continue; - idMappingsFromPref.put(syncId, tabGroupId); - } - - return idMappingsFromPref; } - /** - * For each group that has synced before, updates the local ID in the mapping held by {@link - * TabGroupSyncService}. - */ - private void updateIdMappingsForAllGroups(Map<String, Integer> idMappingsFromPref) { - String[] syncGroupIds = mTabGroupSyncService.getAllGroupIds(); - for (String syncGroupId : syncGroupIds) { - Integer localGroupId = idMappingsFromPref.get(syncGroupId); - if (localGroupId == null) continue; + private void closeDeletedGroup(LocalTabGroupId tabGroupId) { + int rootId = mTabGroupModelFilter.getRootIdFromStableId(tabGroupId.tabGroupId); - mRemoteTabGroupMutationHelper.updateIdMappingForGroupOnStartup( - syncGroupId, localGroupId, /* updateTabIds= */ true); - } + // Close the tabs. + List<Tab> tabs = mTabGroupModelFilter.getRelatedTabListForRootId(rootId); + getTabModel().closeMultipleTabs(tabs, /* canUndo= */ false); + + // Clean up the mapping from the mapping DB for the deleted group. + // TODO(b/336792770): Should this be a special method of its own? We could reuse + // existing removeGroup, or this one, or introduce cleanupDeletedGroupId(). Regardless, + // we need to add this functionality to native. + mTabGroupSyncService.removeLocalTabGroupMapping(tabGroupId); } /** @@ -108,22 +104,43 @@ * create their sync counterparts. */ private void createRemoteTabGroupForNewGroups() { - Set<Integer> localTabGroups = new HashSet<>(); - for (int i = 0; i < getTabModel().getCount(); i++) { - Tab tab = getTabModel().getTabAt(i); - if (tab.getTabGroupId() == null) continue; - localTabGroups.add(tab.getRootId()); - } - - for (int tabGroupId : localTabGroups) { + for (LocalTabGroupId tabGroupId : getLocalTabGroupIds()) { // Skip if the group is already added to sync. - String syncId = mTabGroupModelFilter.getTabGroupSyncId(tabGroupId); - if (!TextUtils.isEmpty(syncId)) continue; + SavedTabGroup savedTabGroup = mTabGroupSyncService.getGroup(tabGroupId); + if (savedTabGroup != null) continue; mRemoteTabGroupMutationHelper.createRemoteTabGroup(tabGroupId); } } + private void reconcileGroupsToSync() { + for (LocalTabGroupId tabGroupId : getLocalTabGroupIds()) { + SavedTabGroup savedTabGroup = mTabGroupSyncService.getGroup(tabGroupId); + assert savedTabGroup != null; + mLocalTabGroupMutationHelper.updateTabGroup(savedTabGroup); + } + } + + /** + * For each group that has synced before, updates the tab ID mappings held by {@link + * TabGroupSyncService}. + */ + private void updateTabIdMappings() { + for (LocalTabGroupId tabGroupId : getLocalTabGroupIds()) { + mRemoteTabGroupMutationHelper.updateTabIdMappingsOnStartup(tabGroupId); + } + } + + private Set<LocalTabGroupId> getLocalTabGroupIds() { + Set<LocalTabGroupId> localTabGroups = new HashSet<>(); + for (int i = 0; i < getTabModel().getCount(); i++) { + Tab tab = getTabModel().getTabAt(i); + if (tab.getTabGroupId() == null) continue; + localTabGroups.add(new LocalTabGroupId(tab.getTabGroupId())); + } + return localTabGroups; + } + private TabModel getTabModel() { return mTabGroupModelFilter.getTabModel(); }
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/StartupHelperUnitTest.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/StartupHelperUnitTest.java index 4d2a2f5..f13bc0f 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/StartupHelperUnitTest.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/StartupHelperUnitTest.java
@@ -6,9 +6,11 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyList; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -25,9 +27,11 @@ import org.chromium.base.Token; import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.tab.MockTab; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabCreationState; import org.chromium.chrome.browser.tab.TabLaunchType; +import org.chromium.chrome.browser.tab_group_sync.TabGroupSyncController.TabCreationDelegate; import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter; import org.chromium.chrome.test.util.browser.tabmodel.MockTabModel; import org.chromium.components.tab_group_sync.LocalTabGroupId; @@ -42,12 +46,18 @@ @RunWith(BaseRobolectricTestRunner.class) @Config(manifest = Config.NONE) public class StartupHelperUnitTest { + private static final int TAB_ID_1 = 5; + private static final int TAB_ID_2 = 6; + private static final Token TOKEN_1 = new Token(2, 3); + private static final int ROOT_ID_1 = 1; + @Rule public MockitoRule mMockitoRule = MockitoJUnit.rule(); @Mock private Profile mProfile; private MockTabModel mTabModel; private @Mock TabGroupModelFilter mTabGroupModelFilter; private TabGroupSyncService mTabGroupSyncService; - private RemoteTabGroupMutationHelper mRemoteMutationHelper; + private @Mock LocalTabGroupMutationHelper mLocalMutationHelper; + private @Mock RemoteTabGroupMutationHelper mRemoteMutationHelper; private StartupHelper mStartupHelper; private Tab mTab1; private Tab mTab2; @@ -63,50 +73,76 @@ @Before public void setUp() { mTabGroupSyncService = spy(new TestTabGroupSyncService()); - mTab1 = prepareTab(1, 1); - mTab2 = prepareTab(2, 2); - Mockito.doReturn(new Token(2, 3)).when(mTab1).getTabGroupId(); + mTab1 = prepareTab(TAB_ID_1, ROOT_ID_1); + mTab2 = prepareTab(TAB_ID_2, ROOT_ID_1); mTabModel = spy(new MockTabModel(mProfile, null)); when(mTabGroupModelFilter.getTabModel()).thenReturn(mTabModel); + when(mTabGroupModelFilter.getRelatedTabIds(ROOT_ID_1)).thenReturn(new ArrayList<>()); + + mLocalMutationHelper = + spy( + new LocalTabGroupMutationHelper( + mTabGroupModelFilter, + mTabGroupSyncService, + new TestTabCreationDelegate(), + new NavigationTracker())); mRemoteMutationHelper = - new RemoteTabGroupMutationHelper(mTabGroupModelFilter, mTabGroupSyncService); + spy(new RemoteTabGroupMutationHelper(mTabGroupModelFilter, mTabGroupSyncService)); mStartupHelper = new StartupHelper( - mTabGroupModelFilter, mTabGroupSyncService, mRemoteMutationHelper); + mTabGroupModelFilter, + mTabGroupSyncService, + mLocalMutationHelper, + mRemoteMutationHelper); + + when(mTabGroupModelFilter.getRootIdFromStableId(eq(TOKEN_1))).thenReturn(ROOT_ID_1); + when(mTabGroupModelFilter.getStableIdFromRootId(eq(ROOT_ID_1))).thenReturn(TOKEN_1); } @Test - public void testNotifiesSyncOfIdMappingOnStartup() { + public void testCloseLocalTabsAndUpdateLocalGroups() { SavedTabGroup savedTabGroup = TabGroupSyncTestUtils.createSavedTabGroup(); + savedTabGroup.savedTabs.remove(1); + savedTabGroup.localId = new LocalTabGroupId(TOKEN_1); String syncId = savedTabGroup.syncId; - when(mTab1.getTabGroupId()).thenReturn(new Token(2, 3)); + when(mTab1.getTabGroupId()).thenReturn(TOKEN_1); mTabModel.addTab( mTab1, 0, TabLaunchType.FROM_TAB_GROUP_UI, TabCreationState.LIVE_IN_BACKGROUND); - when(mTabGroupModelFilter.getTabGroupSyncId(1)).thenReturn(syncId); List<Integer> tabIds = new ArrayList<>(); tabIds.add(mTab1.getId()); - when(mTabGroupModelFilter.getRelatedTabIds(1)).thenReturn(tabIds); + when(mTabGroupModelFilter.getRelatedTabIds(ROOT_ID_1)).thenReturn(tabIds); when(mTabGroupSyncService.getAllGroupIds()).thenReturn(new String[] {syncId}); - when(mTabGroupSyncService.getGroup(new LocalTabGroupId(1))).thenReturn(savedTabGroup); + when(mTabGroupSyncService.getGroup(savedTabGroup.localId)).thenReturn(savedTabGroup); + List<LocalTabGroupId> ids = new ArrayList<>(); + ids.add(savedTabGroup.localId); + when(mTabGroupSyncService.getDeletedGroupIds()).thenReturn(ids); mStartupHelper.initializeTabGroupSync(); - verify(mTabGroupSyncService) - .updateLocalTabGroupMapping(eq(syncId), eq(new LocalTabGroupId(1))); verify(mTabGroupSyncService).updateLocalTabId(any(), anyString(), anyInt()); + verify(mTabGroupSyncService).getDeletedGroupIds(); + verify(mLocalMutationHelper).updateTabGroup(any()); + verify(mTabModel, times(2)).closeMultipleTabs(anyList(), eq(false)); } @Test - public void testCreatesRemoteGroupsForNewGroupsAndUpdatesPrefs() { - when(mTab1.getTabGroupId()).thenReturn(new Token(2, 3)); + public void testCreatesRemoteGroupsForNewGroups() { + when(mTab1.getTabGroupId()).thenReturn(TOKEN_1); mTabModel.addTab( mTab1, 0, TabLaunchType.FROM_TAB_GROUP_UI, TabCreationState.LIVE_IN_BACKGROUND); - when(mTabGroupModelFilter.getTabGroupSyncId(1)).thenReturn(null); + when(mTabGroupSyncService.getDeletedGroupIds()).thenReturn(new ArrayList<>()); when(mTabGroupSyncService.getAllGroupIds()).thenReturn(new String[0]); // Initialize. It should add the group to sync and add ID mapping to prefs. mStartupHelper.initializeTabGroupSync(); - verify(mTabGroupSyncService).createGroup(new LocalTabGroupId(1)); - verify(mTabGroupModelFilter) - .setTabGroupSyncId(eq(1), eq(TestTabGroupSyncService.SYNC_ID_1)); + verify(mTabGroupSyncService).createGroup(new LocalTabGroupId(TOKEN_1)); + } + + private class TestTabCreationDelegate implements TabCreationDelegate { + private int mNextTabId; + + @Override + public Tab createBackgroundTab(GURL url, Tab parent, int position) { + return new MockTab(++mNextTabId, mProfile); + } } }
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncController.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncController.java index a2458779..6004a080 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncController.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncController.java
@@ -76,7 +76,10 @@ new RemoteTabGroupMutationHelper(mTabGroupModelFilter, mTabGroupSyncService); mStartupHelper = new StartupHelper( - mTabGroupModelFilter, mTabGroupSyncService, mRemoteMutationHelper); + mTabGroupModelFilter, + mTabGroupSyncService, + mLocalMutationHelper, + mRemoteMutationHelper); mLocalObserver = new TabGroupSyncLocalObserver(
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncControllerUnitTest.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncControllerUnitTest.java index f0ada1e..c48824d 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncControllerUnitTest.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncControllerUnitTest.java
@@ -4,6 +4,7 @@ package org.chromium.chrome.browser.tab_group_sync; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; @@ -33,6 +34,8 @@ import org.chromium.chrome.test.util.browser.tabmodel.MockTabModel; import org.chromium.components.tab_group_sync.TabGroupSyncService; +import java.util.ArrayList; + /** Unit tests for the {@link TabGroupSyncController}. */ @RunWith(BaseRobolectricTestRunner.class) @Config(manifest = Config.NONE) @@ -73,9 +76,10 @@ @Test public void testInitialization() { when(mTabModelSelector.isTabStateInitialized()).thenReturn(true); - when(mTabGroupSyncService.getAllGroupIds()).thenReturn(new String[0]); + when(mTabGroupSyncService.getDeletedGroupIds()).thenReturn(new ArrayList<>()); mTabGroupSyncServiceObserverCaptor.getValue().onInitialized(); mTabModelSelectorObserverCaptor.getValue().onTabStateInitialized(); - verify(mTabGroupSyncService, times(2)).getAllGroupIds(); + verify(mTabGroupSyncService, times(1)).addObserver(any()); + verify(mTabGroupSyncService, times(2)).getDeletedGroupIds(); } }
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncFeatures.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncFeatures.java new file mode 100644 index 0000000..96b88f64 --- /dev/null +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncFeatures.java
@@ -0,0 +1,17 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.tab_group_sync; + +/** Utility class for defining features and params related to tab group sync. */ +public final class TabGroupSyncFeatures { + + /** Whether tab group sync is enabled. */ + public static boolean isTabGroupSyncEnabled() { + // TODO(b/336385437): Disabling the feature to do a refactor. We can't have the feature + // running during the transition since it will break or crash. + // return ChromeFeatureList.isEnabled(ChromeFeatureList.TAB_GROUP_SYNC_ANDROID); + return false; + } +}
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncLocalObserver.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncLocalObserver.java index f60c551..a0aee02 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncLocalObserver.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncLocalObserver.java
@@ -4,6 +4,7 @@ package org.chromium.chrome.browser.tab_group_sync; +import org.chromium.base.Token; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModelObserver; @@ -90,7 +91,9 @@ if (!mIsObserving || tab.getTabGroupId() == null) return; mRemoteTabGroupMutationHelper.addTab( - tab.getRootId(), tab, mTabGroupModelFilter.getIndexOfTabInGroup(tab)); + new LocalTabGroupId(tab.getTabGroupId()), + tab, + mTabGroupModelFilter.getIndexOfTabInGroup(tab)); } @Override @@ -106,19 +109,22 @@ return new TabGroupModelFilterObserver() { @Override public void didChangeTabGroupColor(int rootId, int newColor) { - updateVisualData(rootId); + Token tabGroupId = mTabGroupModelFilter.getStableIdFromRootId(rootId); + updateVisualData(new LocalTabGroupId(tabGroupId)); } @Override public void didChangeTabGroupTitle(int rootId, String newTitle) { - updateVisualData(rootId); + Token tabGroupId = mTabGroupModelFilter.getStableIdFromRootId(rootId); + updateVisualData(new LocalTabGroupId(tabGroupId)); } @Override public void didMergeTabToGroup(Tab movedTab, int selectedTabIdInGroup) { if (!mIsObserving) return; - int tabGroupRootId = movedTab.getRootId(); + Token tabGroupId = mTabGroupModelFilter.getStableIdFromRootId(movedTab.getRootId()); + LocalTabGroupId tabGroupRootId = new LocalTabGroupId(tabGroupId); if (groupExistsInSync(tabGroupRootId)) { int positionInGroup = mTabGroupModelFilter.getIndexOfTabInGroup(movedTab); mRemoteTabGroupMutationHelper.addTab(tabGroupRootId, movedTab, positionInGroup); @@ -134,8 +140,9 @@ // The tab position was changed. Update sync. int positionInGroup = mTabGroupModelFilter.getIndexOfTabInGroup(movedTab); + Token tabGroupId = mTabGroupModelFilter.getStableIdFromRootId(movedTab.getRootId()); mRemoteTabGroupMutationHelper.updateTab( - movedTab.getRootId(), movedTab, positionInGroup); + new LocalTabGroupId(tabGroupId), movedTab, positionInGroup); } @Override @@ -145,37 +152,37 @@ // Remove tab from the synced group. Tab prevRoot = getTabModel().getTabAt(prevFilterIndex); assert prevRoot != null; - mRemoteTabGroupMutationHelper.removeTab(prevRoot.getRootId(), movedTab.getId()); + Token tabGroupId = mTabGroupModelFilter.getStableIdFromRootId(prevRoot.getRootId()); + mRemoteTabGroupMutationHelper.removeTab( + new LocalTabGroupId(tabGroupId), movedTab.getId()); } @Override public void didCreateNewGroup(Tab destinationTab, TabGroupModelFilter filter) { if (!mIsObserving) return; - if (groupExistsInSync(destinationTab.getRootId())) return; + Token tabGroupId = + mTabGroupModelFilter.getStableIdFromRootId(destinationTab.getRootId()); + LocalTabGroupId localTabGroupId = new LocalTabGroupId(tabGroupId); + if (groupExistsInSync(localTabGroupId)) return; - mRemoteTabGroupMutationHelper.createRemoteTabGroup(destinationTab.getRootId()); + mRemoteTabGroupMutationHelper.createRemoteTabGroup(localTabGroupId); } @Override public void didRemoveTabGroup(int oldRootId) { - mRemoteTabGroupMutationHelper.unmapTabGroupId(oldRootId); - } - - @Override - public void didChangeGroupRootId(int oldRootId, int newRootId) { - // We update the mapping regardless of whether observers are enabled or not. - mRemoteTabGroupMutationHelper.onLocalGroupIdChanged(oldRootId, newRootId); + Token tabGroupId = mTabGroupModelFilter.getStableIdFromRootId(oldRootId); + mRemoteTabGroupMutationHelper.unmapTabGroupId(new LocalTabGroupId(tabGroupId)); } }; } - private void updateVisualData(int tabGroupId) { + private void updateVisualData(LocalTabGroupId tabGroupId) { if (!mIsObserving) return; mRemoteTabGroupMutationHelper.updateVisualData(tabGroupId); } - private boolean groupExistsInSync(int rootId) { - return mTabGroupSyncService.getGroup(new LocalTabGroupId(rootId)) != null; + private boolean groupExistsInSync(LocalTabGroupId rootId) { + return mTabGroupSyncService.getGroup(rootId) != null; } private TabModel getTabModel() {
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncLocalObserverUnitTest.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncLocalObserverUnitTest.java index 4d8149f..f4c5594 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncLocalObserverUnitTest.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncLocalObserverUnitTest.java
@@ -37,7 +37,6 @@ import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilterObserver; import org.chromium.chrome.test.util.browser.tabmodel.MockTabModel; import org.chromium.components.tab_group_sync.LocalTabGroupId; -import org.chromium.components.tab_group_sync.SavedTabGroup; import org.chromium.components.tab_group_sync.TabGroupSyncService; import org.chromium.components.tab_groups.TabGroupColorId; import org.chromium.url.GURL; @@ -49,6 +48,12 @@ @RunWith(BaseRobolectricTestRunner.class) @Config(manifest = Config.NONE) public class TabGroupSyncLocalObserverUnitTest { + private static final int TAB_ID_1 = 1; + private static final int TAB_ID_2 = 2; + private static final int ROOT_ID_1 = 1; + private static final int ROOT_ID_2 = 2; + private static final Token TOKEN_1 = new Token(2, 3); + @Rule public MockitoRule mMockitoRule = MockitoJUnit.rule(); private @Mock TabModelSelector mTabModelSelector; @Mock private Profile mProfile; @@ -76,9 +81,12 @@ @Before public void setUp() { mTabGroupSyncService = spy(new TestTabGroupSyncService()); - mTab1 = prepareTab(1, 1); - mTab2 = prepareTab(2, 2); - Mockito.doReturn(new Token(2, 3)).when(mTab1).getTabGroupId(); + mTab1 = prepareTab(TAB_ID_1, ROOT_ID_1); + mTab2 = prepareTab(TAB_ID_2, ROOT_ID_2); + Mockito.doReturn(TOKEN_1).when(mTab1).getTabGroupId(); + + when(mTabGroupModelFilter.getRootIdFromStableId(eq(TOKEN_1))).thenReturn(ROOT_ID_1); + when(mTabGroupModelFilter.getStableIdFromRootId(eq(ROOT_ID_1))).thenReturn(TOKEN_1); mTabModel = spy(new MockTabModel(mProfile, null)); when(mTabGroupModelFilter.getTabModel()).thenReturn(mTabModel); @@ -117,7 +125,7 @@ TabCreationState.LIVE_IN_BACKGROUND, false); verify(mTabGroupSyncService, times(1)) - .addTab(eq(new LocalTabGroupId(1)), eq(1), any(), any(), anyInt()); + .addTab(eq(new LocalTabGroupId(TOKEN_1)), eq(TAB_ID_1), any(), any(), anyInt()); } @Test @@ -131,8 +139,7 @@ @Test public void testDidMergeTabToGroup() { mTabGroupModelFilterObserverCaptor.getValue().didMergeTabToGroup(mTab1, 1); - verify(mTabGroupSyncService, times(1)) - .createGroup(eq(new LocalTabGroupId(mTab1.getRootId()))); + verify(mTabGroupSyncService, times(1)).createGroup(eq(new LocalTabGroupId(TOKEN_1))); } @Test @@ -142,11 +149,11 @@ mTab1, 0, TabLaunchType.FROM_TAB_GROUP_UI, TabCreationState.LIVE_IN_BACKGROUND); mTabModel.addTab( mTab2, 1, TabLaunchType.FROM_TAB_GROUP_UI, TabCreationState.LIVE_IN_BACKGROUND); - Mockito.doReturn(1).when(mTab2).getRootId(); + Mockito.doReturn(TOKEN_1).when(mTab2).getTabGroupId(); // Move tab 2 out of group and verify. mTabGroupModelFilterObserverCaptor.getValue().didMoveTabOutOfGroup(mTab2, 0); - verify(mTabGroupSyncService, times(1)).removeTab(eq(new LocalTabGroupId(1)), eq(2)); + verify(mTabGroupSyncService, times(1)).removeTab(eq(new LocalTabGroupId(TOKEN_1)), eq(2)); } @Test @@ -154,14 +161,15 @@ mTabGroupModelFilterObserverCaptor .getValue() .didCreateNewGroup(mTab1, mTabGroupModelFilter); - verify(mTabGroupSyncService, times(1)).createGroup(eq(new LocalTabGroupId(1))); + verify(mTabGroupSyncService, times(1)).createGroup(eq(new LocalTabGroupId(TOKEN_1))); } @Test public void testDidMoveTabWithinGroup() { when(mTabGroupModelFilter.getIndexOfTabInGroup(mTab1)).thenReturn(0); mTabGroupModelFilterObserverCaptor.getValue().didMoveWithinGroup(mTab1, 0, 1); - verify(mTabGroupSyncService, times(1)).updateTab(any(), anyInt(), any(), any(), anyInt()); + verify(mTabGroupSyncService, times(1)) + .updateTab(eq(new LocalTabGroupId(TOKEN_1)), eq(TAB_ID_1), any(), any(), anyInt()); } @Test @@ -170,7 +178,7 @@ .getValue() .didChangeTabGroupTitle(mTab1.getRootId(), "New Title"); verify(mTabGroupSyncService, times(1)) - .updateVisualData(eq(new LocalTabGroupId(mTab1.getRootId())), any(), anyInt()); + .updateVisualData(eq(new LocalTabGroupId(TOKEN_1)), any(), anyInt()); } @Test @@ -179,30 +187,13 @@ .getValue() .didChangeTabGroupColor(mTab1.getRootId(), TabGroupColorId.RED); verify(mTabGroupSyncService, times(1)) - .updateVisualData(eq(new LocalTabGroupId(mTab1.getRootId())), any(), anyInt()); + .updateVisualData(eq(new LocalTabGroupId(TOKEN_1)), any(), anyInt()); } @Test public void testDidRemoveGroup() { - mTabGroupModelFilterObserverCaptor.getValue().didRemoveTabGroup(3); - verify(mTabGroupModelFilter).setTabGroupSyncId(eq(3), eq(null)); + mTabGroupModelFilterObserverCaptor.getValue().didRemoveTabGroup(ROOT_ID_1); verify(mTabGroupSyncService, times(1)) - .removeLocalTabGroupMapping(eq(new LocalTabGroupId(3))); - } - - @Test - public void testDidChangeGroupId() { - int oldGroupId = 3; - int newGroupId = 4; - SavedTabGroup savedTabGroup = TabGroupSyncTestUtils.createSavedTabGroup(); - savedTabGroup.localId = new LocalTabGroupId(oldGroupId); - when(mTabGroupSyncService.getGroup(new LocalTabGroupId(oldGroupId))) - .thenReturn(savedTabGroup); - mTabGroupModelFilterObserverCaptor.getValue().didChangeGroupRootId(oldGroupId, newGroupId); - verify(mTabGroupSyncService, times(1)) - .updateLocalTabGroupMapping( - eq(savedTabGroup.syncId), eq(new LocalTabGroupId(newGroupId))); - verify(mTabGroupModelFilter).setTabGroupSyncId(eq(oldGroupId), eq(null)); - verify(mTabGroupModelFilter).setTabGroupSyncId(eq(newGroupId), eq(savedTabGroup.syncId)); + .removeLocalTabGroupMapping(eq(new LocalTabGroupId(TOKEN_1))); } }
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncRemoteObserver.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncRemoteObserver.java index 21ceb52..055a2ea 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncRemoteObserver.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncRemoteObserver.java
@@ -100,7 +100,8 @@ public void onTabGroupRemoved(LocalTabGroupId localId) { assert localId != null; mEnableLocalObserverCallback.onResult(false); - List<Tab> tabs = mTabGroupModelFilter.getRelatedTabList(localId.rootId); + int rootId = mTabGroupModelFilter.getRootIdFromStableId(localId.tabGroupId); + List<Tab> tabs = mTabGroupModelFilter.getRelatedTabList(rootId); getTabModel().closeMultipleTabs(tabs, /* canUndo= */ false); mEnableLocalObserverCallback.onResult(true); }
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncRemoteObserverUnitTest.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncRemoteObserverUnitTest.java index 855457f..09afd96 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncRemoteObserverUnitTest.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TabGroupSyncRemoteObserverUnitTest.java
@@ -23,6 +23,7 @@ import org.mockito.junit.MockitoRule; import org.robolectric.annotation.Config; +import org.chromium.base.Token; import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.MockTab; @@ -44,6 +45,9 @@ @RunWith(BaseRobolectricTestRunner.class) @Config(manifest = Config.NONE) public class TabGroupSyncRemoteObserverUnitTest { + private static final Token TOKEN_1 = new Token(2, 3); + private static final int ROOT_ID_1 = 1; + @Rule public MockitoRule mMockitoRule = MockitoJUnit.rule(); @Mock private Profile mProfile; private MockTabModel mTabModel; @@ -75,6 +79,9 @@ mNavigationTracker, enable -> {}, () -> {}); + + when(mTabGroupModelFilter.getRootIdFromStableId(eq(TOKEN_1))).thenReturn(ROOT_ID_1); + when(mTabGroupModelFilter.getStableIdFromRootId(eq(ROOT_ID_1))).thenReturn(TOKEN_1); } @Test @@ -94,43 +101,40 @@ @Test public void testTabGroupVisualsUpdated() { SavedTabGroup savedTabGroup = TabGroupSyncTestUtils.createSavedTabGroup(); - int rootId = 1; mTabModel.addTab(1); List<Tab> tabs = new ArrayList<>(); tabs.add(mTabModel.getTabAt(0)); - when(mTabGroupModelFilter.getRelatedTabListForRootId(eq(rootId))).thenReturn(tabs); + when(mTabGroupModelFilter.getRelatedTabListForRootId(eq(ROOT_ID_1))).thenReturn(tabs); savedTabGroup.title = "Updated group"; - savedTabGroup.localId = new LocalTabGroupId(rootId); + savedTabGroup.localId = new LocalTabGroupId(TOKEN_1); mRemoteObserver.onTabGroupUpdated(savedTabGroup); - verify(mTabGroupModelFilter).setTabGroupTitle(eq(rootId), eq(savedTabGroup.title)); - verify(mTabGroupModelFilter).setTabGroupColor(anyInt(), anyInt()); + verify(mTabGroupModelFilter).setTabGroupTitle(eq(ROOT_ID_1), eq(savedTabGroup.title)); + verify(mTabGroupModelFilter).setTabGroupColor(eq(ROOT_ID_1), anyInt()); } @Test public void testTabAdded() { SavedTabGroup savedTabGroup = TabGroupSyncTestUtils.createSavedTabGroup(); - int rootId = 1; mTabModel.addTab(1); List<Tab> tabs = new ArrayList<>(); tabs.add(mTabModel.getTabAt(0)); - savedTabGroup.localId = new LocalTabGroupId(rootId); - when(mTabGroupModelFilter.getRelatedTabListForRootId(eq(rootId))).thenReturn(tabs); + savedTabGroup.localId = new LocalTabGroupId(TOKEN_1); + when(mTabGroupModelFilter.getRelatedTabListForRootId(eq(ROOT_ID_1))).thenReturn(tabs); mRemoteObserver.onTabGroupUpdated(savedTabGroup); - verify(mTabGroupModelFilter).setTabGroupTitle(eq(rootId), eq(savedTabGroup.title)); + verify(mTabGroupModelFilter).setTabGroupTitle(eq(ROOT_ID_1), eq(savedTabGroup.title)); verify(mTabGroupModelFilter).setTabGroupColor(anyInt(), anyInt()); - verify(mTabGroupModelFilter, times(2)).mergeTabsToGroup(anyInt(), eq(rootId)); + verify(mTabGroupModelFilter, times(2)).mergeTabsToGroup(anyInt(), eq(ROOT_ID_1)); verify(mTabGroupSyncService, times(2)) - .updateLocalTabId(eq(new LocalTabGroupId(rootId)), any(), anyInt()); + .updateLocalTabId(eq(new LocalTabGroupId(TOKEN_1)), any(), anyInt()); verify(mTabModel).closeMultipleTabs(anyList(), eq(false)); } @Test public void testTabGroupRemoved() { - int rootId = 1; mTabModel.addTab(1); - mRemoteObserver.onTabGroupRemoved(new LocalTabGroupId(rootId)); - verify(mTabModel).closeMultipleTabs(anyList(), anyBoolean()); + mRemoteObserver.onTabGroupRemoved(new LocalTabGroupId(TOKEN_1)); + verify(mTabModel).closeMultipleTabs(anyList(), eq(false)); } private class TestTabCreationDelegate implements TabCreationDelegate {
diff --git a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TestTabGroupSyncService.java b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TestTabGroupSyncService.java index 83071d5d..e6895b1 100644 --- a/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TestTabGroupSyncService.java +++ b/chrome/browser/tab_group_sync/android/java/src/org/chromium/chrome/browser/tab_group_sync/TestTabGroupSyncService.java
@@ -74,5 +74,10 @@ public void removeLocalTabGroupMapping(LocalTabGroupId localId) {} @Override + public List<LocalTabGroupId> getDeletedGroupIds() { + return new ArrayList<>(); + } + + @Override public void updateLocalTabId(LocalTabGroupId localGroupId, String syncTabId, int localTabId) {} }
diff --git a/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabCreator.java b/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabCreator.java index 9295a4e2..ee25bbe 100644 --- a/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabCreator.java +++ b/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabCreator.java
@@ -36,6 +36,7 @@ /** * Creates a new tab and posts to UI. + * * @param loadUrlParams parameters of the url load. * @param type Information about how the tab was launched. * @param parent the parent tab, if present. @@ -46,6 +47,23 @@ LoadUrlParams loadUrlParams, @TabLaunchType int type, Tab parent, int position); /** + * Creates a new tab and posts to UI. + * + * @param loadUrlParams parameters of the url load. + * @param title The title to use for a lazily loaded tab. + * @param type Information about how the tab was launched. + * @param parent the parent tab, if present. + * @param position the requested position (index in the tab model) + * @return The new tab or null if no tab was created. + */ + public abstract @Nullable Tab createNewTab( + LoadUrlParams loadUrlParams, + String title, + @TabLaunchType int type, + Tab parent, + int position); + + /** * On restore, allows us to create a frozen version of a tab using saved tab state we read from * disk. *
diff --git a/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabRegistrationObserverUnitTest.java b/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabRegistrationObserverUnitTest.java index 70a8584..eaa9406 100644 --- a/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabRegistrationObserverUnitTest.java +++ b/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabRegistrationObserverUnitTest.java
@@ -5,6 +5,7 @@ package org.chromium.chrome.browser.tabmodel; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -60,7 +61,8 @@ mJniMocker.mock( org.chromium.chrome.browser.tabmodel.TabModelJniBridgeJni.TEST_HOOKS, mTabModelJniBridge); - when(mTabModelJniBridge.init(any(), any(), anyInt())).thenReturn(FAKE_NATIVE_ADDRESS); + when(mTabModelJniBridge.init(any(), any(), anyInt(), anyBoolean())) + .thenReturn(FAKE_NATIVE_ADDRESS); when(mIncognitoProfile.isOffTheRecord()).thenReturn(true); when(mProfile.isOffTheRecord()).thenReturn(false); @@ -90,7 +92,8 @@ nextTabPolicySupplier, realAsyncTabParamsManager, selector, - true); + /* supportUndo= */ true, + /* trackInNativeModelList= */ true); TestIncognitoTabModel incognitoTabModel = new TestIncognitoTabModel( mIncognitoProfile, @@ -102,7 +105,8 @@ nextTabPolicySupplier, realAsyncTabParamsManager, selector, - false); + /* supportUndo= */ false, + /* trackInNativeModelList= */ true); selector.initialize(normalTabModel, incognitoTabModel); @@ -369,7 +373,8 @@ NextTabPolicy.NextTabPolicySupplier nextTabPolicySupplier, AsyncTabParamsManager asyncTabParamsManager, TabModelDelegate modelDelegate, - boolean supportUndo) { + boolean supportUndo, + boolean trackInNativeModelList) { super( profile, activityType, @@ -380,7 +385,8 @@ nextTabPolicySupplier, asyncTabParamsManager, modelDelegate, - supportUndo); + supportUndo, + trackInNativeModelList); } @Override
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index f0def72..a753532a 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -33,6 +33,7 @@ import("//ui/views/features.gni") assert(enable_supervised_users) +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") generate_histograms_variants_allowlist("webui_name_variants") { namespace = "views_metrics" @@ -508,6 +509,7 @@ "//components/content_settings/core/browser:cookie_settings", "//components/content_settings/core/common", "//components/country_codes", + "//components/crash/core/app", "//components/crash/core/browser", "//components/crx_file", "//components/custom_handlers", @@ -808,10 +810,6 @@ ] } - if (!is_fuchsia) { - deps += [ "//components/crash/core/app" ] - } - if (is_android) { sources += [ "android/android_about_app_info.cc", @@ -2562,22 +2560,14 @@ "../ash/app_list/search/search_session_metrics_manager.h", "../ash/app_list/search/system_info/battery_answer_result.cc", "../ash/app_list/search/system_info/battery_answer_result.h", - "../ash/app_list/search/system_info/battery_health.h", "../ash/app_list/search/system_info/cpu_answer_result.cc", "../ash/app_list/search/system_info/cpu_answer_result.h", - "../ash/app_list/search/system_info/cpu_data.h", - "../ash/app_list/search/system_info/cpu_usage_data.cc", - "../ash/app_list/search/system_info/cpu_usage_data.h", "../ash/app_list/search/system_info/memory_answer_result.cc", "../ash/app_list/search/system_info/memory_answer_result.h", "../ash/app_list/search/system_info/system_info_answer_result.cc", "../ash/app_list/search/system_info/system_info_answer_result.h", "../ash/app_list/search/system_info/system_info_card_provider.cc", "../ash/app_list/search/system_info/system_info_card_provider.h", - "../ash/app_list/search/system_info/system_info_keyword_input.cc", - "../ash/app_list/search/system_info/system_info_keyword_input.h", - "../ash/app_list/search/system_info/system_info_util.cc", - "../ash/app_list/search/system_info/system_info_util.h", "../ash/app_list/search/types.cc", "../ash/app_list/search/types.h", "../ash/app_list/search/util/ftrl_optimizer.cc", @@ -3892,6 +3882,7 @@ "//chromeos/ash/components/heatmap", "//chromeos/ash/components/human_presence", "//chromeos/ash/components/install_attributes", + "//chromeos/ash/components/launcher_search", "//chromeos/ash/components/local_search_service/public/cpp", "//chromeos/ash/components/local_search_service/public/mojom", "//chromeos/ash/components/login/auth", @@ -3914,6 +3905,7 @@ "//chromeos/ash/components/standalone_browser", "//chromeos/ash/components/string_matching", "//chromeos/ash/components/system", + "//chromeos/ash/components/system_info", "//chromeos/ash/components/tether", "//chromeos/ash/resources", "//chromeos/ash/services/assistant:lib", @@ -4166,7 +4158,7 @@ ] } - if (is_win || is_mac || is_linux || is_chromeos || is_fuchsia) { + if (is_win || is_mac || is_linux || is_chromeos) { sources += [ "autofill/payments/virtual_card_selection_dialog.h", "autofill/payments/virtual_card_selection_dialog_controller.h", @@ -4245,7 +4237,7 @@ ] } - if (is_win || is_mac || is_fuchsia || is_linux) { + if (is_win || is_mac || is_linux) { sources += [ "views/web_apps/deprecated_apps_dialog_view.cc", "views/web_apps/deprecated_apps_dialog_view.h", @@ -4273,7 +4265,7 @@ ] } - if (is_win || is_mac || is_fuchsia || is_linux || is_chromeos_ash) { + if (is_win || is_mac || is_linux || is_chromeos_ash) { sources += [ "webui/app_management/app_management_page_handler_base.cc", "webui/app_management/app_management_page_handler_base.h", @@ -4282,7 +4274,7 @@ ] } - if (is_win || is_mac || is_fuchsia || is_linux || is_chromeos_lacros) { + if (is_win || is_mac || is_linux || is_chromeos_lacros) { sources += [ "passwords/account_storage_auth_helper.cc", "passwords/account_storage_auth_helper.h", @@ -4436,7 +4428,7 @@ } } - if (enable_dice_support || is_chromeos_ash || is_fuchsia) { + if (enable_dice_support || is_chromeos_ash) { sources += [ "webui/signin/inline_login_ui.cc", "webui/signin/inline_login_ui.h", @@ -4773,7 +4765,7 @@ ] } - if (is_linux || is_chromeos_lacros || is_fuchsia) { + if (is_linux || is_chromeos_lacros) { sources += [ "views/apps/chrome_app_window_client_views_aura.cc" ] } @@ -6491,17 +6483,6 @@ "//components/arc/common:arc_intent_helper_constants", ] } - if (is_fuchsia) { - sources += [ - "views/chrome_views_delegate_fuchsia.cc", - "views/frame/browser_desktop_window_tree_host.h", - "views/frame/browser_desktop_window_tree_host_fuchsia.cc", - "views/frame/native_browser_frame_factory_aura.cc", - "views/status_icons/status_tray_fuchsia.cc", - "webui/help/version_updater_basic.cc", - "webui/settings/settings_utils_fuchsia.cc", - ] - } if (is_win || is_linux) { sources += [ @@ -6546,7 +6527,7 @@ ] } - if (is_win || is_fuchsia || is_linux || is_chromeos_lacros) { + if (is_win || is_linux || is_chromeos_lacros) { sources += [ "views/native_widget_factory.cc", "views/native_widget_factory.h",
diff --git a/chrome/browser/ui/android/hats/survey_client_android.cc b/chrome/browser/ui/android/hats/survey_client_android.cc index bf25fa6..52b9c4c 100644 --- a/chrome/browser/ui/android/hats/survey_client_android.cc +++ b/chrome/browser/ui/android/hats/survey_client_android.cc
@@ -4,10 +4,11 @@ #include "chrome/browser/ui/android/hats/survey_client_android.h" +#include <string_view> + #include "base/android/jni_android.h" #include "base/android/jni_array.h" #include "base/android/jni_string.h" - #include "base/android/scoped_java_ref.h" #include "base/ranges/algorithm.h" #include "chrome/browser/profiles/profile.h" @@ -34,7 +35,7 @@ ScopedJavaLocalRef<jstring> java_supplied_trigger_id = ConvertUTF8ToJavaString(env, supplied_trigger_id.has_value() ? supplied_trigger_id.value() - : base::StringPiece()); + : std::string_view()); jobj_ = Java_SurveyClientBridge_create( env, reinterpret_cast<int64_t>(this), java_trigger, ui_delegate->GetJavaObject(env),
diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/UpgradePromoCoordinator.java b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/UpgradePromoCoordinator.java index 6bd168a..7f687ce 100644 --- a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/UpgradePromoCoordinator.java +++ b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/UpgradePromoCoordinator.java
@@ -18,6 +18,7 @@ import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.profiles.ProfileProvider; import org.chromium.chrome.browser.signin.services.IdentityServicesProvider; +import org.chromium.chrome.browser.signin.services.SigninManager; import org.chromium.chrome.browser.ui.signin.fullscreen_signin.FullscreenSigninCoordinator; import org.chromium.chrome.browser.ui.signin.fullscreen_signin.FullscreenSigninView; import org.chromium.chrome.browser.ui.signin.history_sync.HistorySyncCoordinator; @@ -25,6 +26,7 @@ import org.chromium.components.signin.identitymanager.ConsentLevel; import org.chromium.components.signin.identitymanager.IdentityManager; import org.chromium.components.signin.metrics.SigninAccessPoint; +import org.chromium.components.signin.metrics.SignoutReason; import org.chromium.ui.modaldialog.ModalDialogManager; import java.lang.annotation.Retention; @@ -75,7 +77,9 @@ } private final Context mContext; + private final ModalDialogManager mModalDialogManager; private final OneshotSupplier<ProfileProvider> mProfileSupplier; + private final PrivacyPreferencesManager mPrivacyPreferencesManager; private final Delegate mDelegate; private final boolean mDidShowSignin; private ViewSwitcher mViewSwitcher; @@ -90,7 +94,9 @@ Delegate delegate) { mContext = context; mViewSwitcher = new ViewSwitcher(context); + mModalDialogManager = modalDialogManager; mProfileSupplier = profileSupplier; + mPrivacyPreferencesManager = privacyPreferencesManager; mDelegate = delegate; inflateViewSwitcher(); if (isSignedIn()) { @@ -99,7 +105,7 @@ } else { mSigninCoordinator = new FullscreenSigninCoordinator( - mContext, modalDialogManager, this, privacyPreferencesManager); + mContext, mModalDialogManager, this, mPrivacyPreferencesManager); mSigninCoordinator.setView((FullscreenSigninView) mViewSwitcher.getCurrentView()); mDidShowSignin = true; } @@ -253,6 +259,33 @@ mSigninCoordinator.onAccountSelected(accountName); } + public void handleBackPress() { + @ViewSwitcherChild int currentlyDisplayedChild = mViewSwitcher.getDisplayedChild(); + switch (currentlyDisplayedChild) { + case ViewSwitcherChild.SIGNIN: + if (isSignedIn()) { + SigninManager signinManager = + IdentityServicesProvider.get() + .getSigninManager(mProfileSupplier.get().getOriginalProfile()); + signinManager.signOut(SignoutReason.ABORT_SIGNIN); + } + mDelegate.onFlowComplete(); + break; + case ViewSwitcherChild.HISTORY_SYNC: + if (!mDidShowSignin) { + mDelegate.onFlowComplete(); + return; + } + mViewSwitcher.setDisplayedChild(ViewSwitcherChild.SIGNIN); + mSigninCoordinator = + new FullscreenSigninCoordinator( + mContext, mModalDialogManager, this, mPrivacyPreferencesManager); + mSigninCoordinator.setView((FullscreenSigninView) mViewSwitcher.getCurrentView()); + mSigninCoordinator.reset(); + return; + } + } + private void inflateViewSwitcher() { Configuration configuration = mContext.getResources().getConfiguration(); boolean useLandscapeLayout =
diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fullscreen_signin/FullscreenSigninCoordinator.java b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fullscreen_signin/FullscreenSigninCoordinator.java index 706be1b9..ee24ea0 100644 --- a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fullscreen_signin/FullscreenSigninCoordinator.java +++ b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fullscreen_signin/FullscreenSigninCoordinator.java
@@ -124,9 +124,8 @@ } /** - * Resets model properties in {@link FullscreenSigninMediator}. - * This method is called when the user advances to the sync consent page and then presses back - * and returns to the FRE again. + * Resets model properties in {@link FullscreenSigninMediator}. This method is called when the + * user advances to the next page and then presses back and returns to the FRE again. */ public void reset() { mMediator.reset();
diff --git a/chrome/browser/ui/android/tab_model/tab_model_jni_bridge.cc b/chrome/browser/ui/android/tab_model/tab_model_jni_bridge.cc index 2b61489..39f5a16 100644 --- a/chrome/browser/ui/android/tab_model/tab_model_jni_bridge.cc +++ b/chrome/browser/ui/android/tab_model/tab_model_jni_bridge.cc
@@ -37,10 +37,13 @@ TabModelJniBridge::TabModelJniBridge(JNIEnv* env, jobject jobj, Profile* profile, - ActivityType activity_type) + ActivityType activity_type, + bool track_in_native_model_list) : TabModel(profile, activity_type), java_object_(env, env->NewWeakGlobalRef(jobj)) { - TabModelList::AddTabModel(this); + if (track_in_native_model_list) { + TabModelList::AddTabModel(this); + } } void TabModelJniBridge::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) { @@ -221,11 +224,14 @@ TabModelList::RemoveTabModel(this); } -static jlong JNI_TabModelJniBridge_Init(JNIEnv* env, - const JavaParamRef<jobject>& obj, - Profile* profile, - jint j_activity_type) { +static jlong JNI_TabModelJniBridge_Init( + JNIEnv* env, + const JavaParamRef<jobject>& obj, + Profile* profile, + jint j_activity_type, + unsigned char track_in_native_model_list) { TabModel* tab_model = new TabModelJniBridge( - env, obj, profile, static_cast<ActivityType>(j_activity_type)); + env, obj, profile, static_cast<ActivityType>(j_activity_type), + track_in_native_model_list); return reinterpret_cast<intptr_t>(tab_model); }
diff --git a/chrome/browser/ui/android/tab_model/tab_model_jni_bridge.h b/chrome/browser/ui/android/tab_model/tab_model_jni_bridge.h index 89694f7a..720a344 100644 --- a/chrome/browser/ui/android/tab_model/tab_model_jni_bridge.h +++ b/chrome/browser/ui/android/tab_model/tab_model_jni_bridge.h
@@ -28,7 +28,8 @@ TabModelJniBridge(JNIEnv* env, jobject obj, Profile* profile, - chrome::android::ActivityType activity_type); + chrome::android::ActivityType activity_type, + bool track_in_native_model_list); void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); TabModelJniBridge(const TabModelJniBridge&) = delete;
diff --git a/chrome/browser/ui/browser_command_controller_browsertest.cc b/chrome/browser/ui/browser_command_controller_browsertest.cc index 5fd212d..aace30a 100644 --- a/chrome/browser/ui/browser_command_controller_browsertest.cc +++ b/chrome/browser/ui/browser_command_controller_browsertest.cc
@@ -4,10 +4,11 @@ #include "chrome/browser/ui/browser_command_controller.h" +#include <string_view> + #include "base/command_line.h" #include "base/containers/contains.h" #include "base/run_loop.h" -#include "base/strings/string_piece.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "build/build_config.h" @@ -89,7 +90,7 @@ ~BrowserCommandControllerBrowserTestRefreshOnly() override = default; protected: - void LoadAndWaitForLanguage(base::StringPiece relative_url) { + void LoadAndWaitForLanguage(std::string_view relative_url) { ASSERT_TRUE(embedded_test_server()->Start()); GURL url = embedded_test_server()->GetURL(relative_url);
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc index cefb9f62..e2894e8 100644 --- a/chrome/browser/ui/browser_navigator.cc +++ b/chrome/browser/ui/browser_navigator.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include <memory> #include <string> +#include <string_view> #include <utility> #include "base/memory/raw_ptr.h" @@ -1000,7 +1001,7 @@ bool IsHostAllowedInIncognito(const GURL& url) { std::string scheme = url.scheme(); - base::StringPiece host = url.host_piece(); + std::string_view host = url.host_piece(); if (scheme != content::kChromeUIScheme) { return true; }
diff --git a/chrome/browser/ui/browser_window_state.cc b/chrome/browser/ui/browser_window_state.cc index fe95041..17746ab2 100644 --- a/chrome/browser/ui/browser_window_state.cc +++ b/chrome/browser/ui/browser_window_state.cc
@@ -6,11 +6,11 @@ #include <stddef.h> +#include <string_view> #include <utility> #include "base/command_line.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "build/chromeos_buildflags.h" #include "chrome/browser/buildflags.h" #include "chrome/browser/defaults.h" @@ -33,9 +33,9 @@ int* ret_num2) { const size_t comma = str.find(','); return (comma != std::string::npos) && - base::StringToInt(base::StringPiece(str.data(), comma), ret_num1) && + base::StringToInt(std::string_view(str.data(), comma), ret_num1) && base::StringToInt( - base::StringPiece(str.data() + comma + 1, str.size() - comma - 1), + std::string_view(str.data() + comma + 1, str.size() - comma - 1), ret_num2); }
diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc index 1155f6d..ae45acf 100644 --- a/chrome/browser/ui/chrome_pages.cc +++ b/chrome/browser/ui/chrome_pages.cc
@@ -7,6 +7,7 @@ #include <stddef.h> #include <memory> +#include <string_view> #include "ash/constants/ash_features.h" #include "ash/webui/shortcut_customization_ui/url_constants.h" @@ -571,7 +572,7 @@ ShowSettingsSubPage(browser, kSearchEnginesSubPage); } -void ShowWebStore(Browser* browser, const base::StringPiece& utm_source_value) { +void ShowWebStore(Browser* browser, std::string_view utm_source_value) { GURL webstore_url = extension_urls::GetWebstoreLaunchURL(); // TODO(crbug.com/40073814): Refactor this check into // extension_urls::GetWebstoreLaunchURL() and fix tests relying on it.
diff --git a/chrome/browser/ui/chrome_pages.h b/chrome/browser/ui/chrome_pages.h index 8b12528..64009f7 100644 --- a/chrome/browser/ui/chrome_pages.h +++ b/chrome/browser/ui/chrome_pages.h
@@ -8,6 +8,7 @@ #include <stdint.h> #include <string> +#include <string_view> #include "base/values.h" #include "build/branding_buildflags.h" @@ -221,7 +222,7 @@ void ShowImportDialog(Browser* browser); void ShowAboutChrome(Browser* browser); void ShowSearchEngineSettings(Browser* browser); -void ShowWebStore(Browser* browser, const base::StringPiece& utm_source_value); +void ShowWebStore(Browser* browser, std::string_view utm_source_value); void ShowPrivacySandboxSettings(Browser* browser); void ShowPrivacySandboxAdMeasurementSettings(Browser* browser); void ShowAddresses(Browser* browser);
diff --git a/chrome/browser/ui/cocoa/tab_menu_bridge_unittest.mm b/chrome/browser/ui/cocoa/tab_menu_bridge_unittest.mm index 6ec1beac..5ff0a388 100644 --- a/chrome/browser/ui/cocoa/tab_menu_bridge_unittest.mm +++ b/chrome/browser/ui/cocoa/tab_menu_bridge_unittest.mm
@@ -112,7 +112,7 @@ int index = ModelIndexForTabNamed(old_name); if (index >= 0) { std::unique_ptr<content::WebContents> old_contents = - model()->ReplaceWebContentsAt(index, CreateWebContents(new_name)); + model()->DiscardWebContentsAt(index, CreateWebContents(new_name)); // Let the old WebContents be destroyed here. } }
diff --git a/chrome/browser/ui/color/chrome_color_mixers.cc b/chrome/browser/ui/color/chrome_color_mixers.cc index 9490bbc..dbc6656 100644 --- a/chrome/browser/ui/color/chrome_color_mixers.cc +++ b/chrome/browser/ui/color/chrome_color_mixers.cc
@@ -5,11 +5,11 @@ #include "chrome/browser/ui/color/chrome_color_mixers.h" #include <memory> +#include <string_view> #include "base/containers/fixed_flat_map.h" #include "base/functional/bind.h" #include "base/no_destructor.h" -#include "base/strings/string_piece.h" #include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/browser/ui/color/chrome_color_mixer.h" #include "chrome/browser/ui/color/material_chrome_color_mixer.h" @@ -30,15 +30,14 @@ class ChromeColorProviderUtilsCallbacks : public ui::ColorProviderUtilsCallbacks { public: - bool ColorIdName(ui::ColorId color_id, - base::StringPiece* color_name) override; + bool ColorIdName(ui::ColorId color_id, std::string_view* color_name) override; }; #include "ui/color/color_id_map_macros.inc" bool ChromeColorProviderUtilsCallbacks::ColorIdName( ui::ColorId color_id, - base::StringPiece* color_name) { + std::string_view* color_name) { static constexpr const auto chrome_color_id_map = base::MakeFixedFlatMap<ui::ColorId, const char*>({CHROME_COLOR_IDS}); auto i = chrome_color_id_map.find(color_id);
diff --git a/chrome/browser/ui/color/material_chrome_color_mixer.cc b/chrome/browser/ui/color/material_chrome_color_mixer.cc index 99c2c6f..4e139d3 100644 --- a/chrome/browser/ui/color/material_chrome_color_mixer.cc +++ b/chrome/browser/ui/color/material_chrome_color_mixer.cc
@@ -24,7 +24,9 @@ kColorTabForegroundInactiveFrameActive}; if (key.custom_theme && key.custom_theme->HasCustomImage(IDR_THEME_TOOLBAR)) { - mixer[kColorAppMenuHighlightDefault] = {ui::kColorSysTonalContainer}; + mixer[kColorAppMenuHighlightDefault] = { + kColorToolbarBackgroundSubtleEmphasis}; + mixer[kColorAppMenuExpandedForegroundDefault] = {kColorToolbarButtonText}; } mixer[kColorAppMenuHighlightSeverityLow] = {kColorAppMenuHighlightDefault};
diff --git a/chrome/browser/ui/exclusive_access/exclusive_access_bubble.cc b/chrome/browser/ui/exclusive_access/exclusive_access_bubble.cc index 426c2363..aac2804 100644 --- a/chrome/browser/ui/exclusive_access/exclusive_access_bubble.cc +++ b/chrome/browser/ui/exclusive_access/exclusive_access_bubble.cc
@@ -4,59 +4,13 @@ #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble.h" -#include "base/feature_list.h" -#include "base/strings/utf_string_conversions.h" -#include "build/build_config.h" -#include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" -#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" -#include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" -#include "extensions/browser/extension_registry.h" -#include "third_party/blink/public/common/features_generated.h" -#include "ui/display/screen.h" -#include "ui/gfx/geometry/rect.h" - -// NOTE(koz): Linux doesn't use the thick shadowed border, so we add padding -// here. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -const int ExclusiveAccessBubble::kPaddingPx = 8; -#else -const int ExclusiveAccessBubble::kPaddingPx = 15; -#endif -const int ExclusiveAccessBubble::kInitialDelayMs = 3800; -const int ExclusiveAccessBubble::kIdleTimeMs = 2300; -const int ExclusiveAccessBubble::kSnoozeNotificationsTimeMs = 900000; // 15m. -const int ExclusiveAccessBubble::kPositionCheckHz = 10; -const int ExclusiveAccessBubble::kSlideInRegionHeightPx = 4; -const int ExclusiveAccessBubble::kPopupTopPx = 45; -const int ExclusiveAccessBubble::kSimplifiedPopupTopPx = 45; - ExclusiveAccessBubble::ExclusiveAccessBubble( - ExclusiveAccessManager* manager, const ExclusiveAccessBubbleParams& params) - : manager_(manager), - params_(params), - hide_timeout_( - FROM_HERE, - base::Milliseconds(kInitialDelayMs), - base::BindRepeating(&ExclusiveAccessBubble::CheckMousePointerPosition, - base::Unretained(this))), - idle_timeout_( - FROM_HERE, - base::Milliseconds(kIdleTimeMs), - base::BindRepeating(&ExclusiveAccessBubble::CheckMousePointerPosition, - base::Unretained(this))), - suppress_notify_timeout_( - FROM_HERE, - base::Milliseconds(kSnoozeNotificationsTimeMs), - base::BindRepeating(&ExclusiveAccessBubble::CheckMousePointerPosition, - base::Unretained(this))), - mouse_pointer_position_checker_( - FROM_HERE, - base::Milliseconds(1000 / kPositionCheckHz), - base::BindRepeating(&ExclusiveAccessBubble::CheckMousePointerPosition, - base::Unretained(this))) { + : params_(params), + hide_timeout_(FROM_HERE, + kShowTime, + base::BindRepeating(&ExclusiveAccessBubble::Hide, + base::Unretained(this))) { DCHECK(params.has_download || params.type != EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE); } @@ -64,82 +18,36 @@ ExclusiveAccessBubble::~ExclusiveAccessBubble() = default; void ExclusiveAccessBubble::OnUserInput() { - // We got some user input; reset the idle timer. - idle_timeout_.Reset(); - - // Re-show the exit bubble for cross-display fullscreen where no input was - // detected yet. - bool first_input_reshow = - reshow_on_first_input_ && !has_seen_user_input_ && - base::FeatureList::IsEnabled(blink::features::kFullscreenPopupWindows) && - params_.type == - ExclusiveAccessBubbleType:: - EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_EXIT_INSTRUCTION; - reshow_on_first_input_ = false; - has_seen_user_input_ = true; - - // If the notification suppression timer has elapsed, re-show it. - if (!suppress_notify_timeout_.IsRunning() || first_input_reshow) { + // Re-show the bubble if no user input occurred during the snooze period. + if (base::TimeTicks::Now() > snooze_until_) { ShowAndStartTimers(); return; } - // The timer has not elapsed, but the user provided some input. Reset the - // timer. (We only want to re-show the message after a period of inactivity.) - suppress_notify_timeout_.Reset(); + // Restart the snooze period; to only re-show after a period of inactivity. + snooze_until_ = base::TimeTicks::Now() + kSnoozeTime; } void ExclusiveAccessBubble::StartWatchingMousePointer() { - // Start the initial delay timer and begin watching the pointer. ShowAndStartTimers(); - mouse_pointer_position_checker_.Reset(); + legacy_is_watching_mouse_pointer_ = true; } void ExclusiveAccessBubble::StopWatchingMousePointer() { hide_timeout_.Stop(); - idle_timeout_.Stop(); - mouse_pointer_position_checker_.Stop(); + legacy_is_watching_mouse_pointer_ = false; } bool ExclusiveAccessBubble::IsWatchingMousePointer() const { - return mouse_pointer_position_checker_.IsRunning(); -} - -void ExclusiveAccessBubble::CheckMousePointerPosition() { - if (!hide_timeout_.IsRunning()) { - // If no input has been detected yet and the cursor is still on a different - // display than the bubble, set a flag to re-show the bubble once input is - // detected. - if (!has_seen_user_input_ && !reshow_on_first_input_ && - params_.type == - ExclusiveAccessBubbleType:: - EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_EXIT_INSTRUCTION) { - display::Screen* screen = display::Screen::GetScreen(); - reshow_on_first_input_ = - screen && - screen->GetDisplayNearestPoint(screen->GetCursorScreenPoint()) != - screen->GetDisplayNearestPoint(GetPopupRect().CenterPoint()); - } - Hide(); - } -} - -std::u16string ExclusiveAccessBubble::GetInstructionText( - const std::u16string& accelerator) const { - return exclusive_access_bubble::GetInstructionTextForType( - params_.type, accelerator, params_.has_download, notify_overridden_); -} - -bool ExclusiveAccessBubble::IsHideTimeoutRunning() const { - return hide_timeout_.IsRunning(); + return legacy_is_watching_mouse_pointer_; } void ExclusiveAccessBubble::ShowAndStartTimers() { Show(); - // Do not allow the notification to hide for a few seconds. + // Restart the timer to hide the bubble after a few seconds. hide_timeout_.Reset(); - // Do not show the notification again until a long time has elapsed. - suppress_notify_timeout_.Reset(); + // Restart the snooze period; to only re-show after a period of inactivity. + snooze_until_ = base::TimeTicks::Now() + kSnoozeTime; }
diff --git a/chrome/browser/ui/exclusive_access/exclusive_access_bubble.h b/chrome/browser/ui/exclusive_access/exclusive_access_bubble.h index 66f8a936..59fce28 100644 --- a/chrome/browser/ui/exclusive_access/exclusive_access_bubble.h +++ b/chrome/browser/ui/exclusive_access/exclusive_access_bubble.h
@@ -8,139 +8,55 @@ #include "base/memory/raw_ptr.h" #include "base/timer/timer.h" #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h" -#include "ui/gfx/animation/animation_delegate.h" -#include "ui/gfx/geometry/point.h" -#include "url/gurl.h" - -class ExclusiveAccessManager; - -namespace gfx { -class Rect; -} // Bubble that informs the user when an exclusive access state is in effect and -// as to how to exit out of the state. Currently there are three exclusive -// access states: fullscreen, keyboard lock, and pointer lock. -// -// Notification display design note: if the #simplified-fullscreen-ui flag is -// enabled, the bubble has the following behaviour: -// - The bubble is shown for kInitialDelayMs, then hides. -// - After a bubble has been shown, notifications are suppressed for -// kSnoozeNotificationsTimeMs, to avoid bothering the user. After this time -// has elapsed, the next user input re-displays the bubble. -class ExclusiveAccessBubble : public gfx::AnimationDelegate { +// how to exit out of the state. There are three exclusive access states: +// fullscreen, keyboard lock, and pointer lock. +// - The bubble is shown for kShowTime, then hides. +// - The bubble re-shows on user input after kSnoozeTime with no user input. +class ExclusiveAccessBubble { public: - ExclusiveAccessBubble(ExclusiveAccessManager* manager, - const ExclusiveAccessBubbleParams& params); + explicit ExclusiveAccessBubble(const ExclusiveAccessBubbleParams& params); ExclusiveAccessBubble(const ExclusiveAccessBubble&) = delete; ExclusiveAccessBubble& operator=(const ExclusiveAccessBubble&) = delete; - ~ExclusiveAccessBubble() override; + virtual ~ExclusiveAccessBubble(); - // Informs the ExclusiveAccessBubble of some user input, which may update - // internal timers and/or re-display the bubble. + // Called on user input to update timers and/or re-show the bubble. void OnUserInput(); + // Time the bubble is shown before hiding automatically. + static constexpr base::TimeDelta kShowTime = base::Milliseconds(3800); + // Time without user input that must elapse before the bubble is re-shown. + static constexpr base::TimeDelta kSnoozeTime = base::Minutes(15); + protected: - // Amount of padding around the link. - static const int kPaddingPx; - // Initial time bubble remains onscreen. - static const int kInitialDelayMs; - // Time before mouse pointer position idle triggers hide. - static const int kIdleTimeMs; - static const int kSnoozeNotificationsTimeMs; - // How fast to check the mouse pointer position. - static const int kPositionCheckHz; - // Height of region triggering slide-in. - static const int kSlideInRegionHeightPx; - // Space between the popup and the top of the screen (excluding shadow). - static const int kPopupTopPx; - // Space between top of screen and popup, in simplified UI. - static const int kSimplifiedPopupTopPx; - - // Returns the current desirable rect for the popup window in screen - // coordinates. - virtual gfx::Rect GetPopupRect() const = 0; - virtual gfx::Point GetCursorScreenPoint() = 0; - virtual bool WindowContainsPoint(gfx::Point pos) = 0; - - // Returns true if the window is active. - virtual bool IsWindowActive() = 0; - - // Hides the bubble. This is a separate function so it can be called by a - // timer. + // Hides the bubble. virtual void Hide() = 0; // Shows the bubble. virtual void Show() = 0; - virtual bool IsAnimating() = 0; - - // True if the mouse pointer position can trigger showing the exit fullscreen - // bubble when the bubble is hidden. - virtual bool CanTriggerOnMousePointer() const = 0; - void StartWatchingMousePointer(); void StopWatchingMousePointer(); bool IsWatchingMousePointer() const; - // Called repeatedly to get the current mouse pointer position and animate the - // bubble on or off the screen as appropriate. - void CheckMousePointerPosition(); - - // This string *may* contain the name of the key surrounded in pipe characters - // ('|'), which should be drawn graphically as a key, not displayed literally. - // |accelerator| is the name of the key to exit fullscreen mode. - std::u16string GetInstructionText(const std::u16string& accelerator) const; - - bool IsHideTimeoutRunning() const; - - // The Manager associated with this bubble. - const raw_ptr<ExclusiveAccessManager> manager_; + // Shows the bubble and sets up timers to auto-hide and snooze. + void ShowAndStartTimers(); // Cached content and traits for this bubble. ExclusiveAccessBubbleParams params_; - // The bubble should notify about overriding another ExclusiveAccessBubble - bool notify_overridden_ = false; + // Hides the bubble after it has been displayed for a short time. + base::RetainingOneShotTimer hide_timeout_; + + // Bubble re-shows on user input are suppressed until this time elapses. + base::TimeTicks snooze_until_; private: friend class ExclusiveAccessTest; - // Shows the bubble and sets up timers to auto-hide and prevent re-showing for - // a certain snooze time. - void ShowAndStartTimers(); - - // When this timer is active, prevent the bubble from hiding. This ensures it - // will be displayed for a minimum amount of time (which can be extended by - // the user moving the mouse pointer to the top of the screen and holding it - // there). - base::RetainingOneShotTimer hide_timeout_; - - // Timer to see how long the user has been idle (from all input sources). - base::RetainingOneShotTimer idle_timeout_; - - // When this timer has elapsed, on the next mouse pointer input, we will - // notify the user about any currently active exclusive access. This is used - // to enact both the initial debounce period, and the snooze period before - // re-notifying the user (see notification display design note above). - base::RetainingOneShotTimer suppress_notify_timeout_; - - // Timer to poll the current mouse pointer position. We can't just listen for - // mouse pointer events without putting a non-empty HWND onscreen (or hooking - // Windows, which has other problems), so instead we run a low-frequency - // poller to see if the user has moved in or out of our show/hide regions. - base::RepeatingTimer mouse_pointer_position_checker_; - - // The most recently seen mouse pointer position, in screen coordinates. Used - // to see if the mouse pointer has moved since our last check. Only used in - // non-simplified fullscreen mode. - gfx::Point last_mouse_pointer_pos_; - - // Indicates if the exit bubble should re-show once input is first detected. - bool reshow_on_first_input_ = false; - - // Tracks if any user input has been detected on the exclusive access context. - bool has_seen_user_input_ = false; + // TODO(msw): Remove this legacy signal used by ExclusiveAccessBubbleViews. + bool legacy_is_watching_mouse_pointer_ = false; }; #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_BUBBLE_H_
diff --git a/chrome/browser/ui/exclusive_access/exclusive_access_bubble_hide_callback.h b/chrome/browser/ui/exclusive_access/exclusive_access_bubble_hide_callback.h index 8f162f0..9ddcd8a 100644 --- a/chrome/browser/ui/exclusive_access/exclusive_access_bubble_hide_callback.h +++ b/chrome/browser/ui/exclusive_access/exclusive_access_bubble_hide_callback.h
@@ -11,21 +11,20 @@ // The bubble was never shown. e.g. // 1. View destroyed before the bubble could be shown. // 2. This is a request to dismiss bubble. e.g. - // a. |PointerLockController| sends request A to lock pointer, then - // b. |PLC| sends request B to unlock mouse pointer with NULL bubble type. - // Resulted callbacks: A <= |kInterrupted|, B <= |kNotShown|. + // a. `PointerLockController` sends request A to lock pointer, then + // b. `PLC` sends request B to unlock mouse pointer with NULL bubble type. + // Resulted callbacks: A <= `kInterrupted`, B <= `kNotShown`. kNotShown, - // The bubble hasn't been displayed for at least - // |ExclusiveAccessBubble::kInitialDelayMs|, and was dismissed due to user - // or script actions. e.g. + // The bubble wasn't shown for the full `ExclusiveAccessBubble::kShowTime`, + // and was dismissed due to user or script actions. e.g. // 1. User pressed ESC or switched to another window; - // 2. Script called |exitPointerLock()|, or triggered pointer lock and + // 2. Script called `exitPointerLock()`, or triggered pointer lock and // fullscreen at the same time. kInterrupted, - // The bubble has been displayed for at least - // |ExclusiveAccessBubble::kInitialDelayMs|, and was dismissed by the timer. + // The bubble was shown for the full `ExclusiveAccessBubble::kShowTime`, and + // was automatically dismissed by its timer. kTimeout, };
diff --git a/chrome/browser/ui/exclusive_access/exclusive_access_bubble_unittest.cc b/chrome/browser/ui/exclusive_access/exclusive_access_bubble_unittest.cc new file mode 100644 index 0000000..5b87012b --- /dev/null +++ b/chrome/browser/ui/exclusive_access/exclusive_access_bubble_unittest.cc
@@ -0,0 +1,65 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/exclusive_access/exclusive_access_bubble.h" + +#include "base/test/task_environment.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +class MockExclusiveAccessBubble : public ExclusiveAccessBubble { + public: + explicit MockExclusiveAccessBubble(ExclusiveAccessBubbleParams params) + : ExclusiveAccessBubble(params) {} + ~MockExclusiveAccessBubble() override = default; + MOCK_METHOD(void, Hide, (), (override)); + MOCK_METHOD(void, Show, (), (override)); + + using ExclusiveAccessBubble::hide_timeout_; + using ExclusiveAccessBubble::ShowAndStartTimers; + using ExclusiveAccessBubble::snooze_until_; +}; + +class ExclusiveAccessBubbleTest : public testing::Test { + public: + ExclusiveAccessBubbleTest() + : bubble_( + {.type = + EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_EXIT_INSTRUCTION}) {} + ~ExclusiveAccessBubbleTest() override = default; + MockExclusiveAccessBubble bubble_; + base::test::TaskEnvironment task_environment_{ + base::test::TaskEnvironment::TimeSource::MOCK_TIME}; +}; + +TEST_F(ExclusiveAccessBubbleTest, ShowAndStartTimers) { + EXPECT_FALSE(bubble_.hide_timeout_.IsRunning()); + EXPECT_TRUE(bubble_.snooze_until_.is_null()); + + EXPECT_CALL(bubble_, Show()).Times(1); + bubble_.ShowAndStartTimers(); + EXPECT_TRUE(bubble_.hide_timeout_.IsRunning()); + EXPECT_FALSE(bubble_.snooze_until_.is_null()); +} + +TEST_F(ExclusiveAccessBubbleTest, HideTimeout) { + EXPECT_CALL(bubble_, Show()).Times(1); + EXPECT_CALL(bubble_, Hide()).Times(1); + bubble_.ShowAndStartTimers(); + task_environment_.FastForwardBy(base::Seconds(5)); +} + +TEST_F(ExclusiveAccessBubbleTest, DoesNotReshowOnUserInputAfterHide) { + EXPECT_CALL(bubble_, Show()).Times(1); + bubble_.ShowAndStartTimers(); + task_environment_.FastForwardBy(base::Seconds(5)); + bubble_.OnUserInput(); +} + +TEST_F(ExclusiveAccessBubbleTest, DoesReshowOnUserInputAfterSnooze) { + EXPECT_CALL(bubble_, Show()).Times(2); + bubble_.ShowAndStartTimers(); + task_environment_.FastForwardBy(base::Minutes(16)); + bubble_.OnUserInput(); +}
diff --git a/chrome/browser/ui/exclusive_access/exclusive_access_test.cc b/chrome/browser/ui/exclusive_access/exclusive_access_test.cc index bf75a59..42f6747c 100644 --- a/chrome/browser/ui/exclusive_access/exclusive_access_test.cc +++ b/chrome/browser/ui/exclusive_access/exclusive_access_test.cc
@@ -284,10 +284,6 @@ ->last_user_escape_time_ = timestamp; } -int ExclusiveAccessTest::InitialBubbleDelayMs() const { - return ExclusiveAccessBubble::kInitialDelayMs; -} - void ExclusiveAccessTest::ExpectMockControllerReceivedEscape(int count) { EXPECT_EQ(count, mock_controller()->escape_pressed_count()); mock_controller()->reset_escape_pressed_count();
diff --git a/chrome/browser/ui/exclusive_access/exclusive_access_test.h b/chrome/browser/ui/exclusive_access/exclusive_access_test.h index 3dcb4d0..ac18075b 100644 --- a/chrome/browser/ui/exclusive_access/exclusive_access_test.h +++ b/chrome/browser/ui/exclusive_access/exclusive_access_test.h
@@ -104,8 +104,6 @@ void SetUserEscapeTimestampForTest(const base::TimeTicks timestamp); - int InitialBubbleDelayMs() const; - void ExpectMockControllerReceivedEscape(int count); MockExclusiveAccessController* mock_controller() {
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller_browsertest.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller_browsertest.cc index 0f1cb91d..06869d2a 100644 --- a/chrome/browser/ui/exclusive_access/fullscreen_controller_browsertest.cc +++ b/chrome/browser/ui/exclusive_access/fullscreen_controller_browsertest.cc
@@ -224,8 +224,8 @@ base::TestMockTimeTaskRunner::ScopedContext scoped_context(task_runner.get()); ASSERT_TRUE(RequestKeyboardLock(/*esc_key_locked=*/true)); - // Shorter than |ExclusiveAccessBubble::kInitialDelayMs|. - task_runner->FastForwardBy(base::Milliseconds(InitialBubbleDelayMs() / 2)); + // Shorter than `ExclusiveAccessBubble::kShowTime`. + task_runner->FastForwardBy(ExclusiveAccessBubble::kShowTime / 2); CancelKeyboardLock(); ASSERT_TRUE(RequestKeyboardLock(/*esc_key_locked=*/true)); ASSERT_TRUE(GetExclusiveAccessManager() @@ -241,8 +241,8 @@ base::TestMockTimeTaskRunner::ScopedContext scoped_context(task_runner.get()); ASSERT_TRUE(RequestKeyboardLock(/*esc_key_locked=*/true)); - // Longer than |ExclusiveAccessBubble::kInitialDelayMs|. - task_runner->FastForwardBy(base::Milliseconds(InitialBubbleDelayMs() + 20)); + // Longer than `ExclusiveAccessBubble::kShowTime`. + task_runner->FastForwardBy(ExclusiveAccessBubble::kShowTime * 2); CancelKeyboardLock(); ASSERT_TRUE(RequestKeyboardLock(/*esc_key_locked=*/true)); ASSERT_TRUE(GetExclusiveAccessManager()
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc index 50003130..44581e8 100644 --- a/chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc +++ b/chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc
@@ -519,7 +519,7 @@ content::WebContents::Create( content::WebContents::CreateParams(profile())); std::unique_ptr<content::WebContents> old_web_contents = - browser()->tab_strip_model()->ReplaceWebContentsAt( + browser()->tab_strip_model()->DiscardWebContentsAt( 0, std::move(new_web_contents)); ChangeWindowFullscreenState(); EXPECT_FALSE(browser()->window()->IsFullscreen());
diff --git a/chrome/browser/ui/exclusive_access/pointer_lock_controller_browsertest.cc b/chrome/browser/ui/exclusive_access/pointer_lock_controller_browsertest.cc index ecae46f..b61bdef 100644 --- a/chrome/browser/ui/exclusive_access/pointer_lock_controller_browsertest.cc +++ b/chrome/browser/ui/exclusive_access/pointer_lock_controller_browsertest.cc
@@ -103,8 +103,8 @@ EXPECT_EQ(0ul, pointer_lock_bubble_hide_reason_recorder_.size()); EXPECT_TRUE(task_runner->HasPendingTask()); - // Must fast forward at least |ExclusiveAccessBubble::kInitialDelayMs|. - task_runner->FastForwardBy(base::Milliseconds(InitialBubbleDelayMs() + 20)); + // Must fast forward at least `ExclusiveAccessBubble::kShowTime`. + task_runner->FastForwardBy(ExclusiveAccessBubble::kShowTime * 2); EXPECT_EQ(1ul, pointer_lock_bubble_hide_reason_recorder_.size()); EXPECT_EQ(ExclusiveAccessBubbleHideReason::kTimeout, pointer_lock_bubble_hide_reason_recorder_[0]); @@ -116,8 +116,8 @@ base::TestMockTimeTaskRunner::ScopedContext scoped_context(task_runner.get()); RequestToLockPointer(true, false); - // Shorter than |ExclusiveAccessBubble::kInitialDelayMs|. - task_runner->FastForwardBy(base::Milliseconds(InitialBubbleDelayMs() / 2)); + // Shorter than `ExclusiveAccessBubble::kShowTime`. + task_runner->FastForwardBy(ExclusiveAccessBubble::kShowTime / 2); LostPointerLock(); RequestToLockPointer(true, true); @@ -135,8 +135,8 @@ base::TestMockTimeTaskRunner::ScopedContext scoped_context(task_runner.get()); RequestToLockPointer(true, false); - // Longer than |ExclusiveAccessBubble::kInitialDelayMs|. - task_runner->FastForwardBy(base::Milliseconds(InitialBubbleDelayMs() + 20)); + // Longer than `ExclusiveAccessBubble::kShowTime`. + task_runner->FastForwardBy(ExclusiveAccessBubble::kShowTime * 2); LostPointerLock(); RequestToLockPointer(true, true);
diff --git a/chrome/browser/ui/find_bar/find_bar_host_interactive_uitest.cc b/chrome/browser/ui/find_bar/find_bar_host_interactive_uitest.cc index 24cc6c9..566cbd07 100644 --- a/chrome/browser/ui/find_bar/find_bar_host_interactive_uitest.cc +++ b/chrome/browser/ui/find_bar/find_bar_host_interactive_uitest.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string_view> + #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "chrome/browser/ui/browser.h" @@ -34,7 +36,7 @@ // Platform independent FindInPage that takes |const wchar_t*| // as an input. int FindInPageASCII(WebContents* web_contents, - const base::StringPiece& search_str, + std::string_view search_str, bool forward, bool case_sensitive, int* ordinal) {
diff --git a/chrome/browser/ui/lens/lens_overlay_controller.cc b/chrome/browser/ui/lens/lens_overlay_controller.cc index 3eafa47..aa0861f 100644 --- a/chrome/browser/ui/lens/lens_overlay_controller.cc +++ b/chrome/browser/ui/lens/lens_overlay_controller.cc
@@ -126,10 +126,8 @@ tab_subscriptions_.push_back(tab_->RegisterWillEnterBackground( base::BindRepeating(&LensOverlayController::TabWillEnterBackground, weak_factory_.GetWeakPtr()))); - tab_subscriptions_.push_back(tab_->RegisterDidAddContents(base::BindRepeating( - &LensOverlayController::DidAddContents, weak_factory_.GetWeakPtr()))); - tab_subscriptions_.push_back(tab_->RegisterWillRemoveContents( - base::BindRepeating(&LensOverlayController::WillRemoveContents, + tab_subscriptions_.push_back(tab_->RegisterWillDiscardContents( + base::BindRepeating(&LensOverlayController::WillDiscardContents, weak_factory_.GetWeakPtr()))); } @@ -682,15 +680,13 @@ CloseUI(); } -void LensOverlayController::WillRemoveContents(tabs::TabInterface* tab, - content::WebContents* contents) { - contents->RemoveUserData(LensOverlayControllerTabLookup::UserDataKey()); +void LensOverlayController::WillDiscardContents( + tabs::TabInterface* tab, + content::WebContents* old_contents, + content::WebContents* new_contents) { CloseUI(); -} - -void LensOverlayController::DidAddContents(tabs::TabInterface* tab, - content::WebContents* contents) { - LensOverlayControllerTabLookup::CreateForWebContents(contents, this); + old_contents->RemoveUserData(LensOverlayControllerTabLookup::UserDataKey()); + LensOverlayControllerTabLookup::CreateForWebContents(new_contents, this); } void LensOverlayController::CloseRequestedByOverlay() {
diff --git a/chrome/browser/ui/lens/lens_overlay_controller.h b/chrome/browser/ui/lens/lens_overlay_controller.h index b9f5eb9..191d091 100644 --- a/chrome/browser/ui/lens/lens_overlay_controller.h +++ b/chrome/browser/ui/lens/lens_overlay_controller.h
@@ -311,12 +311,10 @@ // Called when the associated tab will enter the background. void TabWillEnterBackground(tabs::TabInterface* tab); - // Called when the tab's WebContents are removed. - void WillRemoveContents(tabs::TabInterface* tab, - content::WebContents* contents); - - // Called when the tab's WebContents are added. - void DidAddContents(tabs::TabInterface* tab, content::WebContents* contents); + // Called when the tab's WebContents is discarded. + void WillDiscardContents(tabs::TabInterface* tab, + content::WebContents* old_contents, + content::WebContents* new_contents); // lens::mojom::LensPageHandler overrides. void CloseRequestedByOverlay() override;
diff --git a/chrome/browser/ui/location_bar/location_bar.h b/chrome/browser/ui/location_bar/location_bar.h index 8c0c62d..2a6cae9 100644 --- a/chrome/browser/ui/location_bar/location_bar.h +++ b/chrome/browser/ui/location_bar/location_bar.h
@@ -7,8 +7,9 @@ #include <stddef.h> +#include <string_view> + #include "base/memory/raw_ptr.h" -#include "base/strings/string_piece.h" #include "base/time/time.h" #include "ui/base/page_transition_types.h" #include "ui/base/window_open_disposition.h" @@ -39,7 +40,7 @@ base::TimeTicks match_selection_timestamp; bool url_typed_without_scheme; bool url_typed_with_http_scheme; - base::StringPiece extra_headers; + std::string_view extra_headers; }; explicit LocationBar(CommandUpdater* command_updater)
diff --git a/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc b/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc index c0dd07c..ece90c5 100644 --- a/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc +++ b/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -14,7 +15,6 @@ #include "base/files/scoped_temp_dir.h" #include "base/functional/bind.h" #include "base/run_loop.h" -#include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" #include "base/test/mock_callback.h" #include "build/build_config.h" @@ -465,7 +465,7 @@ }; struct TestCase { - base::StringPiece csv; + std::string_view csv; std::vector<FormDescription> descriptions; };
diff --git a/chrome/browser/ui/performance_controls/test_support/memory_saver_browser_test_mixin.h b/chrome/browser/ui/performance_controls/test_support/memory_saver_browser_test_mixin.h index 6e89116..b85d0015 100644 --- a/chrome/browser/ui/performance_controls/test_support/memory_saver_browser_test_mixin.h +++ b/chrome/browser/ui/performance_controls/test_support/memory_saver_browser_test_mixin.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UI_PERFORMANCE_CONTROLS_TEST_SUPPORT_MEMORY_SAVER_BROWSER_TEST_MIXIN_H_ #define CHROME_BROWSER_UI_PERFORMANCE_CONTROLS_TEST_SUPPORT_MEMORY_SAVER_BROWSER_TEST_MIXIN_H_ +#include <string_view> #include <type_traits> #include <vector> @@ -67,8 +68,8 @@ ->SetMemorySaverModeEnabled(enabled); } - GURL GetURL(base::StringPiece hostname = "example.com", - base::StringPiece path = "/title1.html") { + GURL GetURL(std::string_view hostname = "example.com", + std::string_view path = "/title1.html") { return T::embedded_test_server()->GetURL(hostname, path); }
diff --git a/chrome/browser/ui/quick_answers/quick_answers_controller_impl.cc b/chrome/browser/ui/quick_answers/quick_answers_controller_impl.cc index 10d1bc6..a9264ce 100644 --- a/chrome/browser/ui/quick_answers/quick_answers_controller_impl.cc +++ b/chrome/browser/ui/quick_answers/quick_answers_controller_impl.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/quick_answers/quick_answers_controller_impl.h" +#include "base/functional/bind.h" #include "base/metrics/histogram_functions.h" #include "base/time/time.h" #include "build/chromeos_buildflags.h" @@ -82,6 +83,52 @@ return gaia::IsGoogleInternalAccountEmail(email); } +class PerformOnConsentAccepted : public QuickAnswersStateObserver { + public: + explicit PerformOnConsentAccepted(base::OnceCallback<void()> action) + : action_(std::move(action)) { + CHECK(action_); + + // `QuickAnswersState::AddObserver` calls an added observer with a current + // value (or a pref value later if it's not initialized yet). + scoped_observation_.Observe(QuickAnswersState::Get()); + } + + // QuickAnswersStateObserver: + void OnSettingsEnabled(bool enabled) override { MaybeRun(); } + + void OnConsentStatusUpdated( + quick_answers::prefs::ConsentStatus consent_status) override { + MaybeRun(); + } + + private: + void MaybeRun() { + if (!action_) { + return; + } + + QuickAnswersState* quick_answers_state = QuickAnswersState::Get(); + CHECK(quick_answers_state->prefs_initialized()); + + bool settings_enabled = quick_answers_state->settings_enabled(); + quick_answers::prefs::ConsentStatus consent_status = + quick_answers_state->consent_status(); + + if (!settings_enabled || + consent_status != quick_answers::prefs::ConsentStatus::kAccepted) { + return; + } + + scoped_observation_.Reset(); + std::move(action_).Run(); + } + + base::ScopedObservation<QuickAnswersState, PerformOnConsentAccepted> + scoped_observation_{this}; + base::OnceCallback<void()> action_; +}; + } // namespace QuickAnswersControllerImpl::QuickAnswersControllerImpl( @@ -353,9 +400,19 @@ if (consented) { visibility_ = QuickAnswersVisibility::kPending; - // Display Quick-Answer for the cached query when user consent has - // been granted. - OnTextAvailable(anchor_bounds_, title_, context_.surrounding_text); + + // Preference value can be updated as an async operation. Wait the value + // change and then display quick answer for the cached query. There should + // be no need to reset `perform_on_consent_accepted_` as there is no case a + // user accepts a consent twice on a device. Toggling from OS settings will + // set value directly to `kAccepted` or `kRejected`. + CHECK(!perform_on_consent_accepted_) + << "There is already a pending action. A user should not accept a " + "consent twice or more."; + perform_on_consent_accepted_ = + std::make_unique<PerformOnConsentAccepted>(base::BindOnce( + &QuickAnswersControllerImpl::OnTextAvailable, GetWeakPtr(), + anchor_bounds_, title_, context_.surrounding_text)); } else { visibility_ = QuickAnswersVisibility::kClosed; }
diff --git a/chrome/browser/ui/quick_answers/quick_answers_controller_impl.h b/chrome/browser/ui/quick_answers/quick_answers_controller_impl.h index 7cb7611f..c81395e 100644 --- a/chrome/browser/ui/quick_answers/quick_answers_controller_impl.h +++ b/chrome/browser/ui/quick_answers/quick_answers_controller_impl.h
@@ -14,12 +14,12 @@ #include "chrome/browser/ui/chromeos/read_write_cards/read_write_cards_ui_controller.h" #include "chromeos/components/editor_menu/public/cpp/read_write_card_controller.h" #include "chromeos/components/quick_answers/public/cpp/controller/quick_answers_controller.h" +#include "chromeos/components/quick_answers/public/cpp/quick_answers_state.h" #include "chromeos/components/quick_answers/quick_answers_client.h" #include "chromeos/components/quick_answers/quick_answers_model.h" #include "ui/gfx/geometry/rect.h" class Profile; -class QuickAnswersState; class QuickAnswersUiController; // Implementation of QuickAnswerController. It fetches quick answers @@ -138,6 +138,10 @@ QuickAnswersVisibility visibility_ = QuickAnswersVisibility::kClosed; + // Use `std::unique_ptr` instead of `std::optional` as we can pass a class + // defined in an unnamed namespace. + std::unique_ptr<QuickAnswersStateObserver> perform_on_consent_accepted_; + base::WeakPtrFactory<QuickAnswersControllerImpl> weak_factory_{this}; };
diff --git a/chrome/browser/ui/quick_answers/ui/quick_answers_view.cc b/chrome/browser/ui/quick_answers/ui/quick_answers_view.cc index ac6b1303..51339d8e 100644 --- a/chrome/browser/ui/quick_answers/ui/quick_answers_view.cc +++ b/chrome/browser/ui/quick_answers/ui/quick_answers_view.cc
@@ -206,6 +206,20 @@ (is_internal ? ReportQueryView::kMaximumHeight : 0); } +// `MaybeASingleQuickAnswersTextLabel` returns a pointer of +// `QuickAnswersTextLabel` if `container` only contains a +// `QuickAnswersTextLabel`. Otherwise, this returns `nullptr`. +quick_answers::QuickAnswersTextLabel* MaybeASingleQuickAnswersTextLabel( + views::View* container) { + if (container->children().size() != 1) { + return nullptr; + } + + // `AsViewClass` returns `nullptr` if a view is not a specified class. + return views::AsViewClass<quick_answers::QuickAnswersTextLabel>( + container->children().front()); +} + } // namespace namespace quick_answers { @@ -324,7 +338,6 @@ } void QuickAnswersView::UpdateView(const QuickAnswer& quick_answer) { - has_second_row_answer_ = !quick_answer.second_answer_row.empty(); retry_label_ = nullptr; UpdateQuickAnswerResult(quick_answer); @@ -608,38 +621,23 @@ } // Add first row answer. - View* first_answer_view = nullptr; if (!quick_answer.first_answer_row.empty()) { - first_answer_view = AddHorizontalUiElements(content_view_.view(), - quick_answer.first_answer_row); - } - bool first_answer_is_single_label = - first_answer_view->children().size() == 1 && - std::string_view(first_answer_view->children().front()->GetClassName()) == - std::string_view( - quick_answers::QuickAnswersTextLabel::kViewClassName); - if (first_answer_is_single_label) { - // Update announcement. - auto* answer_label = - static_cast<Label*>(first_answer_view->children().front()); - GetViewAccessibility().SetDescription(l10n_util::GetStringFUTF8( - IDS_QUICK_ANSWERS_VIEW_A11Y_INFO_DESC_TEMPLATE_V2, - title_label->GetText(), answer_label->GetText())); - } + views::View* first_answer_row = AddHorizontalUiElements( + content_view_.view(), quick_answer.first_answer_row); - // Add second row answer. - if (!quick_answer.second_answer_row.empty()) { - AddHorizontalUiElements(content_view_.view(), - quick_answer.second_answer_row); - } else { - // If secondary-answer does not exist and primary-answer is a single label, - // allow that label to wrap through to the row intended for the former. - if (first_answer_is_single_label) { - // Cache multi-line label for resizing when view bounds change. - first_answer_label_ = static_cast<quick_answers::QuickAnswersTextLabel*>( - first_answer_view->children().front()); - first_answer_label_->SetMultiLine(true); - first_answer_label_->SetMaxLines(kMaxRows - /*exclude title*/ 1); + QuickAnswersTextLabel* quick_answers_text_label = + MaybeASingleQuickAnswersTextLabel(first_answer_row); + if (quick_answers_text_label) { + SetAccessibleDescription(l10n_util::GetStringFUTF16( + IDS_QUICK_ANSWERS_VIEW_A11Y_INFO_DESC_TEMPLATE_V2, + title_label->GetText(), quick_answers_text_label->GetText())); + + quick_answers_text_label->SetMultiLine(true); + // Max lines is kMaxRows-1. 1 is for the title row. + quick_answers_text_label->SetMaxLines(kMaxRows - 1); + + // TODO(b/331271987): Remove this caching and manual re-layout. + first_answer_label_ = quick_answers_text_label; UpdateBoundsForQuickAnswers(); } }
diff --git a/chrome/browser/ui/quick_answers/ui/quick_answers_view.h b/chrome/browser/ui/quick_answers/ui/quick_answers_view.h index c6646ac9..115cdf4a 100644 --- a/chrome/browser/ui/quick_answers/ui/quick_answers_view.h +++ b/chrome/browser/ui/quick_answers/ui/quick_answers_view.h
@@ -99,7 +99,6 @@ const quick_answers::PhoneticsInfo& phonetics_info); base::WeakPtr<QuickAnswersUiController> controller_; - bool has_second_row_answer_ = false; std::string title_; bool is_internal_ = false;
diff --git a/chrome/browser/ui/safety_hub/password_status_check_service_unittest.cc b/chrome/browser/ui/safety_hub/password_status_check_service_unittest.cc index ba91adc..fc121f09 100644 --- a/chrome/browser/ui/safety_hub/password_status_check_service_unittest.cc +++ b/chrome/browser/ui/safety_hub/password_status_check_service_unittest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/safety_hub/password_status_check_service.h" #include <string> +#include <string_view> #include "base/json/values_util.h" #include "base/location.h" @@ -92,8 +93,8 @@ raw_ptr<BulkLeakCheckService> leak_check_service_; }; -PasswordForm MakeForm(base::StringPiece16 username, - base::StringPiece16 password, +PasswordForm MakeForm(std::u16string_view username, + std::u16string_view password, std::string origin = kOrigin1, bool is_leaked = false) { PasswordForm form;
diff --git a/chrome/browser/ui/startup/bad_flags_prompt.cc b/chrome/browser/ui/startup/bad_flags_prompt.cc index 4e7e0b72..960e8a8 100644 --- a/chrome/browser/ui/startup/bad_flags_prompt.cc +++ b/chrome/browser/ui/startup/bad_flags_prompt.cc
@@ -6,6 +6,7 @@ #include <algorithm> #include <string> +#include <string_view> #include "base/base_switches.h" #include "base/command_line.h" @@ -209,7 +210,7 @@ void ShowBadFlagsInfoBarHelper(content::WebContents* web_contents, int message_id, - base::StringPiece flag) { + std::string_view flag) { // Animating the infobar also animates the content area size which can trigger // a flood of page layout, compositing, texture reallocations, etc. Do not // animate the infobar to reduce noise in perf benchmarks because they pass
diff --git a/chrome/browser/ui/startup/first_run_service_browsertest.cc b/chrome/browser/ui/startup/first_run_service_browsertest.cc index 28ac65f9..60b0756b 100644 --- a/chrome/browser/ui/startup/first_run_service_browsertest.cc +++ b/chrome/browser/ui/startup/first_run_service_browsertest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/startup/first_run_service.h" #include <optional> +#include <string_view> #include "base/command_line.h" #include "base/feature_list.h" @@ -97,7 +98,7 @@ }; // Converts JSON string to `base::Value` object. -static base::Value GetJSONAsValue(base::StringPiece json) { +static base::Value GetJSONAsValue(std::string_view json) { std::string error; auto value = JSONStringValueDeserializer(json).Deserialize(nullptr, &error); EXPECT_EQ("", error);
diff --git a/chrome/browser/ui/startup/launch_mode_recorder.cc b/chrome/browser/ui/startup/launch_mode_recorder.cc index 7cd4027..3524592a 100644 --- a/chrome/browser/ui/startup/launch_mode_recorder.cc +++ b/chrome/browser/ui/startup/launch_mode_recorder.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/startup/launch_mode_recorder.h" #include <string> +#include <string_view> #include <utility> #include <vector> @@ -75,8 +76,9 @@ base::i18n::ToLower(base::WideToUTF16(shortcut_path.value()))); // The windows quick launch path is not localized. - if (shortcut.find(u"\\quick launch\\") != base::StringPiece16::npos) + if (shortcut.find(u"\\quick launch\\") != std::u16string_view::npos) { return OldLaunchMode::kShortcutTaskbar; + } // Check the common shortcut locations. static constexpr struct { @@ -186,8 +188,9 @@ // The windows quick launch path is not localized. const std::u16string shortcut( base::i18n::ToLower(base::AsStringPiece16(shortcut_path))); - if (shortcut.find(u"\\quick launch\\") != base::StringPiece16::npos) + if (shortcut.find(u"\\quick launch\\") != std::u16string_view::npos) { return base::DIR_TASKBAR_PINS; + } // Check the common shortcut locations. constexpr int kPathKeys[] = {base::DIR_COMMON_START_MENU,
diff --git a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc index 443c59e2..a12f1d1 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
@@ -9,6 +9,7 @@ #include <algorithm> #include <memory> #include <string> +#include <string_view> #include "base/base_switches.h" #include "base/command_line.h" @@ -2032,7 +2033,7 @@ } void SetUpInProcessBrowserTestFixture() override { - base::StringPiece test_name = + std::string_view test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); if (base::StartsWith(test_name, "PRE_")) { @@ -2047,7 +2048,7 @@ } void OnBrowserAdded(Browser* browser) override { - base::StringPiece test_name = + std::string_view test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); // The non PRE_ test will start up as if it was restarted.
diff --git a/chrome/browser/ui/startup/startup_tab_provider.cc b/chrome/browser/ui/startup/startup_tab_provider.cc index ba6c7dc..f0875670 100644 --- a/chrome/browser/ui/startup/startup_tab_provider.cc +++ b/chrome/browser/ui/startup/startup_tab_provider.cc
@@ -5,12 +5,12 @@ #include "chrome/browser/ui/startup/startup_tab_provider.h" #include <string> +#include <string_view> #include "base/command_line.h" #include "base/feature_list.h" #include "base/files/file_path.h" #include "base/ranges/algorithm.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/threading/thread_restrictions.h" #include "build/branding_buildflags.h"
diff --git a/chrome/browser/ui/startup/web_app_info_recorder_utils.cc b/chrome/browser/ui/startup/web_app_info_recorder_utils.cc index 9f5c40c9..9e80187 100644 --- a/chrome/browser/ui/startup/web_app_info_recorder_utils.cc +++ b/chrome/browser/ui/startup/web_app_info_recorder_utils.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -18,7 +19,6 @@ #include "base/json/json_string_value_serializer.h" #include "base/location.h" #include "base/memory/raw_ptr.h" -#include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" #include "base/task/task_traits.h" #include "base/task/thread_pool.h" @@ -130,7 +130,7 @@ base::TaskShutdownBehavior::BLOCK_SHUTDOWN}, base::BindOnce( base::IgnoreResult(&base::ImportantFileWriter::WriteFileAtomically), - output_file_, std::move(output_info_str), base::StringPiece())); + output_file_, std::move(output_info_str), std::string_view())); } }
diff --git a/chrome/browser/ui/tabs/organization/tab_organization_unittest.cc b/chrome/browser/ui/tabs/organization/tab_organization_unittest.cc index 1f3399ee..42770e89 100644 --- a/chrome/browser/ui/tabs/organization/tab_organization_unittest.cc +++ b/chrome/browser/ui/tabs/organization/tab_organization_unittest.cc
@@ -245,7 +245,7 @@ std::unique_ptr<content::WebContents> new_contents = CreateWebContents(); content::WebContents* new_contents_ptr = new_contents.get(); EXPECT_EQ(tab_data->web_contents(), old_contents); - tab_strip_model()->ReplaceWebContentsAt( + tab_strip_model()->DiscardWebContentsAt( tab_strip_model()->GetIndexOfWebContents(old_contents), std::move(new_contents)); EXPECT_EQ(tab_data->web_contents(), new_contents_ptr); @@ -331,7 +331,7 @@ // replace the contents which should result in an update call. std::unique_ptr<content::WebContents> new_contents = CreateWebContents(); content::WebContents* new_contents_ptr = new_contents.get(); - tab_strip_model()->ReplaceWebContentsAt( + tab_strip_model()->DiscardWebContentsAt( tab_strip_model()->GetIndexOfWebContents(old_contents), std::move(new_contents)); EXPECT_EQ(observer.update_call_count, 1);
diff --git a/chrome/browser/ui/tabs/public/tab_interface.h b/chrome/browser/ui/tabs/public/tab_interface.h index 5fbcb24..dfa319f9 100644 --- a/chrome/browser/ui/tabs/public/tab_interface.h +++ b/chrome/browser/ui/tabs/public/tab_interface.h
@@ -40,16 +40,13 @@ // WebContents. virtual content::WebContents* GetContents() const = 0; - // Register for these two callbacks to detect changes to GetContents(). - using DidAddContentsCallback = - base::RepeatingCallback<void(TabInterface*, content::WebContents*)>; - virtual base::CallbackListSubscription RegisterDidAddContents( - DidAddContentsCallback callback) = 0; - - using WillRemoveContentsCallback = - base::RepeatingCallback<void(TabInterface*, content::WebContents*)>; - virtual base::CallbackListSubscription RegisterWillRemoveContents( - WillRemoveContentsCallback callback) = 0; + // Register for this callback to detect changes to GetContents(). The first + // WebContents is the contents that will be discarded. The second WebContents + // is the new contents. The tab is guaranteed to be in the background. + using WillDiscardContentsCallback = base::RepeatingCallback< + void(TabInterface*, content::WebContents*, content::WebContents*)>; + virtual base::CallbackListSubscription RegisterWillDiscardContents( + WillDiscardContentsCallback callback) = 0; // Whether the tab is in the foreground. When a tab is in the foreground, this // class guarantees that GetContents() will return a non-nullptr WebContents,
diff --git a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service_unittest.cc b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service_unittest.cc index 568f0ce9..441683a 100644 --- a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service_unittest.cc +++ b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service_unittest.cc
@@ -930,7 +930,7 @@ std::unique_ptr<content::WebContents> replacement_web_contents = content::WebContentsTester::CreateTestWebContents(profile(), nullptr); - browser->tab_strip_model()->ReplaceWebContentsAt( + browser->tab_strip_model()->DiscardWebContentsAt( 0, std::move(replacement_web_contents)); // Expect after moving the first tab to the right of the second, that the
diff --git a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.cc b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.cc index aecb23e..9cde900 100644 --- a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.cc +++ b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.cc
@@ -39,6 +39,7 @@ kMoveGroupToNewWindowMenuItem); DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(SavedTabGroupUtils, kToggleGroupPinStateMenuItem); +DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(SavedTabGroupUtils, kTabsTitleItem); void SavedTabGroupUtils::OpenUrlToBrowser(Browser* browser, const GURL& url, @@ -181,6 +182,11 @@ ui::DialogModelMenuItem::Params().SetId(kDeleteGroupMenuItem)) .AddSeparator(); + if (tab_groups::IsTabGroupsSaveUIUpdateEnabled()) { + dialog_model.AddTitleItem(l10n_util::GetStringUTF16(IDS_TABS_TITLE_CXMENU), + kTabsTitleItem); + } + for (const SavedTabGroupTab& tab : saved_group->saved_tabs()) { const ui::ImageModel& image = tab.favicon().has_value()
diff --git a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h index 3d8036e6..498f1bf 100644 --- a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h +++ b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h
@@ -33,6 +33,7 @@ DECLARE_CLASS_ELEMENT_IDENTIFIER_VALUE(kDeleteGroupMenuItem); DECLARE_CLASS_ELEMENT_IDENTIFIER_VALUE(kMoveGroupToNewWindowMenuItem); DECLARE_CLASS_ELEMENT_IDENTIFIER_VALUE(kToggleGroupPinStateMenuItem); + DECLARE_CLASS_ELEMENT_IDENTIFIER_VALUE(kTabsTitleItem); SavedTabGroupUtils() = delete; SavedTabGroupUtils(const SavedTabGroupUtils&) = delete;
diff --git a/chrome/browser/ui/tabs/tab_model.cc b/chrome/browser/ui/tabs/tab_model.cc index 4f5de3b..155e590 100644 --- a/chrome/browser/ui/tabs/tab_model.cc +++ b/chrome/browser/ui/tabs/tab_model.cc
@@ -85,14 +85,9 @@ return contents(); } -base::CallbackListSubscription TabModel::RegisterDidAddContents( - TabInterface::DidAddContentsCallback callback) { - return did_add_contents_callback_list_.Add(std::move(callback)); -} - -base::CallbackListSubscription TabModel::RegisterWillRemoveContents( - TabInterface::WillRemoveContentsCallback callback) { - return will_remove_contents_callback_list_.Add(std::move(callback)); +base::CallbackListSubscription TabModel::RegisterWillDiscardContents( + TabInterface::WillDiscardContentsCallback callback) { + return will_discard_contents_callback_list_.Add(std::move(callback)); } bool TabModel::IsInForeground() const { @@ -156,22 +151,16 @@ dict.Add("blocked", blocked()); } -std::unique_ptr<content::WebContents> TabModel::ReplaceContents( +std::unique_ptr<content::WebContents> TabModel::DiscardContents( std::unique_ptr<content::WebContents> contents) { - // We do not call will_enter_background_callback_list_ because it is - // guaranteed that if a tab is being discarded, it is already in the - // background. - std::unique_ptr<content::WebContents> old_contents = RemoveContents(); - SetContents(std::move(contents)); + will_discard_contents_callback_list_.Notify(this, contents_, contents.get()); + std::unique_ptr<content::WebContents> old_contents = + std::move(contents_owned_); + contents_owned_ = std::move(contents); + contents_ = contents_owned_.get(); return old_contents; } -std::unique_ptr<content::WebContents> TabModel::RemoveContents() { - will_remove_contents_callback_list_.Notify(this, contents_.get()); - contents_ = nullptr; - return std::move(contents_owned_); -} - // static std::unique_ptr<content::WebContents> TabModel::DestroyAndTakeWebContents( std::unique_ptr<TabModel> tab_model) { @@ -180,12 +169,4 @@ return contents; } -void TabModel::SetContents(std::unique_ptr<content::WebContents> contents) { - CHECK(!contents_); - CHECK(contents); - contents_owned_ = std::move(contents); - contents_ = contents_owned_.get(); - did_add_contents_callback_list_.Notify(this, contents_.get()); -} - } // namespace tabs
diff --git a/chrome/browser/ui/tabs/tab_model.h b/chrome/browser/ui/tabs/tab_model.h index 424ac446..a1bcefe 100644 --- a/chrome/browser/ui/tabs/tab_model.h +++ b/chrome/browser/ui/tabs/tab_model.h
@@ -61,11 +61,9 @@ void WriteIntoTrace(perfetto::TracedValue context) const; - // https://crbug.com/331022416: Do not use this method. The signature of this - // method suggests that it's possible to replace the WebContents that - // represents a live, foregrounded tab with a different WebContents. This is - // never the case. - std::unique_ptr<content::WebContents> ReplaceContents( + // https://crbug.com/331022416: Do not use this method. This is only used by + // tab discard, which is being refactored to not need this. + std::unique_ptr<content::WebContents> DiscardContents( std::unique_ptr<content::WebContents> contents); // This destroys the TabModel and takes ownership of the underlying @@ -73,9 +71,6 @@ static std::unique_ptr<content::WebContents> DestroyAndTakeWebContents( std::unique_ptr<TabModel> tab_model); - // The current contents of the tab must be |nullptr|. - void SetContents(std::unique_ptr<content::WebContents> contents); - TabFeatures* tab_features() { return tab_features_.get(); } // Returns a pointer to the parent TabCollection. This method is specifically @@ -102,10 +97,8 @@ // TabInterface overrides: content::WebContents* GetContents() const override; - base::CallbackListSubscription RegisterDidAddContents( - TabInterface::DidAddContentsCallback callback) override; - base::CallbackListSubscription RegisterWillRemoveContents( - TabInterface::WillRemoveContentsCallback callback) override; + base::CallbackListSubscription RegisterWillDiscardContents( + TabInterface::WillDiscardContentsCallback callback) override; bool IsInForeground() const override; base::CallbackListSubscription RegisterDidEnterForeground( TabInterface::DidEnterForegroundCallback callback) override; @@ -117,8 +110,6 @@ BrowserWindowInterface* GetBrowserWindowInterface() override; private: - std::unique_ptr<content::WebContents> RemoveContents(); - // Overridden from TabStripModelObserver: void OnTabStripModelChanged( TabStripModel* tab_strip_model, @@ -155,13 +146,9 @@ std::optional<tab_groups::TabGroupId> group_ = std::nullopt; raw_ptr<TabCollection> parent_collection_ = nullptr; - using DidAddContentsCallbackList = - base::RepeatingCallbackList<void(TabInterface*, content::WebContents*)>; - DidAddContentsCallbackList did_add_contents_callback_list_; - - using WillRemoveContentsCallbackList = - base::RepeatingCallbackList<void(TabInterface*, content::WebContents*)>; - WillRemoveContentsCallbackList will_remove_contents_callback_list_; + using WillDiscardContentsCallbackList = base::RepeatingCallbackList< + void(TabInterface*, content::WebContents*, content::WebContents*)>; + WillDiscardContentsCallbackList will_discard_contents_callback_list_; using DidEnterForegroundCallbackList = base::RepeatingCallbackList<void(TabInterface*)>;
diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc index 25dc4b0..cefcc72a 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.cc +++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -428,7 +428,7 @@ return InsertTabAtImpl(index, std::move(tab), add_types, group); } -std::unique_ptr<content::WebContents> TabStripModel::ReplaceWebContentsAt( +std::unique_ptr<content::WebContents> TabStripModel::DiscardWebContentsAt( int index, std::unique_ptr<WebContents> new_contents) { ReentrancyCheck reentrancy_check(&reentrancy_guard_); @@ -442,7 +442,7 @@ TabStripSelectionChange selection(GetActiveWebContents(), selection_model_); WebContents* raw_new_contents = new_contents.get(); std::unique_ptr<WebContents> old_contents = - GetTabAtIndex(index)->ReplaceContents(std::move(new_contents)); + GetTabAtIndex(index)->DiscardContents(std::move(new_contents)); // When the active WebContents is replaced send out a selection notification // too. We do this as nearly all observers need to treat a replacement of the @@ -539,7 +539,7 @@ DetermineNewSelectedIndex(index_at_time_of_removal); UngroupTab(index_at_time_of_removal, - GetTabGroupForTab(index_before_any_removals)); + GetTabGroupForTab(index_at_time_of_removal)); std::unique_ptr<tabs::TabModel> old_data; if (IsContentsDataVector()) {
diff --git a/chrome/browser/ui/tabs/tab_strip_model.h b/chrome/browser/ui/tabs/tab_strip_model.h index 1088c3c..a521bbb 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.h +++ b/chrome/browser/ui/tabs/tab_strip_model.h
@@ -254,10 +254,10 @@ // |close_types| is a bitmask of CloseTypes. void CloseWebContentsAt(int index, uint32_t close_types); - // Replaces the WebContents at |index| with |new_contents|. The - // WebContents that was at |index| is returned and its ownership returns + // Discards the WebContents at |index| and replaces it with |new_contents|. + // The WebContents that was at |index| is returned and its ownership returns // to the caller. - std::unique_ptr<content::WebContents> ReplaceWebContentsAt( + std::unique_ptr<content::WebContents> DiscardWebContentsAt( int index, std::unique_ptr<content::WebContents> new_contents);
diff --git a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc index bc490ed..0953aac 100644 --- a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
@@ -11,6 +11,7 @@ #include <memory> #include <optional> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -460,7 +461,7 @@ model->SetTabPinned(i, true); ui::ListSelectionModel selection_model; - for (const base::StringPiece& sel : base::SplitStringPiece( + for (std::string_view sel : base::SplitStringPiece( selected_tabs, base::kWhitespaceASCII, base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) { int value; @@ -2653,7 +2654,7 @@ std::unique_ptr<WebContents> new_contents = CreateWebContents(); WebContents* raw_new_contents = new_contents.get(); - strip.ReplaceWebContentsAt(0, std::move(new_contents)); + strip.DiscardWebContentsAt(0, std::move(new_contents)); ASSERT_EQ(2, observer.GetStateCount()); @@ -2680,7 +2681,7 @@ // And replace it. new_contents = CreateWebContents(); raw_new_contents = new_contents.get(); - strip.ReplaceWebContentsAt(1, std::move(new_contents)); + strip.DiscardWebContentsAt(1, std::move(new_contents)); ASSERT_EQ(1, observer.GetStateCount()); @@ -4602,7 +4603,7 @@ // Replace the WebContents at index 0 with a new WebContents. std::unique_ptr<WebContents> replaced_contents = - strip.ReplaceWebContentsAt(0, CreateWebContentsWithID(5)); + strip.DiscardWebContentsAt(0, CreateWebContentsWithID(5)); EXPECT_EQ(contents_2, replaced_contents.get()); replaced_contents.reset(); EXPECT_EQ("5 0", GetTabStripStateString(strip));
diff --git a/chrome/browser/ui/test/test_app_window_icon_observer.cc b/chrome/browser/ui/test/test_app_window_icon_observer.cc index 1738c86e..4caf78a 100644 --- a/chrome/browser/ui/test/test_app_window_icon_observer.cc +++ b/chrome/browser/ui/test/test_app_window_icon_observer.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/test/test_app_window_icon_observer.h" +#include <string_view> #include <utility> #include "base/hash/md5.h" @@ -88,8 +89,8 @@ for (int y = 0; y < bitmap->height(); ++y) { base::MD5Update( &ctx, - base::StringPiece( - reinterpret_cast<const char*>(bitmap->getAddr(0, y)), row_width)); + std::string_view(reinterpret_cast<const char*>(bitmap->getAddr(0, y)), + row_width)); } base::MD5Digest digest; base::MD5Final(&digest, &ctx);
diff --git a/chrome/browser/ui/url_identity_unittest.cc b/chrome/browser/ui/url_identity_unittest.cc index 5a400a0c..210d22a2 100644 --- a/chrome/browser/ui/url_identity_unittest.cc +++ b/chrome/browser/ui/url_identity_unittest.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ui/url_identity.h" +#include <string_view> + #include "chrome/test/base/testing_profile.h" #include "content/public/test/browser_task_environment.h" #include "extensions/buildflags/buildflags.h" @@ -36,11 +38,11 @@ UrlIdentity expected_result; }; -constexpr base::StringPiece kTestIsolatedWebAppUrl = +constexpr std::string_view kTestIsolatedWebAppUrl = "isolated-app://" "berugqztij5biqquuk3mfwpsaibuegaqcitgfchwuosuofdjabzqaaic"; -constexpr base::StringPiece kTestIsolatedWebAppName = "Test IWA Name"; -constexpr base::StringPiece kTestExtensionId = +constexpr std::string_view kTestIsolatedWebAppName = "Test IWA Name"; +constexpr std::string_view kTestExtensionId = "0264075e-fd33-4a20-8484-b834afb0333d"; } // namespace
diff --git a/chrome/browser/ui/views/autofill/payments/save_card_bubble_views_browsertest.cc b/chrome/browser/ui/views/autofill/payments/save_card_bubble_views_browsertest.cc index a7d4e6b9..c27b5c6e 100644 --- a/chrome/browser/ui/views/autofill/payments/save_card_bubble_views_browsertest.cc +++ b/chrome/browser/ui/views/autofill/payments/save_card_bubble_views_browsertest.cc
@@ -1733,7 +1733,7 @@ // Tests the upload save bubble. Ensures that the bubble does not surface the // expiration date dropdowns if it is not needed. // TODO(crbug.com/1455908): FindViewInBubbleById() hits CHECK. -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_MAC) #define MAYBE_Upload_ShouldNotRequestExpirationDateInHappyPath \ DISABLED_Upload_ShouldNotRequestExpirationDateInHappyPath #else
diff --git a/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_interactive_uitest.cc b/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_interactive_uitest.cc index 7ad8109..d99d15db 100644 --- a/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_interactive_uitest.cc +++ b/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_interactive_uitest.cc
@@ -357,9 +357,10 @@ AsView<views::View>(el)->GetBoundsInScreen().CenterPoint()); event_generator.ClickRightButton(); }), - WaitForShow(SavedTabGroupUtils::kDeleteGroupMenuItem), + WaitForShow(SavedTabGroupUtils::kMoveGroupToNewWindowMenuItem), WaitForShow(SavedTabGroupUtils::kToggleGroupPinStateMenuItem), - WaitForShow(SavedTabGroupUtils::kMoveGroupToNewWindowMenuItem)); + WaitForShow(SavedTabGroupUtils::kDeleteGroupMenuItem), + WaitForShow(SavedTabGroupUtils::kTabsTitleItem)); } // TODO(crbug.com/333956456): Resolve before enabling. @@ -391,8 +392,10 @@ SelectMenuItem(AppMenuModel::kTabGroupsMenuItem), WaitForShow(STGEverythingMenu::kTabGroup), MoveMouseTo(STGEverythingMenu::kTabGroup), ClickMouse(ui_controls::RIGHT), + WaitForShow(SavedTabGroupUtils::kMoveGroupToNewWindowMenuItem), + EnsureNotPresent(SavedTabGroupUtils::kToggleGroupPinStateMenuItem), WaitForShow(SavedTabGroupUtils::kDeleteGroupMenuItem), - WaitForShow(SavedTabGroupUtils::kMoveGroupToNewWindowMenuItem)); + WaitForShow(SavedTabGroupUtils::kTabsTitleItem)); } // TODO(crbug.com/40934084): Deflake this test before enabling
diff --git a/chrome/browser/ui/views/chrome_views_delegate_fuchsia.cc b/chrome/browser/ui/views/chrome_views_delegate_fuchsia.cc deleted file mode 100644 index 473642ca..0000000 --- a/chrome/browser/ui/views/chrome_views_delegate_fuchsia.cc +++ /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. - -#include "chrome/browser/ui/views/chrome_views_delegate.h" - -#include "chrome/browser/ui/views/native_widget_factory.h" - -views::NativeWidget* ChromeViewsDelegate::CreateNativeWidget( - views::Widget::InitParams* params, - views::internal::NativeWidgetDelegate* delegate) { - DCHECK(!params->native_widget); - if (params->parent || params->context) { - // TODO(crbug.com/1234748): Until Fuchsia supports sub-window/placement - // APIs, have chrome render everything it can inside a single OS view. - return ::CreateNativeWidget(NativeWidgetType::NATIVE_WIDGET_AURA, params, - delegate); - } - // When no context is given, render as a top level desktop window. - return ::CreateNativeWidget(NativeWidgetType::DESKTOP_NATIVE_WIDGET_AURA, - params, delegate); -}
diff --git a/chrome/browser/ui/views/controls/hover_button.cc b/chrome/browser/ui/views/controls/hover_button.cc index 703cacb..001185d 100644 --- a/chrome/browser/ui/views/controls/hover_button.cc +++ b/chrome/browser/ui/views/controls/hover_button.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/controls/hover_button.h" #include <algorithm> +#include <string_view> #include "base/functional/bind.h" #include "base/memory/raw_ptr.h" @@ -302,7 +303,7 @@ } void HoverButton::UpdateTooltipAndAccessibleName() { - std::vector<base::StringPiece16> texts = {title_->GetText()}; + std::vector<std::u16string_view> texts = {title_->GetText()}; if (subtitle_) { texts.push_back(subtitle_->GetText()); }
diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_partial_view.cc b/chrome/browser/ui/views/download/bubble/download_bubble_partial_view.cc index 269ae06..a76ebb44 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_partial_view.cc +++ b/chrome/browser/ui/views/download/bubble/download_bubble_partial_view.cc
@@ -252,7 +252,7 @@ LogVisibleTimeMetrics(); } -base::StringPiece DownloadBubblePartialView::GetVisibleTimeHistogramName() +std::string_view DownloadBubblePartialView::GetVisibleTimeHistogramName() const { return kPartialBubbleVisibleHistogramName; }
diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_partial_view.h b/chrome/browser/ui/views/download/bubble/download_bubble_partial_view.h index dc65aaa..45b0bfc 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_partial_view.h +++ b/chrome/browser/ui/views/download/bubble/download_bubble_partial_view.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_DOWNLOAD_BUBBLE_DOWNLOAD_BUBBLE_PARTIAL_VIEW_H_ #include <optional> +#include <string_view> #include "base/functional/callback_forward.h" #include "chrome/browser/download/download_ui_model.h" @@ -37,7 +38,7 @@ ~DownloadBubblePartialView() override; // DownloadBubblePrimaryView: - base::StringPiece GetVisibleTimeHistogramName() const override; + std::string_view GetVisibleTimeHistogramName() const override; void AddedToWidget() override; void RemovedFromWidget() override; void OnMouseEntered(const ui::MouseEvent& event) override;
diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_primary_view.cc b/chrome/browser/ui/views/download/bubble/download_bubble_primary_view.cc index b301a61..74b58810 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_primary_view.cc +++ b/chrome/browser/ui/views/download/bubble/download_bubble_primary_view.cc
@@ -4,8 +4,9 @@ #include "chrome/browser/ui/views/download/bubble/download_bubble_primary_view.h" +#include <string_view> + #include "base/metrics/histogram_functions.h" -#include "base/strings/string_piece.h" #include "base/time/time.h" #include "chrome/browser/download/bubble/download_bubble_prefs.h" #include "chrome/browser/profiles/profile.h" @@ -54,7 +55,7 @@ DownloadBubblePrimaryView::~DownloadBubblePrimaryView() = default; void DownloadBubblePrimaryView::LogVisibleTimeMetrics() const { - base::StringPiece histogram_name = GetVisibleTimeHistogramName(); + std::string_view histogram_name = GetVisibleTimeHistogramName(); if (!histogram_name.empty()) { base::UmaHistogramMediumTimes(std::string(histogram_name), base::Time::Now() - creation_time_);
diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_primary_view.h b/chrome/browser/ui/views/download/bubble/download_bubble_primary_view.h index 58918e2..8b50ed1 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_primary_view.h +++ b/chrome/browser/ui/views/download/bubble/download_bubble_primary_view.h
@@ -5,8 +5,9 @@ #ifndef CHROME_BROWSER_UI_VIEWS_DOWNLOAD_BUBBLE_DOWNLOAD_BUBBLE_PRIMARY_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_DOWNLOAD_BUBBLE_DOWNLOAD_BUBBLE_PRIMARY_VIEW_H_ +#include <string_view> + #include "base/memory/raw_ptr.h" -#include "base/strings/string_piece.h" #include "chrome/browser/download/download_ui_model.h" #include "chrome/browser/ui/download/download_bubble_row_list_view_info.h" #include "ui/base/metadata/metadata_header_macros.h" @@ -74,7 +75,7 @@ // Log the histogram for how long the bubble was visible. void LogVisibleTimeMetrics() const; - virtual base::StringPiece GetVisibleTimeHistogramName() const = 0; + virtual std::string_view GetVisibleTimeHistogramName() const = 0; private: // The ScrollView holding the DownloadBubbleRowListView with the download
diff --git a/chrome/browser/ui/views/download/bubble/download_dialog_view.cc b/chrome/browser/ui/views/download/bubble/download_dialog_view.cc index 9a2b1a2f..65142e8 100644 --- a/chrome/browser/ui/views/download/bubble/download_dialog_view.cc +++ b/chrome/browser/ui/views/download/bubble/download_dialog_view.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/download/bubble/download_dialog_view.h" +#include <string_view> + #include "base/functional/bind.h" #include "base/functional/callback_forward.h" #include "base/logging.h" @@ -200,7 +202,7 @@ LogVisibleTimeMetrics(); } -base::StringPiece DownloadDialogView::GetVisibleTimeHistogramName() const { +std::string_view DownloadDialogView::GetVisibleTimeHistogramName() const { return kFullBubbleVisibleHistogramName; }
diff --git a/chrome/browser/ui/views/download/bubble/download_dialog_view.h b/chrome/browser/ui/views/download/bubble/download_dialog_view.h index eb089b8b..e976ffb 100644 --- a/chrome/browser/ui/views/download/bubble/download_dialog_view.h +++ b/chrome/browser/ui/views/download/bubble/download_dialog_view.h
@@ -5,8 +5,9 @@ #ifndef CHROME_BROWSER_UI_VIEWS_DOWNLOAD_BUBBLE_DOWNLOAD_DIALOG_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_DOWNLOAD_BUBBLE_DOWNLOAD_DIALOG_VIEW_H_ +#include <string_view> + #include "base/memory/weak_ptr.h" -#include "base/strings/string_piece.h" #include "chrome/browser/ui/download/download_bubble_row_list_view_info.h" #include "chrome/browser/ui/views/download/bubble/download_bubble_primary_view.h" #include "chrome/browser/ui/views/download/bubble/download_bubble_row_list_view.h" @@ -47,7 +48,7 @@ private: // DownloadBubblePrimaryView - base::StringPiece GetVisibleTimeHistogramName() const override; + std::string_view GetVisibleTimeHistogramName() const override; void CloseBubble(); void ShowAllDownloads();
diff --git a/chrome/browser/ui/views/exclusive_access_bubble_views.cc b/chrome/browser/ui/views/exclusive_access_bubble_views.cc index c107eb7..39beac1 100644 --- a/chrome/browser/ui/views/exclusive_access_bubble_views.cc +++ b/chrome/browser/ui/views/exclusive_access_bubble_views.cc
@@ -22,14 +22,13 @@ #include "chrome/browser/ui/views/frame/top_container_view.h" #include "chrome/grit/generated_resources.h" #include "components/fullscreen_control/subtle_notification_view.h" +#include "content/public/browser/web_contents.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/gfx/animation/slide_animation.h" -#include "ui/gfx/canvas.h" #include "ui/strings/grit/ui_strings.h" -#include "ui/views/controls/link.h" #include "ui/views/view.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h" @@ -39,11 +38,23 @@ #include "ui/base/l10n/l10n_util_win.h" #endif +namespace { + +// Returns whether `type` indicates a tab-initiated fullscreen mode. +bool IsTabFullscreenType(ExclusiveAccessBubbleType type) { + return type == EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_EXIT_INSTRUCTION || + type == + EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_POINTERLOCK_EXIT_INSTRUCTION || + type == EXCLUSIVE_ACCESS_BUBBLE_TYPE_KEYBOARD_LOCK_EXIT_INSTRUCTION; +} + +} // namespace + ExclusiveAccessBubbleViews::ExclusiveAccessBubbleViews( ExclusiveAccessBubbleViewsContext* context, const ExclusiveAccessBubbleParams& params, ExclusiveAccessBubbleHideCallback first_hide_callback) - : ExclusiveAccessBubble(context->GetExclusiveAccessManager(), params), + : ExclusiveAccessBubble(params), bubble_view_context_(context), first_hide_callback_(std::move(first_hide_callback)), animation_(new gfx::SlideAnimation(this)) { @@ -99,11 +110,20 @@ view_->SetBounds(0, 0, size.width(), size.height()); popup_->AddObserver(this); - fullscreen_observation_.Observe( + auto* fullscreen_controller = bubble_view_context_->GetExclusiveAccessManager() - ->fullscreen_controller()); + ->fullscreen_controller(); + fullscreen_observation_.Observe(fullscreen_controller); UpdateMousePointerWatcher(); + + const bool entering_tab_fullscreen = IsTabFullscreenType(params.type); + // If the tab enters fullscreen without any recent user interaction, re-show + // the bubble on the first user input event, by clearing the snooze time. + content::WebContents* tab = fullscreen_controller->exclusive_access_tab(); + if (entering_tab_fullscreen && tab && !tab->HasRecentInteraction()) { + snooze_until_ = base::TimeTicks::Min(); + } } ExclusiveAccessBubbleViews::~ExclusiveAccessBubbleViews() { @@ -150,6 +170,9 @@ first_hide_callback_ = std::move(first_hide_callback); + const bool entering_tab_fullscreen = + !IsTabFullscreenType(params_.type) && IsTabFullscreenType(params.type); + params_.url = params.url; // When a request to notify about a download is made, the bubble type // should be preserved from the old value, and not be updated. @@ -157,17 +180,25 @@ params_.type = params.type; } UpdateViewContent(params_.type); - view_->SizeToPreferredSize(); popup_->SetBounds(GetPopupRect()); Show(); // Stop watching the mouse pointer even if UpdateMousePointerWatcher() will // start watching it again so that the popup with the new content is visible - // for at least |kInitialDelayMs|. + // for at least `kShowTime`. StopWatchingMousePointer(); UpdateMousePointerWatcher(); + + // If the tab enters fullscreen without any recent user interaction, re-show + // the bubble on the first user input event, by clearing the snooze time. + content::WebContents* tab = bubble_view_context_->GetExclusiveAccessManager() + ->fullscreen_controller() + ->exclusive_access_tab(); + if (entering_tab_fullscreen && tab && !tab->HasRecentInteraction()) { + snooze_until_ = base::TimeTicks::Min(); + } } void ExclusiveAccessBubbleViews::RepositionIfVisible() { @@ -194,7 +225,8 @@ } void ExclusiveAccessBubbleViews::UpdateMousePointerWatcher() { - bool should_watch_pointer = popup_->IsVisible() || CanTriggerOnMousePointer(); + bool should_watch_pointer = + popup_->IsVisible() || bubble_view_context_->CanTriggerOnMousePointer(); if (should_watch_pointer == IsWatchingMousePointer()) { return; @@ -240,7 +272,11 @@ accelerator = base::i18n::ToLower(accelerator); #endif } - view_->UpdateContent(GetInstructionText(accelerator)); + // This string *may* contain the name of the key surrounded in pipe characters + // ('|'), which should be drawn graphically as a key, not displayed literally. + // `accelerator` is the name of the key to exit fullscreen mode. + view_->UpdateContent(exclusive_access_bubble::GetInstructionTextForType( + params_.type, accelerator, params_.has_download, notify_overridden_)); } bool ExclusiveAccessBubbleViews::IsVisible() const { @@ -256,10 +292,6 @@ #endif } -views::View* ExclusiveAccessBubbleViews::GetBrowserRootView() const { - return bubble_view_context_->GetBubbleAssociatedWidget()->GetRootView(); -} - void ExclusiveAccessBubbleViews::AnimationProgressed( const gfx::Animation* animation) { float opacity = static_cast<float>(animation_->CurrentValueBetween(0.0, 1.0)); @@ -299,30 +331,20 @@ bubble_view_context_->GetTopContainerBoundsInScreen().bottom(); } #endif + // Space between top of screen and popup. + static constexpr int kPopupTopPx = 45; // |desired_top| is the top of the bubble area including the shadow. - const int desired_top = kSimplifiedPopupTopPx - view_->GetInsets().top(); + const int desired_top = kPopupTopPx - view_->GetInsets().top(); const int y = top_container_bottom + desired_top; return gfx::Rect(gfx::Point(x, y), size); } -gfx::Point ExclusiveAccessBubbleViews::GetCursorScreenPoint() { - return bubble_view_context_->GetCursorPointInParent(); -} - -bool ExclusiveAccessBubbleViews::WindowContainsPoint(gfx::Point pos) { - return GetBrowserRootView()->HitTestPoint(pos); -} - -bool ExclusiveAccessBubbleViews::IsWindowActive() { - return bubble_view_context_->GetBubbleAssociatedWidget()->IsActive(); -} - void ExclusiveAccessBubbleViews::Hide() { - // This function is guarded by the |ExclusiveAccessBubble::hide_timeout_| + // This function is guarded by the `ExclusiveAccessBubble::hide_timeout_` // timer, so the bubble has been displayed for at least - // |ExclusiveAccessBubble::kInitialDelayMs|. - DCHECK(!IsHideTimeoutRunning()); + // `ExclusiveAccessBubble::kShowTime`. + DCHECK(!hide_timeout_.IsRunning()); RunHideCallbackIfNeeded(ExclusiveAccessBubbleHideReason::kTimeout); animation_->SetSlideDuration(base::Milliseconds(700)); @@ -336,14 +358,6 @@ animation_->Show(); } -bool ExclusiveAccessBubbleViews::IsAnimating() { - return animation_->is_animating(); -} - -bool ExclusiveAccessBubbleViews::CanTriggerOnMousePointer() const { - return bubble_view_context_->CanTriggerOnMousePointer(); -} - void ExclusiveAccessBubbleViews::OnFullscreenStateChanged() { UpdateMousePointerWatcher(); }
diff --git a/chrome/browser/ui/views/exclusive_access_bubble_views.h b/chrome/browser/ui/views/exclusive_access_bubble_views.h index b2d76cb..a04031f 100644 --- a/chrome/browser/ui/views/exclusive_access_bubble_views.h +++ b/chrome/browser/ui/views/exclusive_access_bubble_views.h
@@ -13,6 +13,7 @@ #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_hide_callback.h" #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" #include "chrome/browser/ui/exclusive_access/fullscreen_observer.h" +#include "ui/gfx/animation/animation_delegate.h" #include "ui/views/widget/widget_observer.h" class ExclusiveAccessBubbleViewsContext; @@ -32,6 +33,7 @@ // moves to the screen top. class ExclusiveAccessBubbleViews : public ExclusiveAccessBubble, public FullscreenObserver, + public gfx::AnimationDelegate, public views::WidgetObserver { public: ExclusiveAccessBubbleViews( @@ -77,20 +79,16 @@ // Returns whether the popup is visible. bool IsVisible() const; - // Returns the root view containing |browser_view_|. - views::View* GetBrowserRootView() const; + // Returns the desired rect for the popup window in screen coordinates. + gfx::Rect GetPopupRect() const; - // ExclusiveAccessBubble: + // gfx::AnimationDelegate: void AnimationProgressed(const gfx::Animation* animation) override; void AnimationEnded(const gfx::Animation* animation) override; - gfx::Rect GetPopupRect() const override; - gfx::Point GetCursorScreenPoint() override; - bool WindowContainsPoint(gfx::Point pos) override; - bool IsWindowActive() override; + + // ExclusiveAccessBubble: void Hide() override; void Show() override; - bool IsAnimating() override; - bool CanTriggerOnMousePointer() const override; // FullscreenObserver: void OnFullscreenStateChanged() override; @@ -105,9 +103,7 @@ raw_ptr<views::Widget> popup_; - // Classic mode: Bubble may show & hide multiple times. The callback only runs - // for the first hide. - // Simplified mode: Bubble only hides once. + // Callback that runs the first time the bubble hides. ExclusiveAccessBubbleHideCallback first_hide_callback_; // Animation controlling showing/hiding of the exit bubble. @@ -117,6 +113,9 @@ raw_ptr<SubtleNotificationView> view_; std::u16string browser_fullscreen_exit_accelerator_; + // Whether the bubble was updated for a download while showing. + bool notify_overridden_ = false; + base::ScopedObservation<FullscreenController, FullscreenObserver> fullscreen_observation_{this}; };
diff --git a/chrome/browser/ui/views/extensions/web_file_handlers/web_file_handlers_file_launch_browsertest.cc b/chrome/browser/ui/views/extensions/web_file_handlers/web_file_handlers_file_launch_browsertest.cc index 3274b56..2ee9b9a 100644 --- a/chrome/browser/ui/views/extensions/web_file_handlers/web_file_handlers_file_launch_browsertest.cc +++ b/chrome/browser/ui/views/extensions/web_file_handlers/web_file_handlers_file_launch_browsertest.cc
@@ -13,7 +13,6 @@ #include "base/functional/callback_helpers.h" #include "base/memory/scoped_refptr.h" #include "base/run_loop.h" -#include "base/strings/string_piece.h" #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "base/threading/thread_restrictions.h" @@ -55,9 +54,9 @@ // Write file to disk. base::FilePath WriteFile(const base::FilePath& directory, - const base::StringPiece name, - const base::StringPiece content) { - const base::FilePath path = directory.Append(base::StringPiece(name)); + const std::string_view name, + const std::string_view content) { + const base::FilePath path = directory.Append(std::string_view(name)); base::ScopedAllowBlockingForTesting allow_blocking; base::WriteFile(path, content); return path;
diff --git a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_fuchsia.cc b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_fuchsia.cc deleted file mode 100644 index e3e9812..0000000 --- a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_fuchsia.cc +++ /dev/null
@@ -1,51 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/frame/browser_desktop_window_tree_host.h" - -#include "ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h" - -namespace { - -class BrowserDesktopWindowTreeHostFuchsia - : public BrowserDesktopWindowTreeHost, - public views::DesktopWindowTreeHostPlatform { - public: - BrowserDesktopWindowTreeHostFuchsia( - views::internal::NativeWidgetDelegate* native_widget_delegate, - views::DesktopNativeWidgetAura* desktop_native_widget_aura, - BrowserView* browser_view, - BrowserFrame* browser_frame) - : views::DesktopWindowTreeHostPlatform(native_widget_delegate, - desktop_native_widget_aura) { - // TODO(crbug.com/1234748): Implement ViewProvider and connect it here, - // so that the DesktopWindowTreeHostPlatform can create an Ozone window - // with the necessary Scenic View token, ViewRef, etc. - } - ~BrowserDesktopWindowTreeHostFuchsia() override = default; - - BrowserDesktopWindowTreeHostFuchsia( - const BrowserDesktopWindowTreeHostFuchsia&) = delete; - BrowserDesktopWindowTreeHostFuchsia& operator=( - const BrowserDesktopWindowTreeHostFuchsia&) = delete; - - private: - // Overridden from BrowserDesktopWindowTreeHost: - DesktopWindowTreeHost* AsDesktopWindowTreeHost() override { return this; } - int GetMinimizeButtonOffset() const override { return 0; } - bool UsesNativeSystemMenu() const override { return false; } -}; - -} // namespace - -BrowserDesktopWindowTreeHost* -BrowserDesktopWindowTreeHost::CreateBrowserDesktopWindowTreeHost( - views::internal::NativeWidgetDelegate* native_widget_delegate, - views::DesktopNativeWidgetAura* desktop_native_widget_aura, - BrowserView* browser_view, - BrowserFrame* browser_frame) { - return new BrowserDesktopWindowTreeHostFuchsia(native_widget_delegate, - desktop_native_widget_aura, - browser_view, browser_frame); -}
diff --git a/chrome/browser/ui/views/frame/webui_tab_strip_field_trial_browsertest.cc b/chrome/browser/ui/views/frame/webui_tab_strip_field_trial_browsertest.cc index 0464466..4f82ca7 100644 --- a/chrome/browser/ui/views/frame/webui_tab_strip_field_trial_browsertest.cc +++ b/chrome/browser/ui/views/frame/webui_tab_strip_field_trial_browsertest.cc
@@ -4,13 +4,13 @@ #include "chrome/browser/ui/views/frame/webui_tab_strip_field_trial.h" +#include <string_view> #include <vector> #include "base/command_line.h" #include "base/memory/scoped_refptr.h" #include "base/metrics/field_trial.h" #include "base/ranges/algorithm.h" -#include "base/strings/string_piece.h" #include "base/test/mock_entropy_provider.h" #include "base/test/scoped_feature_list.h" #include "build/build_config.h" @@ -45,7 +45,7 @@ features::kWebUITabStrip.name)); } -bool IsInGroup(base::StringPiece group_name) { +bool IsInGroup(std::string_view group_name) { variations::ActiveGroupId id = variations::MakeActiveGroupId("WebUITabStripOnTablets", group_name);
diff --git a/chrome/browser/ui/views/infobars/default_browser_infobar_interactive_uitest.cc b/chrome/browser/ui/views/infobars/default_browser_infobar_interactive_uitest.cc index 3badd9f..5db978e 100644 --- a/chrome/browser/ui/views/infobars/default_browser_infobar_interactive_uitest.cc +++ b/chrome/browser/ui/views/infobars/default_browser_infobar_interactive_uitest.cc
@@ -156,8 +156,15 @@ // chrome://settings/defaultBrowser page. #if !BUILDFLAG(IS_LINUX) // TODO(crbug.com/335553725): Flaky on Windows. +#if BUILDFLAG(IS_WIN) +#define MAYBE_RemovesAllBrowserPromptsOnSettingsChange \ + DISABLED_RemovesAllBrowserPromptsOnSettingsChange +#else +#define MAYBE_RemovesAllBrowserPromptsOnSettingsChange \ + RemovesAllBrowserPromptsOnSettingsChange +#endif IN_PROC_BROWSER_TEST_F(DefaultBrowserInfobarWithRefreshInteractiveTest, - RemovesAllBrowserPromptsOnSettingsChange) { + MAYBE_RemovesAllBrowserPromptsOnSettingsChange) { DefaultBrowserPromptManager::GetInstance()->MaybeShowPrompt(); RunTestSequence( InstrumentTab(kFirstTabContents), @@ -170,8 +177,16 @@ } #endif +// TODO(crbug.com/335474941): Flaky on Windows. +#if BUILDFLAG(IS_WIN) +#define MAYBE_HandlesAcceptWithDisabledAnimation \ + DISABLED_HandlesAcceptWithDisabledAnimation +#else +#define MAYBE_HandlesAcceptWithDisabledAnimation \ + HandlesAcceptWithDisabledAnimation +#endif IN_PROC_BROWSER_TEST_F(DefaultBrowserInfobarWithRefreshInteractiveTest, - HandlesAcceptWithDisabledAnimation) { + MAYBE_HandlesAcceptWithDisabledAnimation) { // When animations are disabled, the info bar is destroyed sooner which can // cause UAF if not handled properly. This test ensures it is handled // properly. @@ -198,8 +213,14 @@ WaitForHide(ConfirmInfoBar::kInfoBarElementId)); } +// TODO(crbug.com/335474941): Flaky on Windows. +#if BUILDFLAG(IS_WIN) +#define MAYBE_LogsMetrics DISABLED_LogsMetrics +#else +#define MAYBE_LogsMetrics LogsMetrics +#endif IN_PROC_BROWSER_TEST_F(DefaultBrowserInfobarWithRefreshInteractiveTest, - LogsMetrics) { + MAYBE_LogsMetrics) { base::HistogramTester histogram_tester; DefaultBrowserPromptManager::GetInstance()->MaybeShowPrompt(); RunTestSequence(WaitForShow(ConfirmInfoBar::kInfoBarElementId),
diff --git a/chrome/browser/ui/views/intent_picker_bubble_view.cc b/chrome/browser/ui/views/intent_picker_bubble_view.cc index dc00a0f..3500f53 100644 --- a/chrome/browser/ui/views/intent_picker_bubble_view.cc +++ b/chrome/browser/ui/views/intent_picker_bubble_view.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/views/intent_picker_bubble_view.h" +#include <string_view> #include <utility> #include "base/auto_reset.h" @@ -13,7 +14,6 @@ #include "base/functional/bind.h" #include "base/i18n/rtl.h" #include "base/ranges/algorithm.h" -#include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -339,7 +339,7 @@ const ui::ImageModel& icon_model, const std::string& display_name) : LabelButton(std::move(callback), - base::UTF8ToUTF16(base::StringPiece(display_name))) { + base::UTF8ToUTF16(std::string_view(display_name))) { SetHorizontalAlignment(gfx::ALIGN_LEFT); if (!icon_model.IsEmpty()) SetImageModel(views::ImageButton::STATE_NORMAL, icon_model);
diff --git a/chrome/browser/ui/views/lens/lens_side_panel_navigation_helper.cc b/chrome/browser/ui/views/lens/lens_side_panel_navigation_helper.cc index f4be32ac..5176009 100644 --- a/chrome/browser/ui/views/lens/lens_side_panel_navigation_helper.cc +++ b/chrome/browser/ui/views/lens/lens_side_panel_navigation_helper.cc
@@ -4,7 +4,8 @@ #include "chrome/browser/ui/lens/lens_side_panel_navigation_helper.h" -#include "base/strings/string_piece.h" +#include <string_view> + #include "chrome/browser/ui/browser.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_throttle.h" @@ -17,7 +18,7 @@ // List of domains that are safe to happen in the background. To be in the list, // the site must not be reachable by user navigation. -static constexpr base::StringPiece BACKGROUND_THROTTLE_EXCEPTIONS[] = { +static constexpr std::string_view BACKGROUND_THROTTLE_EXCEPTIONS[] = { "https://feedback.googleusercontent.com"}; bool IsSameSite(const GURL& url1, const GURL& url2) { @@ -29,7 +30,7 @@ // Helper that returns if the given URL is in the exception set bool HasThrottleException(const GURL& url) { - for (const base::StringPiece& safe_site : BACKGROUND_THROTTLE_EXCEPTIONS) { + for (std::string_view safe_site : BACKGROUND_THROTTLE_EXCEPTIONS) { if (IsSameSite(url, GURL(safe_site))) return true; }
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc index c5d62bd..8b550f1 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
@@ -8,6 +8,7 @@ #include <memory> #include <string> +#include <string_view> #include <tuple> #include <utility> #include <vector> @@ -83,7 +84,7 @@ void ResetEmphasisTestState(); void CheckUpdatePopupCallInfo(size_t call_count, - base::StringPiece16 text, + std::u16string_view text, const Range& selection_range); void CheckUpdatePopupNotCalled(); @@ -161,7 +162,7 @@ void TestingOmniboxView::CheckUpdatePopupCallInfo( size_t call_count, - base::StringPiece16 text, + std::u16string_view text, const Range& selection_range) { EXPECT_EQ(call_count, update_popup_call_count_); EXPECT_EQ(text, update_popup_text_); @@ -350,7 +351,7 @@ TestLocationBar* location_bar() { return &location_bar_; } // Updates the models' URL and display text to |new_url|. - void UpdateDisplayURL(base::StringPiece16 new_url) { + void UpdateDisplayURL(std::u16string_view new_url) { location_bar_model()->set_url(GURL(new_url)); location_bar_model()->set_url_for_display(std::u16string(new_url)); omnibox_view()->model()->ResetDisplayTexts(); @@ -551,7 +552,7 @@ // on-screen. Because the domain is RTL, this scrolls to an offset greater // than 0. omnibox_textfield()->OnFocus(); - static constexpr base::StringPiece16 kContentsRtl = + static constexpr std::u16string_view kContentsRtl = u"\x05e8\x05e2.\x05e7\x05d5\x05dd/0123/abcd"; omnibox_view()->SetWindowTextAndCaretPos(std::u16string(kContentsRtl), 0, false, false);
diff --git a/chrome/browser/ui/views/page_info/about_this_site_side_panel_view.cc b/chrome/browser/ui/views/page_info/about_this_site_side_panel_view.cc index 1963d15..9260667 100644 --- a/chrome/browser/ui/views/page_info/about_this_site_side_panel_view.cc +++ b/chrome/browser/ui/views/page_info/about_this_site_side_panel_view.cc
@@ -4,7 +4,8 @@ #include "chrome/browser/ui/views/page_info/about_this_site_side_panel_view.h" -#include "base/strings/string_piece.h" +#include <string_view> + #include "base/task/single_thread_task_runner.h" #include "chrome/browser/page_info/about_this_site_side_panel_throttle.h" #include "chrome/browser/profiles/profile.h" @@ -186,7 +187,7 @@ // Override the ilrm=minimal parameter for navigations to a real tab. if (url::IsSameOriginWith(url, last_url_) && url.query_piece().find(page_info::AboutThisSiteRenderModeParameterName) != - base::StringPiece::npos) { + std::string_view::npos) { return net::AppendOrReplaceQueryParameter( url, page_info::AboutThisSiteRenderModeParameterName, std::string()); }
diff --git a/chrome/browser/ui/views/passwords/password_bubble_interactive_uitest.cc b/chrome/browser/ui/views/passwords/password_bubble_interactive_uitest.cc index fd285183..c28a538 100644 --- a/chrome/browser/ui/views/passwords/password_bubble_interactive_uitest.cc +++ b/chrome/browser/ui/views/passwords/password_bubble_interactive_uitest.cc
@@ -490,7 +490,7 @@ : base::test::WithFeatureOverride( switches::kExplicitBrowserSigninUIOnDesktop) {} - bool is_explicit_browser_signin() { return IsParamFeatureEnabled(); } + bool is_explicit_browser_signin() const { return IsParamFeatureEnabled(); } }; // This is a regression test for crbug.com/1335418
diff --git a/chrome/browser/ui/views/sharing/sharing_browsertest.cc b/chrome/browser/ui/views/sharing/sharing_browsertest.cc index 5aaf38a0..90abbf7 100644 --- a/chrome/browser/ui/views/sharing/sharing_browsertest.cc +++ b/chrome/browser/ui/views/sharing/sharing_browsertest.cc
@@ -5,12 +5,12 @@ #include "chrome/browser/ui/views/sharing/sharing_browsertest.h" #include <map> +#include <string_view> #include "base/functional/bind.h" #include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/strings/strcat.h" -#include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" #include "base/test/bind.h" #include "build/build_config.h" @@ -169,8 +169,8 @@ std::unique_ptr<TestRenderViewContextMenu> SharingBrowserTest::InitContextMenu( const GURL& url, - base::StringPiece link_text, - base::StringPiece selection_text) { + std::string_view link_text, + std::string_view selection_text) { content::ContextMenuParams params; params.selection_text = base::ASCIIToUTF16(selection_text); params.media_type = blink::mojom::ContextMenuDataMediaType::kNone;
diff --git a/chrome/browser/ui/views/sharing/sharing_browsertest.h b/chrome/browser/ui/views/sharing/sharing_browsertest.h index 7477a34..6f8e20de 100644 --- a/chrome/browser/ui/views/sharing/sharing_browsertest.h +++ b/chrome/browser/ui/views/sharing/sharing_browsertest.h
@@ -7,9 +7,9 @@ #include <memory> #include <string> +#include <string_view> #include "base/memory/raw_ptr.h" -#include "base/strings/string_piece.h" #include "chrome/browser/gcm/gcm_profile_service_factory.h" #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h" #include "chrome/browser/sharing/sharing_message_bridge.h" @@ -91,8 +91,8 @@ std::unique_ptr<TestRenderViewContextMenu> InitContextMenu( const GURL& url, - base::StringPiece link_text, - base::StringPiece selection_text); + std::string_view link_text, + std::string_view selection_text); void CheckLastReceiver(const SharingTargetDeviceInfo& device) const;
diff --git a/chrome/browser/ui/views/status_icons/status_tray_fuchsia.cc b/chrome/browser/ui/views/status_icons/status_tray_fuchsia.cc deleted file mode 100644 index 8f59ec82..0000000 --- a/chrome/browser/ui/views/status_icons/status_tray_fuchsia.cc +++ /dev/null
@@ -1,13 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/status_icons/status_tray.h" - -#include "base/notreached.h" - -std::unique_ptr<StatusTray> StatusTray::Create() { - // TODO(crbug.com/40192123) - NOTIMPLEMENTED_LOG_ONCE(); - return nullptr; -}
diff --git a/chrome/browser/ui/views/tabs/filename_elider.cc b/chrome/browser/ui/views/tabs/filename_elider.cc index 59a1d7b8..ec05d27d 100644 --- a/chrome/browser/ui/views/tabs/filename_elider.cc +++ b/chrome/browser/ui/views/tabs/filename_elider.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/tabs/filename_elider.h" +#include <string_view> + #include "base/i18n/break_iterator.h" #include "base/i18n/char_iterator.h" #include "base/strings/string_util.h" @@ -43,7 +45,7 @@ // Fast forward to the unicode character following the paren. base::i18n::UTF16CharIterator it( - base::StringPiece16(text).substr(paren_pos + 1)); + std::u16string_view(text).substr(paren_pos + 1)); // Look for the image width. if (!base::IsAsciiDigit(it.get())) {
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc index 146c8621..84d26a3 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
@@ -2236,7 +2236,7 @@ std::unique_ptr<content::WebContents> new_web_contents = content::WebContents::Create( content::WebContents::CreateParams(browser()->profile())); - browser()->tab_strip_model()->ReplaceWebContentsAt( + browser()->tab_strip_model()->DiscardWebContentsAt( 0, std::move(new_web_contents)); // The drag session should still exist, and still not be started.
diff --git a/chrome/browser/ui/views/toolbar/app_menu_browsertest.cc b/chrome/browser/ui/views/toolbar/app_menu_browsertest.cc index b96d88d..366e22b6 100644 --- a/chrome/browser/ui/views/toolbar/app_menu_browsertest.cc +++ b/chrome/browser/ui/views/toolbar/app_menu_browsertest.cc
@@ -6,6 +6,7 @@ #include <optional> #include <string> +#include <string_view> #include <utility> #include "base/auto_reset.h" @@ -16,7 +17,6 @@ #include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/scoped_observation.h" -#include "base/strings/string_piece.h" #include "base/test/scoped_feature_list.h" #include "build/branding_buildflags.h" #include "build/buildflag.h" @@ -95,7 +95,7 @@ return; } - constexpr auto kSubmenus = base::MakeFixedFlatMap<base::StringPiece, int>({ + constexpr auto kSubmenus = base::MakeFixedFlatMap<std::string_view, int>({ // Submenus present in all versions. {"history", IDC_RECENT_TABS_MENU}, {"bookmarks", IDC_BOOKMARKS_MENU},
diff --git a/chrome/browser/ui/views/toolbar/home_button.cc b/chrome/browser/ui/views/toolbar/home_button.cc index 5469893..87a8016 100644 --- a/chrome/browser/ui/views/toolbar/home_button.cc +++ b/chrome/browser/ui/views/toolbar/home_button.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/toolbar/home_button.h" +#include <string_view> + #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/memory/raw_ptr.h" @@ -81,7 +83,7 @@ l10n_util::GetStringUTF16(IDS_TOOLBAR_INFORM_SET_HOME_PAGE), undo_string}; views::StyledLabel* label = AddChildView(std::make_unique<views::StyledLabel>()); - label->SetText(base::JoinString(message, base::StringPiece16(u" "))); + label->SetText(base::JoinString(message, std::u16string_view(u" "))); gfx::Range undo_range(label->GetText().length() - undo_string.length(), label->GetText().length());
diff --git a/chrome/browser/ui/views/toolbar/toolbar_controller.cc b/chrome/browser/ui/views/toolbar/toolbar_controller.cc index 7657094..c583c11 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_controller.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_controller.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/toolbar/toolbar_controller.h" +#include <string_view> + #include "base/functional/overloaded.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" @@ -256,7 +258,7 @@ absl::variant<ui::ElementIdentifier, actions::ActionId> identifier) { static const base::NoDestructor< base::flat_map<absl::variant<ui::ElementIdentifier, actions::ActionId>, - base::StringPiece>> + std::string_view>> identifier_to_action_name_map({ {kToolbarAvatarButtonElementId, "AvatarButton"}, {kToolbarChromeLabsButtonElementId, "ChromeLabsButton"},
diff --git a/chrome/browser/ui/views/user_education/browser_user_education_service_browsertest.cc b/chrome/browser/ui/views/user_education/browser_user_education_service_browsertest.cc index 225ea5e..7c41a2b 100644 --- a/chrome/browser/ui/views/user_education/browser_user_education_service_browsertest.cc +++ b/chrome/browser/ui/views/user_education/browser_user_education_service_browsertest.cc
@@ -49,6 +49,7 @@ kWrongSessionImpactKeyedNotice, kWrongSessionImpactLegalNotice, kLegacyPromoNoScreenReader, + kWrongSessionParamsRotatingPromo, }; struct IPHException { @@ -170,6 +171,15 @@ os << " is a legacy promo with inadequate screen reader support. Use a " "toast promo instead."; break; + case IPHFailureReason::kWrongSessionParamsRotatingPromo: + os << " has unexpected session rate and/or session rate impact: " + << failure.config->session_rate.type << ", " + << failure.config->session_rate.value << ", " + << failure.config->session_rate_impact.type + << ". A rotating promo should never be prevented from running " + "(session rate ANY) and should not prevent other IPH from " + "running (session rate impact NONE)."; + break; } return os; } @@ -425,6 +435,14 @@ feature_config); } break; + case user_education::FeaturePromoSpecification::PromoType::kRotating: + // Rotating promos should be unlimited and not limit other IPH. + if (is_session_limited || limits_other_iph) { + MaybeAddFailure(failures, exceptions, feature, + IPHFailureReason::kWrongSessionParamsRotatingPromo, + feature_config); + } + break; } }
diff --git a/chrome/browser/ui/views/user_education/feature_promo_lifecycle_interactive_uitest.cc b/chrome/browser/ui/views/user_education/feature_promo_lifecycle_interactive_uitest.cc index 6520c5b..0fa82c0b 100644 --- a/chrome/browser/ui/views/user_education/feature_promo_lifecycle_interactive_uitest.cc +++ b/chrome/browser/ui/views/user_education/feature_promo_lifecycle_interactive_uitest.cc
@@ -12,7 +12,6 @@ #include "base/functional/callback_helpers.h" #include "base/strings/stringprintf.h" #include "base/test/bind.h" -#include "base/test/metrics/histogram_tester.h" #include "base/time/time.h" #include "chrome/browser/feature_engagement/tracker_factory.h" #include "chrome/browser/profiles/profile.h" @@ -28,7 +27,6 @@ #include "components/keyed_service/content/browser_context_keyed_service_factory.h" #include "components/strings/grit/components_strings.h" #include "components/user_education/common/feature_promo_controller.h" -#include "components/user_education/common/feature_promo_data.h" #include "components/user_education/common/feature_promo_result.h" #include "components/user_education/common/feature_promo_specification.h" #include "components/user_education/common/feature_promo_storage_service.h" @@ -67,7 +65,6 @@ } // namespace using TestBase = InteractiveFeaturePromoTestT<web_app::WebAppBrowserTestBase>; -using user_education::FeaturePromoClosedReason; using user_education::FeaturePromoResult; class FeaturePromoLifecycleUiTest : public TestBase { @@ -169,12 +166,14 @@ auto SnoozeIPH() { auto steps = Steps( - Do([this]() { last_snooze_time_.first = base::Time::Now(); }), + Do(base::BindLambdaForTesting( + [this]() { last_snooze_time_.first = base::Time::Now(); })), PressButton( user_education::HelpBubbleView::kFirstNonDefaultButtonIdForTesting), WaitForHide( user_education::HelpBubbleView::kHelpBubbleElementIdForTesting), - Do([this]() { last_snooze_time_.second = base::Time::Now(); })); + Do(base::BindLambdaForTesting( + [this]() { last_snooze_time_.second = base::Time::Now(); }))); AddDescription(steps, "SnoozeIPH(%s)"); return steps; } @@ -223,19 +222,6 @@ })).SetDescription(desc.str())); } - auto CheckMessageActionHistogram(const base::Feature& feature, - FeaturePromoClosedReason bucket, - int expected_count = 1) { - const std::string name = - base::StrCat({"UserEducation.MessageAction.", feature.name}); - return std::move(Do([this, name, bucket, expected_count]() { - histogram_tester_.ExpectBucketCount(name, bucket, - expected_count); - }) - .SetDescription(base::StringPrintf( - "CheckHistogram(%s)", name.c_str()))); - } - static BrowserFeaturePromoController* GetPromoController(Browser* browser) { return static_cast<BrowserFeaturePromoController*>( browser->window()->GetFeaturePromoController()); @@ -249,7 +235,6 @@ private: std::pair<base::Time, base::Time> last_show_time_; std::pair<base::Time, base::Time> last_snooze_time_; - base::HistogramTester histogram_tester_; }; IN_PROC_BROWSER_TEST_F(FeaturePromoLifecycleUiTest, DismissDoesNotSnooze) { @@ -393,102 +378,6 @@ MaybeShowPromo(kFeaturePromoLifecycleTestPromo)); } -IN_PROC_BROWSER_TEST_F(FeaturePromoLifecycleUiTest, - AbortPromoRecordsHistogram) { - RunTestSequence( - ShowPromoRecordingTime(kFeaturePromoLifecycleTestPromo), - AbortPromo(kFeaturePromoLifecycleTestPromo), - CheckMessageActionHistogram(kFeaturePromoLifecycleTestPromo, - FeaturePromoClosedReason::kAbortPromo)); -} - -IN_PROC_BROWSER_TEST_F(FeaturePromoLifecycleUiTest, - SnoozePromoRecordsHistogram) { - RunTestSequence( - ShowPromoRecordingTime(kFeaturePromoLifecycleTestPromo), SnoozeIPH(), - CheckMessageActionHistogram(kFeaturePromoLifecycleTestPromo, - FeaturePromoClosedReason::kSnooze)); -} - -IN_PROC_BROWSER_TEST_F(FeaturePromoLifecycleUiTest, - CancelPromoRecordsHistogram) { - RunTestSequence( - ShowPromoRecordingTime(kFeaturePromoLifecycleTestPromo), DismissIPH(), - CheckMessageActionHistogram(kFeaturePromoLifecycleTestPromo, - FeaturePromoClosedReason::kCancel)); -} - -IN_PROC_BROWSER_TEST_F(FeaturePromoLifecycleUiTest, - DismissPromoRecordsHistogram) { - RunTestSequence( - ShowPromoRecordingTime(kFeaturePromoLifecycleTestPromo), - PressDefaultPromoButton(), - CheckMessageActionHistogram(kFeaturePromoLifecycleTestPromo, - FeaturePromoClosedReason::kDismiss)); -} - -IN_PROC_BROWSER_TEST_F(FeaturePromoLifecycleUiTest, EndPromoRecordsHistogram) { - RunTestSequence( - ShowPromoRecordingTime(kFeaturePromoLifecycleTestPromo), - InBrowser(base::BindOnce([](Browser* browser) { - GetPromoController(browser)->EndPromo( - kFeaturePromoLifecycleTestPromo, - user_education::EndFeaturePromoReason::kFeatureEngaged); - })), - WaitForHide( - user_education::HelpBubbleView::kHelpBubbleElementIdForTesting), - CheckMessageActionHistogram(kFeaturePromoLifecycleTestPromo, - FeaturePromoClosedReason::kFeatureEngaged)); -} - -IN_PROC_BROWSER_TEST_F(FeaturePromoLifecycleUiTest, - WidgetClosedRecordsHistogram) { - RunTestSequence( - ShowPromoRecordingTime(kFeaturePromoLifecycleTestPromo), - WithView(user_education::HelpBubbleView::kHelpBubbleElementIdForTesting, - [](user_education::HelpBubbleView* bubble) { - bubble->GetWidget()->CloseWithReason( - views::Widget::ClosedReason::kEscKeyPressed); - }), - WaitForHide( - user_education::HelpBubbleView::kHelpBubbleElementIdForTesting), - FlushEvents(), - CheckMessageActionHistogram(kFeaturePromoLifecycleTestPromo, - FeaturePromoClosedReason::kAbortPromo)); -} - -IN_PROC_BROWSER_TEST_F(FeaturePromoLifecycleUiTest, - AnchorHideRecordsHistogram) { - RunTestSequence( - ShowPromoRecordingTime(kFeaturePromoLifecycleTestPromo), - WithView(user_education::HelpBubbleView::kHelpBubbleElementIdForTesting, - [](user_education::HelpBubbleView* bubble) { - // This should yank the bubble out from under us. - bubble->GetAnchorView()->SetVisible(false); - }), - WaitForHide( - user_education::HelpBubbleView::kHelpBubbleElementIdForTesting), - CheckMessageActionHistogram(kFeaturePromoLifecycleTestPromo, - FeaturePromoClosedReason::kAbortPromo)); -} - -IN_PROC_BROWSER_TEST_F(FeaturePromoLifecycleUiTest, - DismissInRegionRecordsHistogram) { - RunTestSequence( - ShowPromoRecordingTime(kFeaturePromoLifecycleTestPromo), - WithView(user_education::HelpBubbleView::kHelpBubbleElementIdForTesting, - [](user_education::HelpBubbleView* bubble) { - BrowserFeaturePromoController::GetForView(bubble) - ->DismissNonCriticalBubbleInRegion( - bubble->GetBoundsInScreen()); - }), - WaitForHide( - user_education::HelpBubbleView::kHelpBubbleElementIdForTesting), - CheckMessageActionHistogram( - kFeaturePromoLifecycleTestPromo, - FeaturePromoClosedReason::kOverrideForUIRegionConflict)); -} - class FeaturePromoLifecycleAppUiTest : public FeaturePromoLifecycleUiTest { public: FeaturePromoLifecycleAppUiTest() = default; @@ -707,11 +596,7 @@ RunTestSequence(MaybeShowPromo(kFeaturePromoLifecycleTestPromo3), MaybeShowPromo(kFeaturePromoLifecycleTestPromo), DismissIPH(), CheckDismissed(true, &kFeaturePromoLifecycleTestPromo), - CheckDismissed(false, &kFeaturePromoLifecycleTestPromo3), - FlushEvents(), - CheckMessageActionHistogram( - kFeaturePromoLifecycleTestPromo3, - FeaturePromoClosedReason::kOverrideForPrecedence)); + CheckDismissed(false, &kFeaturePromoLifecycleTestPromo3)); } IN_PROC_BROWSER_TEST_F(FeaturePromoLifecycleCriticalUiTest, @@ -719,9 +604,5 @@ RunTestSequence(MaybeShowPromo(kFeaturePromoLifecycleTestPromo3), MaybeShowPromo(kFeaturePromoLifecycleTestAlert), DismissIPH(), CheckDismissed(true, &kFeaturePromoLifecycleTestAlert), - CheckDismissed(false, &kFeaturePromoLifecycleTestPromo3), - FlushEvents(), - CheckMessageActionHistogram( - kFeaturePromoLifecycleTestPromo3, - FeaturePromoClosedReason::kOverrideForPrecedence)); + CheckDismissed(false, &kFeaturePromoLifecycleTestPromo3)); }
diff --git a/chrome/browser/ui/views/web_apps/deprecated_apps_dialog_view_browsertest.cc b/chrome/browser/ui/views/web_apps/deprecated_apps_dialog_view_browsertest.cc index 17101401..26a3b1f7 100644 --- a/chrome/browser/ui/views/web_apps/deprecated_apps_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/web_apps/deprecated_apps_dialog_view_browsertest.cc
@@ -5,10 +5,10 @@ #include "chrome/browser/ui/views/web_apps/deprecated_apps_dialog_view.h" #include <set> +#include <string_view> #include "base/functional/callback_helpers.h" #include "base/run_loop.h" -#include "base/strings/string_piece.h" #include "base/test/bind.h" #include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/platform_util.h" @@ -97,7 +97,7 @@ return false; } - base::StringPiece ClickDeprecatedDialogLinkString() { + std::string_view ClickDeprecatedDialogLinkString() { return "document.querySelector('body > " "deprecated-apps-link').shadowRoot.querySelector('#deprecated-apps-" "link').click()";
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_test_helper.cc b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_test_helper.cc index 316ced4..09af229f 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_test_helper.cc +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_test_helper.cc
@@ -175,7 +175,7 @@ GURL WebAppFrameToolbarTestHelper::LoadTestPageWithDataAndGetURL( net::test_server::EmbeddedTestServer* embedded_test_server, base::ScopedTempDir* temp_dir, - base::StringPiece test_html) { + std::string_view test_html) { // Write kTestHTML to a temporary file that can be later reached at // http://127.0.0.1/test_file_*.html. static int s_test_file_number = 1;
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_test_helper.h b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_test_helper.h index 3f4ec6b..7be29b3 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_test_helper.h +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_test_helper.h
@@ -7,6 +7,7 @@ #include <memory> #include <string> +#include <string_view> #include "base/memory/raw_ptr.h" #include "base/values.h" @@ -65,7 +66,7 @@ GURL LoadTestPageWithDataAndGetURL( net::test_server::EmbeddedTestServer* embedded_test_server, base::ScopedTempDir* temp_dir, - base::StringPiece test_html); + std::string_view test_html); GURL LoadWindowControlsOverlayTestPageWithDataAndGetURL( net::test_server::EmbeddedTestServer* embedded_test_server,
diff --git a/chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view_controller_unittest.cc b/chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view_controller_unittest.cc index 35846d7..e71b943 100644 --- a/chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view_controller_unittest.cc +++ b/chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view_controller_unittest.cc
@@ -6,13 +6,13 @@ #include <memory> #include <string> +#include <string_view> #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" -#include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_feature_list.h" #include "base/test/test_future.h" @@ -84,7 +84,7 @@ using ::testing::VariantWith; using Step = IsolatedWebAppInstallerModel::Step; -constexpr base::StringPiece kIconPath = "/icon.png"; +constexpr std::string_view kIconPath = "/icon.png"; MATCHER_P3(WithMetadata, app_id, app_name, version, "") { return ExplainMatchResult(
diff --git a/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc b/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc index d7e5d56..7eb418c2 100644 --- a/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc +++ b/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc
@@ -11,6 +11,7 @@ #include <optional> #include <ostream> #include <string> +#include <string_view> #include <utility> #include "base/command_line.h" @@ -2193,7 +2194,7 @@ // CUJs are implemented. void WebAppIntegrationTestDriver::SyncAndInstallPreinstalledAppConfig( const GURL& install_url, - base::StringPiece app_config_string) { + std::string_view app_config_string) { base::AutoReset<bool> bypass_offline_manifest_requirement = PreinstalledWebAppManager::BypassOfflineManifestRequirementForTesting(); // TODO: resolve how to handle return value. @@ -4778,7 +4779,6 @@ std::vector<base::test::FeatureRef> disabled_features; enabled_features.push_back(blink::features::kDesktopPWAsSubApps); enabled_features.push_back(blink::features::kDesktopPWAsTabStrip); - enabled_features.push_back(features::kDesktopPWAsEnforceWebAppSettingsPolicy); enabled_features.push_back(features::kDesktopPWAsTabStripSettings); enabled_features.push_back(features::kIsolatedWebAppDevMode); enabled_features.push_back(features::kIsolatedWebApps);
diff --git a/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.h b/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.h index bfb342d..28adfd2 100644 --- a/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.h +++ b/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.h
@@ -9,6 +9,7 @@ #include <memory> #include <optional> #include <string> +#include <string_view> #include <vector> #include "base/auto_reset.h" @@ -481,7 +482,7 @@ std::vector<base::FilePath> GetTestFilePaths(FilesOptions file_options); void SyncAndInstallPreinstalledAppConfig(const GURL& install_url, - base::StringPiece app_config_string); + std::string_view app_config_string); Browser* browser(); Profile* profile();
diff --git a/chrome/browser/ui/views/webauthn/authenticator_common_views.cc b/chrome/browser/ui/views/webauthn/authenticator_common_views.cc index c94f940..ebc1617 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_common_views.cc +++ b/chrome/browser/ui/views/webauthn/authenticator_common_views.cc
@@ -8,6 +8,7 @@ #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/geometry/insets.h" +#include "ui/gfx/vector_icon_types.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout_view.h" @@ -16,7 +17,8 @@ #include "ui/views/view.h" namespace { -constexpr int kPasskeyIconSize = 20; +constexpr int kGapSize = 8; +constexpr int kIconSize = 20; constexpr int kHorizontalInset = 8; constexpr int kHorizontalSpacing = 16; } // namespace @@ -29,7 +31,7 @@ container->SetBetweenChildSpacing(kHorizontalSpacing); container->AddChildView( std::make_unique<views::ImageView>(ui::ImageModel::FromVectorIcon( - vector_icons::kPasskeyIcon, ui::kColorIcon, kPasskeyIconSize))); + vector_icons::kPasskeyIcon, ui::kColorIcon, kIconSize))); auto username_column = std::make_unique<views::BoxLayoutView>(); username_column->SetOrientation(views::BoxLayout::Orientation::kVertical); @@ -47,3 +49,17 @@ container->AddChildView(std::move(username_column)); return std::move(container); } + +std::unique_ptr<views::View> CreateIconWithLabelRow( + const gfx::VectorIcon& icon, + const std::u16string& label) { + auto row = std::make_unique<views::BoxLayoutView>(); + row->SetOrientation(views::BoxLayout::Orientation::kHorizontal); + row->SetBetweenChildSpacing(kGapSize); + + row->AddChildView(std::make_unique<views::ImageView>( + ui::ImageModel::FromVectorIcon(icon, ui::kColorIcon, kIconSize))); + row->AddChildView(std::make_unique<views::Label>( + label, views::style::CONTEXT_DIALOG_BODY_TEXT)); + return row; +}
diff --git a/chrome/browser/ui/views/webauthn/authenticator_common_views.h b/chrome/browser/ui/views/webauthn/authenticator_common_views.h index 85c0429..958e53f 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_common_views.h +++ b/chrome/browser/ui/views/webauthn/authenticator_common_views.h
@@ -6,6 +6,11 @@ #define CHROME_BROWSER_UI_VIEWS_WEBAUTHN_AUTHENTICATOR_COMMON_VIEWS_H_ #include <memory> +#include <string> + +namespace gfx { +struct VectorIcon; +} // namespace gfx namespace views { class View; @@ -20,4 +25,12 @@ std::unique_ptr<views::View> CreatePasskeyWithUsernameLabel( std::u16string username); +// Creates a simple view with an icon and a label. +// +---------------------+ +// | <icon> label | +// +---------------------+ +std::unique_ptr<views::View> CreateIconWithLabelRow( + const gfx::VectorIcon& icon, + const std::u16string& label); + #endif // CHROME_BROWSER_UI_VIEWS_WEBAUTHN_AUTHENTICATOR_COMMON_VIEWS_H_
diff --git a/chrome/browser/ui/views/webauthn/authenticator_gpm_onboarding_sheet_view.cc b/chrome/browser/ui/views/webauthn/authenticator_gpm_onboarding_sheet_view.cc index a645f34..d527dfd 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_gpm_onboarding_sheet_view.cc +++ b/chrome/browser/ui/views/webauthn/authenticator_gpm_onboarding_sheet_view.cc
@@ -9,7 +9,6 @@ #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/browser/ui/views/webauthn/authenticator_common_views.h" -#include "ui/gfx/vector_icon_types.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" @@ -19,27 +18,6 @@ #include "ui/views/style/typography.h" #include "ui/views/view.h" -namespace { - -constexpr int kIconSize = 20; -constexpr int kGapSize = 8; - -std::unique_ptr<views::View> CreateIconWithLabelRow( - const gfx::VectorIcon& icon, - const std::u16string& label) { - auto row = std::make_unique<views::BoxLayoutView>(); - row->SetOrientation(views::BoxLayout::Orientation::kHorizontal); - row->SetBetweenChildSpacing(kGapSize); - - row->AddChildView(std::make_unique<views::ImageView>( - ui::ImageModel::FromVectorIcon(icon, ui::kColorIcon, kIconSize))); - row->AddChildView(std::make_unique<views::Label>( - label, views::style::CONTEXT_DIALOG_BODY_TEXT)); - return row; -} - -} // namespace - AuthenticatorGpmOnboardingSheetView::AuthenticatorGpmOnboardingSheetView( std::unique_ptr<AuthenticatorGpmOnboardingSheetModel> sheet_model) : AuthenticatorRequestSheetView(std::move(sheet_model)) {}
diff --git a/chrome/browser/ui/views/webauthn/authenticator_request_bubble.cc b/chrome/browser/ui/views/webauthn/authenticator_request_bubble.cc index 53f21701..7b5a886 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_request_bubble.cc +++ b/chrome/browser/ui/views/webauthn/authenticator_request_bubble.cc
@@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/ui/webauthn/authenticator_request_bubble.h" + #include <memory> +#include "base/strings/utf_string_conversions.h" #include "cc/paint/skottie_wrapper.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" @@ -14,10 +17,11 @@ #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/toolbar_button_provider.h" #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" -#include "chrome/browser/ui/webauthn/authenticator_request_bubble.h" +#include "chrome/browser/ui/views/webauthn/authenticator_common_views.h" #include "chrome/browser/webauthn/authenticator_request_dialog_model.h" #include "chrome/grit/browser_resources.h" #include "chrome/grit/generated_resources.h" +#include "components/vector_icons/vector_icons.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/text_constants.h" #include "ui/lottie/animation.h" @@ -45,7 +49,6 @@ &AuthenticatorRequestDialogModel::StartOver; }; -// TODO(rgod): Add username row and correct footer when mocks are ready. constexpr BubbleContents kGPMPasskeySavedContents = { .buttons = ui::DIALOG_BUTTON_NONE, .title = u"Passkey saved (UT)", @@ -187,8 +190,7 @@ if (bubble_contents_->show_footer) { auto label = std::make_unique<views::Label>( u"Your passkeys are saved to Google Password Manager for " - u"example@gmail.com and will also be available on your Android " - u"devices (UNTRANSLATED)", + u"example@gmail.com (UNTRANSLATED)", ChromeTextContext::CONTEXT_DIALOG_BODY_TEXT_SMALL, views::style::STYLE_SECONDARY); label->SetMultiLine(true); @@ -220,6 +222,11 @@ .SetTextContext(views::style::CONTEXT_DIALOG_BODY_TEXT) .Build()); } + if (step_ == AuthenticatorRequestDialogModel::Step::kGPMPasskeySaved) { + AddChildView(CreateIconWithLabelRow( + vector_icons::kPasskeyIcon, + base::UTF8ToUTF16(model_->user_entity.name.value_or("")))); + } AddChildView(std::move(primary_view)); }
diff --git a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc index 1cd8774..d82332e 100644 --- a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc +++ b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc
@@ -125,24 +125,19 @@ base::UTF8ToUTF16(*iframe_etld_plus_one)) : std::nullopt; - // If a modal dialog was created previously but there is no modal support for - // this type of dialog, reset account_selection_view_ to create a bubble - // dialog instead. - if (account_selection_view_ && rp_mode == blink::mojom::RpMode::kButton && - !has_modal_support) { - ResetAccountSelectionView(); - } + bool has_no_prev_view = !account_selection_view_; + // If there was previously a dialog here, the new dialog may be of a different + // type or have a different title. Reset account_selection_view_ to make sure + // everything is updated properly. + MaybeResetAccountSelectionView(); - bool create_view = !account_selection_view_; - if (create_view) { - account_selection_view_ = CreateAccountSelectionView( - top_frame_for_display_, iframe_for_display_, idp_title, rp_context, - rp_mode, has_modal_support); + account_selection_view_ = CreateAccountSelectionView( + top_frame_for_display_, iframe_for_display_, idp_title, rp_context, + rp_mode, has_modal_support); - if (!account_selection_view_) { - delegate_->OnDismiss(DismissReason::kOther); - return; - } + if (!account_selection_view_) { + delegate_->OnDismiss(DismissReason::kOther); + return; } if (sign_in_mode == Account::SignInMode::kAuto) { @@ -247,7 +242,7 @@ // while the modal dialog is visible and we are called from CloseModalDialog. // Because the modal dialog is now closed, we should show the account chooser // now. - if (create_view || is_modal_closed_but_accounts_fetch_pending_ || + if (has_no_prev_view || is_modal_closed_but_accounts_fetch_pending_ || (popup_window_state_ && *popup_window_state_ == PopupWindowResult::kAccountsReceivedAndPopupNotClosedByIdp)) { @@ -303,30 +298,25 @@ // modal is not yet implemented. bool has_modal_support = false; - // If a modal dialog was created previously but there is no modal support for - // this type of dialog, reset account_selection_view_ to create a bubble - // dialog instead. - if (account_selection_view_ && rp_mode == blink::mojom::RpMode::kButton && - !has_modal_support) { - ResetAccountSelectionView(); - } + bool has_no_prev_view = !account_selection_view_; + // If there was previously a dialog here, the new dialog may be of a different + // type or have a different title. Reset account_selection_view_ to make sure + // everything is updated properly. + MaybeResetAccountSelectionView(); - bool create_view = !account_selection_view_; top_frame_for_display_ = base::UTF8ToUTF16(top_frame_etld_plus_one); iframe_for_display_ = iframe_etld_plus_one ? std::make_optional<std::u16string>( base::UTF8ToUTF16(*iframe_etld_plus_one)) : std::nullopt; - if (create_view) { - account_selection_view_ = - CreateAccountSelectionView(top_frame_for_display_, iframe_for_display_, - base::UTF8ToUTF16(idp_etld_plus_one), - rp_context, rp_mode, has_modal_support); + account_selection_view_ = + CreateAccountSelectionView(top_frame_for_display_, iframe_for_display_, + base::UTF8ToUTF16(idp_etld_plus_one), + rp_context, rp_mode, has_modal_support); - if (!account_selection_view_) { - delegate_->OnDismiss(DismissReason::kOther); - return; - } + if (!account_selection_view_) { + delegate_->OnDismiss(DismissReason::kOther); + return; } account_selection_view_->ShowFailureDialog( @@ -345,7 +335,7 @@ input_protector_ = std::make_unique<views::InputEventActivationProtector>(); } - if (create_view || is_modal_closed_but_accounts_fetch_pending_) { + if (has_no_prev_view || is_modal_closed_but_accounts_fetch_pending_) { is_modal_closed_but_accounts_fetch_pending_ = false; if (is_web_contents_visible_) { input_protector_->VisibilityChanged(true); @@ -377,25 +367,19 @@ // modal is not yet implemented. bool has_modal_support = false; - // If a modal dialog was created previously but there is no modal support for - // this type of dialog, reset account_selection_view_ to create a bubble - // dialog instead. - if (account_selection_view_ && rp_mode == blink::mojom::RpMode::kButton && - !has_modal_support) { - ResetAccountSelectionView(); - } + // If there was previously a dialog here, the new dialog may be of a different + // type or have a different title. Reset account_selection_view_ to make sure + // everything is updated properly. + MaybeResetAccountSelectionView(); - bool create_view = !account_selection_view_; - if (create_view) { - account_selection_view_ = - CreateAccountSelectionView(top_frame_for_display_, iframe_for_display_, - base::UTF8ToUTF16(idp_etld_plus_one), - rp_context, rp_mode, has_modal_support); + account_selection_view_ = + CreateAccountSelectionView(top_frame_for_display_, iframe_for_display_, + base::UTF8ToUTF16(idp_etld_plus_one), + rp_context, rp_mode, has_modal_support); - if (!account_selection_view_) { - delegate_->OnDismiss(DismissReason::kOther); - return; - } + if (!account_selection_view_) { + delegate_->OnDismiss(DismissReason::kOther); + return; } account_selection_view_->ShowErrorDialog( @@ -414,7 +398,7 @@ input_protector_ = std::make_unique<views::InputEventActivationProtector>(); } - if (create_view && is_web_contents_visible_) { + if (is_web_contents_visible_) { GetDialogWidget()->Show(); input_protector_->VisibilityChanged(true); } @@ -942,7 +926,7 @@ *modal_account_chooser_state_); } - ResetAccountSelectionView(); + MaybeResetAccountSelectionView(); input_protector_.reset(); if (notify_delegate_of_dismiss_) { @@ -960,7 +944,10 @@ return dialog_type_; } -void FedCmAccountSelectionView::ResetAccountSelectionView() { +void FedCmAccountSelectionView::MaybeResetAccountSelectionView() { + if (!account_selection_view_) { + return; + } account_selection_view_->CloseDialog(); account_selection_view_ = nullptr; TabStripModelObserver::StopObservingAll(this);
diff --git a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.h b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.h index dc1a7be..104c4d23 100644 --- a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.h +++ b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.h
@@ -283,7 +283,7 @@ // Resets `account_selection_view_`. Typically, to recreate it later to show a // different kind of dialog. - void ResetAccountSelectionView(); + void MaybeResetAccountSelectionView(); // Returns whether an IDP sign-in pop-up window is currently open. bool IsIdpSigninPopupOpen();
diff --git a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop_unittest.cc b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop_unittest.cc index 0e80813..1ded0e2f 100644 --- a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop_unittest.cc +++ b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop_unittest.cc
@@ -562,8 +562,7 @@ EXPECT_EQ(TestAccountSelectionView::SheetType::kVerifying, account_selection_view_->sheet_type_); - // Failure bubble should have been re-used for sign-in dialog. - EXPECT_EQ(1u, controller->num_dialogs_); + EXPECT_EQ(2u, controller->num_dialogs_); } // Test transitioning from IdP sign-in status mismatch failure dialog to regular @@ -601,8 +600,7 @@ EXPECT_EQ(TestAccountSelectionView::SheetType::kVerifying, account_selection_view_->sheet_type_); - // Failure bubble should have been re-used for sign-in dialog. - EXPECT_EQ(1u, controller->num_dialogs_); + EXPECT_EQ(2u, controller->num_dialogs_); } TEST_F(FedCmAccountSelectionViewDesktopTest, AutoReauthnSingleAccountFlow) { @@ -1248,8 +1246,7 @@ EXPECT_THAT(account_selection_view_->account_ids_, testing::ElementsAre(kAccountId1)); - // Failure bubble should have been re-used for sign-in dialog. - EXPECT_EQ(1u, controller->num_dialogs_); + EXPECT_EQ(2u, controller->num_dialogs_); } // Test the use another account flow, resulting in the new account being shown @@ -1719,6 +1716,33 @@ dialog_widget_.reset(); } +TEST_F(FedCmAccountSelectionViewDesktopTest, MultiIdpMismatchAndShow) { + std::vector<IdentityProviderDisplayData> idp_list = { + CreateIdentityProviderDisplayData({{kAccountId1, LoginState::kSignUp}}), + CreateIdentityProviderDisplayData(/*account_infos=*/{}, + /*has_login_status_mismatch=*/true)}; + std::unique_ptr<TestFedCmAccountSelectionView> controller = + CreateAndShowMultiIdp(idp_list, SignInMode::kExplicit, + blink::mojom::RpMode::kWidget); + + // Emulate user clicking on "Continue" button in the mismatch dialog. + AccountSelectionViewBase::Observer* observer = + static_cast<AccountSelectionViewBase::Observer*>(controller.get()); + observer->OnLoginToIdP(GURL(kConfigUrl), GURL(kLoginUrl), CreateMouseEvent()); + CreateAndShowPopupWindow(*controller); + controller->CloseModalDialog(); + + std::vector<content::IdentityRequestAccount> new_accounts = + CreateAccount(LoginState::kSignUp); + content::IdentityProviderData new_idp_data = + CreateIdentityProviderData(new_accounts); + + Show(*controller, new_accounts, SignInMode::kExplicit, + blink::mojom::RpMode::kButton, new_idp_data); + + EXPECT_EQ(2u, controller->num_dialogs_); +} + // Tests that if a single account chooser is opened in button flow mode, // selecting an account shows the request permission sheet. Then, confirming the // account on the request permission sheet shows the verifying sheet.
diff --git a/chrome/browser/ui/web_applications/app_browser_controller.cc b/chrome/browser/ui/web_applications/app_browser_controller.cc index 60e687a..9ac986a 100644 --- a/chrome/browser/ui/web_applications/app_browser_controller.cc +++ b/chrome/browser/ui/web_applications/app_browser_controller.cc
@@ -4,10 +4,11 @@ #include "chrome/browser/ui/web_applications/app_browser_controller.h" +#include <string_view> + #include "base/feature_list.h" #include "base/functional/bind.h" #include "base/strings/escape.h" -#include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" @@ -165,7 +166,7 @@ return false; GURL start_url = GetAppStartUrl(); - base::StringPiece start_url_scheme = start_url.scheme_piece(); + std::string_view start_url_scheme = start_url.scheme_piece(); bool is_internal_start_url_scheme = start_url_scheme == extensions::kExtensionScheme ||
diff --git a/chrome/browser/ui/web_applications/sub_apps_permissions_policy_browsertest.cc b/chrome/browser/ui/web_applications/sub_apps_permissions_policy_browsertest.cc index 22c4120..577c5a4e 100644 --- a/chrome/browser/ui/web_applications/sub_apps_permissions_policy_browsertest.cc +++ b/chrome/browser/ui/web_applications/sub_apps_permissions_policy_browsertest.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string_view> + #include "base/files/file_util.h" #include "base/test/gmock_expected_support.h" #include "base/test/test_future.h" @@ -33,7 +35,7 @@ web_package::WebBundleSigner::Ed25519KeyPair::CreateRandom(); TestSignedWebBundle CreateBundle() const { - constexpr base::StringPiece manifest = + constexpr std::string_view manifest = R"({ "name": "Sub apps test app", "id": "/",
diff --git a/chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.cc b/chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.cc index e192c140..53c2b895 100644 --- a/chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.cc +++ b/chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <string_view> #include "base/files/file_path.h" #include "base/test/test_future.h" @@ -90,7 +91,7 @@ content::RenderFrameHost* IsolatedWebAppBrowserTestHarness::OpenApp( const webapps::AppId& app_id, - base::StringPiece path) { + std::string_view path) { return OpenIsolatedWebApp(profile(), app_id, path); } @@ -141,7 +142,7 @@ content::RenderFrameHost* OpenIsolatedWebApp(Profile* profile, const webapps::AppId& app_id, - base::StringPiece path) { + std::string_view path) { WebAppRegistrar& registrar = WebAppProvider::GetForWebApps(profile)->registrar_unsafe(); const WebApp* app = registrar.GetAppById(app_id);
diff --git a/chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h b/chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h index 1a0068e..3cf90749 100644 --- a/chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h +++ b/chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h
@@ -7,6 +7,7 @@ #include <memory> #include <string> +#include <string_view> #include "base/files/file_path.h" #include "base/files/file_util.h" @@ -58,7 +59,7 @@ IsolatedWebAppUrlInfo InstallDevModeProxyIsolatedWebApp( const url::Origin& origin); content::RenderFrameHost* OpenApp(const webapps::AppId& app_id, - base::StringPiece path = ""); + std::string_view path = ""); content::RenderFrameHost* NavigateToURLInNewTab( Browser* window, const GURL& url, @@ -83,7 +84,7 @@ content::RenderFrameHost* OpenIsolatedWebApp(Profile* profile, const webapps::AppId& app_id, - base::StringPiece path = ""); + std::string_view path = ""); void CreateIframe(content::RenderFrameHost* parent_frame, const std::string& iframe_id,
diff --git a/chrome/browser/ui/web_applications/test/web_app_browsertest_util.cc b/chrome/browser/ui/web_applications/test/web_app_browsertest_util.cc index e607b8c..ada4ff64 100644 --- a/chrome/browser/ui/web_applications/test/web_app_browsertest_util.cc +++ b/chrome/browser/ui/web_applications/test/web_app_browsertest_util.cc
@@ -7,6 +7,7 @@ #include <memory> #include <ostream> #include <string> +#include <string_view> #include <utility> #include "base/check.h" @@ -438,7 +439,7 @@ run_loop_.Quit(); } -base::FilePath CreateTestFileWithExtension(base::StringPiece extension) { +base::FilePath CreateTestFileWithExtension(std::string_view extension) { // CreateTemporaryFile blocks, temporarily allow blocking. base::ScopedAllowBlockingForTesting allow_blocking;
diff --git a/chrome/browser/ui/web_applications/test/web_app_browsertest_util.h b/chrome/browser/ui/web_applications/test/web_app_browsertest_util.h index 562cd36..a96827b 100644 --- a/chrome/browser/ui/web_applications/test/web_app_browsertest_util.h +++ b/chrome/browser/ui/web_applications/test/web_app_browsertest_util.h
@@ -5,12 +5,13 @@ #ifndef CHROME_BROWSER_UI_WEB_APPLICATIONS_TEST_WEB_APP_BROWSERTEST_UTIL_H_ #define CHROME_BROWSER_UI_WEB_APPLICATIONS_TEST_WEB_APP_BROWSERTEST_UTIL_H_ +#include <string_view> + #include "base/functional/callback.h" #include "base/location.h" #include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/scoped_observation.h" -#include "base/strings/string_piece.h" #include "chrome/browser/ui/browser_list_observer.h" #include "chrome/browser/web_applications/externally_managed_app_manager.h" #include "chrome/browser/web_applications/web_app_constants.h" @@ -166,7 +167,7 @@ }; // Creates a temporary file with the |extension|. -base::FilePath CreateTestFileWithExtension(base::StringPiece extension); +base::FilePath CreateTestFileWithExtension(std::string_view extension); // Wait for an IPH bubble to show up inside the browser, and return true or // false based on whether the bubble showed up.
diff --git a/chrome/browser/ui/web_applications/web_share_target_browsertest.cc b/chrome/browser/ui/web_applications/web_share_target_browsertest.cc index a9ea229..2def279a 100644 --- a/chrome/browser/ui/web_applications/web_share_target_browsertest.cc +++ b/chrome/browser/ui/web_applications/web_share_target_browsertest.cc
@@ -4,6 +4,7 @@ #include <limits> #include <string> +#include <string_view> #include <vector> #include "base/files/file.h" @@ -82,8 +83,8 @@ #endif // BUILDFLAG(IS_CHROMEOS_ASH) base::FilePath StoreSharedFile(const base::FilePath& directory, - const base::StringPiece name, - const base::StringPiece content) { + const std::string_view name, + const std::string_view content) { const base::FilePath path = directory.Append(name); base::ScopedAllowBlockingForTesting allow_blocking; base::File file(path,
diff --git a/chrome/browser/ui/webauthn/account_hover_list_model.cc b/chrome/browser/ui/webauthn/account_hover_list_model.cc index e8a8e49d..9e5e08a 100644 --- a/chrome/browser/ui/webauthn/account_hover_list_model.cc +++ b/chrome/browser/ui/webauthn/account_hover_list_model.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/webauthn/account_hover_list_model.h" #include <string> +#include <string_view> #include "base/functional/bind.h" #include "base/strings/utf_string_conversions.h" @@ -22,7 +23,7 @@ constexpr size_t kIconSize = 20; namespace { -std::u16string NameTokenForDisplay(base::StringPiece name_token) { +std::u16string NameTokenForDisplay(std::string_view name_token) { if (name_token.empty()) { return l10n_util::GetStringUTF16(IDS_WEBAUTHN_UNKNOWN_ACCOUNT); }
diff --git a/chrome/browser/ui/webui/about/about_ui.cc b/chrome/browser/ui/webui/about/about_ui.cc index 7df47ba..04e52006 100644 --- a/chrome/browser/ui/webui/about/about_ui.cc +++ b/chrome/browser/ui/webui/about/about_ui.cc
@@ -10,6 +10,7 @@ #include <algorithm> #include <memory> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -701,7 +702,7 @@ } std::string AboutUIHTMLSource::GetMimeType(const GURL& url) { - const base::StringPiece path = url.path_piece().substr(1); + const std::string_view path = url.path_piece().substr(1); if (path == kCreditsJsPath || path == kStatsJsPath || path == kStringsJsPath) { return "application/javascript";
diff --git a/chrome/browser/ui/webui/about/about_ui_unittest.cc b/chrome/browser/ui/webui/about/about_ui_unittest.cc index 92e5996..ea1c214 100644 --- a/chrome/browser/ui/webui/about/about_ui_unittest.cc +++ b/chrome/browser/ui/webui/about/about_ui_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <string_view> #include "base/base64.h" #include "base/containers/contains.h" @@ -15,7 +16,6 @@ #include "base/functional/callback_helpers.h" #include "base/memory/ref_counted_memory.h" #include "base/strings/strcat.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "chrome/common/url_constants.h" #include "chrome/common/webui_url_constants.h" @@ -64,7 +64,7 @@ void OnDataReceived(scoped_refptr<base::RefCountedMemory> bytes) { data_received_ = true; - data_ = std::string(base::StringPiece( + data_ = std::string(std::string_view( reinterpret_cast<const char*>(bytes->front()), bytes->size())); }
diff --git a/chrome/browser/ui/webui/app_home/app_home_page_handler_browsertest.cc b/chrome/browser/ui/webui/app_home/app_home_page_handler_browsertest.cc index 5c659d7..7c54648e2 100644 --- a/chrome/browser/ui/webui/app_home/app_home_page_handler_browsertest.cc +++ b/chrome/browser/ui/webui/app_home/app_home_page_handler_browsertest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/webui/app_home/app_home_page_handler.h" +#include <string_view> #include <utility> #include <vector> @@ -149,7 +150,7 @@ auto app_info = std::make_unique<web_app::WebAppInstallInfo>(); app_info->start_url = GURL(kTestAppUrl); app_info->scope = GURL(kTestAppUrl); - app_info->title = base::UTF8ToUTF16(base::StringPiece(test_app_name)); + app_info->title = base::UTF8ToUTF16(std::string_view(test_app_name)); app_info->manifest_url = GURL(kTestManifestUrl); return app_info;
diff --git a/chrome/browser/ui/webui/browser_switch/browser_switch_ui.cc b/chrome/browser/ui/webui/browser_switch/browser_switch_ui.cc index 91cf627..8f7c136d 100644 --- a/chrome/browser/ui/webui/browser_switch/browser_switch_ui.cc +++ b/chrome/browser/ui/webui/browser_switch/browser_switch_ui.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/browser_switch/browser_switch_ui.h" #include <memory> +#include <string_view> #include "base/functional/bind.h" #include "base/metrics/histogram_macros.h" @@ -451,10 +452,10 @@ auto* service = GetBrowserSwitcherService(web_ui()); browser_switcher::Decision decision = service->sitelist()->GetDecision(url); - base::StringPiece action_name = + std::string_view action_name = (decision.action == browser_switcher::kStay) ? "stay" : "go"; - base::StringPiece reason_name; + std::string_view reason_name; switch (decision.reason) { case browser_switcher::kDisabled: reason_name = "globally_disabled";
diff --git a/chrome/browser/ui/webui/certificate_provisioning_ui_handler_unittest.cc b/chrome/browser/ui/webui/certificate_provisioning_ui_handler_unittest.cc index 055476a9..0efc7cfe 100644 --- a/chrome/browser/ui/webui/certificate_provisioning_ui_handler_unittest.cc +++ b/chrome/browser/ui/webui/certificate_provisioning_ui_handler_unittest.cc
@@ -8,6 +8,7 @@ #include <memory> #include <optional> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -111,7 +112,7 @@ // Parses |input| as JSON, replaces string fields that match the placeholder // format "$0" with the corresponding translated message from |message_ids|. -base::Value FormatJsonDict(const base::StringPiece input, +base::Value FormatJsonDict(const std::string_view input, std::vector<std::string> messages) { base::Value parsed = base::test::ParseJson(input); FormatDictRecurse(&parsed, messages);
diff --git a/chrome/browser/ui/webui/certificate_viewer_webui.cc b/chrome/browser/ui/webui/certificate_viewer_webui.cc index 5e16cbc..d86c76d2 100644 --- a/chrome/browser/ui/webui/certificate_viewer_webui.cc +++ b/chrome/browser/ui/webui/certificate_viewer_webui.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/certificate_viewer_webui.h" #include <memory> +#include <string_view> #include <utility> #include "base/functional/bind.h" @@ -13,7 +14,6 @@ #include "base/json/json_writer.h" #include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" @@ -49,7 +49,7 @@ class CertNodeBuilder { public: // Starts the node with "label" set to |label|. - explicit CertNodeBuilder(base::StringPiece label); + explicit CertNodeBuilder(std::string_view label); // Convenience version: Converts |label_id| to the corresponding resource // string, then delegates to the other constructor. @@ -62,7 +62,7 @@ // expressions. // Sets the "payload.val" field. Call this at most once. - CertNodeBuilder& Payload(base::StringPiece payload); + CertNodeBuilder& Payload(std::string_view payload); // Adds |child| in the list keyed "children". Can be called multiple times. CertNodeBuilder& Child(base::Value::Dict child); @@ -83,14 +83,14 @@ bool built_ = false; }; -CertNodeBuilder::CertNodeBuilder(base::StringPiece label) { +CertNodeBuilder::CertNodeBuilder(std::string_view label) { node_.Set("label", label); } CertNodeBuilder::CertNodeBuilder(int label_id) : CertNodeBuilder(l10n_util::GetStringUTF8(label_id)) {} -CertNodeBuilder& CertNodeBuilder::Payload(base::StringPiece payload) { +CertNodeBuilder& CertNodeBuilder::Payload(std::string_view payload) { DCHECK(!node_.FindByDottedPath("payload.val")); node_.SetByDottedPath("payload.val", payload); return *this;
diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc b/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc index a6f9525..74139550 100644 --- a/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc +++ b/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc
@@ -4,9 +4,9 @@ #include <algorithm> #include <memory> +#include <string_view> #include <utility> -#include "base/strings/string_piece.h" #include "base/test/scoped_feature_list.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -195,7 +195,7 @@ enabled_features.push_back(user_notes::kUserNotes); #if !BUILDFLAG(IS_CHROMEOS) - if (GetParam() == base::StringPiece("chrome://welcome")) { + if (GetParam() == std::string_view("chrome://welcome")) { enabled_features.push_back(welcome::kForceEnabled); } #endif @@ -210,7 +210,7 @@ feature_list_.InitWithFeatures(enabled_features, {}); } - void CheckNoTrustedTypesViolation(base::StringPiece url) { + void CheckNoTrustedTypesViolation(std::string_view url) { const std::string kMessageFilter = "*Refused to create a TrustedTypePolicy*"; content::WebContents* content = @@ -224,7 +224,7 @@ EXPECT_TRUE(console_observer.messages().empty()); } - void CheckTrustedTypesEnabled(base::StringPiece url) { + void CheckTrustedTypesEnabled(std::string_view url) { content::WebContents* content = browser()->tab_strip_model()->GetActiveWebContents(); ASSERT_TRUE(embedded_test_server()->Start()); @@ -260,7 +260,7 @@ void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII(ash::switches::kSamlPasswordChangeUrl, "http://password-change.example"); - if (GetParam() == base::StringPiece("chrome://shimless-rma")) { + if (GetParam() == std::string_view("chrome://shimless-rma")) { command_line->AppendSwitchASCII(ash::switches::kLaunchRma, ""); } }
diff --git a/chrome/browser/ui/webui/chrome_web_ui_configs.cc b/chrome/browser/ui/webui/chrome_web_ui_configs.cc index 4db2f01d..991e6d7 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_configs.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_configs.cc
@@ -23,11 +23,14 @@ #endif #include "chrome/browser/ui/webui/bookmarks/bookmarks_ui.h" #include "chrome/browser/ui/webui/commerce/product_specifications_ui.h" +#include "chrome/browser/ui/webui/commerce/shopping_insights_side_panel_ui.h" #include "chrome/browser/ui/webui/downloads/downloads_ui.h" #include "chrome/browser/ui/webui/feedback/feedback_ui.h" #include "chrome/browser/ui/webui/history/history_ui.h" #include "chrome/browser/ui/webui/lens/search_bubble_ui.h" #include "chrome/browser/ui/webui/on_device_internals/on_device_internals_ui.h" +#include "chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_side_panel_ui.h" +#include "chrome/browser/ui/webui/side_panel/reading_list/reading_list_ui.h" #include "chrome/browser/ui/webui/tab_search/tab_search_ui.h" #endif // !BUILDFLAG(IS_ANDROID) @@ -71,14 +74,17 @@ #if BUILDFLAG(GOOGLE_CHROME_BRANDING) map.AddWebUIConfig(std::make_unique<media_router::CastFeedbackUIConfig>()); #endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) - map.AddWebUIConfig(std::make_unique<FeedbackUIConfig>()); - map.AddWebUIConfig(std::make_unique<OnDeviceInternalsUIConfig>()); + map.AddWebUIConfig(std::make_unique<BookmarksSidePanelUIConfig>()); map.AddWebUIConfig(std::make_unique<BookmarksUIConfig>()); - map.AddWebUIConfig( - std::make_unique<commerce::ProductSpecificationsUIConfig>()); map.AddWebUIConfig(std::make_unique<DownloadsUIConfig>()); + map.AddWebUIConfig(std::make_unique<FeedbackUIConfig>()); map.AddWebUIConfig(std::make_unique<HistoryUIConfig>()); map.AddWebUIConfig(std::make_unique<lens::SearchBubbleUIConfig>()); + map.AddWebUIConfig(std::make_unique<OnDeviceInternalsUIConfig>()); + map.AddWebUIConfig( + std::make_unique<commerce::ProductSpecificationsUIConfig>()); + map.AddWebUIConfig(std::make_unique<ReadingListUIConfig>()); + map.AddWebUIConfig(std::make_unique<ShoppingInsightsSidePanelUIConfig>()); map.AddWebUIConfig(std::make_unique<TabSearchUIConfig>()); #endif // !BUILDFLAG(IS_ANDROID)
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index 97aa85ad..d2e6b9c5 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -135,7 +135,6 @@ #include "chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h" #include "chrome/browser/ui/webui/app_service_internals/app_service_internals_ui.h" #include "chrome/browser/ui/webui/bookmarks/bookmarks_ui.h" -#include "chrome/browser/ui/webui/commerce/shopping_insights_side_panel_ui.h" #include "chrome/browser/ui/webui/devtools/devtools_ui.h" #include "chrome/browser/ui/webui/downloads/downloads_ui.h" #include "chrome/browser/ui/webui/history/history_ui.h" @@ -155,11 +154,9 @@ #include "chrome/browser/ui/webui/search_engine_choice/search_engine_choice_ui.h" #include "chrome/browser/ui/webui/settings/settings_ui.h" #include "chrome/browser/ui/webui/settings/settings_utils.h" -#include "chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_side_panel_ui.h" #include "chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_ui.h" #include "chrome/browser/ui/webui/side_panel/history_clusters/history_clusters_side_panel_ui.h" #include "chrome/browser/ui/webui/side_panel/performance_controls/performance_side_panel_ui.h" -#include "chrome/browser/ui/webui/side_panel/reading_list/reading_list_ui.h" #include "chrome/browser/ui/webui/side_panel/user_notes/user_notes_side_panel_ui.h" #include "chrome/browser/ui/webui/signin/sync_confirmation_ui.h" #include "chrome/browser/ui/webui/support_tool/support_tool_ui.h" @@ -550,13 +547,6 @@ if (url.host_piece() == chrome::kChromeUINewTabPageThirdPartyHost) return &NewWebUI<NewTabPageThirdPartyUI>; } - if (url.host_piece() == chrome::kChromeUIReadLaterHost) - return &NewWebUI<ReadingListUI>; - if (url.host_piece() == chrome::kChromeUIBookmarksSidePanelHost) - return &NewWebUI<BookmarksSidePanelUI>; - if (url.host_piece() == commerce::kChromeUIShoppingInsightsSidePanelHost) { - return &NewWebUI<ShoppingInsightsSidePanelUI>; - } if (url.host_piece() == chrome::kChromeUICustomizeChromeSidePanelHost && customize_chrome::IsSidePanelEnabled()) { return &NewWebUI<CustomizeChromeUI>;
diff --git a/chrome/browser/ui/webui/commerce/shopping_insights_side_panel_ui.cc b/chrome/browser/ui/webui/commerce/shopping_insights_side_panel_ui.cc index 2bf653a3..422b0d9 100644 --- a/chrome/browser/ui/webui/commerce/shopping_insights_side_panel_ui.cc +++ b/chrome/browser/ui/webui/commerce/shopping_insights_side_panel_ui.cc
@@ -25,12 +25,26 @@ #include "components/strings/grit/components_strings.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_data_source.h" +#include "content/public/common/url_constants.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" #include "ui/webui/color_change_listener/color_change_handler.h" #include "ui/webui/resources/cr_components/commerce/shopping_service.mojom.h" +ShoppingInsightsSidePanelUIConfig::ShoppingInsightsSidePanelUIConfig() + : WebUIConfig(content::kChromeUIScheme, + commerce::kChromeUIShoppingInsightsSidePanelHost) {} + +ShoppingInsightsSidePanelUIConfig::~ShoppingInsightsSidePanelUIConfig() = + default; + +std::unique_ptr<content::WebUIController> +ShoppingInsightsSidePanelUIConfig::CreateWebUIController(content::WebUI* web_ui, + const GURL& url) { + return std::make_unique<ShoppingInsightsSidePanelUI>(web_ui); +} + ShoppingInsightsSidePanelUI::ShoppingInsightsSidePanelUI(content::WebUI* web_ui) : TopChromeWebUIController(web_ui) { Profile* profile = Profile::FromWebUI(web_ui);
diff --git a/chrome/browser/ui/webui/commerce/shopping_insights_side_panel_ui.h b/chrome/browser/ui/webui/commerce/shopping_insights_side_panel_ui.h index c756bbfe..5449f5a 100644 --- a/chrome/browser/ui/webui/commerce/shopping_insights_side_panel_ui.h +++ b/chrome/browser/ui/webui/commerce/shopping_insights_side_panel_ui.h
@@ -10,6 +10,7 @@ #include "chrome/browser/ui/webui/top_chrome/top_chrome_web_ui_controller.h" #include "chrome/browser/ui/webui/webui_load_timer.h" #include "components/page_image_service/mojom/page_image_service.mojom.h" +#include "content/public/browser/webui_config.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" @@ -20,6 +21,17 @@ class ColorChangeHandler; } +class ShoppingInsightsSidePanelUIConfig : public content::WebUIConfig { + public: + ShoppingInsightsSidePanelUIConfig(); + ~ShoppingInsightsSidePanelUIConfig() override; + + // content::WebUIConfig: + std::unique_ptr<content::WebUIController> CreateWebUIController( + content::WebUI* web_ui, + const GURL& url) override; +}; + namespace commerce { class ShoppingServiceHandler; } // namespace commerce
diff --git a/chrome/browser/ui/webui/conflicts/conflicts_data_fetcher.cc b/chrome/browser/ui/webui/conflicts/conflicts_data_fetcher.cc index a1e904f..1e2474b 100644 --- a/chrome/browser/ui/webui/conflicts/conflicts_data_fetcher.cc +++ b/chrome/browser/ui/webui/conflicts/conflicts_data_fetcher.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/conflicts/conflicts_data_fetcher.h" #include <string> +#include <string_view> #include <utility> #include "base/strings/string_util.h" @@ -64,7 +65,7 @@ "Allowed - In executable directory (dev builds only)"; #endif -void AppendString(base::StringPiece input, std::string* output) { +void AppendString(std::string_view input, std::string* output) { if (!output->empty()) *output += ", "; output->append(input);
diff --git a/chrome/browser/ui/webui/devtools/devtools_ui_data_source_unittest.cc b/chrome/browser/ui/webui/devtools/devtools_ui_data_source_unittest.cc index 958d03d..d294707 100644 --- a/chrome/browser/ui/webui/devtools/devtools_ui_data_source_unittest.cc +++ b/chrome/browser/ui/webui/devtools/devtools_ui_data_source_unittest.cc
@@ -5,13 +5,13 @@ #include "chrome/browser/ui/webui/devtools/devtools_ui_data_source.h" #include <memory> +#include <string_view> #include "base/command_line.h" #include "base/functional/bind.h" #include "base/memory/ref_counted_memory.h" #include "base/memory/scoped_refptr.h" #include "base/strings/strcat.h" -#include "base/strings/string_piece.h" #include "base/test/bind.h" #include "build/build_config.h" #include "chrome/common/chrome_switches.h" @@ -109,7 +109,7 @@ void OnDataReceived(scoped_refptr<base::RefCountedMemory> bytes) { data_received_ = true; if (bytes.get()) { - data_ = std::string(base::StringPiece( + data_ = std::string(std::string_view( reinterpret_cast<const char*>(bytes->front()), bytes->size())); } }
diff --git a/chrome/browser/ui/webui/extensions/extension_icon_source.cc b/chrome/browser/ui/webui/extensions/extension_icon_source.cc index 0e39174..9a77460 100644 --- a/chrome/browser/ui/webui/extensions/extension_icon_source.cc +++ b/chrome/browser/ui/webui/extensions/extension_icon_source.cc
@@ -7,6 +7,7 @@ #include <stddef.h> #include <memory> +#include <string_view> #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" @@ -97,7 +98,7 @@ // static SkBitmap* ExtensionIconSource::LoadImageByResourceId(int resource_id) { - base::StringPiece contents = + std::string_view contents = ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( resource_id, ui::k100Percent);
diff --git a/chrome/browser/ui/webui/extensions/extensions_internals_source.cc b/chrome/browser/ui/webui/extensions/extensions_internals_source.cc index c1c606b..f03f3ad 100644 --- a/chrome/browser/ui/webui/extensions/extensions_internals_source.cc +++ b/chrome/browser/ui/webui/extensions/extensions_internals_source.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <string_view> #include <utility> #include "base/containers/flat_map.h" @@ -14,7 +15,6 @@ #include "base/memory/ref_counted_memory.h" #include "base/numerics/safe_conversions.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/values.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/webui_url_constants.h" @@ -339,39 +339,39 @@ // "type": STRING // "version": STRING -constexpr base::StringPiece kActivitesKey = "activites"; -constexpr base::StringPiece kBackgroundPageKeepalivesKey = +constexpr std::string_view kActivitesKey = "activites"; +constexpr std::string_view kBackgroundPageKeepalivesKey = "background_page_keepalives"; -constexpr base::StringPiece kCountKey = "count"; -constexpr base::StringPiece kEventNameKey = "event_name"; -constexpr base::StringPiece kEventsListenersKey = "event_listeners"; -constexpr base::StringPiece kExtraDataKey = "extra_data"; -constexpr base::StringPiece kFilterKey = "filter"; -constexpr base::StringPiece kInternalsCreationFlagsKey = "creation_flags"; -constexpr base::StringPiece kInternalsDisableReasonsKey = "disable_reasons"; -constexpr base::StringPiece kInternalsIdKey = "id"; -constexpr base::StringPiece kInternalsNameKey = "name"; -constexpr base::StringPiece kInternalsVersionKey = "version"; -constexpr base::StringPiece kIsForServiceWorkerKey = "is_for_service_worker"; -constexpr base::StringPiece kIsLazyKey = "is_lazy"; -constexpr base::StringPiece kListenersKey = "listeners"; -constexpr base::StringPiece kListenerUrlKey = "url"; -constexpr base::StringPiece kLocationKey = "location"; -constexpr base::StringPiece kManifestVersionKey = "manifest_version"; -constexpr base::StringPiece kPathKey = "path"; -constexpr base::StringPiece kPermissionsKey = "permissions"; -constexpr base::StringPiece kPermissionsActiveKey = "active"; -constexpr base::StringPiece kPermissionsOptionalKey = "optional"; -constexpr base::StringPiece kPermissionsTabSpecificKey = "tab_specific"; -constexpr base::StringPiece kPermissionsWithheldKey = "withheld"; -constexpr base::StringPiece kPermissionsApiKey = "api"; -constexpr base::StringPiece kPermissionsManifestKey = "manifest"; -constexpr base::StringPiece kPermissionsExplicitHostsKey = "explicit_hosts"; -constexpr base::StringPiece kPermissionsScriptableHostsKey = "scriptable_hosts"; -constexpr base::StringPiece kServiceWorkerKeepalivesKey = +constexpr std::string_view kCountKey = "count"; +constexpr std::string_view kEventNameKey = "event_name"; +constexpr std::string_view kEventsListenersKey = "event_listeners"; +constexpr std::string_view kExtraDataKey = "extra_data"; +constexpr std::string_view kFilterKey = "filter"; +constexpr std::string_view kInternalsCreationFlagsKey = "creation_flags"; +constexpr std::string_view kInternalsDisableReasonsKey = "disable_reasons"; +constexpr std::string_view kInternalsIdKey = "id"; +constexpr std::string_view kInternalsNameKey = "name"; +constexpr std::string_view kInternalsVersionKey = "version"; +constexpr std::string_view kIsForServiceWorkerKey = "is_for_service_worker"; +constexpr std::string_view kIsLazyKey = "is_lazy"; +constexpr std::string_view kListenersKey = "listeners"; +constexpr std::string_view kListenerUrlKey = "url"; +constexpr std::string_view kLocationKey = "location"; +constexpr std::string_view kManifestVersionKey = "manifest_version"; +constexpr std::string_view kPathKey = "path"; +constexpr std::string_view kPermissionsKey = "permissions"; +constexpr std::string_view kPermissionsActiveKey = "active"; +constexpr std::string_view kPermissionsOptionalKey = "optional"; +constexpr std::string_view kPermissionsTabSpecificKey = "tab_specific"; +constexpr std::string_view kPermissionsWithheldKey = "withheld"; +constexpr std::string_view kPermissionsApiKey = "api"; +constexpr std::string_view kPermissionsManifestKey = "manifest"; +constexpr std::string_view kPermissionsExplicitHostsKey = "explicit_hosts"; +constexpr std::string_view kPermissionsScriptableHostsKey = "scriptable_hosts"; +constexpr std::string_view kServiceWorkerKeepalivesKey = "service_worker_keepalives"; -constexpr base::StringPiece kTimeoutTypeKey = "timeout_type"; -constexpr base::StringPiece kTypeKey = "type"; +constexpr std::string_view kTimeoutTypeKey = "timeout_type"; +constexpr std::string_view kTypeKey = "type"; base::Value::Dict FormatBackgroundPageKeepaliveData( extensions::ProcessManager* process_manager, @@ -495,7 +495,7 @@ base::Value::List* data) { // A map of extension ID to the listener data for that extension, // which is of type LIST of DICTIONARY. - base::flat_map<base::StringPiece, base::Value::List> listeners_map; + base::flat_map<std::string_view, base::Value::List> listeners_map; // Build the map of extension IDs to the list of events. for (const auto& entry : event_router->listeners().listeners()) {
diff --git a/chrome/browser/ui/webui/family_link_user_internals/family_link_user_internals_message_handler.cc b/chrome/browser/ui/webui/family_link_user_internals/family_link_user_internals_message_handler.cc index e56ec3d..e5b5c8c 100644 --- a/chrome/browser/ui/webui/family_link_user_internals/family_link_user_internals_message_handler.cc +++ b/chrome/browser/ui/webui/family_link_user_internals/family_link_user_internals_message_handler.cc
@@ -5,11 +5,11 @@ #include "chrome/browser/ui/webui/family_link_user_internals/family_link_user_internals_message_handler.h" #include <memory> +#include <string_view> #include <utility> #include "base/functional/bind.h" #include "base/memory/ref_counted.h" -#include "base/strings/string_piece.h" #include "base/values.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_key.h" @@ -41,7 +41,7 @@ // section's contents, for use with |AddSectionEntry| below. Note that // |parent_list|, not the caller, owns the newly added section. base::Value::List* AddSection(base::Value::List* parent_list, - base::StringPiece title) { + std::string_view title) { base::Value::Dict section; base::Value::List section_contents; section.Set("title", title); @@ -54,7 +54,7 @@ // Adds a bool entry to a section (created with |AddSection| above). void AddSectionEntry(base::Value::List* section_list, - base::StringPiece name, + std::string_view name, bool value) { base::Value::Dict entry; entry.Set("stat_name", name); @@ -65,8 +65,8 @@ // Adds a string entry to a section (created with |AddSection| above). void AddSectionEntry(base::Value::List* section_list, - base::StringPiece name, - base::StringPiece value) { + std::string_view name, + std::string_view value) { base::Value::Dict entry; entry.Set("stat_name", name); entry.Set("stat_value", value);
diff --git a/chrome/browser/ui/webui/fileicon_source.cc b/chrome/browser/ui/webui/fileicon_source.cc index 2c5a10d..8252563d 100644 --- a/chrome/browser/ui/webui/fileicon_source.cc +++ b/chrome/browser/ui/webui/fileicon_source.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/fileicon_source.h" +#include <string_view> + #include "base/files/file_path.h" #include "base/functional/bind.h" #include "base/functional/callback.h" @@ -38,8 +40,7 @@ // URL parameter specifying scale factor. const char kScaleFactorParameter[] = "scale"; -IconLoader::IconSize SizeStringToIconSize( - const base::StringPiece& size_string) { +IconLoader::IconSize SizeStringToIconSize(std::string_view size_string) { if (size_string == "small") return IconLoader::SMALL; if (size_string == "large") return IconLoader::LARGE; // We default to NORMAL if we don't recognize the size_string. Including @@ -53,7 +54,7 @@ IconLoader::IconSize* icon_size) { GURL request = GURL(chrome::kChromeUIFileiconURL).Resolve(path); for (net::QueryIterator it(request); !it.IsAtEnd(); it.Advance()) { - const base::StringPiece key = it.GetKey(); + const std::string_view key = it.GetKey(); if (key == kPathParameter) { *file_path = base::FilePath::FromUTF8Unsafe(it.GetUnescapedValue()) .NormalizePathSeparators();
diff --git a/chrome/browser/ui/webui/internals/user_education/user_education_internals_page_handler_impl.cc b/chrome/browser/ui/webui/internals/user_education/user_education_internals_page_handler_impl.cc index ea75176..3f08bea4 100644 --- a/chrome/browser/ui/webui/internals/user_education/user_education_internals_page_handler_impl.cc +++ b/chrome/browser/ui/webui/internals/user_education/user_education_internals_page_handler_impl.cc
@@ -92,6 +92,8 @@ return "Toast"; case user_education::FeaturePromoSpecification::PromoType::kTutorial: return "Tutorial"; + case user_education::FeaturePromoSpecification::PromoType::kRotating: + return "Rotating"; } }
diff --git a/chrome/browser/ui/webui/intro/intro_ui.cc b/chrome/browser/ui/webui/intro/intro_ui.cc index 562b1a8..817af4c 100644 --- a/chrome/browser/ui/webui/intro/intro_ui.cc +++ b/chrome/browser/ui/webui/intro/intro_ui.cc
@@ -4,14 +4,10 @@ #include "chrome/browser/ui/webui/intro/intro_ui.h" -#include "base/feature_list.h" #include "base/notreached.h" -#include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/browser_management/management_service_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_attributes_storage.h" #include "chrome/browser/signin/signin_features.h" -#include "chrome/browser/ui/managed_ui.h" #include "chrome/browser/ui/webui/intro/intro_handler.h" #include "chrome/browser/ui/webui/webui_util.h" #include "chrome/common/webui_url_constants.h" @@ -22,14 +18,11 @@ #include "chrome/grit/intro_resources_map.h" #include "chrome/grit/signin_resources.h" #include "components/signin/public/base/signin_buildflags.h" -#include "components/signin/public/base/signin_switches.h" #include "components/strings/grit/components_branded_strings.h" #include "content/public/browser/web_ui_data_source.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/ui_base_features.h" IntroUI::IntroUI(content::WebUI* web_ui) : content::WebUIController(web_ui) { - DCHECK(base::FeatureList::IsEnabled(kForYouFre)); auto* profile = Profile::FromWebUI(web_ui); content::WebUIDataSource* source = content::WebUIDataSource::CreateAndAdd(
diff --git a/chrome/browser/ui/webui/management/management_ui_pwa_browsertest.cc b/chrome/browser/ui/webui/management/management_ui_pwa_browsertest.cc index cd049166..6e4c919 100644 --- a/chrome/browser/ui/webui/management/management_ui_pwa_browsertest.cc +++ b/chrome/browser/ui/webui/management/management_ui_pwa_browsertest.cc
@@ -31,18 +31,9 @@ constexpr char kTestApp[] = "https://test.test/"; class ManagementUIPWATest : public web_app::WebAppBrowserTestBase { - public: - ManagementUIPWATest() { BuildAndInitFeatureList(); } - - protected: - void BuildAndInitFeatureList() { - scoped_feature_list_.InitWithFeatures( - /*enabled_features=*/{features::kDesktopPWAsEnforceWebAppSettingsPolicy, - features::kDesktopPWAsRunOnOsLogin}, - /*disabled_features=*/{}); - } - - base::test::ScopedFeatureList scoped_feature_list_; + private: + base::test::ScopedFeatureList scoped_feature_list_{ + features::kDesktopPWAsRunOnOsLogin}; }; IN_PROC_BROWSER_TEST_F(ManagementUIPWATest, RunOnOsLoginApplicationsReported) {
diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc index d8b91e7..87daacde 100644 --- a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc +++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc
@@ -8,6 +8,7 @@ #include <iterator> #include <memory> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -26,7 +27,6 @@ #include "base/metrics/histogram_macros.h" #include "base/ranges/algorithm.h" #include "base/strings/strcat.h" -#include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" @@ -123,7 +123,7 @@ return false; } static constexpr auto kPrideThemeExtensionIdsDarkForeground = - base::MakeFixedFlatSet<base::StringPiece>({ + base::MakeFixedFlatSet<std::string_view>({ "klnkeldihpjnjoopojllmnpepbpljico", "iffdmpenldeofnlfjmbjcdmafhoekmka", "mckialangcdpcdcflekinnpamfkmkobo",
diff --git a/chrome/browser/ui/webui/new_tab_page/untrusted_source.cc b/chrome/browser/ui/webui/new_tab_page/untrusted_source.cc index 7e95371..c79f0b4 100644 --- a/chrome/browser/ui/webui/new_tab_page/untrusted_source.cc +++ b/chrome/browser/ui/webui/new_tab_page/untrusted_source.cc
@@ -6,6 +6,7 @@ #include <optional> #include <string> +#include <string_view> #include <utility> #include "base/base64.h" @@ -15,7 +16,6 @@ #include "base/memory/ref_counted_memory.h" #include "base/memory/scoped_refptr.h" #include "base/metrics/histogram_macros.h" -#include "base/strings/string_piece.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/task/task_traits.h" @@ -192,7 +192,7 @@ } std::string UntrustedSource::GetMimeType(const GURL& url) { - const base::StringPiece stripped_path = url.path_piece(); + const std::string_view stripped_path = url.path_piece(); if (base::EndsWith(stripped_path, ".js", base::CompareCase::INSENSITIVE_ASCII)) { return "application/javascript";
diff --git a/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc b/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc index 6fd48e8..9064cb6 100644 --- a/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc +++ b/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <string_view> #include <vector> #include "base/functional/bind.h" @@ -62,11 +63,11 @@ std::unique_ptr<ntp_tiles::MostVisitedSites> MakeMostVisitedSites() override; PrefService* GetPrefs() override; void RegisterMessageCallback( - base::StringPiece message, + std::string_view message, base::RepeatingCallback<void(const base::Value::List&)> callback) override; void CallJavascriptFunctionSpan( - base::StringPiece name, + std::string_view name, base::span<const base::ValueView> values) override; ntp_tiles::NTPTilesInternalsMessageHandler handler_; @@ -123,13 +124,13 @@ } void ChromeNTPTilesInternalsMessageHandlerClient::RegisterMessageCallback( - base::StringPiece message, + std::string_view message, base::RepeatingCallback<void(const base::Value::List&)> callback) { web_ui()->RegisterMessageCallback(message, std::move(callback)); } void ChromeNTPTilesInternalsMessageHandlerClient::CallJavascriptFunctionSpan( - base::StringPiece name, + std::string_view name, base::span<const base::ValueView> values) { web_ui()->CallJavascriptFunctionUnsafe(name, values); }
diff --git a/chrome/browser/ui/webui/omnibox_popup/omnibox_popup_ui.cc b/chrome/browser/ui/webui/omnibox_popup/omnibox_popup_ui.cc index 81f84a5..f43a7b5f 100644 --- a/chrome/browser/ui/webui/omnibox_popup/omnibox_popup_ui.cc +++ b/chrome/browser/ui/webui/omnibox_popup/omnibox_popup_ui.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/omnibox_popup/omnibox_popup_ui.h" #include <atomic> +#include <string_view> #include "base/strings/string_number_conversions.h" #include "chrome/browser/profiles/profile.h" @@ -55,15 +56,15 @@ const GURL& url = host->GetWebUI()->GetWebContents()->GetLastCommittedURL(); SessionID id = SessionID::InvalidValue(); if (url.is_valid() && url.has_query()) { - base::StringPiece spec(url.query_piece()); + std::string_view spec(url.query_piece()); url::Component query, key, value; query.len = static_cast<int>(spec.size()); while (url::ExtractQueryKeyValue(spec, &query, &key, &value)) { if (key.is_nonempty() && value.is_nonempty()) { - const base::StringPiece key_piece = spec.substr(key.begin, key.len); + const std::string_view key_piece = spec.substr(key.begin, key.len); constexpr char kSessionIdKey[] = "session_id"; if (key_piece == kSessionIdKey) { - const base::StringPiece value_piece = + const std::string_view value_piece = spec.substr(value.begin, value.len); int value_int = 0; if (base::StringToInt(value_piece, &value_int)) {
diff --git a/chrome/browser/ui/webui/policy/policy_test_ui_browsertest.cc b/chrome/browser/ui/webui/policy/policy_test_ui_browsertest.cc index e27325a..f223be5 100644 --- a/chrome/browser/ui/webui/policy/policy_test_ui_browsertest.cc +++ b/chrome/browser/ui/webui/policy/policy_test_ui_browsertest.cc
@@ -4,6 +4,8 @@ #include <stddef.h> +#include <string_view> + #include "base/test/mock_callback.h" #include "base/test/scoped_feature_list.h" #include "build/build_config.h" @@ -224,7 +226,7 @@ #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) void SetUpRelaunchChromeOverrideForPRETests() { - base::StringPiece test_name = + std::string_view test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); if (base::StartsWith(test_name, "PRE_")) {
diff --git a/chrome/browser/ui/webui/print_preview/local_printer_handler_default_unittest.cc b/chrome/browser/ui/webui/print_preview/local_printer_handler_default_unittest.cc index dc04600..6fa6802 100644 --- a/chrome/browser/ui/webui/print_preview/local_printer_handler_default_unittest.cc +++ b/chrome/browser/ui/webui/print_preview/local_printer_handler_default_unittest.cc
@@ -6,12 +6,12 @@ #include <functional> #include <memory> +#include <string_view> #include <utility> #include "base/json/json_string_value_serializer.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_refptr.h" -#include "base/strings/string_piece.h" #include "base/task/single_thread_task_runner.h" #include "base/values.h" #include "chrome/common/printing/printer_capabilities.h" @@ -135,7 +135,7 @@ // Converts JSON string to `base::Value` object. // On failure, fills `error` string and the return value is not a list. -base::Value GetJSONAsValue(const base::StringPiece& json, std::string& error) { +base::Value GetJSONAsValue(std::string_view json, std::string& error) { return base::Value::FromUniquePtrValue( JSONStringValueDeserializer(json).Deserialize(nullptr, &error)); } @@ -587,7 +587,7 @@ EXPECT_EQ(call_count, 1u); EXPECT_TRUE(is_done); - constexpr base::StringPiece expected_list = R"( + constexpr std::string_view expected_list = R"( [ { "deviceName": "printer1",
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc index 317535c..286330b88 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc
@@ -7,6 +7,7 @@ #include <map> #include <optional> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -159,7 +160,7 @@ return print_ticket; } -base::Value::List ConstructPreviewArgs(base::StringPiece callback_id, +base::Value::List ConstructPreviewArgs(std::string_view callback_id, const base::Value::Dict& print_ticket) { base::Value::List args; args.Append(callback_id);
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_utils_unittest.cc b/chrome/browser/ui/webui/print_preview/print_preview_utils_unittest.cc index 007cee8..ddc133f5 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_utils_unittest.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_utils_unittest.cc
@@ -2,11 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/ui/webui/print_preview/print_preview_utils.h" + #include <memory> +#include <string_view> #include "base/strings/string_number_conversions.h" #include "base/test/values_test_util.h" -#include "chrome/browser/ui/webui/print_preview/print_preview_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/geometry/size.h" @@ -124,7 +126,7 @@ void CompareStringKeys(const base::Value::Dict& expected, const base::Value::Dict& actual, - base::StringPiece key) { + std::string_view key) { EXPECT_EQ(*expected.FindString(key), *actual.FindString(key)); }
diff --git a/chrome/browser/ui/webui/settings/about_handler.cc b/chrome/browser/ui/webui/settings/about_handler.cc index 0794658b..16b6ff6 100644 --- a/chrome/browser/ui/webui/settings/about_handler.cc +++ b/chrome/browser/ui/webui/settings/about_handler.cc
@@ -8,6 +8,7 @@ #include <limits> #include <string> +#include <string_view> #include "base/command_line.h" #include "base/files/file_path.h" @@ -151,7 +152,7 @@ // Returns the relative path under the chromeos-assets dir // to the directory of regulatory labels for a given region, if found // (e.g. "regulatory_labels/us"). Must be called from the blocking pool. -base::FilePath GetRegulatoryLabelDirForRegion(base::StringPiece region) { +base::FilePath GetRegulatoryLabelDirForRegion(std::string_view region) { base::FilePath region_path(kRegulatoryLabelsDirectory); const std::string model_subdir = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( @@ -176,7 +177,7 @@ base::FilePath FindRegulatoryLabelDir() { base::FilePath region_path; // Use the VPD region code to find the label dir. - const std::optional<base::StringPiece> region = + const std::optional<std::string_view> region = ash::system::StatisticsProvider::GetInstance()->GetMachineStatistic( ash::system::kRegionKey); if (region && !region->empty()) {
diff --git a/chrome/browser/ui/webui/settings/safety_hub_handler.cc b/chrome/browser/ui/webui/settings/safety_hub_handler.cc index ffcacdc..0a3b46e 100644 --- a/chrome/browser/ui/webui/settings/safety_hub_handler.cc +++ b/chrome/browser/ui/webui/settings/safety_hub_handler.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/settings/safety_hub_handler.h" #include <memory> +#include <string_view> #include "base/check.h" #include "base/json/values_util.h" @@ -298,7 +299,7 @@ stored_value.GetDict().FindList(permissions::kRevokedKey)->Clone(); base::Value::List permissions_value_list; for (base::Value& type : type_list) { - base::StringPiece permission_str = + std::string_view permission_str = site_settings::ContentSettingsTypeToGroupName( static_cast<ContentSettingsType>(type.GetInt())); if (!permission_str.empty()) {
diff --git a/chrome/browser/ui/webui/settings/safety_hub_handler_unittest.cc b/chrome/browser/ui/webui/settings/safety_hub_handler_unittest.cc index e09c880..84f2f55 100644 --- a/chrome/browser/ui/webui/settings/safety_hub_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/safety_hub_handler_unittest.cc
@@ -6,6 +6,7 @@ #include <ctime> #include <memory> +#include <string_view> #include "base/containers/fixed_flat_set.h" #include "base/functional/bind.h" @@ -390,8 +391,8 @@ // TODO(crbug.com/1443466): Consider moving common test util functions between // this file and password_status_check_service_unittest.cc to a util class. - password_manager::PasswordForm MakeForm(base::StringPiece16 username, - base::StringPiece16 password, + password_manager::PasswordForm MakeForm(std::u16string_view username, + std::u16string_view password, std::string origin = kUsedTestSite, bool is_leaked = false) { password_manager::PasswordForm form;
diff --git a/chrome/browser/ui/webui/settings/settings_utils_fuchsia.cc b/chrome/browser/ui/webui/settings/settings_utils_fuchsia.cc deleted file mode 100644 index 677d55a..0000000 --- a/chrome/browser/ui/webui/settings/settings_utils_fuchsia.cc +++ /dev/null
@@ -1,16 +0,0 @@ -// Copyright 2016 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/webui/settings/settings_utils.h" - -#include "base/notreached.h" - -namespace settings_utils { - -void ShowNetworkProxySettings(content::WebContents* web_contents) { - // TODO(crbug.com/1234748) - NOTIMPLEMENTED_LOG_ONCE(); -} - -} // namespace settings_utils
diff --git a/chrome/browser/ui/webui/settings/site_settings_handler.cc b/chrome/browser/ui/webui/settings/site_settings_handler.cc index e48eba6..7ec7c9b 100644 --- a/chrome/browser/ui/webui/settings/site_settings_handler.cc +++ b/chrome/browser/ui/webui/settings/site_settings_handler.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/settings/site_settings_handler.h" #include <set> +#include <string_view> #include <utility> #include <vector> @@ -1134,7 +1135,7 @@ // Get device chooser permission exceptions. for (auto content_type : kChooserDataContentSettingsTypes) { - base::StringPiece group_name = + std::string_view group_name = site_settings::ContentSettingsTypeToGroupName(content_type); DCHECK(!group_name.empty()); const site_settings::ChooserTypeNameEntry* chooser_type = @@ -1525,7 +1526,7 @@ // Clear device chooser data permission exceptions. if (setting == CONTENT_SETTING_DEFAULT) { for (auto content_type : kChooserDataContentSettingsTypes) { - base::StringPiece group_name = + std::string_view group_name = site_settings::ContentSettingsTypeToGroupName(content_type); DCHECK(!group_name.empty()); const site_settings::ChooserTypeNameEntry* chooser_type =
diff --git a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc index ef20314..57678d5a 100644 --- a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include <optional> #include <string> +#include <string_view> #include <tuple> #include <utility> #include <vector> @@ -22,7 +23,6 @@ #include "base/logging.h" #include "base/memory/raw_ptr.h" #include "base/memory/raw_ref.h" -#include "base/strings/string_piece.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/test/bind.h" @@ -4155,7 +4155,7 @@ // Iterate through the exception's sites array and return true if a site // exception matches |requesting_origin| and |embedding_origin|. bool ChooserExceptionContainsSiteException(const base::Value::Dict& exception, - base::StringPiece origin) { + std::string_view origin) { const base::Value::List* sites = exception.FindList(site_settings::kSites); if (!sites) return false; @@ -4176,8 +4176,8 @@ // |origin|. bool ChooserExceptionContainsSiteException( const base::Value::List& exceptions, - base::StringPiece display_name, - base::StringPiece origin) { + std::string_view display_name, + std::string_view origin) { for (const auto& exception : exceptions) { const std::string* exception_display_name = exception.GetDict().FindString(site_settings::kDisplayName); @@ -4629,7 +4629,7 @@ } void TestHandleSetOriginPermissions() { - constexpr base::StringPiece kYoutubeOriginStr = "https://youtube.com/"; + constexpr std::string_view kYoutubeOriginStr = "https://youtube.com/"; const GURL kYoutubeUrl{kYoutubeOriginStr}; const auto kYoutubeOrigin = url::Origin::Create(kYoutubeUrl);
diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc index b5f842c..f591097 100644 --- a/chrome/browser/ui/webui/settings/site_settings_helper.cc +++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc
@@ -8,6 +8,7 @@ #include <functional> #include <set> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -485,11 +486,11 @@ return false; } -ContentSettingsType ContentSettingsTypeFromGroupName(base::StringPiece name) { +ContentSettingsType ContentSettingsTypeFromGroupName(std::string_view name) { for (const auto& entry : kContentSettingsTypeGroupNames) { // Content setting types that aren't represented in the settings UI // will have `nullptr` as their `name`. However, converting `nullptr` - // to a StringPiece will crash, so we have to handle it explicitly + // to a std::string_view will crash, so we have to handle it explicitly // before comparing. if (entry.name != nullptr && entry.name == name) { return entry.type; @@ -499,7 +500,7 @@ return ContentSettingsType::DEFAULT; } -base::StringPiece ContentSettingsTypeToGroupName(ContentSettingsType type) { +std::string_view ContentSettingsTypeToGroupName(ContentSettingsType type) { for (const auto& entry : kContentSettingsTypeGroupNames) { if (type == entry.type) { // Content setting types that aren't represented in the settings UI @@ -511,13 +512,13 @@ << " does not have a readable name."; } - return entry.name ? entry.name : base::StringPiece(); + return entry.name ? entry.name : std::string_view(); } } NOTREACHED() << static_cast<int32_t>(type) << " is not a recognized content settings type."; - return base::StringPiece(); + return std::string_view(); } std::vector<ContentSettingsType> GetVisiblePermissionCategories( @@ -1225,7 +1226,7 @@ }); } -const ChooserTypeNameEntry* ChooserTypeFromGroupName(base::StringPiece name) { +const ChooserTypeNameEntry* ChooserTypeFromGroupName(std::string_view name) { for (const auto& chooser_type : kChooserTypeGroupNames) { if (chooser_type.name == name) { return &chooser_type;
diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.h b/chrome/browser/ui/webui/settings/site_settings_helper.h index 1fdec95..ffa8ef57 100644 --- a/chrome/browser/ui/webui/settings/site_settings_helper.h +++ b/chrome/browser/ui/webui/settings/site_settings_helper.h
@@ -9,10 +9,10 @@ #include <memory> #include <set> #include <string> +#include <string_view> #include <utility> #include <vector> -#include "base/strings/string_piece.h" #include "base/values.h" #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_pattern.h" @@ -118,8 +118,8 @@ bool HasRegisteredGroupName(ContentSettingsType type); // Converts a ContentSettingsType to/from its group name identifier. -ContentSettingsType ContentSettingsTypeFromGroupName(base::StringPiece name); -base::StringPiece ContentSettingsTypeToGroupName(ContentSettingsType type); +ContentSettingsType ContentSettingsTypeFromGroupName(std::string_view name); +std::string_view ContentSettingsTypeToGroupName(ContentSettingsType type); // Returns a list of all content settings types that correspond to permissions // and which should be displayed in chrome://settings. An origin and profile may @@ -237,7 +237,7 @@ const char* name; }; -const ChooserTypeNameEntry* ChooserTypeFromGroupName(base::StringPiece name); +const ChooserTypeNameEntry* ChooserTypeFromGroupName(std::string_view name); // Creates a chooser exception object for the object with |display_name|. The // object contains the following properties
diff --git a/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_side_panel_ui.cc b/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_side_panel_ui.cc index 422ec0f..1a3b8c7d 100644 --- a/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_side_panel_ui.cc +++ b/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_side_panel_ui.cc
@@ -52,6 +52,18 @@ #include "ui/views/style/platform_style.h" #include "ui/webui/color_change_listener/color_change_handler.h" +BookmarksSidePanelUIConfig::BookmarksSidePanelUIConfig() + : WebUIConfig(content::kChromeUIScheme, + chrome::kChromeUIBookmarksSidePanelHost) {} + +BookmarksSidePanelUIConfig::~BookmarksSidePanelUIConfig() = default; + +std::unique_ptr<content::WebUIController> +BookmarksSidePanelUIConfig::CreateWebUIController(content::WebUI* web_ui, + const GURL& url) { + return std::make_unique<BookmarksSidePanelUI>(web_ui); +} + BookmarksSidePanelUI::BookmarksSidePanelUI(content::WebUI* web_ui) : TopChromeWebUIController(web_ui, true) { Profile* const profile = Profile::FromWebUI(web_ui);
diff --git a/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_side_panel_ui.h b/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_side_panel_ui.h index f799c51..aff5ada 100644 --- a/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_side_panel_ui.h +++ b/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_side_panel_ui.h
@@ -11,6 +11,7 @@ #include "chrome/browser/ui/webui/top_chrome/top_chrome_web_ui_controller.h" #include "chrome/browser/ui/webui/webui_load_timer.h" #include "components/page_image_service/mojom/page_image_service.mojom.h" +#include "content/public/browser/webui_config.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" @@ -32,6 +33,17 @@ class ImageServiceHandler; } +class BookmarksSidePanelUIConfig : public content::WebUIConfig { + public: + BookmarksSidePanelUIConfig(); + ~BookmarksSidePanelUIConfig() override; + + // content::WebUIConfig: + std::unique_ptr<content::WebUIController> CreateWebUIController( + content::WebUI* web_ui, + const GURL& url) override; +}; + class BookmarksSidePanelUI : public TopChromeWebUIController, public side_panel::mojom::BookmarksPageHandlerFactory,
diff --git a/chrome/browser/ui/webui/side_panel/performance_controls/performance_side_panel_ui.cc b/chrome/browser/ui/webui/side_panel/performance_controls/performance_side_panel_ui.cc index 7b12eb0..a5240d77 100644 --- a/chrome/browser/ui/webui/side_panel/performance_controls/performance_side_panel_ui.cc +++ b/chrome/browser/ui/webui/side_panel/performance_controls/performance_side_panel_ui.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/side_panel/performance_controls/performance_side_panel_ui.h" #include <string> +#include <string_view> #include <utility> #include "base/check_op.h" @@ -60,7 +61,7 @@ url::Component key, value; while (url::ExtractQueryKeyValue(url.query_piece(), &query, &key, &value)) { if (url.query_piece().substr(key.begin, key.len) == "notifications") { - base::StringPiece value_str = + std::string_view value_str = url.query_piece().substr(value.begin, value.len); source->AddString("sidePanelNotifications", std::string{value_str}); }
diff --git a/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.cc b/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.cc index 63e4baf61..be0aa9d9 100644 --- a/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.cc +++ b/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.cc
@@ -593,6 +593,7 @@ const std::string& code) { default_language_code_ = code; page_->SetLanguageCode(code); + page_->SetDefaultLanguageCode(code); } ///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/ui/webui/side_panel/reading_list/reading_list_ui.cc b/chrome/browser/ui/webui/side_panel/reading_list/reading_list_ui.cc index d97b7b4f..f176307 100644 --- a/chrome/browser/ui/webui/side_panel/reading_list/reading_list_ui.cc +++ b/chrome/browser/ui/webui/side_panel/reading_list/reading_list_ui.cc
@@ -36,6 +36,17 @@ #include "ui/views/style/platform_style.h" #include "ui/webui/color_change_listener/color_change_handler.h" +ReadingListUIConfig::ReadingListUIConfig() + : WebUIConfig(content::kChromeUIScheme, chrome::kChromeUIReadLaterHost) {} + +ReadingListUIConfig::~ReadingListUIConfig() = default; + +std::unique_ptr<content::WebUIController> +ReadingListUIConfig::CreateWebUIController(content::WebUI* web_ui, + const GURL& url) { + return std::make_unique<ReadingListUI>(web_ui); +} + ReadingListUI::ReadingListUI(content::WebUI* web_ui) : TopChromeWebUIController(web_ui), webui_load_timer_(web_ui->GetWebContents(),
diff --git a/chrome/browser/ui/webui/side_panel/reading_list/reading_list_ui.h b/chrome/browser/ui/webui/side_panel/reading_list/reading_list_ui.h index 7892314..571b4201 100644 --- a/chrome/browser/ui/webui/side_panel/reading_list/reading_list_ui.h +++ b/chrome/browser/ui/webui/side_panel/reading_list/reading_list_ui.h
@@ -11,6 +11,7 @@ #include "chrome/browser/ui/webui/top_chrome/top_chrome_web_ui_controller.h" #include "chrome/browser/ui/webui/webui_load_timer.h" #include "components/user_education/webui/help_bubble_handler.h" +#include "content/public/browser/webui_config.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" @@ -23,6 +24,17 @@ class ColorChangeHandler; } +class ReadingListUIConfig : public content::WebUIConfig { + public: + ReadingListUIConfig(); + ~ReadingListUIConfig() override; + + // content::WebUIConfig: + std::unique_ptr<content::WebUIController> CreateWebUIController( + content::WebUI* web_ui, + const GURL& url) override; +}; + class ReadingListUI : public TopChromeWebUIController, public reading_list::mojom::PageHandlerFactory, public help_bubble::mojom::HelpBubbleHandlerFactory {
diff --git a/chrome/browser/ui/webui/signin/signin_reauth_ui.cc b/chrome/browser/ui/webui/signin/signin_reauth_ui.cc index ffff717..0c85e4e7 100644 --- a/chrome/browser/ui/webui/signin/signin_reauth_ui.cc +++ b/chrome/browser/ui/webui/signin/signin_reauth_ui.cc
@@ -6,6 +6,7 @@ #include <optional> #include <string> +#include <string_view> #include "base/check.h" #include "base/containers/flat_map.h" @@ -151,7 +152,7 @@ } void SigninReauthUI::AddStringResource(content::WebUIDataSource* source, - base::StringPiece name, + std::string_view name, int ids) { source->AddLocalizedString(name, ids);
diff --git a/chrome/browser/ui/webui/signin/signin_reauth_ui.h b/chrome/browser/ui/webui/signin/signin_reauth_ui.h index 09f179c4..54655846 100644 --- a/chrome/browser/ui/webui/signin/signin_reauth_ui.h +++ b/chrome/browser/ui/webui/signin/signin_reauth_ui.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_WEBUI_SIGNIN_SIGNIN_REAUTH_UI_H_ #include <string> +#include <string_view> #include <vector> #include "content/public/browser/web_ui_controller.h" @@ -49,7 +50,7 @@ // of the string to the |ids| in order to later pass it to // SigninReauthHandler. void AddStringResource(content::WebUIDataSource* source, - base::StringPiece name, + std::string_view name, int ids); // For consent auditing.
diff --git a/chrome/browser/ui/webui/support_tool/support_tool_ui_utils.cc b/chrome/browser/ui/webui/support_tool/support_tool_ui_utils.cc index 2a2cb84..362ec02 100644 --- a/chrome/browser/ui/webui/support_tool/support_tool_ui_utils.cc +++ b/chrome/browser/ui/webui/support_tool/support_tool_ui_utils.cc
@@ -8,12 +8,12 @@ #include <optional> #include <set> #include <string> +#include <string_view> #include <vector> #include "base/base64url.h" #include "base/check.h" #include "base/containers/contains.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/values.h" #include "build/chromeos_buildflags.h" @@ -247,8 +247,8 @@ pii_data_item.Set( support_tool_ui::kPiiItemDetectedDataKey, base::JoinString( - std::vector<base::StringPiece>(pii_entry.second.begin(), - pii_entry.second.end()), + std::vector<std::string_view>(pii_entry.second.begin(), + pii_entry.second.end()), // Join the PII strings with a comma in between them when displaying // to the user to make it more easily readable. ", "));
diff --git a/chrome/browser/ui/webui/tab_search/BUILD.gn b/chrome/browser/ui/webui/tab_search/BUILD.gn index 48046ed..48539b4 100644 --- a/chrome/browser/ui/webui/tab_search/BUILD.gn +++ b/chrome/browser/ui/webui/tab_search/BUILD.gn
@@ -4,7 +4,8 @@ import("//mojo/public/tools/bindings/mojom.gni") -assert(is_linux || is_chromeos || is_win || is_mac || is_fuchsia) +assert(is_linux || is_chromeos || is_win || is_mac) +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") mojom("mojo_bindings") { sources = [ "tab_search.mojom" ]
diff --git a/chrome/browser/ui/webui/tab_search/tab_search_page_handler_unittest.cc b/chrome/browser/ui/webui/tab_search/tab_search_page_handler_unittest.cc index 58ee27c29..6a477ca1 100644 --- a/chrome/browser/ui/webui/tab_search/tab_search_page_handler_unittest.cc +++ b/chrome/browser/ui/webui/tab_search/tab_search_page_handler_unittest.cc
@@ -396,7 +396,7 @@ ->SetIsCurrentlyAudible(true); AddTab(browser(), GURL(kTabUrl1)); TabStripModel* tab_strip_model = browser()->tab_strip_model(); - tab_strip_model->ReplaceWebContentsAt(0, std::move(test_web_contents)); + tab_strip_model->DiscardWebContentsAt(0, std::move(test_web_contents)); NavigateAndCommitActiveTab(GURL(kTabUrl1)); tab_search::mojom::PageHandler::GetProfileDataCallback callback = base::BindLambdaForTesting(
diff --git a/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler_unittest.cc b/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler_unittest.cc index 3dd144c..6867eb9 100644 --- a/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler_unittest.cc +++ b/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler_unittest.cc
@@ -560,7 +560,7 @@ browser()->tab_strip_model()->GetWebContentsAt(0)); web_ui()->ClearTrackedCalls(); - browser()->tab_strip_model()->ReplaceWebContentsAt( + browser()->tab_strip_model()->DiscardWebContentsAt( 0, content::WebContentsTester::CreateTestWebContents(profile(), nullptr)); int expected_new_id = extensions::ExtensionTabUtil::GetTabId( browser()->tab_strip_model()->GetWebContentsAt(0));
diff --git a/chrome/browser/ui/webui/tab_strip/tab_strip_ui_util.cc b/chrome/browser/ui/webui/tab_strip/tab_strip_ui_util.cc index fb87b86..0814900 100644 --- a/chrome/browser/ui/webui/tab_strip/tab_strip_ui_util.cc +++ b/chrome/browser/ui/webui/tab_strip/tab_strip_ui_util.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <string_view> #include <utility> #include "base/strings/string_number_conversions.h" @@ -95,8 +96,8 @@ } for (uint32_t i = 0; i < entry_count; ++i) { - base::StringPiece16 type; - base::StringPiece16 data; + std::u16string_view type; + std::u16string_view data; if (!iter.ReadStringPiece16(&type) || !iter.ReadStringPiece16(&data)) { return false; }
diff --git a/chrome/browser/ui/webui/theme_source.cc b/chrome/browser/ui/webui/theme_source.cc index b7a7542..14616bda 100644 --- a/chrome/browser/ui/webui/theme_source.cc +++ b/chrome/browser/ui/webui/theme_source.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/theme_source.h" +#include <string_view> + #include "base/functional/bind.h" #include "base/memory/ref_counted_memory.h" #include "base/metrics/histogram_functions.h" @@ -193,7 +195,7 @@ } std::string ThemeSource::GetMimeType(const GURL& url) { - const base::StringPiece file_path = url.path_piece(); + const std::string_view file_path = url.path_piece(); if (base::EndsWith(file_path, ".css", base::CompareCase::INSENSITIVE_ASCII)) { return "text/css"; @@ -263,7 +265,7 @@ const ui::ColorProvider& color_provider = wc_getter.Run()->GetColorProvider(); std::string sets_param; - std::vector<base::StringPiece> color_id_sets; + std::vector<std::string_view> color_id_sets; bool generate_rgb_vars = false; std::string generate_rgb_vars_query_value; if (net::GetValueForKeyInQuery(url, "generate_rgb_vars",
diff --git a/chrome/browser/ui/webui/translate_internals/chrome_translate_internals_handler.cc b/chrome/browser/ui/webui/translate_internals/chrome_translate_internals_handler.cc index 5b3bc28..a7174eb 100644 --- a/chrome/browser/ui/webui/translate_internals/chrome_translate_internals_handler.cc +++ b/chrome/browser/ui/webui/translate_internals/chrome_translate_internals_handler.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/translate_internals/chrome_translate_internals_handler.h" #include <map> +#include <string_view> #include <utility> #include <vector> @@ -49,13 +50,13 @@ } void ChromeTranslateInternalsHandler::RegisterMessageCallback( - base::StringPiece message, + std::string_view message, MessageCallback callback) { web_ui()->RegisterMessageCallback(message, std::move(callback)); } void ChromeTranslateInternalsHandler::CallJavascriptFunction( - base::StringPiece function_name, + std::string_view function_name, base::span<const base::ValueView> args) { web_ui()->CallJavascriptFunctionUnsafe(function_name, args); }
diff --git a/chrome/browser/ui/webui/translate_internals/chrome_translate_internals_handler.h b/chrome/browser/ui/webui/translate_internals/chrome_translate_internals_handler.h index 5ffcd17..5bab31e 100644 --- a/chrome/browser/ui/webui/translate_internals/chrome_translate_internals_handler.h +++ b/chrome/browser/ui/webui/translate_internals/chrome_translate_internals_handler.h
@@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_CHROME_TRANSLATE_INTERNALS_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_CHROME_TRANSLATE_INTERNALS_HANDLER_H_ +#include <string_view> + #include "base/callback_list.h" #include "components/translate/translate_internals/translate_internals_handler.h" #include "content/public/browser/web_ui_message_handler.h" @@ -26,9 +28,9 @@ // translate::TranslateInternalsHandler. translate::TranslateClient* GetTranslateClient() override; variations::VariationsService* GetVariationsService() override; - void RegisterMessageCallback(base::StringPiece message, + void RegisterMessageCallback(std::string_view message, MessageCallback callback) override; - void CallJavascriptFunction(base::StringPiece function_name, + void CallJavascriptFunction(std::string_view function_name, base::span<const base::ValueView> args) override; // content::WebUIMessageHandler methods:
diff --git a/chrome/browser/ui/webui/util/image_util.cc b/chrome/browser/ui/webui/util/image_util.cc index f41d026..47069c7 100644 --- a/chrome/browser/ui/webui/util/image_util.cc +++ b/chrome/browser/ui/webui/util/image_util.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/util/image_util.h" +#include <string_view> + #include "base/base64.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkStream.h" @@ -15,7 +17,7 @@ namespace webui { std::string MakeDataURIForImage(base::span<const uint8_t> image_data, - base::StringPiece mime_subtype) { + std::string_view mime_subtype) { std::string result = "data:image/"; result.append(mime_subtype.begin(), mime_subtype.end()); result += ";base64,";
diff --git a/chrome/browser/ui/webui/util/image_util.h b/chrome/browser/ui/webui/util/image_util.h index ced0ed19..44cd8c3 100644 --- a/chrome/browser/ui/webui/util/image_util.h +++ b/chrome/browser/ui/webui/util/image_util.h
@@ -5,8 +5,9 @@ #ifndef CHROME_BROWSER_UI_WEBUI_UTIL_IMAGE_UTIL_H_ #define CHROME_BROWSER_UI_WEBUI_UTIL_IMAGE_UTIL_H_ +#include <string_view> + #include "base/containers/span.h" -#include "base/strings/string_piece.h" namespace gfx { class ImageSkia; @@ -14,7 +15,7 @@ namespace webui { std::string MakeDataURIForImage(base::span<const uint8_t> image_data, - base::StringPiece mime_subtype); + std::string_view mime_subtype); std::string EncodePNGAndMakeDataURI(gfx::ImageSkia image, float scale_factor); } // namespace webui
diff --git a/chrome/browser/user_education/browser_feature_promo_storage_service.cc b/chrome/browser/user_education/browser_feature_promo_storage_service.cc index c5fb911..29963f3 100644 --- a/chrome/browser/user_education/browser_feature_promo_storage_service.cc +++ b/chrome/browser/user_education/browser_feature_promo_storage_service.cc
@@ -44,6 +44,8 @@ // Path to the count of how many times this IPH has been shown. // in_product_help.snoozed_feature.[iph_name].show_count constexpr char kIPHShowCountPath[] = "show_count"; +// Path to the index into a cycling promo. +constexpr char kIPHPromoIndexPath[] = "promo_index"; // Path to a list of app IDs that the IPH was shown for; applies to app-specific // IPH only. constexpr char kIPHShownForAppsPath[] = "shown_for_apps"; @@ -135,6 +137,8 @@ pref_data.FindIntByDottedPath(path_prefix + kIPHSnoozeCountPath); std::optional<int> show_count = pref_data.FindIntByDottedPath(path_prefix + kIPHShowCountPath); + std::optional<int> promo_index = + pref_data.FindIntByDottedPath(path_prefix + kIPHPromoIndexPath); const base::Value::List* app_list = pref_data.FindListByDottedPath(path_prefix + kIPHShownForAppsPath); @@ -165,6 +169,7 @@ promo_data->last_snooze_time = *snooze_time; promo_data->snooze_count = *snooze_count; promo_data->show_count = *show_count; + promo_data->promo_index = promo_index.value_or(0); // Since `last_dismissed_by` was not previously recorded, default to // "canceled" if the data isn't present or is invalid. @@ -213,6 +218,8 @@ promo_data.snooze_count); pref_data.SetByDottedPath(path_prefix + kIPHShowCountPath, promo_data.show_count); + pref_data.SetByDottedPath(path_prefix + kIPHPromoIndexPath, + promo_data.promo_index); base::Value::List shown_for_keys; for (auto& app_id : promo_data.shown_for_keys) {
diff --git a/chrome/browser/user_education/user_education_configuration_provider.cc b/chrome/browser/user_education/user_education_configuration_provider.cc index cc2a49c7..b55aebc 100644 --- a/chrome/browser/user_education/user_education_configuration_provider.cc +++ b/chrome/browser/user_education/user_education_configuration_provider.cc
@@ -96,7 +96,8 @@ case user_education::FeaturePromoSpecification::PromoType::kToast: case user_education::FeaturePromoSpecification::PromoType::kLegacy: - // Toasts can always show and do not impact other IPH. + case user_education::FeaturePromoSpecification::PromoType::kRotating: + // Toasts and rotating promos can always show and do not impact other IPH. break; case user_education::FeaturePromoSpecification::PromoType::kUnspecified:
diff --git a/chrome/browser/web_applications/BUILD.gn b/chrome/browser/web_applications/BUILD.gn index 1c65cd3..923b596 100644 --- a/chrome/browser/web_applications/BUILD.gn +++ b/chrome/browser/web_applications/BUILD.gn
@@ -9,6 +9,8 @@ import("//mojo/public/tools/bindings/mojom.gni") import("//testing/test.gni") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + source_set("web_applications") { sources = [ "callback_utils.h", @@ -372,10 +374,6 @@ ] } - if (is_fuchsia) { - sources += [ "os_integration/web_app_stubs.cc" ] - } - if (is_linux) { # Desktop linux, doesn't count ChromeOS. sources += [
diff --git a/chrome/browser/web_applications/externally_managed_app_manager.cc b/chrome/browser/web_applications/externally_managed_app_manager.cc index 6b0b8e2..1e1d549b 100644 --- a/chrome/browser/web_applications/externally_managed_app_manager.cc +++ b/chrome/browser/web_applications/externally_managed_app_manager.cc
@@ -467,11 +467,6 @@ void ExternallyManagedAppManager::MaybeEnqueueServiceWorkerRegistration( const ExternalInstallOptions& install_options) { - if (!base::FeatureList::IsEnabled( - features::kDesktopPWAsCacheDuringDefaultInstall)) { - return; - } - if (IsShuttingDown()) { return; }
diff --git a/chrome/browser/web_applications/policy/web_app_policy_manager.cc b/chrome/browser/web_applications/policy/web_app_policy_manager.cc index 538b461..39e247e 100644 --- a/chrome/browser/web_applications/policy/web_app_policy_manager.cc +++ b/chrome/browser/web_applications/policy/web_app_policy_manager.cc
@@ -215,15 +215,12 @@ base::BindRepeating(&WebAppPolicyManager::RefreshPolicyInstalledApps, weak_ptr_factory_.GetWeakPtr(), /*allow_close_and_relaunch=*/false)); - if (base::FeatureList::IsEnabled( - features::kDesktopPWAsEnforceWebAppSettingsPolicy)) { pref_change_registrar_.Add( prefs::kWebAppSettings, base::BindRepeating(&WebAppPolicyManager::RefreshPolicySettings, weak_ptr_factory_.GetWeakPtr())); RefreshPolicySettings(); - } #if BUILDFLAG(IS_CHROMEOS) RefreshPolicyInstalledApps( /*allow_close_and_relaunch=*/base::FeatureList::IsEnabled( @@ -668,9 +665,7 @@ bool WebAppPolicyManager::IsPreventCloseEnabled( const webapps::AppId& app_id) const { #if BUILDFLAG(IS_CHROMEOS) - if (!base::FeatureList::IsEnabled( - features::kDesktopPWAsEnforceWebAppSettingsPolicy) || - !base::FeatureList::IsEnabled(features::kDesktopPWAsRunOnOsLogin) || + if (!base::FeatureList::IsEnabled(features::kDesktopPWAsRunOnOsLogin) || !base::FeatureList::IsEnabled(features::kDesktopPWAsPreventClose)) { return false; }
diff --git a/chrome/browser/web_applications/test/prevent_close_test_base.cc b/chrome/browser/web_applications/test/prevent_close_test_base.cc index ebf8ba0..c1c9e7c6 100644 --- a/chrome/browser/web_applications/test/prevent_close_test_base.cc +++ b/chrome/browser/web_applications/test/prevent_close_test_base.cc
@@ -7,7 +7,6 @@ #include <string_view> #include "base/json/json_reader.h" -#include "base/test/scoped_feature_list.h" #include "base/values.h" #include "chrome/browser/policy/policy_test_utils.h" #include "chrome/browser/profiles/profile.h" @@ -17,7 +16,6 @@ #include "chrome/browser/web_applications/test/web_app_test_observers.h" #include "chrome/browser/web_applications/web_app_id_constants.h" #include "chrome/browser/web_applications/web_app_install_info.h" -#include "chrome/common/chrome_features.h" #include "components/policy/core/browser/browser_policy_connector.h" #include "components/policy/core/browser/browser_policy_connector_base.h" #include "components/policy/core/common/mock_configuration_policy_provider.h" @@ -29,12 +27,7 @@ #include "ui/base/window_open_disposition.h" #include "url/gurl.h" -PreventCloseTestBase::PreventCloseTestBase() { - scoped_feature_list_.InitWithFeatures( - /*enabled_features=*/{features::kDesktopPWAsEnforceWebAppSettingsPolicy, - features::kDesktopPWAsPreventClose}, - /*disabled_features=*/{}); -} +PreventCloseTestBase::PreventCloseTestBase() = default; PreventCloseTestBase::~PreventCloseTestBase() = default;
diff --git a/chrome/browser/web_applications/test/prevent_close_test_base.h b/chrome/browser/web_applications/test/prevent_close_test_base.h index 7730b61..9bae6ddc 100644 --- a/chrome/browser/web_applications/test/prevent_close_test_base.h +++ b/chrome/browser/web_applications/test/prevent_close_test_base.h
@@ -11,6 +11,7 @@ #include "base/values.h" #include "chrome/browser/policy/policy_test_utils.h" #include "chrome/browser/web_applications/test/os_integration_test_override_impl.h" +#include "chrome/common/chrome_features.h" #include "components/policy/core/common/mock_configuration_policy_provider.h" #include "components/webapps/common/web_app_id.h" @@ -50,7 +51,8 @@ private: web_app::OsIntegrationTestOverrideBlockingRegistration faked_os_integration_; - base::test::ScopedFeatureList scoped_feature_list_; + base::test::ScopedFeatureList scoped_feature_list_{ + features::kDesktopPWAsRunOnOsLogin}; testing::NiceMock<policy::MockConfigurationPolicyProvider> provider_; };
diff --git a/chrome/browser/web_applications/web_app_run_on_os_login_manager_browsertest.cc b/chrome/browser/web_applications/web_app_run_on_os_login_manager_browsertest.cc index b94fba3..0ad7e2b 100644 --- a/chrome/browser/web_applications/web_app_run_on_os_login_manager_browsertest.cc +++ b/chrome/browser/web_applications/web_app_run_on_os_login_manager_browsertest.cc
@@ -87,12 +87,7 @@ skip_run_on_os_login_startup_(std::make_unique<base::AutoReset<bool>>( WebAppRunOnOsLoginManager::SkipStartupForTesting())), skip_preinstalled_web_app_startup_( - PreinstalledWebAppManager::SkipStartupForTesting()) { - scoped_feature_list_.InitWithFeatures( - /*enabled_features=*/{features::kDesktopPWAsEnforceWebAppSettingsPolicy, - features::kDesktopPWAsRunOnOsLogin}, - /*disabled_features=*/{}); - } + PreinstalledWebAppManager::SkipStartupForTesting()) {} void SetUpOnMainThread() override { notification_tester_ = std::make_unique<NotificationDisplayServiceTester>( @@ -196,7 +191,8 @@ base::AutoReset<bool> skip_preinstalled_web_app_startup_; std::unique_ptr<NotificationDisplayServiceTester> notification_tester_; base::test::TestFuture<void> completed_future_; - base::test::ScopedFeatureList scoped_feature_list_; + base::test::ScopedFeatureList scoped_feature_list_{ + features::kDesktopPWAsRunOnOsLogin}; base::ScopedObservation<NotificationDisplayService, WebAppRunOnOsLoginManagerBrowserTest> notification_observation_{this};
diff --git a/chrome/browser/web_applications/web_app_run_on_os_login_manager_unittest.cc b/chrome/browser/web_applications/web_app_run_on_os_login_manager_unittest.cc index 4d09039..1041553 100644 --- a/chrome/browser/web_applications/web_app_run_on_os_login_manager_unittest.cc +++ b/chrome/browser/web_applications/web_app_run_on_os_login_manager_unittest.cc
@@ -60,10 +60,6 @@ class WebAppRunOnOsLoginManagerTestBase : public WebAppTest { public: void SetUp() override { - scoped_feature_list_.InitWithFeatures( - /*enabled_features=*/{features::kDesktopPWAsEnforceWebAppSettingsPolicy, - features::kDesktopPWAsRunOnOsLogin}, - /*disabled_features=*/{}); WebAppTest::SetUp(); provider_ = FakeWebAppProvider::Get(profile()); @@ -124,7 +120,8 @@ std::vector<apps::AppLaunchParams> launched_apps_; raw_ptr<FakeWebAppProvider, DanglingUntriaged> provider_ = nullptr; std::unique_ptr<base::AutoReset<bool>> skip_run_on_os_login_startup_; - base::test::ScopedFeatureList scoped_feature_list_; + base::test::ScopedFeatureList scoped_feature_list_{ + features::kDesktopPWAsRunOnOsLogin}; }; class WebAppRunOnOsLoginManagerParameterizedTest
diff --git a/chrome/browser/webauthn/authenticator_request_dialog_model.cc b/chrome/browser/webauthn/authenticator_request_dialog_model.cc index 039a134..093443d 100644 --- a/chrome/browser/webauthn/authenticator_request_dialog_model.cc +++ b/chrome/browser/webauthn/authenticator_request_dialog_model.cc
@@ -1140,7 +1140,9 @@ ->NotifyWebAuthnRequestAborted(); } } - SetCurrentStep(Step::kClosed); + if (model_->step() != Step::kGPMPasskeySaved) { + SetCurrentStep(Step::kClosed); + } } void AuthenticatorRequestDialogController::OnRequestTimeout() {
diff --git a/chrome/browser/webauthn/chrome_webauthn_autofill_interactive_uitest.cc b/chrome/browser/webauthn/chrome_webauthn_autofill_interactive_uitest.cc index 7969341..a603653 100644 --- a/chrome/browser/webauthn/chrome_webauthn_autofill_interactive_uitest.cc +++ b/chrome/browser/webauthn/chrome_webauthn_autofill_interactive_uitest.cc
@@ -156,13 +156,8 @@ } void SetUp() override { - scoped_feature_list_.InitWithFeatures( - {syncer::kSyncWebauthnCredentials}, - /*disabled_features=*/{ - // Disable this feature explicitly, as it can cause unexpected email - // fields to be parsed in these tests. - // TODO(crbug.com/1493145): Remove when/if launched. - autofill::features::kAutofillEnableEmailHeuristicOnlyAddressForms}); + scoped_feature_list_.InitWithFeatures({syncer::kSyncWebauthnCredentials}, + /*disabled_features=*/{}); ASSERT_TRUE(https_server_.InitializeAndListen()); create_services_subscription_ =
diff --git a/chrome/browser/webauthn/gpm_enclave_controller.cc b/chrome/browser/webauthn/gpm_enclave_controller.cc index 7e0788f3..8a92b3bf 100644 --- a/chrome/browser/webauthn/gpm_enclave_controller.cc +++ b/chrome/browser/webauthn/gpm_enclave_controller.cc
@@ -828,6 +828,7 @@ webauthn::PasskeyModel* passkey_model = PasskeyModelFactory::GetInstance()->GetForProfile(GetProfile()); passkey_model->CreatePasskey(passkey); + model_->SetStep(Step::kGPMPasskeySaved); } bool GPMEnclaveController::GetFailedPINAttemptCount() {
diff --git a/chrome/browser/xsurface/BUILD.gn b/chrome/browser/xsurface/BUILD.gn index 19a8ff1..ab7edeca 100644 --- a/chrome/browser/xsurface/BUILD.gn +++ b/chrome/browser/xsurface/BUILD.gn
@@ -25,6 +25,7 @@ "android/java/src/org/chromium/chrome/browser/xsurface/SurfaceScope.java", "android/java/src/org/chromium/chrome/browser/xsurface/SurfaceScopeDependencyProvider.java", "android/java/src/org/chromium/chrome/browser/xsurface/feed/FeedActionsHandler.java", + "android/java/src/org/chromium/chrome/browser/xsurface/feed/FeedCardOpeningReliabilityLogger.java", "android/java/src/org/chromium/chrome/browser/xsurface/feed/FeedLaunchReliabilityLogger.java", "android/java/src/org/chromium/chrome/browser/xsurface/feed/FeedNetworkRequestReliabilityLogger.java", "android/java/src/org/chromium/chrome/browser/xsurface/feed/FeedSurfaceScope.java",
diff --git a/chrome/browser/xsurface/android/java/src/org/chromium/chrome/browser/xsurface/feed/FeedCardOpeningReliabilityLogger.java b/chrome/browser/xsurface/android/java/src/org/chromium/chrome/browser/xsurface/feed/FeedCardOpeningReliabilityLogger.java new file mode 100644 index 0000000..f3a38c1f --- /dev/null +++ b/chrome/browser/xsurface/android/java/src/org/chromium/chrome/browser/xsurface/feed/FeedCardOpeningReliabilityLogger.java
@@ -0,0 +1,77 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.xsurface.feed; + +import androidx.annotation.IntDef; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Implemented internally. + * + * <p>Interface for capturing the reliability for user tapping a card. One instance exists per feed + * surface and lasts for the surface's lifetime. + */ +public interface FeedCardOpeningReliabilityLogger { + /** Describes the page loading error. */ + @IntDef({ + PageLoadError.INTERNET_DISCONNECTED, + PageLoadError.CONNECTION_TIMED_OUT, + PageLoadError.NAME_RESOLUTION_FAILED, + PageLoadError.PAGE_LOAD_ERROR + }) + @Retention(RetentionPolicy.SOURCE) + public @interface PageLoadError { + /** The Internet connection has been lost. */ + int INTERNET_DISCONNECTED = 0; + + /** A connection attempt timed out. */ + int CONNECTION_TIMED_OUT = 1; + + /** An error occurred when trying to do a name resolution (DNS) */ + int NAME_RESOLUTION_FAILED = 2; + + /** Other error occurred. */ + int PAGE_LOAD_ERROR = 3; + } + + /** + * Called when the card is clicked. + * + * @param pageId The unique ID for the page being opened. + * @param cardCategory The breakdown of cards into categories. + */ + default void onCardClicked(int pageId, int cardCategory) {} + + /** + * Called when the page starts loading. + * + * @param pageId The unique ID for the page being opened. + */ + default void onPageLoadStarted(int pageId) {} + + /** + * Called when the page finishes loading successfully. + * + * @param pageId The unique ID for the page being opened. + */ + default void onPageLoadFinished(int pageId) {} + + /** + * Called when the page fails to load. + * + * @param pageId The unique ID for the page being opened. + * @param errorCode The error code that causes the page to fail loading. + */ + default void onPageLoadFailed(int pageId, @PageLoadError int errorCode) {} + + /** + * Called when the page finishes first paint after non-empty layout. + * + * @param pageId The unique ID for the page being opened. + */ + default void onPageFirstContentfulPaint(int pageId) {} +}
diff --git a/chrome/browser/xsurface/android/java/src/org/chromium/chrome/browser/xsurface/feed/FeedSurfaceScope.java b/chrome/browser/xsurface/android/java/src/org/chromium/chrome/browser/xsurface/feed/FeedSurfaceScope.java index f3ce0c8..e0201c5 100644 --- a/chrome/browser/xsurface/android/java/src/org/chromium/chrome/browser/xsurface/feed/FeedSurfaceScope.java +++ b/chrome/browser/xsurface/android/java/src/org/chromium/chrome/browser/xsurface/feed/FeedSurfaceScope.java
@@ -28,4 +28,8 @@ default FeedUserInteractionReliabilityLogger getUserInteractionReliabilityLogger() { return new FeedUserInteractionReliabilityLogger() {}; } + + default FeedCardOpeningReliabilityLogger getCardOpeningReliabilityLogger() { + return new FeedCardOpeningReliabilityLogger() {}; + } }
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index 5592aa5a..0913478 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1713981585-c7832876f1eff26ec7d36b041206ea3d2ed6f2eb-c04208c2fc20057f99c9b1c44a42b36469a9f9b8.profdata +chrome-android32-main-1714024386-43f8481417434e06188fc50093e8b6a86dfdc88f-2507621298c5d94d2f5e0405a5c7d39d51b97efc.profdata
diff --git a/chrome/build/lacros64.pgo.txt b/chrome/build/lacros64.pgo.txt index 96469159..0802d3d 100644 --- a/chrome/build/lacros64.pgo.txt +++ b/chrome/build/lacros64.pgo.txt
@@ -1 +1 @@ -chrome-chromeos-amd64-generic-main-1713959768-bf1d5a218f0d60783f941e92f7bf9ce0de6f1806-8c57b87c7e93ac061c9e1026960b8c062a22d2dd.profdata +chrome-chromeos-amd64-generic-main-1714003749-a66b9dfccce3af6a79cd5338a5064b1ca61d61ce-1fcfd26fc38afbdc9c5a1ad14eea4766db761344.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 88fa1cbd..f80315e 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1713959768-b77efef093085e8b2b0584900bb619e0e37fbfe8-8c57b87c7e93ac061c9e1026960b8c062a22d2dd.profdata +chrome-linux-main-1714003166-cc45d24efaea16169421530d00d81df7eebd96fe-5c1e239c8edda7e1b998ca561e67a2e0d55312c7.profdata
diff --git a/chrome/build/win-arm64.pgo.txt b/chrome/build/win-arm64.pgo.txt index a6a02ae..18d5267 100644 --- a/chrome/build/win-arm64.pgo.txt +++ b/chrome/build/win-arm64.pgo.txt
@@ -1 +1 @@ -chrome-win-arm64-main-1713959768-ed5cea44af7b8d3d12a0e83b1f6a315b904eff1a-8c57b87c7e93ac061c9e1026960b8c062a22d2dd.profdata +chrome-win-arm64-main-1714024386-d11ae16a291025e62881b3b6b24d6f0fc2e42cec-2507621298c5d94d2f5e0405a5c7d39d51b97efc.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 8016250a..a7c3222 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1713970536-98f735699fce8a6e4693cf2ec12801f680dff92d-274864358b1a6eeaf67af0a970ea3d3acbbd8b49.profdata +chrome-win32-main-1714013767-52c4c5e2d09b2effbf0457594d3bf1b3a6cbaa13-4638aa405b4b18cdc01c46256ca53b08f7557771.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 1855a55..1f81795 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1713970536-c3e807313721064dbe4f870e3f467fedbc868275-274864358b1a6eeaf67af0a970ea3d3acbbd8b49.profdata +chrome-win64-main-1714013767-dfc5e8f860cecce7fa5dd32ef1d6fbf654d9a1c9-4638aa405b4b18cdc01c46256ca53b08f7557771.profdata
diff --git a/chrome/chrome_paks.gni b/chrome/chrome_paks.gni index 5871f07..d48ed384 100644 --- a/chrome/chrome_paks.gni +++ b/chrome/chrome_paks.gni
@@ -15,6 +15,8 @@ import("//ui/webui/webui_features.gni") import("chrome_repack_locales.gni") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + # Generates a rule to repack a set of resources, substituting a given string # in for the percentage (e.g. "100", "200"). It generates the repacked files in # the "gen" directory, and then introduces a copy rule to copy it to the root @@ -405,7 +407,7 @@ ] } - if (is_win || is_mac || is_linux || is_fuchsia) { + if (is_win || is_mac || is_linux) { sources += [ "$root_gen_dir/chrome/app_home_resources.pak" ] deps += [ "//chrome/browser/resources/app_home:resources" ] } @@ -425,12 +427,12 @@ deps += [ "//chrome/browser/resources/dlp_internals:resources" ] } - if (is_win || is_mac || is_linux || is_chromeos_lacros || is_fuchsia) { + if (is_win || is_mac || is_linux || is_chromeos_lacros) { sources += [ "$root_gen_dir/chrome/browser_switch_resources.pak" ] deps += [ "//chrome/browser/resources/browser_switch:resources" ] } - if (is_win || is_mac || is_linux || is_chromeos || is_fuchsia) { + if (is_win || is_mac || is_linux || is_chromeos) { sources += [ "$root_gen_dir/chrome/discards_resources.pak" ] deps += [ "//chrome/browser/resources/discards:resources" ] }
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index 709bd41..6757c9a 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn
@@ -23,6 +23,7 @@ import("//tools/grit/grit_rule.gni") assert(enable_supervised_users) +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") fuzzer_test("ini_parser_fuzzer") { sources = [ "ini_parser_fuzzer.cc" ] @@ -101,8 +102,6 @@ sources += [ "channel_info_lacros.cc" ] } else if (is_posix) { sources += [ "channel_info_posix.cc" ] - } else if (is_fuchsia) { - sources += [ "channel_info_fuchsia.cc" ] } } @@ -261,6 +260,7 @@ deps = [ "//build:chromeos_buildflags", + "//components/crash/core/app", "//components/google/core/common", "//components/live_caption:constants", "//components/metrics:call_stack_profile_builder", @@ -351,10 +351,6 @@ ] } - if (!is_fuchsia) { - deps += [ "//components/crash/core/app" ] - } - if (is_mac) { assert(enable_extensions) sources += [ @@ -681,9 +677,6 @@ sources += [ "chrome_paths_win.cc" ] deps += [ "//chrome/install_static:install_static_util" ] } - if (is_fuchsia) { - sources += [ "chrome_paths_fuchsia.cc" ] - } if (enable_widevine && enable_library_cdms) { deps += [
diff --git a/chrome/common/accessibility/read_anything.mojom b/chrome/common/accessibility/read_anything.mojom index dc0d7c1..60720f4 100644 --- a/chrome/common/accessibility/read_anything.mojom +++ b/chrome/common/accessibility/read_anything.mojom
@@ -233,6 +233,10 @@ // language or the browser language depending on what's available. SetLanguageCode(string code); + // Sets the default language code to be available in the WebUI in the event + // the language set by SetLanguageCode is invalid. + SetDefaultLanguageCode(string code); + // Send the settings values stored in prefs to the WebUI. voices maps // language to voice name OnSettingsRestoredFromPrefs(read_anything.mojom.LineSpacing line_spacing,
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 0bf8f5461..f91f5868 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -267,12 +267,6 @@ "ControlledFrame", base::FEATURE_ENABLED_BY_DEFAULT); -// When installing default installed PWAs, we wait for service workers -// to cache resources. -BASE_FEATURE(kDesktopPWAsCacheDuringDefaultInstall, - "DesktopPWAsCacheDuringDefaultInstall", - base::FEATURE_ENABLED_BY_DEFAULT); - // Moves the Extensions "puzzle piece" icon from the title bar into the app menu // for web app windows. BASE_FEATURE(kDesktopPWAsElidedExtensionsMenu, @@ -284,11 +278,6 @@ #endif ); -// Whether to parse and enforce the WebAppSettings policy. -BASE_FEATURE(kDesktopPWAsEnforceWebAppSettingsPolicy, - "DesktopPWAsEnforceWebAppSettingsPolicy", - base::FEATURE_ENABLED_BY_DEFAULT); - // Enables or disables Desktop PWAs to be auto-started on OS login. BASE_FEATURE(kDesktopPWAsRunOnOsLogin, "DesktopPWAsRunOnOsLogin",
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index 9b700d5..6259aae 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -162,15 +162,9 @@ COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kControlledFrame); COMPONENT_EXPORT(CHROME_FEATURES) -BASE_DECLARE_FEATURE(kDesktopPWAsCacheDuringDefaultInstall); - -COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kDesktopPWAsElidedExtensionsMenu); COMPONENT_EXPORT(CHROME_FEATURES) -BASE_DECLARE_FEATURE(kDesktopPWAsEnforceWebAppSettingsPolicy); - -COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kDesktopPWAsFlashAppNameInsteadOfOrigin); COMPONENT_EXPORT(CHROME_FEATURES)
diff --git a/chrome/common/features.gni b/chrome/common/features.gni index 2f11b07..2ab71ad 100644 --- a/chrome/common/features.gni +++ b/chrome/common/features.gni
@@ -60,6 +60,8 @@ # Enables usage of notifications via Chrome's MessageCenter. enable_chrome_notifications = is_mac || is_win || is_linux || is_fuchsia + # TODO(crbug.com/41481724): Remove this flag and corresponding build + # conditions. # Disable Click to Call on Fuchsia. enable_click_to_call = !is_fuchsia
diff --git a/chrome/common/importer/BUILD.gn b/chrome/common/importer/BUILD.gn index 2531a4d..a64ef03e 100644 --- a/chrome/common/importer/BUILD.gn +++ b/chrome/common/importer/BUILD.gn
@@ -4,6 +4,8 @@ import("//mojo/public/tools/bindings/mojom.gni") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + mojom("interfaces") { sources = [ "profile_import.mojom" ] @@ -92,7 +94,7 @@ "importer_url_row.h", "pstore_declarations.h", ] - if (is_chromeos || is_linux || is_fuchsia) { + if (is_chromeos || is_linux) { sources += [ "firefox_importer_utils_linux.cc" ] } else if (is_mac) { sources += [
diff --git a/chrome/common/safe_browsing/BUILD.gn b/chrome/common/safe_browsing/BUILD.gn index 08103d4..d0c12cc 100644 --- a/chrome/common/safe_browsing/BUILD.gn +++ b/chrome/common/safe_browsing/BUILD.gn
@@ -6,6 +6,8 @@ import("//components/safe_browsing/buildflags.gni") import("//third_party/protobuf/proto_library.gni") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + proto_library("proto") { sources = [ "crx_info.proto" ] } @@ -90,7 +92,7 @@ } else if (is_win) { sources += [ "binary_feature_extractor_win.cc" ] } - if (is_posix || is_fuchsia) { + if (is_posix) { sources += [ "binary_feature_extractor_posix.cc" ] }
diff --git a/chrome/renderer/accessibility/read_anything_app_controller.cc b/chrome/renderer/accessibility/read_anything_app_controller.cc index 754c764..0c1f97f3 100644 --- a/chrome/renderer/accessibility/read_anything_app_controller.cc +++ b/chrome/renderer/accessibility/read_anything_app_controller.cc
@@ -1485,6 +1485,18 @@ ExecuteJavaScript("chrome.readingMode.languageChanged();"); } +// TODO(b/336596926): Use the default language code as a fallback when +// we get a language-unavailable error. +void ReadAnythingAppController::SetDefaultLanguageCode( + const std::string& code) { + std::string default_lang = std::string(language::ExtractBaseLanguage(code)); + // If the default language code is empty, continue to use the default + // language code, as defined by ReadAnythingAppModel, currently 'en' + if (default_lang.length() > 0) { + model_.set_default_language_code(default_lang); + } +} + void ReadAnythingAppController::SetContentForTesting( v8::Local<v8::Value> v8_snapshot_lite, std::vector<ui::AXNodeID> content_node_ids) {
diff --git a/chrome/renderer/accessibility/read_anything_app_controller.h b/chrome/renderer/accessibility/read_anything_app_controller.h index 064d243..a39e2d0 100644 --- a/chrome/renderer/accessibility/read_anything_app_controller.h +++ b/chrome/renderer/accessibility/read_anything_app_controller.h
@@ -111,6 +111,7 @@ base::Value::List languages_enabled_in_pref, read_anything::mojom::HighlightGranularity granularity) override; void SetLanguageCode(const std::string& code) override; + void SetDefaultLanguageCode(const std::string& code) override; void ScreenAIServiceReady() override; // gin templates:
diff --git a/chrome/renderer/accessibility/read_anything_app_model.h b/chrome/renderer/accessibility/read_anything_app_model.h index 99fa7cc..92e574b9 100644 --- a/chrome/renderer/accessibility/read_anything_app_model.h +++ b/chrome/renderer/accessibility/read_anything_app_model.h
@@ -146,6 +146,14 @@ base_language_code_ = code; } + const std::string& default_language_code() const { + return default_language_code_; + } + + void set_default_language_code(const std::string code) { + default_language_code_ = code; + } + std::vector<std::string> GetSupportedFonts() const; // TODO(b/1266555): Ensure there is proper test coverage for all methods. @@ -511,6 +519,13 @@ // The current base language code used for fonts or reading aloud. std::string base_language_code_ = "en"; + // The default language code, used as a fallback in case base_language_code_ + // is invalid. It's not guaranteed that default_language_code_ will always + // be valid, but as it is tied to the browser language, it is likely more + // stable than the base_language_code_, which may be changed on different + // pages. + std::string default_language_code_ = "en"; + // Theme information. std::string font_name_ = string_constants::kReadAnythingPlaceholderFontName; float font_size_ = kReadAnythingDefaultFontScale;
diff --git a/chrome/renderer/accessibility/read_anything_app_model_browsertest.cc b/chrome/renderer/accessibility/read_anything_app_model_browsertest.cc index 6d31d16..79d4275 100644 --- a/chrome/renderer/accessibility/read_anything_app_model_browsertest.cc +++ b/chrome/renderer/accessibility/read_anything_app_model_browsertest.cc
@@ -217,6 +217,11 @@ model_->set_base_language_code(code); } + std::string DefaultLanguageCode() { return model_->default_language_code(); } + void SetDefaultLanguageCode(std::string code) { + model_->set_default_language_code(code); + } + std::vector<std::string> GetSupportedFonts() { return model_->GetSupportedFonts(); } @@ -1355,6 +1360,21 @@ ASSERT_EQ(LanguageCode(), "es"); } +TEST_F(ReadAnythingAppModelTest, DefaultLanguageCode_ReturnsCorrectCode) { + ASSERT_EQ(DefaultLanguageCode(), "en"); + + SetDefaultLanguageCode("es"); + ASSERT_EQ(DefaultLanguageCode(), "es"); + + // The regular base language code isn't impacted. + ASSERT_EQ(LanguageCode(), "en"); + + // Setting the base language code doesn't impact the default language code. + SetLanguageCode("jp"); + ASSERT_EQ(LanguageCode(), "jp"); + ASSERT_EQ(DefaultLanguageCode(), "es"); +} + TEST_F(ReadAnythingAppModelTest, SupportedFonts_InvalidLanguageCode_ReturnsDefaultFonts) { SetLanguageCode("qr");
diff --git a/chrome/services/file_util/public/cpp/sandboxed_zip_analyzer_unittest.cc b/chrome/services/file_util/public/cpp/sandboxed_zip_analyzer_unittest.cc index 4e10859..3fc4635 100644 --- a/chrome/services/file_util/public/cpp/sandboxed_zip_analyzer_unittest.cc +++ b/chrome/services/file_util/public/cpp/sandboxed_zip_analyzer_unittest.cc
@@ -582,3 +582,21 @@ EXPECT_EQ(results.analysis_result, safe_browsing::ArchiveAnalysisResult::kFailedToOpen); } + +TEST_F(SandboxedZipAnalyzerTest, NestedEncryptedZip) { + safe_browsing::ArchiveAnalyzerResults results; + RunAnalyzer(dir_test_data_.AppendASCII( + "download_protection/zipfile_nested_encrypted_zip.zip"), + &results); + EXPECT_TRUE(results.success); + EXPECT_TRUE(results.encryption_info.is_encrypted); +} + +TEST_F(SandboxedZipAnalyzerTest, NestedEncryptedRar) { + safe_browsing::ArchiveAnalyzerResults results; + RunAnalyzer(dir_test_data_.AppendASCII( + "download_protection/zipfile_nested_encrypted_archives.zip"), + &results); + EXPECT_TRUE(results.success); + EXPECT_TRUE(results.encryption_info.is_encrypted); +}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 3f1d160..68e28cc 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -2349,6 +2349,7 @@ "../browser/file_system_access/chrome_file_system_access_permission_context_browsertest.cc", "../browser/file_system_access/file_system_access_picker_requires_user_gesture_browsertest.cc", "../browser/file_system_access/file_system_access_tab_helper_browsertest.cc", + "../browser/file_system_access/file_system_file_handle_browsertest.cc", "../browser/first_party_sets/first_party_sets_policy_browsertest.cc", "../browser/first_run/first_run_browsertest.cc", "../browser/geolocation/geolocation_browsertest.cc", @@ -5314,6 +5315,7 @@ "../browser/safe_browsing/chrome_password_protection_service_browsertest.cc", "../browser/safe_browsing/chrome_password_protection_service_sync_browsertest.cc", "../browser/safe_browsing/client_side_detection_host_browsertest.cc", + "../browser/safe_browsing/ohttp_key_service_browsertest.cc", "../browser/safe_browsing/safe_browsing_blocking_page_test.cc", "../browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc", "../browser/safe_browsing/safe_browsing_service_browsertest.cc", @@ -5327,6 +5329,7 @@ "//components/safe_browsing/content/browser:safe_browsing_blocking_page", "//components/safe_browsing/content/common:file_type_policies_test_support", "//components/safe_browsing/core/browser:safe_browsing_metrics_collector", + "//components/safe_browsing/core/browser/hashprefix_realtime:hash_realtime_service", "//components/safe_browsing/core/common/fbs:client_model", "//components/safe_browsing/core/common/hashprefix_realtime:hash_realtime_utils", ] @@ -7925,6 +7928,7 @@ "../browser/ui/commerce/price_tracking_page_action_controller_unittest.cc", "../browser/ui/content_settings/content_setting_bubble_model_unittest.cc", "../browser/ui/content_settings/content_setting_image_model_unittest.cc", + "../browser/ui/exclusive_access/exclusive_access_bubble_unittest.cc", "../browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc", "../browser/ui/extensions/controlled_home_bubble_delegate_unittest.cc", "../browser/ui/extensions/extension_action_view_controller_unittest.cc",
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/browser/tab/MockTab.java b/chrome/test/android/javatests/src/org/chromium/chrome/browser/tab/MockTab.java index fe5ce60..4dc0632 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/browser/tab/MockTab.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/browser/tab/MockTab.java
@@ -35,7 +35,7 @@ /** Create a new Tab for testing and initializes Tab UserData objects. */ public static MockTab createAndInitialize(int id, Profile profile) { MockTab tab = new MockTab(id, profile); - tab.initialize(null, null, null, null, null, false, null, false); + tab.initialize(null, null, null, null, null, null, false, null, false); return tab; } @@ -43,7 +43,7 @@ public static MockTab createAndInitialize( int id, Profile profile, @TabLaunchType int tabLaunchType) { MockTab tab = new MockTab(id, profile, tabLaunchType); - tab.initialize(null, null, null, null, null, false, null, false); + tab.initialize(null, null, null, null, null, null, false, null, false); return tab; } @@ -60,6 +60,7 @@ Tab parent, @Nullable @TabCreationState Integer creationState, LoadUrlParams loadUrlParams, + @Nullable String title, WebContents webContents, @Nullable TabDelegateFactory delegateFactory, boolean initiallyHidden,
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/browser/tab/TabTestUtils.java b/chrome/test/android/javatests/src/org/chromium/chrome/browser/tab/TabTestUtils.java index 9109ce8..a3233527 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/browser/tab/TabTestUtils.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/browser/tab/TabTestUtils.java
@@ -40,6 +40,7 @@ Tab parent, @Nullable @TabCreationState Integer creationState, @Nullable LoadUrlParams loadUrlParams, + @Nullable String titleForLazyLoad, WebContents webContents, @Nullable TabDelegateFactory delegateFactory, boolean initiallyHidden, @@ -50,6 +51,7 @@ parent, creationState, loadUrlParams, + titleForLazyLoad, webContents, delegateFactory, initiallyHidden,
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/tabmodel/MockTabCreator.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/tabmodel/MockTabCreator.java index 8efc4ad..aebd741 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/tabmodel/MockTabCreator.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/tabmodel/MockTabCreator.java
@@ -46,11 +46,22 @@ @Override public Tab createNewTab( LoadUrlParams loadUrlParams, @TabLaunchType int type, Tab parent, int position) { + return createNewTab(loadUrlParams, /* title= */ null, type, parent, position); + } + + @Override + public Tab createNewTab( + LoadUrlParams loadUrlParams, + String title, + @TabLaunchType int type, + Tab parent, + int position) { Tab tab = new MockTab( 0, mSelector.getModel(mIsIncognito).getProfile(), TabLaunchType.FROM_LINK); tab.getUserDataHost().setUserData(MockTabAttributes.class, new MockTabAttributes(false)); - TabTestUtils.initialize(tab, null, null, loadUrlParams, null, null, false, null, false); + TabTestUtils.initialize( + tab, null, null, loadUrlParams, title, null, null, false, null, false); mSelector .getModel(mIsIncognito) .addTab(tab, position, type, TabCreationState.LIVE_IN_FOREGROUND); @@ -67,7 +78,7 @@ TabLaunchType.FROM_RESTORE); tab.getUserDataHost().setUserData(MockTabAttributes.class, new MockTabAttributes(true)); if (state != null) TabTestUtils.restoreFieldsFromState(tab, state); - TabTestUtils.initialize(tab, null, null, null, null, null, false, null, false); + TabTestUtils.initialize(tab, null, null, null, null, null, null, false, null, false); mSelector .getModel(mIsIncognito) .addTab(tab, index, TabLaunchType.FROM_RESTORE, TabCreationState.FROZEN_ON_RESTORE);
diff --git a/chrome/test/base/android/android_browser_test_browsertest_android.cc b/chrome/test/base/android/android_browser_test_browsertest_android.cc index b871191..0723e543 100644 --- a/chrome/test/base/android/android_browser_test_browsertest_android.cc +++ b/chrome/test/base/android/android_browser_test_browsertest_android.cc
@@ -10,11 +10,7 @@ #include "content/public/test/browser_test_utils.h" IN_PROC_BROWSER_TEST_F(AndroidBrowserTest, Smoke) { - if (base::FeatureList::IsEnabled(chrome::android::kAndroidTabDeclutter)) { - ASSERT_EQ(TabModelList::models().size(), 2u); - } else { - ASSERT_EQ(TabModelList::models().size(), 1u); - } + ASSERT_EQ(TabModelList::models().size(), 1u); // Grab a tab an navigate its contents const TabModel* tab_model = TabModelList::models()[0];
diff --git a/chrome/test/base/scoped_channel_override_fuchsia.cc b/chrome/test/base/scoped_channel_override_fuchsia.cc deleted file mode 100644 index 7aadbbd..0000000 --- a/chrome/test/base/scoped_channel_override_fuchsia.cc +++ /dev/null
@@ -1,39 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/test/base/scoped_channel_override.h" - -#include "chrome/common/channel_info.h" -#include "components/version_info/channel.h" - -namespace chrome { - -namespace { - -version_info::Channel GetChannel(ScopedChannelOverride::Channel channel) { - switch (channel) { - case ScopedChannelOverride::Channel::kExtendedStable: - case ScopedChannelOverride::Channel::kStable: - return version_info::Channel::STABLE; - case ScopedChannelOverride::Channel::kBeta: - return version_info::Channel::BETA; - case ScopedChannelOverride::Channel::kDev: - return version_info::Channel::DEV; - case ScopedChannelOverride::Channel::kCanary: - return version_info::Channel::CANARY; - } -} - -} // namespace - -ScopedChannelOverride::ScopedChannelOverride(Channel channel) { - SetChannelForTesting(GetChannel(channel), - channel == Channel::kExtendedStable); -} - -ScopedChannelOverride::~ScopedChannelOverride() { - ClearChannelForTesting(); -} - -} // namespace chrome
diff --git a/chrome/test/data/run_async_code_on_worker.html b/chrome/test/data/run_async_code_on_worker.html new file mode 100644 index 0000000..2a8eded --- /dev/null +++ b/chrome/test/data/run_async_code_on_worker.html
@@ -0,0 +1,25 @@ +<!doctype html> +<title>Run async code on a worker helper</title> +<script> +const workerCode = ` +onmessage = function(e) { + const AsyncFunction = async function () {}.constructor; + let receivedFunction = new AsyncFunction(e.data); + receivedFunction().then(workerResult => {postMessage(workerResult);}); +} +` +const workerBlob = new Blob ([workerCode], {type: 'text/javascript'}); +const worker = new Worker(window.URL.createObjectURL(workerBlob)); + +async function runOnWorkerAndWaitForResult(code) { + worker.postMessage(code); + return new Promise((resolve, reject) => { + worker.onmessage = result => { + resolve(result.data); + } + worker.onerror = error => { + reject(error); + } + }); +} +</script> \ No newline at end of file
diff --git a/chrome/test/data/safe_browsing/download_protection/README b/chrome/test/data/safe_browsing/download_protection/README index 1ad26da6..5446af38 100644 --- a/chrome/test/data/safe_browsing/download_protection/README +++ b/chrome/test/data/safe_browsing/download_protection/README
@@ -27,3 +27,5 @@ - zip -e encrypted.zip signed.exe - cp encrypted.zip encrypter_zip_no_extension - 7za a -tzip -p12345 -mem=AES256 encrypted_aes.zip signed.exe +- zip zipfile_nested_encrypted_zip.zip encrypted.zip +- zip zipfile_nested_encrypted_archives.zip encrypted.zip ../rar/has_exe.rar \ No newline at end of file
diff --git a/chrome/test/data/safe_browsing/download_protection/zipfile_nested_encrypted_archives.zip b/chrome/test/data/safe_browsing/download_protection/zipfile_nested_encrypted_archives.zip new file mode 100644 index 0000000..d2a78c0 --- /dev/null +++ b/chrome/test/data/safe_browsing/download_protection/zipfile_nested_encrypted_archives.zip Binary files differ
diff --git a/chrome/test/data/safe_browsing/download_protection/zipfile_nested_encrypted_zip.zip b/chrome/test/data/safe_browsing/download_protection/zipfile_nested_encrypted_zip.zip new file mode 100644 index 0000000..256267f --- /dev/null +++ b/chrome/test/data/safe_browsing/download_protection/zipfile_nested_encrypted_zip.zip Binary files differ
diff --git a/chrome/test/data/shared_storage/module_with_custom_header.js b/chrome/test/data/shared_storage/module_with_custom_header.js new file mode 100644 index 0000000..af00636 --- /dev/null +++ b/chrome/test/data/shared_storage/module_with_custom_header.js
@@ -0,0 +1,33 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +console.log('Start executing module_with_custom_header.js') + +class TestOperation { + async run(data) { + console.log('Start executing \'test-operation\''); + console.log(JSON.stringify(data, Object.keys(data).sort())); + console.log('Finish executing \'test-operation\''); + } +} + +class TestURLSelectionOperation { + async run(urls, data) { + console.log('Start executing \'test-url-selection-operation\''); + console.log(JSON.stringify(urls)); + console.log(JSON.stringify(data, Object.keys(data).sort())); + console.log('Finish executing \'test-url-selection-operation\''); + + if (data && data.hasOwnProperty('mockResult')) { + return data['mockResult']; + } + + return -1; + } +} + +register('test-operation', TestOperation); +register('test-url-selection-operation', TestURLSelectionOperation); + +console.log('Finish executing module_with_custom_header.js')
diff --git a/chrome/test/data/shared_storage/module_with_custom_header.js.mock-http-headers b/chrome/test/data/shared_storage/module_with_custom_header.js.mock-http-headers new file mode 100644 index 0000000..f6714d1 --- /dev/null +++ b/chrome/test/data/shared_storage/module_with_custom_header.js.mock-http-headers
@@ -0,0 +1,4 @@ +HTTP/1.1 200 OK +Content-Type: text/javascript +{{ACCESS_CONTROL_ALLOW_ORIGIN_HEADER}} +{{SHARED_STORAGE_CROSS_ORIGIN_WORKLET_ALLOWED_HEADER}}
diff --git a/chrome/test/data/webui/BUILD.gn b/chrome/test/data/webui/BUILD.gn index aaa80fa..e38d279 100644 --- a/chrome/test/data/webui/BUILD.gn +++ b/chrome/test/data/webui/BUILD.gn
@@ -17,6 +17,7 @@ import("//ui/webui/webui_features.gni") assert(!is_android) +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") source_set("browser_tests") { testonly = true @@ -142,7 +143,7 @@ sources += [ "discards/discards_browsertest.cc" ] } - if (is_win || is_mac || is_linux || is_fuchsia) { + if (is_win || is_mac || is_linux) { sources += [ "app_settings/app_settings_browsertest.cc" ] }
diff --git a/chrome/test/data/webui/app_home/BUILD.gn b/chrome/test/data/webui/app_home/BUILD.gn index 8ff68a9..3cf5c4d5 100644 --- a/chrome/test/data/webui/app_home/BUILD.gn +++ b/chrome/test/data/webui/app_home/BUILD.gn
@@ -4,7 +4,8 @@ import("../build_webui_tests.gni") -assert(is_win || is_mac || is_linux || is_fuchsia) +assert(is_win || is_mac || is_linux) +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") build_webui_tests("build") { files = [
diff --git a/chrome/test/data/webui/app_settings/BUILD.gn b/chrome/test/data/webui/app_settings/BUILD.gn index 9ad998e..83f22d6 100644 --- a/chrome/test/data/webui/app_settings/BUILD.gn +++ b/chrome/test/data/webui/app_settings/BUILD.gn
@@ -4,7 +4,9 @@ import("../build_webui_tests.gni") -assert(is_win || is_mac || is_linux || is_fuchsia) +assert(is_win || is_mac || is_linux) + +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") build_webui_tests("build") { files = [
diff --git a/chrome/test/data/webui/chromeos/diagnostics/BUILD.gn b/chrome/test/data/webui/chromeos/diagnostics/BUILD.gn index 36917f7..8b55457 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/BUILD.gn +++ b/chrome/test/data/webui/chromeos/diagnostics/BUILD.gn
@@ -26,7 +26,7 @@ "diagnostics_sticky_banner_test.ts", "diagnostics_test_utils.js", "diagnostics_utils_test.ts", - "drawing_provider_test.js", + "drawing_provider_test.ts", "drawing_provider_utils_test.js", "ethernet_info_test.js", "fake_network_health_provider_test.js",
diff --git a/chrome/test/data/webui/chromeos/diagnostics/drawing_provider_test.js b/chrome/test/data/webui/chromeos/diagnostics/drawing_provider_test.ts similarity index 72% rename from chrome/test/data/webui/chromeos/diagnostics/drawing_provider_test.js rename to chrome/test/data/webui/chromeos/diagnostics/drawing_provider_test.ts index 2c8c356..2b9b5a7 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/drawing_provider_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/drawing_provider_test.ts
@@ -7,59 +7,56 @@ import {CanvasDrawingProvider} from 'chrome://diagnostics/drawing_provider.js'; import {constructRgba, DESTINATION_OVER, LINE_CAP, LINE_WIDTH, lookupCssVariableValue, MARK_COLOR, MARK_OPACITY, MARK_RADIUS, TRAIL_COLOR, TRAIL_MAX_OPACITY} from 'chrome://diagnostics/drawing_provider_utils.js'; +import {assertNotReached} from 'chrome://resources/js/assert.js'; import {assertDeepEquals, assertEquals} from 'chrome://webui-test/chromeos/chai_assert.js'; - -import {MockController} from '../mock_controller.m.js'; +import {MockController} from 'chrome://webui-test/mock_controller.js'; /** * FakeCanvasCtx class mocks various html Canvas API methods to make it easy to * test the drawing behavior. */ -class FakeCanvasCtx { - constructor() { - this.mock = []; - } +class FakeCanvasCtx implements Partial<CanvasRenderingContext2D> { + mock: string[] = []; - getMock() { + getMock(): string[] { return this.mock; } - beginPath() { + beginPath(): void { this.mock.push('beginPath'); } - stroke() { + stroke(): void { this.mock.push('stroke'); } - fill() { + fill(): void { this.mock.push('fill'); } - moveTo(x, y) { + moveTo(x: number, y: number): void { this.mock.push(`moveTo:${x}~${y}`); } - lineTo(x, y) { + lineTo(x: number, y: number): void { this.mock.push(`lineTo:${x}~${y}`); } - arc(x, y, r, startAngle, endAngle) { + arc(x: number, y: number, r: number, startAngle: number, + endAngle: number): void { this.mock.push(`arc:${x}~${y}~${r}~${startAngle}~${endAngle}`); } } suite('drawingProviderTestSuite', function() { - /** @type {{createFunctionMock: Function, reset: Function}} */ - let mockController; + const mockController = new MockController(); setup(() => { // Setup mock for window.getComputedStyle function to prevent test flaky. - mockController = new MockController(); const mockComputedStyle = mockController.createFunctionMock(window, 'getComputedStyle'); mockComputedStyle.returnValue = { - getPropertyValue: (valName) => { + getPropertyValue: (valName: string) => { switch (valName) { case TRAIL_COLOR: return 'rgb(220, 210, 155)'; @@ -67,6 +64,8 @@ return 'rgb(198, 179, 165)'; case MARK_OPACITY: return '0.7'; + default: + assertNotReached(); } }, }; @@ -76,13 +75,13 @@ mockController.reset(); }); - function initializeDrawingProvider() { - return new CanvasDrawingProvider(new FakeCanvasCtx()); + function initializeDrawingProvider(): CanvasDrawingProvider { + return new CanvasDrawingProvider( + new FakeCanvasCtx() as unknown as CanvasRenderingContext2D); } test('SettingUpCanvasDrawingProvider', () => { const drawingProvider = initializeDrawingProvider(); - assertEquals(LINE_CAP, drawingProvider.getLineCap()); assertEquals(LINE_WIDTH, drawingProvider.getLineWidth()); }); @@ -104,9 +103,11 @@ drawingProvider.drawTrail(x0, y0, x1, y1, pressure); const expectedStrokeStyle = constructRgba( - lookupCssVariableValue(TRAIL_COLOR), TRAIL_MAX_OPACITY * pressure); + lookupCssVariableValue(TRAIL_COLOR), `${TRAIL_MAX_OPACITY * pressure}`); - assertDeepEquals(expectedMock, drawingProvider.getCtx().getMock()); + assertDeepEquals( + expectedMock, + (drawingProvider.getCtx() as unknown as FakeCanvasCtx).getMock()); assertEquals(expectedStrokeStyle, drawingProvider.getStrokeStyle()); }); @@ -126,7 +127,9 @@ lookupCssVariableValue(MARK_COLOR), lookupCssVariableValue(MARK_OPACITY)); - assertDeepEquals(expectedMock, drawingProvider.getCtx().getMock()); + assertDeepEquals( + expectedMock, + (drawingProvider.getCtx() as unknown as FakeCanvasCtx).getMock()); assertEquals(expectedFillStyle, drawingProvider.getFillStyle()); assertEquals( DESTINATION_OVER, drawingProvider.getGlobalCompositeOperation());
diff --git a/chrome/test/data/webui/chromeos/settings/BUILD.gn b/chrome/test/data/webui/chromeos/settings/BUILD.gn index 00cec2e..118b47e 100644 --- a/chrome/test/data/webui/chromeos/settings/BUILD.gn +++ b/chrome/test/data/webui/chromeos/settings/BUILD.gn
@@ -63,6 +63,7 @@ "controls/settings_toggle_button_test.ts", "controls/v2/pref_control_mixin_internal_test.ts", + "controls/v2/settings_dropdown_v2_test.ts", "crostini_page/bruschetta_subpage_test.ts", "crostini_page/crostini_arc_adb_test.ts",
diff --git a/chrome/test/data/webui/chromeos/settings/controls/v2/settings_dropdown_v2_test.ts b/chrome/test/data/webui/chromeos/settings/controls/v2/settings_dropdown_v2_test.ts new file mode 100644 index 0000000..dd612042 --- /dev/null +++ b/chrome/test/data/webui/chromeos/settings/controls/v2/settings_dropdown_v2_test.ts
@@ -0,0 +1,206 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'chrome://os-settings/os_settings.js'; + +import {SettingsDropdownV2Element} from 'chrome://os-settings/os_settings.js'; +import {assertEquals, assertFalse, assertNotEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; +import {flushTasks} from 'chrome://webui-test/polymer_test_util.js'; +import {eventToPromise} from 'chrome://webui-test/test_util.js'; + +import {clearBody} from '../../utils.js'; + +suite('<settings-dropdown-v2>', () => { + let dropdownElement: SettingsDropdownV2Element; + let internalSelectElement: HTMLSelectElement; + + const testOptions = [ + {label: 'Lion', value: 1}, + {label: 'Tiger', value: 2}, + {label: 'Bear', value: 3}, + ]; + + const fakeNumberPrefObject = { + key: 'settings.animal', + type: chrome.settingsPrivate.PrefType.NUMBER, + value: 1, + }; + + function simulateSelectAction(value: string|number): void { + internalSelectElement.value = value.toString(); + internalSelectElement.dispatchEvent(new CustomEvent('change')); + } + + function assertOptionSelected(expectedValue: string|number): void { + assertEquals(expectedValue.toString(), internalSelectElement.value); + + const selectedOption = + Array.from(internalSelectElement.options).find((option) => { + return expectedValue.toString() === option.value; + }); + + assertTrue( + !!selectedOption, `No matching option for value: ${expectedValue}`); + assertTrue(selectedOption.selected, 'Option is not selected'); + } + + setup(async () => { + clearBody(); + dropdownElement = document.createElement(SettingsDropdownV2Element.is); + dropdownElement.options = testOptions; + document.body.appendChild(dropdownElement); + internalSelectElement = dropdownElement.$.select; + await flushTasks(); + }); + + suite('disabled property', () => { + test('should reflect to attribute', () => { + // `disabled` is false by default. + assertFalse(dropdownElement.hasAttribute('disabled')); + + dropdownElement.disabled = true; + assertTrue(dropdownElement.hasAttribute('disabled')); + + dropdownElement.disabled = false; + assertFalse(dropdownElement.hasAttribute('disabled')); + }); + + test('is true if pref is enforced', () => { + dropdownElement.pref = {...fakeNumberPrefObject}; + assertFalse(dropdownElement.disabled); + + dropdownElement.pref = { + ...fakeNumberPrefObject, + enforcement: chrome.settingsPrivate.Enforcement.ENFORCED, + }; + assertTrue(dropdownElement.disabled); + }); + + test('cannot be overridden if pref is enforced', () => { + dropdownElement.pref = { + ...fakeNumberPrefObject, + enforcement: chrome.settingsPrivate.Enforcement.ENFORCED, + }; + assertTrue(dropdownElement.disabled); + + // Attempt to force enable the element. Element should still be disabled + // since the pref is enforced. + dropdownElement.disabled = false; + assertTrue(dropdownElement.disabled); + }); + }); + + test('Internal select is disabled if there are no menu options', () => { + assertTrue(dropdownElement.options.length > 0); + assertFalse(internalSelectElement.disabled); + + dropdownElement.options = []; + assertTrue(internalSelectElement.disabled); + }); + + test('Hidden options are not shown', async () => { + const testOptionsWithHiddenAttr = [ + {label: 'Lion', value: 1, hidden: false}, + { + label: 'Tiger', + value: 2, + hidden: true, + }, + {label: 'Bear', value: 3}, + ]; + dropdownElement.options = testOptionsWithHiddenAttr; + await flushTasks(); + + testOptionsWithHiddenAttr.forEach((option, index) => { + assertEquals( + !!option.hidden, internalSelectElement.options[index]!.hidden); + }); + }); + + test('Not found option is included and hidden', () => { + const options = Array.from(internalSelectElement.options); + assertEquals(testOptions.length + 1, options.length); + const notFoundOption = options.find((option) => { + return option.value === 'SETTINGS_DROPDOWN_NOT_FOUND'; + }); + assertTrue(!!notFoundOption); + assertTrue(notFoundOption.hidden); + }); + + suite( + 'validation', + () => { + // TODO(b/333454399) Add pref type validation tests. + }); + + suite('with pref', () => { + setup(async () => { + dropdownElement.pref = {...fakeNumberPrefObject}; + await flushTasks(); + }); + + test('Pref value updates selected option', () => { + assertOptionSelected(1); + dropdownElement.set('pref.value', 2); + assertOptionSelected(2); + dropdownElement.set('pref.value', 3); + assertOptionSelected(3); + }); + + test( + 'Not found option is selected if no matching option for pref value', + () => { + assertOptionSelected(1); + dropdownElement.set('pref.value', 9001); + assertOptionSelected('SETTINGS_DROPDOWN_NOT_FOUND'); + dropdownElement.set('pref.value', 2); + assertOptionSelected(2); + }); + + test('Selecting an option updates local pref value', () => { + for (const testOption of testOptions) { + const value = testOption.value; + simulateSelectAction(value); + assertOptionSelected(value); + assertEquals(value, dropdownElement.pref!.value); + } + }); + + test('Selecting an option dispatches pref change event', async () => { + for (const testOption of testOptions) { + const prefChangeEventPromise = + eventToPromise('user-action-setting-pref-change', window); + const value = testOption.value; + simulateSelectAction(value); + assertOptionSelected(value); + + const event = await prefChangeEventPromise; + assertEquals(fakeNumberPrefObject.key, event.detail.prefKey); + assertEquals(value, event.detail.value); + } + }); + + test('Selecting an option dispatches change event', async () => { + for (const testOption of testOptions) { + const changeEventPromise = eventToPromise('change', window); + const value = testOption.value; + simulateSelectAction(value); + assertOptionSelected(value); + + const event = await changeEventPromise; + assertEquals(value, event.detail); + } + }); + }); + + suite('focus()', () => { + test('should focus the internal select element', () => { + assertNotEquals( + internalSelectElement, dropdownElement.shadowRoot!.activeElement); + dropdownElement.focus(); + assertEquals( + internalSelectElement, dropdownElement.shadowRoot!.activeElement); + }); + }); +});
diff --git a/chrome/test/data/webui/chromeos/settings/device_page/device_page_test.ts b/chrome/test/data/webui/chromeos/settings/device_page/device_page_test.ts index 1b90a033..fed4996 100644 --- a/chrome/test/data/webui/chromeos/settings/device_page/device_page_test.ts +++ b/chrome/test/data/webui/chromeos/settings/device_page/device_page_test.ts
@@ -920,12 +920,14 @@ const setNoiseCancellationEnabled = mockController.createFunctionMock( crosAudioConfig, 'setNoiseCancellationEnabled'); - const noiseCancellationSubsection = audioPage.shadowRoot!.querySelector( - '#audioInputNoiseCancellationSubsection'); + const noiseCancellationSubsection = + audioPage.shadowRoot!.querySelector<HTMLDivElement>( + '#audioInputNoiseCancellationSubsection'); const noiseCancellationToggle = audioPage.shadowRoot!.querySelector<CrToggleElement>( '#audioInputNoiseCancellationToggle'); + assertTrue(!!noiseCancellationSubsection); assertTrue(isVisible(noiseCancellationSubsection)); assertTrue(!!noiseCancellationToggle); assertFalse(noiseCancellationToggle.checked); @@ -939,6 +941,18 @@ /* expected_call_count */ 1, setNoiseCancellationEnabled['calls_'].length); + // Clicking on the row should toggle the noise cancellation toggle. + noiseCancellationSubsection.click(); + assertEquals( + /* expected_call_count */ 2, + setNoiseCancellationEnabled['calls_'].length); + const argsPassedToSetNoiseCancellationEnabled = + setNoiseCancellationEnabled['calls_'][1]; + assertTrue(!!argsPassedToSetNoiseCancellationEnabled); + // "setNoiseCancellationEnabled" should have been called with "false" + // after the row was clicked on. + assertFalse(argsPassedToSetNoiseCancellationEnabled[0]); + crosAudioConfig.setAudioSystemProperties( noiseCancellationNotSupportedAudioSystemProperties); await flushTasks();
diff --git a/chrome/test/data/webui/chromeos/settings/os_settings_browsertest.cc b/chrome/test/data/webui/chromeos/settings/os_settings_browsertest.cc index c506e84..5a24e85a 100644 --- a/chrome/test/data/webui/chromeos/settings/os_settings_browsertest.cc +++ b/chrome/test/data/webui/chromeos/settings/os_settings_browsertest.cc
@@ -702,6 +702,10 @@ RunSettingsTest("controls/v2/pref_control_mixin_internal_test.js"); } +IN_PROC_BROWSER_TEST_P(OSSettingsRevampMochaTest, SettingsDropdownV2) { + RunSettingsTest("controls/v2/settings_dropdown_v2_test.js"); +} + IN_PROC_BROWSER_TEST_P(OSSettingsCrostiniTestRevamp, CrostiniPageBruschettaSubpage) { RunSettingsTest("crostini_page/bruschetta_subpage_test.js");
diff --git a/chrome/test/data/webui/chromeos/shimless_rma/shimless_3p_diag_test.ts b/chrome/test/data/webui/chromeos/shimless_rma/shimless_3p_diag_test.ts index 99325128..ab11d10 100644 --- a/chrome/test/data/webui/chromeos/shimless_rma/shimless_3p_diag_test.ts +++ b/chrome/test/data/webui/chromeos/shimless_rma/shimless_3p_diag_test.ts
@@ -566,7 +566,7 @@ {path: '/fake/installable.swbn'}); service.setInstallLastFound3pDiagnosticsApp({ name: 'Test Diag App', - permissionMessage: undefined, + permissionMessage: null, }); service.setShow3pDiagnosticsAppResult(Show3pDiagnosticsAppResult.kOk); await initialize();
diff --git a/chrome/test/data/webui/cr_components/chromeos/network/apn_list_item_test.js b/chrome/test/data/webui/cr_components/chromeos/network/apn_list_item_test.js index ec8a622..af3cf732 100644 --- a/chrome/test/data/webui/cr_components/chromeos/network/apn_list_item_test.js +++ b/chrome/test/data/webui/cr_components/chromeos/network/apn_list_item_test.js
@@ -9,6 +9,7 @@ import {ApnDetailDialogMode, ApnEventData} from 'chrome://resources/ash/common/network/cellular_utils.js'; import {MojoInterfaceProviderImpl} from 'chrome://resources/ash/common/network/mojo_interface_provider.js'; import {OncMojo} from 'chrome://resources/ash/common/network/onc_mojo.js'; +import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {ApnState, ApnType, CrosNetworkConfigRemote} from 'chrome://resources/mojo/chromeos/services/network_config/public/mojom/cros_network_config.mojom-webui.js'; import {NetworkType, PortalState} from 'chrome://resources/mojo/chromeos/services/network_config/public/mojom/network_types.mojom-webui.js'; import {assertEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; @@ -35,14 +36,17 @@ setup(async function() { mojoApi_ = new FakeNetworkConfig(); MojoInterfaceProviderImpl.getInstance().remote_ = mojoApi_; + }); + + async function init() { apnListItem = document.createElement('apn-list-item'); apnListItem.apn = { accessPointName: 'apn1', }; apnListItem.guid = 'cellular_guid'; document.body.appendChild(apnListItem); - await flushTasks(); - }); + return flushTasks(); + } function openThreeDotMenu() { const menuButton = @@ -55,6 +59,7 @@ } test('Check if APN list item exists', async function() { + await init(); assertTrue(!!apnListItem); apnListItem.apn = { accessPointName: 'apn1', @@ -77,6 +82,7 @@ }); test('Check if connected sublabel is shown', async function() { + await init(); apnListItem.isConnected = false; await flushTasks(); @@ -100,11 +106,13 @@ }); test('Check if APN three dot menu shows', async function() { + await init(); await openThreeDotMenu(); assertTrue(apnListItem.$.dotsMenu.open); }); test('Check disabled state.', async function() { + await init(); apnListItem.apn = { state: ApnState.kDisabled, accessPointName: 'apn', @@ -130,6 +138,7 @@ }); test('Check if three dot menu remove APN works', async function() { + await init(); const guid = 'cellular_guid'; await openThreeDotMenu(); const getRemoveButton = () => @@ -172,6 +181,7 @@ }); test('Check if three dot menu disable/enable APN works', async function() { + await init(); const guid = 'cellular_guid'; await openThreeDotMenu(); const getEnableButton = () => @@ -235,50 +245,78 @@ assertFalse(apnListItem.$.dotsMenu.open); }); - test( - 'Clicking APN details button triggers a show-apn-detail-dialog event ', - async function() { - apnListItem.apn = TEST_APN_EVENT_DATA.apn; - apnListItem.guid = TEST_APN_EVENT_DATA.guid; + [true, false].forEach(isApnPoliciesEnabled => { + test( + `Clicking APN details button triggers a show-apn-detail-dialog event + when isApnPoliciesEnabled is ${isApnPoliciesEnabled}`, + async function() { + loadTimeData.overrideValues({ + isApnPoliciesEnabled, + }); + await init(); + apnListItem.apn = TEST_APN_EVENT_DATA.apn; + apnListItem.guid = TEST_APN_EVENT_DATA.guid; - const subLabel = apnListItem.shadowRoot.querySelector('#autoDetected'); - assertTrue(!!subLabel); - assertFalse(subLabel.hasAttribute('hidden')); - assertEquals(apnListItem.i18n('apnAutoDetected'), subLabel.innerText); + const subLabel = + apnListItem.shadowRoot.querySelector('#autoDetected'); + assertTrue(!!subLabel); + assertFalse(subLabel.hasAttribute('hidden')); + assertEquals(apnListItem.i18n('apnAutoDetected'), subLabel.innerText); - let apnDetailsClickedEvent = - eventToPromise('show-apn-detail-dialog', window); - assertTrue(!!apnListItem.$.detailsButton); - assertEquals( - apnListItem.i18n('apnMenuDetails'), - apnListItem.$.detailsButton.innerText.trim()); - apnListItem.$.detailsButton.click(); - let eventData = await apnDetailsClickedEvent; + let apnDetailsClickedEvent = + eventToPromise('show-apn-detail-dialog', window); + assertTrue(!!apnListItem.$.detailsButton); + assertEquals( + apnListItem.i18n('apnMenuDetails'), + apnListItem.$.detailsButton.innerText.trim()); + apnListItem.$.detailsButton.click(); + let eventData = await apnDetailsClickedEvent; - assertEquals(TEST_APN_EVENT_DATA.apn.name, eventData.detail.apn.name); - assertEquals(TEST_APN_EVENT_DATA.mode, eventData.detail.mode); - assertFalse(apnListItem.$.dotsMenu.open); + assertEquals(TEST_APN_EVENT_DATA.apn.name, eventData.detail.apn.name); + assertEquals(TEST_APN_EVENT_DATA.mode, eventData.detail.mode); + assertFalse(apnListItem.$.dotsMenu.open); - // Case: the apn list item is not auto detected - apnListItem.apn = { - name: TEST_APN_EVENT_DATA.apn.name, - id: '1', - }; - assertTrue(subLabel.hasAttribute('hidden')); - assertEquals( - apnListItem.i18n('apnMenuEdit'), - apnListItem.$.detailsButton.innerText.trim()); + // Case: the apn list item is not auto detected. + apnListItem.apn = { + name: TEST_APN_EVENT_DATA.apn.name, + id: '1', + }; + assertTrue(subLabel.hasAttribute('hidden')); + assertEquals( + apnListItem.i18n('apnMenuEdit'), + apnListItem.$.detailsButton.innerText.trim()); - apnDetailsClickedEvent = - eventToPromise('show-apn-detail-dialog', window); - apnListItem.$.detailsButton.click(); - eventData = await apnDetailsClickedEvent; - assertEquals(TEST_APN_EVENT_DATA.apn.name, eventData.detail.apn.name); - assertEquals(ApnDetailDialogMode.EDIT, eventData.detail.mode); - assertFalse(apnListItem.$.dotsMenu.open); - }); + apnDetailsClickedEvent = + eventToPromise('show-apn-detail-dialog', window); + apnListItem.$.detailsButton.click(); + eventData = await apnDetailsClickedEvent; + assertEquals(TEST_APN_EVENT_DATA.apn.name, eventData.detail.apn.name); + assertEquals(ApnDetailDialogMode.EDIT, eventData.detail.mode); + assertFalse(apnListItem.$.dotsMenu.open); + + if (isApnPoliciesEnabled) { + // Case: APN modification is disallowed. + apnListItem.shouldDisallowApnModification = true; + await flushTasks(); + + assertEquals( + apnListItem.i18n('apnMenuDetails'), + apnListItem.$.detailsButton.innerText.trim()); + + apnDetailsClickedEvent = + eventToPromise('show-apn-detail-dialog', window); + apnListItem.$.detailsButton.click(); + eventData = await apnDetailsClickedEvent; + assertEquals( + TEST_APN_EVENT_DATA.apn.name, eventData.detail.apn.name); + assertEquals(ApnDetailDialogMode.VIEW, eventData.detail.mode); + assertFalse(apnListItem.$.dotsMenu.open); + } + }); + }); test('Test if disable/remove warning event is fired.', async function() { + await init(); const guid = 'cellular_guid'; let promptShowEvent = eventToPromise('show-error-toast', window); await openThreeDotMenu(); @@ -325,6 +363,7 @@ }); test('Test if enable warning event is fired.', async function() { + await init(); const guid = 'cellular_guid'; const promptShowEvent = eventToPromise('show-error-toast', window); await openThreeDotMenu(); @@ -359,6 +398,7 @@ }); test('Item a11y', async function() { + await init(); apnListItem.itemIndex = 0; apnListItem.listSize = 1;
diff --git a/chrome/test/data/webui/extensions/item_test.ts b/chrome/test/data/webui/extensions/item_test.ts index 09439683..bcf5d32 100644 --- a/chrome/test/data/webui/extensions/item_test.ts +++ b/chrome/test/data/webui/extensions/item_test.ts
@@ -9,7 +9,7 @@ import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertDeepEquals, assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; -import {isChildVisible} from 'chrome://webui-test/test_util.js'; +import {isChildVisible, microtasksFinished} from 'chrome://webui-test/test_util.js'; import {TestService} from './test_service.js'; import {createExtensionInfo, MockItemDelegate, testVisible} from './test_util.js'; @@ -447,18 +447,18 @@ // Test that the correct tooltip text is shown when the enable toggle is // hovered over, depending on if the extension is enabled/disabled and its // permissions. - test('EnableExtensionToggleTooltips', function() { - const paperTooltip = + test('EnableExtensionToggleTooltips', async() => { + const crTooltip = item.shadowRoot!.querySelector<HTMLElement>('#enable-toggle-tooltip')!; testVisible(item, '#enable-toggle-tooltip', false); item.$.enableToggle.dispatchEvent( - new MouseEvent('mouseenter', {bubbles: true, composed: true})); - flush(); + new CustomEvent('pointerenter', {bubbles: true, composed: true})); + await microtasksFinished(); testVisible(item, '#enable-toggle-tooltip', true); assertEquals( loadTimeData.getString('enableToggleTooltipEnabled'), - paperTooltip.textContent!.trim()); + crTooltip.textContent!.trim()); item.set( 'data.permissions', @@ -466,12 +466,12 @@ flush(); assertEquals( loadTimeData.getString('enableToggleTooltipEnabledWithSiteAccess'), - paperTooltip.textContent!.trim()); + crTooltip.textContent!.trim()); item.set('data.state', 'DISABLED'); flush(); assertEquals( loadTimeData.getString('enableToggleTooltipDisabled'), - paperTooltip.textContent!.trim()); + crTooltip.textContent!.trim()); }); });
diff --git a/chrome/test/data/webui/history/history_app_test.ts b/chrome/test/data/webui/history/history_app_test.ts index 49514ac..b0e43ef 100644 --- a/chrome/test/data/webui/history/history_app_test.ts +++ b/chrome/test/data/webui/history/history_app_test.ts
@@ -9,7 +9,6 @@ import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {flushTasks} from 'chrome://webui-test/polymer_test_util.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; - import {TestBrowserService} from './test_browser_service.js'; suite('HistoryAppTest', function() { @@ -156,8 +155,31 @@ const historyEmbeddings = element.shadowRoot!.querySelector('cr-history-embeddings'); assertTrue(!!historyEmbeddings); - assertEquals( - expectedDateObject.getTime(), - historyEmbeddings.timeRangeStart?.getTime()); + const timeRangeStartObj = historyEmbeddings.timeRangeStart; + assertTrue(!!timeRangeStartObj); + assertEquals(expectedDateObject.getTime(), timeRangeStartObj.getTime()); + + // Update only the search term. Verify that the date object has not changed. + element.dispatchEvent(new CustomEvent('change-query', { + bubbles: true, + composed: true, + detail: { + search: 'two words updated', + after: '2022-04-02', + }, + })); + await flushTasks(); + assertEquals(timeRangeStartObj, historyEmbeddings.timeRangeStart); + + // Clear the after date query. + element.dispatchEvent(new CustomEvent('change-query', { + bubbles: true, + composed: true, + detail: { + search: 'two words', + }, + })); + await flushTasks(); + assertEquals(undefined, historyEmbeddings.timeRangeStart); }); });
diff --git a/chrome/test/data/webui/new_tab_page/new_tab_page_focus_test.cc b/chrome/test/data/webui/new_tab_page/new_tab_page_focus_test.cc index 131a5ad7..887dcbbf 100644 --- a/chrome/test/data/webui/new_tab_page/new_tab_page_focus_test.cc +++ b/chrome/test/data/webui/new_tab_page/new_tab_page_focus_test.cc
@@ -14,7 +14,14 @@ } }; -IN_PROC_BROWSER_TEST_F(NewTabPageFocusTest, CustomizeDialogFocus) { +#if BUILDFLAG(IS_MAC) +// TODO(crbug.com/40894552): Test is flaky (see crbug.com/41483695) but can be +// removed as part of the customize dialog deprecation. +#define MAYBE_CustomizeDialogFocus DISABLED_CustomizeDialogFocus +#else +#define MAYBE_CustomizeDialogFocus CustomizeDialogFocus +#endif +IN_PROC_BROWSER_TEST_F(NewTabPageFocusTest, MAYBE_CustomizeDialogFocus) { RunTest("new_tab_page/customize_dialog_focus_test.js", "mocha.run()"); }
diff --git a/chrome/test/data/webui/side_panel/read_anything/BUILD.gn b/chrome/test/data/webui/side_panel/read_anything/BUILD.gn index 735972b..ccecf46 100644 --- a/chrome/test/data/webui/side_panel/read_anything/BUILD.gn +++ b/chrome/test/data/webui/side_panel/read_anything/BUILD.gn
@@ -37,6 +37,7 @@ "read_aloud_update_content_selection.ts", "read_aloud_update_content_selection_pdf.ts", "read_aloud_highlighting_test.ts", + "toolbar_overflow_test.ts", "update_content_selection_with_highlights.ts", "next_previous_granularity_test.ts", "update_content_selection.ts",
diff --git a/chrome/test/data/webui/side_panel/read_anything/read_anything_browsertest.cc b/chrome/test/data/webui/side_panel/read_anything/read_anything_browsertest.cc index d906f5a1..e0a7ec2 100644 --- a/chrome/test/data/webui/side_panel/read_anything/read_anything_browsertest.cc +++ b/chrome/test/data/webui/side_panel/read_anything/read_anything_browsertest.cc
@@ -153,6 +153,11 @@ "mocha.run()"); } +IN_PROC_BROWSER_TEST_F(ReadAnythingMochaTest, ToolbarOverflow) { + RunSidePanelTest("side_panel/read_anything/toolbar_overflow_test.js", + "mocha.run()"); +} + // Integration tests that need the actual Read Aloud flag enabled because they // use the full C++ pipeline class ReadAnythingReadAloudMochaTest : public ReadAnythingMochaBrowserTest {
diff --git a/chrome/test/data/webui/side_panel/read_anything/toolbar_overflow_test.ts b/chrome/test/data/webui/side_panel/read_anything/toolbar_overflow_test.ts new file mode 100644 index 0000000..1ba1916 --- /dev/null +++ b/chrome/test/data/webui/side_panel/read_anything/toolbar_overflow_test.ts
@@ -0,0 +1,88 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'chrome-untrusted://read-anything-side-panel.top-chrome/read_anything_toolbar.js'; + +import {BrowserProxy} from '//resources/cr_components/color_change_listener/browser_proxy.js'; +import {flush} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {moreOptionsClass} from 'chrome-untrusted://read-anything-side-panel.top-chrome/read_anything_toolbar.js'; +import type {ReadAnythingToolbarElement} from 'chrome-untrusted://read-anything-side-panel.top-chrome/read_anything_toolbar.js'; +import {assertEquals, assertFalse, assertTrue} from 'chrome-untrusted://webui-test/chai_assert.js'; + +import {suppressInnocuousErrors} from './common.js'; +import {FakeReadingMode} from './fake_reading_mode.js'; +import {TestColorUpdaterBrowserProxy} from './test_color_updater_browser_proxy.js'; + +// TODO: b/40275871 - Add more tests. +suite('ToolbarOverflow', () => { + let testBrowserProxy: TestColorUpdaterBrowserProxy; + let toolbar: ReadAnythingToolbarElement; + + setup(() => { + suppressInnocuousErrors(); + testBrowserProxy = new TestColorUpdaterBrowserProxy(); + BrowserProxy.setInstance(testBrowserProxy); + document.body.innerHTML = window.trustedTypes!.emptyHTML; + const readingMode = new FakeReadingMode(); + chrome.readingMode = readingMode as unknown as typeof chrome.readingMode; + chrome.readingMode.isReadAloudEnabled = true; + toolbar = document.createElement('read-anything-toolbar'); + document.body.appendChild(toolbar); + flush(); + }); + + suite('on reset toolbar', () => { + setup(() => { + // Open the menu first so we can be sure the event is what closes it. + toolbar.$.moreOptionsMenu.get().showAt(toolbar); + assertTrue(toolbar.$.moreOptionsMenu.get().open); + + toolbar.$.toolbarContainer.dispatchEvent( + new CustomEvent('reset-toolbar')); + flush(); + }); + + test('more options closed', () => { + assertFalse(toolbar.$.moreOptionsMenu.get().open); + }); + + test('more options empty', () => { + const moreOptionsButtons = + toolbar.$.moreOptionsMenu.get().querySelectorAll<HTMLElement>( + moreOptionsClass); + assertEquals(moreOptionsButtons.length, 0); + }); + }); + + suite('on toolbar overflow', () => { + function overflow(numOverflowButtons: number) { + toolbar.$.toolbarContainer.dispatchEvent( + new CustomEvent('toolbar-overflow', { + bubbles: true, + composed: true, + detail: {numOverflowButtons}, + })); + toolbar.$.moreOptionsMenu.get(); + flush(); + } + + test('more options contains overflow', () => { + let numOverflow = 3; + overflow(numOverflow); + assertEquals( + toolbar.$.moreOptionsMenu.get() + .querySelectorAll<HTMLElement>(moreOptionsClass) + .length, + numOverflow); + + numOverflow = 5; + overflow(numOverflow); + assertEquals( + toolbar.$.moreOptionsMenu.get() + .querySelectorAll<HTMLElement>(moreOptionsClass) + .length, + numOverflow); + }); + }); +});
diff --git a/chrome/test/data/webui/side_panel/read_anything/update_voice_pack_test.ts b/chrome/test/data/webui/side_panel/read_anything/update_voice_pack_test.ts index 3683b81..ee9f5cce 100644 --- a/chrome/test/data/webui/side_panel/read_anything/update_voice_pack_test.ts +++ b/chrome/test/data/webui/side_panel/read_anything/update_voice_pack_test.ts
@@ -89,15 +89,6 @@ assertEquals(getInstallStatus(lang), VoicePackStatus.DOWNLOADED); }); - test('downloaded if non-natural voices added for this lang', () => { - const lang = 'en'; - app.synth = new FakeSpeechSynthesis(); - - app.updateVoicePackStatus(lang, 'kInstalled'); - - assertEquals(getInstallStatus(lang), VoicePackStatus.DOWNLOADED); - }); - test('downloaded if natural voices are added for a different lang', () => { const lang = 'fr'; addNaturalVoicesForLang('it'); @@ -107,6 +98,26 @@ assertEquals(getInstallStatus(lang), VoicePackStatus.DOWNLOADED); }); + test( + 'downloaded if non-natural voices are added for a different lang', + () => { + const lang = 'de'; + app.synth = new FakeSpeechSynthesis(); + + app.updateVoicePackStatus(lang, 'kInstalled'); + + assertEquals(getInstallStatus(lang), VoicePackStatus.DOWNLOADED); + }); + + test('installed if non-natural voices added for this lang', () => { + const lang = 'en'; + app.synth = new FakeSpeechSynthesis(); + + app.updateVoicePackStatus(lang, 'kInstalled'); + + assertEquals(getInstallStatus(lang), VoicePackStatus.INSTALLED); + }); + test('installed if natural voices are added for this lang', () => { const lang = 'en'; addNaturalVoicesForLang(lang);
diff --git a/chrome/test/enterprise/e2e/policy/cbcm_enroll.py b/chrome/test/enterprise/e2e/policy/cbcm_enroll.py index 02adb21..dde0b2f 100644 --- a/chrome/test/enterprise/e2e/policy/cbcm_enroll.py +++ b/chrome/test/enterprise/e2e/policy/cbcm_enroll.py
@@ -14,7 +14,7 @@ def main(argv): options = webdriver.ChromeOptions() - os.environ["CHROME_LOG_FILE"] = r"c:\temp\chrome_log.txt" + os.environ["CHROME_LOG_FILE"] = r"C:\temp\chrome_log.txt" # Flag which tells Chrome to send events to our test endpoint. # Debugging tip: this flag only works for Dev and Canary builds. @@ -35,6 +35,13 @@ time.sleep(25) try: + # Print CHROME_LOG_FILE + print("PRINTING CHROME LOG FILE....") + with open(os.environ["CHROME_LOG_FILE"]) as file: + content = file.read() + print(content) + print("DONE PRINTING CHROME LOG FILE.") + # Verify Policy status legend in chrome://policy page policy_url = "chrome://policy" driver.get(policy_url)
diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn index ebeb898..0592ec7a 100644 --- a/chrome/utility/BUILD.gn +++ b/chrome/utility/BUILD.gn
@@ -14,6 +14,8 @@ import("//printing/buildflags/buildflags.gni") import("//services/screen_ai/buildflags/features.gni") +assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + static_library("utility") { sources = [ "chrome_content_utility_client.cc", @@ -114,7 +116,7 @@ "importer/safari_importer.mm", ] } - if (!is_mac && !is_fuchsia && !is_chromeos) { + if (!is_mac && !is_chromeos) { # NSS decryptor is not needed on ChromeOS. Additionally, it depends on # system NSS that is unavailable on MacOS/Fuchsia. sources += [
diff --git a/chrome/utility/safe_browsing/archive_analyzer.cc b/chrome/utility/safe_browsing/archive_analyzer.cc index 9cdeccfb..67928b3 100644 --- a/chrome/utility/safe_browsing/archive_analyzer.cc +++ b/chrome/utility/safe_browsing/archive_analyzer.cc
@@ -89,6 +89,9 @@ if (base::FeatureList::IsEnabled(kNestedArchives) && !is_encrypted) { nested_analyzer_ = ArchiveAnalyzer::CreateForArchiveType(GetFileType(path)); if (nested_analyzer_) { + // Archive analyzers expect to start at the beginning of the + // archive, but we may be at the end. + entry.Seek(base::File::FROM_BEGIN, 0); nested_analyzer_->Analyze( entry.Duplicate(), path, password(), base::BindOnce(&ArchiveAnalyzer::NestedAnalysisFinished, GetWeakPtr(),
diff --git a/chrome/utility/safe_browsing/rar_analyzer.cc b/chrome/utility/safe_browsing/rar_analyzer.cc index d8e1cdf..82da961d 100644 --- a/chrome/utility/safe_browsing/rar_analyzer.cc +++ b/chrome/utility/safe_browsing/rar_analyzer.cc
@@ -86,7 +86,7 @@ return; } - results()->encryption_info.is_encrypted = reader_.HeadersEncrypted(); + results()->encryption_info.is_encrypted |= reader_.HeadersEncrypted(); if (reader_.HeaderDecryptionFailed()) { results()->encryption_info.password_status = EncryptionInfo::kKnownIncorrect;
diff --git a/chrome/utility/safe_browsing/zip_analyzer.cc b/chrome/utility/safe_browsing/zip_analyzer.cc index 184db6ca..e78dc46 100644 --- a/chrome/utility/safe_browsing/zip_analyzer.cc +++ b/chrome/utility/safe_browsing/zip_analyzer.cc
@@ -98,7 +98,7 @@ } } - results()->encryption_info.is_encrypted = has_encrypted_; + results()->encryption_info.is_encrypted |= has_encrypted_; if (has_encrypted_) { base::UmaHistogramBoolean("SBClientDownload.EncryptedZipUsesAes", has_aes_encrypted_);
diff --git a/chromeos/ash/components/BUILD.gn b/chromeos/ash/components/BUILD.gn index f495149..7134726e 100644 --- a/chromeos/ash/components/BUILD.gn +++ b/chromeos/ash/components/BUILD.gn
@@ -56,6 +56,7 @@ "//chromeos/ash/components/string_matching:unit_tests", "//chromeos/ash/components/sync_wifi:unit_tests", "//chromeos/ash/components/system:unit_tests", + "//chromeos/ash/components/system_info:unit_tests", "//chromeos/ash/components/tether:unit_tests", "//chromeos/ash/components/timezone:unit_tests", "//chromeos/ash/components/tpm:unit_tests",
diff --git a/chromeos/ash/components/auth_panel/impl/DEPS b/chromeos/ash/components/auth_panel/impl/DEPS index f8fc2408..f17df0e 100644 --- a/chromeos/ash/components/auth_panel/impl/DEPS +++ b/chromeos/ash/components/auth_panel/impl/DEPS
@@ -1,19 +1,19 @@ noparent = True include_rules = [ - "+base", - "+ash/shell.h", + "+ash/ime", "+ash/login/ui", "+ash/public/cpp", - "+ash/style", - "+ash/ime", "+ash/resources/vector_icons", + "+ash/shell.h", "+ash/strings", - "+chromeos/constants", - "+ui/views", - "+ui/base", - "+ui/gfx", - "+ui/color", - "+chromeos/ash/components/osauth/public", + "+ash/style", + "+base", "+chromeos/ash/components/auth_panel/public", + "+chromeos/ash/components/osauth/public", + "+chromeos/constants", + "+ui/base", + "+ui/color", + "+ui/gfx", + "+ui/views", ]
diff --git a/chromeos/ash/components/growth/campaigns_manager_unittest.cc b/chromeos/ash/components/growth/campaigns_manager_unittest.cc index e9413d2..213f876 100644 --- a/chromeos/ash/components/growth/campaigns_manager_unittest.cc +++ b/chromeos/ash/components/growth/campaigns_manager_unittest.cc
@@ -36,7 +36,7 @@ inline constexpr char kValidCampaignsFileTemplate[] = R"( { "0": [ - // Invalid targeting. + // List is an invalid targeting. { "id": 1, "targetings": [ @@ -44,6 +44,7 @@ ], "payload": {} }, + // String is an invalid campaign. "Invalid campaign", { "id": 3, @@ -66,6 +67,36 @@ } )"; +inline constexpr char kValidCampaignsFileMultiTargetingsTemplate[] = R"( + { + "0": [ + // List is an invalid targeting. + { + "id": 1, + "targetings": [ + [] + ], + "payload": {} + }, + // String is an invalid campaign. + "Invalid campaign", + { + "id": 3, + "studyId":1, + "targetings": %s, + "payload": { + "demoModeApp": { + "attractionLoop": { + "videoSrcLang1": "/asset/peripherals_lang1.mp4", + "videoSrcLang2": "/asset/peripherals_lang2.mp4" + } + } + } + } + ] + } +)"; + inline constexpr char kValidDemoModeTargeting[] = R"( "demoMode": { "retailers": ["bby", "bestbuy", "bbt"], @@ -78,6 +109,27 @@ } )"; +inline constexpr char kValidMultiTargetings[] = R"([ + // Targeting 1. + { + "runtime": { + "appsOpened": [{"appId": "app_id_1"}] + } + }, + // Targeting 2. + { + "runtime": { + "appsOpened": [{"appId": "app_id_2"}] + } + }, + // Targeting 3. + { + "runtime": { + "appsOpened": [{"appId": "app_id_3"}] + } + } + ])"; + inline constexpr char kCampaignsFileName[] = "campaigns.json"; inline constexpr char kCampaignsExperimentTag[] = "exp_tag"; @@ -290,6 +342,11 @@ kValidCampaignsFileTemplate, session_targeting.c_str())); } + void LoadComponentWithMultiTargetings(const std::string& targetings) { + LoadComponentAndVerifyLoadComplete(base::StringPrintf( + kValidCampaignsFileMultiTargetingsTemplate, targetings.c_str())); + } + void LoadComponentWithActiveUrlTargeting(const std::string& active_url) { auto session_targeting = base::StringPrintf(R"( "runtime": { @@ -1331,4 +1388,27 @@ ASSERT_EQ(nullptr, campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); } +TEST_F(CampaignsManagerTest, GetCampaignMatchFirstTargeting) { + campaigns_manager_->SetOpenedApp("app_id_1"); + + LoadComponentWithMultiTargetings(kValidMultiTargetings); + VerifyDemoModePayload( + campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); +} + +TEST_F(CampaignsManagerTest, GetCampaignMatchSecondTargeting) { + campaigns_manager_->SetOpenedApp("app_id_2"); + + LoadComponentWithMultiTargetings(kValidMultiTargetings); + VerifyDemoModePayload( + campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); +} + +TEST_F(CampaignsManagerTest, GetCampaignMatchMultiTargetingsMismatch) { + campaigns_manager_->SetOpenedApp("app_id_20"); + + LoadComponentWithMultiTargetings(kValidMultiTargetings); + ASSERT_EQ(nullptr, campaigns_manager_->GetCampaignBySlot(Slot::kDemoModeApp)); +} + } // namespace growth
diff --git a/chromeos/ash/components/growth/campaigns_matcher.cc b/chromeos/ash/components/growth/campaigns_matcher.cc index 1333a28f..10b1ac50 100644 --- a/chromeos/ash/components/growth/campaigns_matcher.cc +++ b/chromeos/ash/components/growth/campaigns_matcher.cc
@@ -503,15 +503,8 @@ MatchEvents(targeting.GetEventsConfig(), campaign_id); } -bool CampaignsMatcher::Matched(const Targetings* targetings, +bool CampaignsMatcher::Matched(const Targeting* targeting, int campaign_id) const { - if (!targetings || targetings->empty()) { - return true; - } - - // TODO(b/299334282): Implement AND targeting operator when the list contains - // more than one targeting. - const auto* targeting = targetings->front().GetIfDict(); if (!targeting) { // Targeting is invalid. Skip the current campaign. LOG(ERROR) << "Invalid targeting."; @@ -525,4 +518,19 @@ MatchRuntimeTargeting(RuntimeTargeting(targeting), campaign_id); } +bool CampaignsMatcher::Matched(const Targetings* targetings, + int campaign_id) const { + if (!targetings || targetings->empty()) { + return true; + } + + for (const auto& targeting : *targetings) { + if (Matched(targeting.GetIfDict(), campaign_id)) { + return true; + } + } + + return false; +} + } // namespace growth
diff --git a/chromeos/ash/components/growth/campaigns_matcher.h b/chromeos/ash/components/growth/campaigns_matcher.h index 1fb9785..bd6ce57 100644 --- a/chromeos/ash/components/growth/campaigns_matcher.h +++ b/chromeos/ash/components/growth/campaigns_matcher.h
@@ -58,6 +58,7 @@ bool MatchEvents(std::unique_ptr<EventsTargeting> config, int campaign_id) const; bool MatchMinorUser(std::optional<bool> minor_user_targeting) const; + bool Matched(const Targeting* targeting, int campaign_id) const; bool Matched(const Targetings* targetings, int campaign_id) const; // Owned by CampaignsManager.
diff --git a/chromeos/ash/components/launcher_search/BUILD.gn b/chromeos/ash/components/launcher_search/BUILD.gn new file mode 100644 index 0000000..a033f91f --- /dev/null +++ b/chromeos/ash/components/launcher_search/BUILD.gn
@@ -0,0 +1,28 @@ +# Copyright 2024 The Chromium Authors +# Use of this source code is governed by a BSD - style license that can be +# found in the LICENSE file. + +import("//build/config/chromeos/ui_mode.gni") + +assert(is_chromeos_ash, "Non-ChromeOS builds cannot depend on //ash") + +component("launcher_search") { + sources = [ + "system_info/launcher_util.cc", + "system_info/launcher_util.h", + "system_info/system_info_keyword_input.cc", + "system_info/system_info_keyword_input.h", + ] + + defines = [ "IS_CHROMEOS_ASH_COMPONENTS_LAUNCHER_SEARCH_IMPL" ] + + deps = [ + "//ash/public/cpp:cpp", + "//ash/strings:strings", + "//base", + "//chromeos/ash/components/system_info", + "//chromeos/ash/services/cros_healthd/public/mojom:mojom", + "//chromeos/dbus/power:power_manager_proto", + "//ui/base", + ] +}
diff --git a/chromeos/ash/components/launcher_search/DEPS b/chromeos/ash/components/launcher_search/DEPS new file mode 100644 index 0000000..9f4e0b78 --- /dev/null +++ b/chromeos/ash/components/launcher_search/DEPS
@@ -0,0 +1,9 @@ +include_rules = [ + "+ash/public/cpp/power_utils.h", + "+ash/strings/grit/ash_strings.h", + "+chromeos/dbus/power_manager/power_supply_properties.pb.h", + "+chromeos/ash/components/system_info", + "+chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h", + "+ui/base/l10n/time_format.h", + "+ui/base/l10n/l10n_util.h", +]
diff --git a/chromeos/ash/components/launcher_search/OWNERS b/chromeos/ash/components/launcher_search/OWNERS new file mode 100644 index 0000000..84793b5 --- /dev/null +++ b/chromeos/ash/components/launcher_search/OWNERS
@@ -0,0 +1,4 @@ +laurencom@chromium.org +chenjih@google.com +dgrebenyuk@google.com +ypitsishin@chromium.org
diff --git a/chromeos/ash/components/launcher_search/system_info/launcher_util.cc b/chromeos/ash/components/launcher_search/system_info/launcher_util.cc new file mode 100644 index 0000000..c12e6c3 --- /dev/null +++ b/chromeos/ash/components/launcher_search/system_info/launcher_util.cc
@@ -0,0 +1,103 @@ +// 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 "chromeos/ash/components/launcher_search/system_info/launcher_util.h" + +#include <string> +#include <string_view> +#include <vector> + +#include "ash/public/cpp/power_utils.h" +#include "ash/strings/grit/ash_strings.h" +#include "base/metrics/histogram_functions.h" +#include "chromeos/ash/components/system_info/cpu_usage_data.h" +#include "chromeos/ash/components/system_info/system_info_util.h" +#include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" +#include "chromeos/dbus/power_manager/power_supply_properties.pb.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/base/l10n/time_format.h" + +namespace launcher_search { + +void PopulatePowerStatus(const power_manager::PowerSupplyProperties& proto, + system_info::BatteryHealth& battery_health) { + bool charging = proto.battery_state() == + power_manager::PowerSupplyProperties_BatteryState_CHARGING; + bool calculating = proto.is_calculating_battery_time(); + int percent = + ash::power_utils::GetRoundedBatteryPercent(proto.battery_percent()); + DCHECK(percent <= 100 && percent >= 0); + base::TimeDelta time_left; + bool show_time = false; + + if (!calculating) { + time_left = base::Seconds(charging ? proto.battery_time_to_full_sec() + : proto.battery_time_to_empty_sec()); + show_time = ash::power_utils::ShouldDisplayBatteryTime(time_left); + } + + std::u16string status_text; + std::u16string accessibility_string; + if (show_time) { + status_text = l10n_util::GetStringFUTF16( + charging ? IDS_ASH_BATTERY_STATUS_CHARGING_IN_LAUNCHER_DESCRIPTION_LEFT + : IDS_ASH_BATTERY_STATUS_IN_LAUNCHER_DESCRIPTION_LEFT, + base::NumberToString16(percent), + system_info::GetBatteryTimeText(time_left)); + accessibility_string = l10n_util::GetStringFUTF16( + charging + ? IDS_ASH_BATTERY_STATUS_CHARGING_IN_LAUNCHER_ACCESSIBILITY_LABEL + : IDS_ASH_BATTERY_STATUS_IN_LAUNCHER_ACCESSIBILITY_LABEL, + base::NumberToString16(percent), + system_info::GetBatteryTimeText(time_left)); + } else { + status_text = l10n_util::GetStringFUTF16( + IDS_ASH_BATTERY_STATUS_IN_LAUNCHER_DESCRIPTION_LEFT_SHORT, + base::NumberToString16(percent)); + accessibility_string = l10n_util::GetStringFUTF16( + IDS_ASH_BATTERY_STATUS_IN_LAUNCHER_ACCESSIBILITY_LABEL_SHORT, + base::NumberToString16(percent)); + } + + battery_health.SetPowerTime(status_text); + battery_health.SetAccessibilityLabel(accessibility_string); + battery_health.SetBatteryPercentage(percent); +} + +std::vector<SystemInfoKeywordInput> GetSystemInfoKeywordVector() { + return { + SystemInfoKeywordInput( + SystemInfoInputType::kVersion, + l10n_util::GetStringUTF16(IDS_ASH_VERSION_KEYWORD_FOR_LAUNCHER)), + SystemInfoKeywordInput( + SystemInfoInputType::kVersion, + l10n_util::GetStringUTF16(IDS_ASH_DEVICE_KEYWORD_FOR_LAUNCHER)), + SystemInfoKeywordInput( + SystemInfoInputType::kVersion, + l10n_util::GetStringUTF16(IDS_ASH_ABOUT_KEYWORD_FOR_LAUNCHER)), + SystemInfoKeywordInput( + SystemInfoInputType::kBattery, + l10n_util::GetStringUTF16(IDS_ASH_BATTERY_KEYWORD_FOR_LAUNCHER)), + SystemInfoKeywordInput( + SystemInfoInputType::kMemory, + l10n_util::GetStringUTF16(IDS_ASH_MEMORY_KEYWORD_FOR_LAUNCHER)), + SystemInfoKeywordInput( + SystemInfoInputType::kMemory, + l10n_util::GetStringUTF16(IDS_ASH_RAM_KEYWORD_FOR_LAUNCHER)), + SystemInfoKeywordInput( + SystemInfoInputType::kCPU, + l10n_util::GetStringUTF16( + IDS_ASH_ACTIVITY_MONITOR_KEYWORD_FOR_LAUNCHER)), + SystemInfoKeywordInput( + SystemInfoInputType::kStorage, + l10n_util::GetStringUTF16(IDS_ASH_STORAGE_KEYWORD_FOR_LAUNCHER)), + SystemInfoKeywordInput( + SystemInfoInputType::kCPU, + l10n_util::GetStringUTF16(IDS_ASH_CPU_KEYWORD_FOR_LAUNCHER)), + SystemInfoKeywordInput( + SystemInfoInputType::kCPU, + l10n_util::GetStringUTF16(IDS_ASH_DEVICE_SLOW_KEYWORD_FOR_LAUNCHER))}; +} + +} // namespace launcher_search
diff --git a/chromeos/ash/components/launcher_search/system_info/launcher_util.h b/chromeos/ash/components/launcher_search/system_info/launcher_util.h new file mode 100644 index 0000000..1a42ea7 --- /dev/null +++ b/chromeos/ash/components/launcher_search/system_info/launcher_util.h
@@ -0,0 +1,32 @@ +// 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 CHROMEOS_ASH_COMPONENTS_LAUNCHER_SEARCH_SYSTEM_INFO_LAUNCHER_UTIL_H_ +#define CHROMEOS_ASH_COMPONENTS_LAUNCHER_SEARCH_SYSTEM_INFO_LAUNCHER_UTIL_H_ + +#include <string> +#include <vector> + +#include "base/component_export.h" +#include "base/time/time.h" +#include "chromeos/ash/components/launcher_search/system_info/system_info_keyword_input.h" +#include "chromeos/ash/components/system_info/battery_health.h" +#include "chromeos/ash/components/system_info/cpu_data.h" +#include "chromeos/ash/components/system_info/cpu_usage_data.h" +#include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" +#include "chromeos/dbus/power_manager/power_supply_properties.pb.h" + +namespace launcher_search { + +void COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_LAUNCHER_SEARCH) + PopulatePowerStatus( + const power_manager::PowerSupplyProperties& power_supply_properties, + system_info::BatteryHealth& battery_health); + +std::vector<SystemInfoKeywordInput> COMPONENT_EXPORT( + CHROMEOS_ASH_COMPONENTS_LAUNCHER_SEARCH) GetSystemInfoKeywordVector(); + +} // namespace launcher_search + +#endif // CHROMEOS_ASH_COMPONENTS_LAUNCHER_SEARCH_SYSTEM_INFO_LAUNCHER_UTIL_H_
diff --git a/chrome/browser/ash/app_list/search/system_info/system_info_keyword_input.cc b/chromeos/ash/components/launcher_search/system_info/system_info_keyword_input.cc similarity index 76% rename from chrome/browser/ash/app_list/search/system_info/system_info_keyword_input.cc rename to chromeos/ash/components/launcher_search/system_info/system_info_keyword_input.cc index faf7c844..4a8e0210 100644 --- a/chrome/browser/ash/app_list/search/system_info/system_info_keyword_input.cc +++ b/chromeos/ash/components/launcher_search/system_info/system_info_keyword_input.cc
@@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ash/app_list/search/system_info/system_info_keyword_input.h" +#include "chromeos/ash/components/launcher_search/system_info/system_info_keyword_input.h" -namespace app_list { +namespace launcher_search { SystemInfoKeywordInput::SystemInfoKeywordInput(SystemInfoInputType input_type, std::u16string keyword) @@ -17,4 +17,4 @@ return keyword_; } -} // namespace app_list +} // namespace launcher_search
diff --git a/chromeos/ash/components/launcher_search/system_info/system_info_keyword_input.h b/chromeos/ash/components/launcher_search/system_info/system_info_keyword_input.h new file mode 100644 index 0000000..bf76b47 --- /dev/null +++ b/chromeos/ash/components/launcher_search/system_info/system_info_keyword_input.h
@@ -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. + +#ifndef CHROMEOS_ASH_COMPONENTS_LAUNCHER_SEARCH_SYSTEM_INFO_SYSTEM_INFO_KEYWORD_INPUT_H_ +#define CHROMEOS_ASH_COMPONENTS_LAUNCHER_SEARCH_SYSTEM_INFO_SYSTEM_INFO_KEYWORD_INPUT_H_ + +#include <string> + +#include "base/component_export.h" + +namespace launcher_search { + +// This enum represents which type of System Info will be displayed. +enum class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_LAUNCHER_SEARCH) + SystemInfoInputType { + kCPU, + kVersion, + kMemory, + kBattery, + kStorage + }; + +struct COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_LAUNCHER_SEARCH) + SystemInfoKeywordInput { + SystemInfoKeywordInput() = default; + SystemInfoKeywordInput(SystemInfoInputType input_type, + std::u16string keyword); + + ~SystemInfoKeywordInput() = default; + + SystemInfoInputType GetInputType(); + std::u16string GetKeyword(); + + private: + SystemInfoInputType input_type_; + std::u16string keyword_; +}; + +} // namespace launcher_search + +#endif // CHROMEOS_ASH_COMPONENTS_LAUNCHER_SEARCH_SYSTEM_INFO_SYSTEM_INFO_KEYWORD_INPUT_H_
diff --git a/chromeos/ash/components/network/portal_detector/mock_network_portal_detector.h b/chromeos/ash/components/network/portal_detector/mock_network_portal_detector.h index b86b848..ebe0b98 100644 --- a/chromeos/ash/components/network/portal_detector/mock_network_portal_detector.h +++ b/chromeos/ash/components/network/portal_detector/mock_network_portal_detector.h
@@ -20,8 +20,6 @@ ~MockNetworkPortalDetector() override; - MOCK_METHOD0(GetCaptivePortalStatus, - NetworkPortalDetector::CaptivePortalStatus()); MOCK_METHOD0(IsEnabled, bool()); MOCK_METHOD0(Enable, void()); MOCK_METHOD0(RequestCaptivePortalDetection, void());
diff --git a/chromeos/ash/components/network/portal_detector/network_portal_detector.cc b/chromeos/ash/components/network/portal_detector/network_portal_detector.cc index 8a875de2..1b31aad1 100644 --- a/chromeos/ash/components/network/portal_detector/network_portal_detector.cc +++ b/chromeos/ash/components/network/portal_detector/network_portal_detector.cc
@@ -5,7 +5,6 @@ #include "chromeos/ash/components/network/portal_detector/network_portal_detector.h" #include "base/logging.h" -#include "base/notreached.h" #include "components/device_event_log/device_event_log.h" namespace ash { @@ -15,36 +14,8 @@ bool set_for_testing_ = false; NetworkPortalDetector* network_portal_detector_ = nullptr; -const char kCaptivePortalStatusUnknown[] = "Unknown"; -const char kCaptivePortalStatusOffline[] = "Offline"; -const char kCaptivePortalStatusOnline[] = "Online"; -const char kCaptivePortalStatusPortal[] = "Portal"; -const char kCaptivePortalStatusProxyAuthRequired[] = "ProxyAuthRequired"; -const char kCaptivePortalStatusUnrecognized[] = "Unrecognized"; - } // namespace -// static -std::string NetworkPortalDetector::CaptivePortalStatusString( - CaptivePortalStatus status) { - switch (status) { - case CAPTIVE_PORTAL_STATUS_UNKNOWN: - return kCaptivePortalStatusUnknown; - case CAPTIVE_PORTAL_STATUS_OFFLINE: - return kCaptivePortalStatusOffline; - case CAPTIVE_PORTAL_STATUS_ONLINE: - return kCaptivePortalStatusOnline; - case CAPTIVE_PORTAL_STATUS_PORTAL: - return kCaptivePortalStatusPortal; - case CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED: - return kCaptivePortalStatusProxyAuthRequired; - case CAPTIVE_PORTAL_STATUS_COUNT: - break; - } - NOTREACHED(); - return kCaptivePortalStatusUnrecognized; -} - namespace network_portal_detector { void InitializeForTesting(NetworkPortalDetector* network_portal_detector) {
diff --git a/chromeos/ash/components/network/portal_detector/network_portal_detector.h b/chromeos/ash/components/network/portal_detector/network_portal_detector.h index eed26c7d..724a192d 100644 --- a/chromeos/ash/components/network/portal_detector/network_portal_detector.h +++ b/chromeos/ash/components/network/portal_detector/network_portal_detector.h
@@ -5,10 +5,7 @@ #ifndef CHROMEOS_ASH_COMPONENTS_NETWORK_PORTAL_DETECTOR_NETWORK_PORTAL_DETECTOR_H_ #define CHROMEOS_ASH_COMPONENTS_NETWORK_PORTAL_DETECTOR_NETWORK_PORTAL_DETECTOR_H_ -#include <string> - #include "base/component_export.h" -#include "base/notreached.h" namespace ash { @@ -16,24 +13,11 @@ // See network_portal_detector_impl.h for details. class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkPortalDetector { public: - enum CaptivePortalStatus { - CAPTIVE_PORTAL_STATUS_UNKNOWN = 0, - CAPTIVE_PORTAL_STATUS_OFFLINE = 1, - CAPTIVE_PORTAL_STATUS_ONLINE = 2, - CAPTIVE_PORTAL_STATUS_PORTAL = 3, - CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED = 4, - CAPTIVE_PORTAL_STATUS_COUNT, - kMaxValue = CAPTIVE_PORTAL_STATUS_COUNT // For UMA_HISTOGRAM_ENUMERATION - }; - NetworkPortalDetector(const NetworkPortalDetector&) = delete; NetworkPortalDetector& operator=(const NetworkPortalDetector&) = delete; virtual ~NetworkPortalDetector() {} - // Returns CaptivePortalStatus for the the default network or UNKNOWN. - virtual CaptivePortalStatus GetCaptivePortalStatus() = 0; - // Returns true if portal detection is enabled. virtual bool IsEnabled() = 0; @@ -44,9 +28,6 @@ // Request captive portal detection after a navigation event or proy signin. virtual void RequestCaptivePortalDetection() = 0; - // Returns non-localized string representation of |status|. - static std::string CaptivePortalStatusString(CaptivePortalStatus status); - protected: NetworkPortalDetector() {} };
diff --git a/chromeos/ash/components/network/portal_detector/network_portal_detector_stub.cc b/chromeos/ash/components/network/portal_detector/network_portal_detector_stub.cc index 2385470..673a24f 100644 --- a/chromeos/ash/components/network/portal_detector/network_portal_detector_stub.cc +++ b/chromeos/ash/components/network/portal_detector/network_portal_detector_stub.cc
@@ -10,11 +10,6 @@ NetworkPortalDetectorStub::~NetworkPortalDetectorStub() = default; -NetworkPortalDetector::CaptivePortalStatus -NetworkPortalDetectorStub::GetCaptivePortalStatus() { - return CAPTIVE_PORTAL_STATUS_UNKNOWN; -} - bool NetworkPortalDetectorStub::IsEnabled() { return false; }
diff --git a/chromeos/ash/components/network/portal_detector/network_portal_detector_stub.h b/chromeos/ash/components/network/portal_detector/network_portal_detector_stub.h index a77a960f..dd2de0dc 100644 --- a/chromeos/ash/components/network/portal_detector/network_portal_detector_stub.h +++ b/chromeos/ash/components/network/portal_detector/network_portal_detector_stub.h
@@ -22,7 +22,6 @@ private: // NetworkPortalDetector: - CaptivePortalStatus GetCaptivePortalStatus() override; bool IsEnabled() override; void Enable() override; void RequestCaptivePortalDetection() override;
diff --git a/chromeos/ash/components/system_info/BUILD.gn b/chromeos/ash/components/system_info/BUILD.gn new file mode 100644 index 0000000..f84117a --- /dev/null +++ b/chromeos/ash/components/system_info/BUILD.gn
@@ -0,0 +1,41 @@ +# Copyright 2024 The Chromium Authors +# Use of this source code is governed by a BSD - style license that can be +# found in the LICENSE file. + +import("//build/config/chromeos/ui_mode.gni") + +assert(is_chromeos_ash, "Non-ChromeOS builds cannot depend on //ash") + +component("system_info") { + sources = [ + "battery_health.h", + "cpu_data.h", + "cpu_usage_data.cc", + "cpu_usage_data.h", + "system_info_util.cc", + "system_info_util.h", + ] + + defines = [ "IS_CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_IMPL" ] + + deps = [ + "//ash/public/cpp:cpp", + "//ash/strings:strings", + "//base", + "//chromeos/ash/services/cros_healthd/public/mojom:mojom", + "//chromeos/dbus/power:power_manager_proto", + "//ui/base", + ] +} + +source_set("unit_tests") { + testonly = true + + sources = [ "cpu_usage_data_unittest.cc" ] + + deps = [ + ":system_info", + "//base/test:test_support", + "//testing/gtest", + ] +}
diff --git a/chromeos/ash/components/system_info/DEPS b/chromeos/ash/components/system_info/DEPS new file mode 100644 index 0000000..949cda9 --- /dev/null +++ b/chromeos/ash/components/system_info/DEPS
@@ -0,0 +1,8 @@ +include_rules = [ + "+ash/public/cpp/power_utils.h", + "+ash/strings/grit/ash_strings.h", + "+chromeos/dbus/power_manager/power_supply_properties.pb.h", + "+chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h", + "+ui/base/l10n/time_format.h", + "+ui/base/l10n/l10n_util.h", +]
diff --git a/chromeos/ash/components/system_info/OWNERS b/chromeos/ash/components/system_info/OWNERS new file mode 100644 index 0000000..b2c940c --- /dev/null +++ b/chromeos/ash/components/system_info/OWNERS
@@ -0,0 +1,2 @@ +laurencom@chromium.org +chenjih@google.com
diff --git a/chrome/browser/ash/app_list/search/system_info/battery_health.h b/chromeos/ash/components/system_info/battery_health.h similarity index 78% rename from chrome/browser/ash/app_list/search/system_info/battery_health.h rename to chromeos/ash/components/system_info/battery_health.h index bba5553..10250f0 100644 --- a/chrome/browser/ash/app_list/search/system_info/battery_health.h +++ b/chromeos/ash/components/system_info/battery_health.h
@@ -2,14 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_BATTERY_HEALTH_H_ -#define CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_BATTERY_HEALTH_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_BATTERY_HEALTH_H_ +#define CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_BATTERY_HEALTH_H_ #include <string> -namespace app_list { +#include "base/component_export.h" -class BatteryHealth { +namespace system_info { + +class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) BatteryHealth { public: BatteryHealth() = default; @@ -25,7 +27,6 @@ void SetAccessibilityLabel(const std::u16string& accessibility_label) { accessibility_label_ = accessibility_label; } - void SetBatteryPercentage(int battery_percentage) { battery_percentage_ = battery_percentage; } @@ -44,6 +45,6 @@ int battery_percentage_ = 0; }; -} // namespace app_list +} // namespace system_info -#endif // CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_BATTERY_HEALTH_H_ +#endif // CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_BATTERY_HEALTH_H_
diff --git a/chrome/browser/ash/app_list/search/system_info/cpu_data.h b/chromeos/ash/components/system_info/cpu_data.h similarity index 83% rename from chrome/browser/ash/app_list/search/system_info/cpu_data.h rename to chromeos/ash/components/system_info/cpu_data.h index 59f640d9..dc35153 100644 --- a/chrome/browser/ash/app_list/search/system_info/cpu_data.h +++ b/chromeos/ash/components/system_info/cpu_data.h
@@ -2,18 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_CPU_DATA_H_ -#define CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_CPU_DATA_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_CPU_DATA_H_ +#define CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_CPU_DATA_H_ #include <string> +#include "base/component_export.h" #include "base/strings/string_number_conversions.h" -namespace app_list { +namespace system_info { /* This class is used to store the final CPU usage and health data for the System Info Provider. */ -class CpuData { +class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) CpuData { public: CpuData() = default; @@ -54,6 +55,6 @@ int scaling_current_frequency_khz_ = 0; }; -} // namespace app_list +} // namespace system_info -#endif // CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_CPU_DATA_H_ +#endif // CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_CPU_DATA_H_
diff --git a/chrome/browser/ash/app_list/search/system_info/cpu_usage_data.cc b/chromeos/ash/components/system_info/cpu_usage_data.cc similarity index 92% rename from chrome/browser/ash/app_list/search/system_info/cpu_usage_data.cc rename to chromeos/ash/components/system_info/cpu_usage_data.cc index 30b1520b..e086f25c 100644 --- a/chrome/browser/ash/app_list/search/system_info/cpu_usage_data.cc +++ b/chromeos/ash/components/system_info/cpu_usage_data.cc
@@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ash/app_list/search/system_info/cpu_usage_data.h" +#include "chromeos/ash/components/system_info/cpu_usage_data.h" -namespace app_list { +namespace system_info { CpuUsageData::CpuUsageData(uint64_t user_time, uint64_t system_time, @@ -47,4 +47,4 @@ return *this; } -} // namespace app_list +} // namespace system_info
diff --git a/chrome/browser/ash/app_list/search/system_info/cpu_usage_data.h b/chromeos/ash/components/system_info/cpu_usage_data.h similarity index 78% rename from chrome/browser/ash/app_list/search/system_info/cpu_usage_data.h rename to chromeos/ash/components/system_info/cpu_usage_data.h index 7fcd6b31..29fa9679 100644 --- a/chrome/browser/ash/app_list/search/system_info/cpu_usage_data.h +++ b/chromeos/ash/components/system_info/cpu_usage_data.h
@@ -2,18 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_CPU_USAGE_DATA_H_ -#define CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_CPU_USAGE_DATA_H_ +#ifndef CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_CPU_USAGE_DATA_H_ +#define CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_CPU_USAGE_DATA_H_ #include <cstdint> #include <limits> -namespace app_list { +#include "base/component_export.h" + +namespace system_info { /* This class is used to store and calculate the system and user usage. The delta between the current previous values is used to calculate the final cpu usage values which are stored in CPU data.*/ -class CpuUsageData { +class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) CpuUsageData { public: CpuUsageData() = default; CpuUsageData(uint64_t user_time, uint64_t system_time, uint64_t idle_time); @@ -44,6 +46,6 @@ uint64_t idle_time_ = std::numeric_limits<uint64_t>::max(); }; -} // namespace app_list +} // namespace system_info -#endif // CHROME_BROWSER_ASH_APP_LIST_SEARCH_SYSTEM_INFO_CPU_USAGE_DATA_H_ +#endif // CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_CPU_USAGE_DATA_H_
diff --git a/chrome/browser/ash/app_list/search/system_info/cpu_usage_data_unittest.cc b/chromeos/ash/components/system_info/cpu_usage_data_unittest.cc similarity index 92% rename from chrome/browser/ash/app_list/search/system_info/cpu_usage_data_unittest.cc rename to chromeos/ash/components/system_info/cpu_usage_data_unittest.cc index 97309a4..e6c38621 100644 --- a/chrome/browser/ash/app_list/search/system_info/cpu_usage_data_unittest.cc +++ b/chromeos/ash/components/system_info/cpu_usage_data_unittest.cc
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ash/app_list/search/system_info/cpu_usage_data.h" +#include "chromeos/ash/components/system_info/cpu_usage_data.h" #include "testing/gtest/include/gtest/gtest.h" -namespace app_list { +namespace system_info { class CpuUsageDataTest : public testing::Test { public: @@ -74,4 +74,4 @@ EXPECT_EQ(3u, data_2.GetIdleTime()); } -} // namespace app_list +} // namespace system_info
diff --git a/chromeos/ash/components/system_info/system_info_util.cc b/chromeos/ash/components/system_info/system_info_util.cc new file mode 100644 index 0000000..fbb7726 --- /dev/null +++ b/chromeos/ash/components/system_info/system_info_util.cc
@@ -0,0 +1,230 @@ +// 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 "chromeos/ash/components/system_info/system_info_util.h" + +#include <optional> +#include <string> +#include <string_view> +#include <vector> + +#include "ash/public/cpp/power_utils.h" +#include "ash/strings/grit/ash_strings.h" +#include "base/metrics/histogram_functions.h" +#include "base/time/time.h" +#include "chromeos/ash/components/system_info/cpu_usage_data.h" +#include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" +#include "chromeos/dbus/power_manager/power_supply_properties.pb.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/base/l10n/time_format.h" + +namespace system_info { +namespace { + +namespace healthd = ash::cros_healthd::mojom; + +constexpr int kMilliampsInAnAmp = 1000; + +void EmitCrosHealthdProbeError(const std::string_view source_type, + healthd::ErrorType error_type, + const std::string& metric_name_for_histogram) { + // `metric_name` may be empty in which case we do not want a metric send + // attempted. + if (metric_name_for_histogram.empty()) { + LOG(WARNING) + << "Ignoring request to record metric for ProbeError of error_type: " + << error_type << " for unknown source_stuct: " << source_type; + return; + } + + base::UmaHistogramEnumeration(metric_name_for_histogram, error_type); +} + +template <typename TResult, typename TTag> + +bool CheckResponse(const TResult& result, + TTag expected_tag, + std::string_view type_name, + const std::string& metric_name_for_histogram) { + if (result.is_null()) { + LOG(ERROR) << type_name << "not found in croshealthd response."; + return false; + } + + auto tag = result->which(); + if (tag == TTag::kError) { + EmitCrosHealthdProbeError(type_name, result->get_error()->type, + metric_name_for_histogram); + LOG(ERROR) << "Error retrieving " << type_name + << "from croshealthd: " << result->get_error()->msg; + return false; + } + + DCHECK_EQ(tag, expected_tag); + + return true; +} + +} // namespace + +void EmitBatteryDataError(BatteryDataError error, + const std::string& histogram_prefix) { + if (!histogram_prefix.empty()) { + base::UmaHistogramEnumeration(histogram_prefix, error); + } +} + +healthd::MemoryInfo* GetMemoryInfo( + const healthd::TelemetryInfo& info, + const std::string& metric_name_for_histogram) { + const healthd::MemoryResultPtr& memory_result = info.memory_result; + if (!CheckResponse(memory_result, healthd::MemoryResult::Tag::kMemoryInfo, + "memory info", metric_name_for_histogram)) { + return nullptr; + } + + return memory_result->get_memory_info().get(); +} + +healthd::CpuInfo* GetCpuInfo(const healthd::TelemetryInfo& info, + const std::string& metric_name_for_histogram) { + const healthd::CpuResultPtr& cpu_result = info.cpu_result; + if (!CheckResponse(cpu_result, healthd::CpuResult::Tag::kCpuInfo, "cpu info", + metric_name_for_histogram)) { + return nullptr; + } + + return cpu_result->get_cpu_info().get(); +} + +const healthd::BatteryInfo* GetBatteryInfo( + const healthd::TelemetryInfo& info, + const std::string& metric_name_for_histogram, + const std::string& battery_error_histogram) { + const healthd::BatteryResultPtr& battery_result = info.battery_result; + if (!CheckResponse(battery_result, healthd::BatteryResult::Tag::kBatteryInfo, + "battery info", metric_name_for_histogram)) { + return nullptr; + } + + const healthd::BatteryInfo* battery_info = + battery_result->get_battery_info().get(); + if (battery_info->charge_full == 0) { + LOG(ERROR) << "charge_full from battery_info should not be zero."; + EmitBatteryDataError(BatteryDataError::kExpectationNotMet, + battery_error_histogram); + return nullptr; + } + + // Handle values in battery_info which could cause a SIGFPE. See b/227485637. + if (isnan(battery_info->charge_full) || + isnan(battery_info->charge_full_design) || + battery_info->charge_full_design == 0) { + LOG(ERROR) << "battery_info values could cause SIGFPE crash: { " + << "charge_full_design: " << battery_info->charge_full_design + << ", charge_full: " << battery_info->charge_full << " }"; + return nullptr; + } + + return battery_info; +} + +CpuUsageData CalculateCpuUsage( + const std::vector<healthd::LogicalCpuInfoPtr>& logical_cpu_infos) { + CpuUsageData new_usage_data; + + DCHECK_GE(logical_cpu_infos.size(), 1u); + for (const auto& logical_cpu_ptr : logical_cpu_infos) { + new_usage_data += CpuUsageData(logical_cpu_ptr->user_time_user_hz, + logical_cpu_ptr->system_time_user_hz, + logical_cpu_ptr->idle_time_user_hz); + } + + return new_usage_data; +} + +void PopulateCpuUsage(CpuUsageData new_cpu_usage_data, + CpuUsageData previous_cpu_usage_data, + CpuData& cpu_usage) { + CpuUsageData delta = new_cpu_usage_data - previous_cpu_usage_data; + + const uint64_t total_delta = delta.GetTotalTime(); + if (total_delta == 0) { + LOG(ERROR) << "Device reported having zero logical CPUs."; + return; + } + cpu_usage.SetPercentUsageUser(100 * delta.GetUserTime() / total_delta); + cpu_usage.SetPercentUsageSystem(100 * delta.GetSystemTime() / total_delta); + cpu_usage.SetPercentUsageFree(100 * delta.GetIdleTime() / total_delta); +} + +void PopulateAverageCpuTemperature( + const ash::cros_healthd::mojom::CpuInfo& cpu_info, + CpuData& cpu_usage) { + if (cpu_info.temperature_channels.empty()) { + LOG(ERROR) << "Device reported having 0 temperature channels."; + return; + } + + uint32_t cumulative_total = 0; + for (const auto& temp_channel_ptr : cpu_info.temperature_channels) { + cumulative_total += temp_channel_ptr->temperature_celsius; + } + + // Integer division. + cpu_usage.SetAverageCpuTempCelsius(cumulative_total / + cpu_info.temperature_channels.size()); +} + +void PopulateAverageScaledClockSpeed(const healthd::CpuInfo& cpu_info, + CpuData& cpu_usage) { + if (cpu_info.physical_cpus.empty() || + cpu_info.physical_cpus[0]->logical_cpus.empty()) { + LOG(ERROR) << "Device reported having 0 logical CPUs."; + return; + } + + uint32_t total_scaled_ghz = 0; + for (const auto& logical_cpu_ptr : cpu_info.physical_cpus[0]->logical_cpus) { + total_scaled_ghz += logical_cpu_ptr->scaling_current_frequency_khz; + } + + // Integer division. + cpu_usage.SetScalingAverageCurrentFrequencyKhz( + total_scaled_ghz / cpu_info.physical_cpus[0]->logical_cpus.size()); +} + +void PopulateBatteryHealth(const healthd::BatteryInfo& battery_info, + BatteryHealth& battery_health) { + battery_health.SetCycleCount(battery_info.cycle_count); + + double charge_full_now_milliamp_hours = + battery_info.charge_full * kMilliampsInAnAmp; + double charge_full_design_milliamp_hours = + battery_info.charge_full_design * kMilliampsInAnAmp; + battery_health.SetBatteryWearPercentage( + std::min({(100 * charge_full_now_milliamp_hours / + charge_full_design_milliamp_hours), + 100.0})); +} + +std::u16string GetBatteryTimeText(base::TimeDelta time_left) { + int hour = 0; + int min = 0; + ash::power_utils::SplitTimeIntoHoursAndMinutes(time_left, &hour, &min); + + std::u16string time_text; + if (hour == 0 || min == 0) { + // Display only one unit ("2 hours" or "10 minutes"). + return ui::TimeFormat::Simple(ui::TimeFormat::FORMAT_DURATION, + ui::TimeFormat::LENGTH_LONG, time_left); + } + + return ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION, + ui::TimeFormat::LENGTH_LONG, + -1, // force hour and minute output + time_left); +} + +} // namespace system_info
diff --git a/chromeos/ash/components/system_info/system_info_util.h b/chromeos/ash/components/system_info/system_info_util.h new file mode 100644 index 0000000..59c5d36 --- /dev/null +++ b/chromeos/ash/components/system_info/system_info_util.h
@@ -0,0 +1,88 @@ +// 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 CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_SYSTEM_INFO_UTIL_H_ +#define CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_SYSTEM_INFO_UTIL_H_ + +#include <string> +#include <vector> + +#include "base/time/time.h" +#include "chromeos/ash/components/system_info/battery_health.h" +#include "chromeos/ash/components/system_info/cpu_data.h" +#include "chromeos/ash/components/system_info/cpu_usage_data.h" +#include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" +#include "chromeos/dbus/power_manager/power_supply_properties.pb.h" + +namespace system_info { + +// The enums below are used in histograms, do not remove/renumber entries. If +// you're adding to any of these enums, update the corresponding enum listing in +// tools/metrics/histograms/enums.xml: CrosDiagnosticsDataError. +enum class BatteryDataError { + // Null or nullptr value. + kNoData = 0, + // For numeric values that are NaN. + kNotANumber = 1, + // Expectation about data not met. Ex. routing prefix is between zero and + // thirty-two. + kExpectationNotMet = 2, + kMaxValue = kExpectationNotMet, +}; + +void COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) + EmitBatteryDataError(BatteryDataError error, + const std::string& histogram_prefix); + +// Extracts MemoryInfo +// from `info`.Logs and returns a nullptr if MemoryInfo in not present +ash::cros_healthd::mojom::MemoryInfo* COMPONENT_EXPORT( + CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) + GetMemoryInfo(const ash::cros_healthd::mojom::TelemetryInfo& info, + const std::string& metric_name_for_histogram); + +// Extracts CpuInfo from `info`. Logs and returns a nullptr if CpuInfo +// in not present. +ash::cros_healthd::mojom::CpuInfo* COMPONENT_EXPORT( + CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) + GetCpuInfo(const ash::cros_healthd::mojom::TelemetryInfo& info, + const std::string& metric_name_for_histogram); + +// Extracts BatteryInfo from `info`. Logs and returns a nullptr if +// BatteryInfo in not present. +const ash::cros_healthd::mojom::BatteryInfo* COMPONENT_EXPORT( + CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) + GetBatteryInfo(const ash::cros_healthd::mojom::TelemetryInfo& info, + const std::string& metric_name_for_histogram, + const std::string& battery_error_histogram); + +CpuUsageData COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) + CalculateCpuUsage( + const std::vector<ash::cros_healthd::mojom::LogicalCpuInfoPtr>& + logical_cpu_infos); + +void COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) + PopulateCpuUsage(CpuUsageData new_cpu_usage_data, + CpuUsageData previous_cpu_usage_data, + CpuData& cpu_usage); +void COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) + PopulateAverageCpuTemperature( + const ash::cros_healthd::mojom::CpuInfo& cpu_info, + CpuData& cpu_usage); +void COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) + PopulateAverageScaledClockSpeed( + const ash::cros_healthd::mojom::CpuInfo& cpu_info, + CpuData& out_cpu_usage); + +void COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) + PopulateBatteryHealth( + const ash::cros_healthd::mojom::BatteryInfo& battery_info, + BatteryHealth& battery_health); + +std::u16string COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO) + GetBatteryTimeText(base::TimeDelta time_left); + +} // namespace system_info + +#endif // CHROMEOS_ASH_COMPONENTS_SYSTEM_INFO_SYSTEM_INFO_UTIL_H_
diff --git a/chromeos/ash/resources/internal b/chromeos/ash/resources/internal index 3a96117..bc844cc 160000 --- a/chromeos/ash/resources/internal +++ b/chromeos/ash/resources/internal
@@ -1 +1 @@ -Subproject commit 3a961174a24cfda9e444f54e3f1c783f75838b41 +Subproject commit bc844cc95077f161fff18f57fee76b33303d48c2
diff --git a/chromeos/ash/services/chromebox_for_meetings/public/cpp/service_connection.cc b/chromeos/ash/services/chromebox_for_meetings/public/cpp/service_connection.cc index 70050bb..6ad1580 100644 --- a/chromeos/ash/services/chromebox_for_meetings/public/cpp/service_connection.cc +++ b/chromeos/ash/services/chromebox_for_meetings/public/cpp/service_connection.cc
@@ -10,6 +10,7 @@ #include "base/no_destructor.h" #include "base/sequence_checker.h" #include "chromeos/ash/components/dbus/chromebox_for_meetings/cfm_hotline_client.h" +#include "mojo/public/cpp/bindings/callback_helpers.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/platform/platform_channel.h" @@ -157,8 +158,11 @@ ProvideAdaptorCallback callback) { BindPlatformServiceContextIfNeeded(); - remote_->ProvideAdaptor(std::move(interface_name), std::move(adaptor_remote), - std::move(callback)); + // Wrap callback with default invoke to correctly report a failure in the event of an + // unsuccessful bootstrap. + remote_->ProvideAdaptor( + std::move(interface_name), std::move(adaptor_remote), + mojo::WrapCallbackWithDefaultInvokeIfNotRun(std::move(callback), false)); } void ServiceConnectionImpl::RequestBindService( @@ -167,8 +171,11 @@ RequestBindServiceCallback callback) { BindPlatformServiceContextIfNeeded(); - remote_->RequestBindService(std::move(interface_name), - std::move(receiver_pipe), std::move(callback)); + // Wrap callback with default invoke to correctly report a failure in the event of an + // unsuccessful bootstrap. + remote_->RequestBindService( + std::move(interface_name), std::move(receiver_pipe), + mojo::WrapCallbackWithDefaultInvokeIfNotRun(std::move(callback), false)); } void ServiceConnectionImpl::OnMojoConnectionError() {
diff --git a/chromeos/ash/services/wifi_direct/BUILD.gn b/chromeos/ash/services/wifi_direct/BUILD.gn index b785ee3d..a931c75a 100644 --- a/chromeos/ash/services/wifi_direct/BUILD.gn +++ b/chromeos/ash/services/wifi_direct/BUILD.gn
@@ -33,6 +33,8 @@ ":wifi_direct", "//ash/constants", "//base/test:test_support", + "//chromeos/ash/components/dbus", + "//chromeos/ash/components/dbus/patchpanel", "//chromeos/ash/components/dbus/shill:test_support", "//testing/gtest", ]
diff --git a/chromeos/ash/services/wifi_direct/public/mojom/wifi_direct_manager.mojom b/chromeos/ash/services/wifi_direct/public/mojom/wifi_direct_manager.mojom index f51994d..41a3d07b 100644 --- a/chromeos/ash/services/wifi_direct/public/mojom/wifi_direct_manager.mojom +++ b/chromeos/ash/services/wifi_direct/public/mojom/wifi_direct_manager.mojom
@@ -6,27 +6,27 @@ enum WifiDirectOperationResult { kSuccess, - // Wifi direct is disallowed in platform per Manager.P2PAllowed. + // Wifi Direct is disallowed in platform per Manager.P2PAllowed. kNotAllowed, - // Wifi direct operation is not supported in the platform. + // Wifi Direct operation is not supported in the platform. kNotSupported, - // Creating Wifi direct interface is not possible with existing interfaces. + // Creating Wifi Direct interface is not possible with existing interfaces. kConcurrencyNotSupported, // The requested frequency is not supported. kFrequencyNotSupported, - // Wifi direct group rejects the authentication attempt. + // Wifi Direct group rejects the authentication attempt. kAuthFailure, - // Didn't discover the Wifi direct group. + // Didn't discover the Wifi Direct group. kGroupNotFound, - // Already connected to the Wifi direct group. + // Already connected to the Wifi Direct group. kAlreadyConnected, kOperationInProgress, kInvalidArguments, - // Wifi direct operation timed out. + // Wifi Direct operation timed out. kTimeout, - // Wifi direct operation response has an invalid result code. + // Wifi Direct operation response has an invalid result code. kInvalidResultCode, - // Wifi direct group miss or has invalid properties. + // Wifi Direct group miss or has invalid properties. kInvalidGroupProperties, kUnknownFailure, }; @@ -38,16 +38,16 @@ bool is_client_ready; }; -// WifiDirectManager provides Wifi direct management methods. An instance of +// WifiDirectManager provides Wifi Direct management methods. An instance of // this interface is owned in the browser process in Ash. interface WifiDirectManager { // Creates a WifiDirectConnection as group owner and returns a result along // with a pending remote of WifiDirectConnection object (a NullRemote will be // returned if the result is anything but kSuccess). Disconnecting from the // remote object will invoke the disconnect handler in WifiDirectConnection - // that will in turn tear down the WiFi direct group. Callers should also + // that will in turn tear down the WiFi Direct group. Callers should also // register a disconnect handler on the remote side to be notified and handle - // the case where the Wifi direct group is disconnected by Shill internally. + // the case where the Wifi Direct group is disconnected by Shill internally. // The ssid should be a UTF8 string that must match the requirements for a // WiFi Direct ssid per WiFi Direct v1.9 3.2.1 (i.e. must begin with DIRECT-xy // where x and y are random letters/numbers). The passphrase must be at least @@ -60,9 +60,9 @@ // along with a pending remote of WifiDirectConnection object (a NullRemote // will be returned if the result is anything but kSuccess). Disconnecting // from the remote object will invoke the disconnect handler in - // WifiDirectConnection that will in turn disconnect to the WiFi direct group. + // WifiDirectConnection that will in turn disconnect to the WiFi Direct group. // Callers should also register a disconnect handler on the remote side to be - // notified and handle the case where the Wifi direct group is disconnected by + // notified and handle the case where the Wifi Direct group is disconnected by // Shill internally. If the frequency is provided, the operation will fail // when the group is not found at the specified frequency. If the frequency // is omitted, system will scan all supported channels to find the group. @@ -77,9 +77,16 @@ GetWifiP2PCapabilities() => (WifiP2PCapabilities capabilities); }; -// WifiDirectConnection represents an active Wifi direct group that was created -// or connected to from WifiDirectManager. +// WifiDirectConnection represents an active Wifi Direct group that was created +// or connected to from WifiDirectManager. This interface should only be +// accessed by Nearby share process and Lacros browser (for WiFi Direct +// streaming). interface WifiDirectConnection { - // Returns the frequency of the Wifi direct network group. + // Returns the frequency of the Wifi Direct network group. GetFrequency() => (uint32 frequency); + + // Associate the TCP/UDP socket to the WiFi Direct group network so that + // traffic can consistently be sent and received on the WiFi Direct + // connection. + AssociateSocket(handle<platform> socket) => (bool success); }; \ No newline at end of file
diff --git a/chromeos/ash/services/wifi_direct/wifi_direct_connection.cc b/chromeos/ash/services/wifi_direct/wifi_direct_connection.cc index 5115700e..f56b1452 100644 --- a/chromeos/ash/services/wifi_direct/wifi_direct_connection.cc +++ b/chromeos/ash/services/wifi_direct/wifi_direct_connection.cc
@@ -4,7 +4,7 @@ #include "chromeos/ash/services/wifi_direct/wifi_direct_connection.h" -#include "mojo/public/cpp/bindings/pending_remote.h" +#include "chromeos/ash/components/wifi_p2p/wifi_p2p_controller.h" namespace ash::wifi_direct { @@ -12,19 +12,25 @@ WifiDirectConnection::InstanceWithPendingRemotePair WifiDirectConnection::Create(int shill_id, uint32_t frequency, + int network_id, base::OnceClosure disconnect_handler) { // Use base::WrapUnique(new WifiDirectConnection(...)) instead of // std::make_unique<WifiDirectConnection> to access a private constructor. std::unique_ptr<WifiDirectConnection> wifi_direct_connection = - base::WrapUnique(new WifiDirectConnection(shill_id, frequency)); + base::WrapUnique( + new WifiDirectConnection(shill_id, frequency, network_id)); return std::make_pair( std::move(wifi_direct_connection), wifi_direct_connection->CreateRemote(std::move(disconnect_handler))); } -WifiDirectConnection::WifiDirectConnection(int shill_id, uint32_t frequency) - : shill_id_(shill_id), frequency_(frequency) {} +WifiDirectConnection::WifiDirectConnection(int shill_id, + uint32_t frequency, + int network_id) + : shill_id_(shill_id), frequency_(frequency), network_id_(network_id) { + CHECK(WifiP2PController::IsInitialized()); +} WifiDirectConnection::~WifiDirectConnection() = default; @@ -32,6 +38,12 @@ std::move(callback).Run(frequency_); } +void WifiDirectConnection::AssociateSocket(mojo::PlatformHandle socket, + AssociateSocketCallback callback) { + WifiP2PController::Get()->TagSocket(network_id_, socket.TakeFD(), + std::move(callback)); +} + mojo::PendingRemote<mojom::WifiDirectConnection> WifiDirectConnection::CreateRemote(base::OnceClosure disconnect_handler) { // Only one mojo::PendingRemote should be created per instance.
diff --git a/chromeos/ash/services/wifi_direct/wifi_direct_connection.h b/chromeos/ash/services/wifi_direct/wifi_direct_connection.h index 79df483..dd4be2ff 100644 --- a/chromeos/ash/services/wifi_direct/wifi_direct_connection.h +++ b/chromeos/ash/services/wifi_direct/wifi_direct_connection.h
@@ -24,6 +24,7 @@ static InstanceWithPendingRemotePair Create( int shill_id, uint32_t frequency, + int network_id, base::OnceClosure disconnect_handler); WifiDirectConnection(const WifiDirectConnection&) = delete; @@ -34,17 +35,20 @@ // mojom::WifiDirectConnection void GetFrequency(GetFrequencyCallback callback) override; + void AssociateSocket(mojo::PlatformHandle socket, + AssociateSocketCallback callback) override; void FlushForTesting(); private: - WifiDirectConnection(int shill_id, uint32_t frequency); + WifiDirectConnection(int shill_id, uint32_t frequency, int network_id); mojo::PendingRemote<mojom::WifiDirectConnection> CreateRemote( base::OnceClosure disconnect_handler); mojo::Receiver<mojom::WifiDirectConnection> receiver_{this}; int shill_id_; uint32_t frequency_; + int network_id_; }; } // namespace ash::wifi_direct
diff --git a/chromeos/ash/services/wifi_direct/wifi_direct_manager.cc b/chromeos/ash/services/wifi_direct/wifi_direct_manager.cc index bd8f1b8f..ff05f2a8 100644 --- a/chromeos/ash/services/wifi_direct/wifi_direct_manager.cc +++ b/chromeos/ash/services/wifi_direct/wifi_direct_manager.cc
@@ -111,7 +111,7 @@ // TODO: set disconnect handler when Destroy/Disconnect group is implemented. auto wifi_direct_connection_pair = WifiDirectConnection::Create( - shill_id, metadata->frequency, + shill_id, metadata->frequency, metadata->network_id, base::BindOnce(&WifiDirectManager::OnClientRequestedDisconnection, weak_ptr_factory_.GetWeakPtr(), shill_id)); if (base::Contains(shill_id_to_wifi_direct_connection_, shill_id)) {
diff --git a/chromeos/ash/services/wifi_direct/wifi_direct_manager_unittest.cc b/chromeos/ash/services/wifi_direct/wifi_direct_manager_unittest.cc index 7b9d419f..f0e814f 100644 --- a/chromeos/ash/services/wifi_direct/wifi_direct_manager_unittest.cc +++ b/chromeos/ash/services/wifi_direct/wifi_direct_manager_unittest.cc
@@ -5,10 +5,12 @@ #include "chromeos/ash/services/wifi_direct/wifi_direct_manager.h" #include "ash/constants/ash_features.h" +#include "base/sync_socket.h" #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/values.h" +#include "chromeos/ash/components/dbus/patchpanel/fake_patchpanel_client.h" #include "chromeos/ash/components/dbus/shill/fake_shill_manager_client.h" #include "chromeos/ash/components/dbus/shill/shill_clients.h" #include "chromeos/ash/components/dbus/shill/shill_manager_client.h" @@ -36,6 +38,7 @@ void SetUp() override { shill_clients::InitializeFakes(); + PatchPanelClient::InitializeFake(); feature_list_.InitAndEnableFeature(features::kWifiDirect); WifiP2PController::Initialize(); wifi_direct_manager_ = std::make_unique<WifiDirectManager>(); @@ -44,6 +47,7 @@ void TearDown() override { wifi_direct_manager_.reset(); WifiP2PController::Shutdown(); + PatchPanelClient::Shutdown(); shill_clients::Shutdown(); } @@ -89,6 +93,18 @@ return frequency; } + bool AssociateSocket( + const mojo::Remote<mojom::WifiDirectConnection>& wifi_direct_connection) { + auto wifi_direct_connection_async_waiter = + mojom::WifiDirectConnectionAsyncWaiter(wifi_direct_connection.get()); + bool success; + base::SyncSocket socket1, socket2; + base::SyncSocket::CreatePair(&socket1, &socket2); + wifi_direct_connection_async_waiter.AssociateSocket( + mojo::PlatformHandle(socket1.Take()), &success); + return success; + } + void ExpectConnectionsCount(size_t expected_connections_count) { wifi_direct_manager_->FlushForTesting(); EXPECT_EQ(expected_connections_count, @@ -116,6 +132,7 @@ std::move(result_arguments.wifi_direct_connection)); ExpectConnectionsCount(1); EXPECT_EQ(1000u, GetFrequency(wifi_direct_connection)); + EXPECT_TRUE(AssociateSocket(wifi_direct_connection)); // Request disconnection from client side. wifi_direct_connection.reset(); ExpectConnectionsCount(0); @@ -148,6 +165,7 @@ std::move(result_arguments.wifi_direct_connection)); ExpectConnectionsCount(1); EXPECT_EQ(5200u, GetFrequency(wifi_direct_connection)); + EXPECT_TRUE(AssociateSocket(wifi_direct_connection)); // Request disconnection from client side. wifi_direct_connection.reset(); ExpectConnectionsCount(0);
diff --git a/chromeos/components/quick_answers/quick_answers_model.h b/chromeos/components/quick_answers/quick_answers_model.h index 12938f2..0ef9b5a 100644 --- a/chromeos/components/quick_answers/quick_answers_model.h +++ b/chromeos/components/quick_answers/quick_answers_model.h
@@ -152,7 +152,6 @@ ResultType result_type = ResultType::kNoResult; std::vector<std::unique_ptr<QuickAnswerUiElement>> title; std::vector<std::unique_ptr<QuickAnswerUiElement>> first_answer_row; - std::vector<std::unique_ptr<QuickAnswerUiElement>> second_answer_row; std::unique_ptr<QuickAnswerImage> image; PhoneticsInfo phonetics_info;
diff --git a/chromeos/tast_control.gni b/chromeos/tast_control.gni index c949276..ab60123 100644 --- a/chromeos/tast_control.gni +++ b/chromeos/tast_control.gni
@@ -171,6 +171,10 @@ tast_disabled_tests_from_chrome_all += [ "secagentd.AuthenticationEvents.mainline@octopus" ] + # b/336365285 disabled until bug is fixed. + tast_disabled_tests_from_chrome_all += + [ "secagentd.AuthenticationEvents.mainline@jacuzzi" ] + # b/274341001: By design, ui.ChromeCrashEarly.strict fails on non-official # builds. tast_disabled_tests_from_lacros_all += [ "ui.ChromeCrashEarly.strict_lacros" ]
diff --git a/clank b/clank index 5adefb93..e746c82 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit 5adefb939901b88ee5b674e74bc2223694aa45b1 +Subproject commit e746c821dc691b97bd4ad986c2d1c735f79ef884
diff --git a/components/autofill/core/browser/browser_autofill_manager_unittest.cc b/components/autofill/core/browser/browser_autofill_manager_unittest.cc index f2b098a..37bffafc 100644 --- a/components/autofill/core/browser/browser_autofill_manager_unittest.cc +++ b/components/autofill/core/browser/browser_autofill_manager_unittest.cc
@@ -2152,10 +2152,6 @@ // shown. Simulates Autocomplete suggestions that do not contain email strings. TEST_F(BrowserAutofillManagerTest, AutocompleteSuppressionWithoutEmailSuggestions) { - // Required to enable heuristics for small forms. - base::test::ScopedFeatureList feature_list{ - features::kAutofillEnableEmailHeuristicOnlyAddressForms}; - autofill_client_.identity_test_environment().MakePrimaryAccountAvailable( "plus@plus.plus", signin::ConsentLevel::kSignin); // Clear profiles to avoid that Autofill takes precedence. @@ -2207,10 +2203,6 @@ // users and in incognito mode. TEST_F(BrowserAutofillManagerTest, AutocompleteSuppressionWithEmailSuggestions) { - // Required to enable heuristics for small forms. - base::test::ScopedFeatureList feature_list{ - features::kAutofillEnableEmailHeuristicOnlyAddressForms}; - // Clear profiles to avoid that Autofill takes precedence. personal_data().ClearProfiles(); FormData form = test::GetFormData({.fields = {{.role = EMAIL_ADDRESS}}}); @@ -2266,10 +2258,6 @@ // focused field disappears while Autocomplete is retrieving suggestions. // Regression test for (b/327866993). TEST_F(BrowserAutofillManagerTest, AutocompleteSuppressionFieldDisappears) { - // Required to enable heuristics for small forms. - base::test::ScopedFeatureList feature_list{ - features::kAutofillEnableEmailHeuristicOnlyAddressForms}; - // Clear profiles to avoid that Autofill takes precedence. personal_data().ClearProfiles(); FormData form = test::GetFormData({.fields = {{.role = EMAIL_ADDRESS}}});
diff --git a/components/autofill/core/browser/metrics/form_events/form_event_logger_base_unittest.cc b/components/autofill/core/browser/metrics/form_events/form_event_logger_base_unittest.cc index e8cbe5fa..9c53833 100644 --- a/components/autofill/core/browser/metrics/form_events/form_event_logger_base_unittest.cc +++ b/components/autofill/core/browser/metrics/form_events/form_event_logger_base_unittest.cc
@@ -554,8 +554,6 @@ // Fillable form. FormData form_; - base::test::ScopedFeatureList features_{ - features::kAutofillEnableEmailHeuristicOnlyAddressForms}; }; void FormEventLoggerBaseEmailHeuristicOnlyMetricsTest::SetUp() {
diff --git a/components/feed/core/v2/public/feed_service.cc b/components/feed/core/v2/public/feed_service.cc index 4f4fe72e..ad8e95a 100644 --- a/components/feed/core/v2/public/feed_service.cc +++ b/components/feed/core/v2/public/feed_service.cc
@@ -81,11 +81,19 @@ // history::HistoryServiceObserver. void OnHistoryDeletions(history::HistoryService* history_service, const history::DeletionInfo& deletion_info) override { - if (internal::ShouldClearFeed( + if (feed_stream_ && identity_manager_ && + internal::ShouldClearFeed( identity_manager_->HasPrimaryAccount( GetConsentLevelNeededForPersonalizedFeed()), - deletion_info)) + deletion_info)) { feed_stream_->OnAllHistoryDeleted(); + } + } + + void Shutdown() { + feed_stream_ = nullptr; + identity_manager_ = nullptr; + scoped_history_service_observer_.Reset(); } private: @@ -124,27 +132,30 @@ class FeedService::StreamDelegateImpl : public FeedStream::Delegate { public: - StreamDelegateImpl(PrefService* local_state, - FeedService::Delegate* service_delegate, + StreamDelegateImpl(FeedService::Delegate* service_delegate, signin::IdentityManager* identity_manager, PrefService* profile_prefs) : service_delegate_(service_delegate), - eula_notifier_(local_state), identity_manager_(identity_manager), profile_prefs_(profile_prefs) {} StreamDelegateImpl(const StreamDelegateImpl&) = delete; StreamDelegateImpl& operator=(const StreamDelegateImpl&) = delete; - void Initialize(FeedStream* feed_stream) { + void Initialize(FeedStream* feed_stream, PrefService* local_state) { + eula_notifier_ = + std::make_unique<web_resource::EulaAcceptedNotifier>(local_state); eula_observer_ = std::make_unique<EulaObserver>(feed_stream); - eula_notifier_.Init(eula_observer_.get()); + eula_notifier_->Init(eula_observer_.get()); } // FeedStream::Delegate. bool IsEulaAccepted() override { - return eula_notifier_.IsEulaAccepted() || - base::CommandLine::ForCurrentProcess()->HasSwitch( - "feed-screenshot-mode"); + if (eula_notifier_) { + return eula_notifier_->IsEulaAccepted() || + base::CommandLine::ForCurrentProcess()->HasSwitch( + "feed-screenshot-mode"); + } + return false; } bool IsOffline() override { return net::NetworkChangeNotifier::IsOffline(); } @@ -185,9 +196,14 @@ service_delegate_->RegisterFeedUserSettingsFieldTrial(group); } + void Shutdown() { + eula_notifier_.reset(); + eula_observer_.reset(); + } + private: raw_ptr<FeedService::Delegate> service_delegate_; - web_resource::EulaAcceptedNotifier eula_notifier_; + std::unique_ptr<web_resource::EulaAcceptedNotifier> eula_notifier_; std::unique_ptr<EulaObserver> eula_observer_; std::unique_ptr<HistoryObserverImpl> history_observer_; raw_ptr<signin::IdentityManager> identity_manager_; @@ -252,7 +268,7 @@ : delegate_(std::move(delegate)), refresh_task_scheduler_(std::move(refresh_task_scheduler)) { stream_delegate_ = std::make_unique<StreamDelegateImpl>( - local_state, delegate_.get(), identity_manager, profile_prefs); + delegate_.get(), identity_manager, profile_prefs); network_delegate_ = std::make_unique<NetworkDelegateImpl>(delegate_.get(), identity_manager); metrics_reporter_ = std::make_unique<MetricsReporter>(profile_prefs); @@ -274,7 +290,8 @@ history_observer_ = std::make_unique<HistoryObserverImpl>( history_service, static_cast<FeedStream*>(stream_.get()), identity_manager); - stream_delegate_->Initialize(static_cast<FeedStream*>(stream_.get())); + stream_delegate_->Initialize(static_cast<FeedStream*>(stream_.get()), + local_state); identity_manager_observer_ = std::make_unique<IdentityManagerObserverImpl>( identity_manager, stream_.get(), delegate_.get()); @@ -332,8 +349,11 @@ } bool FeedService::IsSignedIn() { - return identity_manager_observer_->identity_manager().HasPrimaryAccount( - GetConsentLevelNeededForPersonalizedFeed()); + if (identity_manager_observer_) { + return identity_manager_observer_->identity_manager().HasPrimaryAccount( + GetConsentLevelNeededForPersonalizedFeed()); + } + return false; } #if BUILDFLAG(IS_ANDROID) @@ -352,4 +372,15 @@ } #endif +void FeedService::Shutdown() { + identity_manager_observer_.reset(); + if (history_observer_) { + history_observer_->Shutdown(); + } + + if (stream_delegate_) { + stream_delegate_->Shutdown(); + } +} + } // namespace feed
diff --git a/components/feed/core/v2/public/feed_service.h b/components/feed/core/v2/public/feed_service.h index 15c006a7..c16068a1 100644 --- a/components/feed/core/v2/public/feed_service.h +++ b/components/feed/core/v2/public/feed_service.h
@@ -143,6 +143,8 @@ void OnApplicationStateChange(base::android::ApplicationState state); #endif + void Shutdown() override; + // These components are owned for construction of |FeedApi|. These will // be null if |FeedApi| is created externally. std::unique_ptr<Delegate> delegate_;
diff --git a/components/gwp_asan/OWNERS b/components/gwp_asan/OWNERS index 0a1f39be..2ae8796 100644 --- a/components/gwp_asan/OWNERS +++ b/components/gwp_asan/OWNERS
@@ -1,4 +1,5 @@ -mpdenton@chromium.org +mpdenton@chromium.org # PST +glazunov@google.com # CET # Secondary: file://build/config/sanitizers/OWNERS
diff --git a/components/history_embeddings/history_embeddings_features.cc b/components/history_embeddings/history_embeddings_features.cc index d90fa27a..82687d1 100644 --- a/components/history_embeddings/history_embeddings_features.cc +++ b/components/history_embeddings/history_embeddings_features.cc
@@ -4,6 +4,8 @@ #include "components/history_embeddings/history_embeddings_features.h" +#include "base/feature_list.h" +#include "base/metrics/field_trial_params.h" #include "build/build_config.h" namespace history_embeddings { @@ -34,4 +36,8 @@ "UseMlEmbedder", false); +const base::FeatureParam<bool> kOmniboxUnscoped(&kHistoryEmbeddings, + "OmniboxUnscoped", + false); + } // namespace history_embeddings
diff --git a/components/history_embeddings/history_embeddings_features.h b/components/history_embeddings/history_embeddings_features.h index e66bc15..3ab3484c 100644 --- a/components/history_embeddings/history_embeddings_features.h +++ b/components/history_embeddings/history_embeddings_features.h
@@ -31,6 +31,10 @@ // Specifies whether to use the ML Embedder to embed passages and queries. extern const base::FeatureParam<bool> kUseMlEmbedder; +// Whether history embedding results should be shown in the omnibox outside of +// the '@history' scope. +extern const base::FeatureParam<bool> kOmniboxUnscoped; + } // namespace history_embeddings #endif // COMPONENTS_HISTORY_EMBEDDINGS_HISTORY_EMBEDDINGS_FEATURES_H_
diff --git a/components/history_embeddings/history_embeddings_service.cc b/components/history_embeddings/history_embeddings_service.cc index 4ecd98f..4c949979 100644 --- a/components/history_embeddings/history_embeddings_service.cc +++ b/components/history_embeddings/history_embeddings_service.cc
@@ -317,11 +317,11 @@ page_content_annotations::AnnotationType::kContentVisibility); base::UmaHistogramCounts100("History.Embeddings.NumUrlsMatched", scored_urls.size()); - base::UmaHistogramBoolean( "History.Embeddings.VisibilityModelAvailableAtQuery", is_visibility_model_available); - if (!is_visibility_model_available) { + + if (!is_visibility_model_available || scored_urls.empty()) { OnPassageVisibilityCalculated(std::move(callback), std::move(scored_urls), {}); return;
diff --git a/components/media_router/browser/log_util.cc b/components/media_router/browser/log_util.cc index e0a3d78..863783c9 100644 --- a/components/media_router/browser/log_util.cc +++ b/components/media_router/browser/log_util.cc
@@ -4,7 +4,7 @@ #include "components/media_router/browser/log_util.h" -#include "base/strings/string_piece.h" +#include <string_view> namespace media_router::log_util { @@ -12,7 +12,7 @@ // // For Cast and DIAL sink IDs, this happens to return the cast: or dial: prefix // and the first four characters of the UUID. -base::StringPiece TruncateId(base::StringPiece id) { +std::string_view TruncateId(std::string_view id) { return id.size() <= 9 ? id : id.substr(0, 9); }
diff --git a/components/media_router/browser/log_util.h b/components/media_router/browser/log_util.h index 225e5f2..6c6261d3 100644 --- a/components/media_router/browser/log_util.h +++ b/components/media_router/browser/log_util.h
@@ -5,7 +5,7 @@ #ifndef COMPONENTS_MEDIA_ROUTER_BROWSER_LOG_UTIL_H_ #define COMPONENTS_MEDIA_ROUTER_BROWSER_LOG_UTIL_H_ -#include "base/strings/string_piece.h" +#include <string_view> namespace media_router::log_util { @@ -13,7 +13,7 @@ // // For Cast and DIAL sink IDs, this happens to return the cast: or dial: prefix // and the first four characters of the UUID. -base::StringPiece TruncateId(base::StringPiece id); +std::string_view TruncateId(std::string_view id); } // namespace media_router::log_util
diff --git a/components/media_router/browser/logger_impl.cc b/components/media_router/browser/logger_impl.cc index e232f268..68ac68442 100644 --- a/components/media_router/browser/logger_impl.cc +++ b/components/media_router/browser/logger_impl.cc
@@ -4,9 +4,10 @@ #include "components/media_router/browser/logger_impl.h" +#include <string_view> + #include "base/i18n/time_formatting.h" #include "base/json/json_string_value_serializer.h" -#include "base/strings/string_piece.h" #include "base/values.h" #include "components/media_router/browser/log_util.h" #include "components/media_router/common/media_source.h" @@ -47,11 +48,11 @@ } } -base::StringPiece TruncateComponent(base::StringPiece component) { +std::string_view TruncateComponent(std::string_view component) { return component.substr(0, kComponentMaxLength); } -base::StringPiece TruncateMessage(base::StringPiece message) { +std::string_view TruncateMessage(std::string_view message) { return message.substr(0, kMessageMaxLength); } @@ -140,11 +141,11 @@ LoggerImpl::Entry::Entry(Severity severity, mojom::LogCategory category, base::Time time, - base::StringPiece component, - base::StringPiece message, - base::StringPiece sink_id, + std::string_view component, + std::string_view message, + std::string_view sink_id, std::string media_source, - base::StringPiece session_id) + std::string_view session_id) : severity(severity), category(category), time(time),
diff --git a/components/media_router/browser/logger_impl.h b/components/media_router/browser/logger_impl.h index 6d5b6a1..7a66eb0 100644 --- a/components/media_router/browser/logger_impl.h +++ b/components/media_router/browser/logger_impl.h
@@ -5,9 +5,10 @@ #ifndef COMPONENTS_MEDIA_ROUTER_BROWSER_LOGGER_IMPL_H_ #define COMPONENTS_MEDIA_ROUTER_BROWSER_LOGGER_IMPL_H_ +#include <string_view> + #include "base/containers/circular_deque.h" #include "base/gtest_prod_util.h" -#include "base/strings/string_piece.h" #include "base/time/time.h" #include "base/values.h" #include "components/media_router/common/mojom/logger.mojom.h" @@ -68,11 +69,11 @@ Entry(Severity severity, mojom::LogCategory category, base::Time time, - base::StringPiece component, - base::StringPiece message, - base::StringPiece sink_id, + std::string_view component, + std::string_view message, + std::string_view sink_id, std::string media_source, - base::StringPiece session_id); + std::string_view session_id); Entry(Entry&& other); Entry(const Entry&) = delete; ~Entry();
diff --git a/components/media_router/common/media_route_provider_helper.cc b/components/media_router/common/media_route_provider_helper.cc index fde6b4da..b4df596 100644 --- a/components/media_router/common/media_route_provider_helper.cc +++ b/components/media_router/common/media_route_provider_helper.cc
@@ -5,9 +5,9 @@ #include "components/media_router/common/media_route_provider_helper.h" #include <ostream> +#include <string_view> #include "base/notreached.h" -#include "base/strings/string_piece.h" #include "components/media_router/common/mojom/media_route_provider_id.mojom.h" constexpr const char kWiredDisplay[] = "WIRED_DISPLAY"; @@ -37,7 +37,7 @@ } std::optional<mojom::MediaRouteProviderId> ProviderIdFromString( - base::StringPiece provider_id) { + std::string_view provider_id) { if (provider_id == kWiredDisplay) { return mojom::MediaRouteProviderId::WIRED_DISPLAY; } else if (provider_id == kCast) {
diff --git a/components/media_router/common/media_route_provider_helper.h b/components/media_router/common/media_route_provider_helper.h index e3b298b1..7d041b84 100644 --- a/components/media_router/common/media_route_provider_helper.h +++ b/components/media_router/common/media_route_provider_helper.h
@@ -6,15 +6,15 @@ #define COMPONENTS_MEDIA_ROUTER_COMMON_MEDIA_ROUTE_PROVIDER_HELPER_H_ #include <optional> +#include <string_view> -#include "base/strings/string_piece.h" #include "components/media_router/common/mojom/media_route_provider_id.mojom-forward.h" namespace media_router { const char* ProviderIdToString(mojom::MediaRouteProviderId provider_id); std::optional<mojom::MediaRouteProviderId> ProviderIdFromString( - base::StringPiece provider_id); + std::string_view provider_id); } // namespace media_router
diff --git a/components/media_router/common/media_source.cc b/components/media_router/common/media_source.cc index 4fce6f6..eea5e654 100644 --- a/components/media_router/common/media_source.cc +++ b/components/media_router/common/media_source.cc
@@ -8,9 +8,9 @@ #include <cstdio> #include <ostream> #include <string> +#include <string_view> #include "base/ranges/algorithm.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "build/build_config.h" @@ -30,14 +30,14 @@ // See: https://www.ietf.org/rfc/rfc3406.txt constexpr char kAnyTabMediaUrn[] = "urn:x-org.chromium.media:source:tab:*"; constexpr char kTabMediaUrnFormat[] = "urn:x-org.chromium.media:source:tab:%d"; -constexpr base::StringPiece kDesktopMediaUrnPrefix = +constexpr std::string_view kDesktopMediaUrnPrefix = "urn:x-org.chromium.media:source:desktop:"; // WARNING: If more desktop URN parameters are added in the future, the parsing // code will have to be smarter! -constexpr base::StringPiece kDesktopMediaUrnAudioParam = "?with_audio=true"; -constexpr base::StringPiece kUnchosenDesktopMediaUrn = +constexpr std::string_view kDesktopMediaUrnAudioParam = "?with_audio=true"; +constexpr std::string_view kUnchosenDesktopMediaUrn = "urn:x-org.chromium.media:source:desktop"; -constexpr base::StringPiece kUnchosenDesktopWithAudioMediaUrn = +constexpr std::string_view kUnchosenDesktopWithAudioMediaUrn = "urn:x-org.chromium.media:source:desktop:?with_audio=true"; // List of non-http(s) schemes that are allowed in a Presentation URL.
diff --git a/components/media_router/common/providers/cast/cast_media_source.cc b/components/media_router/common/providers/cast/cast_media_source.cc index bac7113..087f117 100644 --- a/components/media_router/common/providers/cast/cast_media_source.cc +++ b/components/media_router/common/providers/cast/cast_media_source.cc
@@ -4,6 +4,7 @@ #include "components/media_router/common/providers/cast/cast_media_source.h" +#include <string_view> #include <utility> #include "base/containers/contains.h" @@ -12,7 +13,6 @@ #include "base/strings/escape.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "base/strings/utf_string_conversions.h" #include "components/media_router/common/media_source.h" @@ -158,8 +158,7 @@ // Converts a string containing a comma-separated list of capabilities into an // EnumSet of CastDeviceCapability values. -CastDeviceCapabilitySet CastDeviceCapabilitiesFromString( - const base::StringPiece& s) { +CastDeviceCapabilitySet CastDeviceCapabilitiesFromString(std::string_view s) { CastDeviceCapabilitySet result; for (const auto& capability_str : base::SplitStringPiece( s, ",", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) { @@ -174,8 +173,7 @@ return result; } -std::vector<ReceiverAppType> SupportedAppTypesFromString( - const base::StringPiece& s) { +std::vector<ReceiverAppType> SupportedAppTypesFromString(std::string_view s) { std::vector<ReceiverAppType> result; for (const auto& type_str : base::SplitStringPiece( s, ",", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) {
diff --git a/components/media_router/common/providers/cast/certificate/cast_cert_test_helpers.cc b/components/media_router/common/providers/cast/certificate/cast_cert_test_helpers.cc index 6732b6e..3127e37 100644 --- a/components/media_router/common/providers/cast/certificate/cast_cert_test_helpers.cc +++ b/components/media_router/common/providers/cast/certificate/cast_cert_test_helpers.cc
@@ -4,6 +4,8 @@ #include "components/media_router/common/providers/cast/certificate/cast_cert_test_helpers.h" +#include <string_view> + #include "base/base_paths.h" #include "base/files/file_util.h" #include "base/logging.h" @@ -59,7 +61,7 @@ return *kPath; } -SignatureTestData ReadSignatureTestData(const base::StringPiece& file_name) { +SignatureTestData ReadSignatureTestData(std::string_view file_name) { SignatureTestData result; std::string file_data; @@ -94,7 +96,7 @@ } std::unique_ptr<bssl::TrustStoreInMemory> LoadTestCert( - const base::StringPiece& cert_file_name) { + std::string_view cert_file_name) { auto store = std::make_unique<bssl::TrustStoreInMemory>(); CHECK(PopulateStoreWithCertsFromPath( store.get(), @@ -122,8 +124,7 @@ } std::unique_ptr<ScopedCastTrustStoreConfig> -ScopedCastTrustStoreConfig::TestCertificates( - const std::string_view& cert_file_name) { +ScopedCastTrustStoreConfig::TestCertificates(std::string_view cert_file_name) { SetInUse(); const auto cert_path = GetCastCertificatesSubDirectory().AppendASCII(cert_file_name); @@ -135,7 +136,7 @@ std::unique_ptr<ScopedCastTrustStoreConfig> ScopedCastTrustStoreConfig::BuiltInAndTestCertificates( - const std::string_view& cert_file_name) { + std::string_view cert_file_name) { SetInUse(); const auto cert_path = GetCastCertificatesSubDirectory().AppendASCII(cert_file_name);
diff --git a/components/media_router/common/providers/cast/certificate/cast_cert_test_helpers.h b/components/media_router/common/providers/cast/certificate/cast_cert_test_helpers.h index a27a6e2e..279b05a 100644 --- a/components/media_router/common/providers/cast/certificate/cast_cert_test_helpers.h +++ b/components/media_router/common/providers/cast/certificate/cast_cert_test_helpers.h
@@ -8,9 +8,9 @@ #include <atomic> #include <memory> #include <string> +#include <string_view> #include "base/files/file_path.h" -#include "base/strings/string_piece.h" #include "base/time/time.h" #include "third_party/boringssl/src/pki/trust_store_in_memory.h" @@ -40,7 +40,7 @@ // "SIGNATURE SHA256" blocks. // |file_name| should be relative to // //components/test/data/media_router/common/providers/cast/certificate -SignatureTestData ReadSignatureTestData(const base::StringPiece& file_name); +SignatureTestData ReadSignatureTestData(std::string_view file_name); // Converts uint64_t unix timestamp in seconds to base::Time. base::Time ConvertUnixTimestampSeconds(uint64_t time); @@ -48,7 +48,7 @@ // Helper method that loads a certificate from the test certificates folder and // places it in an heap allocated trust store. std::unique_ptr<bssl::TrustStoreInMemory> LoadTestCert( - const base::StringPiece& cert_file_name); + std::string_view cert_file_name); // This allows for modifying the CastTrustStore in order to run a test. When // the instance is destroyed, the CastTrustStore will be reverted to its @@ -60,9 +60,9 @@ // default configuration. static std::unique_ptr<ScopedCastTrustStoreConfig> BuiltInCertificates(); static std::unique_ptr<ScopedCastTrustStoreConfig> TestCertificates( - const std::string_view& cert_file_name); + std::string_view cert_file_name); static std::unique_ptr<ScopedCastTrustStoreConfig> BuiltInAndTestCertificates( - const std::string_view& cert_file_name); + std::string_view cert_file_name); ScopedCastTrustStoreConfig(const ScopedCastTrustStoreConfig&) = delete; ScopedCastTrustStoreConfig& operator=(const ScopedCastTrustStoreConfig&) = delete;
diff --git a/components/media_router/common/providers/cast/certificate/cast_cert_validator.cc b/components/media_router/common/providers/cast/certificate/cast_cert_validator.cc index c85efe4a..4468e90 100644 --- a/components/media_router/common/providers/cast/certificate/cast_cert_validator.cc +++ b/components/media_router/common/providers/cast/certificate/cast_cert_validator.cc
@@ -9,6 +9,7 @@ #include <algorithm> #include <memory> +#include <string_view> #include <utility> #include "base/command_line.h" @@ -16,7 +17,6 @@ #include "base/containers/span.h" #include "base/logging.h" #include "base/path_service.h" -#include "base/strings/string_piece.h" #include "base/task/task_traits.h" #include "components/media_router/common/providers/cast/certificate/cast_cert_printer.h" #include "components/media_router/common/providers/cast/certificate/cast_cert_reader.h" @@ -73,12 +73,12 @@ public: // Save a copy of the passed in public key and common name (text). CertVerificationContextImpl(bssl::UniquePtr<EVP_PKEY> key, - base::StringPiece common_name) + std::string_view common_name) : key_(std::move(key)), common_name_(common_name) {} bool VerifySignatureOverData( - const base::StringPiece& signature, - const base::StringPiece& data, + std::string_view signature, + std::string_view data, CastDigestAlgorithm digest_algorithm) const override { const EVP_MD* digest = nullptr; switch (digest_algorithm) {
diff --git a/components/media_router/common/providers/cast/certificate/cast_cert_validator.h b/components/media_router/common/providers/cast/certificate/cast_cert_validator.h index e6acae6..ae315936 100644 --- a/components/media_router/common/providers/cast/certificate/cast_cert_validator.h +++ b/components/media_router/common/providers/cast/certificate/cast_cert_validator.h
@@ -8,10 +8,10 @@ #include <atomic> #include <memory> #include <string> +#include <string_view> #include <vector> #include "base/files/file_path.h" -#include "base/strings/string_piece.h" #include "base/time/time.h" namespace bssl { @@ -99,8 +99,8 @@ // |digest_algorithm|. Both |signature| and |data| hold raw binary data. // Returns true if the signature was correct. virtual bool VerifySignatureOverData( - const base::StringPiece& signature, - const base::StringPiece& data, + std::string_view signature, + std::string_view data, CastDigestAlgorithm digest_algorithm) const = 0; // Retrieve the Common Name attribute of the subject's distinguished name from
diff --git a/components/media_router/common/providers/cast/certificate/net_trust_store.cc b/components/media_router/common/providers/cast/certificate/net_trust_store.cc index a51d3c2..91b91510 100644 --- a/components/media_router/common/providers/cast/certificate/net_trust_store.cc +++ b/components/media_router/common/providers/cast/certificate/net_trust_store.cc
@@ -67,7 +67,7 @@ std::unique_ptr<openscreen::cast::TrustStore> TrustStore::CreateInstanceFromPemFile(std::string_view file_path) { std::string pem_data; - CHECK(base::ReadFileToString(base::FilePath::FromASCII(base::StringPiece( + CHECK(base::ReadFileToString(base::FilePath::FromASCII(std::string_view( file_path.data(), file_path.size())), &pem_data)); bssl::PEMTokenizer tokenizer(pem_data, {std::string("CERTIFICATE")});
diff --git a/components/media_router/common/providers/cast/channel/cast_message_handler_unittest.cc b/components/media_router/common/providers/cast/channel/cast_message_handler_unittest.cc index 5b534cd..950e721 100644 --- a/components/media_router/common/providers/cast/channel/cast_message_handler_unittest.cc +++ b/components/media_router/common/providers/cast/channel/cast_message_handler_unittest.cc
@@ -3,7 +3,9 @@ // found in the LICENSE file. #include "components/media_router/common/providers/cast/channel/cast_message_handler.h" + #include <string> +#include <string_view> #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" @@ -63,7 +65,7 @@ constexpr int kMaxProtocolMessageSize = 64 * 1024; data_decoder::DataDecoder::ValueOrError ParseJsonLikeDataDecoder( - base::StringPiece json) { + std::string_view json) { return ParseJson(json); }
diff --git a/components/media_router/common/providers/cast/channel/cast_message_util.cc b/components/media_router/common/providers/cast/channel/cast_message_util.cc index d0104fa..7b2f713 100644 --- a/components/media_router/common/providers/cast/channel/cast_message_util.cc +++ b/components/media_router/common/providers/cast/channel/cast_message_util.cc
@@ -5,11 +5,11 @@ #include "components/media_router/common/providers/cast/channel/cast_message_util.h" #include <memory> +#include <string_view> #include "base/json/json_writer.h" #include "base/logging.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -112,7 +112,7 @@ namespace { -constexpr base::StringPiece kCastReservedNamespacePrefix = +constexpr std::string_view kCastReservedNamespacePrefix = "urn:x-cast:com.google.cast."; constexpr const char* kReservedNamespaces[] = { @@ -151,7 +151,7 @@ message->set_namespace_(message_namespace); } -CastMessage CreateKeepAliveMessage(base::StringPiece keep_alive_type) { +CastMessage CreateKeepAliveMessage(std::string_view keep_alive_type) { base::Value::Dict type_dict; type_dict.Set("type", keep_alive_type); return CreateCastMessage(kHeartbeatNamespace, @@ -180,8 +180,7 @@ // Cast V2 protocol. This is necessary because the protocol defines messages // with the same type in different namespaces, and the namespace is lost when // messages are passed using a CastInternalMessage object. -base::StringPiece GetRemappedMediaRequestType( - base::StringPiece v2_message_type) { +std::string_view GetRemappedMediaRequestType(std::string_view v2_message_type) { std::optional<V2MessageType> type = StringToEnum<V2MessageType>(v2_message_type); DCHECK(type && IsMediaRequestMessageType(*type)); @@ -240,7 +239,7 @@ message_proto.has_payload_binary()); } -bool IsCastReservedNamespace(base::StringPiece message_namespace) { +bool IsCastReservedNamespace(std::string_view message_namespace) { // Note: Any namespace with the prefix is theoretically reserved for internal // messages, but there is at least one namespace in widespread use that uses // the "reserved" prefix for app-level messages, so after matching the main @@ -249,7 +248,7 @@ return false; const auto prefix_length = kCastReservedNamespacePrefix.length(); - for (base::StringPiece reserved_namespace : kReservedNamespaces) { + for (std::string_view reserved_namespace : kReservedNamespaces) { DCHECK(base::StartsWith(reserved_namespace, kCastReservedNamespacePrefix)); // This comparison skips the first |prefix_length| characters // because we already know they match.
diff --git a/components/media_router/common/providers/cast/channel/cast_message_util.h b/components/media_router/common/providers/cast/channel/cast_message_util.h index 2ffc1bc..1705323 100644 --- a/components/media_router/common/providers/cast/channel/cast_message_util.h +++ b/components/media_router/common/providers/cast/channel/cast_message_util.h
@@ -7,6 +7,7 @@ #include <optional> #include <string> +#include <string_view> #include "base/values.h" #include "third_party/openscreen/src/cast/common/channel/proto/cast_channel.pb.h" @@ -171,7 +172,7 @@ // Returns true if |message_namespace| is a namespace reserved for internal // messages. -bool IsCastReservedNamespace(base::StringPiece message_namespace); +bool IsCastReservedNamespace(std::string_view message_namespace); // Returns the value in the "type" field or |kOther| if the field is not found. // The result is only valid if |payload| is a Cast application protocol message.
diff --git a/components/media_router/common/providers/cast/channel/cast_socket_unittest.cc b/components/media_router/common/providers/cast/channel/cast_socket_unittest.cc index e52f8f7..ff27c47 100644 --- a/components/media_router/common/providers/cast/channel/cast_socket_unittest.cc +++ b/components/media_router/common/providers/cast/channel/cast_socket_unittest.cc
@@ -7,6 +7,7 @@ #include <stdint.h> #include <memory> +#include <string_view> #include <utility> #include <vector> @@ -536,7 +537,7 @@ void TcpConnectCallback(int result) { connect_result_ = result; } std::unique_ptr<crypto::RSAPrivateKey> ReadTestKeyFromPEM( - const base::StringPiece& name) { + std::string_view name) { base::FilePath key_path = GetTestCertsDirectory().AppendASCII(name); std::string pem_data; if (!base::ReadFileToString(key_path, &pem_data)) {
diff --git a/components/media_router/common/providers/cast/channel/enum_table.cc b/components/media_router/common/providers/cast/channel/enum_table.cc index c3c2227..fa7c9f9 100644 --- a/components/media_router/common/providers/cast/channel/enum_table.cc +++ b/components/media_router/common/providers/cast/channel/enum_table.cc
@@ -5,6 +5,7 @@ #include "components/media_router/common/providers/cast/channel/enum_table.h" #include <cstdlib> +#include <string_view> namespace cast_util { @@ -20,7 +21,7 @@ const GenericEnumTableEntry* GenericEnumTableEntry::FindByString( const GenericEnumTableEntry data[], std::size_t size, - base::StringPiece str) { + std::string_view str) { for (std::size_t i = 0; i < size; i++) { if (data[i].length == str.length() && std::memcmp(data[i].chars, str.data(), str.length()) == 0) @@ -30,7 +31,7 @@ } // static -std::optional<base::StringPiece> GenericEnumTableEntry::FindByValue( +std::optional<std::string_view> GenericEnumTableEntry::FindByValue( const GenericEnumTableEntry data[], std::size_t size, int value) {
diff --git a/components/media_router/common/providers/cast/channel/enum_table.h b/components/media_router/common/providers/cast/channel/enum_table.h index dd58e6cf..3f2ec767 100644 --- a/components/media_router/common/providers/cast/channel/enum_table.h +++ b/components/media_router/common/providers/cast/channel/enum_table.h
@@ -9,10 +9,10 @@ #include <cstring> #include <optional> #include <ostream> +#include <string_view> #include "base/check_op.h" #include "base/notreached.h" -#include "base/strings/string_piece.h" #include "build/build_config.h" // TODO(crbug.com/1291730): Move this file to a more appropriate directory. @@ -62,7 +62,7 @@ // a special zero-argument form of EnumToString(), (and a corresponding member // function in EnumTable): // -// // Compiles to base::StringPiece("FOO"). +// // Compiles to std::string_view("FOO"). // EnumToString<MyEnum, MyEnum::kFoo>(); // // The syntax is a little awkward, but it saves you from having to duplicate @@ -185,7 +185,7 @@ GenericEnumTableEntry { public: inline constexpr GenericEnumTableEntry(int32_t value); - inline constexpr GenericEnumTableEntry(int32_t value, base::StringPiece str); + inline constexpr GenericEnumTableEntry(int32_t value, std::string_view str); GenericEnumTableEntry(const GenericEnumTableEntry&) = delete; GenericEnumTableEntry& operator=(const GenericEnumTableEntry&) = delete; @@ -194,18 +194,18 @@ static const GenericEnumTableEntry* FindByString( const GenericEnumTableEntry data[], std::size_t size, - base::StringPiece str); - static std::optional<base::StringPiece> + std::string_view str); + static std::optional<std::string_view> FindByValue(const GenericEnumTableEntry data[], std::size_t size, int value); - constexpr base::StringPiece str() const { + constexpr std::string_view str() const { DCHECK(has_str()); return {chars, length}; } constexpr bool has_str() const { return chars != nullptr; } - // Instead of storing a base::StringPiece, it's broken apart and stored as a + // Instead of storing a std::string_view, it's broken apart and stored as a // pointer and an unsigned int (rather than a std::size_t) so that table // entries fit in 16 bytes with no padding on 64-bit platforms. const char* chars; @@ -226,7 +226,7 @@ inline constexpr GenericEnumTableEntry::GenericEnumTableEntry( int32_t value, - base::StringPiece str) + std::string_view str) : chars(str.data()), length(static_cast<uint32_t>(str.length())), value(value) {} @@ -250,7 +250,7 @@ : GenericEnumTableEntry(static_cast<int32_t>(value)) {} // Constructor for regular entries. - constexpr Entry(E value, base::StringPiece str) + constexpr Entry(E value, std::string_view str) : GenericEnumTableEntry(static_cast<int32_t>(value), str) {} Entry(const Entry&) = delete; @@ -308,7 +308,7 @@ // Gets the string associated with the given enum value. When the argument // is a constant, prefer the zero-argument form below. - inline std::optional<base::StringPiece> GetString(E value) const { + inline std::optional<std::string_view> GetString(E value) const { if (is_sorted_) { const std::size_t index = static_cast<std::size_t>(value); if (ANALYZER_ASSUME_TRUE(index < data_.size())) { @@ -332,7 +332,7 @@ // possible to report an error in evaluating a constexpr function at compile // time without using exceptions. template <E Value> - constexpr base::StringPiece GetString() const { + constexpr std::string_view GetString() const { for (const auto& entry : data_) { if (entry.value == static_cast<int32_t>(Value) && entry.has_str()) return entry.str(); @@ -346,7 +346,7 @@ // GetString(), this method is not defined as a constexpr, because it should // never be called with a literal string; it's simpler to just refer to the // enum value directly. - std::optional<E> GetEnum(base::StringPiece str) const { + std::optional<E> GetEnum(std::string_view str) const { auto* entry = GenericEnumTableEntry::FindByString( reinterpret_cast<const GenericEnumTableEntry*>(data_.begin()), data_.size(), str); @@ -406,7 +406,7 @@ // Converts an enum value to a string using the default table // (EnumTable<E>::instance) for the given enum type. template <typename E> -inline std::optional<base::StringPiece> EnumToString(E value) { +inline std::optional<std::string_view> EnumToString(E value) { return EnumTable<E>::GetInstance().GetString(value); } @@ -417,20 +417,20 @@ // function to have only one template parameter: // // template <auto Value> -// inline base::StringPiece EnumToString() { +// inline std::string_view EnumToString() { // return EnumTable<decltype(Value) // >::GetInstance().template GetString<Value>(); // } // template <typename E, E Value> -inline base::StringPiece EnumToString() { +inline std::string_view EnumToString() { return EnumTable<E>::GetInstance().template GetString<Value>(); } // Converts a string to an enum value using the default table // (EnumTable<E>::instance) for the given enum type. template <typename E> -inline std::optional<E> StringToEnum(base::StringPiece str) { +inline std::optional<E> StringToEnum(std::string_view str) { return EnumTable<E>::GetInstance().GetEnum(str); }
diff --git a/components/omnibox/browser/BUILD.gn b/components/omnibox/browser/BUILD.gn index 52793bc..5e0a8703 100644 --- a/components/omnibox/browser/BUILD.gn +++ b/components/omnibox/browser/BUILD.gn
@@ -395,7 +395,14 @@ } if (!is_ios) { - deps += [ "//ui/base/clipboard" ] + sources += [ + "history_embeddings_provider.cc", + "history_embeddings_provider.h", + ] + deps += [ + "//components/history_embeddings", + "//ui/base/clipboard", + ] } if (use_blink) { @@ -910,8 +917,12 @@ sources += [ "actions/history_clusters_action_unittest.cc", "history_cluster_provider_unittest.cc", + "history_embeddings_provider_unittest.cc", ] - deps += [ "//ui/base/clipboard:clipboard_test_support" ] + deps += [ + "//components/history_embeddings", + "//ui/base/clipboard:clipboard_test_support", + ] } if (use_blink) {
diff --git a/components/omnibox/browser/DEPS b/components/omnibox/browser/DEPS index 3dba186..9e9fe157 100644 --- a/components/omnibox/browser/DEPS +++ b/components/omnibox/browser/DEPS
@@ -13,6 +13,8 @@ "+components/google/core/common/google_util.h", "+components/grit", "+components/history/core/browser", + "+components/history_embeddings", + "+components/history_embeddings/core", "+components/history/core/test", "+components/history_clusters/core", "+components/keep_alive_registry",
diff --git a/components/omnibox/browser/autocomplete_classifier.cc b/components/omnibox/browser/autocomplete_classifier.cc index 3f9ad29..00213214 100644 --- a/components/omnibox/browser/autocomplete_classifier.cc +++ b/components/omnibox/browser/autocomplete_classifier.cc
@@ -89,7 +89,11 @@ AutocompleteProvider::TYPE_SHORTCUTS | #endif AutocompleteProvider::TYPE_HISTORY_FUZZY | - AutocompleteProvider::TYPE_CALCULATOR; + AutocompleteProvider::TYPE_CALCULATOR +#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) + | AutocompleteProvider::TYPE_HISTORY_EMBEDDINGS +#endif + ; } void AutocompleteClassifier::Classify(
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc index 6bd2059..f6bed14 100644 --- a/components/omnibox/browser/autocomplete_controller.cc +++ b/components/omnibox/browser/autocomplete_controller.cc
@@ -95,8 +95,10 @@ #endif #if !BUILDFLAG(IS_IOS) +#include "components/history_embeddings/history_embeddings_features.h" #include "components/omnibox/browser/actions/history_clusters_action.h" #include "components/omnibox/browser/history_cluster_provider.h" +#include "components/omnibox/browser/history_embeddings_provider.h" #include "components/open_from_clipboard/clipboard_recent_content_generic.h" #endif @@ -997,6 +999,11 @@ providers_.push_back( new CalculatorProvider(provider_client_.get(), this, search_provider_)); } +#if !BUILDFLAG(IS_IOS) + if (provider_types & AutocompleteProvider::TYPE_HISTORY_EMBEDDINGS) { + providers_.push_back(new HistoryEmbeddingsProvider(provider_client_.get())); + } +#endif } void AutocompleteController::InitializeSyncProviders(int provider_types) { @@ -1828,6 +1835,7 @@ // providers. case AutocompleteProvider::TYPE_HISTORY_QUICK: case AutocompleteProvider::TYPE_HISTORY_URL: + case AutocompleteProvider::TYPE_HISTORY_EMBEDDINGS: return (keyword_turl->starter_pack_id() == TemplateURLStarterPackData::kHistory); @@ -1872,12 +1880,17 @@ } } - // Open Tab Provider should only be run for @tabs starter pack mode and in the - // CrOS launcher. If we reach here, we're not in starter pack mode, so - // disable the Open Tab Provider unless we're in the CrOS launcher. - if (provider->type() == AutocompleteProvider::TYPE_OPEN_TAB && - !is_cros_launcher_) { - return false; + // Some providers should only run in starter pack mode or in the CrOS + // launcher. If we reach here, we're not in starter pack mode. + switch (provider->type()) { + case AutocompleteProvider::TYPE_OPEN_TAB: + return is_cros_launcher_; +#if !BUILDFLAG(IS_IOS) + case AutocompleteProvider::TYPE_HISTORY_EMBEDDINGS: + return history_embeddings::kOmniboxUnscoped.Get(); +#endif + default: + break; } // Otherwise, run all providers.
diff --git a/components/omnibox/browser/autocomplete_provider.cc b/components/omnibox/browser/autocomplete_provider.cc index b8ceff1..d897acf 100644 --- a/components/omnibox/browser/autocomplete_provider.cc +++ b/components/omnibox/browser/autocomplete_provider.cc
@@ -76,6 +76,8 @@ return "Calculator"; case TYPE_FEATURED_SEARCH: return "FeaturedSearch"; + case TYPE_HISTORY_EMBEDDINGS: + return "HistoryEmbeddings"; default: NOTREACHED() << "Unhandled AutocompleteProvider::Type " << type; return "Unknown";
diff --git a/components/omnibox/browser/autocomplete_provider.h b/components/omnibox/browser/autocomplete_provider.h index 11ef832..aea13997 100644 --- a/components/omnibox/browser/autocomplete_provider.h +++ b/components/omnibox/browser/autocomplete_provider.h
@@ -176,6 +176,8 @@ TYPE_HISTORY_CLUSTER_PROVIDER = 1 << 18, TYPE_CALCULATOR = 1 << 19, TYPE_FEATURED_SEARCH = 1 << 20, + TYPE_HISTORY_EMBEDDINGS = 1 << 21, + // When adding a value here, update the omnibox_event.proto as well. }; explicit AutocompleteProvider(Type type);
diff --git a/components/omnibox/browser/autocomplete_provider_client.cc b/components/omnibox/browser/autocomplete_provider_client.cc index 1c61513..3aa815f 100644 --- a/components/omnibox/browser/autocomplete_provider_client.cc +++ b/components/omnibox/browser/autocomplete_provider_client.cc
@@ -9,6 +9,11 @@ return nullptr; } +history_embeddings::HistoryEmbeddingsService* +AutocompleteProviderClient::GetHistoryEmbeddingsService() { + return nullptr; +} + bool AutocompleteProviderClient::AllowDeletingBrowserHistory() const { return true; }
diff --git a/components/omnibox/browser/autocomplete_provider_client.h b/components/omnibox/browser/autocomplete_provider_client.h index 6b971ab..183cdbe 100644 --- a/components/omnibox/browser/autocomplete_provider_client.h +++ b/components/omnibox/browser/autocomplete_provider_client.h
@@ -47,6 +47,10 @@ class HistoryClustersService; } +namespace history_embeddings { +class HistoryEmbeddingsService; +} + namespace network { class SharedURLLoaderFactory; } @@ -78,6 +82,8 @@ virtual AutocompleteClassifier* GetAutocompleteClassifier() = 0; virtual history::HistoryService* GetHistoryService() = 0; virtual history_clusters::HistoryClustersService* GetHistoryClustersService(); + virtual history_embeddings::HistoryEmbeddingsService* + GetHistoryEmbeddingsService(); virtual scoped_refptr<history::TopSites> GetTopSites() = 0; virtual bookmarks::CoreBookmarkModel* GetBookmarkModel() = 0; virtual history::URLDatabase* GetInMemoryDatabase() = 0;
diff --git a/components/omnibox/browser/calculator_provider_unittest.cc b/components/omnibox/browser/calculator_provider_unittest.cc index 310303d..45e6bd1 100644 --- a/components/omnibox/browser/calculator_provider_unittest.cc +++ b/components/omnibox/browser/calculator_provider_unittest.cc
@@ -4,6 +4,7 @@ #include "components/omnibox/browser/calculator_provider.h" +#include <memory> #include <string> #include <vector> @@ -19,7 +20,6 @@ #include "components/omnibox/browser/provider_state_service.h" #include "components/omnibox/browser/search_provider.h" #include "components/omnibox/browser/test_scheme_classifier.h" -#include "omnibox_feature_configs.h" namespace { class FakeSearchProvider : public SearchProvider {
diff --git a/components/omnibox/browser/fake_autocomplete_provider_client.h b/components/omnibox/browser/fake_autocomplete_provider_client.h index 57ff3a7..2b03304 100644 --- a/components/omnibox/browser/fake_autocomplete_provider_client.h +++ b/components/omnibox/browser/fake_autocomplete_provider_client.h
@@ -33,6 +33,10 @@ class HistoryService; } // namespace history +namespace history_clusters { +class HistoryClustersService; +} + class InMemoryURLIndex; class PrefService; class TestingPrefServiceSimple;
diff --git a/components/omnibox/browser/history_embeddings_provider.cc b/components/omnibox/browser/history_embeddings_provider.cc new file mode 100644 index 0000000..7825c9cc --- /dev/null +++ b/components/omnibox/browser/history_embeddings_provider.cc
@@ -0,0 +1,100 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "history_embeddings_provider.h" + +#include <string> +#include <tuple> + +#include "base/check.h" +#include "base/feature_list.h" +#include "base/functional/bind.h" +#include "base/strings/utf_string_conversions.h" +#include "components/history_embeddings/history_embeddings_features.h" +#include "components/history_embeddings/history_embeddings_service.h" +#include "components/omnibox/browser/autocomplete_input.h" +#include "components/omnibox/browser/autocomplete_match.h" +#include "components/omnibox/browser/autocomplete_match_classification.h" +#include "components/omnibox/browser/autocomplete_provider.h" +#include "components/omnibox/browser/autocomplete_provider_client.h" +#include "components/omnibox/browser/keyword_provider.h" +#include "components/search_engines/template_url.h" + +namespace { +constexpr int kMaxScore = 1000; +} + +HistoryEmbeddingsProvider::HistoryEmbeddingsProvider( + AutocompleteProviderClient* client) + : AutocompleteProvider(AutocompleteProvider::TYPE_HISTORY_EMBEDDINGS), + client_(client) { + CHECK(client_); +} + +HistoryEmbeddingsProvider::~HistoryEmbeddingsProvider() = default; + +void HistoryEmbeddingsProvider::Start(const AutocompleteInput& input, + bool minimal_changes) { + if (!base::FeatureList::IsEnabled(history_embeddings::kHistoryEmbeddings)) { + return; + } + + // Remove the keyword from input if we're in keyword mode for a starter pack + // engine. + AutocompleteInput adjusted_input; + std::tie(adjusted_input, starter_pack_engine_) = + KeywordProvider::AdjustInputForStarterPackEngines( + input, client_->GetTemplateURLService()); + + matches_.clear(); + + history_embeddings::HistoryEmbeddingsService* service = + client_->GetHistoryEmbeddingsService(); + CHECK(service); + service->Search( + base::UTF16ToUTF8(adjusted_input.text()), {}, provider_max_matches_, + base::BindOnce(&HistoryEmbeddingsProvider::OnReceivedSearchResult, + weak_factory_.GetWeakPtr(), input.text())); +} + +void HistoryEmbeddingsProvider::Stop(bool clear_cached_results, + bool due_to_user_inactivity) { + // TODO(b/333770460): Once `HistoryEmbeddingsService` has a stop API, we + // should call it here. +} + +void HistoryEmbeddingsProvider::DeleteMatch(const AutocompleteMatch& match) { + // TODO(b/333770460): Should delete the entry in the history & embeddings DBs. + // Should also set `match.deletable = true`. +} + +void HistoryEmbeddingsProvider::OnReceivedSearchResult( + std::u16string input_text, + history_embeddings::SearchResult result) { + for (const history_embeddings::ScoredUrlRow& scored_url_row : result) { + AutocompleteMatch match(this, scored_url_row.scored_url.score * kMaxScore, + false, AutocompleteMatchType::HISTORY_BODY); + match.destination_url = scored_url_row.row.url(); + + match.contents = + AutocompleteMatch::SanitizeString(scored_url_row.row.title()); + match.contents_class = ClassifyTermMatches( + FindTermMatches(input_text, match.contents), match.contents.size(), + ACMatchClassification::MATCH, ACMatchClassification::NONE); + + match.description = base::UTF8ToUTF16(scored_url_row.row.url().spec()); + match.description_class = ClassifyTermMatches( + FindTermMatches(input_text, match.description), + match.description.size(), ACMatchClassification::MATCH, + ACMatchClassification::URL); + + if (starter_pack_engine_) { + match.keyword = starter_pack_engine_->keyword(); + match.transition = ui::PAGE_TRANSITION_KEYWORD; + } + + matches_.push_back(match); + } + NotifyListeners(!matches_.empty()); +}
diff --git a/components/omnibox/browser/history_embeddings_provider.h b/components/omnibox/browser/history_embeddings_provider.h new file mode 100644 index 0000000..9951217a --- /dev/null +++ b/components/omnibox/browser/history_embeddings_provider.h
@@ -0,0 +1,48 @@ +// Copyright 2024 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_OMNIBOX_BROWSER_HISTORY_EMBEDDINGS_PROVIDER_H_ +#define COMPONENTS_OMNIBOX_BROWSER_HISTORY_EMBEDDINGS_PROVIDER_H_ + +#include <string> + +#include "base/memory/raw_ptr.h" +#include "components/history_embeddings/history_embeddings_service.h" +#include "components/omnibox/browser/autocomplete_provider.h" + +class AutocompleteProviderClient; +class TemplateURL; +class AutocompleteInput; +struct AutocompleteMatch; + +class HistoryEmbeddingsProvider : public AutocompleteProvider { + public: + explicit HistoryEmbeddingsProvider(AutocompleteProviderClient* client); + + // AutocompleteProvider: + void Start(const AutocompleteInput& input, bool minimal_changes) override; + void Stop(bool clear_cached_results, bool due_to_user_inactivity) override; + void DeleteMatch(const AutocompleteMatch& match) override; + + private: + friend class FakeHistoryEmbeddingsProvider; + + ~HistoryEmbeddingsProvider() override; + + // Callback for querying `HistoryEmbeddingsService::Search()`. + void OnReceivedSearchResult(std::u16string input_text, + history_embeddings::SearchResult result); + + // Assigned in `Start()`, accessed in `OnReceivedSearchResult()` which is only + // called asyncly after `Start()`, so it's never null when accessed. + raw_ptr<const TemplateURL> starter_pack_engine_; + + // Never null. Owned by `AutocompleteController`, which also owns this + // provider, ensuring `client_` outlives this. + raw_ptr<AutocompleteProviderClient> client_; + + base::WeakPtrFactory<HistoryEmbeddingsProvider> weak_factory_{this}; +}; + +#endif // COMPONENTS_OMNIBOX_BROWSER_HISTORY_EMBEDDINGS_PROVIDER_H_
diff --git a/components/omnibox/browser/history_embeddings_provider_unittest.cc b/components/omnibox/browser/history_embeddings_provider_unittest.cc new file mode 100644 index 0000000..8683708 --- /dev/null +++ b/components/omnibox/browser/history_embeddings_provider_unittest.cc
@@ -0,0 +1,76 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/omnibox/browser/history_embeddings_provider.h" + +#include <memory> +#include <string> +#include <vector> + +#include "base/memory/scoped_refptr.h" +#include "components/history/core/browser/url_row.h" +#include "components/history_embeddings/history_embeddings_service.h" +#include "components/omnibox/browser/fake_autocomplete_provider_client.h" +#include "ui/base/page_transition_types.h" +#include "url/gurl.h" + +namespace { +history_embeddings::ScoredUrlRow CreateScoredUrlRow( + float score, + const std::string& url, + const std::u16string& title) { + history_embeddings::ScoredUrlRow scored_url_row{{0, 0, {}, score, 0u, ""}}; + scored_url_row.row = history::URLRow{GURL{url}}; + scored_url_row.row.set_title(title); + return scored_url_row; +} +} // namespace + +class FakeHistoryEmbeddingsProvider : public HistoryEmbeddingsProvider { + public: + using HistoryEmbeddingsProvider::HistoryEmbeddingsProvider; + using HistoryEmbeddingsProvider::OnReceivedSearchResult; + + using HistoryEmbeddingsProvider::matches_; + + private: + ~FakeHistoryEmbeddingsProvider() override = default; +}; + +class HistoryEmbeddingsProviderTest : public testing::Test { + protected: + HistoryEmbeddingsProviderTest() { + client_ = std::make_unique<FakeAutocompleteProviderClient>(); + history_embeddings_provider_ = + new FakeHistoryEmbeddingsProvider(client_.get()); + } + + std::unique_ptr<FakeAutocompleteProviderClient> client_; + scoped_refptr<FakeHistoryEmbeddingsProvider> history_embeddings_provider_; +}; + +TEST_F(HistoryEmbeddingsProviderTest, + OnReceivedSearchResult_CreatesAutocompleteMatches) { + history_embeddings_provider_->OnReceivedSearchResult( + u"query", { + CreateScoredUrlRow(.5, "https://url.com/", u"title"), + }); + + ASSERT_EQ(history_embeddings_provider_->matches_.size(), 1u); + EXPECT_EQ(history_embeddings_provider_->matches_[0].provider.get(), + history_embeddings_provider_.get()); + EXPECT_EQ(history_embeddings_provider_->matches_[0].relevance, 500); + EXPECT_EQ(history_embeddings_provider_->matches_[0].deletable, false); + EXPECT_EQ(history_embeddings_provider_->matches_[0].type, + AutocompleteMatchType::HISTORY_BODY); + EXPECT_EQ(history_embeddings_provider_->matches_[0].destination_url.spec(), + "https://url.com/"); + EXPECT_EQ(history_embeddings_provider_->matches_[0].contents, u"title"); + EXPECT_EQ(history_embeddings_provider_->matches_[0].description, + u"https://url.com/"); + EXPECT_EQ(history_embeddings_provider_->matches_[0].keyword, u""); + EXPECT_TRUE(PageTransitionCoreTypeIs( + history_embeddings_provider_->matches_[0].transition, + ui::PAGE_TRANSITION_TYPED)); +}
diff --git a/components/omnibox/browser/search_suggestion_parser.h b/components/omnibox/browser/search_suggestion_parser.h index bc7345b..e36e459 100644 --- a/components/omnibox/browser/search_suggestion_parser.h +++ b/components/omnibox/browser/search_suggestion_parser.h
@@ -77,8 +77,7 @@ bool received_after_last_keystroke() const { return received_after_last_keystroke_; } - void set_received_after_last_keystroke( - bool received_after_last_keystroke) { + void set_received_after_last_keystroke(bool received_after_last_keystroke) { received_after_last_keystroke_ = received_after_last_keystroke; }
diff --git a/components/optimization_guide/core/optimization_guide_enums.h b/components/optimization_guide/core/optimization_guide_enums.h index 39482f1..1b54d61 100644 --- a/components/optimization_guide/core/optimization_guide_enums.h +++ b/components/optimization_guide/core/optimization_guide_enums.h
@@ -305,15 +305,16 @@ kLoggingNotEnabled = 2, // Upload was not successful because of network error. kNetError = 3, - // Upload is disabled due to user's metrics consent. - kNoMetricsConsent = 4, + // Upload is disabled due to metrics reporting being disabled in + // chrome://settings. + kMetricsReportingDisabled = 4, // Upload is disabled due to enterprise policy. kDisabledDueToEnterprisePolicy = 5, // Insert new values before this line. // This enum must remain synchronized with the enum // |OptimizationGuideModelQualityLogsUploadStatus| in - // tools/metrics/histograms/enums.xml. + // tools/metrics/histograms/metadata/optimization/enums.xml. kMaxValue = kDisabledDueToEnterprisePolicy, };
diff --git a/components/optimization_guide/internal b/components/optimization_guide/internal index 607dfc4..73f3778 160000 --- a/components/optimization_guide/internal +++ b/components/optimization_guide/internal
@@ -1 +1 @@ -Subproject commit 607dfc435ce5ae150eb6625806ea0dfc3a698707 +Subproject commit 73f3778a3e87a9ce13ab216756311a61eeb2ee47
diff --git a/components/os_crypt/async/README.md b/components/os_crypt/async/README.md index 69cf8d29..14022b9 100644 --- a/components/os_crypt/async/README.md +++ b/components/os_crypt/async/README.md
@@ -1,13 +1,17 @@ ***OS Crypt Async*** This directory contains the new version of `OSCrypt` that supports asynchronous -initialization and pluggable providers. +initialization and pluggable providers. It is intended to gradually replace +`os_crypt::OSCrypt` (AKA "OSCrypt Sync") with a new version with improved +capabilities. **Main interfaces** `browser/` should only be included by code that lives in the browser process. An instance of `OSCryptAsync` should be constructed and held in browser and is -responsible for minting `Encryptor` instances. +responsible for minting `Encryptor` instances. \/\/chrome holds a browser-wide +instance that's accessible from `g_browser_process` using `os_crypt_async()` +method. `GetInstance` can be called as many times as necessary to obtain instances of `Encryptor` that should be used for encryption operations. Note that @@ -16,12 +20,87 @@ the callback to ensure correct function. See documentation for `base::CallbackList` for more on this. +When calling `GetInstance` an Encryptor hint can be supplied. This can change +the Encryption behavior of the resulting Encryptor instance, see `encryptor.h` +for details and see below. Note that all `Encryptor` returned from the same +instance of `OSCryptAsync` will always be able to decrypt each other's data. + `common/` can be included by any code in any process and allows `Encryptor` instances to perform encrypt/decrypt operations. These `EncryptString` and `DecryptString` operations are sync and can be called on any thread, the same as with legacy `os_crypt::OSCrypt`. +`Encryptor` instances can be passed over mojo if necessary, as mojo traits exist +to serialize and deserialize. If an `Encryptor` instance is passed to a process +then that process will be able to decrypt any data encrypted with +`OSCryptAsync`. + It is preferred to use the `base::span` `EncryptData` and `DecryptData` APIs, however the `EncryptString` and `DecryptString` APIs are provided for ease of compatibility with existing callers of `os_crypt::OSCrypt`. The string and span APIs are compatible with one another. + +**Integration Guide** + +`OSCryptAsync` is currently integrated into the Cookie encryption within the +network service, and this code can be used as a full end-to-end example of how +to integrate `OSCryptAsync` into your existing code that is using +`os_crypt::OSCrypt`. + +There are a few considerations that are important for integrators: + +1. `GetInstance()` must be called on the same sequence that it was created on, + which, if you are using the instance managed by \/\/chrome is the UI thread. + Therefore, plan for your `GetInstance` calls to be made on this sequence. + Callbacks will also arrive on this sequence. Once you have an `Encryptor` it + can be safely passed and used on another sequence, though. +2. Care should be taken during the rollout of any integration. In particular, + the following three phase approach is recommended, although you might want + to shorten this depending on your risk profile. Bear in mind that + `os_crypt::OSCrypt` and `OSCryptAsync` are likely being used to seal + valuable data so all precautions should be made to avoid any potential data + loss. + 1. **Phase 1: Convert code to async**: In this first phase, the existing + sync code that is calling into `os_crypt::OSCrypt` should be converted + to perform an asynchronous initialization of an Encryptor instance by + calling `GetInstance` and handling the callback. The `Encryptor` + instance that is returned can then be used as if the code were calling + directly to `os_crypt::OSCrypt` but since the `Encryptor` is move-only + it will have to be held by an object on the calling sequence to make the + calls themselves. If multiple sequences need to make encryption calls, + that's supported, but you'll need to get an `Encryptor` for each + sequence and explicitly pass it to those sequences. In this phase, it is + **highly recommended** to: + 1. Call `GetInstance` with the `kEncryptSyncCompat` option. This will + ask the `Encryptor` to always encrypt any data in a format that is + backwards compatible with `os_crypt::OSCrypt`. This means that if + any issues are found when converting the code from sync to async, + there is no risk of any permanent data loss, and any CLs can be + safely rolled back, or features turned off. + 2. Land the async code behind a feature, although this might not always + be possible given the restructuring required. By both using + `kEncryptSyncCompat` and a feature flag, the code can be iterated on + without risk to any permanent data loss for users. + 3. Monitor baseline metrics, to verify no guardrail metrics are + impacted. If you code needs to perform Encrypt or Decrypt operations + very early on in startup, then it is possible that there could be + performance regressions as `OSCryptAsync` might not yet have + obtained a valid `Encryptor` instance. + 2. **Phase 2: Engage new Encryption**: Once Phase 1 has landed and no + regressions are seen, then a feature can land that removes the + `kEncryptSyncCompat` option passed to `GetInstance` from all calls, and + data will now start being encrypted with the keys managed by the + installed `OSCryptAsync` key providers in a potentially non-backwards + compatible way. In this phase, for example, data might start being + encrypted with App-Bound encryption on supported platforms. At this + point you will want to double check no data loss caused by encrypting + data with the new keys, although core `OSCryptAsync` metrics themselves + are used as guardrails against this scenario. + 3. **Phase 3: Re-encrypt all data**: Once Phase 2 has landed and there + appear to be no regressions from using the new key, then all data + currently encrypted (which will include a mix of data encrypted with + `os_crypt::OSCrypt`, and data encrypted with `OSCryptAsync` depending on + when it was originally encrypted) should be read in from persistent + storage, decrypted, re-encrypted, and then and written back to + persistent storage. This ensures that all data is now encrypted with + `OSCryptAsync` and secured by new keys.
diff --git a/components/os_crypt/async/browser/dpapi_key_provider.cc b/components/os_crypt/async/browser/dpapi_key_provider.cc index 98e20893..2c96901 100644 --- a/components/os_crypt/async/browser/dpapi_key_provider.cc +++ b/components/os_crypt/async/browser/dpapi_key_provider.cc
@@ -119,4 +119,8 @@ return true; } +bool DPAPIKeyProvider::IsCompatibleWithOsCryptSync() { + return true; +} + } // namespace os_crypt_async
diff --git a/components/os_crypt/async/browser/dpapi_key_provider.h b/components/os_crypt/async/browser/dpapi_key_provider.h index 6755036..699e876 100644 --- a/components/os_crypt/async/browser/dpapi_key_provider.h +++ b/components/os_crypt/async/browser/dpapi_key_provider.h
@@ -51,6 +51,7 @@ // os_crypt_async::KeyProvider interface. void GetKey(KeyCallback callback) override; bool UseForEncryption() override; + bool IsCompatibleWithOsCryptSync() override; // Attempt to retrieve `encrypted_key` from `pref_path`. If a key is found // that matches and has correct `key_prefix` then the raw encrypted key is
diff --git a/components/os_crypt/async/browser/dpapi_key_provider_unittest.cc b/components/os_crypt/async/browser/dpapi_key_provider_unittest.cc index 9b9e212..c8082432 100644 --- a/components/os_crypt/async/browser/dpapi_key_provider_unittest.cc +++ b/components/os_crypt/async/browser/dpapi_key_provider_unittest.cc
@@ -10,15 +10,16 @@ #include "base/logging.h" #include "base/no_destructor.h" +#include "base/rand_util.h" #include "base/run_loop.h" #include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/task_environment.h" #include "components/os_crypt/async/browser/os_crypt_async.h" +#include "components/os_crypt/async/common/algorithm.mojom.h" #include "components/os_crypt/async/common/encryptor.h" #include "components/os_crypt/sync/os_crypt.h" #include "components/prefs/testing_pref_service.h" -#include "crypto/random.h" #include "testing/gtest/include/gtest/gtest.h" namespace os_crypt_async { @@ -39,21 +40,29 @@ } protected: + Encryptor GetInstanceSync( + OSCryptAsync& factory, + Encryptor::Option option = Encryptor::Option::kNone) { + base::RunLoop run_loop; + std::optional<Encryptor> encryptor; + auto sub = + factory.GetInstance(base::BindLambdaForTesting( + [&](Encryptor encryptor_param, bool success) { + EXPECT_TRUE(success); + encryptor.emplace(std::move(encryptor_param)); + run_loop.Quit(); + }), + option); + run_loop.Run(); + return std::move(*encryptor); + } + Encryptor GetInstanceWithDPAPI() { std::vector<std::pair<size_t, std::unique_ptr<KeyProvider>>> providers; providers.emplace_back(std::make_pair( /*precedence=*/10u, std::make_unique<DPAPIKeyProvider>(&prefs_))); OSCryptAsync factory(std::move(providers)); - base::RunLoop run_loop; - std::optional<Encryptor> encryptor; - auto sub = factory.GetInstance(base::BindLambdaForTesting( - [&](Encryptor encryptor_param, bool success) { - EXPECT_TRUE(success); - encryptor.emplace(std::move(encryptor_param)); - run_loop.Quit(); - })); - run_loop.Run(); - return std::move(*encryptor); + return GetInstanceSync(factory); } DPAPIKeyProvider::KeyStatus expected_histogram_ = @@ -101,6 +110,92 @@ EXPECT_EQ(plaintext, decrypted); } +// Very small Key Provider that provides a random key. +class RandomKeyProvider : public KeyProvider { + private: + void GetKey(KeyCallback callback) final { + std::vector<uint8_t> key(Encryptor::Key::kAES256GCMKeySize); + base::RandBytes(key); + std::move(callback).Run("_", + Encryptor::Key(key, mojom::Algorithm::kAES256GCM)); + } + + bool UseForEncryption() final { return true; } + bool IsCompatibleWithOsCryptSync() final { return false; } +}; + +TEST_F(DPAPIKeyProviderTest, EncryptWithOptions) { + std::vector<std::pair<size_t, std::unique_ptr<KeyProvider>>> providers; + providers.emplace_back(std::make_pair( + /*precedence=*/10u, std::make_unique<DPAPIKeyProvider>(&prefs_))); + // Random Key Provider will take precedence here. + providers.emplace_back(std::make_pair(/*precedence=*/15u, + std::make_unique<RandomKeyProvider>())); + + OSCryptAsync factory(std::move(providers)); + Encryptor encryptor = GetInstanceSync(factory); + std::optional<std::vector<uint8_t>> ciphertext; + { + // This should use RandomKeyProvider. + ciphertext = encryptor.EncryptString("secrets"); + ASSERT_TRUE(ciphertext); + EXPECT_EQ(ciphertext->at(0), '_'); + std::string plaintext; + // Fail, as it's encrypted with the '_' key provider. + EXPECT_FALSE(OSCrypt::DecryptString( + std::string(ciphertext->begin(), ciphertext->end()), &plaintext)); + + // Encryptor should be able to decrypt. + const auto decrypted = encryptor.DecryptData(*ciphertext); + EXPECT_TRUE(decrypted); + EXPECT_EQ(*decrypted, "secrets"); + } + { + // Now, obtain a second encryptor but with the kEncryptSyncCompat option. + Encryptor encryptor_with_option = + GetInstanceSync(factory, Encryptor::Option::kEncryptSyncCompat); + // This should now encrypt with DPAPI key provider, compatible with OSCrypt + // sync, but still contain both keys. + const auto second_ciphertext = + encryptor_with_option.EncryptString("moresecrets"); + ASSERT_TRUE(second_ciphertext); + std::string plaintext; + + // First, test a decrypt using OSCrypt sync works. + ASSERT_TRUE(OSCrypt::DecryptString( + std::string(second_ciphertext->begin(), second_ciphertext->end()), + &plaintext)); + EXPECT_EQ(plaintext, "moresecrets"); + + // Now test both encryptors can decrypt both sets of ciphertext, regardless + // of the option. + { + // First Encryptor with first ciphertext. + const auto decrypted = encryptor.DecryptData(*ciphertext); + ASSERT_TRUE(decrypted); + EXPECT_EQ(*decrypted, "secrets"); + } + { + // First Encryptor with second ciphertext. + const auto decrypted = encryptor.DecryptData(*second_ciphertext); + ASSERT_TRUE(decrypted); + EXPECT_EQ(*decrypted, "moresecrets"); + } + { + // Second encryptor (with option) with first ciphertext. + const auto decrypted = encryptor_with_option.DecryptData(*ciphertext); + ASSERT_TRUE(decrypted); + EXPECT_EQ(*decrypted, "secrets"); + } + { + // Second encryptor (with option) with second ciphertext. + const auto decrypted = + encryptor_with_option.DecryptData(*second_ciphertext); + ASSERT_TRUE(decrypted); + EXPECT_EQ(*decrypted, "moresecrets"); + } + } +} // Only test a few scenarios here, just to verify the error histogram is always // logged. TEST_F(DPAPIKeyProviderTest, OSCryptNotInit) {
diff --git a/components/os_crypt/async/browser/key_provider.h b/components/os_crypt/async/browser/key_provider.h index dcbfd44..686d695 100644 --- a/components/os_crypt/async/browser/key_provider.h +++ b/components/os_crypt/async/browser/key_provider.h
@@ -50,6 +50,12 @@ // data encrypted previously with the key. virtual bool UseForEncryption() = 0; + // Key providers should return whether or not their data is compatible with + // OSCrypt sync, specifically whether encryption of data with the key and + // algorithm returned from this provider could be successfully decrypted using + // Decrypt in os_crypt/sync. + virtual bool IsCompatibleWithOsCryptSync() = 0; + protected: KeyProvider() = default; };
diff --git a/components/os_crypt/async/browser/os_crypt_async.cc b/components/os_crypt/async/browser/os_crypt_async.cc index a8dec03..c6d400d1 100644 --- a/components/os_crypt/async/browser/os_crypt_async.cc +++ b/components/os_crypt/async/browser/os_crypt_async.cc
@@ -70,9 +70,10 @@ // CallbackHelper is needed so the sequence checker member can be accessed in // the callback, which it can't from a lambda without breaking the // sequence_checker abstraction. -void OSCryptAsync::CallbackHelper(InitCallback callback) const { +void OSCryptAsync::CallbackHelper(InitCallback callback, + Encryptor::Option option) const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - std::move(callback).Run(encryptor_instance_->Clone(), /*result=*/true); + std::move(callback).Run(encryptor_instance_->Clone(option), /*result=*/true); } void OSCryptAsync::HandleKey(ProviderIterator current, @@ -91,6 +92,8 @@ << "Tags must not overlap."; } #endif // DCHECK_IS_ON() + key->is_os_crypt_sync_compatible_ = + ((*current)->IsCompatibleWithOsCryptSync()); key_ring_.emplace(tag, std::move(*key)); if ((*current)->UseForEncryption()) { provider_for_encryption_ = tag; @@ -115,17 +118,24 @@ base::CallbackListSubscription OSCryptAsync::GetInstance( InitCallback callback) { + return GetInstance(std::move(callback), Encryptor::Option::kNone); +} + +base::CallbackListSubscription OSCryptAsync::GetInstance( + InitCallback callback, + Encryptor::Option option) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (is_initialized_) { DCHECK(!is_initializing_); - std::move(callback).Run(encryptor_instance_->Clone(), /*result=*/true); + std::move(callback).Run(encryptor_instance_->Clone(option), + /*result=*/true); return base::CallbackListSubscription(); } auto subscription = callbacks_.Add( base::BindOnce(&OSCryptAsync::CallbackHelper, weak_factory_.GetWeakPtr(), - std::move(callback))); + std::move(callback), option)); if (is_initializing_) { return subscription;
diff --git a/components/os_crypt/async/browser/os_crypt_async.h b/components/os_crypt/async/browser/os_crypt_async.h index 1f4db6a..238938d3 100644 --- a/components/os_crypt/async/browser/os_crypt_async.h +++ b/components/os_crypt/async/browser/os_crypt_async.h
@@ -56,17 +56,24 @@ // Obtain an Encryptor instance. Can be called multiple times, each one will // get a valid instance once the initialization has completed, on the - // `callback`. Must be called on the same sequence that the OSCryptAsync - // object was created on. Destruction of the `base::CallbackListSubscription` - // will cause the callback not to run, see `base/callback_list.h`. + // `callback`. `option` determines characteristics of the resulting Encryptor + // instance returned in the callback, see encryptor.h. Must be called on the + // same sequence that the OSCryptAsync object was created on. Destruction of + // the `base::CallbackListSubscription` will cause the callback not to run, + // see `base/callback_list.h`. [[nodiscard]] virtual base::CallbackListSubscription GetInstance( + InitCallback callback, + Encryptor::Option option); + + // Same as the `GetInstance` method above but uses a default option. + [[nodiscard]] base::CallbackListSubscription GetInstance( InitCallback callback); private: using ProviderIterator = std::vector<std::unique_ptr<KeyProvider>>::const_iterator; - void CallbackHelper(InitCallback callback) const; + void CallbackHelper(InitCallback callback, Encryptor::Option option) const; void HandleKey(ProviderIterator current, const std::string& tag, std::optional<Encryptor::Key> key);
diff --git a/components/os_crypt/async/browser/os_crypt_async_unittest.cc b/components/os_crypt/async/browser/os_crypt_async_unittest.cc index df34251a..6920462 100644 --- a/components/os_crypt/async/browser/os_crypt_async_unittest.cc +++ b/components/os_crypt/async/browser/os_crypt_async_unittest.cc
@@ -22,20 +22,46 @@ namespace os_crypt_async { +namespace { + +// Helper function to verify that decryption using OSCrypt failed. This is +// platform dependent, as Windows will fail, but other platforms will return the +// ciphertext back. +[[nodiscard]] bool MaybeVerifyFailedDecryptOperation( + const std::optional<std::string>& decrypted, + base::span<const uint8_t> ciphertext) { +#if BUILDFLAG(IS_WIN) + // On Windows, decryption fails, and decrypted will have no valid value. + return !decrypted; +#else + // On other platforms, OSCrypt does not recognise the data and it returns + // the data without decrypting. + if (!decrypted) { + return false; + } + return decrypted == std::string(ciphertext.begin(), ciphertext.end()); +#endif +} + +} // namespace class OSCryptAsyncTest : public ::testing::Test { protected: using ProviderList = std::vector<std::pair<size_t, std::unique_ptr<KeyProvider>>>; - Encryptor GetInstanceSync(OSCryptAsync& factory) { + Encryptor GetInstanceSync( + OSCryptAsync& factory, + Encryptor::Option option = Encryptor::Option::kNone) { base::RunLoop run_loop; std::optional<Encryptor> encryptor; - auto sub = factory.GetInstance(base::BindLambdaForTesting( - [&](Encryptor encryptor_param, bool success) { - EXPECT_TRUE(success); - encryptor.emplace(std::move(encryptor_param)); - run_loop.Quit(); - })); + auto sub = + factory.GetInstance(base::BindLambdaForTesting( + [&](Encryptor encryptor_param, bool success) { + EXPECT_TRUE(success); + encryptor.emplace(std::move(encryptor_param)); + run_loop.Quit(); + }), + option); run_loop.Run(); return std::move(*encryptor); } @@ -45,11 +71,19 @@ class TestKeyProvider : public KeyProvider { public: - explicit TestKeyProvider(const std::string& name = "TEST", - bool use_for_encryption = true) - : name_(name), use_for_encryption_(use_for_encryption) {} + TestKeyProvider(const std::string& name, + bool use_for_encryption, + bool compatible_with_os_crypt_sync = false) + : name_(name), + use_for_encryption_(use_for_encryption), + compatible_with_os_crypt_sync_(compatible_with_os_crypt_sync) {} protected: + TestKeyProvider() + : name_("TEST"), + use_for_encryption_(true), + compatible_with_os_crypt_sync_(false) {} + Encryptor::Key GenerateKey() { // Make the key derive from the name to ensure different providers have // different keys. @@ -67,15 +101,20 @@ } bool UseForEncryption() override { return use_for_encryption_; } + bool IsCompatibleWithOsCryptSync() override { + return compatible_with_os_crypt_sync_; + } const bool use_for_encryption_; + const bool compatible_with_os_crypt_sync_; }; TEST_F(OSCryptAsyncTest, EncryptHeader) { const std::string kTestProviderName("TEST"); ProviderList providers; - providers.emplace_back(std::make_pair( - 10u, std::make_unique<TestKeyProvider>(kTestProviderName))); + providers.emplace_back( + std::make_pair(10u, std::make_unique<TestKeyProvider>( + kTestProviderName, /*use_for_encryption=*/true))); OSCryptAsync factory(std::move(providers)); Encryptor encryptor = GetInstanceSync(factory); @@ -124,6 +163,27 @@ ASSERT_TRUE(plaintext); EXPECT_EQ("secrets", *plaintext); } + // Check that order of providers does not affect which one is chosen for + // encrypt operations. + { + const std::string kFooProviderName("FOO"); + ProviderList providers; + providers.emplace_back( + /*precedence=*/5u, + std::make_unique<TestKeyProvider>("BAR", /*use_for_encryption=*/true)); + providers.emplace_back( + /*precedence=*/10u, std::make_unique<TestKeyProvider>( + kFooProviderName, /*use_for_encryption=*/true)); + OSCryptAsync factory(std::move(providers)); + Encryptor encryptor = GetInstanceSync(factory); + + ciphertext = encryptor.EncryptString("secrets"); + ASSERT_TRUE(ciphertext); + // The higher of the two providers should have been picked for data + // encryption. + EXPECT_TRUE(std::equal(kFooProviderName.cbegin(), kFooProviderName.cend(), + ciphertext->cbegin())); + } } TEST_F(OSCryptAsyncTest, TwoProvidersOneEnabled) { @@ -169,10 +229,116 @@ } } +TEST_F(OSCryptAsyncTest, EncryptorOption) { + const std::string kTESTProviderName("TEST"); + const std::string kBLAHProviderName("BLAH"); + + std::optional<std::vector<uint8_t>> blah_ciphertext, test_ciphertext; + { + ProviderList providers; + providers.emplace_back(/*precedence=*/10u, + std::make_unique<TestKeyProvider>( + kTESTProviderName, /*use_for_encryption=*/true)); + providers.emplace_back(/*precedence=*/5u, + std::make_unique<TestKeyProvider>( + kBLAHProviderName, /*use_for_encryption=*/true, + /*compatible_with_os_crypt_sync=*/true)); + OSCryptAsync factory(std::move(providers)); + Encryptor encryptor = GetInstanceSync(factory); + + test_ciphertext = encryptor.EncryptString("secrets"); + ASSERT_TRUE(test_ciphertext); + // TEST should be picked, because it has a higher precedence than BLAH. + EXPECT_TRUE(std::equal(kTESTProviderName.cbegin(), kTESTProviderName.cend(), + test_ciphertext->cbegin())); + + // Now obtain an encryptor with a compatibility option. + Encryptor encryptor_compat = + GetInstanceSync(factory, Encryptor::Option::kEncryptSyncCompat); + blah_ciphertext = encryptor_compat.EncryptString("secrets"); + ASSERT_TRUE(blah_ciphertext); + // Should be encrypted with BLAH now. + EXPECT_TRUE(std::equal(kBLAHProviderName.cbegin(), kBLAHProviderName.cend(), + blah_ciphertext->cbegin())); + } + // Check that with just BLAH provider, data can still be decrypted. + { + ProviderList providers; + providers.emplace_back( + /*precedence=*/5u, + std::make_unique<TestKeyProvider>(kBLAHProviderName, + /*use_for_encryption=*/false)); + OSCryptAsync factory(std::move(providers)); + Encryptor encryptor = GetInstanceSync(factory); + + auto plaintext = encryptor.DecryptData(*blah_ciphertext); + // The correct provider based on the encrypted data header should have been + // picked for data decryption. + ASSERT_TRUE(plaintext); + EXPECT_EQ("secrets", *plaintext); + + // The first data that was encrypted with v20 cannot be decrypted. + auto failing_plaintext = encryptor.DecryptData(*test_ciphertext); + EXPECT_TRUE( + MaybeVerifyFailedDecryptOperation(failing_plaintext, *test_ciphertext)); + } + // Test also that if there are multiple key providers with + // compatible_with_os_crypt_sync then the highest precedence is picked. + { + ProviderList providers; + providers.emplace_back(/*precedence=*/10u, + std::make_unique<TestKeyProvider>( + kTESTProviderName, /*use_for_encryption=*/true, + /*compatible_with_os_crypt_sync=*/true)); + providers.emplace_back(/*precedence=*/8u, + std::make_unique<TestKeyProvider>( + "FOO", /*use_for_encryption=*/true, + /*compatible_with_os_crypt_sync=*/false)); + providers.emplace_back(/*precedence=*/5u, + std::make_unique<TestKeyProvider>( + "BAR", /*use_for_encryption=*/true, + /*compatible_with_os_crypt_sync=*/true)); + OSCryptAsync factory(std::move(providers)); + Encryptor encryptor = + GetInstanceSync(factory, Encryptor::Option::kEncryptSyncCompat); + const auto ciphertext = encryptor.EncryptString("secrets"); + ASSERT_TRUE(ciphertext); + // Should be encrypted with TEST - it's the highest precedence provider + // that indicates it's compatible with OSCrypt sync. + EXPECT_TRUE(std::equal(kTESTProviderName.cbegin(), kTESTProviderName.cend(), + ciphertext->cbegin())); + } + // Just in case, test that order doesn't matter here, although this is also + // tested elsewhere. + { + ProviderList providers; + providers.emplace_back(/*precedence=*/5u, + std::make_unique<TestKeyProvider>( + "BAR", /*use_for_encryption=*/true, + /*compatible_with_os_crypt_sync=*/true)); + providers.emplace_back(/*precedence=*/8u, + std::make_unique<TestKeyProvider>( + "FOO", /*use_for_encryption=*/true, + /*compatible_with_os_crypt_sync=*/false)); + providers.emplace_back(/*precedence=*/10u, + std::make_unique<TestKeyProvider>( + kTESTProviderName, /*use_for_encryption=*/true, + /*compatible_with_os_crypt_sync=*/true)); + OSCryptAsync factory(std::move(providers)); + Encryptor encryptor = + GetInstanceSync(factory, Encryptor::Option::kEncryptSyncCompat); + const auto ciphertext = encryptor.EncryptString("secrets"); + ASSERT_TRUE(ciphertext); + // Should be encrypted with TEST - it's the highest precedence provider + // that indicates it's compatible with OSCrypt sync. + EXPECT_TRUE(std::equal(kTESTProviderName.cbegin(), kTESTProviderName.cend(), + ciphertext->cbegin())); + } +} + class SlowTestKeyProvider : public TestKeyProvider { public: - explicit SlowTestKeyProvider(base::TimeDelta sleep_time) - : sleep_time_(sleep_time) {} + explicit SlowTestKeyProvider(base::TimeDelta sleep_time) {} private: void GetKey(KeyCallback callback) override {
diff --git a/components/os_crypt/async/browser/test_utils.cc b/components/os_crypt/async/browser/test_utils.cc index c2441fb..1db0f2e 100644 --- a/components/os_crypt/async/browser/test_utils.cc +++ b/components/os_crypt/async/browser/test_utils.cc
@@ -23,8 +23,9 @@ encryptor_(GetTestEncryptorForTesting()) {} [[nodiscard]] base::CallbackListSubscription GetInstance( - InitCallback callback) override { - std::move(callback).Run(encryptor_.Clone(), true); + InitCallback callback, + Encryptor::Option option) override { + std::move(callback).Run(encryptor_.Clone(option), true); return base::CallbackListSubscription(); }
diff --git a/components/os_crypt/async/common/encryptor.cc b/components/os_crypt/async/common/encryptor.cc index c0351867..7421d37 100644 --- a/components/os_crypt/async/common/encryptor.cc +++ b/components/os_crypt/async/common/encryptor.cc
@@ -48,7 +48,9 @@ Encryptor::Key::~Key() = default; Encryptor::Key Encryptor::Key::Clone() const { - return Key(key_, *algorithm_); + Encryptor::Key key(key_, *algorithm_); + key.is_os_crypt_sync_compatible_ = is_os_crypt_sync_compatible_; + return key; } Encryptor::Encryptor() = default; @@ -198,13 +200,29 @@ return std::nullopt; } -Encryptor Encryptor::Clone() const { +Encryptor Encryptor::Clone(Option option) const { KeyRing keyring; for (const auto& [provider, key] : keys_) { keyring.emplace(provider, key.Clone()); } + std::string provider_for_encryption = provider_for_encryption_; - return Encryptor(std::move(keyring), provider_for_encryption_); + switch (option) { + case Option::kNone: + break; + case Option::kEncryptSyncCompat: + for (const auto& [provider, key] : keyring) { + if (key.is_os_crypt_sync_compatible_) { + // Keys are already sorted by precedence, so if multiple keys are + // compatible, the one with the highest precedence (later in the + // keyring) is picked. + provider_for_encryption = provider; + } + } + break; + } + + return Encryptor(std::move(keyring), provider_for_encryption); } } // namespace os_crypt_async
diff --git a/components/os_crypt/async/common/encryptor.h b/components/os_crypt/async/common/encryptor.h index 23988366..618f5a4 100644 --- a/components/os_crypt/async/common/encryptor.h +++ b/components/os_crypt/async/common/encryptor.h
@@ -63,6 +63,7 @@ friend class Encryptor; // OSCryptAsync and tests need to be able to Clone() keys. friend class OSCryptAsync; + friend class EncryptorTestBase; friend struct mojo::StructTraits<os_crypt_async::mojom::KeyDataView, os_crypt_async::Encryptor::Key>; FRIEND_TEST_ALL_PREFIXES(EncryptorTestBase, MultipleKeys); @@ -78,6 +79,18 @@ // being serialized to/from mojo. std::optional<mojom::Algorithm> algorithm_; std::vector<uint8_t> key_; + bool is_os_crypt_sync_compatible_ = false; + }; + + enum class Option { + // No Encryptor options. + kNone = 0, + // Indicates that the Encryptor returned should be data-compatible with + // OSCrypt Sync for both Encrypt and Decrypt operations. Note that Decrypt + // operations are always backwards compatible with previous Encrypt + // operations from OSCrypt Sync even if no option is specified: this option + // only affects the behavior of Encrypt operations. + kEncryptSyncCompat = 1, }; using KeyRing = std::map</*tag=*/std::string, Key>; @@ -119,6 +132,7 @@ os_crypt_async::Encryptor>; FRIEND_TEST_ALL_PREFIXES(EncryptorTraitsTest, TraitsRoundTrip); + FRIEND_TEST_ALL_PREFIXES(EncryptorTestBase, Clone); // Create an encryptor with no keys or encryption provider. In this case, all // encryption operations will be delegated to OSCrypt. @@ -129,8 +143,8 @@ // corresponding key in `keys`. Encryptor(KeyRing keys, const std::string& provider_for_encryption); - // Clone is used by the factory to vend instances. - Encryptor Clone() const; + // Clone is used internally by the factory to vend instances. + Encryptor Clone(Option option) const; // A KeyRing consists of a set of provider names and Key values. Encrypted // data is always tagged with the provider name and this is used to look up
diff --git a/components/os_crypt/async/common/encryptor_unittest.cc b/components/os_crypt/async/common/encryptor_unittest.cc index adca946..a32ef055 100644 --- a/components/os_crypt/async/common/encryptor_unittest.cc +++ b/components/os_crypt/async/common/encryptor_unittest.cc
@@ -61,10 +61,10 @@ } #endif // BUILDFLAG(IS_WIN) -// Helper function to verify that decryption using OSCrypt worked. This is +// Helper function to verify that decryption using OSCrypt failed. This is // platform dependent, as Windows will fail, but other platforms will return the // ciphertext back. -[[nodiscard]] bool MaybeVerifyDecryptOperation( +[[nodiscard]] bool MaybeVerifyFailedDecryptOperation( const std::optional<std::string>& decrypted, base::span<const uint8_t> ciphertext) { #if BUILDFLAG(IS_WIN) @@ -119,10 +119,12 @@ return crypto::RandBytesAsVector(length); } - static Encryptor::Key GenerateRandomAES256TestKey() { - return Encryptor::Key( - GenerateRandomTestKey(Encryptor::Key::kAES256GCMKeySize), - mojom::Algorithm::kAES256GCM); + static Encryptor::Key GenerateRandomAES256TestKey( + bool is_os_crypt_sync_compatible = false) { + Encryptor::Key key(GenerateRandomTestKey(Encryptor::Key::kAES256GCMKeySize), + mojom::Algorithm::kAES256GCM); + key.is_os_crypt_sync_compatible_ = is_os_crypt_sync_compatible; + return key; } }; @@ -350,7 +352,7 @@ key_ring_bar.emplace("BAR", bar_key.Clone()); const Encryptor encryptor = GetEncryptor(std::move(key_ring_bar), "BAR"); auto decrypted = encryptor.DecryptData(*ciphertext); - EXPECT_TRUE(MaybeVerifyDecryptOperation(decrypted, *ciphertext)); + EXPECT_TRUE(MaybeVerifyFailedDecryptOperation(decrypted, *ciphertext)); } // Verify that order of keys in the keyring does not matter. @@ -391,7 +393,7 @@ { const Encryptor encryptor = GetEncryptor(); auto decrypted = encryptor.DecryptData(*ciphertext); - EXPECT_TRUE(MaybeVerifyDecryptOperation(decrypted, *ciphertext)); + EXPECT_TRUE(MaybeVerifyFailedDecryptOperation(decrypted, *ciphertext)); } } @@ -425,7 +427,7 @@ bad_data += "a"; auto decrypted = encryptor.DecryptData(base::as_bytes(base::make_span(bad_data))); - EXPECT_TRUE(MaybeVerifyDecryptOperation( + EXPECT_TRUE(MaybeVerifyFailedDecryptOperation( decrypted, base::as_bytes(base::make_span(bad_data)))); } } @@ -520,6 +522,49 @@ #endif // BUILDFLAG(IS_WIN) +// Test that Clone respects the option to a key that is os_crypt sync +// compatible. +TEST_F(EncryptorTestBase, Clone) { + { + Encryptor::KeyRing key_ring; + key_ring.emplace("BLAH", GenerateRandomAES256TestKey( + /*is_os_crypt_sync_compatible=*/true)); + key_ring.emplace("TEST", GenerateRandomAES256TestKey()); + auto encryptor = GetEncryptor(std::move(key_ring), "TEST"); + EXPECT_EQ(encryptor.provider_for_encryption_, "TEST"); + + { + auto cloned_encryptor = encryptor.Clone(Encryptor::Option::kNone); + EXPECT_EQ(cloned_encryptor.provider_for_encryption_, "TEST"); + EXPECT_EQ(cloned_encryptor.keys_.size(), 2u); + } + + { + auto cloned_encryptor = + encryptor.Clone(Encryptor::Option::kEncryptSyncCompat); + EXPECT_EQ(cloned_encryptor.provider_for_encryption_, "BLAH"); + EXPECT_EQ(cloned_encryptor.keys_.size(), 2u); + } + } + + // Test empty keyring. + { + const auto empty_encryptor = GetEncryptor(); + EXPECT_TRUE(empty_encryptor.provider_for_encryption_.empty()); + { + auto cloned_encryptor = + empty_encryptor.Clone(Encryptor::Option::kEncryptSyncCompat); + EXPECT_TRUE(cloned_encryptor.provider_for_encryption_.empty()); + } + + { + auto cloned_encryptor = + empty_encryptor.Clone(Encryptor::Option::kEncryptSyncCompat); + EXPECT_TRUE(cloned_encryptor.provider_for_encryption_.empty()); + } + } +} + class EncryptorTraitsTest : public EncryptorTestBase {}; TEST_F(EncryptorTraitsTest, TraitsRoundTrip) {
diff --git a/components/password_manager/core/browser/buildflags.gni b/components/password_manager/core/browser/buildflags.gni index 2ee4df37..2f10c4a 100644 --- a/components/password_manager/core/browser/buildflags.gni +++ b/components/password_manager/core/browser/buildflags.gni
@@ -5,15 +5,14 @@ import("//build/config/android/config.gni") import("//build/config/chrome_build.gni") -# The legacy password store backend is supported on android but usually disabled -# in favor of a downstream implementation. -if(is_android) { - use_login_database_as_backend = !enable_chrome_android_internal -} else { - use_login_database_as_backend = 1 +declare_args() { + # The legacy password store backend is supported on android but usually disabled + # in favor of a downstream implementation. Important: the support for this flag + # is planned to be removed in November 2024. + use_login_database_as_backend = !is_android } # Drawables from the downstream clank/ repository are # used for branded builds. password_manager_use_internal_android_resources = - is_android && enable_chrome_android_internal && is_chrome_branded \ No newline at end of file + is_android && enable_chrome_android_internal && is_chrome_branded
diff --git a/components/password_manager/core/browser/ui/saved_passwords_presenter.cc b/components/password_manager/core/browser/ui/saved_passwords_presenter.cc index 90d6aba..65e207e 100644 --- a/components/password_manager/core/browser/ui/saved_passwords_presenter.cc +++ b/components/password_manager/core/browser/ui/saved_passwords_presenter.cc
@@ -111,9 +111,7 @@ undo_helper_(std::make_unique<PasswordUndoHelper>(profile_store_.get(), account_store_.get())), passwords_grouper_( - std::make_unique<PasswordsGrouper>(affiliation_service)) { - DCHECK(profile_store_); -} + std::make_unique<PasswordsGrouper>(affiliation_service)) {} SavedPasswordsPresenter::~SavedPasswordsPresenter() = default; @@ -122,6 +120,11 @@ sort_key_to_password_forms_.clear(); passwords_grouper_->ClearCache(); + // Password store is not supported in some configurations. + if (profile_store_ == nullptr) { + return; + } + profile_store_observation_.Observe(profile_store_.get()); if (account_store_) { account_store_observation_.Observe(account_store_.get());
diff --git a/components/policy/core/browser/url_blocklist_manager_unittest.cc b/components/policy/core/browser/url_blocklist_manager_unittest.cc index 00cf114..fadb4c18 100644 --- a/components/policy/core/browser/url_blocklist_manager_unittest.cc +++ b/components/policy/core/browser/url_blocklist_manager_unittest.cc
@@ -5,6 +5,7 @@ #include "components/policy/core/browser/url_blocklist_manager.h" #include <stdint.h> + #include <memory> #include <ostream> #include <utility> @@ -13,6 +14,7 @@ #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/run_loop.h" +#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/values.h" #include "build/build_config.h" @@ -24,6 +26,7 @@ #include "net/base/load_flags.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" +#include "url/url_features.h" namespace policy { @@ -165,7 +168,32 @@ EXPECT_EQ(1, blocklist_manager_->update_called()); } -TEST_F(URLBlocklistManagerTest, Filtering) { +// Non-special URLs behavior is affected by the +// StandardCompliantNonSpecialSchemeURLParsing feature. +// See https://crbug.com/40063064 for details. +class URLBlocklistManagerParamTest + : public URLBlocklistManagerTest, + public ::testing::WithParamInterface<bool> { + public: + URLBlocklistManagerParamTest() + : use_standard_compliant_non_special_scheme_url_parsing_(GetParam()) { + if (use_standard_compliant_non_special_scheme_url_parsing_) { + scoped_feature_list_.InitAndEnableFeature( + url::kStandardCompliantNonSpecialSchemeURLParsing); + } else { + scoped_feature_list_.InitAndDisableFeature( + url::kStandardCompliantNonSpecialSchemeURLParsing); + } + } + + protected: + bool use_standard_compliant_non_special_scheme_url_parsing_; + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +TEST_P(URLBlocklistManagerParamTest, Filtering) { URLBlocklist blocklist; // Block domain and all subdomains, for any filtered scheme. @@ -173,7 +201,13 @@ EXPECT_TRUE(IsMatch("google.com", "http://google.com/")); EXPECT_TRUE(IsMatch("google.com", "http://google.com/whatever")); EXPECT_TRUE(IsMatch("google.com", "https://google.com/")); - EXPECT_FALSE(IsMatch("google.com", "bogus://google.com/")); + if (use_standard_compliant_non_special_scheme_url_parsing_) { + // When the feature is enabled, the host part in non-special URLs can be + // recognized. + EXPECT_TRUE(IsMatch("google.com", "bogus://google.com/")); + } else { + EXPECT_FALSE(IsMatch("google.com", "bogus://google.com/")); + } EXPECT_FALSE(IsMatch("google.com", "http://notgoogle.com/")); EXPECT_TRUE(IsMatch("google.com", "http://mail.google.com")); EXPECT_TRUE(IsMatch("google.com", "http://x.mail.google.com")); @@ -472,7 +506,7 @@ EXPECT_FALSE(blocklist.IsURLBlocked(GURL("https://very.safe/path"))); } -TEST_F(URLBlocklistManagerTest, DefaultBlocklistExceptions) { +TEST_P(URLBlocklistManagerParamTest, DefaultBlocklistExceptions) { URLBlocklist blocklist; base::Value::List blocked; @@ -493,8 +527,14 @@ // "about:newtab" as its URL which is not recognized and filtered by the // URLBlocklist code. EXPECT_FALSE(blocklist.IsURLBlocked(GURL("about:newtab"))); - EXPECT_FALSE(blocklist.IsURLBlocked(GURL("about://newtab/"))); EXPECT_FALSE(blocklist.IsURLBlocked(GURL("chrome://newtab"))); + if (use_standard_compliant_non_special_scheme_url_parsing_) { + // When the feature is enabled, the host part in non-special URLs can be + // recognized. + EXPECT_TRUE(blocklist.IsURLBlocked(GURL("about://newtab/"))); + } else { + EXPECT_FALSE(blocklist.IsURLBlocked(GURL("about://newtab/"))); + } #endif // Unless they are explicitly on the blocklist: @@ -512,7 +552,7 @@ EXPECT_FALSE(blocklist.IsURLBlocked(GURL("chrome-native://ntp"))); } -TEST_F(URLBlocklistManagerTest, BlocklistBasicCoverage) { +TEST_P(URLBlocklistManagerParamTest, BlocklistBasicCoverage) { // Tests to cover the documentation from // http://www.chromium.org/administrators/url-blocklist-filter-format @@ -548,12 +588,21 @@ EXPECT_TRUE(IsMatch("example.com", "wss://example.com")); // Some schemes are not matched when the scheme is ommitted. - EXPECT_FALSE(IsMatch("example.com", "about://example.com")); EXPECT_FALSE(IsMatch("example.com", "about:example.com")); EXPECT_FALSE(IsMatch("example.com/*", "filesystem:///something")); - EXPECT_FALSE(IsMatch("example.com", "custom://example.com")); - EXPECT_FALSE(IsMatch("example", "custom://example")); - EXPECT_FALSE(IsMatch("example.com", "gopher://example.com")); + if (use_standard_compliant_non_special_scheme_url_parsing_) { + // When the feature is enabled, the host part in non-special URLs can be + // recognized. + EXPECT_TRUE(IsMatch("example.com", "about://example.com")); + EXPECT_TRUE(IsMatch("example.com", "custom://example.com")); + EXPECT_TRUE(IsMatch("example", "custom://example")); + EXPECT_TRUE(IsMatch("example.com", "gopher://example.com")); + } else { + EXPECT_FALSE(IsMatch("example.com", "about://example.com")); + EXPECT_FALSE(IsMatch("example.com", "about:example.com")); + EXPECT_FALSE(IsMatch("example", "custom://example")); + EXPECT_FALSE(IsMatch("example.com", "gopher://example.com")); + } // An optional '.' (dot) can prefix the host field to disable subdomain // matching, see below for details. @@ -627,6 +676,8 @@ EXPECT_FALSE(IsMatch("host/path?Query=1", "http://host/path?query=1")); } +INSTANTIATE_TEST_SUITE_P(All, URLBlocklistManagerParamTest, ::testing::Bool()); + // Test for GetURLBlocklistState method. TEST_F(URLBlocklistManagerTest, UseBlocklistState) { const policy::URLBlocklist::URLBlocklistState in_blocklist =
diff --git a/components/policy/resources/templates/policy_definitions/Miscellaneous/GlanceablesEnabled.yaml b/components/policy/resources/templates/policy_definitions/Miscellaneous/GlanceablesEnabled.yaml index 85b621636..a5ae7003 100644 --- a/components/policy/resources/templates/policy_definitions/Miscellaneous/GlanceablesEnabled.yaml +++ b/components/policy/resources/templates/policy_definitions/Miscellaneous/GlanceablesEnabled.yaml
@@ -1,4 +1,5 @@ caption: Glanceables on <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph> +deprecated: true default: true default_for_enterprise_users: false desc: |- @@ -22,6 +23,6 @@ schema: type: boolean supported_on: -- chrome_os:118- +- chrome_os:118-124 tags: [] -type: main \ No newline at end of file +type: main
diff --git a/components/policy/test/data/pref_mapping/GlanceablesEnabled.json b/components/policy/test/data/pref_mapping/GlanceablesEnabled.json deleted file mode 100644 index 1c43061..0000000 --- a/components/policy/test/data/pref_mapping/GlanceablesEnabled.json +++ /dev/null
@@ -1,40 +0,0 @@ -[ - { - "os": [ - "chromeos_ash" - ], - "policy_pref_mapping_tests": [ - { - "note": "Check default values (no policies set)", - "policies": {}, - "prefs": { - "ash.glanceables_enabled": { - "value": false - } - } - }, - { - "note": "Check true policy value", - "policies": { - "GlanceablesEnabled": true - }, - "prefs": { - "ash.glanceables_enabled": { - "value": true - } - } - }, - { - "note": "Check false policy value", - "policies": { - "GlanceablesEnabled": false - }, - "prefs": { - "ash.glanceables_enabled": { - "value": false - } - } - } - ] - } -]
diff --git a/components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations_unittest.cc b/components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations_unittest.cc index e465560..67cc25f 100644 --- a/components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations_unittest.cc +++ b/components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations_unittest.cc
@@ -138,7 +138,7 @@ startup_metric_utils::GetBrowser().ResetSessionForTesting(); } - bool IsAttestationsDefaultAllowed() { return IsParamFeatureEnabled(); } + bool IsAttestationsDefaultAllowed() const { return IsParamFeatureEnabled(); } // Return the final expected status of `IsSiteAttested` given the `status` // which represents the actual status of the attestation. @@ -743,7 +743,7 @@ /*disabled_features=*/{kDefaultAllowPrivacySandboxAttestations}); } - bool IsSentinelGuardEnabled() { return IsParamFeatureEnabled(); } + bool IsSentinelGuardEnabled() const { return IsParamFeatureEnabled(); } private: base::test::ScopedFeatureList scoped_feature_list_;
diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl_unittest.cc b/components/privacy_sandbox/privacy_sandbox_settings_impl_unittest.cc index 7372af9..ddabae5 100644 --- a/components/privacy_sandbox/privacy_sandbox_settings_impl_unittest.cc +++ b/components/privacy_sandbox/privacy_sandbox_settings_impl_unittest.cc
@@ -1511,7 +1511,7 @@ ->SetAllPrivacySandboxAttestedForTesting(false); } - bool IsAttestationsDefaultAllowed() { return IsParamFeatureEnabled(); } + bool IsAttestationsDefaultAllowed() const { return IsParamFeatureEnabled(); } }; // When the attestations map has not yet been downloaded, or the browser hasn't
diff --git a/components/safe_browsing/core/browser/hashprefix_realtime/BUILD.gn b/components/safe_browsing/core/browser/hashprefix_realtime/BUILD.gn index 3e43a23..ecc48a6 100644 --- a/components/safe_browsing/core/browser/hashprefix_realtime/BUILD.gn +++ b/components/safe_browsing/core/browser/hashprefix_realtime/BUILD.gn
@@ -63,6 +63,7 @@ "//components/safe_browsing/core/common/hashprefix_realtime:hash_realtime_utils", "//components/safe_browsing/core/common/proto:safebrowsingv5_proto", "//components/sync_preferences:test_support", + "//components/variations", "//google_apis:google_apis", "//services/network:test_support", "//testing/gtest",
diff --git a/components/safe_browsing/core/browser/hashprefix_realtime/hash_realtime_service_unittest.cc b/components/safe_browsing/core/browser/hashprefix_realtime/hash_realtime_service_unittest.cc index 07cfd34..eb22aaa 100644 --- a/components/safe_browsing/core/browser/hashprefix_realtime/hash_realtime_service_unittest.cc +++ b/components/safe_browsing/core/browser/hashprefix_realtime/hash_realtime_service_unittest.cc
@@ -132,9 +132,10 @@ TestOhttpKeyService() : OhttpKeyService(/*url_loader_factory=*/nullptr, /*pref_service=*/nullptr, - /*stored_permanent_country_getter=*/ - base::BindRepeating( - &TestOhttpKeyService::GetStoredPermanentCountry)) {} + /*local_state=*/nullptr, + /*country_getter=*/ + base::BindRepeating(&TestOhttpKeyService::GetCountry)) { + } void GetOhttpKey(OhttpKeyService::Callback callback) override { std::move(callback).Run(ohttp_key_); @@ -151,9 +152,7 @@ lookup_response_notified_ = true; } - static std::optional<std::string> GetStoredPermanentCountry() { - return std::nullopt; - } + static std::optional<std::string> GetCountry() { return std::nullopt; } bool lookup_response_notified() { return lookup_response_notified_; }
diff --git a/components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service.cc b/components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service.cc index 379d481a..396d08f 100644 --- a/components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service.cc +++ b/components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service.cc
@@ -109,15 +109,12 @@ "default." )"); -bool IsEnabled(PrefService* pref_service, - std::optional<std::string> stored_permanent_country) { +bool IsEnabled(PrefService* pref_service, std::optional<std::string> country) { // If this class has been created, it is already known that the session is not // off-the-record, so |is_off_the_record| is passed through as false. - // |latest_country| is passed through as null because it is not used. return safe_browsing::hash_realtime_utils::DetermineHashRealTimeSelection( /*is_off_the_record=*/false, pref_service, - /*stored_permanent_country=*/stored_permanent_country, - /*latest_country=*/std::nullopt) == + /*latest_country=*/country) == safe_browsing::hash_realtime_utils::HashRealTimeSelection:: kHashRealTimeService; } @@ -138,8 +135,8 @@ OhttpKeyService::OhttpKeyService( scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, PrefService* pref_service, - base::RepeatingCallback<std::optional<std::string>()> - stored_permanent_country_getter) + PrefService* local_state, + base::RepeatingCallback<std::optional<std::string>()> country_getter) : url_loader_factory_(url_loader_factory), pref_service_(pref_service), backoff_operator_(std::make_unique<BackoffOperator>( @@ -148,7 +145,7 @@ kMinBackOffResetDurationInSeconds, /*max_backoff_reset_duration_in_seconds=*/ kMaxBackOffResetDurationInSeconds)), - stored_permanent_country_getter_(stored_permanent_country_getter) { + country_getter_(country_getter) { // |pref_service_| can be null in tests. if (!pref_service_) { return; @@ -156,21 +153,30 @@ PopulateKeyFromPref(); + hash_realtime_utils::HashRealTimeSelectionConfiguringPrefs configuring_prefs = + hash_realtime_utils::GetHashRealTimeSelectionConfiguringPrefs(); + // Set up listener for profile prefs. pref_change_registrar_.Init(pref_service_); - for (const char* pref : - hash_realtime_utils::GetHashRealTimeSelectionConfiguringPrefs()) { + for (const char* pref : configuring_prefs.profile_prefs) { pref_change_registrar_.Add( pref, base::BindRepeating(&OhttpKeyService::OnConfiguringPrefsChanged, weak_factory_.GetWeakPtr())); } + // Set up listener for local state prefs. + local_state_pref_change_registrar_.Init(local_state); + for (const char* pref : configuring_prefs.local_state_prefs) { + local_state_pref_change_registrar_.Add( + pref, base::BindRepeating(&OhttpKeyService::OnConfiguringPrefsChanged, + weak_factory_.GetWeakPtr())); + } - SetEnabled(IsEnabled(pref_service_, stored_permanent_country_getter_.Run())); + SetEnabled(IsEnabled(pref_service_, country_getter_.Run())); } OhttpKeyService::~OhttpKeyService() = default; void OhttpKeyService::OnConfiguringPrefsChanged() { - SetEnabled(IsEnabled(pref_service_, stored_permanent_country_getter_.Run())); + SetEnabled(IsEnabled(pref_service_, country_getter_.Run())); } void OhttpKeyService::SetEnabled(bool enable) { @@ -193,8 +199,7 @@ void OhttpKeyService::GetOhttpKey(Callback callback) { base::UmaHistogramBoolean( "SafeBrowsing.HPRT.OhttpKeyService.IsEnabledFreshnessOnKeyFetch", - enabled_ == - IsEnabled(pref_service_, stored_permanent_country_getter_.Run())); + enabled_ == IsEnabled(pref_service_, country_getter_.Run())); if (!enabled_) { std::move(callback).Run(std::nullopt); return; @@ -400,6 +405,7 @@ url_loader_.reset(); pending_callbacks_.Notify(std::nullopt); pref_change_registrar_.RemoveAll(); + local_state_pref_change_registrar_.RemoveAll(); async_fetch_timer_.Stop(); }
diff --git a/components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service.h b/components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service.h index fdfe0f4..6e336def 100644 --- a/components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service.h +++ b/components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service.h
@@ -65,8 +65,8 @@ OhttpKeyService( scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, PrefService* pref_service, - base::RepeatingCallback<std::optional<std::string>()> - stored_permanent_country_getter); + PrefService* local_state, + base::RepeatingCallback<std::optional<std::string>()> country_getter); OhttpKeyService(const OhttpKeyService&) = delete; OhttpKeyService& operator=(const OhttpKeyService&) = delete; @@ -158,9 +158,14 @@ // the OHTTP key service. raw_ptr<PrefService> pref_service_; - // Observes changes prefs that configure whether the service is enabled. + // Observes changes to profile prefs that configure whether the service is + // enabled. PrefChangeRegistrar pref_change_registrar_; + // Observes changes to local state prefs that configure whether the service is + // enabled. + PrefChangeRegistrar local_state_pref_change_registrar_; + // Keeps track of the state of the service. It's enabled when standard // protection is on and the policy kHashPrefixRealTimeChecksAllowedByPolicy // isn't disabled. @@ -177,8 +182,7 @@ std::unique_ptr<BackoffOperator> backoff_operator_; // Callback used to help determine if the service should be enabled. - base::RepeatingCallback<std::optional<std::string>()> - stored_permanent_country_getter_; + base::RepeatingCallback<std::optional<std::string>()> country_getter_; base::WeakPtrFactory<OhttpKeyService> weak_factory_{this}; };
diff --git a/components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service_unittest.cc b/components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service_unittest.cc index 61c5895c..8bd99cf 100644 --- a/components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service_unittest.cc +++ b/components/safe_browsing/core/browser/hashprefix_realtime/ohttp_key_service_unittest.cc
@@ -20,6 +20,7 @@ #include "components/safe_browsing/core/common/features.h" #include "components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h" #include "components/safe_browsing/core/common/safe_browsing_prefs.h" +#include "components/variations/pref_names.h" #include "google_apis/google_api_keys.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" @@ -62,13 +63,15 @@ feature_list_.InitAndDisableFeature(kHashPrefixRealTimeLookups); } RegisterProfilePrefs(pref_service_.registry()); + local_state_.registry()->RegisterStringPref( + variations::prefs::kVariationsCountry, std::string()); test_url_loader_factory_ = std::make_unique<network::TestURLLoaderFactory>(); test_shared_loader_factory_ = test_url_loader_factory_->GetSafeWeakWrapper(); ohttp_key_service_ = std::make_unique<OhttpKeyService>( - test_shared_loader_factory_, &pref_service_, - base::BindRepeating(&OhttpKeyServiceTest::GetStoredPermanentCountry, + test_shared_loader_factory_, &pref_service_, &local_state_, + base::BindRepeating(&OhttpKeyServiceTest::GetCountry, base::Unretained(this))); std::string key = google_apis::GetAPIKey(); key_param_ = @@ -80,9 +83,7 @@ void TearDown() override { ohttp_key_service_->Shutdown(); } - std::optional<std::string> GetStoredPermanentCountry() { - return stored_permanent_country_; - } + std::optional<std::string> GetCountry() { return country_; } protected: std::string GetExpectedKeyFetchServerUrl() { @@ -128,9 +129,10 @@ std::unique_ptr<network::TestURLLoaderFactory> test_url_loader_factory_; scoped_refptr<network::SharedURLLoaderFactory> test_shared_loader_factory_; TestingPrefServiceSimple pref_service_; + TestingPrefServiceSimple local_state_; std::string key_param_; base::HistogramTester histogram_tester_; - std::optional<std::string> stored_permanent_country_; + std::optional<std::string> country_; bool is_feature_enabled_ = true; private: @@ -144,7 +146,7 @@ class OhttpKeyServiceLocationDisabledTest : public OhttpKeyServiceTest { public: - OhttpKeyServiceLocationDisabledTest() { stored_permanent_country_ = "cn"; } + OhttpKeyServiceLocationDisabledTest() { country_ = "cn"; } }; TEST_F(OhttpKeyServiceTest, GetOhttpKey_Success) { @@ -305,7 +307,7 @@ histogram_tester_.ExpectTotalCount( "SafeBrowsing.HPRT.OhttpKeyService.IsEnabledFreshnessOnKeyFetch", 1); - stored_permanent_country_ = std::nullopt; + country_ = std::nullopt; base::MockCallback<OhttpKeyService::Callback> response_callback2; EXPECT_CALL(response_callback2, Run(Eq(std::nullopt))).Times(1); @@ -326,8 +328,8 @@ base::Time::Now() + base::Days(10)); auto ohttp_key_service = std::make_unique<OhttpKeyService>( - test_shared_loader_factory_, &pref_service_, - base::BindRepeating(&OhttpKeyServiceTest::GetStoredPermanentCountry, + test_shared_loader_factory_, &pref_service_, &local_state_, + base::BindRepeating(&OhttpKeyServiceTest::GetCountry, base::Unretained(this))); std::optional<OhttpKeyService::OhttpKeyAndExpiration> ohttp_key = @@ -340,8 +342,8 @@ base::Time::Now() - base::Days(10)); ohttp_key_service = std::make_unique<OhttpKeyService>( - test_shared_loader_factory_, &pref_service_, - base::BindRepeating(&OhttpKeyServiceTest::GetStoredPermanentCountry, + test_shared_loader_factory_, &pref_service_, &local_state_, + base::BindRepeating(&OhttpKeyServiceTest::GetCountry, base::Unretained(this))); ohttp_key = ohttp_key_service->get_ohttp_key_for_testing(); EXPECT_FALSE(ohttp_key.has_value()); @@ -352,8 +354,8 @@ base::Time::Now() + base::Days(10)); auto ohttp_key_service = std::make_unique<OhttpKeyService>( - test_shared_loader_factory_, &pref_service_, - base::BindRepeating(&OhttpKeyServiceTest::GetStoredPermanentCountry, + test_shared_loader_factory_, &pref_service_, &local_state_, + base::BindRepeating(&OhttpKeyServiceTest::GetCountry, base::Unretained(this))); std::optional<OhttpKeyService::OhttpKeyAndExpiration> ohttp_key = @@ -394,29 +396,29 @@ SetupSuccessResponse(); task_environment_.RunUntilIdle(); - auto original_expiration = base::Time::Now() + base::Days(7); + auto expiration1 = base::Time::Now() + base::Days(7); EXPECT_EQ(ohttp_key_service_->get_ohttp_key_for_testing()->expiration, - original_expiration); + expiration1); SetSafeBrowsingState(&pref_service_, SafeBrowsingState::NO_SAFE_BROWSING); task_environment_.FastForwardBy(base::Days(6)); task_environment_.RunUntilIdle(); // The expiration is not extended because the service is disabled. EXPECT_EQ(ohttp_key_service_->get_ohttp_key_for_testing()->expiration, - original_expiration); + expiration1); SetSafeBrowsingState(&pref_service_, SafeBrowsingState::ENHANCED_PROTECTION); task_environment_.FastForwardBy(base::Days(6)); task_environment_.RunUntilIdle(); EXPECT_EQ(ohttp_key_service_->get_ohttp_key_for_testing()->expiration, - original_expiration); + expiration1); - auto new_expiration = base::Time::Now() + base::Days(7); + auto expiration2 = base::Time::Now() + base::Days(7); SetSafeBrowsingState(&pref_service_, SafeBrowsingState::STANDARD_PROTECTION); task_environment_.RunUntilIdle(); // The service is re-enabled, so the expiration date is updated. EXPECT_EQ(ohttp_key_service_->get_ohttp_key_for_testing()->expiration, - new_expiration); + expiration2); pref_service_.SetBoolean(prefs::kHashPrefixRealTimeChecksAllowedByPolicy, false); @@ -424,13 +426,31 @@ task_environment_.RunUntilIdle(); // The expiration is not extended because the service is disabled. EXPECT_EQ(ohttp_key_service_->get_ohttp_key_for_testing()->expiration, - new_expiration); + expiration2); + auto expiration3 = base::Time::Now() + base::Days(7); pref_service_.SetBoolean(prefs::kHashPrefixRealTimeChecksAllowedByPolicy, true); task_environment_.RunUntilIdle(); // The service is re-enabled, so the expiration date is updated. EXPECT_EQ(ohttp_key_service_->get_ohttp_key_for_testing()->expiration, + expiration3); + + country_ = "cn"; + local_state_.SetString(variations::prefs::kVariationsCountry, + country_.value()); + task_environment_.FastForwardBy(base::Days(6)); + task_environment_.RunUntilIdle(); + // The expiration is not extended because the service is disabled. + EXPECT_EQ(ohttp_key_service_->get_ohttp_key_for_testing()->expiration, + expiration3); + + country_ = "us"; + local_state_.SetString(variations::prefs::kVariationsCountry, + country_.value()); + task_environment_.RunUntilIdle(); + // The service is re-enabled, so the expiration date is updated. + EXPECT_EQ(ohttp_key_service_->get_ohttp_key_for_testing()->expiration, base::Time::Now() + base::Days(7)); }
diff --git a/components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.cc b/components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.cc index 3be255a..f896150b 100644 --- a/components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.cc +++ b/components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.cc
@@ -81,30 +81,23 @@ base::FeatureList::IsEnabled(kHashPrefixRealTimeLookups); } bool IsHashRealTimeLookupEligibleInLocation( - std::optional<std::string> stored_permanent_country) { - return (!stored_permanent_country.has_value() || - !base::Contains(GetExcludedCountries(), - stored_permanent_country.value())); + std::optional<std::string> latest_country) { + return (!latest_country.has_value() || + !base::Contains(GetExcludedCountries(), latest_country.value())); } bool IsHashRealTimeLookupEligibleInSessionAndLocation( - std::optional<std::string> stored_permanent_country) { + std::optional<std::string> latest_country) { return IsHashRealTimeLookupEligibleInSession() && - IsHashRealTimeLookupEligibleInLocation(stored_permanent_country); + IsHashRealTimeLookupEligibleInLocation(latest_country); } std::optional<std::string> GetCountryCode( variations::VariationsService* variations_service) { - return variations_service ? variations_service->GetStoredPermanentCountry() - : std::optional<std::string>(); -} -std::optional<std::string> GetLatestCountryCode( - variations::VariationsService* variations_service) { return variations_service ? variations_service->GetLatestCountry() : std::optional<std::string>(); } HashRealTimeSelection DetermineHashRealTimeSelection( bool is_off_the_record, PrefService* prefs, - std::optional<std::string> stored_permanent_country, std::optional<std::string> latest_country, bool log_usage_histograms) { // All prefs used in this method must match the ones returned by @@ -116,7 +109,7 @@ } requirements[] = { {"IneligibleForSessionOrLocation", hash_realtime_utils::IsHashRealTimeLookupEligibleInSessionAndLocation( - stored_permanent_country)}, + latest_country)}, {"OffTheRecord", !is_off_the_record}, {"NotStandardProtection", safe_browsing::GetSafeBrowsingState(*prefs) == SafeBrowsingState::STANDARD_PROTECTION}, @@ -136,10 +129,6 @@ } if (log_usage_histograms) { base::UmaHistogramBoolean( - "SafeBrowsing.HPRT.WouldBeIneligibleForSessionOrLatestCountry", - !hash_realtime_utils::IsHashRealTimeLookupEligibleInSessionAndLocation( - latest_country)); - base::UmaHistogramBoolean( "SafeBrowsing.HPRT.Ineligible.NoGoogleChromeBranding", !HasGoogleChromeBranding()); base::UmaHistogramBoolean( @@ -147,7 +136,7 @@ !base::FeatureList::IsEnabled(kHashPrefixRealTimeLookups)); base::UmaHistogramBoolean( "SafeBrowsing.HPRT.Ineligible.IneligibleForLocation", - !IsHashRealTimeLookupEligibleInLocation(stored_permanent_country)); + !IsHashRealTimeLookupEligibleInLocation(latest_country)); } return can_do_lookup ? #if BUILDFLAG(IS_ANDROID) @@ -158,16 +147,17 @@ : HashRealTimeSelection::kNone; } -std::vector<const char*> GetHashRealTimeSelectionConfiguringPrefs() { - // |kVariationsPermanentOverriddenCountry| and - // |kVariationsPermanentConsistencyCountry| are used by - // |VariationsService::GetStoredPermanentCountry|. They are not expected to - // change mid-session, but it is harmless to add listeners for them in case - // they do. - return {prefs::kSafeBrowsingEnabled, prefs::kSafeBrowsingEnhanced, - prefs::kHashPrefixRealTimeChecksAllowedByPolicy, - variations::prefs::kVariationsPermanentOverriddenCountry, - variations::prefs::kVariationsPermanentConsistencyCountry}; +HashRealTimeSelectionConfiguringPrefs +GetHashRealTimeSelectionConfiguringPrefs() { + std::vector<const char*> profile_prefs = { + prefs::kSafeBrowsingEnabled, prefs::kSafeBrowsingEnhanced, + prefs::kHashPrefixRealTimeChecksAllowedByPolicy}; + // |kVariationsCountry| is used by |VariationsService::GetLatestCountry|. + std::vector<const char*> local_state_prefs = { + variations::prefs::kVariationsCountry}; + return HashRealTimeSelectionConfiguringPrefs( + /*profile_prefs=*/profile_prefs, + /*local_state_prefs=*/local_state_prefs); } GoogleChromeBrandingPretenderForTesting:: @@ -182,4 +172,12 @@ kPretendHasGoogleChromeBranding = false; } +HashRealTimeSelectionConfiguringPrefs::HashRealTimeSelectionConfiguringPrefs( + std::vector<const char*>& profile_prefs, + std::vector<const char*>& local_state_prefs) + : profile_prefs(profile_prefs), local_state_prefs(local_state_prefs) {} + +HashRealTimeSelectionConfiguringPrefs:: + ~HashRealTimeSelectionConfiguringPrefs() = default; + } // namespace safe_browsing::hash_realtime_utils
diff --git a/components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h b/components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h index 5b7ce22..091dbda 100644 --- a/components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h +++ b/components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h
@@ -56,6 +56,15 @@ void StopApplyingBranding(); }; +struct HashRealTimeSelectionConfiguringPrefs { + HashRealTimeSelectionConfiguringPrefs( + std::vector<const char*>& profile_prefs, + std::vector<const char*>& local_state_prefs); + ~HashRealTimeSelectionConfiguringPrefs(); + std::vector<const char*> profile_prefs; + std::vector<const char*> local_state_prefs; +}; + // Returns whether the |url| is eligible for hash-prefix real-time checks. // It's never eligible if the |request_destination| is not mainframe. bool CanCheckUrl(const GURL& url, @@ -77,44 +86,37 @@ // Based on the user's browser session and location, specifies whether // hash-prefix real-time lookups are eligible. Outside of tests, -// |stored_permanent_country| should be determined with the helper function +// |latest_country| should be determined with the helper function // |hash_realtime_utils::GetCountryCode|. If it's passed in as std::nullopt, // the location is considered eligible. bool IsHashRealTimeLookupEligibleInSessionAndLocation( - std::optional<std::string> stored_permanent_country); - -// Returns the stored permanent country. If |variations_service| is null, -// returns std::nullopt. This should be used only as a helper to determine the -// country code to pass into |IsHashRealTimeLookupEligibleInSessionAndLocation| -// and |DetermineHashRealTimeSelection|. This is separated out into a function -// to simplify tests. -std::optional<std::string> GetCountryCode( - variations::VariationsService* variations_service); + std::optional<std::string> latest_country); // Returns the latest country. If |variations_service| is null, returns -// std::nullopt. This is used for logging purposes only. -std::optional<std::string> GetLatestCountryCode( +// std::nullopt. This should be used only as a helper to determine the country +// code to pass into |IsHashRealTimeLookupEligibleInSessionAndLocation| and +// |DetermineHashRealTimeSelection|. This is separated out into a function +// to simplify tests. +std::optional<std::string> GetCountryCode( variations::VariationsService* variations_service); // Based on the user's settings and session, determines which hash-prefix // real-time lookup should be used, if any. If |log_usage_histograms| is true, // this will log metrics related to whether hash real-time lookups were -// available or why not. Outside of tests, |stored_permanent_country| should be +// available or why not. Outside of tests, |latest_country| should be // determined with the helper function |hash_realtime_utils::GetCountryCode|. // If it's passed in as std::nullopt, the location is considered eligible. -// |latest_country| is used for logging purposes only. It should be determined -// with the helper function |hash_realtime_utils::GetLatestCountryCode|. HashRealTimeSelection DetermineHashRealTimeSelection( bool is_off_the_record, PrefService* prefs, - std::optional<std::string> stored_permanent_country, std::optional<std::string> latest_country, bool log_usage_histograms = false); // A helper for consumers that want to recompute // |DetermineHashRealTimeSelection| when there are pref changes. This returns // all prefs that modify the outcome of that method. -std::vector<const char*> GetHashRealTimeSelectionConfiguringPrefs(); +HashRealTimeSelectionConfiguringPrefs +GetHashRealTimeSelectionConfiguringPrefs(); } // namespace safe_browsing::hash_realtime_utils
diff --git a/components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils_unittest.cc b/components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils_unittest.cc index d362e45..afe9fcf 100644 --- a/components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils_unittest.cc +++ b/components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils_unittest.cc
@@ -146,20 +146,20 @@ struct TestCase { bool is_feature_on = true; bool has_google_chrome_branding = true; - std::optional<std::string> stored_permanent_country = std::nullopt; + std::optional<std::string> latest_country = std::nullopt; bool expected_eligibility; } test_cases[] = { - // Lookups eligible when no country is provided. - {.expected_eligibility = true}, - // Lookups eligible for US. - {.stored_permanent_country = "us", .expected_eligibility = true}, - // Lookups ineligible for CN. - {.stored_permanent_country = "cn", .expected_eligibility = false}, - // Lookups ineligible when the feature is disabled. - {.is_feature_on = false, .expected_eligibility = false}, + // Lookups eligible when no country is provided. + {.expected_eligibility = true}, + // Lookups eligible for US. + {.latest_country = "us", .expected_eligibility = true}, + // Lookups ineligible for CN. + {.latest_country = "cn", .expected_eligibility = false}, + // Lookups ineligible when the feature is disabled. + {.is_feature_on = false, .expected_eligibility = false}, #if !BUILDFLAG(GOOGLE_CHROME_BRANDING) - // Lookups ineligible because it's not a branded build. - {.has_google_chrome_branding = false, .expected_eligibility = false}, + // Lookups ineligible because it's not a branded build. + {.has_google_chrome_branding = false, .expected_eligibility = false}, #endif }; @@ -176,7 +176,7 @@ } EXPECT_EQ( hash_realtime_utils::IsHashRealTimeLookupEligibleInSessionAndLocation( - test_case.stored_permanent_country), + test_case.latest_country), test_case.expected_eligibility); } } @@ -194,13 +194,11 @@ bool is_off_the_record = false; bool is_feature_on = true; bool has_google_chrome_branding = true; - std::optional<std::string> stored_permanent_country = std::nullopt; std::optional<std::string> latest_country = std::nullopt; std::optional<bool> lookups_allowed_by_policy = std::nullopt; hash_realtime_utils::HashRealTimeSelection expected_selection; bool expected_log_usage_histograms = true; bool expected_ineligible_for_session_or_location_log = false; - bool expected_would_be_ineligible_for_session_or_location_log = false; bool expected_off_the_record_log = false; bool expected_not_standard_protection_log = false; bool expected_not_allowed_by_policy_log = false; @@ -221,32 +219,18 @@ {.is_feature_on = false, .expected_selection = hash_realtime_utils::HashRealTimeSelection::kNone, .expected_ineligible_for_session_or_location_log = true, - .expected_would_be_ineligible_for_session_or_location_log = true, .expected_feature_off_log = true}, #if !BUILDFLAG(GOOGLE_CHROME_BRANDING) // Lookups disabled because it's not a branded build. {.has_google_chrome_branding = false, .expected_selection = hash_realtime_utils::HashRealTimeSelection::kNone, .expected_ineligible_for_session_or_location_log = true, - .expected_would_be_ineligible_for_session_or_location_log = true, .expected_no_google_chrome_branding_log = true}, #endif // Lookups allowed for US. - {.stored_permanent_country = "us", - .expected_selection = enabled_selection}, + {.latest_country = "us", .expected_selection = enabled_selection}, // Lookups disabled for CN. - {.stored_permanent_country = "cn", - .expected_selection = hash_realtime_utils::HashRealTimeSelection::kNone, - .expected_ineligible_for_session_or_location_log = true, - .expected_ineligible_for_location_log = true}, - // Latest country is for logging only so it does not make it ineligible. - {.stored_permanent_country = "us", - .latest_country = "cn", - .expected_selection = enabled_selection, - .expected_would_be_ineligible_for_session_or_location_log = true}, - // Latest country is for logging only so it does not make it eligible. - {.stored_permanent_country = "cn", - .latest_country = "us", + {.latest_country = "cn", .expected_selection = hash_realtime_utils::HashRealTimeSelection::kNone, .expected_ineligible_for_session_or_location_log = true, .expected_ineligible_for_location_log = true}, @@ -280,11 +264,6 @@ /*sample=*/test_case.expected_not_allowed_by_policy_log, /*expected_bucket_count=*/1); histogram_tester.ExpectUniqueSample( - /*name=*/"SafeBrowsing.HPRT.WouldBeIneligibleForSessionOrLatestCountry", - /*sample=*/ - test_case.expected_would_be_ineligible_for_session_or_location_log, - /*expected_bucket_count=*/1); - histogram_tester.ExpectUniqueSample( /*name=*/"SafeBrowsing.HPRT.Ineligible.NoGoogleChromeBranding", /*sample=*/test_case.expected_no_google_chrome_branding_log, /*expected_bucket_count=*/1); @@ -312,9 +291,6 @@ /*name=*/"SafeBrowsing.HPRT.Ineligible.NotAllowedByPolicy", /*expected_count=*/0); histogram_tester.ExpectTotalCount( - /*name=*/"SafeBrowsing.HPRT.WouldBeIneligibleForSessionOrLatestCountry", - /*expected_count=*/0); - histogram_tester.ExpectTotalCount( /*name=*/"SafeBrowsing.HPRT.Ineligible.NoGoogleChromeBranding", /*expected_count=*/0); histogram_tester.ExpectTotalCount( @@ -345,15 +321,14 @@ test_case.lookups_allowed_by_policy.value()); } // Confirm result is correct and no histograms are logged. - EXPECT_EQ(hash_realtime_utils::DetermineHashRealTimeSelection( - test_case.is_off_the_record, &prefs, - test_case.stored_permanent_country, test_case.latest_country), - test_case.expected_selection); + EXPECT_EQ( + hash_realtime_utils::DetermineHashRealTimeSelection( + test_case.is_off_the_record, &prefs, test_case.latest_country), + test_case.expected_selection); check_no_usage_histograms(histogram_tester); // Confirm result is still correct and relevant histograms are logged. EXPECT_EQ(hash_realtime_utils::DetermineHashRealTimeSelection( - test_case.is_off_the_record, &prefs, - test_case.stored_permanent_country, test_case.latest_country, + test_case.is_off_the_record, &prefs, test_case.latest_country, /*log_usage_histograms=*/true), test_case.expected_selection); if (test_case.expected_log_usage_histograms) {
diff --git a/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/LocalTabGroupId.java b/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/LocalTabGroupId.java index 607a7c5..5709130 100644 --- a/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/LocalTabGroupId.java +++ b/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/LocalTabGroupId.java
@@ -7,21 +7,25 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import org.chromium.base.Token; + +import java.util.Objects; + /** * LocalTabGroupId is a convenient class to contain all the information needed to uniquely identify * a the local tab group. */ public class LocalTabGroupId { - // The root ID of the tab group. Soon to be deprecated. - public @NonNull final Integer rootId; + // Stable ID of the tab group. This should be used going forward. + public final @NonNull Token tabGroupId; /** * Constructor. * - * @param rootId The root ID of the tab group in {@link TabModel}. + * @param tabGroupId The stable ID of the tab group in {@link TabModel}. */ - public LocalTabGroupId(int rootId) { - this.rootId = rootId; + public LocalTabGroupId(Token tabGroupId) { + this.tabGroupId = tabGroupId; } @Override @@ -30,11 +34,11 @@ if (!(o instanceof LocalTabGroupId)) return false; LocalTabGroupId other = (LocalTabGroupId) o; - return rootId.equals(other.rootId); + return Objects.equals(tabGroupId, other.tabGroupId); } @Override public int hashCode() { - return Integer.valueOf(rootId).hashCode(); + return Objects.hash(tabGroupId); } }
diff --git a/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncConversionsBridge.java b/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncConversionsBridge.java index 0e213123..507a430 100644 --- a/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncConversionsBridge.java +++ b/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncConversionsBridge.java
@@ -7,6 +7,7 @@ import org.jni_zero.CalledByNative; import org.jni_zero.JNINamespace; +import org.chromium.base.Token; import org.chromium.url.GURL; /** @@ -62,14 +63,14 @@ } @CalledByNative - private static LocalTabGroupId createJavaTabGroupId(int groupId) { - assert groupId != -1; + private static LocalTabGroupId createJavaTabGroupId(Token groupId) { + assert groupId != null; return new LocalTabGroupId(groupId); } @CalledByNative - private static int getNativeTabGroupId(LocalTabGroupId tabGroupId) { + private static Token getNativeTabGroupId(LocalTabGroupId tabGroupId) { assert tabGroupId != null; - return tabGroupId.rootId; + return tabGroupId.tabGroupId; } }
diff --git a/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncService.java b/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncService.java index 1fddb1f0..e8bdac8f 100644 --- a/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncService.java +++ b/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncService.java
@@ -9,11 +9,14 @@ import org.chromium.components.tab_groups.TabGroupColorId; import org.chromium.url.GURL; +import java.util.List; + /** * The core service class for handling tab group sync across devices. Provides 1. Mutation methods * to propagate local changes to remote. 2. Observer interface to propagate remote changes to local. */ public interface TabGroupSyncService { + /** * Observers observing updates to the sync data which can be originated by either the local or * remote clients. @@ -170,6 +173,15 @@ void removeLocalTabGroupMapping(LocalTabGroupId localId); /** + * Retrieves a list of group IDs that have been deleted from sync but haven't closed locally. + * This can happen a lot in multi-window scenario where the deletion happened for a group that + * belongs to a window that was closed when sync received this event. + * + * @return A list of {@link LocalTabGroupId} for groups that have been deleted. + */ + List<LocalTabGroupId> getDeletedGroupIds(); + + /** * Updates the in-memory mapping between sync and local IDs for a given tab. * * @param localGroupId The local group ID of the corresponding tab group.
diff --git a/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncServiceAndroidUnitTest.java b/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncServiceAndroidUnitTest.java index eca83df..7922c9f 100644 --- a/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncServiceAndroidUnitTest.java +++ b/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncServiceAndroidUnitTest.java
@@ -18,9 +18,11 @@ import org.mockito.ArgumentCaptor; import org.chromium.base.ThreadUtils; +import org.chromium.base.Token; import org.chromium.components.tab_groups.TabGroupColorId; import org.chromium.url.GURL; +import java.util.List; import java.util.concurrent.TimeoutException; /** @@ -31,6 +33,7 @@ */ @JNINamespace("tab_groups") public class TabGroupSyncServiceAndroidUnitTest { + private static final Token TOKEN_1 = new Token(4, 5); private static final String TEST_GROUP_TITLE = "Test Group"; private static final String TEST_GROUP_TITLE_2 = "Test Group 2"; private static final String TEST_TAB_TITLE = "Test Tab"; @@ -103,42 +106,42 @@ @CalledByNative public void testOnTabGroupRemoved() { - verify(mObserver).onTabGroupRemoved(eq(new LocalTabGroupId(4))); + verify(mObserver).onTabGroupRemoved(eq(new LocalTabGroupId(TOKEN_1))); verify(mObserver).onTabGroupRemoved(anyString()); } @CalledByNative public void testCreateGroup() { - String uuid = mService.createGroup(new LocalTabGroupId(4)); + String uuid = mService.createGroup(new LocalTabGroupId(TOKEN_1)); Assert.assertFalse(TextUtils.isEmpty(uuid)); } @CalledByNative public void testRemoveGroup() { - mService.removeGroup(new LocalTabGroupId(4)); + mService.removeGroup(new LocalTabGroupId(TOKEN_1)); } @CalledByNative public void testUpdateVisualData() { mService.updateVisualData( - new LocalTabGroupId(4), TEST_GROUP_TITLE_2, TabGroupColorId.GREEN); + new LocalTabGroupId(TOKEN_1), TEST_GROUP_TITLE_2, TabGroupColorId.GREEN); } @CalledByNative public void testAddTab() { - mService.addTab(new LocalTabGroupId(1), 2, TEST_TAB_TITLE, new GURL(TEST_URL), 3); - mService.addTab(new LocalTabGroupId(3), 4, TEST_TAB_TITLE, new GURL(TEST_URL), -1); + mService.addTab(new LocalTabGroupId(TOKEN_1), 2, TEST_TAB_TITLE, new GURL(TEST_URL), 3); + mService.addTab(new LocalTabGroupId(TOKEN_1), 4, TEST_TAB_TITLE, new GURL(TEST_URL), -1); } @CalledByNative public void testUpdateTab() { - mService.updateTab(new LocalTabGroupId(1), 2, TEST_TAB_TITLE, new GURL(TEST_URL), 3); - mService.updateTab(new LocalTabGroupId(3), 4, TEST_TAB_TITLE, new GURL(TEST_URL), -1); + mService.updateTab(new LocalTabGroupId(TOKEN_1), 2, TEST_TAB_TITLE, new GURL(TEST_URL), 3); + mService.updateTab(new LocalTabGroupId(TOKEN_1), 4, TEST_TAB_TITLE, new GURL(TEST_URL), -1); } @CalledByNative public void testRemoveTab() { - mService.removeTab(new LocalTabGroupId(1), 2); + mService.removeTab(new LocalTabGroupId(TOKEN_1), 2); } @CalledByNative @@ -166,6 +169,12 @@ } @CalledByNative + public void testGetDeletedGroupIds() { + List<LocalTabGroupId> groupIds = mService.getDeletedGroupIds(); + Assert.assertEquals(1, groupIds.size()); + } + + @CalledByNative public void testUpdateLocalTabGroupMapping(String syncId, LocalTabGroupId localId) { mService.updateLocalTabGroupMapping(syncId, localId); }
diff --git a/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncServiceImpl.java b/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncServiceImpl.java index ed094ca8..895187c 100644 --- a/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncServiceImpl.java +++ b/components/saved_tab_groups/android/java/src/org/chromium/components/tab_group_sync/TabGroupSyncServiceImpl.java
@@ -13,6 +13,9 @@ import org.chromium.base.task.TaskTraits; import org.chromium.url.GURL; +import java.util.ArrayList; +import java.util.List; + /** * Java side of the JNI bridge between TabGroupSyncServiceImpl in Java and C++. All method calls are * delegated to the native C++ class. @@ -89,7 +92,7 @@ @Override public String[] getAllGroupIds() { - if (mNativePtr == 0) return null; + if (mNativePtr == 0) return new String[0]; return TabGroupSyncServiceImplJni.get().getAllGroupIds(mNativePtr, this); } @@ -121,6 +124,18 @@ } @Override + public List<LocalTabGroupId> getDeletedGroupIds() { + if (mNativePtr == 0) return new ArrayList<>(); + List<LocalTabGroupId> deletedIds = new ArrayList<>(); + Object[] objects = TabGroupSyncServiceImplJni.get().getDeletedGroupIds(mNativePtr, this); + for (Object obj : objects) { + assert obj instanceof LocalTabGroupId; + deletedIds.add((LocalTabGroupId) obj); + } + return deletedIds; + } + + @Override public void updateLocalTabId(LocalTabGroupId localGroupId, String syncTabId, int localTabId) { if (mNativePtr == 0) return; TabGroupSyncServiceImplJni.get() @@ -224,6 +239,9 @@ TabGroupSyncServiceImpl caller, LocalTabGroupId localGroupId); + Object[] getDeletedGroupIds( + long nativeTabGroupSyncServiceAndroid, TabGroupSyncServiceImpl caller); + void updateLocalTabGroupMapping( long nativeTabGroupSyncServiceAndroid, TabGroupSyncServiceImpl caller,
diff --git a/components/saved_tab_groups/android/tab_group_sync_conversions_bridge.cc b/components/saved_tab_groups/android/tab_group_sync_conversions_bridge.cc index aa856e1..385d845 100644 --- a/components/saved_tab_groups/android/tab_group_sync_conversions_bridge.cc +++ b/components/saved_tab_groups/android/tab_group_sync_conversions_bridge.cc
@@ -8,6 +8,7 @@ #include <vector> #include "base/android/jni_string.h" +#include "base/android/token_android.h" #include "base/uuid.h" #include "components/saved_tab_groups/android/tab_group_sync_conversions_utils.h" #include "components/saved_tab_groups/jni_headers/TabGroupSyncConversionsBridge_jni.h" @@ -18,6 +19,7 @@ using base::android::ConvertUTF16ToJavaString; using base::android::JavaParamRef; using base::android::ScopedJavaLocalRef; +using base::android::TokenAndroid; namespace tab_groups { namespace { @@ -78,8 +80,9 @@ LocalTabGroupID TabGroupSyncConversionsBridge::FromJavaTabGroupId( JNIEnv* env, const JavaParamRef<jobject>& j_group_id) { - return Java_TabGroupSyncConversionsBridge_getNativeTabGroupId(env, - j_group_id); + auto j_token = + Java_TabGroupSyncConversionsBridge_getNativeTabGroupId(env, j_group_id); + return TokenAndroid::FromJavaToken(env, j_token); } // static @@ -88,7 +91,7 @@ const std::optional<LocalTabGroupID>& group_id) { return group_id.has_value() ? Java_TabGroupSyncConversionsBridge_createJavaTabGroupId( - env, group_id.value()) + env, TokenAndroid::Create(env, group_id.value())) : ScopedJavaLocalRef<jobject>(); }
diff --git a/components/saved_tab_groups/android/tab_group_sync_service_android.cc b/components/saved_tab_groups/android/tab_group_sync_service_android.cc index 3ea64377..ab738b9 100644 --- a/components/saved_tab_groups/android/tab_group_sync_service_android.cc +++ b/components/saved_tab_groups/android/tab_group_sync_service_android.cc
@@ -223,6 +223,19 @@ return TabGroupSyncConversionsBridge::CreateGroup(env, group.value()); } +ScopedJavaLocalRef<jobjectArray> TabGroupSyncServiceAndroid::GetDeletedGroupIds( + JNIEnv* env, + const JavaParamRef<jobject>& j_caller) { + auto group_ids = tab_group_sync_service_->GetDeletedGroupIds(); + std::vector<ScopedJavaLocalRef<jobject>> j_group_ids; + for (const auto& group_id : group_ids) { + auto j_group_id = + TabGroupSyncConversionsBridge::ToJavaTabGroupId(env, group_id); + j_group_ids.emplace_back(j_group_id); + } + return base::android::ToJavaArrayOfObjects(env, j_group_ids); +} + void TabGroupSyncServiceAndroid::UpdateLocalTabGroupMapping( JNIEnv* env, const JavaParamRef<jobject>& j_caller,
diff --git a/components/saved_tab_groups/android/tab_group_sync_service_android.h b/components/saved_tab_groups/android/tab_group_sync_service_android.h index 8d5e940..8d8c4f9 100644 --- a/components/saved_tab_groups/android/tab_group_sync_service_android.h +++ b/components/saved_tab_groups/android/tab_group_sync_service_android.h
@@ -90,6 +90,10 @@ const JavaParamRef<jobject>& j_caller, const JavaParamRef<jobject>& j_group_id); + ScopedJavaLocalRef<jobjectArray> GetDeletedGroupIds( + JNIEnv* env, + const JavaParamRef<jobject>& j_caller); + // Book-keeping methods to maintain in-memory mapping of sync and local IDs. void UpdateLocalTabGroupMapping(JNIEnv* env, const JavaParamRef<jobject>& j_caller,
diff --git a/components/saved_tab_groups/android/tab_group_sync_service_android_unittest.cc b/components/saved_tab_groups/android/tab_group_sync_service_android_unittest.cc index ce980827..05423e4 100644 --- a/components/saved_tab_groups/android/tab_group_sync_service_android_unittest.cc +++ b/components/saved_tab_groups/android/tab_group_sync_service_android_unittest.cc
@@ -62,6 +62,7 @@ MOCK_METHOD(std::vector<SavedTabGroup>, GetAllGroups, ()); MOCK_METHOD(std::optional<SavedTabGroup>, GetGroup, (const base::Uuid&)); MOCK_METHOD(std::optional<SavedTabGroup>, GetGroup, (LocalTabGroupID&)); + MOCK_METHOD(std::vector<LocalTabGroupID>, GetDeletedGroupIds, ()); MOCK_METHOD(void, UpdateLocalTabGroupMapping, @@ -141,7 +142,7 @@ TEST_F(TabGroupSyncServiceAndroidTest, TabGroupIdConversion) { auto* env = AttachCurrentThread(); - LocalTabGroupID tab_group_id = 5; + LocalTabGroupID tab_group_id = base::Token(4, 5); auto j_tab_group_id = TabGroupSyncConversionsBridge::ToJavaTabGroupId( env, std::make_optional<LocalTabGroupID>(tab_group_id)); auto retrieved_tab_group_id = @@ -192,7 +193,7 @@ TEST_F(TabGroupSyncServiceAndroidTest, OnTabGroupRemoved) { auto* env = AttachCurrentThread(); base::Uuid group_id = base::Uuid::GenerateRandomV4(); - bridge_->OnTabGroupRemoved(4); + bridge_->OnTabGroupRemoved(base::Token(4, 5)); bridge_->OnTabGroupRemoved(group_id); Java_TabGroupSyncServiceAndroidUnitTest_testOnTabGroupRemoved(env, j_test_); } @@ -205,20 +206,21 @@ Java_TabGroupSyncServiceAndroidUnitTest_testCreateGroup(env, j_test_); EXPECT_TRUE(captured_group.local_group_id().has_value()); - EXPECT_EQ(4, captured_group.local_group_id().value()); + EXPECT_EQ(base::Token(4, 5), captured_group.local_group_id().value()); } TEST_F(TabGroupSyncServiceAndroidTest, RemoveGroup) { auto* env = AttachCurrentThread(); - EXPECT_CALL(tab_group_sync_service_, RemoveGroup(Eq(4))); + EXPECT_CALL(tab_group_sync_service_, RemoveGroup(Eq(base::Token(4, 5)))); Java_TabGroupSyncServiceAndroidUnitTest_testRemoveGroup(env, j_test_); } TEST_F(TabGroupSyncServiceAndroidTest, UpdateVisualData) { auto* env = AttachCurrentThread(); - EXPECT_CALL(tab_group_sync_service_, UpdateVisualData(Eq(4), _)); + EXPECT_CALL(tab_group_sync_service_, + UpdateVisualData(Eq(base::Token(4, 5)), _)); Java_TabGroupSyncServiceAndroidUnitTest_testUpdateVisualData(env, j_test_); } @@ -229,10 +231,12 @@ std::optional<int> position = 3; EXPECT_CALL(tab_group_sync_service_, - AddTab(Eq(1), Eq(2), Eq(kTestTabTitle), Eq(url), Eq(position))); + AddTab(Eq(base::Token(4, 5)), Eq(2), Eq(kTestTabTitle), Eq(url), + Eq(position))); - EXPECT_CALL(tab_group_sync_service_, AddTab(Eq(3), Eq(4), Eq(kTestTabTitle), - Eq(url), Eq(std::nullopt))); + EXPECT_CALL(tab_group_sync_service_, + AddTab(Eq(base::Token(4, 5)), Eq(4), Eq(kTestTabTitle), Eq(url), + Eq(std::nullopt))); Java_TabGroupSyncServiceAndroidUnitTest_testAddTab(env, j_test_); } @@ -242,19 +246,19 @@ GURL url(kTestUrl); std::optional<int> position = 3; - EXPECT_CALL( - tab_group_sync_service_, - UpdateTab(Eq(1), Eq(2), Eq(kTestTabTitle), Eq(url), Eq(position))); - EXPECT_CALL( - tab_group_sync_service_, - UpdateTab(Eq(3), Eq(4), Eq(kTestTabTitle), Eq(url), Eq(std::nullopt))); + EXPECT_CALL(tab_group_sync_service_, + UpdateTab(Eq(base::Token(4, 5)), Eq(2), Eq(kTestTabTitle), + Eq(url), Eq(position))); + EXPECT_CALL(tab_group_sync_service_, + UpdateTab(Eq(base::Token(4, 5)), Eq(4), Eq(kTestTabTitle), + Eq(url), Eq(std::nullopt))); Java_TabGroupSyncServiceAndroidUnitTest_testUpdateTab(env, j_test_); } TEST_F(TabGroupSyncServiceAndroidTest, RemoveTab) { auto* env = AttachCurrentThread(); - EXPECT_CALL(tab_group_sync_service_, RemoveTab(Eq(1), Eq(2))); + EXPECT_CALL(tab_group_sync_service_, RemoveTab(Eq(base::Token(4, 5)), Eq(2))); Java_TabGroupSyncServiceAndroidUnitTest_testRemoveTab(env, j_test_); } @@ -302,35 +306,48 @@ env, j_test_, j_local_id_1, j_local_id_2); } +TEST_F(TabGroupSyncServiceAndroidTest, GetDeletedGroupIds) { + auto local_id_1 = test::GenerateRandomTabGroupID(); + std::vector<LocalTabGroupID> expectedGroupIds = {local_id_1}; + EXPECT_CALL(tab_group_sync_service_, GetDeletedGroupIds()) + .WillOnce(Return(expectedGroupIds)); + Java_TabGroupSyncServiceAndroidUnitTest_testGetDeletedGroupIds( + AttachCurrentThread(), j_test_); +} + TEST_F(TabGroupSyncServiceAndroidTest, UpdateLocalTabGroupMapping) { auto* env = AttachCurrentThread(); base::Uuid group_id = base::Uuid::GenerateRandomV4(); auto j_group_id = UuidToJavaString(env, group_id); + base::Token local_group_id(4, 5); // Update the mapping. EXPECT_CALL(tab_group_sync_service_, - UpdateLocalTabGroupMapping(Eq(group_id), Eq(4))); + UpdateLocalTabGroupMapping(Eq(group_id), Eq(local_group_id))); Java_TabGroupSyncServiceAndroidUnitTest_testUpdateLocalTabGroupMapping( AttachCurrentThread(), j_test_, j_group_id, - TabGroupSyncConversionsBridge::ToJavaTabGroupId(env, 4)); + TabGroupSyncConversionsBridge::ToJavaTabGroupId(env, local_group_id)); // Remove the mapping. - EXPECT_CALL(tab_group_sync_service_, RemoveLocalTabGroupMapping(Eq(4))); + EXPECT_CALL(tab_group_sync_service_, + RemoveLocalTabGroupMapping(Eq(base::Token(4, 5)))); Java_TabGroupSyncServiceAndroidUnitTest_testRemoveLocalTabGroupMapping( AttachCurrentThread(), j_test_, - TabGroupSyncConversionsBridge::ToJavaTabGroupId(env, 4)); + TabGroupSyncConversionsBridge::ToJavaTabGroupId(env, local_group_id)); } TEST_F(TabGroupSyncServiceAndroidTest, UpdateLocalTabId) { auto* env = AttachCurrentThread(); + base::Token group_id(4, 5); base::Uuid tab_id = base::Uuid::GenerateRandomV4(); auto j_tab_id = UuidToJavaString(env, tab_id); EXPECT_CALL(tab_group_sync_service_, - UpdateLocalTabId(Eq(2), Eq(tab_id), Eq(4))); + UpdateLocalTabId(Eq(group_id), Eq(tab_id), Eq(4))); Java_TabGroupSyncServiceAndroidUnitTest_testUpdateLocalTabId( AttachCurrentThread(), j_test_, - TabGroupSyncConversionsBridge::ToJavaTabGroupId(env, 2), j_tab_id, 4); + TabGroupSyncConversionsBridge::ToJavaTabGroupId(env, group_id), j_tab_id, + 4); } } // namespace tab_groups
diff --git a/components/saved_tab_groups/features.cc b/components/saved_tab_groups/features.cc index 31a3ec8..0ae977d 100644 --- a/components/saved_tab_groups/features.cc +++ b/components/saved_tab_groups/features.cc
@@ -4,6 +4,9 @@ #include "components/saved_tab_groups/features.h" +#include "base/feature_list.h" +#include "base/metrics/field_trial_params.h" + namespace tab_groups { // Core feature flag for tab group sync on Android. @@ -24,6 +27,12 @@ "TabGroupsSaveUIUpdate", base::FEATURE_DISABLED_BY_DEFAULT); +// Feature flag specific to UNO. Controls how we handle tab groups on sign-out +// and sync toggle. Can be defined independently for each platform. +BASE_FEATURE(kTabGroupSyncUno, + "TabGroupSyncUno", + base::FEATURE_DISABLED_BY_DEFAULT); + bool IsTabGroupsSaveV2Enabled() { return base::FeatureList::IsEnabled(kTabGroupsSaveV2); } @@ -32,4 +41,9 @@ return base::FeatureList::IsEnabled(kTabGroupsSaveUIUpdate); } +bool ShouldCloseAllTabGroupsOnSignOut() { + return GetFieldTrialParamByFeatureAsBool( + kTabGroupSyncUno, "close_all_tab_groups_on_sign_out", false); +} + } // namespace tab_groups
diff --git a/components/saved_tab_groups/features.h b/components/saved_tab_groups/features.h index 8d0ba04..0a7ac14 100644 --- a/components/saved_tab_groups/features.h +++ b/components/saved_tab_groups/features.h
@@ -14,10 +14,14 @@ BASE_DECLARE_FEATURE(kTabGroupsSaveUIUpdate); +BASE_DECLARE_FEATURE(kTabGroupSyncUno); + extern bool IsTabGroupsSaveV2Enabled(); extern bool IsTabGroupsSaveUIUpdateEnabled(); +extern bool ShouldCloseAllTabGroupsOnSignOut(); + } // namespace tab_groups #endif // COMPONENTS_SAVED_TAB_GROUPS_FEATURES_H_
diff --git a/components/saved_tab_groups/saved_tab_group_sync_bridge.cc b/components/saved_tab_groups/saved_tab_group_sync_bridge.cc index 77006eaa..0729471 100644 --- a/components/saved_tab_groups/saved_tab_group_sync_bridge.cc +++ b/components/saved_tab_groups/saved_tab_group_sync_bridge.cc
@@ -19,6 +19,7 @@ #include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "base/uuid.h" +#include "components/saved_tab_groups/features.h" #include "components/saved_tab_groups/saved_tab_group.h" #include "components/saved_tab_groups/saved_tab_group_model.h" #include "components/saved_tab_groups/saved_tab_group_tab.h" @@ -143,6 +144,22 @@ return {}; } +void SavedTabGroupSyncBridge::ApplyDisableSyncChanges( + std::unique_ptr<syncer::MetadataChangeList> delete_metadata_change_list) { + if (!ShouldCloseAllTabGroupsOnSignOut()) { + return; + } + + // Close all the groups locally. They should still exist in sync server. + std::vector<base::Uuid> group_ids; + for (const SavedTabGroup& group : model_->saved_tab_groups()) { + model_->RemovedFromSync(group.saved_guid()); + } + + // Wipe out all the local data. + store_->DeleteAllDataAndMetadata(base::DoNothing()); +} + std::string SavedTabGroupSyncBridge::GetStorageKey( const syncer::EntityData& entity_data) { return entity_data.specifics.saved_tab_group().guid(); @@ -396,6 +413,7 @@ write_batch->DeleteData(guid.AsLowercaseString()); // Check if the model contains the group guid. If so, remove that group and // all of its tabs. + // TODO(b/336586617): Close tabs on desktop on receiving this event. if (model_->Contains(guid)) { model_->RemovedFromSync(guid); return;
diff --git a/components/saved_tab_groups/saved_tab_group_sync_bridge.h b/components/saved_tab_groups/saved_tab_group_sync_bridge.h index 52d800a1..33337eb 100644 --- a/components/saved_tab_groups/saved_tab_group_sync_bridge.h +++ b/components/saved_tab_groups/saved_tab_group_sync_bridge.h
@@ -54,6 +54,8 @@ std::optional<syncer::ModelError> ApplyIncrementalSyncChanges( std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, syncer::EntityChangeList entity_changes) override; + void ApplyDisableSyncChanges(std::unique_ptr<syncer::MetadataChangeList> + delete_metadata_change_list) override; std::string GetStorageKey(const syncer::EntityData& entity_data) override; std::string GetClientTag(const syncer::EntityData& entity_data) override; void GetData(StorageKeyList storage_keys, DataCallback callback) override;
diff --git a/components/saved_tab_groups/saved_tab_group_sync_bridge_unittest.cc b/components/saved_tab_groups/saved_tab_group_sync_bridge_unittest.cc index 59ff3bd5..cc15486c 100644 --- a/components/saved_tab_groups/saved_tab_group_sync_bridge_unittest.cc +++ b/components/saved_tab_groups/saved_tab_group_sync_bridge_unittest.cc
@@ -11,10 +11,12 @@ #include <vector> #include "base/functional/bind.h" +#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/test/test_file_util.h" #include "base/time/time.h" #include "base/uuid.h" +#include "components/saved_tab_groups/features.h" #include "components/saved_tab_groups/saved_tab_group.h" #include "components/saved_tab_groups/saved_tab_group_model.h" #include "components/saved_tab_groups/saved_tab_group_model_observer.h" @@ -260,6 +262,38 @@ *group_from_model->GetTab(tab_1_guid)->ToSpecifics())); } +// Verify that on sign-out, all data is locally deleted. +TEST_F(SavedTabGroupSyncBridgeTest, DisableSyncDeletesAllLocalData) { + std::map<std::string, std::string> params = { + {"close_all_tab_groups_on_sign_out", "true"}, + }; + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeatureWithParameters(kTabGroupSyncUno, params); + + EXPECT_TRUE(saved_tab_group_model_.saved_tab_groups().empty()); + + SavedTabGroup group(u"Test Title", tab_groups::TabGroupColorId::kBlue, {}, 0); + SavedTabGroupTab tab_1(GURL("https://website.com"), u"Website Title", + group.saved_guid(), /*position=*/std::nullopt); + group.AddTabLocally(tab_1); + bridge_->MergeFullSyncData( + bridge_->CreateMetadataChangeList(), + CreateEntityChangeListFromGroup( + group, syncer::EntityChange::ChangeType::ACTION_ADD)); + EXPECT_TRUE(saved_tab_group_model_.Contains(group.saved_guid())); + EXPECT_EQ(saved_tab_group_model_.saved_tab_groups().size(), 1u); + + const SavedTabGroup* group_from_model = + saved_tab_group_model_.Get(group.saved_guid()); + EXPECT_EQ(group_from_model->saved_tabs().size(), 1u); + + // Disable sync. Expect all groups to be deleted locally from the model, but + // not from sync. + EXPECT_CALL(processor_, Delete(_, _, _)).Times(0); + bridge_->ApplyDisableSyncChanges(bridge_->CreateMetadataChangeList()); + EXPECT_EQ(saved_tab_group_model_.saved_tab_groups().size(), 0u); +} + // Verify orphaned tabs (tabs missing their group) are added into the correct // group in the model once the group arrives. TEST_F(SavedTabGroupSyncBridgeTest, OrphanedTabAddedIntoGroupWhenFound) {
diff --git a/components/saved_tab_groups/saved_tab_group_test_utils.cc b/components/saved_tab_groups/saved_tab_group_test_utils.cc index 793226a..b33b942 100644 --- a/components/saved_tab_groups/saved_tab_group_test_utils.cc +++ b/components/saved_tab_groups/saved_tab_group_test_utils.cc
@@ -16,7 +16,7 @@ LocalTabGroupID GenerateRandomTabGroupID() { #if BUILDFLAG(IS_ANDROID) - return base::RandInt(0, 1000); + return base::Token::CreateRandom(); #else return tab_groups::TabGroupId::GenerateNew(); #endif
diff --git a/components/saved_tab_groups/tab_group_sync_service.h b/components/saved_tab_groups/tab_group_sync_service.h index 9edbec4..f915660 100644 --- a/components/saved_tab_groups/tab_group_sync_service.h +++ b/components/saved_tab_groups/tab_group_sync_service.h
@@ -112,6 +112,7 @@ virtual std::vector<SavedTabGroup> GetAllGroups() = 0; virtual std::optional<SavedTabGroup> GetGroup(const base::Uuid& guid) = 0; virtual std::optional<SavedTabGroup> GetGroup(LocalTabGroupID& local_id) = 0; + virtual std::vector<LocalTabGroupID> GetDeletedGroupIds() = 0; // Book-keeping methods to maintain in-memory mapping of sync and local IDs. virtual void UpdateLocalTabGroupMapping(const base::Uuid& sync_id,
diff --git a/components/saved_tab_groups/tab_group_sync_service_impl.cc b/components/saved_tab_groups/tab_group_sync_service_impl.cc index 2dbf98be..eb83ebf61 100644 --- a/components/saved_tab_groups/tab_group_sync_service_impl.cc +++ b/components/saved_tab_groups/tab_group_sync_service_impl.cc
@@ -81,10 +81,12 @@ void TabGroupSyncServiceImpl::AddGroup(const SavedTabGroup& group) { model_->Add(group); + // TODO(b/336865528): Add to mapping store. } void TabGroupSyncServiceImpl::RemoveGroup(const LocalTabGroupID& local_id) { model_->Remove(local_id); + // TODO(b/336865528): Remove from mapping store. } void TabGroupSyncServiceImpl::UpdateVisualData( @@ -150,6 +152,8 @@ return; } + // TODO(b/336865528): If it's the last tab, we will remove the group from + // model. We should delete from mapping store too. model_->RemoveTabFromGroupLocally(group->saved_guid(), tab->saved_tab_guid()); } @@ -171,15 +175,22 @@ : std::nullopt; } +std::vector<LocalTabGroupID> TabGroupSyncServiceImpl::GetDeletedGroupIds() { + // TODO(b/336865528): Query mapping store. + return std::vector<LocalTabGroupID>(); +} + void TabGroupSyncServiceImpl::UpdateLocalTabGroupMapping( const base::Uuid& sync_id, const LocalTabGroupID& local_id) { model_->OnGroupOpenedInTabStrip(sync_id, local_id); + // TODO(b/336865528): Update mapping store. } void TabGroupSyncServiceImpl::RemoveLocalTabGroupMapping( const LocalTabGroupID& local_id) { model_->OnGroupClosedInTabStrip(local_id); + // TODO(b/336865528): Delete from mapping store. } void TabGroupSyncServiceImpl::UpdateLocalTabId( @@ -248,6 +259,7 @@ } void TabGroupSyncServiceImpl::SavedTabGroupModelLoaded() { + // TODO(b/336865528): Initialize and query mapping store before broadcasting. for (auto& observer : observers_) { observer.OnInitialized(); }
diff --git a/components/saved_tab_groups/tab_group_sync_service_impl.h b/components/saved_tab_groups/tab_group_sync_service_impl.h index 3e193d5c..fe3d1bd2 100644 --- a/components/saved_tab_groups/tab_group_sync_service_impl.h +++ b/components/saved_tab_groups/tab_group_sync_service_impl.h
@@ -72,6 +72,7 @@ std::vector<SavedTabGroup> GetAllGroups() override; std::optional<SavedTabGroup> GetGroup(const base::Uuid& guid) override; std::optional<SavedTabGroup> GetGroup(LocalTabGroupID& local_id) override; + std::vector<LocalTabGroupID> GetDeletedGroupIds() override; void UpdateLocalTabGroupMapping(const base::Uuid& sync_id, const LocalTabGroupID& local_id) override; void RemoveLocalTabGroupMapping(const LocalTabGroupID& local_id) override;
diff --git a/components/saved_tab_groups/tab_group_sync_service_unittest.cc b/components/saved_tab_groups/tab_group_sync_service_unittest.cc index f2ef475..dc954be 100644 --- a/components/saved_tab_groups/tab_group_sync_service_unittest.cc +++ b/components/saved_tab_groups/tab_group_sync_service_unittest.cc
@@ -168,6 +168,12 @@ test::CompareSavedTabGroupTabs(group->saved_tabs(), group_1_.saved_tabs()); } +TEST_F(TabGroupSyncServiceTest, GetDeletedGroupIds) { + auto deleted_ids = tab_group_sync_service_->GetDeletedGroupIds(); + EXPECT_EQ(deleted_ids.size(), 0u); + // TODO(b/336792770): Fix this test after implementing. +} + TEST_F(TabGroupSyncServiceTest, AddGroup) { // Add a new group. SavedTabGroup group_4(test::CreateTestSavedTabGroup());
diff --git a/components/saved_tab_groups/types.h b/components/saved_tab_groups/types.h index bde8c9a..fd365b0 100644 --- a/components/saved_tab_groups/types.h +++ b/components/saved_tab_groups/types.h
@@ -14,7 +14,7 @@ #if BUILDFLAG(IS_ANDROID) using LocalTabID = int; -using LocalTabGroupID = int; +using LocalTabGroupID = base::Token; #else using LocalTabID = base::Token; using LocalTabGroupID = tab_groups::TabGroupId;
diff --git a/components/search_engines/BUILD.gn b/components/search_engines/BUILD.gn index 233cec3..66ba2f6 100644 --- a/components/search_engines/BUILD.gn +++ b/components/search_engines/BUILD.gn
@@ -149,10 +149,6 @@ ] deps = [ "//url" ] - - if (is_android) { - deps += [ "//components/search_engines/android:jni_headers" ] - } } source_set("search_engine_type") {
diff --git a/components/search_engines/template_url_starter_pack_data.cc b/components/search_engines/template_url_starter_pack_data.cc index 0620e03f..3af1a3a 100644 --- a/components/search_engines/template_url_starter_pack_data.cc +++ b/components/search_engines/template_url_starter_pack_data.cc
@@ -14,12 +14,12 @@ namespace TemplateURLStarterPackData { // Update this whenever a change is made to any starter pack data. -const int kCurrentDataVersion = 9; +const int kCurrentDataVersion = 10; // Only update this if there's an incompatible change that requires force // updating the user's starter pack data. This will overwrite any of the // user's changes to the starter pack entries. -const int kFirstCompatibleDataVersion = 5; +const int kFirstCompatibleDataVersion = 10; const StarterPackEngine bookmarks = { .name_message_id = IDS_SEARCH_ENGINES_STARTER_PACK_BOOKMARKS_NAME,
diff --git a/components/signin/public/identity_manager/identity_utils_unittest.cc b/components/signin/public/identity_manager/identity_utils_unittest.cc index 50c02ed..1e36930 100644 --- a/components/signin/public/identity_manager/identity_utils_unittest.cc +++ b/components/signin/public/identity_manager/identity_utils_unittest.cc
@@ -112,7 +112,9 @@ identity_test_env_(/*test_url_loader_factory=*/nullptr, &pref_service_) {} - bool IsExplicitBrowserSigninDisabled() { return !IsParamFeatureEnabled(); } + bool IsExplicitBrowserSigninDisabled() const { + return !IsParamFeatureEnabled(); + } void MakePrimaryAccountAvailable() { static const std::string kTestEmail = "test@gmail.com";
diff --git a/components/sync/base/features.h b/components/sync/base/features.h index fd3990e..f6df717 100644 --- a/components/sync/base/features.h +++ b/components/sync/base/features.h
@@ -11,6 +11,10 @@ namespace syncer { // Customizes the delay of a deferred sync startup. +// Note from 04/2024: The first attempt to roll this out on 05/2023 ran into +// performance regressions (go/deferred-startup-experiment-metrics, sorry +// Googlers only). It might still be possible to launch by investigating and +// fixing the performance issues. crbug.com/40872516 tracks that. BASE_DECLARE_FEATURE(kDeferredSyncStartupCustomDelay); inline constexpr base::FeatureParam<int> kDeferredSyncStartupCustomDelayInSeconds{
diff --git a/components/sync_bookmarks/bookmark_specifics_conversions.cc b/components/sync_bookmarks/bookmark_specifics_conversions.cc index 62fe453..9685c40 100644 --- a/components/sync_bookmarks/bookmark_specifics_conversions.cc +++ b/components/sync_bookmarks/bookmark_specifics_conversions.cc
@@ -330,9 +330,7 @@ // to embed the content of the image itself in the URL may be arbitrarily // large and run into the server-side enforced limit per sync entity. if (node->icon_url() && - (node->icon_url()->spec().size() <= kMaxFaviconUrlSize || - !base::FeatureList::IsEnabled( - switches::kSyncOmitLargeBookmarkFaviconUrl))) { + node->icon_url()->spec().size() <= kMaxFaviconUrlSize) { bm_specifics->set_icon_url(node->icon_url()->spec()); } else { bm_specifics->set_icon_url(std::string());
diff --git a/components/sync_bookmarks/switches.cc b/components/sync_bookmarks/switches.cc index c1dc9d5..cb1f2be 100644 --- a/components/sync_bookmarks/switches.cc +++ b/components/sync_bookmarks/switches.cc
@@ -8,10 +8,6 @@ namespace switches { -BASE_FEATURE(kSyncOmitLargeBookmarkFaviconUrl, - "SyncOmitLargeBookmarkFaviconUrl", - base::FEATURE_ENABLED_BY_DEFAULT); - // TODO(crbug.com/1232951): remove the feature toggle once most of bookmarks // have been reuploaded. BASE_FEATURE(kSyncReuploadBookmarks,
diff --git a/components/sync_bookmarks/switches.h b/components/sync_bookmarks/switches.h index de87d0f..012de30 100644 --- a/components/sync_bookmarks/switches.h +++ b/components/sync_bookmarks/switches.h
@@ -9,8 +9,6 @@ namespace switches { -BASE_DECLARE_FEATURE(kSyncOmitLargeBookmarkFaviconUrl); - // TODO(crbug.com/1232951): remove the feature toggle once most of bookmarks // have been reuploaded. BASE_DECLARE_FEATURE(kSyncReuploadBookmarks);
diff --git a/components/test/data/autofill/heuristics/output/017_checkout_advanceautoparts.com.out b/components/test/data/autofill/heuristics/output/017_checkout_advanceautoparts.com.out index 6ce7b47d..4e5ccbb 100644 --- a/components/test/data/autofill/heuristics/output/017_checkout_advanceautoparts.com.out +++ b/components/test/data/autofill/heuristics/output/017_checkout_advanceautoparts.com.out
@@ -1,3 +1,7 @@ +EMAIL_ADDRESS | logonId | Email Address: | | logonId_1 +UNKNOWN_TYPE | logonPassword | Password: | | logonId_1 +UNKNOWN_TYPE | rememberMe | Remember Me on Future Visits | true | logonId_1 + UNKNOWN_TYPE | billingShippingSame | Make shipping the same as my billing address | false | billingShippingSame_1 NAME_FIRST | billFirstName | *First Name: | | billingShippingSame_1 NAME_LAST | billLastName | *Last Name: | | billingShippingSame_1 @@ -27,8 +31,4 @@ PHONE_HOME_NUMBER_PREFIX | shipNightPhonePart2 | Night Phone: | | shipFirstName_2 PHONE_HOME_NUMBER_SUFFIX | shipNightPhonePart3 | Night Phone: | | shipFirstName_2 -UNKNOWN_TYPE | logonId | Email Address: | | logonId_1 -UNKNOWN_TYPE | logonPassword | Password: | | logonId_1 -UNKNOWN_TYPE | rememberMe | Remember Me on Future Visits | true | logonId_1 - UNKNOWN_TYPE | zipCode | | | zipCode_1
diff --git a/components/test/data/autofill/heuristics/output/019_checkout_bedbathandbeyond.com.out b/components/test/data/autofill/heuristics/output/019_checkout_bedbathandbeyond.com.out index 69a149d..8082f79 100644 --- a/components/test/data/autofill/heuristics/output/019_checkout_bedbathandbeyond.com.out +++ b/components/test/data/autofill/heuristics/output/019_checkout_bedbathandbeyond.com.out
@@ -1,3 +1,5 @@ +EMAIL_ADDRESS | email | Privacy policy - Your Privacy Rights | enter your email address | email_1 + NAME_FIRST | first_nm | *First name | | first_nm_1 NAME_MIDDLE | mid_nm | Middle name | | first_nm_1 NAME_LAST | last_nm | *Last name | | first_nm_1 @@ -36,5 +38,3 @@ PHONE_HOME_CITY_CODE_WITH_TRUNK_PREFIX | ship_eve_phone_part1 | Evening phone | | ship_first_nm_2 PHONE_HOME_NUMBER_PREFIX | ship_eve_phone_part2 | Evening phone | | ship_first_nm_2 PHONE_HOME_NUMBER_SUFFIX | ship_eve_phone_part3 | Evening phone | | ship_first_nm_2 - -UNKNOWN_TYPE | email | Privacy policy - Your Privacy Rights | enter your email address | email_1
diff --git a/components/test/data/autofill/heuristics/output/024_checkout_homedepot.com.out b/components/test/data/autofill/heuristics/output/024_checkout_homedepot.com.out index 5354ce4..82aee50 100644 --- a/components/test/data/autofill/heuristics/output/024_checkout_homedepot.com.out +++ b/components/test/data/autofill/heuristics/output/024_checkout_homedepot.com.out
@@ -1,3 +1,5 @@ +EMAIL_ADDRESS | emailInput | Add Shipping Addresses | Enter Email Address | emailInput_1 + NAME_FIRST | firstName_1 | *First Name: | | firstName_1_1 NAME_LAST | lastName_1 | *Last Name: | | firstName_1_1 ADDRESS_HOME_LINE1 | address1_1 | *Address 1: | | firstName_1_1 @@ -12,5 +14,3 @@ PHONE_HOME_NUMBER_PREFIX | altfieldphone2_1 | Alternate Phone: | | firstName_1_1 PHONE_HOME_NUMBER_SUFFIX | altfieldphone3_1 | Alternate Phone: | | firstName_1_1 UNKNOWN_TYPE | isBillingAddress_1 | Check here if the above shipping address is | on | firstName_1_1 - -UNKNOWN_TYPE | emailInput | Add Shipping Addresses | Enter Email Address | emailInput_1
diff --git a/components/test/data/autofill/heuristics/output/027_checkout_jcrew.com.out b/components/test/data/autofill/heuristics/output/027_checkout_jcrew.com.out index caa09b7..234ee94 100644 --- a/components/test/data/autofill/heuristics/output/027_checkout_jcrew.com.out +++ b/components/test/data/autofill/heuristics/output/027_checkout_jcrew.com.out
@@ -12,6 +12,6 @@ UNKNOWN_TYPE | anonPasswordConfirm | confirm password | | ADDRESS<>country_cd_1 UNKNOWN_TYPE | anonPasswordHint | create password hint | | ADDRESS<>country_cd_1 -UNKNOWN_TYPE | emailID | enter email | enter email | emailID_1 +EMAIL_ADDRESS | emailID | enter email | enter email | emailID_1 UNKNOWN_TYPE | searchTerm | search keyword or item # | search keyword or item # | searchTerm_1
diff --git a/components/test/data/autofill/heuristics/output/029_checkout_kohls.com.out b/components/test/data/autofill/heuristics/output/029_checkout_kohls.com.out index f61abac2..c5b7457 100644 --- a/components/test/data/autofill/heuristics/output/029_checkout_kohls.com.out +++ b/components/test/data/autofill/heuristics/output/029_checkout_kohls.com.out
@@ -1,3 +1,6 @@ +EMAIL_ADDRESS | LOGIN<>userid | E-mail Address: | | LOGIN<>userid_1 +UNKNOWN_TYPE | LOGIN<>passwordLogin | Password: | | LOGIN<>userid_1 + NAME_FIRST | BILL_TO_ADDRESS<>firstName | First Name: | | BILL_TO_ADDRESS<>firstName_1 NAME_LAST | BILL_TO_ADDRESS<>lastName | Last Name: | | BILL_TO_ADDRESS<>firstName_1 ADDRESS_HOME_LINE1 | BILL_TO_ADDRESS<>address1 | Address: | | BILL_TO_ADDRESS<>firstName_1 @@ -25,6 +28,3 @@ PHONE_HOME_EXTENSION | SHIP_PHONE<>extension | Extension | | SHIP_TO_ADDRESS<>firstName_2 PHONE_HOME_CITY_AND_NUMBER | ship_phone | Contact Phone: | | SHIP_TO_ADDRESS<>firstName_2 UNKNOWN_TYPE | validShippingMethodList | Shipping Method: | 7037973929746575 | SHIP_TO_ADDRESS<>firstName_2 - -UNKNOWN_TYPE | LOGIN<>userid | E-mail Address: | | LOGIN<>userid_1 -UNKNOWN_TYPE | LOGIN<>passwordLogin | Password: | | LOGIN<>userid_1
diff --git a/components/test/data/autofill/heuristics/output/035_checkout_petco.com.out b/components/test/data/autofill/heuristics/output/035_checkout_petco.com.out index c3f166f..61c22ba 100644 --- a/components/test/data/autofill/heuristics/output/035_checkout_petco.com.out +++ b/components/test/data/autofill/heuristics/output/035_checkout_petco.com.out
@@ -1,3 +1,5 @@ +EMAIL_ADDRESS | txtEmail | Your Email Address | Your Email Address | txtEmail_1 + NAME_FIRST | ctl00$ctl00$cphBody$cphBody$txtSA_FirstName | First Name * | | ctl00$ctl00$cphBody$cphBody$txtSA_FirstName_1 NAME_LAST | ctl00$ctl00$cphBody$cphBody$txtSA_LastName | Last Name * | | ctl00$ctl00$cphBody$cphBody$txtSA_FirstName_1 ADDRESS_HOME_LINE1 | ctl00$ctl00$cphBody$cphBody$txtSA_Address1 | Address Line 1 * | | ctl00$ctl00$cphBody$cphBody$txtSA_FirstName_1 @@ -12,5 +14,3 @@ PHONE_HOME_EXTENSION | ctl00$ctl00$cphBody$cphBody$txtSA_PhoneExt | Ext. | | ctl00$ctl00$cphBody$cphBody$txtSA_FirstName_1 UNKNOWN_TYPE | ctl00$ctl00$cphBody$cphBody$cbSA_MatchBilling | This is also my billing address | on | ctl00$ctl00$cphBody$cphBody$txtSA_FirstName_1 UNKNOWN_TYPE | ctl00$ctl00$cphBody$cphBody$cbSA_EmailSignup | Send me newsletters with exclusive online discounts, special announcements and health and behavior tips for my pet. | on | ctl00$ctl00$cphBody$cphBody$txtSA_FirstName_1 - -UNKNOWN_TYPE | txtEmail | Your Email Address | Your Email Address | txtEmail_1
diff --git a/components/test/data/autofill/heuristics/output/042_checkout_williams-sonoma.com.out b/components/test/data/autofill/heuristics/output/042_checkout_williams-sonoma.com.out index 65519ce..fb32812 100644 --- a/components/test/data/autofill/heuristics/output/042_checkout_williams-sonoma.com.out +++ b/components/test/data/autofill/heuristics/output/042_checkout_williams-sonoma.com.out
@@ -1,3 +1,5 @@ +EMAIL_ADDRESS | email | Enter your email address | Enter your email address | email_1 + NAME_FULL | shipTos[0].address.fullName | Full Name* | | shipTos[0].address.fullName_1 ADDRESS_HOME_LINE1 | shipTos[0].address.addrLine1 | Address* | | shipTos[0].address.fullName_1 ADDRESS_HOME_LINE2 | shipTos[0].address.addrLine2 | Address Line 2 | | shipTos[0].address.fullName_1 @@ -11,5 +13,3 @@ EMAIL_ADDRESS | shipTos[0].confirmEmailAddr | Confirm Email* | | shipTos[0].address.fullName_1 UNKNOWN_TYPE | shipTos[0].shipType | Standard (5-7 business days) | Standard | shipTos[0].address.fullName_1 UNKNOWN_TYPE | shipTos[0].shipType | Rush (2-3 business days) | Rush | shipTos[0].address.fullName_1 - -UNKNOWN_TYPE | email | Enter your email address | Enter your email address | email_1
diff --git a/components/test/data/autofill/heuristics/output/048_register_deviantart.com.out b/components/test/data/autofill/heuristics/output/048_register_deviantart.com.out index 1471adc..3e1f8ad 100644 --- a/components/test/data/autofill/heuristics/output/048_register_deviantart.com.out +++ b/components/test/data/autofill/heuristics/output/048_register_deviantart.com.out
@@ -1,4 +1,4 @@ -UNKNOWN_TYPE | emailAddress | Email Address | | emailAddress_1 +EMAIL_ADDRESS | emailAddress | Email Address | | emailAddress_1 UNKNOWN_TYPE | password | Password | | emailAddress_1 UNKNOWN_TYPE | remember_me | Stay logged in | 1 | emailAddress_1
diff --git a/components/test/data/autofill/heuristics/output/051_register_epson.com.out b/components/test/data/autofill/heuristics/output/051_register_epson.com.out index 624325b9..bf8fb455 100644 --- a/components/test/data/autofill/heuristics/output/051_register_epson.com.out +++ b/components/test/data/autofill/heuristics/output/051_register_epson.com.out
@@ -1,3 +1,6 @@ +EMAIL_ADDRESS | EMAIL_ADDRESS | Email Address | (Required) | EMAIL_ADDRESS_1 +UNKNOWN_TYPE | FIRST_NAME | First Name | (Optional) | EMAIL_ADDRESS_1 + NAME_FIRST | fname | * First Name | | fname_1 NAME_LAST | lname | * Last Name | | fname_1 EMAIL_ADDRESS | emLogin | * E-mail address | | fname_1 @@ -5,7 +8,4 @@ UNKNOWN_TYPE | verifypw | * Re-Confirm Password | | fname_1 UNKNOWN_TYPE | wantMsg | I'd like to hear about new product information, special discounts and offers exclusive to Epson customers only. Please sign me up! | on | fname_1 -UNKNOWN_TYPE | EMAIL_ADDRESS | Email Address | (Required) | EMAIL_ADDRESS_1 -UNKNOWN_TYPE | FIRST_NAME | First Name | (Optional) | EMAIL_ADDRESS_1 - UNKNOWN_TYPE | query | United States | | query_1
diff --git a/components/test/data/autofill/heuristics/output/053_register_gymboree.com.out b/components/test/data/autofill/heuristics/output/053_register_gymboree.com.out index 4515a73..312731c 100644 --- a/components/test/data/autofill/heuristics/output/053_register_gymboree.com.out +++ b/components/test/data/autofill/heuristics/output/053_register_gymboree.com.out
@@ -16,6 +16,6 @@ UNKNOWN_TYPE | LOYALTY_ACCOUNT<>sendEmail | Save the address above as my default billing address. I would like to receive promotions and special offers from Gymboree. | true | LOYALTY_ACCOUNT<>email_1 UNKNOWN_TYPE | accept | I have read and accept the terms and conditions of Gymboree Rewards. (Rewards information and offers will be emailed to you.) | on | LOYALTY_ACCOUNT<>email_1 -UNKNOWN_TYPE | SEARCH_INPUT<>searchFor | search by keyword or item# | search by keyword or item# | SEARCH_INPUT<>searchFor_1 +EMAIL_ADDRESS | SUBSCRIBER_INFO<>email | Exclusive E-Mail Sign Up | Sign Up Today! | SUBSCRIBER_INFO<>email_1 -UNKNOWN_TYPE | SUBSCRIBER_INFO<>email | Exclusive E-Mail Sign Up | Sign Up Today! | SUBSCRIBER_INFO<>email_1 +UNKNOWN_TYPE | SEARCH_INPUT<>searchFor | search by keyword or item# | search by keyword or item# | SEARCH_INPUT<>searchFor_1
diff --git a/components/test/data/autofill/heuristics/output/061_register_myspace.com.out b/components/test/data/autofill/heuristics/output/061_register_myspace.com.out index bd6bd9fd..28e67a1 100644 --- a/components/test/data/autofill/heuristics/output/061_register_myspace.com.out +++ b/components/test/data/autofill/heuristics/output/061_register_myspace.com.out
@@ -1,4 +1,4 @@ -UNKNOWN_TYPE | Email | Email | | Email_1 +EMAIL_ADDRESS | Email | Email | | Email_1 UNKNOWN_TYPE | Password | Password | | Email_1 UNKNOWN_TYPE | Remember | Keep me logged in | on | Email_1
diff --git a/components/test/data/autofill/heuristics/output/065_register_pyramidcollection.com.out b/components/test/data/autofill/heuristics/output/065_register_pyramidcollection.com.out index 3f9685e8..9a731fd 100644 --- a/components/test/data/autofill/heuristics/output/065_register_pyramidcollection.com.out +++ b/components/test/data/autofill/heuristics/output/065_register_pyramidcollection.com.out
@@ -23,4 +23,4 @@ PHONE_HOME_CITY_AND_NUMBER | SP3 | Evening Phone | | SF1_2 UNKNOWN_TYPE | sameAsBilling | My Shipping address is same as billing address. | on | SF1_2 -UNKNOWN_TYPE | email | ENTER TO WIN A $100 GIFT CARD! | enter email address | email_1 +EMAIL_ADDRESS | email | ENTER TO WIN A $100 GIFT CARD! | enter email address | email_1
diff --git a/components/test/data/autofill/heuristics/output/067_register_rei.com.out b/components/test/data/autofill/heuristics/output/067_register_rei.com.out index 958d4696..3a9f5d0 100644 --- a/components/test/data/autofill/heuristics/output/067_register_rei.com.out +++ b/components/test/data/autofill/heuristics/output/067_register_rei.com.out
@@ -1,3 +1,5 @@ +EMAIL_ADDRESS | EmailAddress | Email Address | Email Address | EmailAddress_1 + NAME_FIRST | firstName | First Name:* | | firstName_1 NAME_MIDDLE_INITIAL | middleName | Middle Initial: | | firstName_1 NAME_LAST | lastName | Last Name:* | | firstName_1 @@ -6,5 +8,3 @@ ADDRESS_HOME_ZIP | zipCode | ZIP (Postal) Code:* | | firstName_1 EMAIL_ADDRESS | email1 | E-mail Address:* | | firstName_1 UNKNOWN_TYPE | gearmail | Yes, I'd like to be notified of news, offers and events at REI via this email address. | y | firstName_1 - -UNKNOWN_TYPE | EmailAddress | Email Address | Email Address | EmailAddress_1
diff --git a/components/test/data/autofill/heuristics/output/073_register_target.com.out b/components/test/data/autofill/heuristics/output/073_register_target.com.out index eceaf2f..8f378f2 100644 --- a/components/test/data/autofill/heuristics/output/073_register_target.com.out +++ b/components/test/data/autofill/heuristics/output/073_register_target.com.out
@@ -1,10 +1,10 @@ -UNKNOWN_TYPE | email | Email address: | | email_1 +EMAIL_ADDRESS | email | Email address: | | email_1 UNKNOWN_TYPE | password | Password: | | email_1 -UNKNOWN_TYPE | email | Email address: | | email_1 +EMAIL_ADDRESS | email | Email address: | | email_1 UNKNOWN_TYPE | password | Password: | | email_1 -UNKNOWN_TYPE | emailId | E-mail Address: | E-mail Address | emailId_1 +EMAIL_ADDRESS | emailId | E-mail Address: | E-mail Address | emailId_1 UNKNOWN_TYPE | firstName | First Name* | | firstName_1 UNKNOWN_TYPE | lastName | Last Name* | | firstName_1
diff --git a/components/test/data/autofill/heuristics/output/074_register_threadless.com.out b/components/test/data/autofill/heuristics/output/074_register_threadless.com.out index ad0c2b10..170c0521 100644 --- a/components/test/data/autofill/heuristics/output/074_register_threadless.com.out +++ b/components/test/data/autofill/heuristics/output/074_register_threadless.com.out
@@ -1,14 +1,14 @@ +EMAIL_ADDRESS | email | Email | | email_1 + +EMAIL_ADDRESS | username | Username or email | | username_1 +UNKNOWN_TYPE | password | Password Password | | username_1 + +EMAIL_ADDRESS | username | Username or email | | username_1 +UNKNOWN_TYPE | password | Password Password | | username_1 + UNKNOWN_TYPE | create_username | Desired username | | create_username_1 UNKNOWN_TYPE | create_password | Password | | create_username_1 UNKNOWN_TYPE | retype_password | Re-type password | | create_username_1 EMAIL_ADDRESS | email | Email | | create_username_1 UNKNOWN_TYPE | join_newsletter | Join our newsletter and be first to know about new tees and great deals! | on | create_username_1 UNKNOWN_TYPE | recaptcha_response_field | Type the words above Type the numbers you hear | | create_username_1 - -UNKNOWN_TYPE | email | Email | | email_1 - -UNKNOWN_TYPE | username | Username or email | | username_1 -UNKNOWN_TYPE | password | Password Password | | username_1 - -UNKNOWN_TYPE | username | Username or email | | username_1 -UNKNOWN_TYPE | password | Password Password | | username_1
diff --git a/components/test/data/autofill/heuristics/output/081_crbug_64569.out b/components/test/data/autofill/heuristics/output/081_crbug_64569.out index 63e1ca8..52e7837 100644 --- a/components/test/data/autofill/heuristics/output/081_crbug_64569.out +++ b/components/test/data/autofill/heuristics/output/081_crbug_64569.out
@@ -1,4 +1,4 @@ -UNKNOWN_TYPE | email | Enter your email address | | email_1 +EMAIL_ADDRESS | email | Enter your email address | | email_1 UNKNOWN_TYPE | payment_group | Payment Type We accept Visa, Mastercard, Discover, American Express, and PayPal. | cc | payment_group_1 UNKNOWN_TYPE | payment_group | Payment Type We accept Visa, Mastercard, Discover, American Express, and PayPal. | paypal | payment_group_1
diff --git a/components/test/data/autofill/heuristics/output/094_checkout_staples.com.out b/components/test/data/autofill/heuristics/output/094_checkout_staples.com.out index 067fdc914..e84c278 100644 --- a/components/test/data/autofill/heuristics/output/094_checkout_staples.com.out +++ b/components/test/data/autofill/heuristics/output/094_checkout_staples.com.out
@@ -1,3 +1,6 @@ +EMAIL_ADDRESS | emailAddress | * Indicates a required field | | emailAddress_1 +UNKNOWN_TYPE | emailPreference | Yes, I would like to receive emails about special money-saving offers from Staples. | emailYes | emailAddress_1 + NAME_FIRST | sFirstName | First Name * | | sFirstName_1 NAME_LAST | sLastName | Last Name * | | sFirstName_1 COMPANY_NAME | sCompany | Company Name (optional) | | sFirstName_1 @@ -8,6 +11,3 @@ ADDRESS_HOME_ZIP | sZipCode | Zip Code * | | sFirstName_1 PHONE_HOME_CITY_AND_NUMBER | sPhone | Phone Number * | | sFirstName_1 PHONE_HOME_EXTENSION | sPhoneExt | Extension | | sFirstName_1 - -UNKNOWN_TYPE | emailAddress | * Indicates a required field | | emailAddress_1 -UNKNOWN_TYPE | emailPreference | Yes, I would like to receive emails about special money-saving offers from Staples. | emailYes | emailAddress_1
diff --git a/components/test/data/autofill/heuristics/output/137_bug_555010.out b/components/test/data/autofill/heuristics/output/137_bug_555010.out index 0ef443d..6508696a 100644 --- a/components/test/data/autofill/heuristics/output/137_bug_555010.out +++ b/components/test/data/autofill/heuristics/output/137_bug_555010.out
@@ -21,5 +21,5 @@ PHONE_HOME_CITY_AND_NUMBER | id_skAltPUPhoneno | Phone | | id_skCOShipAddress_4 EMAIL_ADDRESS | id_skAltPUEmail | Email | | id_skCOShipAddress_4 -UNKNOWN_TYPE | userName | Username or Email address | | userName_1 +EMAIL_ADDRESS | userName | Username or Email address | | userName_1 UNKNOWN_TYPE | password | Password | | userName_1
diff --git a/components/test/data/autofill/heuristics/output/159_bug_966406_transavia.com.out b/components/test/data/autofill/heuristics/output/159_bug_966406_transavia.com.out index 2a00e3a3..6cc76d2 100644 --- a/components/test/data/autofill/heuristics/output/159_bug_966406_transavia.com.out +++ b/components/test/data/autofill/heuristics/output/159_bug_966406_transavia.com.out
@@ -1,5 +1,5 @@ # INCORRECT: 3rd field should be a last name, but the parser cannot return a last name without a first name. -UNKNOWN_TYPE | loginID | Adresse e-mail | | loginID_1 +EMAIL_ADDRESS | loginID | Adresse e-mail | | loginID_1 UNKNOWN_TYPE | password | Mot de passe | | loginID_1 UNKNOWN_TYPE | retrieveBookingByLastname.RecordLocator | Numéro de réservation | | retrieveBookingByLastname.RecordLocator_1
diff --git a/components/user_education/common/feature_promo_controller.cc b/components/user_education/common/feature_promo_controller.cc index ab91af6e..6902bd8 100644 --- a/components/user_education/common/feature_promo_controller.cc +++ b/components/user_education/common/feature_promo_controller.cc
@@ -14,6 +14,7 @@ #include "base/functional/callback_forward.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/user_metrics.h" +#include "base/notimplemented.h" #include "build/build_config.h" #include "components/feature_engagement/public/feature_constants.h" #include "components/strings/grit/components_strings.h" @@ -175,8 +176,7 @@ // If the session policy allows overriding the current promo, abort it. if (current_promo_) { EndPromo(*GetCurrentPromoFeature(), - for_demo ? FeaturePromoClosedReason::kOverrideForDemo - : FeaturePromoClosedReason::kOverrideForPrecedence); + FeaturePromoClosedReason::kOverrideForDemo); } // If the session policy allows overriding other help bubbles, close them. @@ -620,6 +620,12 @@ return FeaturePromoResult::kError; } + // TODO(dfried): support rotating promos. + if (spec->promo_type() == FeaturePromoSpecification::PromoType::kRotating) { + NOTIMPLEMENTED(); + return FeaturePromoResult::kError; + } + // When not bypassing the normal gating systems, don't try to show promos for // disabled features. This prevents us from calling into the Feature // Engagement tracker more times than necessary, emitting unnecessary logging @@ -635,7 +641,7 @@ if (!for_demo && !in_iph_demo_mode_) { lifecycle = std::make_unique<FeaturePromoLifecycle>( storage_service_, params.key, &*params.feature, spec->promo_type(), - spec->promo_subtype()); + spec->promo_subtype(), 0); if (const auto result = lifecycle->CanShow(); !result) { return result; } @@ -683,7 +689,7 @@ // provide one. lifecycle = std::make_unique<FeaturePromoLifecycle>( storage_service_, params.key, &*params.feature, spec->promo_type(), - spec->promo_subtype()); + spec->promo_subtype(), 0); } *lifecycle_out = std::move(lifecycle); } @@ -770,6 +776,8 @@ case FeaturePromoSpecification::PromoType::kToast: case FeaturePromoSpecification::PromoType::kLegacy: break; + case FeaturePromoSpecification::PromoType::kRotating: + NOTREACHED_NORETURN() << "Not implemented; should never reach this code."; } bool had_screen_reader_promo = false;
diff --git a/components/user_education/common/feature_promo_data.h b/components/user_education/common/feature_promo_data.h index 74cfd92..a87411d 100644 --- a/components/user_education/common/feature_promo_data.h +++ b/components/user_education/common/feature_promo_data.h
@@ -58,6 +58,7 @@ base::Time last_snooze_time; int snooze_count = 0; int show_count = 0; + int promo_index = 0; std::set<std::string> shown_for_keys; };
diff --git a/components/user_education/common/feature_promo_lifecycle.cc b/components/user_education/common/feature_promo_lifecycle.cc index cdc5ac2a..45e054e 100644 --- a/components/user_education/common/feature_promo_lifecycle.cc +++ b/components/user_education/common/feature_promo_lifecycle.cc
@@ -12,6 +12,7 @@ #include "base/time/time.h" #include "components/user_education/common/feature_promo_data.h" #include "components/user_education/common/feature_promo_result.h" +#include "components/user_education/common/feature_promo_specification.h" #include "components/user_education/common/feature_promo_storage_service.h" #include "components/user_education/common/help_bubble.h" #include "components/user_education/common/user_education_features.h" @@ -33,6 +34,7 @@ storage_service_->SavePromoData(*iph_feature_, promo_data_); } + FeaturePromoData* get() { return &promo_data_; } FeaturePromoData* operator->() { return &promo_data_; } private: @@ -48,12 +50,18 @@ const base::StringPiece& promo_key, const base::Feature* iph_feature, PromoType promo_type, - PromoSubtype promo_subtype) + PromoSubtype promo_subtype, + int num_rotating_entries = 0) : storage_service_(storage_service), promo_key_(promo_key), iph_feature_(iph_feature), promo_type_(promo_type), - promo_subtype_(promo_subtype) {} + promo_subtype_(promo_subtype), + num_rotating_entries_(num_rotating_entries) { + CHECK_EQ(promo_type_ == PromoType::kRotating, num_rotating_entries_ > 0) + << "Number of rotating entries should be nonzero if and only if promo " + "type is rotating."; +} FeaturePromoLifecycle::~FeaturePromoLifecycle() { MaybeEndPromo(); @@ -82,6 +90,11 @@ case PromoType::kTutorial: result = CanShowSnoozePromo(*data); break; + case PromoType::kRotating: + // Cache the next promo index for later. + MaybeCachePromoIndex(&*data); + // For now, rotating promos can continue to show indefinitely. + return FeaturePromoResult::Success(); case PromoType::kUnspecified: NOTREACHED(); result = FeaturePromoResult::kPermanentlyDismissed; @@ -123,12 +136,21 @@ return !features::IsUserEducationV2() || storage_service_->GetSnoozeCount(*iph_feature_) < features::GetMaxSnoozeCount(); + case PromoType::kRotating: + // TODO(dfried): Should snooze promos be allowed in rotating promos? + return true; case PromoType::kUnspecified: NOTREACHED(); return false; } } +int FeaturePromoLifecycle::GetPromoIndex() const { + CHECK_EQ(PromoType::kRotating, promo_type_); + MaybeCachePromoIndex(nullptr); + return *promo_index_; +} + void FeaturePromoLifecycle::OnPromoShown( std::unique_ptr<HelpBubble> help_bubble, feature_engagement::Tracker* tracker) { @@ -248,14 +270,51 @@ return storage_service_->GetCurrentTime(); } +void FeaturePromoLifecycle::MaybeCachePromoIndex( + const FeaturePromoData* data) const { + if (promo_index_.has_value()) { + return; + } + if (data) { + promo_index_ = data->promo_index; + } else { + const auto new_data = storage_service_->ReadPromoData(*iph_feature_); + if (!new_data) { + promo_index_ = 0; + return; + } + promo_index_ = new_data->promo_index; + } + + // If promo index was just read, it may exceed the number of entries; if this + // is the case, wrap back around to zero. + if (promo_index_ >= num_rotating_entries_) { + promo_index_ = 0; + } +} + void FeaturePromoLifecycle::MaybeWriteClosedPromoData( FeaturePromoClosedReason close_reason) { - if (is_demo() || wrote_close_data_) { + if (wrote_close_data_) { return; } wrote_close_data_ = true; + const bool is_rotating = promo_type_ == PromoType::kRotating; + + if (is_demo()) { + // Increment promo index for rotating promos even in demo mode so that each + // promo in the rotation can be tested. + if (is_rotating) { + ScopedPromoData data(storage_service_, iph_feature_); + MaybeCachePromoIndex(data.get()); + data->promo_index = GetPromoIndex() + 1; + } + // Don't write any other data for demo promos. + return; + } + switch (close_reason) { case FeaturePromoClosedReason::kAction: case FeaturePromoClosedReason::kCancel: @@ -266,8 +325,13 @@ if (!promo_key_.empty()) { data->shown_for_keys.insert(promo_key_); } - data->is_dismissed = true; data->last_dismissed_by = close_reason; + if (is_rotating) { + MaybeCachePromoIndex(data.get()); + data->promo_index = GetPromoIndex() + 1; + } else { + data->is_dismissed = true; + } break; } @@ -275,6 +339,8 @@ ScopedPromoData data(storage_service_, iph_feature_); ++data->snooze_count; data->last_snooze_time = GetCurrentTime(); + // TODO(dfried): Should rotating promos that have been snoozed increment? + // Should snooze promos even be allowed in a rotating promo? break; } @@ -298,10 +364,6 @@ action_name.append(iph_feature_->name); base::RecordComputedAction(action_name); - // Record Promo type - UMA_HISTOGRAM_ENUMERATION("UserEducation.MessageShown.Type", promo_type_); - UMA_HISTOGRAM_ENUMERATION("UserEducation.MessageShown.Subtype", - promo_subtype_); std::string type_action_name = "UserEducation.MessageShown."; switch (promo_subtype_) { case PromoSubtype::kNormal: @@ -319,6 +381,11 @@ type_action_name.append("ActionableAlert."); break; } + + UMA_HISTOGRAM_ENUMERATION("UserEducation.MessageShown.Subtype", + promo_subtype_); + + UMA_HISTOGRAM_ENUMERATION("UserEducation.MessageShown.Type", promo_type_); switch (promo_type_) { case PromoType::kLegacy: type_action_name.append("Legacy"); @@ -335,6 +402,19 @@ case PromoType::kTutorial: type_action_name.append("Tutorial"); break; + case PromoType::kRotating: + // Want to track exactly which messages are being shown in a rotating + // promo. Because the suggested cap on exact linear histograms is 100, use + // that as the max allowed value. + // + // Note that the +1 is not an increment, but rather reflects that + // histograms are 1-indexed rather than 0-indexed. Therefore, the first + // promo is promo 1, not 0. + UMA_HISTOGRAM_EXACT_LINEAR( + "UserEducation.MessageShown.RotatingPromoIndex", GetPromoIndex() + 1, + 100); + type_action_name.append("Rotating"); + break; case PromoType::kUnspecified: NOTREACHED(); } @@ -390,7 +470,7 @@ base::RecordComputedAction(action_name); // Record the histogram. - const std::string histogram_name = + std::string histogram_name = std::string("UserEducation.MessageAction.").append(iph_feature()->name); base::UmaHistogramEnumeration( histogram_name, static_cast<FeaturePromoClosedReason>(close_reason));
diff --git a/components/user_education/common/feature_promo_lifecycle.h b/components/user_education/common/feature_promo_lifecycle.h index ab2866fa4..55d2483 100644 --- a/components/user_education/common/feature_promo_lifecycle.h +++ b/components/user_education/common/feature_promo_lifecycle.h
@@ -35,7 +35,8 @@ const base::StringPiece& promo_key, const base::Feature* iph_feature, PromoType promo_type, - PromoSubtype promo_subtype); + PromoSubtype promo_subtype, + int num_rotating_entries); ~FeaturePromoLifecycle(); FeaturePromoLifecycle(const FeaturePromoLifecycle&) = delete; @@ -50,6 +51,12 @@ // be snoozed if it were shown; meaningless if `CanShow()` is false. bool CanSnooze() const; + // For rotating promos only; retrieves the current promo index. The index will + // be incremented when the promo data is written. The value returned will be + // clamped to the number of rotating promo entries, exclusive, such that if + // the current value exceeds the number of entries it will wrap around to 0. + int GetPromoIndex() const; + // Notifies that the promo was shown. `tracker` will be used to release the // feature when the promo ends. void OnPromoShown(std::unique_ptr<HelpBubble> help_bubble, @@ -112,6 +119,10 @@ // `storage_service` and can be overridden by tests. base::Time GetCurrentTime() const; + // If `promo_index_` isn't yet known, reads it from `data`; if `data` is null, + // reads it from the storage service instead. + void MaybeCachePromoIndex(const FeaturePromoData* data) const; + // The service that stores non-transient data about the IPH. const raw_ptr<FeaturePromoStorageService> storage_service_; @@ -122,6 +133,11 @@ const raw_ptr<const base::Feature> iph_feature_; const PromoType promo_type_; const PromoSubtype promo_subtype_; + const int num_rotating_entries_; + + // These are cached values for rotating promos that are applied later when the + // data for the promo is updated. + mutable std::optional<int> promo_index_; // The current state of the promo. State state_ = State::kNotStarted;
diff --git a/components/user_education/common/feature_promo_lifecycle_unittest.cc b/components/user_education/common/feature_promo_lifecycle_unittest.cc index 4fbb634..4a90e8f3 100644 --- a/components/user_education/common/feature_promo_lifecycle_unittest.cc +++ b/components/user_education/common/feature_promo_lifecycle_unittest.cc
@@ -41,6 +41,7 @@ base::FEATURE_ENABLED_BY_DEFAULT); constexpr char kAppName[] = "App1"; constexpr char kAppName2[] = "App2"; +constexpr int kNumRotatingPromos = 3; DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE(kTestElementId); const ui::ElementContext kTestElementContext{1}; @@ -114,7 +115,8 @@ app_id = promo_subtype() == PromoSubtype::kKeyedNotice ? kAppName : ""; } return std::make_unique<FeaturePromoLifecycle>( - &storage_service_, app_id, &feature, promo_type(), promo_subtype()); + &storage_service_, app_id, &feature, promo_type(), promo_subtype(), + promo_type() == PromoType::kRotating ? kNumRotatingPromos : 0); } std::unique_ptr<test::TestHelpBubble> CreateHelpBubble() { @@ -167,6 +169,9 @@ case PromoType::kTutorial: name.append("Tutorial"); break; + case PromoType::kRotating: + name.append("Rotating"); + break; case PromoType::kUnspecified: NOTREACHED(); return; @@ -302,6 +307,43 @@ EXPECT_EQ(1, promo_data->show_count); } +TEST_F(FeaturePromoLifecycleTest, RotatingPromoIndex) { + set_promo_type(PromoType::kRotating); + + // The tracker will be dismissed every time the promo is ended. + EXPECT_CALL(tracker_, Dismissed).Times(4); + + auto lifecycle = CreateLifecycle(kTestIPHFeature); + EXPECT_EQ(0, lifecycle->GetPromoIndex()); + EXPECT_TRUE(lifecycle->CanShow()); + lifecycle->OnPromoShown(CreateHelpBubble(), &tracker_); + lifecycle->OnPromoEnded(CloseReason::kDismiss, false); + auto promo_data = storage_service_.ReadPromoData(kTestIPHFeature); + EXPECT_EQ(1, promo_data->promo_index); + + lifecycle = CreateLifecycle(kTestIPHFeature); + EXPECT_EQ(1, lifecycle->GetPromoIndex()); + lifecycle->OnPromoShown(CreateHelpBubble(), &tracker_); + lifecycle->OnPromoEnded(CloseReason::kDismiss, false); + promo_data = storage_service_.ReadPromoData(kTestIPHFeature); + EXPECT_EQ(2, promo_data->promo_index); + + lifecycle = CreateLifecycle(kTestIPHFeature); + EXPECT_EQ(2, lifecycle->GetPromoIndex()); + EXPECT_TRUE(lifecycle->CanShow()); + lifecycle->OnPromoShown(CreateHelpBubble(), &tracker_); + lifecycle->OnPromoEnded(CloseReason::kDismiss, false); + promo_data = storage_service_.ReadPromoData(kTestIPHFeature); + EXPECT_EQ(3, promo_data->promo_index); + + lifecycle = CreateLifecycle(kTestIPHFeature); + EXPECT_EQ(0, lifecycle->GetPromoIndex()); + lifecycle->OnPromoShown(CreateHelpBubble(), &tracker_); + lifecycle->OnPromoEnded(CloseReason::kDismiss, false); + promo_data = storage_service_.ReadPromoData(kTestIPHFeature); + EXPECT_EQ(1, promo_data->promo_index); +} + template <typename... Args> class FeaturePromoLifecycleParamTest : public FeaturePromoLifecycleTest, @@ -331,7 +373,8 @@ app_id = promo_subtype() == PromoSubtype::kKeyedNotice ? kAppName : ""; } return std::make_unique<FeaturePromoLifecycle>( - &storage_service_, app_id, &feature, promo_type(), promo_subtype()); + &storage_service_, app_id, &feature, promo_type(), promo_subtype(), + promo_type() == PromoType::kRotating ? kNumRotatingPromos : 0); } }; @@ -355,7 +398,7 @@ CloseReason::kFeatureEngaged)), (ParamToString<PromoType, PromoSubtype, CloseReason>)); -TEST_P(FeaturePromoLifecycleWriteDataTest, DemoDoesNotWriteData) { +TEST_P(FeaturePromoLifecycleWriteDataTest, DoesDemoWriteData) { auto lifecycle = CreateLifecycle(kTestIPHFeature); lifecycle->OnPromoShownForDemo(CreateHelpBubble()); lifecycle->OnPromoEnded(GetParamT<CloseReason>());
diff --git a/components/user_education/common/feature_promo_session_policy.cc b/components/user_education/common/feature_promo_session_policy.cc index 41eab03..41c4f299 100644 --- a/components/user_education/common/feature_promo_session_policy.cc +++ b/components/user_education/common/feature_promo_session_policy.cc
@@ -115,6 +115,7 @@ switch (spec.promo_type()) { case FeaturePromoSpecification::PromoType::kToast: case FeaturePromoSpecification::PromoType::kLegacy: + case FeaturePromoSpecification::PromoType::kRotating: promo_info.weight = PromoWeight::kLight; break; case FeaturePromoSpecification::PromoType::kSnooze:
diff --git a/components/user_education/common/feature_promo_session_policy.h b/components/user_education/common/feature_promo_session_policy.h index 4ab7163b..724e6b2 100644 --- a/components/user_education/common/feature_promo_session_policy.h +++ b/components/user_education/common/feature_promo_session_policy.h
@@ -30,7 +30,7 @@ // IPH in interactivity). enum class PromoWeight { kLight, kHeavy }; - // Describes wehter the promotion is high-priority, such as a mandatory + // Describes whether the promotion is high-priority, such as a mandatory // legal or privacy notice. enum class PromoPriority { kLow, kMedium, kHigh };
diff --git a/components/user_education/common/feature_promo_specification.cc b/components/user_education/common/feature_promo_specification.cc index 1316b06..38ab72f 100644 --- a/components/user_education/common/feature_promo_specification.cc +++ b/components/user_education/common/feature_promo_specification.cc
@@ -10,6 +10,7 @@ #include "base/containers/flat_set.h" #include "base/feature_list.h" #include "base/functional/callback_forward.h" +#include "base/notreached.h" #include "components/strings/grit/components_strings.h" #include "ui/base/accelerators/accelerator.h" #include "ui/base/interaction/element_identifier.h" @@ -64,6 +65,17 @@ return false; } +bool IsAllowedRotatingPromo(const base::Feature& promo_feature) { + // Add the text names of allowlisted keyed notices here: + static const char* const kAllowedPromoNames[] = {}; + for (const auto* promo_name : kAllowedPromoNames) { + if (!strcmp(promo_feature.name, promo_name)) { + return true; + } + } + return false; +} + bool IsAllowedLegacyPromo(const base::Feature& promo_feature) { // NOTE: LEGACY PROMOS ARE DEPRECATED. // NO NEW ITEMS SHOULD BE ADDED TO THIS LIST, EVER. @@ -280,6 +292,32 @@ } // static +FeaturePromoSpecification FeaturePromoSpecification::CreateForRotatingPromo( + const base::Feature& feature, + RotatingPromos rotating_promos) { + CHECK(IsAllowedRotatingPromo(feature)); + FeaturePromoSpecification spec; + spec.feature_ = &feature; + spec.promo_type_ = PromoType::kRotating; + + // Check the rotating promos to ensure they're all normal promos. + for (const auto& promo : rotating_promos) { + if (promo) { + CHECK_EQ(PromoSubtype::kNormal, promo->promo_subtype()) + << "Rotating promo cannot contain promo of type " + << promo->promo_type() << " and subtype " << promo->promo_subtype(); + CHECK_NE(PromoType::kLegacy, promo->promo_type()) + << "Rotating promo cannot contain promo of type Legacy"; + CHECK_NE(PromoType::kUnspecified, promo->promo_type()) + << "Rotating promo cannot contain promo of type Unspecified"; + } + } + spec.rotating_promos_ = std::move(rotating_promos); + + return spec; +} + +// static FeaturePromoSpecification FeaturePromoSpecification::CreateForLegacyPromo( const base::Feature* feature, ui::ElementIdentifier anchor_element_id, @@ -321,6 +359,8 @@ FeaturePromoSpecification& FeaturePromoSpecification::SetPromoSubtype( PromoSubtype promo_subtype) { CHECK_NE(promo_type_, PromoType::kUnspecified); + CHECK_NE(promo_type_, PromoType::kRotating) + << "Rotating is not compatible with other promo subtypes."; CHECK_NE(promo_type_, PromoType::kSnooze) << "Basic snooze is not compatible with other promo subtypes."; switch (promo_subtype) { @@ -427,6 +467,9 @@ case FeaturePromoSpecification::PromoType::kUnspecified: oss << "kUnspecified"; break; + case FeaturePromoSpecification::PromoType::kRotating: + oss << "kRotating"; + break; } return oss; }
diff --git a/components/user_education/common/feature_promo_specification.h b/components/user_education/common/feature_promo_specification.h index dc559b48..c28b4599 100644 --- a/components/user_education/common/feature_promo_specification.h +++ b/components/user_education/common/feature_promo_specification.h
@@ -151,7 +151,11 @@ // A simple promo that acts like a toast but without the required // accessibility data. kLegacy = 5, - kMaxValue = kLegacy + // Rotating promos have a list of different promos they cycle between. + // Because they are shown over and over, possibly at startup, this type + // requires being on an allowlist. + kRotating = 6, + kMaxValue = kRotating }; // These values are persisted to logs. Entries should not be renumbered and @@ -201,6 +205,11 @@ ValueType value_; }; + // A list of rotating promos. The order or index of promos should not change, + // but a promo can be replaced with `std::nullopt` or another promo if it + // becomes deprecated. + using RotatingPromos = std::vector<std::optional<FeaturePromoSpecification>>; + FeaturePromoSpecification(); FeaturePromoSpecification(FeaturePromoSpecification&& other) noexcept; FeaturePromoSpecification& operator=( @@ -268,6 +277,11 @@ int custom_action_string_id, CustomActionCallback custom_action_callback); + // Specifies a promo that shows a rotating set of promos. + static FeaturePromoSpecification CreateForRotatingPromo( + const base::Feature& feature, + RotatingPromos rotating_promos); + // Specifies a text-only promo without additional accessibility information. // Deprecated. Only included for backwards compatibility with existing // promos. This is the only case in which |feature| can be null, and if it is @@ -299,8 +313,10 @@ // can be done to fix it. FeaturePromoSpecification& OverrideFocusOnShow(bool focus_on_show); - // Set the promo subtype. Setting the subtype to LegalNotice requires being on - // an allowlist. + // Set the promo subtype. Setting the subtype to most values other than + // `kNormal` requires being on an allowlist. + // + // For rotating promos, use CreateForRotatingPromo() instead. FeaturePromoSpecification& SetPromoSubtype(PromoSubtype promo_subtype); // Set the anchor element filter. @@ -386,6 +402,9 @@ return SetMetadata(Metadata(std::forward<Args>(args)...)); } + // Only valid for rotating promo subtype. + const RotatingPromos& rotating_promos() const { return rotating_promos_; } + // Force the subtype to a particular value, bypassing permission checks. FeaturePromoSpecification& set_promo_subtype_for_testing( PromoSubtype promo_subtype) { @@ -471,6 +490,9 @@ // Additional conditions describing when the promo can show. AdditionalConditions additional_conditions_; + // For rotating promos, maintain a list of sub-promos. + RotatingPromos rotating_promos_; + // Metadata for this promo. Metadata metadata_; };
diff --git a/components/vector_icons/account_circle_chrome_refresh.icon b/components/vector_icons/account_circle_chrome_refresh.icon index 32fa3ff7..772cc03 100644 --- a/components/vector_icons/account_circle_chrome_refresh.icon +++ b/components/vector_icons/account_circle_chrome_refresh.icon
@@ -1,195 +1,137 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -CANVAS_DIMENSIONS, 24, -MOVE_TO, 5.88f, 17.01f, -R_ARC_TO, 10.38f, 10.38f, 0, 0, 1, 2.84f, -1.52f, -R_ARC_TO, 9.81f, 9.81f, 0, 0, 1, 3.28f, -0.55f, -R_CUBIC_TO, 1.15f, 0, 2.25f, 0.19f, 3.29f, 0.56f, -R_CUBIC_TO, 1.05f, 0.38f, 1.99f, 0.88f, 2.83f, 1.51f, -R_ARC_TO, 7.94f, 7.94f, 0, 0, 0, 1.33f, -2.3f, -ARC_TO, 7.68f, 7.68f, 0, 0, 0, 19.93f, 12, -R_CUBIC_TO, 0, -2.19f, -0.77f, -4.06f, -2.32f, -5.61f, -CUBIC_TO, 16.06f, 4.85f, 14.19f, 4.07f, 12, 4.07f, -R_CUBIC_TO, -2.19f, 0, -4.06f, 0.77f, -5.61f, 2.32f, -CUBIC_TO, 4.85f, 7.94f, 4.07f, 9.81f, 4.07f, 12, -R_CUBIC_TO, 0, 0.97f, 0.16f, 1.87f, 0.47f, 2.71f, -R_ARC_TO, 7.83f, 7.83f, 0, 0, 0, 1.34f, 2.3f, -CLOSE, -MOVE_TO, 12, 13.06f, -R_CUBIC_TO, -1, 0, -1.84f, -0.34f, -2.52f, -1.02f, -R_CUBIC_TO, -0.68f, -0.68f, -1.02f, -1.52f, -1.02f, -2.52f, -R_CUBIC_TO, 0, -1, 0.34f, -1.84f, 1.02f, -2.52f, -CUBIC_TO, 10.16f, 6.31f, 11, 5.97f, 12, 5.97f, -R_CUBIC_TO, 1, 0, 1.84f, 0.34f, 2.52f, 1.02f, -R_CUBIC_TO, 0.68f, 0.68f, 1.02f, 1.52f, 1.02f, 2.52f, -R_CUBIC_TO, 0, 1, -0.34f, 1.84f, -1.02f, 2.52f, -CUBIC_TO, 13.84f, 12.71f, 13, 13.05f, 12, 13.05f, -CLOSE, -R_MOVE_TO, 0, 9.15f, -R_ARC_TO, 9.92f, 9.92f, 0, 0, 1, -3.98f, -0.8f, -R_ARC_TO, 10.35f, 10.35f, 0, 0, 1, -3.24f, -2.18f, -R_CUBIC_TO, -0.92f, -0.92f, -1.65f, -2, -2.18f, -3.24f, -ARC_TO, 9.94f, 9.94f, 0, 0, 1, 1.8f, 12, -R_CUBIC_TO, 0, -1.41f, 0.27f, -2.74f, 0.8f, -3.98f, -R_ARC_TO, 10.35f, 10.35f, 0, 0, 1, 2.18f, -3.24f, -R_CUBIC_TO, 0.92f, -0.92f, 2, -1.65f, 3.24f, -2.18f, -ARC_TO, 9.94f, 9.94f, 0, 0, 1, 12, 1.8f, -R_CUBIC_TO, 1.41f, 0, 2.74f, 0.27f, 3.98f, 0.8f, -R_ARC_TO, 10.35f, 10.35f, 0, 0, 1, 3.24f, 2.18f, -R_CUBIC_TO, 0.92f, 0.92f, 1.65f, 2, 2.18f, 3.24f, -R_CUBIC_TO, 0.54f, 1.24f, 0.8f, 2.57f, 0.8f, 3.98f, -R_CUBIC_TO, 0, 1.41f, -0.26f, 2.74f, -0.8f, 3.98f, -R_ARC_TO, 10.35f, 10.35f, 0, 0, 1, -2.18f, 3.24f, -R_CUBIC_TO, -0.92f, 0.92f, -2, 1.65f, -3.24f, 2.18f, -R_ARC_TO, 9.94f, 9.94f, 0, 0, 1, -3.98f, 0.8f, -CLOSE, -R_MOVE_TO, 0, -2.27f, -R_CUBIC_TO, 0.86f, 0, 1.68f, -0.12f, 2.43f, -0.37f, -R_ARC_TO, 7.55f, 7.55f, 0, 0, 0, 2.11f, -1.07f, -R_ARC_TO, 7.8f, 7.8f, 0, 0, 0, -2.11f, -1.07f, -R_ARC_TO, 7.78f, 7.78f, 0, 0, 0, -2.44f, -0.37f, -R_CUBIC_TO, -0.87f, 0, -1.69f, 0.12f, -2.43f, 0.37f, -R_CUBIC_TO, -0.75f, 0.25f, -1.45f, 0.61f, -2.11f, 1.07f, -R_ARC_TO, 7.65f, 7.65f, 0, 0, 0, 2.11f, 1.08f, -R_CUBIC_TO, 0.76f, 0.25f, 1.57f, 0.38f, 2.43f, 0.38f, -CLOSE, -R_MOVE_TO, 0, -8.96f, -R_CUBIC_TO, 0.42f, 0, 0.77f, -0.14f, 1.04f, -0.41f, -R_CUBIC_TO, 0.28f, -0.27f, 0.41f, -0.62f, 0.41f, -1.04f, -R_CUBIC_TO, 0, -0.42f, -0.14f, -0.76f, -0.41f, -1.04f, -R_CUBIC_TO, -0.27f, -0.28f, -0.62f, -0.41f, -1.04f, -0.41f, -R_CUBIC_TO, -0.42f, 0, -0.77f, 0.14f, -1.04f, 0.41f, -R_CUBIC_TO, -0.28f, 0.28f, -0.41f, 0.63f, -0.41f, 1.04f, -R_CUBIC_TO, 0, 0.42f, 0.14f, 0.77f, 0.41f, 1.04f, -R_CUBIC_TO, 0.27f, 0.28f, 0.62f, 0.41f, 1.04f, 0.41f, -CLOSE - CANVAS_DIMENSIONS, 20, -MOVE_TO, 4.96f, 13.99f, -R_ARC_TO, 8.24f, 8.24f, 0, 0, 1, 2.4f, -1.16f, -R_ARC_TO, 9.28f, 9.28f, 0, 0, 1, 2.64f, -0.37f, -R_CUBIC_TO, 0.91f, 0, 1.8f, 0.13f, 2.65f, 0.38f, -R_ARC_TO, 8.34f, 8.34f, 0, 0, 1, 2.39f, 1.15f, -R_ARC_TO, 5.84f, 5.84f, 0, 0, 0, 1.06f, -1.87f, -R_CUBIC_TO, 0.23f, -0.68f, 0.34f, -1.38f, 0.34f, -2.12f, -R_CUBIC_TO, 0, -1.78f, -0.63f, -3.3f, -1.89f, -4.55f, -R_CUBIC_TO, -1.26f, -1.26f, -2.78f, -1.89f, -4.56f, -1.89f, -R_CUBIC_TO, -1.78f, 0, -3.3f, 0.63f, -4.55f, 1.89f, -CUBIC_TO, 4.19f, 6.7f, 3.56f, 8.22f, 3.56f, 10, -R_CUBIC_TO, 0, 0.73f, 0.11f, 1.44f, 0.34f, 2.11f, -R_CUBIC_TO, 0.23f, 0.68f, 0.58f, 1.3f, 1.06f, 1.88f, +FILL_RULE_NONZERO, +MOVE_TO, 4.94f, 14.06f, +R_ARC_TO, 8.24f, 8.24f, 0, 0, 1, 2.41f, -1.18f, +ARC_TO, 9.14f, 9.14f, 0, 0, 1, 10, 12.5f, +R_CUBIC_TO, 0.92f, 0, 1.8f, 0.13f, 2.66f, 0.39f, +R_ARC_TO, 8.24f, 8.24f, 0, 0, 1, 2.41f, 1.18f, +R_ARC_TO, 5.78f, 5.78f, 0, 0, 0, 1.08f, -1.89f, +ARC_TO, 6.64f, 6.64f, 0, 0, 0, 16.5f, 10, +R_CUBIC_TO, 0, -1.8f, -0.63f, -3.34f, -1.9f, -4.6f, +CUBIC_TO, 13.33f, 4.13f, 11.8f, 3.5f, 10, 3.5f, +R_CUBIC_TO, -1.8f, 0, -3.34f, 0.63f, -4.6f, 1.9f, +CUBIC_TO, 4.13f, 6.66f, 3.5f, 8.2f, 3.5f, 10, +R_CUBIC_TO, 0, 0.75f, 0.12f, 1.47f, 0.36f, 2.17f, +R_ARC_TO, 5.78f, 5.78f, 0, 0, 0, 1.08f, 1.9f, CLOSE, -MOVE_TO, 10, 11.54f, -R_CUBIC_TO, -0.85f, 0, -1.57f, -0.29f, -2.16f, -0.88f, -R_CUBIC_TO, -0.59f, -0.59f, -0.88f, -1.31f, -0.88f, -2.15f, -R_CUBIC_TO, 0, -0.85f, 0.29f, -1.57f, 0.88f, -2.16f, -ARC_TO, 2.94f, 2.94f, 0, 0, 1, 10, 5.47f, -R_CUBIC_TO, 0.85f, 0, 1.57f, 0.3f, 2.16f, 0.89f, -R_CUBIC_TO, 0.59f, 0.59f, 0.88f, 1.31f, 0.88f, 2.16f, -R_CUBIC_TO, 0, 0.84f, -0.29f, 1.56f, -0.88f, 2.15f, -R_CUBIC_TO, -0.59f, 0.59f, -1.31f, 0.88f, -2.16f, 0.88f, +MOVE_TO, 10, 11.5f, +R_ARC_TO, 2.9f, 2.9f, 0, 0, 1, -2.12f, -0.87f, +ARC_TO, 2.9f, 2.9f, 0, 0, 1, 7, 8.5f, +R_CUBIC_TO, 0, -0.83f, 0.29f, -1.54f, 0.88f, -2.12f, +ARC_TO, 2.9f, 2.9f, 0, 0, 1, 10, 5.5f, +R_CUBIC_TO, 0.83f, 0, 1.54f, 0.29f, 2.13f, 0.88f, +R_CUBIC_TO, 0.58f, 0.58f, 0.88f, 1.29f, 0.88f, 2.13f, +R_CUBIC_TO, 0, 0.83f, -0.29f, 1.54f, -0.87f, 2.13f, +ARC_TO, 2.9f, 2.9f, 0, 0, 1, 10, 11.5f, CLOSE, -R_MOVE_TO, 0, 6.63f, -R_ARC_TO, 7.96f, 7.96f, 0, 0, 1, -3.17f, -0.64f, -R_ARC_TO, 8.25f, 8.25f, 0, 0, 1, -2.61f, -1.75f, -R_ARC_TO, 8.25f, 8.25f, 0, 0, 1, -1.75f, -2.61f, -R_ARC_TO, 7.97f, 7.97f, 0, 0, 1, -0.64f, -3.18f, -R_CUBIC_TO, 0, -1.12f, 0.21f, -2.18f, 0.64f, -3.17f, -R_ARC_TO, 8.29f, 8.29f, 0, 0, 1, 1.75f, -2.6f, -R_ARC_TO, 8.25f, 8.25f, 0, 0, 1, 2.61f, -1.75f, -R_ARC_TO, 7.97f, 7.97f, 0, 0, 1, 3.18f, -0.64f, -R_CUBIC_TO, 1.13f, 0, 2.18f, 0.21f, 3.17f, 0.64f, -R_ARC_TO, 8.29f, 8.29f, 0, 0, 1, 2.6f, 1.75f, -R_ARC_TO, 8.26f, 8.26f, 0, 0, 1, 1.75f, 2.6f, -R_CUBIC_TO, 0.43f, 0.99f, 0.64f, 2.05f, 0.64f, 3.17f, -R_ARC_TO, 7.96f, 7.96f, 0, 0, 1, -0.64f, 3.17f, -R_ARC_TO, 8.25f, 8.25f, 0, 0, 1, -1.75f, 2.61f, -R_ARC_TO, 8.26f, 8.26f, 0, 0, 1, -2.6f, 1.75f, -R_ARC_TO, 7.93f, 7.93f, 0, 0, 1, -3.17f, 0.64f, +R_MOVE_TO, 0, 6.5f, +R_ARC_TO, 7.8f, 7.8f, 0, 0, 1, -3.11f, -0.62f, +R_ARC_TO, 8.07f, 8.07f, 0, 0, 1, -2.55f, -1.72f, +R_ARC_TO, 8.07f, 8.07f, 0, 0, 1, -1.72f, -2.55f, +ARC_TO, 7.8f, 7.8f, 0, 0, 1, 2, 9.99f, +R_CUBIC_TO, 0, -1.1f, 0.21f, -2.14f, 0.63f, -3.1f, +R_ARC_TO, 8.12f, 8.12f, 0, 0, 1, 1.72f, -2.54f, +R_CUBIC_TO, 0.73f, -0.73f, 1.58f, -1.3f, 2.55f, -1.72f, +ARC_TO, 7.8f, 7.8f, 0, 0, 1, 10.01f, 2, +R_CUBIC_TO, 1.11f, 0, 2.14f, 0.21f, 3.11f, 0.63f, +R_ARC_TO, 8.12f, 8.12f, 0, 0, 1, 2.54f, 1.72f, +R_CUBIC_TO, 0.73f, 0.73f, 1.3f, 1.58f, 1.72f, 2.55f, +R_CUBIC_TO, 0.42f, 0.97f, 0.63f, 2, 0.63f, 3.11f, +R_ARC_TO, 7.8f, 7.8f, 0, 0, 1, -0.62f, 3.11f, +R_ARC_TO, 8.07f, 8.07f, 0, 0, 1, -1.72f, 2.55f, +R_CUBIC_TO, -0.73f, 0.73f, -1.58f, 1.3f, -2.55f, 1.72f, +R_ARC_TO, 7.75f, 7.75f, 0, 0, 1, -3.1f, 0.63f, CLOSE, -MOVE_TO, 10, 16.44f, -R_CUBIC_TO, 0.71f, 0, 1.38f, -0.11f, 2.03f, -0.33f, -R_ARC_TO, 6.9f, 6.9f, 0, 0, 0, 1.85f, -0.98f, -R_ARC_TO, 7.87f, 7.87f, 0, 0, 0, -1.86f, -0.83f, -ARC_TO, 7.25f, 7.25f, 0, 0, 0, 10, 14.03f, -R_CUBIC_TO, -0.7f, 0, -1.37f, 0.09f, -2.02f, 0.27f, -R_ARC_TO, 6.69f, 6.69f, 0, 0, 0, -1.85f, 0.84f, -R_CUBIC_TO, 0.58f, 0.43f, 1.2f, 0.75f, 1.84f, 0.98f, -R_CUBIC_TO, 0.64f, 0.22f, 1.32f, 0.33f, 2.03f, 0.33f, +MOVE_TO, 10, 16.5f, +R_CUBIC_TO, 0.72f, 0, 1.42f, -0.11f, 2.08f, -0.34f, +R_ARC_TO, 6.62f, 6.62f, 0, 0, 0, 1.88f, -1.01f, +R_ARC_TO, 7.36f, 7.36f, 0, 0, 0, -1.89f, -0.85f, +ARC_TO, 7.31f, 7.31f, 0, 0, 0, 10, 14, +R_CUBIC_TO, -0.71f, 0, -1.4f, 0.09f, -2.07f, 0.28f, +R_CUBIC_TO, -0.67f, 0.19f, -1.3f, 0.48f, -1.88f, 0.86f, +R_ARC_TO, 6.62f, 6.62f, 0, 0, 0, 1.88f, 1.01f, +R_CUBIC_TO, 0.66f, 0.23f, 1.36f, 0.34f, 2.08f, 0.34f, CLOSE, -R_MOVE_TO, 0, -6.47f, -R_CUBIC_TO, 0.4f, 0, 0.75f, -0.14f, 1.03f, -0.43f, -R_CUBIC_TO, 0.28f, -0.28f, 0.43f, -0.63f, 0.43f, -1.03f, -R_CUBIC_TO, 0, -0.41f, -0.14f, -0.75f, -0.43f, -1.03f, -ARC_TO, 1.4f, 1.4f, 0, 0, 0, 10, 7.04f, -R_CUBIC_TO, -0.4f, 0, -0.75f, 0.14f, -1.03f, 0.43f, -R_ARC_TO, 1.41f, 1.41f, 0, 0, 0, -0.43f, 1.03f, -R_CUBIC_TO, 0, 0.4f, 0.14f, 0.75f, 0.43f, 1.03f, -R_CUBIC_TO, 0.28f, 0.28f, 0.63f, 0.43f, 1.03f, 0.43f, +R_MOVE_TO, 0, -6.5f, +R_CUBIC_TO, 0.42f, 0, 0.77f, -0.14f, 1.06f, -0.44f, +R_CUBIC_TO, 0.29f, -0.29f, 0.44f, -0.64f, 0.44f, -1.06f, +R_CUBIC_TO, 0, -0.42f, -0.14f, -0.77f, -0.44f, -1.06f, +ARC_TO, 1.44f, 1.44f, 0, 0, 0, 10, 7, +R_CUBIC_TO, -0.42f, 0, -0.77f, 0.14f, -1.06f, 0.44f, +ARC_TO, 1.44f, 1.44f, 0, 0, 0, 8.5f, 8.5f, +R_CUBIC_TO, 0, 0.42f, 0.14f, 0.77f, 0.44f, 1.06f, +R_CUBIC_TO, 0.29f, 0.29f, 0.64f, 0.44f, 1.06f, 0.44f, +CLOSE, +R_MOVE_TO, 0, -1.5f, +CLOSE, +R_MOVE_TO, 0, 6.65f, CLOSE CANVAS_DIMENSIONS, 16, -MOVE_TO, 4, 11.11f, -R_ARC_TO, 6.71f, 6.71f, 0, 0, 1, 1.91f, -0.91f, -R_ARC_TO, 7.63f, 7.63f, 0, 0, 1, 2.1f, -0.29f, -R_CUBIC_TO, 0.73f, 0, 1.43f, 0.1f, 2.11f, 0.31f, -R_ARC_TO, 6.84f, 6.84f, 0, 0, 1, 1.89f, 0.9f, -R_CUBIC_TO, 0.37f, -0.46f, 0.64f, -0.95f, 0.82f, -1.47f, -R_CUBIC_TO, 0.18f, -0.52f, 0.26f, -1.07f, 0.26f, -1.64f, -R_CUBIC_TO, 0, -1.4f, -0.5f, -2.6f, -1.49f, -3.6f, -R_CUBIC_TO, -0.99f, -0.99f, -2.2f, -1.49f, -3.6f, -1.49f, -R_CUBIC_TO, -1.4f, 0, -2.6f, 0.5f, -3.59f, 1.49f, -CUBIC_TO, 3.41f, 5.4f, 2.91f, 6.6f, 2.91f, 8, -R_CUBIC_TO, 0, 0.57f, 0.09f, 1.11f, 0.26f, 1.63f, -R_ARC_TO, 4.7f, 4.7f, 0, 0, 0, 0.82f, 1.48f, +FILL_RULE_NONZERO, +MOVE_TO, 3.97f, 11.19f, +R_ARC_TO, 6.59f, 6.59f, 0, 0, 1, 1.92f, -0.92f, +R_CUBIC_TO, 0.68f, -0.2f, 1.38f, -0.3f, 2.11f, -0.3f, +R_CUBIC_TO, 0.73f, 0, 1.44f, 0.1f, 2.12f, 0.31f, +R_CUBIC_TO, 0.68f, 0.21f, 1.32f, 0.51f, 1.91f, 0.93f, +R_CUBIC_TO, 0.38f, -0.46f, 0.66f, -0.96f, 0.84f, -1.5f, +ARC_TO, 5.23f, 5.23f, 0, 0, 0, 13.15f, 8, +R_CUBIC_TO, 0, -1.43f, -0.5f, -2.64f, -1.51f, -3.64f, +R_CUBIC_TO, -1.01f, -1, -2.22f, -1.51f, -3.65f, -1.51f, +R_CUBIC_TO, -1.43f, 0, -2.64f, 0.5f, -3.64f, 1.51f, +CUBIC_TO, 3.35f, 5.36f, 2.85f, 6.58f, 2.85f, 8, +R_CUBIC_TO, 0, 0.59f, 0.09f, 1.15f, 0.27f, 1.69f, +R_CUBIC_TO, 0.18f, 0.54f, 0.47f, 1.04f, 0.85f, 1.5f, CLOSE, -MOVE_TO, 8, 9.28f, -R_ARC_TO, 2.4f, 2.4f, 0, 0, 1, -1.76f, -0.71f, -R_ARC_TO, 2.38f, 2.38f, 0, 0, 1, -0.72f, -1.75f, -R_CUBIC_TO, 0, -0.69f, 0.24f, -1.28f, 0.72f, -1.76f, -ARC_TO, 2.39f, 2.39f, 0, 0, 1, 8, 4.35f, -R_ARC_TO, 2.39f, 2.39f, 0, 0, 1, 1.76f, 0.72f, -R_CUBIC_TO, 0.48f, 0.48f, 0.72f, 1.07f, 0.72f, 1.76f, -R_CUBIC_TO, 0, 0.69f, -0.24f, 1.27f, -0.72f, 1.75f, -ARC_TO, 2.4f, 2.4f, 0, 0, 1, 8, 9.29f, +MOVE_TO, 8, 9.23f, +R_CUBIC_TO, -0.68f, 0, -1.25f, -0.23f, -1.72f, -0.7f, +R_ARC_TO, 2.35f, 2.35f, 0, 0, 1, -0.71f, -1.72f, +R_CUBIC_TO, 0, -0.68f, 0.24f, -1.25f, 0.71f, -1.72f, +ARC_TO, 2.35f, 2.35f, 0, 0, 1, 8, 4.38f, +R_CUBIC_TO, 0.68f, 0, 1.25f, 0.24f, 1.72f, 0.71f, +R_CUBIC_TO, 0.47f, 0.47f, 0.71f, 1.04f, 0.71f, 1.72f, +R_CUBIC_TO, 0, 0.68f, -0.24f, 1.25f, -0.71f, 1.72f, +ARC_TO, 2.36f, 2.36f, 0, 0, 1, 8, 9.23f, CLOSE, -R_MOVE_TO, 0, 5.43f, -R_ARC_TO, 6.52f, 6.52f, 0, 0, 1, -2.61f, -0.52f, -ARC_TO, 6.68f, 6.68f, 0, 0, 1, 3.25f, 12.75f, -R_ARC_TO, 6.68f, 6.68f, 0, 0, 1, -1.44f, -2.14f, -R_ARC_TO, 6.53f, 6.53f, 0, 0, 1, -0.52f, -2.61f, -R_CUBIC_TO, 0, -0.93f, 0.17f, -1.8f, 0.52f, -2.6f, -ARC_TO, 6.69f, 6.69f, 0, 0, 1, 3.25f, 3.25f, -R_ARC_TO, 6.68f, 6.68f, 0, 0, 1, 2.15f, -1.44f, -R_ARC_TO, 6.53f, 6.53f, 0, 0, 1, 2.61f, -0.52f, -R_CUBIC_TO, 0.93f, 0, 1.8f, 0.17f, 2.61f, 0.52f, -ARC_TO, 6.69f, 6.69f, 0, 0, 1, 12.75f, 3.25f, -R_ARC_TO, 6.7f, 6.7f, 0, 0, 1, 1.45f, 2.14f, -R_CUBIC_TO, 0.35f, 0.81f, 0.52f, 1.68f, 0.52f, 2.61f, -R_CUBIC_TO, 0, 0.93f, -0.17f, 1.79f, -0.52f, 2.61f, -R_ARC_TO, 6.68f, 6.68f, 0, 0, 1, -1.44f, 2.14f, -R_ARC_TO, 6.7f, 6.7f, 0, 0, 1, -2.14f, 1.45f, -R_ARC_TO, 6.48f, 6.48f, 0, 0, 1, -2.61f, 0.52f, +R_MOVE_TO, 0, 5.3f, +R_ARC_TO, 6.38f, 6.38f, 0, 0, 1, -2.54f, -0.51f, +R_ARC_TO, 6.59f, 6.59f, 0, 0, 1, -3.49f, -3.49f, +R_ARC_TO, 6.39f, 6.39f, 0, 0, 1, -0.51f, -2.54f, +R_CUBIC_TO, 0, -0.9f, 0.17f, -1.75f, 0.51f, -2.53f, +R_ARC_TO, 6.6f, 6.6f, 0, 0, 1, 3.49f, -3.48f, +R_ARC_TO, 6.39f, 6.39f, 0, 0, 1, 2.54f, -0.51f, +R_CUBIC_TO, 0.9f, 0, 1.75f, 0.17f, 2.54f, 0.51f, +R_ARC_TO, 6.6f, 6.6f, 0, 0, 1, 3.48f, 3.49f, +R_CUBIC_TO, 0.34f, 0.79f, 0.51f, 1.64f, 0.51f, 2.54f, +R_ARC_TO, 6.38f, 6.38f, 0, 0, 1, -0.51f, 2.54f, +R_ARC_TO, 6.59f, 6.59f, 0, 0, 1, -3.49f, 3.49f, +R_CUBIC_TO, -0.79f, 0.34f, -1.64f, 0.51f, -2.53f, 0.51f, CLOSE, -MOVE_TO, 8, 13.09f, -R_CUBIC_TO, 0.55f, 0, 1.07f, -0.08f, 1.56f, -0.25f, -R_ARC_TO, 5.72f, 5.72f, 0, 0, 0, 1.45f, -0.75f, -R_ARC_TO, 6.57f, 6.57f, 0, 0, 0, -1.46f, -0.63f, -ARC_TO, 5.64f, 5.64f, 0, 0, 0, 8, 11.26f, -R_CUBIC_TO, -0.56f, 0, -1.07f, 0.06f, -1.55f, 0.2f, -R_CUBIC_TO, -0.48f, 0.13f, -0.96f, 0.34f, -1.44f, 0.64f, -R_CUBIC_TO, 0.47f, 0.33f, 0.95f, 0.58f, 1.44f, 0.75f, -R_CUBIC_TO, 0.49f, 0.17f, 1.01f, 0.25f, 1.56f, 0.25f, +MOVE_TO, 8, 13.15f, +R_CUBIC_TO, 0.57f, 0, 1.11f, -0.09f, 1.62f, -0.26f, +R_ARC_TO, 5.38f, 5.38f, 0, 0, 0, 1.48f, -0.78f, +R_ARC_TO, 6.2f, 6.2f, 0, 0, 0, -1.49f, -0.66f, +ARC_TO, 5.74f, 5.74f, 0, 0, 0, 8, 11.22f, +R_CUBIC_TO, -0.56f, 0, -1.1f, 0.07f, -1.61f, 0.21f, +R_ARC_TO, 5.29f, 5.29f, 0, 0, 0, -1.48f, 0.67f, +R_CUBIC_TO, 0.46f, 0.34f, 0.96f, 0.61f, 1.47f, 0.78f, +ARC_TO, 4.99f, 4.99f, 0, 0, 0, 8, 13.15f, CLOSE, -R_MOVE_TO, 0, -5.14f, -R_CUBIC_TO, 0.31f, 0, 0.57f, -0.11f, 0.79f, -0.33f, -R_CUBIC_TO, 0.22f, -0.22f, 0.33f, -0.48f, 0.33f, -0.79f, -R_ARC_TO, 1.1f, 1.1f, 0, 0, 0, -0.33f, -0.8f, -ARC_TO, 1.08f, 1.08f, 0, 0, 0, 8, 5.68f, -R_CUBIC_TO, -0.31f, 0, -0.57f, 0.11f, -0.79f, 0.34f, -R_ARC_TO, 1.1f, 1.1f, 0, 0, 0, -0.33f, 0.8f, -R_CUBIC_TO, 0, 0.31f, 0.11f, 0.57f, 0.33f, 0.79f, -R_CUBIC_TO, 0.22f, 0.22f, 0.48f, 0.33f, 0.79f, 0.33f, +R_MOVE_TO, 0, -5.17f, +R_CUBIC_TO, 0.32f, 0, 0.6f, -0.11f, 0.82f, -0.34f, +R_CUBIC_TO, 0.23f, -0.23f, 0.34f, -0.5f, 0.34f, -0.82f, +R_CUBIC_TO, 0, -0.32f, -0.11f, -0.6f, -0.34f, -0.83f, +R_CUBIC_TO, -0.23f, -0.23f, -0.5f, -0.34f, -0.82f, -0.34f, +R_CUBIC_TO, -0.32f, 0, -0.6f, 0.11f, -0.82f, 0.34f, +R_CUBIC_TO, -0.23f, 0.23f, -0.34f, 0.5f, -0.34f, 0.83f, +R_CUBIC_TO, 0, 0.32f, 0.11f, 0.6f, 0.34f, 0.82f, +R_CUBIC_TO, 0.23f, 0.23f, 0.5f, 0.34f, 0.82f, 0.34f, +CLOSE, +R_MOVE_TO, 0, -1.17f, +CLOSE, +R_MOVE_TO, 0, 5.3f, CLOSE \ No newline at end of file
diff --git a/components/vector_icons/business_chrome_refresh.icon b/components/vector_icons/business_chrome_refresh.icon index 0ceda76a..aecc447 100644 --- a/components/vector_icons/business_chrome_refresh.icon +++ b/components/vector_icons/business_chrome_refresh.icon
@@ -1,18 +1,19 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 1.31f, 14.04f, -V_LINE_TO, 2.26f, -R_H_LINE_TO, 6.98f, -V_LINE_TO, 4.66f, +FILL_RULE_NONZERO, +MOVE_TO, 1.48f, 13.79f, +V_LINE_TO, 2.34f, +R_H_LINE_TO, 6.65f, +R_V_LINE_TO, 2.4f, R_H_LINE_TO, 6.4f, -R_V_LINE_TO, 9.38f, +R_V_LINE_TO, 9.05f, CLOSE, -MOVE_TO, 2.8f, 12.54f, +MOVE_TO, 2.8f, 12.46f, H_LINE_TO, 4, -V_LINE_TO, 11.34f, +R_V_LINE_TO, -1.2f, H_LINE_TO, 2.8f, CLOSE, R_MOVE_TO, 0, -2.53f, @@ -22,17 +23,17 @@ CLOSE, R_MOVE_TO, 0, -2.53f, H_LINE_TO, 4, -V_LINE_TO, 6.27f, +V_LINE_TO, 6.19f, H_LINE_TO, 2.8f, CLOSE, R_MOVE_TO, 0, -2.54f, H_LINE_TO, 4, -V_LINE_TO, 3.74f, +V_LINE_TO, 3.66f, H_LINE_TO, 2.8f, CLOSE, R_MOVE_TO, 2.8f, 7.6f, R_H_LINE_TO, 1.2f, -V_LINE_TO, 11.34f, +R_V_LINE_TO, -1.2f, H_LINE_TO, 5.6f, CLOSE, R_MOVE_TO, 0, -2.53f, @@ -42,17 +43,17 @@ CLOSE, R_MOVE_TO, 0, -2.53f, R_H_LINE_TO, 1.2f, -V_LINE_TO, 6.27f, +V_LINE_TO, 6.19f, H_LINE_TO, 5.6f, CLOSE, R_MOVE_TO, 0, -2.54f, R_H_LINE_TO, 1.2f, -V_LINE_TO, 3.74f, +V_LINE_TO, 3.66f, H_LINE_TO, 5.6f, CLOSE, -MOVE_TO, 8, 12.54f, +MOVE_TO, 8, 12.46f, R_H_LINE_TO, 5.2f, -V_LINE_TO, 6.14f, +V_LINE_TO, 6.06f, H_LINE_TO, 8, R_V_LINE_TO, 1.34f, R_H_LINE_TO, 1.2f, @@ -72,6 +73,4 @@ R_V_LINE_TO, -1.2f, H_LINE_TO, 12, R_V_LINE_TO, 1.2f, -CLOSE, -R_MOVE_TO, 0, 0, CLOSE
diff --git a/components/vector_icons/close_chrome_refresh.icon b/components/vector_icons/close_chrome_refresh.icon index a0ed528..0be211f 100644 --- a/components/vector_icons/close_chrome_refresh.icon +++ b/components/vector_icons/close_chrome_refresh.icon
@@ -1,18 +1,19 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 20, -MOVE_TO, 6.06f, 15.16f, -LINE_TO, 4.84f, 13.94f, -LINE_TO, 8.78f, 10, -LINE_TO, 4.84f, 6.06f, -LINE_TO, 6.06f, 4.84f, -LINE_TO, 10, 8.78f, -R_LINE_TO, 3.94f, -3.94f, -R_LINE_TO, 1.22f, 1.22f, -LINE_TO, 11.22f, 10, -R_LINE_TO, 3.94f, 3.94f, -R_LINE_TO, -1.22f, 1.22f, -LINE_TO, 10, 11.22f, +FILL_RULE_NONZERO, +MOVE_TO, 6.06f, 15, +LINE_TO, 5, 13.94f, +LINE_TO, 8.94f, 10, +LINE_TO, 5, 6.06f, +LINE_TO, 6.06f, 5, +LINE_TO, 10, 8.94f, +LINE_TO, 13.94f, 5, +LINE_TO, 15, 6.06f, +LINE_TO, 11.06f, 10, +LINE_TO, 15, 13.94f, +LINE_TO, 13.94f, 15, +LINE_TO, 10, 11.06f, CLOSE
diff --git a/components/vector_icons/edit_chrome_refresh.icon b/components/vector_icons/edit_chrome_refresh.icon index 92290b7..c2dc07bc 100644 --- a/components/vector_icons/edit_chrome_refresh.icon +++ b/components/vector_icons/edit_chrome_refresh.icon
@@ -1,82 +1,60 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -CANVAS_DIMENSIONS, 24, -MOVE_TO, 5.05f, 19.01f, -R_H_LINE_TO, 1.31f, -R_LINE_TO, 9.9f, -9.88f, -R_LINE_TO, -0.65f, -0.67f, -R_LINE_TO, -0.67f, -0.65f, -R_LINE_TO, -9.88f, 9.9f, -CLOSE, -R_MOVE_TO, -2.09f, 2.09f, -R_V_LINE_TO, -4.28f, -R_LINE_TO, 13.45f, -13.43f, -R_CUBIC_TO, 0.4f, -0.4f, 0.89f, -0.6f, 1.47f, -0.6f, -R_ARC_TO, 2.02f, 2.02f, 0, 0, 1, 1.49f, 0.61f, -R_LINE_TO, 1.32f, 1.33f, -R_CUBIC_TO, 0.42f, 0.41f, 0.62f, 0.89f, 0.61f, 1.47f, -R_ARC_TO, 2.02f, 2.02f, 0, 0, 1, -0.61f, 1.46f, -LINE_TO, 7.24f, 21.09f, -CLOSE, -MOVE_TO, 19.18f, 6.18f, -LINE_TO, 17.88f, 4.87f, -CLOSE, -R_MOVE_TO, -2.93f, 2.95f, -R_LINE_TO, -0.65f, -0.68f, -R_LINE_TO, -0.67f, -0.65f, -CLOSE - CANVAS_DIMENSIONS, 20, -MOVE_TO, 4.56f, 15.44f, -R_H_LINE_TO, 1.07f, -R_LINE_TO, 7.47f, -7.47f, +FILL_RULE_NONZERO, +MOVE_TO, 4.5f, 15.5f, +R_H_LINE_TO, 1.06f, +R_LINE_TO, 7.81f, -7.81f, R_LINE_TO, -1.06f, -1.06f, -R_LINE_TO, -7.48f, 7.48f, -R_V_LINE_TO, 1.05f, +LINE_TO, 4.5f, 14.44f, CLOSE, -MOVE_TO, 2.83f, 17.17f, -R_V_LINE_TO, -3.51f, -R_LINE_TO, 10.37f, -10.37f, -R_CUBIC_TO, 0.16f, -0.16f, 0.33f, -0.28f, 0.52f, -0.35f, -R_ARC_TO, 1.64f, 1.64f, 0, 0, 1, 1.18f, 0, -R_CUBIC_TO, 0.19f, 0.07f, 0.37f, 0.19f, 0.54f, 0.35f, -R_LINE_TO, 1.28f, 1.26f, -R_ARC_TO, 1.57f, 1.57f, 0, 0, 1, 0.46f, 1.12f, -R_CUBIC_TO, 0, 0.21f, -0.04f, 0.41f, -0.11f, 0.61f, -R_ARC_TO, 1.49f, 1.49f, 0, 0, 1, -0.35f, 0.53f, -LINE_TO, 6.35f, 17.17f, -H_LINE_TO, 2.83f, +MOVE_TO, 3, 17, +R_V_LINE_TO, -3.19f, +LINE_TO, 13.38f, 3.44f, +R_CUBIC_TO, 0.15f, -0.15f, 0.32f, -0.27f, 0.5f, -0.33f, +R_ARC_TO, 1.55f, 1.55f, 0, 0, 1, 1.13f, 0, +R_CUBIC_TO, 0.18f, 0.07f, 0.35f, 0.18f, 0.5f, 0.33f, +LINE_TO, 16.56f, 4.5f, +R_ARC_TO, 1.4f, 1.4f, 0, 0, 1, 0.33f, 0.5f, +R_ARC_TO, 1.56f, 1.56f, 0, 0, 1, 0, 1.13f, +R_CUBIC_TO, -0.07f, 0.18f, -0.18f, 0.35f, -0.33f, 0.5f, +LINE_TO, 6.19f, 17, CLOSE, -R_MOVE_TO, 9.73f, -9.73f, +MOVE_TO, 15.5f, 5.56f, +LINE_TO, 14.44f, 4.5f, +CLOSE, +R_MOVE_TO, -2.66f, 1.6f, R_LINE_TO, -0.52f, -0.54f, R_LINE_TO, 1.06f, 1.06f, -R_LINE_TO, -0.54f, -0.53f, CLOSE CANVAS_DIMENSIONS, 16, -MOVE_TO, 3.68f, 12.41f, -R_H_LINE_TO, 0.55f, -R_LINE_TO, 6.06f, -6.07f, -R_LINE_TO, -0.27f, -0.27f, -R_LINE_TO, -0.27f, -0.27f, -R_LINE_TO, -6.07f, 6.06f, +FILL_RULE_NONZERO, +MOVE_TO, 3.65f, 12.35f, +R_H_LINE_TO, 0.85f, +R_LINE_TO, 5.98f, -5.98f, +R_LINE_TO, -0.85f, -0.85f, +R_LINE_TO, -5.98f, 5.99f, CLOSE, -R_MOVE_TO, -1.34f, 1.34f, -R_V_LINE_TO, -2.44f, -R_LINE_TO, 8.57f, -8.58f, -R_ARC_TO, 0.93f, 0.93f, 0, 0, 1, 0.65f, -0.28f, -R_ARC_TO, 0.97f, 0.97f, 0, 0, 1, 0.69f, 0.28f, -R_LINE_TO, 1.13f, 1.12f, -R_CUBIC_TO, 0.21f, 0.19f, 0.31f, 0.42f, 0.29f, 0.68f, -R_ARC_TO, 0.96f, 0.96f, 0, 0, 1, -0.29f, 0.66f, -LINE_TO, 4.78f, 13.75f, +R_MOVE_TO, -1.38f, 1.38f, +V_LINE_TO, 10.93f, +R_LINE_TO, 8.29f, -8.3f, +R_CUBIC_TO, 0.13f, -0.13f, 0.27f, -0.22f, 0.42f, -0.28f, +R_CUBIC_TO, 0.15f, -0.06f, 0.31f, -0.09f, 0.48f, -0.09f, +R_CUBIC_TO, 0.16f, 0, 0.32f, 0.03f, 0.47f, 0.09f, +R_CUBIC_TO, 0.15f, 0.06f, 0.29f, 0.15f, 0.43f, 0.28f, +LINE_TO, 13.37f, 3.64f, +R_CUBIC_TO, 0.13f, 0.13f, 0.22f, 0.27f, 0.28f, 0.43f, +R_CUBIC_TO, 0.06f, 0.15f, 0.09f, 0.31f, 0.09f, 0.47f, +R_ARC_TO, 1.25f, 1.25f, 0, 0, 1, -0.37f, 0.91f, +R_LINE_TO, -8.29f, 8.29f, CLOSE, -R_MOVE_TO, 9.96f, -9.42f, -R_LINE_TO, -0.55f, -0.54f, +R_MOVE_TO, 10.05f, -9.19f, +R_LINE_TO, -0.85f, -0.86f, CLOSE, -MOVE_TO, 10.29f, 6.34f, -R_LINE_TO, -0.27f, -0.27f, -R_LINE_TO, -0.27f, -0.27f, -CLOSE \ No newline at end of file +R_MOVE_TO, -2.26f, 1.41f, +R_LINE_TO, -0.42f, -0.43f, +R_LINE_TO, 0.85f, 0.85f, +CLOSE
diff --git a/components/vector_icons/extension_chrome_refresh.icon b/components/vector_icons/extension_chrome_refresh.icon index 01f34c44..cf5faa3 100644 --- a/components/vector_icons/extension_chrome_refresh.icon +++ b/components/vector_icons/extension_chrome_refresh.icon
@@ -1,90 +1,89 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 20, -MOVE_TO, 4.5f, 17.17f, -R_CUBIC_TO, -0.46f, 0, -0.85f, -0.16f, -1.18f, -0.49f, -R_ARC_TO, 1.6f, 1.6f, 0, 0, 1, -0.49f, -1.18f, -R_V_LINE_TO, -3.59f, -R_CUBIC_TO, 0.52f, -0.03f, 0.96f, -0.23f, 1.32f, -0.59f, -R_CUBIC_TO, 0.36f, -0.37f, 0.53f, -0.8f, 0.53f, -1.32f, -R_CUBIC_TO, 0, -0.52f, -0.18f, -0.95f, -0.53f, -1.32f, -R_ARC_TO, 1.91f, 1.91f, 0, 0, 0, -1.32f, -0.59f, +FILL_RULE_NONZERO, +MOVE_TO, 4.5f, 17, +R_CUBIC_TO, -0.41f, 0, -0.77f, -0.15f, -1.06f, -0.44f, +ARC_TO, 1.44f, 1.44f, 0, 0, 1, 3, 15.5f, +V_LINE_TO, 12, +R_ARC_TO, 2.12f, 2.12f, 0, 0, 0, 1.42f, -0.61f, +ARC_TO, 1.88f, 1.88f, 0, 0, 0, 5, 10, +R_ARC_TO, 1.88f, 1.88f, 0, 0, 0, -0.58f, -1.39f, +ARC_TO, 2.12f, 2.12f, 0, 0, 0, 3, 8, V_LINE_TO, 4.5f, -R_CUBIC_TO, 0, -0.46f, 0.16f, -0.85f, 0.49f, -1.18f, -R_ARC_TO, 1.6f, 1.6f, 0, 0, 1, 1.18f, -0.49f, -R_H_LINE_TO, 3.36f, -R_ARC_TO, 2.13f, 2.13f, 0, 0, 1, 0.67f, -1.44f, -R_CUBIC_TO, 0.41f, -0.39f, 0.9f, -0.59f, 1.48f, -0.59f, -R_CUBIC_TO, 0.58f, 0, 1.07f, 0.2f, 1.48f, 0.59f, -R_CUBIC_TO, 0.41f, 0.39f, 0.64f, 0.88f, 0.67f, 1.45f, -H_LINE_TO, 15.5f, -R_CUBIC_TO, 0.46f, 0, 0.86f, 0.16f, 1.18f, 0.49f, -R_CUBIC_TO, 0.33f, 0.33f, 0.49f, 0.72f, 0.49f, 1.18f, -R_V_LINE_TO, 3.36f, -R_ARC_TO, 2.13f, 2.13f, 0, 0, 1, 1.45f, 0.67f, -R_CUBIC_TO, 0.4f, 0.41f, 0.59f, 0.9f, 0.59f, 1.48f, -R_CUBIC_TO, 0, 0.58f, -0.19f, 1.07f, -0.59f, 1.48f, -R_CUBIC_TO, -0.39f, 0.41f, -0.87f, 0.64f, -1.45f, 0.67f, -V_LINE_TO, 15.5f, -R_CUBIC_TO, 0, 0.46f, -0.16f, 0.86f, -0.49f, 1.18f, -R_ARC_TO, 1.6f, 1.6f, 0, 0, 1, -1.18f, 0.49f, +R_CUBIC_TO, 0, -0.41f, 0.15f, -0.77f, 0.44f, -1.06f, +ARC_TO, 1.44f, 1.44f, 0, 0, 1, 4.5f, 3, +H_LINE_TO, 8, +R_CUBIC_TO, 0, -0.56f, 0.19f, -1.03f, 0.58f, -1.42f, +ARC_TO, 1.93f, 1.93f, 0, 0, 1, 10, 1, +R_CUBIC_TO, 0.56f, 0, 1.03f, 0.19f, 1.42f, 0.58f, +R_CUBIC_TO, 0.39f, 0.39f, 0.58f, 0.86f, 0.58f, 1.42f, +R_H_LINE_TO, 3.5f, +R_CUBIC_TO, 0.41f, 0, 0.77f, 0.15f, 1.06f, 0.44f, +R_CUBIC_TO, 0.29f, 0.29f, 0.44f, 0.65f, 0.44f, 1.06f, +V_LINE_TO, 8, +R_ARC_TO, 1.94f, 1.94f, 0, 0, 1, 1.42f, 0.58f, +R_CUBIC_TO, 0.39f, 0.39f, 0.58f, 0.86f, 0.58f, 1.42f, +R_CUBIC_TO, 0, 0.56f, -0.19f, 1.03f, -0.58f, 1.42f, +ARC_TO, 1.94f, 1.94f, 0, 0, 1, 17, 12, +R_V_LINE_TO, 3.5f, +R_CUBIC_TO, 0, 0.41f, -0.15f, 0.77f, -0.44f, 1.06f, +ARC_TO, 1.44f, 1.44f, 0, 0, 1, 15.5f, 17, CLOSE, -R_MOVE_TO, 0.06f, -1.73f, -H_LINE_TO, 15.44f, -V_LINE_TO, 4.56f, -H_LINE_TO, 4.56f, -R_V_LINE_TO, 2.27f, -R_ARC_TO, 3.37f, 3.37f, 0, 0, 1, 1.37f, 1.33f, -R_CUBIC_TO, 0.33f, 0.57f, 0.49f, 1.19f, 0.49f, 1.85f, -R_CUBIC_TO, 0, 0.68f, -0.16f, 1.31f, -0.49f, 1.88f, -R_ARC_TO, 3.21f, 3.21f, 0, 0, 1, -1.37f, 1.3f, +R_MOVE_TO, 0, -1.5f, +R_H_LINE_TO, 11, +R_V_LINE_TO, -11, +R_H_LINE_TO, -11, +R_V_LINE_TO, 2.33f, +R_ARC_TO, 3.23f, 3.23f, 0, 0, 1, 1.47f, 1.28f, +CUBIC_TO, 6.32f, 8.69f, 6.5f, 9.32f, 6.5f, 10, +R_CUBIC_TO, 0, 0.7f, -0.18f, 1.33f, -0.53f, 1.91f, +ARC_TO, 3.12f, 3.12f, 0, 0, 1, 4.5f, 13.17f, CLOSE, MOVE_TO, 10, 10, CLOSE - CANVAS_DIMENSIONS, 16, -MOVE_TO, 3.6f, 13.92f, -R_CUBIC_TO, -0.43f, 0, -0.79f, -0.15f, -1.08f, -0.44f, -R_ARC_TO, 1.46f, 1.46f, 0, 0, 1, -0.44f, -1.08f, -V_LINE_TO, 9.43f, -R_CUBIC_TO, 0.38f, -0.02f, 0.7f, -0.17f, 0.95f, -0.45f, -R_CUBIC_TO, 0.25f, -0.28f, 0.38f, -0.6f, 0.38f, -0.98f, -R_CUBIC_TO, 0, -0.38f, -0.12f, -0.7f, -0.37f, -0.98f, -R_ARC_TO, 1.31f, 1.31f, 0, 0, 0, -0.94f, -0.45f, +FILL_RULE_NONZERO, +MOVE_TO, 3.6f, 13.73f, +R_CUBIC_TO, -0.37f, 0, -0.69f, -0.13f, -0.95f, -0.39f, +R_ARC_TO, 1.28f, 1.28f, 0, 0, 1, -0.39f, -0.95f, +R_V_LINE_TO, -2.87f, +R_CUBIC_TO, 0.42f, -0.02f, 0.77f, -0.18f, 1.05f, -0.47f, +ARC_TO, 1.46f, 1.46f, 0, 0, 0, 3.75f, 8, +R_CUBIC_TO, 0, -0.41f, -0.14f, -0.76f, -0.43f, -1.05f, +R_ARC_TO, 1.51f, 1.51f, 0, 0, 0, -1.05f, -0.47f, V_LINE_TO, 3.6f, -R_CUBIC_TO, 0, -0.43f, 0.15f, -0.79f, 0.45f, -1.08f, -R_ARC_TO, 1.46f, 1.46f, 0, 0, 1, 1.08f, -0.44f, -R_H_LINE_TO, 2.52f, -R_CUBIC_TO, 0.07f, -0.47f, 0.28f, -0.86f, 0.63f, -1.18f, -R_CUBIC_TO, 0.35f, -0.32f, 0.77f, -0.48f, 1.24f, -0.48f, -R_CUBIC_TO, 0.48f, 0, 0.9f, 0.16f, 1.25f, 0.48f, -R_CUBIC_TO, 0.35f, 0.32f, 0.56f, 0.71f, 0.63f, 1.19f, -R_H_LINE_TO, 2.52f, -R_CUBIC_TO, 0.43f, 0, 0.79f, 0.15f, 1.08f, 0.45f, -R_CUBIC_TO, 0.3f, 0.29f, 0.45f, 0.65f, 0.45f, 1.08f, -R_V_LINE_TO, 2.52f, -R_CUBIC_TO, 0.47f, 0.07f, 0.86f, 0.28f, 1.18f, 0.63f, -R_CUBIC_TO, 0.32f, 0.35f, 0.48f, 0.77f, 0.48f, 1.24f, -R_CUBIC_TO, 0, 0.48f, -0.16f, 0.9f, -0.48f, 1.25f, -R_CUBIC_TO, -0.32f, 0.35f, -0.71f, 0.56f, -1.19f, 0.63f, -R_V_LINE_TO, 2.52f, -R_CUBIC_TO, 0, 0.43f, -0.15f, 0.79f, -0.44f, 1.08f, -R_ARC_TO, 1.46f, 1.46f, 0, 0, 1, -1.08f, 0.45f, +R_CUBIC_TO, 0, -0.37f, 0.13f, -0.69f, 0.39f, -0.95f, +R_CUBIC_TO, 0.26f, -0.26f, 0.57f, -0.39f, 0.95f, -0.39f, +R_H_LINE_TO, 2.68f, +R_CUBIC_TO, 0.03f, -0.46f, 0.21f, -0.84f, 0.53f, -1.16f, +R_ARC_TO, 1.63f, 1.63f, 0, 0, 1, 1.18f, -0.47f, +R_CUBIC_TO, 0.46f, 0, 0.86f, 0.16f, 1.18f, 0.47f, +R_CUBIC_TO, 0.33f, 0.31f, 0.51f, 0.7f, 0.54f, 1.16f, +R_H_LINE_TO, 2.68f, +R_CUBIC_TO, 0.37f, 0, 0.69f, 0.13f, 0.95f, 0.39f, +R_CUBIC_TO, 0.26f, 0.26f, 0.39f, 0.57f, 0.39f, 0.95f, +R_V_LINE_TO, 2.68f, +R_CUBIC_TO, 0.46f, 0.03f, 0.84f, 0.21f, 1.16f, 0.53f, +R_CUBIC_TO, 0.32f, 0.33f, 0.47f, 0.72f, 0.47f, 1.18f, +R_CUBIC_TO, 0, 0.46f, -0.16f, 0.86f, -0.47f, 1.18f, +R_CUBIC_TO, -0.31f, 0.33f, -0.7f, 0.51f, -1.16f, 0.54f, +R_V_LINE_TO, 2.68f, +R_CUBIC_TO, 0, 0.37f, -0.13f, 0.69f, -0.39f, 0.95f, +R_CUBIC_TO, -0.26f, 0.26f, -0.57f, 0.39f, -0.95f, 0.39f, CLOSE, -R_MOVE_TO, 0.11f, -1.64f, -R_H_LINE_TO, 8.57f, -R_V_LINE_TO, -8.57f, -R_H_LINE_TO, -8.57f, -R_V_LINE_TO, 1.73f, -R_CUBIC_TO, 0.42f, 0.29f, 0.75f, 0.66f, 0.98f, 1.11f, -R_CUBIC_TO, 0.23f, 0.45f, 0.34f, 0.93f, 0.34f, 1.44f, -R_CUBIC_TO, 0, 0.53f, -0.11f, 1.02f, -0.34f, 1.47f, -R_CUBIC_TO, -0.23f, 0.46f, -0.56f, 0.82f, -0.98f, 1.09f, +R_MOVE_TO, 0.05f, -1.38f, +R_H_LINE_TO, 8.7f, +V_LINE_TO, 3.65f, +H_LINE_TO, 3.65f, +R_V_LINE_TO, 1.81f, +R_CUBIC_TO, 0.47f, 0.25f, 0.83f, 0.61f, 1.09f, 1.07f, +R_CUBIC_TO, 0.26f, 0.46f, 0.39f, 0.95f, 0.39f, 1.48f, +R_CUBIC_TO, 0, 0.54f, -0.13f, 1.05f, -0.39f, 1.5f, +R_ARC_TO, 2.58f, 2.58f, 0, 0, 1, -1.09f, 1.04f, CLOSE, MOVE_TO, 8, 8, -CLOSE, -R_MOVE_TO, 0, 0, CLOSE
diff --git a/components/vector_icons/folder_chrome_refresh.icon b/components/vector_icons/folder_chrome_refresh.icon index 3668949..016713e 100644 --- a/components/vector_icons/folder_chrome_refresh.icon +++ b/components/vector_icons/folder_chrome_refresh.icon
@@ -3,59 +3,57 @@ // found in the LICENSE file. CANVAS_DIMENSIONS, 24, -MOVE_TO, 4.07f, 20.2f, -R_ARC_TO, 2.2f, 2.2f, 0, 0, 1, -1.61f, -0.66f, -R_ARC_TO, 2.2f, 2.2f, 0, 0, 1, -0.66f, -1.61f, -V_LINE_TO, 6.07f, -R_CUBIC_TO, 0, -0.63f, 0.22f, -1.16f, 0.66f, -1.61f, -R_CUBIC_TO, 0.45f, -0.44f, 0.98f, -0.66f, 1.61f, -0.66f, -R_H_LINE_TO, 5.84f, -LINE_TO, 12, 5.89f, -R_H_LINE_TO, 7.93f, -R_CUBIC_TO, 0.63f, 0, 1.16f, 0.22f, 1.61f, 0.66f, -R_CUBIC_TO, 0.44f, 0.45f, 0.66f, 0.98f, 0.66f, 1.61f, -R_V_LINE_TO, 9.77f, -R_CUBIC_TO, 0, 0.63f, -0.22f, 1.16f, -0.66f, 1.61f, -R_CUBIC_TO, -0.44f, 0.44f, -0.98f, 0.66f, -1.61f, 0.66f, +FILL_RULE_NONZERO, +MOVE_TO, 4, 20, +R_CUBIC_TO, -0.55f, 0, -1.02f, -0.19f, -1.41f, -0.59f, +ARC_TO, 1.94f, 1.94f, 0, 0, 1, 2, 18, +V_LINE_TO, 6, +R_CUBIC_TO, 0, -0.55f, 0.2f, -1.02f, 0.59f, -1.41f, +CUBIC_TO, 2.98f, 4.2f, 3.45f, 4, 4, 4, +R_H_LINE_TO, 6, +R_LINE_TO, 2, 2, +R_H_LINE_TO, 8, +R_CUBIC_TO, 0.55f, 0, 1.02f, 0.2f, 1.41f, 0.59f, +R_CUBIC_TO, 0.39f, 0.39f, 0.59f, 0.86f, 0.59f, 1.41f, +R_V_LINE_TO, 10, +R_CUBIC_TO, 0, 0.55f, -0.19f, 1.02f, -0.59f, 1.41f, +R_CUBIC_TO, -0.39f, 0.39f, -0.86f, 0.59f, -1.41f, 0.59f, CLOSE, -R_MOVE_TO, 0, -2.27f, -R_H_LINE_TO, 15.86f, -V_LINE_TO, 8.16f, -R_H_LINE_TO, -8.87f, -R_LINE_TO, -2.09f, -2.09f, -H_LINE_TO, 4.07f, +R_MOVE_TO, 0, -2, +R_H_LINE_TO, 16, +V_LINE_TO, 8, +R_H_LINE_TO, -8.82f, +R_LINE_TO, -2, -2, +H_LINE_TO, 4, CLOSE, R_MOVE_TO, 0, 0, -V_LINE_TO, 6.07f, -CLOSE, -R_MOVE_TO, 0, 0, +V_LINE_TO, 6, CLOSE CANVAS_DIMENSIONS, 20, -MOVE_TO, 3.56f, 16.17f, -R_CUBIC_TO, -0.47f, 0, -0.87f, -0.17f, -1.22f, -0.51f, -R_ARC_TO, 1.65f, 1.65f, 0, 0, 1, -0.51f, -1.22f, -V_LINE_TO, 5.56f, -R_CUBIC_TO, 0, -0.48f, 0.17f, -0.89f, 0.51f, -1.22f, -R_ARC_TO, 1.67f, 1.67f, 0, 0, 1, 1.22f, -0.5f, -R_H_LINE_TO, 4.37f, -LINE_TO, 10, 5.91f, -R_H_LINE_TO, 6.44f, -R_CUBIC_TO, 0.48f, 0, 0.89f, 0.17f, 1.22f, 0.5f, -R_CUBIC_TO, 0.34f, 0.34f, 0.5f, 0.75f, 0.5f, 1.22f, -R_V_LINE_TO, 6.81f, -R_CUBIC_TO, 0, 0.47f, -0.17f, 0.88f, -0.5f, 1.22f, -R_ARC_TO, 1.65f, 1.65f, 0, 0, 1, -1.22f, 0.51f, +FILL_RULE_NONZERO, +MOVE_TO, 3.5f, 16, +R_CUBIC_TO, -0.4f, 0, -0.75f, -0.15f, -1.05f, -0.45f, +R_CUBIC_TO, -0.3f, -0.3f, -0.45f, -0.65f, -0.45f, -1.05f, +R_V_LINE_TO, -9, +R_CUBIC_TO, 0, -0.41f, 0.15f, -0.77f, 0.45f, -1.06f, +ARC_TO, 1.45f, 1.45f, 0, 0, 1, 3.5f, 4, +H_LINE_TO, 8, +R_LINE_TO, 2, 2, +R_H_LINE_TO, 6.5f, +R_CUBIC_TO, 0.41f, 0, 0.77f, 0.15f, 1.06f, 0.44f, +R_CUBIC_TO, 0.29f, 0.29f, 0.44f, 0.65f, 0.44f, 1.06f, +R_V_LINE_TO, 7, +R_CUBIC_TO, 0, 0.4f, -0.15f, 0.75f, -0.44f, 1.05f, +R_CUBIC_TO, -0.29f, 0.3f, -0.64f, 0.45f, -1.06f, 0.45f, CLOSE, -R_MOVE_TO, 0, -1.73f, -H_LINE_TO, 16.44f, -V_LINE_TO, 7.63f, -R_H_LINE_TO, -7.16f, -LINE_TO, 7.21f, 5.56f, -H_LINE_TO, 3.56f, +R_MOVE_TO, 0, -1.5f, +R_H_LINE_TO, 13, +R_V_LINE_TO, -7, +H_LINE_TO, 9.38f, +R_LINE_TO, -2, -2, +H_LINE_TO, 3.5f, CLOSE, R_MOVE_TO, 0, 0, -V_LINE_TO, 5.56f, -CLOSE, -R_MOVE_TO, 0, 0, +R_V_LINE_TO, -9, CLOSE
diff --git a/components/vector_icons/info_refresh.icon b/components/vector_icons/info_refresh.icon index 063c13f6..d74bc75 100644 --- a/components/vector_icons/info_refresh.icon +++ b/components/vector_icons/info_refresh.icon
@@ -1,46 +1,51 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 7.26f, 11.34f, -R_H_LINE_TO, 1.48f, +FILL_RULE_NONZERO, +MOVE_TO, 7.34f, 11.26f, +R_H_LINE_TO, 1.32f, V_LINE_TO, 7.2f, -H_LINE_TO, 7.26f, +H_LINE_TO, 7.34f, CLOSE, -R_MOVE_TO, 0.74f, -5.15f, -R_CUBIC_TO, 0.22f, 0, 0.41f, -0.07f, 0.56f, -0.23f, -R_ARC_TO, 0.75f, 0.75f, 0, 0, 0, 0.23f, -0.56f, -R_ARC_TO, 0.76f, 0.76f, 0, 0, 0, -0.23f, -0.56f, -R_ARC_TO, 0.75f, 0.75f, 0, 0, 0, -0.56f, -0.23f, -R_ARC_TO, 0.78f, 0.78f, 0, 0, 0, -0.79f, 0.78f, -R_ARC_TO, 0.78f, 0.78f, 0, 0, 0, 0.79f, 0.79f, +R_MOVE_TO, 0.66f, -5.18f, +R_ARC_TO, 0.66f, 0.66f, 0, 0, 0, 0.48f, -0.19f, +R_ARC_TO, 0.66f, 0.66f, 0, 0, 0, 0.2f, -0.48f, +R_ARC_TO, 0.67f, 0.67f, 0, 0, 0, -0.2f, -0.48f, +R_ARC_TO, 0.64f, 0.64f, 0, 0, 0, -0.48f, -0.2f, +R_ARC_TO, 0.66f, 0.66f, 0, 0, 0, -0.48f, 0.2f, +R_ARC_TO, 0.64f, 0.64f, 0, 0, 0, -0.2f, 0.48f, +R_CUBIC_TO, 0, 0.2f, 0.07f, 0.36f, 0.2f, 0.49f, +R_ARC_TO, 0.64f, 0.64f, 0, 0, 0, 0.48f, 0.2f, CLOSE, -R_MOVE_TO, 0.01f, 8.53f, -R_CUBIC_TO, -0.93f, 0, -1.8f, -0.17f, -2.62f, -0.52f, -R_ARC_TO, 6.67f, 6.67f, 0, 0, 1, -2.14f, -1.44f, -R_ARC_TO, 6.7f, 6.7f, 0, 0, 1, -1.44f, -2.14f, -R_ARC_TO, 6.56f, 6.56f, 0, 0, 1, -0.52f, -2.62f, -R_CUBIC_TO, 0, -0.93f, 0.17f, -1.8f, 0.52f, -2.62f, -R_ARC_TO, 6.71f, 6.71f, 0, 0, 1, 1.44f, -2.13f, -R_ARC_TO, 6.7f, 6.7f, 0, 0, 1, 2.14f, -1.44f, -R_ARC_TO, 6.56f, 6.56f, 0, 0, 1, 2.63f, -0.52f, -R_CUBIC_TO, 0.93f, 0, 1.81f, 0.17f, 2.62f, 0.52f, -R_CUBIC_TO, 0.81f, 0.35f, 1.52f, 0.83f, 2.13f, 1.44f, -R_ARC_TO, 6.68f, 6.68f, 0, 0, 1, 1.44f, 2.13f, -R_CUBIC_TO, 0.35f, 0.81f, 0.52f, 1.68f, 0.52f, 2.62f, -R_CUBIC_TO, 0, 0.93f, -0.17f, 1.81f, -0.52f, 2.62f, -R_ARC_TO, 6.67f, 6.67f, 0, 0, 1, -1.44f, 2.14f, -R_ARC_TO, 6.68f, 6.68f, 0, 0, 1, -2.13f, 1.44f, -R_ARC_TO, 6.51f, 6.51f, 0, 0, 1, -2.62f, 0.52f, +R_MOVE_TO, 0.01f, 8.46f, +R_CUBIC_TO, -0.9f, 0, -1.75f, -0.17f, -2.54f, -0.51f, +R_ARC_TO, 6.52f, 6.52f, 0, 0, 1, -2.08f, -1.4f, +R_ARC_TO, 6.52f, 6.52f, 0, 0, 1, -1.4f, -2.08f, +R_ARC_TO, 6.33f, 6.33f, 0, 0, 1, -0.51f, -2.55f, +R_CUBIC_TO, 0, -0.91f, 0.17f, -1.75f, 0.51f, -2.54f, +ARC_TO, 6.53f, 6.53f, 0, 0, 1, 3.38f, 3.38f, +ARC_TO, 6.52f, 6.52f, 0, 0, 1, 5.46f, 1.98f, +R_ARC_TO, 6.33f, 6.33f, 0, 0, 1, 2.55f, -0.51f, +R_CUBIC_TO, 0.91f, 0, 1.75f, 0.17f, 2.54f, 0.51f, +R_CUBIC_TO, 0.79f, 0.34f, 1.48f, 0.8f, 2.07f, 1.4f, +R_ARC_TO, 6.5f, 6.5f, 0, 0, 1, 1.4f, 2.08f, +R_ARC_TO, 6.29f, 6.29f, 0, 0, 1, 0.51f, 2.54f, +R_CUBIC_TO, 0, 0.9f, -0.17f, 1.75f, -0.51f, 2.54f, +R_ARC_TO, 6.52f, 6.52f, 0, 0, 1, -1.4f, 2.08f, +R_ARC_TO, 6.5f, 6.5f, 0, 0, 1, -2.08f, 1.4f, +R_ARC_TO, 6.29f, 6.29f, 0, 0, 1, -2.54f, 0.51f, CLOSE, -MOVE_TO, 8, 13.09f, -R_CUBIC_TO, 1.42f, 0, 2.62f, -0.49f, 3.61f, -1.48f, -R_CUBIC_TO, 0.98f, -0.99f, 1.48f, -2.19f, 1.48f, -3.61f, -R_CUBIC_TO, 0, -1.42f, -0.49f, -2.62f, -1.48f, -3.61f, -CUBIC_TO, 10.62f, 3.41f, 9.42f, 2.92f, 8, 2.92f, -R_CUBIC_TO, -1.42f, 0, -2.62f, 0.49f, -3.61f, 1.48f, -CUBIC_TO, 3.41f, 5.38f, 2.92f, 6.58f, 2.92f, 8, -R_CUBIC_TO, 0, 1.42f, 0.49f, 2.62f, 1.48f, 3.61f, -R_CUBIC_TO, 0.99f, 0.98f, 2.19f, 1.48f, 3.61f, 1.48f, +MOVE_TO, 8, 13.15f, +R_CUBIC_TO, 1.43f, 0, 2.65f, -0.5f, 3.65f, -1.5f, +R_CUBIC_TO, 1, -1, 1.5f, -2.22f, 1.5f, -3.65f, +R_CUBIC_TO, 0, -1.43f, -0.5f, -2.65f, -1.5f, -3.65f, +CUBIC_TO_SHORTHAND, 9.43f, 2.85f, 8, 2.85f, +R_CUBIC_TO, -1.43f, 0, -2.65f, 0.5f, -3.65f, 1.5f, +CUBIC_TO_SHORTHAND, 2.85f, 6.57f, 2.85f, 8, +R_CUBIC_TO, 0, 1.43f, 0.5f, 2.65f, 1.5f, 3.65f, +R_CUBIC_TO, 1, 1, 2.22f, 1.5f, 3.65f, 1.5f, +CLOSE, +MOVE_TO, 8, 8, CLOSE
diff --git a/components/vector_icons/location_on_chrome_refresh.icon b/components/vector_icons/location_on_chrome_refresh.icon index 749ea94..747418247 100644 --- a/components/vector_icons/location_on_chrome_refresh.icon +++ b/components/vector_icons/location_on_chrome_refresh.icon
@@ -1,135 +1,97 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -CANVAS_DIMENSIONS, 24, -MOVE_TO, 12, 22.18f, -R_CUBIC_TO, -0.27f, 0, -0.5f, -0.07f, -0.7f, -0.23f, -R_ARC_TO, 1.61f, 1.61f, 0, 0, 1, -0.46f, -0.63f, -R_CUBIC_TO, -0.38f, -1.01f, -0.8f, -1.91f, -1.26f, -2.7f, -R_CUBIC_TO, -0.46f, -0.79f, -1.09f, -1.69f, -1.87f, -2.72f, -R_CUBIC_TO, -0.86f, -1.11f, -1.56f, -2.18f, -2.1f, -3.19f, -R_CUBIC_TO, -0.53f, -1.02f, -0.8f, -2.25f, -0.8f, -3.71f, -R_CUBIC_TO, 0, -2.01f, 0.7f, -3.71f, 2.1f, -5.11f, -CUBIC_TO, 8.29f, 2.5f, 9.99f, 1.8f, 12, 1.8f, -R_CUBIC_TO, 2, 0, 3.71f, 0.7f, 5.11f, 2.1f, -CUBIC_TO, 18.5f, 5.29f, 19.2f, 6.99f, 19.2f, 9, -R_CUBIC_TO, 0, 1.55f, -0.29f, 2.84f, -0.88f, 3.86f, -R_ARC_TO, 26.27f, 26.27f, 0, 0, 1, -2.02f, 3.04f, -R_CUBIC_TO, -0.83f, 1.1f, -1.47f, 2.04f, -1.92f, 2.81f, -R_CUBIC_TO, -0.44f, 0.77f, -0.85f, 1.64f, -1.22f, 2.61f, -R_CUBIC_TO, -0.11f, 0.28f, -0.27f, 0.49f, -0.47f, 0.64f, -R_ARC_TO, 1.16f, 1.16f, 0, 0, 1, -0.69f, 0.22f, -CLOSE, -R_MOVE_TO, 0, -3.87f, -R_ARC_TO, 16.62f, 16.62f, 0, 0, 1, 0.95f, -1.67f, -R_CUBIC_TO, 0.36f, -0.55f, 0.87f, -1.26f, 1.54f, -2.14f, -R_CUBIC_TO, 0.72f, -0.93f, 1.3f, -1.78f, 1.75f, -2.57f, -R_CUBIC_TO, 0.46f, -0.79f, 0.69f, -1.77f, 0.69f, -2.94f, -R_CUBIC_TO, 0, -1.36f, -0.48f, -2.53f, -1.44f, -3.49f, -CUBIC_TO, 14.53f, 4.55f, 13.36f, 4.07f, 12, 4.07f, -R_CUBIC_TO, -1.36f, 0, -2.53f, 0.48f, -3.49f, 1.44f, -CUBIC_TO, 7.55f, 6.47f, 7.07f, 7.64f, 7.07f, 9, -R_CUBIC_TO, 0, 1.17f, 0.23f, 2.15f, 0.69f, 2.94f, -R_CUBIC_TO, 0.45f, 0.79f, 1.04f, 1.64f, 1.75f, 2.57f, -R_CUBIC_TO, 0.67f, 0.88f, 1.18f, 1.59f, 1.54f, 2.14f, -R_CUBIC_TO, 0.36f, 0.55f, 0.67f, 1.11f, 0.95f, 1.67f, -CLOSE, -R_MOVE_TO, 0, -6.79f, -R_CUBIC_TO, 0.7f, 0, 1.3f, -0.25f, 1.79f, -0.73f, -ARC_TO, 2.43f, 2.43f, 0, 0, 0, 14.52f, 9, -R_CUBIC_TO, 0, -0.7f, -0.25f, -1.3f, -0.73f, -1.78f, -ARC_TO, 2.43f, 2.43f, 0, 0, 0, 12, 6.48f, -R_CUBIC_TO, -0.7f, 0, -1.3f, 0.25f, -1.78f, 0.73f, -ARC_TO, 2.43f, 2.43f, 0, 0, 0, 9.48f, 9, -R_CUBIC_TO, 0, 0.7f, 0.25f, 1.3f, 0.73f, 1.79f, -R_ARC_TO, 2.43f, 2.43f, 0, 0, 0, 1.79f, 0.74f, -CLOSE - CANVAS_DIMENSIONS, 20, -MOVE_TO, 10, 18.16f, -R_ARC_TO, 0.92f, 0.92f, 0, 0, 1, -0.57f, -0.18f, -R_ARC_TO, 1.09f, 1.09f, 0, 0, 1, -0.36f, -0.5f, -R_ARC_TO, 18.21f, 18.21f, 0, 0, 0, -1.01f, -2.15f, -R_CUBIC_TO, -0.36f, -0.64f, -0.86f, -1.37f, -1.5f, -2.2f, -R_ARC_TO, 16.96f, 16.96f, 0, 0, 1, -1.68f, -2.56f, -R_CUBIC_TO, -0.43f, -0.82f, -0.65f, -1.81f, -0.65f, -2.96f, -R_CUBIC_TO, 0, -1.6f, 0.56f, -2.96f, 1.68f, -4.09f, -CUBIC_TO, 7.03f, 2.39f, 8.39f, 1.83f, 10, 1.83f, -R_CUBIC_TO, 1.61f, 0, 2.97f, 0.56f, 4.09f, 1.68f, -R_CUBIC_TO, 1.12f, 1.12f, 1.68f, 2.49f, 1.68f, 4.1f, -R_CUBIC_TO, 0, 1.24f, -0.24f, 2.27f, -0.71f, 3.09f, -R_ARC_TO, 23.21f, 23.21f, 0, 0, 1, -1.62f, 2.43f, -R_CUBIC_TO, -0.66f, 0.86f, -1.18f, 1.61f, -1.54f, 2.24f, -R_ARC_TO, 14.28f, 14.28f, 0, 0, 0, -0.97f, 2.11f, -R_CUBIC_TO, -0.09f, 0.2f, -0.21f, 0.37f, -0.37f, 0.49f, -R_ARC_TO, 0.87f, 0.87f, 0, 0, 1, -0.56f, 0.19f, +FILL_RULE_NONZERO, +MOVE_TO, 10, 18, +R_ARC_TO, 0.78f, 0.78f, 0, 0, 1, -0.49f, -0.16f, +R_ARC_TO, 0.82f, 0.82f, 0, 0, 1, -0.29f, -0.41f, +R_ARC_TO, 14.33f, 14.33f, 0, 0, 0, -0.95f, -2.09f, +R_CUBIC_TO, -0.37f, -0.66f, -0.9f, -1.43f, -1.59f, -2.32f, +R_CUBIC_TO, -0.68f, -0.87f, -1.23f, -1.71f, -1.66f, -2.52f, +R_CUBIC_TO, -0.42f, -0.8f, -0.64f, -1.77f, -0.64f, -2.9f, +R_CUBIC_TO, 0, -1.55f, 0.55f, -2.87f, 1.63f, -3.96f, +CUBIC_TO, 7.11f, 2.55f, 8.44f, 2, 10, 2, +R_CUBIC_TO, 1.56f, 0, 2.89f, 0.54f, 3.97f, 1.63f, +R_CUBIC_TO, 1.09f, 1.09f, 1.63f, 2.42f, 1.63f, 3.98f, +R_CUBIC_TO, 0, 1.22f, -0.23f, 2.22f, -0.7f, 3.02f, +R_ARC_TO, 23.89f, 23.89f, 0, 0, 1, -1.59f, 2.38f, +R_CUBIC_TO, -0.72f, 0.95f, -1.26f, 1.74f, -1.64f, 2.39f, +R_ARC_TO, 11.54f, 11.54f, 0, 0, 0, -0.91f, 2.03f, +R_ARC_TO, 0.96f, 0.96f, 0, 0, 1, -0.3f, 0.41f, +R_ARC_TO, 0.72f, 0.72f, 0, 0, 1, -0.46f, 0.16f, CLOSE, -MOVE_TO, 10, 15.26f, -R_CUBIC_TO, 0.23f, -0.47f, 0.5f, -0.94f, 0.79f, -1.4f, -R_CUBIC_TO, 0.29f, -0.46f, 0.72f, -1.06f, 1.28f, -1.8f, -R_ARC_TO, 17.86f, 17.86f, 0, 0, 0, 1.42f, -2.07f, -R_CUBIC_TO, 0.36f, -0.64f, 0.55f, -1.43f, 0.55f, -2.39f, -R_CUBIC_TO, 0, -1.11f, -0.39f, -2.06f, -1.19f, -2.85f, -R_CUBIC_TO, -0.8f, -0.79f, -1.75f, -1.19f, -2.87f, -1.19f, -R_CUBIC_TO, -1.11f, 0, -2.07f, 0.4f, -2.85f, 1.19f, -R_CUBIC_TO, -0.79f, 0.79f, -1.18f, 1.75f, -1.18f, 2.86f, -R_CUBIC_TO, 0, 0.95f, 0.18f, 1.75f, 0.56f, 2.39f, -R_CUBIC_TO, 0.37f, 0.64f, 0.84f, 1.33f, 1.41f, 2.07f, -R_CUBIC_TO, 0.56f, 0.74f, 0.99f, 1.34f, 1.28f, 1.8f, -R_CUBIC_TO, 0.3f, 0.46f, 0.56f, 0.93f, 0.79f, 1.4f, +MOVE_TO, 10, 15.36f, +R_CUBIC_TO, 0.23f, -0.47f, 0.5f, -0.94f, 0.8f, -1.4f, +R_CUBIC_TO, 0.3f, -0.46f, 0.74f, -1.08f, 1.33f, -1.85f, +R_CUBIC_TO, 0.58f, -0.75f, 1.06f, -1.45f, 1.43f, -2.09f, +R_CUBIC_TO, 0.37f, -0.64f, 0.55f, -1.45f, 0.55f, -2.41f, +R_CUBIC_TO, 0, -1.12f, -0.4f, -2.09f, -1.21f, -2.9f, +CUBIC_TO, 12.09f, 3.9f, 11.12f, 3.5f, 9.99f, 3.5f, +R_ARC_TO, 3.93f, 3.93f, 0, 0, 0, -2.89f, 1.21f, +R_CUBIC_TO, -0.8f, 0.81f, -1.2f, 1.77f, -1.2f, 2.9f, +R_CUBIC_TO, 0, 0.96f, 0.19f, 1.77f, 0.56f, 2.41f, +R_CUBIC_TO, 0.38f, 0.64f, 0.85f, 1.34f, 1.42f, 2.09f, +R_CUBIC_TO, 0.58f, 0.77f, 1.02f, 1.39f, 1.32f, 1.85f, +R_CUBIC_TO, 0.3f, 0.46f, 0.57f, 0.93f, 0.8f, 1.4f, CLOSE, -R_MOVE_TO, 0, -5.64f, -R_CUBIC_TO, 0.56f, 0, 1.04f, -0.19f, 1.43f, -0.58f, -R_CUBIC_TO, 0.39f, -0.39f, 0.59f, -0.86f, 0.59f, -1.43f, -R_CUBIC_TO, 0, -0.56f, -0.2f, -1.04f, -0.58f, -1.43f, -R_ARC_TO, 1.95f, 1.95f, 0, 0, 0, -1.43f, -0.59f, -R_CUBIC_TO, -0.56f, 0, -1.04f, 0.2f, -1.43f, 0.58f, -R_CUBIC_TO, -0.39f, 0.39f, -0.59f, 0.86f, -0.59f, 1.43f, -R_CUBIC_TO, 0, 0.56f, 0.2f, 1.04f, 0.58f, 1.43f, -R_CUBIC_TO, 0.39f, 0.39f, 0.87f, 0.59f, 1.43f, 0.59f, +R_MOVE_TO, 0, -5.75f, +R_CUBIC_TO, 0.56f, 0, 1.03f, -0.19f, 1.42f, -0.58f, +ARC_TO, 1.93f, 1.93f, 0, 0, 0, 12, 7.61f, +R_CUBIC_TO, 0, -0.56f, -0.19f, -1.03f, -0.58f, -1.42f, +R_ARC_TO, 1.92f, 1.92f, 0, 0, 0, -1.42f, -0.58f, +R_CUBIC_TO, -0.56f, 0, -1.03f, 0.19f, -1.42f, 0.58f, +ARC_TO, 1.92f, 1.92f, 0, 0, 0, 8, 7.6f, +R_CUBIC_TO, 0, 0.56f, 0.19f, 1.03f, 0.58f, 1.42f, +R_CUBIC_TO, 0.39f, 0.39f, 0.86f, 0.59f, 1.42f, 0.59f, +CLOSE, +MOVE_TO, 10, 7.58f, CLOSE CANVAS_DIMENSIONS, 16, -MOVE_TO, 8, 14.69f, -R_ARC_TO, 0.91f, 0.91f, 0, 0, 1, -0.55f, -0.17f, -R_ARC_TO, 1.14f, 1.14f, 0, 0, 1, -0.37f, -0.49f, -R_CUBIC_TO, -0.31f, -0.71f, -0.6f, -1.3f, -0.87f, -1.78f, -R_ARC_TO, 13.96f, 13.96f, 0, 0, 0, -1.1f, -1.62f, -R_ARC_TO, 14.19f, 14.19f, 0, 0, 1, -1.38f, -2.09f, -R_CUBIC_TO, -0.35f, -0.67f, -0.53f, -1.49f, -0.53f, -2.45f, -R_CUBIC_TO, 0, -1.33f, 0.47f, -2.46f, 1.4f, -3.4f, -CUBIC_TO, 5.53f, 1.75f, 6.66f, 1.28f, 8, 1.28f, -R_CUBIC_TO, 1.34f, 0, 2.47f, 0.47f, 3.41f, 1.4f, -R_CUBIC_TO, 0.93f, 0.93f, 1.4f, 2.07f, 1.4f, 3.41f, -R_CUBIC_TO, 0, 1.02f, -0.2f, 1.87f, -0.58f, 2.54f, -R_CUBIC_TO, -0.39f, 0.67f, -0.83f, 1.33f, -1.33f, 1.98f, -ARC_TO, 15.23f, 15.23f, 0, 0, 0, 9.77f, 12.25f, -R_ARC_TO, 15.91f, 15.91f, 0, 0, 0, -0.85f, 1.77f, -R_ARC_TO, 1.29f, 1.29f, 0, 0, 1, -0.37f, 0.49f, -R_ARC_TO, 0.85f, 0.85f, 0, 0, 1, -0.54f, 0.18f, +FILL_RULE_NONZERO, +MOVE_TO, 8, 14.52f, +R_ARC_TO, 0.74f, 0.74f, 0, 0, 1, -0.46f, -0.15f, +R_ARC_TO, 0.86f, 0.86f, 0, 0, 1, -0.29f, -0.39f, +R_CUBIC_TO, -0.25f, -0.64f, -0.52f, -1.21f, -0.8f, -1.72f, +R_CUBIC_TO, -0.28f, -0.51f, -0.69f, -1.09f, -1.2f, -1.76f, +R_CUBIC_TO, -0.55f, -0.71f, -1, -1.39f, -1.35f, -2.05f, +R_CUBIC_TO, -0.34f, -0.66f, -0.51f, -1.44f, -0.51f, -2.37f, +R_CUBIC_TO, 0, -1.28f, 0.45f, -2.37f, 1.34f, -3.27f, +CUBIC_TO, 5.62f, 1.91f, 6.72f, 1.47f, 8, 1.47f, +R_CUBIC_TO, 1.29f, 0, 2.38f, 0.45f, 3.27f, 1.35f, +R_CUBIC_TO, 0.9f, 0.9f, 1.34f, 1.99f, 1.34f, 3.28f, +R_CUBIC_TO, 0, 1, -0.19f, 1.82f, -0.57f, 2.47f, +R_ARC_TO, 19.3f, 19.3f, 0, 0, 1, -1.3f, 1.94f, +R_CUBIC_TO, -0.53f, 0.69f, -0.94f, 1.29f, -1.23f, 1.79f, +R_ARC_TO, 11.26f, 11.26f, 0, 0, 0, -0.78f, 1.69f, +R_ARC_TO, 1.02f, 1.02f, 0, 0, 1, -0.3f, 0.4f, +R_ARC_TO, 0.7f, 0.7f, 0, 0, 1, -0.44f, 0.15f, CLOSE, -MOVE_TO, 8, 12.11f, -R_CUBIC_TO, 0.18f, -0.38f, 0.39f, -0.75f, 0.62f, -1.12f, -R_CUBIC_TO, 0.23f, -0.37f, 0.56f, -0.83f, 0.98f, -1.38f, -R_CUBIC_TO, 0.46f, -0.59f, 0.84f, -1.13f, 1.13f, -1.64f, -R_CUBIC_TO, 0.29f, -0.5f, 0.44f, -1.13f, 0.44f, -1.89f, -R_CUBIC_TO, 0, -0.87f, -0.31f, -1.61f, -0.93f, -2.23f, -R_ARC_TO, 3.06f, 3.06f, 0, 0, 0, -2.25f, -0.93f, -R_CUBIC_TO, -0.87f, 0, -1.62f, 0.31f, -2.24f, 0.93f, -R_ARC_TO, 3.06f, 3.06f, 0, 0, 0, -0.93f, 2.23f, -R_CUBIC_TO, 0, 0.75f, 0.15f, 1.38f, 0.45f, 1.89f, -R_CUBIC_TO, 0.3f, 0.51f, 0.67f, 1.05f, 1.12f, 1.64f, -R_CUBIC_TO, 0.42f, 0.55f, 0.75f, 1.01f, 0.98f, 1.38f, -R_CUBIC_TO, 0.23f, 0.37f, 0.44f, 0.74f, 0.63f, 1.12f, +MOVE_TO, 8, 12.21f, +R_CUBIC_TO, 0.19f, -0.38f, 0.4f, -0.75f, 0.63f, -1.12f, +R_CUBIC_TO, 0.24f, -0.37f, 0.58f, -0.85f, 1.03f, -1.44f, +R_CUBIC_TO, 0.47f, -0.59f, 0.84f, -1.15f, 1.14f, -1.66f, +R_CUBIC_TO, 0.29f, -0.51f, 0.44f, -1.14f, 0.44f, -1.91f, +R_CUBIC_TO, 0, -0.89f, -0.32f, -1.64f, -0.95f, -2.28f, +R_ARC_TO, 3.11f, 3.11f, 0, 0, 0, -2.29f, -0.95f, +R_CUBIC_TO, -0.89f, 0, -1.65f, 0.32f, -2.28f, 0.95f, +R_ARC_TO, 3.13f, 3.13f, 0, 0, 0, -0.94f, 2.28f, +R_CUBIC_TO, 0, 0.77f, 0.15f, 1.4f, 0.45f, 1.91f, +R_CUBIC_TO, 0.3f, 0.51f, 0.68f, 1.07f, 1.13f, 1.66f, +R_CUBIC_TO, 0.45f, 0.59f, 0.79f, 1.07f, 1.03f, 1.44f, +R_CUBIC_TO, 0.24f, 0.37f, 0.45f, 0.74f, 0.63f, 1.12f, CLOSE, -R_MOVE_TO, 0, -4.39f, -R_CUBIC_TO, 0.45f, 0, 0.84f, -0.16f, 1.16f, -0.47f, -R_CUBIC_TO, 0.32f, -0.32f, 0.48f, -0.7f, 0.48f, -1.15f, -R_CUBIC_TO, 0, -0.46f, -0.16f, -0.84f, -0.47f, -1.16f, -R_ARC_TO, 1.56f, 1.56f, 0, 0, 0, -1.15f, -0.48f, -R_CUBIC_TO, -0.45f, 0, -0.84f, 0.16f, -1.16f, 0.47f, -R_CUBIC_TO, -0.32f, 0.31f, -0.48f, 0.7f, -0.48f, 1.15f, -R_CUBIC_TO, 0, 0.45f, 0.16f, 0.84f, 0.47f, 1.16f, -R_CUBIC_TO, 0.31f, 0.32f, 0.7f, 0.48f, 1.15f, 0.48f, +R_MOVE_TO, 0, -4.51f, +R_CUBIC_TO, 0.45f, 0, 0.83f, -0.16f, 1.15f, -0.46f, +R_CUBIC_TO, 0.31f, -0.31f, 0.47f, -0.69f, 0.47f, -1.14f, +R_CUBIC_TO, 0, -0.45f, -0.16f, -0.83f, -0.47f, -1.14f, +R_ARC_TO, 1.54f, 1.54f, 0, 0, 0, -1.14f, -0.47f, +R_CUBIC_TO, -0.45f, 0, -0.83f, 0.15f, -1.14f, 0.47f, +R_ARC_TO, 1.55f, 1.55f, 0, 0, 0, -0.47f, 1.14f, +R_CUBIC_TO, 0, 0.45f, 0.16f, 0.83f, 0.47f, 1.15f, +R_CUBIC_TO, 0.31f, 0.31f, 0.69f, 0.47f, 1.14f, 0.47f, +CLOSE, +MOVE_TO, 8, 6.07f, CLOSE
diff --git a/components/vector_icons/password_manager.icon b/components/vector_icons/password_manager.icon index 28f10869..07bb4f5 100644 --- a/components/vector_icons/password_manager.icon +++ b/components/vector_icons/password_manager.icon
@@ -1,58 +1,59 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 20, -MOVE_TO, 5.83f, 11.67f, -R_CUBIC_TO, 0.46f, 0, 0.85f, -0.16f, 1.17f, -0.48f, -R_CUBIC_TO, 0.33f, -0.33f, 0.5f, -0.73f, 0.5f, -1.19f, -R_CUBIC_TO, 0, -0.46f, -0.17f, -0.85f, -0.5f, -1.17f, -R_ARC_TO, 1.56f, 1.56f, 0, 0, 0, -1.17f, -0.5f, -R_CUBIC_TO, -0.46f, 0, -0.85f, 0.17f, -1.19f, 0.5f, -ARC_TO, 1.59f, 1.59f, 0, 0, 0, 4.17f, 10, -R_CUBIC_TO, 0, 0.46f, 0.16f, 0.85f, 0.48f, 1.19f, -R_CUBIC_TO, 0.33f, 0.32f, 0.73f, 0.48f, 1.19f, 0.48f, +FILL_RULE_NONZERO, +MOVE_TO, 6, 12, +R_CUBIC_TO, 0.55f, 0, 1.02f, -0.19f, 1.41f, -0.59f, +CUBIC_TO, 7.8f, 11.02f, 8, 10.55f, 8, 10, +R_CUBIC_TO, 0, -0.55f, -0.19f, -1.02f, -0.59f, -1.41f, +ARC_TO, 1.94f, 1.94f, 0, 0, 0, 6, 8, +R_CUBIC_TO, -0.55f, 0, -1.02f, 0.2f, -1.41f, 0.59f, +CUBIC_TO, 4.2f, 8.98f, 4, 9.45f, 4, 10, +R_CUBIC_TO, 0, 0.55f, 0.2f, 1.02f, 0.59f, 1.41f, +R_CUBIC_TO, 0.39f, 0.39f, 0.86f, 0.59f, 1.41f, 0.59f, CLOSE, -R_MOVE_TO, 0, 3.33f, -R_CUBIC_TO, -1.39f, 0, -2.57f, -0.49f, -3.54f, -1.46f, -CUBIC_TO, 1.32f, 12.57f, 0.83f, 11.39f, 0.83f, 10, -R_CUBIC_TO, 0, -1.39f, 0.49f, -2.57f, 1.46f, -3.54f, -CUBIC_TO, 3.26f, 5.49f, 4.44f, 5, 5.83f, 5, -R_CUBIC_TO, 0.94f, 0, 1.81f, 0.24f, 2.6f, 0.73f, -R_ARC_TO, 4.75f, 4.75f, 0, 0, 1, 1.83f, 1.98f, -R_H_LINE_TO, 7.23f, -R_CUBIC_TO, 0.46f, 0, 0.85f, 0.17f, 1.17f, 0.5f, -R_CUBIC_TO, 0.33f, 0.32f, 0.5f, 0.71f, 0.5f, 1.17f, -R_V_LINE_TO, 3.96f, -R_CUBIC_TO, 0, 0.46f, -0.17f, 0.85f, -0.5f, 1.19f, -ARC_TO, 1.59f, 1.59f, 0, 0, 1, 17.5f, 15, -R_H_LINE_TO, -3.75f, -R_ARC_TO, 1.66f, 1.66f, 0, 0, 1, -1.19f, -0.48f, -R_ARC_TO, 1.66f, 1.66f, 0, 0, 1, -0.48f, -1.19f, -R_V_LINE_TO, -1.04f, -H_LINE_TO, 10.27f, -R_ARC_TO, 4.59f, 4.59f, 0, 0, 1, -1.81f, 2, -ARC_TO, 5.1f, 5.1f, 0, 0, 1, 5.83f, 15, -CLOSE, -R_MOVE_TO, 3.29f, -4.37f, -R_H_LINE_TO, 4.63f, -R_V_LINE_TO, 2.71f, -H_LINE_TO, 15, -R_V_LINE_TO, -1.04f, -R_ARC_TO, 0.59f, 0.59f, 0, 0, 1, 0.17f, -0.44f, -R_ARC_TO, 0.62f, 0.62f, 0, 0, 1, 0.46f, -0.19f, -R_CUBIC_TO, 0.18f, 0, 0.33f, 0.06f, 0.44f, 0.19f, -R_ARC_TO, 0.56f, 0.56f, 0, 0, 1, 0.19f, 0.44f, -R_V_LINE_TO, 1.04f, +R_MOVE_TO, 0, 3, +R_CUBIC_TO, -1.39f, 0, -2.57f, -0.48f, -3.54f, -1.46f, +CUBIC_TO, 1.48f, 12.57f, 1, 11.39f, 1, 10, +R_CUBIC_TO, 0, -1.39f, 0.48f, -2.57f, 1.46f, -3.54f, +CUBIC_TO, 3.43f, 5.48f, 4.61f, 5, 6, 5, +R_CUBIC_TO, 1, 0, 1.91f, 0.27f, 2.73f, 0.81f, +ARC_TO, 5.09f, 5.09f, 0, 0, 1, 10.58f, 8, H_LINE_TO, 17.5f, -V_LINE_TO, 9.38f, -H_LINE_TO, 9.13f, -R_ARC_TO, 3.31f, 3.31f, 0, 0, 0, -1.17f, -1.94f, -R_ARC_TO, 3.2f, 3.2f, 0, 0, 0, -2.12f, -0.77f, -R_ARC_TO, 3.21f, 3.21f, 0, 0, 0, -2.35f, 0.98f, -CUBIC_TO, 2.83f, 8.3f, 2.5f, 9.08f, 2.5f, 10, -R_CUBIC_TO, 0, 0.92f, 0.33f, 1.7f, 0.98f, 2.35f, -R_ARC_TO, 3.21f, 3.21f, 0, 0, 0, 2.35f, 0.98f, -R_CUBIC_TO, 0.81f, 0, 1.51f, -0.25f, 2.13f, -0.75f, -R_CUBIC_TO, 0.61f, -0.51f, 1, -1.17f, 1.17f, -1.96f, -CLOSE \ No newline at end of file +R_CUBIC_TO, 0.41f, 0, 0.77f, 0.15f, 1.06f, 0.44f, +R_CUBIC_TO, 0.29f, 0.29f, 0.44f, 0.65f, 0.44f, 1.06f, +R_V_LINE_TO, 4, +R_CUBIC_TO, 0, 0.41f, -0.15f, 0.77f, -0.44f, 1.06f, +ARC_TO, 1.44f, 1.44f, 0, 0, 1, 17.5f, 15, +R_H_LINE_TO, -3, +R_CUBIC_TO, -0.41f, 0, -0.77f, -0.15f, -1.06f, -0.44f, +ARC_TO, 1.44f, 1.44f, 0, 0, 1, 13, 13.5f, +V_LINE_TO, 12, +R_H_LINE_TO, -2.42f, +R_ARC_TO, 5.09f, 5.09f, 0, 0, 1, -1.85f, 2.19f, +ARC_TO, 4.84f, 4.84f, 0, 0, 1, 6, 15, +CLOSE, +R_MOVE_TO, 3.46f, -4.5f, +H_LINE_TO, 14.5f, +R_V_LINE_TO, 3, +R_H_LINE_TO, 1, +V_LINE_TO, 12, +R_CUBIC_TO, 0, -0.14f, 0.05f, -0.27f, 0.14f, -0.36f, +R_ARC_TO, 0.49f, 0.49f, 0, 0, 1, 0.36f, -0.14f, +R_CUBIC_TO, 0.14f, 0, 0.27f, 0.05f, 0.36f, 0.14f, +R_CUBIC_TO, 0.09f, 0.09f, 0.14f, 0.22f, 0.14f, 0.36f, +R_V_LINE_TO, 1.5f, +R_H_LINE_TO, 1, +R_V_LINE_TO, -4, +H_LINE_TO, 9.46f, +R_ARC_TO, 3.27f, 3.27f, 0, 0, 0, -1.16f, -2.16f, +ARC_TO, 3.45f, 3.45f, 0, 0, 0, 6, 6.5f, +R_CUBIC_TO, -0.97f, 0, -1.8f, 0.34f, -2.48f, 1.02f, +CUBIC_TO, 2.84f, 8.2f, 2.5f, 9.03f, 2.5f, 10, +R_CUBIC_TO, 0, 0.97f, 0.34f, 1.8f, 1.02f, 2.48f, +R_CUBIC_TO, 0.68f, 0.68f, 1.51f, 1.02f, 2.48f, 1.02f, +R_CUBIC_TO, 0.87f, 0, 1.64f, -0.28f, 2.3f, -0.84f, +ARC_TO, 3.27f, 3.27f, 0, 0, 0, 9.46f, 10.5f, +CLOSE
diff --git a/components/vector_icons/sync_chrome_refresh.icon b/components/vector_icons/sync_chrome_refresh.icon index 36297ae..537bd4b 100644 --- a/components/vector_icons/sync_chrome_refresh.icon +++ b/components/vector_icons/sync_chrome_refresh.icon
@@ -1,83 +1,41 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -CANVAS_DIMENSIONS, 24, -MOVE_TO, 4.01f, 20.12f, -R_V_LINE_TO, -2.09f, -R_H_LINE_TO, 2.55f, -R_LINE_TO, -0.32f, -0.29f, -R_CUBIC_TO, -0.87f, -0.79f, -1.49f, -1.68f, -1.85f, -2.67f, -R_ARC_TO, 8.73f, 8.73f, 0, 0, 1, -0.54f, -3.01f, -R_CUBIC_TO, 0, -1.91f, 0.59f, -3.61f, 1.75f, -5.09f, -R_CUBIC_TO, 1.17f, -1.48f, 2.68f, -2.44f, 4.54f, -2.89f, -R_V_LINE_TO, 2.38f, -R_ARC_TO, 5.66f, 5.66f, 0, 0, 0, -2.91f, 2.15f, -R_ARC_TO, 5.82f, 5.82f, 0, 0, 0, -1.11f, 3.47f, -R_CUBIC_TO, 0, 0.73f, 0.14f, 1.43f, 0.42f, 2.13f, -R_ARC_TO, 5.86f, 5.86f, 0, 0, 0, 1.29f, 1.92f, -R_LINE_TO, 0.2f, 0.2f, -V_LINE_TO, 14, -R_H_LINE_TO, 2.09f, -R_V_LINE_TO, 6.12f, -CLOSE, -R_MOVE_TO, 9.84f, -0.19f, -R_V_LINE_TO, -2.37f, -R_ARC_TO, 5.66f, 5.66f, 0, 0, 0, 2.91f, -2.14f, -R_ARC_TO, 5.82f, 5.82f, 0, 0, 0, 1.11f, -3.46f, -R_CUBIC_TO, 0, -0.73f, -0.14f, -1.43f, -0.42f, -2.12f, -R_ARC_TO, 5.86f, 5.86f, 0, 0, 0, -1.29f, -1.92f, -R_LINE_TO, -0.2f, -0.2f, -V_LINE_TO, 10, -R_H_LINE_TO, -2.09f, -V_LINE_TO, 3.88f, -R_H_LINE_TO, 6.11f, -R_V_LINE_TO, 2.09f, -R_H_LINE_TO, -2.55f, -R_LINE_TO, 0.32f, 0.29f, -R_CUBIC_TO, 0.83f, 0.83f, 1.43f, 1.73f, 1.82f, 2.71f, -R_CUBIC_TO, 0.38f, 0.98f, 0.57f, 1.97f, 0.57f, 2.98f, -R_CUBIC_TO, 0, 1.91f, -0.58f, 3.61f, -1.75f, 5.09f, -R_CUBIC_TO, -1.17f, 1.48f, -2.68f, 2.44f, -4.54f, 2.9f, -CLOSE - CANVAS_DIMENSIONS, 20, -MOVE_TO, 4.51f, 16.1f, -R_V_LINE_TO, -1.58f, -R_H_LINE_TO, 1.38f, -R_LINE_TO, 0.07f, 0.05f, -R_ARC_TO, 6.67f, 6.67f, 0, 0, 1, -1.51f, -2.03f, -ARC_TO, 5.79f, 5.79f, 0, 0, 1, 3.88f, 10, -R_CUBIC_TO, 0, -1.46f, 0.45f, -2.73f, 1.35f, -3.82f, -R_ARC_TO, 6.1f, 6.1f, 0, 0, 1, 3.4f, -2.12f, -R_V_LINE_TO, 1.79f, -R_ARC_TO, 4.41f, 4.41f, 0, 0, 0, -2.17f, 1.56f, -R_CUBIC_TO, -0.57f, 0.75f, -0.85f, 1.61f, -0.85f, 2.59f, -R_CUBIC_TO, 0, 0.65f, 0.13f, 1.25f, 0.4f, 1.8f, -R_ARC_TO, 4.45f, 4.45f, 0, 0, 0, 1.07f, 1.43f, -R_LINE_TO, -0.04f, -0.04f, +FILL_RULE_NONZERO, +MOVE_TO, 4.5f, 16, +R_V_LINE_TO, -1.5f, +R_H_LINE_TO, 1.54f, +R_ARC_TO, 6.27f, 6.27f, 0, 0, 1, -1.49f, -1.99f, +ARC_TO, 5.78f, 5.78f, 0, 0, 1, 4, 10, +R_CUBIC_TO, 0, -1.4f, 0.42f, -2.64f, 1.27f, -3.7f, +ARC_TO, 5.92f, 5.92f, 0, 0, 1, 8.5f, 4.21f, +V_LINE_TO, 5.77f, +R_CUBIC_TO, -0.87f, 0.32f, -1.59f, 0.86f, -2.16f, 1.62f, +CUBIC_TO, 5.78f, 8.14f, 5.5f, 9.02f, 5.5f, 10, +R_CUBIC_TO, 0, 0.67f, 0.14f, 1.29f, 0.41f, 1.86f, +ARC_TO, 4.5f, 4.5f, 0, 0, 0, 7, 13.31f, V_LINE_TO, 12, -R_H_LINE_TO, 1.57f, -R_V_LINE_TO, 4.1f, +R_H_LINE_TO, 1.5f, +R_V_LINE_TO, 4, CLOSE, -R_MOVE_TO, 6.86f, -0.16f, -R_V_LINE_TO, -1.79f, -R_ARC_TO, 4.41f, 4.41f, 0, 0, 0, 2.17f, -1.56f, -R_CUBIC_TO, 0.57f, -0.75f, 0.85f, -1.61f, 0.85f, -2.59f, -R_CUBIC_TO, 0, -0.65f, -0.13f, -1.25f, -0.4f, -1.8f, -R_ARC_TO, 4.45f, 4.45f, 0, 0, 0, -1.07f, -1.43f, -R_LINE_TO, 0.04f, 0.04f, +R_MOVE_TO, 7, -0.21f, +V_LINE_TO, 14.23f, +R_ARC_TO, 4.61f, 4.61f, 0, 0, 0, 2.16f, -1.62f, +R_CUBIC_TO, 0.56f, -0.75f, 0.84f, -1.63f, 0.84f, -2.61f, +R_CUBIC_TO, 0, -0.67f, -0.14f, -1.28f, -0.41f, -1.85f, +ARC_TO, 4.5f, 4.5f, 0, 0, 0, 13, 6.69f, V_LINE_TO, 8, -R_H_LINE_TO, -1.57f, -V_LINE_TO, 3.9f, -R_H_LINE_TO, 4.09f, -R_V_LINE_TO, 1.58f, -R_H_LINE_TO, -1.37f, -R_LINE_TO, -0.07f, -0.05f, -R_ARC_TO, 6.38f, 6.38f, 0, 0, 1, 1.52f, 2.03f, -R_CUBIC_TO, 0.38f, 0.79f, 0.56f, 1.63f, 0.56f, 2.55f, -R_CUBIC_TO, 0, 1.46f, -0.45f, 2.73f, -1.35f, 3.82f, -R_ARC_TO, 6.1f, 6.1f, 0, 0, 1, -3.4f, 2.12f, +R_H_LINE_TO, -1.5f, +V_LINE_TO, 4, +R_H_LINE_TO, 4, +R_V_LINE_TO, 1.5f, +R_H_LINE_TO, -1.54f, +R_ARC_TO, 6.27f, 6.27f, 0, 0, 1, 1.49f, 1.99f, +R_CUBIC_TO, 0.37f, 0.77f, 0.55f, 1.61f, 0.55f, 2.51f, +R_CUBIC_TO, 0, 1.4f, -0.42f, 2.64f, -1.27f, 3.7f, +R_ARC_TO, 5.92f, 5.92f, 0, 0, 1, -3.23f, 2.09f, CLOSE CANVAS_DIMENSIONS, 16,
diff --git a/components/vector_icons/sync_off_chrome_refresh.icon b/components/vector_icons/sync_off_chrome_refresh.icon index 10c15e0df..050da026 100644 --- a/components/vector_icons/sync_off_chrome_refresh.icon +++ b/components/vector_icons/sync_off_chrome_refresh.icon
@@ -1,165 +1,113 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -CANVAS_DIMENSIONS, 24, -MOVE_TO, 19.76f, 22.66f, -LINE_TO, 16.1f, 19, -R_CUBIC_TO, -0.35f, 0.2f, -0.71f, 0.39f, -1.09f, 0.55f, -R_CUBIC_TO, -0.38f, 0.16f, -0.78f, 0.29f, -1.2f, 0.39f, -R_V_LINE_TO, -2.37f, -R_CUBIC_TO, 0.11f, -0.03f, 0.21f, -0.07f, 0.31f, -0.11f, -R_CUBIC_TO, 0.1f, -0.04f, 0.2f, -0.08f, 0.31f, -0.12f, -LINE_TO, 6.64f, 9.54f, -R_CUBIC_TO, -0.17f, 0.4f, -0.31f, 0.8f, -0.41f, 1.22f, -R_ARC_TO, 5.66f, 5.66f, 0, 0, 0, 0.27f, 3.41f, -R_ARC_TO, 5.83f, 5.83f, 0, 0, 0, 1.29f, 1.93f, -R_LINE_TO, 0.2f, 0.2f, -V_LINE_TO, 14, -R_H_LINE_TO, 2.09f, -R_V_LINE_TO, 6.12f, -H_LINE_TO, 3.97f, -R_V_LINE_TO, -2.09f, -R_H_LINE_TO, 2.56f, -R_LINE_TO, -0.33f, -0.29f, -R_CUBIC_TO, -0.83f, -0.83f, -1.43f, -1.73f, -1.82f, -2.71f, -R_ARC_TO, 8.17f, 8.17f, 0, 0, 1, 0.58f, -7.18f, -R_LINE_TO, -3.6f, -3.59f, -LINE_TO, 2.85f, 2.77f, -LINE_TO, 21.25f, 21.17f, -CLOSE, -R_MOVE_TO, -0.75f, -6.57f, -LINE_TO, 17.3f, 14.38f, -R_CUBIC_TO, 0.17f, -0.37f, 0.3f, -0.77f, 0.39f, -1.18f, -R_ARC_TO, 5.73f, 5.73f, 0, 0, 0, -0.28f, -3.37f, -R_ARC_TO, 5.86f, 5.86f, 0, 0, 0, -1.29f, -1.92f, -R_LINE_TO, -0.21f, -0.2f, -V_LINE_TO, 10, -R_H_LINE_TO, -2.09f, -V_LINE_TO, 3.88f, -R_H_LINE_TO, 6.12f, -R_V_LINE_TO, 2.09f, -R_H_LINE_TO, -2.56f, -R_LINE_TO, 0.33f, 0.29f, -R_CUBIC_TO, 0.83f, 0.83f, 1.43f, 1.73f, 1.82f, 2.71f, -R_ARC_TO, 8.17f, 8.17f, 0, 0, 1, 0.28f, 5.16f, -R_ARC_TO, 9.33f, 9.33f, 0, 0, 1, -0.8f, 1.96f, -CLOSE, -R_MOVE_TO, -9.43f, -9.43f, -LINE_TO, 7.88f, 4.95f, -R_CUBIC_TO, 0.34f, -0.2f, 0.7f, -0.37f, 1.07f, -0.51f, -R_CUBIC_TO, 0.37f, -0.14f, 0.75f, -0.27f, 1.16f, -0.37f, -R_V_LINE_TO, 2.38f, -R_ARC_TO, 9.77f, 9.77f, 0, 0, 1, -0.26f, 0.09f, -R_CUBIC_TO, -0.09f, 0.03f, -0.18f, 0.07f, -0.26f, 0.12f, -CLOSE - CANVAS_DIMENSIONS, 20, -R_MOVE_TO, 15.97f, 17.11f, -R_LINE_TO, -2.93f, -2.92f, -R_ARC_TO, 7.31f, 7.31f, 0, 0, 1, -0.82f, 0.42f, -R_ARC_TO, 4.51f, 4.51f, 0, 0, 1, -0.88f, 0.3f, -R_V_LINE_TO, -1.81f, -R_CUBIC_TO, 0.07f, -0.03f, 0.14f, -0.06f, 0.22f, -0.09f, -R_CUBIC_TO, 0.07f, -0.03f, 0.14f, -0.06f, 0.21f, -0.09f, -R_LINE_TO, -5.78f, -5.8f, -R_CUBIC_TO, -0.13f, 0.28f, -0.23f, 0.57f, -0.3f, 0.87f, -R_ARC_TO, 3.81f, 3.81f, 0, 0, 0, -0.11f, 0.95f, -R_CUBIC_TO, 0, 0.64f, 0.13f, 1.24f, 0.4f, 1.8f, -R_ARC_TO, 4.45f, 4.45f, 0, 0, 0, 1.07f, 1.43f, -R_LINE_TO, -0.04f, -0.04f, -R_V_LINE_TO, -1.19f, -H_LINE_TO, 8.57f, -R_V_LINE_TO, 4.1f, -H_LINE_TO, 4.47f, +FILL_RULE_NONZERO, +R_MOVE_TO, 16, 17.06f, +R_LINE_TO, -2.98f, -2.98f, +R_CUBIC_TO, -0.23f, 0.14f, -0.48f, 0.27f, -0.73f, 0.39f, +R_CUBIC_TO, -0.25f, 0.12f, -0.52f, 0.21f, -0.79f, 0.28f, R_V_LINE_TO, -1.58f, -R_H_LINE_TO, 1.38f, -R_LINE_TO, 0.06f, 0.05f, -R_ARC_TO, 6.38f, 6.38f, 0, 0, 1, -1.52f, -2.03f, -R_ARC_TO, 5.88f, 5.88f, 0, 0, 1, -0.56f, -2.55f, -R_CUBIC_TO, 0, -0.57f, 0.07f, -1.11f, 0.23f, -1.64f, -R_ARC_TO, 6.28f, 6.28f, 0, 0, 1, 0.63f, -1.46f, -LINE_TO, 1.84f, 2.97f, -R_LINE_TO, 1.12f, -1.12f, -R_LINE_TO, 14.13f, 14.15f, +R_CUBIC_TO, 0.07f, -0.03f, 0.14f, -0.06f, 0.21f, -0.09f, +R_CUBIC_TO, 0.07f, -0.04f, 0.14f, -0.07f, 0.21f, -0.09f, +LINE_TO, 5.96f, 7, +R_ARC_TO, 5.21f, 5.21f, 0, 0, 0, -0.33f, 0.93f, +ARC_TO, 4.15f, 4.15f, 0, 0, 0, 5.5f, 8.94f, +R_CUBIC_TO, 0, 0.67f, 0.14f, 1.29f, 0.41f, 1.86f, +ARC_TO, 4.5f, 4.5f, 0, 0, 0, 7, 12.25f, +R_V_LINE_TO, -1.31f, +R_H_LINE_TO, 1.5f, +R_V_LINE_TO, 4, +R_H_LINE_TO, -4, +R_V_LINE_TO, -1.5f, +R_H_LINE_TO, 1.54f, +R_ARC_TO, 6.27f, 6.27f, 0, 0, 1, -1.49f, -1.99f, +ARC_TO, 5.78f, 5.78f, 0, 0, 1, 4, 8.94f, +R_CUBIC_TO, 0, -0.56f, 0.07f, -1.09f, 0.22f, -1.61f, +R_CUBIC_TO, 0.14f, -0.51f, 0.35f, -0.99f, 0.61f, -1.44f, +LINE_TO, 1.88f, 2.92f, +R_LINE_TO, 1.06f, -1.06f, +LINE_TO, 17.06f, 16, CLOSE, -R_MOVE_TO, -0.73f, -5.09f, -R_LINE_TO, -1.3f, -1.3f, -R_ARC_TO, 4.64f, 4.64f, 0, 0, 0, 0.3f, -0.85f, -R_ARC_TO, 4.24f, 4.24f, 0, 0, 0, -0.28f, -2.75f, -R_ARC_TO, 4.46f, 4.46f, 0, 0, 0, -1.07f, -1.44f, -R_LINE_TO, 0.04f, 0.04f, -R_V_LINE_TO, 1.21f, -R_H_LINE_TO, -1.57f, -V_LINE_TO, 2.84f, -R_H_LINE_TO, 4.1f, +R_MOVE_TO, -0.83f, -5.08f, +R_LINE_TO, -1.12f, -1.12f, +R_CUBIC_TO, 0.14f, -0.29f, 0.25f, -0.6f, 0.33f, -0.92f, +R_ARC_TO, 4.33f, 4.33f, 0, 0, 0, -0.28f, -2.86f, +ARC_TO, 4.43f, 4.43f, 0, 0, 0, 13, 5.61f, +R_V_LINE_TO, 1.33f, +R_H_LINE_TO, -1.5f, +R_V_LINE_TO, -4, +R_H_LINE_TO, 4, +R_V_LINE_TO, 1.5f, +R_H_LINE_TO, -1.54f, +R_ARC_TO, 6.27f, 6.27f, 0, 0, 1, 1.49f, 1.99f, +R_CUBIC_TO, 0.37f, 0.77f, 0.55f, 1.61f, 0.55f, 2.51f, +R_CUBIC_TO, 0, 0.56f, -0.07f, 1.09f, -0.22f, 1.61f, +R_ARC_TO, 6.11f, 6.11f, 0, 0, 1, -0.61f, 1.44f, +CLOSE, +MOVE_TO, 8.08f, 4.89f, +LINE_TO, 6.98f, 3.77f, +R_CUBIC_TO, 0.24f, -0.14f, 0.48f, -0.26f, 0.73f, -0.37f, +R_CUBIC_TO, 0.25f, -0.11f, 0.52f, -0.2f, 0.79f, -0.27f, R_V_LINE_TO, 1.58f, -R_H_LINE_TO, -1.38f, -R_LINE_TO, -0.06f, -0.05f, -R_ARC_TO, 6.31f, 6.31f, 0, 0, 1, 1.51f, 2.03f, -R_CUBIC_TO, 0.38f, 0.79f, 0.56f, 1.63f, 0.56f, 2.55f, -R_CUBIC_TO, 0, 0.57f, -0.07f, 1.11f, -0.22f, 1.63f, -R_ARC_TO, 5.92f, 5.92f, 0, 0, 1, -0.62f, 1.46f, -CLOSE, -R_MOVE_TO, -7.07f, -7.07f, -LINE_TO, 6.9f, 3.67f, -R_ARC_TO, 7.13f, 7.13f, 0, 0, 1, 0.81f, -0.41f, -R_CUBIC_TO, 0.28f, -0.12f, 0.57f, -0.22f, 0.88f, -0.29f, -R_V_LINE_TO, 1.81f, R_CUBIC_TO, -0.07f, 0.03f, -0.14f, 0.06f, -0.21f, 0.09f, -R_ARC_TO, 1.92f, 1.92f, 0, 0, 1, -0.21f, 0.09f, +R_CUBIC_TO, -0.07f, 0.04f, -0.14f, 0.07f, -0.21f, 0.09f, CLOSE CANVAS_DIMENSIONS, 16, -R_MOVE_TO, 12.73f, 13.75f, -R_LINE_TO, -2.28f, -2.28f, -R_CUBIC_TO, -0.24f, 0.14f, -0.49f, 0.27f, -0.75f, 0.38f, -R_CUBIC_TO, -0.26f, 0.11f, -0.53f, 0.19f, -0.81f, 0.25f, -V_LINE_TO, 10.39f, -R_CUBIC_TO, 0.06f, -0.02f, 0.12f, -0.04f, 0.18f, -0.07f, -R_ARC_TO, 1.16f, 1.16f, 0, 0, 1, 0.18f, -0.06f, -LINE_TO, 4.82f, 5.82f, -R_ARC_TO, 3.21f, 3.21f, 0, 0, 0, 0.02f, 2.72f, -R_CUBIC_TO, 0.2f, 0.43f, 0.48f, 0.8f, 0.82f, 1.11f, -R_LINE_TO, -0.07f, -0.07f, -V_LINE_TO, 8.75f, -R_H_LINE_TO, 1.35f, -R_V_LINE_TO, 3.39f, -H_LINE_TO, 3.54f, -R_V_LINE_TO, -1.34f, -R_H_LINE_TO, 0.93f, -R_LINE_TO, 0.11f, 0.09f, -R_ARC_TO, 5.17f, 5.17f, 0, 0, 1, -1.24f, -1.67f, -R_ARC_TO, 4.77f, 4.77f, 0, 0, 1, -0.46f, -2.08f, -R_CUBIC_TO, 0, -0.46f, 0.06f, -0.91f, 0.19f, -1.34f, -R_CUBIC_TO, 0.13f, -0.43f, 0.3f, -0.83f, 0.52f, -1.2f, -R_LINE_TO, -2.17f, -2.18f, -R_LINE_TO, 0.95f, -0.95f, +FILL_RULE_NONZERO, +R_MOVE_TO, 12.77f, 13.69f, +R_LINE_TO, -2.34f, -2.34f, +R_CUBIC_TO, -0.21f, 0.13f, -0.43f, 0.24f, -0.65f, 0.34f, +R_CUBIC_TO, -0.23f, 0.1f, -0.46f, 0.18f, -0.71f, 0.24f, +R_V_LINE_TO, -1.45f, +R_CUBIC_TO, 0.06f, -0.02f, 0.11f, -0.05f, 0.17f, -0.07f, +R_CUBIC_TO, 0.06f, -0.03f, 0.11f, -0.05f, 0.17f, -0.07f, +LINE_TO, 4.79f, 5.69f, +R_ARC_TO, 3.69f, 3.69f, 0, 0, 0, -0.24f, 0.7f, +R_CUBIC_TO, -0.06f, 0.24f, -0.09f, 0.5f, -0.09f, 0.76f, +R_CUBIC_TO, 0, 0.52f, 0.11f, 1, 0.32f, 1.44f, +R_CUBIC_TO, 0.21f, 0.45f, 0.5f, 0.82f, 0.85f, 1.14f, +R_LINE_TO, -0.03f, -0.03f, +R_V_LINE_TO, -0.95f, +R_H_LINE_TO, 1.26f, +R_V_LINE_TO, 3.28f, +R_H_LINE_TO, -3.28f, +V_LINE_TO, 10.77f, +R_H_LINE_TO, 1.11f, +R_LINE_TO, 0.05f, 0.04f, +R_ARC_TO, 5.13f, 5.13f, 0, 0, 1, -1.21f, -1.62f, +R_ARC_TO, 4.72f, 4.72f, 0, 0, 1, -0.45f, -2.04f, +R_CUBIC_TO, 0, -0.45f, 0.06f, -0.89f, 0.18f, -1.31f, +R_CUBIC_TO, 0.12f, -0.42f, 0.29f, -0.81f, 0.5f, -1.17f, +LINE_TO, 1.47f, 2.38f, +R_LINE_TO, 0.89f, -0.89f, R_LINE_TO, 11.3f, 11.32f, CLOSE, -R_MOVE_TO, -0.47f, -4.07f, -R_LINE_TO, -1.23f, -1.23f, -R_ARC_TO, 3.04f, 3.04f, 0, 0, 0, 0.29f, -1.3f, -R_CUBIC_TO, 0, -0.49f, -0.1f, -0.96f, -0.31f, -1.39f, -R_ARC_TO, 3.48f, 3.48f, 0, 0, 0, -0.82f, -1.11f, -R_LINE_TO, 0.07f, 0.07f, -R_V_LINE_TO, 0.83f, -H_LINE_TO, 8.93f, -V_LINE_TO, 2.16f, -R_H_LINE_TO, 3.39f, -R_V_LINE_TO, 1.34f, -R_H_LINE_TO, -0.93f, -R_LINE_TO, -0.11f, -0.09f, -R_CUBIC_TO, 0.52f, 0.47f, 0.93f, 1.02f, 1.23f, 1.66f, -R_CUBIC_TO, 0.31f, 0.65f, 0.46f, 1.34f, 0.46f, 2.07f, -R_CUBIC_TO, 0, 0.47f, -0.06f, 0.91f, -0.18f, 1.34f, -R_CUBIC_TO, -0.12f, 0.43f, -0.29f, 0.83f, -0.51f, 1.19f, +R_MOVE_TO, -0.58f, -4.07f, +R_LINE_TO, -1.04f, -1.04f, +R_ARC_TO, 3.39f, 3.39f, 0, 0, 0, 0.25f, -0.68f, +R_ARC_TO, 3.37f, 3.37f, 0, 0, 0, -0.23f, -2.2f, +R_ARC_TO, 3.53f, 3.53f, 0, 0, 0, -0.85f, -1.15f, +R_LINE_TO, 0.03f, 0.03f, +R_V_LINE_TO, 0.97f, +H_LINE_TO, 9.09f, +V_LINE_TO, 2.27f, +R_H_LINE_TO, 3.28f, +V_LINE_TO, 3.53f, +R_H_LINE_TO, -1.1f, +R_LINE_TO, -0.05f, -0.04f, +R_CUBIC_TO, 0.51f, 0.46f, 0.91f, 1, 1.21f, 1.63f, +R_CUBIC_TO, 0.3f, 0.63f, 0.45f, 1.31f, 0.45f, 2.04f, +R_CUBIC_TO, 0, 0.45f, -0.06f, 0.89f, -0.18f, 1.31f, +R_ARC_TO, 4.65f, 4.65f, 0, 0, 1, -0.5f, 1.17f, CLOSE, -MOVE_TO, 6.63f, 4.04f, -LINE_TO, 5.42f, 2.82f, -R_CUBIC_TO, 0.23f, -0.14f, 0.48f, -0.26f, 0.73f, -0.37f, -R_CUBIC_TO, 0.26f, -0.11f, 0.52f, -0.19f, 0.81f, -0.25f, -R_V_LINE_TO, 1.7f, -R_LINE_TO, -0.17f, 0.07f, -R_ARC_TO, 0.87f, 0.87f, 0, 0, 1, -0.17f, 0.06f, -CLOSE \ No newline at end of file +MOVE_TO, 6.54f, 3.97f, +R_LINE_TO, -1.02f, -1.03f, +R_CUBIC_TO, 0.21f, -0.12f, 0.42f, -0.23f, 0.65f, -0.33f, +R_CUBIC_TO, 0.22f, -0.1f, 0.46f, -0.17f, 0.7f, -0.23f, +R_V_LINE_TO, 1.45f, +R_CUBIC_TO, -0.05f, 0.02f, -0.11f, 0.04f, -0.17f, 0.07f, +R_ARC_TO, 1.48f, 1.48f, 0, 0, 1, -0.16f, 0.07f, +CLOSE
diff --git a/components/vector_icons/sync_problem_chrome_refresh.icon b/components/vector_icons/sync_problem_chrome_refresh.icon index 3c0fd0f..db850ae 100644 --- a/components/vector_icons/sync_problem_chrome_refresh.icon +++ b/components/vector_icons/sync_problem_chrome_refresh.icon
@@ -1,57 +1,56 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. CANVAS_DIMENSIONS, 16, -MOVE_TO, 2.67f, 12.99f, -R_V_LINE_TO, -1.34f, -R_H_LINE_TO, 0.93f, -R_LINE_TO, 0.11f, 0.09f, -R_ARC_TO, 5.83f, 5.83f, 0, 0, 1, -1.23f, -1.68f, -ARC_TO, 4.67f, 4.67f, 0, 0, 1, 2.02f, 8, -R_CUBIC_TO, 0, -1.22f, 0.39f, -2.29f, 1.16f, -3.2f, -R_ARC_TO, 5.07f, 5.07f, 0, 0, 1, 2.91f, -1.73f, -R_V_LINE_TO, 1.68f, -R_CUBIC_TO, -0.71f, 0.2f, -1.29f, 0.59f, -1.75f, 1.19f, -ARC_TO, 3.27f, 3.27f, 0, 0, 0, 3.66f, 8, -R_CUBIC_TO, 0, 0.5f, 0.1f, 0.96f, 0.31f, 1.38f, -R_CUBIC_TO, 0.21f, 0.43f, 0.48f, 0.8f, 0.82f, 1.11f, -R_LINE_TO, -0.07f, -0.07f, -R_V_LINE_TO, -0.81f, -R_H_LINE_TO, 1.34f, -R_V_LINE_TO, 3.39f, +FILL_RULE_NONZERO, +MOVE_TO, 2.75f, 12.88f, +V_LINE_TO, 11.62f, +R_H_LINE_TO, 1.11f, +R_LINE_TO, 0.05f, 0.04f, +R_ARC_TO, 5.3f, 5.3f, 0, 0, 1, -1.21f, -1.63f, +R_CUBIC_TO, -0.3f, -0.62f, -0.45f, -1.3f, -0.45f, -2.03f, +R_CUBIC_TO, 0, -1.16f, 0.36f, -2.18f, 1.07f, -3.06f, +R_ARC_TO, 4.88f, 4.88f, 0, 0, 1, 2.72f, -1.7f, +R_V_LINE_TO, 1.43f, +R_ARC_TO, 3.46f, 3.46f, 0, 0, 0, -1.73f, 1.25f, +ARC_TO, 3.36f, 3.36f, 0, 0, 0, 3.63f, 8, +R_CUBIC_TO, 0, 0.52f, 0.11f, 1, 0.32f, 1.44f, +R_CUBIC_TO, 0.21f, 0.45f, 0.5f, 0.83f, 0.85f, 1.14f, +R_LINE_TO, -0.03f, -0.03f, +V_LINE_TO, 9.6f, +R_H_LINE_TO, 1.26f, +R_V_LINE_TO, 3.28f, CLOSE, -MOVE_TO, 8, 11.31f, -R_CUBIC_TO, -0.2f, 0, -0.37f, -0.07f, -0.5f, -0.21f, -R_ARC_TO, 0.68f, 0.68f, 0, 0, 1, -0.21f, -0.5f, -R_CUBIC_TO, 0, -0.2f, 0.07f, -0.37f, 0.21f, -0.51f, -ARC_TO, 0.69f, 0.69f, 0, 0, 1, 8, 9.89f, -R_CUBIC_TO, 0.2f, 0, 0.37f, 0.07f, 0.5f, 0.21f, -R_CUBIC_TO, 0.14f, 0.14f, 0.21f, 0.31f, 0.21f, 0.5f, -R_CUBIC_TO, 0, 0.2f, -0.07f, 0.37f, -0.21f, 0.51f, -R_ARC_TO, 0.69f, 0.69f, 0, 0, 1, -0.5f, 0.21f, +MOVE_TO, 8, 11.25f, +R_ARC_TO, 0.62f, 0.62f, 0, 0, 1, -0.46f, -0.19f, +R_ARC_TO, 0.61f, 0.61f, 0, 0, 1, -0.19f, -0.46f, +ARC_TO, 0.64f, 0.64f, 0, 0, 1, 8, 9.95f, +R_CUBIC_TO, 0.18f, 0, 0.33f, 0.06f, 0.46f, 0.19f, +R_ARC_TO, 0.61f, 0.61f, 0, 0, 1, 0.19f, 0.46f, +R_ARC_TO, 0.64f, 0.64f, 0, 0, 1, -0.65f, 0.65f, CLOSE, -R_MOVE_TO, -0.68f, -2.44f, -V_LINE_TO, 4.66f, -R_H_LINE_TO, 1.35f, -R_V_LINE_TO, 4.22f, +R_MOVE_TO, -0.63f, -2.41f, +V_LINE_TO, 4.74f, +R_H_LINE_TO, 1.27f, +R_V_LINE_TO, 4.09f, CLOSE, -R_MOVE_TO, 2.57f, 4.05f, -R_V_LINE_TO, -1.68f, -R_CUBIC_TO, 0.71f, -0.2f, 1.29f, -0.59f, 1.75f, -1.19f, -ARC_TO, 3.27f, 3.27f, 0, 0, 0, 12.32f, 8, -R_ARC_TO, 3.17f, 3.17f, 0, 0, 0, -0.3f, -1.38f, -R_ARC_TO, 3.51f, 3.51f, 0, 0, 0, -0.82f, -1.1f, -R_LINE_TO, 0.07f, 0.07f, -R_V_LINE_TO, 0.81f, -H_LINE_TO, 9.93f, -V_LINE_TO, 3.01f, -R_H_LINE_TO, 3.39f, -R_V_LINE_TO, 1.34f, -R_H_LINE_TO, -0.93f, -R_LINE_TO, -0.11f, -0.09f, -R_CUBIC_TO, 0.52f, 0.47f, 0.93f, 1.02f, 1.23f, 1.66f, -R_CUBIC_TO, 0.3f, 0.64f, 0.45f, 1.34f, 0.45f, 2.08f, -R_CUBIC_TO, 0, 1.22f, -0.39f, 2.29f, -1.16f, 3.2f, -R_ARC_TO, 5.07f, 5.07f, 0, 0, 1, -2.91f, 1.73f, +R_MOVE_TO, 2.59f, 3.93f, +R_V_LINE_TO, -1.43f, +R_ARC_TO, 3.46f, 3.46f, 0, 0, 0, 1.73f, -1.25f, +R_CUBIC_TO, 0.45f, -0.6f, 0.68f, -1.29f, 0.68f, -2.07f, +R_CUBIC_TO, 0, -0.52f, -0.1f, -1, -0.32f, -1.44f, +R_ARC_TO, 3.54f, 3.54f, 0, 0, 0, -0.85f, -1.14f, +R_LINE_TO, 0.03f, 0.03f, +R_V_LINE_TO, 0.95f, +H_LINE_TO, 9.97f, +V_LINE_TO, 3.12f, +R_H_LINE_TO, 3.28f, +V_LINE_TO, 4.38f, +R_H_LINE_TO, -1.1f, +R_LINE_TO, -0.05f, -0.04f, +R_CUBIC_TO, 0.51f, 0.45f, 0.91f, 1, 1.21f, 1.63f, +R_CUBIC_TO, 0.3f, 0.63f, 0.45f, 1.31f, 0.45f, 2.04f, +R_CUBIC_TO, 0, 1.16f, -0.35f, 2.18f, -1.07f, 3.06f, +R_ARC_TO, 4.88f, 4.88f, 0, 0, 1, -2.72f, 1.7f, CLOSE
diff --git a/components/web_package/web_bundle_utils_unittest.cc b/components/web_package/web_bundle_utils_unittest.cc index 2b99731..b406a15 100644 --- a/components/web_package/web_bundle_utils_unittest.cc +++ b/components/web_package/web_bundle_utils_unittest.cc
@@ -26,8 +26,6 @@ GURL("urn:guid:00000000-0000-0000-0000-000000000000"))); ASSERT_FALSE(IsValidUuidInPackageURL( GURL("uri:uuid:00000000-0000-0000-0000-000000000000"))); - ASSERT_FALSE(IsValidUuidInPackageURL( - GURL("urn://uuid:00000000-0000-0000-0000-000000000000"))); ASSERT_TRUE(IsValidUuidInPackageURL( GURL("uuid-in-package:F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6"))); ASSERT_TRUE(IsValidUuidInPackageURL(
diff --git a/content/browser/accessibility/browser_accessibility_state_impl_win.cc b/content/browser/accessibility/browser_accessibility_state_impl_win.cc index 30741d9..fcfaf61 100644 --- a/content/browser/accessibility/browser_accessibility_state_impl_win.cc +++ b/content/browser/accessibility/browser_accessibility_state_impl_win.cc
@@ -158,6 +158,7 @@ BrowserAccessibilityStateImplWin(); protected: + void InitBackgroundTasks() override; void UpdateHistogramsOnOtherThread() override; void UpdateUniqueUserHistograms() override; @@ -168,6 +169,10 @@ BrowserAccessibilityStateImplWin::BrowserAccessibilityStateImplWin() { ui::GetWinAccessibilityAPIUsageObserverList().AddObserver( new WindowsAccessibilityEnabler()); +} + +void BrowserAccessibilityStateImplWin::InitBackgroundTasks() { + BrowserAccessibilityStateImpl::InitBackgroundTasks(); singleton_hwnd_observer_ = std::make_unique<gfx::SingletonHwndObserver>( base::BindRepeating(&OnWndProc));
diff --git a/content/browser/interest_group/auction_url_loader_factory_proxy.cc b/content/browser/interest_group/auction_url_loader_factory_proxy.cc index 87853dd..cac1162c 100644 --- a/content/browser/interest_group/auction_url_loader_factory_proxy.cc +++ b/content/browser/interest_group/auction_url_loader_factory_proxy.cc
@@ -37,6 +37,7 @@ #include "net/traffic_annotation/network_traffic_annotation.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/mojom/interest_group/interest_group_types.mojom.h" #include "url/gurl.h" #include "url/origin.h" @@ -179,6 +180,13 @@ return; } + bool is_cross_origin_enabled_trusted_signals_request = false; + if (is_trusted_signals_request && is_for_seller_ && + base::FeatureList::IsEnabled( + blink::features::kFledgePermitCrossOriginTrustedSignals)) { + is_cross_origin_enabled_trusted_signals_request = true; + } + // Create fresh request object, only keeping the URL field and Accept request // header, to protect against compromised auction worklet processes setting // values that should not have access to (e.g., sending credentialed @@ -215,11 +223,18 @@ } } + if (is_cross_origin_enabled_trusted_signals_request) { + // For cross-origin trusted signals request, the principal is the origin + // of the script. + new_request.request_initiator = url::Origin::Create(script_url_); + } + if (force_reload_) { new_request.load_flags = net::LOAD_BYPASS_CACHE; } - if (maybe_subresource_info || needs_cors_for_additional_bid_) { + if (maybe_subresource_info || needs_cors_for_additional_bid_ || + is_cross_origin_enabled_trusted_signals_request) { // CORS is needed. // // For subresource bundle requests, CORS is supported if the subresource @@ -241,6 +256,10 @@ // signal's JSON response, if made in the context of the page, but the JSON // is only made available to the same-origin script, so ORB isn't needed // here. + // + // This does not apply if we permit trusted signals to be cross-origin from + // the corresponding script, in which has the signals origin's permission is + // required before sharing its data with the script. new_request.mode = network::mojom::RequestMode::kNoCors; }
diff --git a/content/browser/interest_group/auction_url_loader_factory_proxy_unittest.cc b/content/browser/interest_group/auction_url_loader_factory_proxy_unittest.cc index 49ce591..75549893 100644 --- a/content/browser/interest_group/auction_url_loader_factory_proxy_unittest.cc +++ b/content/browser/interest_group/auction_url_loader_factory_proxy_unittest.cc
@@ -14,6 +14,7 @@ #include "base/run_loop.h" #include "base/strings/string_number_conversions.h" #include "base/test/bind.h" +#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "content/browser/interest_group/auction_worklet_manager.h" #include "content/browser/interest_group/subresource_url_builder.h" @@ -33,6 +34,7 @@ #include "services/network/public/mojom/url_loader_factory.mojom.h" #include "services/network/test/test_url_loader_factory.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/interest_group/auction_config.h" #include "url/gurl.h" #include "url/origin.h" @@ -87,7 +89,7 @@ } // namespace -class AuctionUrlLoaderFactoryProxyTest : public testing::Test { +class AuctionUrlLoaderFactoryProxyTest : public testing::TestWithParam<bool> { public: // Ways the proxy can behave in response to a request. enum class ExpectedResponse { @@ -96,6 +98,11 @@ }; AuctionUrlLoaderFactoryProxyTest() { + if (PermitCrossOriginTrustedSignals()) { + scoped_feature_list_.InitAndEnableFeature( + blink::features::kFledgePermitCrossOriginTrustedSignals); + } + // Other defaults are all reasonable, but this should always be true for // FLEDGE. client_security_state_->is_web_secure_context = true; @@ -108,6 +115,8 @@ EXPECT_FALSE(preconnect_url_); } + bool PermitCrossOriginTrustedSignals() const { return GetParam(); } + void CreateUrlLoaderFactoryProxy() { // The AuctionURLLoaderFactoryProxy should only be created if there is no // old one, or the old one's pipe was closed. @@ -303,10 +312,20 @@ EXPECT_EQ(force_reload_ ? net::LOAD_BYPASS_CACHE : 0, observed_request.load_flags); - // The initiator should be set. - EXPECT_EQ(frame_origin_, observed_request.request_initiator); + bool cross_site_enabled_trusted_signals_request = + PermitCrossOriginTrustedSignals() && is_for_seller_ && + !expect_bundle_request && original_accept_header == kAcceptJson; - if (expect_bundle_request || needs_cors_for_additional_bid_) { + // The initiator should be set. + if (cross_site_enabled_trusted_signals_request) { + EXPECT_EQ(url::Origin::Create(GURL(kScriptUrl)), + observed_request.request_initiator); + } else { + EXPECT_EQ(frame_origin_, observed_request.request_initiator); + } + + if (expect_bundle_request || needs_cors_for_additional_bid_ || + cross_site_enabled_trusted_signals_request) { EXPECT_EQ(network::mojom::RequestMode::kCors, observed_request.mode); } else { EXPECT_EQ(network::mojom::RequestMode::kNoCors, observed_request.mode); @@ -404,6 +423,7 @@ } protected: + base::test::ScopedFeatureList scoped_feature_list_; base::test::TaskEnvironment task_environment_; bool is_for_seller_ = false; @@ -428,7 +448,7 @@ mojo::Remote<network::mojom::URLLoaderFactory> remote_url_loader_factory_; }; -TEST_F(AuctionUrlLoaderFactoryProxyTest, Basic) { +TEST_P(AuctionUrlLoaderFactoryProxyTest, Basic) { for (bool is_for_seller : {false, true}) { is_for_seller_ = is_for_seller; // Force creation of a new proxy, with correct `is_for_seller` value. @@ -467,7 +487,7 @@ } } -TEST_F(AuctionUrlLoaderFactoryProxyTest, ForceReload) { +TEST_P(AuctionUrlLoaderFactoryProxyTest, ForceReload) { force_reload_ = true; // Force creation of a new proxy, with correct `force_reload` value. remote_url_loader_factory_.reset(); @@ -476,7 +496,7 @@ TryMakeRequest(kScriptUrl, kAcceptJavascript, ExpectedResponse::kAllow); } -TEST_F(AuctionUrlLoaderFactoryProxyTest, NoWasmUrl) { +TEST_P(AuctionUrlLoaderFactoryProxyTest, NoWasmUrl) { wasm_url_ = std::nullopt; CreateUrlLoaderFactoryProxy(); TryMakeRequest(kWasmUrl, kAcceptJavascript, ExpectedResponse::kReject); @@ -486,7 +506,7 @@ TryMakeRequest(kWasmUrl, std::nullopt, ExpectedResponse::kReject); } -TEST_F(AuctionUrlLoaderFactoryProxyTest, NoTrustedSignalsUrl) { +TEST_P(AuctionUrlLoaderFactoryProxyTest, NoTrustedSignalsUrl) { trusted_signals_base_url_ = std::nullopt; for (bool is_for_seller : {false, true}) { @@ -527,7 +547,7 @@ } // This test focuses on validation of the requested trusted signals URLs. -TEST_F(AuctionUrlLoaderFactoryProxyTest, TrustedSignalsUrl) { +TEST_P(AuctionUrlLoaderFactoryProxyTest, TrustedSignalsUrl) { for (bool is_for_seller : {false, true}) { is_for_seller_ = is_for_seller; // Force creation of a new proxy, with correct `is_for_seller` value. @@ -617,7 +637,7 @@ // Make sure all seller signals requests use the same transient // NetworkAnonymizationKey. -TEST_F(AuctionUrlLoaderFactoryProxyTest, SellerSignalsNetworkIsolationKey) { +TEST_P(AuctionUrlLoaderFactoryProxyTest, SellerSignalsNetworkIsolationKey) { is_for_seller_ = true; // Make 20 JSON requests, 10 with the same URL, 10 with different ones. All // should be plumbed through successfully. @@ -643,7 +663,7 @@ // Test the case the same URL is used for trusted signals and the script (which // seems weird, but should still work). -TEST_F(AuctionUrlLoaderFactoryProxyTest, SameUrl) { +TEST_P(AuctionUrlLoaderFactoryProxyTest, SameUrl) { trusted_signals_base_url_ = GURL(kScriptUrl); for (bool is_for_seller : {false, true}) { @@ -678,7 +698,7 @@ // Make sure that proxies for bidder worklets pass through ClientSecurityState. // This test relies on the ClientSecurityState equality check in // TryMakeRequest(). -TEST_F(AuctionUrlLoaderFactoryProxyTest, ClientSecurityState) { +TEST_P(AuctionUrlLoaderFactoryProxyTest, ClientSecurityState) { is_for_seller_ = false; for (auto ip_address_space : {network::mojom::IPAddressSpace::kLocal, @@ -711,7 +731,7 @@ } } -TEST_F(AuctionUrlLoaderFactoryProxyTest, BasicSubresourceBundles1) { +TEST_P(AuctionUrlLoaderFactoryProxyTest, BasicSubresourceBundles1) { for (bool is_for_seller : {false, true}) { is_for_seller_ = is_for_seller; // Force creation of a new proxy, with correct `is_for_seller` value. @@ -733,7 +753,7 @@ } } -TEST_F(AuctionUrlLoaderFactoryProxyTest, BasicSubresourceBundles2) { +TEST_P(AuctionUrlLoaderFactoryProxyTest, BasicSubresourceBundles2) { for (bool is_for_seller : {false, true}) { is_for_seller_ = is_for_seller; // Force creation of a new proxy, with correct `is_for_seller` value. @@ -760,7 +780,7 @@ } } -TEST_F(AuctionUrlLoaderFactoryProxyTest, AdditionalBidCors) { +TEST_P(AuctionUrlLoaderFactoryProxyTest, AdditionalBidCors) { is_for_seller_ = false; needs_cors_for_additional_bid_ = true; @@ -770,4 +790,8 @@ TryMakeRequest(kScriptUrl, kAcceptJavascript, ExpectedResponse::kAllow); } +INSTANTIATE_TEST_SUITE_P( + /* no label */, + AuctionUrlLoaderFactoryProxyTest, + testing::Bool()); } // namespace content
diff --git a/content/browser/interest_group/interest_group_browsertest.cc b/content/browser/interest_group/interest_group_browsertest.cc index 22021db7..6d7d377 100644 --- a/content/browser/interest_group/interest_group_browsertest.cc +++ b/content/browser/interest_group/interest_group_browsertest.cc
@@ -23300,6 +23300,152 @@ ->ShouldChangeRenderFrameHostOnSameSiteNavigation()); } +class InterestGroupCrossOriginTrustedSignalsBrowserTest + : public InterestGroupBrowserTest { + public: + InterestGroupCrossOriginTrustedSignalsBrowserTest() { + feature_list_.InitAndEnableFeature( + blink::features::kFledgePermitCrossOriginTrustedSignals); + } + + ~InterestGroupCrossOriginTrustedSignalsBrowserTest() override = default; + + void TestTrustedSellerSignals(bool expect_success, + bool add_cors_header, + bool add_script_header); + + protected: + base::test::ScopedFeatureList feature_list_; +}; + +void InterestGroupCrossOriginTrustedSignalsBrowserTest:: + TestTrustedSellerSignals(bool expect_success, + bool add_cors_header, + bool add_script_header) { + // This test cares about kSellerSignals and kSeller being cross-origin. + // Whether other origins are the same or different does not matter. + const char kPublisher[] = "a.test"; + const char kBidder[] = "b.test"; + const char kSeller[] = "c.test"; + const char kSellerSignals[] = "d.test"; + + GURL seller_signals_url = embedded_https_test_server().GetURL( + kSellerSignals, "/trusted_scoring_signals.json"); + + GURL ad_url = embedded_https_test_server().GetURL( + kBidder, "/set-header?Supports-Loading-Mode: fenced-frame"); + + // Navigate to bidder site, and add an interest group. + GURL bidder_url = embedded_https_test_server().GetURL(kBidder, "/echo"); + ASSERT_TRUE(NavigateToURL(shell(), bidder_url)); + url::Origin bidder_origin = url::Origin::Create(bidder_url); + EXPECT_EQ(kSuccess, + JoinInterestGroupAndVerify( + blink::TestInterestGroupBuilder( + /*owner=*/bidder_origin, + /*name=*/"cars") + .SetBiddingUrl(embedded_https_test_server().GetURL( + kBidder, "/interest_group/bidding_logic.js")) + .SetAds({{{ad_url, /*metadata=*/std::nullopt}}}) + .Build())); + + // Navigate to publisher. + ASSERT_TRUE( + NavigateToURL(shell(), embedded_https_test_server().GetURL( + kPublisher, "/page_with_iframe.html"))); + + GURL seller_logic_url = embedded_https_test_server().GetURL( + kSeller, "/interest_group/decision_logic_need_signals.js"); + // Register a seller script that only bids if + // `crossOriginTrustedScoringSignals` are successfully fetched. + NetworkResponder::ResponseHeaders extra_js_headers; + if (add_script_header) { + extra_js_headers.emplace_back( + std::string("Ad-Auction-Allow-Trusted-Scoring-Signals-From"), + base::StringPrintf( + "\"%s\"", + url::Origin::Create(seller_signals_url).Serialize().c_str())); + } + const char kSellerScriptTemplate[] = R"( + function scoreAd( + adMetadata, bid, auctionConfig, trustedScoringSignals, browserSignals, + directFromSellerSignals, crossOriginTrustedScoringSignals) { + if (trustedScoringSignals !== null) { + return 0; + } + + if (browserSignals.crossOriginDataVersion !== 25) { + return 0; + } + + if ('dataVersion' in browserSignals) { + return 0; + } + + if (crossOriginTrustedScoringSignals[$1].renderURL[ + browserSignals.renderURL] === "foo") { + return bid; + } + return 0; + } + )"; + + network_responder_->RegisterNetworkResponse( + seller_logic_url.path(), + JsReplace(kSellerScriptTemplate, url::Origin::Create(seller_signals_url)), + "application/javascript", std::move(extra_js_headers)); + + // Register seller signals with a value for `ad_url`, and a CORS header + // permitting script to access it. + NetworkResponder::ResponseHeaders extra_json_headers; + extra_json_headers.emplace_back("Data-Version", "25"); + if (add_cors_header) { + extra_json_headers.emplace_back( + std::string("Access-Control-Allow-Origin"), + url::Origin::Create(seller_logic_url).Serialize()); + } + network_responder_->RegisterNetworkResponse( + seller_signals_url.path(), + base::StringPrintf(R"({"renderUrls": {"%s": "foo"}})", + ad_url.spec().c_str()), + "application/json", std::move(extra_json_headers)); + + // Run an auction with the scoring script. It should succeed. + const char kConfigTemplate[] = R"({ + seller: $1, + decisionLogicURL: $2, + trustedScoringSignalsURL: $3, + interestGroupBuyers: [$4], + })"; + std::string config = + JsReplace(kConfigTemplate, url::Origin::Create(seller_logic_url), + seller_logic_url, seller_signals_url, bidder_origin); + // Should succeed with CORS header, fail without. + if (expect_success) { + EXPECT_EQ(ad_url, RunAuctionAndWaitForUrl(config)); + } else { + EXPECT_EQ(nullptr, RunAuctionAndWait(config)); + } +} + +IN_PROC_BROWSER_TEST_F(InterestGroupCrossOriginTrustedSignalsBrowserTest, + SellerSignalsPermitted) { + TestTrustedSellerSignals(/*expect_success=*/true, /*add_cors_header=*/true, + /*add_script_header=*/true); +} + +IN_PROC_BROWSER_TEST_F(InterestGroupCrossOriginTrustedSignalsBrowserTest, + SellerSignalsNoCors) { + TestTrustedSellerSignals(/*expect_success=*/false, /*add_cors_header=*/false, + /*add_script_header=*/true); +} + +IN_PROC_BROWSER_TEST_F(InterestGroupCrossOriginTrustedSignalsBrowserTest, + SellerSignalsNoScriptHeader) { + TestTrustedSellerSignals(/*expect_success=*/false, /*add_cors_header=*/true, + /*add_script_header=*/false); +} + } // namespace } // namespace content
diff --git a/content/browser/media/key_system_support_impl.cc b/content/browser/media/key_system_support_impl.cc index 1d365f98..1306be1ea 100644 --- a/content/browser/media/key_system_support_impl.cc +++ b/content/browser/media/key_system_support_impl.cc
@@ -5,7 +5,6 @@ #include "content/browser/media/key_system_support_impl.h" #include "base/logging.h" -#include "base/no_destructor.h" namespace content { @@ -27,19 +26,8 @@ } // namespace -// static -KeySystemSupportImpl* KeySystemSupportImpl::GetInstance() { - static base::NoDestructor<KeySystemSupportImpl> impl; - return impl.get(); -} - -// static -void KeySystemSupportImpl::BindReceiver( - mojo::PendingReceiver<media::mojom::KeySystemSupport> receiver) { - KeySystemSupportImpl::GetInstance()->Bind(std::move(receiver)); -} - -KeySystemSupportImpl::KeySystemSupportImpl() = default; +KeySystemSupportImpl::KeySystemSupportImpl(RenderFrameHost* render_frame_host) + : DocumentUserData(render_frame_host) {} KeySystemSupportImpl::~KeySystemSupportImpl() = default; void KeySystemSupportImpl::SetGetKeySystemCapabilitiesUpdateCbForTesting( @@ -106,4 +94,6 @@ observer->OnKeySystemSupportUpdated(key_system_capabilities_.value()); } +DOCUMENT_USER_DATA_KEY_IMPL(KeySystemSupportImpl); + } // namespace content
diff --git a/content/browser/media/key_system_support_impl.h b/content/browser/media/key_system_support_impl.h index 79d3d41..43fdc8b 100644 --- a/content/browser/media/key_system_support_impl.h +++ b/content/browser/media/key_system_support_impl.h
@@ -12,9 +12,10 @@ #include "base/functional/callback_helpers.h" #include "base/memory/weak_ptr.h" -#include "base/no_destructor.h" #include "content/browser/media/cdm_registry_impl.h" #include "content/common/content_export.h" +#include "content/public/browser/document_user_data.h" +#include "content/public/browser/render_frame_host.h" #include "media/mojo/mojom/key_system_support.mojom.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver_set.h" @@ -22,15 +23,13 @@ namespace content { -// A singleton class living in the browser process handling all KeySystemSupport -// requests. +// A class living in the browser process per render frame handling all +// KeySystemSupport requests for that frame. class CONTENT_EXPORT KeySystemSupportImpl final - : public media::mojom::KeySystemSupport { + : public DocumentUserData<KeySystemSupportImpl>, + public media::mojom::KeySystemSupport { public: - static KeySystemSupportImpl* GetInstance(); - - static void BindReceiver( - mojo::PendingReceiver<media::mojom::KeySystemSupport> receiver); + ~KeySystemSupportImpl() final; KeySystemSupportImpl(const KeySystemSupportImpl&) = delete; KeySystemSupportImpl& operator=(const KeySystemSupportImpl&) = delete; @@ -50,11 +49,11 @@ observer) final; private: - friend class base::NoDestructor<KeySystemSupportImpl>; friend class KeySystemSupportImplTest; + friend class DocumentUserData<KeySystemSupportImpl>; - KeySystemSupportImpl(); - ~KeySystemSupportImpl() final; + explicit KeySystemSupportImpl(RenderFrameHost* rfh); + DOCUMENT_USER_DATA_KEY_DECL(); void ObserveKeySystemCapabilities();
diff --git a/content/browser/media/key_system_support_impl_unittest.cc b/content/browser/media/key_system_support_impl_unittest.cc index a497c83..eec5738 100644 --- a/content/browser/media/key_system_support_impl_unittest.cc +++ b/content/browser/media/key_system_support_impl_unittest.cc
@@ -13,6 +13,7 @@ #include "base/test/gmock_callback_support.h" #include "base/test/mock_callback.h" #include "content/public/test/browser_task_environment.h" +#include "content/public/test/test_renderer_host.h" #include "media/base/cdm_capability.h" #include "media/base/key_system_capability.h" #include "media/base/video_codecs.h" @@ -87,14 +88,15 @@ } // namespace -class KeySystemSupportImplTest : public testing::Test { +class KeySystemSupportImplTest : public RenderViewHostTestHarness { public: - KeySystemSupportImplTest() { + void SetUp() override { LOG(ERROR) << __func__; - key_system_support_impl_.SetGetKeySystemCapabilitiesUpdateCbForTesting( - get_support_cb_.Get()); - key_system_support_impl_.Bind( - key_system_support_.BindNewPipeAndPassReceiver()); + RenderViewHostTestHarness::SetUp(); + KeySystemSupportImpl::GetOrCreateForCurrentDocument(main_rfh()) + ->SetGetKeySystemCapabilitiesUpdateCbForTesting(get_support_cb_.Get()); + KeySystemSupportImpl::GetOrCreateForCurrentDocument(main_rfh()) + ->Bind(key_system_support_.BindNewPipeAndPassReceiver()); } void OnKeySystemSupportUpdated(int observer_id, @@ -119,8 +121,6 @@ run_loop.Run(); } - BrowserTaskEnvironment task_environment_; - KeySystemSupportImpl key_system_support_impl_; mojo::Remote<media::mojom::KeySystemSupport> key_system_support_; base::MockCallback<KeySystemSupportImpl::GetKeySystemCapabilitiesUpdateCB> get_support_cb_;
diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc index c80ca8b0..ca53ecc 100644 --- a/content/browser/renderer_host/navigator.cc +++ b/content/browser/renderer_host/navigator.cc
@@ -568,9 +568,8 @@ // Save the new page's origin and other properties, and replicate them to // proxies, including the proxy created in DidNavigateFrame() to replace the - // old frame in cross-process navigation cases. - render_frame_host->browsing_context_state()->SetCurrentOrigin( - params.origin, params.has_potentially_trustworthy_unique_origin); + // old frame in cross-process navigation cases. Note that the origin-related + // bits are set separately, through `SetLastCommittedOrigin()`. render_frame_host->browsing_context_state()->SetInsecureRequestPolicy( params.insecure_request_policy); render_frame_host->browsing_context_state()->SetInsecureNavigationsSet(
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc index bc90ab0..a7cf50c 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -1615,6 +1615,38 @@ return nullptr; } +// static +SiteInstanceImpl* RenderFrameHostImpl::GetSourceSiteInstanceFromFrameToken( + const blink::LocalFrameToken* frame_token, + int initiator_process_id, + StoragePartitionImpl* storage_partition) { + // There is no null check for `storage_partition` as tests can pass in a null + // StoragePartition in the case the initiator RenderFrameHost still exists. + + if (!frame_token) { + return nullptr; + } + + // Get the source SiteInstance directly from the RenderFrameHost if it's still + // alive. + RenderFrameHostImpl* initiator_rfh = + RenderFrameHostImpl::FromFrameToken(initiator_process_id, *frame_token); + if (initiator_rfh) { + return initiator_rfh->GetSiteInstance(); + } + + // Otherwise get it from the NavigationStateKeepAlive stored in + // `storage_partition`. + NavigationStateKeepAlive* navigation_state = + storage_partition->GetNavigationStateKeepAlive(*frame_token); + if (navigation_state) { + return navigation_state->source_site_instance(); + } + + // There is no source SiteInstance for the given `frame_token`. + return nullptr; +} + RenderFrameHostImpl::RenderFrameHostImpl( SiteInstance* site_instance, scoped_refptr<RenderViewHostImpl> render_view_host, @@ -4046,7 +4078,8 @@ // // The URL is set regardless of whether it's for a net error or not. SetLastCommittedUrl(params.url); - SetLastCommittedOrigin(params.origin); + SetLastCommittedOrigin(params.origin, + params.has_potentially_trustworthy_unique_origin); // If the navigation was a cross-document navigation and it's not the // synchronous about:blank commit, then it committed a document that is not @@ -4165,8 +4198,16 @@ } } -void RenderFrameHostImpl::SetLastCommittedOrigin(const url::Origin& origin) { +void RenderFrameHostImpl::SetLastCommittedOrigin( + const url::Origin& origin, + bool is_potentially_trustworthy_unique_origin) { last_committed_origin_ = origin; + // TODO(https://crbug.com/40159049): Instead of passing + // `is_potentially_trustworthy_unique_origin`, maybe we can just check if the + // origin is opaque and use ``network::IsOriginPotentiallyTrustworthy()` on + // its precursor origin. + browsing_context_state()->SetCurrentOrigin( + origin, is_potentially_trustworthy_unique_origin); } void RenderFrameHostImpl::SetInheritedBaseUrl(const GURL& inherited_base_url) { @@ -4175,7 +4216,13 @@ void RenderFrameHostImpl::SetLastCommittedOriginForTesting( const url::Origin& origin) { - SetLastCommittedOrigin(origin); + // Default setting `is_potentially_trustworthy_unique_origin` to just whether + // the origin is opaque or not, since we don't really have a way to get the + // correct value from a random origin. Since this function is used mostly for + // unit tests that won't actually use this value (which is only used in the + // renderer), it should be good enough. + SetLastCommittedOrigin( + origin, /*is_potentially_trustworthy_unique_origin=*/origin.opaque()); } const url::Origin& RenderFrameHostImpl::ComputeTopFrameOrigin( @@ -4477,7 +4524,19 @@ new_frame_origin, net::IsolationInfo::RequestType::kOther, IsCredentialless(), /*fenced_frame_nonce_for_navigation=*/std::nullopt); - SetLastCommittedOrigin(new_frame_origin); + // The `is_potentially_trustworthy_unique_origin` bit should be inherited from + // the creator frame if it exists. Note that we do this even when the new + // frame is sandboxed, following `DocumentLoader::CaclculateOrigin()`. + // TODO(https://crbug.com/40159049): Once we can always trust + // `network::IsOriginPotentiallyTrustworthy()` instead of passing around + // `has_potentially_trustworthy_unique_origin`, remove this. + bool is_potentially_trustworthy_unique_origin = + creator_frame ? creator_frame->browsing_context_state() + ->current_replication_state() + .has_potentially_trustworthy_unique_origin + : false; + SetLastCommittedOrigin(new_frame_origin, + is_potentially_trustworthy_unique_origin); if (creator_frame) { // If we're given a parent/opener frame, copy the @@ -11133,10 +11192,9 @@ navigation_request->CreatePolicyContainerForBlink(); auto isolation_info = GetSiteInstance()->GetWebExposedIsolationInfo(); - RenderFrameHostImpl* parent_frame_host = GetParentOrOuterDocument(); std::optional<blink::ParsedPermissionsPolicy> manifest_policy; - if (!parent_frame_host && isolation_info.is_isolated_application()) { + if (IsOutermostMainFrame() && isolation_info.is_isolated_application()) { if (auto isolated_web_app_permissions_policy = delegate_->GetPermissionsPolicyForIsolatedWebApp(this)) { manifest_policy = std::move(isolated_web_app_permissions_policy); @@ -12178,10 +12236,9 @@ return; } - RenderFrameHostImpl* parent_frame_host = GetParent(); auto isolation_info = GetSiteInstance()->GetWebExposedIsolationInfo(); - if (!parent_frame_host && isolation_info.is_isolated_application()) { + if (IsOutermostMainFrame() && isolation_info.is_isolated_application()) { // In Isolated Apps, the top level frame should use the policy declared in // the Web App Manifest. if (auto isolated_web_app_permissions_policy = @@ -12192,6 +12249,7 @@ } } + RenderFrameHostImpl* parent_frame_host = GetParent(); const blink::PermissionsPolicy* parent_policy = parent_frame_host ? parent_frame_host->permissions_policy() : nullptr; blink::ParsedPermissionsPolicy container_policy = @@ -12350,7 +12408,8 @@ void RenderFrameHostImpl::BindKeySystemSupportReceiver( mojo::PendingReceiver<media::mojom::KeySystemSupport> receiver) { - KeySystemSupportImpl::BindReceiver(std::move(receiver)); + KeySystemSupportImpl::GetOrCreateForCurrentDocument(this)->Bind( + std::move(receiver)); } void RenderFrameHostImpl::BindMediaMetricsProviderReceiver(
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h index c2e68b4..a2dcb612 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -389,6 +389,16 @@ int initiator_process_id, StoragePartitionImpl* storage_partition); + // Get the SiteInstance for the RenderFrameHost associated with `frame_token`, + // looking it up via NavigationStateKeepAlive in the case that the + // RenderFrameHost has already been deleted after initiating a scheduled + // navigation. The `storage_partition` parameter is used for looking up + // NavigationStateKeepAlives when needed. + static SiteInstanceImpl* GetSourceSiteInstanceFromFrameToken( + const blink::LocalFrameToken* frame_token, + int initiator_process_id, + StoragePartitionImpl* storage_partition); + RenderFrameHostImpl(const RenderFrameHostImpl&) = delete; RenderFrameHostImpl& operator=(const RenderFrameHostImpl&) = delete; @@ -3649,8 +3659,11 @@ // Called by |beforeunload_timeout_| when the beforeunload timeout fires. void BeforeUnloadTimeout(); - // Update this frame's last committed origin. - void SetLastCommittedOrigin(const url::Origin& origin); + // Update this frame's last committed origin. This will also update the origin + // and the "has_potentially_trustworthy_unique_origin" bit in the + // FrameReplicationState. + void SetLastCommittedOrigin(const url::Origin& origin, + bool is_potentially_trustworthy_unique_origin); // Stores a snapshot of the inherited base URL from the initiator's // FrameLoadRequest, if this document inherited one (e.g., about:srcdoc).
diff --git a/content/browser/renderer_host/render_frame_proxy_host.cc b/content/browser/renderer_host/render_frame_proxy_host.cc index 724a979..846887c 100644 --- a/content/browser/renderer_host/render_frame_proxy_host.cc +++ b/content/browser/renderer_host/render_frame_proxy_host.cc
@@ -772,22 +772,24 @@ // the navigation start will be updated when the BeforeUnload ack is received. const auto navigation_start_time = base::TimeTicks::Now(); + blink::LocalFrameToken* initiator_frame_token = + base::OptionalToPtr(params->initiator_frame_token); + // TODO(lfg, lukasza): Remove |extra_headers| parameter from // RequestTransferURL method once both RenderFrameProxyHost and // RenderFrameHostImpl call RequestOpenURL from their OnOpenURL handlers. // See also https://crbug.com/647772. // TODO(clamy): The transition should probably be changed for POST navigations // to PAGE_TRANSITION_FORM_SUBMIT. See https://crbug.com/829827. - // TODO(crbug.com/40202433): Determine which source_site_instance from - // site_instance_group_ to use for navigations to about:blank, once - // RenderFrameProxyHost no longer has a site_instance_deprecated_. frame_tree_node_->navigator().NavigateFromFrameProxy( - current_rfh, validated_url, - base::OptionalToPtr(params->initiator_frame_token), GetProcess()->GetID(), + current_rfh, validated_url, initiator_frame_token, GetProcess()->GetID(), params->initiator_origin, params->initiator_base_url, - GetSiteInstanceDeprecated(), params->referrer.To<content::Referrer>(), - ui::PAGE_TRANSITION_LINK, params->should_replace_current_entry, - download_policy, params->post_body ? "POST" : "GET", params->post_body, + RenderFrameHostImpl::GetSourceSiteInstanceFromFrameToken( + initiator_frame_token, GetProcess()->GetID(), + current_rfh->GetStoragePartition()), + params->referrer.To<content::Referrer>(), ui::PAGE_TRANSITION_LINK, + params->should_replace_current_entry, download_policy, + params->post_body ? "POST" : "GET", params->post_body, params->extra_headers, std::move(blob_url_loader_factory), std::move(params->source_location), params->user_gesture, params->is_form_submission, params->impression,
diff --git a/content/browser/screenlock_monitor/screenlock_monitor_device_source.h b/content/browser/screenlock_monitor/screenlock_monitor_device_source.h index 383c373..2c96386 100644 --- a/content/browser/screenlock_monitor/screenlock_monitor_device_source.h +++ b/content/browser/screenlock_monitor/screenlock_monitor_device_source.h
@@ -32,11 +32,9 @@ #endif // BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_WIN) -namespace base { -namespace win { -class MessageWindow; -} -} // namespace base +namespace gfx { +class SingletonHwndObserver; +} // namespace gfx #endif // BUILDFLAG(IS_WIN) namespace content { @@ -68,7 +66,7 @@ private: #if BUILDFLAG(IS_WIN) - // Represents a message-only window for screenlock message handling on Win. + // Represents a singleton hwnd for screenlock message handling on Win. // Only allow ScreenlockMonitor to create it. class SessionMessageWindow { public: @@ -84,14 +82,14 @@ WTSUnRegisterSessionNotificationFunction unregister_function); private: - bool OnWndProc(UINT message, WPARAM wparam, LPARAM lparam, LRESULT* result); + void OnWndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); void ProcessWTSSessionLockMessage(WPARAM event_id); static WTSRegisterSessionNotificationFunction register_session_notification_function_; static WTSUnRegisterSessionNotificationFunction unregister_session_notification_function_; - std::unique_ptr<base::win::MessageWindow> window_; + std::unique_ptr<gfx::SingletonHwndObserver> singleton_hwnd_observer_; }; SessionMessageWindow session_message_window_;
diff --git a/content/browser/screenlock_monitor/screenlock_monitor_device_source_win.cc b/content/browser/screenlock_monitor/screenlock_monitor_device_source_win.cc index 4fe29dc82..4bc1b37 100644 --- a/content/browser/screenlock_monitor/screenlock_monitor_device_source_win.cc +++ b/content/browser/screenlock_monitor/screenlock_monitor_device_source_win.cc
@@ -10,7 +10,8 @@ #include "base/functional/callback_helpers.h" #include "base/logging.h" #include "base/task/thread_pool.h" -#include "base/win/message_window.h" +#include "ui/gfx/win/singleton_hwnd.h" +#include "ui/gfx/win/singleton_hwnd_observer.h" namespace content { namespace { @@ -58,42 +59,32 @@ } ScreenlockMonitorDeviceSource::SessionMessageWindow::SessionMessageWindow() { - // Create a window for receiving session change notifications. - window_ = std::make_unique<base::win::MessageWindow>(); - if (!window_->Create(base::BindRepeating(&SessionMessageWindow::OnWndProc, - base::Unretained(this)))) { - DLOG(ERROR) << "Failed to create the screenlock monitor window."; - window_.reset(); - return; - } + // Create a singleton observer for receiving session change notifications. + // base:Unretained() is safe because the observer handles the correct + // cleanup if either the SingletonHwnd or forwarded object is destroyed + // first. + singleton_hwnd_observer_ = + std::make_unique<gfx::SingletonHwndObserver>(base::BindRepeating( + &ScreenlockMonitorDeviceSource::SessionMessageWindow::OnWndProc, + base::Unretained(this))); // Use NOTIFY_FOR_THIS_SESSION so we only receive events from the current // session, and not from other users connected to the same session host. bool registered = register_session_notification_function_( - window_->hwnd(), NOTIFY_FOR_THIS_SESSION); + gfx::SingletonHwnd::GetInstance()->hwnd(), NOTIFY_FOR_THIS_SESSION); DCHECK(registered); } -ScreenlockMonitorDeviceSource::SessionMessageWindow::~SessionMessageWindow() { - // There should be no race condition between this code and the worker thread. - // |unregister_session_notification_function_| is only called from destruction - // as we are in shutdown, which means no other worker threads can be running. - if (window_) { - bool unregistered = - unregister_session_notification_function_(window_->hwnd()); - DCHECK(unregistered); - } -} +ScreenlockMonitorDeviceSource::SessionMessageWindow::~SessionMessageWindow() {} -bool ScreenlockMonitorDeviceSource::SessionMessageWindow::OnWndProc( +void ScreenlockMonitorDeviceSource::SessionMessageWindow::OnWndProc( + HWND hwnd, UINT message, WPARAM wparam, - LPARAM lparam, - LRESULT* result) { + LPARAM lparam) { if (message == WM_WTSSESSION_CHANGE) { ProcessWTSSessionLockMessage(wparam); } - return false; } void ScreenlockMonitorDeviceSource::SessionMessageWindow::
diff --git a/content/browser/screenlock_monitor/screenlock_monitor_device_source_win_unittest.cc b/content/browser/screenlock_monitor/screenlock_monitor_device_source_win_unittest.cc index 64bd3206..78809c5 100644 --- a/content/browser/screenlock_monitor/screenlock_monitor_device_source_win_unittest.cc +++ b/content/browser/screenlock_monitor/screenlock_monitor_device_source_win_unittest.cc
@@ -7,6 +7,8 @@ #include "base/test/task_environment.h" #include "content/browser/screenlock_monitor/screenlock_monitor.h" #include "content/browser/screenlock_monitor/screenlock_monitor_source.h" +#include "content/public/browser/browser_thread.h" +#include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" namespace content { @@ -81,7 +83,9 @@ }; TEST(ScreenlockMonitorDeviceSourceWinTest, FakeSessionNotifications) { - base::test::TaskEnvironment task_environment; + content::BrowserTaskEnvironment task_environment; + ASSERT_TRUE(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + ScreenlockMonitorDeviceSource::SetFakeNotificationAPIsForTesting( &FakeRegister, &FakeUnregister); ScreenlockMonitorDeviceSource* screenlock_monitor_source =
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc index 08988b303..bcfc213a 100644 --- a/content/browser/service_worker/service_worker_browsertest.cc +++ b/content/browser/service_worker/service_worker_browsertest.cc
@@ -4089,7 +4089,7 @@ : base::test::WithFeatureOverride( net::features::kThirdPartyStoragePartitioning), scoped_feature_list_(blink::features::kPlzDedicatedWorker) {} - bool ThirdPartyStoragePartitioningEnabled() { + bool ThirdPartyStoragePartitioningEnabled() const { return IsParamFeatureEnabled(); }
diff --git a/content/browser/shared_storage/shared_storage_browsertest.cc b/content/browser/shared_storage/shared_storage_browsertest.cc index f4b3a84f..34ffff6 100644 --- a/content/browser/shared_storage/shared_storage_browsertest.cc +++ b/content/browser/shared_storage/shared_storage_browsertest.cc
@@ -164,19 +164,6 @@ constexpr char kEmptySharedStorageCrossOriginAllowedReplacement[] = ""; -base::StringPairs ResponseHeaderReplacement( - const std::string& access_control_allow_origin_replacement, - const std::string& shared_storage_cross_origin_allowed_replacement) { - base::StringPairs header_replacement; - header_replacement.emplace_back("{{ACCESS_CONTROL_ALLOW_ORIGIN_HEADER}}", - access_control_allow_origin_replacement); - header_replacement.emplace_back( - "{{SHARED_STORAGE_CROSS_ORIGIN_WORKLET_ALLOWED_HEADER}}", - shared_storage_cross_origin_allowed_replacement); - - return header_replacement; -} - std::string TimeDeltaToString(base::TimeDelta delta) { return base::StrCat({base::NumberToString(delta.InMilliseconds()), "ms"}); } @@ -2460,7 +2447,7 @@ GURL module_script_url = https_server()->GetURL( "b.test", net::test_server::GetFilePathWithReplacements( "/shared_storage/module_with_custom_header.js", - ResponseHeaderReplacement( + SharedStorageCrossOriginWorkletResponseHeaderReplacement( "Access-Control-Allow-Origin: *", "Shared-Storage-Cross-Origin-Worklet-Allowed: ?1"))); @@ -4601,7 +4588,7 @@ GURL module_script_url = https_server()->GetURL( "a.test", net::test_server::GetFilePathWithReplacements( "/shared_storage/module_with_custom_header.js", - ResponseHeaderReplacement( + SharedStorageCrossOriginWorkletResponseHeaderReplacement( kEmptyAccessControlAllowOriginReplacement, kEmptySharedStorageCrossOriginAllowedReplacement))); @@ -4622,7 +4609,7 @@ GURL module_script_url = https_server()->GetURL( "b.test", net::test_server::GetFilePathWithReplacements( "/shared_storage/module_with_custom_header.js", - ResponseHeaderReplacement( + SharedStorageCrossOriginWorkletResponseHeaderReplacement( kEmptyAccessControlAllowOriginReplacement, "Shared-Storage-Cross-Origin-Worklet-Allowed: ?1"))); @@ -4676,7 +4663,7 @@ GURL module_script_url = https_server()->GetURL( "b.test", net::test_server::GetFilePathWithReplacements( "/shared_storage/module_with_custom_header.js", - ResponseHeaderReplacement( + SharedStorageCrossOriginWorkletResponseHeaderReplacement( "Access-Control-Allow-Origin: *", kEmptySharedStorageCrossOriginAllowedReplacement))); @@ -4729,7 +4716,7 @@ GURL module_script_url = https_server()->GetURL( "b.test", net::test_server::GetFilePathWithReplacements( "/shared_storage/module_with_custom_header.js", - ResponseHeaderReplacement( + SharedStorageCrossOriginWorkletResponseHeaderReplacement( "Access-Control-Allow-Origin: *", "Shared-Storage-Cross-Origin-Worklet-Allowed: ?1"))); @@ -4759,7 +4746,7 @@ GURL module_script_url = https_server()->GetURL( "b.test", net::test_server::GetFilePathWithReplacements( "/shared_storage/module_with_custom_header.js", - ResponseHeaderReplacement( + SharedStorageCrossOriginWorkletResponseHeaderReplacement( "Access-Control-Allow-Origin: *", "Shared-Storage-Cross-Origin-Worklet-Allowed: ?1"))); @@ -4791,7 +4778,7 @@ GURL module_script_url = https_server()->GetURL( "b.test", net::test_server::GetFilePathWithReplacements( "/shared_storage/module_with_custom_header.js", - ResponseHeaderReplacement( + SharedStorageCrossOriginWorkletResponseHeaderReplacement( "Access-Control-Allow-Origin: *", "Shared-Storage-Cross-Origin-Worklet-Allowed: ?1"))); @@ -4816,7 +4803,7 @@ GURL module_script_url = https_server()->GetURL( "b.test", net::test_server::GetFilePathWithReplacements( "/shared_storage/module_with_custom_header.js", - ResponseHeaderReplacement( + SharedStorageCrossOriginWorkletResponseHeaderReplacement( "Access-Control-Allow-Origin: *", "Shared-Storage-Cross-Origin-Worklet-Allowed: ?1"))); @@ -4845,7 +4832,7 @@ GURL module_script_url = https_server()->GetURL( "b.test", net::test_server::GetFilePathWithReplacements( "/shared_storage/module_with_custom_header.js", - ResponseHeaderReplacement( + SharedStorageCrossOriginWorkletResponseHeaderReplacement( "Access-Control-Allow-Origin: *", "Shared-Storage-Cross-Origin-Worklet-Allowed: ?1")));
diff --git a/content/browser/shared_storage/shared_storage_document_service_impl.cc b/content/browser/shared_storage/shared_storage_document_service_impl.cc index 06f3f2b8..537a48d 100644 --- a/content/browser/shared_storage/shared_storage_document_service_impl.cc +++ b/content/browser/shared_storage/shared_storage_document_service_impl.cc
@@ -146,24 +146,25 @@ return; } - auto intercepting_callback = base::BindOnce( - &SharedStorageDocumentServiceImpl::OnCreateWorkletResponseIntercepted, - weak_ptr_factory_.GetWeakPtr(), is_same_origin, std::move(callback)); - std::string debug_message; if (!IsSharedStorageAddModuleAllowed(&debug_message)) { - std::move(intercepting_callback) - .Run( - /*success=*/false, - /*error_message=*/GetSharedStorageErrorMessage( - debug_message, kSharedStorageAddModuleDisabledMessage)); + OnCreateWorkletResponseIntercepted( + is_same_origin, std::move(callback), + /*prefs_success=*/false, + /*success=*/false, + /*error_message=*/ + GetSharedStorageErrorMessage(debug_message, + kSharedStorageAddModuleDisabledMessage)); return; } GetSharedStorageWorkletHostManager()->CreateWorkletHost( this, render_frame_host().GetLastCommittedOrigin(), script_source_url, credentials_mode, origin_trial_features, std::move(worklet_host), - std::move(intercepting_callback)); + base::BindOnce( + &SharedStorageDocumentServiceImpl::OnCreateWorkletResponseIntercepted, + weak_ptr_factory_.GetWeakPtr(), is_same_origin, std::move(callback), + /*prefs_success=*/true)); } void SharedStorageDocumentServiceImpl::SharedStorageGet( @@ -344,24 +345,31 @@ void SharedStorageDocumentServiceImpl::OnCreateWorkletResponseIntercepted( bool is_same_origin, CreateWorkletCallback original_callback, + bool prefs_success, bool success, const std::string& error_message) { // When the worklet and the worklet creator are not same-origin, the user // preferences for the worklet origin should not be revealed. - // - // TODO(cammie): Right now the metric will be recorded as `kSuccess`. We - // should record a separate metric for the result when it's masking a failure, - // using `SharedStorageWorkletErrorType - // ::kAddModuleNonWebVisibleCrossOriginSharedStorageDisabled` or - // `SharedStorageWorkletErrorType::kAddModuleNonWebVisibleOther` as - // appropriate. We also need to move logging of successes to the browser - // process to prevent counting failures that happen here as successes in the - // renderer. if (!is_same_origin) { + if (!prefs_success) { + LogSharedStorageWorkletError( + blink::SharedStorageWorkletErrorType:: + kAddModuleNonWebVisibleCrossOriginSharedStorageDisabled); + } else if (!success) { + LogSharedStorageWorkletError( + blink::SharedStorageWorkletErrorType::kAddModuleNonWebVisibleOther); + } else { + LogSharedStorageWorkletError( + blink::SharedStorageWorkletErrorType::kSuccess); + } std::move(original_callback).Run(/*success=*/true, /*error_message=*/{}); return; } + if (success) { + LogSharedStorageWorkletError( + blink::SharedStorageWorkletErrorType::kSuccess); + } std::move(original_callback).Run(success, error_message); }
diff --git a/content/browser/shared_storage/shared_storage_document_service_impl.h b/content/browser/shared_storage/shared_storage_document_service_impl.h index 906ddc3..5186c4d 100644 --- a/content/browser/shared_storage/shared_storage_document_service_impl.h +++ b/content/browser/shared_storage/shared_storage_document_service_impl.h
@@ -88,6 +88,7 @@ void OnCreateWorkletResponseIntercepted( bool is_same_origin, CreateWorkletCallback original_callback, + bool prefs_success, bool success, const std::string& error_message);
diff --git a/content/browser/shared_storage/shared_storage_worklet_host.cc b/content/browser/shared_storage/shared_storage_worklet_host.cc index a40c072..0e4b287 100644 --- a/content/browser/shared_storage/shared_storage_worklet_host.cc +++ b/content/browser/shared_storage/shared_storage_worklet_host.cc
@@ -519,13 +519,9 @@ } else { // When the worklet and the worklet creator are not same-origin, the user // preferences for the worklet origin should not be revealed. - // - // TODO(cammie): Right now the metric will be recorded as `kSuccess`. We - // should record a separate metric for this distorted result using type - // `SharedStorageWorkletErrorType - // ::kSelectURLNonWebVisibleCrossOriginSharedStorageDisabled` and move - // logging of successes to the browser process to prevent counting this as - // a success as well. + LogSharedStorageWorkletError( + blink::SharedStorageWorkletErrorType:: + kSelectURLNonWebVisibleCrossOriginSharedStorageDisabled); FencedFrameConfig config(urn_uuid, GURL()); std::move(callback).Run( /*success=*/true, /*error_message=*/{}, @@ -631,13 +627,9 @@ } else { // When the worklet and the worklet creator are not same-origin, the user // preferences for the worklet origin should not be revealed. - // - // TODO(cammie): Right now the metric will be recorded as `kSuccess`. We - // should record a separate metric for this distorted result using type - // `SharedStorageWorkletErrorType - // ::kRunNonWebVisibleCrossOriginSharedStorageDisabled` and move logging - // of successes to the browser process to prevent counting this as a - // success as well. + LogSharedStorageWorkletError( + blink::SharedStorageWorkletErrorType:: + kRunNonWebVisibleCrossOriginSharedStorageDisabled); std::move(callback).Run( /*success=*/true, /*error_message=*/{}); @@ -1100,6 +1092,9 @@ document_service_->render_frame_host()), blink::mojom::ConsoleMessageLevel::kError, error_message); } + } else { + LogSharedStorageWorkletError( + blink::SharedStorageWorkletErrorType::kSuccess); } base::UmaHistogramLongTimes( @@ -1165,7 +1160,20 @@ std::move(urls_with_metadata), index, budget_result.bits, budget_status); + // Log histograms. These do not need the `document_service_`. blink::LogSharedStorageSelectURLBudgetStatus(budget_status); + if (budget_status != + blink::SharedStorageSelectUrlBudgetStatus::kSufficientBudget) { + LogSharedStorageWorkletError( + blink::SharedStorageWorkletErrorType:: + kSelectURLNonWebVisibleInsufficientBudget); + } else if (!script_execution_succeeded) { + LogSharedStorageWorkletErrorFromErrorMessage( + /*from_select_url=*/true, script_execution_error_message); + } else { + LogSharedStorageWorkletError( + blink::SharedStorageWorkletErrorType::kSuccess); + } if (document_service_) { DCHECK(!IsInKeepAlivePhase()); @@ -1178,17 +1186,12 @@ document_service_->render_frame_host()), blink::mojom::ConsoleMessageLevel::kError, "Insufficient budget for selectURL()."); - LogSharedStorageWorkletError( - blink::SharedStorageWorkletErrorType:: - kSelectURLNonWebVisibleInsufficientBudget); } else if (!script_execution_succeeded) { devtools_instrumentation::LogWorkletMessage( static_cast<RenderFrameHostImpl&>( document_service_->render_frame_host()), blink::mojom::ConsoleMessageLevel::kError, script_execution_error_message); - LogSharedStorageWorkletErrorFromErrorMessage( - /*from_select_url=*/true, script_execution_error_message); } }
diff --git a/content/browser/webauth/authenticator_common_impl.cc b/content/browser/webauth/authenticator_common_impl.cc index dbde56d..f85db11e 100644 --- a/content/browser/webauth/authenticator_common_impl.cc +++ b/content/browser/webauth/authenticator_common_impl.cc
@@ -1010,8 +1010,7 @@ req_state_->requested_extensions.insert(RequestExtension::kPRF); req_state_->ctap_make_credential_request->hmac_secret = true; - if (options->prf_input && - base::FeatureList::IsEnabled(device::kWebAuthnPRFEvalDuringCreate)) { + if (options->prf_input) { std::optional<device::PRFInput> prf_input = ParsePRFInputForMakeCredential(options->prf_input); if (!prf_input) {
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java index a548f2bb..d5cb7e2 100644 --- a/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java +++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java
@@ -85,15 +85,6 @@ } } else { switch (inputMode) { - default: - case WebTextInputMode.DEFAULT: - case WebTextInputMode.TEXT: - case WebTextInputMode.SEARCH: - outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE; - if ((inputFlags & WebTextInputFlags.AUTOCORRECT_OFF) == 0) { - outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT; - } - break; case WebTextInputMode.TEL: outAttrs.inputType = InputType.TYPE_CLASS_PHONE; break; @@ -117,6 +108,15 @@ outAttrs.inputType = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL; break; + case WebTextInputMode.DEFAULT: + case WebTextInputMode.TEXT: + case WebTextInputMode.SEARCH: + default: + outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE; + if ((inputFlags & WebTextInputFlags.AUTOCORRECT_OFF) == 0) { + outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT; + } + break; } }
diff --git a/content/public/test/shared_storage_test_utils.cc b/content/public/test/shared_storage_test_utils.cc index 92e7681e9..b74ed7f 100644 --- a/content/public/test/shared_storage_test_utils.cc +++ b/content/public/test/shared_storage_test_utils.cc
@@ -12,6 +12,7 @@ #include "base/functional/overloaded.h" #include "base/memory/weak_ptr.h" #include "base/notreached.h" +#include "base/strings/string_split.h" #include "components/services/storage/shared_storage/shared_storage_manager.h" #include "content/browser/renderer_host/frame_tree_node.h" #include "content/browser/renderer_host/render_frame_host_impl.h" @@ -337,4 +338,17 @@ return observer_ptr; } +base::StringPairs SharedStorageCrossOriginWorkletResponseHeaderReplacement( + const std::string& access_control_allow_origin_replacement, + const std::string& shared_storage_cross_origin_allowed_replacement) { + base::StringPairs header_replacement; + header_replacement.emplace_back("{{ACCESS_CONTROL_ALLOW_ORIGIN_HEADER}}", + access_control_allow_origin_replacement); + header_replacement.emplace_back( + "{{SHARED_STORAGE_CROSS_ORIGIN_WORKLET_ALLOWED_HEADER}}", + shared_storage_cross_origin_allowed_replacement); + + return header_replacement; +} + } // namespace content
diff --git a/content/public/test/shared_storage_test_utils.h b/content/public/test/shared_storage_test_utils.h index 0379e72..0c5581d8 100644 --- a/content/public/test/shared_storage_test_utils.h +++ b/content/public/test/shared_storage_test_utils.h
@@ -6,9 +6,11 @@ #define CONTENT_PUBLIC_TEST_SHARED_STORAGE_TEST_UTILS_H_ #include <stddef.h> + #include <string> #include "base/memory/weak_ptr.h" +#include "base/strings/string_split.h" #include "components/services/storage/shared_storage/shared_storage_manager.h" #include "content/browser/private_aggregation/private_aggregation_host.h" #include "services/network/public/mojom/optional_bool.mojom.h" @@ -115,6 +117,10 @@ base::WeakPtr<TestSharedStorageHeaderObserver> CreateAndOverrideSharedStorageHeaderObserver(StoragePartition* partition); +base::StringPairs SharedStorageCrossOriginWorkletResponseHeaderReplacement( + const std::string& access_control_allow_origin_replacement, + const std::string& shared_storage_cross_origin_allowed_replacement); + } // namespace content #endif // CONTENT_PUBLIC_TEST_SHARED_STORAGE_TEST_UTILS_H_
diff --git a/content/services/auction_worklet/seller_worklet.cc b/content/services/auction_worklet/seller_worklet.cc index eba262e..b4782461 100644 --- a/content/services/auction_worklet/seller_worklet.cc +++ b/content/services/auction_worklet/seller_worklet.cc
@@ -341,6 +341,58 @@ return delta; } +// Check if trusted scoring signals are absent, same-origin, or cross-origin. +SellerWorklet::SignalsOriginRelation ClassifyTrustedSignals( + const GURL& decision_logic_url, + const std::optional<url::Origin>& trusted_scoring_signals_origin) { + if (!trusted_scoring_signals_origin.has_value()) { + return SellerWorklet::SignalsOriginRelation::kNoTrustedSignals; + } + + if (trusted_scoring_signals_origin->IsSameOriginWith(decision_logic_url)) { + return SellerWorklet::SignalsOriginRelation::kSameOriginSignals; + } + + return SellerWorklet::SignalsOriginRelation:: + kUnknownPermissionCrossOriginSignals; +} + +// Sets the appropriate field (if any) of `browser_signals` to data version, +// considering the cross-origin validity. +// Returns success/failure. +bool SetDataVersion( + SellerWorklet::SignalsOriginRelation trusted_signals_relation, + std::optional<uint32_t> scoring_signals_data_version, + gin::Dictionary& browser_signals_dict) { + if (!scoring_signals_data_version.has_value()) { + return true; + } + + switch (trusted_signals_relation) { + case SellerWorklet::SignalsOriginRelation::kNoTrustedSignals: + return true; + + case SellerWorklet::SignalsOriginRelation::kSameOriginSignals: + return browser_signals_dict.Set("dataVersion", + scoring_signals_data_version.value()); + + case SellerWorklet::SignalsOriginRelation:: + kUnknownPermissionCrossOriginSignals: + // This should be turned into permitted or forbidden by now. + CHECK(false); + return false; + + case SellerWorklet::SignalsOriginRelation::kPermittedCrossOriginSignals: + return browser_signals_dict.Set("crossOriginDataVersion", + scoring_signals_data_version.value()); + + case SellerWorklet::SignalsOriginRelation::kForbiddenCrossOriginSignals: + // We shouldn't have a fetch to get a version from if it's forbidden. + CHECK(false); + return false; + } +} + } // namespace SellerWorklet::SellerWorklet( @@ -363,6 +415,10 @@ base::MakeRefCounted<AuctionV8Helper::DebugId>(v8_helper_.get())), url_loader_factory_(std::move(pending_url_loader_factory)), script_source_url_(decision_logic_url), + trusted_scoring_signals_origin_( + trusted_scoring_signals_url ? std::make_optional(url::Origin::Create( + *trusted_scoring_signals_url)) + : std::nullopt), v8_state_(nullptr, base::OnTaskRunnerDeleter(v8_runner_)), auction_network_events_handler_( std::move(auction_network_events_handler)) { @@ -382,12 +438,23 @@ /*trusted_bidding_signals_slot_size_param=*/std::string(), v8_helper_.get()) : nullptr); + trusted_signals_relation_ = ClassifyTrustedSignals( + script_source_url_, trusted_scoring_signals_origin_); + // If trusted seller signals are cross-origin, we cannot start fetching them + // until we have confirmation they are authorized by guaranteed-same-origin + // script, as otherwise we may end up sending sensitive IG information to an + // unrelated this party. + if (trusted_signals_relation_ == + SignalsOriginRelation::kUnknownPermissionCrossOriginSignals) { + trusted_signals_request_manager_->Pause(); + } v8_state_ = std::unique_ptr<V8State, base::OnTaskRunnerDeleter>( new V8State(v8_helper_, debug_id_, std::move(shared_storage_host_remote), decision_logic_url, trusted_scoring_signals_url, - top_window_origin, std::move(permissions_policy_state), - experiment_group_id, weak_ptr_factory_.GetWeakPtr()), + trusted_scoring_signals_origin_, top_window_origin, + std::move(permissions_policy_state), experiment_group_id, + weak_ptr_factory_.GetWeakPtr()), base::OnTaskRunnerDeleter(v8_runner_)); paused_ = pause_for_debugger_on_start; @@ -659,6 +726,7 @@ shared_storage_host_remote, const GURL& decision_logic_url, const std::optional<GURL>& trusted_scoring_signals_url, + const std::optional<url::Origin>& trusted_scoring_signals_origin, const url::Origin& top_window_origin, mojom::AuctionWorkletPermissionsPolicyStatePtr permissions_policy_state, std::optional<uint16_t> experiment_group_id, @@ -669,6 +737,7 @@ user_thread_(base::SequencedTaskRunner::GetCurrentDefault()), decision_logic_url_(decision_logic_url), trusted_scoring_signals_url_(trusted_scoring_signals_url), + trusted_scoring_signals_origin_(trusted_scoring_signals_origin), top_window_origin_(top_window_origin), permissions_policy_state_(std::move(permissions_policy_state)), experiment_group_id_(experiment_group_id) { @@ -679,9 +748,11 @@ } void SellerWorklet::V8State::SetWorkletScript( - WorkletLoader::Result worklet_script) { + WorkletLoader::Result worklet_script, + SignalsOriginRelation trusted_signals_relation) { DCHECK_CALLED_ON_VALID_SEQUENCE(v8_sequence_checker_); worklet_script_ = WorkletLoader::TakeScript(std::move(worklet_script)); + trusted_signals_relation_ = trusted_signals_relation; } void SellerWorklet::V8State::ScoreAd( @@ -712,6 +783,13 @@ base::TimeTicks task_enqueued_time, ScoreAdCallbackInternal callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(v8_sequence_checker_); + CHECK_NE(trusted_signals_relation_, + SignalsOriginRelation::kUnknownPermissionCrossOriginSignals); + if (trusted_signals_relation_ == + SignalsOriginRelation::kForbiddenCrossOriginSignals) { + // We must have cancelled the fetch, so nothing should be set). + CHECK(!trusted_scoring_signals); + } base::UmaHistogramTimes("Ads.InterestGroup.Auction.ScoreAdQueueTime", base::TimeTicks::Now() - task_enqueued_time); base::ElapsedTimer elapsed_timer; @@ -778,6 +856,7 @@ return; } + std::vector<std::string> errors_out; v8::Local<v8::Value> trusted_scoring_signals_value; std::optional<uint32_t> scoring_signals_data_version; if (trusted_scoring_signals) { @@ -788,7 +867,23 @@ } else { trusted_scoring_signals_value = v8::Null(isolate); } - args.push_back(trusted_scoring_signals_value); + + if (trusted_signals_relation_ == + SignalsOriginRelation::kForbiddenCrossOriginSignals) { + // Add a warning to help people debug. + errors_out.push_back(base::StrCat( + {decision_logic_url_.spec(), + " disregarding trusted scoring signals since origin '", + trusted_scoring_signals_origin_->Serialize(), + "' is different from script's origin but not authorized by script's " + "Ad-Auction-Allow-Trusted-Scoring-Signals-From."})); + } + + if (trusted_signals_relation_ == SignalsOriginRelation::kSameOriginSignals) { + args.push_back(trusted_scoring_signals_value); + } else { + args.push_back(v8::Null(isolate)); + } v8::Local<v8::Object> browser_signals = v8::Object::New(isolate); gin::Dictionary browser_signals_dict(isolate, browser_signals); @@ -811,9 +906,8 @@ browser_signal_bidding_duration_msecs) || !browser_signals_dict.Set("bidCurrency", blink::PrintableAdCurrency(bid_currency)) || - (scoring_signals_data_version.has_value() && - !browser_signals_dict.Set("dataVersion", - scoring_signals_data_version.value())) || + !SetDataVersion(trusted_signals_relation_, scoring_signals_data_version, + browser_signals_dict) || (base::FeatureList::IsEnabled( blink::features::kBiddingAndScoringDebugReportingAPI) && base::FeatureList::IsEnabled( @@ -842,7 +936,6 @@ v8::Local<v8::Object> direct_from_seller_signals = v8::Object::New(isolate); gin::Dictionary direct_from_seller_signals_dict(isolate, direct_from_seller_signals); - std::vector<std::string> errors_out; v8::Local<v8::Value> seller_signals = GetDirectFromSellerSignals( direct_from_seller_result_seller_signals, direct_from_seller_seller_signals_header_ad_slot, *v8_helper_, context, @@ -861,6 +954,21 @@ } args.push_back(direct_from_seller_signals); + if (base::FeatureList::IsEnabled( + blink::features::kFledgePermitCrossOriginTrustedSignals)) { + v8::Local<v8::Value> cross_origin_trusted_scoring_signals_value; + if (trusted_signals_relation_ == + SignalsOriginRelation::kPermittedCrossOriginSignals) { + cross_origin_trusted_scoring_signals_value = + TrustedSignals::Result::WrapCrossOriginSignals( + v8_helper_.get(), context, *trusted_scoring_signals_origin_, + trusted_scoring_signals_value); + } else { + cross_origin_trusted_scoring_signals_value = v8::Null(isolate); + } + args.push_back(cross_origin_trusted_scoring_signals_value); + } + v8::Local<v8::Value> score_ad_result; v8_helper_->MaybeTriggerInstrumentationBreakpoint( *debug_id_, "beforeSellerWorkletScoringStart"); @@ -1545,6 +1653,15 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(user_sequence_checker_); DCHECK(!paused_); + WorkletLoader::AllowTrustedScoringSignalsCallback + on_got_cross_origin_signals_permissions; + if (trusted_signals_relation_ == + SignalsOriginRelation::kUnknownPermissionCrossOriginSignals) { + on_got_cross_origin_signals_permissions = base::BindOnce( + &SellerWorklet::OnGotCrossOriginTrustedSignalsPermissions, + base::Unretained(this)); + } + base::UmaHistogramCounts100000( "Ads.InterestGroup.Net.RequestUrlSizeBytes.ScoringScriptJS", script_source_url_.spec().size()); @@ -1553,7 +1670,7 @@ CreateNewAuctionNetworkEventsHandlerRemote( auction_network_events_handler_), script_source_url_, v8_helper_, debug_id_, - WorkletLoader::AllowTrustedScoringSignalsCallback(), + std::move(on_got_cross_origin_signals_permissions), base::BindOnce(&SellerWorklet::OnDownloadComplete, base::Unretained(this))); } @@ -1581,10 +1698,13 @@ // ReportResult() callbacks. load_script_error_msg_ = std::move(error_msg); - v8_runner_->PostTask(FROM_HERE, - base::BindOnce(&SellerWorklet::V8State::SetWorkletScript, - base::Unretained(v8_state_.get()), - std::move(worklet_script))); + DCHECK_NE(trusted_signals_relation_, + SignalsOriginRelation::kUnknownPermissionCrossOriginSignals); + v8_runner_->PostTask( + FROM_HERE, + base::BindOnce(&SellerWorklet::V8State::SetWorkletScript, + base::Unretained(v8_state_.get()), + std::move(worklet_script), trusted_signals_relation_)); MaybeRecordCodeWait(); for (auto score_ad_task = score_ad_tasks_.begin(); @@ -1613,6 +1733,39 @@ } } +void SellerWorklet::OnGotCrossOriginTrustedSignalsPermissions( + std::vector<url::Origin> permit_origins) { + DCHECK_EQ(trusted_signals_relation_, + SignalsOriginRelation::kUnknownPermissionCrossOriginSignals); + + for (const auto& permitted_origin : permit_origins) { + if (trusted_scoring_signals_origin_->IsSameOriginWith(permitted_origin)) { + // Cross-origin trusted signals fetch authorized, so let it start. + trusted_signals_relation_ = + SignalsOriginRelation::kPermittedCrossOriginSignals; + trusted_signals_request_manager_->Resume(); + return; + } + } + + // Trusted scoring signals fetch disallowed; remove them from the queue and + // proceed without them. + trusted_signals_relation_ = + SellerWorklet::SignalsOriginRelation::kForbiddenCrossOriginSignals; + for (auto& task : score_ad_tasks_) { + task.trusted_scoring_signals_request.reset(); + } + + // Also remove the `trusted_signals_request_manager_` so we don't try to + // fetch any more. + trusted_signals_request_manager_.reset(); + + // If we're here, we don't actually have to worry about kicking off scoreAd() + // execution since we only got the headers for the script; the body hasn't + // been handed to us yet. + DCHECK(!IsCodeReady()); +} + void SellerWorklet::OnTrustedScoringSignalsDownloaded( ScoreAdTaskList::iterator task, scoped_refptr<TrustedSignals::Result> result,
diff --git a/content/services/auction_worklet/seller_worklet.h b/content/services/auction_worklet/seller_worklet.h index 33edbbfa..6480bd0 100644 --- a/content/services/auction_worklet/seller_worklet.h +++ b/content/services/auction_worklet/seller_worklet.h
@@ -63,6 +63,19 @@ using PrivateAggregationRequests = std::vector<auction_worklet::mojom::PrivateAggregationRequestPtr>; + // Classification of how trusted signals related to this worklet. + enum class SignalsOriginRelation { + kNoTrustedSignals, + kSameOriginSignals, + + // If trusted signals are cross-origin, their classification starts at + // kUnknownPermissionCrossOriginSignals and gets changed to permitted or + // forbidden once the permission header is received (or is found missing). + kUnknownPermissionCrossOriginSignals, + kPermittedCrossOriginSignals, + kForbiddenCrossOriginSignals + }; + // Starts loading the worklet script on construction. SellerWorklet( scoped_refptr<AuctionV8Helper> v8_helper, @@ -306,12 +319,14 @@ shared_storage_host_remote, const GURL& decision_logic_url, const std::optional<GURL>& trusted_scoring_signals_url, + const std::optional<url::Origin>& trusted_scoring_signals_origin, const url::Origin& top_window_origin, mojom::AuctionWorkletPermissionsPolicyStatePtr permissions_policy_state, std::optional<uint16_t> experiment_group_id, base::WeakPtr<SellerWorklet> parent); - void SetWorkletScript(WorkletLoader::Result worklet_script); + void SetWorkletScript(WorkletLoader::Result worklet_script, + SignalsOriginRelation trusted_signals_relation); void ScoreAd( const std::string& ad_metadata_json, @@ -426,6 +441,9 @@ const GURL decision_logic_url_; const std::optional<GURL> trusted_scoring_signals_url_; + const std::optional<url::Origin> trusted_scoring_signals_origin_; + SignalsOriginRelation trusted_signals_relation_ = + SignalsOriginRelation::kNoTrustedSignals; const url::Origin top_window_origin_; mojom::AuctionWorkletPermissionsPolicyStatePtr permissions_policy_state_; const std::optional<uint16_t> experiment_group_id_; @@ -449,6 +467,9 @@ std::optional<std::string> error_msg); void MaybeRecordCodeWait(); + void OnGotCrossOriginTrustedSignalsPermissions( + std::vector<url::Origin> permit_origins); + // Called when trusted scoring signals have finished downloading, or when // there are no scoring signals to download. Starts running scoreAd() on the // V8 thread. @@ -538,6 +559,10 @@ std::unique_ptr<TrustedSignalsRequestManager> trusted_signals_request_manager_; + const std::optional<url::Origin> trusted_scoring_signals_origin_; + SignalsOriginRelation trusted_signals_relation_ = + SignalsOriginRelation::kNoTrustedSignals; + // Used for fetching DirectFromSellerSignals from subresource bundles (and // caching responses). DirectFromSellerSignalsRequester direct_from_seller_requester_seller_signals_;
diff --git a/content/services/auction_worklet/seller_worklet_unittest.cc b/content/services/auction_worklet/seller_worklet_unittest.cc index 7eb57d3d..ccf8ef6 100644 --- a/content/services/auction_worklet/seller_worklet_unittest.cc +++ b/content/services/auction_worklet/seller_worklet_unittest.cc
@@ -75,7 +75,7 @@ const std::string& extra_code = std::string()) { constexpr char kSellAdScript[] = R"( function scoreAd(adMetadata, bid, auctionConfig, trustedScoringSignals, - browserSignals, directFromSellerSignals) { + browserSignals, directFromSellerSignals, crossOriginTrustedSignals) { %s; return %s; } @@ -302,7 +302,8 @@ PrivateAggregationRequests expected_pa_requests = {}, std::optional<double> expected_bid_in_seller_currency = std::nullopt) { AddJavascriptResponse(&url_loader_factory_, decision_logic_url_, - CreateScoreAdScript(raw_return_value)); + CreateScoreAdScript(raw_return_value), + extra_js_headers_); auto seller_worklet = CreateWorklet(); base::RunLoop run_loop; @@ -339,8 +340,8 @@ PrivateAggregationRequests expected_pa_requests = {}, std::optional<double> expected_bid_in_seller_currency = std::nullopt) { SCOPED_TRACE(javascript); - AddJavascriptResponse(&url_loader_factory_, decision_logic_url_, - javascript); + AddJavascriptResponse(&url_loader_factory_, decision_logic_url_, javascript, + extra_js_headers_); RunScoreAdExpectingResult( expected_score, expected_errors, std::move(expected_component_auction_modified_bid_params), @@ -769,6 +770,9 @@ base::test::TaskEnvironment task_environment_; + // Extra headers to append to replies for JavaScript resources. + std::optional<std::string> extra_js_headers_; + // Arguments passed to score_bid() and report_result(). Arguments common to // both of them use the same field. // @@ -1936,6 +1940,14 @@ /*expected_data_version=*/5); } +// With the cross-origin trusted signals flag off, nothing is passed in to the +// cross-original signals parameter. +TEST_F(SellerWorkletTest, CrossOriginTrustedSignalsDisabled) { + RunScoreAdWithReturnValueExpectingResult( + "crossOriginTrustedSignals === undefined ? 1 : 0", 1); + RunScoreAdWithReturnValueExpectingResult("arguments.length", 6); +} + TEST_F(SellerWorkletTest, ScoreAdTrustedScoringSignalsLatency) { const base::TimeDelta kDelay = base::Milliseconds(135); trusted_scoring_signals_url_ = @@ -6011,5 +6023,302 @@ /*expected_debug_win_report_url=*/std::nullopt); } +class SellerWorkletCrossOriginTrustedSignalsTest : public SellerWorkletTest { + public: + SellerWorkletCrossOriginTrustedSignalsTest() { + scoped_feature_list_.InitAndEnableFeature( + blink::features::kFledgePermitCrossOriginTrustedSignals); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +// With the feature on, same-origin trusted signals still come in the same, +// only there is an extra null param. +TEST_F(SellerWorkletCrossOriginTrustedSignalsTest, SameOrigin) { + trusted_scoring_signals_url_ = + GURL("https://url.test/trusted_scoring_signals"); + const GURL kNoComponentSignalsUrl( + "https://url.test/trusted_scoring_signals?hostname=window.test" + "&renderUrls=https%3A%2F%2Frender.url.test%2F"); + + AddVersionedJsonResponse(&url_loader_factory_, kNoComponentSignalsUrl, + kTrustedScoringSignalsResponse, /*data_version=*/5); + RunScoreAdWithReturnValueExpectingResult( + "crossOriginTrustedSignals === null ? 1 : 0", 1, + /*expected_errors=*/{}, mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/5); + RunScoreAdWithReturnValueExpectingResult( + "arguments.length", 7, + /*expected_errors=*/{}, mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/5); + RunScoreAdWithReturnValueExpectingResult( + "browserSignals.dataVersion", 5, + /*expected_errors=*/{}, mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/5); + RunScoreAdWithReturnValueExpectingResult( + "'crossOriginDataVersion' in browserSignals ? 3 : 2", 2, + /*expected_errors=*/{}, mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/5); + RunScoreAdWithReturnValueExpectingResult( + "trustedScoringSignals.renderURL['https://render.url.test/']", 4, + /*expected_errors=*/{}, mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/5); +} + +// Cross-origin signals need explicit header to work; so if it's not there, +// or doesn't permit the origin, they will get blocked including the version. +TEST_F(SellerWorkletCrossOriginTrustedSignalsTest, ForbiddenCrossOrigin) { + trusted_scoring_signals_url_ = + GURL("https://other.test/trusted_scoring_signals"); + const GURL kNoComponentSignalsUrl( + "https://other.test/trusted_scoring_signals?hostname=window.test" + "&renderUrls=https%3A%2F%2Frender.url.test%2F"); + + std::vector<std::string> expected_errors = { + "https://url.test/ disregarding trusted scoring signals since origin " + "'https://other.test' is different from script's origin but not " + "authorized by script's Ad-Auction-Allow-Trusted-Scoring-Signals-From."}; + + AddVersionedJsonResponse(&url_loader_factory_, kNoComponentSignalsUrl, + kTrustedScoringSignalsResponse, /*data_version=*/5); + + for (bool provide_header : {false, true}) { + SCOPED_TRACE(provide_header); + if (provide_header) { + extra_js_headers_ = + "Ad-Auction-Allow-Trusted-Scoring-Signals-From: " + "\"http://other.test/\", \"https://url.test/\""; + } else { + extra_js_headers_ = std::nullopt; + } + + RunScoreAdWithReturnValueExpectingResult( + "crossOriginTrustedSignals === null ? 1 : 0", 1, expected_errors); + RunScoreAdWithReturnValueExpectingResult("arguments.length", 7, + expected_errors); + RunScoreAdWithReturnValueExpectingResult( + "trustedScoringSignals === null ? 1 : 0", 1, expected_errors); + + // No version in browserSignals... or passed out of worklet. + RunScoreAdWithReturnValueExpectingResult( + "'dataVersion' in browserSignals ? 0 : 1", 1, expected_errors, + mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/std::nullopt); + RunScoreAdWithReturnValueExpectingResult( + "'crossOriginDataVersion' in browserSignals ? 0 : 1", 1, + expected_errors, mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/std::nullopt); + } +} + +// Not allowed cross-origin trusted seller signals do not get fetched +TEST_F(SellerWorkletCrossOriginTrustedSignalsTest, + ForbiddenCrossOriginNoFetch) { + trusted_scoring_signals_url_ = + GURL("https://other.test/trusted_scoring_signals"); + const char kScoreExpr[] = "crossOriginTrustedSignals === null ? 1 : 0"; + const char kError[] = + "https://url.test/ disregarding trusted scoring signals since origin " + "'https://other.test' is different from script's origin but not " + "authorized by script's Ad-Auction-Allow-Trusted-Scoring-Signals-From."; + + std::vector<GURL> saw_urls; + url_loader_factory_.SetInterceptor( + base::BindLambdaForTesting([&](const network::ResourceRequest& request) { + saw_urls.push_back(request.url); + })); + + for (bool provide_header : {false, true}) { + SCOPED_TRACE(provide_header); + url_loader_factory_.ClearResponses(); + saw_urls.clear(); + if (provide_header) { + extra_js_headers_ = + "Ad-Auction-Allow-Trusted-Scoring-Signals-From: " + "\"http://other.test/\", \"https://url.test/\""; + } else { + extra_js_headers_ = std::nullopt; + } + + base::RunLoop run_loop; + auto seller_worklet = CreateWorklet(); + RunScoreAdOnWorkletAsync(seller_worklet.get(), + /*expected_score=*/1.0, + /*expected_errors=*/{kError}, + mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/std::nullopt, + /*expected_debug_loss_report_url=*/std::nullopt, + /*expected_debug_win_report_url=*/std::nullopt, + mojom::RejectReason::kNotAvailable, + /*expected_pa_requests=*/{}, + /*expected_bid_in_seller_currency=*/std::nullopt, + /*expected_score_ad_timeout=*/false, + /*expected_signals_fetch_latency=*/std::nullopt, + /*expected_code_ready_latency=*/std::nullopt, + run_loop.QuitClosure()); + + // Only the script fetch must have started, even if we give enough time that + // seller signals would normally be flushed. + task_environment_.FastForwardBy( + TrustedSignalsRequestManager::kAutoSendDelay); + EXPECT_EQ(1, url_loader_factory_.NumPending()); + EXPECT_TRUE(url_loader_factory_.IsPending(decision_logic_url_.spec())); + + AddJavascriptResponse(&url_loader_factory_, decision_logic_url_, + CreateScoreAdScript(kScoreExpr), extra_js_headers_); + run_loop.Run(); + // We didn't just time out the signals fetch, it didn't happen at all. + EXPECT_THAT(saw_urls, testing::ElementsAre(decision_logic_url_)); + } +} + +// Note that the fetch also involves CORS, but this isn't really a good place +// to test it since we're using a TestURLLoaderFactory so all the CORS code is +// bypassed. +TEST_F(SellerWorkletCrossOriginTrustedSignalsTest, AllowedCrossOrigin) { + trusted_scoring_signals_url_ = + GURL("https://other.test/trusted_scoring_signals"); + const GURL kNoComponentSignalsUrl( + "https://other.test/trusted_scoring_signals?hostname=window.test" + "&renderUrls=https%3A%2F%2Frender.url.test%2F"); + + extra_js_headers_ = + "Ad-Auction-Allow-Trusted-Scoring-Signals-From: " + "\"https://more.test\", \"https://other.test/ignored\""; + + AddVersionedJsonResponse(&url_loader_factory_, kNoComponentSignalsUrl, + kTrustedScoringSignalsResponse, /*data_version=*/5); + + RunScoreAdWithReturnValueExpectingResult( + "arguments.length", 7, /*expected_errors=*/{}, + mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/5); + RunScoreAdWithReturnValueExpectingResult( + "trustedScoringSignals === null ? 1 : 0", 1, + /*expected_errors=*/{}, mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/5); + const char kValidate[] = R"( + const expected = '{"https://other.test":{' + + '"renderURL":{"https://render.url.test/":4},' + + '"renderUrl":{"https://render.url.test/":4}}}' + const actual = JSON.stringify(crossOriginTrustedSignals); + if (actual === expected) + return 7; + throw actual + "!" + expected; + )"; + + RunScoreAdWithJavascriptExpectingResult( + CreateScoreAdScript("3", kValidate), 7, + /*expected_errors=*/{}, mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/5); + + // Versions in crossOriginDataVersion, and passed out of worklet. + RunScoreAdWithReturnValueExpectingResult( + "'dataVersion' in browserSignals ? 0 : 1", 1, + /*expected_errors=*/{}, mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/5); + RunScoreAdWithReturnValueExpectingResult( + "browserSignals.crossOriginDataVersion", 5, + /*expected_errors=*/{}, mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/5); +} + +// When cross-origin trusted seller signals are allowed, they must happen +// after the script headers complete (approximated as script /fetch/ +// completes in this test, since TestURLLoaderFactory isn't that fine-grained). +TEST_F(SellerWorkletCrossOriginTrustedSignalsTest, AllowedCrossOriginTiming) { + trusted_scoring_signals_url_ = + GURL("https://other.test/trusted_scoring_signals"); + const GURL kNoComponentSignalsUrl( + "https://other.test/trusted_scoring_signals?hostname=window.test" + "&renderUrls=https%3A%2F%2Frender.url.test%2F"); + + extra_js_headers_ = + "Ad-Auction-Allow-Trusted-Scoring-Signals-From: " + "\"https://more.test\", \"https://other.test/ignored\""; + + const char kValidate[] = R"( + const expected = '{"https://other.test":{' + + '"renderURL":{"https://render.url.test/":4},' + + '"renderUrl":{"https://render.url.test/":4}}}' + const actual = JSON.stringify(crossOriginTrustedSignals); + if (actual === expected) + return 7; + throw actual + "!" + expected; + )"; + + base::RunLoop run_loop; + auto seller_worklet = CreateWorklet(); + RunScoreAdOnWorkletAsync( + seller_worklet.get(), + /*expected_score=*/7, + /*expected_errors=*/{}, mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/5, + /*expected_debug_loss_report_url=*/std::nullopt, + /*expected_debug_win_report_url=*/std::nullopt, + mojom::RejectReason::kNotAvailable, + /*expected_pa_requests=*/{}, + /*expected_bid_in_seller_currency=*/std::nullopt, + /*expected_score_ad_timeout=*/false, + /*expected_signals_fetch_latency=*/std::nullopt, + /*expected_code_ready_latency=*/std::nullopt, run_loop.QuitClosure()); + + // Only the script fetch must have started now... and after auto-send delay. + task_environment_.FastForwardBy(TrustedSignalsRequestManager::kAutoSendDelay); + EXPECT_EQ(1, url_loader_factory_.NumPending()); + EXPECT_TRUE(url_loader_factory_.IsPending(decision_logic_url_.spec())); + + AddJavascriptResponse(&url_loader_factory_, decision_logic_url_, + CreateScoreAdScript("3", kValidate), extra_js_headers_); + task_environment_.FastForwardBy(TrustedSignalsRequestManager::kAutoSendDelay); + + // Now the trusted signals fetch must be pending, too. + EXPECT_EQ(1, url_loader_factory_.NumPending()); + EXPECT_TRUE(url_loader_factory_.IsPending(kNoComponentSignalsUrl.spec())); + AddVersionedJsonResponse(&url_loader_factory_, kNoComponentSignalsUrl, + kTrustedScoringSignalsResponse, /*data_version=*/5); + run_loop.Run(); +} + +// Handling of errors in trusted signals other than the cross-origin permission; +// it should look identical except for the error message test. +TEST_F(SellerWorkletCrossOriginTrustedSignalsTest, ErrorCrossOrigin) { + trusted_scoring_signals_url_ = + GURL("https://other.test/trusted_scoring_signals"); + const GURL kNoComponentSignalsUrl( + "https://other.test/trusted_scoring_signals?hostname=window.test" + "&renderUrls=https%3A%2F%2Frender.url.test%2F"); + + std::vector<std::string> expected_errors = { + "https://other.test/trusted_scoring_signals Unable to parse as a JSON " + "object."}; + + extra_js_headers_ = + "Ad-Auction-Allow-Trusted-Scoring-Signals-From: " + "\"https://more.test\", \"https://other.test/ignored\""; + + AddVersionedJsonResponse(&url_loader_factory_, kNoComponentSignalsUrl, "{", + /*data_version=*/5); + + RunScoreAdWithReturnValueExpectingResult( + "crossOriginTrustedSignals === null ? 1 : 0", 1, expected_errors); + RunScoreAdWithReturnValueExpectingResult("arguments.length", 7, + expected_errors); + RunScoreAdWithReturnValueExpectingResult( + "trustedScoringSignals === null ? 1 : 0", 1, expected_errors); + + // No version in browserSignals... or passed out of worklet. + RunScoreAdWithReturnValueExpectingResult( + "'dataVersion' in browserSignals ? 0 : 1", 1, expected_errors, + mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/std::nullopt); + RunScoreAdWithReturnValueExpectingResult( + "'crossOriginDataVersion' in browserSignals ? 0 : 1", 1, expected_errors, + mojom::ComponentAuctionModifiedBidParamsPtr(), + /*expected_data_version=*/std::nullopt); +} + } // namespace } // namespace auction_worklet
diff --git a/content/services/auction_worklet/trusted_signals.cc b/content/services/auction_worklet/trusted_signals.cc index d1bcae5..a2dcdf14 100644 --- a/content/services/auction_worklet/trusted_signals.cc +++ b/content/services/auction_worklet/trusted_signals.cc
@@ -28,6 +28,7 @@ #include "content/services/auction_worklet/public/cpp/auction_downloader.h" #include "content/services/auction_worklet/public/cpp/auction_network_events_delegate.h" #include "gin/converter.h" +#include "gin/dictionary.h" #include "net/base/parse_number.h" #include "services/network/public/mojom/url_loader_factory.mojom-forward.h" #include "url/gurl.h" @@ -389,6 +390,22 @@ return out; } +// static +v8::Local<v8::Value> TrustedSignals::Result::WrapCrossOriginSignals( + AuctionV8Helper* v8_helper, + v8::Local<v8::Context> context, + const url::Origin& source_origin, + v8::Local<v8::Value> signals) { + v8::Isolate* isolate = v8_helper->isolate(); + if (signals->IsNullOrUndefined()) { + return v8::Null(isolate); + } + v8::Local<v8::Object> out = v8::Object::New(v8_helper->isolate()); + gin::Dictionary out_converter(isolate, out); + out_converter.Set(source_origin.Serialize(), signals); + return out; +} + TrustedSignals::Result::~Result() = default; GURL TrustedSignals::BuildTrustedBiddingSignalsURL(
diff --git a/content/services/auction_worklet/trusted_signals.h b/content/services/auction_worklet/trusted_signals.h index 95dd5f3..9557f0a 100644 --- a/content/services/auction_worklet/trusted_signals.h +++ b/content/services/auction_worklet/trusted_signals.h
@@ -115,6 +115,15 @@ std::optional<uint32_t> GetDataVersion() const { return data_version_; } + // If `signals` is not undefined or not null, returns an object containing + // `signals` as a field under the key `source_origin`. + // Otherwise, returns JS null. + static v8::Local<v8::Value> WrapCrossOriginSignals( + AuctionV8Helper* v8_helper, + v8::Local<v8::Context> context, + const url::Origin& source_origin, + v8::Local<v8::Value> signals); + private: friend class base::RefCountedThreadSafe<Result>;
diff --git a/content/services/auction_worklet/worklet_test_util.cc b/content/services/auction_worklet/worklet_test_util.cc index 7e86f6d8..2975bb8 100644 --- a/content/services/auction_worklet/worklet_test_util.cc +++ b/content/services/auction_worklet/worklet_test_util.cc
@@ -9,6 +9,7 @@ #include <string> #include "base/strings/strcat.h" +#include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/to_string.h" #include "base/synchronization/waitable_event.h" @@ -71,11 +72,21 @@ std::move(redirects)); } -void AddJavascriptResponse(network::TestURLLoaderFactory* url_loader_factory, - const GURL& url, - const std::string content) { - AddResponse(url_loader_factory, url, kJavascriptMimeType, std::nullopt, - content); +void AddJavascriptResponse( + network::TestURLLoaderFactory* url_loader_factory, + const GURL& url, + const std::string& content, + base::optional_ref<const std::string> extra_headers) { + std::string headers; + if (!extra_headers.has_value()) { + headers = kAllowFledgeHeader; + } else { + headers = base::StrCat( + {kAllowFledgeHeader, "\r\n", + base::TrimWhitespaceASCII(*extra_headers, base::TRIM_ALL)}); + } + AddResponse(url_loader_factory, url, kJavascriptMimeType, + /*charset=*/std::nullopt, content, headers); } void AddJsonResponse(network::TestURLLoaderFactory* url_loader_factory,
diff --git a/content/services/auction_worklet/worklet_test_util.h b/content/services/auction_worklet/worklet_test_util.h index 3294ae88..87b621a 100644 --- a/content/services/auction_worklet/worklet_test_util.h +++ b/content/services/auction_worklet/worklet_test_util.h
@@ -9,6 +9,7 @@ #include <string> #include <vector> +#include "base/types/optional_ref.h" #include "content/services/auction_worklet/public/mojom/auction_network_events_handler.mojom.h" #include "content/services/auction_worklet/public/mojom/auction_shared_storage_host.mojom.h" #include "net/http/http_status_code.h" @@ -49,9 +50,11 @@ // Convenience methods to invoke AddResponse() with the specified MIME type and // no charset. -void AddJavascriptResponse(network::TestURLLoaderFactory* url_loader_factory, - const GURL& url, - const std::string content); +void AddJavascriptResponse( + network::TestURLLoaderFactory* url_loader_factory, + const GURL& url, + const std::string& content, + base::optional_ref<const std::string> extra_headers = std::nullopt); void AddJsonResponse(network::TestURLLoaderFactory* url_loader_factory, const GURL& url, const std::string content);
diff --git a/content/test/gpu/gpu_tests/overlay_support.py b/content/test/gpu/gpu_tests/overlay_support.py index 2a8d7c6..aeab5406 100644 --- a/content/test/gpu/gpu_tests/overlay_support.py +++ b/content/test/gpu/gpu_tests/overlay_support.py
@@ -434,6 +434,15 @@ AllHardwareSupportDirectCompositionConfig(), 0x9bc5: AllHardwareSupportDirectCompositionConfig(), + 0x4680: BasicDirectCompositionConfig()\ + .WithHardwareNV12Support(supported_rotations=[ + VideoRotation.ROT180])\ + .WithHardwareYUY2Support()\ + .WithHardwareBGRA8Support()\ + .WithZeroCopyConfig(ZeroCopyConfig( + supports_scaled_video=False, + supported_codecs=[ + ZeroCopyCodec.H264])), }, constants.GpuVendor.NVIDIA: { # For some reason, software BGRA8 software overlay support changes
diff --git a/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt index 96a99e8e..d8958a1 100644 --- a/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt
@@ -180,19 +180,33 @@ crbug.com/923134 [ mac ] ContextLost_WebGL2Blocked [ Skip ] crbug.com/923134 [ android ] ContextLost_WebGL2Blocked [ Skip ] +# Always fail and flakily hangs browser shutdown on Win/Intel UHD 770. +crbug.com/335672567 [ win intel-0x4680 ] ContextLost_Canvas2dGPUCrash [ Skip ] +crbug.com/335672567 [ win intel-0x4680 ] ContextLost_OffscreenCanvasRecoveryAfterGPUCrash [ Skip ] +crbug.com/335672567 [ win intel-0x4680 ] ContextLost_WebGLBlockedAfterJSNavigation [ Skip ] +crbug.com/335672567 [ win intel-0x4680 ] ContextLost_WebGLContextLostFromGPUProcessExit [ Skip ] +crbug.com/335672567 [ win intel-0x4680 ] ContextLost_WebGLContextRestoredInHiddenTab [ Skip ] +crbug.com/335672567 [ win intel-0x4680 ] ContextLost_WorkerWebGLRAFAfterGPUCrash [ Skip ] +crbug.com/335672567 [ win intel-0x4680 ] ContextLost_WebGLUnblockedAfterUserInitiatedReload [ Skip ] +crbug.com/335672567 [ win intel-0x4680 ] ContextLost_WebGPUBlockedAfterJSNavigation [ Skip ] +crbug.com/335672567 [ win intel-0x4680 ] ContextLost_WebGPUUnblockedAfterUserInitiatedReload [ Skip ] +crbug.com/335672567 [ win intel-0x4680 ] GpuCrash_GPUProcessCrashesExactlyOncePerVisitToAboutGpuCrash [ Skip ] +crbug.com/335672567 [ win intel-0x4680 release ] GpuCrash_InfoForHardwareGpu [ Skip ] + ################### # Failures/Flakes # ################### # Non-"Skip" expectations go here to suppress regular flakes/failures. -# Fails on Linux AMD RX 5500 XT with RADV 20.0.8 -crbug.com/1418987 [ linux amd-0x7340 angle-vulkan ] ContextLost_WebGL2UnpackImageHeight [ Failure ] crbug.com/1419558 [ angle-swiftshader clang-coverage fuchsia fuchsia-board-qemu-x64 google-0xc0de ] ContextLost_WebGLContextLostFromQuantity [ Failure ] # Fails with Graphite on Windows and Mac -crbug.com/329145823 [ win release ] GpuCrash_InfoForHardwareGpu [ Failure ] +crbug.com/329145823 [ win release amd ] GpuCrash_InfoForHardwareGpu [ Failure ] +crbug.com/329145823 [ win release intel-0x9bc5 ] GpuCrash_InfoForHardwareGpu [ Failure ] +crbug.com/329145823 [ win release nvidia ] GpuCrash_InfoForHardwareGpu [ Failure ] +crbug.com/329145823 [ win release qualcomm ] GpuCrash_InfoForHardwareGpu [ Failure ] crbug.com/329145823 [ mac release ] GpuCrash_InfoForHardwareGpu [ Failure ] crbug.com/329145823 [ mac release ] GpuCrash_InfoForDualHardwareGpus [ Failure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt index 2e3ed81..60e49e7 100644 --- a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt
@@ -323,6 +323,10 @@ crbug.com/41488897 [ android android-pixel-6 passthrough renderer-skia-gl graphite-enabled ] Pixel_VideoStreamFrom2DCanvas [ Skip ] crbug.com/41488897 [ android android-pixel-6 passthrough renderer-skia-gl graphite-enabled ] Pixel_Video_BackdropFilter [ Skip ] +# Can flakily hang browser shutdown. +crbug.com/335672567 [ win intel-0x4680 ] Pixel_WebGLContextRestored [ Skip ] +crbug.com/335672567 [ win intel-0x4680 ] Pixel_WebGLSadCanvas [ Skip ] + ############################### # Permanent Slow Expectations # ############################### @@ -482,6 +486,10 @@ # ganesh. crbug.com/332731568 [ win nvidia graphite-disabled ] Pixel_Video_HEVC [ Failure ] +# Consistently times out on Windows/UHD 770 +crbug.com/335325875 [ win10 intel-0x4680 ] Pixel_Video_Context_Loss_MP4 [ Failure ] +crbug.com/335325875 [ win10 intel-0x4680 ] Pixel_Video_Context_Loss_VP9 [ Failure ] + ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here # #######################################################################
diff --git a/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt index a57ef98..4eb431a 100644 --- a/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt
@@ -202,9 +202,6 @@ crbug.com/1201009 [ linux ] WebGLCanvasCaptureTraceTest_VideoStreamFromWebGLCanvas_TwoCopy_Accelerated [ Failure ] -# WebGL drawingBufferStorage does not work on Pixel 4, Samsung A23, nexus-5x or -# Lacros FYI x64 Release (Intel) yet. -crbug.com/1230619 [ android android-nexus-5x no-clang-coverage passthrough ] TraceTest_WebGLFloat [ Failure ] crbug.com/1402261 [ win intel ] OverlayModeTraceTest_DirectComposition_Video_* [ RetryOnFailure ] @@ -233,9 +230,6 @@ crbug.com/329138770 [ win graphite-enabled ] WebGPUCachingTraceTest_RenderPipelineIncognito [ Failure ] crbug.com/335564847 [ win graphite-enabled ] VideoPathTraceTest_DirectComposition_* [ Failure ] -# Failures on fuchsia -crbug.com/40935289 [ fuchsia web-engine-shell ] WebGLCanvasCaptureTraceTest_VideoStreamFromWebGLCanvas_OneCopy [ Failure ] -crbug.com/40935289 [ fuchsia web-engine-shell ] WebGLCanvasCaptureTraceTest_VideoStreamFromWebGLCanvas_TwoCopy_Accelerated [ Failure ] ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here #
diff --git a/content/test/gpu/gpu_tests/test_expectations/webcodecs_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webcodecs_expectations.txt index f00d3772..82b49da8 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webcodecs_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webcodecs_expectations.txt
@@ -176,7 +176,8 @@ crbug.com/326356910 [ chromeos chromeos-board-volteer ] WebCodecs_FrameSizeChange_vp8_hw_decoder [ Failure ] crbug.com/326356910 [ chromeos chromeos-board-volteer ] WebCodecs_copyTo_hw_decoder [ Failure ] - +crbug.com/333426465 [ win intel-0x4680 ] WebCodecs_PerFrameQpEncoding_offscreen_avc1.42001E_prefer-hardware [ Failure ] +crbug.com/333426465 [ win intel-0x4680 ] WebCodecs_SVC_vp09.00.10.08_prefer-hardware_layers_2 [ Failure ] ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here #
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt index 2377984..9deed3d3 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt
@@ -407,6 +407,8 @@ # the default 15 second heartbeat timeout because of that. crbug.com/1426916 [ chromeos chromeos-board-amd64-generic passthrough ] deqp/functional/gles3/uniformapi/random.html [ Slow ] +[ win intel-0x4680 ] deqp/functional/gles3/multisample/fbo_max_samples.html [ Slow ] + ################### # Failures/Flakes # ################### @@ -1007,6 +1009,7 @@ crbug.com/332743717 [ chromeos chromeos-board-octopus ] conformance2/canvas/drawingbuffer-storage-test.html [ Failure ] crbug.com/332743717 [ chromeos chromeos-board-volteer ] conformance2/canvas/drawingbuffer-storage-test.html [ Failure ] crbug.com/332743717 [ android android-pixel-2 ] conformance2/canvas/drawingbuffer-storage-test.html [ Failure ] +crbug.com/332743717 [ win intel-0x4680 ] conformance2/query/occlusion-query-scissor.html [ Failure ] crbug.com/332743717 [ win qualcomm-0x41333430 ] conformance2/textures/image_bitmap_from_video/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html [ Failure ] crbug.com/335203259 [ android android-pixel-2 ] conformance2/wasm/bufferdata-16gb-wasm-memory.html [ Failure ] crbug.com/335203259 [ android android-pixel-2 ] conformance2/wasm/bufferdata-4gb-wasm-memory.html [ Failure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt index d59a9dd7..2956ce5 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt
@@ -735,13 +735,6 @@ crbug.com/1230619 conformance/offscreencanvas/methods-worker.html [ Failure ] crbug.com/1230619 conformance/offscreencanvas/methods.html [ Failure ] -#################### -# Fuchsia failures # -#################### -crbug.com/40935289 [ fuchsia web-engine-shell ] WebglExtension_EXT_float_blend [ Failure ] -crbug.com/40935289 [ fuchsia web-engine-shell ] conformance/context/context-attributes-alpha-depth-stencil-antialias.html [ Failure ] -crbug.com/40935289 [ fuchsia web-engine-shell ] conformance/textures/misc/texture-size-limit.html [ Failure ] -crbug.com/40935289 [ fuchsia web-engine-shell ] conformance/textures/misc/texture-sub-image-cube-maps.html [ Failure ] ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here #
diff --git a/device/fido/enclave/verify/rekor.h b/device/fido/enclave/verify/rekor.h index a4561a855..6b301348 100644 --- a/device/fido/enclave/verify/rekor.h +++ b/device/fido/enclave/verify/rekor.h
@@ -10,6 +10,7 @@ #include <string_view> #include <vector> +#include "base/containers/span.h" #include "base/time/time.h" #include "device/fido/enclave/verify/hash.h" @@ -101,6 +102,32 @@ std::vector<uint8_t> signature; }; +// Verifies a Rekor LogEntry. This includes verifying: +// +// 1. the signature in `signed_entry_timestamp` using Rekor's public key, +// 1. the signature in `body.spec.generic_signature` using the endorser's public +// key, +// 1. that the content of the body equals `endorsement`. +bool VerifyRekorLogEntry(base::span<const uint8_t> log_entry, + base::span<const uint8_t> rekor_public_key, + base::span<const uint8_t> endorsement); + +// Parses the given bytes into a Rekor `LogEntry` object, and returns its +// `body` parsed into an instance of `Body`. +std::optional<Body> GetRekorLogEntryBody(base::span<const uint8_t> log_entry); + +// Parses a blob into a Rekor log entry and verifies the signature in +// `signed_entry_timestamp` using Rekor's public key. +bool VerifyRekorSignature(base::span<const uint8_t> log_entry, + base::span<const uint8_t> rekor_public_key); + +// Verifies the signature in the body over the contents. +bool VerifyRekorBody(const Body&, base::span<const uint8_t> contents_bytes); + +// Parses `RekorSignatureBundle` from `log_entry`. +std::optional<RekorSignatureBundle> RekorSignatureBundle( + base::span<const uint8_t> log_entry); + } // namespace device::enclave #endif // DEVICE_FIDO_ENCLAVE_VERIFY_REKOR_H_
diff --git a/device/fido/features.cc b/device/fido/features.cc index 6f87bc2..6a80facf 100644 --- a/device/fido/features.cc +++ b/device/fido/features.cc
@@ -102,11 +102,6 @@ "WebAuthenticationFilterGooglePasskeys", base::FEATURE_ENABLED_BY_DEFAULT); -// Enabled in M120. Remove in or after M123. -BASE_FEATURE(kWebAuthnPRFEvalDuringCreate, - "WebAuthenticationPRFEvalDuringCreate", - base::FEATURE_ENABLED_BY_DEFAULT); - #if BUILDFLAG(IS_CHROMEOS) // Not yet enabled by default. BASE_FEATURE(kChromeOsPasskeys,
diff --git a/device/fido/features.h b/device/fido/features.h index 0a91499..42075fca 100644 --- a/device/fido/features.h +++ b/device/fido/features.h
@@ -79,10 +79,6 @@ COMPONENT_EXPORT(DEVICE_FIDO) BASE_DECLARE_FEATURE(kWebAuthnFilterGooglePasskeys); -// Support evaluating PRFs during create() calls. -COMPONENT_EXPORT(DEVICE_FIDO) -BASE_DECLARE_FEATURE(kWebAuthnPRFEvalDuringCreate); - #if BUILDFLAG(IS_CHROMEOS) // Enable ChromeOS native passkey support. COMPONENT_EXPORT(DEVICE_FIDO)
diff --git a/docs/unsafe_buffers.md b/docs/unsafe_buffers.md index dea373d..ca7a4f21c 100644 --- a/docs/unsafe_buffers.md +++ b/docs/unsafe_buffers.md
@@ -20,24 +20,17 @@ Warnings can be disabled for a single (C++ source or header) file by writing `#pragma allow_unsafe_buffers` anywhere in the file. This can -be used to mark future work to drive down over time: -``` -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/ABC): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif -``` +be used to mark future work to drive down over time. -It's recommended to place the pragma directly copyright header. This can be used -to work through files in a directory incrementally. To do so, remove the whole -directory from opt-out in the +Warnings can be enabled for a single (C++ source or header) file by +writing `#pragma check_unsafe_buffers` anywhere in the file. It's recommended +to place the pragma directly below the copyright and before any `#include` +directives. This can be used to work through files in a directory +incrementally. Though it's preferable to instead remove the whole directory +from opt-out in the [`//build/config/unsafe_buffers_paths.txt`](../build/config/unsafe_buffers_paths.txt) -file, and temporarily mark any files with `#pragma allow_unsafe_buffers` that -need it. - -The warnings can be enabled for a single (C++ source or header) file by writing -`#pragma check_unsafe_buffers` anywhere in the file. These also need to be -guarded by `#ifdef UNSAFE_BUFFERS_BUILD` if being checked in. +file, and temporarily mark any files with `#pragma allow_unsafe_buffers` +that need it. # Functions with array pointer parameters
diff --git a/extensions/browser/api/networking_private/networking_private_chromeos.cc b/extensions/browser/api/networking_private/networking_private_chromeos.cc index f0c475b..0cc01d4 100644 --- a/extensions/browser/api/networking_private/networking_private_chromeos.cc +++ b/extensions/browser/api/networking_private/networking_private_chromeos.cc
@@ -244,26 +244,28 @@ return api_cert; } -// This returns the strings provided by NetworkPortalDetector for backwards -// compatibility, even though the implementation no longer queries -// NetworkPortalDetector directly. +constexpr char kCaptivePortalStatusUnknown[] = "Unknown"; +constexpr char kCaptivePortalStatusOffline[] = "Offline"; +constexpr char kCaptivePortalStatusOnline[] = "Online"; +constexpr char kCaptivePortalStatusPortal[] = "Portal"; +constexpr char kCaptivePortalStatusUnrecognized[] = "Unrecognized"; + +// This returns backwards compatible strings previously provided by +// NetworkPortalDetector. // static std::string PortalStatusString(ash::NetworkState::PortalState portal_state) { using PortalState = ash::NetworkState::PortalState; switch (portal_state) { case PortalState::kUnknown: - return ash::NetworkPortalDetector::CaptivePortalStatusString( - ash::NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN); + return kCaptivePortalStatusUnknown; case PortalState::kOnline: - return ash::NetworkPortalDetector::CaptivePortalStatusString( - ash::NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE); + return kCaptivePortalStatusOnline; case PortalState::kPortalSuspected: case PortalState::kPortal: case PortalState::kNoInternet: - return ash::NetworkPortalDetector::CaptivePortalStatusString( - ash::NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL); + return kCaptivePortalStatusPortal; } - return "Unrecognized"; + return kCaptivePortalStatusUnrecognized; } } // namespace @@ -574,9 +576,7 @@ return; } if (!network->IsConnectedState()) { - std::move(success_callback) - .Run(ash::NetworkPortalDetector::CaptivePortalStatusString( - ash::NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE)); + std::move(success_callback).Run(kCaptivePortalStatusOffline); return; } std::move(success_callback)
diff --git a/gpu/command_buffer/service/dawn_context_provider.cc b/gpu/command_buffer/service/dawn_context_provider.cc index 1f455a5..4737f8c 100644 --- a/gpu/command_buffer/service/dawn_context_provider.cc +++ b/gpu/command_buffer/service/dawn_context_provider.cc
@@ -15,8 +15,12 @@ #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/notreached.h" +#include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "base/task/single_thread_task_runner.h" #include "base/threading/platform_thread.h" +#include "base/trace_event/memory_dump_manager.h" +#include "base/trace_event/process_memory_dump.h" #include "base/trace_event/trace_arguments.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" @@ -514,6 +518,12 @@ } #endif // BUILDFLAG(IS_WIN) + if (base::SingleThreadTaskRunner::HasCurrentDefault()) { + base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( + this, "DawnContextProvider", + base::SingleThreadTaskRunner::GetCurrentDefault()); + } + return true; } @@ -605,6 +615,50 @@ } } +namespace { +class DawnMemoryDump : public dawn::native::MemoryDump { + public: + DawnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) : pmd_(pmd) { + CHECK(pmd_); + } + + ~DawnMemoryDump() override = default; + + void AddScalar(const char* name, + const char* key, + const char* units, + uint64_t value) override { + pmd_->GetOrCreateAllocatorDump(base::JoinString({kPrefix, name}, "")) + ->AddScalar(key, units, value); + } + + void AddString(const char* name, + const char* key, + const std::string& value) override { + pmd_->GetOrCreateAllocatorDump(base::JoinString({kPrefix, name}, "")) + ->AddString(key, "", value); + } + + private: + static constexpr char kPrefix[] = "gpu/dawn/"; + + const raw_ptr<base::trace_event::ProcessMemoryDump> pmd_; +}; +} // namespace + +bool DawnContextProvider::OnMemoryDump( + const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) { + // TODO(https://crbug.com/330806170): Implement background level of + // detail support for emitting to UMA GPU memory histograms. + if (args.level_of_detail != + base::trace_event::MemoryDumpLevelOfDetail::kBackground) { + DawnMemoryDump dump(pmd); + dawn::native::DumpMemoryStatistics(device_.Get(), &dump); + } + return true; +} + // static size_t DawnContextProvider::LoadCachedData(const void* key, size_t key_size,
diff --git a/gpu/command_buffer/service/dawn_context_provider.h b/gpu/command_buffer/service/dawn_context_provider.h index c572c8c..102fbf8 100644 --- a/gpu/command_buffer/service/dawn_context_provider.h +++ b/gpu/command_buffer/service/dawn_context_provider.h
@@ -13,6 +13,7 @@ #include "base/memory/raw_ptr.h" #include "base/synchronization/lock.h" #include "base/thread_annotations.h" +#include "base/trace_event/memory_dump_provider.h" #include "build/build_config.h" #include "gpu/command_buffer/common/constants.h" #include "gpu/command_buffer/service/dawn_caching_interface.h" @@ -37,7 +38,8 @@ class DawnInstance; } // namespace webgpu -class GPU_GLES2_EXPORT DawnContextProvider { +class GPU_GLES2_EXPORT DawnContextProvider + : public base::trace_event::MemoryDumpProvider { public: using CacheBlobCallback = webgpu::DawnCachingInterface::CacheBlobCallback; static std::unique_ptr<DawnContextProvider> Create( @@ -57,7 +59,7 @@ DawnContextProvider(const DawnContextProvider&) = delete; DawnContextProvider& operator=(const DawnContextProvider&) = delete; - ~DawnContextProvider(); + ~DawnContextProvider() override; wgpu::Device GetDevice() const { return device_; } wgpu::BackendType backend_type() const { return backend_type_; } @@ -107,6 +109,9 @@ const GpuPreferences& gpu_preferences, const GpuDriverBugWorkarounds& gpu_driver_workarounds); + bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) override; + std::unique_ptr<webgpu::DawnCachingInterface> caching_interface_; std::unique_ptr<dawn::platform::Platform> platform_; std::unique_ptr<webgpu::DawnInstance> instance_;
diff --git a/gpu/command_buffer/service/mailbox_manager.h b/gpu/command_buffer/service/mailbox_manager.h index 5b8c8106..ff2c0f2 100644 --- a/gpu/command_buffer/service/mailbox_manager.h +++ b/gpu/command_buffer/service/mailbox_manager.h
@@ -17,9 +17,6 @@ public: virtual ~MailboxManager() = default; - // Look up the texture definition from the named mailbox. - virtual TextureBase* ConsumeTexture(const Mailbox& mailbox) = 0; - // Destroy any mailbox that reference the given texture. virtual void TextureDeleted(TextureBase* texture) = 0; };
diff --git a/gpu/command_buffer/service/mailbox_manager_dummy.cc b/gpu/command_buffer/service/mailbox_manager_dummy.cc index 871b889..3898214 100644 --- a/gpu/command_buffer/service/mailbox_manager_dummy.cc +++ b/gpu/command_buffer/service/mailbox_manager_dummy.cc
@@ -14,10 +14,5 @@ MailboxManagerDummy::~MailboxManagerDummy() = default; -TextureBase* MailboxManagerDummy::ConsumeTexture(const Mailbox& mailbox) { - NOTREACHED(); - return nullptr; -} - } // namespace gles2 } // namespace gpu
diff --git a/gpu/command_buffer/service/mailbox_manager_dummy.h b/gpu/command_buffer/service/mailbox_manager_dummy.h index 836407c4..c51eda2 100644 --- a/gpu/command_buffer/service/mailbox_manager_dummy.h +++ b/gpu/command_buffer/service/mailbox_manager_dummy.h
@@ -25,7 +25,6 @@ ~MailboxManagerDummy() override; // MailboxManager implementation: - TextureBase* ConsumeTexture(const Mailbox& mailbox) override; void TextureDeleted(TextureBase* texture) override {} };
diff --git a/gpu/command_buffer/service/mailbox_manager_impl.cc b/gpu/command_buffer/service/mailbox_manager_impl.cc index dc79c04..643dab5 100644 --- a/gpu/command_buffer/service/mailbox_manager_impl.cc +++ b/gpu/command_buffer/service/mailbox_manager_impl.cc
@@ -22,15 +22,6 @@ DCHECK(textures_to_mailboxes_.empty()); } -TextureBase* MailboxManagerImpl::ConsumeTexture(const Mailbox& mailbox) { - MailboxToTextureMap::iterator it = - mailbox_to_textures_.find(mailbox); - if (it != mailbox_to_textures_.end()) - return it->second->first; - - return nullptr; -} - void MailboxManagerImpl::TextureDeleted(TextureBase* texture) { std::pair<TextureToMailboxMap::iterator, TextureToMailboxMap::iterator> range =
diff --git a/gpu/command_buffer/service/mailbox_manager_impl.h b/gpu/command_buffer/service/mailbox_manager_impl.h index 38867e2..8051c95 100644 --- a/gpu/command_buffer/service/mailbox_manager_impl.h +++ b/gpu/command_buffer/service/mailbox_manager_impl.h
@@ -27,7 +27,6 @@ ~MailboxManagerImpl() override; // MailboxManager implementation: - TextureBase* ConsumeTexture(const Mailbox& mailbox) override; void TextureDeleted(TextureBase* texture) override; private:
diff --git a/gpu/command_buffer/service/shared_image/d3d_image_backing.cc b/gpu/command_buffer/service/shared_image/d3d_image_backing.cc index f14e28d0..6ede1407 100644 --- a/gpu/command_buffer/service/shared_image/d3d_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/d3d_image_backing.cc
@@ -441,135 +441,91 @@ bool D3DImageBacking::UploadFromMemory(const std::vector<SkPixmap>& pixmaps) { DCHECK_EQ(pixmaps.size(), static_cast<size_t>(format().NumberOfPlanes())); + ID3D11Texture2D* staging_texture = GetOrCreateStagingTexture(); + if (!staging_texture) { + return false; + } + CHECK(texture_d3d11_device_); Microsoft::WRL::ComPtr<ID3D11DeviceContext> device_context; texture_d3d11_device_->GetImmediateContext(&device_context); - if (d3d11_texture_desc_.CPUAccessFlags & D3D11_CPU_ACCESS_WRITE) { - // D3D doesn't support mappable+default YUV textures. - DCHECK(format().is_single_plane()); - - Microsoft::WRL::ComPtr<ID3D11Device3> device3; - HRESULT hr = texture_d3d11_device_.As(&device3); - if (FAILED(hr)) { - LOG(ERROR) << "Failed to retrieve ID3D11Device3. hr=" << std::hex << hr; - return false; - } - hr = device_context->Map(d3d11_texture_.Get(), 0, D3D11_MAP_WRITE, 0, - nullptr); - if (FAILED(hr)) { - LOG(ERROR) << "Failed to map texture for write. hr = " << std::hex << hr; - return false; - } - - const uint8_t* source_memory = - static_cast<const uint8_t*>(pixmaps[0].addr()); - const size_t source_stride = pixmaps[0].rowBytes(); - device3->WriteToSubresource(d3d11_texture_.Get(), 0, nullptr, source_memory, - source_stride, 0); - device_context->Unmap(d3d11_texture_.Get(), 0); - } else { - ID3D11Texture2D* staging_texture = GetOrCreateStagingTexture(); - if (!staging_texture) { - return false; - } - D3D11_MAPPED_SUBRESOURCE mapped_resource = {}; - HRESULT hr = device_context->Map(staging_texture, 0, D3D11_MAP_WRITE, 0, - &mapped_resource); - if (FAILED(hr)) { - LOG(ERROR) << "Failed to map texture for write. hr=" << std::hex << hr; - return false; - } - - // The mapped staging texture pData points to the first plane's data so an - // offset is needed for subsequent planes. - size_t dest_offset = 0; - - for (int plane = 0; plane < format().NumberOfPlanes(); ++plane) { - auto& pixmap = pixmaps[plane]; - const uint8_t* source_memory = static_cast<const uint8_t*>(pixmap.addr()); - const size_t source_stride = pixmap.rowBytes(); - - uint8_t* dest_memory = - static_cast<uint8_t*>(mapped_resource.pData) + dest_offset; - const size_t dest_stride = mapped_resource.RowPitch; - - gfx::Size plane_size = format().GetPlaneSize(plane, size()); - CopyPlane(source_memory, source_stride, dest_memory, dest_stride, - pixmap.info().minRowBytes(), plane_size); - - dest_offset += mapped_resource.RowPitch * plane_size.height(); - } - - device_context->Unmap(staging_texture, 0); - device_context->CopyResource(d3d11_texture_.Get(), staging_texture); + D3D11_MAPPED_SUBRESOURCE mapped_resource = {}; + HRESULT hr = device_context->Map(staging_texture, 0, D3D11_MAP_WRITE, 0, + &mapped_resource); + if (FAILED(hr)) { + LOG(ERROR) << "Failed to map texture for write. hr=" << std::hex << hr; + return false; } + + // The mapped staging texture pData points to the first plane's data so an + // offset is needed for subsequent planes. + size_t dest_offset = 0; + + for (int plane = 0; plane < format().NumberOfPlanes(); ++plane) { + auto& pixmap = pixmaps[plane]; + const uint8_t* source_memory = static_cast<const uint8_t*>(pixmap.addr()); + const size_t source_stride = pixmap.rowBytes(); + + uint8_t* dest_memory = + static_cast<uint8_t*>(mapped_resource.pData) + dest_offset; + const size_t dest_stride = mapped_resource.RowPitch; + + gfx::Size plane_size = format().GetPlaneSize(plane, size()); + CopyPlane(source_memory, source_stride, dest_memory, dest_stride, + pixmap.info().minRowBytes(), plane_size); + + dest_offset += mapped_resource.RowPitch * plane_size.height(); + } + + device_context->Unmap(staging_texture, 0); + device_context->CopyResource(d3d11_texture_.Get(), staging_texture); return true; } bool D3DImageBacking::ReadbackToMemory(const std::vector<SkPixmap>& pixmaps) { + DCHECK_EQ(pixmaps.size(), static_cast<size_t>(format().NumberOfPlanes())); + + ID3D11Texture2D* staging_texture = GetOrCreateStagingTexture(); + if (!staging_texture) { + return false; + } + CHECK(texture_d3d11_device_); Microsoft::WRL::ComPtr<ID3D11DeviceContext> device_context; texture_d3d11_device_->GetImmediateContext(&device_context); - if (d3d11_texture_desc_.CPUAccessFlags & D3D11_CPU_ACCESS_READ) { - // D3D doesn't support mappable+default YUV textures. - DCHECK(format().is_single_plane()); + device_context->CopyResource(staging_texture, d3d11_texture_.Get()); - Microsoft::WRL::ComPtr<ID3D11Device3> device3; - HRESULT hr = texture_d3d11_device_.As(&device3); - if (FAILED(hr)) { - LOG(ERROR) << "Failed to retrieve ID3D11Device3. hr=" << std::hex << hr; - return false; - } - hr = device_context->Map(d3d11_texture_.Get(), 0, D3D11_MAP_READ, 0, - nullptr); - if (FAILED(hr)) { - LOG(ERROR) << "Failed to map texture for read. hr=" << std::hex << hr; - return false; - } - - uint8_t* dest_memory = static_cast<uint8_t*>(pixmaps[0].writable_addr()); - const size_t dest_stride = pixmaps[0].rowBytes(); - device3->ReadFromSubresource(dest_memory, dest_stride, 0, - d3d11_texture_.Get(), 0, nullptr); - device_context->Unmap(d3d11_texture_.Get(), 0); - } else { - ID3D11Texture2D* staging_texture = GetOrCreateStagingTexture(); - if (!staging_texture) { - return false; - } - device_context->CopyResource(staging_texture, d3d11_texture_.Get()); - D3D11_MAPPED_SUBRESOURCE mapped_resource = {}; - HRESULT hr = device_context->Map(staging_texture, 0, D3D11_MAP_READ, 0, - &mapped_resource); - if (FAILED(hr)) { - LOG(ERROR) << "Failed to map texture for read. hr=" << std::hex << hr; - return false; - } - - // The mapped staging texture pData points to the first plane's data so an - // offset is needed for subsequent planes. - size_t source_offset = 0; - - for (int plane = 0; plane < format().NumberOfPlanes(); ++plane) { - auto& pixmap = pixmaps[plane]; - uint8_t* dest_memory = static_cast<uint8_t*>(pixmap.writable_addr()); - const size_t dest_stride = pixmap.rowBytes(); - - const uint8_t* source_memory = - static_cast<uint8_t*>(mapped_resource.pData) + source_offset; - const size_t source_stride = mapped_resource.RowPitch; - - gfx::Size plane_size = format().GetPlaneSize(plane, size()); - CopyPlane(source_memory, source_stride, dest_memory, dest_stride, - pixmap.info().minRowBytes(), plane_size); - - source_offset += mapped_resource.RowPitch * plane_size.height(); - } - - device_context->Unmap(staging_texture, 0); + D3D11_MAPPED_SUBRESOURCE mapped_resource = {}; + HRESULT hr = device_context->Map(staging_texture, 0, D3D11_MAP_READ, 0, + &mapped_resource); + if (FAILED(hr)) { + LOG(ERROR) << "Failed to map texture for read. hr=" << std::hex << hr; + return false; } + + // The mapped staging texture pData points to the first plane's data so an + // offset is needed for subsequent planes. + size_t source_offset = 0; + + for (int plane = 0; plane < format().NumberOfPlanes(); ++plane) { + auto& pixmap = pixmaps[plane]; + uint8_t* dest_memory = static_cast<uint8_t*>(pixmap.writable_addr()); + const size_t dest_stride = pixmap.rowBytes(); + + const uint8_t* source_memory = + static_cast<uint8_t*>(mapped_resource.pData) + source_offset; + const size_t source_stride = mapped_resource.RowPitch; + + gfx::Size plane_size = format().GetPlaneSize(plane, size()); + CopyPlane(source_memory, source_stride, dest_memory, dest_stride, + pixmap.info().minRowBytes(), plane_size); + + source_offset += mapped_resource.RowPitch * plane_size.height(); + } + + device_context->Unmap(staging_texture, 0); return true; }
diff --git a/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc b/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc index 7db1f07b3..2724d0c 100644 --- a/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc +++ b/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc
@@ -334,10 +334,7 @@ DXGI_FORMAT dxgi_format = GetDXGIFormatForCreateTexture(format); DCHECK_NE(dxgi_format, DXGI_FORMAT_UNKNOWN); - // SHARED_IMAGE_USAGE_CPU_UPLOAD is set for shared memory GMBs. - const bool is_shm_gmb = usage & SHARED_IMAGE_USAGE_CPU_UPLOAD; - // GL_TEXTURE_2D is okay to use here as D3D11_BIND_RENDER_TARGET is being - // used. + // GL_TEXTURE_2D is ok to use here as D3D11_BIND_RENDER_TARGET is being used. const GLenum texture_target = GL_TEXTURE_2D; D3D11_TEXTURE2D_DESC desc; @@ -357,15 +354,13 @@ format.is_single_plane()) { DCHECK(usage & (SHARED_IMAGE_USAGE_WEBGPU_READ | SHARED_IMAGE_USAGE_WEBGPU_WRITE)); - // WebGPU can use RGBA_8888 and RGBA_16 for STORAGE_BINDING. - + // WebGPU can always use RGBA_8888 and RGBA_16 for STORAGE_BINDING. if (format == viz::SinglePlaneFormat::kRGBA_8888 || format == viz::SinglePlaneFormat::kRGBA_F16) { desc.BindFlags |= D3D11_BIND_UNORDERED_ACCESS; } - // WebGPU can use BGRA_8888 for STORAGE_BINDING when BGRA_8888 is - // supported as UAV. + // WebGPU can use BGRA_8888 for STORAGE_BINDING only when supported for UAV. if (format == viz::SinglePlaneFormat::kBGRA_8888) { if (SupportsBGRA8UnormStorage()) { desc.BindFlags |= D3D11_BIND_UNORDERED_ACCESS; @@ -376,10 +371,11 @@ } } } - // D3D doesn't support mappable+default shared resource or YUV textures. + const bool has_webgpu_usage = usage & (SHARED_IMAGE_USAGE_WEBGPU_READ | SHARED_IMAGE_USAGE_WEBGPU_WRITE); const bool has_gl_usage = HasGLES2ReadOrWriteUsage(usage); + // TODO(crbug.com/40204134): Look into using DXGI handle when MF VEA is used. const bool needs_shared_handle = has_webgpu_usage || (has_gl_usage && (d3d11_device_ != angle_d3d11_device_)); @@ -391,9 +387,6 @@ (gfx::D3DSharedFence::IsSupported(d3d11_device_.Get()) ? D3D11_RESOURCE_MISC_SHARED : D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX); - } else if (is_shm_gmb && format.is_single_plane() && - !format.IsLegacyMultiplanar() && UseMapOnDefaultTextures()) { - desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; } D3D11_SUBRESOURCE_DATA initial_data = {}; @@ -506,25 +499,6 @@ std::move(debug_label)); } -bool D3DImageBackingFactory::UseMapOnDefaultTextures() { - if (!map_on_default_textures_.has_value()) { - D3D11_FEATURE_DATA_D3D11_OPTIONS2 features; - HRESULT hr = d3d11_device_->CheckFeatureSupport( - D3D11_FEATURE_D3D11_OPTIONS2, &features, - sizeof(D3D11_FEATURE_DATA_D3D11_OPTIONS2)); - if (SUCCEEDED(hr)) { - map_on_default_textures_.emplace(features.MapOnDefaultTextures && - features.UnifiedMemoryArchitecture); - } else { - VLOG(1) << "Failed to retrieve D3D11_FEATURE_D3D11_OPTIONS2. hr = " - << std::hex << hr; - map_on_default_textures_.emplace(false); - } - VLOG(1) << "UseMapOnDefaultTextures = " << map_on_default_textures_.value(); - } - return map_on_default_textures_.value(); -} - bool D3DImageBackingFactory::SupportsBGRA8UnormStorage() { if (!supports_bgra8unorm_storage_.has_value()) { D3D11_FEATURE_DATA_FORMAT_SUPPORT bgra8UnormSupport = {};
diff --git a/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.h b/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.h index b7d746e7..aa35c6b 100644 --- a/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.h +++ b/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.h
@@ -152,13 +152,11 @@ SkAlphaType alpha_type, uint32_t usage, std::string debug_label); - bool UseMapOnDefaultTextures(); bool SupportsBGRA8UnormStorage(); // D3D11 device used for creating textures. This is also Skia's D3D11 device. // Can be different from |angle_d3d11_device_| when using Graphite. Microsoft::WRL::ComPtr<ID3D11Device> d3d11_device_; - std::optional<bool> map_on_default_textures_; std::optional<bool> supports_bgra8unorm_storage_; scoped_refptr<DXGISharedHandleManager> dxgi_shared_handle_manager_;
diff --git a/gpu/command_buffer/service/shared_image/dawn_ahardwarebuffer_image_representation.cc b/gpu/command_buffer/service/shared_image/dawn_ahardwarebuffer_image_representation.cc index 6772bb48..2e31033 100644 --- a/gpu/command_buffer/service/shared_image/dawn_ahardwarebuffer_image_representation.cc +++ b/gpu/command_buffer/service/shared_image/dawn_ahardwarebuffer_image_representation.cc
@@ -140,9 +140,9 @@ end_access_desc.nextInChain = &end_layout; if (!shared_texture_memory_.EndAccess(texture_, &end_access_desc)) { - // The only case in which this can happen is on device loss. - CHECK(shared_texture_memory_.IsDeviceLost()); - LOG(ERROR) << "Failed to end access for texture due to device loss"; + LOG(ERROR) << "Failed to end access for texture"; + texture_.Destroy(); + texture_ = nullptr; return; }
diff --git a/gpu/command_buffer/service/shared_image/egl_image_backing_factory_unittest.cc b/gpu/command_buffer/service/shared_image/egl_image_backing_factory_unittest.cc index 3d1fd4f3..7a260993 100644 --- a/gpu/command_buffer/service/shared_image/egl_image_backing_factory_unittest.cc +++ b/gpu/command_buffer/service/shared_image/egl_image_backing_factory_unittest.cc
@@ -785,7 +785,6 @@ CreateAndValidateSharedImageRepresentations:: ~CreateAndValidateSharedImageRepresentations() { shared_image_.reset(); - EXPECT_FALSE(mailbox_manager_->ConsumeTexture(mailbox_)); } // High bit depth rendering is not supported on Android.
diff --git a/gpu/vulkan/BUILD.gn b/gpu/vulkan/BUILD.gn index e8b516d70..ed5ef907 100644 --- a/gpu/vulkan/BUILD.gn +++ b/gpu/vulkan/BUILD.gn
@@ -219,10 +219,7 @@ if (is_android) { sources += [ "tests/native_window_android.cc" ] - deps += [ - "//ui/android:ui_java", - "//ui/gl", - ] + deps += [ "//ui/gl" ] } }
diff --git a/infra/config/generated/builder-owners/browser-automation-staff@google.com.txt b/infra/config/generated/builder-owners/browser-automation-staff@google.com.txt index 97e7f999..ed22a2d4 100644 --- a/infra/config/generated/builder-owners/browser-automation-staff@google.com.txt +++ b/infra/config/generated/builder-owners/browser-automation-staff@google.com.txt
@@ -1,4 +1,3 @@ -ci/linux-arm64-rel-cft ci/linux-rel-cft ci/mac-rel-cft ci/win-rel-cft \ No newline at end of file
diff --git a/infra/config/generated/builder-owners/chrome-dev-infra-team@google.com.txt b/infra/config/generated/builder-owners/chrome-dev-infra-team@google.com.txt index e9f42b70..d50d91c 100644 --- a/infra/config/generated/builder-owners/chrome-dev-infra-team@google.com.txt +++ b/infra/config/generated/builder-owners/chrome-dev-infra-team@google.com.txt
@@ -1,2 +1,3 @@ ci/linux-chromeos-dbg-oslogin -try/linux-chromeos-dbg-oslogin \ No newline at end of file +try/linux-chromeos-dbg-oslogin +try/linux-utr-tester \ No newline at end of file
diff --git a/infra/config/generated/builder-owners/~unowned.txt b/infra/config/generated/builder-owners/~unowned.txt index d1e3233..9e73e08 100644 --- a/infra/config/generated/builder-owners/~unowned.txt +++ b/infra/config/generated/builder-owners/~unowned.txt
@@ -325,7 +325,6 @@ try/linux-afl-asan-rel try/linux-angle-chromium-try try/linux-annotator-rel -try/linux-arm64-rel-cft try/linux-asan-dbg try/linux-asan-media-rel try/linux-asan-media-v8-arm-rel
diff --git a/infra/config/generated/builders/ci/linux-arm64-rel-cft/gn-args.json b/infra/config/generated/builders/ci/linux-arm64-rel-cft/gn-args.json deleted file mode 100644 index 49f45530..0000000 --- a/infra/config/generated/builders/ci/linux-arm64-rel-cft/gn-args.json +++ /dev/null
@@ -1,14 +0,0 @@ -{ - "gn_args": { - "dcheck_always_on": false, - "ffmpeg_branding": "Chrome", - "is_chrome_for_testing": true, - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "symbol_level": 1, - "target_cpu": "arm64", - "use_remoteexec": true, - "use_siso": true - } -} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-arm64-rel-cft/properties.json b/infra/config/generated/builders/ci/linux-arm64-rel-cft/properties.json deleted file mode 100644 index 481e6aa7..0000000 --- a/infra/config/generated/builders/ci/linux-arm64-rel-cft/properties.json +++ /dev/null
@@ -1,81 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "additional_exclusions": [ - "infra/config/generated/builders/ci/linux-arm64-rel-cft/gn-args.json" - ], - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "ci", - "builder": "linux-arm64-rel-cft", - "project": "chromium" - }, - "builder_spec": { - "builder_group": "chromium.cft", - "execution_mode": "COMPILE_AND_TEST", - "legacy_chromium_config": { - "apply_configs": [ - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_arch": "arm", - "target_bits": 64, - "target_platform": "linux" - }, - "legacy_gclient_config": { - "apply_configs": [ - "arm64" - ], - "config": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "ci", - "builder": "linux-arm64-rel-cft", - "project": "chromium" - } - ], - "mirroring_builder_group_and_names": [ - { - "builder": "linux-arm64-rel-cft", - "group": "tryserver.chromium.cft" - } - ] - } - }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "jobs": 500, - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, - "$build/siso": { - "configs": [ - "builder" - ], - "enable_cloud_profiler": true, - "enable_cloud_trace": true, - "experiments": [], - "project": "rbe-chromium-trusted", - "remote_jobs": 500 - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "chromium.cft", - "recipe": "chromium", - "sheriff_rotations": [ - "cft" - ] -} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-arm64-rel-cft/shadow-properties.json b/infra/config/generated/builders/ci/linux-arm64-rel-cft/shadow-properties.json deleted file mode 100644 index a3e8654..0000000 --- a/infra/config/generated/builders/ci/linux-arm64-rel-cft/shadow-properties.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "jobs": 500, - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, - "$build/siso": { - "configs": [ - "builder" - ], - "enable_cloud_profiler": true, - "enable_cloud_trace": true, - "experiments": [], - "project": "rbe-chromium-untrusted", - "remote_jobs": 500 - } -} \ No newline at end of file
diff --git a/infra/config/generated/builders/gn_args_locations.json b/infra/config/generated/builders/gn_args_locations.json index 492ba322..f8d50af 100644 --- a/infra/config/generated/builders/gn_args_locations.json +++ b/infra/config/generated/builders/gn_args_locations.json
@@ -108,7 +108,6 @@ "Mac Builder Siso FYI": "build/Mac Builder Siso FYI/gn-args.json" }, "chromium.cft": { - "linux-arm64-rel-cft": "ci/linux-arm64-rel-cft/gn-args.json", "linux-rel-cft": "ci/linux-rel-cft/gn-args.json", "mac-rel-cft": "ci/mac-rel-cft/gn-args.json", "win-rel-cft": "ci/win-rel-cft/gn-args.json" @@ -638,7 +637,6 @@ "win-angle-chromium-x86-try": "try/win-angle-chromium-x86-try/gn-args.json" }, "tryserver.chromium.cft": { - "linux-arm64-rel-cft": "try/linux-arm64-rel-cft/gn-args.json", "linux-rel-cft": "try/linux-rel-cft/gn-args.json", "mac-rel-cft": "try/mac-rel-cft/gn-args.json", "win-rel-cft": "try/win-rel-cft/gn-args.json"
diff --git a/infra/config/generated/builders/try/linux-arm64-rel-cft/gn-args.json b/infra/config/generated/builders/try/linux-arm64-rel-cft/gn-args.json deleted file mode 100644 index e6fb863..0000000 --- a/infra/config/generated/builders/try/linux-arm64-rel-cft/gn-args.json +++ /dev/null
@@ -1,12 +0,0 @@ -{ - "gn_args": { - "dcheck_always_on": true, - "is_chrome_for_testing": true, - "is_component_build": false, - "is_debug": false, - "symbol_level": 0, - "target_cpu": "arm64", - "use_remoteexec": true, - "use_siso": true - } -} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux-arm64-rel-cft/properties.json b/infra/config/generated/builders/try/linux-arm64-rel-cft/properties.json deleted file mode 100644 index d65740c..0000000 --- a/infra/config/generated/builders/try/linux-arm64-rel-cft/properties.json +++ /dev/null
@@ -1,71 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "additional_exclusions": [ - "infra/config/generated/builders/try/linux-arm64-rel-cft/gn-args.json" - ], - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "ci", - "builder": "linux-arm64-rel-cft", - "project": "chromium" - }, - "builder_spec": { - "builder_group": "chromium.cft", - "execution_mode": "COMPILE_AND_TEST", - "legacy_chromium_config": { - "apply_configs": [ - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_arch": "arm", - "target_bits": 64, - "target_platform": "linux" - }, - "legacy_gclient_config": { - "apply_configs": [ - "arm64" - ], - "config": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "ci", - "builder": "linux-arm64-rel-cft", - "project": "chromium" - } - ] - } - }, - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "jobs": 150, - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, - "$build/siso": { - "configs": [ - "builder" - ], - "enable_cloud_profiler": true, - "enable_cloud_trace": true, - "experiments": [], - "project": "rbe-chromium-untrusted" - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "tryserver.chromium.cft", - "recipe": "chromium_trybot" -} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/win-arm64-compile-dbg/gn-args.json b/infra/config/generated/builders/try/win-arm64-compile-dbg/gn-args.json index d2aca09..f2a139f5 100644 --- a/infra/config/generated/builders/try/win-arm64-compile-dbg/gn-args.json +++ b/infra/config/generated/builders/try/win-arm64-compile-dbg/gn-args.json
@@ -4,7 +4,7 @@ "is_component_build": true, "is_debug": true, "proprietary_codecs": true, - "symbol_level": 1, + "symbol_level": 0, "target_cpu": "arm64", "use_remoteexec": true, "use_siso": true
diff --git a/infra/config/generated/health-specs/health-specs.json b/infra/config/generated/health-specs/health-specs.json index 591eb61..083c7d3 100644 --- a/infra/config/generated/health-specs/health-specs.json +++ b/infra/config/generated/health-specs/health-specs.json
@@ -9502,27 +9502,6 @@ } ] }, - "linux-arm64-rel-cft": { - "contact_team_email": "browser-automation-staff@google.com", - "problem_specs": [ - { - "name": "Unhealthy", - "period_days": 7, - "score": 5, - "thresholds": { - "_default": "_default" - } - }, - { - "name": "Low Value", - "period_days": 90, - "score": 1, - "thresholds": { - "_default": "_default" - } - } - ] - }, "linux-ash-chromium-generator-rel": { "problem_specs": [ {
diff --git a/infra/config/generated/luci/commit-queue.cfg b/infra/config/generated/luci/commit-queue.cfg index 8327c46..a790ebd 100644 --- a/infra/config/generated/luci/commit-queue.cfg +++ b/infra/config/generated/luci/commit-queue.cfg
@@ -3217,10 +3217,6 @@ includable_only: true } builders { - name: "chromium/try/linux-arm64-rel-cft" - includable_only: true - } - builders { name: "chromium/try/linux-asan-dbg" includable_only: true } @@ -3822,6 +3818,10 @@ mode_allowlist: "FULL_RUN" } builders { + name: "chromium/try/linux-utr-tester" + includable_only: true + } + builders { name: "chromium/try/linux-v4l2-codec-rel" location_filters { gerrit_host_regexp: ".*"
diff --git a/infra/config/generated/luci/cr-buildbucket.cfg b/infra/config/generated/luci/cr-buildbucket.cfg index 1423a147..a333831 100644 --- a/infra/config/generated/luci/cr-buildbucket.cfg +++ b/infra/config/generated/luci/cr-buildbucket.cfg
@@ -44660,102 +44660,6 @@ contact_team_email: "cast-eng@google.com" } builders { - name: "linux-arm64-rel-cft" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "free_space:standard" - dimensions: "os:Ubuntu-22.04" - dimensions: "pool:luci.chromium.ci" - dimensions: "ssd:0" - exe { - cipd_package: "infra/chromium/bootstrapper/${platform}" - cipd_version: "latest" - cmd: "bootstrapper" - } - properties: - '{' - ' "$bootstrap/exe": {' - ' "exe": {' - ' "cipd_package": "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",' - ' "cipd_version": "refs/heads/main",' - ' "cmd": [' - ' "luciexe"' - ' ]' - ' }' - ' },' - ' "$bootstrap/properties": {' - ' "properties_file": "infra/config/generated/builders/ci/linux-arm64-rel-cft/properties.json",' - ' "shadow_properties_file": "infra/config/generated/builders/ci/linux-arm64-rel-cft/shadow-properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "chromium.cft",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium",' - ' "sheriff_rotations": [' - ' "cft"' - ' ]' - '}' - execution_timeout_secs: 10800 - build_numbers: YES - service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" - experiments { - key: "chromium_swarming.expose_merge_script_failures" - value: 100 - } - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "ci_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_ci_test_results" - test_results { - predicate { - test_id_regexp: "ninja://(chrome|content)/test:telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_ci_test_results" - test_results { - predicate { - test_id_regexp: "(ninja://[^/]*blink_web_tests/.+)|(ninja://[^/]*_wpt_tests/.+)" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - description_html: "This builder is mirrored by any of the following try builders:<br/><ul><li><a href=\"https://ci.chromium.org/p/chromium/builders/try/linux-arm64-rel-cft\">linux-arm64-rel-cft</a></li></ul>" - shadow_builder_adjustments { - service_account: "chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com" - pool: "luci.chromium.try" - dimensions: "free_space:" - dimensions: "pool:luci.chromium.try" - } - contact_team_email: "browser-automation-staff@google.com" - } - builders { name: "linux-ash-chromium-generator-rel" swarming_host: "chromium-swarm.appspot.com" dimensions: "builderless:1" @@ -86695,101 +86599,6 @@ contact_team_email: "cast-eng@google.com" } builders { - name: "linux-arm64-rel-cft" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-22.04" - dimensions: "pool:luci.chromium.try" - dimensions: "ssd:0" - exe { - cipd_package: "infra/chromium/bootstrapper/${platform}" - cipd_version: "latest" - cmd: "bootstrapper" - } - properties: - '{' - ' "$bootstrap/exe": {' - ' "exe": {' - ' "cipd_package": "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",' - ' "cipd_version": "refs/heads/main",' - ' "cmd": [' - ' "luciexe"' - ' ]' - ' }' - ' },' - ' "$bootstrap/properties": {' - ' "properties_file": "infra/config/generated/builders/try/linux-arm64-rel-cft/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "tryserver.chromium.cft",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium_trybot"' - '}' - execution_timeout_secs: 14400 - expiration_secs: 7200 - grace_period { - seconds: 120 - } - build_numbers: YES - service_account: "chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com" - task_template_canary_percentage { - value: 5 - } - experiments { - key: "chromium_swarming.expose_merge_script_failures" - value: 100 - } - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - experiments { - key: "swarming.prpc.cli" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "try_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_try_test_results" - test_results { - predicate { - test_id_regexp: "ninja://(chrome|content)/test:telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_try_test_results" - test_results { - predicate { - test_id_regexp: "(ninja://[^/]*blink_web_tests/.+)|(ninja://[^/]*_wpt_tests/.+)" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - description_html: "This builder mirrors the following CI builders:<br/><ul><li><a href=\"https://ci.chromium.org/p/chromium/builders/ci/linux-arm64-rel-cft\">linux-arm64-rel-cft</a></li></ul>" - } - builders { name: "linux-asan-dbg" swarming_host: "chromium-swarm.appspot.com" dimensions: "builderless:1" @@ -93396,6 +93205,99 @@ description_html: "This builder mirrors the following CI builders:<br/><ul><li><a href=\"https://ci.chromium.org/p/chromium/builders/ci/linux-updater-builder-rel\">linux-updater-builder-rel</a></li><li><a href=\"https://ci.chromium.org/p/chromium/builders/ci/linux-updater-tester-rel\">linux-updater-tester-rel</a></li></ul>" } builders { + name: "linux-utr-tester" + swarming_host: "chromium-swarm.appspot.com" + dimensions: "builderless:1" + dimensions: "cores:8" + dimensions: "cpu:x86-64" + dimensions: "os:Ubuntu-22.04" + dimensions: "pool:luci.chromium.try" + dimensions: "ssd:0" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" + cipd_version: "refs/heads/main" + cmd: "luciexe" + } + properties: + '{' + ' "$recipe_engine/resultdb/test_presentation": {' + ' "column_keys": [],' + ' "grouping_keys": [' + ' "status",' + ' "v.test_suite"' + ' ]' + ' },' + ' "builder_group": "tryserver.chromium.infra",' + ' "builder_suites": [' + ' {' + ' "bucket": "try",' + ' "build_dir": "out/linux-rel",' + ' "builder_name": "linux-rel",' + ' "test_names": [' + ' "url_unittests"' + ' ]' + ' }' + ' ],' + ' "recipe": "chromium/universal_test_runner_test"' + '}' + execution_timeout_secs: 7200 + expiration_secs: 7200 + grace_period { + seconds: 120 + } + build_numbers: YES + service_account: "chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com" + task_template_canary_percentage { + value: 5 + } + experiments { + key: "chromium_swarming.expose_merge_script_failures" + value: 100 + } + experiments { + key: "luci.recipes.use_python3" + value: 100 + } + experiments { + key: "swarming.prpc.cli" + value: 100 + } + resultdb { + enable: true + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "try_test_results" + test_results {} + } + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "gpu_try_test_results" + test_results { + predicate { + test_id_regexp: "ninja://(chrome|content)/test:telemetry_gpu_integration_test[^/]*/.+" + } + } + } + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "blink_web_tests_try_test_results" + test_results { + predicate { + test_id_regexp: "(ninja://[^/]*blink_web_tests/.+)|(ninja://[^/]*_wpt_tests/.+)" + } + } + } + history_options { + use_invocation_timestamp: true + } + } + description_html: "Tests the <a href=\"https://chromium.googlesource.com/chromium/src/+/HEAD/tools/utr/README.md\">Universal Test Runner</a> against cli changes." + contact_team_email: "chrome-dev-infra-team@google.com" + } + builders { name: "linux-v4l2-codec-rel" swarming_host: "chromium-swarm.appspot.com" dimensions: "builderless:1"
diff --git a/infra/config/generated/luci/luci-milo.cfg b/infra/config/generated/luci/luci-milo.cfg index 0733eae..f56bc286 100644 --- a/infra/config/generated/luci/luci-milo.cfg +++ b/infra/config/generated/luci/luci-milo.cfg
@@ -6422,10 +6422,6 @@ refs: "regexp:refs/heads/main" manifest_name: "REVISION" builders { - name: "buildbucket/luci.chromium.ci/linux-arm64-rel-cft" - short_name: "linux-arm64-rel-cft" - } - builders { name: "buildbucket/luci.chromium.ci/linux-rel-cft" short_name: "linux-rel-cft" } @@ -17012,9 +17008,6 @@ name: "buildbucket/luci.chromium.try/linux-arm64-cast-rel" } builders { - name: "buildbucket/luci.chromium.try/linux-arm64-rel-cft" - } - builders { name: "buildbucket/luci.chromium.try/linux-asan-dbg" } builders { @@ -17222,6 +17215,9 @@ name: "buildbucket/luci.chromium.try/linux-updater-try-builder-rel" } builders { + name: "buildbucket/luci.chromium.try/linux-utr-tester" + } + builders { name: "buildbucket/luci.chromium.try/linux-v4l2-codec-rel" } builders { @@ -18062,9 +18058,6 @@ id: "tryserver.chromium.cft" name: "tryserver.chromium.cft" builders { - name: "buildbucket/luci.chromium.try/linux-arm64-rel-cft" - } - builders { name: "buildbucket/luci.chromium.try/linux-rel-cft" } builders { @@ -18428,6 +18421,9 @@ name: "buildbucket/luci.chromium.try/3pp-windows-amd64-packager" } builders { + name: "buildbucket/luci.chromium.try/linux-utr-tester" + } + builders { name: "buildbucket/luci.chromium.try/mega-cq-launcher" } builder_view_only: true
diff --git a/infra/config/generated/luci/luci-scheduler.cfg b/infra/config/generated/luci/luci-scheduler.cfg index 6d8548dc..c070f0ab0 100644 --- a/infra/config/generated/luci/luci-scheduler.cfg +++ b/infra/config/generated/luci/luci-scheduler.cfg
@@ -4723,15 +4723,6 @@ } } job { - id: "linux-arm64-rel-cft" - realm: "ci" - buildbucket { - server: "cr-buildbucket.appspot.com" - bucket: "ci" - builder: "linux-arm64-rel-cft" - } -} -job { id: "linux-ash-chromium-generator-rel" realm: "ci" schedule: "triggered" @@ -6657,7 +6648,6 @@ triggers: "linux-annotator-rel" triggers: "linux-archive-rel" triggers: "linux-arm64-cast-rel" - triggers: "linux-arm64-rel-cft" triggers: "linux-bfcache-rel" triggers: "linux-blink-heap-verification" triggers: "linux-blink-web-tests-force-accessibility-rel"
diff --git a/infra/config/generated/luci/realms.cfg b/infra/config/generated/luci/realms.cfg index b8df4bf..b2c50af 100644 --- a/infra/config/generated/luci/realms.cfg +++ b/infra/config/generated/luci/realms.cfg
@@ -672,6 +672,7 @@ principals: "group:mdb/chrome-build-access-sphinx" principals: "group:mdb/chrome-troopers" principals: "user:chromium-orchestrator@chops-service-accounts.iam.gserviceaccount.com" + principals: "user:chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com" principals: "user:infra-try-recipes-tester@chops-service-accounts.iam.gserviceaccount.com" } bindings { @@ -679,6 +680,10 @@ principals: "group:all" } bindings { + role: "role/buildbucket.triggerer" + principals: "user:chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com" + } + bindings { role: "role/resultdb.invocationCreator" principals: "group:project-chromium-try-task-accounts" principals: "group:project-chromium-tryjob-access"
diff --git a/infra/config/generated/sheriff-rotations/cft.txt b/infra/config/generated/sheriff-rotations/cft.txt index b2b2714a..19b7311 100644 --- a/infra/config/generated/sheriff-rotations/cft.txt +++ b/infra/config/generated/sheriff-rotations/cft.txt
@@ -1,4 +1,3 @@ -ci/linux-arm64-rel-cft ci/linux-rel-cft ci/mac-rel-cft ci/win-rel-cft
diff --git a/infra/config/generated/testing/variants.pyl b/infra/config/generated/testing/variants.pyl index b46f6a4..1f723d4 100644 --- a/infra/config/generated/testing/variants.pyl +++ b/infra/config/generated/testing/variants.pyl
@@ -267,16 +267,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 126.0.6438.0', + 'description': 'Run with ash-chrome version 126.0.6439.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6438.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v126.0.6438.0', - 'revision': 'version:126.0.6438.0', + 'location': 'lacros_version_skew_tests_v126.0.6439.0', + 'revision': 'version:126.0.6439.0', }, ], }, @@ -299,16 +299,16 @@ }, 'LACROS_VERSION_SKEW_STABLE': { 'identifier': 'Lacros version skew testing ash stable', - 'description': 'Run with ash-chrome version 123.0.6312.132', + 'description': 'Run with ash-chrome version 123.0.6312.134', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.132/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v123.0.6312.132', - 'revision': 'version:123.0.6312.132', + 'location': 'lacros_version_skew_tests_v123.0.6312.134', + 'revision': 'version:123.0.6312.134', }, ], },
diff --git a/infra/config/groups/sheriff-rotations/CFT_OWNERS b/infra/config/groups/sheriff-rotations/CFT_OWNERS index 6862957..8d60937 100644 --- a/infra/config/groups/sheriff-rotations/CFT_OWNERS +++ b/infra/config/groups/sheriff-rotations/CFT_OWNERS
@@ -1,7 +1,7 @@ # @chromium.org email addresses: mathias@chromium.org -tperrotta@chromium.org +kvitekp@chromium.org # @google.com email addresses: mths@google.com -tperrotta@google.com +kvitekp@google.com
diff --git a/infra/config/recipes.star b/infra/config/recipes.star index dc83023a..336550ef 100644 --- a/infra/config/recipes.star +++ b/infra/config/recipes.star
@@ -209,6 +209,10 @@ ) build_recipe( + name = "recipe:chromium/universal_test_runner_test", +) + +build_recipe( name = "recipe:chromium_clang_coverage_tot", )
diff --git a/infra/config/subprojects/chromium/ci/chromium.cft.star b/infra/config/subprojects/chromium/ci/chromium.cft.star index 29f3d095..7f4d971 100644 --- a/infra/config/subprojects/chromium/ci/chromium.cft.star +++ b/infra/config/subprojects/chromium/ci/chromium.cft.star
@@ -72,30 +72,6 @@ ) ci.builder( - name = "linux-arm64-rel-cft", - builder_spec = builder_spec( - build_config = builder_config.build_config.RELEASE, - target_platform = builder_config.target_platform.LINUX, - is_arm64 = True, - ), - gn_args = gn_args.config( - configs = [ - "release_builder", - "reclient", - "minimal_symbols", - "chrome_for_testing", - "chrome_with_codecs", - "arm64", - ], - ), - os = os.LINUX_DEFAULT, - console_view_entry = consoles.console_view_entry( - short_name = "linux-arm64-rel-cft", - ), - contact_team_email = "browser-automation-staff@google.com", -) - -ci.builder( name = "linux-rel-cft", builder_spec = builder_spec( build_config = builder_config.build_config.RELEASE,
diff --git a/infra/config/subprojects/chromium/try.star b/infra/config/subprojects/chromium/try.star index 90816dbd..1327d29 100644 --- a/infra/config/subprojects/chromium/try.star +++ b/infra/config/subprojects/chromium/try.star
@@ -76,9 +76,16 @@ ], users = [ "chromium-orchestrator@chops-service-accounts.iam.gserviceaccount.com", + "chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com", "infra-try-recipes-tester@chops-service-accounts.iam.gserviceaccount.com", ], ), + luci.binding( + roles = "role/buildbucket.triggerer", + users = [ + "chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com", + ], + ), # TODO(crbug.com/1501383): Remove this binding after shadow bucket # could inherit the view permission from the actual bucket. luci.binding(
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.cft.star b/infra/config/subprojects/chromium/try/tryserver.chromium.cft.star index 94862562..ad68bd44 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.cft.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.cft.star
@@ -26,23 +26,6 @@ ) try_.builder( - name = "linux-arm64-rel-cft", - mirrors = [ - "ci/linux-arm64-rel-cft", - ], - gn_args = gn_args.config( - configs = [ - "release_try_builder", - "reclient", - "no_symbols", - "chrome_for_testing", - "arm64", - ], - ), - os = os.LINUX_DEFAULT, -) - -try_.builder( name = "linux-rel-cft", mirrors = [ "ci/linux-rel-cft",
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.infra.star b/infra/config/subprojects/chromium/try/tryserver.chromium.infra.star index 95aa6e9..408d389 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.infra.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.infra.star
@@ -99,3 +99,25 @@ custom_cq_run_modes = [try_.MEGA_CQ_DRY_RUN_NAME, try_.MEGA_CQ_FULL_RUN_NAME], ), ) + +try_.builder( + name = "linux-utr-tester", + description_html = "Tests the <a href=\"https://chromium.googlesource.com/chromium/src/+/HEAD/tools/utr/README.md\">Universal Test Runner</a> against cli changes.", + executable = "recipe:chromium/universal_test_runner_test", + builderless = True, + cores = 8, + os = os.LINUX_DEFAULT, + contact_team_email = "chrome-dev-infra-team@google.com", + execution_timeout = 2 * time.hour, + properties = { + "builder_suites": [{ + "bucket": "try", + "builder_name": "linux-rel", + "test_names": [ + "url_unittests", + ], + "build_dir": "out/linux-rel", + }], + }, + service_account = try_.DEFAULT_SERVICE_ACCOUNT, +)
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.win.star b/infra/config/subprojects/chromium/try/tryserver.chromium.win.star index 3738830..dac8767 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.win.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.win.star
@@ -390,6 +390,7 @@ gn_args = gn_args.config( configs = [ "ci/win-arm64-dbg", + "no_symbols", ], ), builderless = False,
diff --git a/infra/config/targets/lacros-version-skew-variants.json b/infra/config/targets/lacros-version-skew-variants.json index 86e5165..cc5c102a 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_v126.0.6438.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.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_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ] } @@ -49,16 +49,16 @@ }, "LACROS_VERSION_SKEW_STABLE": { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.132/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "identifier": "Lacros version skew testing ash stable", "swarming": { "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ] }
diff --git a/internal b/internal index 6015cc8..86024ec 160000 --- a/internal +++ b/internal
@@ -1 +1 @@ -Subproject commit 6015cc82ed055a33d04a0ebc3febc8038288f114 +Subproject commit 86024ec8f24dadbe2937c11b92d6e0acd82d4b4c
diff --git a/ios/chrome/browser/autofill/model/form_structure_browsertest.mm b/ios/chrome/browser/autofill/model/form_structure_browsertest.mm index 3073dca..4e7d43a 100644 --- a/ios/chrome/browser/autofill/model/form_structure_browsertest.mm +++ b/ios/chrome/browser/autofill/model/form_structure_browsertest.mm
@@ -226,10 +226,6 @@ // TODO(crbug.com/40222716): Remove once launched. This feature is // disabled since it is not supported on iOS. features::kAutofillAlwaysParsePlaceholders, - // TODO(crbug.com/40285735): Remove when/if launched. This feature - // changes default parsing behavior, so must be disabled to avoid - // fieldtrial_testing_config interference. - features::kAutofillEnableEmailHeuristicOnlyAddressForms, }); }
diff --git a/ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory.h b/ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory.h index b0c3ffd..f6cea88 100644 --- a/ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory.h +++ b/ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory.h
@@ -45,7 +45,7 @@ bool ServiceIsCreatedWithBrowserState() const override; bool ServiceIsNULLWhileTesting() const override; - static std::optional<std::string> GetStoredPermanentCountry(); + static std::optional<std::string> GetCountry(); }; // Used only for tests. By default, the OHTTP key service is null for tests,
diff --git a/ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory.mm b/ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory.mm index a7a3917c..d6b1570 100644 --- a/ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory.mm +++ b/ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory.mm
@@ -50,7 +50,8 @@ return std::make_unique<safe_browsing::OhttpKeyService>( network::SharedURLLoaderFactory::Create(std::move(url_loader_factory)), chrome_browser_state->GetPrefs(), - base::BindRepeating(&OhttpKeyServiceFactory::GetStoredPermanentCountry)); + GetApplicationContext()->GetLocalState(), + base::BindRepeating(&OhttpKeyServiceFactory::GetCountry)); } bool OhttpKeyServiceFactory::ServiceIsCreatedWithBrowserState() const { @@ -70,7 +71,7 @@ } // static -std::optional<std::string> OhttpKeyServiceFactory::GetStoredPermanentCountry() { +std::optional<std::string> OhttpKeyServiceFactory::GetCountry() { return safe_browsing::hash_realtime_utils::GetCountryCode( GetApplicationContext()->GetVariationsService()); }
diff --git a/ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory_unittest.mm b/ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory_unittest.mm index 055df40b..c86fb3bb 100644 --- a/ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory_unittest.mm +++ b/ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory_unittest.mm
@@ -5,6 +5,7 @@ #import "ios/chrome/browser/safe_browsing/model/ohttp_key_service_factory.h" #import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h" +#import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" #import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" @@ -13,6 +14,7 @@ OhttpKeyServiceFactoryTest() = default; web::WebTaskEnvironment task_environment_; + IOSChromeScopedTestingLocalState scoped_testing_local_state_; std::unique_ptr<ChromeBrowserState> browser_state_; private:
diff --git a/ios/components/security_interstitials/safe_browsing/safe_browsing_service_impl.mm b/ios/components/security_interstitials/safe_browsing/safe_browsing_service_impl.mm index b4ba675..1f10147 100644 --- a/ios/components/security_interstitials/safe_browsing/safe_browsing_service_impl.mm +++ b/ios/components/security_interstitials/safe_browsing/safe_browsing_service_impl.mm
@@ -167,8 +167,6 @@ pref_change_registrar_->prefs(), safe_browsing::hash_realtime_utils::GetCountryCode( client->GetVariationsService()), - safe_browsing::hash_realtime_utils::GetLatestCountryCode( - client->GetVariationsService()), /*log_usage_histograms=*/true); return std::make_unique<safe_browsing::SafeBrowsingUrlCheckerImpl>( @@ -213,8 +211,6 @@ pref_change_registrar_->prefs(), safe_browsing::hash_realtime_utils::GetCountryCode( client->GetVariationsService()), - safe_browsing::hash_realtime_utils::GetLatestCountryCode( - client->GetVariationsService()), /*log_usage_histograms=*/true); return std::make_unique<safe_browsing::SafeBrowsingUrlCheckerImpl>(
diff --git a/ios_internal b/ios_internal index 41b4928..6fcbad3 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit 41b4928328ee54a1c5d0942b67c3b0e61cbfa803 +Subproject commit 6fcbad302d63b7780d0873442c45b64f3605518e
diff --git a/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.cc b/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.cc index c088df0..a1ceea42 100644 --- a/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.cc +++ b/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.cc
@@ -35,7 +35,7 @@ // The |video_frame| will be released here and it will be returned to pool if // client uses video frame pool. // Destructing ScopedVAImage releases its owned memory. - DCHECK(va_image->IsValid()); + DCHECK(va_image); } scoped_refptr<VideoFrame> CreateMappedVideoFrame( @@ -198,7 +198,7 @@ : kImageFormatP010; auto va_image = vaapi_wrapper_->CreateVaImage( va_surface->id(), &va_image_format, va_surface->size()); - if (!va_image || !va_image->IsValid()) { + if (!va_image) { VLOGF(1) << "Failed in CreateVaImage."; return nullptr; }
diff --git a/media/gpu/vaapi/vaapi_image_decode_accelerator_worker.cc b/media/gpu/vaapi/vaapi_image_decode_accelerator_worker.cc index bbec69e4..7b0480c 100644 --- a/media/gpu/vaapi/vaapi_image_decode_accelerator_worker.cc +++ b/media/gpu/vaapi/vaapi_image_decode_accelerator_worker.cc
@@ -42,21 +42,117 @@ return memcmp("\xFF\xD8\xFF", encoded_data.data(), 3u) == 0; } -// Uses |decoder| to decode the image corresponding to |encoded_data|. -// |decode_cb| is called when finished or when an error is encountered. We don't -// support decoding to scale, so |output_size| is only used for tracing. -void DecodeTask( - VaapiImageDecoder* decoder, +} // namespace + +VaapiImageDecoder* VaapiImageDecodeAcceleratorWorker::GetInitializedDecoder( + const std::vector<uint8_t>& encoded_data) { + DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_sequence_checker_); + // TODO(crbug.com/988123): revisit the + // Media.VaapiImageDecodeAcceleratorWorker.VAAPIError UMA to be able to record + // WebP and JPEG failures separately. + const auto uma_cb = + base::BindRepeating(&ReportVaapiErrorToUMA, + "Media.VaapiImageDecodeAcceleratorWorker.VAAPIError"); + if (IsJpegImage(encoded_data) && + base::Contains(decoders_, gpu::ImageDecodeAcceleratorType::kJpeg)) { + CHECK(base::FeatureList::IsEnabled( + features::kVaapiJpegImageDecodeAcceleration)); + if (!decoders_[gpu::ImageDecodeAcceleratorType::kJpeg]->Initialize( + uma_cb)) { + return nullptr; + } + return decoders_[gpu::ImageDecodeAcceleratorType::kJpeg].get(); + } else if (IsLossyWebPImage(encoded_data) && + base::Contains(decoders_, + gpu::ImageDecodeAcceleratorType::kWebP)) { + CHECK(base::FeatureList::IsEnabled( + features::kVaapiWebPImageDecodeAcceleration)); + if (!decoders_[gpu::ImageDecodeAcceleratorType::kWebP]->Initialize( + uma_cb)) { + return nullptr; + } + return decoders_[gpu::ImageDecodeAcceleratorType::kWebP].get(); + } + return nullptr; +} + +// static +std::unique_ptr<VaapiImageDecodeAcceleratorWorker> +VaapiImageDecodeAcceleratorWorker::Create() { + VaapiImageDecoderVector decoders; + gpu::ImageDecodeAcceleratorSupportedProfiles supported_profiles; + + std::optional<gpu::ImageDecodeAcceleratorSupportedProfile> + jpeg_decoder_supported_profile = VaapiJpegDecoder::GetSupportedProfile(); + if (jpeg_decoder_supported_profile) { + decoders.push_back(std::make_unique<VaapiJpegDecoder>()); + supported_profiles.push_back(*jpeg_decoder_supported_profile); + } + + std::optional<gpu::ImageDecodeAcceleratorSupportedProfile> + webp_decoder_supported_profile = VaapiWebPDecoder::GetSupportedProfile(); + if (webp_decoder_supported_profile) { + decoders.push_back(std::make_unique<VaapiWebPDecoder>()); + supported_profiles.push_back(*webp_decoder_supported_profile); + } + + // If there are no decoders due to no supported profiles found, return + // nullptr. + if (decoders.empty()) { + return nullptr; + } + + return base::WrapUnique(new VaapiImageDecodeAcceleratorWorker( + std::move(decoders), std::move(supported_profiles))); +} + +VaapiImageDecodeAcceleratorWorker::VaapiImageDecodeAcceleratorWorker( + VaapiImageDecoderVector decoders, + gpu::ImageDecodeAcceleratorSupportedProfiles supported_profiles) + : supported_profiles_(std::move(supported_profiles)) { + DETACH_FROM_SEQUENCE(io_sequence_checker_); + DETACH_FROM_SEQUENCE(decoder_sequence_checker_); + DCHECK_CALLED_ON_VALID_SEQUENCE(main_sequence_checker_); + + decoder_task_runner_ = base::ThreadPool::CreateSequencedTaskRunner({}); + CHECK(decoder_task_runner_); + + CHECK(!supported_profiles_.empty()); + CHECK(!decoders.empty()); + CHECK_EQ(decoders.size(), supported_profiles_.size()); + for (auto& decoder : decoders) { + const gpu::ImageDecodeAcceleratorType type = decoder->GetType(); + decoders_[type] = std::move(decoder); + } +} + +void VaapiImageDecodeAcceleratorWorker::Destroy() { + CHECK(decoder_task_runner_); + decoder_task_runner_->DeleteSoon(FROM_HERE, this); +} + +VaapiImageDecodeAcceleratorWorker::~VaapiImageDecodeAcceleratorWorker() { + DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_sequence_checker_); + decoders_.clear(); +} + +gpu::ImageDecodeAcceleratorSupportedProfiles +VaapiImageDecodeAcceleratorWorker::GetSupportedProfiles() { + return supported_profiles_; +} + +void VaapiImageDecodeAcceleratorWorker::DecodeTask( std::vector<uint8_t> encoded_data, - const gfx::Size& output_size, + const gfx::Size& output_size_for_tracing, gpu::ImageDecodeAcceleratorWorker::CompletedDecodeCB decode_cb) { + DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_sequence_checker_); TRACE_EVENT2("jpeg", "VaapiImageDecodeAcceleratorWorker::DecodeTask", - "encoded_bytes", encoded_data.size(), "output_size", - output_size.ToString()); + "encoded_bytes", encoded_data.size(), "output_size_for_tracing", + output_size_for_tracing.ToString()); gpu::ImageDecodeAcceleratorWorker::CompletedDecodeCB scoped_decode_callback = mojo::WrapCallbackWithDefaultInvokeIfNotRun(std::move(decode_cb), nullptr); - + VaapiImageDecoder* decoder = GetInitializedDecoder(encoded_data); // Decode into a VAAPI surface. if (!decoder) { DVLOGF(1) << "No decoder is available for supplied image"; @@ -79,7 +175,7 @@ } DCHECK(exported_pixmap); DCHECK(exported_pixmap->pixmap); - if (exported_pixmap->pixmap->GetBufferSize() != output_size) { + if (exported_pixmap->pixmap->GetBufferSize() != output_size_for_tracing) { DVLOGF(1) << "Scaling is not supported"; return; } @@ -103,106 +199,27 @@ std::move(scoped_decode_callback).Run(std::move(result)); } -} // namespace - -// static -std::unique_ptr<VaapiImageDecodeAcceleratorWorker> -VaapiImageDecodeAcceleratorWorker::Create() { - // TODO(crbug.com/988123): revisit the - // Media.VaapiImageDecodeAcceleratorWorker.VAAPIError UMA to be able to record - // WebP and JPEG failures separately. - const auto uma_cb = - base::BindRepeating(&ReportVaapiErrorToUMA, - "Media.VaapiImageDecodeAcceleratorWorker.VAAPIError"); - VaapiImageDecoderVector decoders; - gpu::ImageDecodeAcceleratorSupportedProfiles supported_profiles; - - auto jpeg_decoder = std::make_unique<VaapiJpegDecoder>(); - std::optional<gpu::ImageDecodeAcceleratorSupportedProfile> - jpeg_decoder_supported_profile = VaapiJpegDecoder::GetSupportedProfile(); - if (jpeg_decoder_supported_profile && jpeg_decoder->Initialize(uma_cb)) { - decoders.push_back(std::move(jpeg_decoder)); - supported_profiles.push_back(*jpeg_decoder_supported_profile); - } - - auto webp_decoder = std::make_unique<VaapiWebPDecoder>(); - std::optional<gpu::ImageDecodeAcceleratorSupportedProfile> - webp_decoder_supported_profile = VaapiWebPDecoder::GetSupportedProfile(); - if (webp_decoder_supported_profile && webp_decoder->Initialize(uma_cb)) { - decoders.push_back(std::move(webp_decoder)); - supported_profiles.push_back(*webp_decoder_supported_profile); - } - - // If there are no decoders due to disabled flags or initialization failure, - // return nullptr. - if (decoders.empty()) - return nullptr; - - return base::WrapUnique(new VaapiImageDecodeAcceleratorWorker( - std::move(decoders), std::move(supported_profiles))); -} - -VaapiImageDecodeAcceleratorWorker::VaapiImageDecodeAcceleratorWorker( - VaapiImageDecoderVector decoders, - gpu::ImageDecodeAcceleratorSupportedProfiles supported_profiles) - : supported_profiles_(std::move(supported_profiles)) { - DETACH_FROM_SEQUENCE(io_sequence_checker_); - decoder_task_runner_ = base::ThreadPool::CreateSequencedTaskRunner({}); - DCHECK(decoder_task_runner_); - - CHECK(!supported_profiles_.empty()); - CHECK(!decoders.empty()); - CHECK_EQ(decoders.size(), supported_profiles_.size()); - for (auto& decoder : decoders) { - const gpu::ImageDecodeAcceleratorType type = decoder->GetType(); - decoders_[type] = std::move(decoder); - } -} - -VaapiImageDecodeAcceleratorWorker::~VaapiImageDecodeAcceleratorWorker() { - DCHECK_CALLED_ON_VALID_SEQUENCE(main_sequence_checker_); - DCHECK(decoder_task_runner_); - for (auto& decoder : decoders_) - decoder_task_runner_->DeleteSoon(FROM_HERE, std::move(decoder.second)); -} - -gpu::ImageDecodeAcceleratorSupportedProfiles -VaapiImageDecodeAcceleratorWorker::GetSupportedProfiles() { - return supported_profiles_; -} - -VaapiImageDecoder* VaapiImageDecodeAcceleratorWorker::GetDecoderForImage( - const std::vector<uint8_t>& encoded_data) { - DCHECK_CALLED_ON_VALID_SEQUENCE(io_sequence_checker_); - auto result = decoders_.end(); - - if (base::FeatureList::IsEnabled( - features::kVaapiJpegImageDecodeAcceleration) && - IsJpegImage(encoded_data)) { - result = decoders_.find(gpu::ImageDecodeAcceleratorType::kJpeg); - } else if (base::FeatureList::IsEnabled( - features::kVaapiWebPImageDecodeAcceleration) && - IsLossyWebPImage(encoded_data)) { - result = decoders_.find(gpu::ImageDecodeAcceleratorType::kWebP); - } - - return result == decoders_.end() ? nullptr : result->second.get(); -} - void VaapiImageDecodeAcceleratorWorker::Decode( std::vector<uint8_t> encoded_data, const gfx::Size& output_size, CompletedDecodeCB decode_cb) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_sequence_checker_); - DCHECK(decoder_task_runner_); + CHECK(decoder_task_runner_); - // We defer checking for a null |decoder| until DecodeTask() because the - // gpu::ImageDecodeAcceleratorWorker interface mandates that the callback be - // called asynchronously. - VaapiImageDecoder* decoder = GetDecoderForImage(encoded_data); decoder_task_runner_->PostTask( - FROM_HERE, base::BindOnce(&DecodeTask, decoder, std::move(encoded_data), - output_size, std::move(decode_cb))); + FROM_HERE, base::BindOnce(&VaapiImageDecodeAcceleratorWorker::DecodeTask, + decoder_weak_this_factory_.GetWeakPtr(), + std::move(encoded_data), output_size, + std::move(decode_cb))); } } // namespace media + +namespace std { + +void default_delete<media::VaapiImageDecodeAcceleratorWorker>::operator()( + media::VaapiImageDecodeAcceleratorWorker* ptr) const { + ptr->Destroy(); +} + +} // namespace std
diff --git a/media/gpu/vaapi/vaapi_image_decode_accelerator_worker.h b/media/gpu/vaapi/vaapi_image_decode_accelerator_worker.h index c09acd0..b05b0a4 100644 --- a/media/gpu/vaapi/vaapi_image_decode_accelerator_worker.h +++ b/media/gpu/vaapi/vaapi_image_decode_accelerator_worker.h
@@ -40,8 +40,8 @@ class VaapiImageDecodeAcceleratorWorker : public gpu::ImageDecodeAcceleratorWorker { public: - // Creates a VaapiImageDecodeAcceleratorWorker and attempts to initialize the - // internal state. Returns nullptr if initialization fails. + // Creates a VaapiImageDecodeAcceleratorWorker. Returns nullptr if no image + // decode profiles are supported. static std::unique_ptr<VaapiImageDecodeAcceleratorWorker> Create(); VaapiImageDecodeAcceleratorWorker(const VaapiImageDecodeAcceleratorWorker&) = @@ -58,25 +58,64 @@ CompletedDecodeCB decode_cb) override; private: + friend struct std::default_delete<VaapiImageDecodeAcceleratorWorker>; + friend class VaapiImageDecodeAcceleratorWorkerTest; VaapiImageDecodeAcceleratorWorker( VaapiImageDecoderVector decoders, gpu::ImageDecodeAcceleratorSupportedProfiles supported_profiles); - VaapiImageDecoder* GetDecoderForImage( + // Calls the destructor of the VaapiImageDecodeAcceleratorWorker instance from + // the |decoder_task_runner_|. + void Destroy(); + + // Returns a pointer to an Initialize()d VaapiImageDecoder that can be used to + // decode |encoded_data|. If no suitable VaapiImageDecoder can be + // Initialize()d, this method returns nullptr. Must be called on the + // |decoder_task_runner_|. + VaapiImageDecoder* GetInitializedDecoder( const std::vector<uint8_t>& encoded_data); + // Tries to decode the image corresponding to |encoded_data| initializing the + // appropriate VaapiImageDecoder instance in |decoders_| as needed. We defer + // the initialization of the decoder until DecodeTask() so that initialization + // occurs on the same sequence as decoding (the VaapiWrapper must be created + // and used on the same sequence). |decode_cb| is called when finished or when + // an error is encountered. |output_size_for_tracing| is only used for tracing + // because we don't support decoding to scale. Must be called on the + // |decoder_task_runner_|. + void DecodeTask( + std::vector<uint8_t> encoded_data, + const gfx::Size& output_size_for_tracing, + gpu::ImageDecodeAcceleratorWorker::CompletedDecodeCB decode_cb); + // We delegate the decoding to the appropriate decoder in |decoders_| which // are used and destroyed on |decoder_task_runner_|. - VaapiImageDecoderMap decoders_; + VaapiImageDecoderMap decoders_ GUARDED_BY_CONTEXT(decoder_sequence_checker_); const gpu::ImageDecodeAcceleratorSupportedProfiles supported_profiles_; + scoped_refptr<base::SequencedTaskRunner> decoder_task_runner_; + SEQUENCE_CHECKER(decoder_sequence_checker_); SEQUENCE_CHECKER(main_sequence_checker_); SEQUENCE_CHECKER(io_sequence_checker_); + + // WeakPtr factory for *|this| to post tasks to |decoder_task_runner_|. + base::WeakPtrFactory<VaapiImageDecodeAcceleratorWorker> + decoder_weak_this_factory_{this}; }; } // namespace media +namespace std { + +// Specializes std::default_delete to call Destroy(). +template <> +struct default_delete<media::VaapiImageDecodeAcceleratorWorker> { + void operator()(media::VaapiImageDecodeAcceleratorWorker* ptr) const; +}; + +} // namespace std + #endif // MEDIA_GPU_VAAPI_VAAPI_IMAGE_DECODE_ACCELERATOR_WORKER_H_
diff --git a/media/gpu/vaapi/vaapi_image_decode_accelerator_worker_unittest.cc b/media/gpu/vaapi/vaapi_image_decode_accelerator_worker_unittest.cc index 68b6763..d2a07ff4 100644 --- a/media/gpu/vaapi/vaapi_image_decode_accelerator_worker_unittest.cc +++ b/media/gpu/vaapi/vaapi_image_decode_accelerator_worker_unittest.cc
@@ -138,10 +138,18 @@ GetFakeSupportedProfile(gpu::ImageDecodeAcceleratorType::kWebP); supported_profiles.push_back(fake_webp_profile); - decoders.push_back(std::make_unique<StrictMock<MockVaapiImageDecoder>>( - gpu::ImageDecodeAcceleratorType::kJpeg)); - decoders.push_back(std::make_unique<StrictMock<MockVaapiImageDecoder>>( - gpu::ImageDecodeAcceleratorType::kWebP)); + auto vaapi_jpeg_decoder = + std::make_unique<StrictMock<MockVaapiImageDecoder>>( + gpu::ImageDecodeAcceleratorType::kJpeg); + vaapi_jpeg_decoder_ = vaapi_jpeg_decoder.get(); + decoders.push_back(std::move(vaapi_jpeg_decoder)); + + auto vaapi_webp_decoder = + std::make_unique<StrictMock<MockVaapiImageDecoder>>( + gpu::ImageDecodeAcceleratorType::kWebP); + vaapi_webp_decoder_ = vaapi_webp_decoder.get(); + decoders.push_back(std::move(vaapi_webp_decoder)); + worker_ = base::WrapUnique(new VaapiImageDecodeAcceleratorWorker( std::move(decoders), std::move(supported_profiles))); } @@ -158,20 +166,12 @@ return profile; } - MockVaapiImageDecoder* GetJpegDecoder() const { - auto result = - worker_->decoders_.find(gpu::ImageDecodeAcceleratorType::kJpeg); - return result == worker_->decoders_.end() - ? nullptr - : static_cast<MockVaapiImageDecoder*>(result->second.get()); + StrictMock<MockVaapiImageDecoder>* GetJpegDecoder() const { + return vaapi_jpeg_decoder_; } - MockVaapiImageDecoder* GetWebPDecoder() const { - auto result = - worker_->decoders_.find(gpu::ImageDecodeAcceleratorType::kWebP); - return result == worker_->decoders_.end() - ? nullptr - : static_cast<MockVaapiImageDecoder*>(result->second.get()); + StrictMock<MockVaapiImageDecoder>* GetWebPDecoder() const { + return vaapi_webp_decoder_; } MOCK_METHOD1( @@ -182,6 +182,9 @@ base::test::TaskEnvironment task_environment_; base::test::ScopedFeatureList feature_list_; std::unique_ptr<VaapiImageDecodeAcceleratorWorker> worker_; + + raw_ptr<StrictMock<MockVaapiImageDecoder>> vaapi_jpeg_decoder_ = nullptr; + raw_ptr<StrictMock<MockVaapiImageDecoder>> vaapi_webp_decoder_ = nullptr; }; ACTION_P2(ExportAsNativePixmapDmaBufSuccessfully, @@ -205,6 +208,7 @@ InSequence sequence; MockVaapiImageDecoder* jpeg_decoder = GetJpegDecoder(); ASSERT_TRUE(jpeg_decoder); + EXPECT_CALL(*jpeg_decoder, Initialize(_)).WillOnce(Return(true)); EXPECT_CALL( *jpeg_decoder, Decode(AllOf(Property(&base::span<const uint8_t>::data, @@ -220,6 +224,7 @@ MockVaapiImageDecoder* webp_decoder = GetWebPDecoder(); ASSERT_TRUE(webp_decoder); + EXPECT_CALL(*webp_decoder, Initialize(_)).WillOnce(Return(true)); EXPECT_CALL( *webp_decoder, Decode(AllOf(Property(&base::span<const uint8_t>::data, @@ -255,6 +260,7 @@ InSequence sequence; MockVaapiImageDecoder* jpeg_decoder = GetJpegDecoder(); ASSERT_TRUE(jpeg_decoder); + EXPECT_CALL(*jpeg_decoder, Initialize(_)).WillOnce(Return(true)); EXPECT_CALL( *jpeg_decoder, Decode(AllOf(Property(&base::span<const uint8_t>::data, @@ -266,6 +272,7 @@ MockVaapiImageDecoder* webp_decoder = GetWebPDecoder(); ASSERT_TRUE(webp_decoder); + EXPECT_CALL(*webp_decoder, Initialize(_)).WillOnce(Return(true)); EXPECT_CALL( *webp_decoder, Decode(AllOf(Property(&base::span<const uint8_t>::data,
diff --git a/media/gpu/vaapi/vaapi_image_decoder.cc b/media/gpu/vaapi/vaapi_image_decoder.cc index 11e27df..7e04c72 100644 --- a/media/gpu/vaapi/vaapi_image_decoder.cc +++ b/media/gpu/vaapi/vaapi_image_decoder.cc
@@ -28,6 +28,9 @@ VaapiImageDecoder::~VaapiImageDecoder() = default; bool VaapiImageDecoder::Initialize(const ReportErrorToUMACB& error_uma_cb) { + if (vaapi_wrapper_) { + return true; + } vaapi_wrapper_ = VaapiWrapper::Create(VaapiWrapper::kDecode, va_profile_, EncryptionScheme::kUnencrypted, error_uma_cb)
diff --git a/media/gpu/vaapi/vaapi_image_decoder.h b/media/gpu/vaapi/vaapi_image_decoder.h index 3c41c2b..c0dd2e5 100644 --- a/media/gpu/vaapi/vaapi_image_decoder.h +++ b/media/gpu/vaapi/vaapi_image_decoder.h
@@ -63,8 +63,9 @@ virtual ~VaapiImageDecoder(); - // Initializes |vaapi_wrapper_| in kDecode mode with the - // appropriate VAAPI profile and |error_uma_cb| for error reporting. + // Initializes |vaapi_wrapper_| in kDecode mode with the appropriate VAAPI + // profile and |error_uma_cb| for error reporting. When the VaapiImageDecoder + // is already initialized, this is a no-op that returns true. virtual bool Initialize(const ReportErrorToUMACB& error_uma_cb); // Decodes a picture. It will fill VA-API parameters and call the
diff --git a/media/gpu/vaapi/vaapi_jpeg_decoder.cc b/media/gpu/vaapi/vaapi_jpeg_decoder.cc index 1760b5e..f358e038 100644 --- a/media/gpu/vaapi/vaapi_jpeg_decoder.cc +++ b/media/gpu/vaapi/vaapi_jpeg_decoder.cc
@@ -12,6 +12,7 @@ #include "base/logging.h" #include "base/numerics/safe_conversions.h" +#include "gpu/config/gpu_finch_features.h" #include "media/base/video_types.h" #include "media/gpu/macros.h" #include "media/gpu/vaapi/vaapi_utils.h" @@ -264,6 +265,10 @@ // static std::optional<gpu::ImageDecodeAcceleratorSupportedProfile> VaapiJpegDecoder::GetSupportedProfile() { + if (!base::FeatureList::IsEnabled( + features::kVaapiJpegImageDecodeAcceleration)) { + return std::nullopt; + } if (VaapiWrapper::GetImplementationType() == VAImplementation::kMesaGallium) { // TODO(crbug.com/974438): we can't advertise accelerated image decoding in // AMD until we support VAAPI surfaces with multiple buffer objects.
diff --git a/media/gpu/vaapi/vaapi_unittest.cc b/media/gpu/vaapi/vaapi_unittest.cc index 31ad3d5..b982778a 100644 --- a/media/gpu/vaapi/vaapi_unittest.cc +++ b/media/gpu/vaapi/vaapi_unittest.cc
@@ -595,12 +595,13 @@ ASSERT_EQ(wrapper->pending_va_buffers_.size(), 1u); { base::AutoLockMaybe auto_lock(wrapper->va_lock_.get()); - ScopedVABufferMapping mapping(wrapper->va_lock_, wrapper->va_display_, - wrapper->pending_va_buffers_.front()); - ASSERT_TRUE(mapping.IsValid()); + auto mapping = ScopedVABufferMapping::Create( + wrapper->va_lock_, wrapper->va_display_, + wrapper->pending_va_buffers_.front()); + ASSERT_TRUE(mapping); auto* const va_buffer = - reinterpret_cast<VAEncMiscParameterBuffer*>(mapping.data()); + reinterpret_cast<VAEncMiscParameterBuffer*>(mapping->data()); EXPECT_EQ(va_buffer->type, VAEncMiscParameterTypeQualityLevel); auto* const enc_quality =
diff --git a/media/gpu/vaapi/vaapi_utils.cc b/media/gpu/vaapi/vaapi_utils.cc index 06d1588..3841669 100644 --- a/media/gpu/vaapi/vaapi_utils.cc +++ b/media/gpu/vaapi/vaapi_utils.cc
@@ -33,43 +33,49 @@ } // namespace -ScopedVABufferMapping::ScopedVABufferMapping( +// static +std::unique_ptr<ScopedVABufferMapping> ScopedVABufferMapping::Create( const base::Lock* lock, VADisplay va_display, VABufferID buffer_id, - base::OnceCallback<void(VABufferID)> release_callback) - : lock_(lock), va_display_(va_display), buffer_id_(buffer_id) { - MAYBE_ASSERT_ACQUIRED(lock_); + base::OnceCallback<void(VABufferID)> release_callback) { + DCHECK(va_display); DCHECK_NE(buffer_id, VA_INVALID_ID); + MAYBE_ASSERT_ACQUIRED(lock); - const VAStatus result = - vaMapBuffer(va_display_, buffer_id_, &va_buffer_data_); - const bool success = result == VA_STATUS_SUCCESS; - LOG_IF(ERROR, !success) << "vaMapBuffer failed: " << vaErrorStr(result); - DCHECK(success == (va_buffer_data_ != nullptr)) - << "|va_buffer_data| should be null if vaMapBuffer() fails"; + void* va_buffer_data; + const VAStatus result = vaMapBuffer(va_display, buffer_id, &va_buffer_data); + if (result != VA_STATUS_SUCCESS) { + LOG(ERROR) << "vaMapBuffer failed: " << vaErrorStr(result); + if (release_callback) { + std::move(release_callback).Run(buffer_id); + } + return nullptr; + } + CHECK(va_buffer_data) + << "va_buffer_data must not be null if vaMapBuffer() succeeds"; - if (!success && release_callback) - std::move(release_callback).Run(buffer_id_); + return base::WrapUnique( + new ScopedVABufferMapping(lock, va_display, buffer_id, va_buffer_data)); } +ScopedVABufferMapping::ScopedVABufferMapping(const base::Lock* lock, + VADisplay va_display, + VABufferID buffer_id, + void* va_buffer_data) + : lock_(lock), + va_display_(va_display), + buffer_id_(buffer_id), + va_buffer_data_(va_buffer_data) {} + ScopedVABufferMapping::~ScopedVABufferMapping() { CHECK(sequence_checker_.CalledOnValidSequence()); - if (va_buffer_data_) { - MAYBE_ASSERT_ACQUIRED(lock_); - Unmap(); - } -} - -VAStatus ScopedVABufferMapping::Unmap() { - CHECK(sequence_checker_.CalledOnValidSequence()); + CHECK(va_buffer_data_); MAYBE_ASSERT_ACQUIRED(lock_); - const VAStatus result = vaUnmapBuffer(va_display_, buffer_id_); - if (result == VA_STATUS_SUCCESS) - va_buffer_data_ = nullptr; - else + if (VAStatus result = vaUnmapBuffer(va_display_, buffer_id_); + result != VA_STATUS_SUCCESS) { LOG(ERROR) << "vaUnmapBuffer failed: " << vaErrorStr(result); - return result; + } } // static @@ -133,42 +139,60 @@ << "Failed to destroy a VA buffer: " << vaErrorStr(va_res); } -ScopedVAImage::ScopedVAImage(base::Lock* lock, - VADisplay va_display, - VASurfaceID va_surface_id, - VAImageFormat* format, - const gfx::Size& size) - : lock_(lock), va_display_(va_display), image_(new VAImage{}) { - MAYBE_ASSERT_ACQUIRED(lock_); - VAStatus result = vaCreateImage(va_display_, format, size.width(), - size.height(), image_.get()); - if (result != VA_STATUS_SUCCESS) { - DCHECK_EQ(image_->image_id, VA_INVALID_ID); - LOG(ERROR) << "vaCreateImage failed: " << vaErrorStr(result); - return; - } - DCHECK_NE(image_->image_id, VA_INVALID_ID); +// static +std::unique_ptr<ScopedVAImage> ScopedVAImage::Create(base::Lock* lock, + VADisplay va_display, + VASurfaceID va_surface_id, + VAImageFormat* format, + const gfx::Size& size) { + DCHECK(va_display); + DCHECK_NE(va_surface_id, VA_INVALID_ID); + DCHECK(!size.IsEmpty()); + MAYBE_ASSERT_ACQUIRED(lock); - result = vaGetImage(va_display_, va_surface_id, 0, 0, size.width(), - size.height(), image_->image_id); + VAImage image{}; + VAStatus result = + vaCreateImage(va_display, format, size.width(), size.height(), &image); + if (result != VA_STATUS_SUCCESS) { + DCHECK_EQ(image.image_id, VA_INVALID_ID); + LOG(ERROR) << "vaCreateImage failed: " << vaErrorStr(result); + return nullptr; + } + DCHECK_NE(image.image_id, VA_INVALID_ID); + + result = vaGetImage(va_display, va_surface_id, 0, 0, size.width(), + size.height(), image.image_id); if (result != VA_STATUS_SUCCESS) { LOG(ERROR) << "vaGetImage failed: " << vaErrorStr(result); - return; + return nullptr; + } + std::unique_ptr<ScopedVABufferMapping> va_buffer = + ScopedVABufferMapping::Create(lock, va_display, image.buf); + if (!va_buffer) { + return nullptr; } - va_buffer_ = - std::make_unique<ScopedVABufferMapping>(lock_, va_display, image_->buf); + return base::WrapUnique( + new ScopedVAImage(lock, va_display, image, std::move(va_buffer))); } +ScopedVAImage::ScopedVAImage(base::Lock* lock, + VADisplay va_display, + const VAImage& image, + std::unique_ptr<ScopedVABufferMapping> va_buffer) + : lock_(lock), + va_display_(va_display), + image_(image), + va_buffer_(std::move(va_buffer)) {} + ScopedVAImage::~ScopedVAImage() { CHECK(sequence_checker_.CalledOnValidSequence()); - if (image_->image_id != VA_INVALID_ID) { - base::AutoLockMaybe auto_lock(lock_.get()); + CHECK_NE(image_.image_id, VA_INVALID_ID); + base::AutoLockMaybe auto_lock(lock_.get()); - // |va_buffer_| has to be deleted before vaDestroyImage(). - va_buffer_.reset(); - vaDestroyImage(va_display_, image_->image_id); - } + // |va_buffer_| has to be deleted before vaDestroyImage(). + va_buffer_.reset(); + vaDestroyImage(va_display_, image_.image_id); } ScopedVASurface::ScopedVASurface(scoped_refptr<VaapiWrapper> vaapi_wrapper,
diff --git a/media/gpu/vaapi/vaapi_utils.h b/media/gpu/vaapi/vaapi_utils.h index 974acc2..051e0e5 100644 --- a/media/gpu/vaapi/vaapi_utils.h +++ b/media/gpu/vaapi/vaapi_utils.h
@@ -29,31 +29,31 @@ // not null, this class must operate under |lock_| acquired. class ScopedVABufferMapping { public: - // |release_callback| will be called if the mapping of the buffer failed. - ScopedVABufferMapping(const base::Lock* lock, - VADisplay va_display, - VABufferID buffer_id, - base::OnceCallback<void(VABufferID)> release_callback = - base::NullCallback()); - + // Creates a ScopedVABufferMapping. Calls |release_callback| and returns + // nullptr if the mapping of the buffer fails. + static std::unique_ptr<ScopedVABufferMapping> Create( + const base::Lock* lock, + VADisplay va_display, + VABufferID buffer_id, + base::OnceCallback<void(VABufferID)> release_callback = + base::NullCallback()); ScopedVABufferMapping(const ScopedVABufferMapping&) = delete; ScopedVABufferMapping& operator=(const ScopedVABufferMapping&) = delete; ~ScopedVABufferMapping(); - bool IsValid() const { - CHECK(sequence_checker_.CalledOnValidSequence()); - return !!va_buffer_data_; - } + void* data() const { - DCHECK(IsValid()); CHECK(sequence_checker_.CalledOnValidSequence()); + CHECK(va_buffer_data_); return va_buffer_data_; } - // Explicit destruction method, to retrieve the success/error result. It is - // safe to call this method several times. - VAStatus Unmap(); private: + // |release_callback| will be called if the mapping of the buffer failed. + ScopedVABufferMapping(const base::Lock* lock, + VADisplay va_display, + VABufferID buffer_id, + void* va_buffer_data); raw_ptr<const base::Lock> lock_; // Only for AssertAcquired() calls. const VADisplay va_display_; const VABufferID buffer_id_; @@ -62,7 +62,7 @@ // This field is not a raw_ptr<> because it was filtered by the rewriter for: // #addr-of - RAW_PTR_EXCLUSION void* va_buffer_data_ = nullptr; + RAW_PTR_EXCLUSION void* const va_buffer_data_ = nullptr; }; // This class tracks the VABuffer life cycle from vaCreateBuffer() to @@ -122,33 +122,35 @@ // acquired for destruction purposes. class ScopedVAImage { public: - ScopedVAImage(base::Lock* lock, - VADisplay va_display, - VASurfaceID va_surface_id, - VAImageFormat* format /* Needs to be a pointer for libva */, - const gfx::Size& size); - + // Creates a ScopedVAImage. Returns nullptr if creating a VA image fails. + static std::unique_ptr<ScopedVAImage> Create( + base::Lock* lock, + VADisplay va_display, + VASurfaceID va_surface_id, + VAImageFormat* format, /* Needs to be a pointer for libva */ + const gfx::Size& size); ScopedVAImage(const ScopedVAImage&) = delete; ScopedVAImage& operator=(const ScopedVAImage&) = delete; ~ScopedVAImage(); - bool IsValid() const { return va_buffer_ && va_buffer_->IsValid(); } - const VAImage* image() const { CHECK(sequence_checker_.CalledOnValidSequence()); - return image_.get(); + return &image_; } const ScopedVABufferMapping* va_buffer() const { - DCHECK(IsValid()); CHECK(sequence_checker_.CalledOnValidSequence()); return va_buffer_.get(); } private: + ScopedVAImage(base::Lock* lock, + VADisplay va_display, + const VAImage& image, + std::unique_ptr<ScopedVABufferMapping> va_buffer); raw_ptr<base::Lock> lock_; const VADisplay va_display_ GUARDED_BY(lock_); - std::unique_ptr<VAImage> image_; + VAImage image_; std::unique_ptr<ScopedVABufferMapping> va_buffer_; base::SequenceCheckerImpl sequence_checker_;
diff --git a/media/gpu/vaapi/vaapi_utils_unittest.cc b/media/gpu/vaapi/vaapi_utils_unittest.cc index e097c652..de4cc94 100644 --- a/media/gpu/vaapi/vaapi_utils_unittest.cc +++ b/media/gpu/vaapi/vaapi_utils_unittest.cc
@@ -93,13 +93,13 @@ // image format seems to default to I420. https://crbug.com/828119 VAImageFormat va_image_format = kImageFormatI420; base::AutoLockMaybe auto_lock(vaapi_wrapper_->va_lock_.get()); - scoped_image = std::make_unique<ScopedVAImage>( + scoped_image = ScopedVAImage::Create( vaapi_wrapper_->va_lock_, vaapi_wrapper_->va_display_, va_surfaces[0], &va_image_format, coded_size); + ASSERT_TRUE(scoped_image); EXPECT_TRUE(scoped_image->image()); - ASSERT_TRUE(scoped_image->IsValid()); - EXPECT_TRUE(scoped_image->va_buffer()->IsValid()); + ASSERT_TRUE(scoped_image->va_buffer()); EXPECT_TRUE(scoped_image->va_buffer()->data()); } vaapi_wrapper_->DestroyContextAndSurfaces(va_surfaces); @@ -118,17 +118,16 @@ { VAImageFormat va_image_format = kImageFormatI420; base::AutoLockMaybe auto_lock(vaapi_wrapper_->va_lock_.get()); - scoped_image = std::make_unique<ScopedVAImage>( + EXPECT_DCHECK_DEATH(ScopedVAImage::Create( vaapi_wrapper_->va_lock_, vaapi_wrapper_->va_display_, va_surfaces[0], - &va_image_format, coded_size); + &va_image_format, coded_size)); - EXPECT_TRUE(scoped_image->image()); - EXPECT_FALSE(scoped_image->IsValid()); -#if DCHECK_IS_ON() - EXPECT_DCHECK_DEATH(scoped_image->va_buffer()); -#else - EXPECT_FALSE(scoped_image->va_buffer()); -#endif + // This should not hit any DCHECK() but will create an invalid + // ScopedVAImage. + scoped_image = ScopedVAImage::Create( + vaapi_wrapper_->va_lock_, vaapi_wrapper_->va_display_, + va_surfaces[0] - 1, &va_image_format, coded_size); + EXPECT_FALSE(scoped_image); } } @@ -138,14 +137,14 @@ base::AutoLockMaybe auto_lock(vaapi_wrapper_->va_lock_.get()); // A ScopedVABufferMapping with a VA_INVALID_ID VABufferID is DCHECK()ed. - EXPECT_DCHECK_DEATH(std::make_unique<ScopedVABufferMapping>( + EXPECT_DCHECK_DEATH(ScopedVABufferMapping::Create( vaapi_wrapper_->va_lock_, vaapi_wrapper_->va_display_, VA_INVALID_ID)); // This should not hit any DCHECK() but will create an invalid // ScopedVABufferMapping. - auto scoped_buffer = std::make_unique<ScopedVABufferMapping>( + auto scoped_buffer = ScopedVABufferMapping::Create( vaapi_wrapper_->va_lock_, vaapi_wrapper_->va_display_, VA_INVALID_ID - 1); - EXPECT_FALSE(scoped_buffer->IsValid()); + EXPECT_FALSE(scoped_buffer); } // This test exercises the creation of a valid ScopedVASurface.
diff --git a/media/gpu/vaapi/vaapi_video_encode_accelerator.cc b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc index 644c238f..f18651d 100644 --- a/media/gpu/vaapi/vaapi_video_encode_accelerator.cc +++ b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
@@ -15,6 +15,7 @@ #include "base/bits.h" #include "base/containers/contains.h" +#include "base/containers/fixed_flat_map.h" #include "base/feature_list.h" #include "base/functional/bind.h" #include "base/functional/callback.h" @@ -216,9 +217,9 @@ return false; } - native_input_mode_ = + bool native_input_mode = config.storage_type == Config::StorageType::kGpuMemoryBuffer; - if (native_input_mode_ && config.input_format != PIXEL_FORMAT_NV12) { + if (native_input_mode && config.input_format != PIXEL_FORMAT_NV12) { // TODO(crbug.com/894381): Support other formats. MEDIA_LOG(ERROR, media_log.get()) << "Unsupported format for native input mode: " @@ -226,7 +227,7 @@ return false; } - if (config.HasSpatialLayer() && !native_input_mode_) { + if (config.HasSpatialLayer() && !native_input_mode) { MEDIA_LOG(ERROR, media_log.get()) << "Spatial scalability is only supported for native input now"; return false; @@ -264,6 +265,9 @@ DCHECK_EQ(state_, kUninitialized); VLOGF(2); + native_input_mode_ = + config.storage_type == Config::StorageType::kGpuMemoryBuffer; + output_codec_ = VideoCodecProfileToVideoCodec(config.output_profile); DCHECK_EQ(IsConfiguredForTesting(), !!vaapi_wrapper_); if (!IsConfiguredForTesting()) { @@ -965,12 +969,6 @@ DVLOGF(4) << "id: " << buffer.id(); DCHECK_CALLED_ON_VALID_SEQUENCE(child_sequence_checker_); - if (buffer.size() < output_buffer_byte_size_) { - NotifyError({EncoderStatus::Codes::kInvalidOutputBuffer, - "Provided bitstream buffer too small"}); - return; - } - encoder_task_runner_->PostTask( FROM_HERE, base::BindOnce(&VaapiVideoEncodeAccelerator::UseOutputBitstreamBufferTask, @@ -982,6 +980,12 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(encoder_sequence_checker_); DCHECK_NE(state_, kUninitialized); + if (buffer.size() < output_buffer_byte_size_) { + NotifyError({EncoderStatus::Codes::kInvalidOutputBuffer, + "Provided bitstream buffer too small"}); + return; + } + available_bitstream_buffers_.push(std::move(buffer)); TryToReturnBitstreamBuffers(); // If there is a pending frame, it is pended because of the bitstream buffer @@ -1133,7 +1137,15 @@ } DCHECK_CALLED_ON_VALID_SEQUENCE(encoder_sequence_checker_); - VLOGF(2) << "setting state to: " << state; + if (VLOG_IS_ON(2)) { + constexpr auto kStateToString = base::MakeFixedFlatMap<State, const char*>( + {{kUninitialized, "kUninitialized"}, + {kEncoding, "kEncoding"}, + {kError, "kError"}}); + CHECK(base::Contains(kStateToString, state)); + VLOGF(2) << "setting state to: " << kStateToString.at(state); + } + state_ = state; }
diff --git a/media/gpu/vaapi/vaapi_video_encode_accelerator.h b/media/gpu/vaapi/vaapi_video_encode_accelerator.h index 29a5585..5628886 100644 --- a/media/gpu/vaapi/vaapi_video_encode_accelerator.h +++ b/media/gpu/vaapi/vaapi_video_encode_accelerator.h
@@ -229,11 +229,14 @@ // |num_instances_| tracks that number. static constexpr int kMaxNumOfInstances = 10; static base::AtomicRefCount num_instances_; - const bool can_use_encoder_; + const bool can_use_encoder_ GUARDED_BY_CONTEXT(child_sequence_checker_); + + // All of the members below must be accessed on the encoder_task_runner_, + // while it is running. // The unchanged values are filled upon the construction. The varied values // are filled properly during encoding. - VideoEncoderInfo encoder_info_; + VideoEncoderInfo encoder_info_ GUARDED_BY_CONTEXT(encoder_sequence_checker_); // VaapiWrapper is the owner of all HW resources (surfaces and buffers) // and will free them on destruction. @@ -242,29 +245,31 @@ // The expected coded size of incoming video frames when |native_input_mode_| // is false. - gfx::Size expected_input_coded_size_; + gfx::Size expected_input_coded_size_ + GUARDED_BY_CONTEXT(encoder_sequence_checker_); // The codec of the stream to be produced. Set during initialization. - VideoCodec output_codec_ = VideoCodec::kUnknown; + VideoCodec output_codec_ GUARDED_BY_CONTEXT(encoder_sequence_checker_) = + VideoCodec::kUnknown; // The visible rect to be encoded. - gfx::Rect visible_rect_; + gfx::Rect visible_rect_ GUARDED_BY_CONTEXT(encoder_sequence_checker_); // Size in bytes required for output bitstream buffers. - size_t output_buffer_byte_size_ = 0; + size_t output_buffer_byte_size_ + GUARDED_BY_CONTEXT(encoder_sequence_checker_) = 0; // Size of the max size of |pending_encode_results_|. - size_t max_pending_results_size_ = 0; + size_t max_pending_results_size_ + GUARDED_BY_CONTEXT(encoder_sequence_checker_) = 0; // This flag signals when the client is sending NV12 + DmaBuf-backed // VideoFrames to encode, which allows for skipping a copy-adaptation on // input. - bool native_input_mode_ = false; + bool native_input_mode_ GUARDED_BY_CONTEXT(encoder_sequence_checker_) = false; // The number of frames that needs to be held on encoding. - size_t num_frames_in_flight_ = 0; - - // All of the members below must be accessed on the encoder_task_runner_, - // while it is running. + size_t num_frames_in_flight_ GUARDED_BY_CONTEXT(encoder_sequence_checker_) = + 0; // Encoder state. Encode tasks will only run in kEncoding state. State state_ GUARDED_BY_CONTEXT(encoder_sequence_checker_) =
diff --git a/media/gpu/vaapi/vaapi_webp_decoder.cc b/media/gpu/vaapi/vaapi_webp_decoder.cc index f0217f0a..4ae4dfca 100644 --- a/media/gpu/vaapi/vaapi_webp_decoder.cc +++ b/media/gpu/vaapi/vaapi_webp_decoder.cc
@@ -6,8 +6,10 @@ #include <va/va.h> +#include "base/feature_list.h" #include "base/logging.h" #include "base/numerics/safe_conversions.h" +#include "gpu/config/gpu_finch_features.h" #include "media/gpu/macros.h" #include "media/gpu/vaapi/vaapi_utils.h" #include "media/gpu/vaapi/vaapi_wrapper.h" @@ -86,6 +88,10 @@ // static std::optional<gpu::ImageDecodeAcceleratorSupportedProfile> VaapiWebPDecoder::GetSupportedProfile() { + if (!base::FeatureList::IsEnabled( + features::kVaapiWebPImageDecodeAcceleration)) { + return std::nullopt; + } gpu::ImageDecodeAcceleratorSupportedProfile profile; profile.image_type = gpu::ImageDecodeAcceleratorType::kWebP;
diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc index 531aec2..a453f54 100644 --- a/media/gpu/vaapi/vaapi_wrapper.cc +++ b/media/gpu/vaapi/vaapi_wrapper.cc
@@ -2268,13 +2268,14 @@ VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAProtectedSessionExecute, false); - ScopedVABufferMapping mapping(va_lock_, va_display_, hw_update->id()); - if (!mapping.IsValid()) { + auto mapping = + ScopedVABufferMapping::Create(va_lock_, va_display_, hw_update->id()); + if (!mapping) { LOG(ERROR) << "Failed mapping returned Execute buf"; return false; } auto* hw_update_buf_out = - reinterpret_cast<VAProtectedSessionExecuteBuffer*>(mapping.data()); + reinterpret_cast<VAProtectedSessionExecuteBuffer*>(mapping->data()); if (!hw_update_buf_out->output.data_size) { LOG(ERROR) << "Received empty HW identifier"; return false; @@ -2825,10 +2826,10 @@ VAStatus va_res = vaSyncSurface(va_display_, va_surface_id); VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVASyncSurface, nullptr); - scoped_image = std::make_unique<ScopedVAImage>(va_lock_, va_display_, - va_surface_id, format, size); + scoped_image = ScopedVAImage::Create(va_lock_, va_display_, va_surface_id, + format, size); } - return scoped_image->IsValid() ? std::move(scoped_image) : nullptr; + return scoped_image; } bool VaapiWrapper::UploadVideoFrameToSurface(const VideoFrame& frame, @@ -2884,12 +2885,13 @@ return false; } - ScopedVABufferMapping mapping(auto_lock ? va_lock_ : nullptr, va_display_, - image.buf); - if (!mapping.IsValid()) { + auto mapping = ScopedVABufferMapping::Create(auto_lock ? va_lock_ : nullptr, + va_display_, image.buf); + if (!mapping) { return false; } - uint8_t* image_ptr = static_cast<uint8_t*>(mapping.data()); + + uint8_t* image_ptr = static_cast<uint8_t*>(mapping->data()); if (!ClearNV12Padding(image, visible_size, image_ptr)) { LOG(ERROR) << "Failed to clear non visible area of VAImage"; @@ -2969,14 +2971,15 @@ VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVASyncSurface, 0u); } - ScopedVABufferMapping mapping(auto_lock ? va_lock_ : nullptr, va_display_, - buffer_id); - if (!mapping.IsValid()) + auto mapping = ScopedVABufferMapping::Create(auto_lock ? va_lock_ : nullptr, + va_display_, buffer_id); + if (!mapping) { return 0u; + } uint64_t coded_data_size = 0; for (auto* buffer_segment = - reinterpret_cast<VACodedBufferSegment*>(mapping.data()); + reinterpret_cast<VACodedBufferSegment*>(mapping->data()); buffer_segment; buffer_segment = reinterpret_cast<VACodedBufferSegment*>( buffer_segment->next)) { coded_data_size += buffer_segment->size; @@ -3009,12 +3012,14 @@ VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVASyncSurface, false); } - ScopedVABufferMapping mapping(auto_lock ? va_lock_ : nullptr, va_display_, - buffer_id); - if (!mapping.IsValid()) + auto mapping = ScopedVABufferMapping::Create(auto_lock ? va_lock_ : nullptr, + va_display_, buffer_id); + if (!mapping) { return false; + } + auto* buffer_segment = - reinterpret_cast<VACodedBufferSegment*>(mapping.data()); + reinterpret_cast<VACodedBufferSegment*>(mapping->data()); // memcpy calls should be fast, unlocking and relocking for unmapping might // cause another thread to acquire the lock and we'd have to wait delaying the @@ -3130,12 +3135,13 @@ VARectangle input_region; VARectangle output_region; { - ScopedVABufferMapping mapping(va_lock_, va_display_, - va_buffer_for_vpp_->id()); - if (!mapping.IsValid()) + auto mapping = ScopedVABufferMapping::Create(va_lock_, va_display_, + va_buffer_for_vpp_->id()); + if (!mapping) { return false; + } auto* pipeline_param = - reinterpret_cast<VAProcPipelineParameterBuffer*>(mapping.data()); + reinterpret_cast<VAProcPipelineParameterBuffer*>(mapping->data()); memset(pipeline_param, 0, sizeof *pipeline_param); if (!src_rect) @@ -3608,13 +3614,14 @@ DCHECK(IsValidVABufferType(va_buffer.type)); DCHECK(va_buffer.data); - ScopedVABufferMapping mapping( + auto mapping = ScopedVABufferMapping::Create( va_lock_, va_display_, va_buffer_id, base::BindOnce(base::IgnoreResult(&vaDestroyBuffer), va_display_)); - if (!mapping.IsValid()) + if (!mapping) { return false; + } - return memcpy(mapping.data(), va_buffer.data, va_buffer.size); + return memcpy(mapping->data(), va_buffer.data, va_buffer.size); } void VaapiWrapper::MaybeSetLowQualityEncoding_Locked() {
diff --git a/media/webrtc/webrtc_features.cc b/media/webrtc/webrtc_features.cc index fb233db..ce1530f 100644 --- a/media/webrtc/webrtc_features.cc +++ b/media/webrtc/webrtc_features.cc
@@ -70,4 +70,17 @@ "WebRtcApmTellsIfPlayoutReferenceIsNeeded", base::FEATURE_ENABLED_BY_DEFAULT); +// When enabled, allow H.265 codec to be used for sending WebRTC streams. +// Platform hardware H.265 encoder needs to be supported and enabled in order to +// negotiate usage of H.265 in SDP in the direction of sending. +BASE_FEATURE(kWebRtcAllowH265Send, + "WebRtcAllowH265Send", + base::FEATURE_DISABLED_BY_DEFAULT); + +// When enabled, allow H.265 codec to be used for receiving WebRTC streams. +// Platform hardware H.265 decoder needs to be supported and enabled in order to +// negotiate usage of H.265 in SDP in the direction of receiving. +BASE_FEATURE(kWebRtcAllowH265Receive, + "WebRtcAllowH265Receive", + base::FEATURE_DISABLED_BY_DEFAULT); } // namespace features
diff --git a/media/webrtc/webrtc_features.h b/media/webrtc/webrtc_features.h index ca1b7ac..deffbbc 100644 --- a/media/webrtc/webrtc_features.h +++ b/media/webrtc/webrtc_features.h
@@ -43,6 +43,11 @@ COMPONENT_EXPORT(MEDIA_WEBRTC) BASE_DECLARE_FEATURE(kWebRtcApmTellsIfPlayoutReferenceIsNeeded); +COMPONENT_EXPORT(MEDIA_WEBRTC) +BASE_DECLARE_FEATURE(kWebRtcAllowH265Send); + +COMPONENT_EXPORT(MEDIA_WEBRTC) +BASE_DECLARE_FEATURE(kWebRtcAllowH265Receive); } // namespace features #endif // MEDIA_WEBRTC_WEBRTC_FEATURES_H_
diff --git a/net/BUILD.gn b/net/BUILD.gn index 9f09336..5e4ca1bc 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -3173,11 +3173,11 @@ deps += [ ":net_jni_headers", "//base:base_unittest_support_java", + "//net/android:dummy_spnego_authenticator_java", + "//net/android:dummy_spnego_authenticator_jni", "//net/android:net_java", "//net/android:net_java_test_support", "//net/android:net_test_support_jni", - "//net/android:net_test_support_provider_java", - "//net/android:net_test_support_provider_jni", "//net/android:net_tests_java", "//net/android:net_tests_jni", "//net/android:net_unittests_apk_resources",
diff --git a/net/android/BUILD.gn b/net/android/BUILD.gn index 31c6e7a..7331c0ab 100644 --- a/net/android/BUILD.gn +++ b/net/android/BUILD.gn
@@ -102,17 +102,17 @@ generate_jni("net_test_support_provider_jni") { testonly = true - sources = [ - "../test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java", - "../test/android/javatests/src/org/chromium/net/test/EmbeddedTestServerImpl.java", - ] + sources = [ "../test/android/javatests/src/org/chromium/net/test/EmbeddedTestServerImpl.java" ] +} + +generate_jni("dummy_spnego_authenticator_jni") { + testonly = true + sources = [ "../test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java" ] } android_library("net_test_support_provider_java") { testonly = true sources = [ - "../test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java", - "../test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticatorService.java", "../test/android/javatests/src/org/chromium/net/test/EmbeddedTestServerImpl.java", "../test/android/javatests/src/org/chromium/net/test/EmbeddedTestServerService.java", ] @@ -129,6 +129,24 @@ data_deps = [ "//net:test_support" ] } +android_library("dummy_spnego_authenticator_java") { + testonly = true + sources = [ + "../test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java", + "../test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticatorService.java", + ] + srcjar_deps = [ ":dummy_spnego_authenticator_jni" ] + + deps = [ + ":net_java", + "//base:base_java", + "//base:base_java_url_utils_for_test", + "//third_party/jni_zero:jni_zero_java", + ] + + data_deps = [ "//net:test_support" ] +} + source_set("java_test_native_support") { testonly = true sources = [
diff --git a/net/android/dummy_spnego_authenticator.cc b/net/android/dummy_spnego_authenticator.cc index 3c19ce5..202a701 100644 --- a/net/android/dummy_spnego_authenticator.cc +++ b/net/android/dummy_spnego_authenticator.cc
@@ -6,7 +6,7 @@ #include "base/android/jni_android.h" #include "base/android/jni_string.h" #include "base/base64.h" -#include "net/android/net_test_support_provider_jni/DummySpnegoAuthenticator_jni.h" +#include "net/android/dummy_spnego_authenticator_jni/DummySpnegoAuthenticator_jni.h" #include "testing/gtest/include/gtest/gtest.h" using base::android::JavaParamRef;
diff --git a/net/base/proxy_server.cc b/net/base/proxy_server.cc index ed883e7..7c2f64a 100644 --- a/net/base/proxy_server.cc +++ b/net/base/proxy_server.cc
@@ -15,6 +15,7 @@ #include "base/numerics/safe_conversions.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/string_util.h" #include "net/base/proxy_string_util.h" #include "url/third_party/mozilla/url_parse.h" #include "url/url_canon.h" @@ -60,6 +61,11 @@ // Create INVALID proxies directly using `ProxyServer()`. DCHECK_NE(scheme, SCHEME_INVALID); + // Trim host which may have been pasted with excess whitespace. + if (!host.empty()) { + host = base::TrimWhitespaceASCII(host, base::TRIM_ALL); + } + // Add brackets to IPv6 literals if missing, as required by url // canonicalization. std::string bracketed_host;
diff --git a/net/base/proxy_server_unittest.cc b/net/base/proxy_server_unittest.cc index e0dd476..ec2e99b 100644 --- a/net/base/proxy_server_unittest.cc +++ b/net/base/proxy_server_unittest.cc
@@ -62,6 +62,7 @@ {ProxyServer::SCHEME_QUIC, "foopy", 111, "111", "foopy", 111}, {ProxyServer::SCHEME_SOCKS4, "foopy", 111, "111", "foopy", 111}, {ProxyServer::SCHEME_SOCKS5, "foopy", 111, "111", "foopy", 111}, + {ProxyServer::SCHEME_HTTPS, " foopy \n", 111, "111", "foopy", 111}, // Default ports {ProxyServer::SCHEME_HTTP, "foopy", std::nullopt, "", "foopy", 80},
diff --git a/net/third_party/quiche/BUILD.gn b/net/third_party/quiche/BUILD.gn index e298204..47b618e 100644 --- a/net/third_party/quiche/BUILD.gn +++ b/net/third_party/quiche/BUILD.gn
@@ -851,8 +851,9 @@ "src/quiche/blind_sign_auth/blind_sign_auth.cc", "src/quiche/blind_sign_auth/blind_sign_auth.h", "src/quiche/blind_sign_auth/blind_sign_auth_interface.h", - "src/quiche/blind_sign_auth/blind_sign_http_response.h", "src/quiche/blind_sign_auth/blind_sign_message_interface.h", + "src/quiche/blind_sign_auth/blind_sign_message_response.cc", + "src/quiche/blind_sign_auth/blind_sign_message_response.h", "src/quiche/blind_sign_auth/cached_blind_sign_auth.cc", "src/quiche/blind_sign_auth/cached_blind_sign_auth.h", ] @@ -912,7 +913,7 @@ testonly = true sources = [ "src/quiche/blind_sign_auth/test_tools/mock_blind_sign_auth_interface.h", - "src/quiche/blind_sign_auth/test_tools/mock_blind_sign_http_interface.h", + "src/quiche/blind_sign_auth/test_tools/mock_blind_sign_message_interface.h", ] configs += [ ":quiche_internal_config" ] public_configs = [ ":quiche_config" ]
diff --git a/net/third_party/quiche/src b/net/third_party/quiche/src index 996eb30..ee429dd 160000 --- a/net/third_party/quiche/src +++ b/net/third_party/quiche/src
@@ -1 +1 @@ -Subproject commit 996eb304c694f34aa8d855ca12f5173697b2574f +Subproject commit ee429dd8e97c8bcc4d4373847f7a982f6fb14da5
diff --git a/services/device/BUILD.gn b/services/device/BUILD.gn index bde279c9..aa67351 100644 --- a/services/device/BUILD.gn +++ b/services/device/BUILD.gn
@@ -259,8 +259,6 @@ ] deps += [ ":device_service_jni_headers", - "//services/device/public/java:geolocation_java_test_support", - "//services/device/usb:java", "//services/device/vibration/android:vibration_jni_headers", ] } else {
diff --git a/services/test/echo/OWNERS b/services/test/echo/OWNERS new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/services/test/echo/OWNERS
@@ -0,0 +1 @@ +*
diff --git a/services/viz/privileged/mojom/gl/gpu_service.mojom b/services/viz/privileged/mojom/gl/gpu_service.mojom index a2e7aef..8d6da77e 100644 --- a/services/viz/privileged/mojom/gl/gpu_service.mojom +++ b/services/viz/privileged/mojom/gl/gpu_service.mojom
@@ -188,7 +188,7 @@ // host since multiple clients may be using the same physical disk path. Note // that this method is used only from a trusted process. LoadedBlob(gpu.mojom.GpuDiskCacheHandle cache_handle, - string key, + mojo_base.mojom.ByteString key, mojo_base.mojom.ByteString data); // Tells GPU to wake up the GPU because we're about to draw.
diff --git a/services/webnn/coreml/graph_builder.cc b/services/webnn/coreml/graph_builder.cc index 57865af..7b07358 100644 --- a/services/webnn/coreml/graph_builder.cc +++ b/services/webnn/coreml/graph_builder.cc
@@ -125,10 +125,12 @@ constexpr char kOpLogicalGreaterEqual[] = "greater_equal"; constexpr char kOpLogicalLess[] = "less"; constexpr char kOpLogicalLessEqual[] = "less_equal"; +constexpr char kOpAbsTypeName[] = "abs"; constexpr char kOpCeilTypeName[] = "ceil"; constexpr char kOpCosTypeName[] = "cos"; constexpr char kOpExpTypeName[] = "exp"; constexpr char kOpFloorTypeName[] = "floor"; +constexpr char kOpIdentityTypeName[] = "identity"; constexpr char kOpSinTypeName[] = "sin"; constexpr char kOpTanTypeName[] = "tan"; constexpr char kOpErfTypeName[] = "erf"; @@ -609,8 +611,9 @@ break; } case mojom::Operation::Tag::kRelu: { - RETURN_IF_ERROR(AddUnaryFloatsOperation(kOpReluTypeName, - *operation->get_relu(), block)); + RETURN_IF_ERROR(AddUnaryOperation(SupportedDataType::kFloats, + kOpReluTypeName, + *operation->get_relu(), block)); break; } case mojom::Operation::Tag::kResample2d: { @@ -624,18 +627,21 @@ break; } case mojom::Operation::Tag::kSigmoid: { - RETURN_IF_ERROR(AddUnaryFloatsOperation( - kOpSigmoidTypeName, *operation->get_sigmoid(), block)); + RETURN_IF_ERROR(AddUnaryOperation(SupportedDataType::kFloats, + kOpSigmoidTypeName, + *operation->get_sigmoid(), block)); break; } case mojom::Operation::Tag::kSoftsign: { - RETURN_IF_ERROR(AddUnaryFloatsOperation( - kOpSoftsignTypeName, *operation->get_softsign(), block)); + RETURN_IF_ERROR(AddUnaryOperation(SupportedDataType::kFloats, + kOpSoftsignTypeName, + *operation->get_softsign(), block)); break; } case mojom::Operation::Tag::kTanh: { - RETURN_IF_ERROR(AddUnaryFloatsOperation(kOpTanhTypeName, - *operation->get_tanh(), block)); + RETURN_IF_ERROR(AddUnaryOperation(SupportedDataType::kFloats, + kOpTanhTypeName, + *operation->get_tanh(), block)); break; } case mojom::Operation::Tag::kTranspose: { @@ -840,14 +846,26 @@ return base::ok(); } -base::expected<void, mojom::ErrorPtr> GraphBuilder::AddUnaryFloatsOperation( +base::expected<void, mojom::ErrorPtr> GraphBuilder::AddUnaryOperation( + SupportedDataType supported_data_type, std::string_view op_name, std::string_view input_name, CoreML::Specification::MILSpec::DataType input_mil_data_type, uint64_t output_operand_id, CoreML::Specification::MILSpec::Block& block) { - if (!kFloatDataTypes.contains(input_mil_data_type)) { - return NewNotSupportedError("Unsupported input datatype."); + switch (supported_data_type) { + case SupportedDataType::kFloats: { + if (!kFloatDataTypes.contains(input_mil_data_type)) { + return NewNotSupportedError("Unsupported input datatype."); + } + break; + } + case SupportedDataType::kFloatsAndInt32: { + if (!kFloatsAndInt32DataTypes.contains(input_mil_data_type)) { + return NewNotSupportedError("Unsupported input datatype."); + } + break; + } } CoreML::Specification::MILSpec::Operation* op = block.add_operations(); @@ -860,15 +878,16 @@ } template <typename T> -base::expected<void, mojom::ErrorPtr> GraphBuilder::AddUnaryFloatsOperation( +base::expected<void, mojom::ErrorPtr> GraphBuilder::AddUnaryOperation( + SupportedDataType supported_data_type, std::string_view op_name, const T& operation, CoreML::Specification::MILSpec::Block& block) { const OperandInfo& input_operand_info = GetOperandInfo(operation.input_operand_id); - return AddUnaryFloatsOperation(op_name, input_operand_info.coreml_name, - input_operand_info.mil_data_type, - operation.output_operand_id, block); + return AddUnaryOperation( + supported_data_type, op_name, input_operand_info.coreml_name, + input_operand_info.mil_data_type, operation.output_operand_id, block); } base::expected<void, mojom::ErrorPtr> @@ -1108,27 +1127,29 @@ break; } case webnn::mojom::Activation::Tag::kRelu: { - RETURN_IF_ERROR(AddUnaryFloatsOperation( - kOpReluTypeName, internal_output_name, output_operand.mil_data_type, - operation.output_operand_id, block)); + RETURN_IF_ERROR(AddUnaryOperation( + SupportedDataType::kFloats, kOpReluTypeName, internal_output_name, + output_operand.mil_data_type, operation.output_operand_id, block)); break; } case webnn::mojom::Activation::Tag::kSigmoid: { - RETURN_IF_ERROR(AddUnaryFloatsOperation( - kOpSigmoidTypeName, internal_output_name, - output_operand.mil_data_type, operation.output_operand_id, block)); + RETURN_IF_ERROR(AddUnaryOperation( + SupportedDataType::kFloats, kOpSigmoidTypeName, + internal_output_name, output_operand.mil_data_type, + operation.output_operand_id, block)); break; } case webnn::mojom::Activation::Tag::kSoftsign: { - RETURN_IF_ERROR(AddUnaryFloatsOperation( - kOpSoftsignTypeName, internal_output_name, - output_operand.mil_data_type, operation.output_operand_id, block)); + RETURN_IF_ERROR(AddUnaryOperation( + SupportedDataType::kFloats, kOpSoftsignTypeName, + internal_output_name, output_operand.mil_data_type, + operation.output_operand_id, block)); break; } case webnn::mojom::Activation::Tag::kTanh: { - RETURN_IF_ERROR(AddUnaryFloatsOperation( - kOpTanhTypeName, internal_output_name, output_operand.mil_data_type, - operation.output_operand_id, block)); + RETURN_IF_ERROR(AddUnaryOperation( + SupportedDataType::kFloats, kOpTanhTypeName, internal_output_name, + output_operand.mil_data_type, operation.output_operand_id, block)); break; } // TODO: crbug.com/41481333 Support these when implemented. @@ -1253,34 +1274,50 @@ const mojom::ElementWiseUnary& operation, CoreML::Specification::MILSpec::Block& block) { switch (operation.kind) { + case mojom::ElementWiseUnary::Kind::kAbs: { + return AddUnaryOperation(SupportedDataType::kFloatsAndInt32, + kOpAbsTypeName, operation, block); + } case mojom::ElementWiseUnary::Kind::kCast: { const OperandInfo& input = GetOperandInfo(operation.input_operand_id); return AddOperationForCast(input.coreml_name, operation.output_operand_id, input.data_type, block); } case mojom::ElementWiseUnary::Kind::kCeil: { - return AddUnaryFloatsOperation(kOpCeilTypeName, operation, block); + return AddUnaryOperation(SupportedDataType::kFloats, kOpCeilTypeName, + operation, block); } case mojom::ElementWiseUnary::Kind::kCos: { - return AddUnaryFloatsOperation(kOpCosTypeName, operation, block); + return AddUnaryOperation(SupportedDataType::kFloats, kOpCosTypeName, + operation, block); } case mojom::ElementWiseUnary::Kind::kExp: { - return AddUnaryFloatsOperation(kOpExpTypeName, operation, block); + return AddUnaryOperation(SupportedDataType::kFloats, kOpExpTypeName, + operation, block); } case mojom::ElementWiseUnary::Kind::kFloor: { - return AddUnaryFloatsOperation(kOpFloorTypeName, operation, block); + return AddUnaryOperation(SupportedDataType::kFloats, kOpFloorTypeName, + operation, block); + } + case mojom::ElementWiseUnary::Kind::kIdentity: { + return AddUnaryOperation(SupportedDataType::kFloatsAndInt32, + kOpIdentityTypeName, operation, block); } case mojom::ElementWiseUnary::Kind::kSin: { - return AddUnaryFloatsOperation(kOpSinTypeName, operation, block); + return AddUnaryOperation(SupportedDataType::kFloats, kOpSinTypeName, + operation, block); } case mojom::ElementWiseUnary::Kind::kTan: { - return AddUnaryFloatsOperation(kOpTanTypeName, operation, block); + return AddUnaryOperation(SupportedDataType::kFloats, kOpTanTypeName, + operation, block); } case mojom::ElementWiseUnary::Kind::kErf: { - return AddUnaryFloatsOperation(kOpErfTypeName, operation, block); + return AddUnaryOperation(SupportedDataType::kFloats, kOpErfTypeName, + operation, block); } case mojom::ElementWiseUnary::Kind::kSqrt: { - return AddUnaryFloatsOperation(kOpSqrtTypeName, operation, block); + return AddUnaryOperation(SupportedDataType::kFloats, kOpSqrtTypeName, + operation, block); } case mojom::ElementWiseUnary::Kind::kReciprocal: { // CoreML's reciprocal operator requires an epsilon value, the default @@ -1301,8 +1338,6 @@ /*epsilon=*/0, block); } case mojom::ElementWiseUnary::Kind::kNeg: - case mojom::ElementWiseUnary::Kind::kAbs: - case mojom::ElementWiseUnary::Kind::kIdentity: case mojom::ElementWiseUnary::Kind::kLogicalNot: return NewNotSupportedError("Unimplemented Unary Operator."); }
diff --git a/services/webnn/coreml/graph_builder.h b/services/webnn/coreml/graph_builder.h index 81d90e0a..2be8f6e 100644 --- a/services/webnn/coreml/graph_builder.h +++ b/services/webnn/coreml/graph_builder.h
@@ -155,16 +155,18 @@ [[nodiscard]] base::expected<void, mojom::ErrorPtr> AddOutput( uint64_t output_id); - // Helper function for simple unary operations that take a single - // float32/float16 input. - [[nodiscard]] base::expected<void, mojom::ErrorPtr> AddUnaryFloatsOperation( + // Helper function for simple unary operations. + enum class SupportedDataType { kFloats, kFloatsAndInt32 }; + [[nodiscard]] base::expected<void, mojom::ErrorPtr> AddUnaryOperation( + SupportedDataType supported_data_type, std::string_view op_name, std::string_view input_name, CoreML::Specification::MILSpec::DataType input_mil_data_type, uint64_t output_operand_id, CoreML::Specification::MILSpec::Block& block); template <typename T> - [[nodiscard]] base::expected<void, mojom::ErrorPtr> AddUnaryFloatsOperation( + [[nodiscard]] base::expected<void, mojom::ErrorPtr> AddUnaryOperation( + SupportedDataType supported_data_type, std::string_view op_name, const T& operation, CoreML::Specification::MILSpec::Block& block);
diff --git a/services/webnn/dml/graph_impl.cc b/services/webnn/dml/graph_impl.cc index c8a8a32..9aa231b 100644 --- a/services/webnn/dml/graph_impl.cc +++ b/services/webnn/dml/graph_impl.cc
@@ -21,6 +21,7 @@ #include "base/strings/stringprintf.h" #include "base/task/thread_pool.h" #include "base/trace_event/trace_event.h" +#include "base/types/expected_macros.h" #include "base/types/optional_ref.h" #include "components/ml/webnn/graph_validation_utils.h" #include "mojo/public/cpp/bindings/self_owned_associated_receiver.h" @@ -496,8 +497,8 @@ // upper than DML_FEATURE_LEVEL_6_0. // https://learn.microsoft.com/en-us/windows/ai/directml/dml-feature-level-history#dml_feature_level_6_0 template <typename Activation> -ActivationOperatorDesc CreateActivationOperatorDesc( - const Activation* activation) { +base::expected<ActivationOperatorDesc, mojom::ErrorPtr> +CreateActivationOperatorDesc(const Activation* activation) { CHECK(activation); switch (activation->which()) { case Activation::Tag::kElu: @@ -533,8 +534,14 @@ case Activation::Tag::kTanh: return ActivationOperatorDesc{.desc = DML_ACTIVATION_TANH_OPERATOR_DESC{}}; + case Activation::Tag::kClamp: + // TODO(crbug.com/336589268): Un-fuse the op instead of reporting error + // when the activation is not supported. + return base::unexpected( + CreateError(mojom::Error::Code::kNotSupportedError, + "The activation (clamp) is not supported.")); default: - NOTREACHED_NORETURN() << "The fused activation type is not supported."; + NOTREACHED_NORETURN() << "The operation is not an activation."; } } @@ -1257,13 +1264,15 @@ if (fusible_activation || batch_normalization->activation) { CHECK(!(fusible_activation && batch_normalization->activation)); if (fusible_activation) { - activation_operator_desc = - CreateActivationOperatorDesc(fusible_activation.value()); + ASSIGN_OR_RETURN( + activation_operator_desc, + CreateActivationOperatorDesc(fusible_activation.value())); output_id = GetFusibleActivationOutputId(fusible_activation.value()).value(); } else { - activation_operator_desc = - CreateActivationOperatorDesc(batch_normalization->activation.get()); + ASSIGN_OR_RETURN( + activation_operator_desc, + CreateActivationOperatorDesc(batch_normalization->activation.get())); } activation_dml_desc = activation_operator_desc->GetActivationDmlDesc(); @@ -1492,13 +1501,14 @@ if (fusible_activation || conv2d->activation) { CHECK(!(fusible_activation && conv2d->activation)); if (fusible_activation) { - activation_operator_desc = - CreateActivationOperatorDesc(fusible_activation.value()); + ASSIGN_OR_RETURN( + activation_operator_desc, + CreateActivationOperatorDesc(fusible_activation.value())); output_id = GetFusibleActivationOutputId(fusible_activation.value()).value(); } else { - activation_operator_desc = - CreateActivationOperatorDesc(conv2d->activation.get()); + ASSIGN_OR_RETURN(activation_operator_desc, + CreateActivationOperatorDesc(conv2d->activation.get())); } activation_dml_desc = activation_operator_desc->GetActivationDmlDesc(); @@ -1607,8 +1617,9 @@ GetFusibleActivationFromOperation( operation_to_fusible_standalone_activation_map, operation); if (fusible_activation) { - ActivationOperatorDesc activation_operator_desc = - CreateActivationOperatorDesc(fusible_activation.value()); + ASSIGN_OR_RETURN( + ActivationOperatorDesc activation_operator_desc, + CreateActivationOperatorDesc(fusible_activation.value())); DML_OPERATOR_DESC activation_dml_desc = activation_operator_desc.GetActivationDmlDesc(); @@ -2655,8 +2666,8 @@ std::optional<ActivationOperatorDesc> activation_operator_desc; std::optional<DML_OPERATOR_DESC> activation_dml_desc; if (fusible_activation) { - activation_operator_desc = - CreateActivationOperatorDesc(fusible_activation.value()); + ASSIGN_OR_RETURN(activation_operator_desc, + CreateActivationOperatorDesc(fusible_activation.value())); activation_dml_desc = activation_operator_desc->GetActivationDmlDesc(); output_id = @@ -2974,8 +2985,9 @@ std::vector<ActivationOperatorDesc> activation_operator_descs; activation_operator_descs.reserve(activations.size()); for (const auto& activation : activations) { - activation_operator_descs.push_back( - CreateActivationOperatorDesc(activation.get())); + ASSIGN_OR_RETURN(ActivationOperatorDesc activation_operator_desc, + CreateActivationOperatorDesc(activation.get())); + activation_operator_descs.push_back(std::move(activation_operator_desc)); } // For bidirectional, activations must be provided f() and g() for forward // followed by f() and g() for backwards. @@ -3239,8 +3251,8 @@ std::optional<ActivationOperatorDesc> activation_operator_desc; std::optional<DML_OPERATOR_DESC> activation_dml_desc; if (fusible_activation) { - activation_operator_desc = - CreateActivationOperatorDesc(fusible_activation.value()); + ASSIGN_OR_RETURN(activation_operator_desc, + CreateActivationOperatorDesc(fusible_activation.value())); activation_dml_desc = activation_operator_desc->GetActivationDmlDesc(); output_id = @@ -3650,8 +3662,9 @@ std::vector<ActivationOperatorDesc> activation_operator_descs; activation_operator_descs.reserve(activations.size()); for (const auto& activation : activations) { - activation_operator_descs.push_back( - CreateActivationOperatorDesc(activation.get())); + ASSIGN_OR_RETURN(ActivationOperatorDesc activation_operator_desc, + CreateActivationOperatorDesc(activation.get())); + activation_operator_descs.push_back(std::move(activation_operator_desc)); } // When the recurrent network is bidirectional, dual activations must be // provided for the forward and backward directions. @@ -3782,8 +3795,8 @@ std::optional<ActivationOperatorDesc> activation_operator_desc; std::optional<DML_OPERATOR_DESC> activation_dml_desc; if (fusible_activation) { - activation_operator_desc = - CreateActivationOperatorDesc(fusible_activation.value()); + ASSIGN_OR_RETURN(activation_operator_desc, + CreateActivationOperatorDesc(fusible_activation.value())); activation_dml_desc = activation_operator_desc->GetActivationDmlDesc(); output_id =
diff --git a/services/webnn/tflite/context_impl.cc b/services/webnn/tflite/context_impl.cc index 27a848c..346b9b9 100644 --- a/services/webnn/tflite/context_impl.cc +++ b/services/webnn/tflite/context_impl.cc
@@ -4,21 +4,36 @@ #include "services/webnn/tflite/context_impl.h" +#include "base/types/expected_macros.h" +#include "services/webnn/public/mojom/webnn_context_provider.mojom.h" #include "services/webnn/tflite/buffer_impl.h" #include "services/webnn/tflite/graph_impl.h" namespace webnn::tflite { ContextImpl::ContextImpl(mojo::PendingReceiver<mojom::WebNNContext> receiver, - WebNNContextProviderImpl* context_provider) - : WebNNContextImpl(std::move(receiver), context_provider) {} + WebNNContextProviderImpl* context_provider, + mojom::CreateContextOptionsPtr options) + : WebNNContextImpl(std::move(receiver), context_provider), + options_(std::move(options)) {} ContextImpl::~ContextImpl() = default; void ContextImpl::CreateGraphImpl( mojom::GraphInfoPtr graph_info, mojom::WebNNContext::CreateGraphCallback callback) { - GraphImpl::CreateAndBuild(std::move(graph_info), std::move(callback)); + ASSIGN_OR_RETURN(std::unique_ptr<GraphImpl> graph, + GraphImpl::CreateAndBuild(std::move(graph_info), this), + [&callback](mojom::ErrorPtr error) { + std::move(callback).Run( + mojom::CreateGraphResult::NewError(std::move(error))); + }); + + mojo::PendingAssociatedRemote<mojom::WebNNGraph> remote; + graph_receivers_.Add(std::move(graph), + remote.InitWithNewEndpointAndPassReceiver()); + std::move(callback).Run( + mojom::CreateGraphResult::NewGraphRemote(std::move(remote))); } std::unique_ptr<WebNNBufferImpl> ContextImpl::CreateBufferImpl(
diff --git a/services/webnn/tflite/context_impl.h b/services/webnn/tflite/context_impl.h index e95d93c1..5d35e78 100644 --- a/services/webnn/tflite/context_impl.h +++ b/services/webnn/tflite/context_impl.h
@@ -5,6 +5,7 @@ #ifndef SERVICES_WEBNN_TFLITE_CONTEXT_IMPL_H_ #define SERVICES_WEBNN_TFLITE_CONTEXT_IMPL_H_ +#include "mojo/public/cpp/bindings/unique_associated_receiver_set.h" #include "services/webnn/webnn_context_impl.h" namespace webnn::tflite { @@ -14,13 +15,16 @@ class ContextImpl final : public WebNNContextImpl { public: ContextImpl(mojo::PendingReceiver<mojom::WebNNContext> receiver, - WebNNContextProviderImpl* context_provider); + WebNNContextProviderImpl* context_provider, + mojom::CreateContextOptionsPtr options); ContextImpl(const WebNNContextImpl&) = delete; ContextImpl& operator=(const ContextImpl&) = delete; ~ContextImpl() override; + const mojom::CreateContextOptions& options() const { return *options_; } + private: void CreateGraphImpl(mojom::GraphInfoPtr graph_info, CreateGraphCallback callback) override; @@ -29,6 +33,9 @@ mojo::PendingAssociatedReceiver<mojom::WebNNBuffer> receiver, mojom::BufferInfoPtr buffer_info, const base::UnguessableToken& buffer_handle) override; + + mojom::CreateContextOptionsPtr options_; + mojo::UniqueAssociatedReceiverSet<mojom::WebNNGraph> graph_receivers_; }; } // namespace webnn::tflite
diff --git a/services/webnn/tflite/graph_impl.cc b/services/webnn/tflite/graph_impl.cc index cdddfb52..9db9294 100644 --- a/services/webnn/tflite/graph_impl.cc +++ b/services/webnn/tflite/graph_impl.cc
@@ -14,6 +14,7 @@ #include "services/webnn/public/mojom/webnn_context_provider.mojom.h" #include "services/webnn/public/mojom/webnn_error.mojom.h" #include "services/webnn/public/mojom/webnn_graph.mojom.h" +#include "services/webnn/tflite/context_impl.h" #include "services/webnn/tflite/graph_builder.h" #include "services/webnn/tflite/op_resolver.h" #include "services/webnn/webnn_graph_impl.h" @@ -110,10 +111,10 @@ class GraphImpl::ComputeResources { public: static base::expected<std::unique_ptr<ComputeResources>, mojom::ErrorPtr> - Create(scoped_refptr<GraphResources> graph_resources) { + Create(scoped_refptr<GraphResources> graph_resources, ContextImpl* context) { auto self = std::make_unique<ComputeResources>(); - OpResolver op_resolver; + OpResolver op_resolver(context->options()); TfLiteStatus status = ::tflite::InterpreterBuilder( graph_resources->model(), op_resolver)(&self->interpreter_); if (status != kTfLiteOk) { @@ -199,39 +200,28 @@ }; // static -void GraphImpl::CreateAndBuild( - mojom::GraphInfoPtr graph_info, - mojom::WebNNContext::CreateGraphCallback callback) { +base::expected<std::unique_ptr<GraphImpl>, mojom::ErrorPtr> +GraphImpl::CreateAndBuild(mojom::GraphInfoPtr graph_info, + ContextImpl* context) { ASSIGN_OR_RETURN(scoped_refptr<GraphResources> graph_resources, - GraphResources::Create(*graph_info), - [&callback](mojom::ErrorPtr error) { - std::move(callback).Run( - mojom::CreateGraphResult::NewError(std::move(error))); - }); + GraphResources::Create(*graph_info)); ASSIGN_OR_RETURN(std::unique_ptr<ComputeResources> compute_resources, - ComputeResources::Create(graph_resources), - [&callback](mojom::ErrorPtr error) { - std::move(callback).Run( - mojom::CreateGraphResult::NewError(std::move(error))); - }); + ComputeResources::Create(graph_resources, context)); - mojo::PendingAssociatedRemote<mojom::WebNNGraph> graph; - mojo::MakeSelfOwnedAssociatedReceiver<mojom::WebNNGraph>( - base::WrapUnique(new GraphImpl(ComputeResourceInfo(graph_info), - std::move(graph_resources), - std::move(compute_resources))), - graph.InitWithNewEndpointAndPassReceiver()); - std::move(callback).Run( - mojom::CreateGraphResult::NewGraphRemote(std::move(graph))); + return base::WrapUnique(new GraphImpl(ComputeResourceInfo(graph_info), + std::move(graph_resources), + std::move(compute_resources), context)); } GraphImpl::~GraphImpl() = default; GraphImpl::GraphImpl(ComputeResourceInfo compute_resource_info, scoped_refptr<GraphResources> graph_resources, - std::unique_ptr<ComputeResources> compute_resources) + std::unique_ptr<ComputeResources> compute_resources, + ContextImpl* context) : WebNNGraphImpl(std::move(compute_resource_info)), + context_(context), graph_resources_(std::move(graph_resources)), compute_resources_(std::move(compute_resources)) {} @@ -242,7 +232,7 @@ auto compute_resources = std::move(compute_resources_); if (!compute_resources) { ASSIGN_OR_RETURN(compute_resources, - ComputeResources::Create(graph_resources_), + ComputeResources::Create(graph_resources_, context_), [&callback](mojom::ErrorPtr error) { std::move(callback).Run( mojom::ComputeResult::NewError(std::move(error)));
diff --git a/services/webnn/tflite/graph_impl.h b/services/webnn/tflite/graph_impl.h index 6484a65d..ae630555 100644 --- a/services/webnn/tflite/graph_impl.h +++ b/services/webnn/tflite/graph_impl.h
@@ -12,20 +12,23 @@ #include "base/containers/flat_map.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" +#include "base/types/expected.h" #include "mojo/public/cpp/base/big_buffer.h" #include "services/webnn/public/mojom/webnn_graph.mojom-forward.h" #include "services/webnn/webnn_graph_impl.h" namespace webnn::tflite { +class ContextImpl; + // GraphImpl inherits from WebNNGraphImpl to represent a TFLite graph // implementation. It is mainly responsible for building a TFLite flatbuffer // model from mojom::GraphInfo via tflite::GraphBuilder, then initializing and // executing the graph. class GraphImpl final : public WebNNGraphImpl { public: - static void CreateAndBuild(mojom::GraphInfoPtr graph_info, - mojom::WebNNContext::CreateGraphCallback callback); + static base::expected<std::unique_ptr<GraphImpl>, mojom::ErrorPtr> + CreateAndBuild(mojom::GraphInfoPtr graph_info, ContextImpl* context); GraphImpl(const GraphImpl&) = delete; GraphImpl& operator=(const GraphImpl&) = delete; @@ -41,7 +44,8 @@ GraphImpl(ComputeResourceInfo compute_resource_info, scoped_refptr<GraphResources> graph_resources, - std::unique_ptr<ComputeResources> compute_resources); + std::unique_ptr<ComputeResources> compute_resources, + ContextImpl* context); // Execute the compiled platform graph asynchronously. The `named_inputs` were // validated in base class so we can use them to compute directly, the result @@ -51,6 +55,9 @@ void OnComputeComplete(ComputeCallback callback, AsyncComputeResult result); + // This class is owned by the `UniqueAssociatedReceiverSet` in `ContextImpl`. + raw_ptr<ContextImpl> context_; + scoped_refptr<GraphResources> graph_resources_; std::unique_ptr<ComputeResources> compute_resources_; base::WeakPtrFactory<GraphImpl> weak_factory_{this};
diff --git a/services/webnn/tflite/op_resolver.cc b/services/webnn/tflite/op_resolver.cc index e6eb28e4..3aa2483 100644 --- a/services/webnn/tflite/op_resolver.cc +++ b/services/webnn/tflite/op_resolver.cc
@@ -4,16 +4,22 @@ #include "services/webnn/tflite/op_resolver.h" +#include "services/webnn/public/mojom/webnn_context_provider.mojom.h" #include "third_party/tflite/buildflags.h" #include "third_party/tflite/src/tensorflow/lite/kernels/builtin_op_kernels.h" +#if BUILDFLAG(BUILD_TFLITE_WITH_NNAPI) +#include "third_party/tflite/src/tensorflow/lite/core/c/c_api_types.h" +#include "third_party/tflite/src/tensorflow/lite/delegates/nnapi/nnapi_delegate.h" +#endif + #if BUILDFLAG(BUILD_TFLITE_WITH_XNNPACK) #include "third_party/tflite/src/tensorflow/lite/tflite_with_xnnpack_optional.h" #endif namespace webnn::tflite { -OpResolver::OpResolver() { +OpResolver::OpResolver(const mojom::CreateContextOptions& options) { AddBuiltin(::tflite::BuiltinOperator_ABS, ::tflite::ops::builtin::Register_ABS()); AddBuiltin(::tflite::BuiltinOperator_AVERAGE_POOL_2D, @@ -205,6 +211,19 @@ /* min_version = */ 1, /* max_version = */ 4); +#if BUILDFLAG(BUILD_TFLITE_WITH_NNAPI) + if (options.device == mojom::CreateContextOptions::Device::kNpu) { + delegate_creators_.push_back([](TfLiteContext* context) { + return std::unique_ptr<TfLiteDelegate, void (*)(TfLiteDelegate*)>( + new ::tflite::StatefulNnApiDelegate(), [](TfLiteDelegate* delegate) { + // Cast `delegate` back to a C++ object type so that the correct + // destructor is invoked. + delete static_cast<::tflite::StatefulNnApiDelegate*>(delegate); + }); + }); + } +#endif + #if BUILDFLAG(BUILD_TFLITE_WITH_XNNPACK) delegate_creators_.push_back([](TfLiteContext* context) { return ::tflite::MaybeCreateXNNPACKDelegate(
diff --git a/services/webnn/tflite/op_resolver.h b/services/webnn/tflite/op_resolver.h index 413c202..eb27c78b 100644 --- a/services/webnn/tflite/op_resolver.h +++ b/services/webnn/tflite/op_resolver.h
@@ -5,6 +5,7 @@ #ifndef SERVICES_WEBNN_TFLITE_OP_RESOLVER_H_ #define SERVICES_WEBNN_TFLITE_OP_RESOLVER_H_ +#include "services/webnn/public/mojom/webnn_context_provider.mojom-forward.h" #include "third_party/tflite/src/tensorflow/lite/mutable_op_resolver.h" namespace webnn::tflite { @@ -13,7 +14,7 @@ // operations for the Chromium build of TFLite and registers them for use. class OpResolver : public ::tflite::MutableOpResolver { public: - OpResolver(); + explicit OpResolver(const mojom::CreateContextOptions& options); }; } // namespace webnn::tflite
diff --git a/services/webnn/webnn_context_provider_impl.cc b/services/webnn/webnn_context_provider_impl.cc index 594a3da..8915b87a5 100644 --- a/services/webnn/webnn_context_provider_impl.cc +++ b/services/webnn/webnn_context_provider_impl.cc
@@ -177,7 +177,8 @@ #if BUILDFLAG(IS_CHROMEOS) auto* context_impl = new tflite::ContextImplCrOS(std::move(receiver), this); #else - auto* context_impl = new tflite::ContextImpl(std::move(receiver), this); + auto* context_impl = + new tflite::ContextImpl(std::move(receiver), this, std::move(options)); #endif impls_.push_back(base::WrapUnique<WebNNContextImpl>(context_impl)); std::move(callback).Run(
diff --git a/services/webnn/webnn_graph_impl_backend_test.cc b/services/webnn/webnn_graph_impl_backend_test.cc index fcba70c..78f7a3e 100644 --- a/services/webnn/webnn_graph_impl_backend_test.cc +++ b/services/webnn/webnn_graph_impl_backend_test.cc
@@ -2784,6 +2784,7 @@ .values = {1, 0, 1, 0, 0, 0}}} .Test(*this); } +#endif // !BUILDFLAG(WEBNN_USE_TFLITE) && !BUILDFLAG(IS_MAC) { ElementWiseUnaryTester<float>{ .input = test_operand_info_float32_scalar, @@ -2812,6 +2813,7 @@ .output = test_operand_info_int32} .Test(*this); } +#if !BUILDFLAG(WEBNN_USE_TFLITE) && !BUILDFLAG(IS_MAC) { ElementWiseUnaryTester<int8_t>{ .input = test_operand_info_int8, @@ -2854,7 +2856,7 @@ // TODO(https://crbug.com/326356909): Enable these tests when using TFLite, // after adding support for float16 and other unary operators. -#if !BUILDFLAG(WEBNN_USE_TFLITE) && !BUILDFLAG(IS_MAC) +#if !BUILDFLAG(WEBNN_USE_TFLITE) { ElementWiseUnaryTester<float16>{ .input = {.type = mojom::Operand::DataType::kFloat16, @@ -2866,7 +2868,7 @@ .values = Float16FromFloat32({0, 2, 5, 4, 8, 7})}} .Test(*this); } -#endif // !BUILDFLAG(WEBNN_USE_TFLITE) && !BUILDFLAG(IS_MAC) +#endif // !BUILDFLAG(WEBNN_USE_TFLITE) #if !BUILDFLAG(WEBNN_USE_TFLITE) { ElementWiseUnaryTester<float>{ @@ -2880,7 +2882,7 @@ .Test(*this); } #endif // !BUILDFLAG(WEBNN_USE_TFLITE) -#if !BUILDFLAG(WEBNN_USE_TFLITE) && !BUILDFLAG(IS_MAC) +#if !BUILDFLAG(WEBNN_USE_TFLITE) { ElementWiseUnaryTester<float16>{ .input = {.type = mojom::Operand::DataType::kFloat16, @@ -2892,7 +2894,7 @@ .values = Float16FromFloat32({0, 1, 0, 1, 1, -1})}} .Test(*this); } -#endif // !BUILDFLAG(WEBNN_USE_TFLITE) && !BUILDFLAG(IS_MAC) +#endif // !BUILDFLAG(WEBNN_USE_TFLITE) #if !BUILDFLAG(WEBNN_USE_TFLITE) { ElementWiseUnaryTester<float>{ @@ -2907,7 +2909,7 @@ .Test(*this); } #endif // !BUILDFLAG(WEBNN_USE_TFLITE) -#if !BUILDFLAG(WEBNN_USE_TFLITE) && !BUILDFLAG(IS_MAC) +#if !BUILDFLAG(WEBNN_USE_TFLITE) { ElementWiseUnaryTester<float16>{ .input = {.type = mojom::Operand::DataType::kFloat16, @@ -2921,8 +2923,7 @@ std::numeric_limits<float>::infinity()})}} .Test(*this); } -#endif // !BUILDFLAG(WEBNN_USE_TFLITE) && !BUILDFLAG(IS_MAC) -#if !BUILDFLAG(IS_MAC) +#endif // !BUILDFLAG(WEBNN_USE_TFLITE) { ElementWiseUnaryTester<float>{ .input = {.type = mojom::Operand::DataType::kFloat32, @@ -2934,7 +2935,6 @@ .values = {1, 4, 2, 16, 64, 0}}} .Test(*this); } -#endif // !BUILDFLAG(IS_MAC) { ElementWiseUnaryTester<float>{ .input = {.type = mojom::Operand::DataType::kFloat32, @@ -2971,7 +2971,7 @@ // TODO(https://crbug.com/326356909): Enable these tests when using TFLite, // after adding support for other unary operators. -#if !BUILDFLAG(WEBNN_USE_TFLITE) && !BUILDFLAG(IS_MAC) +#if !BUILDFLAG(WEBNN_USE_TFLITE) { ElementWiseUnaryTester<float16>{ .input = {.type = mojom::Operand::DataType::kFloat16, @@ -2983,7 +2983,7 @@ .values = Float16FromFloat32({-2, 0, 1, -3, 0, 2})}} .Test(*this); } -#endif // !BUILDFLAG(WEBNN_USE_TFLITE) && !BUILDFLAG(IS_MAC) +#endif // !BUILDFLAG(WEBNN_USE_TFLITE) { ElementWiseUnaryTester<float>{ .input = {.type = mojom::Operand::DataType::kFloat32,
diff --git a/testing/buildbot/chromium.cft.json b/testing/buildbot/chromium.cft.json index ef7a1eb..f72531a 100644 --- a/testing/buildbot/chromium.cft.json +++ b/testing/buildbot/chromium.cft.json
@@ -1,1963 +1,6 @@ { "AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {}, "AAAAA2 See generate_buildbot_json.py to make changes": {}, - "linux-arm64-rel-cft": { - "additional_compile_targets": [ - "all" - ], - "gtest_tests": [ - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "absl_hardening_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "absl_hardening_tests", - "test_id_prefix": "ninja://third_party/abseil-cpp:absl_hardening_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "accessibility_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "accessibility_unittests", - "test_id_prefix": "ninja://ui/accessibility:accessibility_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "angle_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_unittests", - "test_id_prefix": "ninja://third_party/angle/src/tests:angle_unittests/", - "use_isolated_scripts_api": true - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "app_shell_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "app_shell_unittests", - "test_id_prefix": "ninja://extensions/shell:app_shell_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "aura_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "aura_unittests", - "test_id_prefix": "ninja://ui/aura:aura_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "base_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "base_unittests", - "test_id_prefix": "ninja://base:base_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "blink_common_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_common_unittests", - "test_id_prefix": "ninja://third_party/blink/common:blink_common_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "blink_fuzzer_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_fuzzer_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_fuzzer_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "blink_heap_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_heap_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform/heap:blink_heap_unittests/" - }, - { - "args": [ - "--git-revision=${got_revision}" - ], - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "blink_platform_unittests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_platform_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_platform_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "boringssl_crypto_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "boringssl_crypto_tests", - "test_id_prefix": "ninja://third_party/boringssl:boringssl_crypto_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "boringssl_ssl_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "boringssl_ssl_tests", - "test_id_prefix": "ninja://third_party/boringssl:boringssl_ssl_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "browser_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 10 - }, - "test": "browser_tests", - "test_id_prefix": "ninja://chrome/test:browser_tests/" - }, - { - "args": [ - "--gtest_filter=-*UsingRealWebcam*" - ], - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "capture_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "capture_unittests", - "test_id_prefix": "ninja://media/capture:capture_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "cast_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cast_unittests", - "test_id_prefix": "ninja://media/cast:cast_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "cc_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cc_unittests", - "test_id_prefix": "ninja://cc:cc_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "chrome_app_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chrome_app_unittests", - "test_id_prefix": "ninja://chrome/test:chrome_app_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "chromedriver_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chromedriver_unittests", - "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "components_browsertests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "components_browsertests", - "test_id_prefix": "ninja://components:components_browsertests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "components_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "components_unittests", - "test_id_prefix": "ninja://components:components_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "compositor_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "compositor_unittests", - "test_id_prefix": "ninja://ui/compositor:compositor_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "content_browsertests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 8 - }, - "test": "content_browsertests", - "test_id_prefix": "ninja://content/test:content_browsertests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "content_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "content_unittests", - "test_id_prefix": "ninja://content/test:content_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "crashpad_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "crashpad_tests", - "test_id_prefix": "ninja://third_party/crashpad/crashpad:crashpad_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "cronet_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cronet_tests", - "test_id_prefix": "ninja://components/cronet:cronet_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "cronet_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cronet_unittests", - "test_id_prefix": "ninja://components/cronet:cronet_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "crypto_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "crypto_unittests", - "test_id_prefix": "ninja://crypto:crypto_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "dbus_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dbus_unittests", - "test_id_prefix": "ninja://dbus:dbus_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "device_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "device_unittests", - "test_id_prefix": "ninja://device:device_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "display_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "display_unittests", - "test_id_prefix": "ninja://ui/display:display_unittests/" - }, - { - "ci_only": true, - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "env_chromium_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "env_chromium_unittests", - "test_id_prefix": "ninja://third_party/leveldatabase:env_chromium_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "events_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "events_unittests", - "test_id_prefix": "ninja://ui/events:events_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "extensions_browsertests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "extensions_browsertests", - "test_id_prefix": "ninja://extensions:extensions_browsertests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "extensions_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "extensions_unittests", - "test_id_prefix": "ninja://extensions:extensions_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "filesystem_service_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "filesystem_service_unittests", - "test_id_prefix": "ninja://components/services/filesystem:filesystem_service_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gcm_unit_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gcm_unit_tests", - "test_id_prefix": "ninja://google_apis/gcm:gcm_unit_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gfx_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gfx_unittests", - "test_id_prefix": "ninja://ui/gfx:gfx_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gin_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gin_unittests", - "test_id_prefix": "ninja://gin:gin_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "google_apis_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "google_apis_unittests", - "test_id_prefix": "ninja://google_apis:google_apis_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gpu_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gpu_unittests", - "test_id_prefix": "ninja://gpu:gpu_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gwp_asan_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gwp_asan_unittests", - "test_id_prefix": "ninja://components/gwp_asan:gwp_asan_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "headless_browsertests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "headless_browsertests", - "test_id_prefix": "ninja://headless:headless_browsertests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "headless_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "headless_unittests", - "test_id_prefix": "ninja://headless:headless_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "interactive_ui_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 3 - }, - "test": "interactive_ui_tests", - "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "ipc_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ipc_tests", - "test_id_prefix": "ninja://ipc:ipc_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "latency_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "latency_unittests", - "test_id_prefix": "ninja://ui/latency:latency_unittests/" - }, - { - "ci_only": true, - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "leveldb_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "leveldb_unittests", - "test_id_prefix": "ninja://third_party/leveldatabase:leveldb_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "libjingle_xmpp_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "libjingle_xmpp_unittests", - "test_id_prefix": "ninja://third_party/libjingle_xmpp:libjingle_xmpp_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "liburlpattern_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "liburlpattern_unittests", - "test_id_prefix": "ninja://third_party/liburlpattern:liburlpattern_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "media_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "media_unittests", - "test_id_prefix": "ninja://media:media_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "message_center_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "message_center_unittests", - "test_id_prefix": "ninja://ui/message_center:message_center_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "midi_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "midi_unittests", - "test_id_prefix": "ninja://media/midi:midi_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "mojo_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "mojo_unittests", - "test_id_prefix": "ninja://mojo:mojo_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "native_theme_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "native_theme_unittests", - "test_id_prefix": "ninja://ui/native_theme:native_theme_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "net_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "net_unittests", - "test_id_prefix": "ninja://net:net_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "openscreen_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "openscreen_unittests", - "test_id_prefix": "ninja://chrome/browser/media/router:openscreen_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "ozone_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ozone_unittests", - "test_id_prefix": "ninja://ui/ozone:ozone_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "ozone_x11_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ozone_x11_unittests", - "test_id_prefix": "ninja://ui/ozone:ozone_x11_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "pdf_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "pdf_unittests", - "test_id_prefix": "ninja://pdf:pdf_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "perfetto_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "perfetto_unittests", - "test_id_prefix": "ninja://third_party/perfetto:perfetto_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "printing_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "printing_unittests", - "test_id_prefix": "ninja://printing:printing_unittests/" - }, - { - "ci_only": true, - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "pthreadpool_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "pthreadpool_unittests", - "test_id_prefix": "ninja://third_party/pthreadpool:pthreadpool_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "sandbox_linux_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sandbox_linux_unittests", - "test_id_prefix": "ninja://sandbox/linux:sandbox_linux_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "services_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "services_unittests", - "test_id_prefix": "ninja://services:services_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "shell_dialogs_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "shell_dialogs_unittests", - "test_id_prefix": "ninja://ui/shell_dialogs:shell_dialogs_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "skia_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "skia_unittests", - "test_id_prefix": "ninja://skia:skia_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "snapshot_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "snapshot_unittests", - "test_id_prefix": "ninja://ui/snapshot:snapshot_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "sql_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sql_unittests", - "test_id_prefix": "ninja://sql:sql_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "storage_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "storage_unittests", - "test_id_prefix": "ninja://storage:storage_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "sync_integration_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 3 - }, - "test": "sync_integration_tests", - "test_id_prefix": "ninja://chrome/test:sync_integration_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "ui_base_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ui_base_unittests", - "test_id_prefix": "ninja://ui/base:ui_base_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "ui_touch_selection_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ui_touch_selection_unittests", - "test_id_prefix": "ninja://ui/touch_selection:ui_touch_selection_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "ui_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ui_unittests", - "test_id_prefix": "ninja://ui/tests:ui_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "unit_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "unit_tests", - "test_id_prefix": "ninja://chrome/test:unit_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "url_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "url_unittests", - "test_id_prefix": "ninja://url:url_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "views_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "views_unittests", - "test_id_prefix": "ninja://ui/views:views_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "viz_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "viz_unittests", - "test_id_prefix": "ninja://components/viz:viz_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "webkit_unit_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/controller:blink_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "wm_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "wm_unittests", - "test_id_prefix": "ninja://ui/wm:wm_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "wtf_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "wtf_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform/wtf:wtf_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "xr_browser_tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "xr_browser_tests", - "test_id_prefix": "ninja://chrome/test:xr_browser_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "zlib_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "zlib_unittests", - "test_id_prefix": "ninja://third_party/zlib:zlib_unittests/" - } - ], - "isolated_scripts": [ - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "blink_python_tests", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_python_tests", - "test_id_prefix": "ninja://:blink_python_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "blink_pytype", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_pytype", - "test_id_prefix": "ninja://third_party/blink/tools:blink_pytype/" - }, - { - "args": [ - "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" - ], - "isolate_profile_data": true, - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "blink_web_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "results_handler": "layout tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 5 - }, - "test": "blink_web_tests", - "test_id_prefix": "ninja://:blink_web_tests/" - }, - { - "args": [ - "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" - ], - "isolate_profile_data": true, - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "blink_wpt_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "results_handler": "layout tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 - }, - "test": "blink_wpt_tests", - "test_id_prefix": "ninja://:blink_wpt_tests/" - }, - { - "args": [ - "--test-type=integration" - ], - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "chromedriver_py_tests", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chromedriver_py_tests", - "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_py_tests/" - }, - { - "args": [ - "--test-type=integration" - ], - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "chromedriver_py_tests_headless_shell", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chromedriver_py_tests_headless_shell", - "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_py_tests_headless_shell/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "chromedriver_replay_unittests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chromedriver_replay_unittests", - "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_replay_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "content_shell_crash_test", - "resultdb": { - "enable": true, - "result_format": "single" - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "content_shell_crash_test", - "test_id_prefix": "ninja://content/shell:content_shell_crash_test/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "flatbuffers_unittests", - "resultdb": { - "enable": true, - "result_format": "single" - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "flatbuffers_unittests", - "test_id_prefix": "ninja://third_party/flatbuffers:flatbuffers_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "fuchsia_pytype", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "fuchsia_pytype", - "test_id_prefix": "ninja://testing:fuchsia_pytype/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "gold_common_pytype", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gold_common_pytype", - "test_id_prefix": "ninja://build:gold_common_pytype/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "gpu_pytype", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gpu_pytype", - "test_id_prefix": "ninja://content/test:gpu_pytype/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "grit_python_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "grit_python_unittests", - "test_id_prefix": "ninja://tools/grit:grit_python_unittests/" - }, - { - "args": [ - "--flag-specific=highdpi", - "--skipped=always", - "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" - ], - "isolate_profile_data": true, - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "high_dpi_blink_web_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "results_handler": "layout tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_web_tests", - "test_id_prefix": "ninja://:blink_web_tests/" - }, - { - "args": [ - "--flag-specific=highdpi", - "--skipped=always", - "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" - ], - "isolate_profile_data": true, - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "high_dpi_blink_wpt_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "results_handler": "layout tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 3 - }, - "test": "blink_wpt_tests", - "test_id_prefix": "ninja://:blink_wpt_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "mojo_python_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "mojo_python_unittests", - "test_id_prefix": "ninja://mojo/public/tools:mojo_python_unittests/" - }, - { - "args": [ - "--flag-specific=disable-site-isolation-trials", - "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" - ], - "isolate_profile_data": true, - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "not_site_per_process_blink_web_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "results_handler": "layout tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 8 - }, - "test": "blink_web_tests", - "test_id_prefix": "ninja://:blink_web_tests/" - }, - { - "args": [ - "--flag-specific=disable-site-isolation-trials", - "--num-retries=3", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" - ], - "isolate_profile_data": true, - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "not_site_per_process_blink_wpt_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "results_handler": "layout tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 10 - }, - "test": "blink_wpt_tests", - "test_id_prefix": "ninja://:blink_wpt_tests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "telemetry_gpu_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "telemetry_gpu_unittests", - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_unittests/" - }, - { - "args": [ - "--extra-browser-args=--enable-crashpad" - ], - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "telemetry_perf_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 12 - }, - "test": "telemetry_perf_unittests", - "test_id_prefix": "ninja://chrome/test:telemetry_perf_unittests/" - }, - { - "args": [ - "--jobs=1", - "--extra-browser-args=--disable-gpu" - ], - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "telemetry_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 8 - }, - "test": "telemetry_unittests", - "test_id_prefix": "ninja://chrome/test:telemetry_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "testing_pytype", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "testing_pytype", - "test_id_prefix": "ninja://testing:testing_pytype/" - }, - { - "args": [ - "--gtest-benchmark-name=views_perftests" - ], - "isolate_profile_data": true, - "merge": { - "args": [ - "--smoke-test-mode" - ], - "script": "//tools/perf/process_perf_results.py" - }, - "name": "views_perftests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "views_perftests", - "test_id_prefix": "ninja://ui/views:views_perftests/" - }, - { - "args": [ - "--num-retries=3", - "--skipped=always", - "--flag-specific=skia-vulkan-swiftshader", - "--write-run-histories-to=${ISOLATED_OUTDIR}/run_histories.json" - ], - "isolate_profile_data": true, - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "vulkan_swiftshader_blink_web_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "results_handler": "layout tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_web_tests", - "test_id_prefix": "ninja://:blink_web_tests/" - }, - { - "args": [ - "--test-type=wdspec" - ], - "isolate_profile_data": true, - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "webdriver_wpt_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "results_handler": "layout tests", - "swarming": { - "dimensions": { - "cpu": "arm64", - "os": "Ubuntu-20.04" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "chrome_wpt_tests", - "test_id_prefix": "ninja://:chrome_wpt_tests/" - } - ], - "scripts": [ - { - "isolate_profile_data": true, - "name": "check_network_annotations", - "script": "check_network_annotations.py" - }, - { - "isolate_profile_data": true, - "name": "check_static_initializers", - "script": "check_static_initializers.py" - }, - { - "isolate_profile_data": true, - "name": "checkdeps", - "script": "checkdeps.py" - }, - { - "isolate_profile_data": true, - "name": "checkperms", - "script": "checkperms.py" - }, - { - "isolate_profile_data": true, - "name": "metrics_python_tests", - "script": "metrics_python_tests.py" - }, - { - "isolate_profile_data": true, - "name": "webkit_lint", - "script": "blink_lint_expectations.py" - } - ] - }, "linux-rel-cft": { "additional_compile_targets": [ "all"
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 01e55b63..cccb32b 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -5487,9 +5487,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_v126.0.6438.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5499,8 +5499,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ], "dimensions": { @@ -5547,9 +5547,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_v123.0.6312.132/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5559,8 +5559,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ], "dimensions": { @@ -5643,9 +5643,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_v126.0.6438.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5655,8 +5655,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ], "dimensions": { @@ -5703,9 +5703,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_v123.0.6312.132/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5715,8 +5715,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.coverage.json b/testing/buildbot/chromium.coverage.json index 20eab2c..82c4608c4 100644 --- a/testing/buildbot/chromium.coverage.json +++ b/testing/buildbot/chromium.coverage.json
@@ -19663,9 +19663,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_v126.0.6438.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -19675,8 +19675,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ], "dimensions": { @@ -19723,9 +19723,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_v123.0.6312.132/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -19735,8 +19735,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ], "dimensions": { @@ -19819,9 +19819,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_v126.0.6438.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -19831,8 +19831,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ], "dimensions": { @@ -19879,9 +19879,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_v123.0.6312.132/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -19891,8 +19891,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 5f66f374..aeef31be 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -41837,9 +41837,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_v126.0.6438.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -41848,8 +41848,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ], "dimensions": { @@ -41895,9 +41895,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_v123.0.6312.132/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -41906,8 +41906,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ], "dimensions": { @@ -41987,9 +41987,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_v126.0.6438.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -41998,8 +41998,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ], "dimensions": { @@ -42045,9 +42045,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_v123.0.6312.132/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -42056,8 +42056,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ], "dimensions": { @@ -43336,9 +43336,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_v126.0.6438.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -43348,8 +43348,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ], "dimensions": { @@ -43396,9 +43396,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_v123.0.6312.132/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -43408,8 +43408,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ], "dimensions": { @@ -43492,9 +43492,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_v126.0.6438.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -43504,8 +43504,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ], "dimensions": { @@ -43552,9 +43552,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_v123.0.6312.132/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -43564,8 +43564,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ], "dimensions": { @@ -44817,9 +44817,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_v126.0.6438.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -44828,8 +44828,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ], "dimensions": { @@ -44875,9 +44875,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_v123.0.6312.132/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -44886,8 +44886,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ], "dimensions": { @@ -44967,9 +44967,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_v126.0.6438.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -44978,8 +44978,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ], "dimensions": { @@ -45025,9 +45025,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_v123.0.6312.132/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45036,8 +45036,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index b7fcad7..426d5a7e 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -26331,23 +26331,296 @@ ] }, "Win10 FYI x64 Release (Intel UHD 770)": { + "gtest_tests": [ + { + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "angle_unittests", + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "angle_unittests", + "test_id_prefix": "ninja://third_party/angle/src/tests:angle_unittests/", + "use_isolated_scripts_api": true + }, + { + "args": [ + "--use-cmd-decoder=passthrough", + "--use-gl=angle", + "--use-gpu-in-tests", + "--test-launcher-filter-file=../../testing/buildbot/filters/win.uhd_770.gl_tests_passthrough.filter" + ], + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "gl_tests_passthrough", + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 2 + }, + "test": "gl_tests", + "test_id_prefix": "ninja://gpu:gl_tests/" + }, + { + "args": [ + "--use-gpu-in-tests", + "--git-revision=${got_revision}" + ], + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "gl_unittests", + "precommit_args": [ + "--gerrit-issue=${patch_issue}", + "--gerrit-patchset=${patch_set}", + "--buildbucket-id=${buildbucket_build_id}" + ], + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gl_unittests", + "test_id_prefix": "ninja://ui/gl:gl_unittests/" + }, + { + "args": [ + "--use-gpu-in-tests", + "--use-angle=d3d9" + ], + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "gles2_conform_d3d9_test", + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gles2_conform_test", + "test_id_prefix": "ninja://gpu/gles2_conform_support:gles2_conform_test/" + }, + { + "args": [ + "--use-gpu-in-tests", + "--use-angle=gl", + "--disable-gpu-sandbox" + ], + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "gles2_conform_gl_test", + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gles2_conform_test", + "test_id_prefix": "ninja://gpu/gles2_conform_support:gles2_conform_test/" + }, + { + "args": [ + "--use-gpu-in-tests" + ], + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "gles2_conform_test", + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gles2_conform_test", + "test_id_prefix": "ninja://gpu/gles2_conform_support:gles2_conform_test/" + }, + { + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "gpu_unittests", + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gpu_unittests", + "test_id_prefix": "ninja://gpu:gpu_unittests/" + }, + { + "args": [ + "--gtest_filter=MediaFoundationEncryptedMediaTest*", + "--use-gpu-in-tests" + ], + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "media_foundation_browser_tests", + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "browser_tests", + "test_id_prefix": "ninja://chrome/test:browser_tests/" + }, + { + "args": [ + "--gtest_filter=WebNN*", + "--use-gpu-in-tests" + ], + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "services_webnn_unittests", + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "services_unittests", + "test_id_prefix": "ninja://services:services_unittests/" + }, + { + "args": [ + "--enable-gpu", + "--test-launcher-bot-mode", + "--test-launcher-jobs=1", + "--gtest_filter=TabCaptureApiPixelTest.EndToEnd*" + ], + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "tab_capture_end2end_tests", + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "browser_tests", + "test_id_prefix": "ninja://chrome/test:browser_tests/" + }, + { + "args": [ + "--ignore-runtime-requirements=*", + "--gtest_filter=-WebXrVrOpenXrBrowserTest.TestNoStalledFrameLoop" + ], + "merge": { + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "xr_browser_tests", + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "xr_browser_tests", + "test_id_prefix": "ninja://chrome/test:xr_browser_tests/" + } + ], "isolated_scripts": [ { "args": [ - "noop_sleep", + "context_lost", "--show-stdout", "--browser=release_x64", "--passthrough", "-v", "--stable-jobs", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle", "--enforce-browser-version", "--jobs=4" ], "merge": { "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "noop_sleep_tests", + "name": "context_lost_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, "swarming": { "containment_type": "AUTO", "dimensions": { @@ -26363,6 +26636,469 @@ }, "test": "telemetry_gpu_integration_test", "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "expected_color", + "--show-stdout", + "--browser=release_x64", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle", + "--enforce-browser-version", + "--dont-restore-color-profile-after-test", + "--test-machine-name", + "${buildername}", + "--git-revision=${got_revision}", + "--jobs=4" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "expected_color_pixel_passthrough_test", + "precommit_args": [ + "--gerrit-issue=${patch_issue}", + "--gerrit-patchset=${patch_set}", + "--buildbucket-id=${buildbucket_build_id}" + ], + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "idempotent": false, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "telemetry_gpu_integration_test", + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "gpu_process", + "--show-stdout", + "--browser=release_x64", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--enforce-browser-version", + "--jobs=4" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "gpu_process_launch_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "idempotent": false, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "telemetry_gpu_integration_test", + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "hardware_accelerated_feature", + "--show-stdout", + "--browser=release_x64", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--enforce-browser-version", + "--jobs=4" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "hardware_accelerated_feature_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "idempotent": false, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "telemetry_gpu_integration_test", + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "info_collection", + "--show-stdout", + "--browser=release_x64", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --force_high_performance_gpu", + "--enforce-browser-version", + "--expected-vendor-id", + "8086", + "--expected-device-id", + "4680", + "--jobs=4" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "info_collection_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "idempotent": false, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "telemetry_gpu_integration_test", + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "pixel", + "--show-stdout", + "--browser=release_x64", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle", + "--enforce-browser-version", + "--dont-restore-color-profile-after-test", + "--test-machine-name", + "${buildername}", + "--git-revision=${got_revision}", + "--jobs=4" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "pixel_skia_gold_passthrough_test", + "precommit_args": [ + "--gerrit-issue=${patch_issue}", + "--gerrit-patchset=${patch_set}", + "--buildbucket-id=${buildbucket_build_id}" + ], + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "idempotent": false, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "telemetry_gpu_integration_test", + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "screenshot_sync", + "--show-stdout", + "--browser=release_x64", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle", + "--enforce-browser-version", + "--dont-restore-color-profile-after-test", + "--jobs=4" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "screenshot_sync_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "idempotent": false, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "telemetry_gpu_integration_test", + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "trace_test", + "--show-stdout", + "--browser=release_x64", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--enforce-browser-version", + "--jobs=4" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "trace_test", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "idempotent": false, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "telemetry_gpu_integration_test", + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "webcodecs", + "--show-stdout", + "--browser=release_x64", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--enforce-browser-version", + "--jobs=4" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "webcodecs_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "idempotent": false, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "telemetry_gpu_integration_test", + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "webgl2_conformance", + "--show-stdout", + "--browser=release_x64", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=d3d11 --use-cmd-decoder=passthrough --force_high_performance_gpu", + "--enforce-browser-version", + "--webgl-conformance-version=2.0.1", + "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl2_conformance_win_runtimes.json", + "--jobs=2" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "webgl2_conformance_d3d11_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "idempotent": false, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 20 + }, + "test": "telemetry_gpu_integration_test", + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "webgl1_conformance", + "--show-stdout", + "--browser=release_x64", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=d3d11 --use-cmd-decoder=passthrough --force_high_performance_gpu", + "--enforce-browser-version", + "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl1_conformance_win_runtimes.json", + "--jobs=2" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "webgl_conformance_d3d11_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "idempotent": false, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 2 + }, + "test": "telemetry_gpu_integration_test", + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "webgl1_conformance", + "--show-stdout", + "--browser=release_x64", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=d3d9 --use-cmd-decoder=passthrough --force_high_performance_gpu", + "--enforce-browser-version", + "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl1_conformance_win_runtimes.json", + "--jobs=2" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "webgl_conformance_d3d9_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "idempotent": false, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 2 + }, + "test": "telemetry_gpu_integration_test", + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "webgl1_conformance", + "--show-stdout", + "--browser=release_x64", + "--passthrough", + "-v", + "--stable-jobs", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-angle=vulkan --use-cmd-decoder=passthrough --force_high_performance_gpu", + "--enforce-browser-version", + "--jobs=2" + ], + "merge": { + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "webgl_conformance_vulkan_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "containment_type": "AUTO", + "dimensions": { + "display_attached": "1", + "gpu": "8086:4680-31.0.101.5333", + "os": "Windows-10-19045.3930", + "pool": "chromium.tests.gpu" + }, + "hard_timeout": 1800, + "idempotent": false, + "io_timeout": 1800, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 2 + }, + "test": "telemetry_gpu_integration_test", + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" } ] },
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index ce14df6..e7bf7d5 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -15763,12 +15763,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_v126.0.6438.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -15778,8 +15778,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ], "dimensions": { @@ -15829,12 +15829,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_v123.0.6312.132/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -15844,8 +15844,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ], "dimensions": { @@ -15939,12 +15939,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_v126.0.6438.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 126.0.6438.0", + "description": "Run with ash-chrome version 126.0.6439.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -15954,8 +15954,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v126.0.6438.0", - "revision": "version:126.0.6438.0" + "location": "lacros_version_skew_tests_v126.0.6439.0", + "revision": "version:126.0.6439.0" } ], "dimensions": { @@ -16005,12 +16005,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_v123.0.6312.132/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 123.0.6312.132", + "description": "Run with ash-chrome version 123.0.6312.134", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16020,8 +16020,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v123.0.6312.132", - "revision": "version:123.0.6312.132" + "location": "lacros_version_skew_tests_v123.0.6312.134", + "revision": "version:123.0.6312.134" } ], "dimensions": {
diff --git a/testing/buildbot/filters/BUILD.gn b/testing/buildbot/filters/BUILD.gn index b77cdbe..4e193fd 100644 --- a/testing/buildbot/filters/BUILD.gn +++ b/testing/buildbot/filters/BUILD.gn
@@ -331,6 +331,7 @@ "//testing/buildbot/filters/android.samsung_a23.gl_tests.filter", "//testing/buildbot/filters/linux.uhd_630.gl_tests_passthrough.filter", "//testing/buildbot/filters/linux.uhd_770.gl_tests_passthrough.filter", + "//testing/buildbot/filters/win.uhd_770.gl_tests_passthrough.filter", ] } source_set("gl_unittests_filters") {
diff --git a/testing/buildbot/filters/win.uhd_770.gl_tests_passthrough.filter b/testing/buildbot/filters/win.uhd_770.gl_tests_passthrough.filter new file mode 100644 index 0000000..d184fd4 --- /dev/null +++ b/testing/buildbot/filters/win.uhd_770.gl_tests_passthrough.filter
@@ -0,0 +1,33 @@ +# crbug.com/329482486 +-TranslatorVariants/EXTBlendFuncExtendedDrawTest.ESSL1FragColor/0 +-TranslatorVariants/EXTBlendFuncExtendedDrawTest.ESSL1FragColor/1 +-TranslatorVariants/EXTBlendFuncExtendedDrawTest.ESSL1FragData/0 +-TranslatorVariants/EXTBlendFuncExtendedDrawTest.ESSL1FragData/1 +-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ES3Getters/0 +-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ES3Getters/1 +-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3BindArrayAsArray/0 +-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3BindArrayAsArray/1 +-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3BindArrayWithSimpleName/0 +-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3BindArrayWithSimpleName/1 +-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3BindSimpleVarAsArrayNoBind/0 +-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3BindSimpleVarAsArrayNoBind/1 +-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3Var/0 +-TranslatorVariants/EXTBlendFuncExtendedES3DrawTest.ESSL3Var/1 + +# crbug.com/333426466 +-GLES2ExternalFrameBufferTest.Test/RGBA_8888Multisampling +-GLES2ExternalFrameBufferTest.Test/RGBA_8888MultisamplingDepth +-GLES2ExternalFrameBufferTest.Test/RGBA_8888MultisamplingDepthStencil +-GLES2ExternalFrameBufferTest.Test/RGBA_8888MultisamplingPreserve +-GLES2ExternalFrameBufferTest.Test/RGBA_8888MultisamplingPreserveDepth +-GLES2ExternalFrameBufferTest.Test/RGBA_8888MultisamplingPreserveDepthStencil +-GLES2ExternalFrameBufferTest.Test/RGBA_8888MultisamplingPreserveStencil +-GLES2ExternalFrameBufferTest.Test/RGBA_8888MultisamplingStencil +-GLES2ExternalFrameBufferTest.Test/RGBX_8888Multisampling +-GLES2ExternalFrameBufferTest.Test/RGBX_8888MultisamplingDepth +-GLES2ExternalFrameBufferTest.Test/RGBX_8888MultisamplingDepthStencil +-GLES2ExternalFrameBufferTest.Test/RGBX_8888MultisamplingPreserve +-GLES2ExternalFrameBufferTest.Test/RGBX_8888MultisamplingPreserveDepth +-GLES2ExternalFrameBufferTest.Test/RGBX_8888MultisamplingPreserveDepthStencil +-GLES2ExternalFrameBufferTest.Test/RGBX_8888MultisamplingPreserveStencil +-GLES2ExternalFrameBufferTest.Test/RGBX_8888MultisamplingStencil
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index 782671c..2d39eb8 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -2767,6 +2767,11 @@ }, }, }, + 'Win10 FYI x64 Release (Intel UHD 770)': { + 'args': [ + '--test-launcher-filter-file=../../testing/buildbot/filters/win.uhd_770.gl_tests_passthrough.filter', + ], + }, }, }, 'gl_tests_validating': { @@ -3451,7 +3456,6 @@ 'ToTMacASan', # The mac asan tot bot sets enable_nacl=false 'Linux TSan Tests', # The TSan bot sets enable_nacl=false 'Mac ASan 64 Tests (1)', # The mac asan bot sets enable_nacl=false - 'linux-arm64-rel-cft', # Not available on arm64. ], }, 'net_unittests': { @@ -3926,12 +3930,6 @@ 'linux-lacros-tester-rel', ], }, - 'remoting_unittests': { - 'remove_from': [ - # Not available on Linux ARM64 - 'linux-arm64-rel-cft', - ], - }, 'sandbox_linux_unittests': { 'remove_from': [ 'android-asan', # https://crbug.com/962650 @@ -4637,8 +4635,6 @@ 'vr_common_unittests': { 'remove_from': [ 'android-pie-x86-rel', - # Not available on Linux ARM64 - 'linux-arm64-rel-cft', ], }, 'vulkan_pixel_skia_gold_test': { @@ -5453,6 +5449,13 @@ '--gtest_filter=-WebXrVrOpenXrBrowserTest.TestNoStalledFrameLoop', ], }, + 'Win10 FYI x64 Release (Intel UHD 770)': { + 'args': [ + # TODO(crbug.com/40937024): Remove this once the flakes on Intel are + # resolved. + '--gtest_filter=-WebXrVrOpenXrBrowserTest.TestNoStalledFrameLoop', + ], + }, 'Win10 FYI x64 Release (Intel)': { 'args': [ # TODO(crbug.com/40937024): Remove this once the flakes on Intel are
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index b46f6a4..1f723d4 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -267,16 +267,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 126.0.6438.0', + 'description': 'Run with ash-chrome version 126.0.6439.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6438.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v126.0.6439.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v126.0.6438.0', - 'revision': 'version:126.0.6438.0', + 'location': 'lacros_version_skew_tests_v126.0.6439.0', + 'revision': 'version:126.0.6439.0', }, ], }, @@ -299,16 +299,16 @@ }, 'LACROS_VERSION_SKEW_STABLE': { 'identifier': 'Lacros version skew testing ash stable', - 'description': 'Run with ash-chrome version 123.0.6312.132', + 'description': 'Run with ash-chrome version 123.0.6312.134', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.132/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v123.0.6312.134/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v123.0.6312.132', - 'revision': 'version:123.0.6312.132', + 'location': 'lacros_version_skew_tests_v123.0.6312.134', + 'revision': 'version:123.0.6312.134', }, ], },
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index 8177c50..88bf7e6 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -1349,23 +1349,6 @@ 'mixins': ['chromium-tester-service-account'], 'machines': { # Mirrors "Linux Builder" and "Linux Tests". - 'linux-arm64-rel-cft': { - 'mixins': [ - 'isolate_profile_data', - 'linux-focal', - 'arm64', - ], - 'additional_compile_targets': [ - 'all' - ], - 'test_suites': { - 'gtest_tests': 'chromium_linux_gtests', - 'isolated_scripts': 'chromium_linux_rel_isolated_scripts', - 'scripts': 'chromium_linux_scripts', - } - }, - - # Mirrors "Linux Builder" and "Linux Tests". 'linux-rel-cft': { 'mixins': [ 'isolate_profile_data', @@ -4669,8 +4652,8 @@ 'win10_intel_uhd_770_stable', ], 'test_suites': { - # TODO(crbug.com/331316080): Enable tests on this config. - 'gpu_telemetry_tests': 'gpu_noop_sleep_telemetry_test', + 'gtest_tests': 'gpu_fyi_win_gtests', + 'gpu_telemetry_tests': 'gpu_fyi_win_intel_release_telemetry_tests', }, }, 'Win10 FYI x64 Release (Intel)': {
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 9a464d8..df7e56d 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -5231,32 +5231,6 @@ ] } ], - "CrOSLateBootSwapZramRecompression": [ - { - "platforms": [ - "chromeos" - ], - "experiments": [ - { - "name": "Enabled", - "params": { - "backoff_time_sec": "300", - "idle_max_time_sec": "3600", - "idle_min_time_sec": "1800", - "periodic_time_sec": "600", - "recomp_algorithm": "zstd", - "recompression_huge": "true", - "recompression_huge_idle": "true", - "recompression_idle": "true", - "threshold_mib": "1024" - }, - "enable_features": [ - "CrOSLateBootSwapZramRecompression" - ] - } - ] - } - ], "CrOSLateBootSwapZramTuning": [ { "platforms": [
diff --git a/third_party/angle b/third_party/angle index a443959..9c2632b 160000 --- a/third_party/angle +++ b/third_party/angle
@@ -1 +1 @@ -Subproject commit a443959993c4ed30d8e2310e5b3c7d6dabb0d462 +Subproject commit 9c2632b3df7e49e8c51d39a6234887535e5d5978
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc index f711447d..37fbdb3a 100644 --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc
@@ -1343,6 +1343,33 @@ const base::FeatureParam<double> kLCPPDeferUnusedPreloadFrequencyThreshold{ &kLCPPDeferUnusedPreload, "lcpp_unused_preload_frequency_threshold", 0.5}; +const base::FeatureParam<LcppDeferUnusedPreloadPreloadedReason>::Option + lcpp_defer_unused_preload_preloaded_reason[] = { + {LcppDeferUnusedPreloadPreloadedReason::kAll, "all"}, + {LcppDeferUnusedPreloadPreloadedReason::kLinkPreloadOnly, + "link_preload"}, + {LcppDeferUnusedPreloadPreloadedReason::kBrowserSpeculativePreloadOnly, + "speculative_preload"}, +}; + +const base::FeatureParam<LcppDeferUnusedPreloadPreloadedReason> + kLcppDeferUnusedPreloadPreloadedReason{ + &kLCPPDeferUnusedPreload, "preloaded_reason", + LcppDeferUnusedPreloadPreloadedReason::kAll, + &lcpp_defer_unused_preload_preloaded_reason}; + +const base::FeatureParam<LcppDeferUnusedPreloadTiming>::Option + lcpp_defer_unused_preload_timing[] = { + {LcppDeferUnusedPreloadTiming::kPostTask, "post_task"}, + {LcppDeferUnusedPreloadTiming::kLcpTimingPredictor, + "lcp_timing_predictor"}, +}; + +const base::FeatureParam<LcppDeferUnusedPreloadTiming> + kLcppDeferUnusedPreloadTiming{&kLCPPDeferUnusedPreload, "load_timing", + LcppDeferUnusedPreloadTiming::kPostTask, + &lcpp_defer_unused_preload_timing}; + BASE_FEATURE(kLCPPFontURLPredictor, "LCPPFontURLPredictor", base::FEATURE_DISABLED_BY_DEFAULT); @@ -2469,13 +2496,6 @@ "WebAudioSetSinkEchoCancellation", base::FEATURE_ENABLED_BY_DEFAULT); -// A server-side switch for the output device (sink) selection in Web Audio API. -// This enables the selection via the AudioContext constructor and also via -// AudioContext.setSinkId() method. -BASE_FEATURE(kWebAudioSinkSelection, - "kWebAudioSinkSelection", - base::FEATURE_ENABLED_BY_DEFAULT); - /// Enables cache-aware WebFonts loading. See https://crbug.com/570205. // The feature is disabled on Android for WebView API issue discussed at // https://crbug.com/942440.
diff --git a/third_party/blink/common/interest_group/auction_config.cc b/third_party/blink/common/interest_group/auction_config.cc index 5e66e92..c90112a6 100644 --- a/third_party/blink/common/interest_group/auction_config.cc +++ b/third_party/blink/common/interest_group/auction_config.cc
@@ -9,6 +9,7 @@ #include <tuple> #include "base/strings/to_string.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/interest_group/ad_display_size_utils.h" #include "third_party/blink/public/mojom/interest_group/ad_auction_service.mojom.h" @@ -152,7 +153,12 @@ return false; } - return IsHttpsAndMatchesSellerOrigin(url); + if (base::FeatureList::IsEnabled( + blink::features::kFledgePermitCrossOriginTrustedSignals)) { + return url.scheme() == url::kHttpsScheme; + } else { + return IsHttpsAndMatchesSellerOrigin(url); + } } bool AuctionConfig::IsDirectFromSellerSignalsValid(
diff --git a/third_party/blink/common/interest_group/auction_config_mojom_traits_test.cc b/third_party/blink/common/interest_group/auction_config_mojom_traits_test.cc index 3d64c2e..31bd14bd 100644 --- a/third_party/blink/common/interest_group/auction_config_mojom_traits_test.cc +++ b/third_party/blink/common/interest_group/auction_config_mojom_traits_test.cc
@@ -10,6 +10,7 @@ #include <vector> #include "base/containers/flat_map.h" +#include "base/test/scoped_feature_list.h" #include "base/time/time.h" #include "base/unguessable_token.h" #include "base/uuid.h" @@ -17,6 +18,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/numeric/int128.h" #include "third_party/blink/common/interest_group/auction_config_test_util.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/interest_group/auction_config.h" #include "third_party/blink/public/common/interest_group/seller_capabilities.h" #include "third_party/blink/public/mojom/interest_group/interest_group_types.mojom.h" @@ -169,7 +171,7 @@ TEST(AuctionConfigMojomTraitsTest, SellerScoringSignalsUrlMismatch) { AuctionConfig auction_config = - CreateBasicAuctionConfig(GURL("http://seller.test")); + CreateBasicAuctionConfig(GURL("https://seller.test")); // Different origin than seller, but same scheme. auction_config.trusted_scoring_signals_url = GURL("https://not.seller.test/foo"); @@ -185,6 +187,31 @@ EXPECT_FALSE(SerializeAndDeserialize(auction_config)); } +TEST(AuctionConfigMojomTraitsTest, + SellerScoringSignalsUrlCrossOriginPermitted) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeature( + blink::features::kFledgePermitCrossOriginTrustedSignals); + + AuctionConfig auction_config = + CreateBasicAuctionConfig(GURL("https://seller.test")); + auction_config.trusted_scoring_signals_url = + GURL("https://not.seller.org/foo"); + + // With kFledgePermitCrossOriginTrustedSignals on, this is OK. + EXPECT_TRUE(SerializeAndDeserialize(auction_config)); + + auction_config = CreateBasicAuctionConfig(GURL("https://seller.test")); + // This blob URL should be considered same-origin to the seller, but the + // scheme is wrong. That restriction still applies even if the cross-origin + // check is off. + auction_config.trusted_scoring_signals_url = + GURL("blob:https://seller.test/foo"); + ASSERT_EQ(auction_config.seller, + url::Origin::Create(*auction_config.trusted_scoring_signals_url)); + EXPECT_FALSE(SerializeAndDeserialize(auction_config)); +} + TEST(AuctionConfigMojomTraitsTest, TrustedScoringSignalsFields) { AuctionConfig auction_config = CreateBasicAuctionConfig(GURL("https://seller.test"));
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h index 14c024b..2f138af 100644 --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h
@@ -802,6 +802,39 @@ BLINK_COMMON_EXPORT extern const base::FeatureParam<double> kLCPPDeferUnusedPreloadFrequencyThreshold; +// The type of preload for potentially unused preload resources. +enum class LcppDeferUnusedPreloadPreloadedReason { + // No limitation. All preload requests, regardless of the developer created or + // the browser created, can be deferred. + kAll, + // Limit the deferred preload to the requests which are made via <link + // rel="preload">. + kLinkPreloadOnly, + // Limit the deferred preload to the requests which are speculatively + // preloaded via the browse mechanism e.g. preload scanner, LCPP + // optimizations. + // + // This option strictly respects the developer signals by excluding the + // preloads via <link rel="preload"> + kBrowserSpeculativePreloadOnly, +}; + +BLINK_COMMON_EXPORT extern const base::FeatureParam< + LcppDeferUnusedPreloadPreloadedReason> + kLcppDeferUnusedPreloadPreloadedReason; + +// The type of load timing for potentially unused preload resources. +enum class LcppDeferUnusedPreloadTiming { + // Start loading via PostTask. + kPostTask, + // Start loading after the LCPP timing. crbug.com/40285771 for more details. + kLcpTimingPredictor, +}; + +BLINK_COMMON_EXPORT extern const base::FeatureParam< + LcppDeferUnusedPreloadTiming> + kLcppDeferUnusedPreloadTiming; + // If enabled, fetched font URLs are observed to predict font usage in the // future navigation. BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kLCPPFontURLPredictor); @@ -1566,7 +1599,6 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAudioBypassOutputBuffering); BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAudioHandleOnRenderError); BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAudioSetSinkEchoCancellation); -BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebAudioSinkSelection); BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebFontsCacheAwareTimeoutAdaption);
diff --git a/third_party/blink/renderer/core/css/media_query_exp.cc b/third_party/blink/renderer/core/css/media_query_exp.cc index e7b80f1..3b9d03e3 100644 --- a/third_party/blink/renderer/core/css/media_query_exp.cc +++ b/third_party/blink/renderer/core/css/media_query_exp.cc
@@ -158,24 +158,18 @@ } } - if (RuntimeEnabledFeatures::CSSOverflowMediaFeaturesEnabled()) { - if (media_feature == media_feature_names::kOverflowInlineMediaFeature) { - return ident == CSSValueID::kNone || ident == CSSValueID::kScroll; - } + if (media_feature == media_feature_names::kOverflowInlineMediaFeature) { + return ident == CSSValueID::kNone || ident == CSSValueID::kScroll; } - if (RuntimeEnabledFeatures::CSSOverflowMediaFeaturesEnabled()) { - if (media_feature == media_feature_names::kOverflowBlockMediaFeature) { - return ident == CSSValueID::kNone || ident == CSSValueID::kScroll || - ident == CSSValueID::kPaged; - } + if (media_feature == media_feature_names::kOverflowBlockMediaFeature) { + return ident == CSSValueID::kNone || ident == CSSValueID::kScroll || + ident == CSSValueID::kPaged; } - if (RuntimeEnabledFeatures::CSSUpdateMediaFeatureEnabled()) { - if (media_feature == media_feature_names::kUpdateMediaFeature) { - return ident == CSSValueID::kNone || ident == CSSValueID::kFast || - ident == CSSValueID::kSlow; - } + if (media_feature == media_feature_names::kUpdateMediaFeature) { + return ident == CSSValueID::kNone || ident == CSSValueID::kFast || + ident == CSSValueID::kSlow; } if (RuntimeEnabledFeatures::CSSStickyContainerQueriesEnabled()) {
diff --git a/third_party/blink/renderer/core/css/parser/media_query_parser.cc b/third_party/blink/renderer/core/css/parser/media_query_parser.cc index b2c30a33..c49fcc35 100644 --- a/third_party/blink/renderer/core/css/parser/media_query_parser.cc +++ b/third_party/blink/renderer/core/css/parser/media_query_parser.cc
@@ -76,8 +76,9 @@ feature == media_feature_names::kPrefersColorSchemeMediaFeature || feature == media_feature_names::kPrefersContrastMediaFeature || feature == media_feature_names::kPrefersReducedMotionMediaFeature || - (feature == media_feature_names::kUpdateMediaFeature && - RuntimeEnabledFeatures::CSSUpdateMediaFeatureEnabled()) || + feature == media_feature_names::kOverflowInlineMediaFeature || + feature == media_feature_names::kOverflowBlockMediaFeature || + feature == media_feature_names::kUpdateMediaFeature || (feature == media_feature_names::kPrefersReducedDataMediaFeature && RuntimeEnabledFeatures::PrefersReducedDataEnabled()) || feature == @@ -99,10 +100,6 @@ execution_context)) || (feature == media_feature_names::kDevicePostureMediaFeature && RuntimeEnabledFeatures::DevicePostureEnabled(execution_context)) || - (feature == media_feature_names::kOverflowInlineMediaFeature && - RuntimeEnabledFeatures::CSSOverflowMediaFeaturesEnabled()) || - (feature == media_feature_names::kOverflowBlockMediaFeature && - RuntimeEnabledFeatures::CSSOverflowMediaFeaturesEnabled()) || (feature == media_feature_names::kInvertedColorsMediaFeature && RuntimeEnabledFeatures::InvertedColorsEnabled()) || CSSVariableParser::IsValidVariableName(feature) ||
diff --git a/third_party/blink/renderer/core/dom/element.h b/third_party/blink/renderer/core/dom/element.h index b44fa2f6..a45a3b1 100644 --- a/third_party/blink/renderer/core/dom/element.h +++ b/third_party/blink/renderer/core/dom/element.h
@@ -1966,7 +1966,7 @@ } inline bool Element::HasClassName(const AtomicString& class_name) const { - return HasClass() && ClassNames().Contains(class_name); + return HasElementData() && GetElementData()->ClassNames().Contains(class_name); } inline bool Element::HasID() const {
diff --git a/third_party/blink/renderer/core/fetch/body.cc b/third_party/blink/renderer/core/fetch/body.cc index 98e7ce3..6c3927d 100644 --- a/third_party/blink/renderer/core/fetch/body.cc +++ b/third_party/blink/renderer/core/fetch/body.cc
@@ -8,7 +8,6 @@ #include <utility> #include "base/memory/scoped_refptr.h" -#include "base/metrics/histogram_functions.h" #include "base/task/single_thread_task_runner.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" @@ -32,18 +31,6 @@ namespace { -// These values are persisted to logs. Entries should not be renumbered and -// numeric values should never be reused. -enum class BodyConsumerBaseFetchCheckPoint { - kConstructor = 0, - kDidFetchDataLoadFailed = 1, - kMaxValue = kDidFetchDataLoadFailed, -}; - -void SendHistogram(BodyConsumerBaseFetchCheckPoint cp) { - base::UmaHistogramEnumeration("Net.Fetch.CheckPoint.BodyConsumerBase", cp); -} - class BodyConsumerBase : public GarbageCollected<BodyConsumerBase>, public FetchDataLoader::Client { public: @@ -51,7 +38,6 @@ : resolver_(resolver), task_runner_(ExecutionContext::From(resolver_->GetScriptState()) ->GetTaskRunner(TaskType::kNetworking)) { - SendHistogram(BodyConsumerBaseFetchCheckPoint::kConstructor); } BodyConsumerBase(const BodyConsumerBase&) = delete; BodyConsumerBase& operator=(const BodyConsumerBase&) = delete; @@ -61,7 +47,6 @@ ScriptState::Scope scope(Resolver()->GetScriptState()); resolver_->Reject(V8ThrowException::CreateTypeError( Resolver()->GetScriptState()->GetIsolate(), "Failed to fetch")); - SendHistogram(BodyConsumerBaseFetchCheckPoint::kDidFetchDataLoadFailed); } void Abort() override {
diff --git a/third_party/blink/renderer/core/fetch/fetch_manager.cc b/third_party/blink/renderer/core/fetch/fetch_manager.cc index 48f15b86..41046632 100644 --- a/third_party/blink/renderer/core/fetch/fetch_manager.cc +++ b/third_party/blink/renderer/core/fetch/fetch_manager.cc
@@ -226,18 +226,6 @@ net_error); } -// These values are persisted to logs. Entries should not be renumbered and -// numeric values should never be reused. -enum class FetchManagerLoaderCheckPoint { - kConstructor = 0, - kFailed = 1, - kMaxValue = kFailed, -}; - -void SendHistogram(FetchManagerLoaderCheckPoint cp) { - base::UmaHistogramEnumeration("Net.Fetch.CheckPoint.FetchManagerLoader", cp); -} - ResourceLoadPriority ComputeFetchLaterLoadPriority( const FetchParameters& params) { // FetchLater's ResourceType is ResourceType::kRaw, which should default to @@ -528,7 +516,6 @@ v8::Local<v8::Value> exception = V8ThrowException::CreateTypeError(isolate, "Failed to fetch"); exception_.Reset(isolate, exception); - SendHistogram(FetchManagerLoaderCheckPoint::kConstructor); } FetchManager::Loader::~Loader() { @@ -1197,7 +1184,6 @@ IdentifiersFactory::IdFromToken(*issue_id))); } resolver_->Reject(value); - SendHistogram(FetchManagerLoaderCheckPoint::kFailed); LogIfKeepalive("Failed"); } }
diff --git a/third_party/blink/renderer/core/layout/build.gni b/third_party/blink/renderer/core/layout/build.gni index 32454b1..e1ecba46 100644 --- a/third_party/blink/renderer/core/layout/build.gni +++ b/third_party/blink/renderer/core/layout/build.gni
@@ -205,7 +205,6 @@ "grid/grid_track_collection.h", "grid/layout_grid.cc", "grid/layout_grid.h", - "grid/subgrid_min_max_sizes_cache.h", "hit_test_cache.cc", "hit_test_cache.h", "hit_test_canvas_result.cc",
diff --git a/third_party/blink/renderer/core/layout/grid/grid_data.h b/third_party/blink/renderer/core/layout/grid/grid_data.h index 6a035300f..746ab7c 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_data.h +++ b/third_party/blink/renderer/core/layout/grid/grid_data.h
@@ -121,14 +121,12 @@ } GridLayoutTrackCollection& Columns() const { - DCHECK(columns_); - DCHECK_EQ(columns_->Direction(), kForColumns); + DCHECK(columns_ && columns_->Direction() == kForColumns); return *columns_; } GridLayoutTrackCollection& Rows() const { - DCHECK(rows_); - DCHECK_EQ(rows_->Direction(), kForRows); + DCHECK(rows_ && rows_->Direction() == kForRows); return *rows_; } @@ -140,15 +138,6 @@ (track_direction == kForColumns) ? Columns() : Rows()); } - // This method is intended for subgrids with both a standalone and a - // subgridded axis. Returns the only subgridded track collection. - const GridLayoutTrackCollection& OnlySubgriddedCollection() const { - DCHECK(columns_); - DCHECK(rows_); - DCHECK_NE(columns_->IsForSizing(), rows_->IsForSizing()); - return columns_->IsForSizing() ? *rows_ : *columns_; - } - void SetTrackCollection( std::unique_ptr<GridLayoutTrackCollection> track_collection) { DCHECK(track_collection);
diff --git a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc index 008c151..a494d48 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc
@@ -1742,6 +1742,10 @@ grid_item.ComputeSetIndices(track_collection); } } else { + // If this grid has a standalone axis, invalidate its min/max sizes cache, + // since they're only valid for the current step of the sizing algorithm. + Node().InvalidateMinMaxSizesCache(); + auto& track_collection = layout_data.SizingCollection(track_direction); CacheGridItemsProperties(track_collection, &grid_items); @@ -1964,60 +1968,6 @@ }); } -namespace { - -// A subgrid's `MinMaxSizes` cache is stored in its respective `LayoutGrid` and -// gets invalidated via the `IsSubgridMinMaxSizesCacheDirty` flag. -// -// However, a subgrid might need to invalidate the cache if it inherited a -// different track collection in its subgridded axis, which might cause its -// intrinsic sizes to change. This invalidation goes from parent to children, -// which is not accounted for by the invalidation logic in `LayoutObject`. -// -// This method addresses such issue by traversing the tree in postorder checking -// whether the cache at each subgrid level is reusable or not: if the subgrid -// has a valid cache, but its input tracks for the subgridded axis changed, -// then we'll invalidate the cache for that subgrid and its ancestors. -bool ValidateMinMaxSizesCache(const GridNode& grid_node, - const GridSizingSubtree& sizing_subtree, - GridTrackSizingDirection track_direction) { - DCHECK(sizing_subtree.HasValidRootFor(grid_node)); - - bool should_invalidate_min_max_sizes_cache = false; - - // Only iterate over items if this grid has nested subgrids. - if (auto next_subgrid_subtree = sizing_subtree.FirstChild()) { - for (const auto& grid_item : sizing_subtree.GetGridItems()) { - if (!grid_item.IsSubgrid()) { - continue; - } - - DCHECK(next_subgrid_subtree); - should_invalidate_min_max_sizes_cache |= ValidateMinMaxSizesCache( - To<GridNode>(grid_item.node), next_subgrid_subtree, - RelativeDirectionInSubgrid(track_direction, grid_item)); - next_subgrid_subtree = next_subgrid_subtree.NextSibling(); - } - } - - const auto& layout_data = sizing_subtree.LayoutData(); - if (layout_data.IsSubgridWithStandaloneAxis(track_direction)) { - // If no nested subgrid marked this subtree to be invalidated already, check - // that the cached intrinsic sizes are reusable by the current sizing tree. - if (!should_invalidate_min_max_sizes_cache) { - should_invalidate_min_max_sizes_cache = - grid_node.ShouldInvalidateMinMaxSizesCacheFor(layout_data); - } - - if (should_invalidate_min_max_sizes_cache) { - grid_node.InvalidateMinMaxSizesCache(); - } - } - return should_invalidate_min_max_sizes_cache; -} - -} // namespace - void GridLayoutAlgorithm::CompleteTrackSizingAlgorithm( const GridSizingTree& sizing_tree, GridTrackSizingDirection track_direction, @@ -2025,8 +1975,6 @@ bool* opt_needs_additional_pass) const { const auto sizing_subtree = GridSizingSubtree(sizing_tree); - ValidateMinMaxSizesCache(Node(), sizing_subtree, track_direction); - ComputeBaselineAlignment(sizing_tree.FinalizeTree(), sizing_subtree, /* opt_subgrid_data */ kNoSubgriddedItemData, track_direction, sizing_constraint);
diff --git a/third_party/blink/renderer/core/layout/grid/grid_node.cc b/third_party/blink/renderer/core/layout/grid/grid_node.cc index 3f00a93..d7e41cbc 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_node.cc +++ b/third_party/blink/renderer/core/layout/grid/grid_node.cc
@@ -195,8 +195,7 @@ layout_grid->SetMinMaxSizesCache( GridLayoutAlgorithm({*this, fragment_geometry, space}) - .ComputeSubgridMinMaxSizes(sizing_subtree), - sizing_subtree.LayoutData()); + .ComputeSubgridMinMaxSizes(sizing_subtree)); } return {layout_grid->CachedMinMaxSizes(), @@ -222,8 +221,7 @@ // The min and max-content block size are both the box's "ideal" size after // layout (see https://drafts.csswg.org/css-sizing-3/#max-content). layout_grid->SetMinMaxSizesCache( - {intrinsic_block_size, intrinsic_block_size}, - sizing_subtree.LayoutData()); + {intrinsic_block_size, intrinsic_block_size}); } // Both intrinsic sizes are the same, so we can return either.
diff --git a/third_party/blink/renderer/core/layout/grid/grid_node.h b/third_party/blink/renderer/core/layout/grid/grid_node.h index 23fc95c5..c30441b 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_node.h +++ b/third_party/blink/renderer/core/layout/grid/grid_node.h
@@ -31,13 +31,7 @@ } void InvalidateMinMaxSizesCache() const { - box_->SetSubgridMinMaxSizesCacheDirty(true); - } - - bool ShouldInvalidateMinMaxSizesCacheFor( - const GridLayoutData& layout_data) const { - return To<LayoutGrid>(box_.Get()) - ->ShouldInvalidateMinMaxSizesCacheFor(layout_data); + To<LayoutGrid>(box_.Get())->InvalidateMinMaxSizesCache(); } // If `oof_children` is provided, aggregate any out of flow children.
diff --git a/third_party/blink/renderer/core/layout/grid/layout_grid.cc b/third_party/blink/renderer/core/layout/grid/layout_grid.cc index 76d03a9..999cb741b 100644 --- a/third_party/blink/renderer/core/layout/grid/layout_grid.cc +++ b/third_party/blink/renderer/core/layout/grid/layout_grid.cc
@@ -4,23 +4,12 @@ #include "third_party/blink/renderer/core/layout/grid/layout_grid.h" -#include "third_party/blink/renderer/core/layout/grid/subgrid_min_max_sizes_cache.h" #include "third_party/blink/renderer/core/layout/layout_result.h" namespace blink { LayoutGrid::LayoutGrid(Element* element) : LayoutBlock(element) {} -void LayoutGrid::Trace(Visitor* visitor) const { - visitor->Trace(cached_min_max_sizes_); - LayoutBlock::Trace(visitor); -} - -void LayoutGrid::AddChild(LayoutObject* new_child) { - NOT_DESTROYED(); - AddChild(new_child, /*before_child=*/nullptr); -} - void LayoutGrid::AddChild(LayoutObject* new_child, LayoutObject* before_child) { NOT_DESTROYED(); LayoutBlock::AddChild(new_child, before_child); @@ -118,25 +107,20 @@ } bool LayoutGrid::HasCachedMinMaxSizes() const { - return cached_min_max_sizes_ && !IsSubgridMinMaxSizesCacheDirty(); + return cached_min_max_sizes_.has_value(); } const MinMaxSizes& LayoutGrid::CachedMinMaxSizes() const { DCHECK(HasCachedMinMaxSizes()); - return **cached_min_max_sizes_; + return *cached_min_max_sizes_; } -void LayoutGrid::SetMinMaxSizesCache(MinMaxSizes&& min_max_sizes, - const GridLayoutData& layout_data) { - cached_min_max_sizes_ = MakeGarbageCollected<SubgridMinMaxSizesCache>( - std::move(min_max_sizes), layout_data); - SetSubgridMinMaxSizesCacheDirty(false); +void LayoutGrid::SetMinMaxSizesCache(MinMaxSizes&& min_max_sizes) { + cached_min_max_sizes_ = std::move(min_max_sizes); } -bool LayoutGrid::ShouldInvalidateMinMaxSizesCacheFor( - const GridLayoutData& layout_data) const { - return HasCachedMinMaxSizes() && - !cached_min_max_sizes_->IsValidFor(layout_data); +void LayoutGrid::InvalidateMinMaxSizesCache() { + cached_min_max_sizes_.reset(); } const GridLayoutData* LayoutGrid::LayoutData() const { @@ -149,7 +133,7 @@ } wtf_size_t LayoutGrid::AutoRepeatCountForDirection( - GridTrackSizingDirection track_direction) const { + const GridTrackSizingDirection track_direction) const { NOT_DESTROYED(); if (!HasCachedPlacementData()) return 0; @@ -157,7 +141,7 @@ } wtf_size_t LayoutGrid::ExplicitGridStartForDirection( - GridTrackSizingDirection track_direction) const { + const GridTrackSizingDirection track_direction) const { NOT_DESTROYED(); if (!HasCachedPlacementData()) return 0; @@ -165,7 +149,7 @@ } wtf_size_t LayoutGrid::ExplicitGridEndForDirection( - GridTrackSizingDirection track_direction) const { + const GridTrackSizingDirection track_direction) const { NOT_DESTROYED(); if (!HasCachedPlacementData()) return 0; @@ -175,7 +159,8 @@ cached_placement_data_->ExplicitGridTrackCount(track_direction)); } -LayoutUnit LayoutGrid::GridGap(GridTrackSizingDirection track_direction) const { +LayoutUnit LayoutGrid::GridGap( + const GridTrackSizingDirection track_direction) const { NOT_DESTROYED(); const auto* grid_layout_data = LayoutData(); if (!grid_layout_data) @@ -187,14 +172,14 @@ } LayoutUnit LayoutGrid::GridItemOffset( - GridTrackSizingDirection track_direction) const { + const GridTrackSizingDirection track_direction) const { NOT_DESTROYED(); // Distribution offset is baked into the gutter_size in GridNG. return LayoutUnit(); } Vector<LayoutUnit, 1> LayoutGrid::TrackSizesForComputedStyle( - GridTrackSizingDirection track_direction) const { + const GridTrackSizingDirection track_direction) const { NOT_DESTROYED(); Vector<LayoutUnit, 1> track_sizes; const auto* grid_layout_data = LayoutData(); @@ -275,7 +260,7 @@ } Vector<LayoutUnit> LayoutGrid::ComputeExpandedPositions( - GridTrackSizingDirection track_direction) const { + const GridTrackSizingDirection track_direction) const { Vector<LayoutUnit> expanded_positions; const auto* grid_layout_data = LayoutData(); if (!grid_layout_data)
diff --git a/third_party/blink/renderer/core/layout/grid/layout_grid.h b/third_party/blink/renderer/core/layout/grid/layout_grid.h index e3bf476c..a49e87d 100644 --- a/third_party/blink/renderer/core/layout/grid/layout_grid.h +++ b/third_party/blink/renderer/core/layout/grid/layout_grid.h
@@ -6,18 +6,14 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GRID_LAYOUT_GRID_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/grid/grid_data.h" #include "third_party/blink/renderer/core/layout/layout_block.h" +#include "third_party/blink/renderer/core/layout/grid/grid_data.h" namespace blink { -class SubgridMinMaxSizesCache; - class CORE_EXPORT LayoutGrid : public LayoutBlock { public: - explicit LayoutGrid(Element* element); - - void Trace(Visitor* visitor) const override; + explicit LayoutGrid(Element*); const char* GetName() const override { NOT_DESTROYED(); @@ -32,21 +28,20 @@ bool HasCachedMinMaxSizes() const; const MinMaxSizes& CachedMinMaxSizes() const; - void SetMinMaxSizesCache(MinMaxSizes&& min_max_sizes, - const GridLayoutData& layout_data); - bool ShouldInvalidateMinMaxSizesCacheFor( - const GridLayoutData& layout_data) const; + void SetMinMaxSizesCache(MinMaxSizes&& min_max_sizes); + void InvalidateMinMaxSizesCache(); wtf_size_t AutoRepeatCountForDirection( - GridTrackSizingDirection track_direction) const; + const GridTrackSizingDirection track_direction) const; wtf_size_t ExplicitGridStartForDirection( - GridTrackSizingDirection track_direction) const; + const GridTrackSizingDirection track_direction) const; wtf_size_t ExplicitGridEndForDirection( - GridTrackSizingDirection track_direction) const; - LayoutUnit GridGap(GridTrackSizingDirection track_direction) const; - LayoutUnit GridItemOffset(GridTrackSizingDirection track_direction) const; + const GridTrackSizingDirection track_direction) const; + LayoutUnit GridGap(const GridTrackSizingDirection track_direction) const; + LayoutUnit GridItemOffset( + const GridTrackSizingDirection track_direction) const; Vector<LayoutUnit, 1> TrackSizesForComputedStyle( - GridTrackSizingDirection track_direction) const; + const GridTrackSizingDirection track_direction) const; Vector<LayoutUnit> RowPositions() const; Vector<LayoutUnit> ColumnPositions() const; @@ -63,16 +58,16 @@ const GridLayoutTrackCollection& track_collection, wtf_size_t range_index) const; Vector<LayoutUnit> ComputeExpandedPositions( - GridTrackSizingDirection track_direction) const; + const GridTrackSizingDirection track_direction) const; - void AddChild(LayoutObject* new_child); - void AddChild(LayoutObject* new_child, LayoutObject* before_child) override; + void AddChild(LayoutObject* new_child, + LayoutObject* before_child = nullptr) override; void RemoveChild(LayoutObject* child) override; void StyleDidChange(StyleDifference diff, const ComputedStyle* old_style) override; std::optional<GridPlacementData> cached_placement_data_; - Member<const SubgridMinMaxSizesCache> cached_min_max_sizes_; + std::optional<MinMaxSizes> cached_min_max_sizes_; }; // wtf/casting.h helper.
diff --git a/third_party/blink/renderer/core/layout/grid/subgrid_min_max_sizes_cache.h b/third_party/blink/renderer/core/layout/grid/subgrid_min_max_sizes_cache.h deleted file mode 100644 index dbe7034..0000000 --- a/third_party/blink/renderer/core/layout/grid/subgrid_min_max_sizes_cache.h +++ /dev/null
@@ -1,46 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be found -// in the LICENSE file. - -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GRID_SUBGRID_MIN_MAX_SIZES_CACHE_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GRID_SUBGRID_MIN_MAX_SIZES_CACHE_H_ - -#include "third_party/blink/renderer/core/layout/grid/grid_data.h" -#include "third_party/blink/renderer/core/layout/min_max_sizes.h" - -namespace blink { - -class SubgridMinMaxSizesCache - : public GarbageCollected<SubgridMinMaxSizesCache> { - public: - SubgridMinMaxSizesCache() = delete; - SubgridMinMaxSizesCache(const SubgridMinMaxSizesCache&) = delete; - SubgridMinMaxSizesCache& operator=(const SubgridMinMaxSizesCache&) = delete; - - SubgridMinMaxSizesCache(MinMaxSizes&& min_max_sizes, - const GridLayoutData& layout_data) - : opposite_axis_subgridded_tracks_( - layout_data.OnlySubgriddedCollection()), - cached_min_max_sizes_(std::move(min_max_sizes)) {} - - const MinMaxSizes& operator*() const { return cached_min_max_sizes_; } - - bool IsValidFor(const GridLayoutData& layout_data) const { - return layout_data.OnlySubgriddedCollection() == - opposite_axis_subgridded_tracks_; - } - - void Trace(Visitor*) const {} - - private: - // The intrinsic sizes of a subgrid's standalone axis might change when the - // subgridded tracks in the opposite axis change. We keep a copy of these - // tracks to check if the cache is reusable with the new layout data. - GridLayoutTrackCollection opposite_axis_subgridded_tracks_; - - MinMaxSizes cached_min_max_sizes_; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GRID_SUBGRID_MIN_MAX_SIZES_CACHE_H_
diff --git a/third_party/blink/renderer/core/layout/inline/inline_box_state.cc b/third_party/blink/renderer/core/layout/inline/inline_box_state.cc index be42fdb..2984912 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_box_state.cc +++ b/third_party/blink/renderer/core/layout/inline/inline_box_state.cc
@@ -43,6 +43,7 @@ void LogicalRubyColumn::Trace(Visitor* visitor) const { visitor->Trace(annotation_items); visitor->Trace(ruby_column_list); + visitor->Trace(state_stack); } InlineBoxState::InlineBoxState(const InlineBoxState&& state) @@ -206,6 +207,11 @@ return false; } +void InlineLayoutStateStack::Trace(Visitor* visitor) const { + visitor->Trace(stack_); + visitor->Trace(ruby_column_list_); +} + InlineBoxState* InlineLayoutStateStack::OnBeginPlaceItems( const InlineNode node, const ComputedStyle& line_style, @@ -759,6 +765,12 @@ return position; } +void InlineLayoutStateStack::MoveBoxDataInBlockDirection(LayoutUnit diff) { + for (BoxData& box_data : box_data_list_) { + box_data.rect.offset.block_offset += diff; + } +} + void InlineLayoutStateStack::ApplyRelativePositioning( const ConstraintSpace& space, LogicalLineItems* line_box) {
diff --git a/third_party/blink/renderer/core/layout/inline/inline_box_state.h b/third_party/blink/renderer/core/layout/inline/inline_box_state.h index d745bb8a..a0129a91 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_box_state.h +++ b/third_party/blink/renderer/core/layout/inline/inline_box_state.h
@@ -23,6 +23,7 @@ class LogicalLineItems; class ShapeResultView; struct InlineItemResult; +struct LogicalRubyColumn; // Fragments that require the layout position/size of ancestor are packed in // this struct. @@ -33,27 +34,6 @@ EVerticalAlign vertical_align; }; -// Represents a ruby column. This associates LogicalLineItems for a ruby-base -// and LogicalLineItems for a ruby-text. -struct CORE_EXPORT LogicalRubyColumn - : public GarbageCollected<LogicalRubyColumn> { - // Start index of a ruby-base for the corresponding LogicalLineItems. - unsigned start_index; - // The number of ruby-base items in the corresponding LogicalLineItems. - unsigned size; - - Member<LogicalLineItems> annotation_items; - - // Nested <ruby>s in `annotation_items`. - HeapVector<Member<LogicalRubyColumn>> ruby_column_list; - - // `ruby-position` property value. - RubyPosition ruby_position = RubyPosition::kOver; - - void Trace(Visitor* visitor) const; - unsigned EndIndex() const { return start_index + size; } -}; - // Represents the current box while InlineLayoutAlgorithm performs layout. // Used 1) to cache common values for a box, and 2) to layout children that // require ancestor position or size. @@ -171,9 +151,10 @@ // 2) Performs layout when the positin/size of a box was computed. // 3) Cache common values for a box. class CORE_EXPORT InlineLayoutStateStack { - STACK_ALLOCATED(); + DISALLOW_NEW(); public: + void Trace(Visitor* visitor) const; // The box state for the line box. InlineBoxState& LineBoxState() { return stack_.front(); } @@ -247,6 +228,13 @@ LayoutUnit position, bool ignore_box_margin_border_padding); + // This should be called when the corresponding LogicalLineItems are moved in + // the block direction, and should be called before CreateBoxFragments(). + // This is necessary only for annotation lines, which requires to move its + // LogicalLineItems in the block direction before calling + // CreateBoxFragments(). + void MoveBoxDataInBlockDirection(LayoutUnit diff); + void ApplyRelativePositioning(const ConstraintSpace&, LogicalLineItems*); // Create box fragments. This function turns a flat list of children into // a box tree. @@ -365,6 +353,29 @@ bool is_svg_text_ = false; }; +// Represents a ruby column. This associates LogicalLineItems for a ruby-base +// and LogicalLineItems for a ruby-text. +struct CORE_EXPORT LogicalRubyColumn + : public GarbageCollected<LogicalRubyColumn> { + // Start index of a ruby-base for the corresponding LogicalLineItems. + unsigned start_index; + // The number of ruby-base items in the corresponding LogicalLineItems. + unsigned size; + + Member<LogicalLineItems> annotation_items; + + // Nested <ruby>s in `annotation_items`. + HeapVector<Member<LogicalRubyColumn>> ruby_column_list; + + // `ruby-position` property value. + RubyPosition ruby_position = RubyPosition::kOver; + + InlineLayoutStateStack state_stack; + + void Trace(Visitor* visitor) const; + unsigned EndIndex() const { return start_index + size; } +}; + } // namespace blink WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::InlineBoxState)
diff --git a/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.cc b/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.cc index fbd7c57..a0a3df42 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.cc
@@ -226,6 +226,36 @@ ScoreLineBreakContext* score_line_break_context_ = nullptr; }; +void PlaceRelativePositionedItems(const ConstraintSpace& constraint_space, + LogicalLineItems* line_box) { + for (auto& child : *line_box) { + const auto* physical_fragment = child.GetPhysicalFragment(); + if (!physical_fragment) { + continue; + } + child.rect.offset += ComputeRelativeOffsetForInline( + constraint_space, physical_fragment->Style()); + } +} + +void FinalizeAnnotationLines( + const ConstraintSpace& constraint_space, + const HeapVector<Member<LogicalRubyColumn>>& column_list) { + for (auto& logical_column : column_list) { + LogicalLineItems* line_items = logical_column->annotation_items; + InlineLayoutStateStack& state_stack = logical_column->state_stack; + PlaceRelativePositionedItems(constraint_space, line_items); + state_stack.ApplyRelativePositioning(constraint_space, line_items); + + if (state_stack.HasBoxFragments()) { + state_stack.CreateBoxFragments(constraint_space, line_items, + /* is_opaque */ false); + } + + FinalizeAnnotationLines(constraint_space, logical_column->ruby_column_list); + } +} + } // namespace InlineLayoutAlgorithm::InlineLayoutAlgorithm( @@ -460,6 +490,8 @@ .PlaceLines(*line_box, line_box_metrics) .AddLinesTo(*line_container); annotation_metrics = calculator.AnnotationMetrics(); + + FinalizeAnnotationLines(GetConstraintSpace(), column_list); } line_info->SetAnnotationBlockStartAdjustment(SetAnnotationOverflow( *line_info, *line_box, line_box_metrics, annotation_metrics)); @@ -518,7 +550,7 @@ // positioning, (atomic-inlines, and floats). This will only move the // individual item. if (line_builder.HasRelativePositionedItems()) { - PlaceRelativePositionedItems(line_box); + PlaceRelativePositionedItems(GetConstraintSpace(), line_box); } // Apply any relative positioned offsets to any boxes (and their children). @@ -829,17 +861,6 @@ } } -void InlineLayoutAlgorithm::PlaceRelativePositionedItems( - LogicalLineItems* line_box) { - for (auto& child : *line_box) { - const auto* physical_fragment = child.GetPhysicalFragment(); - if (!physical_fragment) - continue; - child.rect.offset += ComputeRelativeOffsetForInline( - GetConstraintSpace(), physical_fragment->Style()); - } -} - // Apply the 'text-align' property to |line_info|. Returns the amount to move // the line in the inline direction. LayoutUnit InlineLayoutAlgorithm::ApplyTextAlign(LineInfo* line_info) {
diff --git a/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.h b/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.h index fb8b2b4f..592239a7 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.h
@@ -89,7 +89,6 @@ LayoutUnit ruby_block_start_adjust, LineInfo*, LogicalLineItems* line_box); - void PlaceRelativePositionedItems(LogicalLineItems* line_box); LayoutUnit ApplyTextAlign(LineInfo*);
diff --git a/third_party/blink/renderer/core/layout/inline/logical_line_builder.cc b/third_party/blink/renderer/core/layout/inline/logical_line_builder.cc index d8850d5b..17678cd 100644 --- a/third_party/blink/renderer/core/layout/inline/logical_line_builder.cc +++ b/third_party/blink/renderer/core/layout/inline/logical_line_builder.cc
@@ -462,21 +462,17 @@ ApplyRubyAlign(item_result.inline_size, annotation_line); auto* line_items = MakeGarbageCollected<LogicalLineItems>(); - InlineLayoutStateStack state_stack; - LogicalLineBuilder annotation_builder(node_, constraint_space_, &state_stack, - context_); + LogicalLineBuilder annotation_builder(node_, constraint_space_, + &logical_column.state_stack, context_); annotation_builder.CreateLine(&annotation_line, line_items, /* main_line_helper */ nullptr); - state_stack.ComputeInlinePositions( + logical_column.state_stack.ComputeInlinePositions( line_items, LayoutUnit(), /* ignore_box_margin_border_padding */ false); - if (state_stack.HasBoxFragments()) { - state_stack.CreateBoxFragments(constraint_space_, line_items, - /* is_opaque */ false); - } logical_column.annotation_items = line_items; - logical_column.ruby_column_list = state_stack.TakeRubyColumnList(); + logical_column.ruby_column_list = + logical_column.state_stack.TakeRubyColumnList(); } // Place a list marker.
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 f390747..32c80b22 100644 --- a/third_party/blink/renderer/core/layout/inline/ruby_utils.cc +++ b/third_party/blink/renderer/core/layout/inline/ruby_utils.cc
@@ -1230,6 +1230,7 @@ LayoutUnit offset) { for (auto& column : column_list_) { column->annotation_items->MoveInBlockDirection(offset); + column->state_stack.MoveBoxDataInBlockDirection(offset); } }
diff --git a/third_party/blink/renderer/core/layout/layout_object.cc b/third_party/blink/renderer/core/layout/layout_object.cc index 36edcb4..b90772cd 100644 --- a/third_party/blink/renderer/core/layout/layout_object.cc +++ b/third_party/blink/renderer/core/layout/layout_object.cc
@@ -1605,8 +1605,6 @@ bitfields_.SetIntrinsicLogicalWidthsChildDependsOnBlockConstraints(true); bitfields_.SetIndefiniteIntrinsicLogicalWidthsDirty(true); bitfields_.SetDefiniteIntrinsicLogicalWidthsDirty(true); - bitfields_.SetIsSubgridMinMaxSizesCacheDirty(true); - if (mark_parents == kMarkContainerChain && (IsText() || !StyleRef().HasOutOfFlowPosition())) InvalidateContainerIntrinsicLogicalWidths(); @@ -1697,8 +1695,6 @@ break; o->bitfields_.SetIntrinsicLogicalWidthsDirty(true); - o->bitfields_.SetIsSubgridMinMaxSizesCacheDirty(true); - // A positioned object has no effect on the min/max width of its containing // block ever. We can optimize this case and not go up any further. if (o->StyleRef().HasOutOfFlowPosition())
diff --git a/third_party/blink/renderer/core/layout/layout_object.h b/third_party/blink/renderer/core/layout/layout_object.h index cd13368b..0dc327f 100644 --- a/third_party/blink/renderer/core/layout/layout_object.h +++ b/third_party/blink/renderer/core/layout/layout_object.h
@@ -3338,16 +3338,6 @@ bitfields_.SetIsGridPlacementDirty(b); } - bool IsSubgridMinMaxSizesCacheDirty() const { - NOT_DESTROYED(); - return bitfields_.IsSubgridMinMaxSizesCacheDirty(); - } - - void SetSubgridMinMaxSizesCacheDirty(bool b) { - NOT_DESTROYED(); - bitfields_.SetIsSubgridMinMaxSizesCacheDirty(b); - } - DisplayLockContext* GetDisplayLockContext() const { NOT_DESTROYED(); auto* element = DynamicTo<Element>(GetNode()); @@ -3829,7 +3819,6 @@ being_destroyed_(false), is_table_column_constraints_dirty_(false), is_grid_placement_dirty_(true), - is_subgrid_min_max_sizes_cache_dirty_(true), transform_affects_vector_effect_(false), svg_descendant_may_have_transform_related_animation_(false), should_skip_next_layout_shift_tracking_(true), @@ -4103,15 +4092,10 @@ ADD_BOOLEAN_BITFIELD(is_table_column_constraints_dirty_, IsTableColumnsConstraintsDirty); - // Grid item placement is cached on `LayoutGrid`. + // Grid item placement is cached on LayoutGrid. // When this flag is set, any cached item placements are invalid. ADD_BOOLEAN_BITFIELD(is_grid_placement_dirty_, IsGridPlacementDirty); - // Subgrid `MinMaxSizes` are cached on `LayoutGrid`. - // When this flag is set, a subgrid's cached `MinMaxSizes` are invalid. - ADD_BOOLEAN_BITFIELD(is_subgrid_min_max_sizes_cache_dirty_, - IsSubgridMinMaxSizesCacheDirty); - // For transformable SVG child objects, indicates if this object or any // descendant has special vector effect that is affected by transform on // this object. For an SVG child object having special vector effect, this
diff --git a/third_party/blink/renderer/core/lcp_critical_path_predictor/lcp_critical_path_predictor.cc b/third_party/blink/renderer/core/lcp_critical_path_predictor/lcp_critical_path_predictor.cc index de8ea79..0234889 100644 --- a/third_party/blink/renderer/core/lcp_critical_path_predictor/lcp_critical_path_predictor.cc +++ b/third_party/blink/renderer/core/lcp_critical_path_predictor/lcp_critical_path_predictor.cc
@@ -23,6 +23,20 @@ return max_length; } +bool IsTimingPredictorEnabled() { + if (base::FeatureList::IsEnabled( + blink::features::kLCPTimingPredictorPrerender2)) { + return true; + } + if (base::FeatureList::IsEnabled(blink::features::kLCPPDeferUnusedPreload) && + features::kLcppDeferUnusedPreloadTiming.Get() == + features::LcppDeferUnusedPreloadTiming::kLcpTimingPredictor) { + return true; + } + + return false; +} + } // namespace LCPCriticalPathPredictor::LCPCriticalPathPredictor(LocalFrame& frame) @@ -96,8 +110,7 @@ } void LCPCriticalPathPredictor::AddLCPPredictedCallback(LCPCallback callback) { - CHECK(base::FeatureList::IsEnabled( - blink::features::kLCPTimingPredictorPrerender2)); + CHECK(IsTimingPredictorEnabled()); if (are_predicted_callbacks_called_) { std::move(callback).Run(/*lcp_element=*/nullptr); return; @@ -105,6 +118,15 @@ lcp_predicted_callbacks_.push_back(std::move(callback)); } +void LCPCriticalPathPredictor::AddLCPPredictedCallback( + base::OnceClosure callback) { + LCPCallback lcp_callback = + WTF::BindOnce([](base::OnceClosure callback, + const Element*) { std::move(callback).Run(); }, + std::move(callback)); + AddLCPPredictedCallback(std::move(lcp_callback)); +} + void LCPCriticalPathPredictor::MayRunPredictedCallbacks( const Element* lcp_element) { if (are_predicted_callbacks_called_) { @@ -131,8 +153,7 @@ std::optional<const KURL> maybe_image_url) { if (base::FeatureList::IsEnabled(features::kLCPCriticalPathPredictor) || base::FeatureList::IsEnabled(features::kLCPPLazyLoadImagePreload) || - base::FeatureList::IsEnabled( - blink::features::kLCPTimingPredictorPrerender2)) { + IsTimingPredictorEnabled()) { std::string lcp_element_locator_string = element_locator::OfElement(lcp_element).SerializeAsString(); @@ -322,8 +343,7 @@ } void LCPCriticalPathPredictor::OnOutermostMainFrameDocumentLoad() { - if (!base::FeatureList::IsEnabled( - blink::features::kLCPTimingPredictorPrerender2)) { + if (!IsTimingPredictorEnabled()) { return; } is_outermost_main_frame_document_loaded_ = true;
diff --git a/third_party/blink/renderer/core/lcp_critical_path_predictor/lcp_critical_path_predictor.h b/third_party/blink/renderer/core/lcp_critical_path_predictor/lcp_critical_path_predictor.h index 4d731b9..1b8dede 100644 --- a/third_party/blink/renderer/core/lcp_critical_path_predictor/lcp_critical_path_predictor.h +++ b/third_party/blink/renderer/core/lcp_critical_path_predictor/lcp_critical_path_predictor.h
@@ -82,6 +82,7 @@ using LCPCallback = base::OnceCallback<void(const Element*)>; void AddLCPPredictedCallback(LCPCallback callback); + void AddLCPPredictedCallback(base::OnceClosure); void Trace(Visitor*) const;
diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.cc b/third_party/blink/renderer/core/loader/frame_fetch_context.cc index 96bfeb8..3f54b66 100644 --- a/third_party/blink/renderer/core/loader/frame_fetch_context.cc +++ b/third_party/blink/renderer/core/loader/frame_fetch_context.cc
@@ -272,6 +272,23 @@ return document_->TopFrameOrigin(); } +const Vector<KURL>& FrameFetchContext::GetPotentiallyUnusedPreloads() const { + if (LocalFrame* frame = GetFrame()) { + if (LCPCriticalPathPredictor* lcpp = frame->GetLCPP()) { + return lcpp->unused_preloads(); + } + } + return empty_unused_preloads_; +} + +void FrameFetchContext::AddLcpPredictedCallback(base::OnceClosure callback) { + if (LocalFrame* frame = FrameFetchContext::GetFrame()) { + if (LCPCriticalPathPredictor* lcpp = frame->GetLCPP()) { + lcpp->AddLCPPredictedCallback(std::move(callback)); + } + } +} + SubresourceFilter* FrameFetchContext::GetSubresourceFilter() const { if (GetResourceFetcherProperties().IsDetached()) return nullptr;
diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.h b/third_party/blink/renderer/core/loader/frame_fetch_context.h index 82839b6..40dadbbd 100644 --- a/third_party/blink/renderer/core/loader/frame_fetch_context.h +++ b/third_party/blink/renderer/core/loader/frame_fetch_context.h
@@ -139,6 +139,10 @@ scoped_refptr<const SecurityOrigin> GetTopFrameOrigin() const override; + const Vector<KURL>& GetPotentiallyUnusedPreloads() const override; + + void AddLcpPredictedCallback(base::OnceClosure callback) override; + private: friend class FrameFetchContextTest;
diff --git a/third_party/blink/renderer/modules/ad_auction/navigator_auction.cc b/third_party/blink/renderer/modules/ad_auction/navigator_auction.cc index 46985db..910ff06 100644 --- a/third_party/blink/renderer/modules/ad_auction/navigator_auction.cc +++ b/third_party/blink/renderer/modules/ad_auction/navigator_auction.cc
@@ -1333,8 +1333,10 @@ // FLEDGE currently only supports HTTPS URLs, and some non-HTTPS URLs can have // HTTPS origins. if (trusted_scoring_signals_url.Protocol() != url::kHttpsScheme || - !output.seller->IsSameOriginWith( - SecurityOrigin::Create(trusted_scoring_signals_url).get())) { + (!base::FeatureList::IsEnabled( + blink::features::kFledgePermitCrossOriginTrustedSignals) && + !output.seller->IsSameOriginWith( + SecurityOrigin::Create(trusted_scoring_signals_url).get()))) { exception_state.ThrowTypeError(ErrorInvalidAuctionConfig( input, "trustedScoringSignalsURL", input.trustedScoringSignalsURL(), "must match seller origin."));
diff --git a/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.cc b/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.cc index 9244327..65b7bc8 100644 --- a/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.cc +++ b/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.cc
@@ -10,9 +10,12 @@ #include "third_party/blink/public/mojom/file_system_access/file_system_access_file_writer.mojom-blink.h" #include "third_party/blink/public/mojom/file_system_access/file_system_access_transfer_token.mojom-blink.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_file_system_create_sync_access_handle_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_file_system_create_writable_options.h" #include "third_party/blink/renderer/core/fileapi/file.h" +#include "third_party/blink/renderer/core/frame/local_dom_window.h" +#include "third_party/blink/renderer/core/workers/worker_global_scope.h" #include "third_party/blink/renderer/modules/file_system_access/file_system_access_error.h" #include "third_party/blink/renderer/modules/file_system_access/file_system_access_file_delegate.h" #include "third_party/blink/renderer/modules/file_system_access/file_system_sync_access_handle.h" @@ -25,6 +28,10 @@ namespace blink { +namespace { +const char kSecurityErrorMessage[] = "File System access is denied."; +} // namespace + using mojom::blink::FileSystemAccessErrorPtr; FileSystemFileHandle::FileSystemFileHandle( @@ -137,16 +144,32 @@ ScriptState* script_state, const FileSystemCreateSyncAccessHandleOptions* options, ExceptionState& exception_state) { - // TODO(fivedots): Check if storage access is allowed. - if (!mojo_ptr_.is_bound()) { - exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, ""); - return ScriptPromise<FileSystemSyncAccessHandle>(); - } - auto* resolver = MakeGarbageCollected<ScriptPromiseResolver<FileSystemSyncAccessHandle>>( script_state, exception_state.GetContext()); - auto result = resolver->Promise(); + auto promise = resolver->Promise(); + + auto on_allowed_callback = + WTF::BindOnce(&FileSystemFileHandle::CreateSyncAccessHandleImpl, + WrapWeakPersistent(this), WrapPersistent(options), + WrapPersistent(resolver)); + + CheckFileSystemStorageAccessIsAllowed( + ExecutionContext::From(script_state), + WTF::BindOnce(&FileSystemFileHandle::OnGotFileSystemStorageAccessStatus, + WrapWeakPersistent(this), WrapPersistent(resolver), + std::move(on_allowed_callback))); + + return promise; +} + +void FileSystemFileHandle::CreateSyncAccessHandleImpl( + const FileSystemCreateSyncAccessHandleOptions* options, + ScriptPromiseResolver<FileSystemSyncAccessHandle>* resolver) { + if (!mojo_ptr_.is_bound()) { + resolver->RejectWithDOMException(DOMExceptionCode::kInvalidStateError, ""); + return; + } mojom::blink::FileSystemAccessAccessHandleLockMode lock_mode; @@ -232,8 +255,6 @@ std::move(access_handle_remote), std::move(lock_mode))); }, WrapPersistent(this), WrapPersistent(resolver), options->mode())); - - return result; } mojo::PendingRemote<mojom::blink::FileSystemAccessTransferToken> @@ -352,4 +373,63 @@ mojo_ptr_->GetCloudIdentifiers(std::move(callback)); } +void FileSystemFileHandle::CheckFileSystemStorageAccessIsAllowed( + ExecutionContext* context, + base::OnceCallback<void(bool)> callback) { + SECURITY_DCHECK(context->IsWindow() || context->IsWorkerGlobalScope()); + + if (file_system_storage_access_allowed_.has_value()) { + std::move(callback).Run(file_system_storage_access_allowed_.value()); + return; + } + + WebContentSettingsClient* content_settings_client = nullptr; + if (auto* window = DynamicTo<LocalDOMWindow>(context)) { + LocalFrame* frame = window->GetFrame(); + if (!frame) { + std::move(callback).Run(false); + return; + } + + content_settings_client = frame->GetContentSettingsClient(); + } else { + content_settings_client = + To<WorkerGlobalScope>(context)->ContentSettingsClient(); + } + + if (!content_settings_client) { + std::move(callback).Run(true); + return; + } + + content_settings_client->AllowStorageAccess( + WebContentSettingsClient::StorageType::kFileSystem, std::move(callback)); +} + +void FileSystemFileHandle::OnGotFileSystemStorageAccessStatus( + ScriptPromiseResolver<FileSystemSyncAccessHandle>* resolver, + base::OnceClosure on_allowed_callback, + bool allow_access) { + if (!resolver->GetExecutionContext() || + !resolver->GetScriptState()->ContextIsValid()) { + return; + } + + if (file_system_storage_access_allowed_.has_value()) { + DCHECK_EQ(file_system_storage_access_allowed_.value(), allow_access); + } else { + file_system_storage_access_allowed_ = allow_access; + } + + if (!allow_access) { + auto* const isolate = resolver->GetScriptState()->GetIsolate(); + ScriptState::Scope scope(resolver->GetScriptState()); + resolver->Reject(V8ThrowDOMException::CreateOrEmpty( + isolate, DOMExceptionCode::kSecurityError, kSecurityErrorMessage)); + return; + } + + std::move(on_allowed_callback).Run(); +} + } // namespace blink
diff --git a/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.h b/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.h index c1bdb265..1a65ba6 100644 --- a/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.h +++ b/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.h
@@ -7,6 +7,7 @@ #include "mojo/public/cpp/bindings/pending_remote.h" #include "third_party/blink/public/mojom/file_system_access/file_system_access_file_handle.mojom-blink.h" +#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" #include "third_party/blink/renderer/modules/file_system_access/file_system_handle.h" #include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" #include "third_party/blink/renderer/platform/wtf/casting.h" @@ -83,7 +84,23 @@ mojom::blink::FileSystemAccessErrorPtr, Vector<mojom::blink::FileSystemAccessCloudIdentifierPtr>)>) override; + void CreateSyncAccessHandleImpl( + const FileSystemCreateSyncAccessHandleOptions* options, + ScriptPromiseResolver<FileSystemSyncAccessHandle>* resolver); + + // Checks if the File System Storage Access is allowed for the current + // frame. + void CheckFileSystemStorageAccessIsAllowed( + ExecutionContext* context, + base::OnceCallback<void(bool)> callback); + void OnGotFileSystemStorageAccessStatus( + ScriptPromiseResolver<FileSystemSyncAccessHandle>* resolver, + base::OnceClosure on_allowed_callback, + bool allow_access); + HeapMojoRemote<mojom::blink::FileSystemAccessFileHandle> mojo_ptr_; + + std::optional<bool> file_system_storage_access_allowed_; }; template <>
diff --git a/third_party/blink/renderer/modules/shared_storage/shared_storage_worklet.cc b/third_party/blink/renderer/modules/shared_storage/shared_storage_worklet.cc index c068bd25..281b9bda 100644 --- a/third_party/blink/renderer/modules/shared_storage/shared_storage_worklet.cc +++ b/third_party/blink/renderer/modules/shared_storage/shared_storage_worklet.cc
@@ -196,8 +196,6 @@ return; } - LogSharedStorageWorkletError( - SharedStorageWorkletErrorType::kSuccess); base::UmaHistogramMediumTimes( "Storage.SharedStorage.Document.Timing.AddModule", base::TimeTicks::Now() - start_time); @@ -208,6 +206,9 @@ } else { resolver->DowncastTo<IDLUndefined>()->Resolve(); } + + // `SharedStorageWorkletErrorType::kSuccess` is logged in the + // browser process for `addModule()` and `createWorklet()`. }, WrapPersistent(resolver), WrapPersistent(this), start_time, resolve_to_worklet)); @@ -475,8 +476,6 @@ return; } - LogSharedStorageWorkletError( - SharedStorageWorkletErrorType::kSuccess); base::UmaHistogramMediumTimes( "Storage.SharedStorage.Document.Timing.SelectURL", base::TimeTicks::Now() - start_time); @@ -488,6 +487,9 @@ } else { resolver->Resolve(KURL(result_config->urn_uuid().value())); } + + // `SharedStorageWorkletErrorType::kSuccess` is logged in the + // browser process for `selectURL()`. }, WrapPersistent(resolver), WrapPersistent(this), start_time, resolve_to_config)); @@ -591,12 +593,13 @@ return; } - LogSharedStorageWorkletError( - SharedStorageWorkletErrorType::kSuccess); base::UmaHistogramMediumTimes( "Storage.SharedStorage.Document.Timing.Run", base::TimeTicks::Now() - start_time); resolver->Resolve(); + + // `SharedStorageWorkletErrorType::kSuccess` is logged in the + // browser process for `run()`. }, WrapPersistent(resolver), WrapPersistent(this), start_time));
diff --git a/third_party/blink/renderer/modules/webaudio/realtime_audio_destination_handler.cc b/third_party/blink/renderer/modules/webaudio/realtime_audio_destination_handler.cc index 59b33f8a..2882ceb 100644 --- a/third_party/blink/renderer/modules/webaudio/realtime_audio_destination_handler.cc +++ b/third_party/blink/renderer/modules/webaudio/realtime_audio_destination_handler.cc
@@ -342,17 +342,9 @@ void RealtimeAudioDestinationHandler::CreatePlatformDestination() { DCHECK(IsMainThread()); - if (base::FeatureList::IsEnabled(features::kWebAudioSinkSelection)) { - platform_destination_ = AudioDestination::Create( - *this, sink_descriptor_, ChannelCount(), latency_hint_, sample_rate_, - Context()->GetDeferredTaskHandler().RenderQuantumFrames()); - } else { - WebAudioSinkDescriptor - sink_descriptor(String(""), sink_descriptor_.Token()); - platform_destination_ = AudioDestination::Create( - *this, sink_descriptor, ChannelCount(), latency_hint_, sample_rate_, - Context()->GetDeferredTaskHandler().RenderQuantumFrames()); - } + platform_destination_ = AudioDestination::Create( + *this, sink_descriptor_, ChannelCount(), latency_hint_, sample_rate_, + Context()->GetDeferredTaskHandler().RenderQuantumFrames()); // if `sample_rate_` is nullopt, it is supposed to use the default device // sample rate. Update the internal sample rate for subsequent device change
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn index e43f998e..0c7d12a 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -2344,6 +2344,7 @@ "//media:test_support", "//media/capture/mojom:video_capture", "//media/mojo:test_support", + "//media/webrtc:webrtc", "//mojo/core/embedder", "//mojo/public/cpp/bindings/tests:for_blink_tests", "//mojo/public/cpp/test_support:test_utils",
diff --git a/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.cc b/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.cc index 77a2df7..4aae0157 100644 --- a/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.cc +++ b/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.cc
@@ -4,12 +4,10 @@ #include "third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.h" -#include "base/debug/crash_logging.h" -#include "base/feature_list.h" -#include "base/metrics/field_trial_params.h" #include "base/numerics/safe_conversions.h" #include "base/task/single_thread_task_runner.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" +#include "third_party/blink/renderer/platform/runtime_enabled_features.h" #include "third_party/blink/renderer/platform/wtf/text/string_builder.h" namespace blink { @@ -43,7 +41,9 @@ : bytes_consumer_(bytes_consumer), timer_(std::move(timer_task_runner), this, - &BufferingBytesConsumer::OnTimerFired) { + &BufferingBytesConsumer::OnTimerFired), + is_limiting_total_buffer_size_( + RuntimeEnabledFeatures::BufferedBytesConsumerLimitSizeEnabled()) { bytes_consumer_->SetClient(this); if (buffering_start_delay.is_zero()) { MaybeStartBuffering(); @@ -94,9 +94,10 @@ return has_seen_end_of_data_ ? Result::kDone : Result::kShouldWait; } - DCHECK_LT(offset_for_first_chunk_, buffer_[0]->size()); - *buffer = buffer_[0]->data() + offset_for_first_chunk_; - *available = buffer_[0]->size() - offset_for_first_chunk_; + HeapVector<char>* first_chunk = buffer_[0]; + DCHECK_LT(offset_for_first_chunk_, first_chunk->size()); + *buffer = first_chunk->data() + offset_for_first_chunk_; + *available = first_chunk->size() - offset_for_first_chunk_; return Result::kOk; } @@ -109,16 +110,32 @@ return Result::kError; } - DCHECK_LE(offset_for_first_chunk_ + read_size, buffer_[0]->size()); + HeapVector<char>* first_chunk = buffer_[0]; + + DCHECK_LE(offset_for_first_chunk_ + read_size, first_chunk->size()); offset_for_first_chunk_ += read_size; - if (offset_for_first_chunk_ == buffer_[0]->size()) { + if (offset_for_first_chunk_ == first_chunk->size()) { + const bool was_waiting_for_capacity = is_limiting_total_buffer_size_ && + !has_seen_end_of_data_ && + total_buffer_size_ >= kMaxBufferSize; + total_buffer_size_ -= first_chunk->size(); offset_for_first_chunk_ = 0; // Actively clear the unused HeapVector at this point. This allows the GC to // immediately reclaim it before any garbage collection is otherwise // triggered. This is useful in this high-performance case. - buffer_[0]->clear(); + first_chunk->clear(); + first_chunk = nullptr; buffer_.pop_front(); + if (was_waiting_for_capacity && total_buffer_size_ < kMaxBufferSize) { + // We might have stopped buffering due to not having enough space, so try + // reading more. + BufferData(); + if (has_seen_error_) { + DCHECK(buffer_.empty()); + return Result::kError; + } + } } if (buffer_.empty() && has_seen_end_of_data_) { @@ -205,7 +222,8 @@ return; DCHECK(bytes_consumer_); - while (true) { + while (!is_limiting_total_buffer_size_ || + total_buffer_size_ < kMaxBufferSize) { const char* p = nullptr; size_t available = 0; auto result = bytes_consumer_->BeginRead(&p, &available); @@ -215,6 +233,7 @@ auto* chunk = MakeGarbageCollected<HeapVector<char>>(); chunk->Append(p, base::checked_cast<wtf_size_t>(available)); buffer_.push_back(chunk); + total_buffer_size_ += chunk->size(); result = bytes_consumer_->EndRead(available); } if (result == Result::kDone) { @@ -224,6 +243,7 @@ } if (result != Result::kOk) { buffer_.clear(); + total_buffer_size_ = 0; has_seen_error_ = true; ClearClient(); return;
diff --git a/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.h b/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.h index 612433ee..e179d08 100644 --- a/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.h +++ b/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.h
@@ -13,6 +13,7 @@ #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/loader/fetch/bytes_consumer.h" #include "third_party/blink/renderer/platform/platform_export.h" +#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h" #include "third_party/blink/renderer/platform/timer.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" @@ -29,6 +30,12 @@ : public BytesConsumer, private BytesConsumer::Client { public: + // Once `total_buffer_size_` reaches this, we will stop reading until it drops + // below it again. For most users the simple cache won't store any file larger + // than 55MB, so there's no point in buffering more than that. This limit is + // only applied when the BufferedBytesConsumerLimitSize feature is enabled. + static constexpr size_t kMaxBufferSize = 55 * 1024 * 1024; + // Creates a BufferingBytesConsumer that waits some delay before beginning // to buffer data from the underlying consumer. This delay provides an // opportunity for the data to be drained before buffering begins. The @@ -90,6 +97,9 @@ HeapDeque<Member<HeapVector<char>>> buffer_; size_t offset_for_first_chunk_ = 0; + // The sum of the sizes of all Vectors in `buffer_`. + size_t total_buffer_size_ = 0; + enum class BufferingState { kDelayed, kStarted, @@ -99,6 +109,7 @@ bool has_seen_end_of_data_ = false; bool has_seen_error_ = false; + bool is_limiting_total_buffer_size_; Member<BytesConsumer::Client> client_; SEQUENCE_CHECKER(sequence_checker_); };
diff --git a/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer_test.cc b/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer_test.cc index 75dafc3..4e46b9d 100644 --- a/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer_test.cc +++ b/third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer_test.cc
@@ -4,6 +4,7 @@ #include "third_party/blink/renderer/platform/loader/fetch/buffering_bytes_consumer.h" +#include "base/strings/stringprintf.h" #include "base/test/task_environment.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h" @@ -265,5 +266,115 @@ EXPECT_FALSE(drained_consumer_handle.is_valid()); } +constexpr size_t kMaxBufferSize = BufferingBytesConsumer::kMaxBufferSize; + +struct MaxBytesParams { + size_t chunk_size; + size_t total_size; +}; + +class BufferingBytesConsumerMaxBytesTest + : public BufferingBytesConsumerTest, + public ::testing::WithParamInterface<MaxBytesParams> { + protected: + BufferingBytesConsumerMaxBytesTest() + : task_runner_(base::MakeRefCounted<scheduler::FakeTaskRunner>()), + replaying_bytes_consumer_( + MakeGarbageCollected<ReplayingBytesConsumer>(task_runner_)) {} + + size_t ChunkSize() const { return GetParam().chunk_size; } + + size_t TotalSize() const { return GetParam().total_size; } + + // Adds `TotalSize()` / `ChunkSize()` chunks to `consumer` of size + // `ChunkSize()`. + void FillReplayingBytesConsumer() { + CHECK_EQ(TotalSize() % ChunkSize(), 0u); + Vector<char> chunk(ChunkSize(), 'a'); + for (size_t size = 0; size < TotalSize(); size += ChunkSize()) { + replaying_bytes_consumer_->Add(Command(Command::kData, chunk)); + } + } + + std::pair<Result, Vector<char>> Read(BufferingBytesConsumer* consumer) { + auto* reader = MakeGarbageCollected<BytesConsumerTestReader>(consumer); + reader->set_max_chunk_size(ChunkSize()); + return reader->Run(task_runner_.get()); + } + + scoped_refptr<scheduler::FakeTaskRunner> task_runner_; + ScopedBufferedBytesConsumerLimitSizeForTest feature_{true}; + Persistent<ReplayingBytesConsumer> replaying_bytes_consumer_; +}; + +TEST_P(BufferingBytesConsumerMaxBytesTest, ReadLargeResourceSuccessfully) { + FillReplayingBytesConsumer(); + + replaying_bytes_consumer_->Add(Command(Command::kDone)); + + auto* bytes_consumer = + BufferingBytesConsumer::Create(replaying_bytes_consumer_); + + EXPECT_EQ(PublicState::kReadableOrWaiting, bytes_consumer->GetPublicState()); + EXPECT_EQ(PublicState::kReadableOrWaiting, + replaying_bytes_consumer_->GetPublicState()); + + task_runner_->RunUntilIdle(); + + EXPECT_EQ(PublicState::kReadableOrWaiting, bytes_consumer->GetPublicState()); + EXPECT_EQ(PublicState::kReadableOrWaiting, + replaying_bytes_consumer_->GetPublicState()); + + auto [result, data] = Read(bytes_consumer); + + EXPECT_EQ(PublicState::kClosed, bytes_consumer->GetPublicState()); + ASSERT_EQ(result, Result::kDone); + ASSERT_EQ(data.size(), TotalSize()); +} + +TEST_P(BufferingBytesConsumerMaxBytesTest, ReadLargeResourceWithError) { + FillReplayingBytesConsumer(); + + replaying_bytes_consumer_->Add(Command(Command::kError)); + + auto* bytes_consumer = + BufferingBytesConsumer::Create(replaying_bytes_consumer_); + + EXPECT_EQ(PublicState::kReadableOrWaiting, bytes_consumer->GetPublicState()); + EXPECT_EQ(PublicState::kReadableOrWaiting, + replaying_bytes_consumer_->GetPublicState()); + + task_runner_->RunUntilIdle(); + + EXPECT_EQ(PublicState::kReadableOrWaiting, bytes_consumer->GetPublicState()); + EXPECT_EQ(PublicState::kReadableOrWaiting, + replaying_bytes_consumer_->GetPublicState()); + + auto [result, data] = Read(bytes_consumer); + + EXPECT_EQ(PublicState::kErrored, bytes_consumer->GetPublicState()); + ASSERT_EQ(result, Result::kError); +} + +std::string PrintToString(const MaxBytesParams& params) { + auto& [chunk_size, total_size] = params; + return base::StringPrintf("%zu_%zu", chunk_size, total_size); +} + +constexpr size_t kSixDigitPrime = 665557; +constexpr size_t kNextMultipleOfSixDigitPrimeAfterMaxBufferSize = + ((kMaxBufferSize + kSixDigitPrime) / kSixDigitPrime) * kSixDigitPrime; + +INSTANTIATE_TEST_SUITE_P( + BufferingBytesConsumerMaxBytesTest, + BufferingBytesConsumerMaxBytesTest, + ::testing::Values(MaxBytesParams{1024 * 1024, kMaxBufferSize + 1024 * 1024}, + MaxBytesParams{ + kSixDigitPrime, + kNextMultipleOfSixDigitPrimeAfterMaxBufferSize}, + MaxBytesParams{1024 * 1024, kMaxBufferSize}, + MaxBytesParams{kMaxBufferSize, kMaxBufferSize}), + ::testing::PrintToStringParamName()); + } // namespace } // namespace blink
diff --git a/third_party/blink/renderer/platform/loader/fetch/fetch_context.h b/third_party/blink/renderer/platform/loader/fetch/fetch_context.h index 1100c30..dafad15f 100644 --- a/third_party/blink/renderer/platform/loader/fetch/fetch_context.h +++ b/third_party/blink/renderer/platform/loader/fetch/fetch_context.h
@@ -198,6 +198,20 @@ virtual scoped_refptr<const SecurityOrigin> GetTopFrameOrigin() const { return nullptr; } + + // Returns the list of potentially unused preload URLs flagged by the LCP + // predcitor, which is attached to the frame. This returns an empty Vector for + // Shared Workers and Service Workers. + virtual const Vector<KURL>& GetPotentiallyUnusedPreloads() const { + return empty_unused_preloads_; + } + + virtual void AddLcpPredictedCallback(base::OnceClosure callback) { + NOTIMPLEMENTED(); + } + + protected: + const Vector<KURL> empty_unused_preloads_; }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc index 757954677..9005337 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc +++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc
@@ -321,7 +321,6 @@ *reason); } } - } // namespace ResourceFetcherInit::ResourceFetcherInit( @@ -805,6 +804,11 @@ return DeferPolicy::kDefer; } + // Check if the resource is marked as a potentially unused preload request. + if (IsPotentiallyUnusedPreload(params)) { + return DeferPolicy::kDeferAndSchedule; + } + return DeferPolicy::kNoDefer; } @@ -823,6 +827,7 @@ // requests should be fulfilled by the MHTML archive). return !archive_ && !ResourceAlreadyLoadStarted(resource, policy); case DeferPolicy::kDefer: + case DeferPolicy::kDeferAndSchedule: return false; } } @@ -1001,13 +1006,14 @@ Resource* resource, DeferPolicy defer_policy) { switch (defer_policy) { + case DeferPolicy::kNoDefer: + break; case DeferPolicy::kDefer: + case DeferPolicy::kDeferAndSchedule: if (!ResourceAlreadyLoadStarted(resource, policy)) { return RevalidationPolicyForMetrics::kDefer; } break; - case DeferPolicy::kNoDefer: - break; } // A resource in memory cache but not yet loaded is a deferred resource // created in previous loads. @@ -1384,6 +1390,12 @@ } } + if (defer_policy == DeferPolicy::kDeferAndSchedule) { + // If |resource| is potentially unused preload based on the LCPP hint, + // schedule the loading instead of calling `StartLoad()`. + ScheduleLoadingPotentiallyUnusedPreload(resource); + } + if (policy != RevalidationPolicy::kUse) InsertAsPreloadIfNecessary(resource, params, resource_type); @@ -2338,9 +2350,11 @@ loaders_.erase(loader); } -bool ResourceFetcher::StartLoad(Resource* resource) { - DCHECK(resource->GetType() == ResourceType::kFont || - resource->GetType() == ResourceType::kImage); +bool ResourceFetcher::StartLoad(Resource* resource, + bool is_potentially_unused_preload) { + CHECK(resource->GetType() == ResourceType::kFont || + resource->GetType() == ResourceType::kImage || + is_potentially_unused_preload); // Currently the metrics collection codes are duplicated here and in // UpdateMemoryCacheStats() because we have two calling paths for triggering a // load here and RequestResource(). @@ -2349,7 +2363,7 @@ base::UmaHistogramEnumeration( RESOURCE_HISTOGRAM_PREFIX "Font", RevalidationPolicyForMetrics::kPreviouslyDeferredLoad); - } else { + } else if (resource->GetType() == ResourceType::kImage) { base::UmaHistogramEnumeration( RESOURCE_HISTOGRAM_PREFIX "Image", RevalidationPolicyForMetrics::kPreviouslyDeferredLoad); @@ -2444,6 +2458,39 @@ return true; } +void ResourceFetcher::ScheduleLoadingPotentiallyUnusedPreload( + Resource* resource) { + static const features::LcppDeferUnusedPreloadTiming load_timing = + features::kLcppDeferUnusedPreloadTiming.Get(); + switch (load_timing) { + case features::LcppDeferUnusedPreloadTiming::kPostTask: + freezable_task_runner_->PostTask( + FROM_HERE, + WTF::BindOnce(&ResourceFetcher::StartLoadAndFinishIfFailed, + WrapWeakPersistent(this), WrapWeakPersistent(resource), + /*is_potentially_unused_preload=*/true)); + break; + case features::LcppDeferUnusedPreloadTiming::kLcpTimingPredictor: + context_->AddLcpPredictedCallback( + WTF::BindOnce(&ResourceFetcher::StartLoadAndFinishIfFailed, + WrapWeakPersistent(this), WrapWeakPersistent(resource), + /*is_potentially_unused_preload=*/true)); + break; + } +} + +void ResourceFetcher::StartLoadAndFinishIfFailed( + Resource* resource, + bool is_potentially_unused_preload) { + if (!resource || !resource->StillNeedsLoad()) { + return; + } + if (!StartLoad(resource, is_potentially_unused_preload)) { + resource->FinishAsError(ResourceError::CancelledError(resource->Url()), + freezable_task_runner_.get()); + } +} + void ResourceFetcher::RemoveResourceLoader(ResourceLoader* loader) { DCHECK(loader); @@ -2893,6 +2940,46 @@ } } +bool ResourceFetcher::IsPotentiallyUnusedPreload( + const FetchParameters& params) const { + static const bool kDeferUnusedPreload = + base::FeatureList::IsEnabled(features::kLCPPDeferUnusedPreload); + if (!kDeferUnusedPreload && !defer_unused_preload_enabled_for_testing_) { + return false; + } + + static const LcppDeferUnusedPreloadPreloadedReason kPreloadedReason = + features::kLcppDeferUnusedPreloadPreloadedReason.Get(); + LcppDeferUnusedPreloadPreloadedReason preloaded_reason; + if (defer_unused_preload_enabled_for_testing_) { + preloaded_reason = defer_unused_preload_preloaded_reason_for_testing_; + } else { + preloaded_reason = kPreloadedReason; + } + bool reason_matched = false; + switch (preloaded_reason) { + case LcppDeferUnusedPreloadPreloadedReason::kAll: + reason_matched = params.IsLinkPreload() || params.IsSpeculativePreload(); + break; + case LcppDeferUnusedPreloadPreloadedReason::kLinkPreloadOnly: + reason_matched = params.IsLinkPreload(); + break; + case LcppDeferUnusedPreloadPreloadedReason::kBrowserSpeculativePreloadOnly: + // Check |is_link_preload| here because |is_link_preload| and + // |is_speculative_preload| are not mutually exclusive. When + // |is_speculative_preload| is true, it's possible that |is_link_preload| + // is also true. That is the case when the resource was made via preload + // scanner for <link rel=preload>. + reason_matched = params.IsSpeculativePreload() && !params.IsLinkPreload(); + break; + } + if (!reason_matched) { + return false; + } + + return base::Contains(context_->GetPotentiallyUnusedPreloads(), params.Url()); +} + void ResourceFetcher::Trace(Visitor* visitor) const { visitor->Trace(context_); visitor->Trace(properties_);
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h index 9509283..b36f4aff 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h +++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h
@@ -35,6 +35,7 @@ #include "base/task/single_thread_task_runner.h" #include "base/unguessable_token.h" #include "services/metrics/public/cpp/mojo_ukm_recorder.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/subresource_load_metrics.h" #include "third_party/blink/public/mojom/blob/blob_registry.mojom-blink.h" #include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink-forward.h" @@ -221,7 +222,7 @@ // Usually, RequestResource() calls this method internally, but needs to // call this method explicitly on cases such as ResourceNeedsLoad() returning // false. - bool StartLoad(Resource*); + bool StartLoad(Resource*, bool is_potentially_unused_preload = false); void SetAutoLoadImages(bool); @@ -377,6 +378,16 @@ Resource* resource, const ResourceResponse& response); + void EnableDeferUnusedPreloadForTesting() { + defer_unused_preload_enabled_for_testing_ = true; + } + using LcppDeferUnusedPreloadPreloadedReason = + features::LcppDeferUnusedPreloadPreloadedReason; + void SetDeferUnusedPreloadPreloadedReasonForTesting( + LcppDeferUnusedPreloadPreloadedReason reason) { + defer_unused_preload_preloaded_reason_for_testing_ = reason; + } + private: friend class ResourceCacheValidationSuppressor; enum class StopFetchingTarget { @@ -389,6 +400,10 @@ // kDefer doesn't start loading in `ResourceRequest()`. This option is used // to defer a non-link preload font, or image loading is disabled. kDefer, + // kDeferAndSchedule doesn't start loading immediately in + // `ResourceRequest()`, but schedule the loading task instead. This option + // is used by the LCPP feature, DeferUnusedPreload. + kDeferAndSchedule, }; bool StartLoad(Resource*, @@ -571,6 +586,12 @@ ResourceType type, RevalidationPolicyForMetrics policy) const; + void ScheduleLoadingPotentiallyUnusedPreload(Resource*); + void StartLoadAndFinishIfFailed(Resource*, + bool is_potentially_unused_preload); + + bool IsPotentiallyUnusedPreload(const FetchParameters& params) const; + Member<DetachableResourceFetcherProperties> properties_; Member<ResourceLoadObserver> resource_load_observer_; Member<FetchContext> context_; @@ -672,6 +693,10 @@ // Number of resources that have had their priority boosted based on LCPP // signals. uint32_t potentially_lcp_resource_priority_boosts_ = 0; + + bool defer_unused_preload_enabled_for_testing_ = false; + LcppDeferUnusedPreloadPreloadedReason + defer_unused_preload_preloaded_reason_for_testing_; }; class ResourceCacheValidationSuppressor {
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher_test.cc b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher_test.cc index bacdcd08..5bc7d97 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher_test.cc +++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher_test.cc
@@ -1749,4 +1749,317 @@ ASSERT_EQ(observer->GetLastRequest(), std::nullopt); } +class DeferUnusedPreloadResourceFetcherTest : public ResourceFetcherTest { + public: + DeferUnusedPreloadResourceFetcherTest() { + scoped_feature_list_.InitWithFeaturesAndParameters( + {{features::kLCPPDeferUnusedPreload, + {{features::kLcppDeferUnusedPreloadTiming.name, "post_task"}}}}, + {}); + } + + ResourceFetcher* CreateFetcher() { + MockFetchContext* context = MakeGarbageCollected<MockFetchContext>(); + context->SetPotentiallyUnusedPreload(potentially_unused_preloads_); + + scoped_refptr<const SecurityOrigin> source_origin = + SecurityOrigin::CreateUniqueOpaque(); + auto* fetcher = ResourceFetcherTest::CreateFetcher( + *MakeGarbageCollected<TestResourceFetcherProperties>(source_origin), + context); + fetcher->EnableDeferUnusedPreloadForTesting(); + return fetcher; + } + + const Vector<KURL>& potentially_unused_preloads() { + return potentially_unused_preloads_; + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; + const Vector<KURL> potentially_unused_preloads_{ + KURL("http://127.0.0.1:8000/test.jpg"), + KURL("http://127.0.0.1:8000/test2.jpg"), + KURL("http://127.0.0.1:8000/test3.jpg")}; +}; + +TEST_F(DeferUnusedPreloadResourceFetcherTest, IsPotentiallyUnusedPreload) { + ResourceFetcher* fetcher = CreateFetcher(); + // A single preload request. + { + KURL url = potentially_unused_preloads()[0]; + FetchParameters fetch_params = + FetchParameters::CreateForTest(ResourceRequest(url)); + fetch_params.SetLinkPreload(/*is_link_preload=*/true); + ResourceResponse response(url); + response.SetHttpStatusCode(200); + + platform_->GetURLLoaderMockFactory()->RegisterURL( + url, WrappedResourceResponse(response), + test::PlatformTestDataPath(kTestResourceFilename)); + + Resource* resource = MockResource::Fetch(fetch_params, fetcher, nullptr); + ASSERT_TRUE(resource); + + // The resource loading is not started yet because it's delayed with the + // post task. On the other hand, it's stored in the memory cache at this + // timing. + platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); + EXPECT_FALSE(resource->IsLoaded()); + EXPECT_TRUE(MemoryCache::Get()->Contains(resource)); + + static_cast<scheduler::FakeTaskRunner*>(fetcher->GetTaskRunner().get()) + ->RunUntilIdle(); + platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); + EXPECT_TRUE(resource->IsLoaded()); + EXPECT_TRUE(MemoryCache::Get()->Contains(resource)); + } + + // A preload request is scheduled, then other preload requests to the same + // resource are passed to the fetcher. + { + KURL url = potentially_unused_preloads()[1]; + FetchParameters fetch_params = + FetchParameters::CreateForTest(ResourceRequest(url)); + fetch_params.SetLinkPreload(/*is_link_preload=*/true); + + ResourceResponse response(url); + response.SetHttpStatusCode(200); + + platform_->GetURLLoaderMockFactory()->RegisterURL( + url, WrappedResourceResponse(response), + test::PlatformTestDataPath(kTestResourceFilename)); + + Resource* resource = MockResource::Fetch(fetch_params, fetcher, nullptr); + ASSERT_TRUE(resource); + + // The resource loading is not started yet. + platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); + EXPECT_FALSE(resource->IsLoaded()); + EXPECT_TRUE(MemoryCache::Get()->Contains(resource)); + + // Handle another request with the link preload. This request is not sent, + // and the resource is the same one as the initial preload resource. + FetchParameters new_fetch_params = + FetchParameters::CreateForTest(ResourceRequest(url)); + new_fetch_params.SetLinkPreload(/*is_link_preload=*/true); + Resource* new_resource = + MockResource::Fetch(new_fetch_params, fetcher, nullptr); + ASSERT_TRUE(new_resource); + EXPECT_FALSE(new_resource->IsLoaded()); + ASSERT_EQ(new_resource, resource); + + // Handle another request with the speculative preload. This request is not + // sent, and the resource is the same one as the initial preload resource. + FetchParameters another_new_fetch_params = + FetchParameters::CreateForTest(ResourceRequest(url)); + another_new_fetch_params.SetSpeculativePreloadType( + FetchParameters::SpeculativePreloadType::kInDocument); + Resource* another_new_resource = + MockResource::Fetch(another_new_fetch_params, fetcher, nullptr); + ASSERT_TRUE(another_new_resource); + EXPECT_FALSE(another_new_resource->IsLoaded()); + ASSERT_EQ(another_new_resource, resource); + + static_cast<scheduler::FakeTaskRunner*>(fetcher->GetTaskRunner().get()) + ->RunUntilIdle(); + platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); + EXPECT_TRUE(new_resource->IsLoaded()); + } + + // A preload request is scheduled, then another non-preload request to the + // same resource is passed to the fetcher. + { + KURL url = potentially_unused_preloads()[2]; + FetchParameters fetch_params = + FetchParameters::CreateForTest(ResourceRequest(url)); + fetch_params.SetLinkPreload(/*is_link_preload=*/true); + + ResourceResponse response(url); + response.SetHttpStatusCode(200); + + platform_->GetURLLoaderMockFactory()->RegisterURL( + url, WrappedResourceResponse(response), + test::PlatformTestDataPath(kTestResourceFilename)); + + Resource* resource = MockResource::Fetch(fetch_params, fetcher, nullptr); + ASSERT_TRUE(resource); + + // The resource loading is not started yet. + platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); + EXPECT_FALSE(resource->IsLoaded()); + EXPECT_TRUE(MemoryCache::Get()->Contains(resource)); + + // Handle another request without preloading signals just like the normal + // resource request. |resource| is the same one as the initial preload + // resource, but the request is dispatched immediately. + FetchParameters new_fetch_params = + FetchParameters::CreateForTest(ResourceRequest(url)); + Resource* new_resource = + MockResource::Fetch(new_fetch_params, fetcher, nullptr); + ASSERT_TRUE(new_resource); + ASSERT_EQ(new_resource, resource); + + platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); + EXPECT_TRUE(new_resource->IsLoaded()); + + // Confirm if the scheduled task is processed. + static_cast<scheduler::FakeTaskRunner*>(fetcher->GetTaskRunner().get()) + ->RunUntilIdle(); + } +} + +class DeferUnusedPreloadWithPreloadedReasonResourceFetcherTest + : public DeferUnusedPreloadResourceFetcherTest, + public testing::WithParamInterface< + features::LcppDeferUnusedPreloadPreloadedReason> { + public: + DeferUnusedPreloadWithPreloadedReasonResourceFetcherTest() { + scoped_feature_list_.InitWithFeaturesAndParameters( + {{features::kLCPPDeferUnusedPreload, + {{features::kLcppDeferUnusedPreloadPreloadedReason.name, + GetParamString()}}}}, + {}); + } + + features::LcppDeferUnusedPreloadPreloadedReason PreloadedReason() { + return GetParam(); + } + + std::string GetParamString() { + switch (PreloadedReason()) { + case features::LcppDeferUnusedPreloadPreloadedReason::kAll: + return "all"; + case features::LcppDeferUnusedPreloadPreloadedReason::kLinkPreloadOnly: + return "link_preload"; + case features::LcppDeferUnusedPreloadPreloadedReason:: + kBrowserSpeculativePreloadOnly: + return "speculative_preload"; + } + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +INSTANTIATE_TEST_SUITE_P( + All, + DeferUnusedPreloadWithPreloadedReasonResourceFetcherTest, + testing::Values( + features::LcppDeferUnusedPreloadPreloadedReason::kAll, + features::LcppDeferUnusedPreloadPreloadedReason::kLinkPreloadOnly, + features::LcppDeferUnusedPreloadPreloadedReason:: + kBrowserSpeculativePreloadOnly)); + +TEST_P(DeferUnusedPreloadWithPreloadedReasonResourceFetcherTest, NotPreload) { + ResourceFetcher* fetcher = CreateFetcher(); + fetcher->SetDeferUnusedPreloadPreloadedReasonForTesting(PreloadedReason()); + KURL url = potentially_unused_preloads()[0]; + FetchParameters fetch_params = + FetchParameters::CreateForTest(ResourceRequest(url)); + + fetch_params.SetLinkPreload(/*is_link_preload=*/false); + ASSERT_FALSE(fetch_params.IsLinkPreload()); + ASSERT_FALSE(fetch_params.IsSpeculativePreload()); + + ResourceResponse response(url); + response.SetHttpStatusCode(200); + + platform_->GetURLLoaderMockFactory()->RegisterURL( + url, WrappedResourceResponse(response), + test::PlatformTestDataPath(kTestResourceFilename)); + + Resource* resource = MockResource::Fetch(fetch_params, fetcher, nullptr); + ASSERT_TRUE(resource); + + platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); + EXPECT_TRUE(resource->IsLoaded()); + EXPECT_TRUE(MemoryCache::Get()->Contains(resource)); +} + +TEST_P(DeferUnusedPreloadWithPreloadedReasonResourceFetcherTest, LinkPreload) { + ResourceFetcher* fetcher = CreateFetcher(); + fetcher->SetDeferUnusedPreloadPreloadedReasonForTesting(PreloadedReason()); + KURL url = potentially_unused_preloads()[0]; + FetchParameters fetch_params = + FetchParameters::CreateForTest(ResourceRequest(url)); + + fetch_params.SetLinkPreload(/*is_link_preload=*/true); + ASSERT_FALSE(fetch_params.IsSpeculativePreload()); + + ResourceResponse response(url); + response.SetHttpStatusCode(200); + + platform_->GetURLLoaderMockFactory()->RegisterURL( + url, WrappedResourceResponse(response), + test::PlatformTestDataPath(kTestResourceFilename)); + + Resource* resource = MockResource::Fetch(fetch_params, fetcher, nullptr); + ASSERT_TRUE(resource); + + platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); + switch (PreloadedReason()) { + case features::LcppDeferUnusedPreloadPreloadedReason::kAll: + EXPECT_FALSE(resource->IsLoaded()); + break; + case features::LcppDeferUnusedPreloadPreloadedReason::kLinkPreloadOnly: + EXPECT_FALSE(resource->IsLoaded()); + break; + case features::LcppDeferUnusedPreloadPreloadedReason:: + kBrowserSpeculativePreloadOnly: + EXPECT_TRUE(resource->IsLoaded()); + break; + } + EXPECT_TRUE(MemoryCache::Get()->Contains(resource)); + + static_cast<scheduler::FakeTaskRunner*>(fetcher->GetTaskRunner().get()) + ->RunUntilIdle(); + platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); + EXPECT_TRUE(resource->IsLoaded()); + EXPECT_TRUE(MemoryCache::Get()->Contains(resource)); +} + +TEST_P(DeferUnusedPreloadWithPreloadedReasonResourceFetcherTest, + SpeculativePreload) { + ResourceFetcher* fetcher = CreateFetcher(); + fetcher->SetDeferUnusedPreloadPreloadedReasonForTesting(PreloadedReason()); + KURL url = potentially_unused_preloads()[0]; + FetchParameters fetch_params = + FetchParameters::CreateForTest(ResourceRequest(url)); + + fetch_params.SetSpeculativePreloadType( + FetchParameters::SpeculativePreloadType::kInDocument); + ASSERT_TRUE(fetch_params.IsSpeculativePreload()); + + ResourceResponse response(url); + response.SetHttpStatusCode(200); + + platform_->GetURLLoaderMockFactory()->RegisterURL( + url, WrappedResourceResponse(response), + test::PlatformTestDataPath(kTestResourceFilename)); + + Resource* resource = MockResource::Fetch(fetch_params, fetcher, nullptr); + ASSERT_TRUE(resource); + + platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); + switch (PreloadedReason()) { + case features::LcppDeferUnusedPreloadPreloadedReason::kAll: + EXPECT_FALSE(resource->IsLoaded()); + break; + case features::LcppDeferUnusedPreloadPreloadedReason::kLinkPreloadOnly: + EXPECT_TRUE(resource->IsLoaded()); + break; + case features::LcppDeferUnusedPreloadPreloadedReason:: + kBrowserSpeculativePreloadOnly: + EXPECT_FALSE(resource->IsLoaded()); + break; + } + EXPECT_TRUE(MemoryCache::Get()->Contains(resource)); + + static_cast<scheduler::FakeTaskRunner*>(fetcher->GetTaskRunner().get()) + ->RunUntilIdle(); + platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); + EXPECT_TRUE(resource->IsLoaded()); + EXPECT_TRUE(MemoryCache::Get()->Contains(resource)); +} } // namespace blink
diff --git a/third_party/blink/renderer/platform/loader/testing/bytes_consumer_test_reader.cc b/third_party/blink/renderer/platform/loader/testing/bytes_consumer_test_reader.cc index 47f56e2..1bedf59b 100644 --- a/third_party/blink/renderer/platform/loader/testing/bytes_consumer_test_reader.cc +++ b/third_party/blink/renderer/platform/loader/testing/bytes_consumer_test_reader.cc
@@ -22,11 +22,8 @@ if (result == BytesConsumer::Result::kShouldWait) return; if (result == BytesConsumer::Result::kOk) { - // We don't use |available| as-is to test cases where endRead - // is called with a number smaller than |available|. We choose 3 - // because of the same reasons as Reader::onStateChange. wtf_size_t read = - static_cast<wtf_size_t>(std::min(static_cast<size_t>(3), available)); + static_cast<wtf_size_t>(std::min(max_chunk_size_, available)); data_.Append(buffer, read); result = consumer_->EndRead(read); }
diff --git a/third_party/blink/renderer/platform/loader/testing/bytes_consumer_test_reader.h b/third_party/blink/renderer/platform/loader/testing/bytes_consumer_test_reader.h index ad4a44b..7901fb5 100644 --- a/third_party/blink/renderer/platform/loader/testing/bytes_consumer_test_reader.h +++ b/third_party/blink/renderer/platform/loader/testing/bytes_consumer_test_reader.h
@@ -30,6 +30,9 @@ std::pair<BytesConsumer::Result, Vector<char>> Run( scheduler::FakeTaskRunner*); + // `max_chunk_size_` can be set to a larger value when efficiency is needed. + void set_max_chunk_size(size_t bytes) { max_chunk_size_ = bytes; } + void Trace(Visitor* visitor) const override { visitor->Trace(consumer_); BytesConsumer::Client::Trace(visitor); @@ -38,6 +41,11 @@ private: Member<BytesConsumer> consumer_; BytesConsumer::Result result_ = BytesConsumer::Result::kShouldWait; + + // We read small chunks by default to provide coverage for cases when + // EndRead() is called with a number smaller than `available`. + size_t max_chunk_size_ = 3; + Vector<char> data_; };
diff --git a/third_party/blink/renderer/platform/loader/testing/mock_fetch_context.h b/third_party/blink/renderer/platform/loader/testing/mock_fetch_context.h index 2144081..476c615999 100644 --- a/third_party/blink/renderer/platform/loader/testing/mock_fetch_context.h +++ b/third_party/blink/renderer/platform/loader/testing/mock_fetch_context.h
@@ -113,6 +113,14 @@ resource_load_info_notifier_ = resource_load_info_notifier; } + void SetPotentiallyUnusedPreload(const Vector<KURL>& urls) { + potentially_unused_preloads_ = urls; + } + + const Vector<KURL>& GetPotentiallyUnusedPreloads() const override { + return potentially_unused_preloads_; + } + private: raw_ptr<mojom::ResourceLoadInfoNotifier> resource_load_info_notifier_ = nullptr; @@ -120,6 +128,7 @@ weak_wrapper_resource_load_info_notifier_; Vector<String> blocked_urls_; Vector<String> tagged_urls_; + Vector<KURL> potentially_unused_preloads_; }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/peerconnection/DEPS b/third_party/blink/renderer/platform/peerconnection/DEPS index 67c69f6..d61a262 100644 --- a/third_party/blink/renderer/platform/peerconnection/DEPS +++ b/third_party/blink/renderer/platform/peerconnection/DEPS
@@ -29,6 +29,7 @@ "+media/video/video_decode_accelerator.h", "+media/video/h264_parser.h", "+media/video/video_encode_accelerator.h", + "+media/webrtc/webrtc_features.h", "+third_party/blink/renderer/platform/allow_discouraged_type.h", "+third_party/blink/renderer/platform/bindings/script_wrappable.h", "+third_party/blink/renderer/platform/heap",
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc index 46d7659..7b7be729 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc
@@ -105,6 +105,9 @@ } bool HasSoftwareFallback(media::VideoCodec video_codec) { + if (video_codec == media::VideoCodec::kHEVC) { + return false; + } #if BUILDFLAG(IS_ANDROID) && !BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS) return video_codec != media::VideoCodec::kH264; #else @@ -515,7 +518,8 @@ media::EncryptionScheme::kUnencrypted); config.set_is_rtc(true); - if (!resolution_monitor) { + // HEVC does not have SW fallback, so resolution monitor is not needed. + if (!resolution_monitor && HasSoftwareFallback(config.codec())) { resolution_monitor = ResolutionMonitor::Create(config.codec()); if (!resolution_monitor) { DLOG(ERROR) << "Failed to create ResolutionMonitor for codec: " @@ -552,8 +556,10 @@ resolution_monitor_(std::move(resolution_monitor)) { DCHECK_CALLED_ON_VALID_SEQUENCE(decoding_sequence_checker_); DVLOG(1) << __func__; - CHECK(resolution_monitor_); - CHECK_EQ(resolution_monitor_->codec(), config_.codec()); + if (HasSoftwareFallback(config.codec())) { + CHECK(resolution_monitor_); + CHECK_EQ(resolution_monitor_->codec(), config_.codec()); + } decoder_info_.implementation_name = "ExternalDecoder (Unknown)"; decoder_info_.is_hardware_accelerated = true; @@ -627,8 +633,10 @@ if (WebRtcToMediaVideoCodec(settings.codec_type()) != config_.codec()) return false; - CHECK_EQ(resolution_monitor_->codec(), - WebRtcToMediaVideoCodec(settings.codec_type())); + if (HasSoftwareFallback(config_.codec())) { + CHECK_EQ(resolution_monitor_->codec(), + WebRtcToMediaVideoCodec(settings.codec_type())); + } const bool init_success = status_ != Status::kError; base::UmaHistogramBoolean("Media.RTCVideoDecoderInitDecodeSuccess",
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter_test.cc b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter_test.cc index b92ce51..7173537 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter_test.cc +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter_test.cc
@@ -2,12 +2,14 @@ // 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/peerconnection/rtc_video_decoder_adapter.h" + +#include <stdint.h> + #include <memory> #include <utility> #include <vector> -#include <stdint.h> - #include "base/check.h" #include "base/functional/bind.h" #include "base/memory/ptr_util.h" @@ -32,8 +34,8 @@ #include "media/video/mock_gpu_video_accelerator_factories.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/renderer/platform/peerconnection/resolution_monitor.h" -#include "third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.h" #include "third_party/blink/renderer/platform/webrtc/webrtc_video_utils.h" #include "third_party/webrtc/api/video_codecs/video_codec.h" #include "third_party/webrtc/api/video_codecs/vp9_profile.h" @@ -728,6 +730,25 @@ EXPECT_EQ(GetCurrentDecoderCount(), 0); } +#if BUILDFLAG(RTC_USE_H265) +TEST_F(RTCVideoDecoderAdapterTest, DoesNotFailForH256LowResolution) { + // Make sure that low-resolution decode does not fail for H.265. + SetSdpFormat(webrtc::SdpVideoFormat( + webrtc::CodecTypeToPayloadString(webrtc::kVideoCodecH265))); + ASSERT_TRUE(CreateAndInitialize(true, false)); + webrtc::VideoDecoder::Settings settings; + settings.set_codec_type(webrtc::kVideoCodecH265); + ASSERT_TRUE(adapter_wrapper_->Configure(settings)); + ASSERT_EQ(RegisterDecodeCompleteCallback(), WEBRTC_VIDEO_CODEC_OK); + + EXPECT_CALL(*video_decoder_, Decode_(_, _)).Times(1); + + ASSERT_EQ(Decode(0), WEBRTC_VIDEO_CODEC_OK); + + media_thread_.FlushForTesting(); +} +#endif + TEST_F(RTCVideoDecoderAdapterTest, DoesNotFallBackForHighResolution) { // Make sure that high-resolution decoders don't fall back. webrtc::VideoDecoder::Settings decoder_settings;
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc index e7f6bcc..00a52ea6 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc
@@ -18,10 +18,14 @@ #include "media/base/media_util.h" #include "media/base/platform_features.h" #include "media/base/video_codecs.h" +#include "media/media_buildflags.h" #include "media/video/gpu_video_accelerator_factories.h" +#include "media/webrtc/webrtc_features.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.h" #include "third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.h" #include "third_party/blink/renderer/platform/webrtc/webrtc_video_utils.h" +#include "third_party/webrtc/api/video/resolution.h" #include "third_party/webrtc/api/video_codecs/h264_profile_level_id.h" #include "third_party/webrtc/api/video_codecs/vp9_profile.h" #include "third_party/webrtc/media/base/codec.h" @@ -29,6 +33,10 @@ #include "ui/gfx/color_space.h" #include "ui/gfx/geometry/size.h" +#if BUILDFLAG(RTC_USE_H265) +#include "third_party/webrtc/api/video_codecs/h265_profile_tier_level.h" +#endif // BUILDFLAG(RTC_USE_H265) + namespace blink { namespace { @@ -38,15 +46,20 @@ // returned by the internal software decoder. // TODO(crbug.com/1213437): Query gpu_factories_ or decoder_factory_ to // determine the maximum resolution and frame rate. -const int kDefaultFps = 30; -const gfx::Size kDefaultSize(1280, 720); +constexpr int kDefaultFps = 30; +constexpr gfx::Size kDefaultSize(1280, 720); +#if BUILDFLAG(RTC_USE_H265) +// For H.265 we use larger default resolution to signal support of 1080p and +// minimum required level 3.1. +constexpr gfx::Size kDefaultSizeH265(1920, 1080); +#endif // BUILDFLAG(RTC_USE_H265) struct CodecConfig { media::VideoCodec codec; media::VideoCodecProfile profile; }; -constexpr std::array<CodecConfig, 9> kCodecConfigs = {{ +constexpr CodecConfig kCodecConfigs[] = { {media::VideoCodec::kVP8, media::VP8PROFILE_ANY}, {media::VideoCodec::kVP9, media::VP9PROFILE_PROFILE0}, {media::VideoCodec::kVP9, media::VP9PROFILE_PROFILE1}, @@ -56,7 +69,11 @@ {media::VideoCodec::kH264, media::H264PROFILE_HIGH}, {media::VideoCodec::kH264, media::H264PROFILE_HIGH444PREDICTIVEPROFILE}, {media::VideoCodec::kAV1, media::AV1PROFILE_PROFILE_MAIN}, -}}; +#if BUILDFLAG(RTC_USE_H265) + {media::VideoCodec::kHEVC, media::HEVCPROFILE_MAIN}, + {media::VideoCodec::kHEVC, media::HEVCPROFILE_MAIN10}, +#endif // BUILDFLAG(RTC_USE_H265) +}; // Translate from media::VideoDecoderConfig to webrtc::SdpVideoFormat, or return // nothing if the profile isn't supported. @@ -122,6 +139,47 @@ {cricket::kH264FmtpLevelAsymmetryAllowed, "1"}}; return format; } + case media::VideoCodec::kHEVC: { +#if BUILDFLAG(RTC_USE_H265) + if (!base::FeatureList::IsEnabled(::features::kWebRtcAllowH265Receive)) { + return std::nullopt; + } + + webrtc::H265Profile h265_profile; + switch (config.profile()) { + case media::HEVCPROFILE_MAIN: + h265_profile = webrtc::H265Profile::kProfileMain; + break; + case media::HEVCPROFILE_MAIN10: + h265_profile = webrtc::H265Profile::kProfileMain10; + break; + default: + // Unsupported H265 profile in WebRTC. + return std::nullopt; + } + + gfx::Rect visible_rect(kDefaultSizeH265); + const webrtc::Resolution resolution = {.width = visible_rect.width(), + .height = visible_rect.height()}; + const std::optional<webrtc::H265Level> h265_level = + webrtc::GetSupportedH265Level(resolution, kDefaultFps); + const webrtc::H265ProfileTierLevel profile_tier_level( + h265_profile, webrtc::H265Tier::kTier0, + h265_level.value_or(webrtc::H265Level::kLevel1)); + + webrtc::SdpVideoFormat format(cricket::kH265CodecName); + format.parameters = { + {cricket::kH265FmtpProfileId, + webrtc::H265ProfileToString(profile_tier_level.profile)}, + {cricket::kH265FmtpTierFlag, + webrtc::H265TierToString(profile_tier_level.tier)}, + {cricket::kH265FmtpLevelId, + webrtc::H265LevelToString(profile_tier_level.level)}}; + return format; +#else + return std::nullopt; +#endif // BUILDFLAG(RTC_USE_H265) + } default: return std::nullopt; } @@ -262,6 +320,13 @@ media::VideoCodec codec = WebRtcToMediaVideoCodec(webrtc::PayloadStringToCodecType(format.name)); + + // If WebRtcAllowH265Receive is not enabled, report H.265 as unsupported. + if (codec == media::VideoCodec::kHEVC && + !base::FeatureList::IsEnabled(::features::kWebRtcAllowH265Receive)) { + return {false, false}; + } + if (reference_scaling) { // Check that the configuration is valid (e.g., H264 doesn't support SVC at // all and VP8 doesn't support spatial layers).
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory_test.cc b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory_test.cc index a7bdfff..9af3eaf 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory_test.cc +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory_test.cc
@@ -2,15 +2,19 @@ // 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/peerconnection/rtc_video_decoder_factory.h" + #include <stdint.h> +#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "media/base/platform_features.h" #include "media/base/video_codecs.h" #include "media/video/mock_gpu_video_accelerator_factories.h" #include "media/video/video_decode_accelerator.h" +#include "media/webrtc/webrtc_features.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.h" +#include "third_party/blink/public/common/features.h" #include "third_party/webrtc/api/video_codecs/sdp_video_format.h" #include "third_party/webrtc/api/video_codecs/video_decoder_factory.h" @@ -55,6 +59,16 @@ {{"level-asymmetry-allowed", "1"}, {"packetization-mode", "1"}, {"profile-level-id", "4d001f"}}); +#if BUILDFLAG(RTC_USE_H265) +const webrtc::SdpVideoFormat kH265MainProfileSdp("H265", + {{"profile-id", "1"}, + {"tier-flag", "0"}, + {"level-id", "93"}}); +const webrtc::SdpVideoFormat kH265Main10ProfileSdp("H265", + {{"profile-id", "2"}, + {"tier-flag", "0"}, + {"level-id", "93"}}); +#endif // BUILDFLAG(RTC_USE_H265) bool Equals(webrtc::VideoDecoderFactory::CodecSupport a, webrtc::VideoDecoderFactory::CodecSupport b) { @@ -84,7 +98,17 @@ } else { return Supported::kFalse; } - } else { + } +#if BUILDFLAG(RTC_USE_H265) + else if (config.codec() == media::VideoCodec::kHEVC) { + if (config.profile() == media::VideoCodecProfile::HEVCPROFILE_MAIN) { + return Supported::kTrue; + } else { + return Supported::kFalse; + } + } +#endif // BUILDFLAG(RTC_USE_H265) + else { return Supported::kFalse; } } @@ -160,6 +184,13 @@ {"profile-level-id", "42001f"}}), true /*reference_scaling*/), kUnsupported)); + + // If WebRTCAllowH265Receive is not enabled, H.265 decode should not be + // supported. + EXPECT_TRUE( + Equals(decoder_factory_.QueryCodecSupport(webrtc::SdpVideoFormat("H265"), + false /*reference_scaling*/), + kUnsupported)); } TEST_F(RTCVideoDecoderFactoryTest, GetSupportedFormatsReturnsAllExpectedModes) { @@ -175,4 +206,47 @@ kVp9Profile0Sdp, kVp9Profile1Sdp, kVp9Profile2Sdp, kAv1Sdp)); } +#if BUILDFLAG(RTC_USE_H265) +TEST_F(RTCVideoDecoderFactoryTest, + QueryCodecSupportH265WithWebRtcAllowH265ReceiveEnabled) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitWithFeatures({::features::kWebRtcAllowH265Receive}, + {}); + EXPECT_CALL(mock_gpu_factories_, IsDecoderSupportKnown()) + .WillRepeatedly(Return(true)); + + // H265 decode should be supported without reference scaling. + EXPECT_TRUE( + Equals(decoder_factory_.QueryCodecSupport(webrtc::SdpVideoFormat("H265"), + false /*reference_scaling*/), + kSupportedPowerEfficient)); + + // H265 decode should not be supported with reference scaling. + EXPECT_TRUE( + Equals(decoder_factory_.QueryCodecSupport(webrtc::SdpVideoFormat("H265"), + true /*reference_scaling*/), + kUnsupported)); + + // H265 decode should be supported with main profile explicitly configured. + EXPECT_TRUE(Equals(decoder_factory_.QueryCodecSupport( + webrtc::SdpVideoFormat("H265", {{"profile-id", "1"}}), + false /*reference_scaling*/), + kSupportedPowerEfficient)); + + // H265 main10 profile is not supported. + EXPECT_TRUE(Equals(decoder_factory_.QueryCodecSupport( + webrtc::SdpVideoFormat("H265", {{"profile-id", "2"}}), + false /*reference_scaling*/), + kUnsupported)); + + EXPECT_THAT( + decoder_factory_.GetSupportedFormats(), + UnorderedElementsAre( + kH264CbPacketizatonMode0Sdp, kH264CbPacketizatonMode1Sdp, + kH264BaselinePacketizatonMode0Sdp, kH264BaselinePacketizatonMode1Sdp, + kH264MainPacketizatonMode0Sdp, kH264MainPacketizatonMode1Sdp, + kVp9Profile0Sdp, kVp9Profile1Sdp, kVp9Profile2Sdp, kAv1Sdp, + kH265MainProfileSdp)); +} +#endif // BUILDFLAG(RTC_USE_H265) } // namespace blink
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.cc b/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.cc index 4c10d09..181ac81c1 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.cc +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.cc
@@ -575,6 +575,11 @@ case webrtc::VideoCodecType::kVideoCodecAV1: histogram_name += "AV1"; break; +#if BUILDFLAG(RTC_USE_H265) + case webrtc::VideoCodecType::kVideoCodecH265: + histogram_name += "H265"; + break; +#endif // BUILDFLAG(RTC_USE_H265) default: histogram_name += "Other"; break; @@ -2143,7 +2148,11 @@ // situations where a codec like H264 is available in HW but not SW in which // case SW fallback would result in a change of codec, see // https://crbug.com/1469318. - if (base::FeatureList::IsEnabled(features::kForceSoftwareForLowResolutions)) { + // + // H.265 does not support SW fallback, so it is excluded from low resoloution + // fallback. + if (codec_settings->codecType != webrtc::kVideoCodecH265 && + base::FeatureList::IsEnabled(features::kForceSoftwareForLowResolutions)) { uint16_t force_sw_height = 359; if (base::FeatureList::IsEnabled(features::kForcingSoftwareIncludes360)) { force_sw_height = 360; @@ -2156,8 +2165,7 @@ } } - if (profile_ >= media::H264PROFILE_MIN && - profile_ <= media::H264PROFILE_MAX && + if (codec_settings->codecType == webrtc::kVideoCodecH264 && (codec_settings->width % 2 != 0 || codec_settings->height % 2 != 0)) { LOG(ERROR) << "Input video size is " << codec_settings->width << "x" << codec_settings->height << ", "
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory.cc b/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory.cc index 4682fda..76a809d 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory.cc +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory.cc
@@ -10,18 +10,25 @@ #include "base/logging.h" #include "base/strings/string_util.h" #include "build/build_config.h" +#include "media/base/media_switches.h" #include "media/media_buildflags.h" #include "media/mojo/clients/mojo_video_encoder_metrics_provider.h" #include "media/video/gpu_video_accelerator_factories.h" +#include "media/webrtc/webrtc_features.h" #include "third_party/blink/public/common/features.h" #include "third_party/blink/renderer/platform/allow_discouraged_type.h" #include "third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.h" +#include "third_party/webrtc/api/video/resolution.h" #include "third_party/webrtc/api/video_codecs/h264_profile_level_id.h" #include "third_party/webrtc/api/video_codecs/sdp_video_format.h" #include "third_party/webrtc/api/video_codecs/video_encoder.h" #include "third_party/webrtc/api/video_codecs/vp9_profile.h" #include "third_party/webrtc/media/base/codec.h" +#if BUILDFLAG(RTC_USE_H265) +#include "third_party/webrtc/api/video_codecs/h265_profile_tier_level.h" +#endif // BUILDFLAG(RTC_USE_H265) + namespace blink { namespace { @@ -67,6 +74,11 @@ } else if (sdp.name == "AV1") { return media::VideoCodecProfile::AV1PROFILE_MIN; } +#if BUILDFLAG(RTC_USE_H265) + else if (sdp.name == "H265") { + return media::VideoCodecProfile::HEVCPROFILE_MIN; + } +#endif // BUILDFLAG(RTC_USE_H265) return std::nullopt; } @@ -74,7 +86,10 @@ // webrtc::SdpVideoFormat, or return nothing if the profile isn't supported. std::optional<webrtc::SdpVideoFormat> VEAToWebRTCFormat( const media::VideoEncodeAccelerator::SupportedProfile& profile) { - DCHECK_EQ(profile.max_framerate_denominator, 1U); + const int width = profile.max_resolution.width(); + const int height = profile.max_resolution.height(); + const int fps = profile.max_framerate_numerator; + DCHECK_EQ(1u, profile.max_framerate_denominator); if (profile.profile >= media::VP8PROFILE_MIN && profile.profile <= media::VP8PROFILE_MAX) { @@ -119,11 +134,6 @@ return std::nullopt; } - const int width = profile.max_resolution.width(); - const int height = profile.max_resolution.height(); - const int fps = profile.max_framerate_numerator; - DCHECK_EQ(1u, profile.max_framerate_denominator); - const std::optional<webrtc::H264Level> h264_level = webrtc::H264SupportedLevel(width * height, fps); const webrtc::H264ProfileLevelId profile_level_id( @@ -164,6 +174,47 @@ return webrtc::SdpVideoFormat("AV1"); } + if (profile.profile >= media::HEVCPROFILE_MIN && + profile.profile <= media::HEVCPROFILE_MAX) { +#if BUILDFLAG(RTC_USE_H265) + // Unlikely H.264, there is no SW encoder implementation for H.265, so we + // will not check SW support here. + webrtc::H265Profile h265_profile; + switch (profile.profile) { + case media::HEVCPROFILE_MAIN: + h265_profile = webrtc::H265Profile::kProfileMain; + break; + case media::HEVCPROFILE_MAIN10: + h265_profile = webrtc::H265Profile::kProfileMain10; + break; + default: + // Unsupported H.265 profiles(main still/range extensions etc) in + // WebRTC. + return std::nullopt; + } + const webrtc::Resolution resolution = { + .width = width, + .height = height, + }; + const std::optional<webrtc::H265Level> h265_level = + webrtc::GetSupportedH265Level(resolution, fps); + const webrtc::H265ProfileTierLevel profile_tier_level( + h265_profile, webrtc::H265Tier::kTier0, + h265_level.value_or(webrtc::H265Level::kLevel1)); + webrtc::SdpVideoFormat format("H265"); + format.parameters = { + {cricket::kH265FmtpProfileId, + webrtc::H265ProfileToString(profile_tier_level.profile)}, + {cricket::kH265FmtpTierFlag, + webrtc::H265TierToString(profile_tier_level.tier)}, + {cricket::kH265FmtpLevelId, + webrtc::H265LevelToString(profile_tier_level.level)}}; + return format; +#else + return std::nullopt; +#endif // BUILDFLAG(RTC_USE_H265) + } + return std::nullopt; } // namespace @@ -181,6 +232,8 @@ media::GpuVideoAcceleratorFactories* gpu_factories, const std::vector<media::VideoCodecProfile>& disabled_profiles) { SupportedFormats supported_formats; + SupportedFormats low_priority_formats; + auto profiles = gpu_factories->GetVideoEncodeAcceleratorSupportedProfiles(); if (!profiles) return supported_formats; @@ -197,7 +250,16 @@ if (format->IsCodecInList(supported_formats.sdp_formats)) { continue; } - + // Supported H.265 formats must be added to the end of supported codecs. +#if BUILDFLAG(RTC_USE_H265) + if (format->name == cricket::kH265CodecName) { + low_priority_formats.profiles.push_back(profile.profile); + low_priority_formats.scalability_modes.push_back( + profile.scalability_modes); + low_priority_formats.sdp_formats.push_back(std::move(*format)); + continue; + } +#endif // BUILDFLAG(RTC_USE_H265) supported_formats.profiles.push_back(profile.profile); supported_formats.scalability_modes.push_back(profile.scalability_modes); supported_formats.sdp_formats.push_back(std::move(*format)); @@ -222,6 +284,17 @@ } } + supported_formats.profiles.insert(supported_formats.profiles.end(), + low_priority_formats.profiles.begin(), + low_priority_formats.profiles.end()); + supported_formats.scalability_modes.insert( + supported_formats.scalability_modes.end(), + low_priority_formats.scalability_modes.begin(), + low_priority_formats.scalability_modes.end()); + supported_formats.sdp_formats.insert(supported_formats.sdp_formats.end(), + low_priority_formats.sdp_formats.begin(), + low_priority_formats.sdp_formats.end()); + DCHECK_EQ(supported_formats.profiles.size(), supported_formats.sdp_formats.size()); DCHECK_EQ(supported_formats.profiles.size(), @@ -280,7 +353,30 @@ disabled_profiles_.emplace_back(media::AV1PROFILE_PROFILE_HIGH); disabled_profiles_.emplace_back(media::AV1PROFILE_PROFILE_PRO); } -#endif +#endif // BUILDFLAG(IS_WIN) + +#if BUILDFLAG(RTC_USE_H265) + // We may not need to add check for media::kPlatformHEVCEncoderSupport here + // but it's added for consistency with other codecs like H264 and AV1. + if ( +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) + !base::FeatureList::IsEnabled(media::kPlatformHEVCEncoderSupport) || +#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) + !base::FeatureList::IsEnabled(::features::kWebRtcAllowH265Send)) { + disabled_profiles_.emplace_back(media::HEVCPROFILE_MAIN); + disabled_profiles_.emplace_back(media::HEVCPROFILE_MAIN10); + disabled_profiles_.emplace_back(media::HEVCPROFILE_MAIN_STILL_PICTURE); + disabled_profiles_.emplace_back(media::HEVCPROFILE_REXT); + disabled_profiles_.emplace_back(media::HEVCPROFILE_HIGH_THROUGHPUT); + disabled_profiles_.emplace_back(media::HEVCPROFILE_MULTIVIEW_MAIN); + disabled_profiles_.emplace_back(media::HEVCPROFILE_SCALABLE_MAIN); + disabled_profiles_.emplace_back(media::HEVCPROFILE_3D_MAIN); + disabled_profiles_.emplace_back(media::HEVCPROFILE_SCREEN_EXTENDED); + disabled_profiles_.emplace_back(media::HEVCPROFILE_SCALABLE_REXT); + disabled_profiles_.emplace_back( + media::HEVCPROFILE_HIGH_THROUGHPUT_SCREEN_EXTENDED); + } +#endif // BUILDFLAG(RTC_USE_H265) } RTCVideoEncoderFactory::~RTCVideoEncoderFactory() {
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory_test.cc b/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory_test.cc index f5fc8ee5..40e3eabf 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory_test.cc +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory_test.cc
@@ -2,18 +2,21 @@ // 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/peerconnection/rtc_video_encoder_factory.h" + #include <stdint.h> #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" +#include "media/base/media_switches.h" #include "media/base/svc_scalability_mode.h" #include "media/base/video_codecs.h" #include "media/mojo/clients/mojo_video_encoder_metrics_provider.h" #include "media/video/mock_gpu_video_accelerator_factories.h" +#include "media/webrtc/webrtc_features.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/common/features.h" #include "third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.h" -#include "third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory.h" #include "third_party/webrtc/api/video_codecs/sdp_video_format.h" #include "third_party/webrtc/api/video_codecs/video_encoder_factory.h" @@ -60,7 +63,13 @@ kScalabilityModes}, {media::VP9PROFILE_PROFILE0, kMaxResolution, kMaxFramerateNumerator, kMaxFramerateDenominator, media::VideoEncodeAccelerator::kConstantMode, - kScalabilityModes}}; + kScalabilityModes}, +#if BUILDFLAG(RTC_USE_H265) + {media::HEVCPROFILE_MAIN, kMaxResolution, kMaxFramerateNumerator, + kMaxFramerateDenominator, media::VideoEncodeAccelerator::kConstantMode, + kScalabilityModes} +#endif // BUILDFLAG(RTC_USE_H265) + }; return profiles; } @@ -75,8 +84,9 @@ public: RTCVideoEncoderFactoryTest() : encoder_factory_(&mock_gpu_factories_, - /*encoder_metrics_provider_factory=*/nullptr) { - // Ensure all the profiles in our mock GPU factory are allowed. + /*encoder_metrics_provider_factory=*/nullptr) {} + // Ensure all the profiles in our mock GPU factory are allowed. + void ClearDisabledProfilesForTesting() { encoder_factory_.clear_disabled_profiles_for_testing(); } @@ -90,6 +100,7 @@ base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitFromCommandLine("MediaFoundationH264CbpEncoding", ""); + ClearDisabledProfilesForTesting(); EXPECT_CALL(mock_gpu_factories_, IsEncoderSupportKnown()) .WillRepeatedly(Return(true)); // H.264 BP/CBP, VP8 and VP9 profile 0 are supported. @@ -139,6 +150,7 @@ } TEST_F(RTCVideoEncoderFactoryTest, QueryCodecSupportSvc) { + ClearDisabledProfilesForTesting(); EXPECT_CALL(mock_gpu_factories_, IsEncoderSupportKnown()) .WillRepeatedly(Return(true)); // Test supported modes. @@ -161,4 +173,61 @@ kUnsupported)); } +#if BUILDFLAG(RTC_USE_H265) +TEST_F(RTCVideoEncoderFactoryTest, + QueryCodecSupportForH265WithoutNeccessaryFeatures) { + base::test::ScopedFeatureList scoped_feature_list; + EXPECT_CALL(mock_gpu_factories_, IsEncoderSupportKnown()) + .WillRepeatedly(Return(true)); + + // H.256 is not supported when WebRtcAllowH265Send is not enabled. + EXPECT_TRUE(Equals(encoder_factory_.QueryCodecSupport( + webrtc::SdpVideoFormat("H265", {{"profile-id", "1"}}), + /*scalability_mode=*/std::nullopt), + kUnsupported)); + +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) + // H.265 is not supported when WebRtcAllowH265Send is enabled but + // PlatformHEVCEncoderSupport is disabled. + scoped_feature_list.InitWithFeatures({::features::kWebRtcAllowH265Send}, + {media::kPlatformHEVCEncoderSupport}); + EXPECT_TRUE(Equals(encoder_factory_.QueryCodecSupport( + webrtc::SdpVideoFormat("H265", {{"profile-id", "1"}}), + /*scalability_mode=*/std::nullopt), + kUnsupported)); +#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) +} + +TEST_F(RTCVideoEncoderFactoryTest, + QueryCodecSupportForH265WithNeccessaryFeatures) { + ClearDisabledProfilesForTesting(); + base::test::ScopedFeatureList scoped_feature_list; + std::vector<base::test::FeatureRef> enabled_features; + enabled_features.emplace_back(::features::kWebRtcAllowH265Send); + +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) + enabled_features.emplace_back(media::kPlatformHEVCEncoderSupport); +#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) + + scoped_feature_list.InitWithFeatures(enabled_features, {}); + + EXPECT_CALL(mock_gpu_factories_, IsEncoderSupportKnown()) + .WillRepeatedly(Return(true)); + + // H.265 main profile is supported when both WebRtcAllowH265Send and + // PlatformHEVCEncoderSupport are enabled. level-id, when not specified, + // implies level 93, and tier-flag defaults to main tier. + EXPECT_TRUE(Equals(encoder_factory_.QueryCodecSupport( + webrtc::SdpVideoFormat("H265", {{"profile-id", "1"}}), + /*scalability_mode=*/std::nullopt), + kSupportedPowerEfficient)); + + // Main10 profile is not supported by mock factory here. + EXPECT_TRUE(Equals(encoder_factory_.QueryCodecSupport( + webrtc::SdpVideoFormat("H265", {{"profile-id", "2"}}), + /*scalability_mode=*/std::nullopt), + kUnsupported)); +} +#endif // BUILDFLAG(RTC_USE_H265) + } // namespace blink
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 4b55f0ec..16295e5 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -522,6 +522,10 @@ public: true, }, { + name: "BufferedBytesConsumerLimitSize", + status: "stable", + }, + { name: "CacheStorageCodeCacheHint", origin_trial_feature_name: "CacheStorageCodeCacheHint", status: "experimental", @@ -899,10 +903,6 @@ status: "stable", }, { - name: "CSSOverflowMediaFeatures", - status: "stable", - }, - { name: "CSSPaintAPIArguments", status: "experimental", }, @@ -1087,10 +1087,6 @@ name: "CSSUnknownContainerQueriesNoSelection", status: "stable", }, - { - name: "CSSUpdateMediaFeature", - status: "stable", - }, // Support for `user-select:contain`. { name: "CSSUserSelectContain", @@ -1796,6 +1792,11 @@ status: "stable", }, { + // Permit trusted signals to come cross-origin, subject to CORS on the + // trusted server side and opt-in on the worklet script side. + name: "FledgePermitCrossOriginTrustedSignals", + }, + { // Enables using a 'reportingTimeout' field within the Protected Audience // ad auction config. name: "FledgeReportingTimeout", @@ -2207,9 +2208,8 @@ { // TODO(crbug.com/40113891): This feature allow scrollers to be // keyboard focusable by default. - // This should be removed in M128 (Jun 24, 2024) assuming no issues. name: "KeyboardFocusableScrollers", - status: "stable", + status: "experimental", }, { // This feature makes HTMLLabelElement::DefaultEventHandler always call
diff --git a/third_party/blink/renderer/platform/webrtc/webrtc_video_utils.cc b/third_party/blink/renderer/platform/webrtc/webrtc_video_utils.cc index ad46c5c..9996919b 100644 --- a/third_party/blink/renderer/platform/webrtc/webrtc_video_utils.cc +++ b/third_party/blink/renderer/platform/webrtc/webrtc_video_utils.cc
@@ -5,7 +5,11 @@ #include "third_party/blink/renderer/platform/webrtc/webrtc_video_utils.h" #include "base/logging.h" +#include "third_party/blink/public/common/features.h" #include "third_party/webrtc/api/video_codecs/h264_profile_level_id.h" +#if BUILDFLAG(RTC_USE_H265) +#include "third_party/webrtc/api/video_codecs/h265_profile_tier_level.h" +#endif // BUILDFLAG(RTC_USE_H265) #include "third_party/webrtc/api/video_codecs/video_codec.h" #include "third_party/webrtc/api/video_codecs/vp9_profile.h" @@ -36,6 +40,10 @@ return media::VideoCodec::kVP9; case webrtc::kVideoCodecH264: return media::VideoCodec::kH264; +#if BUILDFLAG(RTC_USE_H265) + case webrtc::kVideoCodecH265: + return media::VideoCodec::kHEVC; +#endif // BUILDFLAG(RTC_USE_H265) default: return media::VideoCodec::kUnknown; } @@ -88,6 +96,23 @@ return media::H264PROFILE_BASELINE; } } +#if BUILDFLAG(RTC_USE_H265) + case webrtc::kVideoCodecH265: { + const std::optional<webrtc::H265ProfileTierLevel> h265_ptl = + webrtc::ParseSdpForH265ProfileTierLevel(format.parameters); + if (!h265_ptl) { + return media::VIDEO_CODEC_PROFILE_UNKNOWN; + } + switch (h265_ptl->profile) { + case webrtc::H265Profile::kProfileMain: + return media::HEVCPROFILE_MAIN; + case webrtc::H265Profile::kProfileMain10: + return media::HEVCPROFILE_MAIN10; + default: + return media::VIDEO_CODEC_PROFILE_UNKNOWN; + } + } +#endif default: return media::VIDEO_CODEC_PROFILE_UNKNOWN; }
diff --git a/third_party/blink/tools/blinkpy/common/net/git_cl.py b/third_party/blink/tools/blinkpy/common/net/git_cl.py index 95f1105..a1c730e 100644 --- a/third_party/blink/tools/blinkpy/common/net/git_cl.py +++ b/third_party/blink/tools/blinkpy/common/net/git_cl.py
@@ -19,10 +19,6 @@ _log = logging.getLogger(__name__) -# A refresh token may be needed for some commands, such as git cl try, -# in order to authenticate with buildbucket. -_COMMANDS_THAT_TAKE_REFRESH_TOKEN = ('try', ) - class BuildStatus(enum.Flag): """Buildbucket statuses [0]. The names should match where applicable. @@ -69,14 +65,10 @@ class GitCL: - def __init__(self, - host, - auth_refresh_token_json=None, - cwd=None, - bb_client=None): + + def __init__(self, host, cwd=None, bb_client=None): self._host = host self.bb_client = bb_client or BuildbucketClient.from_host(host) - self._auth_refresh_token_json = auth_refresh_token_json self._cwd = cwd self._git_executable_name = Git.find_executable_name( host.executive, host.platform) @@ -91,11 +83,6 @@ A string (the output from git-cl). """ command = [self._git_executable_name, 'cl'] + args - if (self._auth_refresh_token_json - and args[0] in _COMMANDS_THAT_TAKE_REFRESH_TOKEN): - command += [ - '--auth-refresh-token-json', self._auth_refresh_token_json - ] # Suppress the stderr of git-cl because git-cl will show a warning when # running on Swarming bots with local git cache. return self._host.executive.run_command(
diff --git a/third_party/blink/tools/blinkpy/common/net/git_cl_unittest.py b/third_party/blink/tools/blinkpy/common/net/git_cl_unittest.py index 6d6cc1e..cce8c554 100644 --- a/third_party/blink/tools/blinkpy/common/net/git_cl_unittest.py +++ b/third_party/blink/tools/blinkpy/common/net/git_cl_unittest.py
@@ -27,17 +27,20 @@ def test_run_with_auth(self): host = MockHost() host.executive = MockExecutive(output='mock-output') - git_cl = GitCL(host, auth_refresh_token_json='token.json') + git_cl = GitCL(host) git_cl.run(['try', '-b', 'win10_blink_rel']) self.assertEqual(host.executive.calls, [[ - 'git', 'cl', 'try', '-b', 'win10_blink_rel', - '--auth-refresh-token-json', 'token.json' + 'git', + 'cl', + 'try', + '-b', + 'win10_blink_rel', ]]) def test_some_commands_not_run_with_auth(self): host = MockHost() host.executive = MockExecutive(output='mock-output') - git_cl = GitCL(host, auth_refresh_token_json='token.json') + git_cl = GitCL(host) git_cl.run(['issue']) self.assertEqual(host.executive.calls, [['git', 'cl', 'issue']]) @@ -45,47 +48,70 @@ # When no bucket is specified, luci.chromium.try is used by # default. Besides, `git cl try` invocations are grouped by buckets. host = MockHost() - git_cl = GitCL(host, auth_refresh_token_json='token.json') + git_cl = GitCL(host) git_cl.trigger_try_jobs([ 'android_blink_rel', 'fake_blink_try_linux', 'fake_blink_try_win' ]) self.assertEqual(host.executive.calls, [ [ - 'git', 'cl', 'try', '-B', 'luci.chromium.try', '-b', - 'fake_blink_try_linux', '-b', 'fake_blink_try_win', - '--auth-refresh-token-json', 'token.json' + 'git', + 'cl', + 'try', + '-B', + 'luci.chromium.try', + '-b', + 'fake_blink_try_linux', + '-b', + 'fake_blink_try_win', ], [ - 'git', 'cl', 'try', '-B', 'luci.chromium.android', '-b', - 'android_blink_rel', '--auth-refresh-token-json', 'token.json' + 'git', + 'cl', + 'try', + '-B', + 'luci.chromium.android', + '-b', + 'android_blink_rel', ], ]) def test_trigger_try_jobs_with_frozenset(self): # The trigger_try_jobs method may be called with an immutable set. host = MockHost() - git_cl = GitCL(host, auth_refresh_token_json='token.json') + git_cl = GitCL(host) git_cl.trigger_try_jobs( frozenset(['fake_blink_try_linux', 'fake_blink_try_win'])) self.assertEqual(host.executive.calls, [ [ - 'git', 'cl', 'try', '-B', 'luci.chromium.try', '-b', - 'fake_blink_try_linux', '-b', 'fake_blink_try_win', - '--auth-refresh-token-json', 'token.json' + 'git', + 'cl', + 'try', + '-B', + 'luci.chromium.try', + '-b', + 'fake_blink_try_linux', + '-b', + 'fake_blink_try_win', ], ]) def test_trigger_try_jobs_with_explicit_bucket(self): # An explicit bucket overrides configured or default buckets. host = MockHost() - git_cl = GitCL(host, auth_refresh_token_json='token.json') + git_cl = GitCL(host) git_cl.trigger_try_jobs(['fake_blink_try_linux', 'android_blink_rel'], bucket='luci.dummy') self.assertEqual(host.executive.calls, [ [ - 'git', 'cl', 'try', '-B', 'luci.dummy', '-b', - 'android_blink_rel', '-b', 'fake_blink_try_linux', - '--auth-refresh-token-json', 'token.json' + 'git', + 'cl', + 'try', + '-B', + 'luci.dummy', + '-b', + 'android_blink_rel', + '-b', + 'fake_blink_try_linux', ], ])
diff --git a/third_party/blink/tools/blinkpy/w3c/test_importer.py b/third_party/blink/tools/blinkpy/w3c/test_importer.py index b7dbaf3..3c40cb04 100644 --- a/third_party/blink/tools/blinkpy/w3c/test_importer.py +++ b/third_party/blink/tools/blinkpy/w3c/test_importer.py
@@ -130,8 +130,7 @@ '#GitHub-credentials for instructions on how to set ' 'your credentials up.') self.github = self.github or WPTGitHub(self.host, gh_user, gh_token) - self.git_cl = GitCL( - self.host, auth_refresh_token_json=options.auth_refresh_token_json) + self.git_cl = GitCL(self.host) _log.debug('Noting the current Chromium revision.') chromium_revision = self.project_git.latest_git_commit() @@ -378,10 +377,6 @@ action='store_true', help='file new failures automatically to crbug.com') parser.add_argument( - '--auth-refresh-token-json', - help='authentication refresh token JSON file used for try jobs, ' - 'generally not necessary on developer machines') - parser.add_argument( '--credentials-json', help='A JSON file with GitHub credentials, ' 'generally not necessary on developer machines')
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 368afd68..64e369b 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -7201,7 +7201,6 @@ # RubyLineBreakable crbug.com/324111880 virtual/ruby-lb/external/wpt/css/css-contain/contain-layout-005.html [ Crash Failure ] -crbug.com/324111880 virtual/ruby-lb/external/wpt/css/css-contain/contain-paint-008.html [ Failure ] crbug.com/324111880 virtual/ruby-lb/external/wpt/css/css-contain/contain-paint-ignored-cases-ruby-containing-block-001.html [ Crash ] crbug.com/324111880 virtual/ruby-lb/fast/ruby/float-overhang-from-ruby-text.html [ Failure ] # RubyLineBreakable; Passing in the virtual suite though failing in non-virtual
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 2de3bd9..5cfb8f8 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -2467,6 +2467,25 @@ ] }, { + "prefix": "lcpp-defer-unused-preloads", + "platforms": [ + "Linux", + "Mac", + "Win" + ], + "bases": [ + "http/tests/lcpp_unused_preloads" + ], + "exclusive_tests": "ALL", + "args": [ + "--enable-features=LCPPDeferUnusedPreload:load_timing/lcp_timing_predictor" + ], + "expires": "Oct 16, 2024", + "owners": [ + "sisidovski@chromium.org" + ] + }, + { "prefix": "lcp-script-observer", "platforms": [ "Linux",
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index d48e8d0..db2ae42 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -8214,14 +8214,7 @@ {} ] ] - }, - "detached-context-crash.html": [ - "56271f12c3ae76bfd0d11e3abc8d09f15167c906", - [ - null, - {} - ] - ] + } }, "readable-streams": { "crashtests": { @@ -71325,6 +71318,19 @@ {} ] ], + "position-visibility-anchors-visible-stacked-child.tentative.html": [ + "7c0d5dc6aadd36fc9a894dbf0add608f5c0e31c4", + [ + null, + [ + [ + "/css/css-anchor-position/position-visibility-anchors-visible-ref.html", + "==" + ] + ], + {} + ] + ], "position-visibility-anchors-visible-with-position.html": [ "43dd2cc782120763ee553c52b2f18a18308a1b7e", [ @@ -93279,6 +93285,19 @@ {} ] ], + "scope-pseudo-element.html": [ + "29c446906092dc4bccec7fb4b21fb8b4a20b8f8f", + [ + null, + [ + [ + "/css/css-cascade/scope-pseudo-element-ref.html", + "==" + ] + ], + {} + ] + ], "scope-visited.html": [ "392aeb667b201072ff1a70aec745f75019cff54b", [ @@ -147345,6 +147364,19 @@ ], {} ] + ], + "two-clip-path-animation-diff-length4.html": [ + "0a893cb75637e4d1b63e85cca77deff844c37c11", + [ + null, + [ + [ + "/css/css-masking/clip-path/animations/two-clip-path-animation-diff-length1-ref.html", + "==" + ] + ], + {} + ] ] }, "clip-path-blending-offset.html": [ @@ -167032,6 +167064,64 @@ {} ] ], + "highlight-painting-shadows-horizontal.html": [ + "b1762e85ae31fc6dc640fd038ec0edf7ee7d4e25", + [ + null, + [ + [ + "/css/css-pseudo/highlight-painting-shadows-horizontal-ref.html", + "==" + ] + ], + { + "fuzzy": [ + [ + null, + [ + [ + 0, + 32 + ], + [ + 0, + 20 + ] + ] + ] + ] + } + ] + ], + "highlight-painting-shadows-vertical.html": [ + "7187c34da4495fbaded9b9986e5a26889fde6beb", + [ + null, + [ + [ + "/css/css-pseudo/highlight-painting-shadows-vertical-ref.html", + "==" + ] + ], + { + "fuzzy": [ + [ + null, + [ + [ + 0, + 32 + ], + [ + 0, + 4 + ] + ] + ] + ] + } + ] + ], "highlight-painting-soft-hyphens-001.html": [ "17b5f6a37c4c2489959f41bed4ca53c352a20a4d", [ @@ -168551,6 +168641,32 @@ {} ] ], + "target-text-shadow-horizontal.html": [ + "1ded1360ff047d2432f59fc0a6549a8759af0d24", + [ + null, + [ + [ + "/css/css-pseudo/target-text-shadow-horizontal-ref.html", + "==" + ] + ], + {} + ] + ], + "target-text-shadow-vertical.html": [ + "088f6fc175e7a581b74709c7214e22401098cd52", + [ + null, + [ + [ + "/css/css-pseudo/target-text-shadow-vertical-ref.html", + "==" + ] + ], + {} + ] + ], "target-text-text-decoration-001.html": [ "d90d5d96630d05ab88430b88fe4a4ad8985a6fac", [ @@ -289193,16 +289309,16 @@ "be955258530b6634f6233f8c5b6670f6c83f54e5", [] ], + "comp_embedded_control-expected.txt": [ + "495de6dde7f9abab9348af261de51a152ceb1192", + [] + ], "comp_label-expected.txt": [ "c1aa470742a095637b00998bd7b93e596ad88216", [] ], "comp_name_from_content-expected.txt": [ - "acea09db2a5dece42a185ef08678e282b7699e05", - [] - ], - "comp_text_node-expected.txt": [ - "a44aae4aafbecf0525c32cf457f18fc53f4bd085", + "cc544f8b5f91b849d0eda477bfca4642e24346dd", [] ] } @@ -294879,7 +294995,7 @@ [] ], "accounts_check_same_site_strict.py": [ - "a6f385feac1ccf0885b44c43a0d0e737e4c308f6", + "796ac003cbc0bb34773b50c1c5de4351aae8dddd", [] ], "accounts_no_approved_clients.py": [ @@ -295039,7 +295155,7 @@ [] ], "token_check_same_site_strict.py": [ - "8a4b3a234bdb99f38354f706d740b823ccc6e785", + "4e55bf27f610032b30eb3278ddd0f7db4716efef", [] ], "token_with_account_id.py": [ @@ -295136,7 +295252,7 @@ [] ], "set_cookie.headers": [ - "ddeb0bb3d6d81088f63178a2d8ffb7de001b736b", + "df223115a7fa546e682275e8bb9d9af624ea333a", [] ] } @@ -305629,6 +305745,10 @@ "661016619c0c46c113dedc57aa890f62b35e137c", [] ], + "scope-pseudo-element-ref.html": [ + "2ad6a0995a9e3bb9db0131eb2c42b19d09768fb4", + [] + ], "scope-visited-ref.html": [ "91efd659216ab1de4efdfe2cac961bc6200ae62b", [] @@ -306295,6 +306415,10 @@ }, "rendering": { "dark-color-scheme": { + "WEB_FEATURES.yml": [ + "48bbe25901e085455ca7569c4bfbc0147fd40455", + [] + ], "color-scheme-change-checkbox-notref.html": [ "921482afcdf10cc38d113d0d428e1df43d09dd66", [] @@ -308769,7 +308893,7 @@ ], "accessibility": { "display-contents-role-and-label-expected.txt": [ - "2289286d4b23541fea0668fb36290faa643f80ef", + "92c5dc5fdd03da8fd9859a54adb35bed6b3d11c0", [] ] }, @@ -327205,6 +327329,14 @@ "39d26e8387204840d89318ef917d5df0c4021df4", [] ], + "highlight-painting-shadows-horizontal-ref.html": [ + "4ff90afb388154da1b2f2ef62642f0480fa0e446", + [] + ], + "highlight-painting-shadows-vertical-ref.html": [ + "00a6f1c80885d61fdada7ea17f8376b63ec14090", + [] + ], "highlight-painting-soft-hyphens-001-ref.html": [ "f1485ca9226683ac303facb5dadbd38b475c042e", [] @@ -327685,6 +327817,14 @@ "bd94d694359b4bac1e226d3520af3090c30c7ebe", [] ], + "target-text-shadow-horizontal-ref.html": [ + "6189f844b5ecb06ffd1fae67aeec4a28a5d7cf9c", + [] + ], + "target-text-shadow-vertical-ref.html": [ + "cd9e17905371bad10e38afcf45b6153992018fb3", + [] + ], "target-text-text-decoration-001-ref.html": [ "0ee37b1e8aadfed3945bfecc6dbe77e783def5a1", [] @@ -344521,6 +344661,10 @@ "f277097263e7acf6f2e7b40fa810231c61b00e63", [] ], + "WEB_FEATURES.yml": [ + "88f1510e1b4670cce079a4b48a62cd723693f095", + [] + ], "dynamic-range-expected.txt": [ "a58cb78b4c4a2136640805d9a0e98686a6d060ee", [] @@ -345002,7 +345146,7 @@ [] ], "WEB_FEATURES.yml": [ - "4b29277607ff59f605698b5ab133669a6c7e5879", + "2449bf4808f60c035717f1773c72ddd52df1c087", [] ], "attribute-selectors": { @@ -347457,7 +347601,7 @@ [] ], "xml2html.xsl": [ - "07b967500ff66c232aaefae1b240940bffbed969", + "88b74a9620f8093dcd5ff2afa4d1604793f049d9", [] ] }, @@ -360181,6 +360325,10 @@ "af9c736aea7f9b20f4fd09522a8aa2dd25a11ef1", [] ], + "WEB_FEATURES.yml": [ + "1d9e4bab82191d72c374c7399e666bd6bfe42bc2", + [] + ], "reference": { "direction-default-ref.html": [ "cef6df259c4801e93e7ce8dd1692e6f3157d77bc", @@ -360707,6 +360855,10 @@ "af9c736aea7f9b20f4fd09522a8aa2dd25a11ef1", [] ], + "WEB_FEATURES.yml": [ + "1d9e4bab82191d72c374c7399e666bd6bfe42bc2", + [] + ], "canvas.2d.fontStretch-ref.html": [ "00ecdccad3743db0d0a1ec99850f80ea7964d512", [] @@ -371864,7 +372016,7 @@ }, "pseudo-classes": { "WEB_FEATURES.yml": [ - "604e049f202c94d9bd55edefd7b09f57cd9fedf6", + "055a5fb4a302b72585d2ca80a849bd653a4d0666", [] ], "checked-indeterminate.window-expected.txt": [ @@ -374649,6 +374801,12 @@ [] ] }, + "inert": { + "WEB_FEATURES.yml": [ + "074e33726c62121956e2d63027342c711147a1c4", + [] + ] + }, "infrastructure": { "DIR_METADATA": [ "b19504342dfe64050a6372808f15f3e792a79218", @@ -376927,6 +377085,14 @@ [] ], "tentative": { + "loaf-stream-expected.txt": [ + "9b0d0e1d77a0daff1ebe5f7acfb3a318ab4443e6", + [] + ], + "loaf-stream-source-location-expected.txt": [ + "a9df771bdf4c0233aebff06c1f1b6520fd26d3d3", + [] + ], "resources": { "busy.js": [ "9d761b6de5ee65c9067a4c576c90eb9e7dd6ef05", @@ -376957,7 +377123,7 @@ [] ], "utils.js": [ - "a3f3da0433305e4e9f77926548247fadf55a4120", + "aa537d39a780d9d402aebc49c43c2ed733ef343b", [] ] } @@ -388694,7 +388860,11 @@ [] ], "simple-module.js": [ - "620a3592f27fc89eb5df88bc05a6e1df1d854975", + "11b650811dcc9cea02d541a72314ea84a335f3fb", + [] + ], + "simple-module.js.headers": [ + "cf3e03e24c7d68e3fb9f0be9102591c659a2b43c", [] ], "util.js": [ @@ -417070,7 +417240,7 @@ ] ], "comp_name_from_content.html": [ - "3504658ea46156ab7cac72fd7d2b92089c9ddc63", + "2f6b3ab6b474778ff4b296dafd40be90132be6a9", [ null, { @@ -417079,7 +417249,7 @@ ] ], "comp_text_node.html": [ - "a31f9e02451f72b9bb697f4820e637d56e464e4e", + "f9cb8f1baf837e10b55ca16275e48e47c8b69406", [ null, { @@ -438643,7 +438813,7 @@ ], "fedcm-same-site-none": { "fedcm-same-site-none.https.html": [ - "77ecdaff9fe36e3bb4606798e9f69b4708cd2856", + "d3d20ea9df270cc23c48f7f709c9cc21bab7990e", [ null, { @@ -447173,7 +447343,7 @@ "css-display": { "accessibility": { "display-contents-role-and-label.html": [ - "2c9d8581d240ca5614ac12a10aaa43a92ee7a7f6", + "6b5453e9f64f049e34a7371b9ebab80fdbd6e7d4", [ null, { @@ -471991,7 +472161,7 @@ "calc-size": { "animation": { "calc-size-height-interpolation.tentative.html": [ - "06277376e9f266ca5b43890cafcda1c6c6b425fe", + "6d15c3f22654f7836934c830b46475ac1f07bd2e", [ null, { @@ -480172,6 +480342,42 @@ ] }, "device-posture": { + "device-posture-change-event.https.html": [ + "eb2fc2d96f81eddceb14810d79d793dd44ddff7d", + [ + null, + { + "testdriver": true + } + ] + ], + "device-posture-clear.https.html": [ + "319cd7266af066a9e7762b44e92ba695ef06410c", + [ + null, + { + "testdriver": true + } + ] + ], + "device-posture-event-listener.https.html": [ + "f4e21c89ccd8876cb102539f88d706353cfe50f3", + [ + null, + { + "testdriver": true + } + ] + ], + "device-posture-media-queries.https.html": [ + "e4dbd2e7d81d3c3fc088283adc6b884ed4109018", + [ + null, + { + "testdriver": true + } + ] + ], "idlharness.https.window.js": [ "74ebd11af97835a9973186ff9a61131550bf54c3", [ @@ -484002,6 +484208,62 @@ null, {} ] + ], + "continue-css-animation-left.html": [ + "8c7f73e3c933ce6f6a9749281707c62e0a090d7d", + [ + null, + {} + ] + ], + "continue-css-animation-transform.html": [ + "e7a285893aa0e4a538ec29af944f1d0761d93f0a", + [ + null, + {} + ] + ], + "continue-css-transition-left-pseudo.html": [ + "fa51b168879f4ef12f7521a9a4e1a1492d340815", + [ + null, + {} + ] + ], + "continue-css-transition-left.html": [ + "2b8e04b26e469b38bb8d7c3750be9b54025f3060", + [ + null, + {} + ] + ], + "continue-css-transition-transform-pseudo.html": [ + "d02c72561c1101ce9474cc60b9295e46c9e499df", + [ + null, + {} + ] + ], + "continue-css-transition-transform.html": [ + "f09edca144978948e490eeccbc5a0cb915c8ab58", + [ + null, + {} + ] + ], + "css-animation-commit-styles.html": [ + "86bb7c33e4261ec04740824775249fdd7cbdc9b2", + [ + null, + {} + ] + ], + "css-transition-trigger.html": [ + "0cb5608a695e000dc54b9fa2f73c49fc16ebcd98", + [ + null, + {} + ] ] } }, @@ -596693,33 +596955,6 @@ } ] ], - "loaf-source-location-inline-classic-script.html": [ - "30033c9a4d88e2ce7cca65aefb3fb5e2dab78e67", - [ - null, - { - "timeout": "long" - } - ] - ], - "loaf-source-location-inline-event-listener.html": [ - "bd7e8bb7c08a70ba412b44312898ccd3e2213b6b", - [ - null, - { - "timeout": "long" - } - ] - ], - "loaf-source-location-inline-module-script.html": [ - "f40b3e410f4da2239058a6d83681dfde060f9b7c", - [ - null, - { - "timeout": "long" - } - ] - ], "loaf-source-location-redirect.html": [ "c0bb96b1ec5bd982c0266d2c0da26060e2ccc2e5", [ @@ -596739,7 +596974,7 @@ ] ], "loaf-stream-source-location.html": [ - "5776ff5255243609132aa046e1ede5a3f8de1720", + "0fd30859d738dec410b9b8d20c0c9ba8c2f61294", [ null, { @@ -596748,7 +596983,7 @@ ] ], "loaf-stream.html": [ - "424f2cd0d1e629ab89df5c29a206b49b2d2fff51", + "e35bc2f9aa7d7de7a6ac224b9befde30d128e85c", [ null, { @@ -635666,6 +635901,13 @@ {} ] ], + "cross-origin-worklet-select-url-and-verify-data-origin.tentative.https.sub.html": [ + "5b6b9d5f8f5b5e04f89a651eb88e344dae8e957b", + [ + null, + {} + ] + ], "embedder-context.tentative.https.sub.html": [ "44f45a7643111f169be1a1b8935720325103099e", [
diff --git a/third_party/blink/web_tests/external/wpt/accname/name/comp_name_from_content-expected.txt b/third_party/blink/web_tests/external/wpt/accname/name/comp_name_from_content-expected.txt index acea09db2..cc544f8 100644 --- a/third_party/blink/web_tests/external/wpt/accname/name/comp_name_from_content-expected.txt +++ b/third_party/blink/web_tests/external/wpt/accname/name/comp_name_from_content-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 6 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 5 FAIL, 0 TIMEOUT, 0 NOTRUN. [FAIL] button name from fallback content mixing attr() and strings with ::before and ::after assert_equals: <button data-alt-text-before="alt-before" data-alt-text-after="alt-after" data-expectedlabel="start alt-before end label start alt-after end" data-testname="button name from fallback content mixing attr() and strings with ::before and ::after" class="ex fallback-before-mixed fallback-after-mixed">label</button> expected "start alt-before end label start alt-after end" but got "before label after" [FAIL] heading name from fallback content mixing attr() and strings with ::before and ::after @@ -8,8 +8,6 @@ assert_equals: <a href="#" data-alt-text-before="alt-before" data-alt-text-after="alt-after" data-expectedlabel="start alt-before end label start alt-after end" data-testname="link name from fallback content mixing attr() and strings with ::before and ::after" class="ex fallback-before-mixed fallback-after-mixed">label</a> expected "start alt-before end label start alt-after end" but got "before label after" [FAIL] heading name from content for each child including two nested links using aria-labelledby with nested image assert_equals: <h3 data-expectedlabel="image link2 link3" data-testname="heading name from content for each child including two nested links using aria-labelledby with nested image" class="ex">\n <a href="#" aria-labelledby="nested_image_label2">\n link1<!-- this text is skipped because of aria-labelledby -->\n </a>\n <a href="#" data-expectedlabel="link2 image link3" data-testname="link name from content for each child including nested image (referenced elsewhere via labelledby)" class="ex">\n link2\n <img id="nested_image_label2" alt="image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==">\n <!-- image skipped in this link (when computing heading text) because it was already referenced by the first link within this heading label recursion cycle. -->\n <!-- but image not skipped when computing the text of the link itself since it has not been referenced in that context -->\n link3\n </a>\n</h3> expected "image link2 link3" but got "image link2 image link3" -[FAIL] heading with link referencing image using aria-labelledby, that in turn references text element via aria-labelledby - assert_equals: <h3 data-expectedlabel="image link" data-testname="heading with link referencing image using aria-labelledby, that in turn references text element via aria-labelledby" class="ex">\n <a href="#" aria-labelledby="nested_image_label3">\n <span class="note" id="crossref_link">link</span><!-- this text is skipped the first time around because of aria-labelledby on parent element -->\n </a>\n <!-- but it's picked up again in inverse order b/c of cross-referencial aria-labelledby edge case -->\n <img id="nested_image_label_3" alt="image" aria-labelledby="crossref_link" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==">\n</h3> expected "image link" but got "link link" [FAIL] heading with link referencing image using aria-labelledby, that in turn references itself and another element via aria-labelledby assert_equals: <h3 data-expectedlabel="image link" data-testname="heading with link referencing image using aria-labelledby, that in turn references itself and another element via aria-labelledby" class="ex">\n <a href="#" aria-labelledby="nested_image_label4">\n <span class="note" id="crossref_link2">link</span><!-- this text is skipped the first time around because of aria-labelledby on parent element -->\n </a>\n <!-- but it's picked up again (after the self-referencial image alt) in inverse order b/c of cross-referencial aria-labelledby edge case -->\n <img id="nested_image_label4" alt="image" aria-labelledby="nested_image_label4 crossref_link2" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==">\n</h3> expected "image link" but got "image image link" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/accname/name/comp_name_from_content.html b/third_party/blink/web_tests/external/wpt/accname/name/comp_name_from_content.html index 3504658..2f6b3ab6 100644 --- a/third_party/blink/web_tests/external/wpt/accname/name/comp_name_from_content.html +++ b/third_party/blink/web_tests/external/wpt/accname/name/comp_name_from_content.html
@@ -239,7 +239,7 @@ <span class="note" id="crossref_link">link</span><!-- this text is skipped the first time around because of aria-labelledby on parent element --> </a> <!-- but it's picked up again in inverse order b/c of cross-referencial aria-labelledby edge case --> - <img id="nested_image_label_3" alt="image" aria-labelledby="crossref_link" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="> + <img id="nested_image_label3" alt="image" aria-labelledby="crossref_link" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="> </h3> <!-- self-referencial edge case-->
diff --git a/third_party/blink/web_tests/external/wpt/accname/name/comp_text_node-expected.txt b/third_party/blink/web_tests/external/wpt/accname/name/comp_text_node-expected.txt deleted file mode 100644 index a44aae4..0000000 --- a/third_party/blink/web_tests/external/wpt/accname/name/comp_text_node-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -This is a testharness.js-based test. -Found 5 FAIL, 0 TIMEOUT, 0 NOTRUN. -[FAIL] span[role=button] with text node, with leading/trailing non-breaking space - assert_equals: <span role="button" tabindex="0" class="ex" data-expectedlabel="button label" data-testname="span[role=button] with text node, with leading/trailing non-breaking space"> button label </span> expected "button label" but got " button label " -[FAIL] div[role=heading] with text node, with leading/trailing non-breaking space - assert_equals: <div role="heading" class="ex" data-expectedlabel="heading label" data-testname="div[role=heading] with text node, with leading/trailing non-breaking space"> heading label </div> expected "heading label" but got " heading label " -[FAIL] button with text node, with leading/trailing non-breaking space - assert_equals: <button class="ex" data-expectedlabel="button label" data-testname="button with text node, with leading/trailing non-breaking space"> button label </button> expected "button label" but got " button label " -[FAIL] heading with text node, with leading/trailing non-breaking space - assert_equals: <h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with leading/trailing non-breaking space"> heading label </h3> expected "heading label" but got " heading label " -[FAIL] link with text node, with leading/trailing non-breaking space - assert_equals: <a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with leading/trailing non-breaking space"> link label </a> expected "link label" but got " link label " -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/accname/name/comp_text_node.html b/third_party/blink/web_tests/external/wpt/accname/name/comp_text_node.html index a31f9e0..f9cb8f1 100644 --- a/third_party/blink/web_tests/external/wpt/accname/name/comp_text_node.html +++ b/third_party/blink/web_tests/external/wpt/accname/name/comp_text_node.html
@@ -101,11 +101,11 @@ <br> <h1>text node, with leading/trailing non-breaking space</h1> -<span role="button" tabindex="0" class="ex" data-expectedlabel="button label" data-testname="span[role=button] with text node, with leading/trailing non-breaking space"> button label </span> -<div role="heading" class="ex" data-expectedlabel="heading label" data-testname="div[role=heading] with text node, with leading/trailing non-breaking space"> heading label </div> -<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with leading/trailing non-breaking space"> button label </button> -<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with leading/trailing non-breaking space"> heading label </h3> -<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with leading/trailing non-breaking space"> link label </a> +<span role="button" tabindex="0" class="ex" data-expectedlabel=" button label " data-testname="span[role=button] with text node, with leading/trailing non-breaking space"> button label </span> +<div role="heading" class="ex" data-expectedlabel=" heading label " data-testname="div[role=heading] with text node, with leading/trailing non-breaking space"> heading label </div> +<button class="ex" data-expectedlabel=" button label " data-testname="button with text node, with leading/trailing non-breaking space"> button label </button> +<h3 class="ex" data-expectedlabel=" heading label " data-testname="heading with text node, with leading/trailing non-breaking space"> heading label </h3> +<a href="#" class="ex" data-expectedlabel=" link label " data-testname="link with text node, with leading/trailing non-breaking space"> link label </a> <br> <h1>text node, with mixed space and non-breaking space</h1>
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/fedcm-same-site-none/fedcm-same-site-none.https.html b/third_party/blink/web_tests/external/wpt/credential-management/fedcm-same-site-none/fedcm-same-site-none.https.html index 77ecdaff..d3d20ea 100644 --- a/third_party/blink/web_tests/external/wpt/credential-management/fedcm-same-site-none/fedcm-same-site-none.https.html +++ b/third_party/blink/web_tests/external/wpt/credential-management/fedcm-same-site-none/fedcm-same-site-none.https.html
@@ -20,6 +20,6 @@ const cred = await fedcm_get_and_select_first_account(t, options); assert_equals(cred.token, "token"); assert_equals(cred.isAutoSelected, false); -}, "FedCM requests should be considered cross-origin and therefore not send SameSite=Strict cookies."); +}, "FedCM requests should be considered cross-origin and therefore not send SameSite=Strict or Lax cookies."); </script>
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/accounts_check_same_site_strict.py b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/accounts_check_same_site_strict.py index a6f385f..796ac00 100644 --- a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/accounts_check_same_site_strict.py +++ b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/accounts_check_same_site_strict.py
@@ -7,6 +7,8 @@ return request_error if request.cookies.get(b"same_site_strict") == b"1": return (546, [], "Should not send SameSite=Strict cookies") + if request.cookies.get(b"same_site_lax") == b"1": + return (547, [], "Should not send SameSite=Lax cookies") if request.headers.get(b"Sec-Fetch-Site") != b"cross-site": return (538, [], "Wrong Sec-Fetch-Site header")
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/token_check_same_site_strict.py b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/token_check_same_site_strict.py index 8a4b3a23..4e55bf2 100644 --- a/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/token_check_same_site_strict.py +++ b/third_party/blink/web_tests/external/wpt/credential-management/support/fedcm/token_check_same_site_strict.py
@@ -7,6 +7,8 @@ return request_error if request.cookies.get(b"same_site_strict") == b"1": return (546, [], "Should not send SameSite=Strict cookies") + if request.cookies.get(b"same_site_lax") == b"1": + return (547, [], "Should not send SameSite=Lax cookies") response.headers.set(b"Content-Type", b"application/json") response.headers.set(b"Access-Control-Allow-Origin", request.headers.get(b"Origin"))
diff --git a/third_party/blink/web_tests/external/wpt/credential-management/support/set_cookie.headers b/third_party/blink/web_tests/external/wpt/credential-management/support/set_cookie.headers index ddeb0bb..df223115a 100644 --- a/third_party/blink/web_tests/external/wpt/credential-management/support/set_cookie.headers +++ b/third_party/blink/web_tests/external/wpt/credential-management/support/set_cookie.headers
@@ -1,3 +1,4 @@ Content-Type: text/html Set-Cookie: cookie=1; SameSite=None; Secure; Path=/ Set-Cookie: same_site_strict=1; SameSite=Strict; Secure; Path=/ +Set-Cookie: same_site_lax=1; SameSite=Lax; Secure; Path=/
diff --git a/third_party/blink/web_tests/external/wpt/css/css-anchor-position/position-visibility-anchors-visible-stacked-child.tentative.html b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/position-visibility-anchors-visible-stacked-child.tentative.html new file mode 100644 index 0000000..7c0d5dc --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/position-visibility-anchors-visible-stacked-child.tentative.html
@@ -0,0 +1,60 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<meta name="assert" content="Position-visibility: anchors-visible should hide an element and stacked children with an out-of-view anchor." /> +<title>CSS Anchor Positioning Test: position-visibility: anchors-visible</title> +<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/7758"> +<link rel="match" href="position-visibility-anchors-visible-ref.html"> +<style> + #scroll-container { + overflow: hidden scroll; + width: 300px; + height: 100px; + } + + #anchor { + anchor-name: --a1; + width: 100px; + height: 100px; + background: orange; + } + + #spacer { + height: 100px; + } + + #target { + position-anchor: --a1; + position-visibility: anchors-visible; + inset-area: bottom right; + width: 100px; + height: 100px; + background: red; + position: absolute; + top: 0; + left: 0; + } + #stacking-child { + /* stacking context */ + z-index: 1; + width: 100px; + height: 100px; + background: maroon; + position: absolute; + top: 25px; + left: 25px; + } +</style> + +<div id="scroll-container"> + <div id="anchor">anchor</div> + <div id="spacer"></div> + <div id="target">target + <div id="stacking-child"></div> + </div> +</div> + +<script> + const scroller = document.getElementById('scroll-container'); + scroller.scrollTop = 100; + // #target should not be visible because #anchor is scrolled out of view. +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/WEB_FEATURES.yml b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/WEB_FEATURES.yml new file mode 100644 index 0000000..48bbe25 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/WEB_FEATURES.yml
@@ -0,0 +1,3 @@ +features: +- name: color-scheme + files: "**"
diff --git a/third_party/blink/web_tests/external/wpt/css/css-display/accessibility/display-contents-role-and-label-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-display/accessibility/display-contents-role-and-label-expected.txt index 2289286d..92c5dc5 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-display/accessibility/display-contents-role-and-label-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/css-display/accessibility/display-contents-role-and-label-expected.txt
@@ -1,19 +1,19 @@ This is a testharness.js-based test. -Found 18 FAIL, 0 TIMEOUT, 0 NOTRUN. -[FAIL] Label: listitem within ul with display: contents, as child of div with display: grid, has listitem role - assert_equals: <li data-expectedrole="listitem" data-expectedlabel="x" data-testname="listitem within ul with display: contents, as child of div with display: grid, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">x</li> expected "x" but got "" -[FAIL] Label: li as child of ul with role list, both with display: contents, has listitem role - assert_equals: <li style="display: contents;" data-expectedrole="listitem" data-expectedlabel="x" data-testname="li as child of ul with role list, both with display: contents, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">x</li> expected "x" but got "" -[FAIL] Label: li, as child of ul with role list and display: contents, has listitem role - assert_equals: <li data-expectedrole="listitem" data-expectedlabel="y" data-testname="li, as child of ul with role list and display: contents, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">y</li> expected "y" but got "" -[FAIL] Label: li with display: contents, as child of ul with role list, has listitem role - assert_equals: <li style="display: contents;" data-expectedrole="listitem" data-expectedlabel="y" data-testname="li with display: contents, as child of ul with role list, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">y</li> expected "y" but got "" -[FAIL] Label: li as child of ol with role list, both with display: contents, has listitem role - assert_equals: <li style="display: contents;" data-expectedrole="listitem" data-expectedlabel="x" data-testname="li as child of ol with role list, both with display: contents, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">x</li> expected "x" but got "" -[FAIL] Label: li, as child of ol with role list and display: contents, has listitem role - assert_equals: <li data-expectedrole="listitem" data-expectedlabel="y" data-testname="li, as child of ol with role list and display: contents, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">y</li> expected "y" but got "" -[FAIL] Label: li with display: contents, as child of ol with role list, has listitem role - assert_equals: <li style="display: contents;" data-expectedrole="listitem" data-expectedlabel="y" data-testname="li with display: contents, as child of ol with role list, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">y</li> expected "y" but got "" +Found 11 FAIL, 0 TIMEOUT, 0 NOTRUN. +[FAIL] td as child of tr with display: contents, within table with display: flex, has cell role + assert_equals: <td data-expectedrole="cell" data-testname="td as child of tr with display: contents, within table with display: flex, has cell role" class="ex-role">x</td> expected "cell" but got "gridcell" +[FAIL] td as child of tr with display: contents, within table with role=table with display: flex, has cell role + assert_equals: <td data-expectedrole="cell" data-testname="td as child of tr with display: contents, within table with role=table with display: flex, has cell role" class="ex-role">x</td> expected "cell" but got "gridcell" +[FAIL] li as child of ul with role list, both with display: contents, has listitem role + assert_equals: <li style="display: contents;" data-expectedrole="listitem" data-testname="li as child of ul with role list, both with display: contents, has listitem role" class="ex-role">x</li> expected "listitem" but got "none" +[FAIL] li with display: contents, as child of ul with role list, has listitem role + assert_equals: <li style="display: contents;" data-expectedrole="listitem" data-testname="li with display: contents, as child of ul with role list, has listitem role" class="ex-role">y</li> expected "listitem" but got "none" +[FAIL] li as child of ol with role list, both with display: contents, has listitem role + assert_equals: <li style="display: contents;" data-expectedrole="listitem" data-testname="li as child of ol with role list, both with display: contents, has listitem role" class="ex-role">x</li> expected "listitem" but got "none" +[FAIL] li with display: contents, as child of ol with role list, has listitem role + assert_equals: <li style="display: contents;" data-expectedrole="listitem" data-testname="li with display: contents, as child of ol with role list, has listitem role" class="ex-role">y</li> expected "listitem" but got "none" +[FAIL] td within tr in table with role table, all with display: contents, has cell role + assert_equals: <td style="display: contents;" data-expectedrole="cell" data-testname="td within tr in table with role table, all with display: contents, has cell role" class="ex-role">x</td> expected "cell" but got "gridcell" [FAIL] Label: div with listitem role, as child of div with display: contents, has listitem role assert_equals: <div role="listitem" data-expectedrole="listitem" data-expectedlabel="x" data-testname="div with listitem role, as child of div with display: contents, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">x</div> expected "x" but got "" [FAIL] Label: div with listitem role (as child of div with list role), both with display: contents, has listitem role @@ -22,19 +22,5 @@ assert_equals: <div role="listitem" style="display: contents;" data-expectedrole="listitem" data-expectedlabel="y" data-testname="div with listitem role with display: contents, as child of div with list role, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">y</div> expected "y" but got "" [FAIL] Role: g element with display: contents, as child of svg, is labelled via title element assert_equals: <g style="display: contents;" fill="silver" stroke="blue" data-expectedlabel="group label" data-expectedrole="group" data-testname="g element with display: contents, as child of svg, is labelled via title element" class="ex-role-and-label ex-label-only ex-role-only">\n <title>group label</title>\n <circle cx="20" cy="20" r="10"></circle>\n <circle cx="20" cy="20" r="10"></circle>\n </g> expected "group" but got "generic" -[FAIL] Role: td as child of tr with display: contents, within table with display: flex, has cell role - assert_equals: <td data-expectedrole="cell" data-expectedlabel="x" data-testname="td as child of tr with display: contents, within table with display: flex, has cell role" class="ex-role-and-label ex-label-only ex-role-only">x</td> expected "cell" but got "gridcell" -[FAIL] Role: td as child of tr with display: contents, within table with role=table with display: flex, has cell role - assert_equals: <td data-expectedrole="cell" data-expectedlabel="x" data-testname="td as child of tr with display: contents, within table with role=table with display: flex, has cell role" class="ex-role-and-label ex-label-only ex-role-only">x</td> expected "cell" but got "gridcell" -[FAIL] Role: li as child of ul with role list, both with display: contents, has listitem role - assert_equals: <li style="display: contents;" data-expectedrole="listitem" data-expectedlabel="x" data-testname="li as child of ul with role list, both with display: contents, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">x</li> expected "listitem" but got "none" -[FAIL] Role: li with display: contents, as child of ul with role list, has listitem role - assert_equals: <li style="display: contents;" data-expectedrole="listitem" data-expectedlabel="y" data-testname="li with display: contents, as child of ul with role list, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">y</li> expected "listitem" but got "none" -[FAIL] Role: li as child of ol with role list, both with display: contents, has listitem role - assert_equals: <li style="display: contents;" data-expectedrole="listitem" data-expectedlabel="x" data-testname="li as child of ol with role list, both with display: contents, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">x</li> expected "listitem" but got "none" -[FAIL] Role: li with display: contents, as child of ol with role list, has listitem role - assert_equals: <li style="display: contents;" data-expectedrole="listitem" data-expectedlabel="y" data-testname="li with display: contents, as child of ol with role list, has listitem role" class="ex-role-and-label ex-label-only ex-role-only">y</li> expected "listitem" but got "none" -[FAIL] Role: td within tr in table with role table, all with display: contents, has cell role - assert_equals: <td style="display: contents;" data-expectedrole="cell" data-expectedlabel="x" data-testname="td within tr in table with role table, all with display: contents, has cell role" class="ex-role-and-label ex-label-only ex-role-only">x</td> expected "cell" but got "gridcell" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/css/css-display/accessibility/display-contents-role-and-label.html b/third_party/blink/web_tests/external/wpt/css/css-display/accessibility/display-contents-role-and-label.html index 2c9d8581..6b5453e 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-display/accessibility/display-contents-role-and-label.html +++ b/third_party/blink/web_tests/external/wpt/css/css-display/accessibility/display-contents-role-and-label.html
@@ -75,7 +75,7 @@ </thead> <tbody> <tr style="display: contents;"> - <td data-expectedrole="cell" data-expectedlabel="x" data-testname="td as child of tr with display: contents, within table with display: flex, has cell role" class="ex-role-and-label">x</td> + <td data-expectedrole="cell" data-testname="td as child of tr with display: contents, within table with display: flex, has cell role" class="ex-role">x</td> <td>x</td> </tr> </tbody> @@ -90,7 +90,7 @@ </thead> <tbody> <tr style="display: contents;"> - <td data-expectedrole="cell" data-expectedlabel="x" data-testname="td as child of tr with display: contents, within table with role=table with display: flex, has cell role" class="ex-role-and-label">x</td> + <td data-expectedrole="cell" data-testname="td as child of tr with display: contents, within table with role=table with display: flex, has cell role" class="ex-role">x</td> <td>x</td> </tr> </tbody> @@ -105,7 +105,7 @@ </thead> <tbody> <tr style="display: contents;"> - <td data-expectedrole="gridcell" data-expectedlabel="x" data-testname="td (no explicit role) as child of tr with display: contents, within table with role=grid with display: flex, has gridcell role" class="ex-role-and-label">x</td> + <td data-expectedrole="gridcell" data-testname="td (no explicit role) as child of tr with display: contents, within table with role=grid with display: flex, has gridcell role" class="ex-role">x</td> <td>x</td> </tr> </tbody> @@ -116,7 +116,7 @@ <h2>x</h2> <ul style="display: contents" data-expectedrole="list" data-testname="ul with display: contents, as child of div with display: grid, has list role" class="ex-role"> <li>x</li> - <li data-expectedrole="listitem" data-expectedlabel="x" data-testname="listitem within ul with display: contents, as child of div with display: grid, has listitem role" class="ex-role-and-label">x</li> + <li data-expectedrole="listitem" data-testname="listitem within ul with display: contents, as child of div with display: grid, has listitem role" class="ex-role">x</li> </ul> </div> @@ -156,33 +156,33 @@ <!-- Lists --> <ul role="list" style="display: contents;" data-expectedrole="list" data-testname="ul with role list and display: contents (child li has display: contents) has list role" class="ex-role"> - <li style="display: contents;" data-expectedrole="listitem" data-expectedlabel="x" data-testname="li as child of ul with role list, both with display: contents, has listitem role" class="ex-role-and-label">x</li> + <li style="display: contents;" data-expectedrole="listitem" data-testname="li as child of ul with role list, both with display: contents, has listitem role" class="ex-role">x</li> <li>y</li> </ul> <ul role="list" style="display: contents;" data-expectedrole="list" data-testname="ul with role list and display: contents has list role" class="ex-role"> <li>x</li> - <li data-expectedrole="listitem" data-expectedlabel="y" data-testname="li, as child of ul with role list and display: contents, has listitem role" class="ex-role-and-label">y</li> + <li data-expectedrole="listitem" data-testname="li, as child of ul with role list and display: contents, has listitem role" class="ex-role">y</li> </ul> <ul role="list"> <li>x</li> - <li style="display: contents;" data-expectedrole="listitem" data-expectedlabel="y" data-testname="li with display: contents, as child of ul with role list, has listitem role" class="ex-role-and-label">y</li> + <li style="display: contents;" data-expectedrole="listitem" data-testname="li with display: contents, as child of ul with role list, has listitem role" class="ex-role">y</li> </ul> <ol role="list" style="display: contents;" data-expectedrole="list" data-testname="ol with role list and display: contents has list role (child li has display: contents)" class="ex-role"> - <li style="display: contents;" data-expectedrole="listitem" data-expectedlabel="x" data-testname="li as child of ol with role list, both with display: contents, has listitem role" class="ex-role-and-label">x</li> + <li style="display: contents;" data-expectedrole="listitem" data-testname="li as child of ol with role list, both with display: contents, has listitem role" class="ex-role">x</li> <li>y</li> </ol> <ol role="list" style="display: contents;" data-expectedrole="list" data-testname="ol with role list and display: contents has list role" class="ex-role"> <li>x</li> - <li data-expectedrole="listitem" data-expectedlabel="y" data-testname="li, as child of ol with role list and display: contents, has listitem role" class="ex-role-and-label">y</li> + <li data-expectedrole="listitem" data-testname="li, as child of ol with role list and display: contents, has listitem role" class="ex-role">y</li> </ol> <ol role="list"> <li>x</li> - <li style="display: contents;" data-expectedrole="listitem" data-expectedlabel="y" data-testname="li with display: contents, as child of ol with role list, has listitem role" class="ex-role-and-label">y</li> + <li style="display: contents;" data-expectedrole="listitem" data-testname="li with display: contents, as child of ol with role list, has listitem role" class="ex-role">y</li> </ol> <div role="list" style="display: contents;" data-expectedrole="list" data-testname="div with list role and display: contents has list role" class="ex-role"> @@ -212,7 +212,7 @@ </thead> <tbody> <tr> - <td style="display: contents;" data-expectedrole="cell" data-expectedlabel="x" data-testname="td within tr in table with role table, all with display: contents, has cell role" class="ex-role-and-label">x</td> + <td style="display: contents;" data-expectedrole="cell" data-testname="td within tr in table with role table, all with display: contents, has cell role" class="ex-role">x</td> <td>x</td> </tr> </tbody> @@ -242,7 +242,7 @@ </thead> <tbody> <tr> - <td style="display: contents;" data-expectedrole="gridcell" data-expectedlabel="x" data-testname="td within table with role grid, both with display: contents, has gridcell role" class="ex-role-and-label">x</td> + <td style="display: contents;" data-expectedrole="gridcell" data-testname="td within table with role grid, both with display: contents, has gridcell role" class="ex-role">x</td> <td>x</td> </tr> </tbody> @@ -282,10 +282,10 @@ <div role="treegrid" style="display: contents;" data-expectedrole="treegrid" data-testname="div with role treegrid and display: contents has treegrid role" class="ex-role"></div> <ul role="tree" style="display: contents;" data-expectedrole="tree" data-testname="ul with role tree and display: contents has tree role" class="ex-role"> - <li role="treeitem" aria-expanded="true" style="display: contents;" data-expectedrole="treeitem" data-expectedlabel="x" data-testname="li with role treeitem and display: contents, within ul with role tree and display: contents, has treeitem role" class="ex-role-and-label"> + <li role="treeitem" aria-expanded="true" style="display: contents;" data-expectedrole="treeitem" data-testname="li with role treeitem and display: contents, within ul with role tree and display: contents, has treeitem role" class="ex-role"> <span>x</span> <ul role="group"> - <li role="treeitem" aria-expanded="false" style="display: contents;" data-expectedrole="treeitem" data-expectedlabel="x" data-testname="li with role treeitem and display: contents, within ul with role=group (within ul with role tree and display: contents), has treeitem role" class="ex-role-and-label"> + <li role="treeitem" aria-expanded="false" style="display: contents;" data-expectedrole="treeitem" data-testname="li with role treeitem and display: contents, within ul with role=group (within ul with role tree and display: contents), has treeitem role" class="ex-role"> <span>x</span> </li> </ul>
diff --git a/third_party/blink/web_tests/external/wpt/css/mediaqueries/WEB_FEATURES.yml b/third_party/blink/web_tests/external/wpt/css/mediaqueries/WEB_FEATURES.yml new file mode 100644 index 0000000..88f1510 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/mediaqueries/WEB_FEATURES.yml
@@ -0,0 +1,5 @@ +features: +- name: prefers-color-scheme + files: + - prefers-color-scheme.html + - prefers-color-scheme-*
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/WEB_FEATURES.yml b/third_party/blink/web_tests/external/wpt/css/selectors/WEB_FEATURES.yml index 4b292776..2449bf48 100644 --- a/third_party/blink/web_tests/external/wpt/css/selectors/WEB_FEATURES.yml +++ b/third_party/blink/web_tests/external/wpt/css/selectors/WEB_FEATURES.yml
@@ -5,6 +5,9 @@ - name: has files: - has-* +- name: read-write-pseudos + files: + - selector-read-write-* - name: user-pseudos files: - user-invalid.html
diff --git a/third_party/blink/web_tests/external/wpt/dom/xslt/resources/xml2html.xsl b/third_party/blink/web_tests/external/wpt/dom/xslt/resources/xml2html.xsl index 07b96750..88b74a96 100644 --- a/third_party/blink/web_tests/external/wpt/dom/xslt/resources/xml2html.xsl +++ b/third_party/blink/web_tests/external/wpt/dom/xslt/resources/xml2html.xsl
@@ -5,7 +5,7 @@ <xsl:template match="/"> <html> <body> - <h2>My CD Collection</h2> + <h2 style="margin-top:0">My CD Collection</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Title</th>
diff --git a/third_party/blink/web_tests/external/wpt/fetch/api/crashtests/huge-fetch.any.js b/third_party/blink/web_tests/external/wpt/fetch/api/crashtests/huge-fetch.any.js new file mode 100644 index 0000000..1b09925d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/fetch/api/crashtests/huge-fetch.any.js
@@ -0,0 +1,16 @@ +// META: global=window,worker + +'use strict'; + +promise_test(async t => { + const response = await fetch('../resources/huge-response.py'); + const reader = response.body.getReader(); + // Read one chunk just to show willing. + const { value, done } = await reader.read(); + assert_false(done, 'there should be some data'); + assert_greater_than(value.byteLength, 0, 'the chunk should be non-empty'); + // Wait 2 seconds to give it a chance to crash. + await new Promise(resolve => t.step_timeout(resolve, 2000)); + // If we get here without crashing we passed the test. + reader.cancel(); +}, 'fetching a huge cacheable file but not reading it should not crash');
diff --git a/third_party/blink/web_tests/external/wpt/fetch/api/resources/huge-response.py b/third_party/blink/web_tests/external/wpt/fetch/api/resources/huge-response.py new file mode 100644 index 0000000..16a6007 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/fetch/api/resources/huge-response.py
@@ -0,0 +1,22 @@ +# A Python script that generates a huge response. Implemented as a script to +# avoid needing to add a huge file to the repository. + +TOTAL_SIZE = 8 * 1024 * 1024 * 1024 # 8 GB +CHUNK_SIZE = 1024 * 1024 # 1 MB + +assert TOTAL_SIZE % CHUNK_SIZE == 0 + + +def main(request, response): + response.headers.set(b"Content-type", b"text/plain") + response.headers.set(b"Content-Length", str(TOTAL_SIZE).encode()) + response.headers.set(b"Cache-Control", b"max-age=86400") + response.write_status_headers() + + chunk = bytes(CHUNK_SIZE) + total_sent = 0 + + while total_sent < TOTAL_SIZE: + if not response.writer.write(chunk): + break + total_sent += CHUNK_SIZE
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/element/text/WEB_FEATURES.yml b/third_party/blink/web_tests/external/wpt/html/canvas/element/text/WEB_FEATURES.yml new file mode 100644 index 0000000..1d9e4ba --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/text/WEB_FEATURES.yml
@@ -0,0 +1,4 @@ +features: +- name: canvas-text-baselines + files: + - 2d.text.measure.baselines.*
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/WEB_FEATURES.yml b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/WEB_FEATURES.yml new file mode 100644 index 0000000..1d9e4ba --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/WEB_FEATURES.yml
@@ -0,0 +1,4 @@ +features: +- name: canvas-text-baselines + files: + - 2d.text.measure.baselines.*
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/selectors/pseudo-classes/WEB_FEATURES.yml b/third_party/blink/web_tests/external/wpt/html/semantics/selectors/pseudo-classes/WEB_FEATURES.yml index 604e049..055a5fb 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/selectors/pseudo-classes/WEB_FEATURES.yml +++ b/third_party/blink/web_tests/external/wpt/html/semantics/selectors/pseudo-classes/WEB_FEATURES.yml
@@ -5,3 +5,7 @@ - name: default files: - default.html +- name: read-write-pseudos + files: + - readwrite-readonly-type-change.html + - readwrite-readonly.html
diff --git a/third_party/blink/web_tests/external/wpt/inert/WEB_FEATURES.yml b/third_party/blink/web_tests/external/wpt/inert/WEB_FEATURES.yml new file mode 100644 index 0000000..074e337 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/inert/WEB_FEATURES.yml
@@ -0,0 +1,3 @@ +features: +- name: inert + files: "**"
diff --git a/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream-expected.txt b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream-expected.txt new file mode 100644 index 0000000..9b0d0e1d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +[FAIL] LoAF script: StreamPromise.resolve resolve-promise, + assert_true: Entry detected expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream-source-location-expected.txt b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream-source-location-expected.txt new file mode 100644 index 0000000..a9df771b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream-source-location-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +[FAIL] Source location should be extracted for stream promises + promise_test: Unhandled rejection with value: object "TypeError: Cannot read properties of undefined (reading 'sourceURL')" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream-source-location.html b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream-source-location.html index 5776ff5..0fd3085 100644 --- a/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream-source-location.html +++ b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream-source-location.html
@@ -17,8 +17,7 @@ const scriptElement = document.createElement("script"); scriptElement.src = scriptLocation; document.body.appendChild(scriptElement); - }, script => { - return script.invoker === "Promise.resolve" }, t); + }, script => script.invoker === "StreamPromise.resolve.then", t); assert_true(script.sourceURL.includes("stream-promise-generates-loaf.js")); }, "Source location should be extracted for stream promises");
diff --git a/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream.html b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream.html index 424f2cd0..e35bc2f 100644 --- a/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream.html +++ b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream.html
@@ -34,6 +34,6 @@ }); response.body.pipeTo(writable); await readable.getReader().read(); -}, "resolve", "Promise.resolve"); +}, "resolve", "StreamPromise.resolve"); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/shared-storage/cross-origin-worklet-select-url-and-verify-data-origin.tentative.https.sub.html b/third_party/blink/web_tests/external/wpt/shared-storage/cross-origin-worklet-select-url-and-verify-data-origin.tentative.https.sub.html new file mode 100644 index 0000000..5b6b9d5 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/shared-storage/cross-origin-worklet-select-url-and-verify-data-origin.tentative.https.sub.html
@@ -0,0 +1,46 @@ +<!doctype html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/utils.js"></script> +<script src="/shared-storage/resources/util.js"></script> +<script src="/fenced-frame/resources/utils.js"></script> + +<body> +<script> +'use strict'; + +promise_test(async () => { + const crossOrigin = 'https://{{domains[www]}}:{{ports[https][0]}}'; + const script_url = crossOrigin + + `/shared-storage/resources/simple-module.js`; + + const worklet = await sharedStorage.createWorklet( + script_url, + { credentials: "omit" }); + + const ancestor_key = token(); + let url0 = generateURL("/shared-storage/resources/frame0.html", + [ancestor_key]); + + let select_url_result = await worklet.selectURL( + "test-url-selection-operation", + [{ url: url0 }], { + data: { + 'mockResult': 0, + 'setKey': 'key0', + 'setValue': 'value0' + }, + resolveToConfig: true, + keepAlive: true + }); + + assert_true(validateSelectURLResult(select_url_result, true)); + attachFencedFrame(select_url_result, 'opaque-ads'); + const result0 = await nextValueFromServer(ancestor_key); + assert_equals(result0, "frame0_loaded"); + + await verifyKeyValueForOrigin('key0', 'value0', crossOrigin); +}, 'For a cross-origin worklet, test selectURL() and verify its data origin'); + +</script> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/shared-storage/resources/simple-module.js b/third_party/blink/web_tests/external/wpt/shared-storage/resources/simple-module.js index 620a359..11b6508 100644 --- a/third_party/blink/web_tests/external/wpt/shared-storage/resources/simple-module.js +++ b/third_party/blink/web_tests/external/wpt/shared-storage/resources/simple-module.js
@@ -6,6 +6,10 @@ class TestURLSelectionOperation { async run(urls, data) { + if (data && data.hasOwnProperty('setKey') && data.hasOwnProperty('setValue')) { + await sharedStorage.set(data['setKey'], data['setValue']); + } + if (data && data.hasOwnProperty('mockResult')) { return data['mockResult']; }
diff --git a/third_party/blink/web_tests/external/wpt/shared-storage/resources/simple-module.js.headers b/third_party/blink/web_tests/external/wpt/shared-storage/resources/simple-module.js.headers new file mode 100644 index 0000000..cf3e03e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/shared-storage/resources/simple-module.js.headers
@@ -0,0 +1,2 @@ +Access-Control-Allow-Origin: * +Shared-Storage-Cross-Origin-Worklet-Allowed: ?1
diff --git a/third_party/blink/web_tests/external/wpt/streams/piping/detached-context-crash.html b/third_party/blink/web_tests/external/wpt/streams/piping/detached-context-crash.html deleted file mode 100644 index 56271f1..0000000 --- a/third_party/blink/web_tests/external/wpt/streams/piping/detached-context-crash.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<body> -<script> -window.onload = () => { - const i = document.createElement("iframe"); - i.src = "about:blank"; - document.body.appendChild(i); - - const rs = new i.contentWindow.ReadableStream({ - start(controller) { controller.error(); } - }); - const ws = new i.contentWindow.WritableStream(); - - i.remove(); - - // pipeTo() should not crash with a ReadableStream or WritableStream from - // a detached iframe. - rs.pipeTo(ws); -}; -</script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/workers/support/Worker-creation-happens-in-parallel.js.headers b/third_party/blink/web_tests/external/wpt/workers/support/Worker-creation-happens-in-parallel.js.headers new file mode 100644 index 0000000..8249c49c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/workers/support/Worker-creation-happens-in-parallel.js.headers
@@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy:require-corp
diff --git a/third_party/blink/web_tests/external/wpt/workers/support/Worker-postMessage-happens-in-parallel.js.headers b/third_party/blink/web_tests/external/wpt/workers/support/Worker-postMessage-happens-in-parallel.js.headers new file mode 100644 index 0000000..8249c49c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/workers/support/Worker-postMessage-happens-in-parallel.js.headers
@@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy:require-corp
diff --git a/third_party/blink/web_tests/http/tests/lcpp_unused_preloads/defer_unused_preloads.php b/third_party/blink/web_tests/http/tests/lcpp_unused_preloads/defer_unused_preloads.php new file mode 100644 index 0000000..94e3680a --- /dev/null +++ b/third_party/blink/web_tests/http/tests/lcpp_unused_preloads/defer_unused_preloads.php
@@ -0,0 +1,84 @@ +<!doctype html> +<script src="/priorities/resources/common.js"></script> +<script type=module> +import {mojo} from "/gen/mojo/public/js/bindings.js"; +import {NonAssociatedWebTestControlHostRemote} from "/gen/content/web_test/common/web_test.mojom.m.js"; +import {ByteString} from "/gen/mojo/public/mojom/base/byte_string.mojom.m.js"; +import {LCPCriticalPathPredictorNavigationTimeHint} from "/gen/third_party/blink/public/mojom/lcp_critical_path_predictor/lcp_critical_path_predictor.mojom.m.js"; + +if (!window.testRunner) { + console.log("This test requires window.testRunner.") +} + +testRunner.dumpAsText(); +testRunner.waitUntilDone(); +if (window.location.search != "?start") { + const hint = new LCPCriticalPathPredictorNavigationTimeHint(); + + const resp = await fetch("/gen/third_party/blink/renderer/core/lcp_critical_path_predictor/test_proto/lcp_image_id.pb"); + + hint.unusedPreloads = [ + {url: new URL('/resources/square.png', location).toString()}, + ]; + // All fields are non-nullable. + hint.lcpElementLocators = []; + hint.lcpInfluencerScripts = []; + hint.preconnectOrigins = []; + hint.fetchedFonts = []; + + const web_test_control_host_remote = new NonAssociatedWebTestControlHostRemote(); + web_test_control_host_remote.$.bindNewPipeAndPassReceiver().bindInBrowser('process'); + web_test_control_host_remote.setLCPPNavigationHint(hint); + + window.location.search = '?start'; +} +</script> +<?php +// Do not output the HTML below this PHP block until the test is reloaded with +// "?start" to avoid it being picked up by the HTMLPreloadScanner. +if ($_SERVER['QUERY_STRING'] != "start") + exit; +?> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<link rel="preload" href="/resources/square.png" as="image" onload="onLoadPreload()"> + +<body> +<script> + var is_loaded = false; + let promise = new Promise(resolve => { + window.onLoadPreload = () => { + is_loaded = true; + resolve(); + } + }); + + const appendImage = async () => { + return new Promise(resolve => { + const img = document.createElement('img'); + img.onload = resolve; + document.body.appendChild(img); + img.src = "/resources/square20.jpg"; + }); + }; + + promise_test(() => { + const url = new URL('/resources/squre.png', location).toString(); + assert_false(is_loaded, "The loading is not started yet") + return appendImage() + .then(() => { + assert_false(is_loaded, "The preload is still not loaded after subsequent resource was already loaded."); + }) + .then(() => { + return new Promise(resolve => { + window.addEventListener('load', () => { + assert_false(is_loaded, "preload is still not loaded in window.onload"); + resolve(); + }); + }) + }) + .then(promise); + }, "Ensure LCPP hinted unused preloads were deferred by the timing predictor."); +</script> +</body>
diff --git a/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any-expected.txt b/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any-expected.txt index 83bd8b5..432ba64 100644 --- a/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any-expected.txt
@@ -1,31 +1,5 @@ This is a testharness.js-based test. -Found 19 FAIL, 0 TIMEOUT, 0 NOTRUN. -[FAIL] abs float32 1D constant tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] abs float32 1D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] abs float32 2D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] abs float32 3D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] abs float32 4D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] abs float32 5D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 0D scalar - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 1D constant tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 1D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 2D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 3D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 4D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 5D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." +Found 6 FAIL, 0 TIMEOUT, 0 NOTRUN. [FAIL] neg float32 1D constant tensor promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." [FAIL] neg float32 1D tensor
diff --git a/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any.worker-expected.txt index 83bd8b5..432ba64 100644 --- a/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac14-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any.worker-expected.txt
@@ -1,31 +1,5 @@ This is a testharness.js-based test. -Found 19 FAIL, 0 TIMEOUT, 0 NOTRUN. -[FAIL] abs float32 1D constant tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] abs float32 1D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] abs float32 2D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] abs float32 3D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] abs float32 4D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] abs float32 5D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 0D scalar - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 1D constant tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 1D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 2D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 3D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 4D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." -[FAIL] identity float32 5D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." +Found 6 FAIL, 0 TIMEOUT, 0 NOTRUN. [FAIL] neg float32 1D constant tensor promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." [FAIL] neg float32 1D tensor
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any-expected.txt index bab10ea..9dece88f 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any-expected.txt
@@ -1,17 +1,17 @@ This is a testharness.js-based test. Found 64 FAIL, 0 TIMEOUT, 0 NOTRUN. [FAIL] abs float32 1D constant tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test abs float32 actual 49.8125 should be close enough to expected 49.837242126464844 by the acceptable 0 ULP distance, but they have 6486 ULP distance expected true got false [FAIL] abs float32 1D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test abs float32 actual 49.8125 should be close enough to expected 49.837242126464844 by the acceptable 0 ULP distance, but they have 6486 ULP distance expected true got false [FAIL] abs float32 2D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test abs float32 actual 49.8125 should be close enough to expected 49.837242126464844 by the acceptable 0 ULP distance, but they have 6486 ULP distance expected true got false [FAIL] abs float32 3D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test abs float32 actual 49.8125 should be close enough to expected 49.837242126464844 by the acceptable 0 ULP distance, but they have 6486 ULP distance expected true got false [FAIL] abs float32 4D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test abs float32 actual 49.8125 should be close enough to expected 49.837242126464844 by the acceptable 0 ULP distance, but they have 6486 ULP distance expected true got false [FAIL] abs float32 5D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test abs float32 actual 49.8125 should be close enough to expected 49.837242126464844 by the acceptable 0 ULP distance, but they have 6486 ULP distance expected true got false [FAIL] ceil float32 1D constant tensor assert_true: assert_array_approx_equals_ulp: test ceil float32 actual 5 should be close enough to expected 6 by the acceptable 0 ULP distance, but they have 2097152 ULP distance expected true got false [FAIL] ceil float32 1D tensor @@ -49,19 +49,19 @@ [FAIL] exp float32 5D tensor assert_true: assert_array_approx_equals_ulp: test exp float32 actual 1.4072265625 should be close enough to expected 1.4079625606536865 by the acceptable 32 ULP distance, but they have 6174 ULP distance expected true got false [FAIL] identity float32 0D scalar - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual -4.2734375 should be close enough to expected -4.273642539978027 by the acceptable 0 ULP distance, but they have 430 ULP distance expected true got false [FAIL] identity float32 1D constant tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual 0.37744140625 should be close enough to expected 0.377551406621933 by the acceptable 0 ULP distance, but they have 3691 ULP distance expected true got false [FAIL] identity float32 1D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual 0.37744140625 should be close enough to expected 0.377551406621933 by the acceptable 0 ULP distance, but they have 3691 ULP distance expected true got false [FAIL] identity float32 2D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual 0.37744140625 should be close enough to expected 0.377551406621933 by the acceptable 0 ULP distance, but they have 3691 ULP distance expected true got false [FAIL] identity float32 3D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual 0.37744140625 should be close enough to expected 0.377551406621933 by the acceptable 0 ULP distance, but they have 3691 ULP distance expected true got false [FAIL] identity float32 4D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual 0.37744140625 should be close enough to expected 0.377551406621933 by the acceptable 0 ULP distance, but they have 3691 ULP distance expected true got false [FAIL] identity float32 5D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual 0.37744140625 should be close enough to expected 0.377551406621933 by the acceptable 0 ULP distance, but they have 3691 ULP distance expected true got false [FAIL] log float32 positive 1D constant tensor assert_array_approx_equals: test log float32 property 0, expected 4.15615177154541 +/- 0.0009765625, expected 4.15615177154541 but got 4.15234375 [FAIL] log float32 positive 1D tensor
diff --git a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any.worker-expected.txt index bab10ea..9dece88f 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/elementwise_unary.https.any.worker-expected.txt
@@ -1,17 +1,17 @@ This is a testharness.js-based test. Found 64 FAIL, 0 TIMEOUT, 0 NOTRUN. [FAIL] abs float32 1D constant tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test abs float32 actual 49.8125 should be close enough to expected 49.837242126464844 by the acceptable 0 ULP distance, but they have 6486 ULP distance expected true got false [FAIL] abs float32 1D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test abs float32 actual 49.8125 should be close enough to expected 49.837242126464844 by the acceptable 0 ULP distance, but they have 6486 ULP distance expected true got false [FAIL] abs float32 2D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test abs float32 actual 49.8125 should be close enough to expected 49.837242126464844 by the acceptable 0 ULP distance, but they have 6486 ULP distance expected true got false [FAIL] abs float32 3D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test abs float32 actual 49.8125 should be close enough to expected 49.837242126464844 by the acceptable 0 ULP distance, but they have 6486 ULP distance expected true got false [FAIL] abs float32 4D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test abs float32 actual 49.8125 should be close enough to expected 49.837242126464844 by the acceptable 0 ULP distance, but they have 6486 ULP distance expected true got false [FAIL] abs float32 5D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test abs float32 actual 49.8125 should be close enough to expected 49.837242126464844 by the acceptable 0 ULP distance, but they have 6486 ULP distance expected true got false [FAIL] ceil float32 1D constant tensor assert_true: assert_array_approx_equals_ulp: test ceil float32 actual 5 should be close enough to expected 6 by the acceptable 0 ULP distance, but they have 2097152 ULP distance expected true got false [FAIL] ceil float32 1D tensor @@ -49,19 +49,19 @@ [FAIL] exp float32 5D tensor assert_true: assert_array_approx_equals_ulp: test exp float32 actual 1.4072265625 should be close enough to expected 1.4079625606536865 by the acceptable 32 ULP distance, but they have 6174 ULP distance expected true got false [FAIL] identity float32 0D scalar - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual -4.2734375 should be close enough to expected -4.273642539978027 by the acceptable 0 ULP distance, but they have 430 ULP distance expected true got false [FAIL] identity float32 1D constant tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual 0.37744140625 should be close enough to expected 0.377551406621933 by the acceptable 0 ULP distance, but they have 3691 ULP distance expected true got false [FAIL] identity float32 1D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual 0.37744140625 should be close enough to expected 0.377551406621933 by the acceptable 0 ULP distance, but they have 3691 ULP distance expected true got false [FAIL] identity float32 2D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual 0.37744140625 should be close enough to expected 0.377551406621933 by the acceptable 0 ULP distance, but they have 3691 ULP distance expected true got false [FAIL] identity float32 3D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual 0.37744140625 should be close enough to expected 0.377551406621933 by the acceptable 0 ULP distance, but they have 3691 ULP distance expected true got false [FAIL] identity float32 4D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual 0.37744140625 should be close enough to expected 0.377551406621933 by the acceptable 0 ULP distance, but they have 3691 ULP distance expected true got false [FAIL] identity float32 5D tensor - promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Unimplemented Unary Operator." + assert_true: assert_array_approx_equals_ulp: test identity float32 actual 0.37744140625 should be close enough to expected 0.377551406621933 by the acceptable 0 ULP distance, but they have 3691 ULP distance expected true got false [FAIL] log float32 positive 1D constant tensor assert_array_approx_equals: test log float32 property 0, expected 4.15615177154541 +/- 0.0009765625, expected 4.15615177154541 but got 4.15234375 [FAIL] log float32 positive 1D tensor
diff --git a/third_party/blink/web_tests/virtual/lcpp-defer-unused-preloads/README.md b/third_party/blink/web_tests/virtual/lcpp-defer-unused-preloads/README.md new file mode 100644 index 0000000..b17883f6 --- /dev/null +++ b/third_party/blink/web_tests/virtual/lcpp-defer-unused-preloads/README.md
@@ -0,0 +1,5 @@ +# LCPPFontURLPredictor +This suite runs the tests in `http/lcpp_defer_unused_preloads/` with +`--enable-features=LCPPDeferUnusedPreload:load_timing/lcp_timing_predictor` + +See crbug.com/332382758.
diff --git a/third_party/catapult b/third_party/catapult index acbc4b1..01d7072 160000 --- a/third_party/catapult +++ b/third_party/catapult
@@ -1 +1 @@ -Subproject commit acbc4b1e3c39143cd2902cf7be091c5e84bae613 +Subproject commit 01d7072ad67e17b1ba7dded7955e399f29859bd6
diff --git a/third_party/cros-components/src b/third_party/cros-components/src index 3d5fbf6..bf7ce66 160000 --- a/third_party/cros-components/src +++ b/third_party/cros-components/src
@@ -1 +1 @@ -Subproject commit 3d5fbf62d7c7d34b1ecf72dd09577117ed370343 +Subproject commit bf7ce66098c3f9f28fb211f7f625d99a20cca5d3
diff --git a/third_party/dawn b/third_party/dawn index ceaa4eb..2f3cdea 160000 --- a/third_party/dawn +++ b/third_party/dawn
@@ -1 +1 @@ -Subproject commit ceaa4ebd3f266ebcd71627fb58517ad774b55c43 +Subproject commit 2f3cdea8d70c3504bbfa06bfde136c87f3f4b1f1
diff --git a/third_party/depot_tools b/third_party/depot_tools index 13f6ecb..fb94001 160000 --- a/third_party/depot_tools +++ b/third_party/depot_tools
@@ -1 +1 @@ -Subproject commit 13f6ecbbbb132e471ed2dda5e7d0aba5c7061249 +Subproject commit fb94001f066d0e38ab14c7413714ed17bfa34082
diff --git a/third_party/devtools-frontend-internal b/third_party/devtools-frontend-internal index 0b0e6ad..6a4a154 160000 --- a/third_party/devtools-frontend-internal +++ b/third_party/devtools-frontend-internal
@@ -1 +1 @@ -Subproject commit 0b0e6ad1a48238320459d614924bd71c5b11310c +Subproject commit 6a4a154f0261a27786fcd3cdc4ae40248c2367ec
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index 57aae63..05a0610 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit 57aae6355b4f6475d7c9890144f86a25ce43d1a9 +Subproject commit 05a061038727599586ae07a46e7408a1083cef94
diff --git a/third_party/openscreen/src b/third_party/openscreen/src index 5aa9736..b2f1cb4 160000 --- a/third_party/openscreen/src +++ b/third_party/openscreen/src
@@ -1 +1 @@ -Subproject commit 5aa9736c70d5374fd4b1aab1fbeeb3599353ed60 +Subproject commit b2f1cb493bd278159520aed705714c86225e167e
diff --git a/third_party/openxr/BUILD.gn b/third_party/openxr/BUILD.gn index be783468..aa8e9a10 100644 --- a/third_party/openxr/BUILD.gn +++ b/third_party/openxr/BUILD.gn
@@ -4,6 +4,19 @@ import("//device/vr/buildflags/buildflags.gni") +declare_args() { + # Used to determine whether or not the OpenXR loader is allowed to consider + # paths specified by a ContentProvider on Android as valid paths to load an + # OpenXR runtime from. It is more secure, albeit potentially not spec + # compliant, to set this to false, but more spec compliant to set it to true. + # When set to true, ContentProvider paths will be considered as valid paths to + # load an OpenXR runtime from. + # When set to false, ContentProvider paths will be ignored. + # For more details see the "Android Active Runtime Location" section from: + # https://registry.khronos.org/OpenXR/specs/1.0/loader.html#active-runtime-information + allow_openxr_content_providers = false +} + if (enable_openxr) { source_set("openxr_headers") { # This visibility is done to help enforce the dependency that @@ -107,7 +120,6 @@ "src/src/loader/loader_logger_recorders.cpp", "src/src/loader/loader_logger_recorders.hpp", "src/src/loader/loader_platform.hpp", - "src/src/loader/manifest_file.cpp", "src/src/loader/manifest_file.hpp", "src/src/loader/runtime_interface.cpp", "src/src/loader/runtime_interface.hpp", @@ -115,12 +127,14 @@ "src/src/loader/xr_generated_loader.hpp", "src/src/xr_generated_dispatch_table_core.c", "src/src/xr_generated_dispatch_table_core.h", + "src_overrides/src/loader/manifest_file.cpp", ] include_dirs = [ "src/include", "src/src/common", "src/src", + "src/src/loader", ] deps = [ "//third_party/jsoncpp" ] @@ -132,6 +146,10 @@ "DISABLE_STD_FILESYSTEM", ] + if (!allow_openxr_content_providers) { + defines += [ "XRLOADER_DISABLE_CONTENT_PROVIDERS" ] + } + cflags_cc = [ "-Wno-format", "-Wno-microsoft-cast", @@ -143,8 +161,8 @@ if (is_android) { sources += [ "dev/xr_android.h", - "src/src/loader/android_utilities.cpp", "src/src/loader/android_utilities.h", + "src_overrides/src/loader/android_utilities.cpp", ] deps += [ ":android-jni-wrappers" ]
diff --git a/third_party/openxr/README.chromium b/third_party/openxr/README.chromium index 141018e8..e93cf86f 100644 --- a/third_party/openxr/README.chromium +++ b/third_party/openxr/README.chromium
@@ -22,6 +22,9 @@ under active development and not in any openxr release at present. This file is expected to be superceded by any official definitions and may require additional work before a roll containing those definitions can be conducted. +Forked android_utilites.cpp and manifest_file.cpp to allow for customizing to +ignore loading in Android ContentProvider supplied paths while investigating and +waiting for upstreaming. -------------------- DEPENDENCY DIVIDER --------------------
diff --git a/third_party/openxr/src_overrides/src/loader/android_utilities.cpp b/third_party/openxr/src_overrides/src/loader/android_utilities.cpp new file mode 100644 index 0000000..912cf6f0 --- /dev/null +++ b/third_party/openxr/src_overrides/src/loader/android_utilities.cpp
@@ -0,0 +1,380 @@ +// Copyright (c) 2020-2023, The Khronos Group Inc. +// Copyright (c) 2020-2021, Collabora, Ltd. +// +// SPDX-License-Identifier: Apache-2.0 OR MIT +// +// Initial Author: Ryan Pavlik <ryan.pavlik@collabora.com> + +#include "android_utilities.h" + +#ifdef __ANDROID__ +#include <android/log.h> +#include <json/value.h> +#include <openxr/openxr.h> +#include <wrap/android.content.h> +#include <wrap/android.database.h> +#include <wrap/android.net.h> + +#include <sstream> +#include <vector> + +#define ALOGE(...) \ + __android_log_print(ANDROID_LOG_ERROR, "OpenXR-Loader", __VA_ARGS__) +#define ALOGW(...) \ + __android_log_print(ANDROID_LOG_WARN, "OpenXR-Loader", __VA_ARGS__) +#define ALOGV(...) \ + __android_log_print(ANDROID_LOG_VERBOSE, "OpenXR-Loader", __VA_ARGS__) +#define ALOGI(...) \ + __android_log_print(ANDROID_LOG_INFO, "OpenXR-Loader", __VA_ARGS__) + +namespace openxr_android { +#ifndef XRLOADER_DISABLE_CONTENT_PROVIDERS +using wrap::android::content::ContentUris; +using wrap::android::content::Context; +using wrap::android::database::Cursor; +using wrap::android::net::Uri; +using wrap::android::net::Uri_Builder; + +// Code in here corresponds roughly to the Java "BrokerContract" class and +// subclasses. +namespace { +constexpr auto AUTHORITY = "org.khronos.openxr.runtime_broker"; +constexpr auto SYSTEM_AUTHORITY = "org.khronos.openxr.system_runtime_broker"; +constexpr auto BASE_PATH = "openxr"; +constexpr auto ABI_PATH = "abi"; +constexpr auto RUNTIMES_PATH = "runtimes"; + +constexpr const char* getBrokerAuthority(bool systemBroker) { + return systemBroker ? SYSTEM_AUTHORITY : AUTHORITY; +} + +struct BaseColumns { + /** + * The unique ID for a row. + */ + [[maybe_unused]] static constexpr auto ID = "_id"; +}; + +/** + * Contains details for the /openxr/[major_ver]/abi/[abi]/runtimes/active URI. + * <p> + * This URI represents a "table" containing at most one item, the currently + * active runtime. The policy of which runtime is chosen to be active (if more + * than one is installed) is left to the content provider. <p> No sort order is + * required to be honored by the content provider. + */ +namespace active_runtime { +/** + * Final path component to this URI. + */ +static constexpr auto TABLE_PATH = "active"; + +/** + * Create a content URI for querying the data on the active runtime for a + * given major version of OpenXR. + * + * @param systemBroker If the system runtime broker (instead of the installable + * one) should be queried. + * @param majorVer The major version of OpenXR. + * @param abi The Android ABI name in use. + * @return A content URI for a single item: the active runtime. + */ +static Uri makeContentUri(bool systemBroker, + int majorVersion, + const char* abi) { + auto builder = Uri_Builder::construct(); + builder.scheme("content") + .authority(getBrokerAuthority(systemBroker)) + .appendPath(BASE_PATH) + .appendPath(std::to_string(majorVersion)) + .appendPath(ABI_PATH) + .appendPath(abi) + .appendPath(RUNTIMES_PATH) + .appendPath(TABLE_PATH); + ContentUris::appendId(builder, 0); + return builder.build(); +} + +struct Columns : BaseColumns { + /** + * Constant for the PACKAGE_NAME column name + */ + static constexpr auto PACKAGE_NAME = "package_name"; + + /** + * Constant for the NATIVE_LIB_DIR column name + */ + static constexpr auto NATIVE_LIB_DIR = "native_lib_dir"; + + /** + * Constant for the SO_FILENAME column name + */ + static constexpr auto SO_FILENAME = "so_filename"; + + /** + * Constant for the HAS_FUNCTIONS column name. + * <p> + * If this column contains true, you should check the /functions/ URI for that + * runtime. + */ + static constexpr auto HAS_FUNCTIONS = "has_functions"; +}; +} // namespace active_runtime + +/** + * Contains details for the + * /openxr/[major_ver]/abi/[abi]/runtimes/[package]/functions URI. <p> This URI + * is for package-specific function name remapping. Since this is an optional + * field in the corresponding JSON manifests for OpenXR, it is optional here as + * well. If the active runtime contains "true" in its "has_functions" column, + * then this table must exist and be queryable. <p> No sort order is required to + * be honored by the content provider. + */ +namespace functions { +/** + * Final path component to this URI. + */ +static constexpr auto TABLE_PATH = "functions"; + +/** + * Create a content URI for querying all rows of the function remapping data for + * a given runtime package and major version of OpenXR. + * + * @param systemBroker If the system runtime broker (instead of the installable + * one) should be queried. + * @param majorVer The major version of OpenXR. + * @param packageName The package name of the runtime. + * @param abi The Android ABI name in use. + * @return A content URI for the entire table: the function remapping for that + * runtime. + */ +static Uri makeContentUri(bool systemBroker, + int majorVersion, + std::string const& packageName, + const char* abi) { + auto builder = Uri_Builder::construct(); + builder.scheme("content") + .authority(getBrokerAuthority(systemBroker)) + .appendPath(BASE_PATH) + .appendPath(std::to_string(majorVersion)) + .appendPath(ABI_PATH) + .appendPath(abi) + .appendPath(RUNTIMES_PATH) + .appendPath(packageName) + .appendPath(TABLE_PATH); + return builder.build(); +} + +struct Columns : BaseColumns { + /** + * Constant for the FUNCTION_NAME column name + */ + static constexpr auto FUNCTION_NAME = "function_name"; + + /** + * Constant for the SYMBOL_NAME column name + */ + static constexpr auto SYMBOL_NAME = "symbol_name"; +}; +} // namespace functions + +} // namespace + +static inline jni::Array<std::string> makeArray( + std::initializer_list<const char*>&& list) { + auto ret = jni::Array<std::string>{(long)list.size()}; + long i = 0; + for (auto&& elt : list) { + ret.setElement(i, elt); + ++i; + } + return ret; +} +static constexpr auto TAG = "OpenXR-Loader"; + +#if defined(__arm__) +static constexpr auto ABI = "armeabi-v7l"; +#elif defined(__aarch64__) +static constexpr auto ABI = "arm64-v8a"; +#elif defined(__i386__) +static constexpr auto ABI = "x86"; +#elif defined(__x86_64__) +static constexpr auto ABI = "x86_64"; +#else +#error "Unknown ABI!" +#endif + +/// Helper class to generate the jsoncpp object corresponding to a synthetic +/// runtime manifest. +class JsonManifestBuilder { + public: + JsonManifestBuilder(const std::string& libraryPathParent, + const std::string& libraryPath); + JsonManifestBuilder& function(const std::string& functionName, + const std::string& symbolName); + + Json::Value build() const { return root_node; } + + private: + Json::Value root_node; +}; + +inline JsonManifestBuilder::JsonManifestBuilder( + const std::string& libraryPathParent, + const std::string& libraryPath) + : root_node(Json::objectValue) { + root_node["file_format_version"] = "1.0.0"; + root_node["instance_extensions"] = Json::Value(Json::arrayValue); + root_node["functions"] = Json::Value(Json::objectValue); + root_node[libraryPathParent] = Json::objectValue; + root_node[libraryPathParent]["library_path"] = libraryPath; +} + +inline JsonManifestBuilder& JsonManifestBuilder::function( + const std::string& functionName, + const std::string& symbolName) { + root_node["functions"][functionName] = symbolName; + return *this; +} + +static constexpr const char* getBrokerTypeName(bool systemBroker) { + return systemBroker ? "system" : "installable"; +} + +static int populateFunctions(wrap::android::content::Context const& context, + bool systemBroker, + const std::string& packageName, + JsonManifestBuilder& builder) { + jni::Array<std::string> projection = makeArray( + {functions::Columns::FUNCTION_NAME, functions::Columns::SYMBOL_NAME}); + + auto uri = functions::makeContentUri( + systemBroker, XR_VERSION_MAJOR(XR_CURRENT_API_VERSION), packageName, ABI); + ALOGI("populateFunctions: Querying URI: %s", uri.toString().c_str()); + + Cursor cursor = context.getContentResolver().query(uri, projection); + + if (cursor.isNull()) { + ALOGE("Null cursor when querying content resolver for functions."); + return -1; + } + if (cursor.getCount() < 1) { + ALOGE( + "Non-null but empty cursor when querying content resolver for " + "functions."); + cursor.close(); + return -1; + } + auto functionIndex = cursor.getColumnIndex(functions::Columns::FUNCTION_NAME); + auto symbolIndex = cursor.getColumnIndex(functions::Columns::SYMBOL_NAME); + while (cursor.moveToNext()) { + builder.function(cursor.getString(functionIndex), + cursor.getString(symbolIndex)); + } + + cursor.close(); + return 0; +} + +/// Get cursor for active runtime, parameterized by whether or not we use the +/// system broker +static bool getActiveRuntimeCursor( + wrap::android::content::Context const& context, + jni::Array<std::string> const& projection, + bool systemBroker, + Cursor& cursor) { + auto uri = active_runtime::makeContentUri( + systemBroker, XR_VERSION_MAJOR(XR_CURRENT_API_VERSION), ABI); + ALOGI("getActiveRuntimeCursor: Querying URI: %s", uri.toString().c_str()); + try { + cursor = context.getContentResolver().query(uri, projection); + } catch (const std::exception& e) { + ALOGW("Exception when querying %s content resolver: %s", + getBrokerTypeName(systemBroker), e.what()); + cursor = {}; + return false; + } + + if (cursor.isNull()) { + ALOGW("Null cursor when querying %s content resolver.", + getBrokerTypeName(systemBroker)); + cursor = {}; + return false; + } + if (cursor.getCount() < 1) { + ALOGW("Non-null but empty cursor when querying %s content resolver.", + getBrokerTypeName(systemBroker)); + cursor.close(); + cursor = {}; + return false; + } + return true; +} +#endif // #ifndef XRLOADER_DISABLE_CONTENT_PROVIDERS + +int getActiveRuntimeVirtualManifest( + wrap::android::content::Context const& context, + Json::Value& virtualManifest) { +#if defined(XRLOADER_DISABLE_CONTENT_PROVIDERS) + // If we want to ignore android content providers, then just return failure. + // TODO(alcooper): This will add some extra error logging. When upstreaming + // this change, we should probably wrap this level as well as the caller in + // runtime_interface.cpp and then that's corresponding caller in + // manifest_file.cpp + return -1; +#else + jni::Array<std::string> projection = + makeArray({active_runtime::Columns::PACKAGE_NAME, + active_runtime::Columns::NATIVE_LIB_DIR, + active_runtime::Columns::SO_FILENAME, + active_runtime::Columns::HAS_FUNCTIONS}); + + // First, try getting the installable broker's provider + bool systemBroker = false; + Cursor cursor; + if (!getActiveRuntimeCursor(context, projection, systemBroker, cursor)) { + // OK, try the system broker as a fallback. + systemBroker = true; + getActiveRuntimeCursor(context, projection, systemBroker, cursor); + } + + if (cursor.isNull()) { + // Couldn't find either broker + ALOGE("Could access neither the installable nor system runtime broker."); + return -1; + } + + cursor.moveToFirst(); + + auto filename = cursor.getString( + cursor.getColumnIndex(active_runtime::Columns::SO_FILENAME)); + auto libDir = cursor.getString( + cursor.getColumnIndex(active_runtime::Columns::NATIVE_LIB_DIR)); + auto packageName = cursor.getString( + cursor.getColumnIndex(active_runtime::Columns::PACKAGE_NAME)); + + auto hasFunctions = cursor.getInt(cursor.getColumnIndex( + active_runtime::Columns::HAS_FUNCTIONS)) == 1; + __android_log_print(ANDROID_LOG_INFO, TAG, + "Got runtime: package: %s, so filename: %s, native lib " + "dir: %s, has functions: %s", + packageName.c_str(), filename.c_str(), libDir.c_str(), + (hasFunctions ? "yes" : "no")); + + auto lib_path = libDir + "/" + filename; + cursor.close(); + + JsonManifestBuilder builder{"runtime", lib_path}; + if (hasFunctions) { + int result = populateFunctions(context, systemBroker, packageName, builder); + if (result != 0) { + return result; + } + } + virtualManifest = builder.build(); + return 0; +#endif // XRLOADER_DISABLE_CONTENT_PROVIDERS +} +} // namespace openxr_android + +#endif // __ANDROID__
diff --git a/third_party/openxr/src_overrides/src/loader/manifest_file.cpp b/third_party/openxr/src_overrides/src/loader/manifest_file.cpp new file mode 100644 index 0000000..0be2b280 --- /dev/null +++ b/third_party/openxr/src_overrides/src/loader/manifest_file.cpp
@@ -0,0 +1,1152 @@ +// Copyright (c) 2017-2023, The Khronos Group Inc. +// Copyright (c) 2017-2019 Valve Corporation +// Copyright (c) 2017-2019 LunarG, Inc. +// +// SPDX-License-Identifier: Apache-2.0 OR MIT +// +// Initial Authors: Mark Young <marky@lunarg.com>, Dave Houlton +// <daveh@lunarg.com> +// + +#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) +#define _CRT_SECURE_NO_WARNINGS +#endif // defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) + +#include "manifest_file.hpp" + +#ifdef OPENXR_HAVE_COMMON_CONFIG +#include "common_config.h" +#endif // OPENXR_HAVE_COMMON_CONFIG + +#include <json/json.h> +#include <openxr/openxr.h> + +#include <algorithm> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <fstream> +#include <memory> +#include <sstream> +#include <stdexcept> +#include <string> +#include <unordered_map> +#include <utility> +#include <vector> + +#include "filesystem_utils.hpp" +#include "loader_logger.hpp" +#include "loader_platform.hpp" +#include "platform_utils.hpp" +#include "unique_asset.h" + +#ifndef FALLBACK_CONFIG_DIRS +#define FALLBACK_CONFIG_DIRS "/etc/xdg" +#endif // !FALLBACK_CONFIG_DIRS + +#ifndef FALLBACK_DATA_DIRS +#define FALLBACK_DATA_DIRS "/usr/local/share:/usr/share" +#endif // !FALLBACK_DATA_DIRS + +#ifndef SYSCONFDIR +#define SYSCONFDIR "/etc" +#endif // !SYSCONFDIR + +#ifdef XR_USE_PLATFORM_ANDROID +#include <android/asset_manager.h> +#endif + +#ifdef XRLOADER_DISABLE_EXCEPTION_HANDLING +#if JSON_USE_EXCEPTIONS +#error \ + "Loader is configured to not catch exceptions, but jsoncpp was built with exception-throwing enabled, which could violate the C ABI. One of those two things needs to change." +#endif // JSON_USE_EXCEPTIONS +#endif // !XRLOADER_DISABLE_EXCEPTION_HANDLING + +#include "runtime_interface.hpp" + +// Utility functions for finding files in the appropriate paths + +static inline bool StringEndsWith(const std::string& value, + const std::string& ending) { + if (ending.size() > value.size()) { + return false; + } + return std::equal(ending.rbegin(), ending.rend(), value.rbegin()); +} + +// If the file found is a manifest file name, add it to the out_files manifest +// list. +static void AddIfJson(const std::string& full_file, + std::vector<std::string>& manifest_files) { + if (full_file.empty() || !StringEndsWith(full_file, ".json")) { + return; + } + manifest_files.push_back(full_file); +} + +// Check the current path for any manifest files. If the provided search_path +// is a directory, look for all included JSON files in that directory. +// Otherwise, just check the provided search_path which should be a single +// filename. +static void CheckAllFilesInThePath(const std::string& search_path, + bool is_directory_list, + std::vector<std::string>& manifest_files) { + if (FileSysUtilsPathExists(search_path)) { + std::string absolute_path; + if (!is_directory_list) { + // If the file exists, try to add it + if (FileSysUtilsIsRegularFile(search_path)) { + FileSysUtilsGetAbsolutePath(search_path, absolute_path); + AddIfJson(absolute_path, manifest_files); + } + } else { + std::vector<std::string> files; + if (FileSysUtilsFindFilesInPath(search_path, files)) { + for (std::string& cur_file : files) { + std::string relative_path; + FileSysUtilsCombinePaths(search_path, cur_file, relative_path); + if (!FileSysUtilsGetAbsolutePath(relative_path, absolute_path)) { + continue; + } + AddIfJson(absolute_path, manifest_files); + } + } + } + } +} + +// Add all manifest files in the provided paths to the manifest_files list. If +// search_path is made up of directory listings (versus direct manifest file +// names) search each path for any manifest files. +static void AddFilesInPath(const std::string& search_path, + bool is_directory_list, + std::vector<std::string>& manifest_files) { + std::size_t last_found = 0; + std::size_t found = search_path.find_first_of(PATH_SEPARATOR); + std::string cur_search; + + // Handle any path listings in the string (separated by the appropriate path + // separator) + while (found != std::string::npos) { + // substr takes a start index and length. + std::size_t length = found - last_found; + cur_search = search_path.substr(last_found, length); + + CheckAllFilesInThePath(cur_search, is_directory_list, manifest_files); + + // This works around issue if multiple path separator follow each other + // directly. + last_found = found; + while (found == last_found) { + last_found = found + 1; + found = search_path.find_first_of(PATH_SEPARATOR, last_found); + } + } + + // If there's something remaining in the string, copy it over + if (last_found < search_path.size()) { + cur_search = search_path.substr(last_found); + CheckAllFilesInThePath(cur_search, is_directory_list, manifest_files); + } +} + +// Copy all paths listed in the cur_path string into output_path and append the +// appropriate relative_path onto the end of each. +static void CopyIncludedPaths(bool is_directory_list, + const std::string& cur_path, + const std::string& relative_path, + std::string& output_path) { + if (!cur_path.empty()) { + std::size_t last_found = 0; + std::size_t found = cur_path.find_first_of(PATH_SEPARATOR); + + // Handle any path listings in the string (separated by the appropriate path + // separator) + while (found != std::string::npos) { + std::size_t length = found - last_found; + output_path += cur_path.substr(last_found, length); + if (is_directory_list && + (cur_path[found - 1] != '\\' && cur_path[found - 1] != '/')) { + output_path += DIRECTORY_SYMBOL; + } + output_path += relative_path; + output_path += PATH_SEPARATOR; + + last_found = found; + found = cur_path.find_first_of(PATH_SEPARATOR, found + 1); + } + + // If there's something remaining in the string, copy it over + size_t last_char = cur_path.size() - 1; + if (last_found != last_char) { + output_path += cur_path.substr(last_found); + if (is_directory_list && + (cur_path[last_char] != '\\' && cur_path[last_char] != '/')) { + output_path += DIRECTORY_SYMBOL; + } + output_path += relative_path; + output_path += PATH_SEPARATOR; + } + } +} + +// Look for data files in the provided paths, but first check the environment +// override to determine if we should use that instead. +static void ReadDataFilesInSearchPaths( + const std::string& override_env_var, + const std::string& relative_path, + bool& override_active, + std::vector<std::string>& manifest_files) { + std::string override_path; + std::string search_path; + + if (!override_env_var.empty()) { + bool permit_override = true; +#ifndef XR_OS_WINDOWS + if (geteuid() != getuid() || getegid() != getgid()) { + // Don't allow setuid apps to use the env var + permit_override = false; + } +#endif + if (permit_override) { + override_path = PlatformUtilsGetSecureEnv(override_env_var.c_str()); + } + } + + if (!override_path.empty()) { + CopyIncludedPaths(true, override_path, "", search_path); + override_active = true; + } else { + override_active = false; +#if !defined(XR_OS_WINDOWS) && !defined(XR_OS_ANDROID) + const char home_additional[] = ".local/share/"; + + // Determine how much space is needed to generate the full search path + // for the current manifest files. + std::string xdg_conf_dirs = PlatformUtilsGetSecureEnv("XDG_CONFIG_DIRS"); + std::string xdg_data_dirs = PlatformUtilsGetSecureEnv("XDG_DATA_DIRS"); + std::string xdg_data_home = PlatformUtilsGetSecureEnv("XDG_DATA_HOME"); + std::string home = PlatformUtilsGetSecureEnv("HOME"); + + if (xdg_conf_dirs.empty()) { + CopyIncludedPaths(true, FALLBACK_CONFIG_DIRS, relative_path, search_path); + } else { + CopyIncludedPaths(true, xdg_conf_dirs, relative_path, search_path); + } + + CopyIncludedPaths(true, SYSCONFDIR, relative_path, search_path); +#if defined(EXTRASYSCONFDIR) + CopyIncludedPaths(true, EXTRASYSCONFDIR, relative_path, search_path); +#endif + + if (xdg_data_dirs.empty()) { + CopyIncludedPaths(true, FALLBACK_DATA_DIRS, relative_path, search_path); + } else { + CopyIncludedPaths(true, xdg_data_dirs, relative_path, search_path); + } + + if (!xdg_data_home.empty()) { + CopyIncludedPaths(true, xdg_data_home, relative_path, search_path); + } else if (!home.empty()) { + std::string relative_home_path = home_additional; + relative_home_path += relative_path; + CopyIncludedPaths(true, home, relative_home_path, search_path); + } +#elif defined(XR_OS_ANDROID) + CopyIncludedPaths(true, "/product/etc", relative_path, search_path); + CopyIncludedPaths(true, "/odm/etc", relative_path, search_path); + CopyIncludedPaths(true, "/oem/etc", relative_path, search_path); + CopyIncludedPaths(true, "/vendor/etc", relative_path, search_path); + CopyIncludedPaths(true, "/system/etc", relative_path, search_path); +#else + (void)relative_path; +#endif + } + + // Now, parse the paths and add any manifest files found in them. + AddFilesInPath(search_path, true, manifest_files); +} + +#ifdef XR_OS_LINUX + +// Get an XDG environment variable with a $HOME-relative default +static std::string GetXDGEnvHome(const char* name, const char* fallback_path) { + std::string result = PlatformUtilsGetSecureEnv(name); + if (!result.empty()) { + return result; + } + result = PlatformUtilsGetSecureEnv("HOME"); + if (result.empty()) { + return result; + } + result += "/"; + result += fallback_path; + return result; +} + +// Get an XDG environment variable with absolute defaults +static std::string GetXDGEnvAbsolute(const char* name, + const char* fallback_paths) { + std::string result = PlatformUtilsGetSecureEnv(name); + if (!result.empty()) { + return result; + } + return fallback_paths; +} + +/// @param rt_dir_prefix Directory prefix with a trailing slash +static bool FindEitherActiveRuntimeFilename(const char* prefix_desc, + const std::string& rt_dir_prefix, + uint16_t major_version, + std::string& out) { + { + std::ostringstream oss; + oss << "Looking for active_runtime." XR_ARCH_ABI + ".json or active_runtime.json in "; + oss << prefix_desc; + oss << ": "; + oss << rt_dir_prefix; + + LoaderLogger::LogInfoMessage("", oss.str()); + } + { + auto decorated_path = rt_dir_prefix + std::to_string(major_version) + + "/active_runtime." XR_ARCH_ABI ".json"; + + if (FileSysUtilsPathExists(decorated_path)) { + out = decorated_path; + return true; + } + } + { + auto undecorated_path = + rt_dir_prefix + std::to_string(major_version) + "/active_runtime.json"; + + if (FileSysUtilsPathExists(undecorated_path)) { + out = undecorated_path; + return true; + } + } + return false; +} +// Return the first instance of relative_path occurring in an XDG config dir +// according to standard precedence order. +static bool FindXDGConfigFile(const char* relative_dir, + uint16_t major_version, + std::string& out) { + const std::string message{"Looking for active_runtime." XR_ARCH_ABI + ".json or active_runtime.json"}; + std::string dir_prefix = GetXDGEnvHome("XDG_CONFIG_HOME", ".config"); + if (!dir_prefix.empty()) { + dir_prefix += "/"; + dir_prefix += relative_dir; + if (FindEitherActiveRuntimeFilename("XDG_CONFIG_HOME", dir_prefix, + major_version, out)) { + return true; + } + } + + std::istringstream iss( + GetXDGEnvAbsolute("XDG_CONFIG_DIRS", FALLBACK_CONFIG_DIRS)); + std::string path; + while (std::getline(iss, path, PATH_SEPARATOR)) { + if (path.empty()) { + continue; + } + dir_prefix = std::move(path); + dir_prefix += "/"; + dir_prefix += relative_dir; + if (FindEitherActiveRuntimeFilename("an entry of XDG_CONFIG_DIRS", + dir_prefix, major_version, out)) { + return true; + } + } + + dir_prefix = SYSCONFDIR; + dir_prefix += "/"; + dir_prefix += relative_dir; + if (FindEitherActiveRuntimeFilename("compiled-in SYSCONFDIR", dir_prefix, + major_version, out)) { + return true; + } + +#if defined(EXTRASYSCONFDIR) + dir_prefix = EXTRASYSCONFDIR; + dir_prefix += "/"; + dir_prefix += relative_dir; + if (FindEitherActiveRuntimeFilename("compiled-in EXTRASYSCONFDIR", dir_prefix, + major_version, out)) { + return true; + } +#endif + + out.clear(); + return false; +} + +#endif + +#ifdef XR_OS_WINDOWS + +// Look for runtime data files in the provided paths, but first check the +// environment override to determine if we should use that instead. +static void ReadRuntimeDataFilesInRegistry( + const std::string& runtime_registry_location, + const std::string& default_runtime_value_name, + std::vector<std::string>& manifest_files) { + HKEY hkey; + DWORD access_flags; + wchar_t value_w[1024]; + DWORD value_size_w = sizeof(value_w); // byte size of the buffer. + + // Generate the full registry location for the registry information + std::string full_registry_location = OPENXR_REGISTRY_LOCATION; + full_registry_location += + std::to_string(XR_VERSION_MAJOR(XR_CURRENT_API_VERSION)); + full_registry_location += runtime_registry_location; + + const std::wstring full_registry_location_w = + utf8_to_wide(full_registry_location); + const std::wstring default_runtime_value_name_w = + utf8_to_wide(default_runtime_value_name); + + // Use 64 bit regkey for 64bit application, and use 32 bit regkey in WOW for + // 32bit application. + access_flags = KEY_QUERY_VALUE; + LONG open_value = + RegOpenKeyExW(HKEY_LOCAL_MACHINE, full_registry_location_w.c_str(), 0, + access_flags, &hkey); + + if (ERROR_SUCCESS != open_value) { + LoaderLogger::LogWarningMessage( + "", "ReadRuntimeDataFilesInRegistry - failed to open registry key " + + full_registry_location); + + return; + } + + if (ERROR_SUCCESS != + RegGetValueW(hkey, nullptr, default_runtime_value_name_w.c_str(), + RRF_RT_REG_SZ | REG_EXPAND_SZ | RRF_ZEROONFAILURE, NULL, + reinterpret_cast<LPBYTE>(&value_w), &value_size_w)) { + LoaderLogger::LogWarningMessage( + "", "ReadRuntimeDataFilesInRegistry - failed to read registry value " + + default_runtime_value_name); + } else { + AddFilesInPath(wide_to_utf8(value_w), false, manifest_files); + } + + RegCloseKey(hkey); +} + +// Look for layer data files in the provided paths, but first check the +// environment override to determine if we should use that instead. +static void ReadLayerDataFilesInRegistry( + const std::string& registry_location, + std::vector<std::string>& manifest_files) { + const std::wstring full_registry_location_w = + utf8_to_wide(OPENXR_REGISTRY_LOCATION + + std::to_string(XR_VERSION_MAJOR(XR_CURRENT_API_VERSION)) + + registry_location); + + auto ReadLayerDataFilesInHive = [&](HKEY hive) { + HKEY hkey; + LONG open_value = RegOpenKeyExW(hive, full_registry_location_w.c_str(), 0, + KEY_QUERY_VALUE, &hkey); + if (ERROR_SUCCESS != open_value) { + return false; + } + + wchar_t name_w[1024]{}; + LONG rtn_value; + DWORD name_size = 1023; + DWORD value; + DWORD value_size = sizeof(value); + DWORD key_index = 0; + while (ERROR_SUCCESS == (rtn_value = RegEnumValueW( + hkey, key_index++, name_w, &name_size, NULL, + NULL, (LPBYTE)&value, &value_size))) { + if (value_size == sizeof(value) && value == 0) { + const std::string filename = wide_to_utf8(name_w); + AddFilesInPath(filename, false, manifest_files); + } + // Reset some items for the next loop + name_size = 1023; + } + + RegCloseKey(hkey); + + return true; + }; + + // Do not allow high integrity processes to act on data that can be controlled + // by medium integrity processes. + const bool readFromCurrentUser = !IsHighIntegrityLevel(); + + bool found = ReadLayerDataFilesInHive(HKEY_LOCAL_MACHINE); + if (readFromCurrentUser) { + found |= ReadLayerDataFilesInHive(HKEY_CURRENT_USER); + } + + if (!found) { + std::string warning_message = + "ReadLayerDataFilesInRegistry - failed to read registry location "; + warning_message += registry_location; + warning_message += + (readFromCurrentUser + ? " in either HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER" + : " in HKEY_LOCAL_MACHINE"); + LoaderLogger::LogWarningMessage("", warning_message); + } +} + +#endif // XR_OS_WINDOWS + +ManifestFile::ManifestFile(ManifestFileType type, + const std::string& filename, + const std::string& library_path) + : _filename(filename), _type(type), _library_path(library_path) {} + +bool ManifestFile::IsValidJson(const Json::Value& root_node, + JsonVersion& version) { + if (root_node["file_format_version"].isNull() || + !root_node["file_format_version"].isString()) { + LoaderLogger::LogErrorMessage("", + "ManifestFile::IsValidJson - JSON file " + "missing \"file_format_version\""); + return false; + } + std::string file_format = root_node["file_format_version"].asString(); + const int num_fields = sscanf(file_format.c_str(), "%u.%u.%u", &version.major, + &version.minor, &version.patch); + + // Only version 1.0.0 is defined currently. Eventually we may have more + // version, but some of the versions may only be valid for layers or runtimes + // specifically. + if (num_fields != 3 || version.major != 1 || version.minor != 0 || + version.patch != 0) { + std::ostringstream error_ss; + error_ss << "ManifestFile::IsValidJson - JSON \"file_format_version\" " + << version.major << "." << version.minor << "." << version.patch + << " is not supported"; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return false; + } + + return true; +} + +static void GetExtensionProperties( + const std::vector<ExtensionListing>& extensions, + std::vector<XrExtensionProperties>& props) { + for (const auto& ext : extensions) { + auto it = std::find_if(props.begin(), props.end(), + [&](XrExtensionProperties& prop) { + return prop.extensionName == ext.name; + }); + if (it != props.end()) { + it->extensionVersion = + std::max(it->extensionVersion, ext.extension_version); + } else { + XrExtensionProperties prop{}; + prop.type = XR_TYPE_EXTENSION_PROPERTIES; + strncpy(prop.extensionName, ext.name.c_str(), + XR_MAX_EXTENSION_NAME_SIZE - 1); + prop.extensionName[XR_MAX_EXTENSION_NAME_SIZE - 1] = '\0'; + prop.extensionVersion = ext.extension_version; + props.push_back(prop); + } + } +} + +// Return any instance extensions found in the manifest files in the proper form +// for OpenXR (XrExtensionProperties). +void ManifestFile::GetInstanceExtensionProperties( + std::vector<XrExtensionProperties>& props) { + GetExtensionProperties(_instance_extensions, props); +} + +const std::string& ManifestFile::GetFunctionName( + const std::string& func_name) const { + if (!_functions_renamed.empty()) { + auto found = _functions_renamed.find(func_name); + if (found != _functions_renamed.end()) { + return found->second; + } + } + return func_name; +} + +RuntimeManifestFile::RuntimeManifestFile(const std::string& filename, + const std::string& library_path) + : ManifestFile(MANIFEST_TYPE_RUNTIME, filename, library_path) {} + +static void ParseExtension(Json::Value const& ext, + std::vector<ExtensionListing>& extensions) { + Json::Value ext_name = ext["name"]; + Json::Value ext_version = ext["extension_version"]; + + // Allow "extension_version" as a String or a UInt to maintain backwards + // compatibility, even though it should be a String. Internal Issue 1411: + // https://gitlab.khronos.org/openxr/openxr/-/issues/1411 Internal MR !1867: + // https://gitlab.khronos.org/openxr/openxr/-/merge_requests/1867 + if (ext_name.isString() && (ext_version.isString() || ext_version.isUInt())) { + ExtensionListing ext_listing = {}; + ext_listing.name = ext_name.asString(); + if (ext_version.isUInt()) { + ext_listing.extension_version = ext_version.asUInt(); + } else { + ext_listing.extension_version = atoi(ext_version.asString().c_str()); + } + extensions.push_back(ext_listing); + } +} + +void ManifestFile::ParseCommon(Json::Value const& root_node) { + const Json::Value& inst_exts = root_node["instance_extensions"]; + if (!inst_exts.isNull() && inst_exts.isArray()) { + for (const auto& ext : inst_exts) { + ParseExtension(ext, _instance_extensions); + } + } + const Json::Value& funcs_renamed = root_node["functions"]; + if (!funcs_renamed.isNull() && !funcs_renamed.empty()) { + for (Json::ValueConstIterator func_it = funcs_renamed.begin(); + func_it != funcs_renamed.end(); ++func_it) { + if (!(*func_it).isString()) { + LoaderLogger::LogWarningMessage( + "", "ManifestFile::ParseCommon " + _filename + + " \"functions\" section contains non-string values."); + continue; + } + std::string original_name = func_it.key().asString(); + std::string new_name = (*func_it).asString(); + _functions_renamed.emplace(original_name, new_name); + } + } +} + +void RuntimeManifestFile::CreateIfValid( + std::string const& filename, + std::vector<std::unique_ptr<RuntimeManifestFile>>& manifest_files) { + std::ifstream json_stream(filename, std::ifstream::in); + + LoaderLogger::LogInfoMessage( + "", + "RuntimeManifestFile::CreateIfValid - attempting to load " + filename); + std::ostringstream error_ss("RuntimeManifestFile::CreateIfValid "); + if (!json_stream.is_open()) { + error_ss << "failed to open " << filename << ". Does it exist?"; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + Json::CharReaderBuilder builder; + std::string errors; + Json::Value root_node = Json::nullValue; + if (!Json::parseFromStream(builder, json_stream, &root_node, &errors) || + !root_node.isObject()) { + error_ss << "failed to parse " << filename << "."; + if (!errors.empty()) { + error_ss << " (Error message: " << errors << ")"; + } + error_ss << " Is it a valid runtime manifest file?"; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + + CreateIfValid(root_node, filename, manifest_files); +} + +void RuntimeManifestFile::CreateIfValid( + const Json::Value& root_node, + const std::string& filename, + std::vector<std::unique_ptr<RuntimeManifestFile>>& manifest_files) { + std::ostringstream error_ss("RuntimeManifestFile::CreateIfValid "); + JsonVersion file_version = {}; + if (!ManifestFile::IsValidJson(root_node, file_version)) { + error_ss << "isValidJson indicates " << filename + << " is not a valid manifest file."; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + const Json::Value& runtime_root_node = root_node["runtime"]; + // The Runtime manifest file needs the "runtime" root as well as a sub-node + // for "library_path". If any of those aren't there, fail. + if (runtime_root_node.isNull() || + runtime_root_node["library_path"].isNull() || + !runtime_root_node["library_path"].isString()) { + error_ss << filename + << " is missing required fields. Verify all proper fields exist."; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + + std::string lib_path = runtime_root_node["library_path"].asString(); + + // If the library_path variable has no directory symbol, it's just a file name + // and should be accessible on the global library path. + if (lib_path.find('\\') != std::string::npos || + lib_path.find('/') != std::string::npos) { + // If the library_path is an absolute path, just use that if it exists + if (FileSysUtilsIsAbsolutePath(lib_path)) { + if (!FileSysUtilsPathExists(lib_path)) { + error_ss << filename << " library " << lib_path + << " does not appear to exist"; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + } else { + // Otherwise, treat the library path as a relative path based on the JSON + // file. + std::string canonical_path; + std::string combined_path; + std::string file_parent; + // Search relative to the real manifest file, not relative to the symlink + if (!FileSysUtilsGetCanonicalPath(filename, canonical_path)) { + // Give relative to the non-canonical path a chance + canonical_path = filename; + } + if (!FileSysUtilsGetParentPath(canonical_path, file_parent) || + !FileSysUtilsCombinePaths(file_parent, lib_path, combined_path) || + !FileSysUtilsPathExists(combined_path)) { + error_ss << filename << " library " << combined_path + << " does not appear to exist"; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + lib_path = combined_path; + } + } + + // Add this runtime manifest file + manifest_files.emplace_back(new RuntimeManifestFile(filename, lib_path)); + + // Add any extensions to it after the fact. + // Handle any renamed functions + manifest_files.back()->ParseCommon(runtime_root_node); +} + +// Find all manifest files in the appropriate search paths/registries for the +// given type. +XrResult RuntimeManifestFile::FindManifestFiles( + std::vector<std::unique_ptr<RuntimeManifestFile>>& manifest_files) { + XrResult result = XR_SUCCESS; + std::string filename = PlatformUtilsGetSecureEnv(OPENXR_RUNTIME_JSON_ENV_VAR); + if (!filename.empty()) { + LoaderLogger::LogInfoMessage( + "", + "RuntimeManifestFile::FindManifestFiles - using environment variable " + "override runtime file " + + filename); + } else { +#ifdef XR_OS_WINDOWS + std::vector<std::string> filenames; + ReadRuntimeDataFilesInRegistry("", "ActiveRuntime", filenames); + if (filenames.size() == 0) { + LoaderLogger::LogErrorMessage( + "", + "RuntimeManifestFile::FindManifestFiles - failed to find active " + "runtime file in registry"); + return XR_ERROR_RUNTIME_UNAVAILABLE; + } + if (filenames.size() > 1) { + LoaderLogger::LogWarningMessage( + "", + "RuntimeManifestFile::FindManifestFiles - found too many default " + "runtime files in registry"); + } + filename = filenames[0]; + LoaderLogger::LogInfoMessage("", + "RuntimeManifestFile::FindManifestFiles - " + "using registry-specified runtime file " + + filename); +#elif defined(XR_OS_LINUX) + + if (!FindXDGConfigFile("openxr/", XR_VERSION_MAJOR(XR_CURRENT_API_VERSION), + filename)) { + LoaderLogger::LogErrorMessage( + "", + "RuntimeManifestFile::FindManifestFiles - failed to determine active " + "runtime file path for this environment"); + return XR_ERROR_RUNTIME_UNAVAILABLE; + } +#else + +#if defined(XR_KHR_LOADER_INIT_SUPPORT) && \ + !defined(XRLOADER_DISABLE_CONTENT_PROVIDERS) + Json::Value virtualManifest; + result = GetPlatformRuntimeVirtualManifest(virtualManifest); + if (XR_SUCCESS == result) { + RuntimeManifestFile::CreateIfValid(virtualManifest, "", manifest_files); + return result; + } +#endif // defined(XR_KHR_LOADER_INIT_SUPPORT) + if (!PlatformGetGlobalRuntimeFileName( + XR_VERSION_MAJOR(XR_CURRENT_API_VERSION), filename)) { + LoaderLogger::LogErrorMessage( + "", + "RuntimeManifestFile::FindManifestFiles - failed to determine active " + "runtime file path for this environment"); + return XR_ERROR_RUNTIME_UNAVAILABLE; + } + result = XR_SUCCESS; + LoaderLogger::LogInfoMessage( + "", + "RuntimeManifestFile::FindManifestFiles - using global runtime file " + + filename); +#endif + } + RuntimeManifestFile::CreateIfValid(filename, manifest_files); + + return result; +} + +ApiLayerManifestFile::ApiLayerManifestFile( + ManifestFileType type, + const std::string& filename, + const std::string& layer_name, + const std::string& description, + const JsonVersion& api_version, + const uint32_t& implementation_version, + const std::string& library_path) + : ManifestFile(type, filename, library_path), + _api_version(api_version), + _layer_name(layer_name), + _description(description), + _implementation_version(implementation_version) {} + +#ifdef XR_USE_PLATFORM_ANDROID +void ApiLayerManifestFile::AddManifestFilesAndroid( + ManifestFileType type, + std::vector<std::unique_ptr<ApiLayerManifestFile>>& manifest_files) { + AAssetManager* assetManager = (AAssetManager*)Android_Get_Asset_Manager(); + std::vector<std::string> filenames; + { + std::string search_path = ""; + switch (type) { + case MANIFEST_TYPE_IMPLICIT_API_LAYER: + search_path = "openxr/1/api_layers/implicit.d/"; + break; + case MANIFEST_TYPE_EXPLICIT_API_LAYER: + search_path = "openxr/1/api_layers/explicit.d/"; + break; + default: + return; + } + + UniqueAssetDir dir{ + AAssetManager_openDir(assetManager, search_path.c_str())}; + if (!dir) { + return; + } + const std::string json = ".json"; + const char* fn = nullptr; + while ((fn = AAssetDir_getNextFileName(dir.get())) != nullptr) { + const std::string filename = search_path + fn; + if (filename.size() < json.size()) { + continue; + } + if (filename.compare(filename.size() - json.size(), json.size(), json) == + 0) { + filenames.push_back(filename); + } + } + } + for (const auto& filename : filenames) { + UniqueAsset asset{ + AAssetManager_open(assetManager, filename.c_str(), AASSET_MODE_BUFFER)}; + if (!asset) { + LoaderLogger::LogWarningMessage( + "", + "ApiLayerManifestFile::AddManifestFilesAndroid unable to open " + "asset " + + filename + ", skipping"); + + continue; + } + size_t length = AAsset_getLength(asset.get()); + const char* buf = + reinterpret_cast<const char*>(AAsset_getBuffer(asset.get())); + if (!buf) { + LoaderLogger::LogWarningMessage( + "", + "ApiLayerManifestFile::AddManifestFilesAndroid unable to access " + "asset" + + filename + ", skipping"); + + continue; + } + std::istringstream json_stream(std::string{buf, length}); + + CreateIfValid(ManifestFileType::MANIFEST_TYPE_EXPLICIT_API_LAYER, filename, + json_stream, &ApiLayerManifestFile::LocateLibraryInAssets, + manifest_files); + } +} +#endif // XR_USE_PLATFORM_ANDROID + +void ApiLayerManifestFile::CreateIfValid( + ManifestFileType type, + const std::string& filename, + std::istream& json_stream, + LibraryLocator locate_library, + std::vector<std::unique_ptr<ApiLayerManifestFile>>& manifest_files) { + std::ostringstream error_ss("ApiLayerManifestFile::CreateIfValid "); + Json::CharReaderBuilder builder; + std::string errors; + Json::Value root_node = Json::nullValue; + if (!Json::parseFromStream(builder, json_stream, &root_node, &errors) || + !root_node.isObject()) { + error_ss << "failed to parse " << filename << "."; + if (!errors.empty()) { + error_ss << " (Error message: " << errors << ")"; + } + error_ss << " Is it a valid layer manifest file?"; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + JsonVersion file_version = {}; + if (!ManifestFile::IsValidJson(root_node, file_version)) { + error_ss << "isValidJson indicates " << filename + << " is not a valid manifest file."; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + + Json::Value layer_root_node = root_node["api_layer"]; + + // The API Layer manifest file needs the "api_layer" root as well as other + // sub-nodes. If any of those aren't there, fail. + if (layer_root_node.isNull() || layer_root_node["name"].isNull() || + !layer_root_node["name"].isString() || + layer_root_node["api_version"].isNull() || + !layer_root_node["api_version"].isString() || + layer_root_node["library_path"].isNull() || + !layer_root_node["library_path"].isString() || + layer_root_node["implementation_version"].isNull() || + !layer_root_node["implementation_version"].isString()) { + error_ss << filename + << " is missing required fields. Verify all proper fields exist."; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + if (MANIFEST_TYPE_IMPLICIT_API_LAYER == type) { + bool enabled = true; + // Implicit layers require the disable environment variable. + if (layer_root_node["disable_environment"].isNull() || + !layer_root_node["disable_environment"].isString()) { + error_ss << "Implicit layer " << filename + << " is missing \"disable_environment\""; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + // Check if there's an enable environment variable provided + if (!layer_root_node["enable_environment"].isNull() && + layer_root_node["enable_environment"].isString()) { + std::string env_var = layer_root_node["enable_environment"].asString(); + // If it's not set in the environment, disable the layer + if (!PlatformUtilsGetEnvSet(env_var.c_str())) { + enabled = false; + } + } + // Check for the disable environment variable, which must be provided in the + // JSON + std::string env_var = layer_root_node["disable_environment"].asString(); + // If the env var is set, disable the layer. Disable env var overrides + // enable above + if (PlatformUtilsGetEnvSet(env_var.c_str())) { + enabled = false; + } + + // Not enabled, so pretend like it isn't even there. + if (!enabled) { + error_ss << "Implicit layer " << filename << " is disabled"; + LoaderLogger::LogInfoMessage("", error_ss.str()); + return; + } + } + std::string layer_name = layer_root_node["name"].asString(); + std::string api_version_string = layer_root_node["api_version"].asString(); + JsonVersion api_version = {}; + const int num_fields = sscanf(api_version_string.c_str(), "%u.%u", + &api_version.major, &api_version.minor); + api_version.patch = 0; + + if ((num_fields != 2) || (api_version.major == 0 && api_version.minor == 0) || + api_version.major > XR_VERSION_MAJOR(XR_CURRENT_API_VERSION)) { + error_ss << "layer " << filename + << " has invalid API Version. Skipping layer."; + LoaderLogger::LogWarningMessage("", error_ss.str()); + return; + } + + uint32_t implementation_version = + atoi(layer_root_node["implementation_version"].asString().c_str()); + std::string library_path = layer_root_node["library_path"].asString(); + + // If the library_path variable has no directory symbol, it's just a file name + // and should be accessible on the global library path. + if (library_path.find('\\') != std::string::npos || + library_path.find('/') != std::string::npos) { + // If the library_path is an absolute path, just use that if it exists + if (FileSysUtilsIsAbsolutePath(library_path)) { + if (!FileSysUtilsPathExists(library_path)) { + error_ss << filename << " library " << library_path + << " does not appear to exist"; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + } else { + // Otherwise, treat the library path as a relative path based on the JSON + // file. + std::string combined_path; + if (!locate_library(filename, library_path, combined_path)) { + error_ss << filename << " library " << combined_path + << " does not appear to exist"; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + library_path = combined_path; + } + } + + std::string description; + if (!layer_root_node["description"].isNull() && + layer_root_node["description"].isString()) { + description = layer_root_node["description"].asString(); + } + + // Add this layer manifest file + manifest_files.emplace_back(new ApiLayerManifestFile( + type, filename, layer_name, description, api_version, + implementation_version, library_path)); + + // Add any extensions to it after the fact. + manifest_files.back()->ParseCommon(layer_root_node); +} + +void ApiLayerManifestFile::CreateIfValid( + ManifestFileType type, + const std::string& filename, + std::vector<std::unique_ptr<ApiLayerManifestFile>>& manifest_files) { + std::ifstream json_stream(filename, std::ifstream::in); + if (!json_stream.is_open()) { + std::ostringstream error_ss("ApiLayerManifestFile::CreateIfValid "); + error_ss << "failed to open " << filename << ". Does it exist?"; + LoaderLogger::LogErrorMessage("", error_ss.str()); + return; + } + CreateIfValid(type, filename, json_stream, + &ApiLayerManifestFile::LocateLibraryRelativeToJson, + manifest_files); +} + +bool ApiLayerManifestFile::LocateLibraryRelativeToJson( + const std::string& json_filename, + const std::string& library_path, + std::string& out_combined_path) { // Otherwise, treat the library path as a + // relative path based on the JSON file. + std::string combined_path; + std::string file_parent; + if (!FileSysUtilsGetParentPath(json_filename, file_parent) || + !FileSysUtilsCombinePaths(file_parent, library_path, combined_path) || + !FileSysUtilsPathExists(combined_path)) { + out_combined_path = combined_path; + return false; + } + out_combined_path = combined_path; + return true; +} + +#ifdef XR_USE_PLATFORM_ANDROID +bool ApiLayerManifestFile::LocateLibraryInAssets( + const std::string& /* json_filename */, + const std::string& library_path, + std::string& out_combined_path) { + std::string combined_path; + std::string file_parent = GetAndroidNativeLibraryDir(); + if (!FileSysUtilsCombinePaths(file_parent, library_path, combined_path) || + !FileSysUtilsPathExists(combined_path)) { + out_combined_path = combined_path; + return false; + } + out_combined_path = combined_path; + return true; +} +#endif + +void ApiLayerManifestFile::PopulateApiLayerProperties( + XrApiLayerProperties& props) const { + props.layerVersion = _implementation_version; + props.specVersion = XR_MAKE_VERSION(_api_version.major, _api_version.minor, + _api_version.patch); + strncpy(props.layerName, _layer_name.c_str(), XR_MAX_API_LAYER_NAME_SIZE - 1); + if (_layer_name.size() >= XR_MAX_API_LAYER_NAME_SIZE - 1) { + props.layerName[XR_MAX_API_LAYER_NAME_SIZE - 1] = '\0'; + } + strncpy(props.description, _description.c_str(), + XR_MAX_API_LAYER_DESCRIPTION_SIZE - 1); + if (_description.size() >= XR_MAX_API_LAYER_DESCRIPTION_SIZE - 1) { + props.description[XR_MAX_API_LAYER_DESCRIPTION_SIZE - 1] = '\0'; + } +} + +// Find all layer manifest files in the appropriate search paths/registries for +// the given type. +XrResult ApiLayerManifestFile::FindManifestFiles( + ManifestFileType type, + std::vector<std::unique_ptr<ApiLayerManifestFile>>& manifest_files) { + std::string relative_path; + std::string override_env_var; + std::string registry_location; + + // Add the appropriate top-level folders for the relative path. These should + // be the string "openxr/" followed by the API major version as a string. + relative_path = OPENXR_RELATIVE_PATH; + relative_path += std::to_string(XR_VERSION_MAJOR(XR_CURRENT_API_VERSION)); + + switch (type) { + case MANIFEST_TYPE_IMPLICIT_API_LAYER: + relative_path += OPENXR_IMPLICIT_API_LAYER_RELATIVE_PATH; + override_env_var = ""; +#ifdef XR_OS_WINDOWS + registry_location = OPENXR_IMPLICIT_API_LAYER_REGISTRY_LOCATION; +#endif + break; + case MANIFEST_TYPE_EXPLICIT_API_LAYER: + relative_path += OPENXR_EXPLICIT_API_LAYER_RELATIVE_PATH; + override_env_var = OPENXR_API_LAYER_PATH_ENV_VAR; +#ifdef XR_OS_WINDOWS + registry_location = OPENXR_EXPLICIT_API_LAYER_REGISTRY_LOCATION; +#endif + break; + default: + LoaderLogger::LogErrorMessage("", + "ApiLayerManifestFile::FindManifestFiles - " + "unknown manifest file requested"); + return XR_ERROR_FILE_ACCESS_ERROR; + } + + bool override_active = false; + std::vector<std::string> filenames; + ReadDataFilesInSearchPaths(override_env_var, relative_path, override_active, + filenames); + +#ifdef XR_OS_WINDOWS + // Read the registry if the override wasn't active. + if (!override_active) { + ReadLayerDataFilesInRegistry(registry_location, filenames); + } +#endif + + for (std::string& cur_file : filenames) { + ApiLayerManifestFile::CreateIfValid(type, cur_file, manifest_files); + } + +#ifdef XR_USE_PLATFORM_ANDROID + ApiLayerManifestFile::AddManifestFilesAndroid(type, manifest_files); +#endif // XR_USE_PLATFORM_ANDROID + + return XR_SUCCESS; +}
diff --git a/third_party/perfetto b/third_party/perfetto index 196f4d5..234fd02 160000 --- a/third_party/perfetto +++ b/third_party/perfetto
@@ -1 +1 @@ -Subproject commit 196f4d514c286377a44fd10762b7e33e81c38e23 +Subproject commit 234fd02711c642ec5211da272283db8fd8d91af4
diff --git a/third_party/skia b/third_party/skia index 510b676..15da9c78 160000 --- a/third_party/skia +++ b/third_party/skia
@@ -1 +1 @@ -Subproject commit 510b6766d90700a4581c2a3b3829c775e4a1c8d3 +Subproject commit 15da9c78ddbd184784fb31cbd6d7230bbe655ea2
diff --git a/third_party/tflite/BUILD.gn b/third_party/tflite/BUILD.gn index 274923a..5b6611f 100644 --- a/third_party/tflite/BUILD.gn +++ b/third_party/tflite/BUILD.gn
@@ -103,7 +103,10 @@ buildflag_header("buildflags") { header = "buildflags.h" - flags = [ "BUILD_TFLITE_WITH_XNNPACK=$build_tflite_with_xnnpack" ] + flags = [ + "BUILD_TFLITE_WITH_NNAPI=$build_tflite_with_nnapi", + "BUILD_TFLITE_WITH_XNNPACK=$build_tflite_with_xnnpack", + ] } static_library("tflite_builtin_op_resolver_internals") { @@ -632,7 +635,6 @@ "src/tensorflow/lite/delegates/interpreter_utils.cc", "src/tensorflow/lite/delegates/interpreter_utils.h", "src/tensorflow/lite/delegates/nnapi/nnapi_delegate.h", - "src/tensorflow/lite/delegates/nnapi/nnapi_delegate_disabled.cc", "src/tensorflow/lite/delegates/utils.cc", "src/tensorflow/lite/delegates/utils.h", "src/tensorflow/lite/experimental/acceleration/mini_benchmark/mini_benchmark.cc", @@ -657,7 +659,6 @@ "src/tensorflow/lite/mutable_op_resolver.cc", "src/tensorflow/lite/nnapi/NeuralNetworksTypes.h", "src/tensorflow/lite/nnapi/nnapi_implementation.h", - "src/tensorflow/lite/nnapi/nnapi_implementation_disabled.cc", "src/tensorflow/lite/optional_debug_tools.cc", "src/tensorflow/lite/profiling/memory_info.cc", "src/tensorflow/lite/profiling/memory_info.h", @@ -699,6 +700,22 @@ "src/third_party/xla/xla/tsl/util/stats_calculator.h", ] + if (build_tflite_with_nnapi) { + sources += [ + "src/tensorflow/lite/delegates/nnapi/nnapi_delegate.cc", + "src/tensorflow/lite/delegates/nnapi/quant_lstm_sup.cc", + "src/tensorflow/lite/delegates/nnapi/quant_lstm_sup.h", + "src/tensorflow/lite/delegates/serialization.cc", + "src/tensorflow/lite/delegates/serialization.h", + "src/tensorflow/lite/nnapi/nnapi_implementation.cc", + ] + } else { + sources += [ + "src/tensorflow/lite/delegates/nnapi/nnapi_delegate_disabled.cc", + "src/tensorflow/lite/nnapi/nnapi_implementation_disabled.cc", + ] + } + if (build_tflite_with_xnnpack) { sources += [ "src/tensorflow/lite/delegates/xnnpack/quantization_util.cc",
diff --git a/third_party/tflite/features.gni b/third_party/tflite/features.gni index 7388742c..6efbfbab 100644 --- a/third_party/tflite/features.gni +++ b/third_party/tflite/features.gni
@@ -14,4 +14,7 @@ # Turns on TFLITE_WITH_RUY, using ruy as the gemm backend instead of gemmlowp. build_tflite_with_ruy = true + + # This enables building TFLite's NNAPI delegate, currently experimental. + build_tflite_with_nnapi = false }
diff --git a/third_party/webrtc b/third_party/webrtc index 0a8703b..caa1201 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit 0a8703b5c117ea8a6bd5eb7fa6d350681126cb20 +Subproject commit caa1201a080044dc9dd71d6c5abaef1d21782e7a
diff --git a/third_party/webrtc_overrides/BUILD.gn b/third_party/webrtc_overrides/BUILD.gn index 8709ef9..28347a5 100644 --- a/third_party/webrtc_overrides/BUILD.gn +++ b/third_party/webrtc_overrides/BUILD.gn
@@ -66,6 +66,7 @@ "//third_party/webrtc/api/units:time_delta", "//third_party/webrtc/api/units:timestamp", "//third_party/webrtc/api/video:recordable_encoded_frame", + "//third_party/webrtc/api/video:resolution", "//third_party/webrtc/api/video:video_bitrate_allocation", "//third_party/webrtc/api/video:video_frame", "//third_party/webrtc/api/video:video_frame_metadata",
diff --git a/tools/clang/scripts/build.py b/tools/clang/scripts/build.py index ef2049b..98176549 100755 --- a/tools/clang/scripts/build.py +++ b/tools/clang/scripts/build.py
@@ -616,6 +616,9 @@ # everywhere, even though we only need it on Linux. 'COMPILER_RT_BUILD_CRT=ON', 'COMPILER_RT_BUILD_LIBFUZZER=OFF', + # Turn off ctx_profile because it depends on the sanitizer libraries, + # which we don't always build. + 'COMPILER_RT_BUILD_CTX_PROFILE=OFF', 'COMPILER_RT_BUILD_MEMPROF=OFF', 'COMPILER_RT_BUILD_ORC=OFF', 'COMPILER_RT_BUILD_PROFILE=' + ('ON' if profile else 'OFF'),
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index f97ed0aa..e141366 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -40958,6 +40958,12 @@ <description>A Legal Notice Tutorial IPH was shown to the user.</description> </action> +<action name="UserEducation.MessageShown.RotatingPromo"> + <owner>dfried@chromium.org</owner> + <owner>frizzle-team@google.com</owner> + <description>An Actionable Alert IPH was shown to the user.</description> +</action> + <action name="UserEducation.MessageShown.Snooze"> <owner>mickeyburks@chromium.org</owner> <owner>frizzle-team@google.com</owner>
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 0703dceb..1f474d6c 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -18133,7 +18133,6 @@ <int value="-1365859601" label="CCTPageInsightsHubBetterScroll:disabled"/> <int value="-1365795470" label="ServiceWorkerImportedScriptUpdateCheck:disabled"/> - <int value="-1365503870" label="enable-simplified-fullscreen-ui"/> <int value="-1364880645" label="OmniboxCr2023Umbrella:disabled"/> <int value="-1364703377" label="AppListDragAndDropRefactor:enabled"/> <int value="-1363709707" label="MaterialDesignHistory:disabled"/> @@ -19018,7 +19017,6 @@ <int value="-979313250" label="enable-google-branded-context-menu"/> <int value="-979057409" label="enable-seccomp-filter-sandbox"/> <int value="-979034258" label="disable-ntp-other-sessions-menu"/> - <int value="-978700508" label="disable-simplified-fullscreen-ui"/> <int value="-978514039" label="SiteSearchSettingsPolicy:disabled"/> <int value="-977770313" label="AndroidSurfaceControl:enabled"/> <int value="-977476498" label="disable-eol-notification"/> @@ -22669,6 +22667,7 @@ <int value="659051425" label="AdaptiveButtonInTopToolbarCustomizationV2:disabled"/> <int value="659086147" label="OverlayScrollbarFlashWhenMouseEnter:enabled"/> + <int value="659775785" label="(Obsolete) disable-simplified-fullscreen-ui"/> <int value="659871291" label="ClearCrossSiteCrossBrowsingContextGroupWindowName:enabled"/> <int value="661020875" label="AutofillSaveCardShowNoThanks:disabled"/> @@ -23706,6 +23705,7 @@ <int value="1117795262" label="BloatedRendererDetection:disabled"/> <int value="1118109174" label="enable-launcher-search-provider-api"/> <int value="1118339487" label="MemoriesDebug:disabled"/> + <int value="1120211655" label="(Obsolete) enable-simplified-fullscreen-ui"/> <int value="1120428727" label="TabGridLayoutAndroid:enabled"/> <int value="1121879933" label="CrosPrivacyHubAppPermissions:enabled"/> <int value="1122217615" label="PasswordGenerationBottomSheet:enabled"/>
diff --git a/tools/metrics/histograms/metadata/ash/enums.xml b/tools/metrics/histograms/metadata/ash/enums.xml index 018c7c2..bba98fb 100644 --- a/tools/metrics/histograms/metadata/ash/enums.xml +++ b/tools/metrics/histograms/metadata/ash/enums.xml
@@ -333,7 +333,7 @@ <int value="17" label="MoveMergedItemsBackToAshCopyDirectoryFailed"/> </enum> -<enum name="CalendarEventFetchApiError"> +<enum name="CalendarDataFetchApiError"> <int value="200" label="HTTP_SUCCESS"/> <int value="201" label="HTTP_CREATED"/> <int value="204" label="HTTP_NO_CONTENT"/>
diff --git a/tools/metrics/histograms/metadata/ash/histograms.xml b/tools/metrics/histograms/metadata/ash/histograms.xml index 3dc6a4cd..61c7b1ed 100644 --- a/tools/metrics/histograms/metadata/ash/histograms.xml +++ b/tools/metrics/histograms/metadata/ash/histograms.xml
@@ -202,6 +202,11 @@ install should be very quick and always succeed."/> </variants> +<variants name="CalendarDataTypes"> + <variant name="Calendar"/> + <variant name="Event"/> +</variants> + <variants name="DisplayModes"> <!-- Should be kept in sync with variants AppDisplayModes in tools/metrics/histograms/metadata/apps/histograms.xml. @@ -1500,19 +1505,18 @@ </summary> </histogram> -<histogram name="Ash.Calendar.FetchEvents.FetchDuration" units="ms" - expires_after="2024-09-04"> - <owner>rtinkoff@google.com</owner> +<histogram name="Ash.Calendar.FetchCalendars.TotalSelectedCalendars" + units="int" expires_after="2024-09-04"> <owner>jiamingc@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> - Recorded when a calendar fetch returns. The duration of the fetch request. + Recorded when a fetched calendar list is filtered for selected calendars. + Records the number of calendars in the response that are selected. </summary> </histogram> <histogram name="Ash.Calendar.FetchEvents.PreFetched" units="fetches" expires_after="2024-09-04"> - <owner>rtinkoff@google.com</owner> <owner>jiamingc@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -1521,42 +1525,18 @@ </summary> </histogram> -<histogram name="Ash.Calendar.FetchEvents.Result" - enum="CalendarEventFetchApiError" expires_after="2024-09-04"> - <owner>rtinkoff@google.com</owner> - <owner>jiamingc@google.com</owner> - <owner>cros-status-area-eng@google.com</owner> - <summary> - Recorded whenever calendar events are fetched. The recorded enum value - indicates the return code of the fetch request. - </summary> -</histogram> - <histogram name="Ash.Calendar.FetchEvents.SingleMonthSize" units="bytes" expires_after="2024-09-04"> - <owner>rtinkoff@google.com</owner> <owner>jiamingc@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> - Recorded when a calendar fetch returns. The total size of the month's - events. - </summary> -</histogram> - -<histogram name="Ash.Calendar.FetchEvents.Timeout" enum="Boolean" - expires_after="2024-09-04"> - <owner>rtinkoff@google.com</owner> - <owner>jiamingc@google.com</owner> - <owner>cros-status-area-eng@google.com</owner> - <summary> - Recorded whenever calendar events are requested, and the request went too - long without a response. + Recorded when there are no outstanding calendar event fetches for a month. + The total size of the month's events. </summary> </histogram> <histogram name="Ash.Calendar.FetchEvents.TotalCacheSizeMonths" units="months" expires_after="2024-09-04"> - <owner>rtinkoff@google.com</owner> <owner>jiamingc@google.com</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -1565,6 +1545,50 @@ </summary> </histogram> +<histogram name="Ash.Calendar.FetchEvents.TotalFetchDuration" units="ms" + expires_after="2024-09-04"> + <owner>jiamingc@google.com</owner> + <owner>cros-status-area-eng@google.com</owner> + <summary> + Recorded when the final calendar event fetch for a month returns and Multi- + Calendar is enabled. Records the time elapsed from the first fetch that is + started to the last fetch that is completed. + </summary> +</histogram> + +<histogram name="Ash.Calendar.Fetch{DataType}s.FetchDuration" units="ms" + expires_after="2024-09-04"> + <owner>jiamingc@google.com</owner> + <owner>cros-status-area-eng@google.com</owner> + <summary> + Recorded when the {DataType} fetch returns. The duration of the fetch + request. + </summary> + <token key="DataType" variants="CalendarDataTypes"/> +</histogram> + +<histogram name="Ash.Calendar.Fetch{DataType}s.Result" + enum="CalendarDataFetchApiError" expires_after="2024-09-04"> + <owner>jiamingc@google.com</owner> + <owner>cros-status-area-eng@google.com</owner> + <summary> + Recorded when the {DataType} fetch returns. The recorded enum value + indicates the return code of the fetch request. + </summary> + <token key="DataType" variants="CalendarDataTypes"/> +</histogram> + +<histogram name="Ash.Calendar.Fetch{DataType}s.Timeout" enum="Boolean" + expires_after="2024-09-04"> + <owner>jiamingc@google.com</owner> + <owner>cros-status-area-eng@google.com</owner> + <summary> + Recorded when {DataType}s are requested and the request goes too long + without a response. + </summary> + <token key="DataType" variants="CalendarDataTypes"/> +</histogram> + <histogram name="Ash.Calendar.MaxDistanceBrowsed" units="months" expires_after="2024-09-04"> <owner>newcomer@chromium.org</owner> @@ -1622,6 +1646,18 @@ </summary> </histogram> +<histogram name="Ash.Calendar.TimeToSeeTodaysEventDotsForMultiCalendar" + units="ms" expires_after="2024-09-04"> + <owner>newcomer@google.com</owner> + <owner>cros-status-area-eng@google.com</owner> + <summary> + Measures the time from open of CalendarView, to CalendarDateCellView + representing today receives events when Multi-Calendar is enabled. Recorded + once per lifetime of CalendarViewController (once per show), when todays + CalendarDateCellView receives event data. + </summary> +</histogram> + <histogram name="Ash.Calendar.UpNextView.EventDisplayedCount" units="int" expires_after="2024-09-04"> <owner>newcomer@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/blink/histograms.xml b/tools/metrics/histograms/metadata/blink/histograms.xml index 0df26cb..dfbedbb 100644 --- a/tools/metrics/histograms/metadata/blink/histograms.xml +++ b/tools/metrics/histograms/metadata/blink/histograms.xml
@@ -2873,7 +2873,7 @@ </histogram> <histogram name="Blink.LCPP.FontFetch.{Condition}.ConnectionType" - enum="NetworkConnectionType" expires_after="2024-06-01"> + enum="NetworkConnectionType" expires_after="2024-10-01"> <owner>yyanagisawa@chromium.org</owner> <owner> src/third_party/blink/renderer/core/lcp_critical_path_predictor/OWNERS @@ -3113,7 +3113,7 @@ </histogram> <histogram name="Blink.LCPP.RecordedFontUrlMatchCount" units="count" - expires_after="2024-06-01"> + expires_after="2024-10-01"> <owner>yyanagisawa@chromium.org</owner> <owner> src/third_party/blink/renderer/core/lcp_critical_path_predictor/OWNERS @@ -3241,7 +3241,7 @@ </histogram> <histogram name="Blink.LCPP.ReportedFontCount" units="count" - expires_after="2024-06-01"> + expires_after="2024-10-01"> <owner>yyanagisawa@chromium.org</owner> <owner> src/third_party/blink/renderer/core/lcp_critical_path_predictor/OWNERS
diff --git a/tools/metrics/histograms/metadata/bluetooth/histograms.xml b/tools/metrics/histograms/metadata/bluetooth/histograms.xml index f1185d02..2c5b30e6 100644 --- a/tools/metrics/histograms/metadata/bluetooth/histograms.xml +++ b/tools/metrics/histograms/metadata/bluetooth/histograms.xml
@@ -155,7 +155,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.AccountKey.Failure.{FastPairPairingProtocol}" - enum="FastPairAccountKeyFailure" expires_after="2024-06-28"> + enum="FastPairAccountKeyFailure" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -174,7 +174,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.AccountKey.Write.GattErrorReason" - enum="BluetoothDeviceConnectErrorCode" expires_after="2024-06-14"> + enum="BluetoothDeviceConnectErrorCode" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -188,7 +188,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.AccountKey.Write.Result.{FastPairPairingProtocol}" - enum="BooleanSuccess" expires_after="2024-09-01"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -208,7 +208,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.AccountKey.Write.Result.{FastPairPairingProtocol}.{FastPairTrackedModelID}" - enum="BooleanSuccess" expires_after="2024-06-28"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -321,7 +321,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.AccountKey.Write.TotalTime" - units="ms" expires_after="2024-06-28"> + units="ms" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -337,7 +337,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.ConfirmPasskey.Latency" units="ms" - expires_after="2024-06-28"> + expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -350,7 +350,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.ConnectDevice.Result" - enum="BooleanSuccess" expires_after="2024-10-06"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -365,7 +365,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.CreateScanFilter.Result" - enum="BooleanSuccess" expires_after="2024-09-01"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -379,7 +379,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.DeviceMetadataFetcher.Get.HttpResponseError" - enum="HttpResponseCode" expires_after="2024-06-28"> + enum="HttpResponseCode" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -392,7 +392,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.DeviceMetadataFetcher.Get.NetError" - enum="NetErrorCodes" expires_after="2024-06-30"> + enum="NetErrorCodes" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -404,7 +404,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.DeviceMetadataFetcher.Result" - enum="BooleanSuccess" expires_after="2024-08-04"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -416,7 +416,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.Discovered.Version" - enum="FastPairVersion" expires_after="2024-08-04"> + enum="FastPairVersion" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -429,7 +429,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.EngagementFunnel.Steps.{FastPairPairingProtocol}" - enum="FastPairEngagementFlowEvent" expires_after="2024-09-01"> + enum="FastPairEngagementFlowEvent" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -449,7 +449,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.EngagementFunnel.Steps.{FastPairPairingProtocol}.{FastPairDeviceType}.{FastPairNotificationType}" - enum="FastPairEngagementFlowEvent" expires_after="2024-06-28"> + enum="FastPairEngagementFlowEvent" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -490,7 +490,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.EngagementFunnel.Steps.{FastPairPairingProtocol}.{FastPairTrackedModelID}" - enum="FastPairEngagementFlowEvent" expires_after="2024-09-01"> + enum="FastPairEngagementFlowEvent" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -603,7 +603,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.FastPairDataEncryptor.CreateResult" - enum="BooleanSuccess" expires_after="2024-06-28"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -619,7 +619,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.FastPairDataEncryptor.CreateTime" - units="ms" expires_after="2024-06-28"> + units="ms" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -640,7 +640,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.FastPairRepository.Cache.Result" - enum="Boolean" expires_after="2024-06-28"> + enum="Boolean" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -654,7 +654,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.FootprintsFetcher.Delete.Result" - enum="BooleanSuccess" expires_after="2024-10-06"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -668,7 +668,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.FootprintsFetcher.Get.Result" - enum="BooleanSuccess" expires_after="2024-10-06"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -682,7 +682,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.FootprintsFetcher.Post.Result" - enum="BooleanSuccess" expires_after="2024-08-04"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -697,7 +697,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.FootprintsFetcher.{Method}.HttpResponseError" - enum="HttpResponseCode" expires_after="2024-06-30"> + enum="HttpResponseCode" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -716,7 +716,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.FootprintsFetcher.{Method}.NetError" - enum="NetErrorCodes" expires_after="2024-06-30"> + enum="NetErrorCodes" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -734,7 +734,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.GattConnection.AttemptCount" - units="count" expires_after="2024-09-01"> + units="count" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -748,7 +748,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.GattConnection.EffectiveSuccessRate" - enum="BooleanSuccess" expires_after="2024-10-06"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -761,7 +761,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.GattConnection.ErrorReason" - enum="BluetoothDeviceConnectErrorCode" expires_after="2024-09-01"> + enum="BluetoothDeviceConnectErrorCode" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -774,7 +774,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.GattConnection.Result" - enum="BooleanSuccess" expires_after="2024-09-01"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -787,7 +787,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.GattConnection.RetryFailureReason" - enum="FastPairPairFailure" expires_after="2024-06-28"> + enum="FastPairPairFailure" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -800,7 +800,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.Handshake.FailureReason" - enum="FastPairHandshakeFailureReason" expires_after="2024-06-30"> + enum="FastPairHandshakeFailureReason" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -813,7 +813,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.Handshake.Result" - enum="BooleanSuccess" expires_after="2024-06-30"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -829,7 +829,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.Handshake.Steps.{FastPairPairingProtocol}" - enum="FastPairHandshakeSteps" expires_after="2024-06-30"> + enum="FastPairHandshakeSteps" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -853,7 +853,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.KeyBasedPairing.DecryptResult" - enum="BooleanSuccess" expires_after="2024-06-28"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -866,7 +866,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.KeyBasedPairing.DecryptTime" - units="ms" expires_after="2024-06-28"> + units="ms" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -880,7 +880,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.KeyBasedPairing.NotifyTime" - units="ms" expires_after="2024-06-28"> + units="ms" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -896,7 +896,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.KeyBasedPairing.Write.GattErrorReason" - enum="BluetoothGattServiceGattErrorCode" expires_after="2024-06-28"> + enum="BluetoothGattServiceGattErrorCode" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -909,7 +909,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.KeyBasedPairing.Write.PairFailure" - enum="FastPairPairFailure" expires_after="2024-06-28"> + enum="FastPairPairFailure" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -923,7 +923,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.KeyBasedPairing.Write.Result" - enum="BooleanSuccess" expires_after="2024-08-04"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -936,7 +936,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.KeyGenerationResult" - enum="BooleanSuccess" expires_after="2024-06-28"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -950,7 +950,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.MessageStream.ConnectToService.ErrorReason" - enum="BluetoothSocketErrorReason" expires_after="2024-06-14"> + enum="BluetoothSocketErrorReason" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -965,7 +965,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.MessageStream.ConnectToService.Result" - enum="BooleanSuccess" expires_after="2024-09-22"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -979,7 +979,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.MessageStream.ConnectToService.TotalConnectTime" - units="ms" expires_after="2024-06-28"> + units="ms" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -992,7 +992,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.MessageStream.Receive.ErrorReason" - enum="BluetoothConnectToServiceError" expires_after="2024-06-14"> + enum="BluetoothConnectToServiceError" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1006,7 +1006,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.MessageStream.Receive.Result" - enum="BooleanSuccess" expires_after="2024-06-14"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1020,7 +1020,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.NavigateToSettings.Result" - enum="BooleanSuccess" expires_after="2024-06-28"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1048,7 +1048,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.PairDevice.Result" - enum="BooleanSuccess" expires_after="2024-09-22"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1063,7 +1063,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.PairFailure.{FastPairPairingProtocol}" - enum="FastPairPairFailure" expires_after="2024-06-30"> + enum="FastPairPairFailure" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1084,7 +1084,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.Pairing.Result.{FastPairPairingProtocol}" - enum="BooleanSuccess" expires_after="2024-09-01"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1105,7 +1105,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.PairingMethod" - enum="FastPairPairingMethod" expires_after="2024-05-19"> + enum="FastPairPairingMethod" expires_after="2024-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1121,7 +1121,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.PairRetry.Count" units="count" - expires_after="2024-06-28"> + expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1135,7 +1135,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.Passkey.Decrypt.Result" - enum="BooleanSuccess" expires_after="2024-06-28"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1148,7 +1148,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.Passkey.Decrypt.Time" units="ms" - expires_after="2024-06-28"> + expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1161,7 +1161,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.Passkey.NotifyTime" units="ms" - expires_after="2024-06-28"> + expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1176,7 +1176,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.Passkey.Write.GattErrorReason" - enum="GattErrorCode" expires_after="2024-06-28"> + enum="GattErrorCode" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1189,7 +1189,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.Passkey.Write.PairFailure" - enum="FastPairPairFailure" expires_after="2024-06-28"> + enum="FastPairPairFailure" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1202,7 +1202,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.Passkey.Write.Result" - enum="BooleanSuccess" expires_after="2024-08-04"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1215,7 +1215,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.RequestPasskey.Latency" units="ms" - expires_after="2024-06-28"> + expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1231,7 +1231,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.RetroactiveEngagementFunnel.Steps" - enum="FastPairRetroactiveEngagementFlowEvent" expires_after="2024-09-01"> + enum="FastPairRetroactiveEngagementFlowEvent" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1247,7 +1247,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.RetroactiveEngagementFunnel.Steps.{FastPairDeviceType}.{FastPairNotificationType}" - enum="FastPairRetroactiveEngagementFlowEvent" expires_after="2024-06-28"> + enum="FastPairRetroactiveEngagementFlowEvent" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1283,7 +1283,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.RetroactiveEngagementFunnel.Steps.{FastPairTrackedModelID}" - enum="FastPairRetroactiveEngagementFlowEvent" expires_after="2024-06-28"> + enum="FastPairRetroactiveEngagementFlowEvent" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1390,7 +1390,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.RetroactivePairing.Result" - enum="BooleanSuccess" expires_after="2024-09-22"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1403,7 +1403,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.SavedDevices.DeviceCount" - units="devices" expires_after="2024-10-06"> + units="devices" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1417,7 +1417,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.SavedDevices.GetSavedDevices.Result" - enum="BooleanSuccess" expires_after="2024-10-13"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1431,7 +1431,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.SavedDevices.Remove.Result" - enum="BooleanSuccess" expires_after="2024-10-13"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1445,7 +1445,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.SavedDevices.TotalUxLoadTime" - units="ms" expires_after="2024-10-13"> + units="ms" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1465,7 +1465,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.SavedDevices.UiEvent" - enum="FastPairSavedDevicesUiEvent" expires_after="2024-10-13"> + enum="FastPairSavedDevicesUiEvent" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1479,7 +1479,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.SavedDevices.UpdateOptInStatus.Result.{FastPairPairingProtocol}" - enum="BooleanSuccess" expires_after="2024-06-28"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1508,7 +1508,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.Scanner.StartSession.Result" - enum="BooleanSuccess" expires_after="2024-10-06"> + enum="BooleanSuccess" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1521,7 +1521,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.FastPair.TotalGattConnectionTime" - units="ms" expires_after="2024-10-06"> + units="ms" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -1537,7 +1537,7 @@ <histogram name="Bluetooth.ChromeOS.FastPair.TotalUxPairTime.{FastPairPairingProtocol}2" - units="ms" expires_after="2024-09-01"> + units="ms" expires_after="2025-06-28"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/chromeos/histograms.xml b/tools/metrics/histograms/metadata/chromeos/histograms.xml index d0918e2..ed10899 100644 --- a/tools/metrics/histograms/metadata/chromeos/histograms.xml +++ b/tools/metrics/histograms/metadata/chromeos/histograms.xml
@@ -1898,6 +1898,21 @@ </summary> </histogram> +<histogram name="ChromeOS.Inputs.Mouse.InvalidRegistration.{DeviceType}" + units="Vkey" expires_after="2024-08-04"> + <owner>wangdanny@google.com</owner> + <owner>dpad@google.com</owner> + <owner>cros-peripherals@google.com</owner> + <summary> + Records everytime if the mouse which tries the invalid registration is + recognized as a {DeviceType}. + </summary> + <token key="DeviceType"> + <variant name="Combo"/> + <variant name="NonCombo"/> + </token> +</histogram> + <histogram name="ChromeOS.Inputs.Stylus.BatteryReportingEligibility" enum="BatteryReportingEligibility" expires_after="2025-03-15"> <owner>wmahon@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/extensions/histograms.xml b/tools/metrics/histograms/metadata/extensions/histograms.xml index 52e9e3d..7d80f11 100644 --- a/tools/metrics/histograms/metadata/extensions/histograms.xml +++ b/tools/metrics/histograms/metadata/extensions/histograms.xml
@@ -873,9 +873,9 @@ </histogram> <histogram name="Extensions.DeclarativeNetRequest.ManifestEnabledRulesCount2" - units="rules" expires_after="2024-04-28"> + units="rules" expires_after="2025-04-28"> <owner>kelvinjiang@chromium.org</owner> - <owner>src/extensions/OWNERS</owner> + <owner>extensions-core@chromium.org</owner> <summary> The number of enabled indexed declarative rules provided by an extension manifest for the Declarative Net Request API. This is emitted whenever a @@ -884,9 +884,9 @@ </histogram> <histogram name="Extensions.DeclarativeNetRequest.ReadDynamicRulesJSONStatus" - enum="ReadDynamicRulesJSONStatus" expires_after="2024-06-01"> - <owner>rdevlin.cronin@chromium.org</owner> - <owner>src/extensions/OWNERS</owner> + enum="ReadDynamicRulesJSONStatus" expires_after="2025-06-01"> + <owner>kelvinjiang@chromium.org</owner> + <owner>extensions-core@chromium.org</owner> <summary> Indicates the result of reading the dynamic JSON rules for an extension from the disk. Logged whenever an extension calls the getDynamicRules extension @@ -957,9 +957,9 @@ </histogram> <histogram name="Extensions.DeclarativeNetRequest.RegexRuleSize" units="bytes" - expires_after="2024-06-01"> + expires_after="2025-06-01"> <owner>kelvinjiang@chromium.org</owner> - <owner>src/extensions/OWNERS</owner> + <owner>extensions-core@chromium.org</owner> <summary> Logs the size of a regex rule in bytes, including rules that exceed the per-rule memory limit that aren't indexed. Note that any rules above 100Kb
diff --git a/tools/metrics/histograms/metadata/media/histograms.xml b/tools/metrics/histograms/metadata/media/histograms.xml index 347b91f..8610c3a6 100644 --- a/tools/metrics/histograms/metadata/media/histograms.xml +++ b/tools/metrics/histograms/metadata/media/histograms.xml
@@ -129,7 +129,7 @@ </variants> <histogram name="CastStreaming.Sender.Audio.NegotiatedCodec" enum="AudioCodec" - expires_after="2024-04-07"> + expires_after="2025-04-24"> <owner>jophba@chromium.org</owner> <owner>mfoltz@chromium.org</owner> <summary> @@ -138,7 +138,7 @@ </histogram> <histogram name="CastStreaming.Sender.Video.Bitrate" units="kbps" - expires_after="2024-09-01"> + expires_after="2025-04-24"> <owner>jophba@chromium.org</owner> <owner>mfoltz@chromium.org</owner> <summary> @@ -148,7 +148,7 @@ </histogram> <histogram name="CastStreaming.Sender.Video.NegotiatedCodec" enum="VideoCodec" - expires_after="2024-10-20"> + expires_after="2025-04-24"> <owner>jophba@chromium.org</owner> <owner>mfoltz@chromium.org</owner> <summary> @@ -158,7 +158,7 @@ <histogram name="CastStreaming.Sender.{CastStreamingSenderAudioVideo}.AverageCaptureLatency" - units="ms" expires_after="2024-09-01"> + units="ms" expires_after="2025-04-24"> <owner>anasr@google.com</owner> <owner>bzielinski@google.com</owner> <owner>jophba@chromium.org</owner> @@ -175,7 +175,7 @@ <histogram name="CastStreaming.Sender.{CastStreamingSenderAudioVideo}.AverageEncodeTime" - units="ms" expires_after="2024-09-01"> + units="ms" expires_after="2025-04-24"> <owner>anasr@google.com</owner> <owner>bzielinski@google.com</owner> <owner>jophba@chromium.org</owner> @@ -192,7 +192,7 @@ <histogram name="CastStreaming.Sender.{CastStreamingSenderAudioVideo}.AverageEndToEndLatency" - units="ms" expires_after="2024-09-01"> + units="ms" expires_after="2025-04-24"> <owner>anasr@google.com</owner> <owner>bzielinski@google.com</owner> <owner>jophba@chromium.org</owner> @@ -210,7 +210,7 @@ <histogram name="CastStreaming.Sender.{CastStreamingSenderAudioVideo}.AverageNetworkLatency" - units="ms" expires_after="2024-09-01"> + units="ms" expires_after="2025-04-24"> <owner>anasr@google.com</owner> <owner>bzielinski@google.com</owner> <owner>jophba@chromium.org</owner> @@ -227,7 +227,7 @@ <histogram name="CastStreaming.Sender.{CastStreamingSenderAudioVideo}.ExceededPlayoutDelayPacketsPercentage" - units="%" expires_after="2024-09-01"> + units="%" expires_after="2025-04-24"> <owner>anasr@google.com</owner> <owner>bzielinski@google.com</owner> <owner>jophba@chromium.org</owner> @@ -244,7 +244,7 @@ <histogram name="CastStreaming.Sender.{CastStreamingSenderAudioVideo}.LateFramesPercentage" - units="%" expires_after="2024-09-01"> + units="%" expires_after="2025-04-24"> <owner>anasr@google.com</owner> <owner>bzielinski@google.com</owner> <owner>jophba@chromium.org</owner> @@ -262,7 +262,7 @@ <histogram name="CastStreaming.Sender.{CastStreamingSenderAudioVideo}.RetransmittedPacketsPercentage" - units="%" expires_after="2024-09-01"> + units="%" expires_after="2025-04-24"> <owner>anasr@google.com</owner> <owner>bzielinski@google.com</owner> <owner>jophba@chromium.org</owner> @@ -279,7 +279,7 @@ <histogram name="CastStreaming.Sender.{CastStreamingSenderAudioVideo}.TransmissionRate" - units="kbps" expires_after="2024-09-01"> + units="kbps" expires_after="2025-04-24"> <owner>anasr@google.com</owner> <owner>bzielinski@google.com</owner> <owner>jophba@chromium.org</owner> @@ -295,7 +295,7 @@ </histogram> <histogram name="CastStreaming.Sender.{CastStreamingSender}.FrameDropped" - enum="CastStreamingFrameDropReason" expires_after="2024-09-01"> + enum="CastStreamingFrameDropReason" expires_after="2025-04-24"> <owner>jophba@chromium.org</owner> <owner>mfoltz@chromium.org</owner> <summary> @@ -306,7 +306,7 @@ <histogram name="CastStreaming.Sender.{CastStreamingSender}.PercentDroppedFrames" - units="%" expires_after="2024-09-01"> + units="%" expires_after="2025-04-24"> <owner>jophba@chromium.org</owner> <owner>mfoltz@chromium.org</owner> <summary> @@ -5783,7 +5783,7 @@ </histogram> <histogram name="Media.VideoCapture.AspectRatio" units="%" - expires_after="2024-05-05"> + expires_after="2025-04-24"> <owner>mcasas@chromium.org</owner> <owner>jophba@chromium.org</owner> <summary> @@ -6013,7 +6013,7 @@ </histogram> <histogram name="Media.VideoCapture.ScaleOverride" units="units" - expires_after="2024-05-05"> + expires_after="2025-04-24"> <owner>jophba@chromium.org</owner> <owner>klausw@chromium.org</owner> <summary> @@ -6025,7 +6025,7 @@ </histogram> <histogram name="Media.VideoCapture.ScaleOverrideChangeCount" units="units" - expires_after="2024-07-07"> + expires_after="2025-04-24"> <owner>jophba@chromium.org</owner> <owner>klausw@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/net/enums.xml b/tools/metrics/histograms/metadata/net/enums.xml index 647da03..55780a6 100644 --- a/tools/metrics/histograms/metadata/net/enums.xml +++ b/tools/metrics/histograms/metadata/net/enums.xml
@@ -70,11 +70,6 @@ <int value="4" label="Not QUIC, destination different from origin"/> </enum> -<enum name="BodyConsumerBaseFetchCheckPoint"> - <int value="0" label="BodyConsumerBase Constructor"/> - <int value="1" label="BodyConsumerBase::DidFetchDataLoadFailed"/> -</enum> - <enum name="BooleanBroken"> <int value="0" label="Not Broken"/> <int value="1" label="Broken"/> @@ -375,11 +370,6 @@ <int value="15" label="Not-ECT, ECT(1), ECT(0), CE"/> </enum> -<enum name="FetchManagerLoaderCheckPoint"> - <int value="0" label="FetchManager::Loader Constructor"/> - <int value="1" label="FetchManager::Loader::Failed"/> -</enum> - <enum name="Http2WireErrorCodes"> <summary> Error codes defined at
diff --git a/tools/metrics/histograms/metadata/net/histograms.xml b/tools/metrics/histograms/metadata/net/histograms.xml index e5bbb046..8b48b0f 100644 --- a/tools/metrics/histograms/metadata/net/histograms.xml +++ b/tools/metrics/histograms/metadata/net/histograms.xml
@@ -1730,26 +1730,6 @@ </summary> </histogram> -<histogram name="Net.Fetch.CheckPoint.BodyConsumerBase" - enum="BodyConsumerBaseFetchCheckPoint" expires_after="2024-06-01"> - <owner>yyanagisawa@chromium.org</owner> - <owner>chrome-loading@google.com</owner> - <summary> - Records check points in the `BodyConsumerBase` class have been executed. - This metrics is for investigating crbug.com/1431885. - </summary> -</histogram> - -<histogram name="Net.Fetch.CheckPoint.FetchManagerLoader" - enum="FetchManagerLoaderCheckPoint" expires_after="2024-10-06"> - <owner>yyanagisawa@chromium.org</owner> - <owner>chrome-loading@google.com</owner> - <summary> - Records check points in the `FetchManager::Loader` class have been executed. - This metrics is for investigating crbug.com/1431885. - </summary> -</histogram> - <histogram name="Net.HttpAuthCount" enum="HttpAuthCount" expires_after="2024-09-22"> <owner>mpdenton@chromium.org</owner> @@ -5130,8 +5110,8 @@ </histogram> <histogram name="Net.SpdyFrameStreamAndSessionFlowControlState" - enum="SpdyFrameFlowControlState" expires_after="2024-04-03"> - <owner>dschinazi@chromium.org</owner> + enum="SpdyFrameFlowControlState" expires_after="2025-04-24"> + <owner>bashi@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> The counts of the flow control state of each frame (with stream and session @@ -5140,17 +5120,20 @@ </histogram> <histogram name="Net.SpdyHeadersCompressionPercentage" units="%" - expires_after="2024-03-17"> - <owner>dschinazi@chromium.org</owner> + expires_after="2025-04-24"> + <owner>bashi@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> The percent compression achieved when compressing HEADERS frames. + + Warning: this histogram was expired from 2024-03-17 to 2024-04-24; data may + be missing. </summary> </histogram> <histogram name="Net.SpdyIPPoolDomainMatch" enum="SpdyIPPoolDomainMatch" - expires_after="2024-04-03"> - <owner>dschinazi@chromium.org</owner> + expires_after="2025-04-24"> + <owner>bashi@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> Status of checking if a SPDY domain can handle a IP match. If a match is @@ -5230,15 +5213,15 @@ </histogram> <histogram name="Net.SpdySession.ClosedOnError" enum="NetErrorCodes" - expires_after="2024-04-28"> - <owner>dschinazi@chromium.org</owner> + expires_after="2025-04-24"> + <owner>bashi@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary>Net error codes when SpdySession was closed.</summary> </histogram> <histogram name="Net.SpdySession.CreateStreamWithSocketConnected" - enum="BooleanSuccess" expires_after="2024-04-03"> - <owner>dschinazi@chromium.org</owner> + enum="BooleanSuccess" expires_after="2025-04-24"> + <owner>bashi@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary>Socket connected status in SpdySession::CreateStream.</summary> </histogram> @@ -5294,8 +5277,8 @@ </histogram> <histogram name="Net.SpdySessionErrorDetails_Google2" - enum="SpdyProtocolErrorDetails2" expires_after="2024-04-03"> - <owner>dschinazi@chromium.org</owner> + enum="SpdyProtocolErrorDetails2" expires_after="2025-04-24"> + <owner>bashi@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary> WARNING: r181910 added an enum value in the middle, so don't trust the
diff --git a/tools/metrics/histograms/metadata/network/enums.xml b/tools/metrics/histograms/metadata/network/enums.xml index f6f7287..9d0c322 100644 --- a/tools/metrics/histograms/metadata/network/enums.xml +++ b/tools/metrics/histograms/metadata/network/enums.xml
@@ -1099,7 +1099,7 @@ <enum name="NetworkPortalStatus"> <summary> - The portal status types from NetworkPortalDetector::CaptivePortalStatus + DEPRECATED. Remove with Network.NetworkPortalDetectorResult 2024-07-21. </summary> <int value="0" label="Unknown"/> <int value="1" label="Offline"/>
diff --git a/tools/metrics/histograms/metadata/network/histograms.xml b/tools/metrics/histograms/metadata/network/histograms.xml index 78326da7..ff0c53c 100644 --- a/tools/metrics/histograms/metadata/network/histograms.xml +++ b/tools/metrics/histograms/metadata/network/histograms.xml
@@ -847,14 +847,10 @@ </histogram> <histogram name="Network.CaptivePortalResult" enum="CaptivePortalNetworkState" - expires_after="2024-09-22"> + expires_after="2024-05-14"> <owner>stevenjb@chromium.org</owner> <owner>cros-network-health-team@google.com</owner> - <summary> - Captive portal detection state from Shill received by NetworkState. NOTE: - This metric used to be CaptivePortal.NetworkPortalDetectorResult which was - expired from 2021-04-01 to 2022-09-18. - </summary> + <summary>DEPRECATED: This metric is is invalid starting with M125.</summary> </histogram> <histogram name="Network.CaptivePortalStatusCode" enum="HttpResponseCode" @@ -2059,14 +2055,10 @@ </histogram> <histogram name="Network.NetworkPortalDetectorResult" - enum="NetworkPortalStatus" expires_after="2024-09-22"> + enum="NetworkPortalStatus" expires_after="2024-05-14"> <owner>stevenjb@chromium.org</owner> <owner>cros-network-health-team@google.com</owner> - <summary> - Chrome captive portal detection results on ChromeOS. NOTE: This metric used - to be CaptivePortal.NetworkPortalDetectorResult which was expired from - 2021-09-27 to 2022-09-18. - </summary> + <summary>DEPRECATED: This metric is is invalid starting with M125.</summary> </histogram> <histogram name="Network.NetworkPortalDetectorRunCount" units="attempts"
diff --git a/tools/metrics/histograms/metadata/optimization/enums.xml b/tools/metrics/histograms/metadata/optimization/enums.xml index 98f1f34..6420ffee 100644 --- a/tools/metrics/histograms/metadata/optimization/enums.xml +++ b/tools/metrics/histograms/metadata/optimization/enums.xml
@@ -238,8 +238,9 @@ <int value="3" label="Net Error"> Upload was not successful because of network error. </int> - <int value="4" label="No User Metrics Consent"> - Upload was not allowed due to user metrics consent. + <int value="4" label="Metrics reporting disabled"> + Upload was not allowed due to metrics reporting being disabled in + chrome://settings. </int> <int value="5" label="Disabled due to Enterprise Policy"> Upload was disabled due to enterprise policy.
diff --git a/tools/metrics/histograms/metadata/platform/histograms.xml b/tools/metrics/histograms/metadata/platform/histograms.xml index 58b2792..f0d8617 100644 --- a/tools/metrics/histograms/metadata/platform/histograms.xml +++ b/tools/metrics/histograms/metadata/platform/histograms.xml
@@ -22,6 +22,12 @@ <histograms> +<variants name="ChromePressureLevel"> + <variant name="Critical" summary="Critical"/> + <variant name="Moderate" summary="Moderate"/> + <variant name="None" summary="None"/> +</variants> + <variants name="PartitionTypes"> <variant name="EncStateful"/> <variant name="Stateful"/> @@ -1536,8 +1542,8 @@ </summary> </histogram> -<histogram name="Platform.Resourced.VmmsReclaimMemoryDuration" units="ms" - expires_after="2024-08-23"> +<histogram name="Platform.Resourced.VmmsReclaimMemoryDuration.{PressureLevel}" + units="ms" expires_after="2024-08-23"> <owner>vovoy@chromium.org</owner> <owner>chromeos-memory@google.com</owner> <summary> @@ -1546,6 +1552,7 @@ request to the VM Memory Management Service to try to resolve memory pressure in the host. </summary> + <token key="PressureLevel" variants="ChromePressureLevel"/> </histogram> <histogram name="Platform.RksAgent.CertificateFetchResult"
diff --git a/tools/metrics/histograms/metadata/safe_browsing/histograms.xml b/tools/metrics/histograms/metadata/safe_browsing/histograms.xml index 236b6f8..d3ba45a 100644 --- a/tools/metrics/histograms/metadata/safe_browsing/histograms.xml +++ b/tools/metrics/histograms/metadata/safe_browsing/histograms.xml
@@ -1710,19 +1710,6 @@ </token> </histogram> -<histogram name="SafeBrowsing.HPRT.WouldBeIneligibleForSessionOrLatestCountry" - enum="BooleanIneligible" expires_after="2024-09-19"> - <owner>thefrog@chromium.org</owner> - <owner>chrome-counter-abuse-alerts@google.com</owner> - <summary> - Logs whether hash-prefix real-time lookups would be ineligible due to the - feature being disabled for the session or the location, if the location - check was based on the latest country instead of the permanent country. - Logged when a browser URL loader throttle is created. Additionally, logged - when creating a SafeBrowsing URL checker on iOS. - </summary> -</histogram> - <histogram name="SafeBrowsing.IOS.IsCheckCompletedOnShouldAllowResponse" enum="BooleanCompleted" expires_after="2024-09-01"> <owner>ajuma@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/user_education/histograms.xml b/tools/metrics/histograms/metadata/user_education/histograms.xml index ed48175..4d4f3f6 100644 --- a/tools/metrics/histograms/metadata/user_education/histograms.xml +++ b/tools/metrics/histograms/metadata/user_education/histograms.xml
@@ -113,6 +113,18 @@ </summary> </histogram> +<histogram name="UserEducation.MessageShown.RotatingPromoIndex" units="Index" + expires_after="2024-09-01"> + <owner>dfried@chromium.org</owner> + <owner>frizzle-team@google.com</owner> + <summary> + Record the index of a rotating promo when it is shown to the user. This can + be used to determine how deep in the rotation of rotating promos users are + going, and also what proportion of users have seen a particular promo from a + rotating promo set. + </summary> +</histogram> + <histogram name="UserEducation.MessageShown.Subtype" enum="PromoSubtype" expires_after="2024-09-01"> <owner>mickeyburks@chromium.org</owner>
diff --git a/tools/translation/helper/git_helper.py b/tools/translation/helper/git_helper.py index 0554bff..4cc3928 100644 --- a/tools/translation/helper/git_helper.py +++ b/tools/translation/helper/git_helper.py
@@ -4,6 +4,7 @@ import subprocess import sys +import os if sys.platform.startswith('win'): # Use the |git.bat| in the depot_tools/ on Windows. @@ -18,6 +19,11 @@ # shell to do it. # TODO(meacer): This should use list_grds_in_repository() from the internal # translate.py. + if os.getcwd().startswith('/google/cog/cloud'): + files = [] + for _, _, filenames in os.walk(repo_path): + files.extend([f for f in filenames if f.endswith('.grd')]) + return files output = subprocess.check_output([GIT, 'ls-files', '--', '*.grd'], cwd=repo_path) # Need to decode because Python3 returns subprocess output as bytes.
diff --git a/ui/accessibility/platform/ax_platform_node_win.cc b/ui/accessibility/platform/ax_platform_node_win.cc index ce992171..9b039e4 100644 --- a/ui/accessibility/platform/ax_platform_node_win.cc +++ b/ui/accessibility/platform/ax_platform_node_win.cc
@@ -416,19 +416,6 @@ (value ? L"true" : L"false")); } -void AXPlatformNodeWin::HtmlAttributeToUIAAriaProperty( - std::vector<std::wstring>& properties, - const char* html_attribute_name, - const char* uia_aria_property) { - std::u16string html_attribute_value; - if (GetHtmlAttribute(html_attribute_name, &html_attribute_value)) { - std::wstring wide_value = base::UTF16ToWide(html_attribute_value); - SanitizeStringAttributeForUIAAriaProperty(wide_value, &wide_value); - properties.push_back(base::ASCIIToWide(uia_aria_property) + L"=" + - wide_value); - } -} - std::vector<AXPlatformNodeWin*> AXPlatformNodeWin::CreatePlatformNodeVectorFromRelationIdVector( const std::vector<int32_t>& relation_id_list) { @@ -1012,7 +999,7 @@ case ax::mojom::Role::kFeed: return {UIALocalizationStrategy::kSupply, UIA_GroupControlTypeId, - L"group"}; + L"feed"}; case ax::mojom::Role::kFigcaption: return {UIALocalizationStrategy::kSupply, UIA_GroupControlTypeId,
diff --git a/ui/accessibility/platform/ax_platform_node_win.h b/ui/accessibility/platform/ax_platform_node_win.h index 1c2a6065..fb866f7 100644 --- a/ui/accessibility/platform/ax_platform_node_win.h +++ b/ui/accessibility/platform/ax_platform_node_win.h
@@ -1371,12 +1371,6 @@ ax::mojom::State state, const char* uia_aria_property); - // If the Html attribute |html_attribute_name| is present, add its value as a - // UIA AriaProperties Property with the name |uia_aria_property|. - void HtmlAttributeToUIAAriaProperty(std::vector<std::wstring>& properties, - const char* html_attribute_name, - const char* uia_aria_property); - // If the IntList attribute |attribute| is present, return an array // of automation elements referenced by the ids in the // IntList attribute. Otherwise return an empty array.
diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn index b006e61..8d678b62f 100644 --- a/ui/android/BUILD.gn +++ b/ui/android/BUILD.gn
@@ -110,10 +110,8 @@ generate_jni("ui_android_jni_headers") { sources = [ "java/src/org/chromium/ui/OverscrollRefreshHandler.java", - "java/src/org/chromium/ui/base/Clipboard.java", "java/src/org/chromium/ui/base/EventForwarder.java", "java/src/org/chromium/ui/base/LocalizationUtils.java", - "java/src/org/chromium/ui/base/SelectFileDialog.java", "java/src/org/chromium/ui/base/UiAndroidFeatureMap.java", "java/src/org/chromium/ui/base/ViewAndroidDelegate.java", "java/src/org/chromium/ui/base/WindowAndroid.java", @@ -452,6 +450,8 @@ "//third_party/androidx:androidx_vectordrawable_vectordrawable_animated_java", "//third_party/jni_zero:jni_zero_java", "//ui/accessibility:ax_base_java", + "//ui/base:clipboard_jni_headers_java", + "//ui/base:select_file_dialog_jni_headers_java", "//ui/base/cursor/mojom:cursor_type_java", "//ui/base/ime/mojom:mojom_java", "//url:gurl_java",
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn index 9ba6a1d6..fa7f030 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn
@@ -433,6 +433,13 @@ ] } + if (is_chromeos) { + sources += [ + "accelerators/ash/right_alt_event_property.cc", + "accelerators/ash/right_alt_event_property.h", + ] + } + if (is_mac) { sources += [ "accelerators/platform_accelerator_cocoa.h", @@ -925,15 +932,20 @@ if (is_android) { generate_jni("ui_base_jni_headers") { sources = [ - "../android/java/src/org/chromium/ui/base/Clipboard.java", "../android/java/src/org/chromium/ui/base/DeviceFormFactor.java", "../android/java/src/org/chromium/ui/base/IdleDetector.java", "../android/java/src/org/chromium/ui/base/LocalizationUtils.java", "../android/java/src/org/chromium/ui/base/ResourceBundle.java", - "../android/java/src/org/chromium/ui/base/SelectFileDialog.java", "../android/java/src/org/chromium/ui/base/TouchDevice.java", ] } + generate_jni("select_file_dialog_jni_headers") { + sources = + [ "../android/java/src/org/chromium/ui/base/SelectFileDialog.java" ] + } + generate_jni("clipboard_jni_headers") { + sources = [ "../android/java/src/org/chromium/ui/base/Clipboard.java" ] + } } bundle_data("ui_base_unittests_bundle_data") {
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc index 78a3ead..3094f8f 100644 --- a/ui/base/accelerators/accelerator.cc +++ b/ui/base/accelerators/accelerator.cc
@@ -5,6 +5,7 @@ #include "ui/base/accelerators/accelerator.h" #include <stdint.h> + #include <tuple> #include "base/check_op.h" @@ -32,6 +33,7 @@ #endif #if BUILDFLAG(IS_CHROMEOS) +#include "ui/base/accelerators/ash/right_alt_event_property.h" #include "ui/base/ui_base_features.h" #endif @@ -94,6 +96,12 @@ if (features::IsImprovedKeyboardShortcutsEnabled()) { code_ = key_event.code(); } + + // Rewrite to Right Alt based on the presence of the property. + if (key_event.key_code() == VKEY_ASSISTANT && + HasRightAltProperty(key_event)) { + key_code_ = VKEY_RIGHT_ALT; + } #endif }
diff --git a/ui/base/accelerators/ash/right_alt_event_property.cc b/ui/base/accelerators/ash/right_alt_event_property.cc new file mode 100644 index 0000000..160019e --- /dev/null +++ b/ui/base/accelerators/ash/right_alt_event_property.cc
@@ -0,0 +1,34 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ui/base/accelerators/ash/right_alt_event_property.h" + +#include <cstdint> +#include <vector> + +#include "ui/events/event.h" + +namespace ui { + +namespace { +// Tag used to mark events as being for right alt. +constexpr char kPropertyRightAlt[] = "right_alt_event"; +} // namespace + +void SetRightAltProperty(Event* event) { + auto properties = + event->properties() ? *event->properties() : Event::Properties(); + properties.emplace(kPropertyRightAlt, std::vector<std::uint8_t>()); + event->SetProperties(properties); +} + +bool HasRightAltProperty(const Event& event) { + auto* properties = event.properties(); + if (!properties) { + return false; + } + return properties->find(kPropertyRightAlt) != properties->end(); +} + +} // namespace ui
diff --git a/ui/base/accelerators/ash/right_alt_event_property.h b/ui/base/accelerators/ash/right_alt_event_property.h new file mode 100644 index 0000000..d72d6ca --- /dev/null +++ b/ui/base/accelerators/ash/right_alt_event_property.h
@@ -0,0 +1,25 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_BASE_ACCELERATORS_ASH_RIGHT_ALT_EVENT_PROPERTY_H_ +#define UI_BASE_ACCELERATORS_ASH_RIGHT_ALT_EVENT_PROPERTY_H_ + +#include "base/component_export.h" + +namespace ui { + +class Event; + +// Sets the right alt property on the given event to mark the event is supposed +// to be used as the right alt key for the purposes of accelerators. +COMPONENT_EXPORT(UI_BASE) +void SetRightAltProperty(Event* event); + +// Checks if the right alt property is set on the given event. +COMPONENT_EXPORT(UI_BASE) +bool HasRightAltProperty(const Event& event); + +} // namespace ui + +#endif // UI_BASE_ACCELERATORS_ASH_RIGHT_ALT_EVENT_PROPERTY_H_
diff --git a/ui/base/clipboard/BUILD.gn b/ui/base/clipboard/BUILD.gn index da4e905b..cff38e8 100644 --- a/ui/base/clipboard/BUILD.gn +++ b/ui/base/clipboard/BUILD.gn
@@ -178,7 +178,7 @@ } if (is_android) { - deps += [ "//ui/base:ui_base_jni_headers" ] + deps += [ "//ui/base:clipboard_jni_headers" ] } if (is_mac) {
diff --git a/ui/base/clipboard/clipboard_android.cc b/ui/base/clipboard/clipboard_android.cc index 31a55dc60..ca23d7333 100644 --- a/ui/base/clipboard/clipboard_android.cc +++ b/ui/base/clipboard/clipboard_android.cc
@@ -31,8 +31,8 @@ #include "ui/base/clipboard/clipboard_format_type.h" #include "ui/base/clipboard/clipboard_metrics.h" #include "ui/base/clipboard/clipboard_util.h" +#include "ui/base/clipboard_jni_headers/Clipboard_jni.h" #include "ui/base/data_transfer_policy/data_transfer_endpoint.h" -#include "ui/base/ui_base_jni_headers/Clipboard_jni.h" #include "ui/gfx/android/java_bitmap.h" #include "ui/gfx/codec/png_codec.h" #include "ui/gfx/image/image.h"
diff --git a/ui/base/models/dialog_model.h b/ui/base/models/dialog_model.h index f0b6427f..ec1a4e5 100644 --- a/ui/base/models/dialog_model.h +++ b/ui/base/models/dialog_model.h
@@ -332,6 +332,16 @@ return *this; } + // Adds a title item. See DialogModel::AddTitleItem(). + // TODO(pengchaocai): Refactor this method once dialog_model supports + // multiple DialogModelSection, when the title would be an optional member + // of DialogModelSection. + Builder& AddTitleItem(std::u16string label, + ElementIdentifier id = ElementIdentifier()) { + model_->AddTitleItem(std::move(label), id); + return *this; + } + // Adds a separator. See DialogModel::AddSeparator(). Builder& AddSeparator() { model_->AddSeparator(); @@ -421,6 +431,15 @@ std::move(callback), params); } + // Adds a title item at the end of the dialog model. + // TODO(pengchaocai): Refactor this method once dialog_model supports multiple + // DialogModelSection, when the title would be an optional member of + // DialogModelSection and explicitly adding it might not be needed. + void AddTitleItem(std::u16string label, + ElementIdentifier id = ElementIdentifier()) { + contents_.AddTitleItem(std::move(label), id); + } + // Adds a separator at the end of the dialog model. void AddSeparator() { contents_.AddSeparator(); }
diff --git a/ui/base/models/dialog_model_field.cc b/ui/base/models/dialog_model_field.cc index 6e796623..778719a 100644 --- a/ui/base/models/dialog_model_field.cc +++ b/ui/base/models/dialog_model_field.cc
@@ -139,6 +139,11 @@ return static_cast<const DialogModelMenuItem*>(this); } +const DialogModelTitleItem* DialogModelField::AsTitleItem() const { + CHECK_EQ(type_, kTitleItem, base::NotFatalUntil::M123); + return static_cast<const DialogModelTitleItem*>(this); +} + DialogModelTextfield* DialogModelField::AsTextfield() { CHECK_EQ(type_, kTextfield, base::NotFatalUntil::M123); return static_cast<DialogModelTextfield*>(this); @@ -257,6 +262,13 @@ DialogModelSeparator::~DialogModelSeparator() = default; +DialogModelTitleItem::DialogModelTitleItem(std::u16string label, + ElementIdentifier id) + : DialogModelField(kTitleItem, id, {}, DialogModelField::Params()), + label_(std::move(label)) {} + +DialogModelTitleItem::~DialogModelTitleItem() = default; + DialogModelTextfield::Params::Params() = default; DialogModelTextfield::Params::~Params() = default; @@ -400,6 +412,11 @@ std::move(icon), std::move(label), std::move(callback), params)); } +void DialogModelSection::AddTitleItem(std::u16string label, + ElementIdentifier id) { + AddField(std::make_unique<DialogModelTitleItem>(std::move(label), id)); +} + void DialogModelSection::AddTextfield( ElementIdentifier id, std::u16string label,
diff --git a/ui/base/models/dialog_model_field.h b/ui/base/models/dialog_model_field.h index 4362659..bb3deb4 100644 --- a/ui/base/models/dialog_model_field.h +++ b/ui/base/models/dialog_model_field.h
@@ -28,6 +28,7 @@ class DialogModelCombobox; class DialogModelCustomField; class DialogModelMenuItem; +class DialogModelTitleItem; class DialogModelSection; class DialogModelTextfield; class Event; @@ -164,7 +165,9 @@ // having multiple subsequent kSections (3 sections imply 2 // separators). kSection, - kTextfield + kTextfield, + kTitleItem // TODO(pengchaocai): Remove kTitleItem once DialogModel + // supports multiple sections. }; class COMPONENT_EXPORT(UI_BASE) Params { @@ -208,6 +211,7 @@ DialogModelCombobox* AsCombobox(); DialogModelMenuItem* AsMenuItem(); const DialogModelMenuItem* AsMenuItem() const; + const DialogModelTitleItem* AsTitleItem() const; DialogModelTextfield* AsTextfield(); DialogModelSection* AsSection(); DialogModelCustomField* AsCustomField(); @@ -420,6 +424,22 @@ ~DialogModelSeparator() override; }; +// Field class representing a title. +// TODO(pengchaocai): Remove DialogModelTitleItem once DialogModel supports +// multiple sections and titles live in sections as optional strings. +class COMPONENT_EXPORT(UI_BASE) DialogModelTitleItem : public DialogModelField { + public: + explicit DialogModelTitleItem(std::u16string label, + ElementIdentifier id = ElementIdentifier()); + DialogModelTitleItem(const DialogModelSeparator&) = delete; + DialogModelTitleItem& operator=(const DialogModelSeparator&) = delete; + ~DialogModelTitleItem() override; + const std::u16string& label() const { return label_; } + + private: + const std::u16string label_; +}; + // Field class representing a textfield and corresponding label to describe the // textfield: // @@ -625,6 +645,13 @@ const DialogModelMenuItem::Params& params = DialogModelMenuItem::Params()); + // Adds a menu item at the end of the section. + // TODO(pengchaocai): Refactor this method once dialog_model supports multiple + // DialogModelSection, when the title would be an optional member of `this` + // and explicitly adding it might not be needed. + void AddTitleItem(std::u16string label, + ElementIdentifier id = ElementIdentifier()); + // Adds a separator at the end of the section. void AddSeparator();
diff --git a/ui/base/models/dialog_model_menu_model_adapter.cc b/ui/base/models/dialog_model_menu_model_adapter.cc index 6608b4a..9a97ae9 100644 --- a/ui/base/models/dialog_model_menu_model_adapter.cc +++ b/ui/base/models/dialog_model_menu_model_adapter.cc
@@ -31,9 +31,11 @@ } MenuModel::ItemType DialogModelMenuModelAdapter::GetTypeAt(size_t index) const { - return GetField(index)->type() == DialogModelField::kSeparator - ? TYPE_SEPARATOR - : TYPE_COMMAND; + const auto type = GetField(index)->type(); + if (type == DialogModelField::kTitleItem) { + return TYPE_TITLE; + } + return type == DialogModelField::kSeparator ? TYPE_SEPARATOR : TYPE_COMMAND; } MenuSeparatorType DialogModelMenuModelAdapter::GetSeparatorTypeAt( @@ -44,13 +46,21 @@ } int DialogModelMenuModelAdapter::GetCommandIdAt(size_t index) const { + const auto type = GetField(index)->type(); + if (type == DialogModelField::kTitleItem) { + return ui::MenuModel::kTitleId; + } // TODO(pbos): Figure out what this should be. Combobox seems to offset by // 1000. Dunno why. return static_cast<int>(index + 1234); } std::u16string DialogModelMenuModelAdapter::GetLabelAt(size_t index) const { - return GetField(index)->AsMenuItem()->label(); + const DialogModelField* const field = GetField(index); + if (field->type() == DialogModelField::kTitleItem) { + return field->AsTitleItem()->label(); + } + return field->AsMenuItem()->label(); } bool DialogModelMenuModelAdapter::IsItemDynamicAt(size_t index) const { @@ -74,7 +84,11 @@ } ImageModel DialogModelMenuModelAdapter::GetIconAt(size_t index) const { - return GetField(index)->AsMenuItem()->icon(); + const DialogModelField* const field = GetField(index); + if (field->type() == DialogModelField::kTitleItem) { + return ImageModel(); + } + return field->AsMenuItem()->icon(); } ButtonMenuItemModel* DialogModelMenuModelAdapter::GetButtonMenuItemAt( @@ -86,6 +100,10 @@ CHECK_LT(index, GetItemCount(), base::NotFatalUntil::M123); const DialogModelField* const field = GetField(index); + // Non-interactive title should be disabled. + if (field->type() == DialogModelField::kTitleItem) { + return false; + } return field->type() != DialogModelField::kSeparator && field->AsMenuItem()->is_enabled(); } @@ -95,6 +113,9 @@ CHECK_LT(index, GetItemCount(), base::NotFatalUntil::M123); const DialogModelField* const field = GetField(index); + if (field->type() == DialogModelField::kTitleItem) { + return field->id(); + } return field->AsMenuItem()->id(); }
diff --git a/ui/events/ash/event_rewriter_ash.cc b/ui/events/ash/event_rewriter_ash.cc index 18df3dc..0a9db08 100644 --- a/ui/events/ash/event_rewriter_ash.cc +++ b/ui/events/ash/event_rewriter_ash.cc
@@ -22,6 +22,7 @@ #include "base/strings/string_util.h" #include "base/time/time.h" #include "device/udev_linux/scoped_udev.h" +#include "ui/base/accelerators/ash/right_alt_event_property.h" #include "ui/base/ime/ash/extension_ime_util.h" #include "ui/base/ime/ash/ime_keyboard.h" #include "ui/base/ime/ash/input_method_manager.h" @@ -193,6 +194,11 @@ prefs::kLanguageRemapAssistantKeyTo, {EF_NONE, DomCode::LAUNCH_ASSISTANT, DomKey::LAUNCH_ASSISTANT, VKEY_ASSISTANT}}, + {EF_NONE, + ui::mojom::ModifierKey::kRightAlt, + nullptr, + {EF_NONE, DomCode::LAUNCH_ASSISTANT, DomKey::LAUNCH_ASSISTANT, + VKEY_RIGHT_ALT}}, {EF_FUNCTION_DOWN, ui::mojom::ModifierKey::kFunction, nullptr, @@ -1175,6 +1181,12 @@ key_event.type(), state.key_code, state.code, state.flags, state.key, key_event.time_stamp()); key_event_ptr->set_scan_code(key_event.scan_code()); + // Rewrite to VKEY_RIGHT_ALT and set the property on the event to mark it as + // being VKEY_RIGHT_ALT. + if (state.key_code == VKEY_RIGHT_ALT) { + key_event_ptr->set_key_code(VKEY_ASSISTANT); + SetRightAltProperty(key_event_ptr.get()); + } *rewritten_event = std::move(key_event_ptr); } @@ -1325,6 +1337,11 @@ prefs::kLanguageRemapBackspaceKeyTo, delegate_); break; case DomCode::LAUNCH_ASSISTANT: + if (keyboard_capability_->HasRightAltKey(device_id)) { + remapped_key = GetRemappedKey(device_id, mojom::ModifierKey::kRightAlt, + "", delegate_); + break; + } remapped_key = GetRemappedKey(device_id, mojom::ModifierKey::kAssistant, prefs::kLanguageRemapAssistantKeyTo, delegate_); @@ -2162,6 +2179,10 @@ auto key_state_iter = pressed_key_states_.begin(); int event_flags = rewritten_event ? rewritten_event->flags() : key_event.flags(); + Event::Properties properties = + (rewritten_event && rewritten_event->properties()) + ? *rewritten_event->properties() + : Event::Properties(); rewritten_event.reset(); // Iterate the keys being pressed. Release the key events which satisfy one @@ -2191,6 +2212,9 @@ key_state_iter->first.code, event_flags, key_state_iter->first.key, key_event.time_stamp()); dispatched_event->set_scan_code(key_event.scan_code()); + if (!properties.empty()) { + dispatched_event->SetProperties(properties); + } details = SendEventFinally(continuation, dispatched_event.get()); key_state_iter = pressed_key_states_.erase(key_state_iter);
diff --git a/ui/events/ash/keyboard_modifier_event_rewriter.cc b/ui/events/ash/keyboard_modifier_event_rewriter.cc index 1d25aa47..842a3798 100644 --- a/ui/events/ash/keyboard_modifier_event_rewriter.cc +++ b/ui/events/ash/keyboard_modifier_event_rewriter.cc
@@ -4,9 +4,12 @@ #include "ui/events/ash/keyboard_modifier_event_rewriter.h" +#include <variant> + #include "ash/constants/ash_features.h" #include "base/containers/fixed_flat_map.h" #include "base/notreached.h" +#include "ui/base/accelerators/ash/right_alt_event_property.h" #include "ui/base/ime/ash/extension_ime_util.h" #include "ui/base/ime/ash/ime_keyboard.h" #include "ui/base/ime/ash/input_method_manager.h" @@ -22,11 +25,15 @@ #include "ui/events/keycodes/dom/dom_key.h" #include "ui/events/keycodes/dom/keycode_converter.h" #include "ui/events/keycodes/keyboard_code_conversion.h" +#include "ui/events/keycodes/keyboard_codes_posix.h" #include "ui/events/ozone/layout/keyboard_layout_engine.h" namespace ui { namespace { +using PhysicalCode = KeyboardModifierEventRewriter::PhysicalCode; +using UnmappedCode = KeyboardModifierEventRewriter::UnmappedCode; + bool IsFirstPartyKoreanIME() { auto* manager = ash::input_method::InputMethodManager::Get(); if (!manager) { @@ -38,6 +45,18 @@ return ash::extension_ime_util::IsCros1pKorean(current_input_method.id()); } +DomCode GetDomCodeFromPhysicalCode(const PhysicalCode& physical_code) { + if (const UnmappedCode* unmapped_code = + std::get_if<UnmappedCode>(&physical_code)) { + switch (*unmapped_code) { + case UnmappedCode::kRightAlt: + return DomCode::LAUNCH_ASSISTANT; + } + } + + return std::get<DomCode>(physical_code); +} + } // namespace KeyboardModifierEventRewriter::KeyboardModifierEventRewriter( @@ -117,8 +136,10 @@ // Remember the remapping on press. This remapping will be reapplied to the // release event. - if (remapped.code != event.code() || remapped.key != event.GetDomKey() || - remapped.key_code != event.key_code()) { + if (GetDomCodeFromPhysicalCode(remapped.code) != event.code() || + remapped.key != event.GetDomKey() || + remapped.key_code != event.key_code() || + std::holds_alternative<UnmappedCode>(remapped.code)) { remapped_keys_.insert_or_assign(physical_key, remapped); } @@ -171,10 +192,12 @@ } // First DomCode is remapped based on user's preferences. - DomCode remapped_code = - GetRemappedDomCode(event.code(), GetKeyboardDeviceIdProperty(event)) + const PhysicalCode remapped_code = + GetRemappedPhysicalCode(event.code(), GetKeyboardDeviceIdProperty(event)) .value_or(event.code()); - if (remapped_code == DomCode::NONE) { + + const DomCode remapped_dom_code = GetDomCodeFromPhysicalCode(remapped_code); + if (remapped_dom_code == DomCode::NONE) { return {{DomCode::NONE, DomKey::NONE, VKEY_UNKNOWN}}; } @@ -184,7 +207,7 @@ // modifier flags used to interpret original KeyEvent may be remapped. DomKey dom_key; KeyboardCode keycode; - if (!keyboard_layout_engine_->Lookup(remapped_code, + if (!keyboard_layout_engine_->Lookup(remapped_dom_code, RewriteModifierFlags(event.flags()), &dom_key, &keycode)) { LOG(ERROR) << "Failed to look up kayboard layout"; @@ -219,21 +242,33 @@ std::unique_ptr<KeyEvent> KeyboardModifierEventRewriter::BuildRewrittenEvent( const KeyEvent& event, const RemappedKey& remapped) { + // Events with unmapped codes must always be rewritten. EventFlags flags = RewriteModifierFlags(event.flags()); - if (remapped.code == event.code() && remapped.key == event.GetDomKey() && - remapped.key_code == event.key_code() && flags == event.flags()) { + if (GetDomCodeFromPhysicalCode(remapped.code) == event.code() && + remapped.key == event.GetDomKey() && + remapped.key_code == event.key_code() && flags == event.flags() && + !std::holds_alternative<UnmappedCode>(remapped.code)) { // Nothing is rewritten. return nullptr; } auto rewritten_event = - std::make_unique<KeyEvent>(event.type(), remapped.key_code, remapped.code, + std::make_unique<KeyEvent>(event.type(), remapped.key_code, + GetDomCodeFromPhysicalCode(remapped.code), flags, remapped.key, event.time_stamp()); rewritten_event->set_scan_code(event.scan_code()); rewritten_event->set_source_device_id(event.source_device_id()); if (const auto* properties = event.properties()) { rewritten_event->SetProperties(*properties); } + // Set property if the unmapped code is Right Alt. + if (const UnmappedCode* unmapped_code = + std::get_if<UnmappedCode>(&remapped.code)) { + if (*unmapped_code == + KeyboardModifierEventRewriter::UnmappedCode::kRightAlt) { + SetRightAltProperty(rewritten_event.get()); + } + } return rewritten_event; } @@ -263,9 +298,9 @@ return flags; } -std::optional<DomCode> KeyboardModifierEventRewriter::GetRemappedDomCode( - DomCode code, - int device_id) const { +std::optional<PhysicalCode> +KeyboardModifierEventRewriter::GetRemappedPhysicalCode(DomCode code, + int device_id) const { bool is_left = true; mojom::ModifierKey modifier_key; std::string_view pref_name; @@ -332,6 +367,12 @@ break; case DomCode::LAUNCH_ASSISTANT: + // Right alt key must be checked explicitly on a per-device basis as it + // shares the dom code. + if (keyboard_capability_->HasRightAltKey(device_id)) { + modifier_key = mojom::ModifierKey::kRightAlt; + break; + } modifier_key = mojom::ModifierKey::kAssistant; pref_name = prefs::kLanguageRemapAssistantKeyTo; break; @@ -372,9 +413,7 @@ case mojom::ModifierKey::kFunction: return DomCode::FN; case mojom::ModifierKey::kRightAlt: - // TODO(dpad, b/328316040): Implement for right alt. - NOTIMPLEMENTED(); - return std::nullopt; + return UnmappedCode::kRightAlt; } }
diff --git a/ui/events/ash/keyboard_modifier_event_rewriter.h b/ui/events/ash/keyboard_modifier_event_rewriter.h index 5266511..8928474 100644 --- a/ui/events/ash/keyboard_modifier_event_rewriter.h +++ b/ui/events/ash/keyboard_modifier_event_rewriter.h
@@ -7,9 +7,11 @@ #include <map> #include <memory> +#include <variant> #include "base/memory/raw_ptr.h" #include "ui/events/ash/event_rewriter_utils.h" +#include "ui/events/ash/mojom/modifier_key.mojom-shared.h" #include "ui/events/ash/mojom/modifier_key.mojom.h" #include "ui/events/event_rewriter.h" @@ -28,8 +30,15 @@ // events and touch events. class KeyboardModifierEventRewriter : public EventRewriter { public: + // UnmappedCode are keys which do not have a corresponding DomCode for their + // meaning which are used for modifier remapping. + enum class UnmappedCode { + kRightAlt, + }; + + using PhysicalCode = std::variant<DomCode, UnmappedCode>; struct RemappedKey { - DomCode code; + PhysicalCode code; DomKey key; KeyboardCode key_code; }; @@ -78,7 +87,8 @@ const RemappedKey& remapped); int RewriteModifierFlags(int flags) const; - std::optional<DomCode> GetRemappedDomCode(DomCode code, int device_id) const; + std::optional<PhysicalCode> GetRemappedPhysicalCode(DomCode code, + int device_id) const; std::unique_ptr<Delegate> delegate_; const raw_ptr<KeyboardLayoutEngine> keyboard_layout_engine_;
diff --git a/ui/events/keycodes/keyboard_codes_posix.h b/ui/events/keycodes/keyboard_codes_posix.h index a935bbe8..ab95874c 100644 --- a/ui/events/keycodes/keyboard_codes_posix.h +++ b/ui/events/keycodes/keyboard_codes_posix.h
@@ -257,7 +257,7 @@ // All applications - this also triggers the launcher in Chrome OS. VKEY_ALL_APPLICATIONS = 0xEF, -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) VKEY_FUNCTION = 0xFF, VKEY_RIGHT_ALT = 0x100, VKEY_ACCESSIBILITY = 0x101,
diff --git a/ui/shell_dialogs/BUILD.gn b/ui/shell_dialogs/BUILD.gn index 0f6067d03..9a3c87b 100644 --- a/ui/shell_dialogs/BUILD.gn +++ b/ui/shell_dialogs/BUILD.gn
@@ -114,7 +114,7 @@ ] deps += [ "//ui/android", - "//ui/base:ui_base_jni_headers", + "//ui/base:select_file_dialog_jni_headers", ] include_dirs = [ "$root_gen_dir/ui" ] libs = [ "jnigraphics" ]
diff --git a/ui/shell_dialogs/select_file_dialog_android.cc b/ui/shell_dialogs/select_file_dialog_android.cc index 3bdc814..cb8b0834 100644 --- a/ui/shell_dialogs/select_file_dialog_android.cc +++ b/ui/shell_dialogs/select_file_dialog_android.cc
@@ -14,7 +14,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "ui/android/window_android.h" -#include "ui/base/ui_base_jni_headers/SelectFileDialog_jni.h" +#include "ui/base/select_file_dialog_jni_headers/SelectFileDialog_jni.h" #include "ui/shell_dialogs/select_file_policy.h" #include "ui/shell_dialogs/selected_file_info.h" #include "url/gurl.h"
diff --git a/ui/views/accessibility/view_accessibility_utils.cc b/ui/views/accessibility/view_accessibility_utils.cc index 4a74a6c1..3ba3098e 100644 --- a/ui/views/accessibility/view_accessibility_utils.cc +++ b/ui/views/accessibility/view_accessibility_utils.cc
@@ -72,11 +72,9 @@ destination.relative_bounds.bounds = source.relative_bounds.bounds; } - // TODO(javiercon): Add checking for all the states, and add DCHECK for them - // as well. Do the same thing for the Restrictions. - if (source.HasState(ax::mojom::State::kIgnored)) { - destination.AddState(ax::mojom::State::kIgnored); - } + destination.state |= source.state; + + destination.actions |= source.actions; } #if DCHECK_IS_ON()
diff --git a/ui/views/bubble/bubble_dialog_model_host.cc b/ui/views/bubble/bubble_dialog_model_host.cc index c6e575c..451c8dd9 100644 --- a/ui/views/bubble/bubble_dialog_model_host.cc +++ b/ui/views/bubble/bubble_dialog_model_host.cc
@@ -58,6 +58,9 @@ return BubbleDialogModelHost::FieldType::kControl; case ui::DialogModelField::kMenuItem: return BubbleDialogModelHost::FieldType::kMenuItem; + case ui::DialogModelField::kTitleItem: + // No need to handle titles. + NOTREACHED_NORETURN(); case ui::DialogModelField::kSection: // TODO(pbos): Handle nested/multiple sections. NOTREACHED_NORETURN(); @@ -344,6 +347,9 @@ case ui::DialogModelField::kMenuItem: AddOrUpdateMenuItem(field->AsMenuItem()); break; + case ui::DialogModelField::kTitleItem: + // No need to handle titles. + NOTREACHED_NORETURN(); case ui::DialogModelField::kSection: // TODO(pbos): Handle nested/multiple sections. NOTREACHED_NORETURN();
diff --git a/ui/views/controls/menu/menu_model_adapter.cc b/ui/views/controls/menu/menu_model_adapter.cc index 1109f10..4babab46 100644 --- a/ui/views/controls/menu/menu_model_adapter.cc +++ b/ui/views/controls/menu/menu_model_adapter.cc
@@ -67,6 +67,17 @@ return menu; } +std::optional<SkColor> MenuModelAdapter::GetLabelColor(int command_id) const { + // Use STYLE_PRIMARY for title item. This aligns with 3-dot menu title style. + return command_id == ui::MenuModel::kTitleId + ? std::make_optional( + menu_->GetSubmenu()->GetColorProvider()->GetColor( + views::TypographyProvider::Get().GetColorId( + views::style::CONTEXT_MENU, + views::style::STYLE_PRIMARY))) + : std::nullopt; +} + // Static. MenuItemView* MenuModelAdapter::AddMenuItemFromModelAt(ui::MenuModel* model, size_t model_index,
diff --git a/ui/views/controls/menu/menu_model_adapter.h b/ui/views/controls/menu/menu_model_adapter.h index 30e11b5..883188d 100644 --- a/ui/views/controls/menu/menu_model_adapter.h +++ b/ui/views/controls/menu/menu_model_adapter.h
@@ -13,6 +13,7 @@ #include "base/memory/raw_ptr.h" #include "ui/base/models/menu_model_delegate.h" #include "ui/views/controls/menu/menu_delegate.h" +#include "ui/views/style/typography.h" namespace ui { class MenuModel; @@ -95,6 +96,7 @@ void WillShowMenu(MenuItemView* menu) override; void WillHideMenu(MenuItemView* menu) override; void OnMenuClosed(MenuItemView* menu) override; + std::optional<SkColor> GetLabelColor(int command_id) const override; private: // Implementation of BuildMenu().
diff --git a/ui/webui/resources/cr_components/help_bubble/help_bubble.css b/ui/webui/resources/cr_components/help_bubble/help_bubble.css index 85e5c55..daed05b4 100644 --- a/ui/webui/resources/cr_components/help_bubble/help_bubble.css +++ b/ui/webui/resources/cr_components/help_bubble/help_bubble.css
@@ -19,13 +19,13 @@ --help-bubble-foreground: var(--color-feature-promo-bubble-foreground, var(--google-grey-200)); - /* Variable declarations. Some of these will change for the 2023 refresh. */ - --help-bubble-border-radius: 8px; + /* Variable declarations. */ + --help-bubble-border-radius: 12px; --help-bubble-close-button-icon-size: 16px; - --help-bubble-close-button-size: 24px; + --help-bubble-close-button-size: 20px; --help-bubble-element-spacing: 8px; - --help-bubble-padding: 16px 20px; - --help-bubble-font-weight: 500; + --help-bubble-padding: 20px; + --help-bubble-font-weight: 400; border-radius: var(--help-bubble-border-radius); box-shadow: 0 6px 10px 4px rgba(60, 64, 67, 0.15), @@ -35,14 +35,6 @@ z-index: 1; } -/* Values that are different for the 2023 refresh go here. */ -:host-context([chrome-refresh-2023]):host { - --help-bubble-border-radius: 12px; - --help-bubble-close-button-size: 20px; - --help-bubble-padding: 20px; - --help-bubble-font-weight: 400; -} - #arrow { --help-bubble-arrow-size: 11.3px; --help-bubble-arrow-size-half: calc(var(--help-bubble-arrow-size) / 2);
diff --git a/ui/webui/resources/cr_elements/cr_shared_style.css b/ui/webui/resources/cr_elements/cr_shared_style.css index 29c0e7ac..89870c0 100644 --- a/ui/webui/resources/cr_elements/cr_shared_style.css +++ b/ui/webui/resources/cr_elements/cr_shared_style.css
@@ -123,7 +123,8 @@ margin-inline-start: 8px; } -paper-tooltip::part(tooltip) { +paper-tooltip::part(tooltip), +cr-tooltip::part(tooltip) { border-radius: var(--paper-tooltip-border-radius, 2px); font-size: 92.31%; /* Effectively 12px if the host default is 13px. */ font-weight: 500;
diff --git a/v8 b/v8 index 176cc80..11f0340 160000 --- a/v8 +++ b/v8
@@ -1 +1 @@ -Subproject commit 176cc80784780eba961f5a771e360eab581416f0 +Subproject commit 11f0340b178419d19933cc12066683648b4a2d4b