chromium/chrome/browser/extensions/BUILD.gn

# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromebox_for_meetings/buildflags.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
import("//build/config/ozone.gni")
import("//build/config/ui.gni")
import("//chrome/common/features.gni")
import("//components/enterprise/buildflags/buildflags.gni")
import("//components/nacl/features.gni")
import("//extensions/buildflags/buildflags.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//pdf/features.gni")
import("//printing/buildflags/buildflags.gni")
import("//rlz/buildflags/buildflags.gni")
import("//services/screen_ai/buildflags/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//third_party/protobuf/proto_library.gni")

assert(enable_extensions)
assert(enable_supervised_users)
assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome")

source_set("extensions") {
  sources = [
    "active_install_data.cc",
    "active_install_data.h",
    "activity_log/activity_action_constants.cc",
    "activity_log/activity_action_constants.h",
    "activity_log/activity_actions.cc",
    "activity_log/activity_actions.h",
    "activity_log/activity_database.cc",
    "activity_log/activity_database.h",
    "activity_log/activity_log.cc",
    "activity_log/activity_log.h",
    "activity_log/activity_log_policy.cc",
    "activity_log/activity_log_policy.h",
    "activity_log/activity_log_task_runner.cc",
    "activity_log/activity_log_task_runner.h",
    "activity_log/counting_policy.cc",
    "activity_log/counting_policy.h",
    "activity_log/database_string_table.cc",
    "activity_log/database_string_table.h",
    "activity_log/fullstream_ui_policy.cc",
    "activity_log/fullstream_ui_policy.h",
    "permissions/active_tab_permission_granter.cc",
    "permissions/active_tab_permission_granter.h",

    # TODO(crbug.com/40245282): Ideally, no API implementations would be included
    # here.
    "api/automation_internal/chrome_automation_internal_api_delegate.cc",
    "api/automation_internal/chrome_automation_internal_api_delegate.h",
    "api/bookmark_manager_private/bookmark_manager_private_api.cc",
    "api/bookmark_manager_private/bookmark_manager_private_api.h",
    "api/bookmarks/bookmark_api_helpers.cc",
    "api/bookmarks/bookmark_api_helpers.h",
    "api/bookmarks/bookmarks_api.cc",
    "api/bookmarks/bookmarks_api.h",
    "api/bookmarks/bookmarks_api_watcher.cc",
    "api/bookmarks/bookmarks_api_watcher.h",
    "api/bookmarks_core/bookmarks_function.cc",
    "api/bookmarks_core/bookmarks_function.h",
    "api/braille_display_private/braille_controller.h",
    "api/braille_display_private/braille_controller_brlapi.h",
    "api/braille_display_private/braille_display_private_api.cc",
    "api/braille_display_private/braille_display_private_api.h",
    "api/braille_display_private/stub_braille_controller.cc",
    "api/braille_display_private/stub_braille_controller.h",
    "api/browsing_data/browsing_data_api.cc",
    "api/browsing_data/browsing_data_api.h",
    "api/chrome_device_permissions_prompt.h",
    "api/chrome_extensions_api_client.cc",
    "api/chrome_extensions_api_client.h",
    "api/commands/commands.cc",
    "api/commands/commands.h",
    "api/content_settings/content_settings_api.cc",
    "api/content_settings/content_settings_api.h",
    "api/debugger/debugger_api.cc",
    "api/debugger/debugger_api.h",
    "api/debugger/extension_dev_tools_infobar_delegate.cc",
    "api/debugger/extension_dev_tools_infobar_delegate.h",
    "api/declarative_content/chrome_content_rules_registry.cc",
    "api/declarative_content/chrome_content_rules_registry.h",
    "api/declarative_content/content_action.cc",
    "api/declarative_content/content_action.h",
    "api/declarative_content/content_condition.cc",
    "api/declarative_content/content_condition.h",
    "api/declarative_content/content_predicate.cc",
    "api/declarative_content/content_predicate.h",
    "api/declarative_content/content_predicate_evaluator.cc",
    "api/declarative_content/content_predicate_evaluator.h",
    "api/declarative_content/declarative_content_css_condition_tracker.cc",
    "api/declarative_content/declarative_content_css_condition_tracker.h",
    "api/declarative_content/declarative_content_is_bookmarked_condition_tracker.cc",
    "api/declarative_content/declarative_content_is_bookmarked_condition_tracker.h",
    "api/declarative_content/declarative_content_page_url_condition_tracker.cc",
    "api/declarative_content/declarative_content_page_url_condition_tracker.h",
    "api/declarative_content/default_content_predicate_evaluators.cc",
    "api/declarative_content/default_content_predicate_evaluators.h",
    "api/developer_private/developer_private_api.cc",
    "api/developer_private/developer_private_api.h",
    "api/developer_private/extension_info_generator.cc",
    "api/developer_private/extension_info_generator.h",
    "api/developer_private/inspectable_views_finder.cc",
    "api/developer_private/inspectable_views_finder.h",
    "api/downloads/downloads_api.cc",
    "api/downloads/downloads_api.h",
    "api/enterprise_hardware_platform/enterprise_hardware_platform_api.cc",
    "api/enterprise_hardware_platform/enterprise_hardware_platform_api.h",
    "api/enterprise_reporting_private/conversion_utils.cc",
    "api/enterprise_reporting_private/conversion_utils.h",
    "api/enterprise_reporting_private/enterprise_reporting_private_api.cc",
    "api/enterprise_reporting_private/enterprise_reporting_private_api.h",
    "api/extension_action/extension_action_api.cc",
    "api/extension_action/extension_action_api.h",
    "api/extension_action/extension_page_actions_api_constants.cc",
    "api/extension_action/extension_page_actions_api_constants.h",
    "api/feedback_private/chrome_feedback_private_delegate.cc",
    "api/feedback_private/chrome_feedback_private_delegate.h",
    "api/file_system/chrome_file_system_delegate.cc",
    "api/file_system/chrome_file_system_delegate.h",
    "api/file_system/file_entry_picker.cc",
    "api/file_system/file_entry_picker.h",
    "api/gcm/gcm_api.cc",
    "api/gcm/gcm_api.h",
    "api/history/history_api.cc",
    "api/history/history_api.h",
    "api/identity/extension_token_key.cc",
    "api/identity/extension_token_key.h",
    "api/identity/gaia_remote_consent_flow.cc",
    "api/identity/gaia_remote_consent_flow.h",
    "api/identity/identity_api.cc",
    "api/identity/identity_api.h",
    "api/identity/identity_clear_all_cached_auth_tokens_function.cc",
    "api/identity/identity_clear_all_cached_auth_tokens_function.h",
    "api/identity/identity_constants.cc",
    "api/identity/identity_constants.h",
    "api/identity/identity_get_accounts_function.cc",
    "api/identity/identity_get_accounts_function.h",
    "api/identity/identity_get_auth_token_error.cc",
    "api/identity/identity_get_auth_token_error.h",
    "api/identity/identity_get_auth_token_function.cc",
    "api/identity/identity_get_auth_token_function.h",
    "api/identity/identity_get_profile_user_info_function.cc",
    "api/identity/identity_get_profile_user_info_function.h",
    "api/identity/identity_launch_web_auth_flow_function.cc",
    "api/identity/identity_launch_web_auth_flow_function.h",
    "api/identity/identity_mint_queue.cc",
    "api/identity/identity_mint_queue.h",
    "api/identity/identity_remove_cached_auth_token_function.cc",
    "api/identity/identity_remove_cached_auth_token_function.h",
    "api/identity/identity_token_cache.cc",
    "api/identity/identity_token_cache.h",
    "api/identity/launch_web_auth_flow_delegate.h",
    "api/identity/web_auth_flow.cc",
    "api/identity/web_auth_flow.h",
    "api/identity/web_auth_flow_info_bar_delegate.cc",
    "api/identity/web_auth_flow_info_bar_delegate.h",
    "api/idltest/idltest_api.cc",
    "api/idltest/idltest_api.h",
    "api/image_writer_private/destroy_partitions_operation.cc",
    "api/image_writer_private/destroy_partitions_operation.h",
    "api/image_writer_private/error_constants.cc",
    "api/image_writer_private/error_constants.h",
    "api/image_writer_private/extraction_properties.cc",
    "api/image_writer_private/extraction_properties.h",
    "api/image_writer_private/image_writer_private_api.cc",
    "api/image_writer_private/image_writer_private_api.h",
    "api/image_writer_private/image_writer_utility_client.cc",
    "api/image_writer_private/image_writer_utility_client.h",
    "api/image_writer_private/operation.cc",
    "api/image_writer_private/operation.h",
    "api/image_writer_private/operation_manager.cc",
    "api/image_writer_private/operation_manager.h",
    "api/image_writer_private/removable_storage_provider.cc",
    "api/image_writer_private/removable_storage_provider.h",
    "api/image_writer_private/tar_extractor.cc",
    "api/image_writer_private/tar_extractor.h",
    "api/image_writer_private/write_from_file_operation.cc",
    "api/image_writer_private/write_from_file_operation.h",
    "api/image_writer_private/write_from_url_operation.cc",
    "api/image_writer_private/write_from_url_operation.h",
    "api/image_writer_private/xz_extractor.cc",
    "api/image_writer_private/xz_extractor.h",
    "api/image_writer_private/zip_extractor.cc",
    "api/image_writer_private/zip_extractor.h",
    "api/instance_id/instance_id_api.cc",
    "api/instance_id/instance_id_api.h",
    "api/language_settings_private/language_settings_private_api.cc",
    "api/language_settings_private/language_settings_private_api.h",
    "api/language_settings_private/language_settings_private_delegate.cc",
    "api/language_settings_private/language_settings_private_delegate.h",
    "api/language_settings_private/language_settings_private_delegate_factory.cc",
    "api/language_settings_private/language_settings_private_delegate_factory.h",
    "api/management/chrome_management_api_delegate.cc",
    "api/management/chrome_management_api_delegate.h",
    "api/messaging/chrome_messaging_delegate.cc",
    "api/messaging/chrome_messaging_delegate.h",
    "api/messaging/incognito_connectability.cc",
    "api/messaging/incognito_connectability.h",
    "api/messaging/incognito_connectability_infobar_delegate.cc",
    "api/messaging/incognito_connectability_infobar_delegate.h",
    "api/messaging/native_message_port.cc",
    "api/messaging/native_message_port.h",
    "api/messaging/native_messaging_host_manifest.cc",
    "api/messaging/native_messaging_host_manifest.h",
    "api/metrics_private/chrome_metrics_private_delegate.cc",
    "api/metrics_private/chrome_metrics_private_delegate.h",
    "api/networking_private/networking_private_ui_delegate_factory_impl.cc",
    "api/networking_private/networking_private_ui_delegate_factory_impl.h",
    "api/notifications/extension_notification_display_helper.cc",
    "api/notifications/extension_notification_display_helper.h",
    "api/notifications/extension_notification_display_helper_factory.cc",
    "api/notifications/extension_notification_display_helper_factory.h",
    "api/notifications/extension_notification_handler.cc",
    "api/notifications/extension_notification_handler.h",
    "api/notifications/notifications_api.cc",
    "api/notifications/notifications_api.h",
    "api/passwords_private/password_access_auth_timeout_handler.cc",
    "api/passwords_private/password_access_auth_timeout_handler.h",
    "api/passwords_private/password_check_delegate.cc",
    "api/passwords_private/password_check_delegate.h",
    "api/passwords_private/passwords_private_api.cc",
    "api/passwords_private/passwords_private_api.h",
    "api/passwords_private/passwords_private_delegate.h",
    "api/passwords_private/passwords_private_delegate_factory.cc",
    "api/passwords_private/passwords_private_delegate_factory.h",
    "api/passwords_private/passwords_private_delegate_impl.cc",
    "api/passwords_private/passwords_private_delegate_impl.h",
    "api/passwords_private/passwords_private_event_router.cc",
    "api/passwords_private/passwords_private_event_router.h",
    "api/passwords_private/passwords_private_event_router_factory.cc",
    "api/passwords_private/passwords_private_event_router_factory.h",
    "api/passwords_private/passwords_private_utils.cc",
    "api/passwords_private/passwords_private_utils.h",
    "api/preference/cookie_controls_mode_transformer.cc",
    "api/preference/cookie_controls_mode_transformer.h",
    "api/preference/network_prediction_transformer.cc",
    "api/preference/network_prediction_transformer.h",
    "api/preference/privacy_sandbox_transformer.cc",
    "api/preference/privacy_sandbox_transformer.h",
    "api/preference/protected_content_enabled_transformer.cc",
    "api/preference/protected_content_enabled_transformer.h",
    "api/proxy/proxy_api.cc",
    "api/proxy/proxy_api.h",
    "api/proxy/proxy_api_constants.cc",
    "api/proxy/proxy_api_constants.h",
    "api/proxy/proxy_api_helpers.cc",
    "api/proxy/proxy_api_helpers.h",
    "api/reading_list/reading_list_api.cc",
    "api/reading_list/reading_list_api.h",
    "api/reading_list/reading_list_api_constants.cc",
    "api/reading_list/reading_list_api_constants.h",
    "api/reading_list/reading_list_event_router.cc",
    "api/reading_list/reading_list_event_router.h",
    "api/reading_list/reading_list_util.cc",
    "api/reading_list/reading_list_util.h",
    "api/resources_private/resources_private_api.cc",
    "api/resources_private/resources_private_api.h",
    "api/runtime/chrome_runtime_api_delegate.cc",
    "api/runtime/chrome_runtime_api_delegate.h",
    "api/safe_browsing_private/safe_browsing_private_api.cc",
    "api/safe_browsing_private/safe_browsing_private_api.h",
    "api/safe_browsing_private/safe_browsing_private_event_router.cc",
    "api/safe_browsing_private/safe_browsing_private_event_router.h",
    "api/safe_browsing_private/safe_browsing_private_event_router_factory.cc",
    "api/safe_browsing_private/safe_browsing_private_event_router_factory.h",
    "api/safe_browsing_private/safe_browsing_util.cc",
    "api/safe_browsing_private/safe_browsing_util.h",
    "api/search/search_api.cc",
    "api/search/search_api.h",
    "api/sessions/session_id.cc",
    "api/sessions/session_id.h",
    "api/sessions/sessions_api.cc",
    "api/sessions/sessions_api.h",
    "api/settings_overrides/settings_overrides_api.cc",
    "api/settings_overrides/settings_overrides_api.h",
    "api/settings_private/generated_pref.cc",
    "api/settings_private/generated_pref.h",
    "api/settings_private/generated_prefs.cc",
    "api/settings_private/generated_prefs.h",
    "api/settings_private/generated_prefs_factory.cc",
    "api/settings_private/generated_prefs_factory.h",
    "api/settings_private/prefs_util.cc",
    "api/settings_private/prefs_util.h",
    "api/settings_private/settings_private_api.cc",
    "api/settings_private/settings_private_api.h",
    "api/settings_private/settings_private_delegate.cc",
    "api/settings_private/settings_private_delegate.h",
    "api/settings_private/settings_private_delegate_factory.cc",
    "api/settings_private/settings_private_delegate_factory.h",
    "api/settings_private/settings_private_event_router.cc",
    "api/settings_private/settings_private_event_router.h",
    "api/settings_private/settings_private_event_router_factory.cc",
    "api/settings_private/settings_private_event_router_factory.h",
    "api/side_panel/side_panel_api.cc",
    "api/side_panel/side_panel_api.h",
    "api/side_panel/side_panel_service.cc",
    "api/side_panel/side_panel_service.h",
    "api/storage/managed_value_store_cache.cc",
    "api/storage/managed_value_store_cache.h",
    "api/storage/policy_value_store.cc",
    "api/storage/policy_value_store.h",
    "api/storage/setting_sync_data.cc",
    "api/storage/setting_sync_data.h",
    "api/storage/settings_sync_processor.cc",
    "api/storage/settings_sync_processor.h",
    "api/storage/settings_sync_util.cc",
    "api/storage/settings_sync_util.h",
    "api/storage/sync_storage_backend.cc",
    "api/storage/sync_storage_backend.h",
    "api/storage/sync_value_store_cache.cc",
    "api/storage/sync_value_store_cache.h",
    "api/storage/syncable_settings_storage.cc",
    "api/storage/syncable_settings_storage.h",
    "api/streams_private/streams_private_api.cc",
    "api/streams_private/streams_private_api.h",
    "api/system_private/system_private_api.cc",
    "api/system_private/system_private_api.h",
    "api/tab_capture/tab_capture_api.cc",
    "api/tab_capture/tab_capture_api.h",
    "api/tab_capture/tab_capture_registry.cc",
    "api/tab_capture/tab_capture_registry.h",
    "api/tab_groups/tab_groups_api.cc",
    "api/tab_groups/tab_groups_api.h",
    "api/tab_groups/tab_groups_constants.cc",
    "api/tab_groups/tab_groups_constants.h",
    "api/tab_groups/tab_groups_event_router.cc",
    "api/tab_groups/tab_groups_event_router.h",
    "api/tab_groups/tab_groups_event_router_factory.cc",
    "api/tab_groups/tab_groups_event_router_factory.h",
    "api/tab_groups/tab_groups_util.cc",
    "api/tab_groups/tab_groups_util.h",
    "api/tabs/app_base_window.cc",
    "api/tabs/app_base_window.h",
    "api/tabs/app_window_controller.cc",
    "api/tabs/app_window_controller.h",
    "api/tabs/tabs_api.cc",
    "api/tabs/tabs_api.h",
    "api/tabs/tabs_constants.cc",
    "api/tabs/tabs_constants.h",
    "api/tabs/tabs_event_router.cc",
    "api/tabs/tabs_event_router.h",
    "api/tabs/tabs_windows_api.cc",
    "api/tabs/tabs_windows_api.h",
    "api/tabs/windows_event_router.cc",
    "api/tabs/windows_event_router.h",
    "api/tabs/windows_util.cc",
    "api/tabs/windows_util.h",
    "api/top_sites/top_sites_api.cc",
    "api/top_sites/top_sites_api.h",
    "api/web_authentication_proxy/remote_session_state_change.cc",
    "api/web_authentication_proxy/remote_session_state_change.h",
    "api/web_authentication_proxy/web_authentication_proxy_api.cc",
    "api/web_authentication_proxy/web_authentication_proxy_api.h",
    "api/web_authentication_proxy/web_authentication_proxy_service.cc",
    "api/web_authentication_proxy/web_authentication_proxy_service.h",
    "api/web_navigation/frame_navigation_state.cc",
    "api/web_navigation/frame_navigation_state.h",
    "api/web_navigation/web_navigation_api.cc",
    "api/web_navigation/web_navigation_api.h",
    "api/web_navigation/web_navigation_api_constants.cc",
    "api/web_navigation/web_navigation_api_constants.h",
    "api/web_navigation/web_navigation_api_helpers.cc",
    "api/web_navigation/web_navigation_api_helpers.h",
    "api/web_view/chrome_web_view_internal_api.cc",
    "api/web_view/chrome_web_view_internal_api.h",
    "api/webrtc_audio_private/webrtc_audio_private_api.cc",
    "api/webrtc_audio_private/webrtc_audio_private_api.h",
    "api/webstore_private/extension_install_status.cc",
    "api/webstore_private/extension_install_status.h",
    "api/webstore_private/webstore_private_api.cc",
    "api/webstore_private/webstore_private_api.h",
    "blocklist.cc",
    "blocklist.h",
    "blocklist_check.cc",
    "blocklist_check.h",
    "blocklist_factory.cc",
    "blocklist_factory.h",
    "blocklist_state_fetcher.cc",
    "blocklist_state_fetcher.h",
    "bookmark_app_util.cc",
    "bookmark_app_util.h",
    "bookmarks/bookmarks_error_constants.cc",
    "bookmarks/bookmarks_error_constants.h",
    "browser_extension_window_controller.cc",
    "browser_extension_window_controller.h",
    "chrome_app_icon.cc",
    "chrome_app_icon.h",
    "chrome_app_icon_delegate.h",
    "chrome_app_icon_loader.cc",
    "chrome_app_icon_loader.h",
    "chrome_app_icon_service.cc",
    "chrome_app_icon_service.h",
    "chrome_app_icon_service_factory.cc",
    "chrome_app_icon_service_factory.h",
    "chrome_app_sorting.cc",
    "chrome_app_sorting.h",
    "chrome_component_extension_resource_manager.cc",
    "chrome_component_extension_resource_manager.h",
    "chrome_content_browser_client_extensions_part.cc",
    "chrome_content_browser_client_extensions_part.h",
    "chrome_content_browser_client_extensions_part_bindings.cc",
    "chrome_content_verifier_delegate.cc",
    "chrome_content_verifier_delegate.h",
    "chrome_extension_cookies.cc",
    "chrome_extension_cookies.h",
    "chrome_extension_cookies_factory.cc",
    "chrome_extension_cookies_factory.h",
    "chrome_extension_frame_host.cc",
    "chrome_extension_frame_host.h",
    "chrome_extension_function_details.cc",
    "chrome_extension_function_details.h",
    "chrome_extension_host_delegate.cc",
    "chrome_extension_host_delegate.h",
    "chrome_extension_web_contents_observer.cc",
    "chrome_extension_web_contents_observer.h",
    "chrome_extensions_browser_api_provider.cc",
    "chrome_extensions_browser_api_provider.h",
    "chrome_extensions_browser_client.cc",
    "chrome_extensions_browser_client.h",
    "chrome_extensions_browser_interface_binders.cc",
    "chrome_extensions_browser_interface_binders.h",
    "chrome_kiosk_delegate.h",
    "chrome_process_manager_delegate.cc",
    "chrome_process_manager_delegate.h",
    "chrome_url_request_util.cc",
    "chrome_url_request_util.h",
    "chrome_zipfile_installer.cc",
    "chrome_zipfile_installer.h",
    "commands/command_service.cc",
    "commands/command_service.h",
    "component_extensions_allowlist/allowlist.cc",
    "component_extensions_allowlist/allowlist.h",
    "component_loader.cc",
    "component_loader.h",
    "context_menu_helpers.cc",
    "context_menu_helpers.h",
    "context_menu_matcher.cc",
    "context_menu_matcher.h",
    "convert_user_script.cc",
    "convert_user_script.h",
    "corrupted_extension_reinstaller.cc",
    "corrupted_extension_reinstaller.h",
    "crx_installer.cc",
    "crx_installer.h",
    "cws_info_service.cc",
    "cws_info_service.h",
    "cws_info_service_factory.cc",
    "cws_info_service_factory.h",
    "data_deleter.cc",
    "data_deleter.h",
    "device_permissions_dialog_controller.cc",
    "device_permissions_dialog_controller.h",
    "devtools_util.cc",
    "devtools_util.h",
    "error_console/error_console.cc",
    "error_console/error_console.h",
    "error_console/error_console_factory.cc",
    "error_console/error_console_factory.h",
    "event_router_forwarder.cc",
    "event_router_forwarder.h",
    "extension_action_runner.cc",
    "extension_action_runner.h",
    "extension_action_storage_manager.cc",
    "extension_action_storage_manager.h",
    "extension_allowlist.cc",
    "extension_allowlist.h",
    "extension_assets_manager.cc",
    "extension_assets_manager.h",
    "extension_browser_window.h",
    "extension_browser_window_desktop.cc",
    "extension_browser_window_desktop.h",
    "extension_browser_window_helper.cc",
    "extension_browser_window_helper.h",
    "extension_commands_global_registry.cc",
    "extension_commands_global_registry.h",
    "extension_context_menu_model.cc",
    "extension_context_menu_model.h",
    "extension_disabled_ui.cc",
    "extension_disabled_ui.h",
    "extension_error_controller.cc",
    "extension_error_controller.h",
    "extension_error_ui.h",
    "extension_error_ui_default.cc",
    "extension_error_ui_default.h",
    "extension_garbage_collector.cc",
    "extension_garbage_collector.h",
    "extension_garbage_collector_factory.cc",
    "extension_garbage_collector_factory.h",
    "extension_gcm_app_handler.cc",
    "extension_gcm_app_handler.h",
    "extension_install_error_menu_item_id_provider.cc",
    "extension_install_error_menu_item_id_provider.h",
    "extension_install_prompt.cc",
    "extension_install_prompt.h",
    "extension_install_prompt_show_params.cc",
    "extension_install_prompt_show_params.h",
    "extension_keybinding_registry.cc",
    "extension_keybinding_registry.h",
    "extension_management.cc",
    "extension_management.h",
    "extension_management_constants.cc",
    "extension_management_constants.h",
    "extension_management_internal.cc",
    "extension_management_internal.h",
    "extension_menu_icon_loader.cc",
    "extension_menu_icon_loader.h",
    "extension_migrator.cc",
    "extension_migrator.h",
    "extension_safety_check_utils.cc",
    "extension_safety_check_utils.h",
    "extension_service.cc",
    "extension_service.h",
    "extension_side_panel_view_host.cc",
    "extension_side_panel_view_host.h",
    "extension_special_storage_policy.cc",
    "extension_special_storage_policy.h",
    "extension_sync_data.cc",
    "extension_sync_data.h",
    "extension_sync_service.cc",
    "extension_sync_service.h",
    "extension_sync_service_factory.cc",
    "extension_sync_service_factory.h",
    "extension_system_factory.cc",
    "extension_system_factory.h",
    "extension_system_impl.cc",
    "extension_system_impl.h",
    "extension_tab_util.cc",
    "extension_tab_util.h",
    "extension_telemetry_service_verdict_handler.cc",
    "extension_telemetry_service_verdict_handler.h",
    "extension_ui_util.cc",
    "extension_ui_util.h",
    "extension_uninstall_dialog.cc",
    "extension_uninstall_dialog.h",
    "extension_util.cc",
    "extension_util.h",
    "extension_view.h",
    "extension_view_host.cc",
    "extension_view_host.h",
    "extension_view_host_factory.cc",
    "extension_view_host_factory.h",
    "extension_web_ui.cc",
    "extension_web_ui.h",
    "extension_web_ui_override_registrar.cc",
    "extension_web_ui_override_registrar.h",
    "extension_webkit_preferences.cc",
    "extension_webkit_preferences.h",
    "external_component_loader.cc",
    "external_component_loader.h",
    "external_install_error.cc",
    "external_install_error.h",
    "external_install_manager.cc",
    "external_install_manager.h",
    "external_loader.cc",
    "external_loader.h",
    "external_policy_loader.cc",
    "external_policy_loader.h",
    "external_pref_loader.cc",
    "external_pref_loader.h",
    "external_provider_impl.cc",
    "external_provider_impl.h",
    "favicon/favicon_util.cc",
    "favicon/favicon_util.h",
    "file_handlers/file_handling_launch_utils.cc",
    "file_handlers/file_handling_launch_utils.h",
    "forced_extensions/force_installed_metrics.cc",
    "forced_extensions/force_installed_metrics.h",
    "forced_extensions/force_installed_tracker.cc",
    "forced_extensions/force_installed_tracker.h",
    "forced_extensions/install_stage_tracker.cc",
    "forced_extensions/install_stage_tracker.h",
    "forced_extensions/install_stage_tracker_factory.cc",
    "forced_extensions/install_stage_tracker_factory.h",
    "global_shortcut_listener.cc",
    "global_shortcut_listener.h",
    "install_gate.h",
    "install_observer.cc",
    "install_observer.h",
    "install_prompt_permissions.cc",
    "install_prompt_permissions.h",
    "install_signer.cc",
    "install_signer.h",
    "install_tracker.cc",
    "install_tracker.h",
    "install_tracker_factory.cc",
    "install_tracker_factory.h",
    "install_verifier.cc",
    "install_verifier.h",
    "install_verifier_factory.cc",
    "install_verifier_factory.h",
    "installed_loader.cc",
    "installed_loader.h",
    "launch_util.cc",
    "launch_util.h",
    "load_error_reporter.cc",
    "load_error_reporter.h",
    "manifest_v2_experiment_manager.cc",
    "manifest_v2_experiment_manager.h",
    "menu_icon_loader.h",
    "menu_manager.cc",
    "menu_manager.h",
    "menu_manager_factory.cc",
    "menu_manager_factory.h",
    "mv2_deprecation_impact_checker.cc",
    "mv2_deprecation_impact_checker.h",
    "mv2_experiment_stage.h",
    "navigation_extension_enabler.cc",
    "navigation_extension_enabler.h",
    "omaha_attributes_handler.cc",
    "omaha_attributes_handler.h",
    "pack_extension_job.cc",
    "pack_extension_job.h",
    "pending_extension_info.cc",
    "pending_extension_info.h",
    "pending_extension_manager.cc",
    "pending_extension_manager.h",
    "permissions/permissions_helpers.cc",
    "permissions/permissions_helpers.h",
    "permissions/permissions_updater.cc",
    "permissions/permissions_updater.h",
    "permissions/scripting_permissions_modifier.cc",
    "permissions/scripting_permissions_modifier.h",
    "permissions/site_permissions_helper.cc",
    "permissions/site_permissions_helper.h",
    "permissions_based_management_policy_provider.cc",
    "permissions_based_management_policy_provider.h",
    "permissions_url_constants.cc",
    "permissions_url_constants.h",
    "policy_handlers.cc",
    "policy_handlers.h",
    "pref_mapping.cc",
    "pref_mapping.h",
    "pref_transformer_interface.h",
    "preference/preference_helpers.cc",
    "preference/preference_helpers.h",
    "profile_util.cc",
    "profile_util.h",
    "safe_browsing_verdict_handler.cc",
    "safe_browsing_verdict_handler.h",
    "scoped_active_install.cc",
    "scoped_active_install.h",
    "settings_api_helpers.cc",
    "settings_api_helpers.h",
    "shared_module_service.cc",
    "shared_module_service.h",
    "standard_management_policy_provider.cc",
    "standard_management_policy_provider.h",
    "startup_helper.cc",
    "startup_helper.h",
    "sync_bundle.cc",
    "sync_bundle.h",
    "system_display/display_info_provider.h",
    "tab_helper.cc",
    "tab_helper.h",
    "theme_installed_infobar_delegate.cc",
    "theme_installed_infobar_delegate.h",
    "unpacked_installer.cc",
    "unpacked_installer.h",
    "update_install_gate.cc",
    "update_install_gate.h",
    "updater/chrome_extension_downloader_factory.cc",
    "updater/chrome_extension_downloader_factory.h",
    "updater/chrome_update_client_config.cc",
    "updater/chrome_update_client_config.h",
    "updater/extension_update_client_command_line_config_policy.cc",
    "updater/extension_update_client_command_line_config_policy.h",
    "updater/extension_updater.cc",
    "updater/extension_updater.h",
    "updater/extension_updater_switches.cc",
    "updater/extension_updater_switches.h",
    "user_script_listener.cc",
    "user_script_listener.h",
    "warning_badge_service.cc",
    "warning_badge_service.h",
    "warning_badge_service_factory.cc",
    "warning_badge_service_factory.h",
    "webstore_data_fetcher.cc",
    "webstore_data_fetcher.h",
    "webstore_data_fetcher_delegate.cc",
    "webstore_data_fetcher_delegate.h",
    "webstore_install_helper.cc",
    "webstore_install_helper.h",
    "webstore_install_with_prompt.cc",
    "webstore_install_with_prompt.h",
    "webstore_installer.cc",
    "webstore_installer.h",
    "webstore_reinstaller.cc",
    "webstore_reinstaller.h",
    "webstore_standalone_installer.cc",
    "webstore_standalone_installer.h",
    "window_controller.cc",
    "window_controller.h",
    "window_controller_list.cc",
    "window_controller_list.h",
    "window_controller_list_observer.h",
  ]

  # Chrome OS does not support Native Messaging policies.
  if (!is_chromeos) {
    sources += [
      "api/messaging/native_messaging_policy_handler.cc",
      "api/messaging/native_messaging_policy_handler.h",
    ]
  }

  configs += [
    "//build/config:precompiled_headers",
    "//build/config/compiler:wexit_time_destructors",
  ]
  defines = []

  allow_circular_includes_from = [
    # TODO(b/40251079): Remove this circular dependency.
    "//chrome/browser/apps/app_service/app_icon",

    # TODO(crbug.com/40161499): Remove this circular dependency.
    "//chrome/browser/devtools",

    # Lots of APIs use headers from the list above.
    "//chrome/browser/extensions/api:api_registration",

    # TODO(crbug.com/346472679): Remove this circular dependency.
    "//chrome/browser/web_applications/extensions",

    # TODO(crbug.com/41437292): Remove this circular dependency.
    "//chrome/browser/safe_browsing",

    # TODO(crbug.com/343037853): Remove this circular dependency.
    "//chrome/browser/themes",

    # TODO(crbug.com/344921703): Remove circular dependencies.
    "//chrome/browser/sync",

    # TODO(crbug.com/345487716): Remove this circular dependency.
    "//chrome/browser/ui/views/side_panel",

    # TODO(crbug.com/353284909): Remove this circular dependency.
    "//chrome/browser/media/webrtc",

    "//chrome/browser/feedback",
    "//chrome/browser/ui/views/toolbar",
  ]

  # Since browser and browser_extensions actually depend on each other,
  # we must omit the dependency from browser_extensions to browser.
  # However, this means browser_extensions and browser should more or less
  # have the same dependencies. Once browser_extensions is untangled from
  # browser, then we can clean up these dependencies.
  public_deps = [
    "//chrome/browser:browser_public_dependencies",
    "//chrome/browser/extensions/api:api_registration",
    "//chrome/browser/media/webrtc",
    "//chrome/browser/resource_coordinator:tab_lifecycle_observer",
    "//chrome/browser/task_manager",
    "//chrome/common",
    "//chrome/common/extensions/api",
    "//components/omnibox/browser",
    "//components/safe_browsing/core/browser/db:util",
    "//components/safe_browsing/core/common/proto:csd_proto",
    "//components/safe_browsing/core/common/proto:realtimeapi_proto",
    "//components/signin/core/browser",
    "//components/translate/content/browser",
    "//content/public/browser",
    "//mojo/public/cpp/bindings",
  ]
  deps = [
    "//apps",
    "//base",
    "//build:branding_buildflags",
    "//build:chromeos_buildflags",
    "//build/config/chromebox_for_meetings:buildflags",
    "//chrome:extra_resources",
    "//chrome:resources",
    "//chrome:strings",
    "//chrome/app:command_ids",
    "//chrome/app/resources:platform_locale_settings",
    "//chrome/app/theme:chrome_unscaled_resources",
    "//chrome/app/theme:theme_resources",
    "//chrome/app/vector_icons",
    "//chrome/browser:browser_process",
    "//chrome/browser:font_pref",
    "//chrome/browser:primitives",
    "//chrome/browser/apps:user_type_filter",
    "//chrome/browser/apps/app_service:constants",
    "//chrome/browser/feedback",
    "//chrome/browser/search",
    "//chrome/browser/search/background",
    "//chrome/browser/search_engines",
    "//chrome/browser/sync",
    "//chrome/browser/themes",
    "//chrome/browser/ui:browser_navigator_params_headers",
    "//chrome/browser/ui:ui_features",
    "//chrome/browser/ui/apps",
    "//chrome/browser/ui/browser_window",
    "//chrome/browser/ui/views/side_panel",
    "//chrome/browser/ui/views/toolbar",
    "//chrome/browser/ui/zoom",

    # Only for allow_circular_includes_from
    "//chrome/browser/apps/app_service/app_icon",
    "//chrome/browser/autofill",
    "//chrome/browser/bitmap_fetcher",
    "//chrome/browser/browsing_data:constants",
    "//chrome/browser/devtools",
    "//chrome/browser/extensions:cws_item_service_proto",
    "//chrome/browser/favicon",
    "//chrome/browser/google",
    "//chrome/browser/image_decoder",
    "//chrome/browser/media/router",
    "//chrome/browser/media/router:media_router_feature",
    "//chrome/browser/media/router/discovery",
    "//chrome/browser/profiles",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/resource_coordinator:mojo_bindings",
    "//chrome/browser/safe_browsing",
    "//chrome/browser/safe_browsing:metrics_collector",
    "//chrome/browser/ui/tabs:tab_enums",
    "//chrome/browser/web_applications",
    "//components/cbor:cbor",
    "//components/commerce/core:pref_names",
    "//components/device_reauth",
    "//components/optimization_guide/core:features",
    "//components/safe_browsing/content/browser",
    "//components/safe_browsing/core/browser:safe_browsing_metrics_collector",
    "//components/saved_tab_groups:model",
    "//components/security_interstitials/content:security_interstitial_page",
    "//components/security_state/content",
    "//components/site_engagement/core/mojom:mojo_bindings",
    "//components/supervised_user/core/browser",
    "//components/supervised_user/core/common:common",
    "//components/webapps/browser",
    "//components/webapps/common",
    "//components/webauthn/json",

    # TODO(crbug.com/346472679): Remove this dependency:
    "//chrome/browser/web_applications/extensions",
    "//chrome/common/extensions/api:extensions_features",
    "//chrome/common/safe_browsing:proto",
    "//chrome/services/file_util/public/mojom:mojom",
    "//chrome/services/removable_storage_writer/public/mojom",
    "//components/affiliations/core/browser:affiliations",
    "//components/app_constants",
    "//components/autofill/content/browser",
    "//components/autofill/core/common:credit_card_number_validation",
    "//components/back_forward_cache",
    "//components/bookmarks/browser",
    "//components/bookmarks/managed",
    "//components/browser_sync",
    "//components/browsing_data/content",
    "//components/browsing_data/core",
    "//components/content_settings/core/browser",
    "//components/content_settings/core/browser:cookie_settings",
    "//components/cookie_config:cookie_config",
    "//components/crx_file",
    "//components/device_signals/core/browser",
    "//components/device_signals/core/common",
    "//components/dom_distiller/core",
    "//components/download/content/public",
    "//components/download/public/common:public",
    "//components/drive",
    "//components/embedder_support",
    "//components/embedder_support:browser_util",
    "//components/enterprise",
    "//components/enterprise/buildflags",
    "//components/enterprise/connectors/core",
    "//components/favicon/content",
    "//components/feedback",
    "//components/gcm_driver",
    "//components/guest_view/browser",
    "//components/guest_view/common:mojom",
    "//components/history/core/browser",
    "//components/history/core/common",
    "//components/infobars/content",
    "//components/infobars/core",
    "//components/javascript_dialogs",
    "//components/keyed_service/content",
    "//components/language/core/browser",
    "//components/language/core/common",
    "//components/language/core/language_model",
    "//components/live_caption:constants",
    "//components/media_device_salt",
    "//components/nacl/common:buildflags",
    "//components/navigation_interception",
    "//components/net_log",
    "//components/no_state_prefetch/browser",
    "//components/onc",
    "//components/page_load_metrics/browser:browser",
    "//components/password_manager/content/browser",
    "//components/password_manager/core/browser",
    "//components/password_manager/core/browser/export",
    "//components/password_manager/core/browser/features:password_features",
    "//components/password_manager/core/browser/import:importer",
    "//components/password_manager/core/browser/leak_detection",
    "//components/password_manager/core/browser/sharing",
    "//components/payments/core",
    "//components/performance_manager",
    "//components/permissions",
    "//components/policy:generated",
    "//components/policy/core/browser",
    "//components/pref_registry",
    "//components/privacy_sandbox:privacy_sandbox_prefs",
    "//components/privacy_sandbox:tracking_protection_prefs",
    "//components/proxy_config",
    "//components/reading_list/core",
    "//components/resources",
    "//components/safe_browsing:buildflags",
    "//components/safe_browsing/content/browser/web_ui:web_ui",
    "//components/safe_browsing/core/browser/db:database_manager",
    "//components/safe_browsing/core/common",
    "//components/safe_browsing/core/common:safe_browsing_prefs",
    "//components/safe_browsing/core/common/proto:csd_proto",
    "//components/search_engines",
    "//components/services/app_service",
    "//components/services/patch/content",
    "//components/services/unzip/content",
    "//components/services/unzip/public/cpp",
    "//components/sessions",
    "//components/signin/public/identity_manager",
    "//components/spellcheck/browser",
    "//components/storage_monitor",
    "//components/strings",
    "//components/sync",
    "//components/sync_preferences",
    "//components/sync_sessions",
    "//components/tab_groups",
    "//components/translate/content/browser",
    "//components/translate/core/browser",
    "//components/translate/core/common",
    "//components/undo",
    "//components/unified_consent",
    "//components/update_client",
    "//components/update_client:common_impl",
    "//components/url_formatter",
    "//components/url_matcher",
    "//components/user_prefs",
    "//components/vector_icons",
    "//components/web_modal",
    "//components/zoom",
    "//content/public/common",
    "//crypto",
    "//device/bluetooth",
    "//device/fido",
    "//extensions:extensions_resources",
    "//extensions/browser",
    "//extensions/browser/api/content_settings:content_settings",
    "//extensions/browser/api/storage:settings_namespace",
    "//extensions/browser/api/storage:settings_observer",
    "//extensions/browser/updater",
    "//extensions/browser/updater:keepalive",
    "//extensions/buildflags",
    "//extensions/common",
    "//extensions/common:mojom",
    "//extensions/common/api",
    "//extensions/strings",
    "//google_apis",
    "//google_apis/common:request_util",
    "//media:media_buildflags",
    "//net",
    "//pdf:buildflags",
    "//ppapi/buildflags",
    "//printing/buildflags",
    "//rlz/buildflags",
    "//services/audio/public/cpp",
    "//services/data_decoder/public/cpp",
    "//services/device/public/mojom",
    "//services/network/public/mojom",
    "//services/service_manager/public/cpp",
    "//services/service_manager/public/mojom",
    "//services/video_capture/public/mojom:constants",
    "//skia",
    "//sql",
    "//storage/browser",
    "//storage/common",
    "//third_party/abseil-cpp:absl",
    "//third_party/blink/public:resources",
    "//third_party/blink/public:scaled_resources",
    "//third_party/blink/public/common",
    "//third_party/icu",
    "//third_party/leveldatabase",
    "//third_party/libaddressinput:util",
    "//third_party/re2",
    "//third_party/zlib/google:compression_utils",
    "//third_party/zlib/google:zip",
    "//ui/accessibility:ax_enums_mojo",
    "//ui/base",
    "//ui/base:ozone_buildflags",
    "//ui/base/clipboard",
    "//ui/base/dragdrop/mojom:mojom_shared",
    "//ui/base/idle",
    "//ui/base/ime",
    "//ui/gfx",
    "//ui/gfx/geometry",
    "//ui/message_center",
    "//ui/message_center/public/cpp",
    "//ui/native_theme",
    "//ui/resources",
    "//ui/shell_dialogs",
    "//ui/strings",
    "//url",
  ]

  if (is_linux || is_mac || is_win) {
    sources += [
      "api/system_indicator/system_indicator_api.cc",
      "api/system_indicator/system_indicator_api.h",
      "api/system_indicator/system_indicator_manager.cc",
      "api/system_indicator/system_indicator_manager.h",
      "api/system_indicator/system_indicator_manager_factory.cc",
      "api/system_indicator/system_indicator_manager_factory.h",
    ]

    deps += [ "//components/device_signals/core/common:features" ]
  }

  if (is_chromeos) {
    sources += [
      "api/certificate_provider/certificate_provider_api.cc",
      "api/certificate_provider/certificate_provider_api.h",
      "api/enterprise_device_attributes/enterprise_device_attributes_api.cc",
      "api/enterprise_device_attributes/enterprise_device_attributes_api.h",
      "api/enterprise_kiosk_input/enterprise_kiosk_input_api.cc",
      "api/enterprise_kiosk_input/enterprise_kiosk_input_api.h",
      "api/enterprise_networking_attributes/enterprise_networking_attributes_api.cc",
      "api/enterprise_networking_attributes/enterprise_networking_attributes_api.h",
      "api/enterprise_platform_keys/enterprise_platform_keys_api.cc",
      "api/enterprise_platform_keys/enterprise_platform_keys_api.h",
      "api/file_system/consent_provider_impl.cc",
      "api/file_system/consent_provider_impl.h",
      "api/file_system/request_file_system_notification.cc",
      "api/file_system/request_file_system_notification.h",
      "api/messaging/native_message_built_in_host.cc",
      "api/messaging/native_message_built_in_host.h",
      "api/messaging/native_message_echo_host.cc",
      "api/messaging/native_message_echo_host.h",
      "api/passwords_private/passwords_private_utils_chromeos.cc",
      "api/passwords_private/passwords_private_utils_chromeos.h",
      "api/platform_keys/platform_keys_api.cc",
      "api/platform_keys/platform_keys_api.h",
      "api/platform_keys/verify_trust_api.cc",
      "api/platform_keys/verify_trust_api.h",
      "api/shared_storage/shared_storage_private_api.h",

      # TODO(crbug.com/40230380): Find an appropriate spot for this.
      "api/chromeos_api_browser_context_keyed_service_factories.cc",
      "api/chromeos_api_browser_context_keyed_service_factories.h",
      "clipboard_extension_helper_chromeos.cc",
      "clipboard_extension_helper_chromeos.h",
      "extension_keeplist_chromeos.cc",
      "extension_keeplist_chromeos.h",
      "file_handlers/web_file_handlers_permission_handler.cc",
      "file_handlers/web_file_handlers_permission_handler.h",
      "system_display/display_info_provider_chromeos.cc",
      "system_display/display_info_provider_chromeos.h",
      "system_display/display_info_provider_utils.cc",
      "system_display/display_info_provider_utils.h",
    ]
    deps += [
      "//chrome/browser/chromeos/extensions/desk_api",
      "//chrome/browser/chromeos/extensions/login_screen/login/external_logout_request",
      "//chrome/browser/chromeos/extensions/login_screen/login_state",
      "//chrome/browser/chromeos/platform_keys",
      "//chrome/browser/chromeos/policy/dlp",
      "//chrome/browser/chromeos/upload_office_to_cloud",
      "//chrome/browser/ui/chromeos",
      "//chromeos/components/kiosk",
      "//chromeos/components/mgs",
    ]
    if (use_cups) {
      sources += [
        "api/printing/print_job_submitter.cc",
        "api/printing/print_job_submitter.h",
        "api/printing/printing_api.cc",
        "api/printing/printing_api.h",
        "api/printing/printing_api_handler.cc",
        "api/printing/printing_api_handler.h",
        "api/printing/printing_api_utils.cc",
        "api/printing/printing_api_utils.h",
      ]

      deps += [
        # TODO(crbug.com/40230380): Find an appropriate spot for printing_metrics.
        "//chrome/browser/chromeos/extensions/printing_metrics",
        "//chrome/browser/chromeos/printing",
        "//chrome/browser/pdf:pdf_pref_names",
        "//chromeos/printing",
        "//printing/backend",
      ]
    }
    deps += [
      "//chrome/browser/chromeos/app_mode",
      "//chrome/browser/chromeos/drivefs",
      "//chrome/browser/chromeos/drivefs:native_message_host_origins",
      "//chrome/browser/chromeos/extensions:constants",
      "//chrome/browser/chromeos/extensions/file_system_provider",
      "//chrome/browser/chromeos/extensions/login_screen/login/cleanup",
      "//chrome/browser/chromeos/extensions/smart_card_provider_private:smart_card_provider_private",

      # TODO(crbug.com/40230380): Find an appropriate spot for vpn_provider.
      "//chrome/browser/chromeos/extensions/contact_center_insights",
      "//chrome/browser/chromeos/extensions/vpn_provider",
      "//chrome/browser/chromeos/extensions/wm",
      "//chromeos/components/disks:prefs",
      "//chromeos/components/quick_answers/public/cpp:prefs",
      "//chromeos/components/security_token_pin",
      "//chromeos/constants",
      "//chromeos/crosapi/cpp",
      "//chromeos/crosapi/mojom",
      "//chromeos/dbus/missive:missive",
      "//chromeos/dbus/power",
      "//chromeos/services/chromebox_for_meetings/public/cpp",
      "//chromeos/services/chromebox_for_meetings/public/mojom",
      "//remoting/host/it2me:chrome_os_host",
    ]

    allow_circular_includes_from += [
      "//chrome/browser/chromeos/app_mode",
      "//chrome/browser/chromeos/drivefs",
      "//chrome/browser/chromeos/extensions/contact_center_insights",
      "//chrome/browser/chromeos/extensions/desk_api",
      "//chrome/browser/chromeos/extensions/file_system_provider",
      "//chrome/browser/chromeos/extensions/login_screen/login/cleanup",
    ]
  } else {
    sources += [
      "api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc",
      "api/enterprise_reporting_private/chrome_desktop_report_request_helper.h",
      "api/image_writer_private/operation_nonchromeos.cc",
      "api/messaging/launch_context.cc",
      "api/messaging/launch_context.h",
      "api/messaging/native_message_process_host.cc",
      "api/messaging/native_message_process_host.h",
      "api/messaging/native_messaging_launch_from_native.cc",
      "api/messaging/native_messaging_launch_from_native.h",
      "api/messaging/native_process_launcher.cc",
      "api/messaging/native_process_launcher.h",
      "chrome_kiosk_delegate.cc",
      "preinstalled_apps.cc",
      "preinstalled_apps.h",
    ]
    deps += [
      "//components/enterprise",
      "//components/enterprise/common/proto:connectors_proto",
      "//components/keep_alive_registry",
    ]
    if (is_posix) {
      sources += [ "api/messaging/launch_context_posix.cc" ]
    }
    if (use_gio) {
      configs += [ "//build/linux:gio_config" ]
    }
  }

  if (is_chromeos_ash) {
    sources += [
      "api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.cc",
      "api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.h",
      "api/file_handlers/non_native_file_system_delegate_chromeos.cc",
      "api/file_handlers/non_native_file_system_delegate_chromeos.h",
      "api/file_system/chrome_file_system_delegate_ash.cc",
      "api/file_system/chrome_file_system_delegate_ash.h",
      "api/identity/launch_web_auth_flow_delegate_ash.cc",
      "api/identity/launch_web_auth_flow_delegate_ash.h",
      "api/image_writer_private/operation_chromeos.cc",
      "api/image_writer_private/removable_storage_provider_chromeos.cc",
      "api/input_ime/input_ime_api.cc",
      "api/input_ime/input_ime_api.h",
      "api/input_ime/input_ime_api_chromeos.cc",
      "api/input_ime/input_ime_api_chromeos.h",
      "api/media_perception_private/media_perception_api_delegate_chromeos.cc",
      "api/media_perception_private/media_perception_api_delegate_chromeos.h",
      "api/messaging/native_message_host_chromeos.cc",
      "api/networking_private/networking_private_ui_delegate_chromeos.cc",
      "api/networking_private/networking_private_ui_delegate_chromeos.h",
      "api/quick_unlock_private/quick_unlock_private_api.cc",
      "api/quick_unlock_private/quick_unlock_private_api.h",
      "api/quick_unlock_private/quick_unlock_private_ash_utils.cc",
      "api/quick_unlock_private/quick_unlock_private_ash_utils.h",
      "api/settings_private/chromeos_resolve_time_zone_by_geolocation_method_short.cc",
      "api/settings_private/chromeos_resolve_time_zone_by_geolocation_method_short.h",
      "api/settings_private/chromeos_resolve_time_zone_by_geolocation_on_off.cc",
      "api/settings_private/chromeos_resolve_time_zone_by_geolocation_on_off.h",
      "api/settings_private/generated_time_zone_pref_base.cc",
      "api/settings_private/generated_time_zone_pref_base.h",
      "api/shared_storage/shared_storage_private_api_ash.cc",
      "api/terminal/startup_status.cc",
      "api/terminal/startup_status.h",
      "api/terminal/terminal_private_api.cc",
      "api/terminal/terminal_private_api.h",
      "api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc",
      "api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.h",
      "ash_extension_keeplist_manager.cc",
      "ash_extension_keeplist_manager.h",
      "chrome_kiosk_delegate_chromeos.cc",
      "extension_assets_manager_chromeos.cc",
      "extension_assets_manager_chromeos.h",
      "extension_garbage_collector_chromeos.cc",
      "extension_garbage_collector_chromeos.h",
      "updater/chromeos_extension_cache_delegate.cc",
      "updater/chromeos_extension_cache_delegate.h",
      "updater/extension_cache_impl.cc",
      "updater/extension_cache_impl.h",
      "updater/local_extension_cache.cc",
      "updater/local_extension_cache.h",
    ]

    if (use_dbus) {
      configs += [ "//build/config/linux/dbus" ]
    }

    deps += [
      "//ash",
      "//ash/components/arc",
      "//ash/constants",
      "//ash/keyboard/ui:resources_grit_grit",
      "//ash/public/cpp",
      "//ash/webui/camera_app_ui",
      "//ash/webui/camera_app_ui:mojo_bindings",
      "//ash/webui/file_manager/untrusted_resources:file_manager_untrusted_resources",
      "//ash/webui/resources:media_app_bundle_resources_grit",
      "//ash/webui/settings/public/constants:mojom",
      "//chrome/browser/ash/accessibility",
      "//chrome/browser/ash/account_manager",
      "//chrome/browser/ash/app_list",
      "//chrome/browser/ash/app_list/app_service",
      "//chrome/browser/ash/app_mode",
      "//chrome/browser/ash/app_mode/web_app",
      "//chrome/browser/ash/app_restore",
      "//chrome/browser/ash/arc",
      "//chrome/browser/ash/arc/accessibility",
      "//chrome/browser/ash/arc/extensions",
      "//chrome/browser/ash/arc/optin",
      "//chrome/browser/ash/attestation",
      "//chrome/browser/ash/bruschetta",
      "//chrome/browser/ash/child_accounts",
      "//chrome/browser/ash/child_accounts/time_limits",
      "//chrome/browser/ash/crosapi:browser_util",
      "//chrome/browser/ash/crostini",
      "//chrome/browser/ash/crostini:crostini_installer_types_mojom",
      "//chrome/browser/ash/crostini/throttle",
      "//chrome/browser/ash/customization",
      "//chrome/browser/ash/drive",
      "//chrome/browser/ash/extensions",
      "//chrome/browser/ash/extensions/autotest_private",
      "//chrome/browser/ash/extensions/file_manager",
      "//chrome/browser/ash/extensions/speech",
      "//chrome/browser/ash/extensions/users_private",
      "//chrome/browser/ash/file_manager",
      "//chrome/browser/ash/file_system_provider",
      "//chrome/browser/ash/fileapi",
      "//chrome/browser/ash/guest_os",
      "//chrome/browser/ash/guest_os/public",
      "//chrome/browser/ash/guest_os/virtual_machines",
      "//chrome/browser/ash/input_method",
      "//chrome/browser/ash/login",
      "//chrome/browser/ash/login/app_mode",
      "//chrome/browser/ash/login/demo_mode",
      "//chrome/browser/ash/login/quick_unlock",
      "//chrome/browser/ash/login/session",
      "//chrome/browser/ash/login/ui",
      "//chrome/browser/ash/net",
      "//chrome/browser/ash/ownership",
      "//chrome/browser/ash/platform_keys",
      "//chrome/browser/ash/plugin_vm",
      "//chrome/browser/ash/policy/core",
      "//chrome/browser/ash/policy/handlers",
      "//chrome/browser/ash/printing",
      "//chrome/browser/ash/profiles",
      "//chrome/browser/ash/remote_apps",
      "//chrome/browser/ash/settings",
      "//chrome/browser/ash/system_logs",
      "//chrome/browser/ash/system_web_apps/apps",
      "//chrome/browser/devtools",
      "//chrome/browser/nearby_sharing/common",
      "//chrome/browser/ui/ash/keyboard",
      "//chrome/browser/ui/ash/media_client",
      "//chrome/browser/ui/ash/shelf/app_service",
      "//chrome/browser/ui/ash/thumbnail_loader",
      "//chrome/browser/ui/webui/ash",
      "//chrome/browser/ui/webui/ash/login",
      "//chrome/browser/ui/webui/ash/settings/pages/a11y",
      "//chromeos/ash/components/attestation",
      "//chromeos/ash/components/browser_context_helper",
      "//chromeos/ash/components/cryptohome",
      "//chromeos/ash/components/dbus",
      "//chromeos/ash/components/dbus/attestation:attestation_proto",
      "//chromeos/ash/components/dbus/cicerone:cicerone",
      "//chromeos/ash/components/dbus/cicerone:cicerone_proto",
      "//chromeos/ash/components/dbus/constants",
      "//chromeos/ash/components/dbus/cros_disks",
      "//chromeos/ash/components/dbus/cryptohome",
      "//chromeos/ash/components/dbus/image_burner",
      "//chromeos/ash/components/dbus/update_engine",
      "//chromeos/ash/components/disks",
      "//chromeos/ash/components/enhanced_network_tts",
      "//chromeos/ash/components/enhanced_network_tts/mojom",
      "//chromeos/ash/components/language_packs",
      "//chromeos/ash/components/language_packs/public/mojom",
      "//chromeos/ash/components/login/auth",
      "//chromeos/ash/components/login/login_state",
      "//chromeos/ash/components/network",
      "//chromeos/ash/components/osauth/public",
      "//chromeos/ash/components/proximity_auth",
      "//chromeos/ash/components/settings",
      "//chromeos/ash/components/system",
      "//chromeos/ash/components/tether:tether",
      "//chromeos/ash/components/tpm",
      "//chromeos/ash/services/assistant/public/cpp",
      "//chromeos/ash/services/ime/public/mojom",
      "//chromeos/components/remote_apps/mojom",
      "//chromeos/process_proxy",
      "//chromeos/services/machine_learning/public/cpp",
      "//chromeos/services/machine_learning/public/mojom",
      "//chromeos/services/media_perception/public/mojom",
      "//chromeos/services/tts/public/mojom",
      "//chromeos/ui/base",
      "//chromeos/version",
      "//components/constrained_window",
      "//components/crash/content/browser/error_reporting",
      "//components/drive",
      "//components/user_manager",
      "//media/capture:capture_lib",
      "//media/capture/video/chromeos/mojom:cros_camera",
      "//remoting/host",
      "//third_party/protobuf:protobuf_lite",
      "//ui/accessibility",
      "//ui/base/ime/ash",
      "//ui/chromeos",
      "//ui/display/manager",
      "//ui/events/ash",
      "//ui/file_manager:file_manager_gen_resources",
      "//ui/file_manager:resources",
      "//ui/ozone",
      "//ui/views",
    ]

    allow_circular_includes_from += [
      "//chrome/browser/ash/accessibility",
      "//chrome/browser/ash/account_manager",
      "//chrome/browser/ash/attestation",
      "//chrome/browser/ash/app_list",
      "//chrome/browser/ash/app_list/app_service",
      "//chrome/browser/ash/app_mode",
      "//chrome/browser/ash/app_mode/web_app",
      "//chrome/browser/ash/app_restore",
      "//chrome/browser/ash/arc",
      "//chrome/browser/ash/arc/optin",
      "//chrome/browser/ash/bruschetta",
      "//chrome/browser/ash/child_accounts",
      "//chrome/browser/ash/child_accounts/time_limits",
      "//chrome/browser/ash/crostini",
      "//chrome/browser/ash/customization",
      "//chrome/browser/ash/drive",
      "//chrome/browser/ash/extensions",
      "//chrome/browser/ash/extensions/autotest_private",
      "//chrome/browser/ash/extensions/file_manager",
      "//chrome/browser/ash/extensions/speech",
      "//chrome/browser/ash/extensions/users_private",
      "//chrome/browser/ash/file_manager",
      "//chrome/browser/ash/file_system_provider",
      "//chrome/browser/ash/fileapi",
      "//chrome/browser/ash/guest_os",
      "//chrome/browser/ash/guest_os/public",
      "//chrome/browser/ash/guest_os/virtual_machines",
      "//chrome/browser/ash/input_method",
      "//chrome/browser/ash/login",
      "//chrome/browser/ash/login/app_mode",
      "//chrome/browser/ash/login/demo_mode",
      "//chrome/browser/ash/login/quick_unlock",
      "//chrome/browser/ash/login/session",
      "//chrome/browser/ash/login/ui",
      "//chrome/browser/ash/net",
      "//chrome/browser/ash/platform_keys",
      "//chrome/browser/ash/policy/core",
      "//chrome/browser/ash/policy/handlers",
      "//chrome/browser/ash/system_web_apps/apps",
      "//chrome/browser/ash/system_logs",
      "//chrome/browser/ui/ash/shelf/app_service",
      "//chrome/browser/ui/ash/thumbnail_loader",
      "//chrome/browser/ui/webui/ash",
      "//chrome/browser/ui/webui/ash/login",
      "//chrome/browser/ui/webui/ash/settings/pages/a11y",
    ]

    if (is_cfm) {
      deps += [
        "//chrome/browser/ash/chromebox_for_meetings/xu_camera",
        "//chromeos/ash/components/chromebox_for_meetings",
      ]
    }
  }

  if (is_chromeos_lacros) {
    sources += [
      "api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc",
      "api/enterprise_reporting_private/chrome_desktop_report_request_helper.h",
      "api/file_browser_handler/file_browser_handler_flow_lacros.cc",
      "api/file_browser_handler/file_browser_handler_flow_lacros.h",
      "api/file_system/chrome_file_system_delegate_lacros.cc",
      "api/file_system/chrome_file_system_delegate_lacros.h",
      "api/file_system/volume_list_provider_lacros.cc",
      "api/file_system/volume_list_provider_lacros.h",
      "api/image_writer_private/image_writer_controller_lacros.cc",
      "api/image_writer_private/image_writer_controller_lacros.h",
      "api/image_writer_private/operation_nonchromeos.cc",
      "api/messaging/native_message_host_lacros.cc",
      "api/quick_unlock_private/quick_unlock_private_api_lacros.cc",
      "api/quick_unlock_private/quick_unlock_private_api_lacros.h",
      "api/shared_storage/shared_storage_private_api_lacros.cc",
      "api/virtual_keyboard_private/lacros_virtual_keyboard_delegate.cc",
      "api/virtual_keyboard_private/lacros_virtual_keyboard_delegate.h",
      "chrome_kiosk_delegate.cc",
      "preinstalled_apps.cc",
      "preinstalled_apps.h",
    ]
    deps += [
      "//chromeos/lacros",
      "//chromeos/startup",
      "//chromeos/ui/base",
      "//components/enterprise",
      "//components/enterprise/common/proto:connectors_proto",
      "//components/keep_alive_registry",
    ]
  }

  if (use_ozone) {
    deps += [ "//ui/ozone" ]
    sources += [
      "global_shortcut_listener_ozone.cc",
      "global_shortcut_listener_ozone.h",
    ]
  }

  if (is_mac) {
    sources += [
      "api/enterprise_reporting_private/keychain_data_helper_mac.cc",
      "api/enterprise_reporting_private/keychain_data_helper_mac.h",
      "api/image_writer_private/removable_storage_provider_mac.cc",
      "global_shortcut_listener_mac.h",
      "global_shortcut_listener_mac.mm",
      "system_display/display_info_provider_mac.cc",
      "system_display/display_info_provider_mac.h",
    ]
  }

  if (is_linux || is_chromeos_lacros) {
    sources +=
        [ "api/image_writer_private/removable_storage_provider_linux.cc" ]
  }

  if (is_linux || is_chromeos) {
    deps += [ "//third_party/fontconfig" ]

    if (use_dbus) {
      deps += [ "//dbus" ]
    }
    if (use_udev) {
      deps += [ "//device/udev_linux" ]
    }
  }

  if (is_win) {
    sources += [
      "api/image_writer_private/removable_storage_provider_win.cc",
      "api/messaging/launch_context_win.cc",
      "external_registry_loader_win.cc",
      "external_registry_loader_win.h",
      "global_shortcut_listener_win.cc",
      "global_shortcut_listener_win.h",
      "system_display/display_info_provider_win.cc",
      "system_display/display_info_provider_win.h",
    ]
    deps += [
      "//components/app_launch_prefetch",
      "//components/device_signals/core/common/win",
      "//third_party/iaccessible2",
      "//third_party/isimpledom",
    ]
    libs = [
      "setupapi.lib",
      "propsys.lib",
    ]
  } else if (use_aura && !is_chromeos) {
    sources += [
      "system_display/display_info_provider_aura.cc",
      "system_display/display_info_provider_aura.h",
    ]
  }

  if (enable_plugins) {
    sources += [
      "plugin_manager.cc",
      "plugin_manager.h",
    ]
  }

  if (enable_printing && (is_win || is_mac || is_linux || is_chromeos)) {
    # TODO(crbug.com/40183776)  Replace this with more accurate dependency
    # once //chrome/browser/printing build is able to be cleanly targeted.
    deps += [ "//chrome/services/printing/public/mojom" ]
  }

  if (enable_pdf) {
    deps += [
      "//chrome/browser/pdf",
      "//components/pdf/browser",
      "//components/pdf/common:util",
      "//pdf:buildflags",
      "//pdf:features",
    ]
  }

  if (enable_rlz_support) {
    deps += [ "//rlz:rlz_lib" ]
  }

  if (toolkit_views) {
    deps += [ "//ui/views" ]
  }

  if (use_aura) {
    deps += [
      "//chrome/browser/ui/aura/accessibility",
      "//ui/aura",
    ]
  }

  if (use_brlapi) {
    sources += [
      "api/braille_display_private/braille_controller_brlapi.cc",
      "api/braille_display_private/brlapi_connection.cc",
      "api/braille_display_private/brlapi_connection.h",
      "api/braille_display_private/brlapi_keycode_map.cc",
      "api/braille_display_private/brlapi_keycode_map.h",
    ]
    deps += [ "//third_party/libbrlapi" ]
  } else {
    sources += [ "api/braille_display_private/braille_controller_stub.cc" ]
  }

  if (enterprise_data_controls) {
    deps += [
      "//components/enterprise/buildflags",
      "//components/enterprise/data_controls/core/browser",
    ]
  }
}

# KeyedService factories initialization.
source_set("keyed_service_factories") {
  sources = [
    "browser_context_keyed_service_factories.cc",
    "browser_context_keyed_service_factories.h",
    "chrome_browser_context_keyed_service_factories.cc",
    "chrome_browser_context_keyed_service_factories.h",
  ]

  deps = [
    "//chrome/browser/extensions",
    "//chrome/browser/extensions/api:keyed_service_factories",
  ]
}

proto_library("cws_item_service_proto") {
  sources = [ "cws_item_service.proto" ]
}

static_library("test_support") {
  testonly = true

  sources = [
    "api/messaging/native_messaging_test_util.cc",
    "api/messaging/native_messaging_test_util.h",
    "api/passwords_private/test_passwords_private_delegate.cc",
    "api/passwords_private/test_passwords_private_delegate.h",
    "chrome_extension_test_notification_observer.cc",
    "chrome_extension_test_notification_observer.h",
    "chrome_test_extension_loader.cc",
    "chrome_test_extension_loader.h",
    "extension_action_test_util.cc",
    "extension_action_test_util.h",
    "extension_management_test_util.cc",
    "extension_management_test_util.h",
    "external_testing_loader.cc",
    "external_testing_loader.h",
    "fake_crx_installer.cc",
    "fake_crx_installer.h",
    "load_error_waiter.cc",
    "load_error_waiter.h",
    "menu_manager_test_observer.cc",
    "menu_manager_test_observer.h",
    "mock_crx_installer.cc",
    "mock_crx_installer.h",
    "mock_extension_special_storage_policy.cc",
    "mock_extension_special_storage_policy.h",
    "scoped_database_manager_for_test.cc",
    "scoped_database_manager_for_test.h",
    "scoped_test_mv2_enabler.cc",
    "scoped_test_mv2_enabler.h",
    "test_blocklist.cc",
    "test_blocklist.h",
    "test_blocklist_state_fetcher.cc",
    "test_blocklist_state_fetcher.h",
    "test_extension_service.cc",
    "test_extension_service.h",
    "test_extension_system.cc",
    "test_extension_system.h",
  ]

  deps = [
    ":extensions",
    "//base",
    "//chrome/browser",
    "//chrome/browser:test_support",
    "//chrome/browser/profiles:profile",
    "//chrome/browser/ui",
    "//components/crx_file",
    "//components/policy/core/common:test_support",
    "//components/safe_browsing/core/browser/db:database_manager",
    "//components/safe_browsing/core/browser/db:v4_test_util",
    "//components/services/unzip:in_process",
    "//components/services/unzip/content",
    "//components/sessions",
    "//components/value_store:test_support",
    "//content/public/browser",
    "//content/test:test_support",
    "//extensions:test_support",
    "//extensions/browser",
    "//extensions/browser:test_support",
    "//services/data_decoder/public/cpp:test_support",
  ]

  if (is_chromeos) {
    sources += [
      "api/document_scan/document_scan_test_utils.cc",
      "api/document_scan/document_scan_test_utils.h",
    ]
  }

  if (is_chromeos_ash) {
    deps += [ "//components/user_manager:test_support" ]
  }
}

fuzzer_test("extension_management_internal_fuzzer") {
  sources = [ "extension_management_internal_fuzzer.cc" ]
  deps = [
    ":extensions",
    "//base",
    "//third_party/icu/fuzzers:fuzzer_support",

    # While //c/b/extensions should've been sufficient, there are cyclic
    # dependencies that require us linking against the whole //c/b.
    "//chrome/browser",

    # Pull test-specific stubs for symbols needed by //c/b.
    "//chrome/test:test_support",
  ]
}