mirror of
https://github.com/morgan9e/helium
synced 2026-04-15 00:44:06 +09:00
567 lines
24 KiB
Diff
567 lines
24 KiB
Diff
--- a/chrome/browser/BUILD.gn
|
|
+++ b/chrome/browser/BUILD.gn
|
|
@@ -2266,7 +2266,6 @@ static_library("browser") {
|
|
"//components/reporting/util:task_runner_context",
|
|
"//components/resources",
|
|
"//components/safe_browsing/content/browser",
|
|
- "//components/safe_browsing/content/browser:client_side_detection",
|
|
"//components/safe_browsing/content/browser:safe_browsing_service",
|
|
"//components/safe_browsing/content/browser/notification_content_detection",
|
|
"//components/safe_browsing/content/browser/password_protection",
|
|
@@ -3618,8 +3617,6 @@ static_library("browser") {
|
|
"download/download_commands.cc",
|
|
"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/chrome_content_browser_client.cc
|
|
+++ b/chrome/browser/chrome_content_browser_client.cc
|
|
@@ -5403,10 +5403,6 @@ ChromeContentBrowserClient::CreateThrott
|
|
throttles.push_back(std::make_unique<PolicyBlocklistNavigationThrottle>(
|
|
handle, handle->GetWebContents()->GetBrowserContext()));
|
|
|
|
- // Before setting up SSL error detection, configure SSLErrorHandler to invoke
|
|
- // the relevant extension API whenever an SSL interstitial is shown.
|
|
- SSLErrorHandler::SetClientCallbackOnInterstitialsShown(
|
|
- base::BindRepeating(&MaybeTriggerSecurityInterstitialShownEvent));
|
|
throttles.push_back(std::make_unique<SSLErrorNavigationThrottle>(
|
|
handle,
|
|
base::BindOnce(&HandleSSLErrorWrapper), base::BindOnce(&IsInHostedApp),
|
|
@@ -5461,16 +5457,6 @@ ChromeContentBrowserClient::CreateThrott
|
|
&throttles);
|
|
#endif
|
|
|
|
- // g_browser_process->safe_browsing_service() may be null in unittests.
|
|
- safe_browsing::SafeBrowsingUIManager* ui_manager =
|
|
- g_browser_process->safe_browsing_service()
|
|
- ? g_browser_process->safe_browsing_service()->ui_manager().get()
|
|
- : nullptr;
|
|
- MaybeAddThrottle(
|
|
- safe_browsing::SafeBrowsingNavigationThrottle::MaybeCreateThrottleFor(
|
|
- handle, ui_manager),
|
|
- &throttles);
|
|
-
|
|
if (base::FeatureList::IsEnabled(safe_browsing::kDelayedWarnings)) {
|
|
throttles.push_back(
|
|
std::make_unique<safe_browsing::DelayedWarningNavigationThrottle>(
|
|
@@ -5771,8 +5757,6 @@ bool ChromeContentBrowserClient::IsPlugi
|
|
void ChromeContentBrowserClient::InitOnUIThread() {
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
|
- safe_browsing_service_ = g_browser_process->safe_browsing_service();
|
|
-
|
|
// Initialize `network_contexts_parent_directory_`.
|
|
base::FilePath user_data_dir;
|
|
base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
|
|
--- a/chrome/browser/component_updater/file_type_policies_component_installer.cc
|
|
+++ b/chrome/browser/component_updater/file_type_policies_component_installer.cc
|
|
@@ -38,21 +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/chrome_download_manager_delegate.cc
|
|
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
|
|
@@ -530,13 +530,6 @@ void ChromeDownloadManagerDelegate::SetD
|
|
|
|
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 (download_manager_) {
|
|
download_manager_->AddObserver(this);
|
|
}
|
|
@@ -1074,17 +1067,6 @@ void ChromeDownloadManagerDelegate::Choo
|
|
void ChromeDownloadManagerDelegate::SanitizeSavePackageResourceName(
|
|
base::FilePath* filename,
|
|
const GURL& source_url) {
|
|
- safe_browsing::FileTypePolicies* file_type_policies =
|
|
- safe_browsing::FileTypePolicies::GetInstance();
|
|
-
|
|
- const PrefService* prefs = profile_->GetPrefs();
|
|
- if (file_type_policies->GetFileDangerLevel(*filename, source_url, prefs) ==
|
|
- 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::SanitizeDownloadParameters(
|
|
--- a/chrome/browser/download/download_item_model.cc
|
|
+++ b/chrome/browser/download/download_item_model.cc
|
|
@@ -119,7 +119,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_ = DownloadFileType::NOT_DANGEROUS;
|
|
+ safe_browsing::DownloadFileType::DangerLevel danger_level_ = safe_browsing::DownloadFileType::NOT_DANGEROUS;
|
|
|
|
// Whether the download is currently being revived.
|
|
bool is_being_revived_ = false;
|
|
@@ -502,13 +502,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;
|
|
}
|
|
@@ -711,9 +711,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/chrome/browser/download/download_prefs.cc
|
|
+++ b/chrome/browser/download/download_prefs.cc
|
|
@@ -256,14 +256,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_by_user_.insert(extension);
|
|
- }
|
|
+ auto_open_by_user_.insert(extension);
|
|
}
|
|
}
|
|
|
|
@@ -441,10 +434,6 @@ bool DownloadPrefs::IsAutoOpenByPolicy(c
|
|
bool DownloadPrefs::EnableAutoOpenByUserBasedOnExtension(
|
|
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/download/download_target_determiner.cc
|
|
+++ b/chrome/browser/download/download_target_determiner.cc
|
|
@@ -324,13 +324,6 @@ base::FilePath DownloadTargetDeterminer:
|
|
download_->GetURL(), download_->GetContentDisposition(), referrer_charset,
|
|
suggested_filename, sniffed_mime_type, default_filename);
|
|
|
|
- // We don't replace the file extension if sfafe browsing consider the file
|
|
- // extension to be unsafe. Just let safe browsing scan the generated file.
|
|
- if (safe_browsing::FileTypePolicies::GetInstance()->IsCheckedBinaryFile(
|
|
- generated_filename)) {
|
|
- return generated_filename;
|
|
- }
|
|
-
|
|
// If no mime type or explicitly specified a name, don't replace file
|
|
// extension.
|
|
if (sniffed_mime_type.empty() || !suggested_filename.empty())
|
|
@@ -1290,68 +1283,7 @@ DownloadFileType::DangerLevel DownloadTa
|
|
PriorVisitsToReferrer visits) const {
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
|
- // User-initiated extension downloads from pref-whitelisted sources are not
|
|
- // considered dangerous.
|
|
- if (download_->HasUserGesture() &&
|
|
- download_crx_util::IsTrustedExtensionDownload(GetProfile(), *download_)) {
|
|
- return DownloadFileType::NOT_DANGEROUS;
|
|
- }
|
|
-
|
|
- DownloadFileType::DangerLevel danger_level =
|
|
- safe_browsing::FileTypePolicies::GetInstance()->GetFileDangerLevel(
|
|
- virtual_path_.BaseName(), download_->GetURL(),
|
|
- GetProfile()->GetPrefs());
|
|
- policy::DownloadRestriction download_restriction =
|
|
- static_cast<policy::DownloadRestriction>(
|
|
- GetProfile()->GetPrefs()->GetInteger(
|
|
- policy::policy_prefs::kDownloadRestrictions));
|
|
-
|
|
- // If the user has has been prompted or will be, assume that the user has
|
|
- // approved the download. A programmatic download is considered safe unless it
|
|
- // contains malware.
|
|
- bool user_approved_path =
|
|
- !download_->GetForcedFilePath().empty() &&
|
|
- // Drag and drop download paths are not approved by the user. See
|
|
- // https://crbug.com/1513639
|
|
- download_->GetDownloadSource() != download::DownloadSource::DRAG_AND_DROP;
|
|
- if (HasPromptedForPath() ||
|
|
- confirmation_reason_ != DownloadConfirmationReason::NONE ||
|
|
- user_approved_path) {
|
|
- // If the "DownloadRestrictions" enterprise policy explicitly disallows the
|
|
- // download, don't let the user gesture bypass the dangerous verdict.
|
|
- if ((download_restriction == policy::DownloadRestriction::DANGEROUS_FILES ||
|
|
- download_restriction ==
|
|
- policy::DownloadRestriction::POTENTIALLY_DANGEROUS_FILES) &&
|
|
- danger_level != DownloadFileType::NOT_DANGEROUS) {
|
|
- return DownloadFileType::DANGEROUS;
|
|
- }
|
|
- return DownloadFileType::NOT_DANGEROUS;
|
|
- }
|
|
-
|
|
- // Anything the user has marked auto-open is OK if it's user-initiated.
|
|
- if (download_prefs_->IsAutoOpenEnabled(download_->GetURL(), virtual_path_) &&
|
|
- download_->HasUserGesture())
|
|
- return DownloadFileType::NOT_DANGEROUS;
|
|
-
|
|
- // 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;
|
|
}
|
|
|
|
std::optional<base::Time>
|
|
--- 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/download/bubble/download_bubble_ui_controller.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"
|
|
@@ -1378,9 +1377,6 @@ DownloadsAcceptDangerFunction::Downloads
|
|
|
|
DownloadsAcceptDangerFunction::~DownloadsAcceptDangerFunction() = default;
|
|
|
|
-DownloadsAcceptDangerFunction::OnPromptCreatedCallback*
|
|
- DownloadsAcceptDangerFunction::on_prompt_created_ = nullptr;
|
|
-
|
|
ExtensionFunction::ResponseAction DownloadsAcceptDangerFunction::Run() {
|
|
std::optional<downloads::AcceptDanger::Params> params =
|
|
downloads::AcceptDanger::Params::Create(args());
|
|
@@ -1418,42 +1414,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,
|
|
- base::BindOnce(&DownloadsAcceptDangerFunction::DangerPromptCallback, this,
|
|
- download_id));
|
|
- // DownloadDangerPrompt deletes itself
|
|
- if (on_prompt_created_ && !on_prompt_created_->is_null())
|
|
- std::move(*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);
|
|
- std::string error;
|
|
- if (InvalidId(download_item, &error) ||
|
|
- Fault(download_item->GetState() != DownloadItem::IN_PROGRESS,
|
|
- download_extension_errors::kNotInProgress, &error)) {
|
|
- Respond(Error(std::move(error)));
|
|
- return;
|
|
- }
|
|
- switch (action) {
|
|
- case DownloadDangerPrompt::ACCEPT:
|
|
- download_item->ValidateDangerousDownload();
|
|
- break;
|
|
- case DownloadDangerPrompt::CANCEL:
|
|
- download_item->Remove();
|
|
- break;
|
|
- case DownloadDangerPrompt::DISMISS:
|
|
- break;
|
|
- }
|
|
- Respond(NoArguments());
|
|
+ download_item->ValidateDangerousDownload();
|
|
}
|
|
|
|
DownloadsShowFunction::DownloadsShowFunction() = default;
|
|
--- a/chrome/browser/extensions/api/downloads/downloads_api.h
|
|
+++ b/chrome/browser/extensions/api/downloads/downloads_api.h
|
|
@@ -13,7 +13,6 @@
|
|
#include "base/memory/raw_ptr.h"
|
|
#include "base/scoped_observation.h"
|
|
#include "base/time/time.h"
|
|
-#include "chrome/browser/download/download_danger_prompt.h"
|
|
#include "chrome/common/extensions/api/downloads.h"
|
|
#include "components/download/content/public/all_download_item_notifier.h"
|
|
#include "components/download/public/common/download_path_reservation_tracker.h"
|
|
@@ -201,13 +200,6 @@ class DownloadsRemoveFileFunction : publ
|
|
|
|
class DownloadsAcceptDangerFunction : public ExtensionFunction {
|
|
public:
|
|
- using OnPromptCreatedCallback =
|
|
- base::OnceCallback<void(DownloadDangerPrompt*)>;
|
|
- static void OnPromptCreatedForTesting(
|
|
- OnPromptCreatedCallback* callback) {
|
|
- on_prompt_created_ = callback;
|
|
- }
|
|
-
|
|
DECLARE_EXTENSION_FUNCTION("downloads.acceptDanger", DOWNLOADS_ACCEPTDANGER)
|
|
DownloadsAcceptDangerFunction();
|
|
|
|
@@ -219,13 +211,10 @@ class DownloadsAcceptDangerFunction : pu
|
|
|
|
protected:
|
|
~DownloadsAcceptDangerFunction() override;
|
|
- void DangerPromptCallback(int download_id,
|
|
- DownloadDangerPrompt::Action action);
|
|
|
|
private:
|
|
void PromptOrWait(int download_id, int retries);
|
|
|
|
- static OnPromptCreatedCallback* on_prompt_created_;
|
|
};
|
|
|
|
class DownloadsShowFunction : public ExtensionFunction {
|
|
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
|
|
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
|
|
@@ -713,18 +713,6 @@ void WebstorePrivateBeginInstallWithMani
|
|
|
|
void WebstorePrivateBeginInstallWithManifest3Function::
|
|
ReportFrictionAcceptedEvent() {
|
|
- if (!profile_) {
|
|
- return;
|
|
- }
|
|
- auto* metrics_collector =
|
|
- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
|
|
- profile_);
|
|
- // `metrics_collector` can be null in incognito.
|
|
- if (metrics_collector) {
|
|
- metrics_collector->AddSafeBrowsingEventToPref(
|
|
- safe_browsing::SafeBrowsingMetricsCollector::EventType::
|
|
- EXTENSION_ALLOWLIST_INSTALL_BYPASS);
|
|
- }
|
|
}
|
|
|
|
void WebstorePrivateBeginInstallWithManifest3Function::OnInstallPromptDone(
|
|
--- a/chrome/browser/extensions/blocklist_state_fetcher.cc
|
|
+++ b/chrome/browser/extensions/blocklist_state_fetcher.cc
|
|
@@ -75,8 +75,7 @@ void BlocklistStateFetcher::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 {
|
|
@@ -131,12 +130,6 @@ void BlocklistStateFetcher::SendRequest(
|
|
base::Unretained(this), fetcher));
|
|
}
|
|
|
|
-void BlocklistStateFetcher::SetSafeBrowsingConfig(
|
|
- const safe_browsing::V4ProtocolConfig& config) {
|
|
- safe_browsing_config_ =
|
|
- std::make_unique<safe_browsing::V4ProtocolConfig>(config);
|
|
-}
|
|
-
|
|
void BlocklistStateFetcher::OnURLLoaderComplete(
|
|
network::SimpleURLLoader* url_loader,
|
|
std::unique_ptr<std::string> response_body) {
|
|
--- a/chrome/browser/extensions/blocklist_state_fetcher.h
|
|
+++ b/chrome/browser/extensions/blocklist_state_fetcher.h
|
|
@@ -36,8 +36,6 @@ class BlocklistStateFetcher {
|
|
|
|
virtual void Request(const std::string& id, RequestCallback callback);
|
|
|
|
- void SetSafeBrowsingConfig(const safe_browsing::V4ProtocolConfig& config);
|
|
-
|
|
protected:
|
|
void OnURLLoaderComplete(network::SimpleURLLoader* url_loader,
|
|
std::unique_ptr<std::string> response_body);
|
|
--- a/chrome/browser/safe_browsing/BUILD.gn
|
|
+++ b/chrome/browser/safe_browsing/BUILD.gn
|
|
@@ -8,6 +8,7 @@ import("//components/safe_browsing/build
|
|
import("//extensions/buildflags/buildflags.gni")
|
|
|
|
static_library("safe_browsing") {
|
|
+ if (false) {
|
|
sources = [
|
|
"chrome_controller_client.cc",
|
|
"chrome_controller_client.h",
|
|
@@ -78,6 +79,7 @@ static_library("safe_browsing") {
|
|
"//mojo/public/cpp/system",
|
|
"//services/preferences/public/cpp",
|
|
]
|
|
+ }
|
|
|
|
if (is_android) {
|
|
deps += [
|
|
@@ -549,6 +551,7 @@ static_library("advanced_protection") {
|
|
}
|
|
|
|
source_set("metrics_collector") {
|
|
+ if (false) {
|
|
sources = [
|
|
"safe_browsing_metrics_collector_factory.cc",
|
|
"safe_browsing_metrics_collector_factory.h",
|
|
@@ -568,6 +571,7 @@ source_set("metrics_collector") {
|
|
"//components/safe_browsing/core/common:safe_browsing_prefs",
|
|
"//content/public/browser",
|
|
]
|
|
+ }
|
|
}
|
|
|
|
source_set("test_support") {
|
|
--- a/chrome/browser/ui/tab_helpers.cc
|
|
+++ b/chrome/browser/ui/tab_helpers.cc
|
|
@@ -486,35 +486,8 @@ void TabHelpers::AttachTabHelpers(WebCon
|
|
// See https://crbug.com/910288.
|
|
resource_coordinator::ResourceCoordinatorTabHelper::CreateForWebContents(
|
|
web_contents);
|
|
- safe_browsing::SafeBrowsingNavigationObserver::MaybeCreateForWebContents(
|
|
- web_contents, HostContentSettingsMapFactory::GetForProfile(profile),
|
|
- safe_browsing::SafeBrowsingNavigationObserverManagerFactory::
|
|
- GetForBrowserContext(profile),
|
|
- profile->GetPrefs(), g_browser_process->safe_browsing_service());
|
|
site_protection::SiteProtectionMetricsObserver::CreateForWebContents(
|
|
web_contents);
|
|
-
|
|
- if (base::FeatureList::IsEnabled(
|
|
- safe_browsing::kTailoredSecurityIntegration)) {
|
|
- safe_browsing::TailoredSecurityUrlObserver::CreateForWebContents(
|
|
- web_contents,
|
|
- safe_browsing::TailoredSecurityServiceFactory::GetForProfile(profile));
|
|
- }
|
|
- if (g_browser_process->safe_browsing_service()) {
|
|
- safe_browsing::AsyncCheckTracker::CreateForWebContents(
|
|
- web_contents, g_browser_process->safe_browsing_service()->ui_manager(),
|
|
- safe_browsing::AsyncCheckTracker::
|
|
- IsPlatformEligibleForSyncCheckerCheckAllowlist());
|
|
- }
|
|
- // SafeBrowsingTabObserver creates a ClientSideDetectionHost, which observes
|
|
- // events from PermissionRequestManager and AsyncCheckTracker in its
|
|
- // constructor. Therefore, PermissionRequestManager and AsyncCheckTracker need
|
|
- // to be created before SafeBrowsingTabObserver is created.
|
|
- safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(
|
|
- web_contents,
|
|
- std::make_unique<safe_browsing::ChromeSafeBrowsingTabObserverDelegate>());
|
|
- safe_browsing::TriggerCreator::MaybeCreateTriggersForWebContents(
|
|
- profile, web_contents);
|
|
SafetyTipWebContentsObserver::CreateForWebContents(web_contents);
|
|
SearchEngineTabHelper::CreateForWebContents(web_contents);
|
|
if (site_engagement::SiteEngagementService::IsEnabled()) {
|
|
--- a/chrome/browser/ui/views/download/BUILD.gn
|
|
+++ b/chrome/browser/ui/views/download/BUILD.gn
|
|
@@ -27,7 +27,6 @@ source_set("download") {
|
|
"bubble/download_dialog_view.h",
|
|
"bubble/download_toolbar_ui_controller.cc",
|
|
"bubble/download_toolbar_ui_controller.h",
|
|
- "download_danger_prompt_views.cc",
|
|
"download_in_progress_dialog_view.cc",
|
|
"download_in_progress_dialog_view.h",
|
|
"download_item_view.cc",
|
|
--- a/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc
|
|
+++ b/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc
|
|
@@ -25,7 +25,6 @@
|
|
#include "base/values.h"
|
|
#include "chrome/browser/browser_process.h"
|
|
#include "chrome/browser/download/bubble/download_bubble_ui_controller.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_item_warning_data.h"
|
|
@@ -536,12 +535,6 @@ void DownloadsDOMHandler::RemoveDownload
|
|
IdSet ids;
|
|
|
|
for (download::DownloadItem* download : to_remove) {
|
|
- if (download->IsDangerous() || download->IsInsecure()) {
|
|
- // 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) {
|
|
--- a/chrome/browser/ui/webui/downloads/downloads_dom_handler.h
|
|
+++ b/chrome/browser/ui/webui/downloads/downloads_dom_handler.h
|
|
@@ -13,7 +13,6 @@
|
|
#include "base/memory/raw_ptr.h"
|
|
#include "base/memory/weak_ptr.h"
|
|
#include "base/time/time.h"
|
|
-#include "chrome/browser/download/download_danger_prompt.h"
|
|
#include "chrome/browser/download/download_warning_desktop_hats_utils.h"
|
|
#include "chrome/browser/ui/webui/downloads/downloads.mojom-forward.h"
|
|
#include "chrome/browser/ui/webui/downloads/downloads_list_tracker.h"
|
|
--- a/chrome/renderer/chrome_content_renderer_client.cc
|
|
+++ b/chrome/renderer/chrome_content_renderer_client.cc
|
|
@@ -113,7 +113,6 @@
|
|
#include "components/pdf/common/pdf_util.h"
|
|
#include "components/permissions/features.h"
|
|
#include "components/safe_browsing/buildflags.h"
|
|
-#include "components/safe_browsing/content/renderer/threat_dom_details.h"
|
|
#include "components/sampling_profiler/process_type.h"
|
|
#include "components/sampling_profiler/thread_profiler.h"
|
|
#include "components/security_interstitials/content/renderer/security_interstitial_page_controller_delegate_impl.h"
|
|
@@ -484,12 +483,8 @@ void ChromeContentRendererClient::Render
|
|
thread->AddObserver(fingerprinting_protection_ruleset_dealer_.get());
|
|
}
|
|
|
|
- phishing_model_setter_ =
|
|
- std::make_unique<safe_browsing::PhishingModelSetterImpl>();
|
|
-
|
|
thread->AddObserver(chrome_observer_.get());
|
|
thread->AddObserver(subresource_filter_ruleset_dealer_.get());
|
|
- thread->AddObserver(phishing_model_setter_.get());
|
|
|
|
blink::WebScriptController::RegisterExtension(
|
|
extensions_v8::LoadTimesExtension::Get());
|