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
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
|
# Additional changes to Inox's fix-building-without-safebrowsing.patch
--- chrome/browser/BUILD.gn.orig
+++ chrome/browser/BUILD.gn
@@ -1953,7 +1953,6 @@ static_library("browser") {
"//chrome/browser/net:probe_message_proto",
"//chrome/browser/new_tab_page/modules/drive:mojo_bindings",
"//chrome/browser/new_tab_page/modules/photos:mojo_bindings",
- "//chrome/browser/new_tab_page/modules/safe_browsing:mojo_bindings",
"//chrome/browser/new_tab_page/modules/task_module:mojo_bindings",
"//chrome/browser/notifications",
"//chrome/browser/notifications/scheduler:factory",
@@ -3726,9 +3725,6 @@ static_library("browser") {
"download/offline_item_model_manager_factory.h",
"enterprise/connectors/analysis/analysis_service_settings.cc",
"enterprise/connectors/analysis/analysis_service_settings.h",
- "enterprise/connectors/analysis/content_analysis_delegate.cc",
- "enterprise/connectors/analysis/content_analysis_delegate.h",
- "enterprise/connectors/analysis/content_analysis_delegate_base.h",
"enterprise/connectors/analysis/content_analysis_dialog.cc",
"enterprise/connectors/analysis/content_analysis_dialog.h",
"enterprise/connectors/analysis/content_analysis_downloads_delegate.cc",
@@ -3978,10 +3974,6 @@ static_library("browser") {
"new_tab_page/modules/photos/photos_service.h",
"new_tab_page/modules/photos/photos_service_factory.cc",
"new_tab_page/modules/photos/photos_service_factory.h",
- "new_tab_page/modules/safe_browsing/safe_browsing_handler.cc",
- "new_tab_page/modules/safe_browsing/safe_browsing_handler.h",
- "new_tab_page/modules/safe_browsing/safe_browsing_prefs.cc",
- "new_tab_page/modules/safe_browsing/safe_browsing_prefs.h",
"new_tab_page/modules/task_module/task_module_handler.cc",
"new_tab_page/modules/task_module/task_module_handler.h",
"new_tab_page/modules/task_module/task_module_service.cc",
@@ -7012,9 +7004,14 @@ static_library("browser") {
"//components/safe_browsing/content/browser:safe_browsing_blocking_page",
"//components/safe_browsing/content/browser/download:download_stats",
"//components/safe_browsing/content/common:file_type_policies",
- "//components/safe_browsing/content/common/proto:download_file_types_proto",
+ # "//components/safe_browsing/content/common/proto:download_file_types_proto",
]
}
+ # Use download_file_types_proto regardless of safe_browsing_mode, for
+ # now...
+ deps += [
+ "//components/safe_browsing/content/common/proto:download_file_types_proto",
+ ]
if (!is_fuchsia) {
sources += [
--- chrome/browser/accuracy_tips/accuracy_service_factory.cc.orig
+++ chrome/browser/accuracy_tips/accuracy_service_factory.cc
@@ -48,10 +48,7 @@ KeyedService* AccuracyServiceFactory::Bu
content::BrowserContext* browser_context) const {
DCHECK(base::FeatureList::IsEnabled(safe_browsing::kAccuracyTipsFeature));
Profile* profile = Profile::FromBrowserContext(browser_context);
- auto sb_database =
- g_browser_process->safe_browsing_service()
- ? g_browser_process->safe_browsing_service()->database_manager()
- : nullptr;
+ auto sb_database = nullptr;
auto* history_service = HistoryServiceFactory::GetForProfile(
profile, ServiceAccessType::IMPLICIT_ACCESS);
auto delegate = std::make_unique<AccuracyServiceDelegate>(profile);
--- chrome/browser/chrome_content_browser_client.cc.orig
+++ chrome/browser/chrome_content_browser_client.cc
@@ -4229,11 +4229,13 @@ ChromeContentBrowserClient::CreateThrott
&throttles);
#endif
+#if BUILDFLAG(FULL_SAFE_BROWSING)
if (base::FeatureList::IsEnabled(safe_browsing::kDelayedWarnings)) {
throttles.push_back(
std::make_unique<safe_browsing::DelayedWarningNavigationThrottle>(
handle));
}
+#endif
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
@@ -5632,26 +5634,7 @@ ChromeContentBrowserClient::GetSafeBrows
const std::vector<std::string>& allowlist_domains) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- // Should not bypass safe browsing check if the check is for enterprise
- // lookup.
- if (!safe_browsing_enabled_for_profile && !should_check_on_sb_disabled)
- return nullptr;
-
- // |safe_browsing_service_| may be unavailable in tests.
- if (safe_browsing_service_ && !safe_browsing_url_checker_delegate_) {
- safe_browsing_url_checker_delegate_ =
- base::MakeRefCounted<safe_browsing::UrlCheckerDelegateImpl>(
- safe_browsing_service_->database_manager(),
- safe_browsing_service_->ui_manager());
- }
-
- // Update allowlist domains.
- if (safe_browsing_url_checker_delegate_) {
- safe_browsing_url_checker_delegate_->SetPolicyAllowlistDomains(
- allowlist_domains);
- }
-
- return safe_browsing_url_checker_delegate_;
+ return nullptr;
}
safe_browsing::RealTimeUrlLookupServiceBase*
@@ -5672,11 +5655,6 @@ ChromeContentBrowserClient::GetUrlLookup
GetForProfile(profile);
}
#endif
-
- if (is_consumer_lookup_enabled) {
- return safe_browsing::RealTimeUrlLookupServiceFactory::GetForProfile(
- profile);
- }
return nullptr;
}
--- chrome/browser/chrome_content_browser_client_receiver_bindings.cc.orig
+++ chrome/browser/chrome_content_browser_client_receiver_bindings.cc
@@ -139,45 +139,6 @@ void MaybeCreateSafeBrowsingForRenderer(
const std::vector<std::string>& allowlist_domains)>
get_checker_delegate,
mojo::PendingReceiver<safe_browsing::mojom::SafeBrowsing> receiver) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-
- content::RenderProcessHost* render_process_host =
- content::RenderProcessHost::FromID(process_id);
- if (!render_process_host)
- return;
-
- PrefService* pref_service =
- Profile::FromBrowserContext(render_process_host->GetBrowserContext())
- ->GetPrefs();
-
- std::vector<std::string> allowlist_domains =
- safe_browsing::GetURLAllowlistByPolicy(pref_service);
-
- // Log the size of the domains to make sure copying them is
- // not too expensive.
- if (allowlist_domains.size() > 0) {
- int total_size = 0;
- for (const auto& domains : allowlist_domains) {
- total_size += domains.size();
- }
- base::UmaHistogramCounts10000(
- "SafeBrowsing.Policy.AllowlistDomainsTotalSize", total_size);
- }
-
- bool safe_browsing_enabled =
- safe_browsing::IsSafeBrowsingEnabled(*pref_service);
- content::GetIOThreadTaskRunner({})->PostTask(
- FROM_HERE,
- base::BindOnce(
- &safe_browsing::MojoSafeBrowsingImpl::MaybeCreate, process_id,
- resource_context,
- base::BindRepeating(get_checker_delegate, safe_browsing_enabled,
- // Navigation initiated from renderer should never
- // check when safe browsing is disabled, because
- // enterprise check only supports mainframe URL.
- /*should_check_on_sb_disabled=*/false,
- allowlist_domains),
- std::move(receiver)));
}
// BadgeManager is not used for Android.
--- chrome/browser/component_updater/client_side_phishing_component_installer.cc.orig
+++ chrome/browser/component_updater/client_side_phishing_component_installer.cc
@@ -36,20 +36,6 @@ const char kClientSidePhishingManifestNa
void LoadFromDisk(const base::FilePath& pb_path,
const base::FilePath& visual_tflite_model_path) {
- if (pb_path.empty())
- return;
-
- std::string binary_pb;
- if (!base::ReadFileToString(pb_path, &binary_pb))
- binary_pb.clear();
-
- base::File visual_tflite_model(visual_tflite_model_path,
- base::File::FLAG_OPEN | base::File::FLAG_READ);
-
- // The ClientSidePhishingModel singleton will react appropriately if the
- // |binary_pb| is empty or |visual_tflite_model| is invalid.
- safe_browsing::ClientSidePhishingModel::GetInstance()
- ->PopulateFromDynamicUpdate(binary_pb, std::move(visual_tflite_model));
}
base::FilePath GetInstalledProtoPath(const base::FilePath& base) {
@@ -123,9 +109,6 @@ update_client::InstallerAttributes
ClientSidePhishingComponentInstallerPolicy::GetInstallerAttributes() const {
update_client::InstallerAttributes attributes;
- // Pass the tag parameter to the installer as the "tag" attribute; it will
- // be used to choose which binary is downloaded.
- attributes["tag"] = safe_browsing::GetClientSideDetectionTag();
return attributes;
}
--- chrome/browser/download/chrome_download_manager_delegate.cc.orig
+++ chrome/browser/download/chrome_download_manager_delegate.cc
@@ -135,7 +135,6 @@ using content::DownloadManager;
using download::DownloadItem;
using download::DownloadPathReservationTracker;
using download::PathValidationResult;
-using safe_browsing::DownloadFileType;
using safe_browsing::DownloadProtectionService;
using ConnectionType = net::NetworkChangeNotifier::ConnectionType;
@@ -1517,8 +1516,6 @@ void ChromeDownloadManagerDelegate::OnDo
if (item->GetOriginalMimeType() == "application/x-x509-user-cert")
DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true);
#endif
-
- DownloadItemModel(item).SetDangerLevel(target_info->danger_level);
}
if (ShouldBlockFile(target_info->danger_type, item)) {
MaybeReportDangerousDownloadBlocked(
@@ -1670,7 +1667,6 @@ void ChromeDownloadManagerDelegate::Mayb
service->MaybeSendDangerousDownloadOpenedReport(download,
show_download_in_folder);
}
-#endif
if (!download->GetAutoOpened()) {
download::DownloadContent download_content =
download::DownloadContentFromMimeType(download->GetMimeType(), false);
@@ -1678,6 +1674,7 @@ void ChromeDownloadManagerDelegate::Mayb
download->GetDangerType(), download_content, base::Time::Now(),
download->GetEndTime(), show_download_in_folder);
}
+#endif
}
void ChromeDownloadManagerDelegate::CheckDownloadAllowed(
@@ -1754,30 +1751,6 @@ void ChromeDownloadManagerDelegate::Chec
std::move(callback).Run(true);
return;
}
-
- absl::optional<enterprise_connectors::AnalysisSettings> settings =
- safe_browsing::DeepScanningRequest::ShouldUploadBinary(download_item);
-
- if (settings.has_value()) {
- DownloadProtectionService* service = GetDownloadProtectionService();
- // Save package never need malware scans, so exempt them from scanning if
- // there are no other tags.
- settings->tags.erase("malware");
- if (!settings->tags.empty() && service) {
- download_item->SetUserData(
- enterprise_connectors::SavePackageScanningData::kKey,
- std::make_unique<enterprise_connectors::SavePackageScanningData>(
- std::move(callback)));
-
- service->UploadSavePackageForDeepScanning(
- download_item, std::move(save_package_files),
- base::BindRepeating(
- &ChromeDownloadManagerDelegate::CheckSavePackageScanningDone,
- weak_ptr_factory_.GetWeakPtr(), download_item->GetId()),
- std::move(settings.value()));
- return;
- }
- }
#endif
std::move(callback).Run(true);
}
--- chrome/browser/download/download_stats.cc.orig
+++ chrome/browser/download/download_stats.cc
@@ -8,6 +8,7 @@
#include "base/metrics/user_metrics.h"
#include "base/notreached.h"
#include "components/profile_metrics/browser_profile_type.h"
+#include "components/safe_browsing/buildflags.h"
#include "components/safe_browsing/content/browser/download/download_stats.h"
void RecordDownloadCount(ChromeDownloadCountTypes type) {
@@ -27,8 +28,10 @@ void RecordDangerousDownloadWarningShown
bool has_user_gesture) {
base::UmaHistogramEnumeration("Download.ShowedDownloadWarning", danger_type,
download::DOWNLOAD_DANGER_TYPE_MAX);
+#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
safe_browsing::RecordDangerousDownloadWarningShown(
danger_type, file_path, is_https, has_user_gesture);
+#endif
}
void RecordOpenedDangerousConfirmDialog(
--- chrome/browser/download/download_target_determiner.cc.orig
+++ chrome/browser/download/download_target_determiner.cc
@@ -872,11 +872,13 @@ void DownloadTargetDeterminer::CheckVisi
bool visited_referrer_before) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(STATE_DETERMINE_INTERMEDIATE_PATH, next_state_);
+#if BUILDFLAG(FULL_SAFE_BROWSING)
safe_browsing::RecordDownloadFileTypeAttributes(
safe_browsing::FileTypePolicies::GetInstance()->GetFileDangerLevel(
virtual_path_.BaseName()),
download_->HasUserGesture(), visited_referrer_before,
GetLastDownloadBypassTimestamp());
+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
danger_level_ = GetDangerLevel(
visited_referrer_before ? VISITED_REFERRER : NO_VISITS_TO_REFERRER);
if (danger_level_ != DownloadFileType::NOT_DANGEROUS &&
@@ -1111,6 +1113,7 @@ DownloadFileType::DangerLevel DownloadTa
absl::optional<base::Time>
DownloadTargetDeterminer::GetLastDownloadBypassTimestamp() const {
+#if BUILDFLAG(FULL_SAFE_BROWSING)
safe_browsing::SafeBrowsingMetricsCollector* metrics_collector =
safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
GetProfile());
@@ -1119,6 +1122,9 @@ DownloadTargetDeterminer::GetLastDownloa
safe_browsing::SafeBrowsingMetricsCollector::
EventType::DANGEROUS_DOWNLOAD_BYPASS)
: absl::nullopt;
+#else
+ return absl::nullopt;
+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
}
void DownloadTargetDeterminer::OnDownloadDestroyed(
--- chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc.orig
+++ chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
@@ -32,7 +32,6 @@
#include "chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service_factory.h"
#include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h"
#include "chrome/browser/safe_browsing/cloud_content_scanning/file_analysis_request.h"
-#include "chrome/browser/safe_browsing/download_protection/check_client_download_request.h"
#include "chrome/grit/generated_resources.h"
#include "components/enterprise/common/proto/connectors.pb.h"
#include "components/policy/core/browser/url_util.h"
--- chrome/browser/enterprise/connectors/connectors_service.cc.orig
+++ chrome/browser/enterprise/connectors/connectors_service.cc
@@ -475,19 +475,6 @@ absl::optional<std::string> ConnectorsSe
return absl::nullopt;
}
-safe_browsing::EnterpriseRealTimeUrlCheckMode
-ConnectorsService::GetAppliedRealTimeUrlCheck() const {
- if (!ConnectorsEnabled() ||
- !GetDmToken(prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckScope)
- .has_value()) {
- return safe_browsing::REAL_TIME_CHECK_DISABLED;
- }
-
- return static_cast<safe_browsing::EnterpriseRealTimeUrlCheckMode>(
- Profile::FromBrowserContext(context_)->GetPrefs()->GetInteger(
- prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckMode));
-}
-
ConnectorsManager* ConnectorsService::ConnectorsManagerForTesting() {
return connectors_manager_.get();
}
--- chrome/browser/enterprise/connectors/connectors_service.h.orig
+++ chrome/browser/enterprise/connectors/connectors_service.h
@@ -78,12 +78,6 @@ class ConnectorsService : public KeyedSe
// is no token to use.
absl::optional<std::string> GetDMTokenForRealTimeUrlCheck() const;
- // Returns the value to used by the enterprise real-time URL check Connector
- // if it is set and if the scope it's set at has a valid browser-profile
- // affiliation.
- safe_browsing::EnterpriseRealTimeUrlCheckMode GetAppliedRealTimeUrlCheck()
- const;
-
// Returns the CBCM domain or profile domain that enables connector policies.
// If both set Connector policies, the CBCM domain is returned as it has
// precedence.
--- chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.cc.orig
+++ chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.cc
@@ -38,9 +38,6 @@ void CommonSignalsDecorator::Decorate(Si
// Get signals from policy values.
signals.set_built_in_dns_client_enabled(
enterprise_signals::utils::GetBuiltInDnsClientEnabled(local_state_));
- signals.set_safe_browsing_protection_level(static_cast<int32_t>(
- enterprise_signals::utils::GetSafeBrowsingProtectionLevel(
- profile_prefs_)));
signals.set_remote_desktop_available(
enterprise_signals::utils::GetChromeRemoteDesktopAppBlocked(
policy_blocklist_service_));
@@ -58,15 +55,6 @@ void CommonSignalsDecorator::Decorate(Si
signals.set_chrome_cleanup_enabled(chrome_cleanup_enabled.value());
}
- absl::optional<safe_browsing::PasswordProtectionTrigger>
- password_protection_warning_trigger =
- enterprise_signals::utils::GetPasswordProtectionWarningTrigger(
- profile_prefs_);
- if (password_protection_warning_trigger.has_value()) {
- signals.set_password_protection_warning_trigger(
- static_cast<int32_t>(password_protection_warning_trigger.value()));
- }
-
std::move(done_closure).Run();
}
--- chrome/browser/enterprise/signals/context_info_fetcher.cc.orig
+++ chrome/browser/enterprise/signals/context_info_fetcher.cc
@@ -169,7 +169,6 @@ void ContextInfoFetcher::Fetch(ContextIn
GetAnalysisConnectorProviders(enterprise_connectors::FILE_DOWNLOADED);
info.on_bulk_data_entry_providers =
GetAnalysisConnectorProviders(enterprise_connectors::BULK_DATA_ENTRY);
- info.realtime_url_check_mode = GetRealtimeUrlCheckMode();
info.on_security_event_providers = GetOnSecurityEventProviders();
info.browser_version = version_info::GetVersionNumber();
info.site_isolation_enabled =
@@ -227,11 +226,6 @@ std::vector<std::string> ContextInfoFetc
return connectors_service_->GetAnalysisServiceProviderNames(connector);
}
-safe_browsing::EnterpriseRealTimeUrlCheckMode
-ContextInfoFetcher::GetRealtimeUrlCheckMode() {
- return connectors_service_->GetAppliedRealTimeUrlCheck();
-}
-
std::vector<std::string> ContextInfoFetcher::GetOnSecurityEventProviders() {
return connectors_service_->GetReportingServiceProviderNames(
enterprise_connectors::ReportingConnector::SECURITY_EVENT);
--- chrome/browser/enterprise/signals/context_info_fetcher.h.orig
+++ chrome/browser/enterprise/signals/context_info_fetcher.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_ENTERPRISE_SIGNALS_CONTEXT_INFO_FETCHER_H_
#include <string>
+#include <memory>
#include <vector>
#include "base/callback_forward.h"
@@ -37,7 +38,6 @@ struct ContextInfo {
std::vector<std::string> on_file_downloaded_providers;
std::vector<std::string> on_bulk_data_entry_providers;
std::vector<std::string> on_security_event_providers;
- safe_browsing::EnterpriseRealTimeUrlCheckMode realtime_url_check_mode;
std::string browser_version;
safe_browsing::SafeBrowsingState safe_browsing_protection_level;
bool site_isolation_enabled;
@@ -88,7 +88,6 @@ class ContextInfoFetcher {
std::vector<std::string> GetAnalysisConnectorProviders(
enterprise_connectors::AnalysisConnector connector);
- safe_browsing::EnterpriseRealTimeUrlCheckMode GetRealtimeUrlCheckMode();
std::vector<std::string> GetOnSecurityEventProviders();
--- chrome/browser/enterprise/signals/signals_utils.cc.orig
+++ chrome/browser/enterprise/signals/signals_utils.cc
@@ -33,24 +33,6 @@ bool IsURLBlocked(const GURL& url, Polic
} // namespace
-safe_browsing::SafeBrowsingState GetSafeBrowsingProtectionLevel(
- PrefService* profile_prefs) {
- DCHECK(profile_prefs);
- bool safe_browsing_enabled =
- profile_prefs->GetBoolean(prefs::kSafeBrowsingEnabled);
- bool safe_browsing_enhanced_enabled =
- profile_prefs->GetBoolean(prefs::kSafeBrowsingEnhanced);
-
- if (safe_browsing_enabled) {
- if (safe_browsing_enhanced_enabled)
- return safe_browsing::SafeBrowsingState::ENHANCED_PROTECTION;
- else
- return safe_browsing::SafeBrowsingState::STANDARD_PROTECTION;
- } else {
- return safe_browsing::SafeBrowsingState::NO_SAFE_BROWSING;
- }
-}
-
absl::optional<bool> GetThirdPartyBlockingEnabled(PrefService* local_state) {
DCHECK(local_state);
#if defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
@@ -65,15 +47,6 @@ bool GetBuiltInDnsClientEnabled(PrefServ
return local_state->GetBoolean(prefs::kBuiltInDnsClientEnabled);
}
-absl::optional<safe_browsing::PasswordProtectionTrigger>
-GetPasswordProtectionWarningTrigger(PrefService* profile_prefs) {
- DCHECK(profile_prefs);
- if (!profile_prefs->HasPrefPath(prefs::kPasswordProtectionWarningTrigger))
- return absl::nullopt;
- return static_cast<safe_browsing::PasswordProtectionTrigger>(
- profile_prefs->GetInteger(prefs::kPasswordProtectionWarningTrigger));
-}
-
absl::optional<bool> GetChromeCleanupEnabled(PrefService* local_state) {
DCHECK(local_state);
#if defined(OS_WIN)
--- chrome/browser/enterprise/signals/signals_utils.h.orig
+++ chrome/browser/enterprise/signals/signals_utils.h
@@ -21,12 +21,6 @@ bool GetBuiltInDnsClientEnabled(PrefServ
absl::optional<bool> GetChromeCleanupEnabled(PrefService* local_state);
-absl::optional<safe_browsing::PasswordProtectionTrigger>
-GetPasswordProtectionWarningTrigger(PrefService* profile_prefs);
-
-safe_browsing::SafeBrowsingState GetSafeBrowsingProtectionLevel(
- PrefService* profile_prefs);
-
bool GetChromeRemoteDesktopAppBlocked(PolicyBlocklistService* service);
} // namespace utils
--- chrome/browser/extensions/BUILD.gn.orig
+++ chrome/browser/extensions/BUILD.gn
@@ -650,8 +650,6 @@ static_library("extensions") {
"menu_manager_factory.h",
"navigation_observer.cc",
"navigation_observer.h",
- "omaha_attributes_handler.cc",
- "omaha_attributes_handler.h",
"pack_extension_job.cc",
"pack_extension_job.h",
"pending_extension_info.cc",
--- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc.orig
+++ chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc
@@ -72,17 +72,8 @@ api::enterprise_reporting_private::Conte
: nullptr;
info.os_firewall = ToInfoSettingValue(signals.os_firewall);
info.system_dns_servers = std::move(signals.system_dns_servers);
- switch (signals.realtime_url_check_mode) {
- case safe_browsing::REAL_TIME_CHECK_DISABLED:
info.realtime_url_check_mode = extensions::api::
enterprise_reporting_private::REALTIME_URL_CHECK_MODE_DISABLED;
- break;
- case safe_browsing::REAL_TIME_CHECK_FOR_MAINFRAME_ENABLED:
- info.realtime_url_check_mode =
- extensions::api::enterprise_reporting_private::
- REALTIME_URL_CHECK_MODE_ENABLED_MAIN_FRAME;
- break;
- }
info.browser_version = std::move(signals.browser_version);
info.built_in_dns_client_enabled = signals.built_in_dns_client_enabled;
--- chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc.orig
+++ chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc
@@ -326,6 +326,7 @@ void SafeBrowsingPrivateEventRouter::OnD
event_router_->BroadcastEvent(std::move(extension_event));
}
+#if defined(FULL_SAFE_BROWSING)
absl::optional<enterprise_connectors::ReportingSettings> settings =
GetReportingSettings();
if (!settings.has_value() ||
@@ -356,6 +357,7 @@ void SafeBrowsingPrivateEventRouter::OnD
ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(settings.value()),
std::move(event));
+#endif // FULL_SAFE_BROWSING
}
void SafeBrowsingPrivateEventRouter::OnSecurityInterstitialShown(
@@ -383,6 +385,7 @@ void SafeBrowsingPrivateEventRouter::OnS
event_router_->BroadcastEvent(std::move(extension_event));
}
+#if defined(FULL_SAFE_BROWSING)
absl::optional<enterprise_connectors::ReportingSettings> settings =
GetReportingSettings();
if (!settings.has_value() ||
@@ -406,6 +409,7 @@ void SafeBrowsingPrivateEventRouter::OnS
ReportRealtimeEvent(kKeyInterstitialEvent, std::move(settings.value()),
std::move(event));
+#endif // FULL_SAFE_BROWSING
}
void SafeBrowsingPrivateEventRouter::OnSecurityInterstitialProceeded(
@@ -433,6 +437,7 @@ void SafeBrowsingPrivateEventRouter::OnS
event_router_->BroadcastEvent(std::move(extension_event));
}
+#if defined(FULL_SAFE_BROWSING)
absl::optional<enterprise_connectors::ReportingSettings> settings =
GetReportingSettings();
if (!settings.has_value() ||
@@ -452,6 +457,7 @@ void SafeBrowsingPrivateEventRouter::OnS
ReportRealtimeEvent(kKeyInterstitialEvent, std::move(settings.value()),
std::move(event));
+#endif // FULL_SAFE_BROWSING
}
void SafeBrowsingPrivateEventRouter::OnAnalysisConnectorResult(
@@ -465,6 +471,7 @@ void SafeBrowsingPrivateEventRouter::OnA
const enterprise_connectors::ContentAnalysisResponse::Result& result,
const int64_t content_size,
safe_browsing::EventResult event_result) {
+#if defined(FULL_SAFE_BROWSING)
if (result.tag() == "malware") {
DCHECK_EQ(1, result.triggered_rules().size());
OnDangerousDeepScanningResult(
@@ -476,6 +483,7 @@ void SafeBrowsingPrivateEventRouter::OnA
OnSensitiveDataEvent(url, file_name, download_digest_sha256, mime_type,
trigger, scan_id, result, content_size, event_result);
}
+#endif // FULL_SAFE_BROWSING
}
void SafeBrowsingPrivateEventRouter::OnDangerousDeepScanningResult(
@@ -491,6 +499,7 @@ void SafeBrowsingPrivateEventRouter::OnD
const std::string& malware_category,
const std::string& evidence_locker_filepath,
const std::string& scan_id) {
+#if defined(FULL_SAFE_BROWSING)
absl::optional<enterprise_connectors::ReportingSettings> settings =
GetReportingSettings();
if (!settings.has_value() ||
@@ -528,6 +537,7 @@ void SafeBrowsingPrivateEventRouter::OnD
ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(settings.value()),
std::move(event));
+#endif // FULL_SAFE_BROWSING
}
void SafeBrowsingPrivateEventRouter::OnSensitiveDataEvent(
@@ -540,6 +550,7 @@ void SafeBrowsingPrivateEventRouter::OnS
const enterprise_connectors::ContentAnalysisResponse::Result& result,
const int64_t content_size,
safe_browsing::EventResult event_result) {
+#if defined(FULL_SAFE_BROWSING)
absl::optional<enterprise_connectors::ReportingSettings> settings =
GetReportingSettings();
if (!settings.has_value() ||
@@ -572,6 +583,7 @@ void SafeBrowsingPrivateEventRouter::OnS
ReportRealtimeEvent(kKeySensitiveDataEvent, std::move(settings.value()),
std::move(event));
+#endif // FULL_SAFE_BROWSING
}
void SafeBrowsingPrivateEventRouter::OnAnalysisConnectorWarningBypassed(
@@ -584,6 +596,7 @@ void SafeBrowsingPrivateEventRouter::OnA
safe_browsing::DeepScanAccessPoint access_point,
const enterprise_connectors::ContentAnalysisResponse::Result& result,
const int64_t content_size) {
+#if defined(FULL_SAFE_BROWSING)
absl::optional<enterprise_connectors::ReportingSettings> settings =
GetReportingSettings();
if (!settings.has_value() ||
@@ -616,6 +629,7 @@ void SafeBrowsingPrivateEventRouter::OnA
ReportRealtimeEvent(kKeySensitiveDataEvent, std::move(settings.value()),
std::move(event));
+#endif // FULL_SAFE_BROWSING
}
void SafeBrowsingPrivateEventRouter::OnUnscannedFileEvent(
@@ -628,6 +642,7 @@ void SafeBrowsingPrivateEventRouter::OnU
const std::string& reason,
const int64_t content_size,
safe_browsing::EventResult event_result) {
+#if defined(FULL_SAFE_BROWSING)
absl::optional<enterprise_connectors::ReportingSettings> settings =
GetReportingSettings();
if (!settings.has_value() ||
@@ -654,6 +669,7 @@ void SafeBrowsingPrivateEventRouter::OnU
ReportRealtimeEvent(kKeyUnscannedFileEvent, std::move(settings.value()),
std::move(event));
+#endif // FULL_SAFE_BROWSING
}
void SafeBrowsingPrivateEventRouter::OnDangerousDownloadEvent(
@@ -679,6 +695,7 @@ void SafeBrowsingPrivateEventRouter::OnD
const std::string& scan_id,
const int64_t content_size,
safe_browsing::EventResult event_result) {
+#if defined(FULL_SAFE_BROWSING)
absl::optional<enterprise_connectors::ReportingSettings> settings =
GetReportingSettings();
if (!settings.has_value() ||
@@ -709,6 +726,7 @@ void SafeBrowsingPrivateEventRouter::OnD
ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(settings.value()),
std::move(event));
+#endif
}
void SafeBrowsingPrivateEventRouter::OnDangerousDownloadWarningBypassed(
@@ -732,6 +750,7 @@ void SafeBrowsingPrivateEventRouter::OnD
const std::string& mime_type,
const std::string& scan_id,
const int64_t content_size) {
+#if defined(FULL_SAFE_BROWSING)
absl::optional<enterprise_connectors::ReportingSettings> settings =
GetReportingSettings();
if (!settings.has_value() ||
@@ -762,6 +781,7 @@ void SafeBrowsingPrivateEventRouter::OnD
ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(settings.value()),
std::move(event));
+#endif // FULL_SAFE_BROWSING
}
void SafeBrowsingPrivateEventRouter::OnLoginEvent(
@@ -1087,7 +1107,11 @@ void SafeBrowsingPrivateEventRouter::Rep
}
std::string SafeBrowsingPrivateEventRouter::GetProfileUserName() const {
+#if defined(FULL_SAFE_BROWSING)
return safe_browsing::GetProfileEmail(identity_manager_);
+#else
+ return "";
+#endif
}
#if BUILDFLAG(IS_CHROMEOS_ASH)
--- chrome/browser/extensions/extension_service.cc.orig
+++ chrome/browser/extensions/extension_service.cc
@@ -52,7 +52,6 @@
#include "chrome/browser/extensions/forced_extensions/install_stage_tracker.h"
#include "chrome/browser/extensions/install_verifier.h"
#include "chrome/browser/extensions/installed_loader.h"
-#include "chrome/browser/extensions/omaha_attributes_handler.h"
#include "chrome/browser/extensions/pending_extension_manager.h"
#include "chrome/browser/extensions/permissions_updater.h"
#include "chrome/browser/extensions/shared_module_service.h"
@@ -370,7 +369,6 @@ ExtensionService::ExtensionService(Profi
safe_browsing_verdict_handler_(extension_prefs,
ExtensionRegistry::Get(profile),
this),
- omaha_attributes_handler_(extension_prefs, this),
registry_(ExtensionRegistry::Get(profile)),
pending_extension_manager_(profile),
install_directory_(install_directory),
@@ -852,47 +850,6 @@ bool ExtensionService::IsExtensionEnable
return extension_registrar_.IsExtensionEnabled(extension_id);
}
-void ExtensionService::PerformActionBasedOnOmahaAttributes(
- const std::string& extension_id,
- const base::Value& attributes) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- HandleMalwareOmahaAttribute(extension_id, attributes);
- omaha_attributes_handler_.PerformActionBasedOnOmahaAttributes(extension_id,
- attributes);
- allowlist_.PerformActionBasedOnOmahaAttributes(extension_id, attributes);
-}
-
-void ExtensionService::HandleMalwareOmahaAttribute(
- const std::string& extension_id,
- const base::Value& attributes) {
- bool has_malware_value =
- OmahaAttributesHandler::HasOmahaBlocklistStateInAttributes(
- attributes, BitMapBlocklistState::BLOCKLISTED_MALWARE);
- if (!has_malware_value) {
- OmahaAttributesHandler::ReportNoUpdateCheckKeys();
- // Omaha attributes may have previously have the "_malware" key.
- MaybeEnableRemotelyDisabledExtension(extension_id);
- return;
- }
-
- if (extension_prefs_->HasDisableReason(
- extension_id, disable_reason::DISABLE_REMOTELY_FOR_MALWARE)) {
- // The extension is already disabled. No work needs to be done.
- return;
- }
-
- OmahaAttributesHandler::ReportExtensionDisabledRemotely(
- extension_registrar_.IsExtensionEnabled(extension_id),
- ExtensionUpdateCheckDataKey::kMalware);
-
- // Add the extension to the blocklisted extensions set.
- UpdateBlocklistedExtensions({extension_id},
- registry_->blocklisted_extensions().GetIDs());
- extension_prefs_->AddDisableReason(
- extension_id, disable_reason::DISABLE_REMOTELY_FOR_MALWARE);
- // Show an error for the newly blocklisted extension.
- error_controller_->ShowErrorIfNeeded();
-}
void ExtensionService::MaybeEnableRemotelyDisabledExtension(
const std::string& extension_id) {
@@ -909,56 +866,6 @@ void ExtensionService::MaybeEnableRemote
unchanged.erase(extension_id);
// Remove the extension from the blocklist.
UpdateBlocklistedExtensions({}, unchanged);
- OmahaAttributesHandler::ReportReenableExtension(
- ExtensionUpdateCheckDataKey::kMalware);
-}
-
-void ExtensionService::ClearGreylistedAcknowledgedStateAndMaybeReenable(
- const std::string& extension_id) {
- bool is_on_sb_list = (blocklist_prefs::GetSafeBrowsingExtensionBlocklistState(
- extension_id, extension_prefs_) !=
- BitMapBlocklistState::NOT_BLOCKLISTED);
- bool is_on_omaha_list =
- blocklist_prefs::HasAnyOmahaGreylistState(extension_id, extension_prefs_);
- if (is_on_sb_list || is_on_omaha_list) {
- return;
- }
- // Clear all acknowledged states so the extension will still get disabled if
- // it is added to the greylist again.
- blocklist_prefs::ClearAcknowledgedGreylistStates(extension_id,
- extension_prefs_);
- RemoveDisableReasonAndMaybeEnable(extension_id,
- disable_reason::DISABLE_GREYLIST);
-}
-
-void ExtensionService::MaybeDisableGreylistedExtension(
- const std::string& extension_id,
- BitMapBlocklistState new_state) {
-#if DCHECK_IS_ON()
- bool has_new_state_on_sb_list =
- (blocklist_prefs::GetSafeBrowsingExtensionBlocklistState(
- extension_id, extension_prefs_) == new_state);
- bool has_new_state_on_omaha_list = blocklist_prefs::HasOmahaBlocklistState(
- extension_id, new_state, extension_prefs_);
- DCHECK(has_new_state_on_sb_list || has_new_state_on_omaha_list);
-#endif
- if (blocklist_prefs::HasAcknowledgedBlocklistState(extension_id, new_state,
- extension_prefs_)) {
- // If the extension is already acknowledged, don't disable it again
- // because it can be already re-enabled by the user. This could happen if
- // the extension is added to the SafeBrowsing blocklist, and then
- // subsequently marked by Omaha. In this case, we don't want to disable the
- // extension twice.
- return;
- }
-
- // Set the current greylist states to acknowledge immediately because the
- // extension is disabled silently. Clear the other acknowledged state because
- // when the state changes to another greylist state in the future, we'd like
- // to disable the extension again.
- blocklist_prefs::UpdateCurrentGreylistStatesAsAcknowledged(extension_id,
- extension_prefs_);
- DisableExtension(extension_id, disable_reason::DISABLE_GREYLIST);
}
void ExtensionService::RemoveDisableReasonAndMaybeEnable(
--- chrome/browser/extensions/extension_service.h.orig
+++ chrome/browser/extensions/extension_service.h
@@ -25,7 +25,6 @@
#include "chrome/browser/extensions/forced_extensions/force_installed_metrics.h"
#include "chrome/browser/extensions/forced_extensions/force_installed_tracker.h"
#include "chrome/browser/extensions/install_gate.h"
-#include "chrome/browser/extensions/omaha_attributes_handler.h"
#include "chrome/browser/extensions/pending_extension_manager.h"
#include "chrome/browser/extensions/safe_browsing_verdict_handler.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -269,28 +268,11 @@ class ExtensionService : public Extensio
// nothing.
void EnableExtension(const std::string& extension_id);
- // Takes Safe Browsing and Omaha blocklist states into account and decides
- // whether to remove greylist disabled reason. Called when a greylisted
- // state is removed from the Safe Browsing blocklist or Omaha blocklist. Also
- // clears all acknowledged states if the greylist disabled reason is removed.
- void ClearGreylistedAcknowledgedStateAndMaybeReenable(
- const std::string& extension_id);
-
- // Takes acknowledged blocklist states into account and decides whether to
- // disable the greylisted extension. Called when a new greylisted state is
- // added to the Safe Browsing blocklist or Omaha blocklist.
- void MaybeDisableGreylistedExtension(const std::string& extension_id,
- BitMapBlocklistState new_state);
-
// Removes the disable reason and enable the extension if there are no disable
// reasons left and is not blocked for another reason.
void RemoveDisableReasonAndMaybeEnable(const std::string& extension_id,
disable_reason::DisableReason reason);
- // Performs action based on Omaha attributes for the extension.
- void PerformActionBasedOnOmahaAttributes(const std::string& extension_id,
- const base::Value& attributes);
-
// Disables the extension. If the extension is already disabled, just adds
// the |disable_reasons| (a bitmask of disable_reason::DisableReason - there
// can be multiple DisableReasons e.g. when an extension comes in disabled
@@ -562,11 +544,6 @@ class ExtensionService : public Extensio
// Helper method to determine if an extension can be blocked.
bool CanBlockExtension(const Extension* extension) const;
- // Handles the malware Omaha attribute for remotely disabled extensions.
- // TODO(crbug.com/1193695): Move this function to OmahaAttributesHandler.
- void HandleMalwareOmahaAttribute(const std::string& extension_id,
- const base::Value& attributes);
-
// Enables an extension that was only previously disabled remotely.
void MaybeEnableRemotelyDisabledExtension(const std::string& extension_id);
@@ -639,8 +616,6 @@ class ExtensionService : public Extensio
SafeBrowsingVerdictHandler safe_browsing_verdict_handler_;
- OmahaAttributesHandler omaha_attributes_handler_;
-
// Sets of enabled/disabled/terminated/blocklisted extensions. Not owned.
ExtensionRegistry* registry_ = nullptr;
--- chrome/browser/extensions/extension_system_impl.cc.orig
+++ chrome/browser/extensions/extension_system_impl.cc
@@ -465,8 +465,6 @@ void ExtensionSystemImpl::InstallUpdate(
void ExtensionSystemImpl::PerformActionBasedOnOmahaAttributes(
const std::string& extension_id,
const base::Value& attributes) {
- extension_service()->PerformActionBasedOnOmahaAttributes(extension_id,
- attributes);
}
bool ExtensionSystemImpl::FinishDelayedInstallationIfReady(
--- chrome/browser/extensions/safe_browsing_verdict_handler.cc.orig
+++ chrome/browser/extensions/safe_browsing_verdict_handler.cc
@@ -101,8 +101,6 @@ void SafeBrowsingVerdictHandler::UpdateG
blocklist_prefs::SetSafeBrowsingExtensionBlocklistState(
extension->id(), BitMapBlocklistState::NOT_BLOCKLISTED,
extension_prefs_);
- extension_service_->ClearGreylistedAcknowledgedStateAndMaybeReenable(
- extension->id());
UMA_HISTOGRAM_ENUMERATION("Extensions.Greylist.Enabled",
extension->location());
}
@@ -125,8 +123,6 @@ void SafeBrowsingVerdictHandler::UpdateG
blocklist_prefs::BlocklistStateToBitMapBlocklistState(greylist_state);
blocklist_prefs::SetSafeBrowsingExtensionBlocklistState(
extension->id(), bitmap_greylist_state, extension_prefs_);
- extension_service_->MaybeDisableGreylistedExtension(id,
- bitmap_greylist_state);
UMA_HISTOGRAM_ENUMERATION("Extensions.Greylist.Disabled",
extension->location());
}
--- chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc.orig
+++ chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
@@ -35,8 +35,6 @@
#include "chrome/browser/file_system_access/file_system_access_permission_request_manager.h"
#include "chrome/browser/installable/installable_utils.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/safe_browsing/download_protection/download_protection_service.h"
-#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/ui/file_system_access_dialogs.h"
#include "chrome/common/chrome_paths.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
@@ -299,83 +297,6 @@ BindResultCallbackToCurrentSequence(
base::SequencedTaskRunnerHandle::Get(), std::move(callback));
}
-void DoSafeBrowsingCheckOnUIThread(
- content::GlobalRenderFrameHostId frame_id,
- std::unique_ptr<content::FileSystemAccessWriteItem> item,
- safe_browsing::CheckDownloadCallback callback) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- // Download Protection Service is not supported on Android.
-#if BUILDFLAG(FULL_SAFE_BROWSING)
- safe_browsing::SafeBrowsingService* sb_service =
- g_browser_process->safe_browsing_service();
- if (!sb_service || !sb_service->download_protection_service() ||
- !sb_service->download_protection_service()->enabled()) {
- std::move(callback).Run(safe_browsing::DownloadCheckResult::UNKNOWN);
- return;
- }
-
- if (!item->browser_context) {
- content::RenderProcessHost* rph =
- content::RenderProcessHost::FromID(frame_id.child_id);
- if (!rph) {
- std::move(callback).Run(safe_browsing::DownloadCheckResult::UNKNOWN);
- return;
- }
- item->browser_context = rph->GetBrowserContext();
- }
-
- if (!item->web_contents) {
- content::RenderFrameHost* rfh = content::RenderFrameHost::FromID(frame_id);
- if (rfh) {
- DCHECK_NE(rfh->GetLifecycleState(),
- content::RenderFrameHost::LifecycleState::kPrerendering);
- item->web_contents = content::WebContents::FromRenderFrameHost(rfh);
- }
- }
-
- sb_service->download_protection_service()->CheckFileSystemAccessWrite(
- std::move(item), std::move(callback));
-#endif
-}
-
-ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult
-InterpretSafeBrowsingResult(safe_browsing::DownloadCheckResult result) {
- using Result = safe_browsing::DownloadCheckResult;
- switch (result) {
- // Only allow downloads that are marked as SAFE or UNKNOWN by SafeBrowsing.
- // All other types are going to be blocked. UNKNOWN could be the result of a
- // failed safe browsing ping.
- case Result::UNKNOWN:
- case Result::SAFE:
- case Result::ALLOWLISTED_BY_POLICY:
- return ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult::
- kAllow;
-
- case Result::DANGEROUS:
- case Result::UNCOMMON:
- case Result::DANGEROUS_HOST:
- case Result::POTENTIALLY_UNWANTED:
- case Result::BLOCKED_PASSWORD_PROTECTED:
- case Result::BLOCKED_TOO_LARGE:
- case Result::BLOCKED_UNSUPPORTED_FILE_TYPE:
- case Result::DANGEROUS_ACCOUNT_COMPROMISE:
- return ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult::
- kBlock;
-
- // This shouldn't be returned for File System Access write checks.
- case Result::ASYNC_SCANNING:
- case Result::SENSITIVE_CONTENT_WARNING:
- case Result::SENSITIVE_CONTENT_BLOCK:
- case Result::DEEP_SCANNED_SAFE:
- case Result::PROMPT_FOR_SCANNING:
- NOTREACHED();
- return ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult::
- kAllow;
- }
- NOTREACHED();
- return ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult::kBlock;
-}
-
std::string GenerateLastPickedDirectoryKey(const std::string& id) {
return id.empty() ? kDefaultLastPickedDirectoryKey
: base::StrCat({kCustomLastPickedDirectoryKey, "-", id});
@@ -1106,28 +1027,6 @@ void ChromeFileSystemAccessPermissionCon
std::move(callback)));
}
-void ChromeFileSystemAccessPermissionContext::PerformAfterWriteChecks(
- std::unique_ptr<content::FileSystemAccessWriteItem> item,
- content::GlobalRenderFrameHostId frame_id,
- base::OnceCallback<void(AfterWriteCheckResult)> callback) {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- content::GetUIThreadTaskRunner({})->PostTask(
- FROM_HERE,
- base::BindOnce(
- &DoSafeBrowsingCheckOnUIThread, frame_id, std::move(item),
- base::BindOnce(
- [](scoped_refptr<base::TaskRunner> task_runner,
- base::OnceCallback<void(AfterWriteCheckResult result)>
- callback,
- safe_browsing::DownloadCheckResult result) {
- task_runner->PostTask(
- FROM_HERE,
- base::BindOnce(std::move(callback),
- InterpretSafeBrowsingResult(result)));
- },
- base::SequencedTaskRunnerHandle::Get(), std::move(callback))));
-}
-
void ChromeFileSystemAccessPermissionContext::
DidConfirmSensitiveDirectoryAccess(
const url::Origin& origin,
--- chrome/browser/file_system_access/chrome_file_system_access_permission_context.h.orig
+++ chrome/browser/file_system_access/chrome_file_system_access_permission_context.h
@@ -85,10 +85,6 @@ class ChromeFileSystemAccessPermissionCo
HandleType handle_type,
content::GlobalRenderFrameHostId frame_id,
base::OnceCallback<void(SensitiveDirectoryResult)> callback) override;
- void PerformAfterWriteChecks(
- std::unique_ptr<content::FileSystemAccessWriteItem> item,
- content::GlobalRenderFrameHostId frame_id,
- base::OnceCallback<void(AfterWriteCheckResult)> callback) override;
bool CanObtainReadPermission(const url::Origin& origin) override;
bool CanObtainWritePermission(const url::Origin& origin) override;
--- chrome/browser/media/webrtc/display_media_access_handler.cc.orig
+++ chrome/browser/media/webrtc/display_media_access_handler.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/safe_browsing/user_interaction_observer.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
+#include "components/safe_browsing/buildflags.h"
#include "components/url_formatter/elide_url.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/desktop_capture.h"
@@ -111,6 +112,7 @@ void DisplayMediaAccessHandler::HandleRe
return;
}
+ #if BUILDFLAG(FULL_SAFE_BROWSING)
// SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing
// warnings until user interaction. If the current page has a delayed warning,
// it'll have a user interaction observer attached. Show the warning
@@ -125,6 +127,7 @@ void DisplayMediaAccessHandler::HandleRe
observer->OnDesktopCaptureRequest();
return;
}
+ #endif // BUILDFLAG(FULL_SAFE_BROWSING)
#if defined(OS_MAC)
// Do not allow picker UI to be shown on a page that isn't in the foreground
--- chrome/browser/password_manager/chrome_password_manager_client.cc.orig
+++ chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -33,7 +33,6 @@
#include "chrome/browser/password_manager/password_reuse_manager_factory.h"
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
#include "chrome/browser/safe_browsing/user_interaction_observer.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/sync/sync_service_factory.h"
@@ -110,11 +109,11 @@
#if BUILDFLAG(FULL_SAFE_BROWSING)
#include "chrome/browser/safe_browsing/advanced_protection_status_manager.h"
#include "chrome/browser/safe_browsing/advanced_protection_status_manager_factory.h"
+#endif
#include "third_party/blink/public/mojom/clipboard/clipboard.mojom.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/data_transfer_policy/data_transfer_endpoint.h"
#include "ui/events/keycodes/keyboard_codes.h"
-#endif
#if defined(OS_ANDROID)
#include "chrome/browser/android/tab_android.h"
@@ -826,6 +825,7 @@ autofill::LanguageCode ChromePasswordMan
return autofill::LanguageCode();
}
+#if BUILDFLAG(FULL_SAFE_BROWSING)
safe_browsing::PasswordProtectionService*
ChromePasswordManagerClient::GetPasswordProtectionService() const {
return safe_browsing::ChromePasswordProtectionService::
@@ -836,13 +836,6 @@ ChromePasswordManagerClient::GetPassword
void ChromePasswordManagerClient::CheckSafeBrowsingReputation(
const GURL& form_action,
const GURL& frame_url) {
- safe_browsing::PasswordProtectionService* pps =
- GetPasswordProtectionService();
- if (pps) {
- pps->MaybeStartPasswordFieldOnFocusRequest(
- web_contents(), web_contents()->GetLastCommittedURL(), form_action,
- frame_url, pps->GetAccountInfo().hosted_domain);
- }
}
#endif // defined(ON_FOCUS_PING_ENABLED)
@@ -852,22 +845,10 @@ void ChromePasswordManagerClient::CheckP
const std::vector<password_manager::MatchingReusedCredential>&
matching_reused_credentials,
bool password_field_exists) {
- safe_browsing::PasswordProtectionService* pps =
- GetPasswordProtectionService();
- if (!pps)
- return;
-
- pps->MaybeStartProtectedPasswordEntryRequest(
- web_contents(), web_contents()->GetLastCommittedURL(), username,
- password_type, matching_reused_credentials, password_field_exists);
}
+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
void ChromePasswordManagerClient::LogPasswordReuseDetectedEvent() {
- safe_browsing::PasswordProtectionService* pps =
- GetPasswordProtectionService();
- if (pps) {
- pps->MaybeLogPasswordReuseDetectedEvent(web_contents());
- }
}
#if !defined(OS_ANDROID)
@@ -1365,9 +1346,11 @@ void ChromePasswordManagerClient::OnPast
}
was_on_paste_called_ = true;
+#if defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED)
password_reuse_detection_manager_.OnPaste(std::move(text));
+#endif // defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED)
}
-#endif
+#endif // !defined(OS_ANDROID)
void ChromePasswordManagerClient::RenderFrameCreated(
content::RenderFrameHost* render_frame_host) {
@@ -1402,7 +1385,9 @@ void ChromePasswordManagerClient::OnInpu
if (key_event.windows_key_code == (ui::VKEY_V & 0x1f)) {
OnPaste();
} else {
+#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED)
password_reuse_detection_manager_.OnKeyPressedCommitted(key_event.text);
+#endif // defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED)
}
#endif // defined(OS_ANDROID)
}
@@ -1441,6 +1426,7 @@ bool ChromePasswordManagerClient::IsPass
is_enabled = false;
}
+ #if BUILDFLAG(FULL_SAFE_BROWSING)
// SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing
// warnings until user interaction. If the current page has a delayed warning,
// it'll have a user interaction observer attached. Disable password
@@ -1451,6 +1437,7 @@ bool ChromePasswordManagerClient::IsPass
observer->OnPasswordSaveOrAutofillDenied();
is_enabled = false;
}
+ #endif // BUILDFLAG(FULL_SAFE_BROWSING)
if (log_manager_->IsLoggingActive()) {
password_manager::BrowserSavePasswordProgressLogger logger(
--- chrome/browser/password_manager/chrome_password_manager_client.h.orig
+++ chrome/browser/password_manager/chrome_password_manager_client.h
@@ -207,13 +207,14 @@ class ChromePasswordManagerClient
void AnnotateNavigationEntry(bool has_password_field) override;
autofill::LanguageCode GetPageLanguage() const override;
+#if BUILDFLAG(FULL_SAFE_BROWSING)
safe_browsing::PasswordProtectionService* GetPasswordProtectionService()
const override;
#if defined(ON_FOCUS_PING_ENABLED)
void CheckSafeBrowsingReputation(const GURL& form_action,
const GURL& frame_url) override;
-#endif
+#endif // defined(ON_FOCUS_PING_ENABLED)
void CheckProtectedPasswordEntry(
password_manager::metrics_util::PasswordType reused_password_type,
@@ -221,6 +222,7 @@ class ChromePasswordManagerClient
const std::vector<password_manager::MatchingReusedCredential>&
matching_reused_credentials,
bool password_field_exists) override;
+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
void LogPasswordReuseDetectedEvent() override;
--- chrome/browser/permissions/abusive_origin_permission_revocation_request.cc.orig
+++ chrome/browser/permissions/abusive_origin_permission_revocation_request.cc
@@ -136,6 +136,7 @@ void AbusiveOriginPermissionRevocationRe
DCHECK(profile_);
DCHECK(callback_);
+#if BUILDFLAG(FULL_SAFE_BROWSING)
if (!AbusiveOriginNotificationsPermissionRevocationConfig::IsEnabled() ||
!safe_browsing::IsSafeBrowsingEnabled(*profile_->GetPrefs()) ||
IsOriginExemptedFromFutureRevocations(profile_, origin_)) {
@@ -182,6 +183,7 @@ void AbusiveOriginPermissionRevocationRe
}
}
NotifyCallback(Outcome::PERMISSION_NOT_REVOKED);
+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
}
void AbusiveOriginPermissionRevocationRequest::OnSafeBrowsingVerdictReceived(
--- chrome/browser/permissions/contextual_notification_permission_ui_selector.cc.orig
+++ chrome/browser/permissions/contextual_notification_permission_ui_selector.cc
@@ -17,7 +17,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/permissions/quiet_notification_permission_ui_config.h"
#include "chrome/browser/permissions/quiet_notification_permission_ui_state.h"
-#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/common/chrome_features.h"
#include "components/permissions/permission_request.h"
#include "components/permissions/request_type.h"
@@ -151,9 +150,6 @@ void ContextualNotificationPermissionUiS
}
void ContextualNotificationPermissionUiSelector::Cancel() {
- // The computation either finishes synchronously above, or is waiting on the
- // Safe Browsing check.
- safe_browsing_request_.reset();
}
bool ContextualNotificationPermissionUiSelector::IsPermissionRequestSupported(
@@ -179,24 +175,14 @@ void ContextualNotificationPermissionUiS
absl::optional<Decision> decision =
GetDecisionBasedOnSiteReputation(reputation);
- // If the PreloadData suggests this is an unacceptable site, ping Safe
- // Browsing to verify; but do not ping if it is not warranted.
+ // If the PreloadData suggests this is an unacceptable site, assume it is
+ // correct, since we can't access safe browsing.
if (!decision || (!decision->quiet_ui_reason && !decision->warning_reason)) {
Notify(Decision::UseNormalUiAndShowNoWarning());
- return;
+ } else {
+ // decision has a value, unwrap with .value()
+ Notify(decision.value());
}
-
- DCHECK(!safe_browsing_request_);
- DCHECK(g_browser_process->safe_browsing_service());
-
- // It is fine to use base::Unretained() here, as |safe_browsing_request_|
- // guarantees not to fire the callback after its destruction.
- safe_browsing_request_.emplace(
- g_browser_process->safe_browsing_service()->database_manager(),
- base::DefaultClock::GetInstance(), origin,
- base::BindOnce(&ContextualNotificationPermissionUiSelector::
- OnSafeBrowsingVerdictReceived,
- base::Unretained(this), *decision));
}
void ContextualNotificationPermissionUiSelector::OnSafeBrowsingVerdictReceived(
--- chrome/browser/permissions/prediction_based_permission_ui_selector.cc.orig
+++ chrome/browser/permissions/prediction_based_permission_ui_selector.cc
@@ -212,10 +212,8 @@ bool PredictionBasedPermissionUiSelector
permissions::RequestType request_type) {
// We need to also check `kQuietNotificationPrompts` here since there is no
// generic safeguard anywhere else in the stack.
- if (!base::FeatureList::IsEnabled(features::kQuietNotificationPrompts) ||
- !safe_browsing::IsSafeBrowsingEnabled(*(profile_->GetPrefs()))) {
+ if (!base::FeatureList::IsEnabled(features::kQuietNotificationPrompts))
return false;
- }
double hold_back_chance = 0.0;
bool is_permissions_predictions_enabled = false;
switch (request_type) {
--- chrome/browser/prefs/browser_prefs.cc.orig
+++ chrome/browser/prefs/browser_prefs.cc
@@ -243,7 +243,6 @@
#include "chrome/browser/nearby_sharing/common/nearby_share_prefs.h"
#include "chrome/browser/new_tab_page/modules/drive/drive_service.h"
#include "chrome/browser/new_tab_page/modules/photos/photos_service.h"
-#include "chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.h"
#include "chrome/browser/new_tab_page/modules/task_module/task_module_service.h"
#include "chrome/browser/new_tab_page/promos/promo_service.h"
#include "chrome/browser/search/background/ntp_custom_background_service.h"
@@ -1277,7 +1276,6 @@ void RegisterProfilePrefs(user_prefs::Pr
NewTabPageHandler::RegisterProfilePrefs(registry);
NewTabPageUI::RegisterProfilePrefs(registry);
NewTabUI::RegisterProfilePrefs(registry);
- ntp::SafeBrowsingHandler::RegisterProfilePrefs(registry);
ntp_tiles::CustomLinksManagerImpl::RegisterProfilePrefs(registry);
PhotosService::RegisterProfilePrefs(registry);
PinnedTabCodec::RegisterProfilePrefs(registry);
--- chrome/browser/reputation/reputation_service.cc.orig
+++ chrome/browser/reputation/reputation_service.cc
@@ -120,9 +120,7 @@ void ReputationService::GetReputationSta
ReputationCheckCallback callback) {
DCHECK(url.SchemeIsHTTPOrHTTPS());
- bool has_delayed_warning =
- !!safe_browsing::SafeBrowsingUserInteractionObserver::FromWebContents(
- web_contents);
+ bool has_delayed_warning = false;
LookalikeUrlService* service = LookalikeUrlService::Get(profile_);
if (service->EngagedSitesNeedUpdating()) {
--- chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.cc.orig
+++ chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.cc
@@ -17,15 +17,6 @@ SafeBrowsingMetricsProvider::~SafeBrowsi
void SafeBrowsingMetricsProvider::ProvideCurrentSessionData(
metrics::ChromeUserMetricsExtension* uma_proto) {
- Profile* profile = cached_profile_.GetMetricsProfile();
-
- if (!profile)
- return;
-
- SafeBrowsingState state = GetSafeBrowsingState(*profile->GetPrefs());
-
- base::UmaHistogramEnumeration(
- "SafeBrowsing.Pref.MainProfile.SafeBrowsingState", state);
}
} // namespace safe_browsing
--- chrome/browser/safe_browsing/url_lookup_service_factory.cc.orig
+++ chrome/browser/safe_browsing/url_lookup_service_factory.cc
@@ -59,28 +59,7 @@ RealTimeUrlLookupServiceFactory::RealTim
KeyedService* RealTimeUrlLookupServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
- if (!g_browser_process->safe_browsing_service()) {
- return nullptr;
- }
- Profile* profile = Profile::FromBrowserContext(context);
- auto url_loader_factory =
- std::make_unique<network::CrossThreadPendingSharedURLLoaderFactory>(
- g_browser_process->safe_browsing_service()->GetURLLoaderFactory(
- profile));
- return new RealTimeUrlLookupService(
- network::SharedURLLoaderFactory::Create(std::move(url_loader_factory)),
- VerdictCacheManagerFactory::GetForProfile(profile),
- base::BindRepeating(&safe_browsing::GetUserPopulationForProfile, profile),
- profile->GetPrefs(),
- std::make_unique<SafeBrowsingPrimaryAccountTokenFetcher>(
- IdentityManagerFactory::GetForProfile(profile)),
- base::BindRepeating(&safe_browsing::SyncUtils::
- AreSigninAndSyncSetUpForSafeBrowsingTokenFetches,
- SyncServiceFactory::GetForProfile(profile),
- IdentityManagerFactory::GetForProfile(profile)),
- profile->IsOffTheRecord(), g_browser_process->variations_service(),
- SafeBrowsingNavigationObserverManagerFactory::GetForBrowserContext(
- profile));
+ return nullptr;
}
} // namespace safe_browsing
--- chrome/browser/ssl/chrome_security_blocking_page_factory.cc.orig
+++ chrome/browser/ssl/chrome_security_blocking_page_factory.cc
@@ -142,15 +142,6 @@ CreateSettingsPageHelper() {
CreateChromeSettingsPageHelper();
}
-void LogSafeBrowsingSecuritySensitiveAction(
- safe_browsing::SafeBrowsingMetricsCollector* metrics_collector) {
- if (metrics_collector) {
- metrics_collector->AddSafeBrowsingEventToPref(
- safe_browsing::SafeBrowsingMetricsCollector::EventType::
- SECURITY_SENSITIVE_SSL_INTERSTITIAL);
- }
-}
-
} // namespace
std::unique_ptr<SSLBlockingPage>
@@ -192,10 +183,6 @@ ChromeSecurityBlockingPageFactory::Creat
}
}
- LogSafeBrowsingSecuritySensitiveAction(
- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
- Profile::FromBrowserContext(web_contents->GetBrowserContext())));
-
auto controller_client = std::make_unique<SSLErrorControllerClient>(
web_contents, ssl_info, cert_error, request_url,
std::move(metrics_helper), CreateSettingsPageHelper());
@@ -264,10 +251,6 @@ ChromeSecurityBlockingPageFactory::Creat
const GURL& request_url,
std::unique_ptr<SSLCertReporter> ssl_cert_reporter,
const net::SSLInfo& ssl_info) {
- LogSafeBrowsingSecuritySensitiveAction(
- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
- Profile::FromBrowserContext(web_contents->GetBrowserContext())));
-
auto page = std::make_unique<LegacyTLSBlockingPage>(
web_contents, cert_error, request_url, std::move(ssl_cert_reporter),
/*can_show_enhanced_protection_message=*/true, ssl_info,
@@ -289,10 +272,6 @@ ChromeSecurityBlockingPageFactory::Creat
std::unique_ptr<SSLCertReporter> ssl_cert_reporter,
const net::SSLInfo& ssl_info,
const std::string& mitm_software_name) {
- LogSafeBrowsingSecuritySensitiveAction(
- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
- Profile::FromBrowserContext(web_contents->GetBrowserContext())));
-
auto page = std::make_unique<MITMSoftwareBlockingPage>(
web_contents, cert_error, request_url, std::move(ssl_cert_reporter),
/*can_show_enhanced_protection_message=*/true, ssl_info,
@@ -314,10 +293,6 @@ ChromeSecurityBlockingPageFactory::Creat
const GURL& request_url,
std::unique_ptr<SSLCertReporter> ssl_cert_reporter,
const net::SSLInfo& ssl_info) {
- LogSafeBrowsingSecuritySensitiveAction(
- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
- Profile::FromBrowserContext(web_contents->GetBrowserContext())));
-
auto page = std::make_unique<BlockedInterceptionBlockingPage>(
web_contents, cert_error, request_url, std::move(ssl_cert_reporter),
/*can_show_enhanced_protection_message=*/true, ssl_info,
--- chrome/browser/ssl/sct_reporting_service_factory.cc.orig
+++ chrome/browser/ssl/sct_reporting_service_factory.cc
@@ -32,15 +32,7 @@ SCTReportingServiceFactory::~SCTReportin
KeyedService* SCTReportingServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* profile) const {
- safe_browsing::SafeBrowsingService* safe_browsing_service =
- g_browser_process->safe_browsing_service();
- // In unit tests the safe browsing service can be null, if this happens,
- // return null instead of crashing.
- if (!safe_browsing_service)
- return nullptr;
-
- return new SCTReportingService(safe_browsing_service,
- static_cast<Profile*>(profile));
+ return nullptr;
}
content::BrowserContext* SCTReportingServiceFactory::GetBrowserContextToUse(
--- chrome/browser/subresource_filter/chrome_content_subresource_filter_web_contents_helper_factory.cc.orig
+++ chrome/browser/subresource_filter/chrome_content_subresource_filter_web_contents_helper_factory.cc
@@ -6,7 +6,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/subresource_filter/subresource_filter_profile_context_factory.h"
#include "components/safe_browsing/core/browser/db/database_manager.h"
#include "components/subresource_filter/content/browser/content_subresource_filter_web_contents_helper.h"
@@ -18,10 +17,7 @@ namespace {
// available. Otherwise returns nullptr.
const scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager>
GetDatabaseManagerFromSafeBrowsingService() {
- safe_browsing::SafeBrowsingService* safe_browsing_service =
- g_browser_process->safe_browsing_service();
- return safe_browsing_service ? safe_browsing_service->database_manager()
- : nullptr;
+ return nullptr;
}
} // namespace
--- chrome/browser/ui/BUILD.gn.orig
+++ chrome/browser/ui/BUILD.gn
@@ -533,7 +533,6 @@ static_library("ui") {
"//components/renderer_context_menu",
"//components/resources",
"//components/safe_browsing/content/browser",
- "//components/safe_browsing/content/browser:client_side_detection",
"//components/safe_browsing/content/browser/password_protection",
"//components/safe_browsing/content/browser/web_ui",
"//components/safe_browsing/core/browser/db:database_manager",
--- chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc.orig
+++ chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc
@@ -16,6 +16,7 @@
#include "components/javascript_dialogs/tab_modal_dialog_manager.h"
#include "components/javascript_dialogs/tab_modal_dialog_view.h"
#include "components/navigation_metrics/navigation_metrics.h"
+#include "components/safe_browsing/buildflags.h"
#include "components/ukm/content/source_url_recorder.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/navigation_handle.h"
@@ -36,6 +37,7 @@ JavaScriptTabModalDialogManagerDelegateD
void JavaScriptTabModalDialogManagerDelegateDesktop::WillRunDialog() {
BrowserList::AddObserver(this);
+ #if BUILDFLAG(FULL_SAFE_BROWSING)
// SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing
// warnings until user interaction. If the current page has a delayed warning,
// it'll have a user interaction observer attached. Show the warning
@@ -46,6 +48,7 @@ void JavaScriptTabModalDialogManagerDele
if (observer) {
observer->OnJavaScriptDialog();
}
+ #endif // BUILDFLAG(FULL_SAFE_BROWSING)
}
void JavaScriptTabModalDialogManagerDelegateDesktop::DidCloseDialog() {
--- chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.cc.orig
+++ chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.cc
@@ -11,7 +11,10 @@
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/task_runner_util.h"
+#include "components/safe_browsing/buildflags.h"
+#if BUILDFLAG(FULL_SAFE_BROWSING)
#include "chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.h"
+#endif
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h"
#include "content/public/browser/web_contents.h"
@@ -22,6 +25,7 @@
namespace {
+#if BUILDFLAG(FULL_SAFE_BROWSING)
void CompletionCallback(
content::WebContentsViewDelegate::DropCompletionCallback callback,
const enterprise_connectors::ContentAnalysisDelegate::Data& data,
@@ -63,6 +67,7 @@ enterprise_connectors::ContentAnalysisDe
}
return data;
}
+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
// Helper class to handle WebContents being destroyed while files are opened in
// the threadpool. This class deletes itself either when it's no longer needed
@@ -76,6 +81,7 @@ class HandleDropScanData : public conten
: content::WebContentsObserver(web_contents),
callback_(std::move(callback)) {}
+#if BUILDFLAG(FULL_SAFE_BROWSING)
void ScanData(
enterprise_connectors::ContentAnalysisDelegate::Data analysis_data) {
DCHECK(web_contents());
@@ -87,6 +93,7 @@ class HandleDropScanData : public conten
delete this;
}
+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
void WebContentsDestroyed() override { delete this; }
@@ -106,13 +113,16 @@ void HandleOnPerformDrop(
content::WebContents* web_contents,
const content::DropData& drop_data,
content::WebContentsViewDelegate::DropCompletionCallback callback) {
+#if BUILDFLAG(FULL_SAFE_BROWSING)
enterprise_connectors::ContentAnalysisDelegate::Data data;
+#endif
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
auto connector =
drop_data.filenames.empty()
? enterprise_connectors::AnalysisConnector::BULK_DATA_ENTRY
: enterprise_connectors::AnalysisConnector::FILE_ATTACHED;
+#if BUILDFLAG(FULL_SAFE_BROWSING)
if (!enterprise_connectors::ContentAnalysisDelegate::IsEnabled(
profile, web_contents->GetLastCommittedURL(), &data, connector)) {
std::move(callback).Run(
@@ -154,4 +164,8 @@ void HandleOnPerformDrop(
std::move(callback).Run(
content::WebContentsViewDelegate::DropCompletionResult::kContinue);
}
+#else
+ std::move(callback).Run(
+ content::WebContentsViewDelegate::DropCompletionResult::kContinue);
+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
}
--- chrome/browser/ui/views/download/download_item_view.cc.orig
+++ chrome/browser/ui/views/download/download_item_view.cc
@@ -837,9 +837,7 @@ void DownloadItemView::UpdateLabels() {
deep_scanning_label_->SetVisible(mode_ ==
download::DownloadItemMode::kDeepScanning);
if (deep_scanning_label_->GetVisible()) {
- const int id = (model_->download() &&
- safe_browsing::DeepScanningRequest::ShouldUploadBinary(
- model_->download()))
+ const int id = model_->download()
? IDS_PROMPT_DEEP_SCANNING_DOWNLOAD
: IDS_PROMPT_DEEP_SCANNING_APP_DOWNLOAD;
const std::u16string filename = ElidedFilename(*deep_scanning_label_);
@@ -886,11 +884,15 @@ void DownloadItemView::UpdateButtons() {
}
const bool allow_open_during_deep_scan =
+#if BUILDFLAG(FULL_SAFE_BROWSING)
(mode_ == download::DownloadItemMode::kDeepScanning) &&
!enterprise_connectors::ConnectorsServiceFactory::GetForBrowserContext(
model_->profile())
->DelayUntilVerdict(
enterprise_connectors::AnalysisConnector::FILE_DOWNLOADED);
+#else
+ false;
+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
open_button_->SetEnabled((mode_ == download::DownloadItemMode::kNormal) ||
prompt_to_scan || allow_open_during_deep_scan);
@@ -1427,7 +1429,9 @@ void DownloadItemView::ShowContextMenuIm
}
void DownloadItemView::OpenDownloadDuringAsyncScanning() {
+#if BUILDFLAG(FULL_SAFE_BROWSING)
model_->CompleteSafeBrowsingScan();
+#endif
model_->SetOpenWhenComplete(true);
}
--- chrome/browser/ui/webui/downloads/downloads_dom_handler.cc.orig
+++ chrome/browser/ui/webui/downloads/downloads_dom_handler.cc
@@ -366,7 +366,6 @@ void DownloadsDOMHandler::OpenDuringScan
if (download) {
DownloadItemModel model(download);
model.SetOpenWhenComplete(true);
- model.CompleteSafeBrowsingScan();
}
}
--- chrome/browser/ui/webui/management/management_ui_handler.cc.orig
+++ chrome/browser/ui/webui/management/management_ui_handler.cc
@@ -805,12 +805,6 @@ base::Value ManagementUIHandler::GetThre
&info);
}
- if (connectors_service->GetAppliedRealTimeUrlCheck() !=
- safe_browsing::REAL_TIME_CHECK_DISABLED) {
- AddThreatProtectionPermission(kManagementOnPageVisitedEvent,
- kManagementOnPageVisitedVisibleData, &info);
- }
-
const std::string enterprise_manager =
connectors_service->GetManagementDomain();
--- chrome/browser/webshare/share_service_impl.cc.orig
+++ chrome/browser/webshare/share_service_impl.cc
@@ -14,7 +14,9 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/common/chrome_features.h"
+#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
#include "components/safe_browsing/content/common/file_type_policies.h"
+#endif
#include "components/safe_browsing/core/browser/db/database_manager.h"
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
@@ -182,11 +184,13 @@ void ShareServiceImpl::Share(const std::
// Check if at least one file is marked by the download protection service
// to send a ping to check this file type.
const base::FilePath path = base::FilePath::FromUTF8Unsafe(file->name);
+#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
if (!should_check_url &&
safe_browsing::FileTypePolicies::GetInstance()->IsCheckedBinaryFile(
path)) {
should_check_url = true;
}
+#endif // BUILDFLAG(SAFE_BROWSING_AVAILABLE)
// In the case where the original blob handle was to a native file (of
// unknown size), the serialized data does not contain an accurate file
@@ -196,6 +200,7 @@ void ShareServiceImpl::Share(const std::
}
DCHECK(!safe_browsing_request_);
+#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
if (should_check_url && g_browser_process->safe_browsing_service()) {
safe_browsing_request_.emplace(
g_browser_process->safe_browsing_service()->database_manager(),
@@ -205,6 +210,7 @@ void ShareServiceImpl::Share(const std::
std::move(files), std::move(callback)));
return;
}
+#endif // BUILDFLAG(SAFE_BROWSING_AVAILABLE)
OnSafeBrowsingResultReceived(title, text, share_url, std::move(files),
std::move(callback),
--- chrome/test/BUILD.gn.orig
+++ chrome/test/BUILD.gn
@@ -1196,7 +1196,6 @@ if (!is_android && !is_fuchsia) {
"//components/resources",
"//components/safe_browsing:buildflags",
"//components/safe_browsing/content/browser",
- "//components/safe_browsing/content/browser:client_side_detection",
"//components/safe_browsing/content/browser:safe_browsing_service",
"//components/safe_browsing/content/browser/password_protection",
"//components/safe_browsing/content/browser/password_protection:test_support",
@@ -5349,7 +5348,6 @@ test("unit_tests") {
"//components/resources",
"//components/safe_browsing:buildflags",
"//components/safe_browsing/content/browser",
- "//components/safe_browsing/content/browser:client_side_detection",
"//components/safe_browsing/content/browser/password_protection",
"//components/safe_browsing/content/browser/password_protection:mock_password_protection",
"//components/safe_browsing/content/browser/web_ui",
--- components/password_manager/content/browser/content_password_manager_driver.cc.orig
+++ components/password_manager/content/browser/content_password_manager_driver.cc
@@ -407,7 +407,7 @@ void ContentPasswordManagerDriver::Check
if (client_->GetMetricsRecorder()) {
client_->GetMetricsRecorder()->RecordUserFocusedPasswordField();
}
-#if defined(ON_FOCUS_PING_ENABLED)
+#if defined(ON_FOCUS_PING_ENABLED) && BUILDFLAG(FULL_SAFE_BROWSING)
client_->CheckSafeBrowsingReputation(form_action, frame_url);
#endif
}
--- components/password_manager/core/browser/password_manager_client.h.orig
+++ components/password_manager/core/browser/password_manager_client.h
@@ -339,11 +339,14 @@ class PasswordManagerClient {
// Returns the current best guess as to the page's display language.
virtual autofill::LanguageCode GetPageLanguage() const;
+#if (defined(ON_FOCUS_PING_ENABLED) || defined(PASSWORD_REUSE_DETECTION_ENABLED)) && \
+ BUILDFLAG(FULL_SAFE_BROWSING)
// Return the PasswordProtectionService associated with this instance.
virtual safe_browsing::PasswordProtectionService*
GetPasswordProtectionService() const = 0;
+#endif
-#if defined(ON_FOCUS_PING_ENABLED)
+#if defined(ON_FOCUS_PING_ENABLED) && BUILDFLAG(FULL_SAFE_BROWSING)
// Checks the safe browsing reputation of the webpage when the
// user focuses on a username/password field. This is used for reporting
// only, and won't trigger a warning.
@@ -351,6 +354,7 @@ class PasswordManagerClient {
const GURL& frame_url) = 0;
#endif
+#if defined(PASSWORD_REUSE_DETECTION_ENABLED)
// Checks the safe browsing reputation of the webpage where password reuse
// happens. This is called by the PasswordReuseDetectionManager when a
// protected password is typed on the wrong domain. This may trigger a
@@ -363,6 +367,7 @@ class PasswordManagerClient {
const std::string& username,
const std::vector<MatchingReusedCredential>& matching_reused_credentials,
bool password_field_exists) = 0;
+#endif
// Records a Chrome Sync event that GAIA password reuse was detected.
virtual void LogPasswordReuseDetectedEvent() = 0;
--- components/password_manager/core/browser/password_reuse_detection_manager.cc.orig
+++ components/password_manager/core/browser/password_reuse_detection_manager.cc
@@ -161,9 +161,11 @@ void PasswordReuseDetectionManager::OnRe
? reused_protected_password_hash->username
: "";
+ #if defined(PASSWORD_REUSE_DETECTION_ENABLED)
client_->CheckProtectedPasswordEntry(reused_password_type, username,
matching_reused_credentials,
password_field_detected);
+ #endif
}
void PasswordReuseDetectionManager::SetClockForTesting(base::Clock* clock) {
--- components/safe_browsing/content/browser/BUILD.gn.orig
+++ components/safe_browsing/content/browser/BUILD.gn
@@ -82,8 +82,6 @@ source_set("browser") {
"threat_details_cache.h",
"threat_details_history.cc",
"threat_details_history.h",
- "user_population.cc",
- "user_population.h",
"web_api_handshake_checker.cc",
"web_api_handshake_checker.h",
]
--- components/safe_browsing/content/common/proto/BUILD.gn.orig
+++ components/safe_browsing/content/common/proto/BUILD.gn
@@ -5,8 +5,12 @@
import("//components/safe_browsing/buildflags.gni")
import("//third_party/protobuf/proto_library.gni")
-if (safe_browsing_mode != 0) {
+# Although this was gated on safe_browsing_mode != 0, a considerable amount
+# of source code that relies on the types included in download_file_types.pb.h
+# is not gated on BUILDFLAG(SAFE_BROWSING_AVAILABLE). This is far less
+# invasive than the alternative.
+# if (safe_browsing_mode != 0) {
proto_library("download_file_types_proto") {
sources = [ "download_file_types.proto" ]
}
-}
+# }
--- components/safe_browsing/content/common/safe_browsing.mojom.orig
+++ components/safe_browsing/content/common/safe_browsing.mojom
@@ -120,7 +120,6 @@ enum PhishingDetectorResult {
INVALID_SCORE = 4,
};
-[EnableIf=full_safe_browsing]
// Interface for setting the CSD model and to start phishing classification.
interface PhishingDetector {
// A classification model for client-side phishing detection.
--- content/browser/file_system_access/safe_move_helper.cc.orig
+++ content/browser/file_system_access/safe_move_helper.cc
@@ -150,14 +150,8 @@ void SafeMoveHelper::Start(SafeMoveHelpe
return;
}
- if (!RequireSecurityChecks() || !manager_->permission_context()) {
DidAfterWriteCheck(
FileSystemAccessPermissionContext::AfterWriteCheckResult::kAllow);
- return;
- }
-
- ComputeHashForSourceFile(base::BindOnce(&SafeMoveHelper::DoAfterWriteCheck,
- weak_factory_.GetWeakPtr()));
}
void SafeMoveHelper::ComputeHashForSourceFile(HashCallback callback) {
@@ -177,38 +171,6 @@ void SafeMoveHelper::ComputeHashForSourc
std::move(wrapped_callback), source_url()));
}
-void SafeMoveHelper::DoAfterWriteCheck(base::File::Error hash_result,
- const std::string& hash,
- int64_t size) {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
-
- if (hash_result != base::File::FILE_OK) {
- // Calculating the hash failed.
- std::move(callback_).Run(file_system_access_error::FromStatus(
- blink::mojom::FileSystemAccessStatus::kOperationAborted,
- "Failed to perform Safe Browsing check."));
- return;
- }
-
- if (!manager_) {
- std::move(callback_).Run(file_system_access_error::FromStatus(
- blink::mojom::FileSystemAccessStatus::kOperationAborted));
- return;
- }
-
- auto item = std::make_unique<FileSystemAccessWriteItem>();
- item->target_file_path = dest_url().path();
- item->full_path = source_url().path();
- item->sha256_hash = hash;
- item->size = size;
- item->frame_url = context_.url;
- item->has_user_gesture = has_transient_user_activation_;
- manager_->permission_context()->PerformAfterWriteChecks(
- std::move(item), context_.frame_id,
- base::BindOnce(&SafeMoveHelper::DidAfterWriteCheck,
- weak_factory_.GetWeakPtr()));
-}
-
void SafeMoveHelper::DidAfterWriteCheck(
FileSystemAccessPermissionContext::AfterWriteCheckResult result) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
--- content/browser/file_system_access/safe_move_helper.h.orig
+++ content/browser/file_system_access/safe_move_helper.h
@@ -52,9 +52,6 @@ class CONTENT_EXPORT SafeMoveHelper {
private:
SEQUENCE_CHECKER(sequence_checker_);
- void DoAfterWriteCheck(base::File::Error hash_result,
- const std::string& hash,
- int64_t size);
void DidAfterWriteCheck(
FileSystemAccessPermissionContext::AfterWriteCheckResult result);
void DidFileSkipQuarantine(base::File::Error result);
--- content/public/browser/file_system_access_permission_context.h.orig
+++ content/public/browser/file_system_access_permission_context.h
@@ -107,12 +107,6 @@ class FileSystemAccessPermissionContext
base::OnceCallback<void(SensitiveDirectoryResult)> callback) = 0;
enum class AfterWriteCheckResult { kAllow, kBlock };
- // Runs a recently finished write operation through checks such as malware
- // or other security checks to determine if the write should be allowed.
- virtual void PerformAfterWriteChecks(
- std::unique_ptr<FileSystemAccessWriteItem> item,
- GlobalRenderFrameHostId frame_id,
- base::OnceCallback<void(AfterWriteCheckResult)> callback) = 0;
// Returns whether the give |origin| already allows read permission, or it is
// possible to request one. This is used to block file dialogs from being
--- extensions/browser/updater/update_service.cc.orig
+++ extensions/browser/updater/update_service.cc
@@ -111,13 +111,6 @@ void UpdateService::OnEvent(Events event
break;
}
- if (should_perform_action_on_omaha_attributes) {
- base::Value attributes = GetExtensionOmahaAttributes(extension_id);
- // Note that it's important to perform actions even if |attributes| is
- // empty, missing values may default to false and have associated logic.
- ExtensionSystem::Get(browser_context_)
- ->PerformActionBasedOnOmahaAttributes(extension_id, attributes);
- }
}
UpdateService::UpdateService(
--- weblayer/BUILD.gn.orig
+++ weblayer/BUILD.gn
@@ -463,7 +463,6 @@ source_set("weblayer_lib_base") {
"//components/prefs",
"//components/profile_metrics",
"//components/safe_browsing/content/browser",
- "//components/safe_browsing/content/browser:client_side_detection",
"//components/safe_browsing/content/common:interfaces",
"//components/safe_browsing/content/renderer:throttles",
"//components/safe_browsing/content/renderer/phishing_classifier",
|