# Copyright 2014 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/features.gni") import("//build/config/jumbo.gni") import("//extensions/buildflags/buildflags.gni") assert(enable_extensions) group("browser") { public_deps = [ "//extensions/browser:browser_context_keyed_service_factories", "//extensions/browser:browser_sources", "//extensions/browser/api:api_registration", ] # Includes all API implementations and the ExtensionsApiClient # interface. Moving an API from src/chrome to src/extensions implies # it can be cleanly disabled with enable_extensions=false. public_deps += [ "//extensions/browser/api" ] } # Isolate the instantiation of BrowserContextKeyedServiceFactories. source_set("browser_context_keyed_service_factories") { visibility = [ ":*" ] sources = [ "browser_context_keyed_service_factories.cc", "browser_context_keyed_service_factories.h", ] deps = [ "//extensions/browser:browser_sources", "//extensions/browser/api", ] } jumbo_source_set("browser_sources") { visibility = [ "./*" ] sources = [ "api_activity_monitor.cc", "api_activity_monitor.h", "app_sorting.h", "app_window/app_delegate.h", "app_window/app_web_contents_helper.cc", "app_window/app_web_contents_helper.h", "app_window/app_window.cc", "app_window/app_window.h", "app_window/app_window_client.cc", "app_window/app_window_client.h", "app_window/app_window_contents.cc", "app_window/app_window_contents.h", "app_window/app_window_geometry_cache.cc", "app_window/app_window_geometry_cache.h", "app_window/app_window_registry.cc", "app_window/app_window_registry.h", "app_window/native_app_window.h", "app_window/size_constraints.cc", "app_window/size_constraints.h", "bad_message.cc", "bad_message.h", "blacklist_state.h", "blob_holder.cc", "blob_holder.h", "blob_reader.cc", "blob_reader.h", "blocked_action_type.h", "browser_context_keyed_api_factory.h", "component_extension_resource_manager.h", "computed_hashes.cc", "computed_hashes.h", "content_hash_fetcher.cc", "content_hash_fetcher.h", "content_hash_reader.cc", "content_hash_reader.h", "content_hash_tree.cc", "content_hash_tree.h", "content_verifier.cc", "content_verifier.h", "content_verifier/content_hash.cc", "content_verifier/content_hash.h", "content_verifier/content_verifier_key.h", "content_verifier_delegate.h", "content_verifier_io_data.cc", "content_verifier_io_data.h", "content_verify_job.cc", "content_verify_job.h", "crx_file_info.cc", "crx_file_info.h", "declarative_user_script_manager.cc", "declarative_user_script_manager.h", "declarative_user_script_manager_factory.cc", "declarative_user_script_manager_factory.h", "declarative_user_script_master.cc", "declarative_user_script_master.h", "deferred_start_render_host.h", "deferred_start_render_host_observer.h", "device_local_account_util.cc", "device_local_account_util.h", "disable_reason.h", "error_map.cc", "error_map.h", "event_listener_map.cc", "event_listener_map.h", "event_page_tracker.h", "event_router.cc", "event_router.h", "event_router_factory.cc", "event_router_factory.h", "events/lazy_event_dispatch_util.cc", "events/lazy_event_dispatch_util.h", "events/lazy_event_dispatcher.cc", "events/lazy_event_dispatcher.h", "extension_api_frame_id_map.cc", "extension_api_frame_id_map.h", "extension_creator.cc", "extension_creator.h", "extension_creator_filter.cc", "extension_creator_filter.h", "extension_dialog_auto_confirm.cc", "extension_dialog_auto_confirm.h", "extension_error.cc", "extension_error.h", "extension_file_task_runner.cc", "extension_file_task_runner.h", "extension_function.cc", "extension_function.h", "extension_function_constants.cc", "extension_function_constants.h", "extension_function_dispatcher.cc", "extension_function_dispatcher.h", "extension_function_registry.cc", "extension_function_registry.h", "extension_host.cc", "extension_host.h", "extension_host_delegate.h", "extension_host_observer.h", "extension_host_queue.h", "extension_icon_image.cc", "extension_icon_image.h", "extension_icon_placeholder.cc", "extension_icon_placeholder.h", "extension_message_filter.cc", "extension_message_filter.h", "extension_navigation_throttle.cc", "extension_navigation_throttle.h", "extension_navigation_ui_data.cc", "extension_navigation_ui_data.h", "extension_pref_store.cc", "extension_pref_store.h", "extension_pref_value_map.cc", "extension_pref_value_map.h", "extension_pref_value_map_factory.cc", "extension_pref_value_map_factory.h", "extension_prefs.cc", "extension_prefs.h", "extension_prefs_factory.cc", "extension_prefs_factory.h", "extension_prefs_observer.h", "extension_prefs_scope.h", "extension_protocols.cc", "extension_protocols.h", "extension_registrar.cc", "extension_registrar.h", "extension_registry.cc", "extension_registry.h", "extension_registry_factory.cc", "extension_registry_factory.h", "extension_registry_observer.h", "extension_request_limiting_throttle.cc", "extension_request_limiting_throttle.h", "extension_service_worker_message_filter.cc", "extension_service_worker_message_filter.h", "extension_system.cc", "extension_system.h", "extension_system_provider.cc", "extension_system_provider.h", "extension_throttle_entry.cc", "extension_throttle_entry.h", "extension_throttle_entry_interface.h", "extension_throttle_manager.cc", "extension_throttle_manager.h", "extension_user_script_loader.cc", "extension_user_script_loader.h", "extension_util.cc", "extension_util.h", "extension_web_contents_observer.cc", "extension_web_contents_observer.h", "extension_zoom_request_client.cc", "extension_zoom_request_client.h", "extensions_browser_client.cc", "extensions_browser_client.h", "external_install_info.cc", "external_install_info.h", "external_provider_interface.h", "file_highlighter.cc", "file_highlighter.h", "file_reader.cc", "file_reader.h", "granted_file_entry.cc", "granted_file_entry.h", "guest_view/app_view/app_view_constants.cc", "guest_view/app_view/app_view_constants.h", "guest_view/app_view/app_view_guest.cc", "guest_view/app_view/app_view_guest.h", "guest_view/app_view/app_view_guest_delegate.cc", "guest_view/app_view/app_view_guest_delegate.h", "guest_view/extension_options/extension_options_constants.cc", "guest_view/extension_options/extension_options_constants.h", "guest_view/extension_options/extension_options_guest.cc", "guest_view/extension_options/extension_options_guest.h", "guest_view/extension_options/extension_options_guest_delegate.cc", "guest_view/extension_options/extension_options_guest_delegate.h", "guest_view/extension_view/extension_view_constants.cc", "guest_view/extension_view/extension_view_constants.h", "guest_view/extension_view/extension_view_guest.cc", "guest_view/extension_view/extension_view_guest.h", "guest_view/extension_view/whitelist/extension_view_whitelist.cc", "guest_view/extension_view/whitelist/extension_view_whitelist.h", "guest_view/extensions_guest_view_manager_delegate.cc", "guest_view/extensions_guest_view_manager_delegate.h", "guest_view/extensions_guest_view_message_filter.cc", "guest_view/extensions_guest_view_message_filter.h", "guest_view/guest_view_events.cc", "guest_view/guest_view_events.h", "guest_view/mime_handler_view/mime_handler_stream_manager.cc", "guest_view/mime_handler_view/mime_handler_stream_manager.h", "guest_view/mime_handler_view/mime_handler_view_constants.cc", "guest_view/mime_handler_view/mime_handler_view_constants.h", "guest_view/mime_handler_view/mime_handler_view_guest.cc", "guest_view/mime_handler_view/mime_handler_view_guest.h", "guest_view/mime_handler_view/mime_handler_view_guest_delegate.cc", "guest_view/mime_handler_view/mime_handler_view_guest_delegate.h", # TODO(crbug.com/730220): Ideally web_view should be a separate target on # which the extension system depends. "guest_view/web_view/javascript_dialog_helper.cc", "guest_view/web_view/javascript_dialog_helper.h", "guest_view/web_view/web_view_constants.cc", "guest_view/web_view/web_view_constants.h", "guest_view/web_view/web_view_content_script_manager.cc", "guest_view/web_view/web_view_content_script_manager.h", "guest_view/web_view/web_view_find_helper.cc", "guest_view/web_view/web_view_find_helper.h", "guest_view/web_view/web_view_guest.cc", "guest_view/web_view/web_view_guest.h", "guest_view/web_view/web_view_guest_delegate.h", "guest_view/web_view/web_view_permission_helper.cc", "guest_view/web_view/web_view_permission_helper.h", "guest_view/web_view/web_view_permission_helper_delegate.cc", "guest_view/web_view/web_view_permission_helper_delegate.h", "guest_view/web_view/web_view_permission_types.h", "guest_view/web_view/web_view_renderer_state.cc", "guest_view/web_view/web_view_renderer_state.h", "image_loader.cc", "image_loader.h", "image_loader_factory.cc", "image_loader_factory.h", "image_sanitizer.cc", "image_sanitizer.h", "info_map.cc", "info_map.h", "install_flag.h", "io_thread_extension_message_filter.cc", "io_thread_extension_message_filter.h", "json_file_sanitizer.cc", "json_file_sanitizer.h", "lazy_background_task_queue.cc", "lazy_background_task_queue.h", "lazy_background_task_queue_factory.cc", "lazy_background_task_queue_factory.h", "lazy_context_id.cc", "lazy_context_id.h", "lazy_context_task_queue.h", "load_monitoring_extension_host_queue.cc", "load_monitoring_extension_host_queue.h", "management_policy.cc", "management_policy.h", "media_capture_util.cc", "media_capture_util.h", "mojo/interface_registration.cc", "mojo/interface_registration.h", "mojo/keep_alive_impl.cc", "mojo/keep_alive_impl.h", "notification_types.cc", "notification_types.h", "null_app_sorting.cc", "null_app_sorting.h", "path_util.cc", "path_util.h", "policy_check.cc", "policy_check.h", "pref_names.cc", "pref_names.h", "preload_check.cc", "preload_check.h", "preload_check_group.cc", "preload_check_group.h", "process_manager.cc", "process_manager.h", "process_manager_delegate.h", "process_manager_factory.cc", "process_manager_factory.h", "process_manager_observer.h", "process_map.cc", "process_map.h", "process_map_factory.cc", "process_map_factory.h", "quota_service.cc", "quota_service.h", "renderer_startup_helper.cc", "renderer_startup_helper.h", "requirements_checker.cc", "requirements_checker.h", "runtime_data.cc", "runtime_data.h", "sandboxed_unpacker.cc", "sandboxed_unpacker.h", "script_execution_observer.h", "script_executor.cc", "script_executor.h", "serial_extension_host_queue.cc", "serial_extension_host_queue.h", "service_worker_manager.cc", "service_worker_manager.h", "service_worker_task_queue.cc", "service_worker_task_queue.h", "service_worker_task_queue_factory.cc", "service_worker_task_queue_factory.h", "shared_user_script_master.cc", "shared_user_script_master.h", "state_store.cc", "state_store.h", "suggest_permission_util.cc", "suggest_permission_util.h", "uninstall_ping_sender.cc", "uninstall_ping_sender.h", "uninstall_reason.h", "update_observer.h", "url_request_util.cc", "url_request_util.h", "user_script_loader.cc", "user_script_loader.h", "verified_contents.cc", "verified_contents.h", "view_type_utils.cc", "view_type_utils.h", "warning_service.cc", "warning_service.h", "warning_service_factory.cc", "warning_service_factory.h", "warning_set.cc", "warning_set.h", "web_ui_user_script_loader.cc", "web_ui_user_script_loader.h", "zipfile_installer.cc", "zipfile_installer.h", ] deps = [ "//base:i18n", "//components/cast_certificate", "//components/cast_channel", "//components/crx_file", "//components/crx_file:crx_creator", "//components/guest_view/browser", "//components/keyed_service/content", "//components/keyed_service/core", "//components/pref_registry", "//components/prefs", "//components/sessions", "//components/sync", "//components/update_client", "//components/update_client", "//components/variations", "//components/version_info", "//components/web_cache/browser", "//components/web_modal", "//components/zoom", "//content/public/browser", "//crypto:platform", "//crypto:platform", "//extensions:extensions_browser_resources", "//extensions/browser/guest_view/web_view/web_ui", "//extensions/buildflags", "//extensions/common", "//extensions/common/api", "//extensions/strings", "//google_apis", "//ppapi/buildflags", "//services/device/public/mojom", "//services/preferences/public/cpp", "//services/service_manager/public/cpp", "//ui/display", ] public_deps = [ "//content/public/common", "//extensions/browser/install", "//extensions/browser/kiosk", "//extensions/browser/updater", "//extensions/browser/value_store", "//ipc", ] configs += [ "//build/config:precompiled_headers", # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. "//build/config/compiler:no_size_t_to_int_warning", ] } source_set("browser_tests") { testonly = true sources = [ "api/audio/audio_apitest.cc", # TODO(michaelpg): bluetooth_appshell_test.cc is a crutch until we have a # better system for testing APIs in both app_shell and chrome. See # crbug.com/650835. "api/bluetooth/bluetooth_appshell_test.cc", "api/bluetooth_socket/bluetooth_socket_apitest.cc", "api/display_source/display_source_apitest.cc", "api/display_source/display_source_apitestbase.cc", "api/display_source/display_source_apitestbase.h", "api/dns/dns_apitest.cc", "api/feedback_private/feedback_private_apitest.cc", "api/hid/hid_apitest.cc", "api/printer_provider/printer_provider_apitest.cc", "api/socket/socket_apitest.cc", "api/sockets_tcp/sockets_tcp_apitest.cc", "api/sockets_tcp_server/sockets_tcp_server_apitest.cc", "api/sockets_udp/sockets_udp_apitest.cc", "api/system_cpu/system_cpu_apitest.cc", "api/system_display/system_display_apitest.cc", "api/system_memory/system_memory_apitest.cc", "api/system_network/system_network_apitest.cc", "api/system_storage/storage_api_test_util.cc", "api/system_storage/storage_api_test_util.h", "api/system_storage/system_storage_apitest.cc", "api/system_storage/system_storage_eject_apitest.cc", "api/usb/usb_apitest.cc", "browsertest_util_browsertest.cc", "guest_view/app_view/app_view_apitest.cc", "guest_view/web_view/web_view_apitest.cc", "guest_view/web_view/web_view_apitest.h", "guest_view/web_view/web_view_media_access_apitest.cc", ] defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] deps = [ ":browser", "//base", "//components/guest_view/browser:test_support", "//components/storage_monitor:test_support", "//content/test:test_support", "//device/base:mocks", "//device/bluetooth:mocks", "//device/usb:test_support", "//extensions:test_support", "//extensions/browser:test_support", "//extensions/common", "//extensions/common/api", "//extensions/shell:app_shell_lib", "//extensions/shell:browser_tests", "//net:test_support", "//services/device/public/cpp/hid", "//services/device/public/mojom", "//services/service_manager/public/cpp", "//ui/display:test_support", ] if (is_mac) { # Needed for App Shell.app's Helper. deps += [ "//extensions/shell:app_shell" ] } if (is_chromeos) { sources += [ "api/cec_private/cec_private_apitest.cc", "api/media_perception_private/media_perception_private_apitest.cc", "api/virtual_keyboard/virtual_keyboard_apitest.cc", ] deps += [ "//chromeos", "//chromeos:media_perception_proto", ] } } jumbo_source_set("test_support") { testonly = true sources = [ "browsertest_util.cc", "browsertest_util.h", "preload_check_test_util.cc", "preload_check_test_util.h", "value_store/test_value_store_factory.cc", "value_store/test_value_store_factory.h", "value_store/testing_value_store.cc", "value_store/testing_value_store.h", ] deps = [ "//base", "//content/public/browser", "//extensions/browser", "//extensions/browser/api/declarative_net_request:test_support", "//extensions/common", "//extensions/common:test_support", "//testing/gtest", ] } source_set("unit_tests") { testonly = true sources = [ "api/alarms/alarms_api_unittest.cc", "api/api_resource_manager_unittest.cc", "api/bluetooth/bluetooth_event_router_unittest.cc", "api/bluetooth_socket/bluetooth_socket_api_unittest.cc", "api/cast_channel/cast_channel_api_unittest.cc", "api/cast_channel/cast_channel_enum_util_unittest.cc", "api/declarative/declarative_rule_unittest.cc", "api/declarative/deduping_factory_unittest.cc", "api/declarative/rules_registry_unittest.cc", "api/declarative_net_request/flat_ruleset_indexer_unittest.cc", "api/declarative_net_request/indexed_rule_unittest.cc", "api/declarative_webrequest/webrequest_condition_attribute_unittest.cc", "api/declarative_webrequest/webrequest_condition_unittest.cc", "api/document_scan/document_scan_api_unittest.cc", "api/document_scan/document_scan_interface_chromeos_unittest.cc", "api/document_scan/mock_document_scan_interface.cc", "api/document_scan/mock_document_scan_interface.h", "api/file_handlers/app_file_handler_util_unittest.cc", "api/file_handlers/directory_util_unittest.cc", "api/file_handlers/mime_util_unittest.cc", "api/idle/idle_api_unittest.cc", "api/mime_handler_private/mime_handler_private_unittest.cc", "api/networking_config/networking_config_service_chromeos_unittest.cc", "api/networking_private/networking_private_chromeos_unittest.cc", "api/power/power_api_unittest.cc", "api/runtime/restart_after_delay_api_unittest.cc", "api/sockets_tcp/sockets_tcp_api_unittest.cc", "api/sockets_udp/sockets_udp_api_unittest.cc", "api/storage/settings_quota_unittest.cc", "api/storage/storage_api_unittest.cc", "api/storage/storage_frontend_unittest.cc", "api/system_network/system_network_api_unittest.cc", "api/web_request/form_data_parser_unittest.cc", "api/web_request/upload_data_presenter_unittest.cc", "api/web_request/web_request_permissions_unittest.cc", "api/web_request/web_request_time_tracker_unittest.cc", "app_window/app_window_geometry_cache_unittest.cc", "computed_hashes_unittest.cc", "content_hash_fetcher_unittest.cc", "content_hash_tree_unittest.cc", "content_verifier_unittest.cc", "content_verify_job_unittest.cc", "error_map_unittest.cc", "event_listener_map_unittest.cc", "event_router_unittest.cc", "extension_api_frame_id_map_unittest.cc", "extension_creator_filter_unittest.cc", "extension_icon_image_unittest.cc", "extension_pref_value_map_unittest.cc", "extension_registrar_unittest.cc", "extension_registry_unittest.cc", "extension_throttle_simulation_unittest.cc", "extension_throttle_test_support.cc", "extension_throttle_test_support.h", "extension_throttle_unittest.cc", "file_highlighter_unittest.cc", "file_reader_unittest.cc", "image_loader_unittest.cc", "image_sanitizer_unittest.cc", "info_map_unittest.cc", "json_file_sanitizer_unittest.cc", "lazy_background_task_queue_unittest.cc", "load_monitoring_extension_host_queue_unittest.cc", "management_policy_unittest.cc", "mojo/keep_alive_impl_unittest.cc", "path_util_unittest.cc", "policy_check_unittest.cc", "preload_check_group_unittest.cc", "process_manager_unittest.cc", "process_map_unittest.cc", "quota_service_unittest.cc", "renderer_startup_helper_unittest.cc", "requirements_checker_unittest.cc", "runtime_data_unittest.cc", "sandboxed_unpacker_unittest.cc", "updater/extension_installer_unittest.cc", "updater/safe_manifest_parser_unittest.cc", "updater/update_data_provider_unittest.cc", "updater/update_service_unittest.cc", "value_store/leveldb_scoped_database_unittest.cc", "value_store/leveldb_value_store_unittest.cc", "value_store/testing_value_store_unittest.cc", "value_store/value_store_change_unittest.cc", "value_store/value_store_frontend_unittest.cc", "value_store/value_store_unittest.cc", "value_store/value_store_unittest.h", "verified_contents_unittest.cc", "warning_service_unittest.cc", ] deps = [ ":browser", ":test_support", "//base", "//base/test:test_support", "//components/cast_certificate", "//components/cast_certificate:test_support", "//components/cast_certificate/proto:unittest_proto", "//components/crx_file", "//components/keyed_service/content", "//components/onc", "//components/pref_registry:pref_registry", "//components/prefs:test_support", "//components/services/unzip:lib", "//components/services/unzip/public/cpp:test_support", "//components/sync_preferences:test_support", "//components/update_client", "//components/url_matcher", "//components/user_prefs", "//components/version_info", "//content/test:test_support", "//device/bluetooth:mocks", "//extensions:extensions_browser_resources", "//extensions:test_support", "//extensions/buildflags", "//extensions/common", "//extensions/common/api", "//extensions/strings", "//ipc:test_support", "//net:test_support", "//services/data_decoder:lib", "//services/data_decoder/public/cpp:test_support", "//services/device/public/mojom", "//services/service_manager/public/cpp/test:test_support", "//storage/browser:test_support", "//third_party/leveldatabase", "//third_party/zlib/google:zip", ] if (is_chromeos) { sources += [ "api/audio/audio_device_id_calculator_unittest.cc", "api/feedback_private/access_rate_limiter_chromeos_unittest.cc", "api/feedback_private/feedback_private_api_chromeos_unittest.cc", "api/feedback_private/feedback_private_api_unittest_base_chromeos.cc", "api/feedback_private/feedback_private_api_unittest_base_chromeos.h", "api/feedback_private/log_source_access_manager_chromeos_unittest.cc", "api/lock_screen_data/data_item_unittest.cc", "api/lock_screen_data/lock_screen_item_storage_unittest.cc", "api/lock_screen_data/lock_screen_value_store_migrator_impl_unittest.cc", "api/media_perception_private/conversion_utils_unittest.cc", "api/media_perception_private/media_perception_api_manager_unittest.cc", "api/webcam_private/visca_webcam_unittest.cc", ] deps += [ "//chromeos:media_perception_proto", "//chromeos:test_support", "//components/feedback", "//extensions/shell:app_shell_lib", ] } }