This repository has been archived by the owner on Mar 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
0001-fix-building-without-safebrowsing.patch
1343 lines (1256 loc) · 56.9 KB
/
0001-fix-building-without-safebrowsing.patch
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
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -710,30 +710,6 @@ void SetApplicationLocaleOnIOThread(cons
g_io_thread_application_locale.Get() = locale;
}
-// An implementation of the SSLCertReporter interface used by
-// SSLErrorHandler. Uses CertificateReportingService to send reports. The
-// service handles queueing and re-sending of failed reports. Each certificate
-// error creates a new instance of this class.
-class CertificateReportingServiceCertReporter : public SSLCertReporter {
- public:
- explicit CertificateReportingServiceCertReporter(
- content::WebContents* web_contents)
- : service_(CertificateReportingServiceFactory::GetForBrowserContext(
- web_contents->GetBrowserContext())) {}
- ~CertificateReportingServiceCertReporter() override {}
-
- // SSLCertReporter implementation
- void ReportInvalidCertificateChain(
- const std::string& serialized_report) override {
- service_->Send(serialized_report);
- }
-
- private:
- CertificateReportingService* service_;
-
- DISALLOW_COPY_AND_ASSIGN(CertificateReportingServiceCertReporter);
-};
-
#if defined(OS_ANDROID)
float GetDeviceScaleAdjustment() {
static const float kMinFSM = 1.05f;
@@ -1890,7 +1866,7 @@ void ChromeContentBrowserClient::AppendE
// Disable client-side phishing detection in the renderer if it is
// disabled in the Profile preferences or the browser process.
if (!prefs->GetBoolean(prefs::kSafeBrowsingEnabled) ||
- !g_browser_process->safe_browsing_detection_service()) {
+ true) {
command_line->AppendSwitch(
switches::kDisableClientSidePhishingDetection);
}
@@ -2489,7 +2465,7 @@ void ChromeContentBrowserClient::AllowCe
SSLErrorHandler::HandleSSLError(
web_contents, cert_error, ssl_info, request_url,
expired_previous_decision,
- std::make_unique<CertificateReportingServiceCertReporter>(web_contents),
+ nullptr,
callback, SSLErrorHandler::BlockingPageReadyCallback());
}
@@ -2720,8 +2696,6 @@ bool ChromeContentBrowserClient::CanCrea
void ChromeContentBrowserClient::ResourceDispatcherHostCreated() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- safe_browsing_service_ = g_browser_process->safe_browsing_service();
-
for (size_t i = 0; i < extra_parts_.size(); ++i)
extra_parts_[i]->ResourceDispatcherHostCreated();
@@ -3681,7 +3655,7 @@ ChromeContentBrowserClient::CreateThrott
switches::kCommittedInterstitials)) {
throttles.push_back(std::make_unique<SSLErrorNavigationThrottle>(
handle,
- std::make_unique<CertificateReportingServiceCertReporter>(web_contents),
+ nullptr,
base::Bind(&SSLErrorHandler::HandleSSLError)));
}
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -491,18 +491,6 @@ ProfileImpl::ProfileImpl(
create_mode == CREATE_MODE_SYNCHRONOUS);
#endif
- scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_service(
- g_browser_process->safe_browsing_service());
- prefs::mojom::TrackedPreferenceValidationDelegatePtr pref_validation_delegate;
- if (safe_browsing_service.get()) {
- auto pref_validation_delegate_impl =
- safe_browsing_service->CreatePreferenceValidationDelegate(this);
- if (pref_validation_delegate_impl) {
- mojo::MakeStrongBinding(std::move(pref_validation_delegate_impl),
- mojo::MakeRequest(&pref_validation_delegate));
- }
- }
-
content::BrowserContext::Initialize(this, path_);
{
@@ -511,7 +499,7 @@ ProfileImpl::ProfileImpl(
->CreateDelegate();
delegate->InitPrefRegistry(pref_registry_.get());
prefs_ = chrome_prefs::CreateProfilePrefs(
- path_, std::move(pref_validation_delegate),
+ path_, nullptr,
profile_policy_connector_->policy_service(), supervised_user_settings,
CreateExtensionPrefStore(this, false), pref_registry_, async_prefs,
GetIOTaskRunner(), std::move(delegate));
--- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
@@ -347,8 +347,7 @@ void LogCommittedPreviewsDecision(
} // namespace
ChromeResourceDispatcherHostDelegate::ChromeResourceDispatcherHostDelegate()
- : download_request_limiter_(g_browser_process->download_request_limiter()),
- safe_browsing_(g_browser_process->safe_browsing_service())
+ : download_request_limiter_(g_browser_process->download_request_limiter())
#if BUILDFLAG(ENABLE_EXTENSIONS)
, user_script_listener_(new extensions::UserScriptListener())
#endif
@@ -398,8 +397,6 @@ void ChromeResourceDispatcherHostDelegat
content::AppCacheService* appcache_service,
ResourceType resource_type,
std::vector<std::unique_ptr<content::ResourceThrottle>>* throttles) {
- if (safe_browsing_.get())
- safe_browsing_->OnResourceRequest(request);
ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
client_hints::RequestBeginning(request, io_data->GetCookieSettings());
@@ -533,7 +530,7 @@ void ChromeResourceDispatcherHostDelegat
content::ResourceThrottle* first_throttle = NULL;
#if defined(OS_ANDROID)
first_throttle = DataReductionProxyResourceThrottle::MaybeCreate(
- request, resource_context, resource_type, safe_browsing_.get());
+ request, resource_context, resource_type, nullptr);
#endif // defined(OS_ANDROID)
#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
@@ -546,7 +543,7 @@ void ChromeResourceDispatcherHostDelegat
if (!url_loader_throttle_used) {
first_throttle = MaybeCreateSafeBrowsingResourceThrottle(
- request, resource_type, safe_browsing_.get(), io_data);
+ request, resource_type, nullptr, io_data);
}
}
#endif // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
--- a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
+++ b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
@@ -250,110 +250,6 @@ BadClockBlockingPage* CreateBadClockBloc
base::Callback<void(content::CertificateRequestResultType)>());
}
-safe_browsing::SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage(
- content::WebContents* web_contents) {
- safe_browsing::SBThreatType threat_type =
- safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
- GURL request_url("http://example.com");
- std::string url_param;
- if (net::GetValueForKeyInQuery(web_contents->GetURL(),
- "url",
- &url_param)) {
- if (GURL(url_param).is_valid()) {
- request_url = GURL(url_param);
- }
- }
- GURL main_frame_url(request_url);
- // TODO(mattm): add flag to change main_frame_url or add dedicated flag to
- // test subresource interstitials.
- std::string type_param;
- if (net::GetValueForKeyInQuery(web_contents->GetURL(),
- "type",
- &type_param)) {
- // TODO(mattm): add param for SB_THREAT_TYPE_URL_UNWANTED.
- if (type_param == "malware") {
- threat_type = safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
- } else if (type_param == "phishing") {
- threat_type = safe_browsing::SB_THREAT_TYPE_URL_PHISHING;
- } else if (type_param == "clientside_malware") {
- threat_type = safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE;
- } else if (type_param == "clientside_phishing") {
- threat_type = safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING;
- }
- }
- safe_browsing::SafeBrowsingBlockingPage::UnsafeResource resource;
- resource.url = request_url;
- resource.is_subresource = request_url != main_frame_url;
- resource.is_subframe = false;
- resource.threat_type = threat_type;
- resource.web_contents_getter =
- security_interstitials::UnsafeResource::GetWebContentsGetter(
- web_contents->GetMainFrame()->GetProcess()->GetID(),
- web_contents->GetMainFrame()->GetRoutingID());
- resource.threat_source = g_browser_process->safe_browsing_service()
- ->database_manager()
- ->GetThreatSource();
-
- // Normally safebrowsing interstitial types which block the main page load
- // (SB_THREAT_TYPE_URL_MALWARE, SB_THREAT_TYPE_URL_PHISHING, and
- // SB_THREAT_TYPE_URL_UNWANTED on main-frame loads) would expect there to be a
- // pending navigation when the SafeBrowsingBlockingPage is created. This demo
- // creates a SafeBrowsingBlockingPage but does not actually show a real
- // interstitial. Instead it extracts the html and displays it manually, so the
- // parts which depend on the NavigationEntry are not hit.
- return safe_browsing::SafeBrowsingBlockingPage::CreateBlockingPage(
- g_browser_process->safe_browsing_service()->ui_manager().get(),
- web_contents, main_frame_url, resource);
-}
-
-TestSafeBrowsingBlockingPageQuiet* CreateSafeBrowsingQuietBlockingPage(
- content::WebContents* web_contents) {
- safe_browsing::SBThreatType threat_type =
- safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
- GURL request_url("http://example.com");
- std::string url_param;
- if (net::GetValueForKeyInQuery(web_contents->GetURL(), "url", &url_param)) {
- if (GURL(url_param).is_valid())
- request_url = GURL(url_param);
- }
- GURL main_frame_url(request_url);
- std::string type_param;
- bool is_giant_webview = false;
- if (net::GetValueForKeyInQuery(web_contents->GetURL(), "type", &type_param)) {
- if (type_param == "malware") {
- threat_type = safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
- } else if (type_param == "phishing") {
- threat_type = safe_browsing::SB_THREAT_TYPE_URL_PHISHING;
- } else if (type_param == "giant") {
- threat_type = safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
- is_giant_webview = true;
- }
- }
- safe_browsing::SafeBrowsingBlockingPage::UnsafeResource resource;
- resource.url = request_url;
- resource.is_subresource = request_url != main_frame_url;
- resource.is_subframe = false;
- resource.threat_type = threat_type;
- resource.web_contents_getter =
- security_interstitials::UnsafeResource::GetWebContentsGetter(
- web_contents->GetMainFrame()->GetProcess()->GetID(),
- web_contents->GetMainFrame()->GetRoutingID());
- resource.threat_source = g_browser_process->safe_browsing_service()
- ->database_manager()
- ->GetThreatSource();
-
- // Normally safebrowsing interstitial types which block the main page load
- // (SB_THREAT_TYPE_URL_MALWARE, SB_THREAT_TYPE_URL_PHISHING, and
- // SB_THREAT_TYPE_URL_UNWANTED on main-frame loads) would expect there to be a
- // pending navigation when the SafeBrowsingBlockingPage is created. This demo
- // creates a SafeBrowsingBlockingPage but does not actually show a real
- // interstitial. Instead it extracts the html and displays it manually, so the
- // parts which depend on the NavigationEntry are not hit.
- return TestSafeBrowsingBlockingPageQuiet::CreateBlockingPage(
- g_browser_process->safe_browsing_service()->ui_manager().get(),
- web_contents, main_frame_url, resource, is_giant_webview);
-}
-
#if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION)
CaptivePortalBlockingPage* CreateCaptivePortalBlockingPage(
content::WebContents* web_contents) {
@@ -457,8 +353,6 @@ void InterstitialHTMLSource::StartDataRe
CreateSSLBlockingPage(web_contents, true /* is superfish */));
} else if (path_without_query == "/mitm-software-ssl") {
interstitial_delegate.reset(CreateMITMSoftwareBlockingPage(web_contents));
- } else if (path_without_query == "/safebrowsing") {
- interstitial_delegate.reset(CreateSafeBrowsingBlockingPage(web_contents));
} else if (path_without_query == "/clock") {
interstitial_delegate.reset(CreateBadClockBlockingPage(web_contents));
#if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION)
@@ -469,11 +363,6 @@ void InterstitialHTMLSource::StartDataRe
if (path_without_query == "/supervised_user") {
html = GetSupervisedUserInterstitialHTML(path);
- } else if (path_without_query == "/quietsafebrowsing") {
- TestSafeBrowsingBlockingPageQuiet* blocking_page =
- CreateSafeBrowsingQuietBlockingPage(web_contents);
- interstitial_delegate.reset(blocking_page);
- html = blocking_page->GetHTML();
} else if (interstitial_delegate.get()) {
html = interstitial_delegate.get()->GetHTMLContents();
} else {
--- a/chrome/browser/extensions/blacklist_state_fetcher.cc
+++ b/chrome/browser/extensions/blacklist_state_fetcher.cc
@@ -31,10 +31,10 @@ BlacklistStateFetcher::~BlacklistStateFe
void BlacklistStateFetcher::Request(const std::string& id,
const RequestCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (!safe_browsing_config_) {
- if (g_browser_process && g_browser_process->safe_browsing_service()) {
- SetSafeBrowsingConfig(
- g_browser_process->safe_browsing_service()->GetProtocolConfig());
+ if (true) {
+ if (false) {
+ //SetSafeBrowsingConfig(
+ // g_browser_process->safe_browsing_service()->GetProtocolConfig());
} else {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(callback, BLACKLISTED_UNKNOWN));
@@ -47,10 +47,10 @@ void BlacklistStateFetcher::Request(cons
if (request_already_sent)
return;
- if (g_browser_process && g_browser_process->safe_browsing_service()) {
- url_loader_factory_ =
- g_browser_process->safe_browsing_service()->GetURLLoaderFactory();
- }
+ //if (g_browser_process && g_browser_process->safe_browsing_service()) {
+ // url_loader_factory_ =
+ // g_browser_process->safe_browsing_service()->GetURLLoaderFactory();
+ //}
SendRequest(id);
}
@@ -110,13 +110,14 @@ void BlacklistStateFetcher::SendRequest(
base::Unretained(this), fetcher));
}
-void BlacklistStateFetcher::SetSafeBrowsingConfig(
- const safe_browsing::SafeBrowsingProtocolConfig& config) {
- safe_browsing_config_.reset(
- new safe_browsing::SafeBrowsingProtocolConfig(config));
-}
+//void BlacklistStateFetcher::SetSafeBrowsingConfig(
+// const safe_browsing::SafeBrowsingProtocolConfig& config) {
+// safe_browsing_config_.reset(
+// new safe_browsing::SafeBrowsingProtocolConfig(config));
+//}
GURL BlacklistStateFetcher::RequestUrl() const {
+ /*
std::string url = base::StringPrintf(
"%s/%s?client=%s&appver=%s&pver=2.2",
safe_browsing_config_->url_prefix.c_str(),
@@ -129,6 +130,8 @@ GURL BlacklistStateFetcher::RequestUrl()
net::EscapeQueryParamValue(api_key, true).c_str());
}
return GURL(url);
+ */
+ return GURL();
}
void BlacklistStateFetcher::OnURLLoaderComplete(
--- a/chrome/browser/extensions/blacklist_state_fetcher.h
+++ b/chrome/browser/extensions/blacklist_state_fetcher.h
@@ -34,8 +34,8 @@ class BlacklistStateFetcher {
virtual void Request(const std::string& id, const RequestCallback& callback);
- void SetSafeBrowsingConfig(
- const safe_browsing::SafeBrowsingProtocolConfig& config);
+ //void SetSafeBrowsingConfig(
+ // const safe_browsing::SafeBrowsingProtocolConfig& config);
protected:
void OnURLLoaderComplete(network::SimpleURLLoader* url_loader,
@@ -55,8 +55,8 @@ class BlacklistStateFetcher {
void SendRequest(const std::string& id);
- std::unique_ptr<safe_browsing::SafeBrowsingProtocolConfig>
- safe_browsing_config_;
+ //std::unique_ptr<safe_browsing::SafeBrowsingProtocolConfig>
+ // safe_browsing_config_;
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
// SimpleURLLoader -> (owned loader, extension id).
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -289,13 +289,6 @@ ChromeDownloadManagerDelegate::~ChromeDo
void ChromeDownloadManagerDelegate::SetDownloadManager(DownloadManager* dm) {
download_manager_ = dm;
-
- safe_browsing::SafeBrowsingService* sb_service =
- g_browser_process->safe_browsing_service();
- if (sb_service && !profile_->IsOffTheRecord()) {
- // Include this download manager in the set monitored by safe browsing.
- sb_service->AddDownloadManager(dm);
- }
}
#if defined(OS_ANDROID)
@@ -579,16 +572,6 @@ download::InProgressCache* ChromeDownloa
void ChromeDownloadManagerDelegate::SanitizeSavePackageResourceName(
base::FilePath* filename) {
- safe_browsing::FileTypePolicies* file_type_policies =
- safe_browsing::FileTypePolicies::GetInstance();
-
- if (file_type_policies->GetFileDangerLevel(*filename) ==
- safe_browsing::DownloadFileType::NOT_DANGEROUS)
- return;
-
- base::FilePath default_filename = base::FilePath::FromUTF8Unsafe(
- l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
- *filename = filename->AddExtension(default_filename.BaseName().value());
}
void ChromeDownloadManagerDelegate::OpenDownloadUsingPlatformHandler(
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -71,7 +71,6 @@
#include "chrome/browser/printing/print_preview_dialog_controller.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h"
-#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/status_icons/status_tray.h"
#include "chrome/browser/ui/browser_dialogs.h"
@@ -350,8 +349,6 @@ void BrowserProcessImpl::StartTearDown()
// that URLFetcher operation before going away.)
metrics_services_manager_.reset();
intranet_redirect_detector_.reset();
- if (safe_browsing_service_.get())
- safe_browsing_service()->ShutDown();
network_time_tracker_.reset();
#if BUILDFLAG(ENABLE_PLUGINS)
plugins_resource_service_.reset();
@@ -964,22 +961,6 @@ StatusTray* BrowserProcessImpl::status_t
return status_tray_.get();
}
-safe_browsing::SafeBrowsingService*
-BrowserProcessImpl::safe_browsing_service() {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- if (!created_safe_browsing_service_)
- CreateSafeBrowsingService();
- return safe_browsing_service_.get();
-}
-
-safe_browsing::ClientSideDetectionService*
- BrowserProcessImpl::safe_browsing_detection_service() {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- if (safe_browsing_service())
- return safe_browsing_service()->safe_browsing_detection_service();
- return NULL;
-}
-
subresource_filter::ContentRulesetService*
BrowserProcessImpl::subresource_filter_ruleset_service() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -1247,16 +1228,6 @@ void BrowserProcessImpl::CreateBackgroun
#endif
}
-void BrowserProcessImpl::CreateSafeBrowsingService() {
- DCHECK(!safe_browsing_service_);
- // Set this flag to true so that we don't retry indefinitely to
- // create the service class if there was an error.
- created_safe_browsing_service_ = true;
- safe_browsing_service_ =
- safe_browsing::SafeBrowsingService::CreateSafeBrowsingService();
- safe_browsing_service_->Initialize();
-}
-
void BrowserProcessImpl::CreateSubresourceFilterRulesetService() {
DCHECK(!subresource_filter_ruleset_service_);
created_subresource_filter_ruleset_service_ = true;
--- a/chrome/browser/browser_process_impl.h
+++ b/chrome/browser/browser_process_impl.h
@@ -143,9 +143,6 @@ class BrowserProcessImpl : public Browse
void set_background_mode_manager_for_test(
std::unique_ptr<BackgroundModeManager> manager) override;
StatusTray* status_tray() override;
- safe_browsing::SafeBrowsingService* safe_browsing_service() override;
- safe_browsing::ClientSideDetectionService* safe_browsing_detection_service()
- override;
subresource_filter::ContentRulesetService*
subresource_filter_ruleset_service() override;
optimization_guide::OptimizationGuideService* optimization_guide_service()
@@ -280,9 +277,6 @@ class BrowserProcessImpl : public Browse
std::unique_ptr<BackgroundModeManager> background_mode_manager_;
#endif
- bool created_safe_browsing_service_ = false;
- scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_service_;
-
bool created_subresource_filter_ruleset_service_ = false;
std::unique_ptr<subresource_filter::ContentRulesetService>
subresource_filter_ruleset_service_;
--- a/chrome/browser/browser_process.h
+++ b/chrome/browser/browser_process.h
@@ -45,10 +45,6 @@ namespace content {
class NetworkConnectionTracker;
}
-namespace safe_browsing {
-class SafeBrowsingService;
-}
-
namespace subresource_filter {
class ContentRulesetService;
}
@@ -121,10 +117,6 @@ namespace resource_coordinator {
class TabManager;
}
-namespace safe_browsing {
-class ClientSideDetectionService;
-}
-
// NOT THREAD SAFE, call only from the main thread.
// These functions shouldn't return NULL unless otherwise noted.
class BrowserProcess {
@@ -237,14 +229,6 @@ class BrowserProcess {
// on this platform (or this is a unit test).
virtual StatusTray* status_tray() = 0;
- // Returns the SafeBrowsing service.
- virtual safe_browsing::SafeBrowsingService* safe_browsing_service() = 0;
-
- // Returns an object which handles communication with the SafeBrowsing
- // client-side detection servers.
- virtual safe_browsing::ClientSideDetectionService*
- safe_browsing_detection_service() = 0;
-
// Returns the service providing versioned storage for rules used by the Safe
// Browsing subresource filter.
virtual subresource_filter::ContentRulesetService*
--- a/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h
+++ b/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h
@@ -12,7 +12,6 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/browser/download/download_danger_prompt.h"
#include "chrome/browser/ui/webui/md_downloads/downloads_list_tracker.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_ui_message_handler.h"
@@ -116,18 +115,6 @@ class MdDownloadsDOMHandler : public con
// null-checking |original_notifier_|.
content::DownloadManager* GetOriginalNotifierManager() const;
- // Displays a native prompt asking the user for confirmation after accepting
- // the dangerous download specified by |dangerous|. The function returns
- // immediately, and will invoke DangerPromptAccepted() asynchronously if the
- // user accepts the dangerous download. The native prompt will observe
- // |dangerous| until either the dialog is dismissed or |dangerous| is no
- // longer an in-progress dangerous download.
- virtual void ShowDangerPrompt(download::DownloadItem* dangerous);
-
- // Conveys danger acceptance from the DownloadDangerPrompt to the
- // DownloadItem.
- void DangerPromptDone(int download_id, DownloadDangerPrompt::Action action);
-
// Returns true if the records of any downloaded items are allowed (and able)
// to be deleted.
bool IsDeletingHistoryAllowed();
--- a/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc
@@ -20,7 +20,6 @@
#include "base/threading/thread.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/download/download_danger_prompt.h"
#include "chrome/browser/download/download_history.h"
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_prefs.h"
@@ -197,9 +196,6 @@ void MdDownloadsDOMHandler::HandleDrag(c
void MdDownloadsDOMHandler::HandleSaveDangerous(const base::ListValue* args) {
CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS);
- download::DownloadItem* file = GetDownloadByValue(args);
- if (file)
- ShowDangerPrompt(file);
}
void MdDownloadsDOMHandler::HandleDiscardDangerous(
@@ -301,12 +297,6 @@ void MdDownloadsDOMHandler::RemoveDownlo
IdSet ids;
for (auto* download : to_remove) {
- if (download->IsDangerous()) {
- // Don't allow users to revive dangerous downloads; just nuke 'em.
- download->Remove();
- continue;
- }
-
DownloadItemModel item_model(download);
if (!item_model.ShouldShowInShelf() ||
download->GetState() == download::DownloadItem::IN_PROGRESS) {
@@ -359,33 +349,6 @@ void MdDownloadsDOMHandler::FinalizeRemo
}
}
-void MdDownloadsDOMHandler::ShowDangerPrompt(
- download::DownloadItem* dangerous_item) {
- DownloadDangerPrompt* danger_prompt = DownloadDangerPrompt::Create(
- dangerous_item,
- GetWebUIWebContents(),
- false,
- base::Bind(&MdDownloadsDOMHandler::DangerPromptDone,
- weak_ptr_factory_.GetWeakPtr(), dangerous_item->GetId()));
- // danger_prompt will delete itself.
- DCHECK(danger_prompt);
-}
-
-void MdDownloadsDOMHandler::DangerPromptDone(
- int download_id, DownloadDangerPrompt::Action action) {
- if (action != DownloadDangerPrompt::ACCEPT)
- return;
- download::DownloadItem* item = NULL;
- if (GetMainNotifierManager())
- item = GetMainNotifierManager()->GetDownload(download_id);
- if (!item && GetOriginalNotifierManager())
- item = GetOriginalNotifierManager()->GetDownload(download_id);
- if (!item || item->IsDone())
- return;
- CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS);
- item->ValidateDangerousDownload();
-}
-
bool MdDownloadsDOMHandler::IsDeletingHistoryAllowed() {
content::DownloadManager* manager = GetMainNotifierManager();
return manager &&
--- a/chrome/browser/extensions/api/downloads/downloads_api.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api.cc
@@ -39,7 +39,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_core_service.h"
#include "chrome/browser/download/download_core_service_factory.h"
-#include "chrome/browser/download/download_danger_prompt.h"
#include "chrome/browser/download/download_file_icon_extractor.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/download/download_query.h"
@@ -1301,9 +1300,6 @@ DownloadsAcceptDangerFunction::Downloads
DownloadsAcceptDangerFunction::~DownloadsAcceptDangerFunction() {}
-DownloadsAcceptDangerFunction::OnPromptCreatedCallback*
- DownloadsAcceptDangerFunction::on_prompt_created_ = NULL;
-
bool DownloadsAcceptDangerFunction::RunAsync() {
std::unique_ptr<downloads::AcceptDanger::Params> params(
downloads::AcceptDanger::Params::Create(*args_));
@@ -1339,40 +1335,7 @@ void DownloadsAcceptDangerFunction::Prom
return;
}
RecordApiFunctions(DOWNLOADS_FUNCTION_ACCEPT_DANGER);
- // DownloadDangerPrompt displays a modal dialog using native widgets that the
- // user must either accept or cancel. It cannot be scripted.
- DownloadDangerPrompt* prompt = DownloadDangerPrompt::Create(
- download_item,
- web_contents,
- true,
- base::Bind(&DownloadsAcceptDangerFunction::DangerPromptCallback,
- this, download_id));
- // DownloadDangerPrompt deletes itself
- if (on_prompt_created_ && !on_prompt_created_->is_null())
- on_prompt_created_->Run(prompt);
- // Function finishes in DangerPromptCallback().
-}
-
-void DownloadsAcceptDangerFunction::DangerPromptCallback(
- int download_id, DownloadDangerPrompt::Action action) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- DownloadItem* download_item =
- GetDownload(browser_context(), include_incognito(), download_id);
- if (InvalidId(download_item, &error_) ||
- Fault(download_item->GetState() != DownloadItem::IN_PROGRESS,
- errors::kNotInProgress, &error_))
- return;
- switch (action) {
- case DownloadDangerPrompt::ACCEPT:
- download_item->ValidateDangerousDownload();
- break;
- case DownloadDangerPrompt::CANCEL:
- download_item->Remove();
- break;
- case DownloadDangerPrompt::DISMISS:
- break;
- }
- SendResponse(error_.empty());
+ download_item->ValidateDangerousDownload();
}
DownloadsShowFunction::DownloadsShowFunction() {}
--- a/chrome/browser/extensions/api/downloads/downloads_api.h
+++ b/chrome/browser/extensions/api/downloads/downloads_api.h
@@ -13,7 +13,6 @@
#include "base/macros.h"
#include "base/scoped_observer.h"
#include "base/time/time.h"
-#include "chrome/browser/download/download_danger_prompt.h"
#include "chrome/browser/download/download_path_reservation_tracker.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/common/extensions/api/downloads.h"
@@ -188,25 +187,16 @@ class DownloadsRemoveFileFunction : publ
class DownloadsAcceptDangerFunction : public ChromeAsyncExtensionFunction {
public:
- typedef base::Callback<void(DownloadDangerPrompt*)> OnPromptCreatedCallback;
- static void OnPromptCreatedForTesting(
- OnPromptCreatedCallback* callback) {
- on_prompt_created_ = callback;
- }
-
DECLARE_EXTENSION_FUNCTION("downloads.acceptDanger", DOWNLOADS_ACCEPTDANGER)
DownloadsAcceptDangerFunction();
bool RunAsync() override;
protected:
~DownloadsAcceptDangerFunction() override;
- void DangerPromptCallback(int download_id,
- DownloadDangerPrompt::Action action);
private:
void PromptOrWait(int download_id, int retries);
- static OnPromptCreatedCallback* on_prompt_created_;
DISALLOW_COPY_AND_ASSIGN(DownloadsAcceptDangerFunction);
};
--- a/chrome/browser/download/download_prefs.cc
+++ b/chrome/browser/download/download_prefs.cc
@@ -195,14 +195,7 @@ DownloadPrefs::DownloadPrefs(Profile* pr
base::FilePath::StringType(1, base::FilePath::kExtensionSeparator) +
extension);
- // Note that the list of file types that are not allowed to open
- // automatically can change in the future. When the list is tightened, it is
- // expected that some entries in the users' auto open list will get dropped
- // permanently as a result.
- if (FileTypePolicies::GetInstance()->IsAllowedToOpenAutomatically(
- filename_with_extension)) {
- auto_open_.insert(extension);
- }
+ auto_open_.insert(extension);
}
}
@@ -360,10 +353,6 @@ bool DownloadPrefs::IsAutoOpenEnabledBas
bool DownloadPrefs::EnableAutoOpenBasedOnExtension(
const base::FilePath& file_name) {
base::FilePath::StringType extension = file_name.Extension();
- if (!FileTypePolicies::GetInstance()->IsAllowedToOpenAutomatically(
- file_name)) {
- return false;
- }
DCHECK(extension[0] == base::FilePath::kExtensionSeparator);
extension.erase(0, 1);
--- a/chrome/browser/component_updater/file_type_policies_component_installer.cc
+++ b/chrome/browser/component_updater/file_type_policies_component_installer.cc
@@ -38,20 +38,6 @@ const uint8_t kFileTypePoliciesPublicKey
const char kFileTypePoliciesManifestName[] = "File Type Policies";
void LoadFileTypesFromDisk(const base::FilePath& pb_path) {
- if (pb_path.empty())
- return;
-
- VLOG(1) << "Reading Download File Types from file: " << pb_path.value();
- std::string binary_pb;
- if (!base::ReadFileToString(pb_path, &binary_pb)) {
- // The file won't exist on new installations, so this is not always an
- // error.
- VLOG(1) << "Failed reading from " << pb_path.value();
- return;
- }
-
- safe_browsing::FileTypePolicies::GetInstance()->PopulateFromDynamicUpdate(
- binary_pb);
}
} // namespace
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -985,29 +985,7 @@ DownloadFileType::DangerLevel DownloadTa
download_->HasUserGesture())
return DownloadFileType::NOT_DANGEROUS;
- DownloadFileType::DangerLevel danger_level =
- safe_browsing::FileTypePolicies::GetInstance()->GetFileDangerLevel(
- virtual_path_.BaseName());
-
- // A danger level of ALLOW_ON_USER_GESTURE is used to label potentially
- // dangerous file types that have a high frequency of legitimate use. We would
- // like to avoid prompting for the legitimate cases as much as possible. To
- // that end, we consider a download to be legitimate if one of the following
- // is true, and avoid prompting:
- //
- // * The user navigated to the download URL via the omnibox (either by typing
- // the URL, pasting it, or using search).
- //
- // * The navigation that initiated the download has a user gesture associated
- // with it AND the user the user is familiar with the referring origin. A
- // user is considered familiar with a referring origin if a visit for a page
- // from the same origin was recorded on the previous day or earlier.
- if (danger_level == DownloadFileType::ALLOW_ON_USER_GESTURE &&
- ((download_->GetTransitionType() &
- ui::PAGE_TRANSITION_FROM_ADDRESS_BAR) != 0 ||
- (download_->HasUserGesture() && visits == VISITED_REFERRER)))
- return DownloadFileType::NOT_DANGEROUS;
- return danger_level;
+ return DownloadFileType::NOT_DANGEROUS;
}
void DownloadTargetDeterminer::OnDownloadDestroyed(
--- a/chrome/browser/download/download_commands.cc
+++ b/chrome/browser/download/download_commands.cc
@@ -213,9 +213,6 @@ bool DownloadCommands::IsCommandEnabled(
// filename. Don't base an "Always open" decision based on it. Also
// exclude extensions.
return download_item_->CanOpenDownload() &&
- safe_browsing::FileTypePolicies::GetInstance()
- ->IsAllowedToOpenAutomatically(
- download_item_->GetTargetFilePath()) &&
!download_crx_util::IsExtensionDownload(*download_item_);
case CANCEL:
return !download_item_->IsDone();
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -2402,8 +2402,6 @@ jumbo_split_static_library("browser") {
"download/download_commands.h",
"download/download_crx_util.cc",
"download/download_crx_util.h",
- "download/download_danger_prompt.cc",
- "download/download_danger_prompt.h",
"download/download_dir_policy_handler.cc",
"download/download_dir_policy_handler.h",
"download/download_dir_util.cc",
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -2525,7 +2525,6 @@ split_static_library("ui") {
"cocoa/content_settings/cookie_tree_node.mm",
"cocoa/content_settings/cookies_tree_controller_bridge.h",
"cocoa/content_settings/cookies_tree_controller_bridge.mm",
- "cocoa/download/download_danger_prompt_impl.cc",
"cocoa/extensions/chooser_dialog_cocoa.h",
"cocoa/extensions/chooser_dialog_cocoa.mm",
"cocoa/extensions/chooser_dialog_cocoa_controller.h",
@@ -2833,7 +2832,6 @@ split_static_library("ui") {
"views/cookie_info_view.h",
"views/device_chooser_content_view.cc",
"views/device_chooser_content_view.h",
- "views/download/download_danger_prompt_views.cc",
"views/elevation_icon_setter.cc",
"views/elevation_icon_setter.h",
"views/exclusive_access_bubble_views.cc",
--- a/chrome/browser/ssl/security_state_tab_helper.cc
+++ b/chrome/browser/ssl/security_state_tab_helper.cc
@@ -246,62 +246,6 @@ bool SecurityStateTabHelper::UsedPolicyI
security_state::MaliciousContentStatus
SecurityStateTabHelper::GetMaliciousContentStatus() const {
- content::NavigationEntry* entry =
- web_contents()->GetController().GetVisibleEntry();
- if (!entry)
- return security_state::MALICIOUS_CONTENT_STATUS_NONE;
- safe_browsing::SafeBrowsingService* sb_service =
- g_browser_process->safe_browsing_service();
- if (!sb_service)
- return security_state::MALICIOUS_CONTENT_STATUS_NONE;
- scoped_refptr<SafeBrowsingUIManager> sb_ui_manager = sb_service->ui_manager();
- safe_browsing::SBThreatType threat_type;
- if (sb_ui_manager->IsUrlWhitelistedOrPendingForWebContents(
- entry->GetURL(), false, entry, web_contents(), false, &threat_type)) {
- switch (threat_type) {
- case safe_browsing::SB_THREAT_TYPE_UNUSED:
- case safe_browsing::SB_THREAT_TYPE_SAFE:
- break;
- case safe_browsing::SB_THREAT_TYPE_URL_PHISHING:
- case safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING:
- return security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING;
- case safe_browsing::SB_THREAT_TYPE_URL_MALWARE:
- case safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE:
- return security_state::MALICIOUS_CONTENT_STATUS_MALWARE;
- case safe_browsing::SB_THREAT_TYPE_URL_UNWANTED:
- return security_state::MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE;
- case safe_browsing::SB_THREAT_TYPE_PASSWORD_REUSE:
-#if defined(SAFE_BROWSING_DB_LOCAL)
- if (base::FeatureList::IsEnabled(
- safe_browsing::kGoogleBrandedPhishingWarning)) {
- if (safe_browsing::ChromePasswordProtectionService::
- ShouldShowChangePasswordSettingUI(Profile::FromBrowserContext(
- web_contents()->GetBrowserContext()))) {
- return security_state::MALICIOUS_CONTENT_STATUS_PASSWORD_REUSE;
- }
- // If user has already changed Gaia password, returns the regular
- // social engineering content status.
- return security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING;
- }
- break;
-#endif
- case safe_browsing::
- DEPRECATED_SB_THREAT_TYPE_URL_PASSWORD_PROTECTION_PHISHING:
- case safe_browsing::SB_THREAT_TYPE_URL_BINARY_MALWARE:
- case safe_browsing::SB_THREAT_TYPE_EXTENSION:
- case safe_browsing::SB_THREAT_TYPE_BLACKLISTED_RESOURCE:
- case safe_browsing::SB_THREAT_TYPE_API_ABUSE:
- case safe_browsing::SB_THREAT_TYPE_SUBRESOURCE_FILTER:
- case safe_browsing::SB_THREAT_TYPE_CSD_WHITELIST:
- case safe_browsing::SB_THREAT_TYPE_AD_SAMPLE:
- case safe_browsing::SB_THREAT_TYPE_SUSPICIOUS_SITE:
- // These threat types are not currently associated with
- // interstitials, and thus resources with these threat types are
- // not ever whitelisted or pending whitelisting.
- NOTREACHED();
- break;
- }
- }
return security_state::MALICIOUS_CONTENT_STATUS_NONE;
}
--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
+++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
@@ -706,42 +706,6 @@ void ChromeBrowsingDataRemoverDelegate::
CONTENT_SETTINGS_TYPE_CLIENT_HINTS, base::Time(), base::Time::Max(),
base::BindRepeating(&WebsiteSettingsFilterAdapter, filter));
- // Clear the safebrowsing cookies only if time period is for "all time". It
- // doesn't make sense to apply the time period of deleting in the last X
- // hours/days to the safebrowsing cookies since they aren't the result of
- // any user action.
- if (delete_begin_ == base::Time()) {
- safe_browsing::SafeBrowsingService* sb_service =
- g_browser_process->safe_browsing_service();
- if (sb_service) {
- scoped_refptr<net::URLRequestContextGetter> sb_context =
- sb_service->url_request_context();
-
- if (filter_builder.IsEmptyBlacklist()) {
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::BindOnce(
- &ClearCookiesOnIOThread, delete_begin_, delete_end_,
- base::RetainedRef(std::move(sb_context)),
- UIThreadTrampoline(base::BindOnce(
- &ChromeBrowsingDataRemoverDelegate::OnClearedCookies,
- weak_ptr_factory_.GetWeakPtr(),
- CreatePendingTaskCompletionClosure()))));
- } else {
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::BindOnce(
- &ClearCookiesWithPredicateOnIOThread, delete_begin_,
- delete_end_, filter_builder.BuildCookieFilter(),
- base::RetainedRef(std::move(sb_context)),
- UIThreadTrampoline(base::BindOnce(
- &ChromeBrowsingDataRemoverDelegate::OnClearedCookies,
- weak_ptr_factory_.GetWeakPtr(),
- CreatePendingTaskCompletionClosure()))));
- }
- }
- }
-
MediaDeviceIDSalt::Reset(profile_->GetPrefs());
}
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -28,8 +28,6 @@
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_io_data.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/safe_browsing/ping_manager.h"
-#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
@@ -500,16 +498,6 @@ PlatformNotificationServiceImpl::CreateN
notification.set_type(message_center::NOTIFICATION_TYPE_IMAGE);
notification.set_image(
gfx::Image::CreateFrom1xBitmap(notification_resources.image));
- // n.b. this should only be posted once per notification.
- if (g_browser_process->safe_browsing_service() &&
- g_browser_process->safe_browsing_service()->enabled_by_prefs()) {
- g_browser_process->safe_browsing_service()
- ->ping_manager()
- ->ReportNotificationImage(
- profile,
- g_browser_process->safe_browsing_service()->database_manager(),
- origin, notification_resources.image);
- }
}
// Badges are only supported on Android, primarily because it's the only
--- a/chrome/browser/metrics/chrome_metrics_service_client.cc
+++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -45,7 +45,6 @@
#include "chrome/browser/metrics/sampling_metrics_provider.h"
#include "chrome/browser/metrics/subprocess_metrics_provider.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/safe_browsing/certificate_reporting_metrics_provider.h"
#include "chrome/browser/sync/chrome_sync_client.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/translate/translate_ranker_metrics_provider.h"
@@ -718,9 +717,6 @@ void ChromeMetricsServiceClient::Registe
metrics_service_->RegisterMetricsProvider(
std::make_unique<HttpsEngagementMetricsProvider>());
- metrics_service_->RegisterMetricsProvider(
- std::make_unique<CertificateReportingMetricsProvider>());
-
#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
metrics_service_->RegisterMetricsProvider(
std::make_unique<UpgradeMetricsProvider>());
--- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
+++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
@@ -223,7 +223,6 @@ EnsureBrowserContextKeyedServiceFactorie
#if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION)
CaptivePortalServiceFactory::GetInstance();
#endif
- CertificateReportingServiceFactory::GetInstance();
#if defined(OS_ANDROID)
android::DataUseUITabModelFactory::GetInstance();
#endif
--- a/chrome/browser/ssl/captive_portal_blocking_page.cc
+++ b/chrome/browser/ssl/captive_portal_blocking_page.cc