summaryrefslogtreecommitdiff
path: root/www/chromium-uc/patches/core/inox-patchset/0001-fix-building-without-safebrowsing.patch
diff options
context:
space:
mode:
Diffstat (limited to 'www/chromium-uc/patches/core/inox-patchset/0001-fix-building-without-safebrowsing.patch')
-rw-r--r--www/chromium-uc/patches/core/inox-patchset/0001-fix-building-without-safebrowsing.patch1195
1 files changed, 0 insertions, 1195 deletions
diff --git a/www/chromium-uc/patches/core/inox-patchset/0001-fix-building-without-safebrowsing.patch b/www/chromium-uc/patches/core/inox-patchset/0001-fix-building-without-safebrowsing.patch
deleted file mode 100644
index 18fc72a..0000000
--- a/www/chromium-uc/patches/core/inox-patchset/0001-fix-building-without-safebrowsing.patch
+++ /dev/null
@@ -1,1195 +0,0 @@
1--- chrome/browser/BUILD.gn.orig
2+++ chrome/browser/BUILD.gn
3@@ -2195,7 +2195,6 @@ static_library("browser") {
4 "//components/reputation/core:proto",
5 "//components/resources",
6 "//components/safe_browsing/content/browser",
7- "//components/safe_browsing/content/browser:client_side_detection",
8 "//components/safe_browsing/content/browser:safe_browsing_service",
9 "//components/safe_browsing/content/browser/password_protection",
10 "//components/safe_browsing/content/browser/web_ui",
11@@ -3706,8 +3705,6 @@ static_library("browser") {
12 "download/download_commands.h",
13 "download/download_crx_util.cc",
14 "download/download_crx_util.h",
15- "download/download_danger_prompt.cc",
16- "download/download_danger_prompt.h",
17 "download/download_dir_policy_handler.cc",
18 "download/download_dir_policy_handler.h",
19 "download/download_dir_util.cc",
20--- chrome/browser/browser_process.h.orig
21+++ chrome/browser/browser_process.h
22@@ -55,10 +55,6 @@ class NetworkQualityTracker;
23 class SharedURLLoaderFactory;
24 }
25
26-namespace safe_browsing {
27-class SafeBrowsingService;
28-}
29-
30 namespace subresource_filter {
31 class RulesetService;
32 }
33@@ -218,9 +214,6 @@ class BrowserProcess {
34 // on this platform (or this is a unit test).
35 virtual StatusTray* status_tray() = 0;
36
37- // Returns the SafeBrowsing service.
38- virtual safe_browsing::SafeBrowsingService* safe_browsing_service() = 0;
39-
40 // Returns the service providing versioned storage for rules used by the Safe
41 // Browsing subresource filter.
42 virtual subresource_filter::RulesetService*
43--- chrome/browser/browser_process_impl.cc.orig
44+++ chrome/browser/browser_process_impl.cc
45@@ -70,7 +70,6 @@
46 #include "chrome/browser/printing/print_preview_dialog_controller.h"
47 #include "chrome/browser/profiles/profile_manager.h"
48 #include "chrome/browser/resource_coordinator/resource_coordinator_parts.h"
49-#include "chrome/browser/safe_browsing/safe_browsing_service.h"
50 #include "chrome/browser/shell_integration.h"
51 #include "chrome/browser/site_isolation/prefs_observer.h"
52 #include "chrome/browser/ssl/secure_origin_prefs_observer.h"
53@@ -395,8 +394,6 @@ void BrowserProcessImpl::StartTearDown()
54
55 metrics_services_manager_.reset();
56 intranet_redirect_detector_.reset();
57- if (safe_browsing_service_.get())
58- safe_browsing_service()->ShutDown();
59 network_time_tracker_.reset();
60 #if BUILDFLAG(ENABLE_PLUGINS)
61 plugins_resource_service_.reset();
62@@ -1030,14 +1027,6 @@ StatusTray* BrowserProcessImpl::status_t
63 return status_tray_.get();
64 }
65
66-safe_browsing::SafeBrowsingService*
67-BrowserProcessImpl::safe_browsing_service() {
68- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
69- if (!created_safe_browsing_service_)
70- CreateSafeBrowsingService();
71- return safe_browsing_service_.get();
72-}
73-
74 subresource_filter::RulesetService*
75 BrowserProcessImpl::subresource_filter_ruleset_service() {
76 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
77@@ -1300,26 +1289,6 @@ void BrowserProcessImpl::CreateBackgroun
78 #endif
79 }
80
81-void BrowserProcessImpl::CreateSafeBrowsingService() {
82- DCHECK(!safe_browsing_service_);
83- // Set this flag to true so that we don't retry indefinitely to
84- // create the service class if there was an error.
85- created_safe_browsing_service_ = true;
86-
87- // The factory can be overridden in tests.
88- if (!safe_browsing::SafeBrowsingServiceInterface::HasFactory()) {
89- safe_browsing::SafeBrowsingServiceInterface::RegisterFactory(
90- safe_browsing::GetSafeBrowsingServiceFactory());
91- }
92-
93- // TODO(crbug/925153): Port consumers of the |safe_browsing_service_| to use
94- // the interface in components/safe_browsing, and remove this cast.
95- safe_browsing_service_ = static_cast<safe_browsing::SafeBrowsingService*>(
96- safe_browsing::SafeBrowsingServiceInterface::CreateSafeBrowsingService());
97- if (safe_browsing_service_)
98- safe_browsing_service_->Initialize();
99-}
100-
101 void BrowserProcessImpl::CreateSubresourceFilterRulesetService() {
102 DCHECK(!subresource_filter_ruleset_service_);
103 created_subresource_filter_ruleset_service_ = true;
104--- chrome/browser/browser_process_impl.h.orig
105+++ chrome/browser/browser_process_impl.h
106@@ -190,7 +190,6 @@ class BrowserProcessImpl : public Browse
107 std::unique_ptr<BackgroundModeManager> manager) override;
108 #endif
109 StatusTray* status_tray() override;
110- safe_browsing::SafeBrowsingService* safe_browsing_service() override;
111 subresource_filter::RulesetService* subresource_filter_ruleset_service()
112 override;
113 federated_learning::FlocSortingLshClustersService*
114@@ -344,9 +343,6 @@ class BrowserProcessImpl : public Browse
115 std::unique_ptr<BackgroundModeManager> background_mode_manager_;
116 #endif
117
118- bool created_safe_browsing_service_ = false;
119- scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_service_;
120-
121 bool created_subresource_filter_ruleset_service_ = false;
122 std::unique_ptr<subresource_filter::RulesetService>
123 subresource_filter_ruleset_service_;
124--- chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc.orig
125+++ chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
126@@ -70,7 +70,6 @@
127 #include "chrome/browser/profiles/profile.h"
128 #include "chrome/browser/profiles/profile_keep_alive_types.h"
129 #include "chrome/browser/profiles/scoped_profile_keep_alive.h"
130-#include "chrome/browser/safe_browsing/safe_browsing_service.h"
131 #include "chrome/browser/search_engines/template_url_service_factory.h"
132 #include "chrome/browser/share/share_history.h"
133 #include "chrome/browser/share/share_ranking.h"
134@@ -643,10 +642,6 @@ void ChromeBrowsingDataRemoverDelegate::
135 base::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies"));
136
137 network::mojom::NetworkContext* safe_browsing_context = nullptr;
138- safe_browsing::SafeBrowsingService* sb_service =
139- g_browser_process->safe_browsing_service();
140- if (sb_service)
141- safe_browsing_context = sb_service->GetNetworkContext(profile_);
142
143 browsing_data::RemoveEmbedderCookieData(
144 delete_begin, delete_end, filter_builder, host_content_settings_map_,
145--- chrome/browser/chrome_content_browser_client.cc.orig
146+++ chrome/browser/chrome_content_browser_client.cc
147@@ -921,34 +921,6 @@ void SetApplicationLocaleOnIOThread(cons
148 GetIOThreadApplicationLocale() = locale;
149 }
150
151-// An implementation of the SSLCertReporter interface used by
152-// SSLErrorHandler. Uses CertificateReportingService to send reports. The
153-// service handles queueing and re-sending of failed reports. Each certificate
154-// error creates a new instance of this class.
155-class CertificateReportingServiceCertReporter : public SSLCertReporter {
156- public:
157- explicit CertificateReportingServiceCertReporter(
158- content::WebContents* web_contents)
159- : service_(CertificateReportingServiceFactory::GetForBrowserContext(
160- web_contents->GetBrowserContext())) {}
161-
162- CertificateReportingServiceCertReporter(
163- const CertificateReportingServiceCertReporter&) = delete;
164- CertificateReportingServiceCertReporter& operator=(
165- const CertificateReportingServiceCertReporter&) = delete;
166-
167- ~CertificateReportingServiceCertReporter() override {}
168-
169- // SSLCertReporter implementation
170- void ReportInvalidCertificateChain(
171- const std::string& serialized_report) override {
172- service_->Send(serialized_report);
173- }
174-
175- private:
176- CertificateReportingService* service_;
177-};
178-
179 #if BUILDFLAG(ENABLE_EXTENSIONS)
180
181 AppLoadedInTabSource ClassifyAppLoadedInTabSource(
182@@ -1423,7 +1395,6 @@ void ChromeContentBrowserClient::PostAft
183 InitNetworkContextsParentDirectory();
184
185 DCHECK_CURRENTLY_ON(BrowserThread::UI);
186- safe_browsing_service_ = g_browser_process->safe_browsing_service();
187 }
188
189 bool ChromeContentBrowserClient::IsBrowserStartupComplete() {
190@@ -4229,7 +4200,7 @@ ChromeContentBrowserClient::CreateThrott
191 content::WebContents* web_contents = handle->GetWebContents();
192 throttles.push_back(std::make_unique<SSLErrorNavigationThrottle>(
193 handle,
194- std::make_unique<CertificateReportingServiceCertReporter>(web_contents),
195+ nullptr,
196 base::BindOnce(&HandleSSLErrorWrapper), base::BindOnce(&IsInHostedApp),
197 base::BindOnce(
198 &ShouldIgnoreSslInterstitialBecauseNavigationDefaultedToHttps)));
199@@ -4258,15 +4229,6 @@ ChromeContentBrowserClient::CreateThrott
200 &throttles);
201 #endif
202
203- // g_browser_process->safe_browsing_service() may be null in unittests.
204- safe_browsing::SafeBrowsingUIManager* ui_manager =
205- g_browser_process->safe_browsing_service()
206- ? g_browser_process->safe_browsing_service()->ui_manager().get()
207- : nullptr;
208- throttles.push_back(
209- std::make_unique<safe_browsing::SafeBrowsingNavigationThrottle>(
210- handle, ui_manager));
211-
212 if (base::FeatureList::IsEnabled(safe_browsing::kDelayedWarnings)) {
213 throttles.push_back(
214 std::make_unique<safe_browsing::DelayedWarningNavigationThrottle>(
215--- chrome/browser/component_updater/file_type_policies_component_installer.cc.orig
216+++ chrome/browser/component_updater/file_type_policies_component_installer.cc
217@@ -40,20 +40,6 @@ const uint8_t kFileTypePoliciesPublicKey
218 const char kFileTypePoliciesManifestName[] = "File Type Policies";
219
220 void LoadFileTypesFromDisk(const base::FilePath& pb_path) {
221- if (pb_path.empty())
222- return;
223-
224- VLOG(1) << "Reading Download File Types from file: " << pb_path.value();
225- std::string binary_pb;
226- if (!base::ReadFileToString(pb_path, &binary_pb)) {
227- // The file won't exist on new installations, so this is not always an
228- // error.
229- VLOG(1) << "Failed reading from " << pb_path.value();
230- return;
231- }
232-
233- safe_browsing::FileTypePolicies::GetInstance()->PopulateFromDynamicUpdate(
234- binary_pb);
235 }
236
237 } // namespace
238--- chrome/browser/download/chrome_download_manager_delegate.cc.orig
239+++ chrome/browser/download/chrome_download_manager_delegate.cc
240@@ -436,13 +436,6 @@ ChromeDownloadManagerDelegate::~ChromeDo
241
242 void ChromeDownloadManagerDelegate::SetDownloadManager(DownloadManager* dm) {
243 download_manager_ = dm;
244-
245- safe_browsing::SafeBrowsingService* sb_service =
246- g_browser_process->safe_browsing_service();
247- if (sb_service && !profile_->IsOffTheRecord()) {
248- // Include this download manager in the set monitored by safe browsing.
249- sb_service->AddDownloadManager(dm);
250- }
251 }
252
253 #if defined(OS_ANDROID)
254@@ -791,16 +784,6 @@ void ChromeDownloadManagerDelegate::Choo
255
256 void ChromeDownloadManagerDelegate::SanitizeSavePackageResourceName(
257 base::FilePath* filename) {
258- safe_browsing::FileTypePolicies* file_type_policies =
259- safe_browsing::FileTypePolicies::GetInstance();
260-
261- if (file_type_policies->GetFileDangerLevel(*filename) ==
262- safe_browsing::DownloadFileType::NOT_DANGEROUS)
263- return;
264-
265- base::FilePath default_filename = base::FilePath::FromUTF8Unsafe(
266- l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
267- *filename = filename->AddExtension(default_filename.BaseName().value());
268 }
269
270 void ChromeDownloadManagerDelegate::SanitizeDownloadParameters(
271--- chrome/browser/download/download_item_model.cc.orig
272+++ chrome/browser/download/download_item_model.cc
273@@ -86,7 +86,7 @@ class DownloadItemModelData : public bas
274
275 // Danger level of the file determined based on the file type and whether
276 // there was a user action associated with the download.
277- DownloadFileType::DangerLevel danger_level_;
278+ safe_browsing::DownloadFileType::DangerLevel danger_level_;
279
280 // Whether the download is currently being revived.
281 bool is_being_revived_;
282@@ -123,7 +123,7 @@ DownloadItemModelData::DownloadItemModel
283 : should_show_in_shelf_(true),
284 was_ui_notified_(false),
285 should_prefer_opening_in_browser_(false),
286- danger_level_(DownloadFileType::NOT_DANGEROUS),
287+ danger_level_(safe_browsing::DownloadFileType::NOT_DANGEROUS),
288 is_being_revived_(false) {}
289
290 } // namespace
291@@ -381,13 +381,13 @@ void DownloadItemModel::SetShouldPreferO
292 data->should_prefer_opening_in_browser_ = preference;
293 }
294
295-DownloadFileType::DangerLevel DownloadItemModel::GetDangerLevel() const {
296+safe_browsing::DownloadFileType::DangerLevel DownloadItemModel::GetDangerLevel() const {
297 const DownloadItemModelData* data = DownloadItemModelData::Get(download_);
298- return data ? data->danger_level_ : DownloadFileType::NOT_DANGEROUS;
299+ return data ? data->danger_level_ : safe_browsing::DownloadFileType::NOT_DANGEROUS;
300 }
301
302 void DownloadItemModel::SetDangerLevel(
303- DownloadFileType::DangerLevel danger_level) {
304+ safe_browsing::DownloadFileType::DangerLevel danger_level) {
305 DownloadItemModelData* data = DownloadItemModelData::GetOrCreate(download_);
306 data->danger_level_ = danger_level;
307 }
308@@ -599,9 +599,6 @@ bool DownloadItemModel::IsCommandEnabled
309 // filename. Don't base an "Always open" decision based on it. Also
310 // exclude extensions.
311 return download_->CanOpenDownload() &&
312- safe_browsing::FileTypePolicies::GetInstance()
313- ->IsAllowedToOpenAutomatically(
314- download_->GetTargetFilePath()) &&
315 !download_crx_util::IsExtensionDownload(*download_);
316 case DownloadCommands::PAUSE:
317 return !download_->IsSavePackageDownload() &&
318--- chrome/browser/download/download_prefs.cc.orig
319+++ chrome/browser/download/download_prefs.cc
320@@ -260,14 +260,7 @@ DownloadPrefs::DownloadPrefs(Profile* pr
321 base::FilePath::StringType(1, base::FilePath::kExtensionSeparator) +
322 extension);
323
324- // Note that the list of file types that are not allowed to open
325- // automatically can change in the future. When the list is tightened, it is
326- // expected that some entries in the users' auto open list will get dropped
327- // permanently as a result.
328- if (FileTypePolicies::GetInstance()->IsAllowedToOpenAutomatically(
329- filename_with_extension)) {
330- auto_open_by_user_.insert(extension);
331- }
332+ auto_open_by_user_.insert(extension);
333 }
334 }
335
336@@ -475,10 +468,6 @@ bool DownloadPrefs::IsAutoOpenByPolicy(c
337 bool DownloadPrefs::EnableAutoOpenByUserBasedOnExtension(
338 const base::FilePath& file_name) {
339 base::FilePath::StringType extension = file_name.Extension();
340- if (!FileTypePolicies::GetInstance()->IsAllowedToOpenAutomatically(
341- file_name)) {
342- return false;
343- }
344
345 DCHECK(extension[0] == base::FilePath::kExtensionSeparator);
346 extension.erase(0, 1);
347--- chrome/browser/download/download_target_determiner.cc.orig
348+++ chrome/browser/download/download_target_determiner.cc
349@@ -297,13 +297,6 @@ base::FilePath DownloadTargetDeterminer:
350 download_->GetURL(), download_->GetContentDisposition(), referrer_charset,
351 suggested_filename, sniffed_mime_type, default_filename);
352
353- // We don't replace the file extension if sfafe browsing consider the file
354- // extension to be unsafe. Just let safe browsing scan the generated file.
355- if (safe_browsing::FileTypePolicies::GetInstance()->IsCheckedBinaryFile(
356- generated_filename)) {
357- return generated_filename;
358- }
359-
360 // If no mime type or explicitly specified a name, don't replace file
361 // extension.
362 if (sniffed_mime_type.empty() || !suggested_filename.empty())
363@@ -1113,29 +1106,7 @@ DownloadFileType::DangerLevel DownloadTa
364 download_->HasUserGesture())
365 return DownloadFileType::NOT_DANGEROUS;
366
367- DownloadFileType::DangerLevel danger_level =
368- safe_browsing::FileTypePolicies::GetInstance()->GetFileDangerLevel(
369- virtual_path_.BaseName());
370-
371- // A danger level of ALLOW_ON_USER_GESTURE is used to label potentially
372- // dangerous file types that have a high frequency of legitimate use. We would
373- // like to avoid prompting for the legitimate cases as much as possible. To
374- // that end, we consider a download to be legitimate if one of the following
375- // is true, and avoid prompting:
376- //
377- // * The user navigated to the download URL via the omnibox (either by typing
378- // the URL, pasting it, or using search).
379- //
380- // * The navigation that initiated the download has a user gesture associated
381- // with it AND the user the user is familiar with the referring origin. A
382- // user is considered familiar with a referring origin if a visit for a page
383- // from the same origin was recorded on the previous day or earlier.
384- if (danger_level == DownloadFileType::ALLOW_ON_USER_GESTURE &&
385- ((download_->GetTransitionType() &
386- ui::PAGE_TRANSITION_FROM_ADDRESS_BAR) != 0 ||
387- (download_->HasUserGesture() && visits == VISITED_REFERRER)))
388- return DownloadFileType::NOT_DANGEROUS;
389- return danger_level;
390+ return DownloadFileType::NOT_DANGEROUS;
391 }
392
393 absl::optional<base::Time>
394--- chrome/browser/extensions/api/downloads/downloads_api.cc.orig
395+++ chrome/browser/extensions/api/downloads/downloads_api.cc
396@@ -36,7 +36,6 @@
397 #include "chrome/browser/browser_process.h"
398 #include "chrome/browser/download/download_core_service.h"
399 #include "chrome/browser/download/download_core_service_factory.h"
400-#include "chrome/browser/download/download_danger_prompt.h"
401 #include "chrome/browser/download/download_file_icon_extractor.h"
402 #include "chrome/browser/download/download_open_prompt.h"
403 #include "chrome/browser/download/download_prefs.h"
404@@ -1274,9 +1273,6 @@ DownloadsAcceptDangerFunction::Downloads
405
406 DownloadsAcceptDangerFunction::~DownloadsAcceptDangerFunction() {}
407
408-DownloadsAcceptDangerFunction::OnPromptCreatedCallback*
409- DownloadsAcceptDangerFunction::on_prompt_created_ = NULL;
410-
411 ExtensionFunction::ResponseAction DownloadsAcceptDangerFunction::Run() {
412 std::unique_ptr<downloads::AcceptDanger::Params> params(
413 downloads::AcceptDanger::Params::Create(args()));
414@@ -1314,42 +1310,7 @@ void DownloadsAcceptDangerFunction::Prom
415 return;
416 }
417 RecordApiFunctions(DOWNLOADS_FUNCTION_ACCEPT_DANGER);
418- // DownloadDangerPrompt displays a modal dialog using native widgets that the
419- // user must either accept or cancel. It cannot be scripted.
420- DownloadDangerPrompt* prompt = DownloadDangerPrompt::Create(
421- download_item, web_contents, true,
422- base::BindOnce(&DownloadsAcceptDangerFunction::DangerPromptCallback, this,
423- download_id));
424- // DownloadDangerPrompt deletes itself
425- if (on_prompt_created_ && !on_prompt_created_->is_null())
426- std::move(*on_prompt_created_).Run(prompt);
427- // Function finishes in DangerPromptCallback().
428-}
429-
430-void DownloadsAcceptDangerFunction::DangerPromptCallback(
431- int download_id,
432- DownloadDangerPrompt::Action action) {
433- DCHECK_CURRENTLY_ON(BrowserThread::UI);
434- DownloadItem* download_item = GetDownload(
435- browser_context(), include_incognito_information(), download_id);
436- std::string error;
437- if (InvalidId(download_item, &error) ||
438- Fault(download_item->GetState() != DownloadItem::IN_PROGRESS,
439- download_extension_errors::kNotInProgress, &error)) {
440- Respond(Error(std::move(error)));
441- return;
442- }
443- switch (action) {
444- case DownloadDangerPrompt::ACCEPT:
445- download_item->ValidateDangerousDownload();
446- break;
447- case DownloadDangerPrompt::CANCEL:
448- download_item->Remove();
449- break;
450- case DownloadDangerPrompt::DISMISS:
451- break;
452- }
453- Respond(NoArguments());
454+ download_item->ValidateDangerousDownload();
455 }
456
457 DownloadsShowFunction::DownloadsShowFunction() {}
458--- chrome/browser/extensions/api/downloads/downloads_api.h.orig
459+++ chrome/browser/extensions/api/downloads/downloads_api.h
460@@ -13,7 +13,6 @@
461 #include "base/macros.h"
462 #include "base/scoped_observation.h"
463 #include "base/time/time.h"
464-#include "chrome/browser/download/download_danger_prompt.h"
465 #include "chrome/common/extensions/api/downloads.h"
466 #include "components/download/content/public/all_download_item_notifier.h"
467 #include "components/download/public/common/download_path_reservation_tracker.h"
468@@ -199,13 +198,6 @@ class DownloadsRemoveFileFunction : publ
469
470 class DownloadsAcceptDangerFunction : public ExtensionFunction {
471 public:
472- using OnPromptCreatedCallback =
473- base::OnceCallback<void(DownloadDangerPrompt*)>;
474- static void OnPromptCreatedForTesting(
475- OnPromptCreatedCallback* callback) {
476- on_prompt_created_ = callback;
477- }
478-
479 DECLARE_EXTENSION_FUNCTION("downloads.acceptDanger", DOWNLOADS_ACCEPTDANGER)
480 DownloadsAcceptDangerFunction();
481
482@@ -217,13 +209,10 @@ class DownloadsAcceptDangerFunction : pu
483
484 protected:
485 ~DownloadsAcceptDangerFunction() override;
486- void DangerPromptCallback(int download_id,
487- DownloadDangerPrompt::Action action);
488
489 private:
490 void PromptOrWait(int download_id, int retries);
491
492- static OnPromptCreatedCallback* on_prompt_created_;
493 };
494
495 class DownloadsShowFunction : public ExtensionFunction {
496--- chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.cc.orig
497+++ chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.cc
498@@ -54,38 +54,7 @@ SafeBrowsingPrivateGetReferrerChainFunct
499 base::StringPrintf("Could not find tab with id %d.", params->tab_id)));
500 }
501
502- Profile* profile = Profile::FromBrowserContext(browser_context());
503- if (!SafeBrowsingNavigationObserverManager::IsEnabledAndReady(
504- profile->GetPrefs(), g_browser_process->safe_browsing_service()))
505- return RespondNow(NoArguments());
506-
507- SafeBrowsingNavigationObserverManager* navigation_observer_manager =
508- safe_browsing::SafeBrowsingNavigationObserverManagerFactory::
509- GetForBrowserContext(profile);
510-
511- safe_browsing::ReferrerChain referrer_chain;
512- SafeBrowsingNavigationObserverManager::AttributionResult result =
513- navigation_observer_manager->IdentifyReferrerChainByWebContents(
514- contents, kReferrerUserGestureLimit, &referrer_chain);
515-
516- // If the referrer chain is incomplete we'll append the most recent
517- // navigations to referrer chain for diagnostic purposes. This only happens if
518- // the user is not in incognito mode and has opted into extended reporting or
519- // Scout reporting. Otherwise, |CountOfRecentNavigationsToAppend| returns 0.
520- int recent_navigations_to_collect =
521- SafeBrowsingNavigationObserverManager::CountOfRecentNavigationsToAppend(
522- profile, profile->GetPrefs(), result);
523- if (recent_navigations_to_collect > 0) {
524- navigation_observer_manager->AppendRecentNavigations(
525- recent_navigations_to_collect, &referrer_chain);
526- }
527-
528 std::vector<api::safe_browsing_private::ReferrerChainEntry> referrer_entries;
529- referrer_entries.reserve(referrer_chain.size());
530- for (const auto& entry : referrer_chain) {
531- referrer_entries.emplace_back(
532- safe_browsing_util::ReferrerToReferrerChainEntry(entry));
533- }
534 return RespondNow(ArgumentList(
535 api::safe_browsing_private::GetReferrerChain::Results::Create(
536 referrer_entries)));
537--- chrome/browser/extensions/api/webstore_private/webstore_private_api.cc.orig
538+++ chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
539@@ -683,18 +683,6 @@ void WebstorePrivateBeginInstallWithMani
540
541 void WebstorePrivateBeginInstallWithManifest3Function::
542 ReportFrictionAcceptedEvent() {
543- if (!profile_) {
544- return;
545- }
546- auto* metrics_collector =
547- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
548- profile_);
549- // `metrics_collector` can be null in incognito.
550- if (metrics_collector) {
551- metrics_collector->AddSafeBrowsingEventToPref(
552- safe_browsing::SafeBrowsingMetricsCollector::EventType::
553- EXTENSION_ALLOWLIST_INSTALL_BYPASS);
554- }
555 }
556
557 void WebstorePrivateBeginInstallWithManifest3Function::OnInstallPromptDone(
558@@ -1159,52 +1147,9 @@ WebstorePrivateGetReferrerChainFunction:
559
560 ExtensionFunction::ResponseAction
561 WebstorePrivateGetReferrerChainFunction::Run() {
562- Profile* profile = Profile::FromBrowserContext(browser_context());
563- if (!SafeBrowsingNavigationObserverManager::IsEnabledAndReady(
564- profile->GetPrefs(), g_browser_process->safe_browsing_service()))
565- return RespondNow(ArgumentList(
566- api::webstore_private::GetReferrerChain::Results::Create("")));
567-
568- content::WebContents* web_contents = GetSenderWebContents();
569- if (!web_contents) {
570- return RespondNow(ErrorWithArguments(
571- api::webstore_private::GetReferrerChain::Results::Create(""),
572- kWebstoreUserCancelledError));
573- }
574-
575- SafeBrowsingNavigationObserverManager* navigation_observer_manager =
576- safe_browsing::SafeBrowsingNavigationObserverManagerFactory::
577- GetForBrowserContext(profile);
578-
579- safe_browsing::ReferrerChain referrer_chain;
580- SafeBrowsingNavigationObserverManager::AttributionResult result =
581- navigation_observer_manager->IdentifyReferrerChainByWebContents(
582- web_contents, kExtensionReferrerUserGestureLimit, &referrer_chain);
583-
584- // If the referrer chain is incomplete we'll append the most recent
585- // navigations to referrer chain for diagnostic purposes. This only happens if
586- // the user is not in incognito mode and has opted into extended reporting or
587- // Scout reporting. Otherwise, |CountOfRecentNavigationsToAppend| returns 0.
588- int recent_navigations_to_collect =
589- SafeBrowsingNavigationObserverManager::CountOfRecentNavigationsToAppend(
590- profile, profile->GetPrefs(), result);
591- if (recent_navigations_to_collect > 0) {
592- navigation_observer_manager->AppendRecentNavigations(
593- recent_navigations_to_collect, &referrer_chain);
594- }
595-
596- safe_browsing::ExtensionWebStoreInstallRequest request;
597- request.mutable_referrer_chain()->Swap(&referrer_chain);
598- request.mutable_referrer_chain_options()->set_recent_navigations_to_collect(
599- recent_navigations_to_collect);
600-
601- std::string serialized_referrer_proto = request.SerializeAsString();
602- // Base64 encode the proto to avoid issues with base::Value rejecting strings
603- // which are not valid UTF8.
604- base::Base64Encode(serialized_referrer_proto, &serialized_referrer_proto);
605 return RespondNow(
606 ArgumentList(api::webstore_private::GetReferrerChain::Results::Create(
607- serialized_referrer_proto)));
608+ "")));
609 }
610
611 WebstorePrivateGetExtensionStatusFunction::
612--- chrome/browser/extensions/blocklist_state_fetcher.cc.orig
613+++ chrome/browser/extensions/blocklist_state_fetcher.cc
614@@ -34,33 +34,8 @@ BlocklistStateFetcher::~BlocklistStateFe
615 void BlocklistStateFetcher::Request(const std::string& id,
616 RequestCallback callback) {
617 DCHECK_CURRENTLY_ON(BrowserThread::UI);
618- if (!safe_browsing_config_) {
619- if (g_browser_process && g_browser_process->safe_browsing_service()) {
620- SetSafeBrowsingConfig(
621- g_browser_process->safe_browsing_service()->GetV4ProtocolConfig());
622- } else {
623- base::ThreadTaskRunnerHandle::Get()->PostTask(
624- FROM_HERE, base::BindOnce(std::move(callback), BLOCKLISTED_UNKNOWN));
625- return;
626- }
627- }
628-
629- bool request_already_sent = base::Contains(callbacks_, id);
630- callbacks_.insert(std::make_pair(id, std::move(callback)));
631- if (request_already_sent)
632- return;
633-
634- if (g_browser_process && g_browser_process->safe_browsing_service()) {
635- if (base::FeatureList::IsEnabled(
636- safe_browsing::kSafeBrowsingRemoveCookies)) {
637- url_loader_factory_ = g_browser_process->shared_url_loader_factory();
638- } else {
639- url_loader_factory_ =
640- g_browser_process->safe_browsing_service()->GetURLLoaderFactory();
641- }
642- }
643-
644- SendRequest(id);
645+ base::ThreadTaskRunnerHandle::Get()->PostTask(
646+ FROM_HERE, base::BindOnce(std::move(callback), BLOCKLISTED_UNKNOWN));
647 }
648
649 void BlocklistStateFetcher::SendRequest(const std::string& id) {
650@@ -71,8 +46,7 @@ void BlocklistStateFetcher::SendRequest(
651 std::string request_str;
652 request.SerializeToString(&request_str);
653
654- GURL request_url = GURL(safe_browsing::GetReportUrl(
655- *safe_browsing_config_, "clientreport/crx-list-info"));
656+ GURL request_url = GURL();
657 net::NetworkTrafficAnnotationTag traffic_annotation =
658 net::DefineNetworkTrafficAnnotation("extension_blacklist", R"(
659 semantics {
660@@ -122,12 +96,6 @@ void BlocklistStateFetcher::SendRequest(
661 base::Unretained(this), fetcher));
662 }
663
664-void BlocklistStateFetcher::SetSafeBrowsingConfig(
665- const safe_browsing::V4ProtocolConfig& config) {
666- safe_browsing_config_ =
667- std::make_unique<safe_browsing::V4ProtocolConfig>(config);
668-}
669-
670 void BlocklistStateFetcher::OnURLLoaderComplete(
671 network::SimpleURLLoader* url_loader,
672 std::unique_ptr<std::string> response_body) {
673--- chrome/browser/extensions/blocklist_state_fetcher.h.orig
674+++ chrome/browser/extensions/blocklist_state_fetcher.h
675@@ -37,8 +37,6 @@ class BlocklistStateFetcher {
676
677 virtual void Request(const std::string& id, RequestCallback callback);
678
679- void SetSafeBrowsingConfig(const safe_browsing::V4ProtocolConfig& config);
680-
681 protected:
682 void OnURLLoaderComplete(network::SimpleURLLoader* url_loader,
683 std::unique_ptr<std::string> response_body);
684@@ -57,7 +55,6 @@ class BlocklistStateFetcher {
685
686 void SendRequest(const std::string& id);
687
688- std::unique_ptr<safe_browsing::V4ProtocolConfig> safe_browsing_config_;
689 scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
690
691 // SimpleURLLoader -> (owned loader, extension id).
692--- chrome/browser/metrics/chrome_metrics_service_client.cc.orig
693+++ chrome/browser/metrics/chrome_metrics_service_client.cc
694@@ -828,9 +828,6 @@ void ChromeMetricsServiceClient::Registe
695 metrics_service_->RegisterMetricsProvider(
696 std::make_unique<HttpsEngagementMetricsProvider>());
697
698- metrics_service_->RegisterMetricsProvider(
699- std::make_unique<CertificateReportingMetricsProvider>());
700-
701 #if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
702 metrics_service_->RegisterMetricsProvider(
703 std::make_unique<UpgradeMetricsProvider>());
704--- chrome/browser/net/trial_comparison_cert_verifier_controller.cc.orig
705+++ chrome/browser/net/trial_comparison_cert_verifier_controller.cc
706@@ -138,9 +138,6 @@ void TrialComparisonCertVerifierControll
707 std::string serialized_report;
708 if (!report.Serialize(&serialized_report))
709 return;
710-
711- CertificateReportingServiceFactory::GetForBrowserContext(profile_)->Send(
712- serialized_report);
713 }
714
715 // static
716--- chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc.orig
717+++ chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
718@@ -297,7 +297,6 @@ void ChromeBrowserMainExtraPartsProfiles
719 #if BUILDFLAG(IS_CHROMEOS_LACROS)
720 CertDbInitializerFactory::GetInstance();
721 #endif
722- CertificateReportingServiceFactory::GetInstance();
723 #if !defined(OS_ANDROID)
724 ChromeBrowsingDataLifetimeManagerFactory::GetInstance();
725 #endif
726--- chrome/browser/profiles/profile_impl.cc.orig
727+++ chrome/browser/profiles/profile_impl.cc
728@@ -93,7 +93,6 @@
729 #include "chrome/browser/profiles/profile_metrics.h"
730 #include "chrome/browser/push_messaging/push_messaging_service_factory.h"
731 #include "chrome/browser/push_messaging/push_messaging_service_impl.h"
732-#include "chrome/browser/safe_browsing/safe_browsing_service.h"
733 #include "chrome/browser/sessions/exit_type_service.h"
734 #include "chrome/browser/sharing/sharing_service_factory.h"
735 #include "chrome/browser/signin/identity_manager_factory.h"
736@@ -627,17 +626,6 @@ void ProfileImpl::LoadPrefsForNormalStar
737
738 mojo::PendingRemote<prefs::mojom::TrackedPreferenceValidationDelegate>
739 pref_validation_delegate;
740- scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_service(
741- g_browser_process->safe_browsing_service());
742- if (safe_browsing_service.get()) {
743- auto pref_validation_delegate_impl =
744- safe_browsing_service->CreatePreferenceValidationDelegate(this);
745- if (pref_validation_delegate_impl) {
746- mojo::MakeSelfOwnedReceiver(
747- std::move(pref_validation_delegate_impl),
748- pref_validation_delegate.InitWithNewPipeAndPassReceiver());
749- }
750- }
751
752 prefs_ =
753 CreatePrefService(pref_registry_, CreateExtensionPrefStore(this, false),
754--- chrome/browser/profiles/profiles_state.cc.orig
755+++ chrome/browser/profiles/profiles_state.cc
756@@ -259,9 +259,6 @@ void RemoveBrowsingDataForProfile(const
757 // The BrowsingDataRemover relies on many objects that aren't created in unit
758 // tests. Previously this code would depend on content::ResourceDispatcherHost
759 // but that's gone, so do a similar hack for now.
760- if (!g_browser_process->safe_browsing_service())
761- return;
762-
763 Profile* profile =
764 g_browser_process->profile_manager()->GetProfileByPath(profile_path);
765 if (!profile)
766--- chrome/browser/safe_browsing/BUILD.gn.orig
767+++ chrome/browser/safe_browsing/BUILD.gn
768@@ -5,6 +5,7 @@ import("//components/safe_browsing/build
769 import("//extensions/buildflags/buildflags.gni")
770
771 static_library("safe_browsing") {
772+ if (false) {
773 sources = [
774 "chrome_controller_client.cc",
775 "chrome_controller_client.h",
776@@ -88,6 +89,7 @@ static_library("safe_browsing") {
777 "//extensions/browser",
778 ]
779 }
780+ }
781
782 if (safe_browsing_mode != 0) {
783 # "Safe Browsing Basic" files used for safe browsing in full mode
784@@ -411,6 +413,7 @@ static_library("advanced_protection") {
785 }
786
787 source_set("metrics_collector") {
788+ if (false) {
789 sources = [
790 "safe_browsing_metrics_collector_factory.cc",
791 "safe_browsing_metrics_collector_factory.h",
792@@ -428,6 +431,7 @@ source_set("metrics_collector") {
793 "//components/safe_browsing/core/common:safe_browsing_prefs",
794 "//content/public/browser",
795 ]
796+ }
797 }
798
799 source_set("test_support") {
800--- chrome/browser/ssl/security_state_tab_helper.cc.orig
801+++ chrome/browser/ssl/security_state_tab_helper.cc
802@@ -217,89 +217,6 @@ bool SecurityStateTabHelper::UsedPolicyI
803
804 security_state::MaliciousContentStatus
805 SecurityStateTabHelper::GetMaliciousContentStatus() const {
806- content::NavigationEntry* entry =
807- web_contents()->GetController().GetVisibleEntry();
808- if (!entry)
809- return security_state::MALICIOUS_CONTENT_STATUS_NONE;
810- safe_browsing::SafeBrowsingService* sb_service =
811- g_browser_process->safe_browsing_service();
812- if (!sb_service)
813- return security_state::MALICIOUS_CONTENT_STATUS_NONE;
814- scoped_refptr<SafeBrowsingUIManager> sb_ui_manager = sb_service->ui_manager();
815- safe_browsing::SBThreatType threat_type;
816- if (sb_ui_manager->IsUrlAllowlistedOrPendingForWebContents(
817- entry->GetURL(), false, entry, web_contents(), false, &threat_type)) {
818- switch (threat_type) {
819- case safe_browsing::SB_THREAT_TYPE_UNUSED:
820- case safe_browsing::SB_THREAT_TYPE_SAFE:
821- case safe_browsing::SB_THREAT_TYPE_URL_PHISHING:
822- case safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING:
823- return security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING;
824- case safe_browsing::SB_THREAT_TYPE_URL_MALWARE:
825- case safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE:
826- return security_state::MALICIOUS_CONTENT_STATUS_MALWARE;
827- case safe_browsing::SB_THREAT_TYPE_URL_UNWANTED:
828- return security_state::MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE;
829- case safe_browsing::SB_THREAT_TYPE_SAVED_PASSWORD_REUSE:
830-#if BUILDFLAG(FULL_SAFE_BROWSING)
831- return security_state::MALICIOUS_CONTENT_STATUS_SAVED_PASSWORD_REUSE;
832-#endif
833- case safe_browsing::SB_THREAT_TYPE_SIGNED_IN_SYNC_PASSWORD_REUSE:
834-#if BUILDFLAG(FULL_SAFE_BROWSING)
835- if (safe_browsing::ChromePasswordProtectionService::
836- ShouldShowPasswordReusePageInfoBubble(
837- web_contents(), PasswordType::PRIMARY_ACCOUNT_PASSWORD)) {
838- return security_state::
839- MALICIOUS_CONTENT_STATUS_SIGNED_IN_SYNC_PASSWORD_REUSE;
840- }
841-#endif
842- FALLTHROUGH;
843- case safe_browsing::SB_THREAT_TYPE_SIGNED_IN_NON_SYNC_PASSWORD_REUSE:
844-#if BUILDFLAG(FULL_SAFE_BROWSING)
845- if (safe_browsing::ChromePasswordProtectionService::
846- ShouldShowPasswordReusePageInfoBubble(
847- web_contents(), PasswordType::OTHER_GAIA_PASSWORD)) {
848- return security_state::
849- MALICIOUS_CONTENT_STATUS_SIGNED_IN_NON_SYNC_PASSWORD_REUSE;
850- }
851-#endif
852- FALLTHROUGH;
853- case safe_browsing::SB_THREAT_TYPE_ENTERPRISE_PASSWORD_REUSE:
854-#if BUILDFLAG(FULL_SAFE_BROWSING)
855- if (safe_browsing::ChromePasswordProtectionService::
856- ShouldShowPasswordReusePageInfoBubble(
857- web_contents(), PasswordType::ENTERPRISE_PASSWORD)) {
858- return security_state::
859- MALICIOUS_CONTENT_STATUS_ENTERPRISE_PASSWORD_REUSE;
860- }
861-#endif
862- // If user has already changed password or FULL_SAFE_BROWSING isn't
863- // enabled, returns the regular social engineering content status.
864- return security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING;
865- case safe_browsing::SB_THREAT_TYPE_BILLING:
866- return security_state::MALICIOUS_CONTENT_STATUS_BILLING;
867- case safe_browsing::
868- DEPRECATED_SB_THREAT_TYPE_URL_PASSWORD_PROTECTION_PHISHING:
869- case safe_browsing::SB_THREAT_TYPE_URL_BINARY_MALWARE:
870- case safe_browsing::SB_THREAT_TYPE_EXTENSION:
871- case safe_browsing::SB_THREAT_TYPE_BLOCKLISTED_RESOURCE:
872- case safe_browsing::SB_THREAT_TYPE_API_ABUSE:
873- case safe_browsing::SB_THREAT_TYPE_SUBRESOURCE_FILTER:
874- case safe_browsing::SB_THREAT_TYPE_CSD_ALLOWLIST:
875- case safe_browsing::SB_THREAT_TYPE_AD_SAMPLE:
876- case safe_browsing::SB_THREAT_TYPE_BLOCKED_AD_POPUP:
877- case safe_browsing::SB_THREAT_TYPE_BLOCKED_AD_REDIRECT:
878- case safe_browsing::SB_THREAT_TYPE_SUSPICIOUS_SITE:
879- case safe_browsing::SB_THREAT_TYPE_APK_DOWNLOAD:
880- case safe_browsing::SB_THREAT_TYPE_HIGH_CONFIDENCE_ALLOWLIST:
881- case safe_browsing::SB_THREAT_TYPE_ACCURACY_TIPS:
882- // These threat types are not currently associated with
883- // interstitials, and thus resources with these threat types are
884- // not ever whitelisted or pending whitelisting.
885- NOTREACHED();
886- break;
887- }
888- }
889 return security_state::MALICIOUS_CONTENT_STATUS_NONE;
890 }
891
892--- chrome/browser/ui/BUILD.gn.orig
893+++ chrome/browser/ui/BUILD.gn
894@@ -3946,7 +3946,6 @@ static_library("ui") {
895 "views/device_chooser_content_view.h",
896 "views/devtools_process_observer.cc",
897 "views/devtools_process_observer.h",
898- "views/download/download_danger_prompt_views.cc",
899 "views/download/download_in_progress_dialog_view.cc",
900 "views/download/download_in_progress_dialog_view.h",
901 "views/download/download_item_view.cc",
902--- chrome/browser/ui/tab_helpers.cc.orig
903+++ chrome/browser/ui/tab_helpers.cc
904@@ -330,16 +330,6 @@ void TabHelpers::AttachTabHelpers(WebCon
905 // See https://crbug.com/910288.
906 resource_coordinator::ResourceCoordinatorTabHelper::CreateForWebContents(
907 web_contents);
908- safe_browsing::SafeBrowsingNavigationObserver::MaybeCreateForWebContents(
909- web_contents, HostContentSettingsMapFactory::GetForProfile(profile),
910- safe_browsing::SafeBrowsingNavigationObserverManagerFactory::
911- GetForBrowserContext(profile),
912- profile->GetPrefs(), g_browser_process->safe_browsing_service());
913- safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(
914- web_contents,
915- std::make_unique<safe_browsing::ChromeSafeBrowsingTabObserverDelegate>());
916- safe_browsing::TriggerCreator::MaybeCreateTriggersForWebContents(
917- profile, web_contents);
918 ReputationWebContentsObserver::CreateForWebContents(web_contents);
919 SearchEngineTabHelper::CreateForWebContents(web_contents);
920 SecurityStateTabHelper::CreateForWebContents(web_contents);
921--- chrome/browser/ui/webui/downloads/downloads_dom_handler.cc.orig
922+++ chrome/browser/ui/webui/downloads/downloads_dom_handler.cc
923@@ -23,7 +23,6 @@
924 #include "base/threading/thread.h"
925 #include "base/values.h"
926 #include "chrome/browser/browser_process.h"
927-#include "chrome/browser/download/download_danger_prompt.h"
928 #include "chrome/browser/download/download_history.h"
929 #include "chrome/browser/download/download_item_model.h"
930 #include "chrome/browser/download/download_prefs.h"
931@@ -171,9 +170,6 @@ void DownloadsDOMHandler::SaveDangerousR
932 }
933
934 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS);
935- download::DownloadItem* file = GetDownloadByStringId(id);
936- if (file)
937- ShowDangerPrompt(file);
938 }
939
940 void DownloadsDOMHandler::AcceptIncognitoWarning(const std::string& id) {
941@@ -325,12 +321,6 @@ void DownloadsDOMHandler::RemoveDownload
942 IdSet ids;
943
944 for (auto* download : to_remove) {
945- if (download->IsDangerous() || download->IsMixedContent()) {
946- // Don't allow users to revive dangerous downloads; just nuke 'em.
947- download->Remove();
948- continue;
949- }
950-
951 DownloadItemModel item_model(download);
952 if (!item_model.ShouldShowInShelf() ||
953 download->GetState() == download::DownloadItem::IN_PROGRESS) {
954@@ -404,44 +394,6 @@ void DownloadsDOMHandler::FinalizeRemova
955 }
956 }
957
958-void DownloadsDOMHandler::ShowDangerPrompt(
959- download::DownloadItem* dangerous_item) {
960- DownloadDangerPrompt* danger_prompt = DownloadDangerPrompt::Create(
961- dangerous_item, GetWebUIWebContents(), false,
962- base::BindOnce(&DownloadsDOMHandler::DangerPromptDone,
963- weak_ptr_factory_.GetWeakPtr(), dangerous_item->GetId()));
964- // danger_prompt will delete itself.
965- DCHECK(danger_prompt);
966-}
967-
968-void DownloadsDOMHandler::DangerPromptDone(
969- int download_id,
970- DownloadDangerPrompt::Action action) {
971- if (action != DownloadDangerPrompt::ACCEPT)
972- return;
973- download::DownloadItem* item = NULL;
974- if (GetMainNotifierManager())
975- item = GetMainNotifierManager()->GetDownload(download_id);
976- if (!item && GetOriginalNotifierManager())
977- item = GetOriginalNotifierManager()->GetDownload(download_id);
978- if (!item || item->IsDone())
979- return;
980- CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS);
981-
982- // If a download is mixed content, validate that first. Is most cases, mixed
983- // content warnings will occur first, but in the worst case scenario, we show
984- // a dangerous warning twice. That's better than showing a mixed content
985- // warning, then dismissing the dangerous download warning. Since mixed
986- // content downloads triggering the UI are temporary and rare to begin with,
987- // this should very rarely occur.
988- if (item->IsMixedContent()) {
989- item->ValidateMixedContentDownload();
990- return;
991- }
992-
993- item->ValidateDangerousDownload();
994-}
995-
996 bool DownloadsDOMHandler::IsDeletingHistoryAllowed() {
997 content::DownloadManager* manager = GetMainNotifierManager();
998 return manager &&
999--- chrome/browser/ui/webui/downloads/downloads_dom_handler.h.orig
1000+++ chrome/browser/ui/webui/downloads/downloads_dom_handler.h
1001@@ -12,7 +12,6 @@
1002
1003 #include "base/macros.h"
1004 #include "base/memory/weak_ptr.h"
1005-#include "chrome/browser/download/download_danger_prompt.h"
1006 #include "chrome/browser/ui/webui/downloads/downloads.mojom-forward.h"
1007 #include "chrome/browser/ui/webui/downloads/downloads_list_tracker.h"
1008 #include "content/public/browser/web_contents_observer.h"
1009@@ -94,18 +93,6 @@ class DownloadsDOMHandler : public conte
1010 // null-checking |original_notifier_|.
1011 content::DownloadManager* GetOriginalNotifierManager() const;
1012
1013- // Displays a native prompt asking the user for confirmation after accepting
1014- // the dangerous download specified by |dangerous|. The function returns
1015- // immediately, and will invoke DangerPromptAccepted() asynchronously if the
1016- // user accepts the dangerous download. The native prompt will observe
1017- // |dangerous| until either the dialog is dismissed or |dangerous| is no
1018- // longer an in-progress dangerous download.
1019- virtual void ShowDangerPrompt(download::DownloadItem* dangerous);
1020-
1021- // Conveys danger acceptance from the DownloadDangerPrompt to the
1022- // DownloadItem.
1023- void DangerPromptDone(int download_id, DownloadDangerPrompt::Action action);
1024-
1025 // Returns true if the records of any downloaded items are allowed (and able)
1026 // to be deleted.
1027 bool IsDeletingHistoryAllowed();
1028--- chrome/browser/ui/webui/interstitials/interstitial_ui.cc.orig
1029+++ chrome/browser/ui/webui/interstitials/interstitial_ui.cc
1030@@ -281,116 +281,6 @@ CreateHttpsOnlyModePage(content::WebCont
1031 request_url));
1032 }
1033
1034-std::unique_ptr<safe_browsing::SafeBrowsingBlockingPage>
1035-CreateSafeBrowsingBlockingPage(content::WebContents* web_contents) {
1036- safe_browsing::SBThreatType threat_type =
1037- safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
1038- GURL request_url("http://example.com");
1039- std::string url_param;
1040- if (net::GetValueForKeyInQuery(web_contents->GetURL(), "url", &url_param)) {
1041- if (GURL(url_param).is_valid()) {
1042- request_url = GURL(url_param);
1043- }
1044- }
1045- GURL main_frame_url(request_url);
1046- // TODO(mattm): add flag to change main_frame_url or add dedicated flag to
1047- // test subresource interstitials.
1048- std::string type_param;
1049- if (net::GetValueForKeyInQuery(web_contents->GetURL(), "type", &type_param)) {
1050- if (type_param == "malware") {
1051- threat_type = safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
1052- } else if (type_param == "phishing") {
1053- threat_type = safe_browsing::SB_THREAT_TYPE_URL_PHISHING;
1054- } else if (type_param == "unwanted") {
1055- threat_type = safe_browsing::SB_THREAT_TYPE_URL_UNWANTED;
1056- } else if (type_param == "clientside_malware") {
1057- threat_type = safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE;
1058- } else if (type_param == "clientside_phishing") {
1059- threat_type = safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING;
1060- } else if (type_param == "billing") {
1061- threat_type = safe_browsing::SB_THREAT_TYPE_BILLING;
1062- }
1063- }
1064- const content::GlobalRenderFrameHostId primary_main_frame_id =
1065- web_contents->GetMainFrame()->GetGlobalId();
1066- safe_browsing::SafeBrowsingBlockingPage::UnsafeResource resource;
1067- resource.url = request_url;
1068- resource.is_subresource = request_url != main_frame_url;
1069- resource.is_subframe = false;
1070- resource.threat_type = threat_type;
1071- resource.render_process_id = primary_main_frame_id.child_id;
1072- resource.render_frame_id = primary_main_frame_id.frame_routing_id;
1073- resource.threat_source = g_browser_process->safe_browsing_service()
1074- ->database_manager()
1075- ->GetThreatSource();
1076-
1077- // Normally safebrowsing interstitial types which block the main page load
1078- // (SB_THREAT_TYPE_URL_MALWARE, SB_THREAT_TYPE_URL_PHISHING, and
1079- // SB_THREAT_TYPE_URL_UNWANTED on main-frame loads) would expect there to be a
1080- // pending navigation when the SafeBrowsingBlockingPage is created. This demo
1081- // creates a SafeBrowsingBlockingPage but does not actually show a real
1082- // interstitial. Instead it extracts the html and displays it manually, so the
1083- // parts which depend on the NavigationEntry are not hit.
1084- auto* ui_manager =
1085- g_browser_process->safe_browsing_service()->ui_manager().get();
1086- return base::WrapUnique<safe_browsing::SafeBrowsingBlockingPage>(
1087- ui_manager->blocking_page_factory()->CreateSafeBrowsingPage(
1088- ui_manager, web_contents, main_frame_url, {resource}, true));
1089-}
1090-
1091-std::unique_ptr<TestSafeBrowsingBlockingPageQuiet>
1092-CreateSafeBrowsingQuietBlockingPage(content::WebContents* web_contents) {
1093- safe_browsing::SBThreatType threat_type =
1094- safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
1095- GURL request_url("http://example.com");
1096- std::string url_param;
1097- if (net::GetValueForKeyInQuery(web_contents->GetURL(), "url", &url_param)) {
1098- if (GURL(url_param).is_valid())
1099- request_url = GURL(url_param);
1100- }
1101- GURL main_frame_url(request_url);
1102- std::string type_param;
1103- bool is_giant_webview = false;
1104- if (net::GetValueForKeyInQuery(web_contents->GetURL(), "type", &type_param)) {
1105- if (type_param == "malware") {
1106- threat_type = safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
1107- } else if (type_param == "phishing") {
1108- threat_type = safe_browsing::SB_THREAT_TYPE_URL_PHISHING;
1109- } else if (type_param == "unwanted") {
1110- threat_type = safe_browsing::SB_THREAT_TYPE_URL_UNWANTED;
1111- } else if (type_param == "billing") {
1112- threat_type = safe_browsing::SB_THREAT_TYPE_BILLING;
1113- } else if (type_param == "giant") {
1114- threat_type = safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
1115- is_giant_webview = true;
1116- }
1117- }
1118- const content::GlobalRenderFrameHostId primary_main_frame_id =
1119- web_contents->GetMainFrame()->GetGlobalId();
1120- safe_browsing::SafeBrowsingBlockingPage::UnsafeResource resource;
1121- resource.url = request_url;
1122- resource.is_subresource = request_url != main_frame_url;
1123- resource.is_subframe = false;
1124- resource.threat_type = threat_type;
1125- resource.render_process_id = primary_main_frame_id.child_id;
1126- resource.render_frame_id = primary_main_frame_id.frame_routing_id;
1127- resource.threat_source = g_browser_process->safe_browsing_service()
1128- ->database_manager()
1129- ->GetThreatSource();
1130-
1131- // Normally safebrowsing interstitial types which block the main page load
1132- // (SB_THREAT_TYPE_URL_MALWARE, SB_THREAT_TYPE_URL_PHISHING, and
1133- // SB_THREAT_TYPE_URL_UNWANTED on main-frame loads) would expect there to be a
1134- // pending navigation when the SafeBrowsingBlockingPage is created. This demo
1135- // creates a SafeBrowsingBlockingPage but does not actually show a real
1136- // interstitial. Instead it extracts the html and displays it manually, so the
1137- // parts which depend on the NavigationEntry are not hit.
1138- return base::WrapUnique<TestSafeBrowsingBlockingPageQuiet>(
1139- TestSafeBrowsingBlockingPageQuiet::CreateBlockingPage(
1140- g_browser_process->safe_browsing_service()->ui_manager().get(),
1141- web_contents, main_frame_url, resource, is_giant_webview));
1142-}
1143-
1144 #if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION)
1145 std::unique_ptr<CaptivePortalBlockingPage> CreateCaptivePortalBlockingPage(
1146 content::WebContents* web_contents) {
1147@@ -507,8 +397,6 @@ void InterstitialHTMLSource::StartDataRe
1148 interstitial_delegate = CreateBlockedInterceptionBlockingPage(web_contents);
1149 } else if (path_without_query == "/legacy-tls") {
1150 interstitial_delegate = CreateLegacyTLSBlockingPage(web_contents);
1151- } else if (path_without_query == "/safebrowsing") {
1152- interstitial_delegate = CreateSafeBrowsingBlockingPage(web_contents);
1153 } else if (path_without_query == "/clock") {
1154 interstitial_delegate = CreateBadClockBlockingPage(web_contents);
1155 } else if (path_without_query == "/lookalike") {
1156@@ -525,16 +413,12 @@ void InterstitialHTMLSource::StartDataRe
1157 interstitial_delegate = CreateHttpsOnlyModePage(web_contents);
1158 }
1159
1160- if (path_without_query == "/quietsafebrowsing") {
1161- std::unique_ptr<TestSafeBrowsingBlockingPageQuiet> blocking_page =
1162- CreateSafeBrowsingQuietBlockingPage(web_contents);
1163- html = blocking_page->GetHTML();
1164- interstitial_delegate = std::move(blocking_page);
1165 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
1166- } else if (path_without_query == "/supervised_user") {
1167+ if (path_without_query == "/supervised_user") {
1168 html = GetSupervisedUserInterstitialHTML(path);
1169+ } else
1170 #endif
1171- } else if (interstitial_delegate.get()) {
1172+ if (interstitial_delegate.get()) {
1173 html = interstitial_delegate.get()->GetHTMLContents();
1174 } else {
1175 html = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
1176--- chrome/renderer/chrome_content_renderer_client.cc.orig
1177+++ chrome/renderer/chrome_content_renderer_client.cc
1178@@ -97,7 +97,6 @@
1179 #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h"
1180 #include "components/paint_preview/buildflags/buildflags.h"
1181 #include "components/safe_browsing/buildflags.h"
1182-#include "components/safe_browsing/content/renderer/threat_dom_details.h"
1183 #include "components/spellcheck/spellcheck_buildflags.h"
1184 #include "components/subresource_filter/content/renderer/subresource_filter_agent.h"
1185 #include "components/subresource_filter/content/renderer/unverified_ruleset_dealer.h"
1186--- components/security_interstitials/content/cert_report_helper.cc.orig
1187+++ components/security_interstitials/content/cert_report_helper.cc
1188@@ -177,7 +177,6 @@ void CertReportHelper::FinishCertCollect
1189 return;
1190 }
1191
1192- ssl_cert_reporter_->ReportInvalidCertificateChain(serialized_report);
1193 }
1194
1195 bool CertReportHelper::ShouldShowCertificateReporterCheckbox() {