# Copyright 2016 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//build/config/apple/swift_source_set.gni") import("//build/config/ios/ios_sdk.gni") if (enable_swift_cxx_interop) { # TODO(crbug.com/478110569): Remove `if (has_swift_6_3_support)` as soon as # the FYI bots running with enable_swift_cxx_interop = true are updated to # Swift 6.3. if (has_swift_6_3_support) { swift_cxx_import("cxx_imports") { # TODO(crbug.com/451945291): Use a shim layer instead of the direct # dependency to C++ files. sources = [ "//ios/chrome/browser/menu/ui_bundled/menu_histograms.h" ] public_deps = [ "//ios/chrome/browser/menu/ui_bundled:menu_action_type" ] } swift_source_set("swift_coordinator") { bridge_header = "bridge_header.h" sources = [ "swift_history_coordinator_impl.swift" ] frameworks = [ "UIKit.framework" ] cxx_import_deps = [ ":cxx_imports" ] deps = [ ":coordinator", ":ui", "//base", "//ios/chrome/browser/shared/ui/table_view", ] } } } source_set("coordinator_factory") { sources = [ "history_coordinator_factory.h", "history_coordinator_factory.mm", ] deps = [ ":coordinator", "//build/config/ios:swift_buildflags", ] if (enable_swift_cxx_interop) { # TODO(crbug.com/478110569): Remove `if (has_swift_6_3_support)` as soon as # the FYI bots running with enable_swift_cxx_interop = true are updated to # Swift 6.3. if (has_swift_6_3_support) { deps += [ ":swift_coordinator", "//ios/chrome/common/swift:features", ] # TODO(crbug.com/456806155): Find a better solution to suppress errors # from chromium clang on headers that come from the iOS SDK. Ideally, we'd # want a suppression that is inherited implicitly from swift_source_set # dependencies. Unfortunately, the gn language does not allow child # targets to do things like `invoker.configs -= [...]`. Also, we'd ideally # want a suppression that is scoped to just the SDK headers rather than # the entire target that includes the headers. We can't use the # "build/config/compiler:no_chromium_code" config to solve this problem # because we don't have any build targets that have the SDK headers as # direct sources. if (is_clang) { configs -= [ "//build/config/clang:find_bad_constructs" ] } } } } source_set("coordinator") { sources = [ "base_history_coordinator+subclassing.h", "base_history_coordinator.h", "base_history_coordinator.mm", "history_coordinator.h", "history_coordinator.mm", "history_coordinator_delegate.h", "history_coordinator_impl.h", "history_coordinator_impl.mm", "history_mediator.h", "history_mediator.mm", ] deps = [ ":history_driver", ":ui", "//base", "//components/browser_sync", "//components/history/core/browser", "//ios/chrome/browser/favicon/model", "//ios/chrome/browser/history/model", "//ios/chrome/browser/history/ui_bundled/public", "//ios/chrome/browser/menu/ui_bundled", "//ios/chrome/browser/net/model:crurl", "//ios/chrome/browser/policy/model:policy_util", "//ios/chrome/browser/shared/coordinator/alert", "//ios/chrome/browser/shared/coordinator/chrome_coordinator", "//ios/chrome/browser/shared/model/browser", "//ios/chrome/browser/shared/model/profile", "//ios/chrome/browser/shared/public/commands", "//ios/chrome/browser/shared/ui/table_view", "//ios/chrome/browser/sharing/ui_bundled", "//ios/chrome/browser/sync/model", "//ios/chrome/common/ui/favicon:favicon_constants", ] frameworks = [ "MobileCoreServices.framework", "QuartzCore.framework", "UIKit.framework", ] } source_set("constants") { sources = [ "history_ui_constants.h", "history_ui_constants.mm", ] } source_set("ui") { sources = [ "base_history_view_controller+subclassing.h", "base_history_view_controller.h", "base_history_view_controller.mm", "history_consumer.h", "history_entry_inserter.h", "history_entry_inserter.mm", "history_entry_item.h", "history_entry_item.mm", "history_entry_item_delegate.h", "history_entry_item_interface.h", "history_menu_provider.h", "history_table_view_controller.h", "history_table_view_controller.mm", "history_table_view_controller_delegate.h", "history_util.h", "history_util.mm", ] deps = [ ":constants", "public", "//base", "//base:i18n", "//components/history/core/browser", "//components/strings", "//components/url_formatter", "//ios/chrome/app:tests_hook", "//ios/chrome/app/strings", "//ios/chrome/browser/drag_and_drop/model", "//ios/chrome/browser/history/ui_bundled/resources", "//ios/chrome/browser/keyboard/ui_bundled", "//ios/chrome/browser/metrics/model:metrics_internal", "//ios/chrome/browser/net/model:crurl", "//ios/chrome/browser/policy/model:policy_util", "//ios/chrome/browser/shared/coordinator/alert", "//ios/chrome/browser/shared/model/browser", "//ios/chrome/browser/shared/model/profile", "//ios/chrome/browser/shared/model/url:constants", "//ios/chrome/browser/shared/model/web_state_list", "//ios/chrome/browser/shared/public/commands", "//ios/chrome/browser/shared/public/features", "//ios/chrome/browser/shared/ui/list_model", "//ios/chrome/browser/shared/ui/table_view", "//ios/chrome/browser/shared/ui/table_view:utils", "//ios/chrome/browser/shared/ui/table_view/cells", "//ios/chrome/browser/shared/ui/table_view/content_configuration", "//ios/chrome/browser/shared/ui/util", "//ios/chrome/browser/sync/model", "//ios/chrome/browser/url_loading/model", "//ios/chrome/browser/window_activities/model", "//ios/chrome/common/ui/colors", "//ios/chrome/common/ui/favicon", "//ios/chrome/common/ui/table_view:cells_constants", "//ios/chrome/common/ui/util", "//ios/web/public", "//ui/base", "//ui/strings", ] } source_set("history_driver") { sources = [ "ios_browsing_history_driver.h", "ios_browsing_history_driver.mm", "ios_browsing_history_driver_delegate.h", "ios_browsing_history_driver_delegate_bridge.h", "ios_browsing_history_driver_delegate_bridge.mm", ] deps = [ ":ui", "//base", "//components/browsing_data/core", "//components/history/core/browser", "//ios/chrome/browser/history/model:utils", "//url", ] } source_set("test_support") { sources = [ "stub_history_coordinator_delegate.h", "stub_history_coordinator_delegate.mm", ] deps = [ ":coordinator" ] } source_set("unit_tests") { testonly = true sources = [ "base_history_view_controller_unittest.mm", "history_entry_inserter_unittest.mm", ] deps = [ ":ui", "//base", "//base/test:test_support", "//components/history/core/browser", "//ios/chrome/browser/net/model:crurl", "//ios/chrome/browser/shared/model/browser/test:test_support", "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/browser/shared/ui/list_model", "//ios/chrome/browser/shared/ui/table_view", "//ios/chrome/browser/shared/ui/table_view:test_support", "//ios/chrome/common/ui/favicon", "//ios/chrome/test:test_support", "//ios/web/public/test", "//testing/gtest", "//third_party/ocmock", "//url", ] frameworks = [ "UIKit.framework" ] } source_set("eg2_tests") { configs += [ "//build/config/ios:xctest_config" ] testonly = true sources = [ "history_system_egtest.mm", "history_ui_egtest.mm", ] deps = [ ":constants", "//base", "//components/browsing_data/core", "//components/sync/base", "//components/url_formatter", "//ios/chrome/app/strings", "//ios/chrome/browser/authentication/test:eg_test_support+eg2", "//ios/chrome/browser/menu/ui_bundled:menu_action_type", "//ios/chrome/browser/metrics/model:eg_test_support+eg2", "//ios/chrome/browser/popup_menu/public", "//ios/chrome/browser/shared/public/features", "//ios/chrome/browser/shared/ui/table_view:constants", "//ios/chrome/browser/signin/model:fake_system_identity", "//ios/chrome/common:string_util", "//ios/chrome/test/earl_grey:eg_test_support+eg2", "//ios/testing/earl_grey:eg_test_support+eg2", "//net:test_support", ] frameworks = [ "UIKit.framework" ] }