| # 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("//build/buildflag_header.gni") |
| import("//build/config/ios/swift_source_set.gni") |
| import("//ios/build/chrome_build.gni") |
| |
| source_set("util") { |
| configs += [ "//build/config/compiler:enable_arc" ] |
| sources = [ |
| "accessibility_close_menu_button.h", |
| "accessibility_close_menu_button.mm", |
| "animation_util.h", |
| "animation_util.mm", |
| "dynamic_type_util.h", |
| "dynamic_type_util.mm", |
| "force_touch_long_press_gesture_recognizer.h", |
| "force_touch_long_press_gesture_recognizer.mm", |
| "i18n_string.h", |
| "i18n_string.mm", |
| "keyboard_observer_helper.h", |
| "keyboard_observer_helper.mm", |
| "layout_guide_names.h", |
| "layout_guide_names.mm", |
| "named_guide.h", |
| "named_guide.mm", |
| "named_guide_util.h", |
| "named_guide_util.mm", |
| "optional_property_animator.h", |
| "optional_property_animator.mm", |
| "page_animation_util.h", |
| "page_animation_util.mm", |
| "pasteboard_util.h", |
| "pasteboard_util.mm", |
| "property_animator_group.h", |
| "property_animator_group.mm", |
| "reversed_animation.h", |
| "reversed_animation.mm", |
| "rtl_geometry.h", |
| "rtl_geometry.mm", |
| "top_view_controller.h", |
| "top_view_controller.mm", |
| "transparent_link_button.h", |
| "transparent_link_button.mm", |
| "ui_util.h", |
| "ui_util.mm", |
| "uikit_ui_util.h", |
| "uikit_ui_util.mm", |
| "unicode_util.h", |
| "unicode_util.mm", |
| ] |
| deps = [ |
| "//base", |
| "//base:i18n", |
| "//ios/chrome/app:tests_hook", |
| "//ios/chrome/app/strings:ios_strings_grit", |
| "//ios/chrome/browser:utils", |
| "//ios/chrome/browser/ui:feature_flags", |
| "//ios/chrome/common:timing", |
| "//ios/chrome/common/ui/util", |
| "//ios/chrome/common/ui/util:dynamic_type_util", |
| "//ios/web:threads", |
| "//ios/web/common:uikit", |
| "//ios/web/public/thread:thread", |
| "//ios/web/thread", |
| "//net", |
| "//ui/base", |
| "//ui/gfx", |
| "//url", |
| ] |
| frameworks = [ |
| "Accelerate.framework", |
| "CoreGraphics.framework", |
| "QuartzCore.framework", |
| ] |
| } |
| |
| swift_source_set("util_swift") { |
| bridge_header = "util_swift_bridge.h" |
| sources = [ |
| "UIView+WindowCoordinates.swift", |
| "UIView+WindowObserving.swift", |
| "frame_layout_guide.swift", |
| "layout_guide_center.swift", |
| ] |
| deps = [ ":crbug_1316061" ] |
| frameworks = [ "UIKit.framework" ] |
| } |
| |
| # TODO(crbug.com/1316061): This target is just a pretext to force swiftc to |
| # import the `util_swift_bridge.h` bridging header, and transitively, |
| # UIKit/UIKit.h. |
| source_set("crbug_1316061") { |
| configs += [ "//build/config/compiler:enable_arc" ] |
| sources = [ |
| "crbug_1316061_view.h", |
| "crbug_1316061_view.mm", |
| ] |
| frameworks = [ "UIKit.framework" ] |
| } |
| |
| source_set("terms_util") { |
| configs += [ "//build/config/compiler:enable_arc" ] |
| sources = [ |
| "terms_util.h", |
| "terms_util.mm", |
| ] |
| deps = [ |
| ":terms_resources", |
| "//base", |
| "//ios/chrome/app/strings", |
| "//ios/chrome/browser", |
| "//ui/base", |
| "//url", |
| ] |
| } |
| |
| source_set("url_with_title") { |
| configs += [ "//build/config/compiler:enable_arc" ] |
| sources = [ |
| "url_with_title.h", |
| "url_with_title.mm", |
| ] |
| deps = [ "//url" ] |
| } |
| |
| source_set("unit_tests") { |
| configs += [ "//build/config/compiler:enable_arc" ] |
| testonly = true |
| sources = [ |
| "force_touch_long_press_gesture_recognizer_unittest.mm", |
| "frame_layout_guide_unittest.mm", |
| "layout_guide_center_unittest.mm", |
| "named_guide_unittest.mm", |
| "optional_property_animator_unittest.mm", |
| "pasteboard_util_unittest.mm", |
| "terms_util_unittest.mm", |
| "ui_util_unittest.mm", |
| "uikit_ui_util_unittest.mm", |
| "uiview_window_coordinates_unittest.mm", |
| "uiview_window_observing_unittest.mm", |
| ] |
| deps = [ |
| ":terms_util", |
| ":util", |
| ":util_swift", |
| "//base", |
| "//base/test:test_support", |
| "//ios/third_party/material_components_ios", |
| "//testing/gtest", |
| "//third_party/ocmock", |
| "//ui/base", |
| "//url", |
| ] |
| } |
| |
| bundle_data("terms_resources") { |
| sources = [ |
| # On iOS, the terms of service file need to be loaded from the application |
| # bundle, not from a datapack. As GetTermsOfServicePath() returns path to |
| # those files, they are added to //ios/chrome/browser/ui/util:terms_resources. |
| "//components/resources/terms/terms_am.html", |
| "//components/resources/terms/terms_ar.html", |
| "//components/resources/terms/terms_bg.html", |
| "//components/resources/terms/terms_bn.html", |
| "//components/resources/terms/terms_ca.html", |
| "//components/resources/terms/terms_cs.html", |
| "//components/resources/terms/terms_da.html", |
| "//components/resources/terms/terms_de.html", |
| "//components/resources/terms/terms_el.html", |
| "//components/resources/terms/terms_en-GB.html", |
| "//components/resources/terms/terms_en.html", |
| "//components/resources/terms/terms_es-419.html", |
| "//components/resources/terms/terms_es.html", |
| "//components/resources/terms/terms_et.html", |
| "//components/resources/terms/terms_fa.html", |
| "//components/resources/terms/terms_fi.html", |
| "//components/resources/terms/terms_fil.html", |
| "//components/resources/terms/terms_fr.html", |
| "//components/resources/terms/terms_gu.html", |
| "//components/resources/terms/terms_he.html", |
| "//components/resources/terms/terms_hi.html", |
| "//components/resources/terms/terms_hr.html", |
| "//components/resources/terms/terms_hu.html", |
| "//components/resources/terms/terms_id.html", |
| "//components/resources/terms/terms_it.html", |
| "//components/resources/terms/terms_ja.html", |
| "//components/resources/terms/terms_kn.html", |
| "//components/resources/terms/terms_ko.html", |
| "//components/resources/terms/terms_lt.html", |
| "//components/resources/terms/terms_lv.html", |
| "//components/resources/terms/terms_ml.html", |
| "//components/resources/terms/terms_mr.html", |
| "//components/resources/terms/terms_nb.html", |
| "//components/resources/terms/terms_nl.html", |
| "//components/resources/terms/terms_pl.html", |
| "//components/resources/terms/terms_pt-BR.html", |
| "//components/resources/terms/terms_pt-PT.html", |
| "//components/resources/terms/terms_ro.html", |
| "//components/resources/terms/terms_ru.html", |
| "//components/resources/terms/terms_sk.html", |
| "//components/resources/terms/terms_sl.html", |
| "//components/resources/terms/terms_sr.html", |
| "//components/resources/terms/terms_sv.html", |
| "//components/resources/terms/terms_sw.html", |
| "//components/resources/terms/terms_ta.html", |
| "//components/resources/terms/terms_te.html", |
| "//components/resources/terms/terms_th.html", |
| "//components/resources/terms/terms_tr.html", |
| "//components/resources/terms/terms_uk.html", |
| "//components/resources/terms/terms_vi.html", |
| "//components/resources/terms/terms_zh-CN.html", |
| "//components/resources/terms/terms_zh-TW.html", |
| ] |
| outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ] |
| } |
| |
| source_set("eg_app_support+eg2") { |
| configs += [ |
| "//build/config/compiler:enable_arc", |
| "//build/config/ios:xctest_config", |
| ] |
| testonly = true |
| sources = [ |
| "keyboard_observer_helper_app_interface.h", |
| "keyboard_observer_helper_app_interface.mm", |
| ] |
| deps = [ |
| ":util", |
| "//base", |
| "//base/test:test_support", |
| "//ios/chrome/test/app:test_support", |
| ] |
| } |
| |
| source_set("eg_test_support+eg2") { |
| configs += [ |
| "//build/config/compiler:enable_arc", |
| "//build/config/ios:xctest_config", |
| ] |
| testonly = true |
| sources = [ "keyboard_observer_helper_app_interface.h" ] |
| deps = [ |
| ":util", |
| "//ios/testing/earl_grey:eg_test_support+eg2", |
| "//ios/third_party/earl_grey2:test_lib", |
| ] |
| } |