# Copyright 2016 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("//ios/web/js_compile.gni") source_set("web") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ "dom_altering_lock.h", "dom_altering_lock.mm", "error_page_util.h", "error_page_util.mm", "font_size_tab_helper.h", "font_size_tab_helper.mm", "image_fetch_tab_helper.h", "image_fetch_tab_helper.mm", "invalid_url_tab_helper.h", "invalid_url_tab_helper.mm", "load_timing_tab_helper.h", "load_timing_tab_helper.mm", "repost_form_tab_helper.h", "repost_form_tab_helper.mm", "sad_tab_tab_helper.h", "sad_tab_tab_helper.mm", "web_navigation_util.h", "web_navigation_util.mm", "web_state_delegate_tab_helper.h", "web_state_delegate_tab_helper.mm", ] deps = [ ":feature_flags", ":page_placeholder", ":tab_helper_delegates", "//base", "//components/error_page/common", "//components/image_fetcher/ios", "//components/pref_registry", "//components/resources:components_resources_grit", "//components/resources:dev_ui_components_resources_grit", "//components/search_engines", "//components/strings", "//components/ukm/ios:ukm_url_recorder", "//ios/chrome/app/strings:ios_strings_grit", "//ios/chrome/browser", "//ios/chrome/browser/browser_state", "//ios/chrome/browser/ntp", "//ios/chrome/browser/overlays", "//ios/chrome/browser/overlays/public/web_content_area", "//ios/chrome/browser/snapshots", "//ios/chrome/browser/ui/commands", "//ios/chrome/browser/ui/dialogs:dialogs_internal", "//ios/chrome/browser/ui/elements", "//ios/chrome/browser/ui/fullscreen", "//ios/chrome/browser/ui/util", "//ios/chrome/common/ui/util", "//ios/components/ui_util", "//ios/components/webui:url_constants", "//ios/net", "//ios/public/provider/chrome/browser:browser", "//ios/web", "//ios/web/common", "//ios/web/public/js_messaging", "//services/metrics/public/cpp:ukm_builders", "//ui/base", "//url", ] public_deps = [ ":tab_id_tab_helper" ] } source_set("page_placeholder") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ "page_placeholder_tab_helper.h", "page_placeholder_tab_helper.mm", ] deps = [ "//base", "//ios/chrome/browser/snapshots", "//ios/chrome/browser/ui/elements", "//ios/chrome/browser/ui/util", "//ios/chrome/common/ui/util", "//ios/net", "//ios/web", ] } source_set("tab_id_tab_helper") { sources = [ "tab_id_tab_helper.h", "tab_id_tab_helper.mm", ] deps = [ "//base", "//ios/web/public", "//ios/web/public/session", ] configs += [ "//build/config/compiler:enable_arc" ] } source_set("tab_helper_delegates") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ "repost_form_tab_helper_delegate.h", "sad_tab_tab_helper_delegate.h", ] } source_set("unit_tests") { configs += [ "//build/config/compiler:enable_arc" ] testonly = true sources = [ "error_page_util_unittest.mm", "font_size_js_unittest.mm", "font_size_tab_helper_unittest.mm", "image_fetch_js_unittest.mm", "image_fetch_tab_helper_unittest.mm", "invalid_url_tab_helper_unittest.mm", "load_timing_tab_helper_unittest.mm", "page_placeholder_tab_helper_unittest.mm", "repost_form_tab_helper_unittest.mm", "sad_tab_tab_helper_unittest.mm", "tab_id_tab_helper_unittest.mm", "web_navigation_util_unittest.mm", "web_state_delegate_tab_helper_unittest.mm", ] deps = [ ":accessibility", ":image_fetch", ":page_placeholder", ":tab_helper_delegates", ":test_support", ":web", ":web_internal", "//base", "//base/test:test_support", "//components/search_engines", "//components/strings:components_strings_grit", "//components/sync_preferences:sync_preferences", "//components/sync_preferences:test_support", "//ios/chrome/browser", "//ios/chrome/browser/browser_state:test_support", "//ios/chrome/browser/ntp", "//ios/chrome/browser/overlays", "//ios/chrome/browser/overlays/public/web_content_area", "//ios/chrome/browser/prefs:browser_prefs", "//ios/chrome/browser/snapshots", "//ios/chrome/browser/ui/util", "//ios/chrome/browser/web:feature_flags", "//ios/chrome/test:test_support", "//ios/net", "//ios/net:test_support", "//ios/web", "//ios/web/public/test", "//ios/web/public/test/fakes", "//ios/web/public/test/http_server", "//net:test_support", "//services/network:test_support", "//testing/gmock", "//testing/gtest", "//third_party/ocmock", "//ui/base", "//url:url", ] } js_compile_bundle("chrome_bundle_all_frames") { closure_entry_point = "__crWeb.chromeBundleAllFrames" sources = [ "//components/autofill/ios/browser/resources/autofill_controller.js", "//components/autofill/ios/browser/resources/suggestion_controller.js", "//components/autofill/ios/form_util/resources/fill.js", "//components/autofill/ios/form_util/resources/form.js", "//components/autofill/ios/form_util/resources/form_handlers.js", "resources/accessibility.js", "resources/chrome_bundle_all_frames.js", "resources/console.js", "resources/print.js", ] } js_compile_bundle("chrome_bundle_main_frame") { closure_entry_point = "__crWeb.chromeBundleMainFrame" sources = [ "//components/password_manager/ios/resources/password_controller.js", "//ios/chrome/browser/link_to_text/resources/link_to_text.js", "//ios/chrome/browser/search_engines/resources/search_engine.js", "//third_party/text-fragments-polyfill/src/src/fragment-generation-utils.js", "//third_party/text-fragments-polyfill/src/src/text-fragment-utils.js", "resources/chrome_bundle_main_frame.js", "resources/image_fetch.js", ] } js_compile_checked("accessibility") { sources = [ "resources/accessibility.js" ] } js_compile_checked("image_fetch") { sources = [ "resources/image_fetch.js" ] } source_set("java_script_console") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ "java_script_console/java_script_console_message.cc", "java_script_console/java_script_console_message.h", "java_script_console/java_script_console_tab_helper.h", "java_script_console/java_script_console_tab_helper.mm", "java_script_console/java_script_console_tab_helper_delegate.h", ] deps = [ "//base", "//ios/web/public", "//ios/web/public/js_messaging", ] frameworks = [ "Foundation.framework" ] } source_set("web_internal") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ "blocked_popup_tab_helper.h", "blocked_popup_tab_helper.mm", "chrome_web_client.h", "chrome_web_client.mm", "print_tab_helper.h", "print_tab_helper.mm", "web_state_printer.h", ] deps = [ ":chrome_bundle_all_frames", ":chrome_bundle_main_frame", ":web", "//base", "//components/content_settings/core/browser", "//components/dom_distiller/core", "//components/google/core/common", "//components/infobars/core", "//components/payments/core", "//components/prefs", "//components/resources", "//components/strings", "//components/version_info", "//ios/chrome/app/resources:ios_resources", "//ios/chrome/app/strings", "//ios/chrome/browser", "//ios/chrome/browser:browser_impl", "//ios/chrome/browser/browser_state", "//ios/chrome/browser/content_settings", "//ios/chrome/browser/infobars", "//ios/chrome/browser/infobars:public", "//ios/chrome/browser/passwords", "//ios/chrome/browser/reading_list", "//ios/chrome/browser/safe_browsing", "//ios/chrome/browser/ssl", "//ios/chrome/browser/ui:feature_flags", "//ios/chrome/browser/ui/elements", "//ios/chrome/browser/ui/infobars/coordinators", "//ios/chrome/browser/ui/util", "//ios/chrome/browser/web:feature_flags", "//ios/components/security_interstitials", "//ios/components/security_interstitials/legacy_tls", "//ios/components/security_interstitials/lookalikes", "//ios/components/webui:url_constants", "//ios/net", "//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser/voice", "//ios/web", "//ios/web/common", "//ios/web/common:user_agent", "//ios/web/public", "//ios/web/public/js_messaging", "//net", "//services/metrics/public/cpp:metrics_cpp", "//ui/base", "//ui/gfx", "//url", ] public_deps = [ ":java_script_console" ] frameworks = [ "UIKit.framework", "Foundation.framework", ] } source_set("test_support") { configs += [ "//build/config/compiler:enable_arc" ] testonly = true sources = [ "chrome_web_test.h", "chrome_web_test.mm", ] deps = [ "//components/password_manager/core/browser:test_support", "//ios/chrome/browser/browser_state:test_support", "//ios/chrome/browser/passwords", "//ios/chrome/browser/web", "//ios/web", "//ios/web/public/test", ] } source_set("unit_tests_internal") { configs += [ "//build/config/compiler:enable_arc" ] testonly = true sources = [ "blocked_popup_tab_helper_unittest.mm", "chrome_web_client_unittest.mm", "java_script_console/java_script_console_tab_helper_unittest.mm", ] deps = [ ":feature_flags", ":test_support", ":web_internal", "//base", "//base/test:test_support", "//components/captive_portal/core", "//components/content_settings/core/browser", "//components/infobars/core", "//components/lookalikes/core", "//components/payments/core", "//components/safe_browsing/ios/browser:allow_list", "//components/security_interstitials/core:unsafe_resource", "//components/strings:components_strings_grit", "//ios/chrome/browser", "//ios/chrome/browser/browser_state:test_support", "//ios/chrome/browser/content_settings:content_settings", "//ios/chrome/browser/find_in_page", "//ios/chrome/browser/infobars", "//ios/chrome/browser/infobars:public", "//ios/chrome/browser/passwords", "//ios/chrome/browser/safe_browsing", "//ios/chrome/browser/ssl", "//ios/chrome/browser/web", "//ios/chrome/test/fakes", "//ios/components/security_interstitials", "//ios/components/security_interstitials/legacy_tls", "//ios/components/security_interstitials/lookalikes", "//ios/net", "//ios/web/common:features", "//ios/web/common:web_view_creation_util", "//ios/web/public/test", "//ios/web/public/test/fakes", "//net", "//net:test_support", "//services/network:test_support", "//testing/gtest", "//third_party/ocmock", "//ui/base", "//url", ] } source_set("constants") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ "lookalike_url_constants.h", "lookalike_url_constants.mm", ] } source_set("eg_test_support+eg2") { defines = [ "CHROME_EARL_GREY_2" ] configs += [ "//build/config/compiler:enable_arc", "//build/config/ios:xctest_config", ] testonly = true sources = [ "lookalike_url_app_interface.h", "progress_indicator_app_interface.h", ] deps = [ "//ios/chrome/test/earl_grey:eg_test_support+eg2", "//ios/third_party/earl_grey2:test_lib", ] } source_set("eg_app_support+eg2") { configs += [ "//build/config/compiler:enable_arc", "//build/config/ios:xctest_config", ] testonly = true defines = [ "CHROME_EARL_GREY_2" ] sources = [ "lookalike_url_app_interface.h", "lookalike_url_app_interface.mm", "progress_indicator_app_interface.h", "progress_indicator_app_interface.mm", ] deps = [ ":constants", "//base", "//components/lookalikes/core", "//ios/chrome/test/app:test_support", "//ios/components/security_interstitials/lookalikes", "//ios/testing/earl_grey:eg_app_support+eg2", "//ios/third_party/earl_grey2:app_framework+link", "//ios/third_party/material_components_ios", "//ios/web/public", "//net", ] } source_set("eg2_tests") { defines = [ "CHROME_EARL_GREY_2" ] configs += [ "//build/config/compiler:enable_arc", "//build/config/ios:xctest_config", ] testonly = true sources = [ "browsing_egtest.mm", "browsing_prevent_default_egtest.mm", "cache_egtest.mm", "child_window_open_by_dom_egtest.mm", "content_mode_egtest.mm", "error_page_egtest.mm", "forms_egtest.mm", "http_auth_egtest.mm", "js_print_egtest.mm", "legacy_tls_egtest.mm", "lookalike_url_egtest.mm", "navigation_egtest.mm", "progress_indicator_egtest.mm", "push_and_replace_state_navigation_egtest.mm", "restore_egtest.mm", "ssl_egtest.mm", "stop_loading_egtest.mm", "tab_order_egtest.mm", "visible_url_egtest.mm", "web_share_egtest.mm", "window_open_by_dom_egtest.mm", ] deps = [ ":constants", ":eg_test_support+eg2", "//components/content_settings/core/common", "//components/strings", "//components/url_formatter", "//components/version_info:version_info", "//ios/chrome/app/strings", "//ios/chrome/browser:chrome_url_constants", "//ios/chrome/browser/ui/infobars/banners:public", "//ios/chrome/browser/ui/popup_menu:constants", "//ios/chrome/browser/ui/tab_switcher/tab_grid:features", "//ios/chrome/test:eg_test_support+eg2", "//ios/chrome/test/earl_grey:eg_test_support+eg2", "//ios/net:test_support", "//ios/testing:embedded_test_server_support", "//ios/testing/earl_grey:eg_test_support+eg2", "//ios/third_party/earl_grey2:test_lib", "//ios/web/common:features", "//ios/web/public/test:element_selector", "//ios/web/public/test/http_server", "//net:test_support", "//ui/base", "//url", ] frameworks = [ "UIKit.framework" ] } source_set("perf_tests") { configs += [ "//build/config/compiler:enable_arc" ] testonly = true sources = [ "early_page_script_perftest.mm" ] deps = [ "//base", "//base/test:test_support", "//ios/chrome/browser/browser_state:test_support", "//ios/chrome/test/base:perf_test_support", "//ios/third_party/webkit", "//ios/web/common:web_view_creation_util", "//ios/web/public/test", ] } source_set("feature_flags") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ "features.cc", "features.h", ] deps = [ "//base" ] }