| # Copyright 2025 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/buildflag_header.gni") |
| import("//components/plus_addresses/core/browser/buildflags.gni") |
| import("//third_party/protobuf/proto_library.gni") |
| |
| if (is_android) { |
| import("//build/config/android/rules.gni") |
| } |
| |
| source_set("types") { |
| sources = [ |
| "plus_address_types.cc", |
| "plus_address_types.h", |
| ] |
| deps = [ "//net" ] |
| public_deps = [ |
| "//base", |
| "//components/affiliations/core/browser:affiliations", |
| "//components/autofill/core/browser", |
| ] |
| } |
| |
| if (is_android) { |
| java_cpp_enum("plus_address_java_enums") { |
| sources = [ "plus_address_types.h" ] |
| } |
| } |
| |
| source_set("hats_utils") { |
| sources = [ "plus_address_hats_utils.h" ] |
| } |
| |
| proto_library("plus_address_blocklist_proto") { |
| sources = [ "blocked_facets.proto" ] |
| } |
| |
| source_set("blocklist_data") { |
| sources = [ |
| "plus_address_blocklist_data.cc", |
| "plus_address_blocklist_data.h", |
| ] |
| deps = [ "//base" ] |
| public_deps = [ |
| ":plus_address_blocklist_proto", |
| "//third_party/re2", |
| ] |
| } |
| |
| source_set("parsing") { |
| sources = [ |
| "plus_address_parsing_utils.cc", |
| "plus_address_parsing_utils.h", |
| ] |
| |
| deps = [ "//components/plus_addresses/core/common:features" ] |
| public_deps = [ |
| ":types", |
| "//base", |
| "//services/data_decoder/public/cpp", |
| ] |
| } |
| |
| source_set("browser") { |
| sources = [ |
| "affiliations/plus_address_affiliation_match_helper.cc", |
| "affiliations/plus_address_affiliation_match_helper.h", |
| "affiliations/plus_address_affiliation_source_adapter.cc", |
| "affiliations/plus_address_affiliation_source_adapter.h", |
| "plus_address_allocator.h", |
| "plus_address_cache.cc", |
| "plus_address_cache.h", |
| "plus_address_client.h", |
| "plus_address_http_client.h", |
| "plus_address_http_client_impl.cc", |
| "plus_address_http_client_impl.h", |
| "plus_address_jit_allocator.cc", |
| "plus_address_jit_allocator.h", |
| "plus_address_preallocator.cc", |
| "plus_address_preallocator.h", |
| "plus_address_service.h", |
| "plus_address_service_impl.cc", |
| "plus_address_service_impl.h", |
| "plus_address_suggestion_helper.cc", |
| "plus_address_suggestion_helper.h", |
| "plus_address_ui_utils.cc", |
| "plus_address_ui_utils.h", |
| ] |
| deps = [ |
| ":blocklist_data", |
| ":hats_utils", |
| ":parsing", |
| "//components/affiliations/core/browser:affiliations", |
| "//components/feature_engagement/public", |
| "//components/plus_addresses/core/browser/metrics", |
| "//components/plus_addresses/core/browser/metrics:submission_logger", |
| "//components/plus_addresses/core/browser/resources/strings", |
| "//components/plus_addresses/core/browser/settings", |
| "//components/plus_addresses/core/browser/webdata", |
| "//components/plus_addresses/core/common:prefs", |
| "//components/signin/public/identity_manager", |
| "//components/strings:components_strings_grit", |
| "//components/url_formatter", |
| "//net", |
| "//services/data_decoder/public/cpp", |
| "//services/network/public/cpp", |
| "//ui/base", |
| ] |
| public_deps = [ |
| ":types", |
| "//base", |
| "//components/autofill/core/browser", |
| "//components/keyed_service/core", |
| |
| # While not strictly public by .h file inclusion, this is a temporary move |
| # of features.h out of sources. Allowing those depending on |
| # :browser to also depend on its features to reduce churn. |
| "//components/plus_addresses/core/common:features", |
| "//third_party/abseil-cpp:absl", |
| "//url", |
| ] |
| } |
| |
| buildflag_header("plus_addresses_buildflags") { |
| header = "plus_addresses_buildflags.h" |
| flags = [ "PLUS_ADDRESSES_USE_INTERNAL_ANDROID_RESOURCES=$plus_addresses_use_internal_android_resources" ] |
| } |
| |
| source_set("unit_tests") { |
| testonly = true |
| sources = [ |
| "affiliations/plus_address_affiliation_match_helper_unittest.cc", |
| "affiliations/plus_address_affiliation_source_adapter_unittest.cc", |
| "plus_address_blocklist_data_unittest.cc", |
| "plus_address_http_client_impl_unittest.cc", |
| "plus_address_jit_allocator_unittest.cc", |
| "plus_address_parsing_utils_unittest.cc", |
| "plus_address_preallocator_unittest.cc", |
| "plus_address_service_impl_unittest.cc", |
| "plus_address_suggestion_helper_unittest.cc", |
| ] |
| |
| deps = [ |
| ":blocklist_data", |
| ":browser", |
| ":hats_utils", |
| ":parsing", |
| ":test_support", |
| "//base/test:test_support", |
| "//components/affiliations/core/browser:affiliations", |
| "//components/affiliations/core/browser:test_support", |
| "//components/autofill/core/browser:test_support", |
| "//components/feature_engagement/public", |
| "//components/os_crypt/async/browser:test_support", |
| "//components/plus_addresses/core/browser/metrics", |
| "//components/plus_addresses/core/browser/resources/strings", |
| "//components/plus_addresses/core/browser/settings:test_support", |
| "//components/plus_addresses/core/browser/webdata", |
| "//components/plus_addresses/core/common:features", |
| "//components/plus_addresses/core/common:prefs", |
| "//components/prefs:test_support", |
| "//components/signin/public/identity_manager:test_support", |
| "//components/sync_preferences:test_support", |
| "//services/data_decoder/public/cpp:test_support", |
| "//services/network:test_support", |
| ] |
| } |
| |
| static_library("test_support") { |
| testonly = true |
| sources = [ |
| "fake_plus_address_allocator.cc", |
| "fake_plus_address_allocator.h", |
| "fake_plus_address_service.cc", |
| "fake_plus_address_service.h", |
| "mock_plus_address_http_client.cc", |
| "mock_plus_address_http_client.h", |
| "plus_address_http_client_impl_test_api.h", |
| "plus_address_test_environment.cc", |
| "plus_address_test_environment.h", |
| "plus_address_test_utils.cc", |
| "plus_address_test_utils.h", |
| ] |
| deps = [ |
| ":hats_utils", |
| "//base", |
| "//base/test:test_support", |
| "//components/affiliations/core/browser:test_support", |
| "//components/autofill/core/browser", |
| "//components/autofill/core/browser:test_support", |
| "//components/feature_engagement/public", |
| "//components/plus_addresses/core/browser/resources/strings", |
| "//components/plus_addresses/core/common:prefs", |
| "//components/strings:components_strings_grit", |
| "//net:test_support", |
| "//testing/gmock", |
| ] |
| public_deps = [ |
| ":browser", |
| ":types", |
| "//components/affiliations/core/browser:test_support", |
| "//components/plus_addresses/core/browser/settings:test_support", |
| "//components/prefs:test_support", |
| "//components/signin/public/identity_manager:test_support", |
| ] |
| } |