summaryrefslogtreecommitdiff
path: root/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-safebrowsing.patch
diff options
context:
space:
mode:
Diffstat (limited to 'www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-safebrowsing.patch')
-rw-r--r--www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-safebrowsing.patch1200
1 files changed, 553 insertions, 647 deletions
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-safebrowsing.patch b/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-safebrowsing.patch
index b1200f9..d71a532 100644
--- a/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-safebrowsing.patch
+++ b/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-safebrowsing.patch
@@ -1,17 +1,8 @@
1# Additional changes to Inox's fix-building-without-safebrowsing.patch 1# Additional changes to Inox's fix-building-without-safebrowsing.patch
2 2
3--- a/chrome/browser/BUILD.gn 3--- chrome/browser/BUILD.gn.orig
4+++ b/chrome/browser/BUILD.gn 4+++ chrome/browser/BUILD.gn
5@@ -615,8 +615,6 @@ static_library("browser") { 5@@ -1953,7 +1953,6 @@ static_library("browser") {
6 "internal_auth.h",
7 "interstitials/chrome_settings_page_helper.cc",
8 "interstitials/chrome_settings_page_helper.h",
9- "interstitials/enterprise_util.cc",
10- "interstitials/enterprise_util.h",
11 "invalidation/profile_invalidation_provider_factory.cc",
12 "invalidation/profile_invalidation_provider_factory.h",
13 "language/language_model_manager_factory.cc",
14@@ -1960,7 +1958,6 @@ static_library("browser") {
15 "//chrome/browser/net:probe_message_proto", 6 "//chrome/browser/net:probe_message_proto",
16 "//chrome/browser/new_tab_page/modules/drive:mojo_bindings", 7 "//chrome/browser/new_tab_page/modules/drive:mojo_bindings",
17 "//chrome/browser/new_tab_page/modules/photos:mojo_bindings", 8 "//chrome/browser/new_tab_page/modules/photos:mojo_bindings",
@@ -19,18 +10,17 @@
19 "//chrome/browser/new_tab_page/modules/task_module:mojo_bindings", 10 "//chrome/browser/new_tab_page/modules/task_module:mojo_bindings",
20 "//chrome/browser/notifications", 11 "//chrome/browser/notifications",
21 "//chrome/browser/notifications/scheduler:factory", 12 "//chrome/browser/notifications/scheduler:factory",
22@@ -3774,10 +3771,6 @@ static_library("browser") { 13@@ -3726,9 +3725,6 @@ static_library("browser") {
23 "download/offline_item_model_manager_factory.h", 14 "download/offline_item_model_manager_factory.h",
24 "enterprise/connectors/analysis/analysis_service_settings.cc", 15 "enterprise/connectors/analysis/analysis_service_settings.cc",
25 "enterprise/connectors/analysis/analysis_service_settings.h", 16 "enterprise/connectors/analysis/analysis_service_settings.h",
26- "enterprise/connectors/analysis/content_analysis_delegate.cc", 17- "enterprise/connectors/analysis/content_analysis_delegate.cc",
27- "enterprise/connectors/analysis/content_analysis_delegate.h", 18- "enterprise/connectors/analysis/content_analysis_delegate.h",
28- "enterprise/connectors/analysis/content_analysis_delegate_base.cc",
29- "enterprise/connectors/analysis/content_analysis_delegate_base.h", 19- "enterprise/connectors/analysis/content_analysis_delegate_base.h",
30 "enterprise/connectors/analysis/content_analysis_dialog.cc", 20 "enterprise/connectors/analysis/content_analysis_dialog.cc",
31 "enterprise/connectors/analysis/content_analysis_dialog.h", 21 "enterprise/connectors/analysis/content_analysis_dialog.h",
32 "enterprise/connectors/analysis/content_analysis_downloads_delegate.cc", 22 "enterprise/connectors/analysis/content_analysis_downloads_delegate.cc",
33@@ -4024,10 +4017,6 @@ static_library("browser") { 23@@ -3978,10 +3974,6 @@ static_library("browser") {
34 "new_tab_page/modules/photos/photos_service.h", 24 "new_tab_page/modules/photos/photos_service.h",
35 "new_tab_page/modules/photos/photos_service_factory.cc", 25 "new_tab_page/modules/photos/photos_service_factory.cc",
36 "new_tab_page/modules/photos/photos_service_factory.h", 26 "new_tab_page/modules/photos/photos_service_factory.h",
@@ -41,7 +31,7 @@
41 "new_tab_page/modules/task_module/task_module_handler.cc", 31 "new_tab_page/modules/task_module/task_module_handler.cc",
42 "new_tab_page/modules/task_module/task_module_handler.h", 32 "new_tab_page/modules/task_module/task_module_handler.h",
43 "new_tab_page/modules/task_module/task_module_service.cc", 33 "new_tab_page/modules/task_module/task_module_service.cc",
44@@ -7380,9 +7369,14 @@ static_library("browser") { 34@@ -7012,9 +7004,14 @@ static_library("browser") {
45 "//components/safe_browsing/content/browser:safe_browsing_blocking_page", 35 "//components/safe_browsing/content/browser:safe_browsing_blocking_page",
46 "//components/safe_browsing/content/browser/download:download_stats", 36 "//components/safe_browsing/content/browser/download:download_stats",
47 "//components/safe_browsing/content/common:file_type_policies", 37 "//components/safe_browsing/content/common:file_type_policies",
@@ -57,8 +47,8 @@
57 47
58 if (!is_fuchsia) { 48 if (!is_fuchsia) {
59 sources += [ 49 sources += [
60--- a/chrome/browser/accuracy_tips/accuracy_service_factory.cc 50--- chrome/browser/accuracy_tips/accuracy_service_factory.cc.orig
61+++ b/chrome/browser/accuracy_tips/accuracy_service_factory.cc 51+++ chrome/browser/accuracy_tips/accuracy_service_factory.cc
62@@ -48,10 +48,7 @@ KeyedService* AccuracyServiceFactory::Bu 52@@ -48,10 +48,7 @@ KeyedService* AccuracyServiceFactory::Bu
63 content::BrowserContext* browser_context) const { 53 content::BrowserContext* browser_context) const {
64 DCHECK(base::FeatureList::IsEnabled(safe_browsing::kAccuracyTipsFeature)); 54 DCHECK(base::FeatureList::IsEnabled(safe_browsing::kAccuracyTipsFeature));
@@ -71,9 +61,9 @@
71 auto* history_service = HistoryServiceFactory::GetForProfile( 61 auto* history_service = HistoryServiceFactory::GetForProfile(
72 profile, ServiceAccessType::IMPLICIT_ACCESS); 62 profile, ServiceAccessType::IMPLICIT_ACCESS);
73 auto delegate = std::make_unique<AccuracyServiceDelegate>(profile); 63 auto delegate = std::make_unique<AccuracyServiceDelegate>(profile);
74--- a/chrome/browser/chrome_content_browser_client.cc 64--- chrome/browser/chrome_content_browser_client.cc.orig
75+++ b/chrome/browser/chrome_content_browser_client.cc 65+++ chrome/browser/chrome_content_browser_client.cc
76@@ -4298,11 +4298,13 @@ ChromeContentBrowserClient::CreateThrott 66@@ -4229,11 +4229,13 @@ ChromeContentBrowserClient::CreateThrott
77 &throttles); 67 &throttles);
78 #endif 68 #endif
79 69
@@ -87,7 +77,7 @@
87 77
88 // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch 78 // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
89 // of lacros-chrome is complete. 79 // of lacros-chrome is complete.
90@@ -5699,26 +5701,7 @@ ChromeContentBrowserClient::GetSafeBrows 80@@ -5632,26 +5634,7 @@ ChromeContentBrowserClient::GetSafeBrows
91 const std::vector<std::string>& allowlist_domains) { 81 const std::vector<std::string>& allowlist_domains) {
92 DCHECK_CURRENTLY_ON(BrowserThread::IO); 82 DCHECK_CURRENTLY_ON(BrowserThread::IO);
93 83
@@ -115,7 +105,7 @@
115 } 105 }
116 106
117 safe_browsing::RealTimeUrlLookupServiceBase* 107 safe_browsing::RealTimeUrlLookupServiceBase*
118@@ -5739,11 +5722,6 @@ ChromeContentBrowserClient::GetUrlLookup 108@@ -5672,11 +5655,6 @@ ChromeContentBrowserClient::GetUrlLookup
119 GetForProfile(profile); 109 GetForProfile(profile);
120 } 110 }
121 #endif 111 #endif
@@ -127,9 +117,9 @@
127 return nullptr; 117 return nullptr;
128 } 118 }
129 119
130--- a/chrome/browser/chrome_content_browser_client_receiver_bindings.cc 120--- chrome/browser/chrome_content_browser_client_receiver_bindings.cc.orig
131+++ b/chrome/browser/chrome_content_browser_client_receiver_bindings.cc 121+++ chrome/browser/chrome_content_browser_client_receiver_bindings.cc
132@@ -143,34 +143,6 @@ void MaybeCreateSafeBrowsingForRenderer( 122@@ -139,45 +139,6 @@ void MaybeCreateSafeBrowsingForRenderer(
133 const std::vector<std::string>& allowlist_domains)> 123 const std::vector<std::string>& allowlist_domains)>
134 get_checker_delegate, 124 get_checker_delegate,
135 mojo::PendingReceiver<safe_browsing::mojom::SafeBrowsing> receiver) { 125 mojo::PendingReceiver<safe_browsing::mojom::SafeBrowsing> receiver) {
@@ -147,6 +137,17 @@
147- std::vector<std::string> allowlist_domains = 137- std::vector<std::string> allowlist_domains =
148- safe_browsing::GetURLAllowlistByPolicy(pref_service); 138- safe_browsing::GetURLAllowlistByPolicy(pref_service);
149- 139-
140- // Log the size of the domains to make sure copying them is
141- // not too expensive.
142- if (allowlist_domains.size() > 0) {
143- int total_size = 0;
144- for (const auto& domains : allowlist_domains) {
145- total_size += domains.size();
146- }
147- base::UmaHistogramCounts10000(
148- "SafeBrowsing.Policy.AllowlistDomainsTotalSize", total_size);
149- }
150-
150- bool safe_browsing_enabled = 151- bool safe_browsing_enabled =
151- safe_browsing::IsSafeBrowsingEnabled(*pref_service); 152- safe_browsing::IsSafeBrowsingEnabled(*pref_service);
152- content::GetIOThreadTaskRunner({})->PostTask( 153- content::GetIOThreadTaskRunner({})->PostTask(
@@ -164,9 +165,9 @@
164 } 165 }
165 166
166 // BadgeManager is not used for Android. 167 // BadgeManager is not used for Android.
167--- a/chrome/browser/component_updater/chrome_client_side_phishing_component_installer.cc 168--- chrome/browser/component_updater/client_side_phishing_component_installer.cc.orig
168+++ b/chrome/browser/component_updater/chrome_client_side_phishing_component_installer.cc 169+++ chrome/browser/component_updater/client_side_phishing_component_installer.cc
169@@ -29,20 +29,6 @@ namespace { 170@@ -36,20 +36,6 @@ const char kClientSidePhishingManifestNa
170 171
171 void LoadFromDisk(const base::FilePath& pb_path, 172 void LoadFromDisk(const base::FilePath& pb_path,
172 const base::FilePath& visual_tflite_model_path) { 173 const base::FilePath& visual_tflite_model_path) {
@@ -186,9 +187,9 @@
186- ->PopulateFromDynamicUpdate(binary_pb, std::move(visual_tflite_model)); 187- ->PopulateFromDynamicUpdate(binary_pb, std::move(visual_tflite_model));
187 } 188 }
188 189
189 void PopulateModelFromFiles(const base::FilePath& install_dir) { 190 base::FilePath GetInstalledProtoPath(const base::FilePath& base) {
190@@ -56,9 +42,6 @@ void PopulateModelFromFiles(const base:: 191@@ -123,9 +109,6 @@ update_client::InstallerAttributes
191 update_client::InstallerAttributes GetInstallerAttributes() { 192 ClientSidePhishingComponentInstallerPolicy::GetInstallerAttributes() const {
192 update_client::InstallerAttributes attributes; 193 update_client::InstallerAttributes attributes;
193 194
194- // Pass the tag parameter to the installer as the "tag" attribute; it will 195- // Pass the tag parameter to the installer as the "tag" attribute; it will
@@ -197,19 +198,9 @@
197 return attributes; 198 return attributes;
198 } 199 }
199 200
200--- a/chrome/browser/devtools/devtools_window.cc 201--- chrome/browser/download/chrome_download_manager_delegate.cc.orig
201+++ b/chrome/browser/devtools/devtools_window.cc 202+++ chrome/browser/download/chrome_download_manager_delegate.cc
202@@ -70,6 +70,7 @@ 203@@ -135,7 +135,6 @@ using content::DownloadManager;
203 #include "content/public/common/content_client.h"
204 #include "content/public/common/url_constants.h"
205 #include "net/base/escape.h"
206+#include "net/cert/x509_certificate.h"
207 #include "third_party/blink/public/common/input/web_gesture_event.h"
208 #include "third_party/blink/public/common/input/web_input_event.h"
209 #include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"
210--- a/chrome/browser/download/chrome_download_manager_delegate.cc
211+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
212@@ -130,7 +130,6 @@ using content::DownloadManager;
213 using download::DownloadItem; 204 using download::DownloadItem;
214 using download::DownloadPathReservationTracker; 205 using download::DownloadPathReservationTracker;
215 using download::PathValidationResult; 206 using download::PathValidationResult;
@@ -217,7 +208,7 @@
217 using safe_browsing::DownloadProtectionService; 208 using safe_browsing::DownloadProtectionService;
218 using ConnectionType = net::NetworkChangeNotifier::ConnectionType; 209 using ConnectionType = net::NetworkChangeNotifier::ConnectionType;
219 210
220@@ -1519,8 +1518,6 @@ void ChromeDownloadManagerDelegate::OnDo 211@@ -1517,8 +1516,6 @@ void ChromeDownloadManagerDelegate::OnDo
221 if (item->GetOriginalMimeType() == "application/x-x509-user-cert") 212 if (item->GetOriginalMimeType() == "application/x-x509-user-cert")
222 DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true); 213 DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true);
223 #endif 214 #endif
@@ -226,7 +217,7 @@
226 } 217 }
227 if (ShouldBlockFile(target_info->danger_type, item)) { 218 if (ShouldBlockFile(target_info->danger_type, item)) {
228 MaybeReportDangerousDownloadBlocked( 219 MaybeReportDangerousDownloadBlocked(
229@@ -1655,7 +1652,6 @@ void ChromeDownloadManagerDelegate::Mayb 220@@ -1670,7 +1667,6 @@ void ChromeDownloadManagerDelegate::Mayb
230 service->MaybeSendDangerousDownloadOpenedReport(download, 221 service->MaybeSendDangerousDownloadOpenedReport(download,
231 show_download_in_folder); 222 show_download_in_folder);
232 } 223 }
@@ -234,7 +225,7 @@
234 if (!download->GetAutoOpened()) { 225 if (!download->GetAutoOpened()) {
235 download::DownloadContent download_content = 226 download::DownloadContent download_content =
236 download::DownloadContentFromMimeType(download->GetMimeType(), false); 227 download::DownloadContentFromMimeType(download->GetMimeType(), false);
237@@ -1663,6 +1659,7 @@ void ChromeDownloadManagerDelegate::Mayb 228@@ -1678,6 +1674,7 @@ void ChromeDownloadManagerDelegate::Mayb
238 download->GetDangerType(), download_content, base::Time::Now(), 229 download->GetDangerType(), download_content, base::Time::Now(),
239 download->GetEndTime(), show_download_in_folder); 230 download->GetEndTime(), show_download_in_folder);
240 } 231 }
@@ -242,27 +233,48 @@
242 } 233 }
243 234
244 void ChromeDownloadManagerDelegate::CheckDownloadAllowed( 235 void ChromeDownloadManagerDelegate::CheckDownloadAllowed(
245@@ -1732,8 +1729,7 @@ void ChromeDownloadManagerDelegate::Chec 236@@ -1754,30 +1751,6 @@ void ChromeDownloadManagerDelegate::Chec
246 DCHECK(download_item); 237 std::move(callback).Run(true);
247 DCHECK(download_item->IsSavePackageDownload()); 238 return;
248 239 }
249-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ 240-
250- BUILDFLAG(IS_MAC) 241- absl::optional<enterprise_connectors::AnalysisSettings> settings =
251+#if 0 242- safe_browsing::DeepScanningRequest::ShouldUploadBinary(download_item);
252 absl::optional<enterprise_connectors::AnalysisSettings> settings = 243-
253 safe_browsing::DeepScanningRequest::ShouldUploadBinary(download_item); 244- if (settings.has_value()) {
254 245- DownloadProtectionService* service = GetDownloadProtectionService();
255--- a/chrome/browser/download/download_stats.cc 246- // Save package never need malware scans, so exempt them from scanning if
256+++ b/chrome/browser/download/download_stats.cc 247- // there are no other tags.
257@@ -9,6 +9,7 @@ 248- settings->tags.erase("malware");
249- if (!settings->tags.empty() && service) {
250- download_item->SetUserData(
251- enterprise_connectors::SavePackageScanningData::kKey,
252- std::make_unique<enterprise_connectors::SavePackageScanningData>(
253- std::move(callback)));
254-
255- service->UploadSavePackageForDeepScanning(
256- download_item, std::move(save_package_files),
257- base::BindRepeating(
258- &ChromeDownloadManagerDelegate::CheckSavePackageScanningDone,
259- weak_ptr_factory_.GetWeakPtr(), download_item->GetId()),
260- std::move(settings.value()));
261- return;
262- }
263- }
264 #endif
265 std::move(callback).Run(true);
266 }
267--- chrome/browser/download/download_stats.cc.orig
268+++ chrome/browser/download/download_stats.cc
269@@ -8,6 +8,7 @@
270 #include "base/metrics/user_metrics.h"
258 #include "base/notreached.h" 271 #include "base/notreached.h"
259 #include "build/build_config.h"
260 #include "components/profile_metrics/browser_profile_type.h" 272 #include "components/profile_metrics/browser_profile_type.h"
261+#include "components/safe_browsing/buildflags.h" 273+#include "components/safe_browsing/buildflags.h"
262 #include "components/safe_browsing/content/browser/download/download_stats.h" 274 #include "components/safe_browsing/content/browser/download/download_stats.h"
263 275
264 void RecordDownloadCount(ChromeDownloadCountTypes type) { 276 void RecordDownloadCount(ChromeDownloadCountTypes type) {
265@@ -28,8 +29,10 @@ void RecordDangerousDownloadWarningShown 277@@ -27,8 +28,10 @@ void RecordDangerousDownloadWarningShown
266 bool has_user_gesture) { 278 bool has_user_gesture) {
267 base::UmaHistogramEnumeration("Download.ShowedDownloadWarning", danger_type, 279 base::UmaHistogramEnumeration("Download.ShowedDownloadWarning", danger_type,
268 download::DOWNLOAD_DANGER_TYPE_MAX); 280 download::DOWNLOAD_DANGER_TYPE_MAX);
@@ -273,24 +285,23 @@
273 } 285 }
274 286
275 void RecordOpenedDangerousConfirmDialog( 287 void RecordOpenedDangerousConfirmDialog(
276--- a/chrome/browser/download/download_target_determiner.cc 288--- chrome/browser/download/download_target_determiner.cc.orig
277+++ b/chrome/browser/download/download_target_determiner.cc 289+++ chrome/browser/download/download_target_determiner.cc
278@@ -877,12 +877,14 @@ void DownloadTargetDeterminer::CheckVisi 290@@ -872,11 +872,13 @@ void DownloadTargetDeterminer::CheckVisi
279 bool visited_referrer_before) { 291 bool visited_referrer_before) {
280 DCHECK_CURRENTLY_ON(BrowserThread::UI); 292 DCHECK_CURRENTLY_ON(BrowserThread::UI);
281 DCHECK_EQ(STATE_DETERMINE_INTERMEDIATE_PATH, next_state_); 293 DCHECK_EQ(STATE_DETERMINE_INTERMEDIATE_PATH, next_state_);
282+#if BUILDFLAG(FULL_SAFE_BROWSING) 294+#if BUILDFLAG(FULL_SAFE_BROWSING)
283 safe_browsing::RecordDownloadFileTypeAttributes( 295 safe_browsing::RecordDownloadFileTypeAttributes(
284 safe_browsing::FileTypePolicies::GetInstance()->GetFileDangerLevel( 296 safe_browsing::FileTypePolicies::GetInstance()->GetFileDangerLevel(
285 virtual_path_.BaseName(), download_->GetURL(), 297 virtual_path_.BaseName()),
286 GetProfile()->GetPrefs()),
287 download_->HasUserGesture(), visited_referrer_before, 298 download_->HasUserGesture(), visited_referrer_before,
288 GetLastDownloadBypassTimestamp()); 299 GetLastDownloadBypassTimestamp());
289+#endif // BUILDFLAG(FULL_SAFE_BROWSING) 300+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
290 danger_level_ = GetDangerLevel( 301 danger_level_ = GetDangerLevel(
291 visited_referrer_before ? VISITED_REFERRER : NO_VISITS_TO_REFERRER); 302 visited_referrer_before ? VISITED_REFERRER : NO_VISITS_TO_REFERRER);
292 if (danger_level_ != DownloadFileType::NOT_DANGEROUS && 303 if (danger_level_ != DownloadFileType::NOT_DANGEROUS &&
293@@ -1122,6 +1124,7 @@ DownloadFileType::DangerLevel DownloadTa 304@@ -1111,6 +1113,7 @@ DownloadFileType::DangerLevel DownloadTa
294 305
295 absl::optional<base::Time> 306 absl::optional<base::Time>
296 DownloadTargetDeterminer::GetLastDownloadBypassTimestamp() const { 307 DownloadTargetDeterminer::GetLastDownloadBypassTimestamp() const {
@@ -298,7 +309,7 @@
298 safe_browsing::SafeBrowsingMetricsCollector* metrics_collector = 309 safe_browsing::SafeBrowsingMetricsCollector* metrics_collector =
299 safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( 310 safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
300 GetProfile()); 311 GetProfile());
301@@ -1130,6 +1133,9 @@ DownloadTargetDeterminer::GetLastDownloa 312@@ -1119,6 +1122,9 @@ DownloadTargetDeterminer::GetLastDownloa
302 safe_browsing::SafeBrowsingMetricsCollector:: 313 safe_browsing::SafeBrowsingMetricsCollector::
303 EventType::DANGEROUS_DOWNLOAD_BYPASS) 314 EventType::DANGEROUS_DOWNLOAD_BYPASS)
304 : absl::nullopt; 315 : absl::nullopt;
@@ -308,19 +319,19 @@
308 } 319 }
309 320
310 void DownloadTargetDeterminer::OnDownloadDestroyed( 321 void DownloadTargetDeterminer::OnDownloadDestroyed(
311--- a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc 322--- chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc.orig
312+++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc 323+++ chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
313@@ -33,7 +33,6 @@ 324@@ -32,7 +32,6 @@
314 #include "chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service_factory.h" 325 #include "chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service_factory.h"
315 #include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h" 326 #include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h"
316 #include "chrome/browser/safe_browsing/cloud_content_scanning/file_analysis_request.h" 327 #include "chrome/browser/safe_browsing/cloud_content_scanning/file_analysis_request.h"
317-#include "chrome/browser/safe_browsing/download_protection/check_client_download_request.h" 328-#include "chrome/browser/safe_browsing/download_protection/check_client_download_request.h"
318 #include "chrome/grit/generated_resources.h" 329 #include "chrome/grit/generated_resources.h"
319 #include "components/enterprise/common/proto/connectors.pb.h" 330 #include "components/enterprise/common/proto/connectors.pb.h"
320 #include "components/policy/core/common/chrome_schema.h" 331 #include "components/policy/core/browser/url_util.h"
321--- a/chrome/browser/enterprise/connectors/connectors_service.cc 332--- chrome/browser/enterprise/connectors/connectors_service.cc.orig
322+++ b/chrome/browser/enterprise/connectors/connectors_service.cc 333+++ chrome/browser/enterprise/connectors/connectors_service.cc
323@@ -461,19 +461,6 @@ absl::optional<std::string> ConnectorsSe 334@@ -475,19 +475,6 @@ absl::optional<std::string> ConnectorsSe
324 return absl::nullopt; 335 return absl::nullopt;
325 } 336 }
326 337
@@ -340,9 +351,9 @@
340 ConnectorsManager* ConnectorsService::ConnectorsManagerForTesting() { 351 ConnectorsManager* ConnectorsService::ConnectorsManagerForTesting() {
341 return connectors_manager_.get(); 352 return connectors_manager_.get();
342 } 353 }
343--- a/chrome/browser/enterprise/connectors/connectors_service.h 354--- chrome/browser/enterprise/connectors/connectors_service.h.orig
344+++ b/chrome/browser/enterprise/connectors/connectors_service.h 355+++ chrome/browser/enterprise/connectors/connectors_service.h
345@@ -80,12 +80,6 @@ class ConnectorsService : public KeyedSe 356@@ -78,12 +78,6 @@ class ConnectorsService : public KeyedSe
346 // is no token to use. 357 // is no token to use.
347 absl::optional<std::string> GetDMTokenForRealTimeUrlCheck() const; 358 absl::optional<std::string> GetDMTokenForRealTimeUrlCheck() const;
348 359
@@ -355,18 +366,18 @@
355 // Returns the CBCM domain or profile domain that enables connector policies. 366 // Returns the CBCM domain or profile domain that enables connector policies.
356 // If both set Connector policies, the CBCM domain is returned as it has 367 // If both set Connector policies, the CBCM domain is returned as it has
357 // precedence. 368 // precedence.
358--- a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.cc 369--- chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.cc.orig
359+++ b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.cc 370+++ chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.cc
360@@ -41,9 +41,6 @@ void CommonSignalsDecorator::Decorate(Si 371@@ -38,9 +38,6 @@ void CommonSignalsDecorator::Decorate(Si
361 // Get signals from policy values. 372 // Get signals from policy values.
362 signals.set_built_in_dns_client_enabled( 373 signals.set_built_in_dns_client_enabled(
363 enterprise_signals::utils::GetBuiltInDnsClientEnabled(local_state_)); 374 enterprise_signals::utils::GetBuiltInDnsClientEnabled(local_state_));
364- signals.set_safe_browsing_protection_level(static_cast<int32_t>( 375- signals.set_safe_browsing_protection_level(static_cast<int32_t>(
365- enterprise_signals::utils::GetSafeBrowsingProtectionLevel( 376- enterprise_signals::utils::GetSafeBrowsingProtectionLevel(
366- profile_prefs_))); 377- profile_prefs_)));
367 378 signals.set_remote_desktop_available(
368 absl::optional<bool> third_party_blocking_enabled = 379 enterprise_signals::utils::GetChromeRemoteDesktopAppBlocked(
369 enterprise_signals::utils::GetThirdPartyBlockingEnabled(local_state_); 380 policy_blocklist_service_));
370@@ -58,15 +55,6 @@ void CommonSignalsDecorator::Decorate(Si 381@@ -58,15 +55,6 @@ void CommonSignalsDecorator::Decorate(Si
371 signals.set_chrome_cleanup_enabled(chrome_cleanup_enabled.value()); 382 signals.set_chrome_cleanup_enabled(chrome_cleanup_enabled.value());
372 } 383 }
@@ -380,32 +391,12 @@
380- static_cast<int32_t>(password_protection_warning_trigger.value())); 391- static_cast<int32_t>(password_protection_warning_trigger.value()));
381- } 392- }
382- 393-
383 if (cached_device_model_ && cached_device_manufacturer_) { 394 std::move(done_closure).Run();
384 UpdateFromCache(signals); 395 }
385 LogSignalsCollectionLatency(kLatencyHistogramWithCacheVariant, start_time);
386--- a/chrome/browser/enterprise/connectors/reporting/reporting_service_settings.cc
387+++ b/chrome/browser/enterprise/connectors/reporting/reporting_service_settings.cc
388@@ -63,17 +63,6 @@ ReportingServiceSettings::ReportingServi
389 else
390 DVLOG(1) << "Enabled event name list contains a non string value!";
391 }
392- } else {
393- // When the list of enabled event names is not set, we assume all events are
394- // enabled. This is to support the feature of selecting the "All always on"
395- // option in the policy UI, which means to always enable all events, even
396- // when new events may be added in the future. And this is also to support
397- // existing customer policies that were created before we introduced the
398- // concept of enabling/disabling events.
399- for (auto* event_name :
400- extensions::SafeBrowsingPrivateEventRouter::kAllEvents) {
401- enabled_event_names_.insert(event_name);
402- }
403 }
404 396
405 const base::Value* enabled_opt_in_events_value = 397--- chrome/browser/enterprise/signals/context_info_fetcher.cc.orig
406--- a/chrome/browser/enterprise/signals/context_info_fetcher.cc 398+++ chrome/browser/enterprise/signals/context_info_fetcher.cc
407+++ b/chrome/browser/enterprise/signals/context_info_fetcher.cc 399@@ -169,7 +169,6 @@ void ContextInfoFetcher::Fetch(ContextIn
408@@ -204,7 +204,6 @@ void ContextInfoFetcher::Fetch(ContextIn
409 GetAnalysisConnectorProviders(enterprise_connectors::FILE_DOWNLOADED); 400 GetAnalysisConnectorProviders(enterprise_connectors::FILE_DOWNLOADED);
410 info.on_bulk_data_entry_providers = 401 info.on_bulk_data_entry_providers =
411 GetAnalysisConnectorProviders(enterprise_connectors::BULK_DATA_ENTRY); 402 GetAnalysisConnectorProviders(enterprise_connectors::BULK_DATA_ENTRY);
@@ -413,7 +404,7 @@
413 info.on_security_event_providers = GetOnSecurityEventProviders(); 404 info.on_security_event_providers = GetOnSecurityEventProviders();
414 info.browser_version = version_info::GetVersionNumber(); 405 info.browser_version = version_info::GetVersionNumber();
415 info.site_isolation_enabled = 406 info.site_isolation_enabled =
416@@ -262,11 +261,6 @@ std::vector<std::string> ContextInfoFetc 407@@ -227,11 +226,6 @@ std::vector<std::string> ContextInfoFetc
417 return connectors_service_->GetAnalysisServiceProviderNames(connector); 408 return connectors_service_->GetAnalysisServiceProviderNames(connector);
418 } 409 }
419 410
@@ -425,8 +416,8 @@
425 std::vector<std::string> ContextInfoFetcher::GetOnSecurityEventProviders() { 416 std::vector<std::string> ContextInfoFetcher::GetOnSecurityEventProviders() {
426 return connectors_service_->GetReportingServiceProviderNames( 417 return connectors_service_->GetReportingServiceProviderNames(
427 enterprise_connectors::ReportingConnector::SECURITY_EVENT); 418 enterprise_connectors::ReportingConnector::SECURITY_EVENT);
428--- a/chrome/browser/enterprise/signals/context_info_fetcher.h 419--- chrome/browser/enterprise/signals/context_info_fetcher.h.orig
429+++ b/chrome/browser/enterprise/signals/context_info_fetcher.h 420+++ chrome/browser/enterprise/signals/context_info_fetcher.h
430@@ -6,6 +6,7 @@ 421@@ -6,6 +6,7 @@
431 #define CHROME_BROWSER_ENTERPRISE_SIGNALS_CONTEXT_INFO_FETCHER_H_ 422 #define CHROME_BROWSER_ENTERPRISE_SIGNALS_CONTEXT_INFO_FETCHER_H_
432 423
@@ -435,7 +426,7 @@
435 #include <vector> 426 #include <vector>
436 427
437 #include "base/callback_forward.h" 428 #include "base/callback_forward.h"
438@@ -38,7 +39,6 @@ struct ContextInfo { 429@@ -37,7 +38,6 @@ struct ContextInfo {
439 std::vector<std::string> on_file_downloaded_providers; 430 std::vector<std::string> on_file_downloaded_providers;
440 std::vector<std::string> on_bulk_data_entry_providers; 431 std::vector<std::string> on_bulk_data_entry_providers;
441 std::vector<std::string> on_security_event_providers; 432 std::vector<std::string> on_security_event_providers;
@@ -443,7 +434,7 @@
443 std::string browser_version; 434 std::string browser_version;
444 safe_browsing::SafeBrowsingState safe_browsing_protection_level; 435 safe_browsing::SafeBrowsingState safe_browsing_protection_level;
445 bool site_isolation_enabled; 436 bool site_isolation_enabled;
446@@ -89,7 +89,6 @@ class ContextInfoFetcher { 437@@ -88,7 +88,6 @@ class ContextInfoFetcher {
447 std::vector<std::string> GetAnalysisConnectorProviders( 438 std::vector<std::string> GetAnalysisConnectorProviders(
448 enterprise_connectors::AnalysisConnector connector); 439 enterprise_connectors::AnalysisConnector connector);
449 440
@@ -451,8 +442,8 @@
451 442
452 std::vector<std::string> GetOnSecurityEventProviders(); 443 std::vector<std::string> GetOnSecurityEventProviders();
453 444
454--- a/chrome/browser/enterprise/signals/signals_utils.cc 445--- chrome/browser/enterprise/signals/signals_utils.cc.orig
455+++ b/chrome/browser/enterprise/signals/signals_utils.cc 446+++ chrome/browser/enterprise/signals/signals_utils.cc
456@@ -33,24 +33,6 @@ bool IsURLBlocked(const GURL& url, Polic 447@@ -33,24 +33,6 @@ bool IsURLBlocked(const GURL& url, Polic
457 448
458 } // namespace 449 } // namespace
@@ -477,7 +468,7 @@
477- 468-
478 absl::optional<bool> GetThirdPartyBlockingEnabled(PrefService* local_state) { 469 absl::optional<bool> GetThirdPartyBlockingEnabled(PrefService* local_state) {
479 DCHECK(local_state); 470 DCHECK(local_state);
480 #if BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING) 471 #if defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
481@@ -65,15 +47,6 @@ bool GetBuiltInDnsClientEnabled(PrefServ 472@@ -65,15 +47,6 @@ bool GetBuiltInDnsClientEnabled(PrefServ
482 return local_state->GetBoolean(prefs::kBuiltInDnsClientEnabled); 473 return local_state->GetBoolean(prefs::kBuiltInDnsClientEnabled);
483 } 474 }
@@ -493,9 +484,9 @@
493- 484-
494 absl::optional<bool> GetChromeCleanupEnabled(PrefService* local_state) { 485 absl::optional<bool> GetChromeCleanupEnabled(PrefService* local_state) {
495 DCHECK(local_state); 486 DCHECK(local_state);
496 #if BUILDFLAG(IS_WIN) 487 #if defined(OS_WIN)
497--- a/chrome/browser/enterprise/signals/signals_utils.h 488--- chrome/browser/enterprise/signals/signals_utils.h.orig
498+++ b/chrome/browser/enterprise/signals/signals_utils.h 489+++ chrome/browser/enterprise/signals/signals_utils.h
499@@ -21,12 +21,6 @@ bool GetBuiltInDnsClientEnabled(PrefServ 490@@ -21,12 +21,6 @@ bool GetBuiltInDnsClientEnabled(PrefServ
500 491
501 absl::optional<bool> GetChromeCleanupEnabled(PrefService* local_state); 492 absl::optional<bool> GetChromeCleanupEnabled(PrefService* local_state);
@@ -509,20 +500,9 @@
509 bool GetChromeRemoteDesktopAppBlocked(PolicyBlocklistService* service); 500 bool GetChromeRemoteDesktopAppBlocked(PolicyBlocklistService* service);
510 501
511 } // namespace utils 502 } // namespace utils
512--- a/chrome/browser/extensions/BUILD.gn 503--- chrome/browser/extensions/BUILD.gn.orig
513+++ b/chrome/browser/extensions/BUILD.gn 504+++ chrome/browser/extensions/BUILD.gn
514@@ -300,10 +300,6 @@ static_library("extensions") { 505@@ -650,8 +650,6 @@ static_library("extensions") {
515 "api/runtime/chrome_runtime_api_delegate.h",
516 "api/safe_browsing_private/safe_browsing_private_api.cc",
517 "api/safe_browsing_private/safe_browsing_private_api.h",
518- "api/safe_browsing_private/safe_browsing_private_event_router.cc",
519- "api/safe_browsing_private/safe_browsing_private_event_router.h",
520- "api/safe_browsing_private/safe_browsing_private_event_router_factory.cc",
521- "api/safe_browsing_private/safe_browsing_private_event_router_factory.h",
522 "api/safe_browsing_private/safe_browsing_util.cc",
523 "api/safe_browsing_private/safe_browsing_util.h",
524 "api/scripting/scripting_api.cc",
525@@ -638,8 +634,6 @@ static_library("extensions") {
526 "menu_manager_factory.h", 506 "menu_manager_factory.h",
527 "navigation_observer.cc", 507 "navigation_observer.cc",
528 "navigation_observer.h", 508 "navigation_observer.h",
@@ -531,8 +511,8 @@
531 "pack_extension_job.cc", 511 "pack_extension_job.cc",
532 "pack_extension_job.h", 512 "pack_extension_job.h",
533 "pending_extension_info.cc", 513 "pending_extension_info.cc",
534--- a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc 514--- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc.orig
535+++ b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc 515+++ chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc
536@@ -72,17 +72,8 @@ api::enterprise_reporting_private::Conte 516@@ -72,17 +72,8 @@ api::enterprise_reporting_private::Conte
537 : nullptr; 517 : nullptr;
538 info.os_firewall = ToInfoSettingValue(signals.os_firewall); 518 info.os_firewall = ToInfoSettingValue(signals.os_firewall);
@@ -551,75 +531,183 @@
551 info.browser_version = std::move(signals.browser_version); 531 info.browser_version = std::move(signals.browser_version);
552 info.built_in_dns_client_enabled = signals.built_in_dns_client_enabled; 532 info.built_in_dns_client_enabled = signals.built_in_dns_client_enabled;
553 533
554--- a/chrome/browser/extensions/browser_context_keyed_service_factories.cc 534--- chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc.orig
555+++ b/chrome/browser/extensions/browser_context_keyed_service_factories.cc 535+++ chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc
556@@ -125,7 +125,6 @@ void EnsureBrowserContextKeyedServiceFac 536@@ -326,6 +326,7 @@ void SafeBrowsingPrivateEventRouter::OnD
557 #endif 537 event_router_->BroadcastEvent(std::move(extension_event));
558 extensions::PreferenceAPI::GetFactoryInstance(); 538 }
559 extensions::ProcessesAPI::GetFactoryInstance(); 539
560- extensions::SafeBrowsingPrivateEventRouterFactory::GetInstance(); 540+#if defined(FULL_SAFE_BROWSING)
561 extensions::SessionsAPI::GetFactoryInstance(); 541 absl::optional<enterprise_connectors::ReportingSettings> settings =
562 #if BUILDFLAG(IS_CHROMEOS) 542 GetReportingSettings();
563 extensions::SessionStateChangedEventDispatcher::GetFactoryInstance(); 543 if (!settings.has_value() ||
564--- a/chrome/browser/extensions/chrome_extensions_browser_client.cc 544@@ -356,6 +357,7 @@ void SafeBrowsingPrivateEventRouter::OnD
565+++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc 545
566@@ -612,51 +612,22 @@ void ChromeExtensionsBrowserClient::Noti 546 ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(settings.value()),
567 content::BrowserContext* context, 547 std::move(event));
568 const ExtensionId& extension_id, 548+#endif // FULL_SAFE_BROWSING
569 const std::string& code) const {
570- auto* telemetry_service =
571- safe_browsing::ExtensionTelemetryServiceFactory::GetForProfile(
572- Profile::FromBrowserContext(context));
573- if (!telemetry_service || !telemetry_service->enabled() ||
574- !base::FeatureList::IsEnabled(
575- safe_browsing::kExtensionTelemetryTabsExecuteScriptSignal)) {
576- return;
577- }
578-
579- auto signal = std::make_unique<safe_browsing::TabsExecuteScriptSignal>(
580- extension_id, code);
581- telemetry_service->AddSignal(std::move(signal));
582 } 549 }
583 550
584 bool ChromeExtensionsBrowserClient::IsExtensionTelemetryServiceEnabled( 551 void SafeBrowsingPrivateEventRouter::OnSecurityInterstitialShown(
585 content::BrowserContext* context) const { 552@@ -383,6 +385,7 @@ void SafeBrowsingPrivateEventRouter::OnS
586- auto* telemetry_service = 553 event_router_->BroadcastEvent(std::move(extension_event));
587- safe_browsing::ExtensionTelemetryServiceFactory::GetForProfile( 554 }
588- Profile::FromBrowserContext(context)); 555
589- return telemetry_service && telemetry_service->enabled(); 556+#if defined(FULL_SAFE_BROWSING)
590+ return false; 557 absl::optional<enterprise_connectors::ReportingSettings> settings =
558 GetReportingSettings();
559 if (!settings.has_value() ||
560@@ -406,6 +409,7 @@ void SafeBrowsingPrivateEventRouter::OnS
561
562 ReportRealtimeEvent(kKeyInterstitialEvent, std::move(settings.value()),
563 std::move(event));
564+#endif // FULL_SAFE_BROWSING
565 }
566
567 void SafeBrowsingPrivateEventRouter::OnSecurityInterstitialProceeded(
568@@ -433,6 +437,7 @@ void SafeBrowsingPrivateEventRouter::OnS
569 event_router_->BroadcastEvent(std::move(extension_event));
570 }
571
572+#if defined(FULL_SAFE_BROWSING)
573 absl::optional<enterprise_connectors::ReportingSettings> settings =
574 GetReportingSettings();
575 if (!settings.has_value() ||
576@@ -452,6 +457,7 @@ void SafeBrowsingPrivateEventRouter::OnS
577
578 ReportRealtimeEvent(kKeyInterstitialEvent, std::move(settings.value()),
579 std::move(event));
580+#endif // FULL_SAFE_BROWSING
591 } 581 }
592 582
593 bool ChromeExtensionsBrowserClient:: 583 void SafeBrowsingPrivateEventRouter::OnAnalysisConnectorResult(
594 IsExtensionTelemetryRemoteHostContactedSignalEnabled() const { 584@@ -465,6 +471,7 @@ void SafeBrowsingPrivateEventRouter::OnA
595- return base::FeatureList::IsEnabled( 585 const enterprise_connectors::ContentAnalysisResponse::Result& result,
596- safe_browsing::kExtensionTelemetryReportContactedHosts); 586 const int64_t content_size,
597+ return false; 587 safe_browsing::EventResult event_result) {
588+#if defined(FULL_SAFE_BROWSING)
589 if (result.tag() == "malware") {
590 DCHECK_EQ(1, result.triggered_rules().size());
591 OnDangerousDeepScanningResult(
592@@ -476,6 +483,7 @@ void SafeBrowsingPrivateEventRouter::OnA
593 OnSensitiveDataEvent(url, file_name, download_digest_sha256, mime_type,
594 trigger, scan_id, result, content_size, event_result);
595 }
596+#endif // FULL_SAFE_BROWSING
598 } 597 }
599 598
600 void ChromeExtensionsBrowserClient::NotifyExtensionRemoteHostContacted( 599 void SafeBrowsingPrivateEventRouter::OnDangerousDeepScanningResult(
601 content::BrowserContext* context, 600@@ -491,6 +499,7 @@ void SafeBrowsingPrivateEventRouter::OnD
602 const ExtensionId& extension_id, 601 const std::string& malware_category,
603 const GURL& url) const { 602 const std::string& evidence_locker_filepath,
604- if (!url.SchemeIsHTTPOrHTTPS()) { 603 const std::string& scan_id) {
605- return; 604+#if defined(FULL_SAFE_BROWSING)
606- } 605 absl::optional<enterprise_connectors::ReportingSettings> settings =
607- auto* telemetry_service = 606 GetReportingSettings();
608- safe_browsing::ExtensionTelemetryServiceFactory::GetForProfile( 607 if (!settings.has_value() ||
609- Profile::FromBrowserContext(context)); 608@@ -528,6 +537,7 @@ void SafeBrowsingPrivateEventRouter::OnD
610- if (!telemetry_service || !telemetry_service->enabled()) { 609
611- return; 610 ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(settings.value()),
612- } 611 std::move(event));
613- auto remote_host_signal = 612+#endif // FULL_SAFE_BROWSING
614- std::make_unique<safe_browsing::RemoteHostContactedSignal>(extension_id, 613 }
615- url); 614
616- telemetry_service->AddSignal(std::move(remote_host_signal)); 615 void SafeBrowsingPrivateEventRouter::OnSensitiveDataEvent(
616@@ -540,6 +550,7 @@ void SafeBrowsingPrivateEventRouter::OnS
617 const enterprise_connectors::ContentAnalysisResponse::Result& result,
618 const int64_t content_size,
619 safe_browsing::EventResult event_result) {
620+#if defined(FULL_SAFE_BROWSING)
621 absl::optional<enterprise_connectors::ReportingSettings> settings =
622 GetReportingSettings();
623 if (!settings.has_value() ||
624@@ -572,6 +583,7 @@ void SafeBrowsingPrivateEventRouter::OnS
625
626 ReportRealtimeEvent(kKeySensitiveDataEvent, std::move(settings.value()),
627 std::move(event));
628+#endif // FULL_SAFE_BROWSING
617 } 629 }
618 630
619 // static 631 void SafeBrowsingPrivateEventRouter::OnAnalysisConnectorWarningBypassed(
620--- a/chrome/browser/extensions/extension_service.cc 632@@ -584,6 +596,7 @@ void SafeBrowsingPrivateEventRouter::OnA
621+++ b/chrome/browser/extensions/extension_service.cc 633 safe_browsing::DeepScanAccessPoint access_point,
622@@ -53,7 +53,6 @@ 634 const enterprise_connectors::ContentAnalysisResponse::Result& result,
635 const int64_t content_size) {
636+#if defined(FULL_SAFE_BROWSING)
637 absl::optional<enterprise_connectors::ReportingSettings> settings =
638 GetReportingSettings();
639 if (!settings.has_value() ||
640@@ -616,6 +629,7 @@ void SafeBrowsingPrivateEventRouter::OnA
641
642 ReportRealtimeEvent(kKeySensitiveDataEvent, std::move(settings.value()),
643 std::move(event));
644+#endif // FULL_SAFE_BROWSING
645 }
646
647 void SafeBrowsingPrivateEventRouter::OnUnscannedFileEvent(
648@@ -628,6 +642,7 @@ void SafeBrowsingPrivateEventRouter::OnU
649 const std::string& reason,
650 const int64_t content_size,
651 safe_browsing::EventResult event_result) {
652+#if defined(FULL_SAFE_BROWSING)
653 absl::optional<enterprise_connectors::ReportingSettings> settings =
654 GetReportingSettings();
655 if (!settings.has_value() ||
656@@ -654,6 +669,7 @@ void SafeBrowsingPrivateEventRouter::OnU
657
658 ReportRealtimeEvent(kKeyUnscannedFileEvent, std::move(settings.value()),
659 std::move(event));
660+#endif // FULL_SAFE_BROWSING
661 }
662
663 void SafeBrowsingPrivateEventRouter::OnDangerousDownloadEvent(
664@@ -679,6 +695,7 @@ void SafeBrowsingPrivateEventRouter::OnD
665 const std::string& scan_id,
666 const int64_t content_size,
667 safe_browsing::EventResult event_result) {
668+#if defined(FULL_SAFE_BROWSING)
669 absl::optional<enterprise_connectors::ReportingSettings> settings =
670 GetReportingSettings();
671 if (!settings.has_value() ||
672@@ -709,6 +726,7 @@ void SafeBrowsingPrivateEventRouter::OnD
673
674 ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(settings.value()),
675 std::move(event));
676+#endif
677 }
678
679 void SafeBrowsingPrivateEventRouter::OnDangerousDownloadWarningBypassed(
680@@ -732,6 +750,7 @@ void SafeBrowsingPrivateEventRouter::OnD
681 const std::string& mime_type,
682 const std::string& scan_id,
683 const int64_t content_size) {
684+#if defined(FULL_SAFE_BROWSING)
685 absl::optional<enterprise_connectors::ReportingSettings> settings =
686 GetReportingSettings();
687 if (!settings.has_value() ||
688@@ -762,6 +781,7 @@ void SafeBrowsingPrivateEventRouter::OnD
689
690 ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(settings.value()),
691 std::move(event));
692+#endif // FULL_SAFE_BROWSING
693 }
694
695 void SafeBrowsingPrivateEventRouter::OnLoginEvent(
696@@ -1087,7 +1107,11 @@ void SafeBrowsingPrivateEventRouter::Rep
697 }
698
699 std::string SafeBrowsingPrivateEventRouter::GetProfileUserName() const {
700+#if defined(FULL_SAFE_BROWSING)
701 return safe_browsing::GetProfileEmail(identity_manager_);
702+#else
703+ return "";
704+#endif
705 }
706
707 #if BUILDFLAG(IS_CHROMEOS_ASH)
708--- chrome/browser/extensions/extension_service.cc.orig
709+++ chrome/browser/extensions/extension_service.cc
710@@ -52,7 +52,6 @@
623 #include "chrome/browser/extensions/forced_extensions/install_stage_tracker.h" 711 #include "chrome/browser/extensions/forced_extensions/install_stage_tracker.h"
624 #include "chrome/browser/extensions/install_verifier.h" 712 #include "chrome/browser/extensions/install_verifier.h"
625 #include "chrome/browser/extensions/installed_loader.h" 713 #include "chrome/browser/extensions/installed_loader.h"
@@ -627,15 +715,7 @@
627 #include "chrome/browser/extensions/pending_extension_manager.h" 715 #include "chrome/browser/extensions/pending_extension_manager.h"
628 #include "chrome/browser/extensions/permissions_updater.h" 716 #include "chrome/browser/extensions/permissions_updater.h"
629 #include "chrome/browser/extensions/shared_module_service.h" 717 #include "chrome/browser/extensions/shared_module_service.h"
630@@ -207,7 +206,6 @@ void ExtensionService::BlocklistExtensio 718@@ -370,7 +369,6 @@ ExtensionService::ExtensionService(Profi
631 blocklist_prefs::SetSafeBrowsingExtensionBlocklistState(
632 extension_id, BitMapBlocklistState::BLOCKLISTED_MALWARE,
633 extension_prefs_);
634- OnBlocklistStateAdded(extension_id);
635 }
636
637 bool ExtensionService::OnExternalExtensionUpdateUrlFound(
638@@ -370,7 +368,6 @@ ExtensionService::ExtensionService(Profi
639 safe_browsing_verdict_handler_(extension_prefs, 719 safe_browsing_verdict_handler_(extension_prefs,
640 ExtensionRegistry::Get(profile), 720 ExtensionRegistry::Get(profile),
641 this), 721 this),
@@ -643,7 +723,7 @@
643 registry_(ExtensionRegistry::Get(profile)), 723 registry_(ExtensionRegistry::Get(profile)),
644 pending_extension_manager_(profile), 724 pending_extension_manager_(profile),
645 install_directory_(install_directory), 725 install_directory_(install_directory),
646@@ -870,100 +867,6 @@ bool ExtensionService::IsExtensionEnable 726@@ -852,47 +850,6 @@ bool ExtensionService::IsExtensionEnable
647 return extension_registrar_.IsExtensionEnabled(extension_id); 727 return extension_registrar_.IsExtensionEnabled(extension_id);
648 } 728 }
649 729
@@ -651,14 +731,56 @@
651- const std::string& extension_id, 731- const std::string& extension_id,
652- const base::Value& attributes) { 732- const base::Value& attributes) {
653- DCHECK_CURRENTLY_ON(BrowserThread::UI); 733- DCHECK_CURRENTLY_ON(BrowserThread::UI);
734- HandleMalwareOmahaAttribute(extension_id, attributes);
654- omaha_attributes_handler_.PerformActionBasedOnOmahaAttributes(extension_id, 735- omaha_attributes_handler_.PerformActionBasedOnOmahaAttributes(extension_id,
655- attributes); 736- attributes);
656- allowlist_.PerformActionBasedOnOmahaAttributes(extension_id, attributes); 737- allowlist_.PerformActionBasedOnOmahaAttributes(extension_id, attributes);
738-}
739-
740-void ExtensionService::HandleMalwareOmahaAttribute(
741- const std::string& extension_id,
742- const base::Value& attributes) {
743- bool has_malware_value =
744- OmahaAttributesHandler::HasOmahaBlocklistStateInAttributes(
745- attributes, BitMapBlocklistState::BLOCKLISTED_MALWARE);
746- if (!has_malware_value) {
747- OmahaAttributesHandler::ReportNoUpdateCheckKeys();
748- // Omaha attributes may have previously have the "_malware" key.
749- MaybeEnableRemotelyDisabledExtension(extension_id);
750- return;
751- }
752-
753- if (extension_prefs_->HasDisableReason(
754- extension_id, disable_reason::DISABLE_REMOTELY_FOR_MALWARE)) {
755- // The extension is already disabled. No work needs to be done.
756- return;
757- }
758-
759- OmahaAttributesHandler::ReportExtensionDisabledRemotely(
760- extension_registrar_.IsExtensionEnabled(extension_id),
761- ExtensionUpdateCheckDataKey::kMalware);
762-
763- // Add the extension to the blocklisted extensions set.
764- UpdateBlocklistedExtensions({extension_id},
765- registry_->blocklisted_extensions().GetIDs());
766- extension_prefs_->AddDisableReason(
767- extension_id, disable_reason::DISABLE_REMOTELY_FOR_MALWARE);
657- // Show an error for the newly blocklisted extension. 768- // Show an error for the newly blocklisted extension.
658- error_controller_->ShowErrorIfNeeded(); 769- error_controller_->ShowErrorIfNeeded();
659-} 770-}
771
772 void ExtensionService::MaybeEnableRemotelyDisabledExtension(
773 const std::string& extension_id) {
774@@ -909,56 +866,6 @@ void ExtensionService::MaybeEnableRemote
775 unchanged.erase(extension_id);
776 // Remove the extension from the blocklist.
777 UpdateBlocklistedExtensions({}, unchanged);
778- OmahaAttributesHandler::ReportReenableExtension(
779- ExtensionUpdateCheckDataKey::kMalware);
780-}
660- 781-
661-void ExtensionService::OnGreylistStateRemoved(const std::string& extension_id) { 782-void ExtensionService::ClearGreylistedAcknowledgedStateAndMaybeReenable(
783- const std::string& extension_id) {
662- bool is_on_sb_list = (blocklist_prefs::GetSafeBrowsingExtensionBlocklistState( 784- bool is_on_sb_list = (blocklist_prefs::GetSafeBrowsingExtensionBlocklistState(
663- extension_id, extension_prefs_) != 785- extension_id, extension_prefs_) !=
664- BitMapBlocklistState::NOT_BLOCKLISTED); 786- BitMapBlocklistState::NOT_BLOCKLISTED);
@@ -675,8 +797,9 @@
675- disable_reason::DISABLE_GREYLIST); 797- disable_reason::DISABLE_GREYLIST);
676-} 798-}
677- 799-
678-void ExtensionService::OnGreylistStateAdded(const std::string& extension_id, 800-void ExtensionService::MaybeDisableGreylistedExtension(
679- BitMapBlocklistState new_state) { 801- const std::string& extension_id,
802- BitMapBlocklistState new_state) {
680-#if DCHECK_IS_ON() 803-#if DCHECK_IS_ON()
681- bool has_new_state_on_sb_list = 804- bool has_new_state_on_sb_list =
682- (blocklist_prefs::GetSafeBrowsingExtensionBlocklistState( 805- (blocklist_prefs::GetSafeBrowsingExtensionBlocklistState(
@@ -702,51 +825,12 @@
702- blocklist_prefs::UpdateCurrentGreylistStatesAsAcknowledged(extension_id, 825- blocklist_prefs::UpdateCurrentGreylistStatesAsAcknowledged(extension_id,
703- extension_prefs_); 826- extension_prefs_);
704- DisableExtension(extension_id, disable_reason::DISABLE_GREYLIST); 827- DisableExtension(extension_id, disable_reason::DISABLE_GREYLIST);
705-} 828 }
706- 829
707-void ExtensionService::OnBlocklistStateRemoved(
708- const std::string& extension_id) {
709- if (blocklist_prefs::IsExtensionBlocklisted(extension_id, extension_prefs_)) {
710- return;
711- }
712-
713- // Clear acknowledged state.
714- blocklist_prefs::RemoveAcknowledgedBlocklistState(
715- extension_id, BitMapBlocklistState::BLOCKLISTED_MALWARE,
716- extension_prefs_);
717-
718- scoped_refptr<const Extension> extension =
719- registry_->blocklisted_extensions().GetByID(extension_id);
720- DCHECK(extension);
721- registry_->RemoveBlocklisted(extension_id);
722- AddExtension(extension.get());
723-}
724-
725-void ExtensionService::OnBlocklistStateAdded(const std::string& extension_id) {
726- DCHECK(
727- blocklist_prefs::IsExtensionBlocklisted(extension_id, extension_prefs_));
728- // The extension was already acknowledged by the user, it should already be in
729- // the unloaded state.
730- if (blocklist_prefs::HasAcknowledgedBlocklistState(
731- extension_id, BitMapBlocklistState::BLOCKLISTED_MALWARE,
732- extension_prefs_)) {
733- DCHECK(base::Contains(registry_->blocklisted_extensions().GetIDs(),
734- extension_id));
735- return;
736- }
737-
738- scoped_refptr<const Extension> extension =
739- registry_->GetInstalledExtension(extension_id);
740- registry_->AddBlocklisted(extension);
741- UnloadExtension(extension_id, UnloadedExtensionReason::BLOCKLIST);
742-}
743-
744 void ExtensionService::RemoveDisableReasonAndMaybeEnable( 830 void ExtensionService::RemoveDisableReasonAndMaybeEnable(
745 const std::string& extension_id, 831--- chrome/browser/extensions/extension_service.h.orig
746 disable_reason::DisableReason reason_to_remove) { 832+++ chrome/browser/extensions/extension_service.h
747--- a/chrome/browser/extensions/extension_service.h 833@@ -25,7 +25,6 @@
748+++ b/chrome/browser/extensions/extension_service.h
749@@ -26,7 +26,6 @@
750 #include "chrome/browser/extensions/forced_extensions/force_installed_metrics.h" 834 #include "chrome/browser/extensions/forced_extensions/force_installed_metrics.h"
751 #include "chrome/browser/extensions/forced_extensions/force_installed_tracker.h" 835 #include "chrome/browser/extensions/forced_extensions/force_installed_tracker.h"
752 #include "chrome/browser/extensions/install_gate.h" 836 #include "chrome/browser/extensions/install_gate.h"
@@ -754,7 +838,7 @@
754 #include "chrome/browser/extensions/pending_extension_manager.h" 838 #include "chrome/browser/extensions/pending_extension_manager.h"
755 #include "chrome/browser/extensions/safe_browsing_verdict_handler.h" 839 #include "chrome/browser/extensions/safe_browsing_verdict_handler.h"
756 #include "chrome/browser/profiles/profile_manager.h" 840 #include "chrome/browser/profiles/profile_manager.h"
757@@ -276,40 +275,11 @@ class ExtensionService : public Extensio 841@@ -269,28 +268,11 @@ class ExtensionService : public Extensio
758 // nothing. 842 // nothing.
759 void EnableExtension(const std::string& extension_id); 843 void EnableExtension(const std::string& extension_id);
760 844
@@ -762,26 +846,14 @@
762- // whether to remove greylist disabled reason. Called when a greylisted 846- // whether to remove greylist disabled reason. Called when a greylisted
763- // state is removed from the Safe Browsing blocklist or Omaha blocklist. Also 847- // state is removed from the Safe Browsing blocklist or Omaha blocklist. Also
764- // clears all acknowledged states if the greylist disabled reason is removed. 848- // clears all acknowledged states if the greylist disabled reason is removed.
765- void OnGreylistStateRemoved(const std::string& extension_id); 849- void ClearGreylistedAcknowledgedStateAndMaybeReenable(
850- const std::string& extension_id);
766- 851-
767- // Takes acknowledged blocklist states into account and decides whether to 852- // Takes acknowledged blocklist states into account and decides whether to
768- // disable the greylisted extension. Called when a new greylisted state is 853- // disable the greylisted extension. Called when a new greylisted state is
769- // added to the Safe Browsing blocklist or Omaha blocklist. 854- // added to the Safe Browsing blocklist or Omaha blocklist.
770- void OnGreylistStateAdded(const std::string& extension_id, 855- void MaybeDisableGreylistedExtension(const std::string& extension_id,
771- BitMapBlocklistState new_state); 856- BitMapBlocklistState new_state);
772-
773- // Takes Safe Browsing and Omaha malware blocklist states into account and
774- // decides whether to remove the extension from the blocklist and reload it.
775- // Called when a blocklisted extension is removed from the Safe Browsing
776- // malware blocklist or Omaha malware blocklist. Also clears the acknowledged
777- // state if the extension is reloaded.
778- void OnBlocklistStateRemoved(const std::string& extension_id);
779-
780- // Takes acknowledged malware blocklist state into account and decides whether
781- // to add the extension to the blocklist and unload it. Called when the
782- // extension is added to the Safe Browsing malware blocklist or the Omaha
783- // malware blocklist.
784- void OnBlocklistStateAdded(const std::string& extension_id);
785- 857-
786 // Removes the disable reason and enable the extension if there are no disable 858 // Removes the disable reason and enable the extension if there are no disable
787 // reasons left and is not blocked for another reason. 859 // reasons left and is not blocked for another reason.
@@ -795,17 +867,29 @@
795 // Disables the extension. If the extension is already disabled, just adds 867 // Disables the extension. If the extension is already disabled, just adds
796 // the |disable_reasons| (a bitmask of disable_reason::DisableReason - there 868 // the |disable_reasons| (a bitmask of disable_reason::DisableReason - there
797 // can be multiple DisableReasons e.g. when an extension comes in disabled 869 // can be multiple DisableReasons e.g. when an extension comes in disabled
798@@ -649,8 +619,6 @@ class ExtensionService : public Extensio 870@@ -562,11 +544,6 @@ class ExtensionService : public Extensio
871 // Helper method to determine if an extension can be blocked.
872 bool CanBlockExtension(const Extension* extension) const;
873
874- // Handles the malware Omaha attribute for remotely disabled extensions.
875- // TODO(crbug.com/1193695): Move this function to OmahaAttributesHandler.
876- void HandleMalwareOmahaAttribute(const std::string& extension_id,
877- const base::Value& attributes);
878-
879 // Enables an extension that was only previously disabled remotely.
880 void MaybeEnableRemotelyDisabledExtension(const std::string& extension_id);
881
882@@ -639,8 +616,6 @@ class ExtensionService : public Extensio
799 883
800 SafeBrowsingVerdictHandler safe_browsing_verdict_handler_; 884 SafeBrowsingVerdictHandler safe_browsing_verdict_handler_;
801 885
802- OmahaAttributesHandler omaha_attributes_handler_; 886- OmahaAttributesHandler omaha_attributes_handler_;
803- 887-
804 // Sets of enabled/disabled/terminated/blocklisted extensions. Not owned. 888 // Sets of enabled/disabled/terminated/blocklisted extensions. Not owned.
805 raw_ptr<ExtensionRegistry> registry_ = nullptr; 889 ExtensionRegistry* registry_ = nullptr;
806 890
807--- a/chrome/browser/extensions/extension_system_impl.cc 891--- chrome/browser/extensions/extension_system_impl.cc.orig
808+++ b/chrome/browser/extensions/extension_system_impl.cc 892+++ chrome/browser/extensions/extension_system_impl.cc
809@@ -465,8 +465,6 @@ void ExtensionSystemImpl::InstallUpdate( 893@@ -465,8 +465,6 @@ void ExtensionSystemImpl::InstallUpdate(
810 void ExtensionSystemImpl::PerformActionBasedOnOmahaAttributes( 894 void ExtensionSystemImpl::PerformActionBasedOnOmahaAttributes(
811 const std::string& extension_id, 895 const std::string& extension_id,
@@ -815,42 +899,28 @@
815 } 899 }
816 900
817 bool ExtensionSystemImpl::FinishDelayedInstallationIfReady( 901 bool ExtensionSystemImpl::FinishDelayedInstallationIfReady(
818--- a/chrome/browser/extensions/safe_browsing_verdict_handler.cc 902--- chrome/browser/extensions/safe_browsing_verdict_handler.cc.orig
819+++ b/chrome/browser/extensions/safe_browsing_verdict_handler.cc 903+++ chrome/browser/extensions/safe_browsing_verdict_handler.cc
820@@ -119,7 +119,6 @@ void SafeBrowsingVerdictHandler::UpdateB 904@@ -101,8 +101,6 @@ void SafeBrowsingVerdictHandler::UpdateG
821 blocklist_.Remove(id);
822 blocklist_prefs::SetSafeBrowsingExtensionBlocklistState(
823 id, BitMapBlocklistState::NOT_BLOCKLISTED, extension_prefs_);
824- extension_service_->OnBlocklistStateRemoved(id);
825 UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.UnblacklistInstalled",
826 extension->location());
827 }
828@@ -133,7 +132,6 @@ void SafeBrowsingVerdictHandler::UpdateB
829 blocklist_.Insert(extension);
830 blocklist_prefs::SetSafeBrowsingExtensionBlocklistState(
831 id, BitMapBlocklistState::BLOCKLISTED_MALWARE, extension_prefs_);
832- extension_service_->OnBlocklistStateAdded(id);
833 UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlacklistInstalled",
834 extension->location());
835 }
836@@ -157,7 +155,6 @@ void SafeBrowsingVerdictHandler::UpdateG
837 blocklist_prefs::SetSafeBrowsingExtensionBlocklistState( 905 blocklist_prefs::SetSafeBrowsingExtensionBlocklistState(
838 extension->id(), BitMapBlocklistState::NOT_BLOCKLISTED, 906 extension->id(), BitMapBlocklistState::NOT_BLOCKLISTED,
839 extension_prefs_); 907 extension_prefs_);
840- extension_service_->OnGreylistStateRemoved(extension->id()); 908- extension_service_->ClearGreylistedAcknowledgedStateAndMaybeReenable(
909- extension->id());
841 UMA_HISTOGRAM_ENUMERATION("Extensions.Greylist.Enabled", 910 UMA_HISTOGRAM_ENUMERATION("Extensions.Greylist.Enabled",
842 extension->location()); 911 extension->location());
843 } 912 }
844@@ -177,7 +174,6 @@ void SafeBrowsingVerdictHandler::UpdateG 913@@ -125,8 +123,6 @@ void SafeBrowsingVerdictHandler::UpdateG
845 blocklist_prefs::BlocklistStateToBitMapBlocklistState(greylist_state); 914 blocklist_prefs::BlocklistStateToBitMapBlocklistState(greylist_state);
846 blocklist_prefs::SetSafeBrowsingExtensionBlocklistState( 915 blocklist_prefs::SetSafeBrowsingExtensionBlocklistState(
847 extension->id(), bitmap_greylist_state, extension_prefs_); 916 extension->id(), bitmap_greylist_state, extension_prefs_);
848- extension_service_->OnGreylistStateAdded(id, bitmap_greylist_state); 917- extension_service_->MaybeDisableGreylistedExtension(id,
918- bitmap_greylist_state);
849 UMA_HISTOGRAM_ENUMERATION("Extensions.Greylist.Disabled", 919 UMA_HISTOGRAM_ENUMERATION("Extensions.Greylist.Disabled",
850 extension->location()); 920 extension->location());
851 } 921 }
852--- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc 922--- chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc.orig
853+++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc 923+++ chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
854@@ -35,8 +35,6 @@ 924@@ -35,8 +35,6 @@
855 #include "chrome/browser/file_system_access/file_system_access_permission_request_manager.h" 925 #include "chrome/browser/file_system_access/file_system_access_permission_request_manager.h"
856 #include "chrome/browser/installable/installable_utils.h" 926 #include "chrome/browser/installable/installable_utils.h"
@@ -860,7 +930,7 @@
860 #include "chrome/browser/ui/file_system_access_dialogs.h" 930 #include "chrome/browser/ui/file_system_access_dialogs.h"
861 #include "chrome/common/chrome_paths.h" 931 #include "chrome/common/chrome_paths.h"
862 #include "components/content_settings/core/browser/host_content_settings_map.h" 932 #include "components/content_settings/core/browser/host_content_settings_map.h"
863@@ -305,83 +303,6 @@ BindResultCallbackToCurrentSequence( 933@@ -299,83 +297,6 @@ BindResultCallbackToCurrentSequence(
864 base::SequencedTaskRunnerHandle::Get(), std::move(callback)); 934 base::SequencedTaskRunnerHandle::Get(), std::move(callback));
865 } 935 }
866 936
@@ -944,7 +1014,7 @@
944 std::string GenerateLastPickedDirectoryKey(const std::string& id) { 1014 std::string GenerateLastPickedDirectoryKey(const std::string& id) {
945 return id.empty() ? kDefaultLastPickedDirectoryKey 1015 return id.empty() ? kDefaultLastPickedDirectoryKey
946 : base::StrCat({kCustomLastPickedDirectoryKey, "-", id}); 1016 : base::StrCat({kCustomLastPickedDirectoryKey, "-", id});
947@@ -1137,28 +1058,6 @@ void ChromeFileSystemAccessPermissionCon 1017@@ -1106,28 +1027,6 @@ void ChromeFileSystemAccessPermissionCon
948 std::move(callback))); 1018 std::move(callback)));
949 } 1019 }
950 1020
@@ -973,9 +1043,9 @@
973 void ChromeFileSystemAccessPermissionContext:: 1043 void ChromeFileSystemAccessPermissionContext::
974 DidConfirmSensitiveDirectoryAccess( 1044 DidConfirmSensitiveDirectoryAccess(
975 const url::Origin& origin, 1045 const url::Origin& origin,
976--- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h 1046--- chrome/browser/file_system_access/chrome_file_system_access_permission_context.h.orig
977+++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h 1047+++ chrome/browser/file_system_access/chrome_file_system_access_permission_context.h
978@@ -86,10 +86,6 @@ class ChromeFileSystemAccessPermissionCo 1048@@ -85,10 +85,6 @@ class ChromeFileSystemAccessPermissionCo
979 HandleType handle_type, 1049 HandleType handle_type,
980 content::GlobalRenderFrameHostId frame_id, 1050 content::GlobalRenderFrameHostId frame_id,
981 base::OnceCallback<void(SensitiveDirectoryResult)> callback) override; 1051 base::OnceCallback<void(SensitiveDirectoryResult)> callback) override;
@@ -986,9 +1056,9 @@
986 bool CanObtainReadPermission(const url::Origin& origin) override; 1056 bool CanObtainReadPermission(const url::Origin& origin) override;
987 bool CanObtainWritePermission(const url::Origin& origin) override; 1057 bool CanObtainWritePermission(const url::Origin& origin) override;
988 1058
989--- a/chrome/browser/media/webrtc/display_media_access_handler.cc 1059--- chrome/browser/media/webrtc/display_media_access_handler.cc.orig
990+++ b/chrome/browser/media/webrtc/display_media_access_handler.cc 1060+++ chrome/browser/media/webrtc/display_media_access_handler.cc
991@@ -23,6 +23,7 @@ 1061@@ -25,6 +25,7 @@
992 #include "chrome/browser/safe_browsing/user_interaction_observer.h" 1062 #include "chrome/browser/safe_browsing/user_interaction_observer.h"
993 #include "chrome/common/pref_names.h" 1063 #include "chrome/common/pref_names.h"
994 #include "components/prefs/pref_service.h" 1064 #include "components/prefs/pref_service.h"
@@ -996,7 +1066,7 @@
996 #include "components/url_formatter/elide_url.h" 1066 #include "components/url_formatter/elide_url.h"
997 #include "content/public/browser/browser_thread.h" 1067 #include "content/public/browser/browser_thread.h"
998 #include "content/public/browser/desktop_capture.h" 1068 #include "content/public/browser/desktop_capture.h"
999@@ -106,6 +107,7 @@ void DisplayMediaAccessHandler::HandleRe 1069@@ -111,6 +112,7 @@ void DisplayMediaAccessHandler::HandleRe
1000 return; 1070 return;
1001 } 1071 }
1002 1072
@@ -1004,41 +1074,25 @@
1004 // SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing 1074 // SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing
1005 // warnings until user interaction. If the current page has a delayed warning, 1075 // warnings until user interaction. If the current page has a delayed warning,
1006 // it'll have a user interaction observer attached. Show the warning 1076 // it'll have a user interaction observer attached. Show the warning
1007@@ -121,6 +123,7 @@ void DisplayMediaAccessHandler::HandleRe 1077@@ -125,6 +127,7 @@ void DisplayMediaAccessHandler::HandleRe
1008 observer->OnDesktopCaptureRequest(); 1078 observer->OnDesktopCaptureRequest();
1009 return; 1079 return;
1010 } 1080 }
1011+ #endif // BUILDFLAG(FULL_SAFE_BROWSING) 1081+ #endif // BUILDFLAG(FULL_SAFE_BROWSING)
1012 1082
1013 #if BUILDFLAG(IS_MAC) 1083 #if defined(OS_MAC)
1014 // Do not allow picker UI to be shown on a page that isn't in the foreground 1084 // Do not allow picker UI to be shown on a page that isn't in the foreground
1015--- a/chrome/browser/notifications/notification_display_service_impl.cc 1085--- chrome/browser/password_manager/chrome_password_manager_client.cc.orig
1016+++ b/chrome/browser/notifications/notification_display_service_impl.cc 1086+++ chrome/browser/password_manager/chrome_password_manager_client.cc
1017@@ -88,13 +88,6 @@ NotificationDisplayServiceImpl::Notifica
1018 profile_));
1019 #endif
1020
1021-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
1022- BUILDFLAG(IS_WIN)
1023- AddNotificationHandler(
1024- NotificationHandler::Type::TAILORED_SECURITY,
1025- std::make_unique<safe_browsing::TailoredSecurityNotificationHandler>());
1026-#endif
1027-
1028 #if BUILDFLAG(ENABLE_EXTENSIONS)
1029 AddNotificationHandler(
1030 NotificationHandler::Type::EXTENSION,
1031--- a/chrome/browser/password_manager/chrome_password_manager_client.cc
1032+++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
1033@@ -33,7 +33,6 @@ 1087@@ -33,7 +33,6 @@
1034 #include "chrome/browser/password_manager/password_scripts_fetcher_factory.h" 1088 #include "chrome/browser/password_manager/password_reuse_manager_factory.h"
1035 #include "chrome/browser/password_manager/password_store_factory.h" 1089 #include "chrome/browser/password_manager/password_store_factory.h"
1036 #include "chrome/browser/profiles/profile.h" 1090 #include "chrome/browser/profiles/profile.h"
1037-#include "chrome/browser/safe_browsing/chrome_password_protection_service.h" 1091-#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
1038 #include "chrome/browser/safe_browsing/user_interaction_observer.h" 1092 #include "chrome/browser/safe_browsing/user_interaction_observer.h"
1039 #include "chrome/browser/signin/identity_manager_factory.h" 1093 #include "chrome/browser/signin/identity_manager_factory.h"
1040 #include "chrome/browser/sync/sync_service_factory.h" 1094 #include "chrome/browser/sync/sync_service_factory.h"
1041@@ -114,11 +113,11 @@ 1095@@ -110,11 +109,11 @@
1042 #if BUILDFLAG(FULL_SAFE_BROWSING) 1096 #if BUILDFLAG(FULL_SAFE_BROWSING)
1043 #include "chrome/browser/safe_browsing/advanced_protection_status_manager.h" 1097 #include "chrome/browser/safe_browsing/advanced_protection_status_manager.h"
1044 #include "chrome/browser/safe_browsing/advanced_protection_status_manager_factory.h" 1098 #include "chrome/browser/safe_browsing/advanced_protection_status_manager_factory.h"
@@ -1049,9 +1103,9 @@
1049 #include "ui/events/keycodes/keyboard_codes.h" 1103 #include "ui/events/keycodes/keyboard_codes.h"
1050-#endif 1104-#endif
1051 1105
1052 #if BUILDFLAG(IS_ANDROID) 1106 #if defined(OS_ANDROID)
1053 #include "chrome/browser/android/tab_android.h" 1107 #include "chrome/browser/android/tab_android.h"
1054@@ -850,6 +849,7 @@ autofill::LanguageCode ChromePasswordMan 1108@@ -826,6 +825,7 @@ autofill::LanguageCode ChromePasswordMan
1055 return autofill::LanguageCode(); 1109 return autofill::LanguageCode();
1056 } 1110 }
1057 1111
@@ -1059,59 +1113,45 @@
1059 safe_browsing::PasswordProtectionService* 1113 safe_browsing::PasswordProtectionService*
1060 ChromePasswordManagerClient::GetPasswordProtectionService() const { 1114 ChromePasswordManagerClient::GetPasswordProtectionService() const {
1061 return safe_browsing::ChromePasswordProtectionService:: 1115 return safe_browsing::ChromePasswordProtectionService::
1062@@ -885,13 +885,9 @@ void ChromePasswordManagerClient::CheckP 1116@@ -836,13 +836,6 @@ ChromePasswordManagerClient::GetPassword
1063 web_contents(), web_contents()->GetLastCommittedURL(), username, 1117 void ChromePasswordManagerClient::CheckSafeBrowsingReputation(
1064 password_type, matching_reused_credentials, password_field_exists); 1118 const GURL& form_action,
1065 } 1119 const GURL& frame_url) {
1066+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
1067
1068 void ChromePasswordManagerClient::LogPasswordReuseDetectedEvent() {
1069- safe_browsing::PasswordProtectionService* pps = 1120- safe_browsing::PasswordProtectionService* pps =
1070- GetPasswordProtectionService(); 1121- GetPasswordProtectionService();
1071- if (pps) { 1122- if (pps) {
1072- pps->MaybeLogPasswordReuseDetectedEvent(web_contents()); 1123- pps->MaybeStartPasswordFieldOnFocusRequest(
1124- web_contents(), web_contents()->GetLastCommittedURL(), form_action,
1125- frame_url, pps->GetAccountInfo().hosted_domain);
1073- } 1126- }
1074 } 1127 }
1128 #endif // defined(ON_FOCUS_PING_ENABLED)
1075 1129
1076 #if !BUILDFLAG(IS_ANDROID) 1130@@ -852,22 +845,10 @@ void ChromePasswordManagerClient::CheckP
1077@@ -900,36 +896,10 @@ void ChromePasswordManagerClient::MaybeR 1131 const std::vector<password_manager::MatchingReusedCredential>&
1078 bool is_federated, 1132 matching_reused_credentials,
1079 const url::Origin& federated_origin, 1133 bool password_field_exists) {
1080 const std::u16string& login_user_name) const { 1134- safe_browsing::PasswordProtectionService* pps =
1081- if (!base::FeatureList::IsEnabled(policy::features::kLoginEventReporting)) 1135- GetPasswordProtectionService();
1082- return; 1136- if (!pps)
1083-
1084- extensions::SafeBrowsingPrivateEventRouter* router =
1085- extensions::SafeBrowsingPrivateEventRouterFactory::GetForProfile(
1086- profile_);
1087- if (!router)
1088- return; 1137- return;
1089- 1138-
1090- // The router is responsible for checking if the reporting of this event type 1139- pps->MaybeStartProtectedPasswordEntryRequest(
1091- // is enabled by the admin. 1140- web_contents(), web_contents()->GetLastCommittedURL(), username,
1092- router->OnLoginEvent(url, is_federated, federated_origin, login_user_name); 1141- password_type, matching_reused_credentials, password_field_exists);
1093 } 1142 }
1143+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
1094 1144
1095 void ChromePasswordManagerClient::MaybeReportEnterprisePasswordBreachEvent( 1145 void ChromePasswordManagerClient::LogPasswordReuseDetectedEvent() {
1096 const std::vector<std::pair<GURL, std::u16string>>& identities) const { 1146- safe_browsing::PasswordProtectionService* pps =
1097- if (!base::FeatureList::IsEnabled( 1147- GetPasswordProtectionService();
1098- policy::features::kPasswordBreachEventReporting)) { 1148- if (pps) {
1099- return; 1149- pps->MaybeLogPasswordReuseDetectedEvent(web_contents());
1100- } 1150- }
1101-
1102- extensions::SafeBrowsingPrivateEventRouter* router =
1103- extensions::SafeBrowsingPrivateEventRouterFactory::GetForProfile(
1104- profile_);
1105- if (!router)
1106- return;
1107-
1108- // The router is responsible for checking if the reporting of this event type
1109- // is enabled by the admin.
1110- router->OnPasswordBreach(kPasswordBreachEntryTrigger, identities);
1111 } 1151 }
1112 #endif
1113 1152
1114@@ -1398,9 +1368,11 @@ void ChromePasswordManagerClient::OnPast 1153 #if !defined(OS_ANDROID)
1154@@ -1365,9 +1346,11 @@ void ChromePasswordManagerClient::OnPast
1115 } 1155 }
1116 1156
1117 was_on_paste_called_ = true; 1157 was_on_paste_called_ = true;
@@ -1120,11 +1160,11 @@
1120+#endif // defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED) 1160+#endif // defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED)
1121 } 1161 }
1122-#endif 1162-#endif
1123+#endif // !BUILDFLAG(IS_ANDROID) 1163+#endif // !defined(OS_ANDROID)
1124 1164
1125 void ChromePasswordManagerClient::RenderFrameCreated( 1165 void ChromePasswordManagerClient::RenderFrameCreated(
1126 content::RenderFrameHost* render_frame_host) { 1166 content::RenderFrameHost* render_frame_host) {
1127@@ -1435,7 +1407,9 @@ void ChromePasswordManagerClient::OnInpu 1167@@ -1402,7 +1385,9 @@ void ChromePasswordManagerClient::OnInpu
1128 if (key_event.windows_key_code == (ui::VKEY_V & 0x1f)) { 1168 if (key_event.windows_key_code == (ui::VKEY_V & 0x1f)) {
1129 OnPaste(); 1169 OnPaste();
1130 } else { 1170 } else {
@@ -1132,9 +1172,9 @@
1132 password_reuse_detection_manager_.OnKeyPressedCommitted(key_event.text); 1172 password_reuse_detection_manager_.OnKeyPressedCommitted(key_event.text);
1133+#endif // defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) 1173+#endif // defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED)
1134 } 1174 }
1135 #endif // BUILDFLAG(IS_ANDROID) 1175 #endif // defined(OS_ANDROID)
1136 } 1176 }
1137@@ -1474,6 +1448,7 @@ bool ChromePasswordManagerClient::IsPass 1177@@ -1441,6 +1426,7 @@ bool ChromePasswordManagerClient::IsPass
1138 is_enabled = false; 1178 is_enabled = false;
1139 } 1179 }
1140 1180
@@ -1142,7 +1182,7 @@
1142 // SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing 1182 // SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing
1143 // warnings until user interaction. If the current page has a delayed warning, 1183 // warnings until user interaction. If the current page has a delayed warning,
1144 // it'll have a user interaction observer attached. Disable password 1184 // it'll have a user interaction observer attached. Disable password
1145@@ -1484,6 +1459,7 @@ bool ChromePasswordManagerClient::IsPass 1185@@ -1451,6 +1437,7 @@ bool ChromePasswordManagerClient::IsPass
1146 observer->OnPasswordSaveOrAutofillDenied(); 1186 observer->OnPasswordSaveOrAutofillDenied();
1147 is_enabled = false; 1187 is_enabled = false;
1148 } 1188 }
@@ -1150,9 +1190,9 @@
1150 1190
1151 if (log_manager_->IsLoggingActive()) { 1191 if (log_manager_->IsLoggingActive()) {
1152 password_manager::BrowserSavePasswordProgressLogger logger( 1192 password_manager::BrowserSavePasswordProgressLogger logger(
1153--- a/chrome/browser/password_manager/chrome_password_manager_client.h 1193--- chrome/browser/password_manager/chrome_password_manager_client.h.orig
1154+++ b/chrome/browser/password_manager/chrome_password_manager_client.h 1194+++ chrome/browser/password_manager/chrome_password_manager_client.h
1155@@ -216,13 +216,14 @@ class ChromePasswordManagerClient 1195@@ -207,13 +207,14 @@ class ChromePasswordManagerClient
1156 void AnnotateNavigationEntry(bool has_password_field) override; 1196 void AnnotateNavigationEntry(bool has_password_field) override;
1157 autofill::LanguageCode GetPageLanguage() const override; 1197 autofill::LanguageCode GetPageLanguage() const override;
1158 1198
@@ -1168,7 +1208,7 @@
1168 1208
1169 void CheckProtectedPasswordEntry( 1209 void CheckProtectedPasswordEntry(
1170 password_manager::metrics_util::PasswordType reused_password_type, 1210 password_manager::metrics_util::PasswordType reused_password_type,
1171@@ -230,6 +231,7 @@ class ChromePasswordManagerClient 1211@@ -221,6 +222,7 @@ class ChromePasswordManagerClient
1172 const std::vector<password_manager::MatchingReusedCredential>& 1212 const std::vector<password_manager::MatchingReusedCredential>&
1173 matching_reused_credentials, 1213 matching_reused_credentials,
1174 bool password_field_exists) override; 1214 bool password_field_exists) override;
@@ -1176,8 +1216,8 @@
1176 1216
1177 void LogPasswordReuseDetectedEvent() override; 1217 void LogPasswordReuseDetectedEvent() override;
1178 1218
1179--- a/chrome/browser/permissions/abusive_origin_permission_revocation_request.cc 1219--- chrome/browser/permissions/abusive_origin_permission_revocation_request.cc.orig
1180+++ b/chrome/browser/permissions/abusive_origin_permission_revocation_request.cc 1220+++ chrome/browser/permissions/abusive_origin_permission_revocation_request.cc
1181@@ -136,6 +136,7 @@ void AbusiveOriginPermissionRevocationRe 1221@@ -136,6 +136,7 @@ void AbusiveOriginPermissionRevocationRe
1182 DCHECK(profile_); 1222 DCHECK(profile_);
1183 DCHECK(callback_); 1223 DCHECK(callback_);
@@ -1194,9 +1234,9 @@
1194 } 1234 }
1195 1235
1196 void AbusiveOriginPermissionRevocationRequest::OnSafeBrowsingVerdictReceived( 1236 void AbusiveOriginPermissionRevocationRequest::OnSafeBrowsingVerdictReceived(
1197--- a/chrome/browser/permissions/contextual_notification_permission_ui_selector.cc 1237--- chrome/browser/permissions/contextual_notification_permission_ui_selector.cc.orig
1198+++ b/chrome/browser/permissions/contextual_notification_permission_ui_selector.cc 1238+++ chrome/browser/permissions/contextual_notification_permission_ui_selector.cc
1199@@ -16,7 +16,6 @@ 1239@@ -17,7 +17,6 @@
1200 #include "chrome/browser/browser_process.h" 1240 #include "chrome/browser/browser_process.h"
1201 #include "chrome/browser/permissions/quiet_notification_permission_ui_config.h" 1241 #include "chrome/browser/permissions/quiet_notification_permission_ui_config.h"
1202 #include "chrome/browser/permissions/quiet_notification_permission_ui_state.h" 1242 #include "chrome/browser/permissions/quiet_notification_permission_ui_state.h"
@@ -1204,7 +1244,7 @@
1204 #include "chrome/common/chrome_features.h" 1244 #include "chrome/common/chrome_features.h"
1205 #include "components/permissions/permission_request.h" 1245 #include "components/permissions/permission_request.h"
1206 #include "components/permissions/request_type.h" 1246 #include "components/permissions/request_type.h"
1207@@ -150,9 +149,6 @@ void ContextualNotificationPermissionUiS 1247@@ -151,9 +150,6 @@ void ContextualNotificationPermissionUiS
1208 } 1248 }
1209 1249
1210 void ContextualNotificationPermissionUiSelector::Cancel() { 1250 void ContextualNotificationPermissionUiSelector::Cancel() {
@@ -1214,7 +1254,7 @@
1214 } 1254 }
1215 1255
1216 bool ContextualNotificationPermissionUiSelector::IsPermissionRequestSupported( 1256 bool ContextualNotificationPermissionUiSelector::IsPermissionRequestSupported(
1217@@ -178,24 +174,14 @@ void ContextualNotificationPermissionUiS 1257@@ -179,24 +175,14 @@ void ContextualNotificationPermissionUiS
1218 absl::optional<Decision> decision = 1258 absl::optional<Decision> decision =
1219 GetDecisionBasedOnSiteReputation(reputation); 1259 GetDecisionBasedOnSiteReputation(reputation);
1220 1260
@@ -1244,92 +1284,23 @@
1244 } 1284 }
1245 1285
1246 void ContextualNotificationPermissionUiSelector::OnSafeBrowsingVerdictReceived( 1286 void ContextualNotificationPermissionUiSelector::OnSafeBrowsingVerdictReceived(
1247--- a/chrome/browser/permissions/prediction_based_permission_ui_selector.cc 1287--- chrome/browser/permissions/prediction_based_permission_ui_selector.cc.orig
1248+++ b/chrome/browser/permissions/prediction_based_permission_ui_selector.cc 1288+++ chrome/browser/permissions/prediction_based_permission_ui_selector.cc
1249@@ -322,47 +322,5 @@ bool PredictionBasedPermissionUiSelector 1289@@ -212,10 +212,8 @@ bool PredictionBasedPermissionUiSelector
1250
1251 PredictionSource PredictionBasedPermissionUiSelector::GetPredictionTypeToUse(
1252 permissions::RequestType request_type) { 1290 permissions::RequestType request_type) {
1253- if (!safe_browsing::IsSafeBrowsingEnabled(*(profile_->GetPrefs()))) { 1291 // We need to also check `kQuietNotificationPrompts` here since there is no
1254 return PredictionSource::USE_NONE; 1292 // generic safeguard anywhere else in the stack.
1255- } 1293- if (!base::FeatureList::IsEnabled(features::kQuietNotificationPrompts) ||
1256- 1294- !safe_browsing::IsSafeBrowsingEnabled(*(profile_->GetPrefs()))) {
1257- bool is_server_side_prediction_enabled = false; 1295+ if (!base::FeatureList::IsEnabled(features::kQuietNotificationPrompts))
1258- bool is_ondevice_prediction_enabled = false; 1296 return false;
1259-
1260- bool is_tflite_available = false;
1261-#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
1262- is_tflite_available = true;
1263-#endif // BUILDFLAG(BUILD_WITH_TFLITE_LIB)
1264-
1265- // Notification supports both flavours of the quiet prompt
1266- if (request_type == permissions::RequestType::kNotifications &&
1267- (base::FeatureList::IsEnabled(features::kQuietNotificationPrompts) ||
1268- base::FeatureList::IsEnabled(
1269- permissions::features::kPermissionQuietChip))) {
1270- is_server_side_prediction_enabled =
1271- base::FeatureList::IsEnabled(features::kPermissionPredictions);
1272-
1273- is_ondevice_prediction_enabled =
1274- is_tflite_available &&
1275- base::FeatureList::IsEnabled(
1276- permissions::features::kPermissionOnDeviceNotificationPredictions);
1277- }
1278-
1279- // Geolocation supports only the quiet chip ui
1280- if (request_type == permissions::RequestType::kGeolocation &&
1281- base::FeatureList::IsEnabled(
1282- permissions::features::kPermissionQuietChip)) {
1283- is_server_side_prediction_enabled = base::FeatureList::IsEnabled(
1284- features::kPermissionGeolocationPredictions);
1285- }
1286-
1287- if (is_server_side_prediction_enabled && is_ondevice_prediction_enabled) {
1288- return PredictionSource::USE_ANY;
1289- } else if (is_server_side_prediction_enabled) {
1290- return PredictionSource::USE_SERVER_SIDE;
1291- } else if (is_ondevice_prediction_enabled) {
1292- return PredictionSource::USE_ONDEVICE;
1293- } else {
1294- return PredictionSource::USE_NONE;
1295- } 1297- }
1296 } 1298 double hold_back_chance = 0.0;
1297--- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc 1299 bool is_permissions_predictions_enabled = false;
1298+++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc 1300 switch (request_type) {
1299@@ -92,6 +92,7 @@ 1301--- chrome/browser/prefs/browser_prefs.cc.orig
1300 #include "components/policy/core/common/schema.h" 1302+++ chrome/browser/prefs/browser_prefs.cc
1301 #include "components/policy/policy_constants.h" 1303@@ -243,7 +243,6 @@
1302 #include "components/proxy_config/proxy_policy_handler.h"
1303+#include "components/safe_browsing/buildflags.h"
1304 #include "components/safe_browsing/content/common/file_type_policies_prefs.h"
1305 #include "components/safe_browsing/core/common/safe_browsing_policy_handler.h"
1306 #include "components/safe_browsing/core/common/safe_browsing_prefs.h"
1307@@ -1732,8 +1733,6 @@ std::unique_ptr<ConfigurationPolicyHandl
1308 handlers->AddHandler(
1309 std::make_unique<bookmarks::ManagedBookmarksPolicyHandler>(
1310 chrome_schema));
1311- handlers->AddHandler(
1312- std::make_unique<safe_browsing::SafeBrowsingPolicyHandler>());
1313 handlers->AddHandler(std::make_unique<syncer::SyncPolicyHandler>());
1314 handlers->AddHandler(
1315 std::make_unique<URLBlocklistPolicyHandler>(key::kURLBlocklist));
1316@@ -1790,13 +1789,6 @@ std::unique_ptr<ConfigurationPolicyHandl
1317 prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckMode,
1318 prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckScope, chrome_schema));
1319
1320- handlers->AddHandler(std::make_unique<SimpleSchemaValidatingPolicyHandler>(
1321- key::kExemptDomainFileTypePairsFromFileTypeDownloadWarnings,
1322- safe_browsing::file_type::prefs::
1323- kExemptDomainFileTypePairsFromFileTypeDownloadWarnings,
1324- chrome_schema, SCHEMA_ALLOW_UNKNOWN,
1325- SimpleSchemaValidatingPolicyHandler::RECOMMENDED_PROHIBITED,
1326- SimpleSchemaValidatingPolicyHandler::MANDATORY_ALLOWED));
1327 handlers->AddHandler(
1328 std::make_unique<ManagedAccountRestrictionsPolicyHandler>(chrome_schema));
1329
1330--- a/chrome/browser/prefs/browser_prefs.cc
1331+++ b/chrome/browser/prefs/browser_prefs.cc
1332@@ -248,7 +248,6 @@
1333 #include "chrome/browser/nearby_sharing/common/nearby_share_prefs.h" 1304 #include "chrome/browser/nearby_sharing/common/nearby_share_prefs.h"
1334 #include "chrome/browser/new_tab_page/modules/drive/drive_service.h" 1305 #include "chrome/browser/new_tab_page/modules/drive/drive_service.h"
1335 #include "chrome/browser/new_tab_page/modules/photos/photos_service.h" 1306 #include "chrome/browser/new_tab_page/modules/photos/photos_service.h"
@@ -1337,7 +1308,7 @@
1337 #include "chrome/browser/new_tab_page/modules/task_module/task_module_service.h" 1308 #include "chrome/browser/new_tab_page/modules/task_module/task_module_service.h"
1338 #include "chrome/browser/new_tab_page/promos/promo_service.h" 1309 #include "chrome/browser/new_tab_page/promos/promo_service.h"
1339 #include "chrome/browser/search/background/ntp_custom_background_service.h" 1310 #include "chrome/browser/search/background/ntp_custom_background_service.h"
1340@@ -1386,7 +1385,6 @@ void RegisterProfilePrefs(user_prefs::Pr 1311@@ -1277,7 +1276,6 @@ void RegisterProfilePrefs(user_prefs::Pr
1341 NewTabPageHandler::RegisterProfilePrefs(registry); 1312 NewTabPageHandler::RegisterProfilePrefs(registry);
1342 NewTabPageUI::RegisterProfilePrefs(registry); 1313 NewTabPageUI::RegisterProfilePrefs(registry);
1343 NewTabUI::RegisterProfilePrefs(registry); 1314 NewTabUI::RegisterProfilePrefs(registry);
@@ -1345,18 +1316,8 @@
1345 ntp_tiles::CustomLinksManagerImpl::RegisterProfilePrefs(registry); 1316 ntp_tiles::CustomLinksManagerImpl::RegisterProfilePrefs(registry);
1346 PhotosService::RegisterProfilePrefs(registry); 1317 PhotosService::RegisterProfilePrefs(registry);
1347 PinnedTabCodec::RegisterProfilePrefs(registry); 1318 PinnedTabCodec::RegisterProfilePrefs(registry);
1348--- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc 1319--- chrome/browser/reputation/reputation_service.cc.orig
1349+++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc 1320+++ chrome/browser/reputation/reputation_service.cc
1350@@ -536,7 +536,6 @@ void ChromeBrowserMainExtraPartsProfiles
1351 SystemExtensionsProviderFactory::GetInstance();
1352 #endif
1353 TabRestoreServiceFactory::GetInstance();
1354- safe_browsing::TailoredSecurityServiceFactory::GetInstance();
1355 TemplateURLFetcherFactory::GetInstance();
1356 TemplateURLServiceFactory::GetInstance();
1357 #if !BUILDFLAG(IS_ANDROID)
1358--- a/chrome/browser/reputation/reputation_service.cc
1359+++ b/chrome/browser/reputation/reputation_service.cc
1360@@ -120,9 +120,7 @@ void ReputationService::GetReputationSta 1321@@ -120,9 +120,7 @@ void ReputationService::GetReputationSta
1361 ReputationCheckCallback callback) { 1322 ReputationCheckCallback callback) {
1362 DCHECK(url.SchemeIsHTTPOrHTTPS()); 1323 DCHECK(url.SchemeIsHTTPOrHTTPS());
@@ -1368,18 +1329,8 @@
1368 1329
1369 LookalikeUrlService* service = LookalikeUrlService::Get(profile_); 1330 LookalikeUrlService* service = LookalikeUrlService::Get(profile_);
1370 if (service->EngagedSitesNeedUpdating()) { 1331 if (service->EngagedSitesNeedUpdating()) {
1371--- a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_page.ts 1332--- chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.cc.orig
1372+++ b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_page.ts 1333+++ chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.cc
1373@@ -17,7 +17,6 @@ import './privacy_guide_completion_fragm
1374 import './privacy_guide_cookies_fragment.js';
1375 import './privacy_guide_history_sync_fragment.js';
1376 import './privacy_guide_msbb_fragment.js';
1377-import './privacy_guide_safe_browsing_fragment.js';
1378 import './privacy_guide_welcome_fragment.js';
1379 import './step_indicator.js';
1380
1381--- a/chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.cc
1382+++ b/chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.cc
1383@@ -17,15 +17,6 @@ SafeBrowsingMetricsProvider::~SafeBrowsi 1334@@ -17,15 +17,6 @@ SafeBrowsingMetricsProvider::~SafeBrowsi
1384 1335
1385 void SafeBrowsingMetricsProvider::ProvideCurrentSessionData( 1336 void SafeBrowsingMetricsProvider::ProvideCurrentSessionData(
@@ -1396,8 +1347,8 @@
1396 } 1347 }
1397 1348
1398 } // namespace safe_browsing 1349 } // namespace safe_browsing
1399--- a/chrome/browser/safe_browsing/url_lookup_service_factory.cc 1350--- chrome/browser/safe_browsing/url_lookup_service_factory.cc.orig
1400+++ b/chrome/browser/safe_browsing/url_lookup_service_factory.cc 1351+++ chrome/browser/safe_browsing/url_lookup_service_factory.cc
1401@@ -59,28 +59,7 @@ RealTimeUrlLookupServiceFactory::RealTim 1352@@ -59,28 +59,7 @@ RealTimeUrlLookupServiceFactory::RealTim
1402 1353
1403 KeyedService* RealTimeUrlLookupServiceFactory::BuildServiceInstanceFor( 1354 KeyedService* RealTimeUrlLookupServiceFactory::BuildServiceInstanceFor(
@@ -1428,9 +1379,9 @@
1428 } 1379 }
1429 1380
1430 } // namespace safe_browsing 1381 } // namespace safe_browsing
1431--- a/chrome/browser/ssl/chrome_security_blocking_page_factory.cc 1382--- chrome/browser/ssl/chrome_security_blocking_page_factory.cc.orig
1432+++ b/chrome/browser/ssl/chrome_security_blocking_page_factory.cc 1383+++ chrome/browser/ssl/chrome_security_blocking_page_factory.cc
1433@@ -143,15 +143,6 @@ CreateSettingsPageHelper() { 1384@@ -142,15 +142,6 @@ CreateSettingsPageHelper() {
1434 CreateChromeSettingsPageHelper(); 1385 CreateChromeSettingsPageHelper();
1435 } 1386 }
1436 1387
@@ -1446,9 +1397,9 @@
1446 } // namespace 1397 } // namespace
1447 1398
1448 std::unique_ptr<SSLBlockingPage> 1399 std::unique_ptr<SSLBlockingPage>
1449@@ -175,10 +166,6 @@ ChromeSecurityBlockingPageFactory::Creat 1400@@ -192,10 +183,6 @@ ChromeSecurityBlockingPageFactory::Creat
1450 Profile::FromBrowserContext(web_contents->GetBrowserContext())); 1401 }
1451 state->DidDisplayErrorPage(cert_error); 1402 }
1452 1403
1453- LogSafeBrowsingSecuritySensitiveAction( 1404- LogSafeBrowsingSecuritySensitiveAction(
1454- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( 1405- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
@@ -1457,7 +1408,18 @@
1457 auto controller_client = std::make_unique<SSLErrorControllerClient>( 1408 auto controller_client = std::make_unique<SSLErrorControllerClient>(
1458 web_contents, ssl_info, cert_error, request_url, 1409 web_contents, ssl_info, cert_error, request_url,
1459 std::move(metrics_helper), CreateSettingsPageHelper()); 1410 std::move(metrics_helper), CreateSettingsPageHelper());
1460@@ -248,10 +235,6 @@ ChromeSecurityBlockingPageFactory::Creat 1411@@ -264,10 +251,6 @@ ChromeSecurityBlockingPageFactory::Creat
1412 const GURL& request_url,
1413 std::unique_ptr<SSLCertReporter> ssl_cert_reporter,
1414 const net::SSLInfo& ssl_info) {
1415- LogSafeBrowsingSecuritySensitiveAction(
1416- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
1417- Profile::FromBrowserContext(web_contents->GetBrowserContext())));
1418-
1419 auto page = std::make_unique<LegacyTLSBlockingPage>(
1420 web_contents, cert_error, request_url, std::move(ssl_cert_reporter),
1421 /*can_show_enhanced_protection_message=*/true, ssl_info,
1422@@ -289,10 +272,6 @@ ChromeSecurityBlockingPageFactory::Creat
1461 std::unique_ptr<SSLCertReporter> ssl_cert_reporter, 1423 std::unique_ptr<SSLCertReporter> ssl_cert_reporter,
1462 const net::SSLInfo& ssl_info, 1424 const net::SSLInfo& ssl_info,
1463 const std::string& mitm_software_name) { 1425 const std::string& mitm_software_name) {
@@ -1468,7 +1430,7 @@
1468 auto page = std::make_unique<MITMSoftwareBlockingPage>( 1430 auto page = std::make_unique<MITMSoftwareBlockingPage>(
1469 web_contents, cert_error, request_url, std::move(ssl_cert_reporter), 1431 web_contents, cert_error, request_url, std::move(ssl_cert_reporter),
1470 /*can_show_enhanced_protection_message=*/true, ssl_info, 1432 /*can_show_enhanced_protection_message=*/true, ssl_info,
1471@@ -273,10 +256,6 @@ ChromeSecurityBlockingPageFactory::Creat 1433@@ -314,10 +293,6 @@ ChromeSecurityBlockingPageFactory::Creat
1472 const GURL& request_url, 1434 const GURL& request_url,
1473 std::unique_ptr<SSLCertReporter> ssl_cert_reporter, 1435 std::unique_ptr<SSLCertReporter> ssl_cert_reporter,
1474 const net::SSLInfo& ssl_info) { 1436 const net::SSLInfo& ssl_info) {
@@ -1479,8 +1441,8 @@
1479 auto page = std::make_unique<BlockedInterceptionBlockingPage>( 1441 auto page = std::make_unique<BlockedInterceptionBlockingPage>(
1480 web_contents, cert_error, request_url, std::move(ssl_cert_reporter), 1442 web_contents, cert_error, request_url, std::move(ssl_cert_reporter),
1481 /*can_show_enhanced_protection_message=*/true, ssl_info, 1443 /*can_show_enhanced_protection_message=*/true, ssl_info,
1482--- a/chrome/browser/ssl/sct_reporting_service_factory.cc 1444--- chrome/browser/ssl/sct_reporting_service_factory.cc.orig
1483+++ b/chrome/browser/ssl/sct_reporting_service_factory.cc 1445+++ chrome/browser/ssl/sct_reporting_service_factory.cc
1484@@ -32,15 +32,7 @@ SCTReportingServiceFactory::~SCTReportin 1446@@ -32,15 +32,7 @@ SCTReportingServiceFactory::~SCTReportin
1485 1447
1486 KeyedService* SCTReportingServiceFactory::BuildServiceInstanceFor( 1448 KeyedService* SCTReportingServiceFactory::BuildServiceInstanceFor(
@@ -1498,19 +1460,8 @@
1498 } 1460 }
1499 1461
1500 content::BrowserContext* SCTReportingServiceFactory::GetBrowserContextToUse( 1462 content::BrowserContext* SCTReportingServiceFactory::GetBrowserContextToUse(
1501--- a/chrome/browser/ssl/ssl_error_controller_client.cc 1463--- chrome/browser/subresource_filter/chrome_content_subresource_filter_web_contents_helper_factory.cc.orig
1502+++ b/chrome/browser/ssl/ssl_error_controller_client.cc 1464+++ chrome/browser/subresource_filter/chrome_content_subresource_filter_web_contents_helper_factory.cc
1503@@ -91,8 +91,6 @@ void SSLErrorControllerClient::GoBack()
1504 }
1505
1506 void SSLErrorControllerClient::Proceed() {
1507- MaybeTriggerSecurityInterstitialProceededEvent(web_contents_, request_url_,
1508- "SSL_ERROR", cert_error_);
1509 #if BUILDFLAG(ENABLE_EXTENSIONS)
1510 // Hosted Apps should not be allowed to run if there is a problem with their
1511 // certificate. So, when users click proceed on an interstitial, move the tab
1512--- a/chrome/browser/subresource_filter/chrome_content_subresource_filter_web_contents_helper_factory.cc
1513+++ b/chrome/browser/subresource_filter/chrome_content_subresource_filter_web_contents_helper_factory.cc
1514@@ -6,7 +6,6 @@ 1465@@ -6,7 +6,6 @@
1515 1466
1516 #include "chrome/browser/browser_process.h" 1467 #include "chrome/browser/browser_process.h"
@@ -1531,9 +1482,9 @@
1531 } 1482 }
1532 1483
1533 } // namespace 1484 } // namespace
1534--- a/chrome/browser/ui/BUILD.gn 1485--- chrome/browser/ui/BUILD.gn.orig
1535+++ b/chrome/browser/ui/BUILD.gn 1486+++ chrome/browser/ui/BUILD.gn
1536@@ -546,7 +546,6 @@ static_library("ui") { 1487@@ -533,7 +533,6 @@ static_library("ui") {
1537 "//components/renderer_context_menu", 1488 "//components/renderer_context_menu",
1538 "//components/resources", 1489 "//components/resources",
1539 "//components/safe_browsing/content/browser", 1490 "//components/safe_browsing/content/browser",
@@ -1541,17 +1492,8 @@
1541 "//components/safe_browsing/content/browser/password_protection", 1492 "//components/safe_browsing/content/browser/password_protection",
1542 "//components/safe_browsing/content/browser/web_ui", 1493 "//components/safe_browsing/content/browser/web_ui",
1543 "//components/safe_browsing/core/browser/db:database_manager", 1494 "//components/safe_browsing/core/browser/db:database_manager",
1544@@ -4667,8 +4666,6 @@ static_library("ui") { 1495--- chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc.orig
1545 "views/safe_browsing/password_reuse_modal_warning_dialog.h", 1496+++ chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc
1546 "views/safe_browsing/prompt_for_scanning_modal_dialog.cc",
1547 "views/safe_browsing/prompt_for_scanning_modal_dialog.h",
1548- "views/safe_browsing/tailored_security_unconsented_modal.cc",
1549- "views/safe_browsing/tailored_security_unconsented_modal.h",
1550 "views/send_tab_to_self/send_tab_to_self_bubble_device_button.cc",
1551 "views/send_tab_to_self/send_tab_to_self_bubble_device_button.h",
1552 "views/send_tab_to_self/send_tab_to_self_bubble_view_impl.cc",
1553--- a/chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc
1554+++ b/chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc
1555@@ -16,6 +16,7 @@ 1497@@ -16,6 +16,7 @@
1556 #include "components/javascript_dialogs/tab_modal_dialog_manager.h" 1498 #include "components/javascript_dialogs/tab_modal_dialog_manager.h"
1557 #include "components/javascript_dialogs/tab_modal_dialog_view.h" 1499 #include "components/javascript_dialogs/tab_modal_dialog_view.h"
@@ -1576,12 +1518,12 @@
1576 } 1518 }
1577 1519
1578 void JavaScriptTabModalDialogManagerDelegateDesktop::DidCloseDialog() { 1520 void JavaScriptTabModalDialogManagerDelegateDesktop::DidCloseDialog() {
1579--- a/chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.cc 1521--- chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.cc.orig
1580+++ b/chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.cc 1522+++ chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.cc
1581@@ -10,7 +10,10 @@ 1523@@ -11,7 +11,10 @@
1582 #include "base/strings/utf_string_conversions.h" 1524 #include "base/task/post_task.h"
1583 #include "base/task/task_runner_util.h"
1584 #include "base/task/thread_pool.h" 1525 #include "base/task/thread_pool.h"
1526 #include "base/task_runner_util.h"
1585+#include "components/safe_browsing/buildflags.h" 1527+#include "components/safe_browsing/buildflags.h"
1586+#if BUILDFLAG(FULL_SAFE_BROWSING) 1528+#if BUILDFLAG(FULL_SAFE_BROWSING)
1587 #include "chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.h" 1529 #include "chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.h"
@@ -1589,7 +1531,7 @@
1589 #include "chrome/browser/profiles/profile.h" 1531 #include "chrome/browser/profiles/profile.h"
1590 #include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h" 1532 #include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h"
1591 #include "content/public/browser/web_contents.h" 1533 #include "content/public/browser/web_contents.h"
1592@@ -21,6 +24,7 @@ 1534@@ -22,6 +25,7 @@
1593 1535
1594 namespace { 1536 namespace {
1595 1537
@@ -1597,7 +1539,7 @@
1597 void CompletionCallback( 1539 void CompletionCallback(
1598 content::WebContentsViewDelegate::DropCompletionCallback callback, 1540 content::WebContentsViewDelegate::DropCompletionCallback callback,
1599 const enterprise_connectors::ContentAnalysisDelegate::Data& data, 1541 const enterprise_connectors::ContentAnalysisDelegate::Data& data,
1600@@ -62,6 +66,7 @@ enterprise_connectors::ContentAnalysisDe 1542@@ -63,6 +67,7 @@ enterprise_connectors::ContentAnalysisDe
1601 } 1543 }
1602 return data; 1544 return data;
1603 } 1545 }
@@ -1605,7 +1547,7 @@
1605 1547
1606 // Helper class to handle WebContents being destroyed while files are opened in 1548 // Helper class to handle WebContents being destroyed while files are opened in
1607 // the threadpool. This class deletes itself either when it's no longer needed 1549 // the threadpool. This class deletes itself either when it's no longer needed
1608@@ -75,6 +80,7 @@ class HandleDropScanData : public conten 1550@@ -76,6 +81,7 @@ class HandleDropScanData : public conten
1609 : content::WebContentsObserver(web_contents), 1551 : content::WebContentsObserver(web_contents),
1610 callback_(std::move(callback)) {} 1552 callback_(std::move(callback)) {}
1611 1553
@@ -1613,7 +1555,7 @@
1613 void ScanData( 1555 void ScanData(
1614 enterprise_connectors::ContentAnalysisDelegate::Data analysis_data) { 1556 enterprise_connectors::ContentAnalysisDelegate::Data analysis_data) {
1615 DCHECK(web_contents()); 1557 DCHECK(web_contents());
1616@@ -86,6 +92,7 @@ class HandleDropScanData : public conten 1558@@ -87,6 +93,7 @@ class HandleDropScanData : public conten
1617 1559
1618 delete this; 1560 delete this;
1619 } 1561 }
@@ -1621,7 +1563,7 @@
1621 1563
1622 void WebContentsDestroyed() override { delete this; } 1564 void WebContentsDestroyed() override { delete this; }
1623 1565
1624@@ -105,13 +112,16 @@ void HandleOnPerformDrop( 1566@@ -106,13 +113,16 @@ void HandleOnPerformDrop(
1625 content::WebContents* web_contents, 1567 content::WebContents* web_contents,
1626 const content::DropData& drop_data, 1568 const content::DropData& drop_data,
1627 content::WebContentsViewDelegate::DropCompletionCallback callback) { 1569 content::WebContentsViewDelegate::DropCompletionCallback callback) {
@@ -1638,7 +1580,7 @@
1638 if (!enterprise_connectors::ContentAnalysisDelegate::IsEnabled( 1580 if (!enterprise_connectors::ContentAnalysisDelegate::IsEnabled(
1639 profile, web_contents->GetLastCommittedURL(), &data, connector)) { 1581 profile, web_contents->GetLastCommittedURL(), &data, connector)) {
1640 std::move(callback).Run( 1582 std::move(callback).Run(
1641@@ -151,4 +161,8 @@ void HandleOnPerformDrop( 1583@@ -154,4 +164,8 @@ void HandleOnPerformDrop(
1642 std::move(callback).Run( 1584 std::move(callback).Run(
1643 content::WebContentsViewDelegate::DropCompletionResult::kContinue); 1585 content::WebContentsViewDelegate::DropCompletionResult::kContinue);
1644 } 1586 }
@@ -1647,8 +1589,8 @@
1647+ content::WebContentsViewDelegate::DropCompletionResult::kContinue); 1589+ content::WebContentsViewDelegate::DropCompletionResult::kContinue);
1648+#endif // BUILDFLAG(FULL_SAFE_BROWSING) 1590+#endif // BUILDFLAG(FULL_SAFE_BROWSING)
1649 } 1591 }
1650--- a/chrome/browser/ui/views/download/download_item_view.cc 1592--- chrome/browser/ui/views/download/download_item_view.cc.orig
1651+++ b/chrome/browser/ui/views/download/download_item_view.cc 1593+++ chrome/browser/ui/views/download/download_item_view.cc
1652@@ -837,9 +837,7 @@ void DownloadItemView::UpdateLabels() { 1594@@ -837,9 +837,7 @@ void DownloadItemView::UpdateLabels() {
1653 deep_scanning_label_->SetVisible(mode_ == 1595 deep_scanning_label_->SetVisible(mode_ ==
1654 download::DownloadItemMode::kDeepScanning); 1596 download::DownloadItemMode::kDeepScanning);
@@ -1676,7 +1618,7 @@
1676 open_button_->SetEnabled((mode_ == download::DownloadItemMode::kNormal) || 1618 open_button_->SetEnabled((mode_ == download::DownloadItemMode::kNormal) ||
1677 prompt_to_scan || allow_open_during_deep_scan); 1619 prompt_to_scan || allow_open_during_deep_scan);
1678 1620
1679@@ -1421,7 +1423,9 @@ void DownloadItemView::ShowContextMenuIm 1621@@ -1427,7 +1429,9 @@ void DownloadItemView::ShowContextMenuIm
1680 } 1622 }
1681 1623
1682 void DownloadItemView::OpenDownloadDuringAsyncScanning() { 1624 void DownloadItemView::OpenDownloadDuringAsyncScanning() {
@@ -1686,9 +1628,9 @@
1686 model_->SetOpenWhenComplete(true); 1628 model_->SetOpenWhenComplete(true);
1687 } 1629 }
1688 1630
1689--- a/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc 1631--- chrome/browser/ui/webui/downloads/downloads_dom_handler.cc.orig
1690+++ b/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc 1632+++ chrome/browser/ui/webui/downloads/downloads_dom_handler.cc
1691@@ -367,7 +367,6 @@ void DownloadsDOMHandler::OpenDuringScan 1633@@ -366,7 +366,6 @@ void DownloadsDOMHandler::OpenDuringScan
1692 if (download) { 1634 if (download) {
1693 DownloadItemModel model(download); 1635 DownloadItemModel model(download);
1694 model.SetOpenWhenComplete(true); 1636 model.SetOpenWhenComplete(true);
@@ -1696,9 +1638,9 @@
1696 } 1638 }
1697 } 1639 }
1698 1640
1699--- a/chrome/browser/ui/webui/management/management_ui_handler.cc 1641--- chrome/browser/ui/webui/management/management_ui_handler.cc.orig
1700+++ b/chrome/browser/ui/webui/management/management_ui_handler.cc 1642+++ chrome/browser/ui/webui/management/management_ui_handler.cc
1701@@ -843,12 +843,6 @@ base::Value ManagementUIHandler::GetThre 1643@@ -805,12 +805,6 @@ base::Value ManagementUIHandler::GetThre
1702 &info); 1644 &info);
1703 } 1645 }
1704 1646
@@ -1711,9 +1653,9 @@
1711 const std::string enterprise_manager = 1653 const std::string enterprise_manager =
1712 connectors_service->GetManagementDomain(); 1654 connectors_service->GetManagementDomain();
1713 1655
1714--- a/chrome/browser/webshare/share_service_impl.cc 1656--- chrome/browser/webshare/share_service_impl.cc.orig
1715+++ b/chrome/browser/webshare/share_service_impl.cc 1657+++ chrome/browser/webshare/share_service_impl.cc
1716@@ -17,7 +17,9 @@ 1658@@ -14,7 +14,9 @@
1717 #include "chrome/browser/browser_process.h" 1659 #include "chrome/browser/browser_process.h"
1718 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 1660 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
1719 #include "chrome/common/chrome_features.h" 1661 #include "chrome/common/chrome_features.h"
@@ -1723,10 +1665,10 @@
1723 #include "components/safe_browsing/core/browser/db/database_manager.h" 1665 #include "components/safe_browsing/core/browser/db/database_manager.h"
1724 #include "content/public/browser/web_contents.h" 1666 #include "content/public/browser/web_contents.h"
1725 #include "mojo/public/cpp/bindings/self_owned_receiver.h" 1667 #include "mojo/public/cpp/bindings/self_owned_receiver.h"
1726@@ -198,11 +200,13 @@ void ShareServiceImpl::Share(const std:: 1668@@ -182,11 +184,13 @@ void ShareServiceImpl::Share(const std::
1727
1728 // Check if at least one file is marked by the download protection service 1669 // Check if at least one file is marked by the download protection service
1729 // to send a ping to check this file type. 1670 // to send a ping to check this file type.
1671 const base::FilePath path = base::FilePath::FromUTF8Unsafe(file->name);
1730+#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) 1672+#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
1731 if (!should_check_url && 1673 if (!should_check_url &&
1732 safe_browsing::FileTypePolicies::GetInstance()->IsCheckedBinaryFile( 1674 safe_browsing::FileTypePolicies::GetInstance()->IsCheckedBinaryFile(
@@ -1737,7 +1679,7 @@
1737 1679
1738 // In the case where the original blob handle was to a native file (of 1680 // In the case where the original blob handle was to a native file (of
1739 // unknown size), the serialized data does not contain an accurate file 1681 // unknown size), the serialized data does not contain an accurate file
1740@@ -212,6 +216,7 @@ void ShareServiceImpl::Share(const std:: 1682@@ -196,6 +200,7 @@ void ShareServiceImpl::Share(const std::
1741 } 1683 }
1742 1684
1743 DCHECK(!safe_browsing_request_); 1685 DCHECK(!safe_browsing_request_);
@@ -1745,7 +1687,7 @@
1745 if (should_check_url && g_browser_process->safe_browsing_service()) { 1687 if (should_check_url && g_browser_process->safe_browsing_service()) {
1746 safe_browsing_request_.emplace( 1688 safe_browsing_request_.emplace(
1747 g_browser_process->safe_browsing_service()->database_manager(), 1689 g_browser_process->safe_browsing_service()->database_manager(),
1748@@ -221,6 +226,7 @@ void ShareServiceImpl::Share(const std:: 1690@@ -205,6 +210,7 @@ void ShareServiceImpl::Share(const std::
1749 std::move(files), std::move(callback))); 1691 std::move(files), std::move(callback)));
1750 return; 1692 return;
1751 } 1693 }
@@ -1753,9 +1695,9 @@
1753 1695
1754 OnSafeBrowsingResultReceived(title, text, share_url, std::move(files), 1696 OnSafeBrowsingResultReceived(title, text, share_url, std::move(files),
1755 std::move(callback), 1697 std::move(callback),
1756--- a/chrome/test/BUILD.gn 1698--- chrome/test/BUILD.gn.orig
1757+++ b/chrome/test/BUILD.gn 1699+++ chrome/test/BUILD.gn
1758@@ -1314,7 +1314,6 @@ if (!is_android) { 1700@@ -1196,7 +1196,6 @@ if (!is_android && !is_fuchsia) {
1759 "//components/resources", 1701 "//components/resources",
1760 "//components/safe_browsing:buildflags", 1702 "//components/safe_browsing:buildflags",
1761 "//components/safe_browsing/content/browser", 1703 "//components/safe_browsing/content/browser",
@@ -1763,7 +1705,7 @@
1763 "//components/safe_browsing/content/browser:safe_browsing_service", 1705 "//components/safe_browsing/content/browser:safe_browsing_service",
1764 "//components/safe_browsing/content/browser/password_protection", 1706 "//components/safe_browsing/content/browser/password_protection",
1765 "//components/safe_browsing/content/browser/password_protection:test_support", 1707 "//components/safe_browsing/content/browser/password_protection:test_support",
1766@@ -5819,7 +5818,6 @@ test("unit_tests") { 1708@@ -5349,7 +5348,6 @@ test("unit_tests") {
1767 "//components/resources", 1709 "//components/resources",
1768 "//components/safe_browsing:buildflags", 1710 "//components/safe_browsing:buildflags",
1769 "//components/safe_browsing/content/browser", 1711 "//components/safe_browsing/content/browser",
@@ -1771,20 +1713,20 @@
1771 "//components/safe_browsing/content/browser/password_protection", 1713 "//components/safe_browsing/content/browser/password_protection",
1772 "//components/safe_browsing/content/browser/password_protection:mock_password_protection", 1714 "//components/safe_browsing/content/browser/password_protection:mock_password_protection",
1773 "//components/safe_browsing/content/browser/web_ui", 1715 "//components/safe_browsing/content/browser/web_ui",
1774--- a/components/password_manager/content/browser/content_password_manager_driver.cc 1716--- components/password_manager/content/browser/content_password_manager_driver.cc.orig
1775+++ b/components/password_manager/content/browser/content_password_manager_driver.cc 1717+++ components/password_manager/content/browser/content_password_manager_driver.cc
1776@@ -415,7 +415,7 @@ void ContentPasswordManagerDriver::Check 1718@@ -407,7 +407,7 @@ void ContentPasswordManagerDriver::Check
1777 if (!password_manager::bad_message::CheckFrameNotPrerendering( 1719 if (client_->GetMetricsRecorder()) {
1778 render_frame_host_)) 1720 client_->GetMetricsRecorder()->RecordUserFocusedPasswordField();
1779 return; 1721 }
1780-#if defined(ON_FOCUS_PING_ENABLED) 1722-#if defined(ON_FOCUS_PING_ENABLED)
1781+#if defined(ON_FOCUS_PING_ENABLED) && BUILDFLAG(FULL_SAFE_BROWSING) 1723+#if defined(ON_FOCUS_PING_ENABLED) && BUILDFLAG(FULL_SAFE_BROWSING)
1782 client_->CheckSafeBrowsingReputation(form_action, frame_url); 1724 client_->CheckSafeBrowsingReputation(form_action, frame_url);
1783 #endif 1725 #endif
1784 } 1726 }
1785--- a/components/password_manager/core/browser/password_manager_client.h 1727--- components/password_manager/core/browser/password_manager_client.h.orig
1786+++ b/components/password_manager/core/browser/password_manager_client.h 1728+++ components/password_manager/core/browser/password_manager_client.h
1787@@ -374,11 +374,14 @@ class PasswordManagerClient { 1729@@ -339,11 +339,14 @@ class PasswordManagerClient {
1788 // Returns the current best guess as to the page's display language. 1730 // Returns the current best guess as to the page's display language.
1789 virtual autofill::LanguageCode GetPageLanguage() const; 1731 virtual autofill::LanguageCode GetPageLanguage() const;
1790 1732
@@ -1800,7 +1742,7 @@
1800 // Checks the safe browsing reputation of the webpage when the 1742 // Checks the safe browsing reputation of the webpage when the
1801 // user focuses on a username/password field. This is used for reporting 1743 // user focuses on a username/password field. This is used for reporting
1802 // only, and won't trigger a warning. 1744 // only, and won't trigger a warning.
1803@@ -386,6 +389,7 @@ class PasswordManagerClient { 1745@@ -351,6 +354,7 @@ class PasswordManagerClient {
1804 const GURL& frame_url) = 0; 1746 const GURL& frame_url) = 0;
1805 #endif 1747 #endif
1806 1748
@@ -1808,7 +1750,7 @@
1808 // Checks the safe browsing reputation of the webpage where password reuse 1750 // Checks the safe browsing reputation of the webpage where password reuse
1809 // happens. This is called by the PasswordReuseDetectionManager when a 1751 // happens. This is called by the PasswordReuseDetectionManager when a
1810 // protected password is typed on the wrong domain. This may trigger a 1752 // protected password is typed on the wrong domain. This may trigger a
1811@@ -398,6 +402,7 @@ class PasswordManagerClient { 1753@@ -363,6 +367,7 @@ class PasswordManagerClient {
1812 const std::string& username, 1754 const std::string& username,
1813 const std::vector<MatchingReusedCredential>& matching_reused_credentials, 1755 const std::vector<MatchingReusedCredential>& matching_reused_credentials,
1814 bool password_field_exists) = 0; 1756 bool password_field_exists) = 0;
@@ -1816,8 +1758,8 @@
1816 1758
1817 // Records a Chrome Sync event that GAIA password reuse was detected. 1759 // Records a Chrome Sync event that GAIA password reuse was detected.
1818 virtual void LogPasswordReuseDetectedEvent() = 0; 1760 virtual void LogPasswordReuseDetectedEvent() = 0;
1819--- a/components/password_manager/core/browser/password_reuse_detection_manager.cc 1761--- components/password_manager/core/browser/password_reuse_detection_manager.cc.orig
1820+++ b/components/password_manager/core/browser/password_reuse_detection_manager.cc 1762+++ components/password_manager/core/browser/password_reuse_detection_manager.cc
1821@@ -161,9 +161,11 @@ void PasswordReuseDetectionManager::OnRe 1763@@ -161,9 +161,11 @@ void PasswordReuseDetectionManager::OnRe
1822 ? reused_protected_password_hash->username 1764 ? reused_protected_password_hash->username
1823 : ""; 1765 : "";
@@ -1830,8 +1772,19 @@
1830 } 1772 }
1831 1773
1832 void PasswordReuseDetectionManager::SetClockForTesting(base::Clock* clock) { 1774 void PasswordReuseDetectionManager::SetClockForTesting(base::Clock* clock) {
1833--- a/components/safe_browsing/content/common/proto/BUILD.gn 1775--- components/safe_browsing/content/browser/BUILD.gn.orig
1834+++ b/components/safe_browsing/content/common/proto/BUILD.gn 1776+++ components/safe_browsing/content/browser/BUILD.gn
1777@@ -82,8 +82,6 @@ source_set("browser") {
1778 "threat_details_cache.h",
1779 "threat_details_history.cc",
1780 "threat_details_history.h",
1781- "user_population.cc",
1782- "user_population.h",
1783 "web_api_handshake_checker.cc",
1784 "web_api_handshake_checker.h",
1785 ]
1786--- components/safe_browsing/content/common/proto/BUILD.gn.orig
1787+++ components/safe_browsing/content/common/proto/BUILD.gn
1835@@ -5,8 +5,12 @@ 1788@@ -5,8 +5,12 @@
1836 import("//components/safe_browsing/buildflags.gni") 1789 import("//components/safe_browsing/buildflags.gni")
1837 import("//third_party/protobuf/proto_library.gni") 1790 import("//third_party/protobuf/proto_library.gni")
@@ -1847,8 +1800,8 @@
1847 } 1800 }
1848-} 1801-}
1849+# } 1802+# }
1850--- a/components/safe_browsing/content/common/safe_browsing.mojom 1803--- components/safe_browsing/content/common/safe_browsing.mojom.orig
1851+++ b/components/safe_browsing/content/common/safe_browsing.mojom 1804+++ components/safe_browsing/content/common/safe_browsing.mojom
1852@@ -120,7 +120,6 @@ enum PhishingDetectorResult { 1805@@ -120,7 +120,6 @@ enum PhishingDetectorResult {
1853 INVALID_SCORE = 4, 1806 INVALID_SCORE = 4,
1854 }; 1807 };
@@ -1857,39 +1810,9 @@
1857 // Interface for setting the CSD model and to start phishing classification. 1810 // Interface for setting the CSD model and to start phishing classification.
1858 interface PhishingDetector { 1811 interface PhishingDetector {
1859 // A classification model for client-side phishing detection. 1812 // A classification model for client-side phishing detection.
1860--- a/components/safe_browsing/core/browser/BUILD.gn 1813--- content/browser/file_system_access/safe_move_helper.cc.orig
1861+++ b/components/safe_browsing/core/browser/BUILD.gn 1814+++ content/browser/file_system_access/safe_move_helper.cc
1862@@ -11,8 +11,6 @@ source_set("browser") { 1815@@ -150,14 +150,8 @@ void SafeMoveHelper::Start(SafeMoveHelpe
1863 "safe_browsing_url_checker_impl.cc",
1864 "safe_browsing_url_checker_impl.h",
1865 "url_checker_delegate.h",
1866- "user_population.cc",
1867- "user_population.h",
1868 ]
1869
1870 public_deps = [ "//google_apis:google_apis" ]
1871--- a/components/safe_browsing/core/browser/verdict_cache_manager.cc
1872+++ b/components/safe_browsing/core/browser/verdict_cache_manager.cc
1873@@ -402,16 +402,6 @@ VerdictCacheManager::VerdictCacheManager
1874 // pref_service can be null in tests.
1875 if (pref_service) {
1876 pref_change_registrar_.Init(pref_service);
1877- pref_change_registrar_.Add(
1878- prefs::kSafeBrowsingEnhanced,
1879- base::BindRepeating(&VerdictCacheManager::CleanUpAllPageLoadTokens,
1880- weak_factory_.GetWeakPtr(),
1881- ClearReason::kSafeBrowsingStateChanged));
1882- pref_change_registrar_.Add(
1883- prefs::kSafeBrowsingEnabled,
1884- base::BindRepeating(&VerdictCacheManager::CleanUpAllPageLoadTokens,
1885- weak_factory_.GetWeakPtr(),
1886- ClearReason::kSafeBrowsingStateChanged));
1887 }
1888 // sync_observer_ can be null in some embedders that don't support sync.
1889 if (sync_observer_) {
1890--- a/content/browser/file_system_access/safe_move_helper.cc
1891+++ b/content/browser/file_system_access/safe_move_helper.cc
1892@@ -154,14 +154,8 @@ void SafeMoveHelper::Start(SafeMoveHelpe
1893 return; 1816 return;
1894 } 1817 }
1895 1818
@@ -1904,7 +1827,7 @@
1904 } 1827 }
1905 1828
1906 void SafeMoveHelper::ComputeHashForSourceFile(HashCallback callback) { 1829 void SafeMoveHelper::ComputeHashForSourceFile(HashCallback callback) {
1907@@ -181,44 +175,6 @@ void SafeMoveHelper::ComputeHashForSourc 1830@@ -177,38 +171,6 @@ void SafeMoveHelper::ComputeHashForSourc
1908 std::move(wrapped_callback), source_url())); 1831 std::move(wrapped_callback), source_url()));
1909 } 1832 }
1910 1833
@@ -1927,18 +1850,12 @@
1927- return; 1850- return;
1928- } 1851- }
1929- 1852-
1930- content::GlobalRenderFrameHostId outermost_main_frame_id;
1931- auto* rfh = content::RenderFrameHost::FromID(context_.frame_id);
1932- if (rfh)
1933- outermost_main_frame_id = rfh->GetOutermostMainFrame()->GetGlobalId();
1934-
1935- auto item = std::make_unique<FileSystemAccessWriteItem>(); 1853- auto item = std::make_unique<FileSystemAccessWriteItem>();
1936- item->target_file_path = dest_url().path(); 1854- item->target_file_path = dest_url().path();
1937- item->full_path = source_url().path(); 1855- item->full_path = source_url().path();
1938- item->sha256_hash = hash; 1856- item->sha256_hash = hash;
1939- item->size = size; 1857- item->size = size;
1940- item->frame_url = context_.url; 1858- item->frame_url = context_.url;
1941- item->outermost_main_frame_id = outermost_main_frame_id;
1942- item->has_user_gesture = has_transient_user_activation_; 1859- item->has_user_gesture = has_transient_user_activation_;
1943- manager_->permission_context()->PerformAfterWriteChecks( 1860- manager_->permission_context()->PerformAfterWriteChecks(
1944- std::move(item), context_.frame_id, 1861- std::move(item), context_.frame_id,
@@ -1949,8 +1866,8 @@
1949 void SafeMoveHelper::DidAfterWriteCheck( 1866 void SafeMoveHelper::DidAfterWriteCheck(
1950 FileSystemAccessPermissionContext::AfterWriteCheckResult result) { 1867 FileSystemAccessPermissionContext::AfterWriteCheckResult result) {
1951 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 1868 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
1952--- a/content/browser/file_system_access/safe_move_helper.h 1869--- content/browser/file_system_access/safe_move_helper.h.orig
1953+++ b/content/browser/file_system_access/safe_move_helper.h 1870+++ content/browser/file_system_access/safe_move_helper.h
1954@@ -52,9 +52,6 @@ class CONTENT_EXPORT SafeMoveHelper { 1871@@ -52,9 +52,6 @@ class CONTENT_EXPORT SafeMoveHelper {
1955 private: 1872 private:
1956 SEQUENCE_CHECKER(sequence_checker_); 1873 SEQUENCE_CHECKER(sequence_checker_);
@@ -1961,8 +1878,8 @@
1961 void DidAfterWriteCheck( 1878 void DidAfterWriteCheck(
1962 FileSystemAccessPermissionContext::AfterWriteCheckResult result); 1879 FileSystemAccessPermissionContext::AfterWriteCheckResult result);
1963 void DidFileSkipQuarantine(base::File::Error result); 1880 void DidFileSkipQuarantine(base::File::Error result);
1964--- a/content/public/browser/file_system_access_permission_context.h 1881--- content/public/browser/file_system_access_permission_context.h.orig
1965+++ b/content/public/browser/file_system_access_permission_context.h 1882+++ content/public/browser/file_system_access_permission_context.h
1966@@ -107,12 +107,6 @@ class FileSystemAccessPermissionContext 1883@@ -107,12 +107,6 @@ class FileSystemAccessPermissionContext
1967 base::OnceCallback<void(SensitiveDirectoryResult)> callback) = 0; 1884 base::OnceCallback<void(SensitiveDirectoryResult)> callback) = 0;
1968 1885
@@ -1976,9 +1893,9 @@
1976 1893
1977 // Returns whether the give |origin| already allows read permission, or it is 1894 // Returns whether the give |origin| already allows read permission, or it is
1978 // possible to request one. This is used to block file dialogs from being 1895 // possible to request one. This is used to block file dialogs from being
1979--- a/extensions/browser/updater/update_service.cc 1896--- extensions/browser/updater/update_service.cc.orig
1980+++ b/extensions/browser/updater/update_service.cc 1897+++ extensions/browser/updater/update_service.cc
1981@@ -122,13 +122,6 @@ void UpdateService::OnEvent(Events event 1898@@ -111,13 +111,6 @@ void UpdateService::OnEvent(Events event
1982 break; 1899 break;
1983 } 1900 }
1984 1901
@@ -1992,20 +1909,9 @@
1992 } 1909 }
1993 1910
1994 UpdateService::UpdateService( 1911 UpdateService::UpdateService(
1995--- a/printing/buildflags/buildflags.gni 1912--- weblayer/BUILD.gn.orig
1996+++ b/printing/buildflags/buildflags.gni 1913+++ weblayer/BUILD.gn
1997@@ -37,7 +37,7 @@ declare_args() { 1914@@ -463,7 +463,6 @@ source_set("weblayer_lib_base") {
1998 # Enable snapshotting a page when printing for its content to be analyzed for
1999 # sensitive content by enterprise users.
2000 enable_print_content_analysis =
2001- is_chromeos_ash || is_chromeos_lacros || is_win || is_linux || is_mac
2002+ false
2003 }
2004
2005 declare_args() {
2006--- a/weblayer/BUILD.gn
2007+++ b/weblayer/BUILD.gn
2008@@ -462,7 +462,6 @@ source_set("weblayer_lib_base") {
2009 "//components/prefs", 1915 "//components/prefs",
2010 "//components/profile_metrics", 1916 "//components/profile_metrics",
2011 "//components/safe_browsing/content/browser", 1917 "//components/safe_browsing/content/browser",