BUILD.gn revision 5f1c94371a64b3196d4be9466099bb892df9b88e
1# Copyright 2014 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5if (is_android) { 6 import("//build/config/android/config.gni") 7 autofill_enable_sync = !is_android_webview_build 8} else { 9 autofill_enable_sync = true 10} 11 12config("autofill_browser_config") { 13 if (autofill_enable_sync) { 14 defines = [ "AUTOFILL_ENABLE_SYNC" ] 15 } 16} 17 18# GYP version: components/autofill.gyp:autofill_regexes 19action("regexes") { 20 visibility = "//components/autofill/*" 21 script = "//build/escape_unicode.py" 22 23 inputs = [ 24 "autofill_regex_constants.cc.utf8", 25 ] 26 outputs = [ 27 "$target_gen_dir/autofill_regex_constants.cc", 28 ] 29 30 args = [ "-o", rebase_path(target_gen_dir, root_build_dir) ] 31 args += rebase_path(inputs, root_build_dir) 32} 33 34# GYP version: components/autofill.gyp:autofill_core_browser 35static_library("browser") { 36 sources = [ 37 "address.cc", 38 "address.h", 39 "address_field.cc", 40 "address_field.h", 41 "address_i18n.cc", 42 "address_i18n.h", 43 "autocomplete_history_manager.cc", 44 "autocomplete_history_manager.h", 45 "autofill-inl.h", 46 "autofill_country.cc", 47 "autofill_country.h", 48 "autofill_data_model.cc", 49 "autofill_data_model.h", 50 "autofill_download_manager.cc", 51 "autofill_download_manager.h", 52 "autofill_driver.h", 53 "autofill_external_delegate.cc", 54 "autofill_external_delegate.h", 55 "autofill_field.cc", 56 "autofill_field.h", 57 "autofill_ie_toolbar_import_win.cc", 58 "autofill_ie_toolbar_import_win.h", 59 "autofill_manager.cc", 60 "autofill_manager.h", 61 "autofill_client.h", 62 "autofill_manager_test_delegate.h", 63 "autofill_metrics.cc", 64 "autofill_metrics.h", 65 "autofill_popup_delegate.h", 66 "autofill_profile.cc", 67 "autofill_profile.h", 68 "autofill_regex_constants.cc.utf8", 69 "autofill_regex_constants.h", 70 "autofill_regexes.cc", 71 "autofill_regexes.h", 72 "autofill_scanner.cc", 73 "autofill_scanner.h", 74 "autofill_server_field_info.h", 75 "autofill_type.cc", 76 "autofill_type.h", 77 "autofill_xml_parser.cc", 78 "autofill_xml_parser.h", 79 "contact_info.cc", 80 "contact_info.h", 81 "credit_card.cc", 82 "credit_card.h", 83 "credit_card_field.cc", 84 "credit_card_field.h", 85 "email_field.cc", 86 "email_field.h", 87 "field_types.h", 88 "form_field.cc", 89 "form_field.h", 90 "form_group.cc", 91 "form_group.h", 92 "form_structure.cc", 93 "form_structure.h", 94 "name_field.cc", 95 "name_field.h", 96 "password_generator.cc", 97 "password_generator.h", 98 "personal_data_manager.cc", 99 "personal_data_manager.h", 100 "personal_data_manager_mac.mm", 101 "personal_data_manager_observer.h", 102 "phone_field.cc", 103 "phone_field.h", 104 "phone_number.cc", 105 "phone_number.h", 106 "phone_number_i18n.cc", 107 "phone_number_i18n.h", 108 "popup_item_ids.h", 109 "state_names.cc", 110 "state_names.h", 111 "validation.cc", 112 "validation.h", 113 "webdata/autofill_change.cc", 114 "webdata/autofill_change.h", 115 "webdata/autofill_entry.cc", 116 "webdata/autofill_entry.h", 117 "webdata/autofill_profile_syncable_service.cc", 118 "webdata/autofill_profile_syncable_service.h", 119 "webdata/autofill_table.cc", 120 "webdata/autofill_table.h", 121 "webdata/autofill_webdata.h", 122 "webdata/autofill_webdata_backend.h", 123 "webdata/autofill_webdata_backend_impl.cc", 124 "webdata/autofill_webdata_backend_impl.h", 125 "webdata/autofill_webdata_service.cc", 126 "webdata/autofill_webdata_service.h", 127 "webdata/autofill_webdata_service_observer.h", 128 ] 129 130 # Compile the generated regex file. 131 sources += get_target_outputs(":regexes") 132 133 deps = [ 134 ":regexes", 135 "//base", 136 "//base:i18n", 137 "//base:prefs", 138 "//components/autofill/core/common", 139 "//components/keyed_service/core", 140 "//components/os_crypt", 141 "//components/pref_registry", 142 "//components/resources", 143 "//components/strings", 144 "//components/webdata/common", 145 "//google_apis", 146 "//skia", 147 "//sql", 148 "//third_party/fips181", 149 "//third_party/icu", 150 "//third_party/libaddressinput:util", 151 "//third_party/libphonenumber", 152 "//ui/base", 153 "//ui/gfx", 154 "//ui/gfx/geometry", 155 "//url", 156 # TODO(GYP) also remove libjingle_stub_config below when this is added: 157 #'../third_party/libjingle/libjingle.gyp:libjingle', TODO(GYP) 158 ] 159 160 configs += [ "//content:libjingle_stub_config" ] 161 direct_dependent_configs = [ ":autofill_browser_config" ] 162 163 if (autofill_enable_sync) { 164 deps += [ "//sync" ] 165 } else { 166 sources -= [ 167 "webdata/autofill_profile_syncable_service.cc", 168 "webdata/autofill_profile_syncable_service.h", 169 ] 170 } 171 172 if (is_win) { 173 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 174 cflags = [ "/wd4267" ] 175 } 176} 177 178static_library("test_support") { 179 sources = [ 180 "android/test_auxiliary_profile_loader_android.cc", 181 "android/test_auxiliary_profile_loader_android.h", 182 "autofill_test_utils.cc", 183 "autofill_test_utils.h", 184 "data_driven_test.cc", 185 "data_driven_test.h", 186 "test_autofill_client.cc", 187 "test_autofill_client.h", 188 "test_autofill_driver.cc", 189 "test_autofill_driver.h", 190 "test_autofill_external_delegate.cc", 191 "test_autofill_external_delegate.h", 192 "test_personal_data_manager.cc", 193 "test_personal_data_manager.h", 194 ] 195 196 deps = [ 197 ":browser", 198 "//components/autofill/core/browser", 199 "//components/autofill/core/common", 200 "//skia", 201 "//testing/gtest", 202 ] 203} 204 205source_set("unit_tests") { 206 sources = [ 207 "address_field_unittest.cc", 208 "address_unittest.cc", 209 "android/auxiliary_profile_unittest_android.cc", 210 "autocomplete_history_manager_unittest.cc", 211 "autofill_country_unittest.cc", 212 "autofill_data_model_unittest.cc", 213 "autofill_download_manager_unittest.cc", 214 "autofill_external_delegate_unittest.cc", 215 "autofill_field_unittest.cc", 216 "autofill_ie_toolbar_import_win_unittest.cc", 217 "autofill_manager_unittest.cc", 218 "autofill_merge_unittest.cc", 219 "autofill_metrics_unittest.cc", 220 "autofill_profile_unittest.cc", 221 "autofill_regexes_unittest.cc", 222 "autofill_type_unittest.cc", 223 "autofill_xml_parser_unittest.cc", 224 "contact_info_unittest.cc", 225 "credit_card_field_unittest.cc", 226 "credit_card_unittest.cc", 227 "form_field_unittest.cc", 228 "form_structure_unittest.cc", 229 "name_field_unittest.cc", 230 "password_generator_unittest.cc", 231 "personal_data_manager_unittest.cc", 232 "phone_field_unittest.cc", 233 "phone_number_i18n_unittest.cc", 234 "phone_number_unittest.cc", 235 "validation_unittest.cc", 236 "webdata/autofill_profile_syncable_service_unittest.cc", 237 "webdata/autofill_table_unittest.cc", 238 "webdata/web_data_service_unittest.cc", 239 ] 240 241 configs += [ "//content:libjingle_stub_config" ] 242 243 deps = [ 244 ":browser", 245 ":test_support", 246 "//components/resources", 247 "//components/strings", 248 "//testing/gmock", 249 "//third_party/libphonenumber", 250 #'../third_party/libjingle/libjingle.gyp:libjingle', TODO(GYP) 251 ] 252} 253