2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-12-25 16:50:07 -07:00
repo/testing/chromium/patches/0001-fix-building-without-safebrowsing.patch
2019-07-30 23:35:53 +03:00

1238 lines
54 KiB
Diff

--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -889,30 +889,6 @@ void SetApplicationLocaleOnIOThread(cons
GetIOThreadApplicationLocale() = 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;
@@ -2130,7 +2106,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);
}
@@ -2789,7 +2765,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());
}
@@ -3076,8 +3052,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();
@@ -4350,7 +4324,7 @@ ChromeContentBrowserClient::CreateThrott
if (base::FeatureList::IsEnabled(features::kSSLCommittedInterstitials)) {
throttles.push_back(std::make_unique<SSLErrorNavigationThrottle>(
handle,
- std::make_unique<CertificateReportingServiceCertReporter>(web_contents),
+ nullptr,
base::Bind(&SSLErrorHandler::HandleSSLError)));
}
@@ -4382,11 +4356,6 @@ ChromeContentBrowserClient::CreateThrott
PreviewsLitePageDecider::MaybeCreateThrottleFor(handle);
if (previews_lite_page_throttle)
throttles.push_back(std::move(previews_lite_page_throttle));
- if (base::FeatureList::IsEnabled(safe_browsing::kCommittedSBInterstitials)) {
- throttles.push_back(
- std::make_unique<safe_browsing::SafeBrowsingNavigationThrottle>(
- handle));
- }
#if defined(OS_WIN) || defined(OS_MACOSX) || \
(defined(OS_LINUX) && !defined(OS_CHROMEOS))
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -562,18 +562,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_);
{
@@ -582,7 +570,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
@@ -290,8 +290,7 @@ void NotifyUIThreadOfRequestComplete(
} // 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()) {}
ChromeResourceDispatcherHostDelegate::~ChromeResourceDispatcherHostDelegate() {
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -305,8 +304,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);
#if BUILDFLAG(ENABLE_OFFLINE_PAGES) || BUILDFLAG(ENABLE_NACL)
--- a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
+++ b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
@@ -267,117 +267,6 @@ LookalikeUrlInterstitialPage* CreateLook
safe_url));
}
-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)) {
- 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 == "unwanted") {
- threat_type = safe_browsing::SB_THREAT_TYPE_URL_UNWANTED;
- } 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;
- } else if (type_param == "billing") {
- threat_type = safe_browsing::SB_THREAT_TYPE_BILLING;
- }
- }
- 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 == "unwanted") {
- threat_type = safe_browsing::SB_THREAT_TYPE_URL_UNWANTED;
- } else if (type_param == "billing") {
- threat_type = safe_browsing::SB_THREAT_TYPE_BILLING;
- } 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) {
@@ -484,8 +373,6 @@ void InterstitialHTMLSource::StartDataRe
interstitial_delegate.reset(CreateSSLBlockingPage(web_contents));
} 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));
} else if (path_without_query == "/lookalike") {
@@ -501,11 +388,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
@@ -32,28 +32,9 @@ 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()->GetV4ProtocolConfig());
- } else {
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::BindOnce(callback, BLACKLISTED_UNKNOWN));
- return;
- }
- }
-
- bool request_already_sent = base::ContainsKey(callbacks_, id);
- callbacks_.insert(std::make_pair(id, callback));
- 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();
- }
-
- SendRequest(id);
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::BindOnce(callback, BLACKLISTED_UNKNOWN));
+ return;
}
void BlacklistStateFetcher::SendRequest(const std::string& id) {
@@ -64,8 +45,7 @@ void BlacklistStateFetcher::SendRequest(
std::string request_str;
request.SerializeToString(&request_str);
- GURL request_url = GURL(safe_browsing::GetReportUrl(
- *safe_browsing_config_, "clientreport/crx-list-info"));
+ GURL request_url = GURL();
net::NetworkTrafficAnnotationTag traffic_annotation =
net::DefineNetworkTrafficAnnotation("extension_blacklist", R"(
semantics {
@@ -112,12 +92,6 @@ void BlacklistStateFetcher::SendRequest(
base::Unretained(this), fetcher));
}
-void BlacklistStateFetcher::SetSafeBrowsingConfig(
- const safe_browsing::V4ProtocolConfig& config) {
- safe_browsing_config_ =
- std::make_unique<safe_browsing::V4ProtocolConfig>(config);
-}
-
void BlacklistStateFetcher::OnURLLoaderComplete(
network::SimpleURLLoader* url_loader,
std::unique_ptr<std::string> response_body) {
--- a/chrome/browser/extensions/blacklist_state_fetcher.h
+++ b/chrome/browser/extensions/blacklist_state_fetcher.h
@@ -34,8 +34,6 @@ class BlacklistStateFetcher {
virtual void Request(const std::string& id, const RequestCallback& callback);
- void SetSafeBrowsingConfig(const safe_browsing::V4ProtocolConfig& config);
-
protected:
void OnURLLoaderComplete(network::SimpleURLLoader* url_loader,
std::unique_ptr<std::string> response_body);
@@ -54,7 +52,6 @@ class BlacklistStateFetcher {
void SendRequest(const std::string& id);
- std::unique_ptr<safe_browsing::V4ProtocolConfig> 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
@@ -320,13 +320,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)
@@ -637,16 +630,6 @@ void ChromeDownloadManagerDelegate::Choo
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
@@ -73,7 +73,6 @@
#include "chrome/browser/printing/print_preview_dialog_controller.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/resource_coordinator/resource_coordinator_parts.h"
-#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/site_isolation/prefs_observer.h"
#include "chrome/browser/startup_data.h"
@@ -386,8 +385,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();
@@ -1008,22 +1005,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::RulesetService*
BrowserProcessImpl::subresource_filter_ruleset_service() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -1311,16 +1292,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
@@ -173,9 +173,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::RulesetService* subresource_filter_ruleset_service()
override;
optimization_guide::OptimizationGuideService* optimization_guide_service()
@@ -321,9 +318,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::RulesetService>
subresource_filter_ruleset_service_;
--- a/chrome/browser/browser_process.h
+++ b/chrome/browser/browser_process.h
@@ -44,10 +44,6 @@ class NetworkQualityTracker;
class SharedURLLoaderFactory;
}
-namespace safe_browsing {
-class SafeBrowsingService;
-}
-
namespace subresource_filter {
class RulesetService;
}
@@ -117,10 +113,6 @@ class ResourceCoordinatorParts;
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 {
@@ -235,14 +227,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::RulesetService*
--- a/chrome/browser/ui/webui/downloads/downloads_dom_handler.h
+++ b/chrome/browser/ui/webui/downloads/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/downloads/downloads_list_tracker.h"
#include "chrome/browser/ui/webui/downloads/downloads.mojom.h"
#include "content/public/browser/web_contents_observer.h"
@@ -85,18 +84,6 @@ class DownloadsDOMHandler : public conte
// 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/downloads/downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc
@@ -22,7 +22,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"
@@ -162,9 +161,6 @@ void DownloadsDOMHandler::SaveDangerousR
}
CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS);
- download::DownloadItem* file = GetDownloadByStringId(id);
- if (file)
- ShowDangerPrompt(file);
}
void DownloadsDOMHandler::DiscardDangerous(const std::string& id) {
@@ -307,12 +303,6 @@ void DownloadsDOMHandler::RemoveDownload
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) {
@@ -369,32 +359,6 @@ void DownloadsDOMHandler::FinalizeRemova
}
}
-void DownloadsDOMHandler::ShowDangerPrompt(
- download::DownloadItem* dangerous_item) {
- DownloadDangerPrompt* danger_prompt = DownloadDangerPrompt::Create(
- dangerous_item, GetWebUIWebContents(), false,
- base::Bind(&DownloadsDOMHandler::DangerPromptDone,
- weak_ptr_factory_.GetWeakPtr(), dangerous_item->GetId()));
- // danger_prompt will delete itself.
- DCHECK(danger_prompt);
-}
-
-void DownloadsDOMHandler::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 DownloadsDOMHandler::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
@@ -38,7 +38,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_open_prompt.h"
#include "chrome/browser/download/download_prefs.h"
@@ -1304,9 +1303,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_));
@@ -1344,40 +1340,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_information(), download_id);
- if (InvalidId(download_item, &error_) ||
- Fault(download_item->GetState() != DownloadItem::IN_PROGRESS,
- download_extension_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/extensions/chrome_extension_function.h"
#include "chrome/common/extensions/api/downloads.h"
#include "components/download/content/public/all_download_item_notifier.h"
@@ -189,25 +188,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
@@ -224,14 +224,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);
}
}
@@ -381,10 +374,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
@@ -258,9 +258,7 @@ DownloadTargetDeterminer::Result
// considered safe by safe browsing. Noticed that when generating file name,
// |suggested_filename| and Content-Disposition header have higher priority
// than the URL.
- bool safe_file_ext =
- !safe_browsing::FileTypePolicies::GetInstance()->IsCheckedBinaryFile(
- generated_filename);
+ bool safe_file_ext = true;
net::HttpContentDisposition content_disposition_header(
download_->GetContentDisposition(), referrer_charset);
bool should_replace_extension =
@@ -1028,29 +1026,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/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -2831,8 +2831,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
@@ -2514,7 +2514,6 @@ jumbo_split_static_library("ui") {
"views/desktop_capture/desktop_media_tab_list.h",
"views/device_chooser_content_view.cc",
"views/device_chooser_content_view.h",
- "views/download/download_danger_prompt_views.cc",
"views/download/download_in_progress_dialog_view.cc",
"views/download/download_in_progress_dialog_view.h",
"views/download/download_item_view.cc",
--- a/chrome/browser/ssl/security_state_tab_helper.cc
+++ b/chrome/browser/ssl/security_state_tab_helper.cc
@@ -195,77 +195,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:
- 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_SIGN_IN_PASSWORD_REUSE:
-#if defined(FULL_SAFE_BROWSING)
- if (safe_browsing::ChromePasswordProtectionService::
- ShouldShowPasswordReusePageInfoBubble(
- web_contents(),
- safe_browsing::LoginReputationClientRequest::
- PasswordReuseEvent::SIGN_IN_PASSWORD)) {
- return security_state::
- MALICIOUS_CONTENT_STATUS_SIGN_IN_PASSWORD_REUSE;
- }
- // If user has already changed Gaia password, returns the regular
- // social engineering content status.
- return security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING;
-#endif
- case safe_browsing::SB_THREAT_TYPE_ENTERPRISE_PASSWORD_REUSE:
-#if defined(FULL_SAFE_BROWSING)
- if (safe_browsing::ChromePasswordProtectionService::
- ShouldShowPasswordReusePageInfoBubble(
- web_contents(),
- safe_browsing::LoginReputationClientRequest::
- PasswordReuseEvent::ENTERPRISE_PASSWORD)) {
- return security_state::
- MALICIOUS_CONTENT_STATUS_ENTERPRISE_PASSWORD_REUSE;
- }
- // If user has already changed Gaia password, returns the regular
- // social engineering content status.
- return security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING;
-#endif
- case safe_browsing::SB_THREAT_TYPE_BILLING:
- return security_state::MALICIOUS_CONTENT_STATUS_BILLING;
- 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:
- case safe_browsing::SB_THREAT_TYPE_APK_DOWNLOAD:
- // 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
@@ -639,36 +639,6 @@ void ChromeBrowsingDataRemoverDelegate::
CONTENT_SETTINGS_TYPE_CLIENT_HINTS, base::Time(), base::Time::Max(),
website_settings_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 (IsForAllTime()) {
- safe_browsing::SafeBrowsingService* sb_service =
- g_browser_process->safe_browsing_service();
- if (sb_service) {
- network::mojom::CookieManagerPtr cookie_manager;
- sb_service->GetNetworkContext()->GetCookieManager(
- mojo::MakeRequest(&cookie_manager));
-
- network::mojom::CookieManager* manager_ptr = cookie_manager.get();
-
- network::mojom::CookieDeletionFilterPtr deletion_filter =
- filter_builder.BuildCookieDeletionFilter();
- if (!delete_begin_.is_null())
- deletion_filter->created_after_time = delete_begin_;
- if (!delete_end_.is_null())
- deletion_filter->created_before_time = delete_end_;
-
- manager_ptr->DeleteCookies(
- std::move(deletion_filter),
- base::BindOnce(
- &OnClearedCookies,
- CreateTaskCompletionClosure(TracingDataType::kCookies),
- std::move(cookie_manager)));
- }
- }
-
MediaDeviceIDSalt::Reset(profile_->GetPrefs());
}
--- a/chrome/browser/metrics/chrome_metrics_service_client.cc
+++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -695,9 +695,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
@@ -238,7 +238,6 @@ void ChromeBrowserMainExtraPartsProfiles
#if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION)
CaptivePortalServiceFactory::GetInstance();
#endif
- CertificateReportingServiceFactory::GetInstance();
ChromeBrowsingDataRemoverDelegateFactory::GetInstance();
#if defined(OS_CHROMEOS)
chromeos::android_sms::AndroidSmsServiceFactory::GetInstance();
--- a/chrome/browser/ssl/captive_portal_blocking_page.cc
+++ b/chrome/browser/ssl/captive_portal_blocking_page.cc
@@ -211,10 +211,7 @@ void CaptivePortalBlockingPage::Populate
load_time_data->SetString("recurrentErrorParagraph", "");
load_time_data->SetBoolean("show_recurrent_error_paragraph", false);
- if (cert_report_helper())
- cert_report_helper()->PopulateExtendedReportingOption(load_time_data);
- else
- load_time_data->SetBoolean(security_interstitials::kDisplayCheckBox, false);
+ load_time_data->SetBoolean(security_interstitials::kDisplayCheckBox, false);
}
void CaptivePortalBlockingPage::CommandReceived(const std::string& command) {
@@ -229,8 +226,6 @@ void CaptivePortalBlockingPage::CommandR
security_interstitials::SecurityInterstitialCommand cmd =
static_cast<security_interstitials::SecurityInterstitialCommand>(
command_num);
- cert_report_helper()->HandleReportingCommands(cmd,
- controller()->GetPrefService());
switch (cmd) {
case security_interstitials::CMD_OPEN_LOGIN:
captive_portal::CaptivePortalMetrics::LogCaptivePortalBlockingPageEvent(
--- a/chrome/browser/ssl/cert_report_helper.cc
+++ b/chrome/browser/ssl/cert_report_helper.cc
@@ -179,8 +179,6 @@ void CertReportHelper::FinishCertCollect
LOG(ERROR) << "Failed to serialize certificate report.";
return;
}
-
- ssl_cert_reporter_->ReportInvalidCertificateChain(serialized_report);
}
bool CertReportHelper::ShouldShowCertificateReporterCheckbox() {
--- a/chrome/browser/ui/tab_helpers.cc
+++ b/chrome/browser/ui/tab_helpers.cc
@@ -242,10 +242,6 @@ void TabHelpers::AttachTabHelpers(WebCon
PreviewsUITabHelper::CreateForWebContents(web_contents);
RecentlyAudibleHelper::CreateForWebContents(web_contents);
ResourceLoadingHintsWebContentsObserver::CreateForWebContents(web_contents);
- safe_browsing::SafeBrowsingNavigationObserver::MaybeCreateForWebContents(
- web_contents);
- safe_browsing::TriggerCreator::MaybeCreateTriggersForWebContents(
- profile, web_contents);
SearchEngineTabHelper::CreateForWebContents(web_contents);
SecurityStateTabHelper::CreateForWebContents(web_contents);
if (SiteEngagementService::IsEnabled())
@@ -295,7 +291,6 @@ void TabHelpers::AttachTabHelpers(WebCon
web_contents, std::make_unique<ChromePDFWebContentsHelperClient>());
PluginObserver::CreateForWebContents(web_contents);
SadTabHelper::CreateForWebContents(web_contents);
- safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(web_contents);
SearchTabHelper::CreateForWebContents(web_contents);
TabDialogs::CreateForWebContents(web_contents);
if (base::FeatureList::IsEnabled(features::kTabHoverCardImages))
--- a/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc
+++ b/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc
@@ -70,20 +70,6 @@ void ChromeSubresourceFilterClient::DidS
void ChromeSubresourceFilterClient::MaybeAppendNavigationThrottles(
content::NavigationHandle* navigation_handle,
std::vector<std::unique_ptr<content::NavigationThrottle>>* throttles) {
- safe_browsing::SafeBrowsingService* safe_browsing_service =
- g_browser_process->safe_browsing_service();
- if (navigation_handle->IsInMainFrame() && safe_browsing_service) {
- throttles->push_back(
- std::make_unique<subresource_filter::
- SubresourceFilterSafeBrowsingActivationThrottle>(
- navigation_handle, this,
- base::CreateSingleThreadTaskRunnerWithTraits(
- {content::BrowserThread::IO}),
- safe_browsing_service->database_manager()));
- }
-
- throttle_manager_->MaybeAppendNavigationThrottles(navigation_handle,
- throttles);
}
void ChromeSubresourceFilterClient::OnReloadRequested() {
--- a/chrome/browser/safe_browsing/BUILD.gn
+++ b/chrome/browser/safe_browsing/BUILD.gn
@@ -6,6 +6,7 @@ import("//build/config/jumbo.gni")
import("//extensions/buildflags/buildflags.gni")
jumbo_static_library("safe_browsing") {
+ if (false) {
sources = [
"safe_browsing_controller_client.cc",
"safe_browsing_controller_client.h",
@@ -100,6 +101,7 @@ jumbo_static_library("safe_browsing") {
} else {
sources += [ "chrome_cleaner/chrome_cleaner_extension_util_win_noop.cc" ]
}
+ }
if (safe_browsing_mode != 0) {
# "Safe Browsing Basic" files used for safe browsing in full mode
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -84,7 +84,6 @@
#include "components/error_page/common/localized_error.h"
#include "components/network_hints/renderer/prescient_networking_dispatcher.h"
#include "components/pdf/renderer/pepper_pdf_host.h"
-#include "components/safe_browsing/renderer/threat_dom_details.h"
#include "components/spellcheck/spellcheck_buildflags.h"
#include "components/startup_metric_utils/common/startup_metric.mojom.h"
#include "components/subresource_filter/content/renderer/subresource_filter_agent.h"
--- a/chrome/browser/net/trial_comparison_cert_verifier_controller.cc
+++ b/chrome/browser/net/trial_comparison_cert_verifier_controller.cc
@@ -112,9 +112,6 @@ void TrialComparisonCertVerifierControll
std::string serialized_report;
if (!report.Serialize(&serialized_report))
return;
-
- CertificateReportingServiceFactory::GetForBrowserContext(profile_)->Send(
- serialized_report);
}
// static
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
@@ -681,51 +681,9 @@ WebstorePrivateGetReferrerChainFunction:
ExtensionFunction::ResponseAction
WebstorePrivateGetReferrerChainFunction::Run() {
- Profile* profile = chrome_details_.GetProfile();
- if (!SafeBrowsingNavigationObserverManager::IsEnabledAndReady(profile))
- return RespondNow(ArgumentList(
- api::webstore_private::GetReferrerChain::Results::Create("")));
-
- content::WebContents* web_contents = GetSenderWebContents();
- if (!web_contents) {
- return RespondNow(ErrorWithArguments(
- api::webstore_private::GetReferrerChain::Results::Create(""),
- kWebstoreUserCancelledError));
- }
-
- scoped_refptr<SafeBrowsingNavigationObserverManager>
- navigation_observer_manager = g_browser_process->safe_browsing_service()
- ->navigation_observer_manager();
-
- safe_browsing::ReferrerChain referrer_chain;
- SafeBrowsingNavigationObserverManager::AttributionResult result =
- navigation_observer_manager->IdentifyReferrerChainByWebContents(
- web_contents, kExtensionReferrerUserGestureLimit, &referrer_chain);
-
- // If the referrer chain is incomplete we'll append the most recent
- // navigations to referrer chain for diagnostic purposes. This only happens if
- // the user is not in incognito mode and has opted into extended reporting or
- // Scout reporting. Otherwise, |CountOfRecentNavigationsToAppend| returns 0.
- int recent_navigations_to_collect =
- SafeBrowsingNavigationObserverManager::CountOfRecentNavigationsToAppend(
- *profile, result);
- if (recent_navigations_to_collect > 0) {
- navigation_observer_manager->AppendRecentNavigations(
- recent_navigations_to_collect, &referrer_chain);
- }
-
- safe_browsing::ExtensionWebStoreInstallRequest request;
- request.mutable_referrer_chain()->Swap(&referrer_chain);
- request.mutable_referrer_chain_options()->set_recent_navigations_to_collect(
- recent_navigations_to_collect);
-
- std::string serialized_referrer_proto = request.SerializeAsString();
- // Base64 encode the proto to avoid issues with base::Value rejecting strings
- // which are not valid UTF8.
- base::Base64Encode(serialized_referrer_proto, &serialized_referrer_proto);
return RespondNow(
ArgumentList(api::webstore_private::GetReferrerChain::Results::Create(
- serialized_referrer_proto)));
+ "")));
}
} // namespace extensions
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -69,7 +69,7 @@ class DownloadItemModelData : public bas
// Danger level of the file determined based on the file type and whether
// there was a user action associated with the download.
- DownloadFileType::DangerLevel danger_level_;
+ safe_browsing::DownloadFileType::DangerLevel danger_level_;
// Whether the download is currently being revived.
bool is_being_revived_;
@@ -106,7 +106,7 @@ DownloadItemModelData::DownloadItemModel
: should_show_in_shelf_(true),
was_ui_notified_(false),
should_prefer_opening_in_browser_(false),
- danger_level_(DownloadFileType::NOT_DANGEROUS),
+ danger_level_(safe_browsing::DownloadFileType::NOT_DANGEROUS),
is_being_revived_(false) {}
} // namespace
@@ -368,13 +368,13 @@ void DownloadItemModel::SetShouldPreferO
data->should_prefer_opening_in_browser_ = preference;
}
-DownloadFileType::DangerLevel DownloadItemModel::GetDangerLevel() const {
+safe_browsing::DownloadFileType::DangerLevel DownloadItemModel::GetDangerLevel() const {
const DownloadItemModelData* data = DownloadItemModelData::Get(download_);
- return data ? data->danger_level_ : DownloadFileType::NOT_DANGEROUS;
+ return data ? data->danger_level_ : safe_browsing::DownloadFileType::NOT_DANGEROUS;
}
void DownloadItemModel::SetDangerLevel(
- DownloadFileType::DangerLevel danger_level) {
+ safe_browsing::DownloadFileType::DangerLevel danger_level) {
DownloadItemModelData* data = DownloadItemModelData::GetOrCreate(download_);
data->danger_level_ = danger_level;
}
@@ -526,9 +526,6 @@ bool DownloadItemModel::IsCommandEnabled
// filename. Don't base an "Always open" decision based on it. Also
// exclude extensions.
return download_->CanOpenDownload() &&
- safe_browsing::FileTypePolicies::GetInstance()
- ->IsAllowedToOpenAutomatically(
- download_->GetTargetFilePath()) &&
!download_crx_util::IsExtensionDownload(*download_);
case DownloadCommands::PAUSE:
return !download_->IsSavePackageDownload() &&
--- a/components/safe_browsing/features.cc
+++ b/components/safe_browsing/features.cc
@@ -43,10 +43,10 @@ const base::Feature kPasswordProtectionF
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kSuspiciousSiteTriggerQuotaFeature{
- "SafeBrowsingSuspiciousSiteTriggerQuota", base::FEATURE_ENABLED_BY_DEFAULT};
+ "SafeBrowsingSuspiciousSiteTriggerQuota", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kTelemetryForApkDownloads{
- "SafeBrowsingTelemetryForApkDownloads", base::FEATURE_ENABLED_BY_DEFAULT};
+ "SafeBrowsingTelemetryForApkDownloads", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kThreatDomDetailsTagAndAttributeFeature{
"ThreatDomDetailsTagAttributes", base::FEATURE_DISABLED_BY_DEFAULT};
@@ -59,7 +59,7 @@ const base::Feature kUseLocalBlacklistsV
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kInspectRarContentFeature{"InspectRarContent",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kUseAPDownloadProtection{"UseAPDownloadProtection",
base::FEATURE_DISABLED_BY_DEFAULT};
--- a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.cc
+++ b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.cc
@@ -52,37 +52,7 @@ SafeBrowsingPrivateGetReferrerChainFunct
base::StringPrintf("Could not find tab with id %d.", params->tab_id)));
}
- Profile* profile = Profile::FromBrowserContext(browser_context());
- if (!SafeBrowsingNavigationObserverManager::IsEnabledAndReady(profile))
- return RespondNow(NoArguments());
-
- scoped_refptr<SafeBrowsingNavigationObserverManager>
- navigation_observer_manager = g_browser_process->safe_browsing_service()
- ->navigation_observer_manager();
-
- safe_browsing::ReferrerChain referrer_chain;
- SafeBrowsingNavigationObserverManager::AttributionResult result =
- navigation_observer_manager->IdentifyReferrerChainByWebContents(
- contents, kReferrerUserGestureLimit, &referrer_chain);
-
- // If the referrer chain is incomplete we'll append the most recent
- // navigations to referrer chain for diagnostic purposes. This only happens if
- // the user is not in incognito mode and has opted into extended reporting or
- // Scout reporting. Otherwise, |CountOfRecentNavigationsToAppend| returns 0.
- int recent_navigations_to_collect =
- SafeBrowsingNavigationObserverManager::CountOfRecentNavigationsToAppend(
- *profile, result);
- if (recent_navigations_to_collect > 0) {
- navigation_observer_manager->AppendRecentNavigations(
- recent_navigations_to_collect, &referrer_chain);
- }
-
std::vector<api::safe_browsing_private::ReferrerChainEntry> referrer_entries;
- referrer_entries.reserve(referrer_chain.size());
- for (const auto& entry : referrer_chain) {
- referrer_entries.emplace_back(
- safe_browsing_util::ReferrerToReferrerChainEntry(entry));
- }
return RespondNow(ArgumentList(
api::safe_browsing_private::GetReferrerChain::Results::Create(
referrer_entries)));