From a95a7417ad456115a1ef2da4bb8320531c0821f1 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 29 Sep 2022 16:16:15 +0200 Subject: BASELINE: Update Chromium to 106.0.5249.126 Change-Id: Ib0bb21c437a7d1686e21c33f2d329f2ac425b7ab Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/438936 Reviewed-by: Allan Sandfeld Jensen --- chromium/chrome/browser/ui/BUILD.gn | 452 +++++++---- .../browser/ui/android/appmenu/internal/BUILD.gn | 22 +- .../browser/ui/android/autofill/internal/BUILD.gn | 5 +- .../ui/android/default_browser_promo/BUILD.gn | 6 +- .../browser/ui/android/fast_checkout/BUILD.gn | 50 ++ .../ui/android/fast_checkout/internal/BUILD.gn | 51 ++ .../java/strings/android_fast_checkout_strings.grd | 193 +++++ .../chrome/browser/ui/android/layouts/BUILD.gn | 7 +- chromium/chrome/browser/ui/android/logo/BUILD.gn | 29 +- .../chrome/browser/ui/android/multiwindow/BUILD.gn | 9 +- .../chrome/browser/ui/android/native_page/BUILD.gn | 7 +- .../chrome/browser/ui/android/night_mode/BUILD.gn | 18 +- .../chrome/browser/ui/android/omnibox/BUILD.gn | 77 +- .../ui/android/quickactionsearchwidget/BUILD.gn | 4 +- .../ui/android/searchactivityutils/BUILD.gn | 2 +- chromium/chrome/browser/ui/android/signin/BUILD.gn | 71 +- .../ui/android/strings/android_chrome_strings.grd | 412 ++++++---- .../chrome/browser/ui/android/toolbar/BUILD.gn | 70 +- chromium/chrome/browser/ui/android/webid/BUILD.gn | 6 + .../browser/ui/android/webid/internal/BUILD.gn | 24 +- .../chrome/browser/ui/ash/holding_space/BUILD.gn | 4 +- .../chrome/browser/ui/ash/system_web_apps/BUILD.gn | 30 + chromium/chrome/browser/ui/color/BUILD.gn | 2 +- .../chrome/browser/ui/messages/android/BUILD.gn | 11 +- chromium/chrome/browser/ui/side_search/BUILD.gn | 4 - .../chrome/browser/ui/web_applications/BUILD.gn | 131 ++++ chromium/chrome/browser/ui/webui/BUILD.gn | 2 + chromium/chrome/browser/ui/webui/DEPS | 14 - chromium/chrome/browser/ui/webui/OWNERS | 2 - chromium/chrome/browser/ui/webui/about_ui.cc | 21 +- chromium/chrome/browser/ui/webui/about_ui.h | 2 +- .../chrome/browser/ui/webui/about_ui_unittest.cc | 2 +- .../webui/access_code_cast/access_code_cast.mojom | 3 +- .../access_code_cast/access_code_cast_dialog.cc | 15 +- .../access_code_cast_dialog_browsertest.cc | 60 ++ .../access_code_cast/access_code_cast_handler.cc | 51 +- .../access_code_cast/access_code_cast_handler.h | 4 + .../access_code_cast_handler_browsertest.cc | 124 +++ .../access_code_cast_handler_unittest.cc | 68 +- .../webui/access_code_cast/access_code_cast_ui.cc | 2 +- .../chrome/browser/ui/webui/apc_internals/OWNERS | 1 + .../webui/apc_internals/apc_internals_handler.cc | 153 +++- .../ui/webui/apc_internals/apc_internals_handler.h | 40 +- .../apc_internals/apc_internals_logins_request.cc | 44 ++ .../apc_internals/apc_internals_logins_request.h | 54 ++ chromium/chrome/browser/ui/webui/app_home/BUILD.gn | 11 + .../chrome/browser/ui/webui/app_home/DIR_METADATA | 1 + chromium/chrome/browser/ui/webui/app_home/OWNERS | 4 + .../browser/ui/webui/app_home/app_home.mojom | 35 + .../ui/webui/app_home/app_home_page_handler.cc | 121 +++ .../ui/webui/app_home/app_home_page_handler.h | 63 ++ .../webui/app_home/app_home_page_handler_test.cc | 128 +++ .../browser/ui/webui/app_home/app_home_ui.cc | 43 ++ .../chrome/browser/ui/webui/app_home/app_home_ui.h | 48 ++ .../ui/webui/app_home/mock_app_home_page.cc | 18 + .../browser/ui/webui/app_home/mock_app_home_page.h | 26 + .../browser/ui/webui/app_launcher_page_ui.cc | 6 +- .../app_management/app_management_page_handler.cc | 172 +++-- .../app_service_internals_browsertest.cc | 2 +- .../web_app_settings_navigation_throttle.cc | 3 - .../autofill_internals_ui_browsertest.cc | 2 +- .../internals_ui_handler.cc | 42 +- .../internals_ui_handler.h | 7 +- .../password_manager_internals_ui_browsertest.cc | 38 - .../webui/bookmarks/bookmarks_message_handler.cc | 16 +- .../ui/webui/bookmarks/bookmarks_message_handler.h | 8 +- .../chrome/browser/ui/webui/browser_command/DEPS | 4 + .../browser_command/browser_command_handler.cc | 78 +- .../browser_command/browser_command_handler.h | 12 + .../browser_command_handler_unittest.cc | 153 +++- .../ui/webui/browser_switch/browser_switch_ui.cc | 114 ++- .../browsing_topics_internals_page_handler.cc | 5 +- .../browsing_topics_internals_page_handler.h | 1 + ...rtificate_manager_localized_strings_provider.cc | 4 +- .../webui/certificate_provisioning_ui_handler.cc | 274 +++---- .../ui/webui/certificate_provisioning_ui_handler.h | 79 +- ...certificate_provisioning_ui_handler_unittest.cc | 314 +++----- .../browser/ui/webui/certificate_viewer_ui.cc | 2 + .../browser/ui/webui/certificate_viewer_webui.cc | 466 +++++------ .../browser/ui/webui/certificate_viewer_webui.h | 51 +- .../browser/ui/webui/certificates_handler.cc | 114 ++- .../chrome/browser/ui/webui/certificates_handler.h | 5 +- .../ui/webui/certificates_handler_unittest.cc | 3 +- .../chrome_untrusted_web_ui_configs_chromeos.cc | 9 +- .../webui/chrome_url_data_manager_browsertest.cc | 3 - .../ui/webui/chrome_web_ui_configs_chromeos.cc | 10 +- .../ui/webui/chrome_web_ui_controller_factory.cc | 155 ++-- chromium/chrome/browser/ui/webui/chromeos/OWNERS | 6 +- .../account_manager/account_manager_error_ui.cc | 2 +- .../account_migration_welcome_ui.cc | 14 +- .../add_supervision_handler_utils_unittest.cc | 14 +- .../arc_graphics_tracing_handler.cc | 52 +- .../arc_graphics_tracing_handler.h | 10 +- .../arc_power_control/arc_power_control_handler.cc | 39 +- .../arc_power_control/arc_power_control_handler.h | 10 +- .../chromeos/assistant_optin/assistant_optin_ui.cc | 7 +- .../assistant_optin/assistant_optin_utils.cc | 120 +-- .../assistant_optin/assistant_optin_utils.h | 28 +- .../ui/webui/chromeos/audio/audio_handler.h | 4 +- .../chromeos/cellular_setup/mobile_setup_dialog.cc | 6 +- .../chromeos/cellular_setup/mobile_setup_dialog.h | 4 +- .../chromeos/cellular_setup/mobile_setup_ui.cc | 58 +- .../webui/chromeos/chromebox_for_meetings/OWNERS | 2 +- .../network_settings_dialog.cc | 2 +- .../ui/webui/chromeos/cloud_upload/BUILD.gn | 15 + .../browser/ui/webui/chromeos/cloud_upload/OWNERS | 4 + .../webui/chromeos/cloud_upload/cloud_upload.mojom | 29 + .../chromeos/cloud_upload/cloud_upload_dialog.cc | 72 ++ .../chromeos/cloud_upload/cloud_upload_dialog.h | 48 ++ .../cloud_upload/cloud_upload_page_handler.cc | 30 + .../cloud_upload/cloud_upload_page_handler.h | 49 ++ .../webui/chromeos/cloud_upload/cloud_upload_ui.cc | 64 ++ .../webui/chromeos/cloud_upload/cloud_upload_ui.h | 48 ++ .../webui/chromeos/crostini_installer/DIR_METADATA | 4 +- .../crostini_installer/crostini_installer_ui.cc | 2 +- .../webui/chromeos/crostini_upgrader/DIR_METADATA | 4 +- .../crostini_upgrader/crostini_upgrader_dialog.cc | 2 +- .../crostini_upgrader_page_handler.cc | 6 +- .../crostini_upgrader/crostini_upgrader_ui.cc | 2 +- .../ui/webui/chromeos/cryptohome_web_ui_handler.cc | 8 +- .../ui/webui/chromeos/cryptohome_web_ui_handler.h | 2 +- .../chromeos/edu_account_login_handler_chromeos.cc | 44 +- .../chromeos/edu_account_login_handler_chromeos.h | 4 +- .../chromeos/edu_account_login_handler_unittest.cc | 58 +- .../edu_coexistence_login_handler_browsertest.cc | 18 +- .../edu_coexistence_login_handler_chromeos.cc | 66 +- .../edu_coexistence_login_handler_chromeos.h | 13 +- .../emulator/device_emulator_message_handler.cc | 119 ++- .../emulator/device_emulator_message_handler.h | 2 +- .../webui/chromeos/guest_os_installer/DIR_METADATA | 4 +- .../webui/chromeos/human_presence_internals_ui.cc | 175 ++++- .../browser/ui/webui/chromeos/image_source.cc | 4 +- .../browser/ui/webui/chromeos/image_source.h | 2 +- .../confirm_password_change_handler.cc | 28 +- .../confirm_password_change_handler.h | 4 +- .../lock_screen_captive_portal_dialog.cc | 6 +- .../lock_screen_network_dialog.cc | 4 +- .../lock_screen_reauth_dialogs.cc | 45 +- .../lock_screen_reauth_dialogs.h | 20 +- .../lock_screen_reauth_handler.cc | 41 +- .../lock_screen_reauth_handler.h | 1 + .../password_change_handler.cc | 14 +- .../password_change_handler.h | 4 +- .../password_change_ui.cc | 6 +- .../urgent_password_expiry_notification_handler.cc | 14 +- .../urgent_password_expiry_notification_handler.h | 4 +- .../ui/webui/chromeos/internet_config_dialog.cc | 8 +- .../ui/webui/chromeos/internet_config_dialog.h | 4 +- .../ui/webui/chromeos/internet_detail_dialog.cc | 8 +- .../ui/webui/chromeos/internet_detail_dialog.h | 4 +- .../chrome/browser/ui/webui/chromeos/login/OWNERS | 11 +- .../login/app_downloading_screen_handler.cc | 3 +- .../login/app_launch_splash_screen_handler.cc | 31 +- .../login/app_launch_splash_screen_handler.h | 10 +- .../login/arc_terms_of_service_screen_handler.cc | 28 +- .../login/arc_terms_of_service_screen_handler.h | 10 +- .../login/assistant_optin_flow_screen_handler.cc | 66 +- .../login/assistant_optin_flow_screen_handler.h | 6 +- .../login/auto_enrollment_check_screen_handler.cc | 35 - .../login/auto_enrollment_check_screen_handler.h | 19 +- .../ui/webui/chromeos/login/base_webui_handler.h | 13 +- .../check_passwords_against_cryptohome_helper.cc | 4 +- .../check_passwords_against_cryptohome_helper.h | 2 +- .../ui/webui/chromeos/login/core_oobe_handler.cc | 10 +- .../ui/webui/chromeos/login/core_oobe_handler.h | 2 + .../chromeos/login/debug/debug_overlay_handler.cc | 8 +- .../login/enable_debugging_screen_handler.cc | 49 +- .../login/enable_debugging_screen_handler.h | 30 +- .../login/encryption_migration_screen_handler.cc | 56 +- .../login/encryption_migration_screen_handler.h | 22 +- .../chromeos/login/enrollment_screen_handler.cc | 86 ++- .../chromeos/login/enrollment_screen_handler.h | 16 +- .../webui/chromeos/login/error_screen_handler.cc | 74 +- .../ui/webui/chromeos/login/error_screen_handler.h | 38 +- .../login/fake_app_launch_splash_screen_handler.h | 1 + .../login/fake_update_required_screen_handler.h | 3 - .../login/family_link_notice_screen_handler.cc | 30 +- .../login/family_link_notice_screen_handler.h | 22 +- .../login/fingerprint_setup_screen_handler.cc | 37 +- .../login/fingerprint_setup_screen_handler.h | 26 +- .../login/gaia_password_changed_screen_handler.cc | 51 +- .../login/gaia_password_changed_screen_handler.h | 27 +- .../ui/webui/chromeos/login/gaia_screen_handler.cc | 52 +- .../ui/webui/chromeos/login/gaia_screen_handler.h | 8 + .../login/gesture_navigation_screen_handler.cc | 37 +- .../login/gesture_navigation_screen_handler.h | 29 +- .../chromeos/login/guest_tos_screen_handler.cc | 44 +- .../chromeos/login/guest_tos_screen_handler.h | 23 +- .../login/kiosk_autolaunch_screen_handler.cc | 10 +- .../chromeos/login/kiosk_enable_screen_handler.cc | 34 +- .../chromeos/login/kiosk_enable_screen_handler.h | 21 +- .../chromeos/login/locale_switch_screen_handler.cc | 19 +- .../chromeos/login/locale_switch_screen_handler.h | 18 +- .../login/management_transition_screen_handler.cc | 143 +--- .../login/management_transition_screen_handler.h | 67 +- .../login/marketing_opt_in_screen_handler.cc | 73 +- .../login/marketing_opt_in_screen_handler.h | 39 +- .../login/multidevice_setup_screen_handler.cc | 15 +- .../login/multidevice_setup_screen_handler.h | 19 +- .../chromeos/login/network_dropdown_handler.cc | 6 +- .../webui/chromeos/login/network_screen_handler.cc | 4 +- .../webui/chromeos/login/network_state_informer.cc | 34 +- .../webui/chromeos/login/network_state_informer.h | 17 +- .../chromeos/login/offline_login_screen_handler.cc | 68 +- .../chromeos/login/offline_login_screen_handler.h | 31 +- .../ui/webui/chromeos/login/online_login_helper.cc | 4 +- .../ui/webui/chromeos/login/online_login_helper.h | 4 +- .../webui/chromeos/login/oobe_display_chooser.cc | 6 +- .../ui/webui/chromeos/login/oobe_display_chooser.h | 7 +- .../login/oobe_display_chooser_unittest.cc | 32 +- .../browser/ui/webui/chromeos/login/oobe_ui.cc | 121 +-- .../browser/ui/webui/chromeos/login/oobe_ui.h | 1 - .../login/packaged_license_screen_handler.cc | 32 +- .../login/packaged_license_screen_handler.h | 29 +- .../login/parental_handoff_screen_handler.cc | 25 +- .../login/parental_handoff_screen_handler.h | 22 +- .../chromeos/login/pin_setup_screen_handler.cc | 25 +- .../chromeos/login/pin_setup_screen_handler.h | 24 +- .../chromeos/login/quick_start_screen_handler.cc | 18 +- .../login/recommend_apps_screen_handler.cc | 2 +- .../webui/chromeos/login/reset_screen_handler.cc | 60 +- .../ui/webui/chromeos/login/reset_screen_handler.h | 25 +- .../chromeos/login/saml_challenge_key_handler.cc | 6 +- .../chromeos/login/saml_challenge_key_handler.h | 3 +- .../login/signin_fatal_error_screen_handler.cc | 24 +- .../login/signin_fatal_error_screen_handler.h | 18 +- .../webui/chromeos/login/signin_screen_handler.cc | 77 +- .../webui/chromeos/login/signin_screen_handler.h | 19 +- .../webui/chromeos/login/ssh_configured_handler.cc | 11 +- .../chromeos/login/sync_consent_screen_handler.cc | 2 - .../login/terms_of_service_screen_handler.cc | 62 +- .../login/terms_of_service_screen_handler.h | 44 +- .../login/testapi/oobe_test_api_handler.cc | 23 +- .../chromeos/login/testapi/oobe_test_api_handler.h | 4 +- .../login/theme_selection_screen_handler.cc | 17 +- .../login/theme_selection_screen_handler.h | 8 +- .../chromeos/login/tpm_error_screen_handler.cc | 41 +- .../chromeos/login/tpm_error_screen_handler.h | 25 +- .../login/update_required_screen_handler.cc | 56 +- .../login/update_required_screen_handler.h | 26 +- .../chromeos/login/user_creation_screen_handler.cc | 26 +- .../chromeos/login/user_creation_screen_handler.h | 19 +- .../webui/chromeos/login/welcome_screen_handler.cc | 51 +- .../webui/chromeos/login/welcome_screen_handler.h | 2 +- .../chromeos/login/wrong_hwid_screen_handler.cc | 36 +- .../chromeos/login/wrong_hwid_screen_handler.h | 28 +- .../ui/webui/chromeos/manage_mirrorsync/BUILD.gn | 16 + .../webui/chromeos/manage_mirrorsync/DIR_METADATA | 1 + .../ui/webui/chromeos/manage_mirrorsync/OWNERS | 4 + .../manage_mirrorsync/manage_mirrorsync.mojom | 43 ++ .../manage_mirrorsync/manage_mirrorsync_dialog.cc | 63 ++ .../manage_mirrorsync/manage_mirrorsync_dialog.h | 35 + .../manage_mirrorsync_dialog_browsertest.cc | 444 +++++++++++ .../manage_mirrorsync_page_handler.cc | 169 ++++ .../manage_mirrorsync_page_handler.h | 67 ++ .../manage_mirrorsync/manage_mirrorsync_ui.cc | 51 ++ .../manage_mirrorsync/manage_mirrorsync_ui.h | 47 ++ .../multidevice_internals_logs_handler.cc | 27 +- .../multidevice_internals_logs_handler.h | 9 +- .../multidevice_internals_phone_hub_handler.cc | 83 +- .../multidevice_internals_phone_hub_handler.h | 28 +- .../multidevice_setup/multidevice_setup_handler.cc | 22 +- .../multidevice_setup/multidevice_setup_handler.h | 4 +- .../webui/chromeos/network_logs_message_handler.cc | 41 +- .../webui/chromeos/network_logs_message_handler.h | 12 +- .../chrome/browser/ui/webui/chromeos/network_ui.cc | 355 ++++++++- .../ui/webui/chromeos/notification_tester/DEPS | 3 + .../ui/webui/chromeos/notification_tester/OWNERS | 1 + .../notification_tester_handler.cc | 247 ++++++ .../notification_tester_handler.h | 75 ++ .../notification_tester/notification_tester_ui.cc | 18 +- .../notification_tester/notification_tester_ui.h | 13 + .../webui/chromeos/onc_import_message_handler.cc | 12 +- .../ui/webui/chromeos/onc_import_message_handler.h | 13 +- .../parent_access/parent_access_callback.proto | 33 +- .../chromeos/parent_access/parent_access_dialog.cc | 4 +- .../chromeos/parent_access/parent_access_ui.mojom | 24 +- .../parent_access/parent_access_ui_handler_impl.cc | 50 +- .../parent_access/parent_access_ui_handler_impl.h | 9 +- .../parent_access_ui_handler_impl_browsertest.cc | 155 ++++ .../chrome/browser/ui/webui/chromeos/power_ui.cc | 101 ++- .../browser/ui/webui/chromeos/set_time_ui.cc | 30 +- .../browser/ui/webui/chromeos/slow_trace_ui.cc | 2 +- .../browser/ui/webui/chromeos/slow_trace_ui.h | 2 +- .../chrome/browser/ui/webui/chromeos/slow_ui.cc | 18 +- .../ui/webui/chromeos/smb_shares/smb_handler.cc | 46 +- .../ui/webui/chromeos/smb_shares/smb_handler.h | 6 +- .../webui/chromeos/smb_shares/smb_share_dialog.cc | 5 - .../ui/webui/chromeos/sync/os_sync_handler.cc | 37 +- .../ui/webui/chromeos/sync/os_sync_handler.h | 13 +- .../chromeos/sync/os_sync_handler_unittest.cc | 28 +- .../sys_internals/sys_internals_message_handler.cc | 73 +- .../sys_internals/sys_internals_message_handler.h | 4 +- .../browser/ui/webui/chromeos/user_image_source.cc | 2 +- .../browser/ui/webui/chromeos/user_image_source.h | 2 +- .../browser/ui/webui/chromeos/video_source.cc | 114 --- .../browser/ui/webui/chromeos/video_source.h | 56 -- .../ui/webui/commander/commander_handler.cc | 60 +- .../browser/ui/webui/commander/commander_handler.h | 10 +- .../ui/webui/components/components_handler.cc | 47 +- .../ui/webui/components/components_handler.h | 12 +- .../components/components_handler_unittest.cc | 4 +- .../browser/ui/webui/components/components_ui.cc | 4 +- .../ui/webui/conflicts/conflicts_data_fetcher.cc | 27 +- .../ui/webui/conflicts/conflicts_data_fetcher.h | 10 +- .../ui/webui/conflicts/conflicts_handler.cc | 8 +- .../browser/ui/webui/conflicts/conflicts_handler.h | 10 +- .../connectors_internals.mojom | 2 +- .../webui/connectors_internals/zero_trust_utils.cc | 4 +- .../browser/ui/webui/constrained_web_dialog_ui.cc | 11 +- .../browser/ui/webui/constrained_web_dialog_ui.h | 2 +- .../ui/webui/constrained_web_dialog_ui_unittest.cc | 10 +- .../browser/ui/webui/cookies_tree_model_util.cc | 65 +- .../browser/ui/webui/cookies_tree_model_util.h | 9 +- .../history_clusters/history_clusters_util.cc | 6 +- .../history_clusters/history_clusters_util.h | 3 +- chromium/chrome/browser/ui/webui/crashes_ui.cc | 9 +- .../chrome_customize_themes_handler.cc | 17 +- chromium/chrome/browser/ui/webui/device_log_ui.cc | 10 +- .../browser/ui/webui/devtools_ui_data_source.cc | 8 +- .../browser/ui/webui/devtools_ui_data_source.h | 2 +- .../browser/ui/webui/discards/discards_ui.cc | 23 +- .../ui/webui/domain_reliability_internals_ui.cc | 73 -- .../ui/webui/domain_reliability_internals_ui.h | 54 -- .../download_internals_ui_message_handler.cc | 31 +- .../download_internals_ui_message_handler.h | 18 +- .../chrome/browser/ui/webui/downloads/BUILD.gn | 2 + .../browser/ui/webui/downloads/downloads.mojom | 6 + .../ui/webui/downloads/downloads_dom_handler.cc | 18 + .../ui/webui/downloads/downloads_dom_handler.h | 1 + .../ui/webui/downloads/downloads_list_tracker.cc | 7 + .../browser/ui/webui/downloads/downloads_ui.cc | 1 + .../ui/webui/extensions/ash/kiosk_apps_handler.cc | 15 +- .../ui/webui/extensions/extension_icon_source.cc | 2 +- .../ui/webui/extensions/extension_icon_source.h | 2 +- .../extensions/extension_settings_browsertest.cc | 3 +- .../extensions/extensions_internals_source.cc | 2 +- .../webui/extensions/extensions_internals_source.h | 2 +- .../browser/ui/webui/extensions/extensions_ui.cc | 4 + .../family_link_user_internals_message_handler.cc | 85 +- .../family_link_user_internals_message_handler.h | 10 +- chromium/chrome/browser/ui/webui/favicon_source.cc | 2 +- chromium/chrome/browser/ui/webui/favicon_source.h | 2 +- .../browser/ui/webui/favicon_source_unittest.cc | 34 +- chromium/chrome/browser/ui/webui/feed/feed_ui.cc | 37 +- chromium/chrome/browser/ui/webui/feed/feed_ui.h | 4 +- .../ui/webui/feed_internals/feed_internals.mojom | 7 +- .../feedv2_internals_page_handler.cc | 11 +- .../feed_internals/feedv2_internals_page_handler.h | 4 +- .../browser/ui/webui/feedback/feedback_handler.cc | 22 +- .../browser/ui/webui/feedback/feedback_handler.h | 14 +- .../browser/ui/webui/feedback/feedback_ui.cc | 8 +- .../chrome/browser/ui/webui/fileicon_source.cc | 2 +- chromium/chrome/browser/ui/webui/fileicon_source.h | 2 +- .../browser/ui/webui/flags/flags_ui_handler.cc | 33 +- .../chrome/browser/ui/webui/gcm_internals_ui.cc | 19 +- .../browser/ui/webui/help/test_version_updater.h | 1 + .../chrome/browser/ui/webui/help/version_updater.h | 10 +- .../ui/webui/help/version_updater_chromeos.cc | 98 ++- .../ui/webui/help/version_updater_chromeos.h | 7 +- .../help/version_updater_chromeos_unittest.cc | 32 +- .../browser/ui/webui/help/version_updater_mac.h | 9 +- .../browser/ui/webui/help/version_updater_mac.mm | 79 +- .../ui/webui/history/browsing_history_handler.cc | 66 +- .../ui/webui/history/browsing_history_handler.h | 10 +- .../history/browsing_history_handler_unittest.cc | 34 +- .../ui/webui/history/foreign_session_handler.cc | 156 ++-- .../ui/webui/history/foreign_session_handler.h | 12 +- .../ui/webui/history/history_login_handler.cc | 14 +- .../ui/webui/history/history_login_handler.h | 6 +- .../chrome/browser/ui/webui/history/history_ui.cc | 8 +- .../browser/ui/webui/history/navigation_handler.cc | 5 +- .../browser/ui/webui/history/navigation_handler.h | 6 +- .../history_clusters/history_clusters_handler.cc | 156 +++- .../history_clusters/history_clusters_handler.h | 14 +- .../history_clusters_handler_browsertest.cc | 18 +- .../browser/ui/webui/identity_internals_ui.cc | 24 +- .../ui/webui/image_editor/image_editor_ui.cc | 2 - .../browser/ui/webui/internals/internals_ui.cc | 32 +- .../browser/ui/webui/internals/internals_ui.h | 25 +- .../lens/lens_internals_ui_message_handler.cc | 12 +- .../user_education_internals_page_handler_impl.h | 5 +- .../ui/webui/interstitials/interstitial_ui.cc | 16 +- .../interstitials/interstitial_ui_browsertest.cc | 6 - .../chrome/browser/ui/webui/intro/DIR_METADATA | 1 + chromium/chrome/browser/ui/webui/intro/OWNERS | 2 + .../chrome/browser/ui/webui/intro/intro_handler.cc | 28 + .../chrome/browser/ui/webui/intro/intro_handler.h | 27 + chromium/chrome/browser/ui/webui/intro/intro_ui.cc | 36 + chromium/chrome/browser/ui/webui/intro/intro_ui.h | 24 + .../invalidations/invalidations_message_handler.cc | 9 +- .../invalidations/invalidations_message_handler.h | 4 +- .../chrome/browser/ui/webui/managed_ui_handler.cc | 13 +- .../chrome/browser/ui/webui/managed_ui_handler.h | 2 +- .../browser/ui/webui/management/management_ui.cc | 18 +- .../ui/webui/management/management_ui_handler.cc | 574 ++++++++------ .../ui/webui/management/management_ui_handler.h | 67 +- .../management/management_ui_handler_unittest.cc | 218 +++--- .../browser/ui/webui/media/webrtc_logs_ui.cc | 110 ++- .../ui/webui/media_router/cast_feedback_ui.cc | 4 +- .../ui/webui/media_router/cast_feedback_ui.h | 7 +- ...media_router_internals_webui_message_handler.cc | 23 +- .../chrome/browser/ui/webui/memory_internals_ui.cc | 65 +- chromium/chrome/browser/ui/webui/nacl_ui.cc | 23 +- .../nearby_internals_contact_handler.cc | 21 +- .../nearby_internals_http_handler.cc | 8 +- .../nearby_internals_logs_handler.cc | 13 +- .../nearby_internals_logs_handler.h | 8 +- .../nearby_internals_ui_trigger_handler.cc | 34 +- .../quick_pair/quick_pair_handler.cc | 6 +- chromium/chrome/browser/ui/webui/net_export_ui.cc | 44 +- .../ui/webui/net_internals/net_internals_ui.cc | 150 +++- .../net_internals/net_internals_ui_browsertest.cc | 5 +- .../chrome/browser/ui/webui/new_tab_page/BUILD.gn | 2 + .../chrome/browser/ui/webui/new_tab_page/OWNERS | 3 +- .../ui/webui/new_tab_page/new_tab_page.mojom | 10 +- .../ui/webui/new_tab_page/new_tab_page_handler.cc | 260 +++---- .../ui/webui/new_tab_page/new_tab_page_handler.h | 4 + .../new_tab_page/new_tab_page_handler_unittest.cc | 67 +- .../ui/webui/new_tab_page/new_tab_page_ui.cc | 82 +- .../ui/webui/new_tab_page/new_tab_page_ui.h | 20 +- .../ui/webui/new_tab_page/untrusted_source.cc | 6 +- .../ui/webui/new_tab_page/untrusted_source.h | 2 +- .../new_tab_page_third_party_handler.cc | 13 +- .../new_tab_page_third_party_ui.cc | 16 +- .../browser/ui/webui/ntp/app_launcher_handler.cc | 191 +++-- .../browser/ui/webui/ntp/app_launcher_handler.h | 28 +- .../ui/webui/ntp/app_launcher_handler_unittest.cc | 18 +- .../ui/webui/ntp/cookie_controls_handler.cc | 12 +- chromium/chrome/browser/ui/webui/ntp/new_tab_ui.cc | 3 +- chromium/chrome/browser/ui/webui/ntp/new_tab_ui.h | 2 +- .../browser/ui/webui/ntp/ntp_resource_cache.cc | 55 +- .../browser/ui/webui/ntp/ntp_resource_cache.h | 3 +- .../browser/ui/webui/ntp_tiles_internals_ui.cc | 27 +- .../offline_internals_ui_message_handler.cc | 72 +- .../webui/password_manager/password_manager_ui.cc | 45 ++ .../webui/password_manager/password_manager_ui.h | 19 + .../chrome/browser/ui/webui/policy/policy_ui.cc | 8 + .../ui/webui/policy/policy_ui_browsertest.cc | 11 +- .../browser/ui/webui/policy/policy_ui_handler.cc | 337 +++----- .../browser/ui/webui/policy/policy_ui_handler.h | 64 +- .../cloud_policy_core_status_provider.cc | 30 - .../cloud_policy_core_status_provider.h | 41 - ...vice_active_directory_policy_status_provider.cc | 21 - ...evice_active_directory_policy_status_provider.h | 42 - ...device_cloud_policy_status_provider_chromeos.cc | 29 - .../device_cloud_policy_status_provider_chromeos.h | 39 - .../device_local_account_policy_status_provider.cc | 50 -- .../device_local_account_policy_status_provider.h | 50 -- .../device_policy_status_provider_lacros.cc | 24 - .../device_policy_status_provider_lacros.h | 26 - .../policy/status_provider/status_provider_util.cc | 75 -- .../policy/status_provider/status_provider_util.h | 32 - .../status_provider/updater_status_provider.cc | 67 -- .../status_provider/updater_status_provider.h | 34 - ...user_active_directory_policy_status_provider.cc | 82 -- .../user_active_directory_policy_status_provider.h | 49 -- .../user_cloud_policy_status_provider.cc | 26 - .../user_cloud_policy_status_provider.h | 40 - .../user_cloud_policy_status_provider_chromeos.cc | 30 - .../user_cloud_policy_status_provider_chromeos.h | 41 - .../user_policy_status_provider_lacros.cc | 50 -- .../user_policy_status_provider_lacros.h | 41 - .../ui/webui/predictors/predictors_handler.cc | 77 +- .../ui/webui/predictors/predictors_handler.h | 10 +- .../browser/ui/webui/prefs_internals_source.cc | 2 +- .../browser/ui/webui/prefs_internals_source.h | 2 +- .../print_preview/extension_printer_handler.cc | 6 +- .../extension_printer_handler_unittest.cc | 22 +- .../webui/print_preview/fake_print_render_frame.cc | 3 +- .../webui/print_preview/fake_print_render_frame.h | 3 +- .../local_printer_handler_chromeos.cc | 20 +- .../print_preview/local_printer_handler_chromeos.h | 8 +- .../local_printer_handler_chromeos_unittest.cc | 12 +- .../print_preview/local_printer_handler_default.cc | 2 +- .../webui/print_preview/print_preview_handler.cc | 262 +++---- .../ui/webui/print_preview/print_preview_handler.h | 14 +- .../print_preview_handler_chromeos.cc | 31 +- .../print_preview/print_preview_handler_chromeos.h | 6 +- .../print_preview_handler_chromeos_unittest.cc | 3 +- .../print_preview_handler_unittest.cc | 14 +- .../print_preview/print_preview_ui_browsertest.cc | 6 +- .../ui/webui/print_preview/print_preview_utils.cc | 19 + .../ui/webui/print_preview/print_preview_utils.h | 20 +- .../print_preview/print_preview_utils_unittest.cc | 56 ++ .../ui/webui/print_preview/printer_handler.h | 4 +- .../chrome/browser/ui/webui/privacy_sandbox/OWNERS | 1 + .../profile_internals/profile_internals_handler.cc | 66 +- .../profile_internals/profile_internals_handler.h | 2 +- chromium/chrome/browser/ui/webui/realbox/BUILD.gn | 2 + chromium/chrome/browser/ui/webui/realbox/OWNERS | 2 +- .../browser/ui/webui/realbox/realbox_handler.cc | 61 +- .../webui/realbox/realbox_handler_browsertest.cc | 8 +- .../chrome/browser/ui/webui/reset_password/OWNERS | 4 +- .../ui/webui/reset_password/reset_password_ui.cc | 9 +- .../browser/ui/webui/sandbox/sandbox_handler.cc | 61 +- .../browser/ui/webui/sandbox/sandbox_handler.h | 2 +- .../browser/ui/webui/sanitized_image_source.cc | 2 +- .../browser/ui/webui/sanitized_image_source.h | 2 +- .../ui/webui/sanitized_image_source_unittest.cc | 4 +- chromium/chrome/browser/ui/webui/settings/OWNERS | 2 +- .../browser/ui/webui/settings/about_handler.cc | 152 ++-- .../browser/ui/webui/settings/about_handler.h | 18 +- .../ui/webui/settings/about_handler_unittest.cc | 30 +- .../settings/ash/calculator/size_calculator.cc | 6 +- .../settings/ash/calculator/size_calculator.h | 4 +- .../ash/os_apps_page/app_notification_handler.cc | 9 +- .../app_notification_handler_unittest.cc | 40 +- .../browser/ui/webui/settings/ash/search/BUILD.gn | 23 + .../browser/ui/webui/settings/ash/search/OWNERS | 5 + .../per_session_settings_user_action_tracker.cc | 124 +++ .../per_session_settings_user_action_tracker.h | 67 ++ ...ession_settings_user_action_tracker_unittest.cc | 176 +++++ .../ui/webui/settings/ash/search/search.mojom | 135 ++++ .../ui/webui/settings/ash/search/search_concept.h | 71 ++ .../ui/webui/settings/ash/search/search_handler.cc | 340 ++++++++ .../ui/webui/settings/ash/search/search_handler.h | 122 +++ .../settings/ash/search/search_handler_unittest.cc | 311 ++++++++ .../settings/ash/search/search_result_icon.mojom | 59 ++ .../settings/ash/search/search_tag_registry.cc | 216 ++++++ .../settings/ash/search/search_tag_registry.h | 111 +++ .../ash/search/search_tag_registry_unittest.cc | 154 ++++ .../settings/ash/search/user_action_recorder.mojom | 44 ++ .../webui/settings/autofill_assistant_handler.cc | 81 ++ .../ui/webui/settings/autofill_assistant_handler.h | 65 ++ .../browser/ui/webui/settings/captions_handler.cc | 4 +- .../browser/ui/webui/settings/captions_handler.h | 3 +- .../webui/settings/chrome_cleanup_handler_win.cc | 11 +- .../browser/ui/webui/settings/chromeos/BUILD.gn | 3 +- .../chrome/browser/ui/webui/settings/chromeos/DEPS | 1 + .../browser/ui/webui/settings/chromeos/OWNERS | 2 +- .../ui/webui/settings/chromeos/about_section.cc | 27 +- .../settings/chromeos/accessibility_handler.cc | 22 +- .../settings/chromeos/accessibility_handler.h | 3 +- .../settings/chromeos/accessibility_section.cc | 310 ++++++-- .../settings/chromeos/account_manager_handler.cc | 105 ++- .../settings/chromeos/account_manager_handler.h | 5 +- .../account_manager_handler_browsertest.cc | 32 +- .../settings/chromeos/ambient_mode_handler.cc | 695 ----------------- .../webui/settings/chromeos/ambient_mode_handler.h | 182 ----- .../chromeos/ambient_mode_handler_unittest.cc | 860 --------------------- .../settings/chromeos/android_apps_handler.cc | 33 +- .../webui/settings/chromeos/android_apps_handler.h | 7 +- .../ui/webui/settings/chromeos/apps_section.cc | 4 +- .../webui/settings/chromeos/bluetooth_handler.cc | 2 +- .../chromeos/bluetooth_handler_unittest.cc | 9 +- .../webui/settings/chromeos/bluetooth_section.cc | 68 +- .../settings/chromeos/change_picture_handler.cc | 43 +- .../settings/chromeos/change_picture_handler.h | 11 +- .../chromeos/change_picture_handler_unittest.cc | 8 +- .../ui/webui/settings/chromeos/constants/BUILD.gn | 1 + .../webui/settings/chromeos/constants/routes.mojom | 25 +- .../settings/chromeos/constants/routes_util.cc | 7 +- .../settings/chromeos/constants/setting.mojom | 6 +- .../ui/webui/settings/chromeos/crostini_handler.cc | 92 ++- .../ui/webui/settings/chromeos/crostini_handler.h | 14 +- .../ui/webui/settings/chromeos/crostini_section.cc | 7 +- .../settings/chromeos/cups_printers_handler.cc | 123 ++- .../settings/chromeos/cups_printers_handler.h | 2 +- .../chromeos/cups_printers_handler_unittest.cc | 9 +- .../webui/settings/chromeos/date_time_handler.cc | 2 +- .../webui/settings/chromeos/date_time_section.cc | 2 +- .../settings/chromeos/device_display_handler.h | 5 +- .../settings/chromeos/device_keyboard_handler.cc | 24 +- .../webui/settings/chromeos/device_name_handler.cc | 14 +- .../webui/settings/chromeos/device_name_handler.h | 2 +- .../chromeos/device_name_handler_unittest.cc | 12 +- .../settings/chromeos/device_power_handler.cc | 60 +- .../ui/webui/settings/chromeos/device_section.cc | 34 +- .../ui/webui/settings/chromeos/device_section.h | 15 +- .../settings/chromeos/device_storage_handler.cc | 66 +- .../settings/chromeos/device_storage_handler.h | 9 +- .../chromeos/device_storage_handler_unittest.cc | 12 +- .../webui/settings/chromeos/device_storage_util.cc | 39 + .../webui/settings/chromeos/device_storage_util.h | 20 + .../settings/chromeos/device_stylus_handler.cc | 16 +- .../chromeos/fast_pair_saved_devices_handler.cc | 251 ++++++ .../chromeos/fast_pair_saved_devices_handler.h | 71 ++ .../fast_pair_saved_devices_handler_unittest.cc | 618 +++++++++++++++ .../ui/webui/settings/chromeos/files_section.cc | 2 +- .../webui/settings/chromeos/fingerprint_handler.cc | 34 +- .../settings/chromeos/google_assistant_handler.cc | 4 +- .../settings/chromeos/google_assistant_handler.h | 2 +- .../ui/webui/settings/chromeos/guest_os_handler.cc | 25 +- .../browser/ui/webui/settings/chromeos/hierarchy.h | 2 +- .../ui/webui/settings/chromeos/internet_handler.cc | 21 +- .../ui/webui/settings/chromeos/internet_section.cc | 7 +- .../ui/webui/settings/chromeos/internet_section.h | 16 +- .../settings/chromeos/kerberos_accounts_handler.cc | 49 +- .../ui/webui/settings/chromeos/kerberos_section.cc | 2 +- .../webui/settings/chromeos/languages_section.cc | 16 +- .../ui/webui/settings/chromeos/main_section.cc | 13 +- .../settings/chromeos/metrics_consent_handler.cc | 9 +- .../chromeos/metrics_consent_handler_unittest.cc | 2 +- .../webui/settings/chromeos/multidevice_handler.cc | 112 ++- .../webui/settings/chromeos/multidevice_handler.h | 8 +- .../chromeos/multidevice_handler_unittest.cc | 115 ++- .../webui/settings/chromeos/multidevice_section.cc | 30 +- .../chromeos/multidevice_section_unittest.cc | 4 +- .../webui/settings/chromeos/os_settings_manager.cc | 4 +- .../chromeos/os_settings_manager_factory.cc | 2 +- .../chromeos/os_settings_manager_unittest.cc | 11 +- .../webui/settings/chromeos/os_settings_section.h | 4 +- .../ui/webui/settings/chromeos/os_settings_ui.cc | 21 +- .../ui/webui/settings/chromeos/os_settings_ui.h | 16 +- .../settings/chromeos/parental_controls_handler.cc | 29 +- .../ui/webui/settings/chromeos/people_section.cc | 32 +- .../chromeos/peripheral_data_access_handler.cc | 8 +- .../chromeos/personalization_hub_handler.cc | 6 +- .../settings/chromeos/personalization_section.cc | 193 +---- .../settings/chromeos/personalization_section.h | 4 - .../ui/webui/settings/chromeos/printing_section.cc | 2 +- .../webui/settings/chromeos/privacy_hub_handler.cc | 99 +++ .../webui/settings/chromeos/privacy_hub_handler.h | 47 ++ .../chromeos/privacy_hub_handler_unittest.cc | 214 +++++ .../ui/webui/settings/chromeos/privacy_section.cc | 24 +- .../ui/webui/settings/chromeos/reset_section.cc | 2 +- .../ui/webui/settings/chromeos/search/BUILD.gn | 21 - .../ui/webui/settings/chromeos/search/OWNERS | 5 - .../per_session_settings_user_action_tracker.cc | 124 --- .../per_session_settings_user_action_tracker.h | 67 -- ...ession_settings_user_action_tracker_unittest.cc | 176 ----- .../ui/webui/settings/chromeos/search/search.mojom | 135 ---- .../settings/chromeos/search/search_concept.h | 71 -- .../settings/chromeos/search/search_handler.cc | 340 -------- .../settings/chromeos/search/search_handler.h | 122 --- .../chromeos/search/search_handler_unittest.cc | 311 -------- .../chromeos/search/search_result_icon.mojom | 49 -- .../chromeos/search/search_tag_registry.cc | 216 ------ .../settings/chromeos/search/search_tag_registry.h | 111 --- .../search/search_tag_registry_unittest.cc | 154 ---- .../chromeos/search/user_action_recorder.mojom | 44 -- .../ui/webui/settings/chromeos/search_section.cc | 86 ++- .../chromeos/settings_user_action_tracker.h | 4 +- .../settings_user_action_tracker_unittest.cc | 4 +- .../settings/chromeos/switch_access_handler.cc | 30 +- .../ui/webui/settings/chromeos/tts_handler.cc | 28 +- .../settings/custom_home_pages_table_model.cc | 54 +- .../webui/settings/custom_home_pages_table_model.h | 18 +- .../browser/ui/webui/settings/downloads_handler.cc | 20 +- .../browser/ui/webui/settings/font_handler.cc | 11 +- .../browser/ui/webui/settings/font_handler.h | 4 +- .../ui/webui/settings/import_data_handler.cc | 12 +- .../incompatible_applications_handler_win.cc | 12 +- .../ui/webui/settings/metrics_reporting_handler.cc | 23 +- .../ui/webui/settings/metrics_reporting_handler.h | 2 +- .../ui/webui/settings/on_startup_handler.cc | 15 +- .../browser/ui/webui/settings/on_startup_handler.h | 1 + .../browser/ui/webui/settings/people_handler.cc | 126 ++- .../browser/ui/webui/settings/people_handler.h | 4 +- .../ui/webui/settings/people_handler_unittest.cc | 163 ++-- .../ui/webui/settings/privacy_sandbox_handler.cc | 101 +-- .../ui/webui/settings/privacy_sandbox_handler.h | 4 - .../settings/privacy_sandbox_handler_unittest.cc | 43 -- .../ui/webui/settings/profile_info_handler.cc | 13 +- .../ui/webui/settings/profile_info_handler.h | 2 +- .../settings/profile_info_handler_unittest.cc | 20 +- .../ui/webui/settings/protocol_handlers_handler.cc | 81 +- .../ui/webui/settings/protocol_handlers_handler.h | 9 +- .../ui/webui/settings/reset_settings_handler.cc | 4 +- .../ui/webui/settings/safety_check_handler.cc | 56 +- .../ui/webui/settings/safety_check_handler.h | 4 +- .../settings/safety_check_handler_unittest.cc | 37 +- .../ui/webui/settings/search_engines_handler.cc | 112 ++- .../ui/webui/settings/search_engines_handler.h | 10 +- .../settings_clear_browsing_data_handler.cc | 90 ++- .../settings_clear_browsing_data_handler.h | 4 +- ...ings_clear_browsing_data_handler_browsertest.cc | 5 +- .../settings/settings_cookies_view_handler.cc | 31 +- .../settings_cookies_view_handler_unittest.cc | 3 +- .../settings/settings_default_browser_handler.cc | 11 +- .../webui/settings/settings_interactive_uitest.cc | 64 +- .../settings_localized_strings_provider.cc | 760 +++++++++--------- .../settings/settings_manage_profile_handler.cc | 18 +- .../settings/settings_manage_profile_handler.h | 2 +- .../settings_media_devices_selection_handler.cc | 3 +- .../webui/settings/settings_secure_dns_handler.cc | 27 +- .../webui/settings/settings_secure_dns_handler.h | 2 +- .../settings_secure_dns_handler_browsertest.cc | 78 +- .../settings/settings_security_key_handler.cc | 177 ++++- .../webui/settings/settings_security_key_handler.h | 41 + .../settings/settings_startup_pages_handler.cc | 19 +- .../settings/settings_startup_pages_handler.h | 6 +- .../browser/ui/webui/settings/settings_ui.cc | 66 +- .../browser/ui/webui/settings/settings_utils.cc | 14 - .../browser/ui/webui/settings/settings_utils.h | 7 - .../shared_settings_localized_strings_provider.cc | 5 +- .../ui/webui/settings/site_settings_handler.cc | 249 +++--- .../ui/webui/settings/site_settings_handler.h | 4 +- .../settings/site_settings_handler_unittest.cc | 697 ++++++++++------- .../ui/webui/settings/site_settings_helper.cc | 178 ++--- .../ui/webui/settings/site_settings_helper.h | 46 +- .../settings/site_settings_helper_unittest.cc | 164 ++-- .../browser/ui/webui/side_panel/bookmarks/BUILD.gn | 2 + .../ui/webui/side_panel/bookmarks/bookmarks.mojom | 20 +- .../side_panel/bookmarks/bookmarks_page_handler.cc | 49 +- .../side_panel/bookmarks/bookmarks_page_handler.h | 7 +- .../bookmarks/bookmarks_side_panel_ui.cc | 15 + .../side_panel/bookmarks/bookmarks_side_panel_ui.h | 22 +- .../ui/webui/side_panel/customize_chrome/BUILD.gn | 13 + .../webui/side_panel/customize_chrome/DIR_METADATA | 3 + .../ui/webui/side_panel/customize_chrome/OWNERS | 4 + .../customize_chrome/customize_chrome.mojom | 15 + .../customize_chrome_browsertest.cc | 106 +++ .../customize_chrome_page_handler.cc | 42 + .../customize_chrome_page_handler.h | 41 + .../customize_chrome/customize_chrome_ui.cc | 50 ++ .../customize_chrome/customize_chrome_ui.h | 42 + .../history_clusters_side_panel_ui.cc | 12 +- .../ui/webui/side_panel/read_anything/BUILD.gn | 14 - .../browser/ui/webui/side_panel/read_anything/DEPS | 5 +- .../side_panel/read_anything/read_anything.mojom | 53 -- .../read_anything/read_anything_page_handler.cc | 51 +- .../read_anything/read_anything_page_handler.h | 34 +- .../read_anything/read_anything_prefs.cc | 42 + .../side_panel/read_anything/read_anything_prefs.h | 30 + .../side_panel/read_anything/read_anything_ui.h | 2 +- .../ui/webui/side_panel/reading_list/BUILD.gn | 2 + .../browser/ui/webui/side_panel/reading_list/DEPS | 3 + .../reading_list/reading_list_page_handler.cc | 2 +- .../side_panel/reading_list/reading_list_ui.cc | 15 + .../side_panel/reading_list/reading_list_ui.h | 25 +- chromium/chrome/browser/ui/webui/signin/OWNERS | 4 +- .../signin/dice_web_signin_intercept_handler.cc | 32 + .../signin/dice_web_signin_intercept_handler.h | 1 + .../signin/enterprise_profile_welcome_handler.cc | 13 + .../signin/enterprise_profile_welcome_handler.h | 4 + .../enterprise_profile_welcome_handler_unittest.cc | 10 +- .../webui/signin/enterprise_profile_welcome_ui.cc | 4 +- .../inline_login_dialog_chromeos_browsertest.cc | 4 +- .../ui/webui/signin/inline_login_handler.cc | 37 +- .../browser/ui/webui/signin/inline_login_handler.h | 12 +- .../webui/signin/inline_login_handler_chromeos.cc | 6 +- .../webui/signin/inline_login_handler_chromeos.h | 2 +- .../inline_login_handler_chromeos_browsertest.cc | 37 +- .../browser/ui/webui/signin/inline_login_ui.cc | 10 +- .../browser/ui/webui/signin/login_ui_test_utils.cc | 74 +- .../browser/ui/webui/signin/login_ui_test_utils.h | 7 + .../webui/signin/profile_customization_handler.cc | 18 +- .../webui/signin/profile_customization_handler.h | 16 +- .../ui/webui/signin/profile_customization_ui.cc | 24 +- .../ui/webui/signin/profile_customization_ui.h | 5 +- .../ui/webui/signin/profile_picker_handler.cc | 139 ++-- .../ui/webui/signin/profile_picker_handler.h | 34 +- .../signin/profile_picker_handler_unittest.cc | 50 +- .../profile_picker_lacros_sign_in_provider.cc | 2 +- .../profile_picker_lacros_sign_in_provider.h | 3 +- .../browser/ui/webui/signin/profile_picker_ui.cc | 28 +- .../ui/webui/signin/signin_helper_chromeos.cc | 14 +- .../ui/webui/signin/signin_helper_chromeos.h | 6 + .../signin/signin_helper_chromeos_browsertest.cc | 270 ++++--- .../browser/ui/webui/signin/signin_url_utils.cc | 100 +-- .../browser/ui/webui/signin/signin_url_utils.h | 40 +- .../ui/webui/signin/signin_url_utils_unittest.cc | 108 ++- .../ui/webui/signin/signin_utils_desktop.cc | 21 +- .../browser/ui/webui/signin/signin_utils_desktop.h | 8 +- .../ui/webui/signin/sync_confirmation_handler.cc | 4 - .../signin/sync_confirmation_handler_unittest.cc | 7 - .../ui/webui/signin/sync_confirmation_ui.cc | 141 ++-- .../browser/ui/webui/signin/sync_confirmation_ui.h | 25 +- .../browser/ui/webui/signin/turn_sync_on_helper.cc | 139 +++- .../browser/ui/webui/signin/turn_sync_on_helper.h | 20 +- .../turn_sync_on_helper_policy_fetch_tracker.cc | 14 +- .../webui/signin/turn_sync_on_helper_unittest.cc | 112 ++- .../chrome/browser/ui/webui/signin_internals_ui.cc | 10 +- .../chrome/browser/ui/webui/signin_internals_ui.h | 4 +- .../ui/webui/support_tool/support_tool_ui.cc | 278 +------ .../ui/webui/support_tool/support_tool_ui_utils.cc | 264 ++++++- .../ui/webui/support_tool/support_tool_ui_utils.h | 74 ++ .../support_tool/support_tool_ui_utils_unittest.cc | 85 ++ .../extension_statuses_handler.cc | 33 +- .../extension_statuses_handler.h | 6 +- .../file_metadata_handler.cc | 22 +- .../file_metadata_handler.h | 6 +- .../sync_file_system_internals_handler.cc | 32 +- .../sync_internals/sync_internals_browsertest.js | 51 +- .../sync_internals_message_handler.cc | 48 +- .../sync_internals_message_handler.h | 7 +- .../sync_internals_message_handler_unittest.cc | 58 +- chromium/chrome/browser/ui/webui/system_info_ui.cc | 11 +- .../chrome/browser/ui/webui/tab_search/BUILD.gn | 2 + .../ui/webui/tab_search/tab_search_page_handler.cc | 26 +- .../tab_search/tab_search_page_handler_unittest.cc | 5 +- .../browser/ui/webui/tab_search/tab_search_ui.cc | 2 + .../chrome/browser/ui/webui/tab_strip/BUILD.gn | 1 + .../browser/ui/webui/tab_strip/tab_strip.mojom | 3 - .../ui/webui/tab_strip/tab_strip_page_handler.cc | 107 +-- .../ui/webui/tab_strip/tab_strip_page_handler.h | 2 +- .../tab_strip/tab_strip_page_handler_unittest.cc | 87 ++- .../browser/ui/webui/tab_strip/tab_strip_ui.cc | 17 +- .../browser/ui/webui/tab_strip/tab_strip_ui.h | 10 + .../ui/webui/tab_strip/tab_strip_ui_browsertest.cc | 1 - .../ui/webui/tab_strip/tab_strip_ui_embedder.h | 1 - .../ui/webui/tab_strip/tab_strip_ui_util.cc | 6 +- .../chrome/browser/ui/webui/test_data_source.cc | 12 +- .../chrome/browser/ui/webui/test_data_source.h | 2 +- chromium/chrome/browser/ui/webui/theme_handler.cc | 4 +- chromium/chrome/browser/ui/webui/theme_source.cc | 131 +++- chromium/chrome/browser/ui/webui/theme_source.h | 9 +- .../browser/ui/webui/theme_source_unittest.cc | 14 +- .../chrome_translate_internals_handler.cc | 6 +- .../chrome_translate_internals_handler.h | 9 +- .../translate_internals/translate_internals_ui.cc | 5 +- .../ui/webui/usb_internals/usb_internals_ui.cc | 4 - .../browser/ui/webui/version/version_handler.cc | 15 +- .../ui/webui/version/version_handler_chromeos.cc | 31 +- .../ui/webui/version/version_handler_chromeos.h | 5 +- .../chrome/browser/ui/webui/version/version_ui.cc | 56 +- .../chrome/browser/ui/webui/version/version_ui.h | 6 + .../web_app_internals/web_app_internals_source.cc | 61 +- .../web_app_internals/web_app_internals_source.h | 6 +- .../web_dialog_web_contents_delegate_unittest.cc | 3 +- chromium/chrome/browser/ui/webui/webapks/OWNERS | 1 + .../browser/ui/webui/webapks/webapks_handler.cc | 61 +- .../ui/webui/webui_allowlist_provider_unittest.cc | 24 +- chromium/chrome/browser/ui/webui/webui_util.cc | 4 + .../browser/ui/webui/webui_webview_browsertest.cc | 131 ++-- chromium/chrome/browser/ui/webui/welcome/helpers.h | 2 +- .../ui/webui/welcome/ntp_background_handler.cc | 2 +- .../browser/ui/webui/whats_new/whats_new_ui.cc | 9 +- 820 files changed, 19645 insertions(+), 16310 deletions(-) create mode 100644 chromium/chrome/browser/ui/android/fast_checkout/BUILD.gn create mode 100644 chromium/chrome/browser/ui/android/fast_checkout/internal/BUILD.gn create mode 100644 chromium/chrome/browser/ui/android/fast_checkout/internal/java/strings/android_fast_checkout_strings.grd create mode 100644 chromium/chrome/browser/ui/ash/system_web_apps/BUILD.gn create mode 100644 chromium/chrome/browser/ui/web_applications/BUILD.gn create mode 100644 chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_dialog_browsertest.cc create mode 100644 chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_browsertest.cc create mode 100644 chromium/chrome/browser/ui/webui/apc_internals/apc_internals_logins_request.cc create mode 100644 chromium/chrome/browser/ui/webui/apc_internals/apc_internals_logins_request.h create mode 100644 chromium/chrome/browser/ui/webui/app_home/BUILD.gn create mode 100644 chromium/chrome/browser/ui/webui/app_home/DIR_METADATA create mode 100644 chromium/chrome/browser/ui/webui/app_home/OWNERS create mode 100644 chromium/chrome/browser/ui/webui/app_home/app_home.mojom create mode 100644 chromium/chrome/browser/ui/webui/app_home/app_home_page_handler.cc create mode 100644 chromium/chrome/browser/ui/webui/app_home/app_home_page_handler.h create mode 100644 chromium/chrome/browser/ui/webui/app_home/app_home_page_handler_test.cc create mode 100644 chromium/chrome/browser/ui/webui/app_home/app_home_ui.cc create mode 100644 chromium/chrome/browser/ui/webui/app_home/app_home_ui.h create mode 100644 chromium/chrome/browser/ui/webui/app_home/mock_app_home_page.cc create mode 100644 chromium/chrome/browser/ui/webui/app_home/mock_app_home_page.h create mode 100644 chromium/chrome/browser/ui/webui/browser_command/DEPS create mode 100644 chromium/chrome/browser/ui/webui/chromeos/cloud_upload/BUILD.gn create mode 100644 chromium/chrome/browser/ui/webui/chromeos/cloud_upload/OWNERS create mode 100644 chromium/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload.mojom create mode 100644 chromium/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_dialog.cc create mode 100644 chromium/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_dialog.h create mode 100644 chromium/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_page_handler.cc create mode 100644 chromium/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_page_handler.h create mode 100644 chromium/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_ui.cc create mode 100644 chromium/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_ui.h create mode 100644 chromium/chrome/browser/ui/webui/chromeos/manage_mirrorsync/BUILD.gn create mode 100644 chromium/chrome/browser/ui/webui/chromeos/manage_mirrorsync/DIR_METADATA create mode 100644 chromium/chrome/browser/ui/webui/chromeos/manage_mirrorsync/OWNERS create mode 100644 chromium/chrome/browser/ui/webui/chromeos/manage_mirrorsync/manage_mirrorsync.mojom create mode 100644 chromium/chrome/browser/ui/webui/chromeos/manage_mirrorsync/manage_mirrorsync_dialog.cc create mode 100644 chromium/chrome/browser/ui/webui/chromeos/manage_mirrorsync/manage_mirrorsync_dialog.h create mode 100644 chromium/chrome/browser/ui/webui/chromeos/manage_mirrorsync/manage_mirrorsync_dialog_browsertest.cc create mode 100644 chromium/chrome/browser/ui/webui/chromeos/manage_mirrorsync/manage_mirrorsync_page_handler.cc create mode 100644 chromium/chrome/browser/ui/webui/chromeos/manage_mirrorsync/manage_mirrorsync_page_handler.h create mode 100644 chromium/chrome/browser/ui/webui/chromeos/manage_mirrorsync/manage_mirrorsync_ui.cc create mode 100644 chromium/chrome/browser/ui/webui/chromeos/manage_mirrorsync/manage_mirrorsync_ui.h create mode 100644 chromium/chrome/browser/ui/webui/chromeos/notification_tester/DEPS create mode 100644 chromium/chrome/browser/ui/webui/chromeos/notification_tester/OWNERS create mode 100644 chromium/chrome/browser/ui/webui/chromeos/notification_tester/notification_tester_handler.cc create mode 100644 chromium/chrome/browser/ui/webui/chromeos/notification_tester/notification_tester_handler.h delete mode 100644 chromium/chrome/browser/ui/webui/chromeos/video_source.cc delete mode 100644 chromium/chrome/browser/ui/webui/chromeos/video_source.h delete mode 100644 chromium/chrome/browser/ui/webui/domain_reliability_internals_ui.cc delete mode 100644 chromium/chrome/browser/ui/webui/domain_reliability_internals_ui.h create mode 100644 chromium/chrome/browser/ui/webui/intro/DIR_METADATA create mode 100644 chromium/chrome/browser/ui/webui/intro/OWNERS create mode 100644 chromium/chrome/browser/ui/webui/intro/intro_handler.cc create mode 100644 chromium/chrome/browser/ui/webui/intro/intro_handler.h create mode 100644 chromium/chrome/browser/ui/webui/intro/intro_ui.cc create mode 100644 chromium/chrome/browser/ui/webui/intro/intro_ui.h create mode 100644 chromium/chrome/browser/ui/webui/password_manager/password_manager_ui.cc create mode 100644 chromium/chrome/browser/ui/webui/password_manager/password_manager_ui.h delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/cloud_policy_core_status_provider.cc delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/cloud_policy_core_status_provider.h delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/device_active_directory_policy_status_provider.cc delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/device_active_directory_policy_status_provider.h delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/device_cloud_policy_status_provider_chromeos.cc delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/device_cloud_policy_status_provider_chromeos.h delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/device_local_account_policy_status_provider.cc delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/device_local_account_policy_status_provider.h delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/device_policy_status_provider_lacros.cc delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/device_policy_status_provider_lacros.h delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/status_provider_util.cc delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/status_provider_util.h delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/updater_status_provider.cc delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/updater_status_provider.h delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/user_active_directory_policy_status_provider.cc delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/user_active_directory_policy_status_provider.h delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/user_cloud_policy_status_provider.cc delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/user_cloud_policy_status_provider.h delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/user_cloud_policy_status_provider_chromeos.cc delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/user_cloud_policy_status_provider_chromeos.h delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/user_policy_status_provider_lacros.cc delete mode 100644 chromium/chrome/browser/ui/webui/policy/status_provider/user_policy_status_provider_lacros.h create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/BUILD.gn create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/OWNERS create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.cc create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.h create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker_unittest.cc create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/search.mojom create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/search_concept.h create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/search_handler.cc create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/search_handler.h create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/search_handler_unittest.cc create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/search_result_icon.mojom create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/search_tag_registry.cc create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/search_tag_registry.h create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/search_tag_registry_unittest.cc create mode 100644 chromium/chrome/browser/ui/webui/settings/ash/search/user_action_recorder.mojom create mode 100644 chromium/chrome/browser/ui/webui/settings/autofill_assistant_handler.cc create mode 100644 chromium/chrome/browser/ui/webui/settings/autofill_assistant_handler.h delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/ambient_mode_handler.cc delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/ambient_mode_handler.h delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/ambient_mode_handler_unittest.cc create mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/device_storage_util.cc create mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/device_storage_util.h create mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/fast_pair_saved_devices_handler.cc create mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/fast_pair_saved_devices_handler.h create mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/fast_pair_saved_devices_handler_unittest.cc create mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/privacy_hub_handler.cc create mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/privacy_hub_handler.h create mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/privacy_hub_handler_unittest.cc delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/BUILD.gn delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/OWNERS delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/per_session_settings_user_action_tracker.cc delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/per_session_settings_user_action_tracker.h delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/per_session_settings_user_action_tracker_unittest.cc delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/search.mojom delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/search_concept.h delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/search_handler.cc delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/search_handler.h delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/search_handler_unittest.cc delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/search_result_icon.mojom delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/search_tag_registry.cc delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/search_tag_registry.h delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/search_tag_registry_unittest.cc delete mode 100644 chromium/chrome/browser/ui/webui/settings/chromeos/search/user_action_recorder.mojom create mode 100644 chromium/chrome/browser/ui/webui/side_panel/customize_chrome/BUILD.gn create mode 100644 chromium/chrome/browser/ui/webui/side_panel/customize_chrome/DIR_METADATA create mode 100644 chromium/chrome/browser/ui/webui/side_panel/customize_chrome/OWNERS create mode 100644 chromium/chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome.mojom create mode 100644 chromium/chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_browsertest.cc create mode 100644 chromium/chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_page_handler.cc create mode 100644 chromium/chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_page_handler.h create mode 100644 chromium/chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_ui.cc create mode 100644 chromium/chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_ui.h delete mode 100644 chromium/chrome/browser/ui/webui/side_panel/read_anything/BUILD.gn delete mode 100644 chromium/chrome/browser/ui/webui/side_panel/read_anything/read_anything.mojom create mode 100644 chromium/chrome/browser/ui/webui/side_panel/read_anything/read_anything_prefs.cc create mode 100644 chromium/chrome/browser/ui/webui/side_panel/read_anything/read_anything_prefs.h create mode 100644 chromium/chrome/browser/ui/webui/side_panel/reading_list/DEPS create mode 100644 chromium/chrome/browser/ui/webui/webapks/OWNERS (limited to 'chromium/chrome/browser/ui') diff --git a/chromium/chrome/browser/ui/BUILD.gn b/chromium/chrome/browser/ui/BUILD.gn index 583a685cd12..17c1f3e28c7 100644 --- a/chromium/chrome/browser/ui/BUILD.gn +++ b/chromium/chrome/browser/ui/BUILD.gn @@ -3,7 +3,7 @@ # found in the LICENSE file. import("//build/config/buildflags_paint_preview.gni") -import("//build/config/chromecast_build.gni") +import("//build/config/chromebox_for_meetings/buildflags.gni") import("//build/config/chromeos/ui_mode.gni") import("//build/config/compiler/compiler.gni") import("//build/config/features.gni") @@ -12,7 +12,6 @@ import("//build/config/ui.gni") import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/ash/components/assistant/assistant.gni") -import("//chromeos/components/chromebox_for_meetings/buildflags/buildflags.gni") import("//chromeos/dbus/config/use_real_dbus_clients.gni") import("//components/feed/features.gni") import("//components/nacl/features.gni") @@ -109,8 +108,6 @@ static_library("ui") { "find_bar/find_bar_state.h", "find_bar/find_bar_state_factory.cc", "find_bar/find_bar_state_factory.h", - "interventions/framebust_block_message_delegate.cc", - "interventions/framebust_block_message_delegate.h", "interventions/intervention_delegate.h", "interventions/intervention_infobar_delegate.cc", "interventions/intervention_infobar_delegate.h", @@ -144,9 +141,6 @@ static_library("ui") { "passwords/password_manager_navigation_throttle.h", "passwords/settings/password_manager_porter.cc", "passwords/settings/password_manager_porter.h", - "passwords/settings/password_manager_presenter.cc", - "passwords/settings/password_manager_presenter.h", - "passwords/settings/password_ui_view.h", "passwords/ui_utils.cc", "passwords/ui_utils.h", "passwords/well_known_change_password_navigation_throttle.cc", @@ -222,6 +216,8 @@ static_library("ui") { "webui/about_ui.h", "webui/apc_internals/apc_internals_handler.cc", "webui/apc_internals/apc_internals_handler.h", + "webui/apc_internals/apc_internals_logins_request.cc", + "webui/apc_internals/apc_internals_logins_request.h", "webui/apc_internals/apc_internals_ui.cc", "webui/apc_internals/apc_internals_ui.h", "webui/autofill_and_password_manager_internals/autofill_internals_ui.cc", @@ -248,8 +244,6 @@ static_library("ui") { "webui/crashes_ui.h", "webui/device_log_ui.cc", "webui/device_log_ui.h", - "webui/domain_reliability_internals_ui.cc", - "webui/domain_reliability_internals_ui.h", "webui/download_internals/download_internals_ui.cc", "webui/download_internals/download_internals_ui.h", "webui/download_internals/download_internals_ui_message_handler.cc", @@ -300,12 +294,6 @@ static_library("ui") { "webui/policy/policy_ui.h", "webui/policy/policy_ui_handler.cc", "webui/policy/policy_ui_handler.h", - "webui/policy/status_provider/cloud_policy_core_status_provider.cc", - "webui/policy/status_provider/cloud_policy_core_status_provider.h", - "webui/policy/status_provider/status_provider_util.cc", - "webui/policy/status_provider/status_provider_util.h", - "webui/policy/status_provider/user_cloud_policy_status_provider.cc", - "webui/policy/status_provider/user_cloud_policy_status_provider.h", "webui/predictors/predictors_handler.cc", "webui/predictors/predictors_handler.h", "webui/predictors/predictors_ui.cc", @@ -394,6 +382,7 @@ static_library("ui") { "//base/allocator:buildflags", "//build:branding_buildflags", "//build:chromeos_buildflags", + "//build/config/chromebox_for_meetings:buildflags", "//cc/paint", "//chrome:extra_resources", "//chrome:resources", @@ -409,8 +398,8 @@ static_library("ui") { "//chrome/browser:dev_ui_browser_resources", "//chrome/browser:resource_prefetch_predictor_proto", "//chrome/browser/breadcrumbs", - "//chrome/browser/commerce/shopping_list", "//chrome/browser/devtools", + "//chrome/browser/favicon", "//chrome/browser/image_decoder", "//chrome/browser/media:mojo_bindings", "//chrome/browser/media/router:media_router_feature", @@ -430,20 +419,16 @@ static_library("ui") { "//chrome/browser/share", "//chrome/browser/ui/webui:configs", "//chrome/browser/ui/webui/bluetooth_internals", - "//chrome/browser/ui/webui/downloads:mojo_bindings", "//chrome/browser/ui/webui/omnibox:mojo_bindings", - "//chrome/browser/ui/webui/realbox:mojo_bindings", "//chrome/browser/ui/webui/segmentation_internals:mojo_bindings", - "//chrome/browser/ui/webui/side_panel/bookmarks:mojo_bindings", - "//chrome/browser/ui/webui/side_panel/read_anything:mojo_bindings", - "//chrome/browser/ui/webui/side_panel/reading_list:mojo_bindings", - "//chrome/browser/ui/webui/tab_search:mojo_bindings", "//chrome/browser/ui/webui/usb_internals:mojo_bindings", "//chrome/browser/video_tutorials", "//chrome/common", "//chrome/common/net", "//chrome/common/search:mojo_bindings", "//chrome/installer/util:with_no_strings", + "//chrome/services/media_gallery_util/public/cpp", + "//chrome/services/media_gallery_util/public/mojom", "//chrome/services/qrcode_generator/public/cpp", "//chrome/services/qrcode_generator/public/mojom", "//components/about_ui", @@ -522,7 +507,6 @@ static_library("ui") { "//components/live_caption:utils", "//components/local_state", "//components/lookalikes/core", - "//components/metrics:content", "//components/metrics_services_manager", "//components/navigation_metrics", "//components/net_log", @@ -540,7 +524,9 @@ static_library("ui") { "//components/password_manager/content/browser", "//components/password_manager/core/browser", "//components/password_manager/core/browser:affiliation", - "//components/password_manager/core/browser:csv", + "//components/password_manager/core/browser:import_results", + "//components/password_manager/core/browser/import:csv", + "//components/password_manager/core/browser/import:importer", "//components/password_manager/core/common", "//components/payments/content:utils", "//components/payments/content/icon", @@ -565,6 +551,7 @@ static_library("ui") { "//components/safe_browsing/core/browser/db:database_manager", "//components/safe_browsing/core/browser/db:util", "//components/safe_browsing/core/browser/password_protection:password_protection_metrics_util", + "//components/safe_browsing/core/browser/tailored_security_service", "//components/safe_browsing/core/common", "//components/safe_browsing/core/common:safe_browsing_prefs", "//components/safe_browsing/core/common/proto:csd_proto", @@ -676,6 +663,7 @@ static_library("ui") { allow_circular_includes_from = [ # TODO(crbug.com/1158905): Remove this circular dependency. "//chrome/browser/devtools", + "//chrome/browser/favicon", "//chrome/browser/safe_browsing", "//chrome/browser/ui/webui/bluetooth_internals", "//chrome/browser/profiling_host", @@ -774,6 +762,10 @@ static_library("ui") { "android/device_dialog/usb_chooser_dialog_android.cc", "android/device_dialog/usb_chooser_dialog_android.h", "android/external_protocol_dialog_android.cc", + "android/fast_checkout/fast_checkout_view_impl.cc", + "android/fast_checkout/fast_checkout_view_impl.h", + "android/fast_checkout/ui_view_android_utils.cc", + "android/fast_checkout/ui_view_android_utils.h", "android/infobars/autofill_credit_card_filling_infobar.cc", "android/infobars/autofill_credit_card_filling_infobar.h", "android/infobars/autofill_offer_notification_infobar.cc", @@ -784,8 +776,6 @@ static_library("ui") { "android/infobars/autofill_virtual_card_enrollment_infobar.h", "android/infobars/duplicate_download_infobar.cc", "android/infobars/duplicate_download_infobar.h", - "android/infobars/framebust_block_infobar.cc", - "android/infobars/framebust_block_infobar.h", "android/infobars/generated_password_saved_infobar.cc", "android/infobars/generated_password_saved_infobar.h", "android/infobars/grouped_permission_infobar.cc", @@ -869,6 +859,10 @@ static_library("ui") { "autofill/payments/virtual_card_enroll_bubble_controller_impl.cc", "autofill/payments/virtual_card_enroll_bubble_controller_impl.h", "browser_otr_state_android.cc", + "fast_checkout/fast_checkout_controller.h", + "fast_checkout/fast_checkout_controller_impl.cc", + "fast_checkout/fast_checkout_controller_impl.h", + "fast_checkout/fast_checkout_view.h", "javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_android.cc", "javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_android.h", "page_info/about_this_site_message_delegate_android.cc", @@ -965,6 +959,7 @@ static_library("ui") { "apps/chrome_app_window_client.h", "apps/directory_access_confirmation_dialog.cc", "apps/directory_access_confirmation_dialog.h", + "autofill_assistant/password_change/apc_scrim_manager.h", "autofill_assistant/password_change/apc_utils.cc", "autofill_assistant/password_change/apc_utils.h", "autofill_assistant/password_change/assistant_display_delegate.h", @@ -1001,6 +996,8 @@ static_library("ui") { "bookmarks/bookmark_utils_desktop.h", "bookmarks/recently_used_folders_combo_model.cc", "bookmarks/recently_used_folders_combo_model.h", + "bookmarks/test_bookmark_navigation_wrapper.cc", + "bookmarks/test_bookmark_navigation_wrapper.h", "breadcrumb_manager_browser_agent.cc", "breadcrumb_manager_browser_agent.h", "browser.cc", @@ -1207,9 +1204,9 @@ static_library("ui") { "omnibox/clipboard_utils.h", "omnibox/omnibox_tab_helper.cc", "omnibox/omnibox_tab_helper.h", - "omnibox/omnibox_theme.cc", "omnibox/omnibox_theme.h", "page_action/page_action_icon_type.h", + "page_info/about_this_site_side_panel.h", "page_info/chrome_accuracy_tip_ui.h", "page_info/page_info_dialog.cc", "page_info/page_info_dialog.h", @@ -1337,8 +1334,6 @@ static_library("ui") { "tabs/pinned_tab_service.h", "tabs/pinned_tab_service_factory.cc", "tabs/pinned_tab_service_factory.h", - "tabs/saved_tab_groups/saved_tab_group.cc", - "tabs/saved_tab_groups/saved_tab_group.h", "tabs/saved_tab_groups/saved_tab_group_keyed_service.cc", "tabs/saved_tab_groups/saved_tab_group_keyed_service.h", "tabs/saved_tab_groups/saved_tab_group_model.cc", @@ -1348,6 +1343,7 @@ static_library("ui") { "tabs/saved_tab_groups/saved_tab_group_model_observer.h", "tabs/saved_tab_groups/saved_tab_group_service_factory.cc", "tabs/saved_tab_groups/saved_tab_group_service_factory.h", + "tabs/tab.h", "tabs/tab_change_type.h", "tabs/tab_group.cc", "tabs/tab_group.h", @@ -1370,10 +1366,11 @@ static_library("ui") { "tabs/tab_strip_model_delegate.h", "tabs/tab_strip_model_observer.cc", "tabs/tab_strip_model_observer.h", - "tabs/tab_strip_model_order_controller.cc", - "tabs/tab_strip_model_order_controller.h", "tabs/tab_strip_model_stats_recorder.cc", "tabs/tab_strip_model_stats_recorder.h", + "tabs/tab_strip_scrubbing_metrics.cc", + "tabs/tab_strip_scrubbing_metrics.h", + "tabs/tab_strip_user_gesture_details.h", "tabs/tab_style.cc", "tabs/tab_style.h", "tabs/tab_switch_event_latency_recorder.cc", @@ -1578,6 +1575,8 @@ static_library("ui") { "webui/ntp/ntp_resource_cache_factory.h", "webui/page_not_available_for_guest/page_not_available_for_guest_ui.cc", "webui/page_not_available_for_guest/page_not_available_for_guest_ui.h", + "webui/password_manager/password_manager_ui.cc", + "webui/password_manager/password_manager_ui.h", "webui/plural_string_handler.cc", "webui/plural_string_handler.h", "webui/policy_indicator_localized_strings_provider.cc", @@ -1602,6 +1601,8 @@ static_library("ui") { "webui/settings/accessibility_main_handler.h", "webui/settings/appearance_handler.cc", "webui/settings/appearance_handler.h", + "webui/settings/autofill_assistant_handler.cc", + "webui/settings/autofill_assistant_handler.h", "webui/settings/browser_lifetime_handler.cc", "webui/settings/browser_lifetime_handler.h", "webui/settings/captions_handler.cc", @@ -1670,10 +1671,16 @@ static_library("ui") { "webui/side_panel/bookmarks/bookmarks_page_handler.h", "webui/side_panel/bookmarks/bookmarks_side_panel_ui.cc", "webui/side_panel/bookmarks/bookmarks_side_panel_ui.h", + "webui/side_panel/customize_chrome/customize_chrome_page_handler.cc", + "webui/side_panel/customize_chrome/customize_chrome_page_handler.h", + "webui/side_panel/customize_chrome/customize_chrome_ui.cc", + "webui/side_panel/customize_chrome/customize_chrome_ui.h", "webui/side_panel/history_clusters/history_clusters_side_panel_ui.cc", "webui/side_panel/history_clusters/history_clusters_side_panel_ui.h", "webui/side_panel/read_anything/read_anything_page_handler.cc", "webui/side_panel/read_anything/read_anything_page_handler.h", + "webui/side_panel/read_anything/read_anything_prefs.cc", + "webui/side_panel/read_anything/read_anything_prefs.h", "webui/side_panel/read_anything/read_anything_ui.cc", "webui/side_panel/read_anything/read_anything_ui.h", "webui/side_panel/reading_list/reading_list_page_handler.cc", @@ -1741,7 +1748,6 @@ static_library("ui") { "//chrome/browser:browser_themes", "//chrome/browser:theme_properties", "//chrome/browser/ash/system_web_apps/types:types", - "//chrome/browser/autofill_assistant/password_change/proto:proto", "//chrome/browser/autofill_assistant/password_change/vector_icons", "//chrome/browser/browsing_data:constants", "//chrome/browser/cart:mojo_bindings", @@ -1752,8 +1758,9 @@ static_library("ui") { "//chrome/browser/media/router/discovery/access_code:access_code_sink_service", "//chrome/browser/new_tab_page/chrome_colors:generate_chrome_colors_info", "//chrome/browser/new_tab_page/modules/drive:mojo_bindings", + "//chrome/browser/new_tab_page/modules/feed:mojo_bindings", "//chrome/browser/new_tab_page/modules/photos:mojo_bindings", - "//chrome/browser/new_tab_page/modules/task_module:mojo_bindings", + "//chrome/browser/new_tab_page/modules/recipes:mojo_bindings", "//chrome/browser/profile_resetter:profile_reset_report_proto", "//chrome/browser/resource_coordinator:tab_metrics_event_proto", "//chrome/browser/resource_coordinator/tab_ranker", @@ -1767,21 +1774,32 @@ static_library("ui") { "//chrome/browser/ui/commander:fuzzy_finder", "//chrome/browser/ui/webui/access_code_cast:mojo_bindings", "//chrome/browser/ui/webui/app_service_internals:mojo_bindings", + "//chrome/browser/ui/webui/downloads:mojo_bindings", "//chrome/browser/ui/webui/feed:mojo_bindings", "//chrome/browser/ui/webui/image_editor:image_editor_ui", "//chrome/browser/ui/webui/image_editor:mojo_bindings", "//chrome/browser/ui/webui/internals/user_education:mojo_bindings", "//chrome/browser/ui/webui/new_tab_page:mojo_bindings", "//chrome/browser/ui/webui/new_tab_page_third_party:mojo_bindings", + "//chrome/browser/ui/webui/realbox:mojo_bindings", + "//chrome/browser/ui/webui/side_panel/bookmarks:mojo_bindings", + "//chrome/browser/ui/webui/side_panel/customize_chrome:mojo_bindings", + "//chrome/browser/ui/webui/side_panel/reading_list:mojo_bindings", + "//chrome/browser/ui/webui/tab_search:mojo_bindings", "//chrome/browser/ui/webui/tab_strip:mojo_bindings", "//chrome/browser/web_applications", "//chrome/common:buildflags", "//chrome/common:version_header", + "//chrome/common/accessibility:mojo_bindings", "//chrome/common/search:mojo_bindings", "//chrome/common/themes:autogenerated_theme_util", "//components/app_constants", + "//components/autofill_assistant/browser/public/password_change/proto:proto", "//components/commerce/content/browser:hint", + "//components/commerce/core:cart_db_content_proto", "//components/commerce/core:feature_list", + "//components/commerce/core/mojom:mojo_bindings", + "//components/commerce/core/webui", "//components/enterprise/common:download_item_reroute_info", "//components/feedback/proto", "//components/keep_alive_registry", @@ -1793,6 +1811,7 @@ static_library("ui") { "//components/reading_list/features:flags", "//components/safe_browsing/core/common:safe_browsing_policy_handler", "//components/safety_check", + "//components/saved_tab_groups:core", "//components/search_provider_logos", "//components/services/app_service/public/cpp:app_types", "//components/services/app_service/public/cpp:app_update", @@ -1806,6 +1825,7 @@ static_library("ui") { "//components/url_formatter", "//components/url_param_filter/content", "//components/user_education/common", + "//components/user_education/webui", "//components/user_notes:features", "//components/vector_icons", "//components/web_modal", @@ -1824,6 +1844,7 @@ static_library("ui") { "//ui/base/dragdrop/mojom", "//ui/events", "//ui/webui/resources/cr_components/app_management:mojo_bindings", + "//ui/webui/resources/cr_components/help_bubble:mojo_bindings", "//ui/webui/resources/cr_components/history_clusters:mojo_bindings", "//ui/webui/resources/js/browser_command:mojo_bindings", "//ui/webui/resources/js/metrics_reporter:mojo_bindings", @@ -1834,6 +1855,7 @@ static_library("ui") { "//ui/base/dragdrop/mojom:mojom_headers", ] + # TODO(crbug.com/1030821): Resolve circular dependencies. allow_circular_includes_from += [ "//chrome/browser/media/router" ] if (use_ozone && !is_chromeos_ash) { @@ -1885,8 +1907,7 @@ static_library("ui") { assert(is_chromeos) sources += [ "supervised_user/parent_permission_dialog.h", - "views/supervised_user/extension_install_blocked_by_parent_dialog_view.cc", - "views/supervised_user/extension_install_blocked_by_parent_dialog_view.h", + "views/supervised_user/extension_install_blocked_by_parent_dialog.cc", "views/supervised_user/parent_permission_dialog_view.cc", "views/supervised_user/parent_permission_dialog_view.h", ] @@ -2082,6 +2103,7 @@ static_library("ui") { "app_list/search/omnibox_provider.h", "app_list/search/omnibox_result.cc", "app_list/search/omnibox_result.h", + "app_list/search/omnibox_util.cc", "app_list/search/omnibox_util.h", "app_list/search/open_tab_result.cc", "app_list/search/open_tab_result.h", @@ -2170,6 +2192,8 @@ static_library("ui") { "ash/accessibility/accessibility_controller_client.h", "ash/ambient/ambient_client_impl.cc", "ash/ambient/ambient_client_impl.h", + "ash/app_access_notifier.cc", + "ash/app_access_notifier.h", "ash/app_icon_color_cache.cc", "ash/app_icon_color_cache.h", "ash/arc_custom_tab_modal_dialog_host.cc", @@ -2235,6 +2259,8 @@ static_library("ui") { "ash/default_pinned_apps.h", "ash/desks/chrome_desks_templates_delegate.cc", "ash/desks/chrome_desks_templates_delegate.h", + "ash/desks/chrome_desks_util.cc", + "ash/desks/chrome_desks_util.h", "ash/desks/desks_client.cc", "ash/desks/desks_client.h", "ash/desks/desks_templates_app_launch_handler.cc", @@ -2245,6 +2271,10 @@ static_library("ui") { "ash/device_scheduled_reboot/scheduled_reboot_dialog.h", "ash/fwupd_download_client_impl.cc", "ash/fwupd_download_client_impl.h", + "ash/global_media_controls/cast_media_notification_producer_keyed_service.cc", + "ash/global_media_controls/cast_media_notification_producer_keyed_service.h", + "ash/global_media_controls/cast_media_notification_producer_keyed_service_factory.cc", + "ash/global_media_controls/cast_media_notification_producer_keyed_service_factory.h", "ash/holding_space/holding_space_client_impl.cc", "ash/holding_space/holding_space_client_impl.h", "ash/holding_space/holding_space_downloads_delegate.cc", @@ -2267,6 +2297,8 @@ static_library("ui") { "ash/ime_controller_client_impl.h", "ash/in_session_auth_dialog_client.cc", "ash/in_session_auth_dialog_client.h", + "ash/in_session_auth_token_provider_impl.cc", + "ash/in_session_auth_token_provider_impl.h", "ash/keyboard/chrome_keyboard_bounds_observer.cc", "ash/keyboard/chrome_keyboard_bounds_observer.h", "ash/keyboard/chrome_keyboard_controller_client.cc", @@ -2282,8 +2314,6 @@ static_library("ui") { "ash/login_screen_shown_observer.h", "ash/media_client_impl.cc", "ash/media_client_impl.h", - "ash/microphone_mute_notification_delegate_impl.cc", - "ash/microphone_mute_notification_delegate_impl.h", "ash/multi_user/multi_profile_support.cc", "ash/multi_user/multi_profile_support.h", "ash/multi_user/multi_user_context_menu.h", @@ -2312,10 +2342,14 @@ static_library("ui") { "ash/projector/projector_app_client_impl.h", "ash/projector/projector_client_impl.cc", "ash/projector/projector_client_impl.h", + "ash/projector/projector_drivefs_provider.cc", + "ash/projector/projector_drivefs_provider.h", "ash/projector/projector_soda_installation_controller.cc", "ash/projector/projector_soda_installation_controller.h", "ash/projector/projector_utils.cc", "ash/projector/projector_utils.h", + "ash/projector/screencast_manager.cc", + "ash/projector/screencast_manager.h", "ash/screen_orientation_delegate_chromeos.cc", "ash/screen_orientation_delegate_chromeos.h", "ash/screenshot_area.cc", @@ -2426,6 +2460,10 @@ static_library("ui") { "ash/test_ime_controller.h", "ash/thumbnail_loader.cc", "ash/thumbnail_loader.h", + "ash/touch_selection_menu_chromeos.cc", + "ash/touch_selection_menu_chromeos.h", + "ash/touch_selection_menu_runner_chromeos.cc", + "ash/touch_selection_menu_runner_chromeos.h", "ash/vpn_list_forwarder.cc", "ash/vpn_list_forwarder.h", "ash/wallpaper_controller_client_impl.cc", @@ -2471,8 +2509,6 @@ static_library("ui") { "views/crostini/crostini_uninstaller_view.h", "views/crostini/crostini_update_filesystem_view.cc", "views/crostini/crostini_update_filesystem_view.h", - "views/extensions/request_file_system_dialog_view.cc", - "views/extensions/request_file_system_dialog_view.h", "views/frame/browser_frame_ash.cc", "views/frame/browser_frame_ash.h", "views/frame/custom_tab_browser_frame.cc", @@ -2490,16 +2526,10 @@ static_library("ui") { "views/select_file_dialog_extension.h", "views/select_file_dialog_extension_factory.cc", "views/select_file_dialog_extension_factory.h", - "views/touch_selection_menu_chromeos.cc", - "views/touch_selection_menu_chromeos.h", - "views/touch_selection_menu_runner_chromeos.cc", - "views/touch_selection_menu_runner_chromeos.h", "web_applications/file_stream_data_pipe_getter.cc", "web_applications/file_stream_data_pipe_getter.h", "webui/app_management/app_management_shelf_delegate_chromeos.cc", "webui/app_management/app_management_shelf_delegate_chromeos.h", - "webui/certificate_provisioning_ui_handler.cc", - "webui/certificate_provisioning_ui_handler.h", "webui/chromeos/account_manager/account_manager_error_ui.cc", "webui/chromeos/account_manager/account_manager_error_ui.h", "webui/chromeos/account_manager/account_migration_welcome_dialog.cc", @@ -2545,6 +2575,12 @@ static_library("ui") { "webui/chromeos/cellular_setup/mobile_setup_ui.h", "webui/chromeos/certificate_manager_dialog_ui.cc", "webui/chromeos/certificate_manager_dialog_ui.h", + "webui/chromeos/cloud_upload/cloud_upload_dialog.cc", + "webui/chromeos/cloud_upload/cloud_upload_dialog.h", + "webui/chromeos/cloud_upload/cloud_upload_page_handler.cc", + "webui/chromeos/cloud_upload/cloud_upload_page_handler.h", + "webui/chromeos/cloud_upload/cloud_upload_ui.cc", + "webui/chromeos/cloud_upload/cloud_upload_ui.h", "webui/chromeos/connectivity_diagnostics_dialog.cc", "webui/chromeos/connectivity_diagnostics_dialog.h", "webui/chromeos/crostini_installer/crostini_installer_dialog.cc", @@ -2757,6 +2793,12 @@ static_library("ui") { "webui/chromeos/login/welcome_screen_handler.h", "webui/chromeos/login/wrong_hwid_screen_handler.cc", "webui/chromeos/login/wrong_hwid_screen_handler.h", + "webui/chromeos/manage_mirrorsync/manage_mirrorsync_dialog.cc", + "webui/chromeos/manage_mirrorsync/manage_mirrorsync_dialog.h", + "webui/chromeos/manage_mirrorsync/manage_mirrorsync_page_handler.cc", + "webui/chromeos/manage_mirrorsync/manage_mirrorsync_page_handler.h", + "webui/chromeos/manage_mirrorsync/manage_mirrorsync_ui.cc", + "webui/chromeos/manage_mirrorsync/manage_mirrorsync_ui.h", "webui/chromeos/multidevice_internals/multidevice_internals_logs_handler.cc", "webui/chromeos/multidevice_internals/multidevice_internals_logs_handler.h", "webui/chromeos/multidevice_internals/multidevice_internals_phone_hub_handler.cc", @@ -2773,6 +2815,8 @@ static_library("ui") { "webui/chromeos/network_logs_message_handler.h", "webui/chromeos/network_ui.cc", "webui/chromeos/network_ui.h", + "webui/chromeos/notification_tester/notification_tester_handler.cc", + "webui/chromeos/notification_tester/notification_tester_handler.h", "webui/chromeos/notification_tester/notification_tester_ui.cc", "webui/chromeos/notification_tester/notification_tester_ui.h", "webui/chromeos/onc_import_message_handler.cc", @@ -2811,8 +2855,6 @@ static_library("ui") { "webui/chromeos/system_web_dialog_delegate.h", "webui/chromeos/user_image_source.cc", "webui/chromeos/user_image_source.h", - "webui/chromeos/video_source.cc", - "webui/chromeos/video_source.h", "webui/chromeos/vm/vm_ui.cc", "webui/chromeos/vm/vm_ui.h", "webui/extensions/ash/kiosk_apps_handler.cc", @@ -2841,21 +2883,18 @@ static_library("ui") { "webui/nearby_share/nearby_share_dialog_ui.h", "webui/nearby_share/shared_resources.cc", "webui/nearby_share/shared_resources.h", - "webui/policy/status_provider/device_active_directory_policy_status_provider.cc", - "webui/policy/status_provider/device_active_directory_policy_status_provider.h", - "webui/policy/status_provider/device_cloud_policy_status_provider_chromeos.cc", - "webui/policy/status_provider/device_cloud_policy_status_provider_chromeos.h", - "webui/policy/status_provider/device_local_account_policy_status_provider.cc", - "webui/policy/status_provider/device_local_account_policy_status_provider.h", - "webui/policy/status_provider/user_active_directory_policy_status_provider.cc", - "webui/policy/status_provider/user_active_directory_policy_status_provider.h", - "webui/policy/status_provider/user_cloud_policy_status_provider_chromeos.cc", - "webui/policy/status_provider/user_cloud_policy_status_provider_chromeos.h", "webui/settings/ash/app_management/app_management_uma.h", "webui/settings/ash/calculator/size_calculator.cc", "webui/settings/ash/calculator/size_calculator.h", "webui/settings/ash/os_apps_page/app_notification_handler.cc", "webui/settings/ash/os_apps_page/app_notification_handler.h", + "webui/settings/ash/search/per_session_settings_user_action_tracker.cc", + "webui/settings/ash/search/per_session_settings_user_action_tracker.h", + "webui/settings/ash/search/search_concept.h", + "webui/settings/ash/search/search_handler.cc", + "webui/settings/ash/search/search_handler.h", + "webui/settings/ash/search/search_tag_registry.cc", + "webui/settings/ash/search/search_tag_registry.h", "webui/settings/chromeos/about_section.cc", "webui/settings/chromeos/about_section.h", "webui/settings/chromeos/accessibility_handler.cc", @@ -2864,8 +2903,6 @@ static_library("ui") { "webui/settings/chromeos/accessibility_section.h", "webui/settings/chromeos/account_manager_handler.cc", "webui/settings/chromeos/account_manager_handler.h", - "webui/settings/chromeos/ambient_mode_handler.cc", - "webui/settings/chromeos/ambient_mode_handler.h", "webui/settings/chromeos/android_apps_handler.cc", "webui/settings/chromeos/android_apps_handler.h", "webui/settings/chromeos/apps_section.cc", @@ -2904,8 +2941,12 @@ static_library("ui") { "webui/settings/chromeos/device_section.h", "webui/settings/chromeos/device_storage_handler.cc", "webui/settings/chromeos/device_storage_handler.h", + "webui/settings/chromeos/device_storage_util.cc", + "webui/settings/chromeos/device_storage_util.h", "webui/settings/chromeos/device_stylus_handler.cc", "webui/settings/chromeos/device_stylus_handler.h", + "webui/settings/chromeos/fast_pair_saved_devices_handler.cc", + "webui/settings/chromeos/fast_pair_saved_devices_handler.h", "webui/settings/chromeos/files_section.cc", "webui/settings/chromeos/files_section.h", "webui/settings/chromeos/fingerprint_handler.cc", @@ -2963,19 +3004,14 @@ static_library("ui") { "webui/settings/chromeos/pref_names.h", "webui/settings/chromeos/printing_section.cc", "webui/settings/chromeos/printing_section.h", + "webui/settings/chromeos/privacy_hub_handler.cc", + "webui/settings/chromeos/privacy_hub_handler.h", "webui/settings/chromeos/privacy_section.cc", "webui/settings/chromeos/privacy_section.h", "webui/settings/chromeos/quick_unlock_handler.cc", "webui/settings/chromeos/quick_unlock_handler.h", "webui/settings/chromeos/reset_section.cc", "webui/settings/chromeos/reset_section.h", - "webui/settings/chromeos/search/per_session_settings_user_action_tracker.cc", - "webui/settings/chromeos/search/per_session_settings_user_action_tracker.h", - "webui/settings/chromeos/search/search_concept.h", - "webui/settings/chromeos/search/search_handler.cc", - "webui/settings/chromeos/search/search_handler.h", - "webui/settings/chromeos/search/search_tag_registry.cc", - "webui/settings/chromeos/search/search_tag_registry.h", "webui/settings/chromeos/search_section.cc", "webui/settings/chromeos/search_section.h", "webui/settings/chromeos/server_printer_url_util.cc", @@ -3009,14 +3045,12 @@ static_library("ui") { "//ash/app_list", "//ash/assistant/model", "//ash/assistant/util", - "//ash/components/account_manager", "//ash/components/arc", "//ash/components/arc/video_accelerator:protected_native_pixmap_query_client", - "//ash/components/audio", - "//ash/components/cryptohome", "//ash/components/disks", "//ash/components/drivefs", "//ash/components/drivefs/mojom:mojom", + "//ash/components/fwupd", "//ash/components/login/auth", "//ash/components/login/session", "//ash/components/multidevice", @@ -3027,7 +3061,6 @@ static_library("ui") { "//ash/components/proximity_auth", "//ash/components/settings", "//ash/components/tether", - "//ash/components/tpm", "//ash/constants", "//ash/keyboard/ui", "//ash/public/cpp", @@ -3035,6 +3068,7 @@ static_library("ui") { "//ash/public/cpp/resources:ash_public_unscaled_resources", "//ash/quick_pair/common", "//ash/quick_pair/keyed_service", + "//ash/quick_pair/proto:fastpair_proto", "//ash/quick_pair/repository", "//ash/quick_pair/ui", "//ash/services/cellular_setup", @@ -3080,8 +3114,10 @@ static_library("ui") { "//chrome/browser/ash", "//chrome/browser/ash/crosapi", "//chrome/browser/ash/crostini:crostini_installer_types_mojom", + "//chrome/browser/ash/system_web_apps", "//chrome/browser/chromeos", "//chrome/browser/chromeos/extensions/vpn_provider", + "//chrome/browser/chromeos/launcher_search:search_util", "//chrome/browser/media/router/discovery/access_code:access_code_cast_feature", "//chrome/browser/media/router/discovery/access_code:discovery_resources_proto", "//chrome/browser/nearby_sharing:share_target", @@ -3098,6 +3134,7 @@ static_library("ui") { "//chrome/browser/resources:internet_config_dialog_resources", "//chrome/browser/resources:internet_detail_dialog_resources", "//chrome/browser/resources/chromeos:multidevice_setup_resources", + "//chrome/browser/resources/chromeos/cloud_upload:resources", "//chrome/browser/ui/app_list/search/cros_action_history:cros_action_proto", "//chrome/browser/ui/app_list/search/ranking:proto", "//chrome/browser/ui/app_list/search/search_result_ranker:app_launch_event_logger_proto", @@ -3107,64 +3144,72 @@ static_library("ui") { "//chrome/browser/ui/quick_answers", "//chrome/browser/ui/webui/chromeos/add_supervision:mojo_bindings", "//chrome/browser/ui/webui/chromeos/audio:mojo_bindings", + "//chrome/browser/ui/webui/chromeos/cloud_upload:mojo_bindings", "//chrome/browser/ui/webui/chromeos/crostini_upgrader:mojo_bindings", "//chrome/browser/ui/webui/chromeos/launcher_internals:mojo_bindings", + "//chrome/browser/ui/webui/chromeos/manage_mirrorsync:mojo_bindings", "//chrome/browser/ui/webui/chromeos/parent_access:mojo_bindings", "//chrome/browser/ui/webui/chromeos/parent_access:proto", "//chrome/browser/ui/webui/chromeos/vm:mojo_bindings", "//chrome/browser/ui/webui/nearby_share:mojom", "//chrome/browser/ui/webui/nearby_share/public/mojom", "//chrome/browser/ui/webui/settings/ash/os_apps_page/mojom", - "//chrome/browser/ui/webui/settings/chromeos/search:mojo_bindings", + "//chrome/browser/ui/webui/settings/ash/search:mojo_bindings", "//chrome/browser/web_applications", + "//chrome/browser/webshare:storage", "//chrome/services/file_util/public/cpp", + "//chromeos/ash/components/account_manager", "//chromeos/ash/components/assistant:buildflags", + "//chromeos/ash/components/audio", + "//chromeos/ash/components/cryptohome", + "//chromeos/ash/components/dbus", + "//chromeos/ash/components/dbus/audio", + "//chromeos/ash/components/dbus/cryptohome", + "//chromeos/ash/components/dbus/cryptohome:cryptohome_proto", + "//chromeos/ash/components/dbus/hermes", + "//chromeos/ash/components/dbus/human_presence", "//chromeos/ash/components/dbus/kerberos:kerberos_proto", "//chromeos/ash/components/dbus/os_install", "//chromeos/ash/components/dbus/pciguard:pciguard", + "//chromeos/ash/components/dbus/session_manager", + "//chromeos/ash/components/dbus/shill", "//chromeos/ash/components/dbus/spaced", "//chromeos/ash/components/dbus/system_clock", + "//chromeos/ash/components/dbus/update_engine", "//chromeos/ash/components/dbus/upstart", + "//chromeos/ash/components/dbus/userdataauth", + "//chromeos/ash/components/dbus/userdataauth:userdataauth_proto", "//chromeos/ash/components/human_presence", + "//chromeos/ash/components/install_attributes", + "//chromeos/ash/components/local_search_service/public/cpp", + "//chromeos/ash/components/local_search_service/public/mojom", + "//chromeos/ash/components/network", "//chromeos/ash/components/network/portal_detector", "//chromeos/ash/components/oobe_quick_start", + "//chromeos/ash/components/string_matching", "//chromeos/ash/resources", "//chromeos/ash/services/assistant:lib", - "//chromeos/components/local_search_service/public/cpp", - "//chromeos/components/local_search_service/public/mojom", + "//chromeos/ash/services/assistant/public/cpp", + "//chromeos/ash/services/assistant/public/mojom", + "//chromeos/ash/services/assistant/public/proto", + "//chromeos/ash/services/auth_factor_config", "//chromeos/components/onc", "//chromeos/components/quick_answers", "//chromeos/components/quick_answers/public/cpp:cpp", "//chromeos/components/quick_answers/public/cpp:prefs", "//chromeos/components/sharesheet:constants", - "//chromeos/components/string_matching", "//chromeos/constants", "//chromeos/crosapi/cpp", "//chromeos/crosapi/cpp:crosapi_constants", - "//chromeos/dbus", - "//chromeos/dbus/audio", - "//chromeos/dbus/cryptohome", - "//chromeos/dbus/cryptohome:cryptohome_proto", - "//chromeos/dbus/hermes", - "//chromeos/dbus/human_presence", - "//chromeos/dbus/power", - "//chromeos/dbus/session_manager", "//chromeos/dbus/tpm_manager", "//chromeos/dbus/tpm_manager:tpm_manager_proto", - "//chromeos/dbus/update_engine", - "//chromeos/dbus/userdataauth", - "//chromeos/dbus/userdataauth:userdataauth_proto", - "//chromeos/dbus/util", "//chromeos/login/login_state", - "//chromeos/network", "//chromeos/printing", - "//chromeos/services/assistant/public/cpp", - "//chromeos/services/assistant/public/mojom", - "//chromeos/services/assistant/public/proto", "//chromeos/services/assistant/public/shared", "//chromeos/services/bluetooth_config", "//chromeos/services/bluetooth_config:in_process_bluetooth_config", "//chromeos/services/bluetooth_config/public/mojom", + "//chromeos/services/network_config/public/cpp", "//chromeos/services/network_config/public/mojom", "//chromeos/services/network_health/public/mojom", "//chromeos/system", @@ -3172,6 +3217,7 @@ static_library("ui") { "//chromeos/ui/frame", "//chromeos/ui/vector_icons", "//chromeos/ui/wm", + "//chromeos/version", "//components/app_constants", "//components/app_restore", "//components/arc", @@ -3261,6 +3307,8 @@ static_library("ui") { "tabs/existing_window_sub_menu_model_chromeos.cc", "tabs/existing_window_sub_menu_model_chromeos.h", "views/extensions/print_job_confirmation_dialog.cc", + "views/extensions/request_file_system_dialog_view.cc", + "views/extensions/request_file_system_dialog_view.h", "views/frame/browser_frame_header_chromeos.cc", "views/frame/browser_frame_header_chromeos.h", "views/frame/browser_non_client_frame_view_chromeos.cc", @@ -3276,6 +3324,8 @@ static_library("ui") { "views/platform_keys_certificate_selector_chromeos.h", "views/tabs/tab_scrubber_chromeos.cc", "views/tabs/tab_scrubber_chromeos.h", + "webui/certificate_provisioning_ui_handler.cc", + "webui/certificate_provisioning_ui_handler.h", "webui/chromeos/chrome_url_disabled/chrome_url_disabled_ui.cc", "webui/chromeos/chrome_url_disabled/chrome_url_disabled_ui.h", "webui/version/version_handler_chromeos.cc", @@ -3284,9 +3334,11 @@ static_library("ui") { deps += [ "//chrome/app:generated_resources", "//chromeos/components/security_token_pin", + "//chromeos/dbus/power", "//chromeos/strings", "//components/account_manager_core:account_manager_core", "//ui/chromeos/styles:cros_styles_views", + "//ui/chromeos/styles:cros_tokens_color_mappings", ] } @@ -3304,10 +3356,6 @@ static_library("ui") { "views/frame/immersive_mode_controller_chromeos.h", "views/profiles/lacros_first_run_signed_in_flow_controller.cc", "views/profiles/lacros_first_run_signed_in_flow_controller.h", - "webui/policy/status_provider/device_policy_status_provider_lacros.cc", - "webui/policy/status_provider/device_policy_status_provider_lacros.h", - "webui/policy/status_provider/user_policy_status_provider_lacros.cc", - "webui/policy/status_provider/user_policy_status_provider_lacros.h", "webui/signin/profile_picker_lacros_sign_in_provider.cc", "webui/signin/profile_picker_lacros_sign_in_provider.h", "window_sizer/window_sizer_chromeos.cc", @@ -3376,6 +3424,8 @@ static_library("ui") { "views/privacy_sandbox/privacy_sandbox_notice_bubble.h", "views/profiles/incognito_menu_view.cc", "views/profiles/incognito_menu_view.h", + "views/profiles/profile_menu_coordinator.cc", + "views/profiles/profile_menu_coordinator.h", "views/profiles/profile_menu_view_base.cc", "views/profiles/profile_menu_view_base.h", "views/profiles/signin_view_controller_delegate_views.cc", @@ -3409,6 +3459,10 @@ static_library("ui") { "views/web_apps/deprecated_apps_dialog_view.h", "views/web_apps/force_installed_deprecated_apps_dialog_view.cc", "views/web_apps/force_installed_deprecated_apps_dialog_view.h", + "webui/app_home/app_home_page_handler.cc", + "webui/app_home/app_home_page_handler.h", + "webui/app_home/app_home_ui.cc", + "webui/app_home/app_home_ui.h", "webui/app_launcher_page_ui.cc", "webui/app_launcher_page_ui.h", "webui/app_settings/web_app_settings_navigation_throttle.cc", @@ -3420,6 +3474,8 @@ static_library("ui") { "webui/ntp/app_launcher_handler.cc", "webui/ntp/app_launcher_handler.h", ] + + deps += [ "//chrome/browser/ui/webui/app_home:mojo_bindings" ] } if (is_win || is_mac || is_fuchsia || is_linux || is_chromeos_lacros) { @@ -3454,6 +3510,10 @@ static_library("ui") { "views/profiles/profile_picker_view.cc", "views/profiles/profile_picker_view.h", "views/profiles/profile_picker_web_contents_host.h", + "webui/intro/intro_handler.cc", + "webui/intro/intro_handler.h", + "webui/intro/intro_ui.cc", + "webui/intro/intro_ui.h", "webui/profile_helper.cc", "webui/profile_helper.h", "webui/settings/settings_default_browser_handler.cc", @@ -3732,6 +3792,7 @@ static_library("ui") { deps += [ "//chrome/browser/apps/app_shim", + "//chrome/updater:browser_sources", "//components/remote_cocoa/app_shim", "//components/remote_cocoa/browser", "//extensions/components/native_app_window", @@ -3747,10 +3808,7 @@ static_library("ui") { weak_frameworks = [ "ScreenTime.framework" ] if (enable_chromium_updater) { - deps += [ - "//chrome/browser/updater:browser_updater_client", - "//chrome/updater:browser_sources", - ] + deps += [ "//chrome/browser/updater:browser_updater_client" ] } } @@ -3796,10 +3854,12 @@ static_library("ui") { "views/frame/native_browser_frame_factory_aura.cc", "views/frame/system_menu_insertion_delegate_win.cc", "views/frame/system_menu_insertion_delegate_win.h", - "views/frame/windows_10_caption_button.cc", - "views/frame/windows_10_caption_button.h", - "views/frame/windows_10_tab_search_caption_button.cc", - "views/frame/windows_10_tab_search_caption_button.h", + "views/frame/windows_caption_button.cc", + "views/frame/windows_caption_button.h", + "views/frame/windows_icon_painter.cc", + "views/frame/windows_icon_painter.h", + "views/frame/windows_tab_search_caption_button.cc", + "views/frame/windows_tab_search_caption_button.h", "views/network_profile_bubble_view.cc", "views/settings_reset_prompt_dialog.cc", "views/settings_reset_prompt_dialog.h", @@ -3823,8 +3883,6 @@ static_library("ui") { "webui/conflicts/conflicts_handler.h", "webui/conflicts/conflicts_ui.cc", "webui/conflicts/conflicts_ui.h", - "webui/policy/status_provider/updater_status_provider.cc", - "webui/policy/status_provider/updater_status_provider.h", "webui/sandbox/sandbox_handler.cc", "webui/sandbox/sandbox_handler.h", "webui/settings/chrome_cleanup_handler_win.cc", @@ -3875,12 +3933,7 @@ static_library("ui") { ] } } else { # 'OS!="win" - # The Cast Linux build sets toolkit_views to false, but many files in this - # target include views-related files unconditionally, causing `gn check` - # to fail on this variant. Since this target is only referenced (but not - # compiled) on this variant, it's okay to add this "incorrect" dependency - # to Cast Linux builds so that `gn check` passes. - if (toolkit_views || is_castos) { + if (toolkit_views) { public_deps += [ "//ui/views", "//ui/views/controls/webview", @@ -3907,6 +3960,10 @@ static_library("ui") { "views/window_sizer_linux.cc", "views/window_sizer_linux.h", ] + deps += [ + "//ui/linux:linux_ui", + "//ui/linux:linux_ui_factory", + ] } if (is_linux || is_chromeos_lacros || is_fuchsia) { @@ -3925,7 +3982,6 @@ static_library("ui") { "//ui/base/ime", "//ui/events:dom_keycode_converter", "//ui/platform_window", - "//ui/views/linux_ui:linux_ui_factory", ] if (use_dbus) { @@ -3975,20 +4031,27 @@ static_library("ui") { ] } - if (is_linux || is_chromeos) { # Both desktop Linux and ChromeOS. + if (enable_webui_certificate_viewer) { sources += [ "certificate_dialogs.cc", "certificate_dialogs.h", - "process_singleton_dialog_linux.h", "webui/certificate_viewer_ui.cc", "webui/certificate_viewer_ui.h", "webui/certificate_viewer_webui.cc", "webui/certificate_viewer_webui.h", + ] + deps += [ "//third_party/boringssl" ] + if (use_nss_certs) { + configs += [ "//build/config/linux/nss" ] + } + } + + if (is_linux || is_chromeos) { + sources += [ + "process_singleton_dialog_linux.h", "webui/webui_js_error/webui_js_error_ui.cc", "webui/webui_js_error/webui_js_error_ui.h", ] - deps += [ "//third_party/boringssl" ] - configs += [ "//build/config/linux/nss" ] if (use_aura) { deps += [ "//third_party/fontconfig" ] } @@ -4041,9 +4104,7 @@ static_library("ui") { "qrcode_generator/qrcode_generator_bubble_controller.cc", "qrcode_generator/qrcode_generator_bubble_controller.h", "qrcode_generator/qrcode_generator_bubble_view.h", - "send_tab_to_self/send_tab_to_self_bubble_controller.cc", - "send_tab_to_self/send_tab_to_self_bubble_controller.h", - "send_tab_to_self/send_tab_to_self_bubble_view.h", + "send_tab_to_self/send_tab_to_self_bubble.h", "send_tab_to_self/send_tab_to_self_toolbar_icon_controller.cc", "send_tab_to_self/send_tab_to_self_toolbar_icon_controller.h", "send_tab_to_self/send_tab_to_self_toolbar_icon_controller_delegate.h", @@ -4051,6 +4112,14 @@ static_library("ui") { "sharing_hub/screenshot/screenshot_captured_bubble_controller.h", "sharing_hub/sharing_hub_bubble_controller.h", "sharing_hub/sharing_hub_bubble_view.h", + "side_panel/customize_chrome/customize_chrome_side_panel_controller_utils.h", + "side_panel/customize_chrome/customize_chrome_tab_helper.cc", + "side_panel/customize_chrome/customize_chrome_tab_helper.h", + "views/send_tab_to_self/send_tab_to_self_bubble.cc", + "views/send_tab_to_self/send_tab_to_self_bubble_controller.cc", + "views/send_tab_to_self/send_tab_to_self_bubble_controller.h", + "views/send_tab_to_self/send_tab_to_self_bubble_view.cc", + "views/send_tab_to_self/send_tab_to_self_bubble_view.h", # This test header is included because it contains forward declarations # needed for "friend" statements for use in tests. @@ -4066,6 +4135,7 @@ static_library("ui") { "side_search/side_search_tab_contents_helper.h", "side_search/side_search_utils.cc", "side_search/side_search_utils.h", + "side_search/unified_side_search_helper.h", "sync/one_click_signin_links_delegate.h", "sync/one_click_signin_links_delegate_impl.cc", "sync/one_click_signin_links_delegate_impl.h", @@ -4167,11 +4237,19 @@ static_library("ui") { "views/autofill/save_update_address_profile_icon_view.h", "views/autofill/update_address_profile_view.cc", "views/autofill/update_address_profile_view.h", + "views/autofill_assistant/password_change/apc_scrim_manager_impl.cc", + "views/autofill_assistant/password_change/apc_scrim_manager_impl.h", "views/autofill_assistant/password_change/assistant_onboarding_view.cc", "views/autofill_assistant/password_change/assistant_onboarding_view.h", "views/autofill_assistant/password_change/assistant_side_panel_coordinator_impl.cc", "views/autofill_assistant/password_change/assistant_side_panel_coordinator_impl.h", + "views/autofill_assistant/password_change/password_change_animated_icon.cc", + "views/autofill_assistant/password_change/password_change_animated_icon.h", + "views/autofill_assistant/password_change/password_change_animated_progress_bar.cc", + "views/autofill_assistant/password_change/password_change_animated_progress_bar.h", "views/autofill_assistant/password_change/password_change_run_display.cc", + "views/autofill_assistant/password_change/password_change_run_progress.cc", + "views/autofill_assistant/password_change/password_change_run_progress.h", "views/autofill_assistant/password_change/password_change_run_view.cc", "views/autofill_assistant/password_change/password_change_run_view.h", "views/bookmarks/bookmark_bar_view.cc", @@ -4233,6 +4311,8 @@ static_library("ui") { "views/chrome_web_dialog_view.h", "views/collected_cookies_views.cc", "views/collected_cookies_views.h", + "views/color_provider_browser_helper.cc", + "views/color_provider_browser_helper.h", "views/commander_frontend_views.cc", "views/commander_frontend_views.h", "views/commerce/ntp_discount_consent_dialog_view.cc", @@ -4288,8 +4368,6 @@ static_library("ui") { "views/exclusive_access_bubble_views.cc", "views/exclusive_access_bubble_views.h", "views/exclusive_access_bubble_views_context.h", - "views/extensions/blocked_action_dialog_view.cc", - "views/extensions/blocked_action_dialog_view.h", "views/extensions/chooser_dialog_view.cc", "views/extensions/chooser_dialog_view.h", "views/extensions/expandable_container_view.cc", @@ -4322,6 +4400,8 @@ static_library("ui") { "views/extensions/extensions_request_access_button_hover_card.h", "views/extensions/extensions_request_access_dialog_view.cc", "views/extensions/extensions_request_access_dialog_view.h", + "views/extensions/extensions_tabbed_menu_coordinator.cc", + "views/extensions/extensions_tabbed_menu_coordinator.h", "views/extensions/extensions_tabbed_menu_view.cc", "views/extensions/extensions_tabbed_menu_view.h", "views/extensions/extensions_toolbar_button.cc", @@ -4330,8 +4410,12 @@ static_library("ui") { "views/extensions/extensions_toolbar_container.h", "views/extensions/extensions_toolbar_controls.cc", "views/extensions/extensions_toolbar_controls.h", + "views/extensions/reload_page_dialog_view.cc", + "views/extensions/reload_page_dialog_view.h", "views/extensions/site_settings_expand_button.cc", "views/extensions/site_settings_expand_button.h", + "views/file_system_access/file_system_access_dangerous_file_dialog_view.cc", + "views/file_system_access/file_system_access_dangerous_file_dialog_view.h", "views/file_system_access/file_system_access_icon_view.cc", "views/file_system_access/file_system_access_icon_view.h", "views/file_system_access/file_system_access_permission_view.cc", @@ -4379,6 +4463,8 @@ static_library("ui") { "views/frame/native_browser_frame.h", "views/frame/native_browser_frame_factory.cc", "views/frame/native_browser_frame_factory.h", + "views/frame/picture_in_picture_browser_frame_view.cc", + "views/frame/picture_in_picture_browser_frame_view.h", "views/frame/system_menu_model_builder.cc", "views/frame/system_menu_model_builder.h", "views/frame/system_menu_model_delegate.cc", @@ -4426,6 +4512,8 @@ static_library("ui") { "views/importer/import_lock_dialog_view.h", "views/incognito_clear_browsing_data_dialog.cc", "views/incognito_clear_browsing_data_dialog.h", + "views/incognito_clear_browsing_data_dialog_coordinator.cc", + "views/incognito_clear_browsing_data_dialog_coordinator.h", "views/infobars/alternate_nav_infobar_view.cc", "views/infobars/alternate_nav_infobar_view.h", "views/infobars/confirm_infobar.cc", @@ -4467,13 +4555,6 @@ static_library("ui") { "views/location_bar/omnibox_chip_button.cc", "views/location_bar/omnibox_chip_button.h", "views/location_bar/omnibox_chip_theme.h", - "views/location_bar/permission_chip.cc", - "views/location_bar/permission_chip.h", - "views/location_bar/permission_chip_delegate.h", - "views/location_bar/permission_quiet_chip.cc", - "views/location_bar/permission_quiet_chip.h", - "views/location_bar/permission_request_chip.cc", - "views/location_bar/permission_request_chip.h", "views/location_bar/selected_keyword_view.cc", "views/location_bar/selected_keyword_view.h", "views/location_bar/star_view.cc", @@ -4487,6 +4568,8 @@ static_library("ui") { "views/md_text_button_with_down_arrow.h", "views/media_router/cast_dialog_access_code_cast_button.cc", "views/media_router/cast_dialog_access_code_cast_button.h", + "views/media_router/cast_dialog_coordinator.cc", + "views/media_router/cast_dialog_coordinator.h", "views/media_router/cast_dialog_helper.cc", "views/media_router/cast_dialog_helper.h", "views/media_router/cast_dialog_metrics.cc", @@ -4575,6 +4658,10 @@ static_library("ui") { "views/page_action/pwa_install_view.h", "views/page_action/zoom_view.cc", "views/page_action/zoom_view.h", + "views/page_info/about_this_site_side_panel_coordinator.cc", + "views/page_info/about_this_site_side_panel_coordinator.h", + "views/page_info/about_this_site_side_panel_view.cc", + "views/page_info/about_this_site_side_panel_view.h", "views/page_info/accuracy_tip_bubble_view.cc", "views/page_info/accuracy_tip_bubble_view.h", "views/page_info/chosen_object_view.cc", @@ -4588,6 +4675,8 @@ static_library("ui") { "views/page_info/page_info_bubble_view.h", "views/page_info/page_info_bubble_view_base.cc", "views/page_info/page_info_bubble_view_base.h", + "views/page_info/page_info_cookies_content_view.cc", + "views/page_info/page_info_cookies_content_view.h", "views/page_info/page_info_history_controller.cc", "views/page_info/page_info_history_controller.h", "views/page_info/page_info_hover_button.cc", @@ -4646,10 +4735,6 @@ static_library("ui") { "views/passwords/views_utils.h", "views/payments/contact_info_editor_view_controller.cc", "views/payments/contact_info_editor_view_controller.h", - "views/payments/credit_card_editor_view_controller.cc", - "views/payments/credit_card_editor_view_controller.h", - "views/payments/cvc_unmask_view_controller.cc", - "views/payments/cvc_unmask_view_controller.h", "views/payments/editor_view_controller.cc", "views/payments/editor_view_controller.h", "views/payments/error_message_view_controller.cc", @@ -4695,12 +4780,26 @@ static_library("ui") { "views/payments/validation_delegate.h", "views/payments/view_stack.cc", "views/payments/view_stack.h", - "views/permission_bubble/chooser_bubble_ui.cc", - "views/permission_bubble/permission_prompt_bubble_view.cc", - "views/permission_bubble/permission_prompt_bubble_view.h", - "views/permission_bubble/permission_prompt_impl.cc", - "views/permission_bubble/permission_prompt_impl.h", - "views/permission_bubble/permission_prompt_style.h", + "views/permissions/chooser_bubble_ui.cc", + "views/permissions/permission_chip.cc", + "views/permissions/permission_chip.h", + "views/permissions/permission_chip_delegate.h", + "views/permissions/permission_prompt_bubble.cc", + "views/permissions/permission_prompt_bubble.h", + "views/permissions/permission_prompt_bubble_view.cc", + "views/permissions/permission_prompt_bubble_view.h", + "views/permissions/permission_prompt_chip.cc", + "views/permissions/permission_prompt_chip.h", + "views/permissions/permission_prompt_desktop.cc", + "views/permissions/permission_prompt_desktop.h", + "views/permissions/permission_prompt_factory.cc", + "views/permissions/permission_prompt_quiet_icon.cc", + "views/permissions/permission_prompt_quiet_icon.h", + "views/permissions/permission_prompt_style.h", + "views/permissions/permission_quiet_chip.cc", + "views/permissions/permission_quiet_chip.h", + "views/permissions/permission_request_chip.cc", + "views/permissions/permission_request_chip.h", "views/profiles/avatar_toolbar_button.cc", "views/profiles/avatar_toolbar_button.h", "views/profiles/avatar_toolbar_button_delegate.cc", @@ -4727,6 +4826,8 @@ static_library("ui") { "views/safe_browsing/password_reuse_modal_warning_dialog.h", "views/safe_browsing/prompt_for_scanning_modal_dialog.cc", "views/safe_browsing/prompt_for_scanning_modal_dialog.h", + "views/safe_browsing/tailored_security_desktop_dialog.cc", + "views/safe_browsing/tailored_security_desktop_dialog.h", "views/safe_browsing/tailored_security_unconsented_modal.cc", "views/safe_browsing/tailored_security_unconsented_modal.h", "views/send_tab_to_self/manage_account_devices_link_view.cc", @@ -4757,18 +4858,21 @@ static_library("ui") { "views/sharing_hub/sharing_hub_bubble_action_button.h", "views/sharing_hub/sharing_hub_bubble_util.cc", "views/sharing_hub/sharing_hub_bubble_util.h", - "views/sharing_hub/sharing_hub_bubble_view_impl.cc", - "views/sharing_hub/sharing_hub_bubble_view_impl.h", "views/sharing_hub/sharing_hub_icon_view.cc", "views/sharing_hub/sharing_hub_icon_view.h", "views/shopping_bubble/shopping_prompt_impl.cc", "views/shopping_bubble/shopping_prompt_impl.h", "views/side_panel/bookmarks/bookmarks_side_panel_coordinator.cc", "views/side_panel/bookmarks/bookmarks_side_panel_coordinator.h", + "views/side_panel/customize_chrome/customize_chrome_side_panel_controller.cc", + "views/side_panel/customize_chrome/customize_chrome_side_panel_controller.h", + "views/side_panel/customize_chrome/customize_chrome_side_panel_controller_utils.cc", "views/side_panel/feed/feed_side_panel_coordinator.cc", "views/side_panel/feed/feed_side_panel_coordinator.h", "views/side_panel/history_clusters/history_clusters_side_panel_coordinator.cc", "views/side_panel/history_clusters/history_clusters_side_panel_coordinator.h", + "views/side_panel/read_anything/read_anything_button_view.cc", + "views/side_panel/read_anything/read_anything_button_view.h", "views/side_panel/read_anything/read_anything_constants.h", "views/side_panel/read_anything/read_anything_container_view.cc", "views/side_panel/read_anything/read_anything_container_view.h", @@ -4776,6 +4880,8 @@ static_library("ui") { "views/side_panel/read_anything/read_anything_controller.h", "views/side_panel/read_anything/read_anything_coordinator.cc", "views/side_panel/read_anything/read_anything_coordinator.h", + "views/side_panel/read_anything/read_anything_font_combobox.cc", + "views/side_panel/read_anything/read_anything_font_combobox.h", "views/side_panel/read_anything/read_anything_model.cc", "views/side_panel/read_anything/read_anything_model.h", "views/side_panel/read_anything/read_anything_toolbar_view.cc", @@ -4798,8 +4904,11 @@ static_library("ui") { "views/side_panel/side_panel_registry.cc", "views/side_panel/side_panel_registry.h", "views/side_panel/side_panel_registry_observer.h", + "views/side_panel/side_panel_resize_area.cc", + "views/side_panel/side_panel_resize_area.h", "views/side_panel/side_panel_util.cc", "views/side_panel/side_panel_util.h", + "views/side_panel/side_panel_view_state_observer.h", "views/side_panel/side_panel_web_ui_view.cc", "views/side_panel/side_panel_web_ui_view.h", "views/side_panel/user_note/user_note_ui_coordinator.cc", @@ -4812,6 +4921,17 @@ static_library("ui") { "views/side_search/side_search_browser_controller.h", "views/side_search/side_search_icon_view.cc", "views/side_search/side_search_icon_view.h", + "views/side_search/side_search_views_utils.cc", + "views/side_search/side_search_views_utils.h", + "views/side_search/unified_side_search_controller.cc", + "views/side_search/unified_side_search_controller.h", + "views/side_search/unified_side_search_helper.cc", + "views/site_data/page_specific_site_data_dialog.cc", + "views/site_data/page_specific_site_data_dialog.h", + "views/site_data/page_specific_site_data_dialog_controller.cc", + "views/site_data/page_specific_site_data_dialog_controller.h", + "views/site_data/site_data_row_view.cc", + "views/site_data/site_data_row_view.h", "views/ssl_client_certificate_selector.cc", "views/ssl_client_certificate_selector.h", "views/status_bubble_views.cc", @@ -4850,8 +4970,10 @@ static_library("ui") { "views/tabs/tab.h", "views/tabs/tab_close_button.cc", "views/tabs/tab_close_button.h", - "views/tabs/tab_container.cc", "views/tabs/tab_container.h", + "views/tabs/tab_container_controller.h", + "views/tabs/tab_container_impl.cc", + "views/tabs/tab_container_impl.h", "views/tabs/tab_drag_context.h", "views/tabs/tab_drag_controller.cc", "views/tabs/tab_drag_controller.h", @@ -4898,6 +5020,8 @@ static_library("ui") { "views/tabs/tab_width_constraints.h", "views/tabs/window_finder.cc", "views/tabs/window_finder.h", + "views/tabs/z_orderable_tab_container_element.cc", + "views/tabs/z_orderable_tab_container_element.h", "views/task_manager_view.cc", "views/task_manager_view.h", "views/theme_copying_widget.cc", @@ -5045,7 +5169,6 @@ static_library("ui") { deps += [ "side_search:side_search_tab_data_proto", - "side_search:side_search_window_data_proto", "//base", "//chrome/browser/ui/views", "//components/commerce/core:public", @@ -5117,7 +5240,6 @@ static_library("ui") { } if (is_fuchsia) { sources += [ - "views/certificate_viewer_fuchsia.cc", "views/chrome_views_delegate_fuchsia.cc", "views/frame/browser_desktop_window_tree_host.h", "views/frame/browser_desktop_window_tree_host_fuchsia.cc", @@ -5222,6 +5344,8 @@ static_library("ui") { "views/frame/opaque_browser_frame_view_layout.h", "views/frame/opaque_browser_frame_view_layout_delegate.cc", "views/frame/opaque_browser_frame_view_layout_delegate.h", + "views/sharing_hub/sharing_hub_bubble_view_impl.cc", + "views/sharing_hub/sharing_hub_bubble_view_impl.h", ] deps += [ "//ui/views/window/vector_icons" ] } @@ -5243,6 +5367,10 @@ static_library("ui") { "views/lens/lens_side_panel_helper.cc", "views/lens/lens_side_panel_view.cc", "views/lens/lens_side_panel_view.h", + "views/side_panel/lens/lens_side_panel_coordinator.cc", + "views/side_panel/lens/lens_side_panel_coordinator.h", + "views/side_panel/lens/lens_unified_side_panel_view.cc", + "views/side_panel/lens/lens_unified_side_panel_view.h", ] deps += [ "//chrome/browser/ui/media_router/internal/vector_icons" ] } @@ -5376,8 +5504,8 @@ static_library("ui") { "views/extensions/media_galleries_dialog_views.h", "views/extensions/media_gallery_checkbox_view.cc", "views/extensions/media_gallery_checkbox_view.h", - "views/extensions/settings_overridden_dialog_view.cc", - "views/extensions/settings_overridden_dialog_view.h", + "views/extensions/settings_overridden_dialog.cc", + "views/extensions/settings_overridden_dialog.h", "views/javascript_app_modal_event_blocker.h", "web_applications/app_browser_controller.cc", "web_applications/app_browser_controller.h", @@ -5387,9 +5515,6 @@ static_library("ui") { "web_applications/share_target_utils.h", "web_applications/sub_apps_service_impl.cc", "web_applications/sub_apps_service_impl.h", - "web_applications/system_web_app_delegate_ui_impl.cc", - "web_applications/system_web_app_ui_utils.cc", - "web_applications/system_web_app_ui_utils.h", "web_applications/web_app_browser_controller.cc", "web_applications/web_app_browser_controller.h", "web_applications/web_app_dialog_manager.cc", @@ -5410,6 +5535,8 @@ static_library("ui") { "web_applications/web_app_metrics_factory.h", "web_applications/web_app_metrics_tab_helper.cc", "web_applications/web_app_metrics_tab_helper.h", + "web_applications/web_app_tabbed_utils.cc", + "web_applications/web_app_tabbed_utils.h", "web_applications/web_app_ui_manager_impl.cc", "web_applications/web_app_ui_manager_impl.h", "web_applications/web_app_ui_utils.cc", @@ -5421,6 +5548,12 @@ static_library("ui") { "webui/extensions/extension_icon_source.h", ] + if (is_chromeos_ash) { + deps += [ "//chrome/browser/ui/ash/system_web_apps" ] + allow_circular_includes_from += + [ "//chrome/browser/ui/ash/system_web_apps" ] + } + if (is_mac) { sources += [ "views/javascript_app_modal_event_blocker_mac.h" ] } else { @@ -5454,10 +5587,6 @@ static_library("ui") { "hung_plugin_tab_helper.cc", "hung_plugin_tab_helper.h", ] - deps += [ - "//ppapi/c", - "//ppapi/proxy:ipc", - ] } if (enable_basic_printing) { @@ -5614,12 +5743,6 @@ static_library("test_support") { "find_bar/find_bar_host_unittest_util.h", "login/login_handler_test_utils.cc", "login/login_handler_test_utils.h", - "passwords/settings/password_ui_view_mock.cc", - "passwords/settings/password_ui_view_mock.h", - "toolbar/test_toolbar_action_view_controller.cc", - "toolbar/test_toolbar_action_view_controller.h", - "toolbar/test_toolbar_actions_bar_bubble_delegate.cc", - "toolbar/test_toolbar_actions_bar_bubble_delegate.h", ] public_deps = [ ":ui" ] deps = [ @@ -5687,14 +5810,20 @@ static_library("test_support") { if (!is_android) { sources += [ + "autofill_assistant/password_change/mock_apc_scrim_manager.cc", + "autofill_assistant/password_change/mock_apc_scrim_manager.h", "autofill_assistant/password_change/mock_assistant_display_delegate.cc", "autofill_assistant/password_change/mock_assistant_display_delegate.h", "autofill_assistant/password_change/mock_assistant_onboarding_controller.cc", "autofill_assistant/password_change/mock_assistant_onboarding_controller.h", "autofill_assistant/password_change/mock_assistant_onboarding_prompt.cc", "autofill_assistant/password_change/mock_assistant_onboarding_prompt.h", + "autofill_assistant/password_change/mock_assistant_side_panel_coordinator.cc", + "autofill_assistant/password_change/mock_assistant_side_panel_coordinator.h", "autofill_assistant/password_change/mock_password_change_run_controller.cc", "autofill_assistant/password_change/mock_password_change_run_controller.h", + "autofill_assistant/password_change/mock_password_change_run_display.cc", + "autofill_assistant/password_change/mock_password_change_run_display.h", "exclusive_access/exclusive_access_test.cc", "exclusive_access/exclusive_access_test.h", "exclusive_access/fullscreen_controller_state_test.cc", @@ -5725,6 +5854,7 @@ static_library("test_support") { ] deps += [ "//chrome/test:test_support_ui", + "//components/autofill_assistant/browser/public/password_change/proto:proto", "//components/media_message_center:media_message_center", "//components/media_router/browser:browser", "//components/signin/core/browser", @@ -5757,12 +5887,18 @@ static_library("test_support") { ] deps += [ "//ash/public/cpp", - "//chromeos/dbus", + "//chromeos/ash/components/dbus", "//chromeos/ui/base", ] } if (enable_extensions) { + sources += [ + "toolbar/test_toolbar_action_view_controller.cc", + "toolbar/test_toolbar_action_view_controller.h", + "toolbar/test_toolbar_actions_bar_bubble_delegate.cc", + "toolbar/test_toolbar_actions_bar_bubble_delegate.h", + ] deps += [ "//extensions/browser" ] } } diff --git a/chromium/chrome/browser/ui/android/appmenu/internal/BUILD.gn b/chromium/chrome/browser/ui/android/appmenu/internal/BUILD.gn index 7a8f3befd96..b86e1c435d4 100644 --- a/chromium/chrome/browser/ui/android/appmenu/internal/BUILD.gn +++ b/chromium/chrome/browser/ui/android/appmenu/internal/BUILD.gn @@ -58,7 +58,7 @@ android_resources("java_resources") { ] } -android_library("javatests") { +android_library("unit_device_javatests") { testonly = true resources_package = "org.chromium.chrome.browser.ui.appmenu.test" @@ -78,7 +78,7 @@ android_library("javatests") { "//chrome/browser/flags:java", "//chrome/browser/ui/android/appmenu:java", "//chrome/browser/ui/android/appmenu/test:test_support_java", - "//chrome/test/android:chrome_java_test_support", + "//chrome/test/android:chrome_java_integration_test_support", "//components/browser_ui/widget/android:java", "//components/browser_ui/widget/android:test_support_java", "//content/public/test/android:content_java_test_support", @@ -99,30 +99,22 @@ android_resources("test_java_resources") { testonly = true sources = [ - "test/java/res/drawable/test_ic_arrow_downward_black_24dp.xml", - "test/java/res/drawable/test_ic_arrow_forward_black_24dp.xml", - "test/java/res/drawable/test_ic_info_outline_black_24dp.xml", - "test/java/res/drawable/test_ic_more_vert_black_24dp.xml", - "test/java/res/drawable/test_ic_refresh_black_24dp.xml", - "test/java/res/drawable/test_ic_star_border_black_24dp.xml", - "test/java/res/drawable/test_ic_vintage_filter.xml", "test/java/res/layout/test_app_menu_activity_layout.xml", "test/java/res/layout/test_menu_footer.xml", "test/java/res/layout/test_menu_header.xml", "test/java/res/menu/test_menu.xml", ] - deps = [ ":java_resources" ] + deps = [ + ":java_resources", + "//components/browser_ui/widget/android:java_test_resources", + ] } -java_library("junit") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true - testonly = true +robolectric_library("junit") { sources = [ "java/src/org/chromium/chrome/browser/ui/appmenu/AppMenuPopupPositionTest.java" ] deps = [ ":java", "//base:base_junit_test_support", - "//third_party/android_deps:robolectric_all_java", "//third_party/junit", "//third_party/mockito:mockito_java", ] diff --git a/chromium/chrome/browser/ui/android/autofill/internal/BUILD.gn b/chromium/chrome/browser/ui/android/autofill/internal/BUILD.gn index 8223699ec21..49543b2d321 100644 --- a/chromium/chrome/browser/ui/android/autofill/internal/BUILD.gn +++ b/chromium/chrome/browser/ui/android/autofill/internal/BUILD.gn @@ -53,10 +53,7 @@ generate_jni("jni_headers") { ] } -android_library("junit") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true - testonly = true +robolectric_library("junit") { sources = [ "java/src/org/chromium/chrome/browser/ui/autofill/AuthenticatorSelectionDialogBridgeTest.java", "java/src/org/chromium/chrome/browser/ui/autofill/AuthenticatorSelectionDialogTest.java", diff --git a/chromium/chrome/browser/ui/android/default_browser_promo/BUILD.gn b/chromium/chrome/browser/ui/android/default_browser_promo/BUILD.gn index 6f28d07724e..f303b9e4038 100644 --- a/chromium/chrome/browser/ui/android/default_browser_promo/BUILD.gn +++ b/chromium/chrome/browser/ui/android/default_browser_promo/BUILD.gn @@ -22,16 +22,12 @@ android_library("java") { resources_package = "org.chromium.chrome.browser.ui.default_browser_promo" } -java_library("junit") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true - testonly = true +robolectric_library("junit") { sources = [ "java/src/org/chromium/chrome/browser/ui/default_browser_promo/DefaultBrowserPromoUtilsTest.java" ] deps = [ ":java", "//base:base_java", "//base:base_junit_test_support", - "//third_party/android_deps:robolectric_all_java", "//third_party/junit", "//third_party/mockito:mockito_java", ] diff --git a/chromium/chrome/browser/ui/android/fast_checkout/BUILD.gn b/chromium/chrome/browser/ui/android/fast_checkout/BUILD.gn new file mode 100644 index 00000000000..906ddeeae79 --- /dev/null +++ b/chromium/chrome/browser/ui/android/fast_checkout/BUILD.gn @@ -0,0 +1,50 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/rules.gni") + +android_library("java") { + deps = [ + "//base:jni_java", + "//components/autofill/android:autofill_payments_java_resources", + "//components/autofill/android:main_autofill_java", + "//components/browser_ui/bottomsheet/android:java", + "//components/payments/content/android:java_resources", + "//url:gurl_java", + ] + sources = [ + "java/src/org/chromium/chrome/browser/ui/fast_checkout/FastCheckoutComponent.java", + "java/src/org/chromium/chrome/browser/ui/fast_checkout/data/FastCheckoutAutofillProfile.java", + "java/src/org/chromium/chrome/browser/ui/fast_checkout/data/FastCheckoutCreditCard.java", + ] + resources_package = "org.chromium.chrome.browser.ui.fast_checkout" +} + +generate_jni("jni_headers") { + sources = [ + "internal/java/src/org/chromium/chrome/browser/ui/fast_checkout/FastCheckoutBridge.java", + "java/src/org/chromium/chrome/browser/ui/fast_checkout/data/FastCheckoutAutofillProfile.java", + "java/src/org/chromium/chrome/browser/ui/fast_checkout/data/FastCheckoutCreditCard.java", + ] +} + +robolectric_library("junit") { + testonly = true + + sources = [ "junit/java/src/org/chromium/chrome/browser/ui/fast_checkout/FastCheckoutControllerTest.java" ] + deps = [ + ":java", + "//base:base_junit_test_support", + "//chrome/browser/ui/android/fast_checkout/internal:java", + "//components/autofill/android:main_autofill_java", + "//components/autofill_assistant/android:public_java", + "//components/browser_ui/bottomsheet/android:java", + "//third_party/androidx:androidx_recyclerview_recyclerview_java", + "//third_party/hamcrest:hamcrest_library_java", + "//third_party/junit:junit", + "//third_party/mockito:mockito_java", + "//ui/android:ui_java_test_support", + "//ui/android:ui_no_recycler_view_java", + ] +} diff --git a/chromium/chrome/browser/ui/android/fast_checkout/internal/BUILD.gn b/chromium/chrome/browser/ui/android/fast_checkout/internal/BUILD.gn new file mode 100644 index 00000000000..5d29064f14f --- /dev/null +++ b/chromium/chrome/browser/ui/android/fast_checkout/internal/BUILD.gn @@ -0,0 +1,51 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/rules.gni") +import("//build/config/locales.gni") +import("//chrome/common/features.gni") +import("//tools/grit/grit_rule.gni") + +android_library("java") { + sources = [ + "java/src/org/chromium/chrome/browser/ui/fast_checkout/FastCheckoutBridge.java", + "java/src/org/chromium/chrome/browser/ui/fast_checkout/FastCheckoutCoordinator.java", + "java/src/org/chromium/chrome/browser/ui/fast_checkout/FastCheckoutMediator.java", + "java/src/org/chromium/chrome/browser/ui/fast_checkout/FastCheckoutModel.java", + "java/src/org/chromium/chrome/browser/ui/fast_checkout/FastCheckoutSheetContent.java", + ] + deps = [ + ":java_resources", + "//base:base_java", + "//base:jni_java", + "//build/android:build_java", + "//chrome/browser/ui/android/fast_checkout:java", + "//chrome/browser/ui/android/strings:ui_strings_grd", + "//components/autofill_assistant/android:public_java", + "//components/browser_ui/bottomsheet/android:java", + "//components/browser_ui/strings/android:browser_ui_strings_grd", + "//third_party/androidx:androidx_annotation_annotation_java", + "//ui/android:ui_no_recycler_view_java", + ] + annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] + resources_package = "org.chromium.chrome.browser.ui.fast_checkout" +} + +android_resources("java_resources") { + deps = [ + ":java_strings_grd", + "//ui/android:ui_java_resources", + ] + custom_package = "org.chromium.chrome.browser.ui.fast_checkout" +} + +java_strings_grd("java_strings_grd") { + defines = chrome_grit_defines + grd_file = "java/strings/android_fast_checkout_strings.grd" + outputs = + [ "values/android_fast_checkout_strings.xml" ] + + process_file_template( + android_bundle_locales_as_resources, + [ "values-{{source_name_part}}/android_fast_checkout_strings.xml" ]) +} diff --git a/chromium/chrome/browser/ui/android/fast_checkout/internal/java/strings/android_fast_checkout_strings.grd b/chromium/chrome/browser/ui/android/fast_checkout/internal/java/strings/android_fast_checkout_strings.grd new file mode 100644 index 00000000000..a3e83afa5f6 --- /dev/null +++ b/chromium/chrome/browser/ui/android/fast_checkout/internal/java/strings/android_fast_checkout_strings.grd @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + List of addresses and payment options to be filled during checkout flows. + + + List of addresses and payment options to be filled during checkout flows opened at half height. + + + List of addresses and payment options to be filled during checkout flows opened at full height. + + + List of addresses and payment options to be filled during checkout flows is closed. + + + + diff --git a/chromium/chrome/browser/ui/android/layouts/BUILD.gn b/chromium/chrome/browser/ui/android/layouts/BUILD.gn index 76ea86beb3d..f7d4269c688 100644 --- a/chromium/chrome/browser/ui/android/layouts/BUILD.gn +++ b/chromium/chrome/browser/ui/android/layouts/BUILD.gn @@ -52,11 +52,7 @@ generate_jni("layouts_jni_headers") { ] } -java_library("junit") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true - testonly = true - +robolectric_library("junit") { sources = [ "java/src/org/chromium/chrome/browser/layouts/CompositorModelChangeProcessorUnitTest.java", "java/src/org/chromium/chrome/browser/layouts/FilterLayoutStateObserverTest.java", @@ -69,7 +65,6 @@ java_library("junit") { "//base:base_java", "//base:base_java_test_support", "//base:base_junit_test_support", - "//third_party/android_deps:robolectric_all_java", "//third_party/android_support_test_runner:runner_java", "//third_party/androidx:androidx_test_runner_java", "//third_party/junit", diff --git a/chromium/chrome/browser/ui/android/logo/BUILD.gn b/chromium/chrome/browser/ui/android/logo/BUILD.gn index baac91089cd..c7b71a335ff 100644 --- a/chromium/chrome/browser/ui/android/logo/BUILD.gn +++ b/chromium/chrome/browser/ui/android/logo/BUILD.gn @@ -55,32 +55,10 @@ android_resources("java_resources") { deps = [ "//chrome/browser/ui/android/strings:ui_strings_grd" ] } -android_library("javatests") { - testonly = true - sources = [ "java/src/org/chromium/chrome/browser/logo/LogoViewTest.java" ] - - deps = [ - ":java", - "//base:base_java_test_support", - "//chrome/browser/search_engines/android:java", - "//chrome/test/android:chrome_java_test_support", - "//components/search_engines/android:java", - "//content/public/android:content_full_java", - "//content/public/test/android:content_java_test_support", - "//third_party/androidx:androidx_test_runner_java", - "//third_party/junit:junit", - "//third_party/mockito:mockito_java", - "//ui/android:ui_java_test_support", - ] -} - -android_library("junit") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true - testonly = true - +robolectric_library("junit") { sources = [ "java/src/org/chromium/chrome/browser/logo/LogoLoadHelperUnitTest.java", + "java/src/org/chromium/chrome/browser/logo/LogoViewTest.java", ] deps = [ @@ -96,9 +74,10 @@ android_library("junit") { "//components/search_engines/android:java", "//content/public/android:content_full_java", "//content/public/test/android:content_java_test_support", - "//third_party/android_deps:robolectric_all_java", "//third_party/androidx:androidx_test_core_java", + "//third_party/androidx:androidx_test_ext_junit_java", "//third_party/junit:junit", "//third_party/mockito:mockito_java", + "//ui/android:ui_java_test_support", ] } diff --git a/chromium/chrome/browser/ui/android/multiwindow/BUILD.gn b/chromium/chrome/browser/ui/android/multiwindow/BUILD.gn index 00f5edf5f71..52bbfe158b3 100644 --- a/chromium/chrome/browser/ui/android/multiwindow/BUILD.gn +++ b/chromium/chrome/browser/ui/android/multiwindow/BUILD.gn @@ -67,11 +67,7 @@ android_resources("java_resources") { ] } -java_library("junit") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true - testonly = true - +robolectric_library("junit") { sources = [ "java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceStateUnitTest.java", "java/src/org/chromium/chrome/browser/multiwindow/UiUtilsUnitTest.java", @@ -85,7 +81,6 @@ java_library("junit") { "//chrome/browser/profiles/android:java", "//chrome/browser/util:java", "//components/favicon/android:java", - "//third_party/android_deps:robolectric_all_java", "//third_party/android_support_test_runner:runner_java", "//third_party/androidx:androidx_test_core_java", "//third_party/androidx:androidx_test_runner_java", @@ -108,7 +103,7 @@ android_library("javatests") { "//base:base_java_test_support", "//chrome/browser/flags:java", "//chrome/browser/preferences:java", - "//chrome/test/android:chrome_java_test_support", + "//chrome/test/android:chrome_java_unit_test_support", "//components/browser_ui/modaldialog/android:java", "//components/browser_ui/settings/android:java", "//components/browser_ui/widget/android:java", diff --git a/chromium/chrome/browser/ui/android/native_page/BUILD.gn b/chromium/chrome/browser/ui/android/native_page/BUILD.gn index f5530991985..2153ef2b0bf 100644 --- a/chromium/chrome/browser/ui/android/native_page/BUILD.gn +++ b/chromium/chrome/browser/ui/android/native_page/BUILD.gn @@ -21,11 +21,7 @@ android_library("java") { ] } -java_library("junit") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true - testonly = true - +robolectric_library("junit") { sources = [ "java/src/org/chromium/chrome/browser/ui/native_page/NativePageTest.java", ] @@ -33,7 +29,6 @@ java_library("junit") { deps = [ ":java", "//base:base_junit_test_support", - "//third_party/android_deps:robolectric_all_java", "//third_party/junit", ] } diff --git a/chromium/chrome/browser/ui/android/night_mode/BUILD.gn b/chromium/chrome/browser/ui/android/night_mode/BUILD.gn index 4091efc4185..479f99492d0 100644 --- a/chromium/chrome/browser/ui/android/night_mode/BUILD.gn +++ b/chromium/chrome/browser/ui/android/night_mode/BUILD.gn @@ -75,7 +75,7 @@ android_library("night_mode_java_test_support") { ] } -android_library("javatests") { +android_library("unit_device_javatests") { testonly = true sources = [ "java/src/org/chromium/chrome/browser/night_mode/settings/ThemeSettingsFragmentTest.java" ] @@ -85,14 +85,16 @@ android_library("javatests") { ":night_mode_java_test_support", "//base:base_java", "//base:base_java_test_support", + "//chrome/browser/feature_engagement:java", "//chrome/browser/flags:java", "//chrome/browser/preferences:java", - "//chrome/browser/settings:java", - "//chrome/browser/settings:test_support_java", - "//chrome/test/android:chrome_java_test_support", + "//chrome/browser/profiles/android:java", + "//chrome/test/android:chrome_java_test_support_common", + "//components/browser_ui/settings/android:test_support_java", "//components/browser_ui/site_settings/android:java", "//components/browser_ui/widget/android:java", "//components/content_settings/android:content_settings_enums_java", + "//components/feature_engagement/public:public_java", "//content/public/android:content_full_java", "//content/public/test/android:content_java_test_support", "//third_party/androidx:androidx_test_runner_java", @@ -104,10 +106,7 @@ android_library("javatests") { resources_package = "org.chromium.chrome.browser.night_mode" } -android_library("junit") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true - testonly = true +robolectric_library("junit") { sources = [ "java/src/org/chromium/chrome/browser/night_mode/AutoDarkFeedbackSourceUnitTest.java", "java/src/org/chromium/chrome/browser/night_mode/WebContentsDarkModeControllerUnitTest.java", @@ -125,7 +124,7 @@ android_library("junit") { "//chrome/browser/flags:java", "//chrome/browser/preferences:java", "//chrome/browser/profiles/android:java", - "//chrome/test/android:chrome_java_test_support", + "//chrome/test/android:chrome_java_unit_test_support", "//components/browser_ui/settings/android:java", "//components/browser_ui/site_settings/android:java", "//components/content_settings/android:content_settings_enums_java", @@ -137,7 +136,6 @@ android_library("junit") { "//content/public/android:content_full_java", "//content/public/test/android:content_java_test_support", "//testing/android/junit:junit_test_support", - "//third_party/android_deps:robolectric_all_java", "//third_party/androidx:androidx_test_runner_java", "//third_party/junit", "//third_party/mockito:mockito_java", diff --git a/chromium/chrome/browser/ui/android/omnibox/BUILD.gn b/chromium/chrome/browser/ui/android/omnibox/BUILD.gn index 76ed0fe6a93..1063f68ee7d 100644 --- a/chromium/chrome/browser/ui/android/omnibox/BUILD.gn +++ b/chromium/chrome/browser/ui/android/omnibox/BUILD.gn @@ -26,6 +26,7 @@ android_library("java") { "java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java", "java/src/org/chromium/chrome/browser/omnibox/LocationBarTablet.java", "java/src/org/chromium/chrome/browser/omnibox/NewTabPageDelegate.java", + "java/src/org/chromium/chrome/browser/omnibox/OmniboxFeatures.java", "java/src/org/chromium/chrome/browser/omnibox/OmniboxFocusReason.java", "java/src/org/chromium/chrome/browser/omnibox/OmniboxPrerender.java", "java/src/org/chromium/chrome/browser/omnibox/OmniboxStub.java", @@ -59,12 +60,13 @@ android_library("java") { "java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteDelegate.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManager.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownCommonProperties.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemProcessor.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfo.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilder.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManager.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/FaviconFetcher.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxPedalDelegate.java", - "java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxQueryTileCoordinator.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionUiType.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdown.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdownAdapter.java", @@ -93,6 +95,7 @@ android_library("java") { "java/src/org/chromium/chrome/browser/omnibox/suggestions/basic/BasicSuggestionProcessor.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/basic/SuggestionViewProperties.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/basic/SuggestionViewViewBinder.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/carousel/BaseCarouselSuggestionItemViewBuilder.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/carousel/BaseCarouselSuggestionProcessor.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/carousel/BaseCarouselSuggestionSelectionManager.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/carousel/BaseCarouselSuggestionView.java", @@ -109,7 +112,6 @@ android_library("java") { "java/src/org/chromium/chrome/browser/omnibox/suggestions/header/HeaderView.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/header/HeaderViewBinder.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/header/HeaderViewProperties.java", - "java/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/ExploreIconProvider.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesProcessor.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/pedal/PedalSuggestionProcessor.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/pedal/PedalSuggestionView.java", @@ -140,6 +142,7 @@ android_library("java") { "//base:jni_java", "//build/android:build_java", "//chrome/browser/android/lifecycle:java", + "//chrome/browser/back_press/android:java", "//chrome/browser/browser_controls/android:java", "//chrome/browser/commerce/merchant_viewer/android:java", "//chrome/browser/device:java", @@ -235,7 +238,7 @@ android_library("javatests") { "//base:base_java", "//base:base_java_test_support", "//base/test:test_support_java", - "//chrome/test/android:chrome_java_test_support", + "//chrome/test/android:chrome_java_unit_test_support", "//content/public/test/android:content_java_test_support", "//third_party/android_sdk:android_test_mock_java", "//third_party/android_support_test_runner:runner_java", @@ -325,7 +328,6 @@ android_resources("java_resources") { "java/res/layout/omnibox_answer_suggestion.xml", "java/res/layout/omnibox_basic_suggestion.xml", "java/res/layout/omnibox_entity_suggestion.xml", - "java/res/layout/omnibox_query_tiles_suggestion.xml", "java/res/layout/omnibox_results_container.xml", "java/res/layout/suggestions_tile_view.xml", "java/res/layout/url_action_container.xml", @@ -347,17 +349,46 @@ proto_java_library("partner_location_descriptor_proto_java") { sources = [ "$proto_path/partner_location_descriptor.proto" ] } -android_library("junit") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true +android_library("unit_device_javatests") { testonly = true + sources = [ + "java/src/org/chromium/chrome/browser/omnibox/status/StatusViewRenderTest.java", + "java/src/org/chromium/chrome/browser/omnibox/status/StatusViewTest.java", + ] + deps = [ + ":java", + ":java_resources", + "//base:base_java_test_support", + "//chrome/browser/ui/android/toolbar:java", + "//chrome/test/android:chrome_java_test_support_common", + "//components/browser_ui/site_settings/android:java", + "//components/browser_ui/widget/android:java", + "//components/content_settings/android:content_settings_enums_java", + "//content/public/test/android:content_java_test_support", + "//third_party/android_deps:espresso_java", + "//third_party/android_sdk:android_test_base_java", + "//third_party/androidx:androidx_appcompat_appcompat_resources_java", + "//third_party/androidx:androidx_core_core_java", + "//third_party/androidx:androidx_recyclerview_recyclerview_java", + "//third_party/androidx:androidx_test_core_java", + "//third_party/androidx:androidx_test_runner_java", + "//third_party/hamcrest:hamcrest_library_java", + "//third_party/junit:junit", + "//third_party/mockito:mockito_java", + "//ui/android:ui_java_test_support", + "//ui/android:ui_no_recycler_view_java", + "//url:gurl_java", + ] +} +robolectric_library("junit") { sources = [ "java/src/org/chromium/chrome/browser/omnibox/AutocompleteEditTextTest.java", "java/src/org/chromium/chrome/browser/omnibox/AutocompleteStateUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/KeyboardHideHelperUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/LocationBarMediatorTest.java", "java/src/org/chromium/chrome/browser/omnibox/SearchEngineLogoUtilsUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/ShadowUrlBarData.java", "java/src/org/chromium/chrome/browser/omnibox/SpannableAutocompleteEditTextModelUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/UrlBarDataTest.java", "java/src/org/chromium/chrome/browser/omnibox/UrlBarMediatorUnitTest.java", @@ -366,16 +397,31 @@ android_library("junit") { "java/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManagerTest.java", "java/src/org/chromium/chrome/browser/omnibox/geo/VisibleNetworksTest.java", "java/src/org/chromium/chrome/browser/omnibox/geo/VisibleNetworksTrackerTest.java", + "java/src/org/chromium/chrome/browser/omnibox/status/StatusMediatorUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/styles/OmniboxResourceProviderTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediatorUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilderUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManagerUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/FaviconFetcherUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/answer/AnswerSuggestionProcessorUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/answer/AnswerTextNewLayoutUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionProcessorUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionViewBinderUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionViewProcessorUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionViewTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/base/SimpleHorizontalLayoutViewTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/base/SimpleVerticalLayoutViewTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/base/SuggestionSpannableUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/basic/BasicSuggestionProcessorUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/carousel/BaseCarouselSuggestionProcessorUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/carousel/BaseCarouselSuggestionSelectionManagerUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/carousel/BaseCarouselSuggestionViewBinderUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/clipboard/ClipboardSuggestionProcessorUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/editurl/EditUrlSuggestionUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/entity/EntitySuggestionProcessorUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/header/HeaderViewBinderUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesProcessorUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/tail/AlignmentManagerUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/voice/AssistantVoiceSearchServiceUnitTest.java", ] @@ -386,6 +432,7 @@ android_library("junit") { "//base:base_junit_test_support", "//build/android:build_java", "//chrome/android:base_module_java", + "//chrome/browser/commerce/merchant_viewer/android:java", "//chrome/browser/device:java", "//chrome/browser/flags:java", "//chrome/browser/gsa:java", @@ -395,13 +442,16 @@ android_library("junit") { "//chrome/browser/prefetch/android:java", "//chrome/browser/privacy:java", "//chrome/browser/profiles/android:java", + "//chrome/browser/search_engines/android:java", + "//chrome/browser/share:java", "//chrome/browser/signin/services/android:java", "//chrome/browser/tab:java", + "//chrome/browser/tabmodel:java", "//chrome/browser/ui/android/favicon:java", "//chrome/browser/ui/android/theme:java", "//chrome/browser/ui/android/toolbar:java", "//chrome/browser/util:java", - "//chrome/test/android:chrome_java_test_support", + "//chrome/test/android:chrome_java_unit_test_support", "//components/browser_ui/site_settings/android:java", "//components/browser_ui/styles/android:java", "//components/browser_ui/theme/android:java_resources", @@ -409,26 +459,35 @@ android_library("junit") { "//components/content_settings/android:content_settings_enums_java", "//components/embedder_support/android:util_java", "//components/externalauth/android:java", + "//components/favicon/android:java", + "//components/image_fetcher:java", "//components/omnibox/browser:browser_java", + "//components/omnibox/browser:junit_test_support", + "//components/permissions/android:java", "//components/search_engines/android:java", + "//components/security_state/core:security_state_enums_java", "//components/signin/public/android:java", "//components/signin/public/android:signin_java_test_support", "//content/public/android:content_java", "//content/public/test/android:content_java_test_support", "//testing/android/junit:junit_test_support", "//third_party/android_deps:material_design_java", - "//third_party/android_deps:robolectric_all_java", "//third_party/android_support_test_runner:runner_java", "//third_party/androidx:androidx_annotation_annotation_java", "//third_party/androidx:androidx_recyclerview_recyclerview_java", "//third_party/androidx:androidx_test_core_java", + "//third_party/androidx:androidx_test_ext_junit_java", "//third_party/androidx:androidx_test_runner_java", + "//third_party/hamcrest:hamcrest_core_java", "//third_party/hamcrest:hamcrest_library_java", "//third_party/junit", + "//third_party/metrics_proto:metrics_proto_java", "//third_party/mockito:mockito_java", + "//ui/android:ui_java_test_support", "//ui/android:ui_no_recycler_view_java", "//ui/android:ui_recycler_view_java", "//url:gurl_java", + "//url:gurl_junit_shadows", "//url:gurl_junit_test_support", ] annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] diff --git a/chromium/chrome/browser/ui/android/quickactionsearchwidget/BUILD.gn b/chromium/chrome/browser/ui/android/quickactionsearchwidget/BUILD.gn index 0f24e9e2a3e..b47762d1c9f 100644 --- a/chromium/chrome/browser/ui/android/quickactionsearchwidget/BUILD.gn +++ b/chromium/chrome/browser/ui/android/quickactionsearchwidget/BUILD.gn @@ -21,8 +21,6 @@ android_library("java") { } android_library("javatests") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true testonly = true sources = [ "java/src/org/chromium/chrome/browser/ui/quickactionsearchwidget/QuickActionSearchWidgetProviderDelegateTest.java", @@ -40,7 +38,7 @@ android_library("javatests") { "//chrome/browser/tab:java", "//chrome/browser/tabmodel:java", "//chrome/browser/ui/android/searchactivityutils:java", - "//chrome/test/android:chrome_java_test_support", + "//chrome/test/android:chrome_java_integration_test_support", "//components/embedder_support/android:util_java", "//content/public/test/android:content_java_test_support", "//third_party/android_support_test_runner:runner_java", diff --git a/chromium/chrome/browser/ui/android/searchactivityutils/BUILD.gn b/chromium/chrome/browser/ui/android/searchactivityutils/BUILD.gn index b4ac2dcfd49..d1a29b1196a 100644 --- a/chromium/chrome/browser/ui/android/searchactivityutils/BUILD.gn +++ b/chromium/chrome/browser/ui/android/searchactivityutils/BUILD.gn @@ -27,7 +27,7 @@ android_library("constants_java") { sources = [ "java/src/org/chromium/chrome/browser/ui/searchactivityutils/SearchActivityConstants.java" ] } -android_library("javatests") { +android_library("unit_device_javatests") { testonly = true sources = [ "java/src/org/chromium/chrome/browser/ui/searchactivityutils/SearchActivityPreferencesManagerTest.java" ] diff --git a/chromium/chrome/browser/ui/android/signin/BUILD.gn b/chromium/chrome/browser/ui/android/signin/BUILD.gn index 8d5cb30a1dd..dc9e4e63a1a 100644 --- a/chromium/chrome/browser/ui/android/signin/BUILD.gn +++ b/chromium/chrome/browser/ui/android/signin/BUILD.gn @@ -43,20 +43,21 @@ android_library("java") { ] sources = [ "java/src/org/chromium/chrome/browser/ui/signin/ConfirmImportSyncDataDialogCoordinator.java", - "java/src/org/chromium/chrome/browser/ui/signin/ConfirmManagedSyncDataDialog.java", + "java/src/org/chromium/chrome/browser/ui/signin/ConfirmManagedSyncDataDialogCoordinator.java", "java/src/org/chromium/chrome/browser/ui/signin/ConfirmSyncDataStateMachine.java", "java/src/org/chromium/chrome/browser/ui/signin/ConfirmSyncDataStateMachineDelegate.java", "java/src/org/chromium/chrome/browser/ui/signin/ConsentTextTracker.java", + "java/src/org/chromium/chrome/browser/ui/signin/FullScreenSyncPromoUtil.java", "java/src/org/chromium/chrome/browser/ui/signin/GoogleActivityController.java", "java/src/org/chromium/chrome/browser/ui/signin/PersonalizedSigninPromoView.java", "java/src/org/chromium/chrome/browser/ui/signin/SignOutDialogCoordinator.java", - "java/src/org/chromium/chrome/browser/ui/signin/SigninPromoController.java", - "java/src/org/chromium/chrome/browser/ui/signin/SigninPromoUtil.java", "java/src/org/chromium/chrome/browser/ui/signin/SigninScrollView.java", "java/src/org/chromium/chrome/browser/ui/signin/SigninUtils.java", "java/src/org/chromium/chrome/browser/ui/signin/SigninView.java", "java/src/org/chromium/chrome/browser/ui/signin/SyncConsentActivityLauncher.java", "java/src/org/chromium/chrome/browser/ui/signin/SyncConsentFragmentBase.java", + "java/src/org/chromium/chrome/browser/ui/signin/SyncConsentView.java", + "java/src/org/chromium/chrome/browser/ui/signin/SyncPromoController.java", "java/src/org/chromium/chrome/browser/ui/signin/TangibleSyncCoordinator.java", "java/src/org/chromium/chrome/browser/ui/signin/account_picker/AccountPickerBottomSheetCoordinator.java", "java/src/org/chromium/chrome/browser/ui/signin/account_picker/AccountPickerBottomSheetMediator.java", @@ -83,17 +84,15 @@ android_library("java") { android_resources("java_resources") { sources = [ - "java/res/drawable-hdpi/chrome_sync_logo.png", "java/res/drawable-hdpi/ic_account_child_20dp.png", - "java/res/drawable-mdpi/chrome_sync_logo.png", "java/res/drawable-mdpi/ic_account_child_20dp.png", "java/res/drawable-night/sync_promo_illustration.xml", - "java/res/drawable-xhdpi/chrome_sync_logo.png", "java/res/drawable-xhdpi/ic_account_child_20dp.png", - "java/res/drawable-xxhdpi/chrome_sync_logo.png", "java/res/drawable-xxhdpi/ic_account_child_20dp.png", - "java/res/drawable-xxxhdpi/chrome_sync_logo.png", "java/res/drawable-xxxhdpi/ic_account_child_20dp.png", + "java/res/drawable/autofill_key.xml", + "java/res/drawable/chrome_sync_logo.xml", + "java/res/drawable/devices_icon.xml", "java/res/drawable/ic_expand_more_in_circle_24dp.xml", "java/res/drawable/sync_promo_illustration.xml", "java/res/layout/account_picker_bottom_sheet_continue_button.xml", @@ -123,6 +122,7 @@ android_resources("java_resources") { "java/res/layout/signin_progress_bar_dialog.xml", "java/res/layout/signin_view.xml", "java/res/layout/signout_wipe_storage_dialog.xml", + "java/res/layout/sync_consent_view.xml", "java/res/values-sw320dp/styles.xml", "java/res/values/dimens.xml", "java/res/values/styles.xml", @@ -135,14 +135,11 @@ android_resources("java_resources") { ] } -android_library("junit") { - bypass_platform_checks = true - testonly = true +robolectric_library("junit") { sources = [ - "junit/src/org/chromium/chrome/browser/ui/signin/ConfirmSyncDataStateMachineDelegateTest.java", "junit/src/org/chromium/chrome/browser/ui/signin/ConfirmSyncDataStateMachineTest.java", - "junit/src/org/chromium/chrome/browser/ui/signin/SigninPromoControllerTest.java", - "junit/src/org/chromium/chrome/browser/ui/signin/SigninPromoUtilLaunchSigninPromoTest.java", + "junit/src/org/chromium/chrome/browser/ui/signin/FullScreenSyncPromoTest.java", + "junit/src/org/chromium/chrome/browser/ui/signin/SyncPromoControllerTest.java", "junit/src/org/chromium/chrome/browser/ui/signin/account_picker/AccountPickerMediatorTest.java", "junit/src/org/chromium/chrome/browser/ui/signin/account_picker/WebSigninAccountPickerDelegateTest.java", ] @@ -157,7 +154,7 @@ android_library("junit") { "//chrome/browser/profiles/android:java", "//chrome/browser/signin/services/android:java", "//chrome/browser/tab:java", - "//chrome/test/android:chrome_java_test_support", + "//chrome/test/android:chrome_java_unit_test_support", "//components/browser_ui/modaldialog/android:java", "//components/browser_ui/test/android:test_support_java", "//components/prefs/android:java", @@ -166,7 +163,6 @@ android_library("junit") { "//components/signin/public/android:signin_java_test_support", "//components/user_prefs/android:java", "//content/public/android:content_java", - "//third_party/android_deps:robolectric_all_java", "//third_party/androidx:androidx_appcompat_appcompat_java", "//third_party/androidx:androidx_fragment_fragment_java", "//third_party/androidx:androidx_test_core_java", @@ -177,16 +173,48 @@ android_library("junit") { } android_library("javatests") { + testonly = true + sources = [ + "java/src/org/chromium/chrome/browser/ui/signin/SyncPromoControllerRenderTest.java", + "java/src/org/chromium/chrome/browser/ui/signin/account_picker/AccountPickerBottomSheetRenderTest.java", + "java/src/org/chromium/chrome/browser/ui/signin/account_picker/AccountPickerBottomSheetTest.java", + ] + deps = [ + ":java", + "//base:base_java", + "//base:base_java_test_support", + "//chrome/android:chrome_java", + "//chrome/browser/flags:java", + "//chrome/browser/preferences:java", + "//chrome/browser/signin/services/android:java", + "//chrome/browser/ui/android/night_mode:night_mode_java_test_support", + "//chrome/test/android:chrome_java_integration_test_support", + "//components/browser_ui/bottomsheet/android:java", + "//components/signin/core/browser:signin_enums_java", + "//components/signin/public/android:java", + "//components/signin/public/android:signin_java_test_support", + "//content/public/test/android:content_java_test_support", + "//third_party/android_deps:espresso_java", + "//third_party/android_support_test_runner:runner_java", + "//third_party/androidx:androidx_annotation_annotation_java", + "//third_party/androidx:androidx_test_runner_java", + "//third_party/hamcrest:hamcrest_java", + "//third_party/junit", + "//third_party/mockito:mockito_java", + "//ui/android:ui_java_test_support", + ] +} + +android_library("unit_device_javatests") { testonly = true sources = [ "java/src/org/chromium/chrome/browser/ui/signin/ConfirmImportSyncDataDialogTest.java", "java/src/org/chromium/chrome/browser/ui/signin/ConfirmManagedSyncDataDialogTest.java", "java/src/org/chromium/chrome/browser/ui/signin/ConfirmSyncDataIntegrationTest.java", + "java/src/org/chromium/chrome/browser/ui/signin/ConfirmSyncDataStateMachineDelegateTest.java", "java/src/org/chromium/chrome/browser/ui/signin/SignOutDialogRenderTest.java", "java/src/org/chromium/chrome/browser/ui/signin/SignOutDialogTest.java", - "java/src/org/chromium/chrome/browser/ui/signin/SigninPromoControllerRenderTest.java", - "java/src/org/chromium/chrome/browser/ui/signin/account_picker/AccountPickerBottomSheetRenderTest.java", - "java/src/org/chromium/chrome/browser/ui/signin/account_picker/AccountPickerBottomSheetTest.java", + "java/src/org/chromium/chrome/browser/ui/signin/TangibleSyncCoordinatorTest.java", "java/src/org/chromium/chrome/browser/ui/signin/account_picker/AccountPickerDialogTest.java", "java/src/org/chromium/chrome/browser/ui/signin/fre/FreUMADialogTest.java", ] @@ -194,15 +222,14 @@ android_library("javatests") { ":java", "//base:base_java", "//base:base_java_test_support", - "//chrome/android:chrome_java", "//chrome/browser/flags:java", "//chrome/browser/preferences:java", "//chrome/browser/profiles/android:java", "//chrome/browser/signin/services/android:java", "//chrome/browser/ui/android/night_mode:night_mode_java_test_support", - "//chrome/test/android:chrome_java_test_support", - "//components/browser_ui/bottomsheet/android:java", + "//chrome/test/android:chrome_java_integration_test_support", "//components/browser_ui/modaldialog/android:java", + "//components/browser_ui/styles/android:java", "//components/externalauth/android:java", "//components/prefs/android:java", "//components/signin/core/browser:signin_enums_java", diff --git a/chromium/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chromium/chrome/browser/ui/android/strings/android_chrome_strings.grd index cf38ec789fa..60c67124be2 100644 --- a/chromium/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chromium/chrome/browser/ui/android/strings/android_chrome_strings.grd @@ -277,10 +277,6 @@ CHAR_LIMIT guidelines: USB - - Unsupported - - You and Google @@ -553,7 +549,7 @@ CHAR_LIMIT guidelines: Remove - A virtual card disguises your actual card to help protect you from potential fraud. <link1>Learn more about virtual cards</link1> + A virtual card hides your actual card to help protect you from potential fraud. <link1>Learn more about virtual cards</link1> Virtual card @@ -594,7 +590,7 @@ CHAR_LIMIT guidelines: other {%1$sJerry, 438-123-1922\u2026 and %2$s2 more}} - + Passwords @@ -745,6 +741,12 @@ CHAR_LIMIT guidelines: Details: %1$sIOException: No space left on device + + Unified password manager error + + + The unified password manager was automatically disabled. Please submit an issue via the bug app! + @@ -806,22 +808,9 @@ CHAR_LIMIT guidelines: Touch to Search - - Learn about topics on websites without leaving the page. Touch to Search sends a word and its surrounding context to Google Search, returning definitions, pictures, search results, and other details. - -Tap any word to search. To refine your search, touch & hold to select more or fewer words. To edit your search, open the panel, tap the icon to open in a new tab, and make your changes in the search box. - - Learn about topics on websites without leaving the page. Touch to Search sends a word and its surrounding context to Google Search, returning definitions, pictures, search results, and other details. - -Touch & hold any word to search. To refine your search, select more or fewer words. To edit your search, open the panel, tap the icon to open in a new tab, and make your changes in the search box. - - Learn about topics on websites without leaving the page. Select one or more words on the page to search for them. - - Touch to Search sends the selected word and the current page as context to Google Search. You can turn it off in <link>Settings</link>. - Include surrounding text in Google searches? @@ -831,9 +820,6 @@ Touch & hold any word to search. To refine your search, select more or fewer Include - - Allow - No thanks @@ -968,48 +954,84 @@ Based on your interaction with a site, like regularly signing in to an account, Trust tokens improve privacy on the web and can’t be used to find out who you are. - + <b>What data is used:</b> Your browsing history, a record of sites you’ve visited using Chrome on this device. - + <b>How we use this data:</b> Chrome can estimate your interests. Later, a site you visit can ask Chrome to see your interests in order to personalize the ads you see. - + <b>How you can manage your data:</b> To protect your privacy, we auto-delete your interests that are older than 4 weeks. As you keep browsing, an interest might appear on the list again. Or you can remove interests you don’t want Chrome to consider. + + <b>What data is used:</b> Your browsing history, a record of sites you’ve visited using Chrome on this device. + + + <b>How we use this data:</b> Sites can store information with Chrome about your interests. For example, if you visit a site to buy shoes for a marathon, the site might define your interest as running marathons. Later, if you visit a different site to register for a race, that site can show you an ad for running shoes based on your interests. + + + <b>How you can manage your data:</b> To protect your privacy, we auto-delete sites from the list that are older than 4 weeks. A site you visit again might appear on the list again. Or you can remove a site if you don’t want that site to ever define interests for you. + About ad personalization Add %1$sActing and Theater + + Add %1$sexample.com + - Interest added + Chrome can consider this interest + + + Site can define interests Remove %1$sActing and Theater + + Remove %1$sexample.com + Interest removed Interests you removed + + Site removed + + + Sites you removed + Allow an interest or site if you think ads related to the item would be useful to you Browser-based ad personalization - + Your interests as estimated by Chrome + + Sites you visit that define your interests + A list of interests will appear here as you browse the web Interests you removed will appear here + + Sites you removed will appear here + + + Sites you visit that define your interests + + + A list of sites will appear here as you browse the web + @@ -1033,21 +1055,24 @@ Trust tokens improve privacy on the web and can’t be used to find out who you Limited sharing between sites - - We’re exploring ways to restrict cross-site tracking while enabling sites to stop ad spam and fraud. + + We’re exploring ways to restrict tracking while enabling sites to stop ad spam and fraud. More control over the ads you see - - During the trials, you can see and remove topics of interest sites use to show you ads. Chrome estimates your interests based on your recent browsing history. + + You can see and remove topics of interest sites use to show you ads. Chrome estimates your interests based on your recent browsing history. Learn more about ad personalization in Chrome - + Your interests as estimated by Chrome + + Sites you visit that define your interests + You can change your mind at any time in Chrome settings. The trials run alongside the current way ads get served, so you won’t see changes right away. @@ -1066,8 +1091,8 @@ Trust tokens improve privacy on the web and can’t be used to find out who you Help us build a better web - - During trials, Chrome is exploring ways to limit spam, fraud, and sharing between sites. Chrome also <link>estimates your interests</link> that sites can use to show you ads. You can manage your interests in settings. + + Chrome is finding new ways to reduce tracking and keep you even safer as you browse. Chrome also <link>estimates your interests</link> and enables you to manage them. Then, sites you visit can ask Chrome for your interests to show you ads. @@ -1225,143 +1250,143 @@ Your Google account may have other forms of browsing history like searches and a %1$s3 items deleted - - + + Privacy guide - - Review privacy and security settings + + Review key privacy and security controls - - The most important privacy and security controls in one place + + A guide of your privacy choices - - Chrome provides reasonable defaults, but you can customize it to best fit your browsing habit + + Take a guided tour of key privacy and security controls. For more options, go to individual settings. - + Let’s go - - What you get + + When on - - What you share with Google + + Things to consider - + You’ll browse faster because content is proactively loaded based on your current webpage visit - + You’ll get improved suggestions in the address bar - - URLs you visit are sent to Google + + URLs you visit are sent to Google to predict what sites you might visit next - + If you also share Chrome usage reports, those reports include the URLs you visit - + History sync - - You’ll have your history on all your synced devices, so you can continue what you were doing + + You’ll have your history on all your synced devices so you can continue what you were doing - + If Google is also your default search engine, you’ll see better, contextually relevant suggestions - - The URLs you visit are saved to your Google account + + The URLs you visit are saved to your Google Account - + Choose when to block third-party cookies - + Block while using incognito - + While in incognito, sites can’t use your cookies to see your browsing activity across different sites, for example, to personalize ads. Features on some sites may break. - + Block all the time - + Sites can only use your cookies to see your browsing activity only on their own site - + Choose your Safe Browsing protection - + Enhanced protection - + Faster, proactive protection against dangerous websites, downloads, and extensions - + Standard protection - + Standard protection against websites, downloads, and extensions that are known to be dangerous - + Finish - + Review complete! - + Explore more settings below or finish now - + Privacy Sandbox trial - + See how Chrome plans to safeguard you from cross-site tracking while preserving the open web - + Web & App Activity - + Choose whether to include Chrome history for more personalized experiences in Google services - + Privacy guide explanation - + Privacy guide explanation opened at half height - + Privacy guide explanation opened at full height - + Privacy guide explanation closed - + Detects and warns you about dangerous events when they happen - + Checks URLs with a list of unsafe sites stored in Chrome - + If a site tries to steal your password, or when you download a harmful file, Chrome may send URLs including bits of page content to Safe Browsing - - Warns you about dangerous events before they happen + + Predicts and warns you about dangerous events before they happen - + Keeps you safe on Chrome and may be used to improve your security in other Google apps when you are signed in - - Warns you if passwords are exposed in a data breach - - + Improves security for you and everyone on the web - + + Warns you if passwords are exposed in a data breach + + Sends URLs to Safe Browsing to check them - - Sends a small sample of pages, downloads, extension activity, and system information to help discover new threats + + Also sends a small sample of pages, downloads, extension activity, and system information to help discover new threats - + Temporarily links this data to your Google Account when you’re signed in, to protect you across Google apps @@ -1422,6 +1447,9 @@ Your Google account may have other forms of browsing history like searches and a Chrome couldn’t check all passwords + + Update Google Play services to check your passwords + Chrome is up to date @@ -1562,7 +1590,7 @@ Your Google account may have other forms of browsing history like searches and a Other languages - Content languages + Preferred languages To show content in your preferred languages, the sites you visit can see your preferences @@ -1588,6 +1616,9 @@ Your Google account may have other forms of browsing history like searches and a Your keyboard won’t change + + More languages + Loading %1$sHindi @@ -1660,45 +1691,12 @@ Your Google account may have other forms of browsing history like searches and a - - Download later instead? - - - You'll see a notification when this file is ready - - - Now - - - Your file will be saved to <b>%1$sDownloads</b>. <LINK2>Edit</LINK2>. - Next - - On Wi-Fi - - - Pick date & time - Ask when to save files - - Your %1$s2G connection might slow down your download - - - 2G - - - Bluetooth - - - This file is large (%1$s300MB) - - - Done - @@ -1842,8 +1840,27 @@ Your Google account may have other forms of browsing history like searches and a Allow all sites - - Powered by Chrome + + + %1$sAlice wants you to approve this website: + + + All pages of %1$snetflix.com + + + Approve + + + Don’t approve + + + Option to approve or not approve a website + + + Option to approve or not approve a website opened at full height + + + Option to approve or not approve a website closed @@ -2244,6 +2261,16 @@ To change this setting, <resetlink>reset sync

%1$s8:30PM. + + Download file? + + + Anyone using this device can see downloaded files + + + Download + + Translate… @@ -2289,6 +2316,15 @@ To change this setting, <resetlink>reset sync

Verify it’s you + + To manage your passwords, update Google Play services + + + Update + + + Not now + @@ -2443,12 +2479,6 @@ To change this setting, <resetlink>reset sync

Install this app - - To get here quicker, add this page to your Home screen - - - To get here quicker, add this page to your Home screen from the More options button - Add to Home screen @@ -2755,6 +2785,20 @@ To change this setting, <resetlink>reset sync

+ + + Lock Incognito tabs when you leave Chrome + + + Use screen lock to see open Incognito tabs + + + Turn on Incognito lock + + + Incognito tabs will be locked when you leave Chrome + + CVC @@ -2857,6 +2901,18 @@ To change this setting, <resetlink>reset sync

Turn on sync? + + Turn on sync + + + Sync + + + Back up your stuff and use it on any device + + + Sync your data on all devices + Sync your passwords, history & more on all devices @@ -2866,6 +2922,18 @@ To change this setting, <resetlink>reset sync

You can always choose what to sync in <LINK1>settings</LINK1>. + + You can always choose what to sync in <LINK1>settings</LINK1>. Google may personalize Search and other services based on your history. + + + Bookmarks + + + Autofill + + + History and more + Yes, I'm in @@ -2882,10 +2950,10 @@ To change this setting, <resetlink>reset sync

- Sign in to this site and Chrome with your Google Account. You can turn on sync later. + Sign in to this site and Chrome - You can send tabs between devices that are signed in with the same Google Account + To send this tab to another device, sign in to Chrome on both devices Signing in... @@ -3648,7 +3716,7 @@ To change this setting, <resetlink>reset sync

- Track price here + Track price Track price from the More options button @@ -3797,6 +3865,17 @@ To change this setting, <resetlink>reset sync

+ + + Desktop sites requested by default + + + Update settings + + + Request desktop sites by default? + + @@ -3887,15 +3966,18 @@ To change this setting, <resetlink>reset sync

Showing suggestions for %1$sCrater Lake National Park (U.S. National Park Service) - - %1$sCrater Lake National Park (U.S. National Park Service): %2$shttps://www.nps.gov/crla - Chrome action button: %sclear browsing data %d12 suggested items in list below. + + Search: %sWeather in San Francisco + + + Navigate: %1$sCrater Lake National Park (U.S. National Park Service): %2$shttps://www.nps.gov/crla + {NUM_SELECTED, plural, @@ -4200,6 +4282,9 @@ To change this setting, <resetlink>reset sync

Running in Chrome + + Running in %1$sChromium + You'll see your %1$swww.youtube.com sign-in status, browsing data, and site data in Chrome @@ -4495,6 +4580,12 @@ To change this setting, <resetlink>reset sync

Translate this page to any language from the More options button + + Translate pages here + + + Translate pages from the More Options button + New: share a link that scrolls to this text @@ -4592,21 +4683,15 @@ To change this setting, <resetlink>reset sync

You can send tabs between devices that are signed in with the same Google Account + + To send this tab to another device, sign in to Chrome there + Sharing to %1$sPixel 3 - - Turn on sync to share across devices - - - To share something from your phone to another device, turn on sync in Chrome settings on both devices - - - Go to Chrome settings - @@ -4698,9 +4783,6 @@ To change this setting, <resetlink>reset sync

Copied to your clipboard - - Send text to Your Devices - @@ -4967,12 +5049,12 @@ To change this setting, <resetlink>reset sync

- - You can use this phone to sign in on the computer that’s displaying this QR code. + + You can use this phone to sign in on the device that’s displaying this QR code. - - You can use this tablet to sign in on the computer that’s displaying this QR code. + + You can use this tablet to sign in on the device that’s displaying this QR code. @@ -5470,17 +5552,6 @@ To change this setting, <resetlink>reset sync

- - - Ad - - - Results from\n%1$s - - - Search results from Google. - - Signing in to %1$srp.example with %2$sidp.com @@ -5620,6 +5691,11 @@ To change this setting, <resetlink>reset sync

Passwords are saved to Password Manager on this device + + + + Price drop spotted + diff --git a/chromium/chrome/browser/ui/android/toolbar/BUILD.gn b/chromium/chrome/browser/ui/android/toolbar/BUILD.gn index c7293ed364f..56e3c249e07 100644 --- a/chromium/chrome/browser/ui/android/toolbar/BUILD.gn +++ b/chromium/chrome/browser/ui/android/toolbar/BUILD.gn @@ -11,6 +11,7 @@ android_library("java") { "java/src/org/chromium/chrome/browser/toolbar/ButtonData.java", "java/src/org/chromium/chrome/browser/toolbar/ButtonDataImpl.java", "java/src/org/chromium/chrome/browser/toolbar/ButtonDataProvider.java", + "java/src/org/chromium/chrome/browser/toolbar/ConstraintsChecker.java", "java/src/org/chromium/chrome/browser/toolbar/ControlContainer.java", "java/src/org/chromium/chrome/browser/toolbar/HomeButton.java", "java/src/org/chromium/chrome/browser/toolbar/IncognitoToggleTabLayout.java", @@ -65,6 +66,13 @@ android_library("java") { "java/src/org/chromium/chrome/browser/toolbar/menu_button/MenuButtonViewBinder.java", "java/src/org/chromium/chrome/browser/toolbar/menu_button/MenuItemState.java", "java/src/org/chromium/chrome/browser/toolbar/menu_button/MenuUiState.java", + "java/src/org/chromium/chrome/browser/toolbar/optional_button/OptionalButtonConstants.java", + "java/src/org/chromium/chrome/browser/toolbar/optional_button/OptionalButtonCoordinator.java", + "java/src/org/chromium/chrome/browser/toolbar/optional_button/OptionalButtonMediator.java", + "java/src/org/chromium/chrome/browser/toolbar/optional_button/OptionalButtonProperties.java", + "java/src/org/chromium/chrome/browser/toolbar/optional_button/OptionalButtonView.java", + "java/src/org/chromium/chrome/browser/toolbar/optional_button/OptionalButtonViewBinder.java", + "java/src/org/chromium/chrome/browser/toolbar/optional_button/ShrinkTransition.java", "java/src/org/chromium/chrome/browser/toolbar/top/ActionModeController.java", "java/src/org/chromium/chrome/browser/toolbar/top/CaptureReadinessResult.java", "java/src/org/chromium/chrome/browser/toolbar/top/HomeButtonCoordinator.java", @@ -74,7 +82,6 @@ android_library("java") { "java/src/org/chromium/chrome/browser/toolbar/top/NavigationPopup.java", "java/src/org/chromium/chrome/browser/toolbar/top/OptionalBrowsingModeButtonController.java", "java/src/org/chromium/chrome/browser/toolbar/top/ResourceFactory.java", - "java/src/org/chromium/chrome/browser/toolbar/top/StartSurfaceHomeButtonIPHController.java", "java/src/org/chromium/chrome/browser/toolbar/top/StartSurfaceTabSwitcherActionMenuCoordinator.java", "java/src/org/chromium/chrome/browser/toolbar/top/StartSurfaceToolbarCoordinator.java", "java/src/org/chromium/chrome/browser/toolbar/top/StartSurfaceToolbarMediator.java", @@ -107,6 +114,7 @@ android_library("java") { "//base:base_java", "//base:jni_java", "//build/android:build_java", + "//cc:cc_java", "//chrome/android/features/start_surface:public_java", "//chrome/browser/android/lifecycle:java", "//chrome/browser/back_press/android:java", @@ -247,6 +255,7 @@ android_resources("java_resources") { "java/res/layout/control_container.xml", "java/res/layout/menu_button.xml", "java/res/layout/navigation_popup_item.xml", + "java/res/layout/optional_button_layout.xml", "java/res/layout/radio_button_group_adaptive_toolbar_preference.xml", "java/res/layout/start_top_toolbar.xml", "java/res/layout/tab_switcher_toolbar.xml", @@ -269,26 +278,29 @@ android_resources("java_resources") { ] } -android_library("junit") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true - testonly = true - +robolectric_library("junit") { sources = [ + "java/src/org/chromium/chrome/browser/toolbar/ConstraintsCheckerTest.java", + "java/src/org/chromium/chrome/browser/toolbar/ToolbarProgressBarTest.java", "java/src/org/chromium/chrome/browser/toolbar/VoiceToolbarButtonControllerUnitTest.java", "java/src/org/chromium/chrome/browser/toolbar/adaptive/AdaptiveButtonActionMenuCoordinatorTest.java", "java/src/org/chromium/chrome/browser/toolbar/adaptive/AdaptiveToolbarButtonControllerTest.java", "java/src/org/chromium/chrome/browser/toolbar/adaptive/AdaptiveToolbarFeaturesTest.java", "java/src/org/chromium/chrome/browser/toolbar/adaptive/AdaptiveToolbarStatePredictorTest.java", "java/src/org/chromium/chrome/browser/toolbar/adaptive/OptionalNewTabButtonControllerUnitTest.java", + "java/src/org/chromium/chrome/browser/toolbar/adaptive/settings/AdaptiveToolbarPreferenceFragmentTest.java", + "java/src/org/chromium/chrome/browser/toolbar/load_progress/LoadProgressMediatorTest.java", "java/src/org/chromium/chrome/browser/toolbar/menu_button/MenuButtonCoordinatorTest.java", "java/src/org/chromium/chrome/browser/toolbar/menu_button/MenuButtonMediatorTest.java", "java/src/org/chromium/chrome/browser/toolbar/menu_button/MenuButtonTest.java", + "java/src/org/chromium/chrome/browser/toolbar/optional_button/OptionalButtonCoordinatorTest.java", + "java/src/org/chromium/chrome/browser/toolbar/optional_button/OptionalButtonViewTest.java", "java/src/org/chromium/chrome/browser/toolbar/top/HomeButtonCoordinatorTest.java", "java/src/org/chromium/chrome/browser/toolbar/top/OptionalBrowsingModeButtonControllerTest.java", "java/src/org/chromium/chrome/browser/toolbar/top/ToggleTabStackButtonCoordinatorTest.java", "java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainerTest.java", "java/src/org/chromium/chrome/browser/toolbar/top/ToolbarSnapshotStateTest.java", + "java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTabletUnitTest.java", "java/src/org/chromium/chrome/browser/toolbar/top/TopToolbarInteractabilityManagerTest.java", "java/src/org/chromium/chrome/browser/toolbar/top/TopToolbarOverlayMediatorTest.java", ] @@ -298,6 +310,7 @@ android_library("junit") { "//base:base_java", "//base:base_java_test_support", "//base:base_junit_test_support", + "//cc:cc_java", "//chrome/browser/android/lifecycle:java", "//chrome/browser/browser_controls/android:java", "//chrome/browser/feature_engagement:java", @@ -313,8 +326,10 @@ android_library("junit") { "//chrome/browser/ui/android/theme:java", "//chrome/browser/ui/android/toolbar:java_resources", "//chrome/browser/user_education:java", - "//chrome/test/android:chrome_java_test_support", + "//chrome/test/android:chrome_java_unit_test_support", "//components/browser_ui/settings/android:java", + "//components/browser_ui/styles/android:java", + "//components/browser_ui/theme/android:java_resources", "//components/browser_ui/widget/android:java", "//components/feature_engagement:feature_engagement_java", "//components/search_engines/android:java", @@ -322,53 +337,18 @@ android_library("junit") { "//content/public/android:content_full_java", "//content/public/test/android:content_java_test_support", "//third_party/android_deps:guava_android_java", - "//third_party/android_deps:robolectric_all_java", "//third_party/android_support_test_runner:runner_java", "//third_party/androidx:androidx_annotation_annotation_java", + "//third_party/androidx:androidx_appcompat_appcompat_resources_java", + "//third_party/androidx:androidx_fragment_fragment_testing_java", "//third_party/androidx:androidx_test_core_java", "//third_party/androidx:androidx_test_runner_java", "//third_party/hamcrest:hamcrest_library_java", "//third_party/junit", "//third_party/mockito:mockito_java", "//ui/android:ui_java", - "//url:gurl_java", - "//url:gurl_junit_test_support", - ] -} - -android_library("javatests") { - testonly = true - sources = [ - "java/src/org/chromium/chrome/browser/toolbar/ToolbarProgressBarTest.java", - "java/src/org/chromium/chrome/browser/toolbar/adaptive/settings/AdaptiveToolbarPreferenceFragmentTest.java", - "java/src/org/chromium/chrome/browser/toolbar/load_progress/LoadProgressMediatorTest.java", - ] - - deps = [ - ":java", - ":java_resources", - "//base:base_java", - "//base:base_java_test_support", - "//chrome/browser/flags:java", - "//chrome/browser/preferences:java", - "//chrome/browser/settings:test_support_java", - "//chrome/browser/tab:java", - "//chrome/browser/ui/android/omnibox:java_resources", - "//chrome/browser/ui/android/toolbar:java", - "//chrome/test/android:chrome_java_test_support", - "//components/browser_ui/settings/android:java", - "//components/browser_ui/styles/android:java", - "//components/browser_ui/widget/android:java", - "//content/public/android:content_java", - "//content/public/test/android:content_java_test_support", - "//third_party/androidx:androidx_test_runner_java", - "//third_party/hamcrest:hamcrest_library_java", - "//third_party/junit", - "//third_party/mockito:mockito_java", - "//ui/android:ui_java", "//ui/android:ui_java_test_support", "//url:gurl_java", + "//url:gurl_junit_test_support", ] - - resources_package = "org.chromium.chrome.browser.toolbar" } diff --git a/chromium/chrome/browser/ui/android/webid/BUILD.gn b/chromium/chrome/browser/ui/android/webid/BUILD.gn index 7db653b2253..a1eba546082 100644 --- a/chromium/chrome/browser/ui/android/webid/BUILD.gn +++ b/chromium/chrome/browser/ui/android/webid/BUILD.gn @@ -13,6 +13,8 @@ android_library("public_java") { "//url:gurl_java", ] + srcjar_deps = [ ":java_enums_srcjar" ] + sources = [ "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionComponent.java", "java/src/org/chromium/chrome/browser/ui/android/webid/data/Account.java", @@ -29,3 +31,7 @@ generate_jni("jni_headers") { "java/src/org/chromium/chrome/browser/ui/android/webid/data/IdentityProviderMetadata.java", ] } + +java_cpp_enum("java_enums_srcjar") { + sources = [ "//content/public/browser/identity_request_dialog_controller.h" ] +} diff --git a/chromium/chrome/browser/ui/android/webid/internal/BUILD.gn b/chromium/chrome/browser/ui/android/webid/internal/BUILD.gn index 8747b28633a..4dbe88ec4d2 100644 --- a/chromium/chrome/browser/ui/android/webid/internal/BUILD.gn +++ b/chromium/chrome/browser/ui/android/webid/internal/BUILD.gn @@ -65,13 +65,11 @@ android_resources("java_resources") { ] } -java_library("junit") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true - - testonly = true - - sources = [ "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionControllerTest.java" ] +robolectric_library("junit") { + sources = [ + "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionControllerTest.java", + "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionViewTest.java", + ] deps = [ ":java", @@ -85,11 +83,14 @@ java_library("junit") { "//components/favicon/android:java", "//components/image_fetcher:java", "//components/url_formatter/android:url_formatter_java", - "//third_party/android_deps:robolectric_all_java", "//third_party/androidx:androidx_annotation_annotation_java", + "//third_party/androidx:androidx_recyclerview_recyclerview_java", + "//third_party/androidx:androidx_test_core_java", + "//third_party/androidx:androidx_test_ext_junit_java", "//third_party/junit", "//third_party/mockito:mockito_java", "//ui/android:ui_full_java", + "//ui/android:ui_java_test_support", "//url:gurl_java", "//url:gurl_junit_shadows", "//url:gurl_junit_test_support", @@ -99,10 +100,7 @@ java_library("junit") { android_library("javatests") { testonly = true - sources = [ - "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionIntegrationTest.java", - "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionViewTest.java", - ] + sources = [ "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionIntegrationTest.java" ] deps = [ ":java", @@ -115,7 +113,7 @@ android_library("javatests") { "//chrome/browser/flags:java", "//chrome/browser/tab:java", "//chrome/browser/ui/android/webid:public_java", - "//chrome/test/android:chrome_java_test_support", + "//chrome/test/android:chrome_java_integration_test_support", "//components/browser_ui/bottomsheet/android:java", "//components/browser_ui/bottomsheet/android/test:java", "//content/public/test/android:content_java_test_support", diff --git a/chromium/chrome/browser/ui/ash/holding_space/BUILD.gn b/chromium/chrome/browser/ui/ash/holding_space/BUILD.gn index 4224d6fbd66..0bd7bb2242b 100644 --- a/chromium/chrome/browser/ui/ash/holding_space/BUILD.gn +++ b/chromium/chrome/browser/ui/ash/holding_space/BUILD.gn @@ -60,12 +60,12 @@ source_set("test_support") { "//base/test:test_support", "//chrome/browser", "//chrome/browser/ash", + "//chrome/browser/ash/system_web_apps/test_support:test_support_ui", "//chrome/browser/chromeos:test_support", "//chrome/browser/extensions", "//chrome/browser/ui", - "//chrome/browser/web_applications:browser_tests_base", "//chrome/test:test_support_ui", - "//chromeos/dbus/session_manager", + "//chromeos/ash/components/dbus/session_manager", "//components/session_manager/core", "//ui/views", ] diff --git a/chromium/chrome/browser/ui/ash/system_web_apps/BUILD.gn b/chromium/chrome/browser/ui/ash/system_web_apps/BUILD.gn new file mode 100644 index 00000000000..11f738a7bc0 --- /dev/null +++ b/chromium/chrome/browser/ui/ash/system_web_apps/BUILD.gn @@ -0,0 +1,30 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//chrome/browser/buildflags.gni") + +assert(is_chromeos_ash) + +source_set("system_web_apps") { + sources = [ + "system_web_app_delegate_ui_impl.cc", + "system_web_app_ui_utils.cc", + "system_web_app_ui_utils.h", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + deps = [ + "//base", + "//chrome/browser/ash/system_web_apps", + "//chrome/browser/ash/system_web_apps/types", + "//chrome/browser/profiles:profile", + "//chrome/browser/web_applications", + "//chrome/common", + "//components/services/app_service/public/mojom", + "//content/public/browser", + "//ui/base", + "//ui/display", + ] +} diff --git a/chromium/chrome/browser/ui/color/BUILD.gn b/chromium/chrome/browser/ui/color/BUILD.gn index 99e5a81eeab..be4803fdbc2 100644 --- a/chromium/chrome/browser/ui/color/BUILD.gn +++ b/chromium/chrome/browser/ui/color/BUILD.gn @@ -65,7 +65,7 @@ source_set("mixers") { } } -if (!is_ios && !is_android && !is_castos) { +if (!is_ios && !is_android) { executable("dump_colors") { testonly = true diff --git a/chromium/chrome/browser/ui/messages/android/BUILD.gn b/chromium/chrome/browser/ui/messages/android/BUILD.gn index d7e310efb47..b104ee30c86 100644 --- a/chromium/chrome/browser/ui/messages/android/BUILD.gn +++ b/chromium/chrome/browser/ui/messages/android/BUILD.gn @@ -59,12 +59,7 @@ generate_jni("jni_headers") { sources = [ "java/src/org/chromium/chrome/browser/ui/messages/infobar/SimpleConfirmInfoBarBuilder.java" ] } -java_library("junit") { - # Skip platform checks since Robolectric depends on requires_android targets. - bypass_platform_checks = true - - testonly = true - +robolectric_library("junit") { sources = [ "java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarCollectionUnitTest.java" ] deps = [ @@ -75,7 +70,7 @@ java_library("junit") { ] } -android_library("javatests") { +android_library("unit_device_javatests") { testonly = true resources_package = "org.chromium.chrome.browser.ui.messages.test" @@ -87,7 +82,7 @@ android_library("javatests") { "//base:base_java", "//base:base_java_test_support", "//chrome/browser/util:java", - "//chrome/test/android:chrome_java_test_support", + "//chrome/test/android:chrome_java_integration_test_support", "//content/public/android:content_java", "//content/public/test/android:content_java_test_support", "//third_party/android_support_test_runner:rules_java", diff --git a/chromium/chrome/browser/ui/side_search/BUILD.gn b/chromium/chrome/browser/ui/side_search/BUILD.gn index 2495de1df55..576b84d8ad5 100644 --- a/chromium/chrome/browser/ui/side_search/BUILD.gn +++ b/chromium/chrome/browser/ui/side_search/BUILD.gn @@ -4,10 +4,6 @@ import("//third_party/protobuf/proto_library.gni") -proto_library("side_search_window_data_proto") { - sources = [ "side_search_window_data.proto" ] -} - proto_library("side_search_tab_data_proto") { sources = [ "side_search_tab_data.proto" ] } diff --git a/chromium/chrome/browser/ui/web_applications/BUILD.gn b/chromium/chrome/browser/ui/web_applications/BUILD.gn new file mode 100644 index 00000000000..5d2724f8f3f --- /dev/null +++ b/chromium/chrome/browser/ui/web_applications/BUILD.gn @@ -0,0 +1,131 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//chrome/browser/buildflags.gni") + +source_set("unit_tests") { + testonly = true + + sources = [ + "app_browser_controller_unittest.cc", + "share_target_utils_unittest.cc", + "web_app_launch_manager_unittest.cc", + "web_app_launch_utils_unittest.cc", + ] + + if (is_chromeos_ash) { + sources += [ "file_stream_data_pipe_getter_unittest.cc" ] + } + + deps = [ + "//chrome/browser", + "//chrome/browser/ui", + "//chrome/browser/web_applications", + "//chrome/browser/web_applications:web_applications_unit_tests", + "//components/services/app_service/public/cpp:intents", + "//content/test:test_support", + "//storage/browser:test_support", + ] +} + +source_set("browser_tests") { + testonly = true + + sources = [ + "create_shortcut_browsertest.cc", + "pwa_mixed_content_browsertest.cc", + "sub_apps_service_impl_browsertest.cc", + "web_app_badging_browsertest.cc", + "web_app_browsertest.cc", + "web_app_dark_mode_browsertest.cc", + "web_app_engagement_browsertest.cc", + "web_app_file_handling_browsertest.cc", + "web_app_launch_handler_browsertest.cc", + "web_app_link_capturing_browsertest.cc", + "web_app_metrics_browsertest.cc", + "web_app_navigate_browsertest.cc", + "web_app_protocol_handling_browsertest.cc", + "web_app_ui_manager_impl_browsertest.cc", + "web_app_uninstall_browsertest.cc", + "web_app_url_handling_browsertest.cc", + "web_app_window_controls_overlay_browsertest.cc", + ] + + if (!is_chromeos_lacros) { + sources += [ + # Test not valid on Lacros as WebApps is only enabled in the main + # profile which can never be deleted. + "web_app_profile_deletion_browsertest.cc", + ] + } + + if (is_chromeos_ash) { + sources += [ + "app_browser_controller_browsertest.cc", + "web_app_guest_session_browsertest_chromeos.cc", + ] + } + + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + + deps = [ + "//chrome/app:command_ids", + "//chrome/browser:browser_themes", + "//chrome/browser:theme_properties", + "//chrome/browser/browsing_data:constants", + "//chrome/browser/devtools", + "//chrome/browser/web_applications:web_applications_test_support", + "//chrome/test:test_support", + "//chrome/test:test_support_ui", + "//components/embedder_support", + "//components/page_load_metrics/browser:test_support", + "//components/services/app_service/public/cpp:protocol_handling", + "//components/site_engagement/content", + "//components/webapps/browser", + ] + + if (is_chromeos_ash) { + deps += [ + "//chrome/browser/ash/system_web_apps/test_support", + "//chrome/browser/ui/ash/system_web_apps", + ] + } +} + +# On Lacros, these browser tests require Ash to be running. +source_set("app_service_browser_tests") { + testonly = true + + sources = [ "launch_web_app_browsertest.cc" ] + + if (is_chromeos) { + sources += [ + "share_to_target_browsertest.cc", + "web_share_target_browsertest.cc", + ] + } + + if (is_chromeos_lacros) { + sources += [ "lacros_web_app_browsertest.cc" ] + } + + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + + deps = [ + "//chrome/app:command_ids", + "//chrome/browser/web_applications", + "//chrome/browser/web_applications:web_applications_test_support", + "//chrome/test:test_support", + "//chrome/test:test_support_ui", + "//components/services/app_service/public/cpp:intents", + ] + + if (is_chromeos_lacros) { + deps += [ + "//chrome/test:lacros_test_support_ui", + "//chromeos/lacros", + "//chromeos/lacros:test_support", + ] + } +} diff --git a/chromium/chrome/browser/ui/webui/BUILD.gn b/chromium/chrome/browser/ui/webui/BUILD.gn index 2f2ac276d6b..d8d8de838d5 100644 --- a/chromium/chrome/browser/ui/webui/BUILD.gn +++ b/chromium/chrome/browser/ui/webui/BUILD.gn @@ -55,11 +55,13 @@ source_set("configs") { "//ash/webui/file_manager:file_manager_untrusted_ui", "//ash/webui/help_app_ui", "//ash/webui/os_feedback_ui", + "//ash/webui/shortcut_customization_ui", "//chrome/browser/ash", ] if (!is_official_build) { deps += [ "//ash/webui/demo_mode_app_ui", + "//ash/webui/facial_ml_app_ui", "//ash/webui/sample_system_web_app_ui", ] } diff --git a/chromium/chrome/browser/ui/webui/DEPS b/chromium/chrome/browser/ui/webui/DEPS index fa8286d2400..e40bda8b4cd 100644 --- a/chromium/chrome/browser/ui/webui/DEPS +++ b/chromium/chrome/browser/ui/webui/DEPS @@ -1,20 +1,6 @@ include_rules = [ - "+ash/components/account_manager", - "+ash/components/audio", - "+ash/webui/os_feedback_ui", - "+components/app_constants", "+components/browser_ui/share/android", - "+components/services/app_service/public", - "+device/bluetooth", "+extensions/strings/grit/extensions_strings.h", - - # Generated files - "+js2webui/chrome/test/data", - - # Other libraries. - "+third_party/angle", # For ANGLE version. - "+third_party/brotli", # For compressed resources. - "+third_party/zlib/zlib.h", # For compression level constants. ] specific_include_rules = { diff --git a/chromium/chrome/browser/ui/webui/OWNERS b/chromium/chrome/browser/ui/webui/OWNERS index acfb748e059..39b8fd02560 100644 --- a/chromium/chrome/browser/ui/webui/OWNERS +++ b/chromium/chrome/browser/ui/webui/OWNERS @@ -8,8 +8,6 @@ per-file devtools_ui*=caseq@chromium.org per-file inspect_ui*=dgozman@chromium.org per-file inspect_ui*=caseq@chromium.org -per-file history_ui*=calamity@chromium.org - per-file memory_internals_ui*=erikchen@chromium.org per-file net_export_ui.*=file://net/OWNERS diff --git a/chromium/chrome/browser/ui/webui/about_ui.cc b/chromium/chrome/browser/ui/webui/about_ui.cc index f1be7001f5e..d6138afa814 100644 --- a/chromium/chrome/browser/ui/webui/about_ui.cc +++ b/chromium/chrome/browser/ui/webui/about_ui.cc @@ -686,11 +686,21 @@ void AboutUIHTMLSource::StartDataRequest( #endif #if BUILDFLAG(IS_CHROMEOS_ASH) } else if (source_name_ == chrome::kChromeUIOSCreditsHost) { - ChromeOSCreditsHandler::Start(path, std::move(callback)); - return; + if (path == kCreditsCssPath) { + response = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString( + IDR_ABOUT_UI_CREDITS_CSS); + } else { + ChromeOSCreditsHandler::Start(path, std::move(callback)); + return; + } } else if (source_name_ == chrome::kChromeUICrostiniCreditsHost) { - CrostiniCreditsHandler::Start(profile(), path, std::move(callback)); - return; + if (path == kCreditsCssPath) { + response = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString( + IDR_ABOUT_UI_CREDITS_CSS); + } else { + CrostiniCreditsHandler::Start(profile(), path, std::move(callback)); + return; + } } else if (source_name_ == chrome::kChromeUIBorealisCreditsHost) { HandleBorealisCredits(profile(), std::move(callback)); return; @@ -720,7 +730,8 @@ void AboutUIHTMLSource::FinishDataRequest( base::RefCountedString::TakeString(std::move(html_copy))); } -std::string AboutUIHTMLSource::GetMimeType(const std::string& path) { +std::string AboutUIHTMLSource::GetMimeType(const GURL& url) { + const base::StringPiece path = url.path_piece().substr(1); if (path == kCreditsJsPath || #if BUILDFLAG(IS_CHROMEOS_ASH) path == kKeyboardUtilsPath || diff --git a/chromium/chrome/browser/ui/webui/about_ui.h b/chromium/chrome/browser/ui/webui/about_ui.h index b159d18de89..4bdfbc6a002 100644 --- a/chromium/chrome/browser/ui/webui/about_ui.h +++ b/chromium/chrome/browser/ui/webui/about_ui.h @@ -32,7 +32,7 @@ class AboutUIHTMLSource : public content::URLDataSource { const GURL& url, const content::WebContents::Getter& wc_getter, content::URLDataSource::GotDataCallback callback) override; - std::string GetMimeType(const std::string& path) override; + std::string GetMimeType(const GURL& url) override; bool ShouldAddContentSecurityPolicy() override; std::string GetAccessControlAllowOriginForOrigin( const std::string& origin) override; diff --git a/chromium/chrome/browser/ui/webui/about_ui_unittest.cc b/chromium/chrome/browser/ui/webui/about_ui_unittest.cc index a802b46fa0e..2dc25abbba8 100644 --- a/chromium/chrome/browser/ui/webui/about_ui_unittest.cc +++ b/chromium/chrome/browser/ui/webui/about_ui_unittest.cc @@ -24,7 +24,7 @@ #include "chrome/common/url_constants.h" #include "chrome/common/webui_url_constants.h" #include "chrome/test/base/scoped_browser_locale.h" -#include "chromeos/dbus/dbus_thread_manager.h" +#include "chromeos/ash/components/dbus/dbus_thread_manager.h" #include "chromeos/system/fake_statistics_provider.h" #include "chromeos/system/statistics_provider.h" #include "content/public/browser/browser_task_traits.h" diff --git a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast.mojom b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast.mojom index 9a7e3a00f2f..4b7138e6fcb 100644 --- a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast.mojom +++ b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast.mojom @@ -29,7 +29,8 @@ enum AddSinkResultCode { SERVER_ERROR, SINK_CREATION_ERROR, CHANNEL_OPEN_ERROR, - PROFILE_SYNC_ERROR + PROFILE_SYNC_ERROR, + INTERNAL_MEDIA_ROUTER_ERROR }; diff --git a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_dialog.cc b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_dialog.cc index 9eb6b79b9d7..1159b3b3db0 100644 --- a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_dialog.cc +++ b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_dialog.cc @@ -34,6 +34,11 @@ void SetCurrentDialog(std::unique_ptr dialog) { // The corner radius for system dialogs. constexpr int kSystemDialogCornerRadiusDp = 12; +// The default width, height without footnote, height with footnote for the dialog container. +const int kDialogWidthDefault = 448; +const int kDialogHeightDefault = 295; +const int kDialogHeightFootnote = 330; + AccessCodeCastDialog::AccessCodeCastDialog( const CastModeSet& cast_mode_set, std::unique_ptr media_route_starter) @@ -156,14 +161,10 @@ void AccessCodeCastDialog::GetWebUIMessageHandlers( std::vector* handlers) const {} void AccessCodeCastDialog::GetDialogSize(gfx::Size* size) const { - const int kDefaultWidth = 448; - const int kDefaultHeight = 271; - const int kRememberDevicesHeight = 310; - base::TimeDelta duration_pref = GetAccessCodeDeviceDurationPref( - context_->GetPrefs()); + base::TimeDelta duration_pref = GetAccessCodeDeviceDurationPref(context_); bool rememberDevices = duration_pref != base::Seconds(0); - size->SetSize(kDefaultWidth, - rememberDevices ? kRememberDevicesHeight : kDefaultHeight); + size->SetSize(kDialogWidthDefault, + rememberDevices ? kDialogHeightFootnote : kDialogHeightDefault); } std::string AccessCodeCastDialog::GetDialogArgs() const { diff --git a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_dialog_browsertest.cc b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_dialog_browsertest.cc new file mode 100644 index 00000000000..d10275e2c31 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_dialog_browsertest.cc @@ -0,0 +1,60 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/media/router/discovery/access_code/access_code_cast_feature.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/test/test_browser_dialog.h" +#include "chrome/browser/ui/webui/access_code_cast/access_code_cast_dialog.h" +#include "chrome/test/base/chrome_test_utils.h" +#include "components/prefs/pref_service.h" +#include "content/public/test/browser_test.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace media_router { + +class AccessCodeCastDialogBrowserTest : public DialogBrowserTest { + public: + AccessCodeCastDialogBrowserTest() = default; + AccessCodeCastDialogBrowserTest(const AccessCodeCastDialogBrowserTest&) = + delete; + AccessCodeCastDialogBrowserTest& operator=( + const AccessCodeCastDialogBrowserTest&) = delete; + ~AccessCodeCastDialogBrowserTest() override = default; + + // DialogBrowserTest: + void ShowUi(const std::string& name) override { + content::WebContentsAddedObserver observer; + + // Enable AccessCodeCast. + browser()->profile()->GetPrefs()->SetBoolean( + media_router::prefs::kAccessCodeCastEnabled, true); + + // Show the dialog. + CastModeSet tab_mode = {MediaCastMode::TAB_MIRROR}; + content::WebContents* web_contents = + chrome_test_utils::GetActiveWebContents(this); + std::unique_ptr starter = + std::make_unique(tab_mode, web_contents, nullptr); + AccessCodeCastDialog::Show( + tab_mode, std::move(starter), + AccessCodeCastDialogOpenLocation::kBrowserCastMenu); + content::WebContents* dialog_contents = observer.GetWebContents(); + EXPECT_TRUE(content::WaitForLoadStop(dialog_contents)); + } + + private: + base::test::ScopedFeatureList feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(AccessCodeCastDialogBrowserTest, InvokeUi_default) { +#if BUILDFLAG(IS_LINUX) + GTEST_SKIP() << "Flaky on linux due to dialog closing early, b/235882005"; +#else + // ShowAndVerifyUi(); + GTEST_SKIP() << "Disabling test while investigating failures, b/242863470"; +#endif +} + +} // namespace media_router diff --git a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.cc b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.cc index 0249584141c..fdaed23dfdd 100644 --- a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.cc +++ b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.cc @@ -60,6 +60,8 @@ const char* AddSinkResultCodeToStringHelper(AddSinkResultCode value) { return "CHANNEL_OPEN_ERROR"; case AddSinkResultCode::PROFILE_SYNC_ERROR: return "PROFILE_SYNC_ERROR"; + case AddSinkResultCode::INTERNAL_MEDIA_ROUTER_ERROR: + return "INTERNAL_MEDIA_ROUTER_ERROR"; default: return nullptr; } @@ -120,9 +122,13 @@ AccessCodeCastHandler::AccessCodeCastHandler( cast_mode_set_(cast_mode_set), media_route_starter_(std::move(media_route_starter)) { if (media_route_starter_) { + DCHECK(media_route_starter_->GetProfile()) + << "The MediaRouteStarter does not have a valid profile!"; // Ensure we don't use an off-the-record profile. access_code_sink_service_ = AccessCodeCastSinkServiceFactory::GetForProfile( media_route_starter_->GetProfile()->GetOriginalProfile()); + DCHECK(access_code_sink_service_) + << "AccessCodeSinkService was not properly created!"; Init(); } } @@ -147,8 +153,6 @@ AccessCodeCastHandler::~AccessCodeCastHandler() { } void AccessCodeCastHandler::Init() { - DCHECK(access_code_sink_service_) - << "AccessCodeSinkService was not properly created!"; DCHECK(media_route_starter_) << "Must have MediaRouterService!"; media_route_starter_->SetLoggerComponent(kLoggerComponent); media_route_starter_->AddMediaSinkWithCastModesObserver(this); @@ -165,10 +169,10 @@ void AccessCodeCastHandler::AddSink( return; } AddSinkCallback callback_with_default_invoker = - mojo::WrapCallbackWithDefaultInvokeIfNotRun(std::move(callback), - AddSinkResultCode::UNKNOWN_ERROR); + mojo::WrapCallbackWithDefaultInvokeIfNotRun( + std::move(callback), AddSinkResultCode::UNKNOWN_ERROR); add_sink_callback_ = std::move(base::BindOnce(&AddSinkMetricsCallback)) - .Then(std::move(callback_with_default_invoker)); + .Then(std::move(callback_with_default_invoker)); access_code_sink_service_->DiscoverSink( access_code, base::BindOnce(&AccessCodeCastHandler::OnSinkAddedResult, weak_ptr_factory_.GetWeakPtr())); @@ -197,11 +201,6 @@ void AccessCodeCastHandler::CheckForDiscoveryCompletion() { return; } - // Sink has been completely added so caller can be alerted. - if (base::FeatureList::IsEnabled(features::kAccessCodeCastRememberDevices)) { - access_code_sink_service_->StoreSinkAndSetExpirationTimer(sink_id_.value()); - } - std::move(add_sink_callback_).Run(AddSinkResultCode::OK); } @@ -287,6 +286,18 @@ void AccessCodeCastHandler::CastToSink(CastToSinkCallback callback) { current_route_request_ = absl::make_optional(*params->request); + if (HasActiveRoute(sink_id_.value())) { + GetMediaRouter()->GetLogger()->LogInfo( + mojom::LogCategory::kUi, kLoggerComponent, + "There already exists a route for the given sink id. No new route can " + "be created. Checking to see if this is a saved device -- otherwise we " + "wil remove it from the media router.", + sink_id_.value(), "", ""); + access_code_sink_service_->CheckMediaSinkForExpiration(sink_id_.value()); + std::move(callback).Run(RouteRequestResultCode::ROUTE_ALREADY_EXISTS); + return; + } + params->route_result_callbacks.push_back(base::BindOnce( &AccessCodeCastHandler::OnRouteResponse, weak_ptr_factory_.GetWeakPtr(), cast_mode, params->request->id, *sink_id_, std::move(callback))); @@ -315,17 +326,14 @@ void AccessCodeCastHandler::OnRouteResponse(MediaCastMode cast_mode, const MediaRoute* route = result.route(); if (!route) { - DCHECK(result.result_code() != RouteRequestResult::OK) + DCHECK(result.result_code() != mojom::RouteRequestResultCode::OK) << "No route but OK response"; // The provider will handle sending an issue for a failed route request. GetMediaRouter()->GetLogger()->LogError( mojom::LogCategory::kUi, kLoggerComponent, "MediaRouteResponse returned error: " + result.error(), sink_id, "", ""); - std::move(dialog_callback) - .Run(mojo::EnumTraits< - RouteRequestResultCode, - RouteRequestResult::ResultCode>::ToMojom(result.result_code())); + std::move(dialog_callback).Run(result.result_code()); return; } @@ -333,4 +341,17 @@ void AccessCodeCastHandler::OnRouteResponse(MediaCastMode cast_mode, std::move(dialog_callback).Run(RouteRequestResultCode::OK); } +bool AccessCodeCastHandler::HasActiveRoute(const MediaSink::Id& sink_id) { + if (!GetMediaRouter()) + return false; + auto routes = GetMediaRouter()->GetCurrentRoutes(); + auto route_it = std::find_if(routes.begin(), routes.end(), + [&sink_id](const MediaRoute& route) { + return route.media_sink_id() == sink_id; + }); + if (route_it == routes.end()) + return false; + return true; +} + } // namespace media_router diff --git a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.h b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.h index 6fa9a84552f..1d86437655b 100644 --- a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.h +++ b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler.h @@ -65,6 +65,7 @@ class AccessCodeCastHandler : public access_code_cast::mojom::PageHandler, FRIEND_TEST_ALL_PREFIXES(AccessCodeCastHandlerTest, DesktopMirroring); FRIEND_TEST_ALL_PREFIXES(AccessCodeCastHandlerTest, DesktopMirroringError); FRIEND_TEST_ALL_PREFIXES(AccessCodeCastHandlerTest, OnSinkAddedResult); + FRIEND_TEST_ALL_PREFIXES(AccessCodeCastHandlerTest, RouteAlreadyExists); // Constructor that is used for testing. AccessCodeCastHandler( @@ -110,6 +111,9 @@ class AccessCodeCastHandler : public access_code_cast::mojom::PageHandler, // been satisfied. If so, alerts the dialog. void CheckForDiscoveryCompletion(); + // Checks to see that if route already exists for the given media sink id. + bool HasActiveRoute(const MediaSink::Id& sink_id); + mojo::Remote page_; mojo::Receiver receiver_; diff --git a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_browsertest.cc b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_browsertest.cc new file mode 100644 index 00000000000..e62f725210e --- /dev/null +++ b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_browsertest.cc @@ -0,0 +1,124 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/test/media_router/access_code_cast/access_code_cast_integration_browsertest.h" + +#if BUILDFLAG(IS_WIN) +#include "base/win/windows_version.h" +#endif +#include "chrome/browser/media/router/discovery/access_code/access_code_cast_constants.h" +#include "components/sessions/content/session_tab_helper.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace media_router { + +class AccessCodeCastHandlerBrowserTest + : public AccessCodeCastIntegrationBrowserTest {}; + +// TODO(b/235275754): Add a case for when the network is connected and we +// surface a server error. +IN_PROC_BROWSER_TEST_F(AccessCodeCastHandlerBrowserTest, + ExpectNetworkErrorWhenNoNetwork) { +#if BUILDFLAG(IS_WIN) + // TODO(b/235896651): This test sometimes timesout on win10. + if (base::win::GetVersion() >= base::win::Version::WIN10) + GTEST_SKIP() << "This test is flaky on win10"; +#endif + + EnableAccessCodeCasting(); + + // This tests that if the network is not present (we are not connected to the + // internet), we will see a server error in the access code dialog box. + SetUpPrimaryAccountWithHostedDomain(signin::ConsentLevel::kSync, + browser()->profile()); + + auto* dialog_contents = ShowDialog(); + SetAccessCode("abcdef", dialog_contents); + PressSubmit(dialog_contents); + + // This error code corresponds to + // ErrorMessage.NETWORK::AddSinkResultCode.SERVER_ERROR + EXPECT_EQ(3, WaitForAddSinkErrorCode(dialog_contents)); + CloseDialog(dialog_contents); +} + +IN_PROC_BROWSER_TEST_F(AccessCodeCastHandlerBrowserTest, + ReturnSuccessfulResponse) { +#if BUILDFLAG(IS_WIN) + // TODO(b/235896651): This test sometimes timesout on win10. + if (base::win::GetVersion() >= base::win::Version::WIN10) + GTEST_SKIP() << "This test is flaky on win10"; +#endif + + const char kEndpointResponseSuccess[] = + R"({ + "device": { + "displayName": "test_device", + "id": "1234", + "deviceCapabilities": { + "videoOut": true, + "videoIn": true, + "audioOut": true, + "audioIn": true, + "devMode": true + }, + "networkInfo": { + "hostName": "GoogleNet", + "port": "666", + "ipV4Address": "192.0.2.146", + "ipV6Address": "2001:0db8:85a3:0000:0000:8a2e:0370:7334" + } + } + })"; + + // Mock a successful fetch from our server. + SetEndpointFetcherMockResponse(kEndpointResponseSuccess, net::HTTP_OK, + net::OK); + + // Simulate a successful opening of the channel. + SetMockOpenChannelCallbackResponse(true); + + EnableAccessCodeCasting(); + + SetUpPrimaryAccountWithHostedDomain(signin::ConsentLevel::kSync, + browser()->profile()); + + auto* dialog_contents = ShowDialog(); + SetAccessCode("abcdef", dialog_contents); + ExpectStartRouteCallFromTabMirroring( + "cast:<1234>", + MediaSource::ForTab( + sessions::SessionTabHelper::IdForTab(web_contents()).id()) + .id(), + web_contents()); + + PressSubmitAndWaitForClose(dialog_contents); +} + +IN_PROC_BROWSER_TEST_F(AccessCodeCastHandlerBrowserTest, + ExpectGenericErrorWhenNoSync) { +#if BUILDFLAG(IS_WIN) + // TODO(b/235896651): This test sometimes timesout on win10. + if (base::win::GetVersion() >= base::win::Version::WIN10) + GTEST_SKIP() << "This test is flaky on win10"; +#endif + + EnableAccessCodeCasting(); + + // This tests that an account that does not have Sync enabled will throw a + // generic error. + SetUpPrimaryAccountWithHostedDomain(signin::ConsentLevel::kSignin, + browser()->profile()); + + auto* dialog_contents = ShowDialog(); + SetAccessCode("abcdef", dialog_contents); + PressSubmit(dialog_contents); + + // This error code corresponds to + // ErrorMessage.GENERIC::AddSinkResultCode.PROFILE_SYNC_ERROR + EXPECT_EQ(1, WaitForAddSinkErrorCode(dialog_contents)); + CloseDialog(dialog_contents); +} + +} // namespace media_router diff --git a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_unittest.cc b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_unittest.cc index fc749d043d1..64721262e4e 100644 --- a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_unittest.cc +++ b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_handler_unittest.cc @@ -72,27 +72,6 @@ class MockPage : public access_code_cast::mojom::Page { } // namespace -class MockAccessCodeCastSinkService : public AccessCodeCastSinkService { - public: - MockAccessCodeCastSinkService( - Profile* profile, - MediaRouter* media_router, - CastMediaSinkServiceImpl* cast_media_sink_service_impl, - DiscoveryNetworkMonitor* network_monitor) - : AccessCodeCastSinkService(profile, - media_router, - cast_media_sink_service_impl, - network_monitor, - profile->GetPrefs()) {} - ~MockAccessCodeCastSinkService() override = default; - - MOCK_METHOD(void, - AddSinkToMediaRouter, - (const MediaSinkInternal& sink, - AddSinkResultCallback add_sink_callback), - (override)); -}; - class AccessCodeCastHandlerTest : public ChromeRenderViewHostTestHarness { protected: AccessCodeCastHandlerTest() @@ -197,7 +176,7 @@ class AccessCodeCastHandlerTest : public ChromeRenderViewHostTestHarness { return access_code_cast_sink_service_.get(); } - void set_expected_cast_result(RouteRequestResult::ResultCode code) { + void set_expected_cast_result(mojom::RouteRequestResultCode code) { result_code_ = code; } @@ -292,9 +271,6 @@ class AccessCodeCastHandlerTest : public ChromeRenderViewHostTestHarness { } }); - ON_CALL(*router(), GetCurrentRoutes()) - .WillByDefault(Return(std::vector())); - // Handler so MockMediaRouter will respond to requests to create a route. // Will construct a RouteRequestResult based on the set result code and // then call the handler's callback, which should call the page's callback. @@ -306,7 +282,7 @@ class AccessCodeCastHandlerTest : public ChromeRenderViewHostTestHarness { MediaRouteResponseCallback& callback, base::TimeDelta timeout, bool incognito) { std::unique_ptr result; - if (result_code_ == RouteRequestResult::ResultCode::OK) { + if (result_code_ == mojom::RouteRequestResultCode::OK) { MediaSource source(source_id); MediaRoute route; route.set_media_route_id(source_id + "->" + sink_id); @@ -351,8 +327,8 @@ class AccessCodeCastHandlerTest : public ChromeRenderViewHostTestHarness { mock_cast_media_sink_service_impl_; std::unique_ptr presentation_manager_; std::vector media_sinks_observers_; - RouteRequestResult::ResultCode result_code_ = - RouteRequestResult::ResultCode::OK; + mojom::RouteRequestResultCode result_code_ = + mojom::RouteRequestResultCode::OK; MediaSinkInternal cast_sink_1_; MediaSinkInternal cast_sink_2_; }; @@ -410,7 +386,7 @@ TEST_F(AccessCodeCastHandlerTest, OtherDevicesIgnored) { // Demonstrates that desktop mirroring attempts call media router with the // correct parameters, and that success is communicated to the dialog box. TEST_F(AccessCodeCastHandlerTest, DesktopMirroring) { - set_expected_cast_result(RouteRequestResult::ResultCode::OK); + set_expected_cast_result(mojom::RouteRequestResultCode::OK); MockCastToSinkCallback mock_callback; EXPECT_CALL(mock_callback, Run(RouteRequestResultCode::OK)); StartDesktopMirroring(MediaSource::ForUnchosenDesktop(), mock_callback); @@ -419,7 +395,7 @@ TEST_F(AccessCodeCastHandlerTest, DesktopMirroring) { // Demonstrates that if casting does not start successfully that the error // code is communicated to the dialog. TEST_F(AccessCodeCastHandlerTest, DesktopMirroringError) { - set_expected_cast_result(RouteRequestResult::ResultCode::ROUTE_NOT_FOUND); + set_expected_cast_result(mojom::RouteRequestResultCode::ROUTE_NOT_FOUND); MockCastToSinkCallback mock_callback; EXPECT_CALL(mock_callback, Run(RouteRequestResultCode::ROUTE_NOT_FOUND)); StartDesktopMirroring(MediaSource::ForUnchosenDesktop(), mock_callback); @@ -428,7 +404,7 @@ TEST_F(AccessCodeCastHandlerTest, DesktopMirroringError) { // Demonstrates that tab mirroring attempts call media router with the // correct parameters, and that success is communicated to the dialog box. TEST_F(AccessCodeCastHandlerTest, TabMirroring) { - set_expected_cast_result(RouteRequestResult::ResultCode::OK); + set_expected_cast_result(mojom::RouteRequestResultCode::OK); MockCastToSinkCallback mock_callback; EXPECT_CALL(mock_callback, Run(RouteRequestResultCode::OK)); MediaSource media_source = MediaSource::ForTab( @@ -439,7 +415,7 @@ TEST_F(AccessCodeCastHandlerTest, TabMirroring) { // Demonstrates that if casting does not start successfully that the error // code is communicated to the dialog. TEST_F(AccessCodeCastHandlerTest, TabMirroringError) { - set_expected_cast_result(RouteRequestResult::ResultCode::INVALID_ORIGIN); + set_expected_cast_result(mojom::RouteRequestResultCode::INVALID_ORIGIN); MockCastToSinkCallback mock_callback; EXPECT_CALL(mock_callback, Run(RouteRequestResultCode::INVALID_ORIGIN)); MediaSource media_source = MediaSource::ForTab( @@ -450,7 +426,7 @@ TEST_F(AccessCodeCastHandlerTest, TabMirroringError) { // Demonstrates that if a default presentation source is available, // presentation casting will begin instead of tab casting. TEST_F(AccessCodeCastHandlerTest, DefaultPresentation) { - set_expected_cast_result(RouteRequestResult::ResultCode::OK); + set_expected_cast_result(mojom::RouteRequestResultCode::OK); MockCastToSinkCallback mock_callback; EXPECT_CALL(mock_callback, Run(RouteRequestResultCode::OK)); @@ -464,7 +440,7 @@ TEST_F(AccessCodeCastHandlerTest, DefaultPresentation) { // Demonstrates that if a presentation casting does not start successfully // that the error is propagated to the dialog. TEST_F(AccessCodeCastHandlerTest, DefaultPresentationError) { - set_expected_cast_result(RouteRequestResult::ResultCode::INVALID_ORIGIN); + set_expected_cast_result(mojom::RouteRequestResultCode::INVALID_ORIGIN); MockCastToSinkCallback mock_callback; EXPECT_CALL(mock_callback, Run(RouteRequestResultCode::INVALID_ORIGIN)); @@ -479,7 +455,7 @@ TEST_F(AccessCodeCastHandlerTest, DefaultPresentationError) { // it will be used to start casting in preference to the default request and // tab mirroring. TEST_F(AccessCodeCastHandlerTest, StartPresentationContext) { - set_expected_cast_result(RouteRequestResult::ResultCode::OK); + set_expected_cast_result(mojom::RouteRequestResultCode::OK); MockCastToSinkCallback mock_callback; EXPECT_CALL(mock_callback, Run(RouteRequestResultCode::OK)); @@ -500,4 +476,26 @@ TEST_F(AccessCodeCastHandlerTest, StartPresentationContext) { mock_callback); } +// Demonstrates that casting will not start if there already exists a route for +// the given sink. +TEST_F(AccessCodeCastHandlerTest, RouteAlreadyExists) { + MockCastToSinkCallback mock_callback; + + MediaSinkInternal access_code_sink = CreateCastSink(1); + access_code_sink.cast_data().discovery_type = + CastDiscoveryType::kAccessCodeManualEntry; + + CreateHandler({MediaCastMode::DESKTOP_MIRROR}); + set_screen_capture_allowed_for_testing(true); + UpdateSinks({access_code_sink.sink()}, std::vector()); + handler()->set_sink_id_for_testing(access_code_sink.sink().id()); + + MediaRoute media_route_access = CreateRouteForTesting(access_code_sink.id()); + std::vector route_list = {media_route_access}; + ON_CALL(*router(), GetCurrentRoutes()).WillByDefault(Return(route_list)); + + EXPECT_CALL(mock_callback, Run(RouteRequestResultCode::ROUTE_ALREADY_EXISTS)); + handler()->CastToSink(mock_callback.Get()); +} + } // namespace media_router diff --git a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.cc b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.cc index ce5c5e2d8eb..4086f9a8325 100644 --- a/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.cc +++ b/chromium/chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.cc @@ -61,7 +61,7 @@ AccessCodeCastUI::AccessCodeCastUI(content::WebUI* web_ui) Profile* const profile = Profile::FromWebUI(web_ui); source->AddInteger("rememberedDeviceDuration", - GetAccessCodeDeviceDurationPref(profile->GetPrefs()).InSeconds()); + GetAccessCodeDeviceDurationPref(profile).InSeconds()); // Add a handler to provide pluralized strings. auto plural_string_handler = std::make_unique(); diff --git a/chromium/chrome/browser/ui/webui/apc_internals/OWNERS b/chromium/chrome/browser/ui/webui/apc_internals/OWNERS index 0472f1f0382..664cba0d3d2 100644 --- a/chromium/chrome/browser/ui/webui/apc_internals/OWNERS +++ b/chromium/chrome/browser/ui/webui/apc_internals/OWNERS @@ -1,2 +1,3 @@ +brunobraga@google.com jkeitel@google.com vizcay@google.com diff --git a/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_handler.cc b/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_handler.cc index c69bc54202c..5a0e0b8fefc 100644 --- a/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_handler.cc +++ b/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_handler.cc @@ -7,23 +7,42 @@ #include #include "base/bind.h" +#include "base/callback_forward.h" #include "base/callback_helpers.h" #include "base/command_line.h" +#include "base/containers/unique_ptr_adapters.h" #include "base/metrics/field_trial_params.h" +#include "base/ranges/algorithm.h" +#include "base/strings/strcat.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/utf_string_conversions.h" #include "base/values.h" +#include "chrome/browser/autofill_assistant/password_change/apc_client.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/password_manager/chrome_password_manager_client.h" #include "chrome/browser/password_manager/password_scripts_fetcher_factory.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser_navigator.h" +#include "chrome/browser/ui/browser_navigator_params.h" +#include "chrome/browser/ui/ui_features.h" +#include "chrome/browser/ui/webui/apc_internals/apc_internals_logins_request.h" #include "components/autofill_assistant/browser/switches.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" #include "components/password_manager/core/browser/password_scripts_fetcher.h" #include "components/password_manager/core/common/password_manager_features.h" +#include "components/url_formatter/url_formatter.h" #include "components/variations/service/variations_service.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" +#include "url/origin.h" using password_manager::PasswordScriptsFetcher; namespace { +constexpr char kPasswordChangeIntentName[] = "password_change"; +constexpr char kBundleIdSeparator[] = "/"; + // TODO(1311324): Reduce the level of code duplication between // autofill_assistant::ClientAndroid and the helper method in // chrome/browser/password_manager/password_scripts_fetcher_factory.cc. @@ -36,11 +55,37 @@ std::string GetCountryCode() { return base::ToUpperASCII(variations_service->GetLatestCountry()); } +// Builds the bundle id that Autofill Assistant takes as a parameter based on +// the user's `ldap`, the `url` of the page, and the `id` of the bundle. +std::string CreateBundleId(const std::string& ldap, + const GURL& url, + unsigned id) { + const std::u16string formatted_url = url_formatter::FormatUrl( + url, + url_formatter::kFormatUrlOmitHTTP | url_formatter::kFormatUrlOmitHTTPS | + url_formatter::kFormatUrlOmitTrivialSubdomains | + url_formatter::kFormatUrlTrimAfterHost, + base::UnescapeRule::SPACES, /*new_parsed=*/nullptr, + /*prefix_end=*/nullptr, /*offset_for_adjustment=*/nullptr); + // Autofill Assistant expects the following format: + // `{LDAP}/{BUNDLE_ID}/{INTENT_NAME}/{DOMAIN}`. + return base::StrCat({ldap, kBundleIdSeparator, base::NumberToString(id), + kBundleIdSeparator, kPasswordChangeIntentName, + kBundleIdSeparator, base::UTF16ToUTF8(formatted_url)}); +} + } // namespace +APCInternalsHandler::APCInternalsHandler() = default; + APCInternalsHandler::~APCInternalsHandler() = default; void APCInternalsHandler::RegisterMessages() { + password_manager::PasswordManagerClient* password_manager_client = + ChromePasswordManagerClient::FromWebContents(web_ui()->GetWebContents()); + profile_password_store_ = password_manager_client->GetProfilePasswordStore(); + account_password_store_ = password_manager_client->GetAccountPasswordStore(); + web_ui()->RegisterMessageCallback( "loaded", base::BindRepeating(&APCInternalsHandler::OnLoaded, base::Unretained(this))); @@ -58,35 +103,42 @@ void APCInternalsHandler::RegisterMessages() { "set-autofill-assistant-url", base::BindRepeating(&APCInternalsHandler::OnSetAutofillAssistantUrl, base::Unretained(this))); + + web_ui()->RegisterMessageCallback( + "launch-script", + base::BindRepeating(&APCInternalsHandler::GetLoginsAndTryLaunchScript, + base::Unretained(this))); } void APCInternalsHandler::OnLoaded(const base::Value::List& args) { AllowJavascript(); // Provide information for initial page creation. - FireWebUIListener("on-flags-information-received", - base::Value(GetAPCRelatedFlags())); + FireWebUIListener("on-flags-information-received", GetAPCRelatedFlags()); FireWebUIListener("on-script-fetching-information-received", - base::Value(GetPasswordScriptFetcherInformation())); + GetPasswordScriptFetcherInformation()); UpdateAutofillAssistantInformation(); + OnRefreshScriptCacheRequested(base::Value::List()); } void APCInternalsHandler::UpdateAutofillAssistantInformation() { FireWebUIListener("on-autofill-assistant-information-received", - base::Value(GetAutofillAssistantInformation())); + GetAutofillAssistantInformation()); } void APCInternalsHandler::OnScriptCacheRequested( const base::Value::List& args) { FireWebUIListener("on-script-cache-received", - base::Value(GetPasswordScriptFetcherCache())); + GetPasswordScriptFetcherCache()); } void APCInternalsHandler::OnRefreshScriptCacheRequested( const base::Value::List& args) { if (PasswordScriptsFetcher* scripts_fetcher = GetPasswordScriptsFetcher(); scripts_fetcher) { - scripts_fetcher->PrewarmCache(); + scripts_fetcher->RefreshScriptsIfNecessary( + base::BindOnce(&APCInternalsHandler::OnScriptCacheRequested, + weak_ptr_factory_.GetWeakPtr(), base::Value::List())); } } @@ -120,11 +172,14 @@ base::Value::List APCInternalsHandler::GetAPCRelatedFlags() const { // base::FeatureList::IsEnabled) checks that there is only one memory address // per feature. const base::Feature* const apc_features[] = { - &password_manager::features::kPasswordChange, - &password_manager::features::kPasswordChangeInSettings, - &password_manager::features::kPasswordScriptsFetching, - &password_manager::features::kPasswordDomainCapabilitiesFetching, - &password_manager::features::kForceEnablePasswordDomainCapabilities, + &password_manager::features::kPasswordChange, + &password_manager::features::kPasswordChangeInSettings, + &password_manager::features::kPasswordScriptsFetching, + &password_manager::features::kPasswordDomainCapabilitiesFetching, + &password_manager::features::kForceEnablePasswordDomainCapabilities, +#if !BUILDFLAG(IS_ANDROID) + &features::kUnifiedSidePanel, +#endif }; base::Value::List relevant_features; @@ -142,10 +197,10 @@ base::Value::List APCInternalsHandler::GetAPCRelatedFlags() const { for (const auto& [param_name, param_state] : params) feature_params.Set(param_name, param_state); - feature_entry.Set("parameters", base::Value(std::move(feature_params))); + feature_entry.Set("parameters", std::move(feature_params)); } } - relevant_features.Append(base::Value(std::move(feature_entry))); + relevant_features.Append(std::move(feature_entry)); } return relevant_features; } @@ -192,3 +247,75 @@ base::Value::Dict APCInternalsHandler::GetAutofillAssistantInformation() const { } return result; } + +void APCInternalsHandler::GetLoginsAndTryLaunchScript( + const base::Value::List& args) { + if (!profile_password_store_) + return; + + if (args.size() == 3 && base::ranges::all_of(args.cbegin(), args.cend(), + &base::Value::is_string)) { + GURL url = GURL(args.front().GetString()); + url::Origin origin = url::Origin::Create(url); + password_manager::PasswordFormDigest digest( + password_manager::PasswordForm::Scheme::kHtml, origin.GetURL().spec(), + GURL()); + + // Check whether to pass debug parameters. + const std::string& ldap = args[1].GetString(); + const std::string& bundle_id_input = args[2].GetString(); + unsigned bundle_id_number = 0u; + if (!ldap.empty() && + base::StringToUint(bundle_id_input, &bundle_id_number)) { + debug_run_information_ = ApcClient::DebugRunInformation{ + .bundle_id = CreateBundleId(ldap, url, bundle_id_number), + .socket_id = ldap}; + } else { + debug_run_information_.reset(); + } + + pending_logins_requests_.emplace_back( + std::make_unique( + base::BindOnce(&APCInternalsHandler::LaunchScript, + base::Unretained(this)), + base::BindOnce(&APCInternalsHandler::OnLoginsRequestFinished, + base::Unretained(this)))); + + pending_logins_requests_.back()->IncreaseWaitCounter(); + if (account_password_store_) + pending_logins_requests_.back()->IncreaseWaitCounter(); + + profile_password_store_->GetLogins( + digest, pending_logins_requests_.back()->GetWeakPtr()); + + if (account_password_store_) + account_password_store_->GetLogins( + digest, pending_logins_requests_.back()->GetWeakPtr()); + } +} + +void APCInternalsHandler::OnLoginsRequestFinished( + APCInternalsLoginsRequest* finished_request) { + base::EraseIf(pending_logins_requests_, + base::MatchesUniquePtr(finished_request)); +} + +void APCInternalsHandler::LaunchScript(const GURL& url, + const std::string& username) { +#if !BUILDFLAG(IS_ANDROID) + NavigateParams params(Profile::FromBrowserContext( + web_ui()->GetWebContents()->GetBrowserContext()), + url, ui::PageTransition::PAGE_TRANSITION_LINK); + params.disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; + base::WeakPtr navigation_handle = + Navigate(¶ms); + + if (navigation_handle) { + ApcClient* apc_client = ApcClient::GetOrCreateForWebContents( + navigation_handle.get()->GetWebContents()); + apc_client->Start(url, username, + /*skip_login=*/false, + /*callback=*/base::DoNothing(), debug_run_information_); + } +#endif // !IS_ANDROID +} diff --git a/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_handler.h b/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_handler.h index f5a9a47791f..dbb205a3aad 100644 --- a/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_handler.h +++ b/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_handler.h @@ -5,15 +5,25 @@ #ifndef CHROME_BROWSER_UI_WEBUI_APC_INTERNALS_APC_INTERNALS_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_APC_INTERNALS_APC_INTERNALS_HANDLER_H_ +#include "base/callback_forward.h" +#include "base/memory/weak_ptr.h" #include "base/values.h" -#include "components/password_manager/core/browser/password_scripts_fetcher.h" +#include "chrome/browser/autofill_assistant/password_change/apc_client.h" #include "content/public/browser/web_ui_message_handler.h" +#include "third_party/abseil-cpp/absl/types/optional.h" + +class APCInternalsLoginsRequest; + +namespace password_manager { +class PasswordScriptsFetcher; +class PasswordStoreInterface; +} // namespace password_manager // Provides the WebUI message handling for chrome://apc-internals, the // diagnostics page for Automated Password Change (APC) flows. class APCInternalsHandler : public content::WebUIMessageHandler { public: - APCInternalsHandler() = default; + APCInternalsHandler(); APCInternalsHandler(const APCInternalsHandler&) = delete; APCInternalsHandler& operator=(const APCInternalsHandler&) = delete; @@ -43,11 +53,13 @@ class APCInternalsHandler : public content::WebUIMessageHandler { // user-triggered DOM event. void OnSetAutofillAssistantUrl(const base::Value::List& args); + void GetLoginsAndTryLaunchScript(const base::Value::List& args); + // Returns a raw pointer to the |PasswordScriptsFetcher| keyed service. password_manager::PasswordScriptsFetcher* GetPasswordScriptsFetcher(); // Data gathering methods. - // Gathers information on all APC-related feature and feature parameters. + // Gathers information on all APC-related features and feature parameters. base::Value::List GetAPCRelatedFlags() const; // Gathers information about the script fetcher, e.g. chosen engine, @@ -60,6 +72,28 @@ class APCInternalsHandler : public content::WebUIMessageHandler { // Gathers AutofillAssistant-related information, e.g. language, locale (can // be different from general Chrome settings) base::Value::Dict GetAutofillAssistantInformation() const; + + // Launches APC script on `url` with login `username`. + void LaunchScript(const GURL& url, const std::string& username); + + // Removes finished requests from `pending_logins_requests_`. + void OnLoginsRequestFinished(APCInternalsLoginsRequest* finished_request); + + // Parameters for starting an APC script as a debug run. + absl::optional debug_run_information_; + + // Queue for pending requests fetching logins from password store. + std::vector> + pending_logins_requests_; + + // Profile password store. + raw_ptr profile_password_store_; + + // Represents all Gaia-account-scoped password stores. + raw_ptr account_password_store_; + + // A factory for weak pointers to the handler. + base::WeakPtrFactory weak_ptr_factory_{this}; }; #endif // CHROME_BROWSER_UI_WEBUI_APC_INTERNALS_APC_INTERNALS_HANDLER_H_ diff --git a/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_logins_request.cc b/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_logins_request.cc new file mode 100644 index 00000000000..234dcaf87e8 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_logins_request.cc @@ -0,0 +1,44 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// 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/apc_internals/apc_internals_logins_request.h" + +#include "base/strings/utf_string_conversions.h" +#include "components/password_manager/core/browser/password_form.h" + +APCInternalsLoginsRequest::APCInternalsLoginsRequest( + base::OnceCallback + on_success_callback, + base::OnceCallback + request_finished_callback) + : on_success_callback_(std::move(on_success_callback)), + request_finished_callback_(std::move(request_finished_callback)) {} + +APCInternalsLoginsRequest::~APCInternalsLoginsRequest() = default; + +void APCInternalsLoginsRequest::OnGetPasswordStoreResults( + std::vector> results) { + for (auto& password_form : results) + results_.push_back(std::move(password_form)); + + if (--wait_counter_ > 0) + return; + + if (!results_.empty()) { + GURL url = results_.front()->url; + std::string username = base::UTF16ToUTF8(results_.front()->username_value); + std::move(on_success_callback_).Run(url, username); + } + + std::move(request_finished_callback_).Run(this); +} + +void APCInternalsLoginsRequest::IncreaseWaitCounter() { + wait_counter_++; +} + +base::WeakPtr +APCInternalsLoginsRequest::GetWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); +} diff --git a/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_logins_request.h b/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_logins_request.h new file mode 100644 index 00000000000..f9e54da5e83 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/apc_internals/apc_internals_logins_request.h @@ -0,0 +1,54 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_APC_INTERNALS_APC_INTERNALS_LOGINS_REQUEST_H_ +#define CHROME_BROWSER_UI_WEBUI_APC_INTERNALS_APC_INTERNALS_LOGINS_REQUEST_H_ + +#include "components/password_manager/core/browser/password_store_consumer.h" +#include "url/gurl.h" + +// Helper class for fetching logins from password store. +class APCInternalsLoginsRequest + : public password_manager::PasswordStoreConsumer { + public: + explicit APCInternalsLoginsRequest( + base::OnceCallback + on_success_callback, + base::OnceCallback + request_finished_callback); + + ~APCInternalsLoginsRequest() override; + + // Called by PasswordStoreInterface::GetLogins on completion. + void OnGetPasswordStoreResults( + std::vector> results) + override; + + // Increase `wait_counter_` by 1. + void IncreaseWaitCounter(); + + base::WeakPtr GetWeakPtr(); + + private: + // Callback for when all password stores are finished retrieving logins and + // there is at least one login. Used for launching a script. + base::OnceCallback + on_success_callback_; + + // Callback for when all password stores are finished retrieving logins. Used + // for clearing requests queue (outside of this class). + base::OnceCallback + request_finished_callback_; + + // The number of password stores this class is still waiting for to complete + // retrieving logins. + int wait_counter_ = 0; + + // Logins retrieved from all password stores. + std::vector> results_; + + base::WeakPtrFactory weak_ptr_factory_{this}; +}; + +#endif // CHROME_BROWSER_UI_WEBUI_APC_INTERNALS_APC_INTERNALS_LOGINS_REQUEST_H_ diff --git a/chromium/chrome/browser/ui/webui/app_home/BUILD.gn b/chromium/chrome/browser/ui/webui/app_home/BUILD.gn new file mode 100644 index 00000000000..88352e40c05 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/app_home/BUILD.gn @@ -0,0 +1,11 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/tools/bindings/mojom.gni") + +mojom("mojo_bindings") { + sources = [ "app_home.mojom" ] + webui_module_path = "/" + public_deps = [ "//url/mojom:url_mojom_gurl" ] +} diff --git a/chromium/chrome/browser/ui/webui/app_home/DIR_METADATA b/chromium/chrome/browser/ui/webui/app_home/DIR_METADATA new file mode 100644 index 00000000000..59e00971183 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/app_home/DIR_METADATA @@ -0,0 +1 @@ +mixins: "//chrome/browser/web_applications/COMMON_METADATA" \ No newline at end of file diff --git a/chromium/chrome/browser/ui/webui/app_home/OWNERS b/chromium/chrome/browser/ui/webui/app_home/OWNERS new file mode 100644 index 00000000000..a74f1031167 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/app_home/OWNERS @@ -0,0 +1,4 @@ +file://chrome/browser/web_applications/OWNERS + +per-file *.mojom=set noparent +per-file *.mojom=file://ipc/SECURITY_OWNERS diff --git a/chromium/chrome/browser/ui/webui/app_home/app_home.mojom b/chromium/chrome/browser/ui/webui/app_home/app_home.mojom new file mode 100644 index 00000000000..20f0a96b141 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/app_home/app_home.mojom @@ -0,0 +1,35 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module app_home.mojom; + +import "url/mojom/url.mojom"; + +struct AppInfo { + // The app id. + string id; + // The first url to load when app start launching. + url.mojom.Url start_url; + // The app's name. + string name; + // The app's icon url showing on `chrome://apps`. + url.mojom.Url icon_url; +}; + +interface PageHandlerFactory { + CreatePageHandler(pending_remote page, + pending_receiver handler); +}; + +interface PageHandler { + // Get all apps' information that defined in `AppInfo`. + GetApps() => (array app_list); +}; + +// The `Page` interface is used for sending mojom action messsage +// from backend to frontend. +// TODO(crbug.com/1350406): Currently there's no place needs to +// send message to frontend page, so we just left an empty interface class +// here now, but in the feature, we will add needed APIs here. +interface Page {}; \ No newline at end of file diff --git a/chromium/chrome/browser/ui/webui/app_home/app_home_page_handler.cc b/chromium/chrome/browser/ui/webui/app_home/app_home_page_handler.cc new file mode 100644 index 00000000000..ffbf204d1e6 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/app_home/app_home_page_handler.cc @@ -0,0 +1,121 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// 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/app_home/app_home_page_handler.h" + +#include "chrome/browser/apps/app_service/app_icon/app_icon_source.h" +#include "chrome/browser/extensions/extension_ui_util.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/webui/extensions/extension_icon_source.h" +#include "chrome/browser/web_applications/web_app.h" +#include "chrome/browser/web_applications/web_app_provider.h" +#include "chrome/browser/web_applications/web_app_registrar.h" +#include "chrome/common/extensions/manifest_handlers/app_launch_info.h" +#include "content/public/browser/web_ui.h" +#include "extensions/browser/extension_registry.h" +#include "url/gurl.h" + +using content::WebUI; +using extensions::Extension; +using extensions::ExtensionRegistry; +using extensions::ExtensionSet; + +namespace webapps { + +namespace { + +const int kWebAppLargeIconSize = 128; + +// The Youtube app is incorrectly hardcoded to be a 'bookmark app'. However, it +// is a platform app. +// TODO(crbug.com/1065748): Remove this hack once the youtube app is fixed. +bool IsYoutubeExtension(const std::string& extension_id) { + return extension_id == extension_misc::kYoutubeAppId; +} +} // namespace + +AppHomePageHandler::~AppHomePageHandler() = default; + +AppHomePageHandler::AppHomePageHandler( + content::WebUI* web_ui, + Profile* profile, + mojo::PendingReceiver receiver, + mojo::PendingRemote page) + : web_ui_(web_ui), + profile_(profile), + receiver_(this, std::move(receiver)), + page_(std::move(page)) {} + +app_home::mojom::AppInfoPtr AppHomePageHandler::CreateAppInfoPtrFromWebApp( + const web_app::AppId& app_id) { + auto& registrar = + web_app::WebAppProvider::GetForWebApps(profile_)->registrar(); + + auto app_info = app_home::mojom::AppInfo::New(); + + app_info->id = app_id; + + GURL start_url = registrar.GetAppStartUrl(app_id); + app_info->start_url = start_url; + + std::string name = registrar.GetAppShortName(app_id); + app_info->name = name; + + app_info->icon_url = + apps::AppIconSource::GetIconURL(app_id, kWebAppLargeIconSize); + + return app_info; +} + +app_home::mojom::AppInfoPtr AppHomePageHandler::CreateAppInfoPtrFromExtension( + const Extension* extension) { + auto app_info = app_home::mojom::AppInfo::New(); + + app_info->id = extension->id(); + + GURL start_url = extensions::AppLaunchInfo::GetFullLaunchURL(extension); + app_info->start_url = start_url; + + app_info->name = extension->name(); + + app_info->icon_url = extensions::ExtensionIconSource::GetIconURL( + extension, extension_misc::EXTENSION_ICON_LARGE, + ExtensionIconSet::MATCH_BIGGER, false /*grayscale*/); + + return app_info; +} + +void AppHomePageHandler::FillWebAppInfoList( + std::vector* result) { + web_app::WebAppRegistrar& registrar = + web_app::WebAppProvider::GetForWebApps(profile_)->registrar(); + + for (const web_app::AppId& web_app_id : registrar.GetAppIds()) { + if (IsYoutubeExtension(web_app_id)) + continue; + result->emplace_back(CreateAppInfoPtrFromWebApp(web_app_id)); + } +} + +void AppHomePageHandler::FillExtensionInfoList( + std::vector* result) { + ExtensionRegistry* registry = ExtensionRegistry::Get(profile_); + std::unique_ptr extension_apps = + registry->GenerateInstalledExtensionsSet(ExtensionRegistry::ENABLED | + ExtensionRegistry::DISABLED | + ExtensionRegistry::TERMINATED); + for (const auto& extension : *extension_apps) { + if (extensions::ui_util::ShouldDisplayInNewTabPage(extension.get(), + profile_)) + result->emplace_back(CreateAppInfoPtrFromExtension(extension.get())); + } +} + +void AppHomePageHandler::GetApps(GetAppsCallback callback) { + std::vector result; + FillWebAppInfoList(&result); + FillExtensionInfoList(&result); + std::move(callback).Run(std::move(result)); +} + +} // namespace webapps diff --git a/chromium/chrome/browser/ui/webui/app_home/app_home_page_handler.h b/chromium/chrome/browser/ui/webui/app_home/app_home_page_handler.h new file mode 100644 index 00000000000..312667fb1e8 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/app_home/app_home_page_handler.h @@ -0,0 +1,63 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_APP_HOME_APP_HOME_PAGE_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_APP_HOME_APP_HOME_PAGE_HANDLER_H_ + +#include "base/memory/raw_ptr.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/webui/app_home/app_home.mojom.h" +#include "chrome/browser/web_applications/web_app_id.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "mojo/public/cpp/bindings/remote.h" + +namespace content { +class WebUI; +} // namespace content + +namespace extensions { +class Extension; +} // namespace extensions + +namespace webapps { + +class AppHomePageHandler : public app_home::mojom::PageHandler { + public: + AppHomePageHandler( + content::WebUI*, + Profile* profile, + mojo::PendingReceiver receiver, + mojo::PendingRemote page); + + AppHomePageHandler(const AppHomePageHandler&) = delete; + AppHomePageHandler& operator=(const AppHomePageHandler&) = delete; + + ~AppHomePageHandler() override; + + // app_home::mojom::PageHandler: + void GetApps(GetAppsCallback callback) override; + + private: + void FillWebAppInfoList(std::vector* result); + void FillExtensionInfoList(std::vector* result); + app_home::mojom::AppInfoPtr CreateAppInfoPtrFromWebApp( + const web_app::AppId& app_id); + app_home::mojom::AppInfoPtr CreateAppInfoPtrFromExtension( + const extensions::Extension* extension); + + raw_ptr web_ui_; + + raw_ptr profile_; + + mojo::Receiver receiver_; + + mojo::Remote page_; + + // Used for passing callbacks. + base::WeakPtrFactory weak_ptr_factory_{this}; +}; + +} // namespace webapps + +#endif // CHROME_BROWSER_UI_WEBUI_APP_HOME_APP_HOME_PAGE_HANDLER_H_ diff --git a/chromium/chrome/browser/ui/webui/app_home/app_home_page_handler_test.cc b/chromium/chrome/browser/ui/webui/app_home/app_home_page_handler_test.cc new file mode 100644 index 00000000000..2762c67f940 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/app_home/app_home_page_handler_test.cc @@ -0,0 +1,128 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// 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/app_home/app_home_page_handler.h" + +#include + +#include "base/strings/utf_string_conversions.h" +#include "chrome/browser/ui/webui/app_home/app_home.mojom.h" +#include "chrome/browser/ui/webui/app_home/mock_app_home_page.h" +#include "chrome/browser/web_applications/test/web_app_install_test_utils.h" +#include "chrome/browser/web_applications/test/web_app_test.h" +#include "content/public/browser/web_contents.h" +#include "content/public/test/test_web_ui.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +using web_app::AppId; +using GetAppsCallback = + base::OnceCallback)>; + +namespace webapps { + +namespace { + +constexpr char kTestAppUrl[] = "https://www.example.com/"; +constexpr char kTestManifestUrl[] = "https://www.example.com/manifest.json"; +const std::u16string kTestAppName = u"Test App"; + +class TestAppHomePageHandler : public AppHomePageHandler { + public: + TestAppHomePageHandler(content::WebUI* web_ui, + Profile* profile, + mojo::PendingRemote page) + : AppHomePageHandler( + web_ui, + profile, + mojo::PendingReceiver(), + std::move(page)) {} + + TestAppHomePageHandler(const TestAppHomePageHandler&) = delete; + TestAppHomePageHandler& operator=(const TestAppHomePageHandler&) = delete; + + ~TestAppHomePageHandler() override = default; +}; + +std::unique_ptr BuildWebAppInfo() { + auto app_info = std::make_unique(); + app_info->start_url = GURL(kTestAppUrl); + app_info->scope = GURL(kTestAppUrl); + app_info->title = kTestAppName; + app_info->manifest_url = GURL(kTestManifestUrl); + + return app_info; +} + +GetAppsCallback WrapGetAppsCallback( + std::vector* out, + base::OnceClosure quit_closure) { + return base::BindOnce( + [](base::OnceClosure quit_closure, + std::vector* out, + std::vector result) { + *out = std::move(result); + std::move(quit_closure).Run(); + }, + std::move(quit_closure), out); +} + +} // namespace + +class AppHomePageHandlerTest : public WebAppTest { + public: + AppHomePageHandlerTest() = default; + + AppHomePageHandlerTest(const AppHomePageHandlerTest&) = delete; + AppHomePageHandlerTest& operator=(const AppHomePageHandlerTest&) = delete; + + ~AppHomePageHandlerTest() override = default; + + void SetUp() override { + WebAppTest::SetUp(); + web_app::test::AwaitStartWebAppProviderAndSubsystems(profile()); + } + + protected: + std::unique_ptr GetAppHomePageHandler( + content::TestWebUI* test_web_ui) { + return std::make_unique(test_web_ui, profile(), + page_.BindAndGetRemote()); + } + + AppId InstallWebApp() { + AppId installed_app_id = + web_app::test::InstallWebApp(profile(), BuildWebAppInfo()); + + return installed_app_id; + } + + std::unique_ptr CreateTestWebUI() { + auto test_web_ui = std::make_unique(); + test_web_ui->set_web_contents(web_contents()); + return test_web_ui; + } + + testing::StrictMock page_; +}; + +TEST_F(AppHomePageHandlerTest, GetApps) { + AppId installed_app_id = InstallWebApp(); + + std::unique_ptr test_web_ui = CreateTestWebUI(); + + std::unique_ptr page_handler = + GetAppHomePageHandler(test_web_ui.get()); + + std::vector app_infos; + base::RunLoop run_loop; + page_handler->GetApps( + WrapGetAppsCallback(&app_infos, run_loop.QuitClosure())); + run_loop.Run(); + + ASSERT_EQ(1u, app_infos.size()); + EXPECT_EQ(kTestAppUrl, app_infos[0]->start_url); + EXPECT_EQ(kTestAppName, base::UTF8ToUTF16(app_infos[0]->name)); +} +} // namespace webapps diff --git a/chromium/chrome/browser/ui/webui/app_home/app_home_ui.cc b/chromium/chrome/browser/ui/webui/app_home/app_home_ui.cc new file mode 100644 index 00000000000..90cfc06ebc2 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/app_home/app_home_ui.cc @@ -0,0 +1,43 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// 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/app_home/app_home_ui.h" + +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/webui/app_home/app_home.mojom.h" +#include "chrome/browser/ui/webui/app_home/app_home_page_handler.h" +#include "chrome/common/webui_url_constants.h" +#include "content/public/browser/web_ui_data_source.h" + +namespace webapps { + +AppHomeUI::AppHomeUI(content::WebUI* web_ui) : ui::MojoWebUIController(web_ui) { + content::WebUIDataSource* source = + content::WebUIDataSource::Create(chrome::kChromeUIAppLauncherPageHost); + + Profile* profile = Profile::FromWebUI(web_ui); + content::WebUIDataSource::Add(profile, source); +} + +void AppHomeUI::BindInterface( + mojo::PendingReceiver receiver) { + page_factory_receiver_.reset(); + + page_factory_receiver_.Bind(std::move(receiver)); +} + +void AppHomeUI::CreatePageHandler( + mojo::PendingRemote page, + mojo::PendingReceiver receiver) { + DCHECK(page); + Profile* profile = Profile::FromWebUI(web_ui()); + page_handler_ = std::make_unique( + web_ui(), profile, std::move(receiver), std::move(page)); +} + +WEB_UI_CONTROLLER_TYPE_IMPL(AppHomeUI) + +AppHomeUI::~AppHomeUI() = default; + +} // namespace webapps diff --git a/chromium/chrome/browser/ui/webui/app_home/app_home_ui.h b/chromium/chrome/browser/ui/webui/app_home/app_home_ui.h new file mode 100644 index 00000000000..3bd696e44e1 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/app_home/app_home_ui.h @@ -0,0 +1,48 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_APP_HOME_APP_HOME_UI_H_ +#define CHROME_BROWSER_UI_WEBUI_APP_HOME_APP_HOME_UI_H_ + +#include "chrome/browser/ui/webui/app_home/app_home.mojom.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/mojo_web_ui_controller.h" + +namespace webapps { +class AppHomePageHandler; +} // namespace webapps + +namespace webapps { + +// The WebUI controller for chrome://apps. +class AppHomeUI : public ui::MojoWebUIController, + public app_home::mojom::PageHandlerFactory { + public: + explicit AppHomeUI(content::WebUI* web_ui); + AppHomeUI(const AppHomeUI&) = delete; + AppHomeUI& operator=(const AppHomeUI&) = delete; + ~AppHomeUI() override; + + void BindInterface( + mojo::PendingReceiver receiver); + + private: + // app_home::mojom::PageHandlerFactory: + void CreatePageHandler( + mojo::PendingRemote page, + mojo::PendingReceiver receiver) override; + + std::unique_ptr page_handler_; + + mojo::Receiver page_factory_receiver_{ + this}; + + WEB_UI_CONTROLLER_TYPE_DECL(); +}; + +} // namespace webapps + +#endif // CHROME_BROWSER_UI_WEBUI_APP_HOME_APP_HOME_UI_H_ diff --git a/chromium/chrome/browser/ui/webui/app_home/mock_app_home_page.cc b/chromium/chrome/browser/ui/webui/app_home/mock_app_home_page.cc new file mode 100644 index 00000000000..039aa466fe7 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/app_home/mock_app_home_page.cc @@ -0,0 +1,18 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// 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/app_home/mock_app_home_page.h" + +namespace webapps { + +MockAppHomePage::MockAppHomePage() = default; + +MockAppHomePage::~MockAppHomePage() = default; + +mojo::PendingRemote MockAppHomePage::BindAndGetRemote() { + DCHECK(!receiver_.is_bound()); + return receiver_.BindNewPipeAndPassRemote(); +} + +} // namespace webapps diff --git a/chromium/chrome/browser/ui/webui/app_home/mock_app_home_page.h b/chromium/chrome/browser/ui/webui/app_home/mock_app_home_page.h new file mode 100644 index 00000000000..b1ab46aebfd --- /dev/null +++ b/chromium/chrome/browser/ui/webui/app_home/mock_app_home_page.h @@ -0,0 +1,26 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_APP_HOME_MOCK_APP_HOME_PAGE_H_ +#define CHROME_BROWSER_UI_WEBUI_APP_HOME_MOCK_APP_HOME_PAGE_H_ + +#include "chrome/browser/ui/webui/app_home/app_home.mojom.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" + +namespace webapps { + +class MockAppHomePage : public app_home::mojom::Page { + public: + MockAppHomePage(); + ~MockAppHomePage() override; + + mojo::PendingRemote BindAndGetRemote(); + + mojo::Receiver receiver_{this}; +}; + +} // namespace webapps + +#endif // CHROME_BROWSER_UI_WEBUI_APP_HOME_MOCK_APP_HOME_PAGE_H_ diff --git a/chromium/chrome/browser/ui/webui/app_launcher_page_ui.cc b/chromium/chrome/browser/ui/webui/app_launcher_page_ui.cc index a418a3352ff..b87ac3eb247 100644 --- a/chromium/chrome/browser/ui/webui/app_launcher_page_ui.cc +++ b/chromium/chrome/browser/ui/webui/app_launcher_page_ui.cc @@ -132,9 +132,9 @@ AppLauncherPageUI::AppLauncherPageUI(content::WebUI* web_ui) bool is_swipe_tracking_from_scroll_events_enabled = false; #if BUILDFLAG(IS_MAC) - // On Mac OS X 10.7+, horizontal scrolling can be treated as a back or - // forward gesture. Pass through a flag that indicates whether or not that - // feature is enabled. + // On the Mac, horizontal scrolling can be treated as a back or forward + // gesture. Pass through a flag that indicates whether or not that feature is + // enabled. is_swipe_tracking_from_scroll_events_enabled = platform_util::IsSwipeTrackingFromScrollEventsEnabled(); #endif diff --git a/chromium/chrome/browser/ui/webui/app_management/app_management_page_handler.cc b/chromium/chrome/browser/ui/webui/app_management/app_management_page_handler.cc index 33bc72f90d0..fe59c24327e 100644 --- a/chromium/chrome/browser/ui/webui/app_management/app_management_page_handler.cc +++ b/chromium/chrome/browser/ui/webui/app_management/app_management_page_handler.cc @@ -11,6 +11,7 @@ #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" #include "base/i18n/message_formatter.h" +#include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -24,9 +25,11 @@ #include "chrome/grit/generated_resources.h" #include "components/app_constants/constants.h" #include "components/services/app_service/public/cpp/app_registry_cache.h" +#include "components/services/app_service/public/cpp/features.h" #include "components/services/app_service/public/cpp/intent_filter.h" #include "components/services/app_service/public/cpp/intent_filter_util.h" #include "components/services/app_service/public/cpp/intent_util.h" +#include "components/services/app_service/public/cpp/permission.h" #include "components/services/app_service/public/cpp/preferred_apps_list_handle.h" #include "components/services/app_service/public/cpp/types_util.h" #include "components/services/app_service/public/mojom/types.mojom.h" @@ -39,6 +42,7 @@ #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" +#include "third_party/blink/public/common/features.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/text/bytes_formatting.h" #include "ui/events/event_constants.h" @@ -267,8 +271,13 @@ void AppManagementPageHandler::SetPinned(const std::string& app_id, void AppManagementPageHandler::SetPermission(const std::string& app_id, apps::PermissionPtr permission) { - apps::AppServiceProxyFactory::GetForProfile(profile_)->SetPermission( - app_id, apps::ConvertPermissionToMojomPermission(permission)); + if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { + apps::AppServiceProxyFactory::GetForProfile(profile_)->SetPermission( + app_id, std::move(permission)); + } else { + apps::AppServiceProxyFactory::GetForProfile(profile_)->SetPermission( + app_id, apps::ConvertPermissionToMojomPermission(permission)); + } } void AppManagementPageHandler::SetResizeLocked(const std::string& app_id, @@ -283,9 +292,15 @@ void AppManagementPageHandler::SetResizeLocked(const std::string& app_id, } void AppManagementPageHandler::Uninstall(const std::string& app_id) { - apps::AppServiceProxyFactory::GetForProfile(profile_)->Uninstall( - app_id, apps::mojom::UninstallSource::kAppManagement, - delegate_.GetUninstallAnchorWindow()); + if (base::FeatureList::IsEnabled(apps::kAppServiceUninstallWithoutMojom)) { + apps::AppServiceProxyFactory::GetForProfile(profile_)->Uninstall( + app_id, apps::UninstallSource::kAppManagement, + delegate_.GetUninstallAnchorWindow()); + } else { + apps::AppServiceProxyFactory::GetForProfile(profile_)->Uninstall( + app_id, apps::mojom::UninstallSource::kAppManagement, + delegate_.GetUninstallAnchorWindow()); + } } void AppManagementPageHandler::OpenNativeSettings(const std::string& app_id) { @@ -353,8 +368,17 @@ void AppManagementPageHandler::SetRunOnOsLoginMode( void AppManagementPageHandler::SetFileHandlingEnabled(const std::string& app_id, bool enabled) { - web_app::PersistFileHandlersUserChoice(profile_, app_id, enabled, - base::DoNothing()); + auto permission = std::make_unique( + apps::PermissionType::kFileHandling, + std::make_unique(enabled), + /*is_managed=*/false); + if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { + apps::AppServiceProxyFactory::GetForProfile(profile_)->SetPermission( + app_id, std::move(permission)); + } else { + apps::AppServiceProxyFactory::GetForProfile(profile_)->SetPermission( + app_id, apps::ConvertPermissionToMojomPermission(permission)); + } } void AppManagementPageHandler::ShowDefaultAppAssociationsUi() { @@ -441,55 +465,87 @@ app_management::mojom::AppPtr AppManagementPageHandler::CreateUIAppPtr( std::move(run_on_os_login.value())); } - if (update.AppType() == apps::AppType::kWeb) { + if (update.AppType() == apps::AppType::kWeb || + update.AppType() == apps::AppType::kSystemWeb) { std::string file_handling_types; std::string file_handling_types_label; bool fh_enabled = false; -// Speculative fix for crbug.com/1315958 -#if !BUILDFLAG(IS_CHROMEOS) - auto* provider = - web_app::WebAppProvider::GetForLocalAppsUnchecked(profile_); - fh_enabled = - !provider->registrar().IsAppFileHandlerPermissionBlocked(app->id); - if (provider->os_integration_manager().IsFileHandlingAPIAvailable( - app->id) && - !provider->registrar().IsSystemApp(app->id) && - !provider->registrar().GetAppFileHandlers(app->id)->empty()) { - auto [file_handling_types16, count] = - web_app::GetFileTypeAssociationsHandledByWebAppForDisplay(profile_, - app->id); - file_handling_types = base::UTF16ToUTF8(file_handling_types16); - - const std::vector all_extensions = - web_app::GetFileTypeAssociationsHandledByWebAppForDisplayAsList( - profile_, app->id); - std::vector truncated_extensions = all_extensions; - // Only show at most 4 extensions. - truncated_extensions.resize(4); - file_handling_types_label = - base::UTF16ToUTF8(base::i18n::MessageFormatter::FormatWithNamedArgs( - l10n_util::GetStringUTF16(IDS_APP_MANAGEMENT_FILE_HANDLING_TYPES), - "FILE_TYPE_COUNT", static_cast(all_extensions.size()), - "FILE_TYPE1", truncated_extensions[0], "FILE_TYPE2", - truncated_extensions[1], "FILE_TYPE3", truncated_extensions[2], - "FILE_TYPE4", truncated_extensions[3], "OVERFLOW_COUNT", - static_cast(all_extensions.size()) - - static_cast(truncated_extensions.size()), - "LINK", "#")); + const bool is_system_web_app = + update.InstallReason() == apps::InstallReason::kSystem; + if (!is_system_web_app && + base::FeatureList::IsEnabled(blink::features::kFileHandlingAPI)) { + apps::IntentFilters filters = update.IntentFilters(); + if (!filters.empty()) { + std::set file_extensions; + // Mime types are ignored. + std::set mime_types; + for (auto& filter : filters) { + bool is_potential_file_handler_action = base::ranges::any_of( + filter->conditions.begin(), filter->conditions.end(), + [](const std::unique_ptr& condition) { + if (condition->condition_type != apps::ConditionType::kAction) + return false; + + if (condition->condition_values.size() != 1U) + return false; + + return condition->condition_values[0]->value == + apps_util::kIntentActionPotentialFileHandler; + }); + if (is_potential_file_handler_action) { + filter->GetMimeTypesAndExtensions(mime_types, file_extensions); + break; + } + } + + for (const auto& permission : update.Permissions()) { + if (permission->permission_type == + apps::PermissionType::kFileHandling) { + fh_enabled = permission->IsPermissionEnabled(); + break; + } + } + + std::vector extensions_for_display = + web_app::TransformFileExtensionsForDisplay(file_extensions); + file_handling_types = base::UTF16ToUTF8( + base::JoinString(extensions_for_display, + l10n_util::GetStringUTF16( + IDS_WEB_APP_FILE_HANDLING_LIST_SEPARATOR))); + + std::vector truncated_extensions = + extensions_for_display; + // Only show at most 4 extensions. + truncated_extensions.resize(4); + file_handling_types_label = + base::UTF16ToUTF8(base::i18n::MessageFormatter::FormatWithNamedArgs( + l10n_util::GetStringUTF16( + IDS_APP_MANAGEMENT_FILE_HANDLING_TYPES), + "FILE_TYPE_COUNT", + static_cast(extensions_for_display.size()), "FILE_TYPE1", + truncated_extensions[0], "FILE_TYPE2", truncated_extensions[1], + "FILE_TYPE3", truncated_extensions[2], "FILE_TYPE4", + truncated_extensions[3], "OVERFLOW_COUNT", + static_cast(extensions_for_display.size()) - + static_cast(truncated_extensions.size()), + "LINK", "#")); + } + + absl::optional learn_more_url; + if (!CanShowDefaultAppAssociationsUi()) + learn_more_url = GURL(kFileHandlingLearnMore); + // TODO(crbug/1252505): add file handling policy support. + app->file_handling_state = app_management::mojom::FileHandlingState::New( + fh_enabled, /*is_managed=*/false, file_handling_types, + file_handling_types_label, learn_more_url); } + } - app->hide_window_mode = provider->registrar().IsIsolated(app->id); +#if !BUILDFLAG(IS_CHROMEOS) + auto* provider = web_app::WebAppProvider::GetForLocalAppsUnchecked(profile_); + app->hide_window_mode = provider->registrar().IsIsolated(app->id); #endif - absl::optional learn_more_url; - if (!CanShowDefaultAppAssociationsUi()) - learn_more_url = GURL(kFileHandlingLearnMore); - // TODO(crbug/1252505): add file handling policy support. - app->file_handling_state = app_management::mojom::FileHandlingState::New( - fh_enabled, /*is_managed=*/false, file_handling_types, - file_handling_types_label, learn_more_url); - } - app->publisher_id = update.PublisherId(); return app; @@ -503,12 +559,22 @@ void AppManagementPageHandler::OpenStorePage(const std::string& app_id) { if (update.InstallSource() == apps::InstallSource::kPlayStore) { GURL url("https://play.google.com/store/apps/details?id=" + update.PublisherId()); - proxy->LaunchAppWithUrl(arc::kPlayStoreAppId, ui::EF_NONE, url, - apps::mojom::LaunchSource::kFromChromeInternal); + if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { + proxy->LaunchAppWithUrl(arc::kPlayStoreAppId, ui::EF_NONE, url, + apps::LaunchSource::kFromChromeInternal); + } else { + proxy->LaunchAppWithUrl(arc::kPlayStoreAppId, ui::EF_NONE, url, + apps::mojom::LaunchSource::kFromChromeInternal); + } } else if (update.InstallSource() == apps::InstallSource::kChromeWebStore) { GURL url("https://chrome.google.com/webstore/detail/" + update.AppId()); - proxy->LaunchAppWithUrl(extensions::kWebStoreAppId, ui::EF_NONE, url, - apps::mojom::LaunchSource::kFromChromeInternal); + if (base::FeatureList::IsEnabled(apps::kAppServiceLaunchWithoutMojom)) { + proxy->LaunchAppWithUrl(extensions::kWebStoreAppId, ui::EF_NONE, url, + apps::LaunchSource::kFromChromeInternal); + } else { + proxy->LaunchAppWithUrl(extensions::kWebStoreAppId, ui::EF_NONE, url, + apps::mojom::LaunchSource::kFromChromeInternal); + } } }); #endif diff --git a/chromium/chrome/browser/ui/webui/app_service_internals/app_service_internals_browsertest.cc b/chromium/chrome/browser/ui/webui/app_service_internals/app_service_internals_browsertest.cc index 0e0bc19f062..8ad68143f93 100644 --- a/chromium/chrome/browser/ui/webui/app_service_internals/app_service_internals_browsertest.cc +++ b/chromium/chrome/browser/ui/webui/app_service_internals/app_service_internals_browsertest.cc @@ -18,7 +18,7 @@ IN_PROC_BROWSER_TEST_F(AppServiceInternalsBrowserTest, LoadsWebUiPage) { // app visible. ASSERT_TRUE(embedded_test_server()->Start()); const GURL app_url = - embedded_test_server()->GetURL("/web_apps/site_a/basic.html"); + embedded_test_server()->GetURL("/web_apps/standalone/basic.html"); web_app::InstallWebAppFromPage(browser(), app_url); content::WebContents* web_contents = diff --git a/chromium/chrome/browser/ui/webui/app_settings/web_app_settings_navigation_throttle.cc b/chromium/chrome/browser/ui/webui/app_settings/web_app_settings_navigation_throttle.cc index 25b062fb646..59c703a5ea7 100644 --- a/chromium/chrome/browser/ui/webui/app_settings/web_app_settings_navigation_throttle.cc +++ b/chromium/chrome/browser/ui/webui/app_settings/web_app_settings_navigation_throttle.cc @@ -21,9 +21,6 @@ bool g_disable_throttle_for_testing_ = false; std::unique_ptr WebAppSettingsNavigationThrottle::MaybeCreateThrottleFor( content::NavigationHandle* handle) { - // Check web app settings feature is enabled. - if (!base::FeatureList::IsEnabled(features::kDesktopPWAsWebAppSettingsPage)) - return nullptr; // Check the current url scheme is chrome:// if (!handle->GetURL().SchemeIs(content::kChromeUIScheme)) return nullptr; diff --git a/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/autofill_internals_ui_browsertest.cc b/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/autofill_internals_ui_browsertest.cc index ab02ab3d81f..aa51623af77 100644 --- a/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/autofill_internals_ui_browsertest.cc +++ b/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/autofill_internals_ui_browsertest.cc @@ -46,7 +46,7 @@ IN_PROC_BROWSER_TEST_F(AutofillInternalsWebUIBrowserTest, ResetCache) { // Wait for reset-fake-button to become visible constexpr char kGetResetButtonDisplayStyle[] = "document.getElementById('reset-cache-fake-button').style.display"; - while ("inline-block" != EvalJs(kGetResetButtonDisplayStyle)) + while ("inline" != EvalJs(kGetResetButtonDisplayStyle)) SpinRunLoop(); // Trigger reset button. diff --git a/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.cc b/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.cc index 056541903e6..889c1159a29 100644 --- a/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.cc +++ b/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.cc @@ -13,6 +13,7 @@ #include "components/autofill/core/browser/logging/log_router.h" #include "components/embedder_support/user_agent_utils.h" #include "components/grit/dev_ui_components_resources.h" +#include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/version_info/version_info.h" #include "components/version_ui/version_handler_helper.h" #include "components/version_ui/version_ui_constants.h" @@ -91,12 +92,18 @@ InternalsUIHandler::~InternalsUIHandler() { } void InternalsUIHandler::RegisterMessages() { - web_ui()->RegisterDeprecatedMessageCallback( + web_ui()->RegisterMessageCallback( "loaded", base::BindRepeating(&InternalsUIHandler::OnLoaded, base::Unretained(this))); - web_ui()->RegisterDeprecatedMessageCallback( + web_ui()->RegisterMessageCallback( "resetCache", base::BindRepeating(&InternalsUIHandler::OnResetCache, base::Unretained(this))); +#if BUILDFLAG(IS_ANDROID) + web_ui()->RegisterMessageCallback( + "resetUpmEviction", + base::BindRepeating(&InternalsUIHandler::OnResetUpmEviction, + base::Unretained(this))); +#endif } void InternalsUIHandler::OnJavascriptAllowed() { @@ -107,7 +114,7 @@ void InternalsUIHandler::OnJavascriptDisallowed() { EndSubscription(); } -void InternalsUIHandler::OnLoaded(const base::ListValue* args) { +void InternalsUIHandler::OnLoaded(const base::Value::List& args) { AllowJavascript(); FireWebUIListener(call_on_load_, base::Value()); // This is only available in contents, because the iOS BrowsingDataRemover @@ -118,9 +125,17 @@ void InternalsUIHandler::OnLoaded(const base::ListValue* args) { "notify-about-incognito", base::Value(Profile::FromWebUI(web_ui())->IsIncognitoProfile())); FireWebUIListener("notify-about-variations", version_ui::GetVariationsList()); + +#if BUILDFLAG(IS_ANDROID) + auto* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); + FireWebUIListener("enable-reset-upm-eviction-button", + base::Value(prefs->GetBoolean( + password_manager::prefs:: + kUnenrolledFromGoogleMobileServicesDueToErrors))); +#endif } -void InternalsUIHandler::OnResetCache(const base::ListValue* args) { +void InternalsUIHandler::OnResetCache(const base::Value::List& args) { if (!autofill_cache_resetter_) { content::BrowserContext* browser_context = Profile::FromWebUI(web_ui()); autofill_cache_resetter_.emplace(browser_context); @@ -133,6 +148,16 @@ void InternalsUIHandler::OnResetCacheDone(const std::string& message) { FireWebUIListener("notify-reset-done", base::Value(message)); } +#if BUILDFLAG(IS_ANDROID) +void InternalsUIHandler::OnResetUpmEviction(const base::Value::List& args) { + auto* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); + prefs->SetBoolean( + password_manager::prefs::kUnenrolledFromGoogleMobileServicesDueToErrors, + false); + FireWebUIListener("enable-reset-upm-eviction-button", base::Value(false)); +} +#endif + void InternalsUIHandler::StartSubscription() { LogRouter* log_router = get_log_router_function_.Run(Profile::FromWebUI(web_ui())); @@ -140,10 +165,7 @@ void InternalsUIHandler::StartSubscription() { return; registered_with_log_router_ = true; - - const auto& past_logs = log_router->RegisterReceiver(this); - for (const auto& entry : past_logs) - LogEntry(entry); + log_router->RegisterReceiver(this); } void InternalsUIHandler::EndSubscription() { @@ -156,8 +178,8 @@ void InternalsUIHandler::EndSubscription() { log_router->UnregisterReceiver(this); } -void InternalsUIHandler::LogEntry(const base::Value& entry) { - if (!registered_with_log_router_ || entry.is_none()) +void InternalsUIHandler::LogEntry(const base::Value::Dict& entry) { + if (!registered_with_log_router_) return; FireWebUIListener("add-structured-log", entry); } diff --git a/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.h b/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.h index a94e0d1a055..ae019503ca6 100644 --- a/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.h +++ b/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.h @@ -78,14 +78,15 @@ class InternalsUIHandler : public content::WebUIMessageHandler, void OnJavascriptDisallowed() override; // LogReceiver implementation. - void LogEntry(const base::Value& entry) override; + void LogEntry(const base::Value::Dict& entry) override; void StartSubscription(); void EndSubscription(); // JavaScript call handler. - void OnLoaded(const base::ListValue* args); - void OnResetCache(const base::ListValue* args); + void OnLoaded(const base::Value::List& args); + void OnResetCache(const base::Value::List& args); + void OnResetUpmEviction(const base::Value::List& args); void OnResetCacheDone(const std::string& message); diff --git a/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/password_manager_internals_ui_browsertest.cc b/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/password_manager_internals_ui_browsertest.cc index bd9a0758584..d3dca59791f 100644 --- a/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/password_manager_internals_ui_browsertest.cc +++ b/chromium/chrome/browser/ui/webui/autofill_and_password_manager_internals/password_manager_internals_ui_browsertest.cc @@ -102,44 +102,6 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerInternalsWebUIBrowserTest, ASSERT_TRUE(RunJavascriptTest("testLogEmpty")); } -// Test that if two tabs with the internals page are open, the second displays -// the same logs. In particular, this checks that both the second tab gets the -// logs created before the second tab was opened, and also that the second tab -// waits with displaying until the internals page is ready (trying to display -// the old logs just on construction time would fail). -IN_PROC_BROWSER_TEST_F(PasswordManagerInternalsWebUIBrowserTest, - LogEntry_MultipleTabsIdentical) { - // First, open one tab with the internals page, and log something. - autofill::LogRouter* log_router = - password_manager::PasswordManagerLogRouterFactory::GetForBrowserContext( - browser()->profile()); - ASSERT_TRUE(log_router); - log_router->ProcessLog("