|
@@ -1,6 +1,6 @@
|
|
|
--- a/chrome/browser/BUILD.gn
|
|
|
+++ b/chrome/browser/BUILD.gn
|
|
|
-@@ -3105,8 +3105,6 @@ jumbo_static_library("browser") {
|
|
|
+@@ -3180,8 +3180,6 @@ jumbo_static_library("browser") {
|
|
|
"download/download_commands.h",
|
|
|
"download/download_crx_util.cc",
|
|
|
"download/download_crx_util.h",
|
|
@@ -11,7 +11,7 @@
|
|
|
"download/download_dir_util.cc",
|
|
|
--- a/chrome/browser/browser_process.h
|
|
|
+++ b/chrome/browser/browser_process.h
|
|
|
-@@ -45,10 +45,6 @@ class NetworkQualityTracker;
|
|
|
+@@ -46,10 +46,6 @@ class NetworkQualityTracker;
|
|
|
class SharedURLLoaderFactory;
|
|
|
}
|
|
|
|
|
@@ -22,7 +22,7 @@
|
|
|
namespace subresource_filter {
|
|
|
class RulesetService;
|
|
|
}
|
|
|
-@@ -106,10 +102,6 @@ class ResourceCoordinatorParts;
|
|
|
+@@ -107,10 +103,6 @@ class ResourceCoordinatorParts;
|
|
|
class TabManager;
|
|
|
}
|
|
|
|
|
@@ -33,7 +33,7 @@
|
|
|
// NOT THREAD SAFE, call only from the main thread.
|
|
|
// These functions shouldn't return NULL unless otherwise noted.
|
|
|
class BrowserProcess {
|
|
|
-@@ -210,14 +202,6 @@ class BrowserProcess {
|
|
|
+@@ -211,14 +203,6 @@ class BrowserProcess {
|
|
|
// on this platform (or this is a unit test).
|
|
|
virtual StatusTray* status_tray() = 0;
|
|
|
|
|
@@ -50,7 +50,7 @@
|
|
|
virtual subresource_filter::RulesetService*
|
|
|
--- a/chrome/browser/browser_process_impl.cc
|
|
|
+++ b/chrome/browser/browser_process_impl.cc
|
|
|
-@@ -67,7 +67,6 @@
|
|
|
+@@ -70,7 +70,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"
|
|
@@ -58,7 +58,7 @@
|
|
|
#include "chrome/browser/shell_integration.h"
|
|
|
#include "chrome/browser/site_isolation/prefs_observer.h"
|
|
|
#include "chrome/browser/ssl/secure_origin_prefs_observer.h"
|
|
|
-@@ -356,8 +355,6 @@ void BrowserProcessImpl::StartTearDown()
|
|
|
+@@ -373,8 +372,6 @@ void BrowserProcessImpl::StartTearDown()
|
|
|
|
|
|
metrics_services_manager_.reset();
|
|
|
intranet_redirect_detector_.reset();
|
|
@@ -67,7 +67,7 @@
|
|
|
network_time_tracker_.reset();
|
|
|
#if BUILDFLAG(ENABLE_PLUGINS)
|
|
|
plugins_resource_service_.reset();
|
|
|
-@@ -957,22 +954,6 @@ StatusTray* BrowserProcessImpl::status_t
|
|
|
+@@ -988,22 +985,6 @@ StatusTray* BrowserProcessImpl::status_t
|
|
|
return status_tray_.get();
|
|
|
}
|
|
|
|
|
@@ -90,7 +90,7 @@
|
|
|
subresource_filter::RulesetService*
|
|
|
BrowserProcessImpl::subresource_filter_ruleset_service() {
|
|
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
|
-@@ -1225,26 +1206,6 @@ void BrowserProcessImpl::CreateBackgroun
|
|
|
+@@ -1256,26 +1237,6 @@ void BrowserProcessImpl::CreateBackgroun
|
|
|
#endif
|
|
|
}
|
|
|
|
|
@@ -119,7 +119,7 @@
|
|
|
created_subresource_filter_ruleset_service_ = true;
|
|
|
--- a/chrome/browser/browser_process_impl.h
|
|
|
+++ b/chrome/browser/browser_process_impl.h
|
|
|
-@@ -165,9 +165,6 @@ class BrowserProcessImpl : public Browse
|
|
|
+@@ -169,9 +169,6 @@ class BrowserProcessImpl : public Browse
|
|
|
void set_background_mode_manager_for_test(
|
|
|
std::unique_ptr<BackgroundModeManager> manager) override;
|
|
|
StatusTray* status_tray() override;
|
|
@@ -129,7 +129,7 @@
|
|
|
subresource_filter::RulesetService* subresource_filter_ruleset_service()
|
|
|
override;
|
|
|
optimization_guide::OptimizationGuideService* optimization_guide_service()
|
|
|
-@@ -308,9 +305,6 @@ class BrowserProcessImpl : public Browse
|
|
|
+@@ -315,9 +312,6 @@ class BrowserProcessImpl : public Browse
|
|
|
std::unique_ptr<BackgroundModeManager> background_mode_manager_;
|
|
|
#endif
|
|
|
|
|
@@ -141,7 +141,7 @@
|
|
|
subresource_filter_ruleset_service_;
|
|
|
--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
|
|
|
+++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
|
|
|
-@@ -60,7 +60,6 @@
|
|
|
+@@ -62,7 +62,6 @@
|
|
|
#include "chrome/browser/previews/previews_service.h"
|
|
|
#include "chrome/browser/previews/previews_service_factory.h"
|
|
|
#include "chrome/browser/profiles/profile.h"
|
|
@@ -149,7 +149,7 @@
|
|
|
#include "chrome/browser/translate/chrome_translate_client.h"
|
|
|
#include "chrome/browser/ui/find_bar/find_bar_state.h"
|
|
|
#include "chrome/browser/ui/find_bar/find_bar_state_factory.h"
|
|
|
-@@ -651,36 +650,6 @@ void ChromeBrowsingDataRemoverDelegate::
|
|
|
+@@ -649,36 +648,6 @@ void ChromeBrowsingDataRemoverDelegate::
|
|
|
ContentSettingsType::CLIENT_HINTS, base::Time(), base::Time::Max(),
|
|
|
website_settings_filter);
|
|
|
|
|
@@ -188,7 +188,7 @@
|
|
|
|
|
|
--- a/chrome/browser/chrome_content_browser_client.cc
|
|
|
+++ b/chrome/browser/chrome_content_browser_client.cc
|
|
|
-@@ -874,30 +874,6 @@ void SetApplicationLocaleOnIOThread(cons
|
|
|
+@@ -843,30 +843,6 @@ void SetApplicationLocaleOnIOThread(cons
|
|
|
GetIOThreadApplicationLocale() = locale;
|
|
|
}
|
|
|
|
|
@@ -219,7 +219,7 @@
|
|
|
#if defined(OS_ANDROID)
|
|
|
float GetDeviceScaleAdjustment() {
|
|
|
static const float kMinFSM = 1.05f;
|
|
|
-@@ -1337,7 +1313,6 @@ void ChromeContentBrowserClient::PostAft
|
|
|
+@@ -1296,7 +1272,6 @@ void ChromeContentBrowserClient::PostAft
|
|
|
InitNetworkContextsParentDirectory();
|
|
|
|
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
@@ -227,16 +227,16 @@
|
|
|
}
|
|
|
|
|
|
bool ChromeContentBrowserClient::IsBrowserStartupComplete() {
|
|
|
-@@ -2130,7 +2105,7 @@ void ChromeContentBrowserClient::AppendE
|
|
|
+@@ -2089,7 +2064,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) ||
|
|
|
+ if (!safe_browsing::IsSafeBrowsingEnabled(*prefs) ||
|
|
|
- !g_browser_process->safe_browsing_detection_service()) {
|
|
|
+ true) {
|
|
|
command_line->AppendSwitch(
|
|
|
switches::kDisableClientSidePhishingDetection);
|
|
|
}
|
|
|
-@@ -3973,7 +3948,7 @@ ChromeContentBrowserClient::CreateThrott
|
|
|
+@@ -3956,7 +3931,7 @@ ChromeContentBrowserClient::CreateThrott
|
|
|
base::BindRepeating(&MaybeTriggerSecurityInterstitialShownEvent));
|
|
|
throttles.push_back(std::make_unique<SSLErrorNavigationThrottle>(
|
|
|
handle,
|
|
@@ -245,7 +245,7 @@
|
|
|
base::BindOnce(&HandleSSLErrorWrapper), base::BindOnce(&IsInHostedApp)));
|
|
|
|
|
|
throttles.push_back(std::make_unique<LoginNavigationThrottle>(handle));
|
|
|
-@@ -3994,12 +3969,6 @@ ChromeContentBrowserClient::CreateThrott
|
|
|
+@@ -3977,12 +3952,6 @@ ChromeContentBrowserClient::CreateThrott
|
|
|
GooglePasswordManagerNavigationThrottle::MaybeCreateThrottleFor(handle));
|
|
|
#endif
|
|
|
|
|
@@ -260,7 +260,7 @@
|
|
|
MaybeAddThrottle(&throttles,
|
|
|
--- 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
|
|
|
+@@ -39,20 +39,6 @@ const uint8_t kFileTypePoliciesPublicKey
|
|
|
const char kFileTypePoliciesManifestName[] = "File Type Policies";
|
|
|
|
|
|
void LoadFileTypesFromDisk(const base::FilePath& pb_path) {
|
|
@@ -283,7 +283,7 @@
|
|
|
} // namespace
|
|
|
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
|
|
|
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
|
|
|
-@@ -327,13 +327,6 @@ ChromeDownloadManagerDelegate::~ChromeDo
|
|
|
+@@ -328,13 +328,6 @@ ChromeDownloadManagerDelegate::~ChromeDo
|
|
|
|
|
|
void ChromeDownloadManagerDelegate::SetDownloadManager(DownloadManager* dm) {
|
|
|
download_manager_ = dm;
|
|
@@ -297,7 +297,7 @@
|
|
|
}
|
|
|
|
|
|
#if defined(OS_ANDROID)
|
|
|
-@@ -638,16 +631,6 @@ void ChromeDownloadManagerDelegate::Choo
|
|
|
+@@ -639,16 +632,6 @@ void ChromeDownloadManagerDelegate::Choo
|
|
|
|
|
|
void ChromeDownloadManagerDelegate::SanitizeSavePackageResourceName(
|
|
|
base::FilePath* filename) {
|
|
@@ -316,7 +316,7 @@
|
|
|
void ChromeDownloadManagerDelegate::SanitizeDownloadParameters(
|
|
|
--- a/chrome/browser/download/download_item_model.cc
|
|
|
+++ b/chrome/browser/download/download_item_model.cc
|
|
|
-@@ -78,7 +78,7 @@ class DownloadItemModelData : public bas
|
|
|
+@@ -79,7 +79,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.
|
|
@@ -325,7 +325,7 @@
|
|
|
|
|
|
// Whether the download is currently being revived.
|
|
|
bool is_being_revived_;
|
|
|
-@@ -115,7 +115,7 @@ DownloadItemModelData::DownloadItemModel
|
|
|
+@@ -116,7 +116,7 @@ DownloadItemModelData::DownloadItemModel
|
|
|
: should_show_in_shelf_(true),
|
|
|
was_ui_notified_(false),
|
|
|
should_prefer_opening_in_browser_(false),
|
|
@@ -334,7 +334,7 @@
|
|
|
is_being_revived_(false) {}
|
|
|
|
|
|
} // namespace
|
|
|
-@@ -397,13 +397,13 @@ void DownloadItemModel::SetShouldPreferO
|
|
|
+@@ -400,13 +400,13 @@ void DownloadItemModel::SetShouldPreferO
|
|
|
data->should_prefer_opening_in_browser_ = preference;
|
|
|
}
|
|
|
|
|
@@ -351,7 +351,7 @@
|
|
|
DownloadItemModelData* data = DownloadItemModelData::GetOrCreate(download_);
|
|
|
data->danger_level_ = danger_level;
|
|
|
}
|
|
|
-@@ -560,9 +560,6 @@ bool DownloadItemModel::IsCommandEnabled
|
|
|
+@@ -563,9 +563,6 @@ bool DownloadItemModel::IsCommandEnabled
|
|
|
// filename. Don't base an "Always open" decision based on it. Also
|
|
|
// exclude extensions.
|
|
|
return download_->CanOpenDownload() &&
|
|
@@ -392,18 +392,21 @@
|
|
|
extension.erase(0, 1);
|
|
|
--- 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 =
|
|
|
-@@ -1068,29 +1066,7 @@ DownloadFileType::DangerLevel DownloadTa
|
|
|
+@@ -292,13 +292,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 safe 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())
|
|
|
+@@ -1085,29 +1078,7 @@ DownloadFileType::DangerLevel DownloadTa
|
|
|
download_->HasUserGesture())
|
|
|
return DownloadFileType::NOT_DANGEROUS;
|
|
|
|
|
@@ -444,17 +447,17 @@
|
|
|
#include "chrome/browser/download/download_file_icon_extractor.h"
|
|
|
#include "chrome/browser/download/download_open_prompt.h"
|
|
|
#include "chrome/browser/download/download_prefs.h"
|
|
|
-@@ -1327,9 +1326,6 @@ DownloadsAcceptDangerFunction::Downloads
|
|
|
+@@ -1330,9 +1329,6 @@ DownloadsAcceptDangerFunction::Downloads
|
|
|
|
|
|
DownloadsAcceptDangerFunction::~DownloadsAcceptDangerFunction() {}
|
|
|
|
|
|
-DownloadsAcceptDangerFunction::OnPromptCreatedCallback*
|
|
|
- DownloadsAcceptDangerFunction::on_prompt_created_ = NULL;
|
|
|
-
|
|
|
- bool DownloadsAcceptDangerFunction::RunAsync() {
|
|
|
+ ExtensionFunction::ResponseAction DownloadsAcceptDangerFunction::Run() {
|
|
|
std::unique_ptr<downloads::AcceptDanger::Params> params(
|
|
|
downloads::AcceptDanger::Params::Create(*args_));
|
|
|
-@@ -1367,40 +1363,7 @@ void DownloadsAcceptDangerFunction::Prom
|
|
|
+@@ -1370,43 +1366,7 @@ void DownloadsAcceptDangerFunction::Prom
|
|
|
return;
|
|
|
}
|
|
|
RecordApiFunctions(DOWNLOADS_FUNCTION_ACCEPT_DANGER);
|
|
@@ -477,10 +480,13 @@
|
|
|
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
- DownloadItem* download_item = GetDownload(
|
|
|
- browser_context(), include_incognito_information(), download_id);
|
|
|
-- if (InvalidId(download_item, &error_) ||
|
|
|
+- std::string error;
|
|
|
+- if (InvalidId(download_item, &error) ||
|
|
|
- Fault(download_item->GetState() != DownloadItem::IN_PROGRESS,
|
|
|
-- download_extension_errors::kNotInProgress, &error_))
|
|
|
+- download_extension_errors::kNotInProgress, &error)) {
|
|
|
+- Respond(Error(error));
|
|
|
- return;
|
|
|
+- }
|
|
|
- switch (action) {
|
|
|
- case DownloadDangerPrompt::ACCEPT:
|
|
|
- download_item->ValidateDangerousDownload();
|
|
@@ -491,7 +497,7 @@
|
|
|
- case DownloadDangerPrompt::DISMISS:
|
|
|
- break;
|
|
|
- }
|
|
|
-- SendResponse(error_.empty());
|
|
|
+- Respond(NoArguments());
|
|
|
+ download_item->ValidateDangerousDownload();
|
|
|
}
|
|
|
|
|
@@ -503,12 +509,12 @@
|
|
|
#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"
|
|
|
-@@ -186,25 +185,16 @@ class DownloadsRemoveFileFunction : publ
|
|
|
+ #include "components/download/public/common/download_path_reservation_tracker.h"
|
|
|
+@@ -187,25 +186,16 @@ class DownloadsRemoveFileFunction : publ
|
|
|
|
|
|
- class DownloadsAcceptDangerFunction : public ChromeAsyncExtensionFunction {
|
|
|
+ class DownloadsAcceptDangerFunction : public ExtensionFunction {
|
|
|
public:
|
|
|
- typedef base::Callback<void(DownloadDangerPrompt*)> OnPromptCreatedCallback;
|
|
|
- static void OnPromptCreatedForTesting(
|
|
@@ -518,7 +524,7 @@
|
|
|
-
|
|
|
DECLARE_EXTENSION_FUNCTION("downloads.acceptDanger", DOWNLOADS_ACCEPTDANGER)
|
|
|
DownloadsAcceptDangerFunction();
|
|
|
- bool RunAsync() override;
|
|
|
+ ResponseAction Run() override;
|
|
|
|
|
|
protected:
|
|
|
~DownloadsAcceptDangerFunction() override;
|
|
@@ -574,7 +580,7 @@
|
|
|
referrer_entries)));
|
|
|
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
|
|
|
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
|
|
|
-@@ -732,51 +732,9 @@ WebstorePrivateGetReferrerChainFunction:
|
|
|
+@@ -998,51 +998,9 @@ WebstorePrivateGetReferrerChainFunction:
|
|
|
|
|
|
ExtensionFunction::ResponseAction
|
|
|
WebstorePrivateGetReferrerChainFunction::Run() {
|
|
@@ -704,7 +710,7 @@
|
|
|
// SimpleURLLoader -> (owned loader, extension id).
|
|
|
--- a/chrome/browser/metrics/chrome_metrics_service_client.cc
|
|
|
+++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
|
|
|
-@@ -776,9 +776,6 @@ void ChromeMetricsServiceClient::Registe
|
|
|
+@@ -737,9 +737,6 @@ void ChromeMetricsServiceClient::Registe
|
|
|
metrics_service_->RegisterMetricsProvider(
|
|
|
std::make_unique<HttpsEngagementMetricsProvider>());
|
|
|
|
|
@@ -716,7 +722,7 @@
|
|
|
std::make_unique<UpgradeMetricsProvider>());
|
|
|
--- a/chrome/browser/net/trial_comparison_cert_verifier_controller.cc
|
|
|
+++ b/chrome/browser/net/trial_comparison_cert_verifier_controller.cc
|
|
|
-@@ -127,9 +127,6 @@ void TrialComparisonCertVerifierControll
|
|
|
+@@ -131,9 +131,6 @@ void TrialComparisonCertVerifierControll
|
|
|
std::string serialized_report;
|
|
|
if (!report.Serialize(&serialized_report))
|
|
|
return;
|
|
@@ -738,7 +744,7 @@
|
|
|
ClientHintsFactory::GetInstance();
|
|
|
--- a/chrome/browser/profiles/profile_impl.cc
|
|
|
+++ b/chrome/browser/profiles/profile_impl.cc
|
|
|
-@@ -89,7 +89,6 @@
|
|
|
+@@ -91,7 +91,6 @@
|
|
|
#include "chrome/browser/profiles/profile_metrics.h"
|
|
|
#include "chrome/browser/push_messaging/push_messaging_service_factory.h"
|
|
|
#include "chrome/browser/push_messaging/push_messaging_service_impl.h"
|
|
@@ -746,7 +752,7 @@
|
|
|
#include "chrome/browser/sharing/sharing_service_factory.h"
|
|
|
#include "chrome/browser/signin/identity_manager_factory.h"
|
|
|
#include "chrome/browser/signin/signin_ui_util.h"
|
|
|
-@@ -583,17 +582,6 @@ void ProfileImpl::LoadPrefsForNormalStar
|
|
|
+@@ -585,17 +584,6 @@ void ProfileImpl::LoadPrefsForNormalStar
|
|
|
|
|
|
mojo::PendingRemote<prefs::mojom::TrackedPreferenceValidationDelegate>
|
|
|
pref_validation_delegate;
|
|
@@ -766,7 +772,7 @@
|
|
|
CreatePrefService(pref_registry_, CreateExtensionPrefStore(this, false),
|
|
|
--- a/chrome/browser/profiles/profiles_state.cc
|
|
|
+++ b/chrome/browser/profiles/profiles_state.cc
|
|
|
-@@ -222,9 +222,6 @@ void RemoveBrowsingDataForProfile(const
|
|
|
+@@ -217,9 +217,6 @@ void RemoveBrowsingDataForProfile(const
|
|
|
// The BrowsingDataRemover relies on many objects that aren't created in unit
|
|
|
// tests. Previously this code would depend on content::ResourceDispatcherHost
|
|
|
// but that's gone, so do a similar hack for now.
|
|
@@ -913,7 +919,7 @@
|
|
|
void ChromeSubresourceFilterClient::OnReloadRequested() {
|
|
|
--- a/chrome/browser/ui/BUILD.gn
|
|
|
+++ b/chrome/browser/ui/BUILD.gn
|
|
|
-@@ -2814,7 +2814,6 @@ jumbo_static_library("ui") {
|
|
|
+@@ -2903,7 +2903,6 @@ jumbo_static_library("ui") {
|
|
|
"views/device_chooser_content_view.h",
|
|
|
"views/devtools_process_observer.cc",
|
|
|
"views/devtools_process_observer.h",
|
|
@@ -923,9 +929,9 @@
|
|
|
"views/download/download_item_view.cc",
|
|
|
--- a/chrome/browser/ui/tab_helpers.cc
|
|
|
+++ b/chrome/browser/ui/tab_helpers.cc
|
|
|
-@@ -272,10 +272,6 @@ void TabHelpers::AttachTabHelpers(WebCon
|
|
|
- PreviewsUITabHelper::CreateForWebContents(web_contents);
|
|
|
- RecentlyAudibleHelper::CreateForWebContents(web_contents);
|
|
|
+@@ -290,10 +290,6 @@ void TabHelpers::AttachTabHelpers(WebCon
|
|
|
+ resource_coordinator::ResourceCoordinatorTabHelper::CreateForWebContents(
|
|
|
+ web_contents);
|
|
|
ResourceLoadingHintsWebContentsObserver::CreateForWebContents(web_contents);
|
|
|
- safe_browsing::SafeBrowsingNavigationObserver::MaybeCreateForWebContents(
|
|
|
- web_contents);
|
|
@@ -934,14 +940,14 @@
|
|
|
ReputationWebContentsObserver::CreateForWebContents(web_contents);
|
|
|
SearchEngineTabHelper::CreateForWebContents(web_contents);
|
|
|
SecurityStateTabHelper::CreateForWebContents(web_contents);
|
|
|
-@@ -333,7 +329,6 @@ void TabHelpers::AttachTabHelpers(WebCon
|
|
|
+@@ -356,7 +352,6 @@ void TabHelpers::AttachTabHelpers(WebCon
|
|
|
pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
|
|
|
web_contents, std::make_unique<ChromePDFWebContentsHelperClient>());
|
|
|
SadTabHelper::CreateForWebContents(web_contents);
|
|
|
- safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(web_contents);
|
|
|
SearchTabHelper::CreateForWebContents(web_contents);
|
|
|
- if (base::FeatureList::IsEnabled(features::kSyncEncryptionKeysWebApi)) {
|
|
|
- SyncEncryptionKeysTabHelper::CreateForWebContents(web_contents);
|
|
|
+ if (base::FeatureList::IsEnabled(
|
|
|
+ switches::kSyncSupportTrustedVaultPassphrase)) {
|
|
|
--- a/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc
|
|
|
+++ b/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc
|
|
|
@@ -23,7 +23,6 @@
|
|
@@ -952,7 +958,7 @@
|
|
|
#include "chrome/browser/download/download_history.h"
|
|
|
#include "chrome/browser/download/download_item_model.h"
|
|
|
#include "chrome/browser/download/download_prefs.h"
|
|
|
-@@ -167,9 +166,6 @@ void DownloadsDOMHandler::SaveDangerousR
|
|
|
+@@ -168,9 +167,6 @@ void DownloadsDOMHandler::SaveDangerousR
|
|
|
}
|
|
|
|
|
|
CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS);
|
|
@@ -975,7 +981,7 @@
|
|
|
DownloadItemModel item_model(download);
|
|
|
if (!item_model.ShouldShowInShelf() ||
|
|
|
download->GetState() == download::DownloadItem::IN_PROGRESS) {
|
|
|
-@@ -379,44 +369,6 @@ void DownloadsDOMHandler::FinalizeRemova
|
|
|
+@@ -396,44 +386,6 @@ void DownloadsDOMHandler::FinalizeRemova
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1027,10 +1033,10 @@
|
|
|
#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.mojom.h"
|
|
|
+ #include "chrome/browser/ui/webui/downloads/downloads.mojom-forward.h"
|
|
|
#include "chrome/browser/ui/webui/downloads/downloads_list_tracker.h"
|
|
|
#include "content/public/browser/web_contents_observer.h"
|
|
|
-@@ -88,18 +87,6 @@ class DownloadsDOMHandler : public conte
|
|
|
+@@ -89,18 +88,6 @@ class DownloadsDOMHandler : public conte
|
|
|
// null-checking |original_notifier_|.
|
|
|
content::DownloadManager* GetOriginalNotifierManager() const;
|
|
|
|
|
@@ -1051,19 +1057,17 @@
|
|
|
bool IsDeletingHistoryAllowed();
|
|
|
--- a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
|
|
|
+++ b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
|
|
|
-@@ -273,115 +273,6 @@ LookalikeUrlInterstitialPage* CreateLook
|
|
|
+@@ -272,113 +272,6 @@ std::unique_ptr<LookalikeUrlBlockingPage
|
|
|
safe_url));
|
|
|
}
|
|
|
|
|
|
--safe_browsing::SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage(
|
|
|
-- content::WebContents* web_contents) {
|
|
|
+-std::unique_ptr<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 (net::GetValueForKeyInQuery(web_contents->GetURL(), "url", &url_param)) {
|
|
|
- if (GURL(url_param).is_valid()) {
|
|
|
- request_url = GURL(url_param);
|
|
|
- }
|
|
@@ -1072,9 +1076,7 @@
|
|
|
- // 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 (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") {
|
|
@@ -1108,13 +1110,14 @@
|
|
|
- // 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, true);
|
|
|
+- return base::WrapUnique<safe_browsing::SafeBrowsingBlockingPage>(
|
|
|
+- safe_browsing::SafeBrowsingBlockingPage::CreateBlockingPage(
|
|
|
+- g_browser_process->safe_browsing_service()->ui_manager().get(),
|
|
|
+- web_contents, main_frame_url, resource, true));
|
|
|
-}
|
|
|
-
|
|
|
--TestSafeBrowsingBlockingPageQuiet* CreateSafeBrowsingQuietBlockingPage(
|
|
|
-- content::WebContents* web_contents) {
|
|
|
+-std::unique_ptr<TestSafeBrowsingBlockingPageQuiet>
|
|
|
+-CreateSafeBrowsingQuietBlockingPage(content::WebContents* web_contents) {
|
|
|
- safe_browsing::SBThreatType threat_type =
|
|
|
- safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
|
|
|
- GURL request_url("http://example.com");
|
|
@@ -1159,40 +1162,47 @@
|
|
|
- // 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);
|
|
|
+- return base::WrapUnique<TestSafeBrowsingBlockingPageQuiet>(
|
|
|
+- 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(
|
|
|
+ std::unique_ptr<CaptivePortalBlockingPage> CreateCaptivePortalBlockingPage(
|
|
|
content::WebContents* web_contents) {
|
|
|
-@@ -497,8 +388,6 @@ void InterstitialHTMLSource::StartDataRe
|
|
|
- CreateBlockedInterceptionBlockingPage(web_contents));
|
|
|
+@@ -493,8 +386,6 @@ void InterstitialHTMLSource::StartDataRe
|
|
|
+ interstitial_delegate = CreateBlockedInterceptionBlockingPage(web_contents);
|
|
|
} else if (path_without_query == "/legacy-tls") {
|
|
|
- interstitial_delegate.reset(CreateLegacyTLSBlockingPage(web_contents));
|
|
|
+ interstitial_delegate = CreateLegacyTLSBlockingPage(web_contents);
|
|
|
- } else if (path_without_query == "/safebrowsing") {
|
|
|
-- interstitial_delegate.reset(CreateSafeBrowsingBlockingPage(web_contents));
|
|
|
+- interstitial_delegate = CreateSafeBrowsingBlockingPage(web_contents);
|
|
|
} else if (path_without_query == "/clock") {
|
|
|
- interstitial_delegate.reset(CreateBadClockBlockingPage(web_contents));
|
|
|
+ interstitial_delegate = CreateBadClockBlockingPage(web_contents);
|
|
|
} else if (path_without_query == "/lookalike") {
|
|
|
-@@ -510,13 +399,6 @@ void InterstitialHTMLSource::StartDataRe
|
|
|
- } else if (path_without_query == "/origin_policy") {
|
|
|
- interstitial_delegate.reset(
|
|
|
- CreateOriginPolicyInterstitialPage(web_contents));
|
|
|
-- }
|
|
|
--
|
|
|
+@@ -507,16 +398,12 @@ void InterstitialHTMLSource::StartDataRe
|
|
|
+ interstitial_delegate = CreateOriginPolicyInterstitialPage(web_contents);
|
|
|
+ }
|
|
|
+
|
|
|
- if (path_without_query == "/quietsafebrowsing") {
|
|
|
-- TestSafeBrowsingBlockingPageQuiet* blocking_page =
|
|
|
+- std::unique_ptr<TestSafeBrowsingBlockingPageQuiet> blocking_page =
|
|
|
- CreateSafeBrowsingQuietBlockingPage(web_contents);
|
|
|
-- interstitial_delegate.reset(blocking_page);
|
|
|
- html = blocking_page->GetHTML();
|
|
|
+- interstitial_delegate = std::move(blocking_page);
|
|
|
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
|
|
|
- } else if (path_without_query == "/supervised_user") {
|
|
|
+- } else if (path_without_query == "/supervised_user") {
|
|
|
++ if (path_without_query == "/supervised_user") {
|
|
|
html = GetSupervisedUserInterstitialHTML(path);
|
|
|
++ } else
|
|
|
+ #endif
|
|
|
+- } else if (interstitial_delegate.get()) {
|
|
|
++ if (interstitial_delegate.get()) {
|
|
|
+ html = interstitial_delegate.get()->GetHTMLContents();
|
|
|
+ } else {
|
|
|
+ html = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
|
|
|
--- a/chrome/renderer/chrome_content_renderer_client.cc
|
|
|
+++ b/chrome/renderer/chrome_content_renderer_client.cc
|
|
|
-@@ -86,7 +86,6 @@
|
|
|
+@@ -87,7 +87,6 @@
|
|
|
#include "components/paint_preview/buildflags/buildflags.h"
|
|
|
#include "components/pdf/renderer/pepper_pdf_host.h"
|
|
|
#include "components/safe_browsing/buildflags.h"
|