summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/safe_browsing/BUILD.gn
blob: a940b0d2a09b3cde8e3d0cf17eab0470ba8099b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# Copyright 2014 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("//components/safe_browsing/buildflags.gni")
import("//extensions/buildflags/buildflags.gni")

static_library("safe_browsing") {
  sources = [
    "chrome_controller_client.cc",
    "chrome_controller_client.h",
    "safe_browsing_tab_observer.cc",
    "safe_browsing_tab_observer.h",
    "url_checker_delegate_impl.cc",
    "url_checker_delegate_impl.h",
  ]

  public_deps = []

  deps = [
    "//build:branding_buildflags",
    "//chrome/app:generated_resources",
    "//chrome/browser:browser_process",
    "//chrome/browser/profiles:profile",
    "//chrome/common",
    "//chrome/common:constants",
    "//components/browser_sync",
    "//components/enterprise/common:strings",
    "//components/keyed_service/content",
    "//components/language/core/browser",
    "//components/no_state_prefetch/browser",
    "//components/no_state_prefetch/common",
    "//components/page_info",
    "//components/password_manager/core/browser",
    "//components/password_manager/core/browser:hash_password_manager",
    "//components/pref_registry",
    "//components/resources:components_resources_grit",
    "//components/safe_browsing:buildflags",
    "//components/safe_browsing/content",
    "//components/safe_browsing/content/browser:client_side_detection",
    "//components/safe_browsing/content/triggers:suspicious_site_trigger",
    "//components/safe_browsing/content/web_ui",
    "//components/safe_browsing/core:features",
    "//components/safe_browsing/core:ping_manager",
    "//components/safe_browsing/core/browser",
    "//components/safe_browsing/core/browser:referrer_chain_provider",
    "//components/safe_browsing/core/common:interfaces",
    "//components/safe_browsing/core/db:database_manager",
    "//components/safe_browsing/core/db:v4_local_database_manager",
    "//components/search_engines",
    "//components/security_interstitials/content:security_interstitial_page",
    "//components/security_interstitials/core",
    "//components/sessions",
    "//components/signin/public/identity_manager",
    "//components/url_formatter",
    "//mojo/public/cpp/platform",
    "//mojo/public/cpp/system",
    "//services/preferences/public/cpp",
  ]

  if (enable_extensions) {
    sources += [
      "settings_reset_prompt/default_settings_fetcher.cc",
      "settings_reset_prompt/default_settings_fetcher.h",
      "settings_reset_prompt/settings_reset_prompt_config.cc",
      "settings_reset_prompt/settings_reset_prompt_config.h",
      "settings_reset_prompt/settings_reset_prompt_controller.cc",
      "settings_reset_prompt/settings_reset_prompt_controller.h",
      "settings_reset_prompt/settings_reset_prompt_model.cc",
      "settings_reset_prompt/settings_reset_prompt_model.h",
      "settings_reset_prompt/settings_reset_prompt_prefs_manager.cc",
      "settings_reset_prompt/settings_reset_prompt_prefs_manager.h",
    ]
    if (is_win) {
      sources += [
        "settings_reset_prompt/settings_reset_prompt_util_win.cc",
        "settings_reset_prompt/settings_reset_prompt_util_win.h",
      ]
    }
    deps += [
      "//chrome/browser/profiles:profile",
      "//extensions/browser",
    ]
  }

  if (safe_browsing_mode != 0) {
    # "Safe Browsing Basic" files used for safe browsing in full mode
    # (safe_browsing=1) and mobile (=2)
    sources += [
      "certificate_reporting_metrics_provider.cc",
      "certificate_reporting_metrics_provider.h",
      "certificate_reporting_service.cc",
      "certificate_reporting_service.h",
      "certificate_reporting_service_factory.cc",
      "certificate_reporting_service_factory.h",
      "chrome_password_protection_service.cc",
      "chrome_password_protection_service.h",
      "chrome_password_protection_service_factory.cc",
      "chrome_password_protection_service_factory.h",
      "client_side_detection_host_delegate.cc",
      "client_side_detection_host_delegate.h",
      "client_side_detection_service_delegate.cc",
      "client_side_detection_service_delegate.h",
      "client_side_detection_service_factory.cc",
      "client_side_detection_service_factory.h",
      "delayed_warning_navigation_throttle.cc",
      "delayed_warning_navigation_throttle.h",
      "safe_browsing_blocking_page.cc",
      "safe_browsing_blocking_page.h",
      "safe_browsing_navigation_observer.cc",
      "safe_browsing_navigation_observer.h",
      "safe_browsing_navigation_observer_manager.cc",
      "safe_browsing_navigation_observer_manager.h",
      "safe_browsing_navigation_throttle.cc",
      "safe_browsing_navigation_throttle.h",
      "safe_browsing_service.cc",
      "safe_browsing_service.h",
      "safe_browsing_subresource_tab_helper.cc",
      "safe_browsing_subresource_tab_helper.h",
      "services_delegate.cc",
      "services_delegate.h",
      "telemetry/telemetry_service.cc",
      "telemetry/telemetry_service.h",
      "test_safe_browsing_blocking_page_quiet.cc",
      "test_safe_browsing_blocking_page_quiet.h",
      "trigger_creator.cc",
      "trigger_creator.h",
      "ui_manager.cc",
      "ui_manager.h",
      "url_lookup_service_factory.cc",
      "url_lookup_service_factory.h",
      "user_interaction_observer.cc",
      "user_interaction_observer.h",
      "user_population.cc",
      "user_population.h",
    ]
    deps += [
      ":advanced_protection",
      ":metrics_collector",
      ":verdict_cache_manager_factory",
      "//build:branding_buildflags",
      "//chrome/browser:browser_process",
      "//chrome/browser/profiles:profile",
      "//chrome/common/safe_browsing:proto",
      "//components/content_settings/core/browser",
      "//components/no_state_prefetch/browser",
      "//components/omnibox/browser",
      "//components/password_manager/core/browser/form_parsing",
      "//components/permissions",
      "//components/safe_browsing/content",
      "//components/safe_browsing/content/browser",
      "//components/safe_browsing/content/browser:client_side_detection",
      "//components/safe_browsing/content/browser:client_side_model_loader",
      "//components/safe_browsing/content/password_protection",
      "//components/safe_browsing/content/triggers:ad_popup_trigger",
      "//components/safe_browsing/content/triggers:ad_redirect_trigger",
      "//components/safe_browsing/content/triggers:ad_sampler_trigger",
      "//components/safe_browsing/content/triggers:suspicious_site_trigger",
      "//components/safe_browsing/core:csd_proto",
      "//components/safe_browsing/core:file_type_policies",
      "//components/safe_browsing/core:public",
      "//components/safe_browsing/core:verdict_cache_manager",
      "//components/safe_browsing/core/browser",
      "//components/safe_browsing/core/browser:network_context",
      "//components/safe_browsing/core/browser/sync",
      "//components/safe_browsing/core/common",
      "//components/safe_browsing/core/common:safe_browsing_prefs",
      "//components/safe_browsing/core/db:allowlist_checker_client",
      "//components/safe_browsing/core/db:metadata_proto",
      "//components/safe_browsing/core/realtime:policy_engine",
      "//components/safe_browsing/core/realtime:url_lookup_service",
      "//components/safe_browsing/core/triggers",
      "//components/safe_browsing/core/triggers:trigger_throttler",
      "//components/signin/public/identity_manager",
      "//components/site_engagement/core/mojom:mojo_bindings",
      "//components/sync_user_events",
      "//components/unified_consent",
      "//components/variations/service",
      "//content/public/browser",
      "//services/preferences/public/mojom:mojom",
    ]
    if (safe_browsing_mode == 1) {
      # "Safe Browsing Full" files in addition to the "basic" ones to use for
      # full safe browsing. This has some in common with "mobile."
      sources += [
        "../download/download_completion_blocker.cc",
        "../download/download_completion_blocker.h",
        "chrome_enterprise_url_lookup_service.cc",
        "chrome_enterprise_url_lookup_service.h",
        "chrome_enterprise_url_lookup_service_factory.cc",
        "chrome_enterprise_url_lookup_service_factory.h",
        "cloud_content_scanning/binary_fcm_service.cc",
        "cloud_content_scanning/binary_fcm_service.h",
        "cloud_content_scanning/binary_upload_service.cc",
        "cloud_content_scanning/binary_upload_service.h",
        "cloud_content_scanning/binary_upload_service_factory.cc",
        "cloud_content_scanning/binary_upload_service_factory.h",
        "cloud_content_scanning/deep_scanning_utils.cc",
        "cloud_content_scanning/deep_scanning_utils.h",
        "cloud_content_scanning/file_analysis_request.cc",
        "cloud_content_scanning/file_analysis_request.h",
        "cloud_content_scanning/multipart_uploader.cc",
        "cloud_content_scanning/multipart_uploader.h",
        "download_protection/check_client_download_request.cc",
        "download_protection/check_client_download_request.h",
        "download_protection/check_client_download_request_base.cc",
        "download_protection/check_client_download_request_base.h",
        "download_protection/check_file_system_access_write_request.cc",
        "download_protection/check_file_system_access_write_request.h",
        "download_protection/deep_scanning_request.cc",
        "download_protection/deep_scanning_request.h",
        "download_protection/download_feedback.cc",
        "download_protection/download_feedback.h",
        "download_protection/download_feedback_service.cc",
        "download_protection/download_feedback_service.h",
        "download_protection/download_protection_service.cc",
        "download_protection/download_protection_service.h",
        "download_protection/download_protection_util.cc",
        "download_protection/download_protection_util.h",
        "download_protection/download_reporter.cc",
        "download_protection/download_reporter.h",
        "download_protection/download_request_maker.cc",
        "download_protection/download_request_maker.h",
        "download_protection/download_url_sb_client.cc",
        "download_protection/download_url_sb_client.h",
        "download_protection/file_analyzer.cc",
        "download_protection/file_analyzer.h",
        "download_protection/path_sanitizer.cc",
        "download_protection/path_sanitizer.h",
        "download_protection/ppapi_download_request.cc",
        "download_protection/ppapi_download_request.h",
        "download_protection/two_phase_uploader.cc",
        "download_protection/two_phase_uploader.h",
        "incident_reporting/binary_integrity_analyzer.cc",
        "incident_reporting/binary_integrity_analyzer.h",
        "incident_reporting/binary_integrity_incident.cc",
        "incident_reporting/binary_integrity_incident.h",
        "incident_reporting/delayed_analysis_callback.h",
        "incident_reporting/delayed_callback_runner.cc",
        "incident_reporting/delayed_callback_runner.h",
        "incident_reporting/download_metadata_manager.cc",
        "incident_reporting/download_metadata_manager.h",
        "incident_reporting/environment_data_collection.cc",
        "incident_reporting/environment_data_collection.h",
        "incident_reporting/extension_data_collection.cc",
        "incident_reporting/extension_data_collection.h",
        "incident_reporting/incident.cc",
        "incident_reporting/incident.h",
        "incident_reporting/incident_handler_util.cc",
        "incident_reporting/incident_handler_util.h",
        "incident_reporting/incident_receiver.h",
        "incident_reporting/incident_report_uploader.cc",
        "incident_reporting/incident_report_uploader.h",
        "incident_reporting/incident_report_uploader_impl.cc",
        "incident_reporting/incident_report_uploader_impl.h",
        "incident_reporting/incident_reporting_service.cc",
        "incident_reporting/incident_reporting_service.h",
        "incident_reporting/last_download_finder.cc",
        "incident_reporting/last_download_finder.h",
        "incident_reporting/platform_state_store.cc",
        "incident_reporting/platform_state_store.h",
        "incident_reporting/preference_validation_delegate.cc",
        "incident_reporting/preference_validation_delegate.h",
        "incident_reporting/resource_request_incident.cc",
        "incident_reporting/resource_request_incident.h",
        "incident_reporting/state_store.cc",
        "incident_reporting/state_store.h",
        "incident_reporting/tracked_preference_incident.cc",
        "incident_reporting/tracked_preference_incident.h",
        "services_delegate_desktop.cc",
        "services_delegate_desktop.h",
      ]
      if (is_mac) {
        sources += [
          "incident_reporting/binary_integrity_analyzer_mac.cc",
          "incident_reporting/binary_integrity_analyzer_mac.h",
          "signature_evaluator_mac.h",
          "signature_evaluator_mac.mm",
        ]
      } else if (is_win) {
        sources += [
          "incident_reporting/binary_integrity_analyzer_win.cc",
          "incident_reporting/binary_integrity_analyzer_win.h",
          "incident_reporting/environment_data_collection_win.cc",
          "incident_reporting/environment_data_collection_win.h",
          "incident_reporting/module_integrity_verifier_win.cc",
          "incident_reporting/module_integrity_verifier_win.h",
          "incident_reporting/platform_state_store_win.cc",
        ]
      }
      deps += [
        ":advanced_protection",
        ":verdict_cache_manager_factory",
        "//build:branding_buildflags",
        "//build:chromeos_buildflags",
        "//chrome/common",
        "//chrome/common/safe_browsing:archive_analyzer_results",
        "//chrome/common/safe_browsing:binary_feature_extractor",
        "//chrome/common/safe_browsing:download_type_util",
        "//chrome/services/file_util/public/cpp",
        "//components/content_settings/core/browser",
        "//components/enterprise/common/proto:connectors_proto",
        "//components/gcm_driver",
        "//components/gcm_driver/instance_id",
        "//components/keyed_service/content",
        "//components/language/core/common",
        "//components/policy/core/browser",
        "//components/prefs",
        "//components/safe_browsing/core:client_model_proto",
        "//components/safe_browsing/core:csd_proto",
        "//components/safe_browsing/core:realtimeapi_proto",
        "//components/safe_browsing/core:verdict_cache_manager",
        "//components/safe_browsing/core/common:thread_utils",
        "//components/safe_browsing/core/db",
        "//components/safe_browsing/core/realtime:policy_engine",
        "//components/safe_browsing/core/realtime:url_lookup_service_base",
        "//components/security_interstitials/content:security_interstitial_page",
        "//components/security_interstitials/core:unsafe_resource",
        "//components/sync",
        "//content/public/browser",
        "//net",
        "//services/network/public/cpp:cpp",
      ]
      if (is_mac) {
        deps += [ "//chrome/common/safe_browsing:disk_image_type_sniffer_mac" ]
      } else if (is_win) {
        deps += [
          "//chrome/browser/safe_browsing/incident_reporting:state_store_data_proto",
          "//chrome/common:version_header",
        ]
      }
    } else if (safe_browsing_mode == 2) {
      if (is_android) {
        sources += [
          "android/services_delegate_android.cc",
          "android/services_delegate_android.h",
          "telemetry/android/android_telemetry_service.cc",
          "telemetry/android/android_telemetry_service.h",
        ]
        deps += [ "//components/safe_browsing/android:remote_database_manager" ]
      }
      deps += [
        "//chrome/browser/safe_browsing/android",
        "//components/safe_browsing:buildflags",
        "//components/safe_browsing/android:safe_browsing_mobile",
      ]
    }
  }
}

source_set("verdict_cache_manager_factory") {
  sources = [
    "verdict_cache_manager_factory.cc",
    "verdict_cache_manager_factory.h",
  ]

  deps = [
    "//chrome/browser:browser_process",
    "//chrome/browser/profiles:profile",
    "//chrome/common",
    "//components/content_settings/core/browser",
    "//components/history/core/browser",
    "//components/keyed_service/content",
    "//components/prefs",
    "//components/safe_browsing/core:verdict_cache_manager",
    "//content/public/browser",
  ]
}

static_library("advanced_protection") {
  sources = [
    "advanced_protection_status_manager.cc",
    "advanced_protection_status_manager.h",
    "advanced_protection_status_manager_factory.cc",
    "advanced_protection_status_manager_factory.h",
  ]

  deps = [
    "//chrome/browser/profiles:profile",
    "//components/keyed_service/content",
    "//components/prefs",
    "//components/safe_browsing/core:features",
    "//components/safe_browsing/core/common",
    "//components/safe_browsing/core/common:safe_browsing_prefs",
    "//components/signin/public/identity_manager",
    "//content/public/browser",
  ]
}

source_set("metrics_collector") {
  sources = [
    "safe_browsing_metrics_collector.cc",
    "safe_browsing_metrics_collector.h",
    "safe_browsing_metrics_collector_factory.cc",
    "safe_browsing_metrics_collector_factory.h",
  ]

  deps = [
    "//chrome/browser:browser_process",
    "//chrome/browser/profiles:profile",
    "//chrome/common",
    "//components/keyed_service/content",
    "//components/prefs",
    "//components/safe_browsing/core/common",
    "//components/safe_browsing/core/common:safe_browsing_prefs",
    "//content/public/browser",
  ]
}

source_set("test_support") {
  testonly = true

  if (safe_browsing_mode != 0) {
    sources = [
      "test_safe_browsing_service.cc",
      "test_safe_browsing_service.h",
    ]

    deps = [
      ":safe_browsing",
      "//chrome/common/safe_browsing:proto",
      "//components/enterprise/common/proto:connectors_proto",
      "//components/safe_browsing:buildflags",
      "//components/safe_browsing/core:public",
      "//components/safe_browsing/core/browser:network_context",
      "//components/safe_browsing/core/db:database_manager",
      "//components/safe_browsing/core/db:test_database_manager",
      "//components/safe_browsing/core/db:v4_protocol_manager_util",
      "//content/public/browser",
      "//services/network:test_support",
    ]
  }

  if (safe_browsing_mode == 1) {
    sources += [
      "cloud_content_scanning/test_binary_upload_service.cc",
      "cloud_content_scanning/test_binary_upload_service.h",
    ]
  }
}