1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368 |
- # Additional changes to Inox's fix-building-without-safebrowsing.patch
- --- a/chrome/browser/BUILD.gn
- +++ b/chrome/browser/BUILD.gn
- @@ -631,8 +631,6 @@ static_library("browser") {
- "internal_auth.h",
- "interstitials/chrome_settings_page_helper.cc",
- "interstitials/chrome_settings_page_helper.h",
- - "interstitials/enterprise_util.cc",
- - "interstitials/enterprise_util.h",
- "invalidation/profile_invalidation_provider_factory.cc",
- "invalidation/profile_invalidation_provider_factory.h",
- "k_anonymity_service/k_anonymity_service_client.cc",
- @@ -3757,10 +3755,6 @@ static_library("browser") {
- "enterprise/connectors/analysis/analysis_service_settings.h",
- "enterprise/connectors/analysis/analysis_settings.cc",
- "enterprise/connectors/analysis/analysis_settings.h",
- - "enterprise/connectors/analysis/content_analysis_delegate.cc",
- - "enterprise/connectors/analysis/content_analysis_delegate.h",
- - "enterprise/connectors/analysis/content_analysis_delegate_base.cc",
- - "enterprise/connectors/analysis/content_analysis_delegate_base.h",
- "enterprise/connectors/analysis/content_analysis_dialog.cc",
- "enterprise/connectors/analysis/content_analysis_dialog.h",
- "enterprise/connectors/analysis/content_analysis_downloads_delegate.cc",
- @@ -4040,10 +4034,6 @@ static_library("browser") {
- "new_tab_page/modules/recipes/recipes_service_factory.h",
- "new_tab_page/modules/recipes/time_format_util.cc",
- "new_tab_page/modules/recipes/time_format_util.h",
- - "new_tab_page/modules/safe_browsing/safe_browsing_handler.cc",
- - "new_tab_page/modules/safe_browsing/safe_browsing_handler.h",
- - "new_tab_page/modules/safe_browsing/safe_browsing_prefs.cc",
- - "new_tab_page/modules/safe_browsing/safe_browsing_prefs.h",
- "new_tab_page/new_tab_page_util.cc",
- "new_tab_page/new_tab_page_util.h",
- "new_tab_page/one_google_bar/one_google_bar_data.cc",
- @@ -4488,7 +4478,6 @@ static_library("browser") {
- "//chrome/browser/new_tab_page/modules/feed:mojo_bindings",
- "//chrome/browser/new_tab_page/modules/photos:mojo_bindings",
- "//chrome/browser/new_tab_page/modules/recipes:mojo_bindings",
- - "//chrome/browser/new_tab_page/modules/safe_browsing:mojo_bindings",
- "//chrome/browser/policy:path_parser",
- "//chrome/browser/profile_resetter:profile_reset_report_proto",
- "//chrome/browser/resource_coordinator:intervention_policy_database_proto",
- @@ -7884,9 +7873,14 @@ static_library("browser") {
- "//components/safe_browsing/content/browser:safe_browsing_blocking_page",
- "//components/safe_browsing/content/browser/download:download_stats",
- "//components/safe_browsing/content/common:file_type_policies",
- - "//components/safe_browsing/content/common/proto:download_file_types_proto",
- + # "//components/safe_browsing/content/common/proto:download_file_types_proto",
- ]
- }
- + # Use download_file_types_proto regardless of safe_browsing_mode, for
- + # now...
- + deps += [
- + "//components/safe_browsing/content/common/proto:download_file_types_proto",
- + ]
-
- if (build_with_tflite_lib) {
- sources += [
- --- a/chrome/browser/accuracy_tips/accuracy_service_factory.cc
- +++ b/chrome/browser/accuracy_tips/accuracy_service_factory.cc
- @@ -45,10 +45,7 @@ KeyedService* AccuracyServiceFactory::Bu
- content::BrowserContext* browser_context) const {
- DCHECK(base::FeatureList::IsEnabled(safe_browsing::kAccuracyTipsFeature));
- Profile* profile = Profile::FromBrowserContext(browser_context);
- - auto sb_database =
- - g_browser_process->safe_browsing_service()
- - ? g_browser_process->safe_browsing_service()->database_manager()
- - : nullptr;
- + auto sb_database = nullptr;
- auto* history_service = HistoryServiceFactory::GetForProfile(
- profile, ServiceAccessType::IMPLICIT_ACCESS);
- auto delegate = std::make_unique<AccuracyServiceDelegate>(profile);
- --- a/chrome/browser/chrome_content_browser_client.cc
- +++ b/chrome/browser/chrome_content_browser_client.cc
- @@ -4649,11 +4649,13 @@ ChromeContentBrowserClient::CreateThrott
- &throttles);
- #endif
-
- +#if BUILDFLAG(FULL_SAFE_BROWSING)
- if (base::FeatureList::IsEnabled(safe_browsing::kDelayedWarnings)) {
- throttles.push_back(
- std::make_unique<safe_browsing::DelayedWarningNavigationThrottle>(
- handle));
- }
- +#endif
-
- #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
- MaybeAddThrottle(browser_switcher::BrowserSwitcherNavigationThrottle::
- @@ -6088,26 +6090,7 @@ ChromeContentBrowserClient::GetSafeBrows
- const std::vector<std::string>& allowlist_domains) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
-
- - // Should not bypass safe browsing check if the check is for enterprise
- - // lookup.
- - if (!safe_browsing_enabled_for_profile && !should_check_on_sb_disabled)
- - return nullptr;
- -
- - // |safe_browsing_service_| may be unavailable in tests.
- - if (safe_browsing_service_ && !safe_browsing_url_checker_delegate_) {
- - safe_browsing_url_checker_delegate_ =
- - base::MakeRefCounted<safe_browsing::UrlCheckerDelegateImpl>(
- - safe_browsing_service_->database_manager(),
- - safe_browsing_service_->ui_manager());
- - }
- -
- - // Update allowlist domains.
- - if (safe_browsing_url_checker_delegate_) {
- - safe_browsing_url_checker_delegate_->SetPolicyAllowlistDomains(
- - allowlist_domains);
- - }
- -
- - return safe_browsing_url_checker_delegate_;
- + return nullptr;
- }
-
- safe_browsing::RealTimeUrlLookupServiceBase*
- @@ -6128,11 +6111,6 @@ ChromeContentBrowserClient::GetUrlLookup
- GetForProfile(profile);
- }
- #endif
- -
- - if (is_consumer_lookup_enabled) {
- - return safe_browsing::RealTimeUrlLookupServiceFactory::GetForProfile(
- - profile);
- - }
- return nullptr;
- }
-
- --- a/chrome/browser/chrome_content_browser_client_receiver_bindings.cc
- +++ b/chrome/browser/chrome_content_browser_client_receiver_bindings.cc
- @@ -143,34 +143,6 @@ void MaybeCreateSafeBrowsingForRenderer(
- const std::vector<std::string>& allowlist_domains)>
- get_checker_delegate,
- mojo::PendingReceiver<safe_browsing::mojom::SafeBrowsing> receiver) {
- - DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- -
- - content::RenderProcessHost* render_process_host =
- - content::RenderProcessHost::FromID(process_id);
- - if (!render_process_host)
- - return;
- -
- - PrefService* pref_service =
- - Profile::FromBrowserContext(render_process_host->GetBrowserContext())
- - ->GetPrefs();
- -
- - std::vector<std::string> allowlist_domains =
- - safe_browsing::GetURLAllowlistByPolicy(pref_service);
- -
- - bool safe_browsing_enabled =
- - safe_browsing::IsSafeBrowsingEnabled(*pref_service);
- - content::GetIOThreadTaskRunner({})->PostTask(
- - FROM_HERE,
- - base::BindOnce(
- - &safe_browsing::MojoSafeBrowsingImpl::MaybeCreate, process_id,
- - resource_context,
- - base::BindRepeating(get_checker_delegate, safe_browsing_enabled,
- - // Navigation initiated from renderer should never
- - // check when safe browsing is disabled, because
- - // enterprise check only supports mainframe URL.
- - /*should_check_on_sb_disabled=*/false,
- - allowlist_domains),
- - std::move(receiver)));
- }
-
- // BadgeManager is not used for Android.
- --- a/chrome/browser/component_updater/chrome_client_side_phishing_component_installer.cc
- +++ b/chrome/browser/component_updater/chrome_client_side_phishing_component_installer.cc
- @@ -29,20 +29,6 @@ namespace {
-
- void LoadFromDisk(const base::FilePath& pb_path,
- const base::FilePath& visual_tflite_model_path) {
- - if (pb_path.empty())
- - return;
- -
- - std::string binary_pb;
- - if (!base::ReadFileToString(pb_path, &binary_pb))
- - binary_pb.clear();
- -
- - base::File visual_tflite_model(visual_tflite_model_path,
- - base::File::FLAG_OPEN | base::File::FLAG_READ);
- -
- - // The ClientSidePhishingModel singleton will react appropriately if the
- - // |binary_pb| is empty or |visual_tflite_model| is invalid.
- - safe_browsing::ClientSidePhishingModel::GetInstance()
- - ->PopulateFromDynamicUpdate(binary_pb, std::move(visual_tflite_model));
- }
-
- void PopulateModelFromFiles(const base::FilePath& install_dir) {
- @@ -56,9 +42,6 @@ void PopulateModelFromFiles(const base::
- update_client::InstallerAttributes GetInstallerAttributes() {
- update_client::InstallerAttributes attributes;
-
- - // Pass the tag parameter to the installer as the "tag" attribute; it will
- - // be used to choose which binary is downloaded.
- - attributes["tag"] = safe_browsing::GetClientSideDetectionTag();
- return attributes;
- }
-
- --- a/chrome/browser/devtools/devtools_window.cc
- +++ b/chrome/browser/devtools/devtools_window.cc
- @@ -72,6 +72,7 @@
- #include "content/public/browser/web_contents.h"
- #include "content/public/common/content_client.h"
- #include "content/public/common/url_constants.h"
- +#include "net/cert/x509_certificate.h"
- #include "third_party/blink/public/common/input/web_gesture_event.h"
- #include "third_party/blink/public/common/input/web_input_event.h"
- #include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"
- --- a/chrome/browser/download/bubble/download_bubble_controller.cc
- +++ b/chrome/browser/download/bubble/download_bubble_controller.cc
- @@ -402,8 +402,6 @@ void DownloadBubbleUIController::Process
- ProcessDownloadWarningButtonPress(model, command);
- break;
- case DownloadCommands::REVIEW:
- - model->ReviewScanningVerdict(
- - browser_->tab_strip_model()->GetActiveWebContents());
- break;
- case DownloadCommands::RETRY:
- RetryDownload(model, command);
- --- a/chrome/browser/download/chrome_download_manager_delegate.cc
- +++ b/chrome/browser/download/chrome_download_manager_delegate.cc
- @@ -132,7 +132,6 @@ using content::DownloadManager;
- using download::DownloadItem;
- using download::DownloadPathReservationTracker;
- using download::PathValidationResult;
- -using safe_browsing::DownloadFileType;
- using safe_browsing::DownloadProtectionService;
- using ConnectionType = net::NetworkChangeNotifier::ConnectionType;
-
- @@ -1486,7 +1485,6 @@ void ChromeDownloadManagerDelegate::OnDo
- DownloadItemModel model(item);
- model.DetermineAndSetShouldPreferOpeningInBrowser(
- target_info->target_path, target_info->is_filetype_handled_safely);
- - model.SetDangerLevel(target_info->danger_level);
- }
- if (ShouldBlockFile(item, target_info->danger_type)) {
- MaybeReportDangerousDownloadBlocked(
- @@ -1565,56 +1563,6 @@ bool ChromeDownloadManagerDelegate::IsOp
- bool ChromeDownloadManagerDelegate::ShouldBlockFile(
- download::DownloadItem* item,
- download::DownloadDangerType danger_type) const {
- - DownloadPrefs::DownloadRestriction download_restriction =
- - download_prefs_->download_restriction();
- -
- - if (IsDangerTypeBlocked(danger_type))
- - return true;
- -
- - // TODO(crbug/1061111): Move this into IsDangerTypeBlocked once the UX is
- - // ready.
- - if (danger_type ==
- - download::DOWNLOAD_DANGER_TYPE_BLOCKED_UNSUPPORTED_FILETYPE)
- - return true;
- -
- - bool file_type_dangerous =
- - (item &&
- - DownloadItemModel(item).GetDangerLevel() !=
- - DownloadFileType::NOT_DANGEROUS &&
- - danger_type == download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS);
- -
- - switch (download_restriction) {
- - case (DownloadPrefs::DownloadRestriction::NONE):
- - return false;
- -
- - case (DownloadPrefs::DownloadRestriction::POTENTIALLY_DANGEROUS_FILES):
- - return danger_type != download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS ||
- - file_type_dangerous;
- -
- - case (DownloadPrefs::DownloadRestriction::DANGEROUS_FILES): {
- - return (danger_type == download::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT ||
- - danger_type == download::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE ||
- - danger_type == download::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL ||
- - danger_type ==
- - download::DOWNLOAD_DANGER_TYPE_DANGEROUS_ACCOUNT_COMPROMISE ||
- - file_type_dangerous);
- - }
- -
- - case (DownloadPrefs::DownloadRestriction::MALICIOUS_FILES): {
- - return (danger_type == download::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT ||
- - danger_type == download::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST ||
- - danger_type == download::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL ||
- - danger_type ==
- - download::DOWNLOAD_DANGER_TYPE_DANGEROUS_ACCOUNT_COMPROMISE);
- - }
- -
- - case (DownloadPrefs::DownloadRestriction::ALL_FILES):
- - return true;
- -
- - default:
- - LOG(ERROR) << "Invalid download restruction value: "
- - << static_cast<int>(download_restriction);
- - }
-
- return false;
- }
- @@ -1629,7 +1577,6 @@ void ChromeDownloadManagerDelegate::Mayb
- service->MaybeSendDangerousDownloadOpenedReport(download,
- show_download_in_folder);
- }
- -#endif
- if (!download->GetAutoOpened()) {
- download::DownloadContent download_content =
- download::DownloadContentFromMimeType(download->GetMimeType(), false);
- @@ -1637,6 +1584,7 @@ void ChromeDownloadManagerDelegate::Mayb
- download->GetDangerType(), download_content, base::Time::Now(),
- download->GetEndTime(), show_download_in_folder);
- }
- +#endif
- }
-
- void ChromeDownloadManagerDelegate::CheckDownloadAllowed(
- @@ -1694,8 +1642,7 @@ void ChromeDownloadManagerDelegate::Chec
- DCHECK(download_item);
- DCHECK(download_item->IsSavePackageDownload());
-
- -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
- - BUILDFLAG(IS_MAC)
- +#if 0
- absl::optional<enterprise_connectors::AnalysisSettings> settings =
- safe_browsing::DeepScanningRequest::ShouldUploadBinary(download_item);
-
- --- a/chrome/browser/download/download_item_model.cc
- +++ b/chrome/browser/download/download_item_model.cc
- @@ -924,100 +924,10 @@ void DownloadItemModel::ExecuteCommand(D
-
- DownloadItemModel::BubbleUIInfo
- DownloadItemModel::GetBubbleUIInfoForTailoredWarning() const {
- - download::DownloadDangerType danger_type = GetDangerType();
- - TailoredVerdict tailored_verdict = safe_browsing::DownloadProtectionService::
- - GetDownloadProtectionTailoredVerdict(download_);
- -
- - // Suspicious archives
- - if (danger_type == download::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT &&
- - tailored_verdict.tailored_verdict_type() ==
- - TailoredVerdict::SUSPICIOUS_ARCHIVE) {
- - return DownloadUIModel::BubbleUIInfo(
- - l10n_util::GetStringUTF16(
- - IDS_DOWNLOAD_BUBBLE_SUBPAGE_SUMMARY_SUSPICIOUS_ARCHIVE))
- - .AddIconAndColor(views::kInfoIcon, ui::kColorAlertMediumSeverity)
- - .AddPrimaryButton(DownloadCommands::Command::DISCARD)
- - .AddSubpageButton(l10n_util::GetStringUTF16(IDS_DOWNLOAD_BUBBLE_DELETE),
- - DownloadCommands::Command::DISCARD,
- - /*is_prominent=*/true)
- - .AddSubpageButton(
- - l10n_util::GetStringUTF16(IDS_DOWNLOAD_BUBBLE_CONTINUE),
- - DownloadCommands::Command::KEEP,
- - /*is_prominent=*/false);
- - }
- -
- - // Cookie theft
- - if (danger_type ==
- - download::DOWNLOAD_DANGER_TYPE_DANGEROUS_ACCOUNT_COMPROMISE &&
- - tailored_verdict.tailored_verdict_type() ==
- - TailoredVerdict::COOKIE_THEFT) {
- - if (base::Contains(tailored_verdict.adjustments(),
- - TailoredVerdict::ACCOUNT_INFO_STRING)) {
- - auto* identity_manager = IdentityManagerFactory::GetForProfile(profile());
- - std::string email =
- - identity_manager
- - ? identity_manager
- - ->GetPrimaryAccountInfo(signin::ConsentLevel::kSignin)
- - .email
- - : "";
- - base::UmaHistogramBoolean(
- - "SBClientDownload.TailoredWarning.HasVaidEmailForAccountInfo",
- - !email.empty());
- - if (!email.empty()) {
- - return DownloadUIModel::BubbleUIInfo(
- - l10n_util::GetStringFUTF16(
- - IDS_DOWNLOAD_BUBBLE_SUBPAGE_SUMMARY_COOKIE_THEFT_AND_ACCOUNT,
- - base::ASCIIToUTF16(email)))
- - .AddIconAndColor(vector_icons::kNotSecureWarningIcon,
- - ui::kColorAlertHighSeverity)
- - .AddPrimaryButton(DownloadCommands::Command::DISCARD)
- - .AddSubpageButton(
- - l10n_util::GetStringUTF16(IDS_DOWNLOAD_BUBBLE_DELETE),
- - DownloadCommands::Command::DISCARD,
- - /*is_prominent=*/true);
- - }
- - }
- - return DownloadUIModel::BubbleUIInfo(
- - l10n_util::GetStringUTF16(
- - IDS_DOWNLOAD_BUBBLE_SUBPAGE_SUMMARY_COOKIE_THEFT))
- - .AddIconAndColor(vector_icons::kNotSecureWarningIcon,
- - ui::kColorAlertHighSeverity)
- - .AddPrimaryButton(DownloadCommands::Command::DISCARD)
- - .AddSubpageButton(l10n_util::GetStringUTF16(IDS_DOWNLOAD_BUBBLE_DELETE),
- - DownloadCommands::Command::DISCARD,
- - /*is_prominent=*/true);
- - }
- -
- - NOTREACHED();
- return DownloadUIModel::BubbleUIInfo();
- }
-
- bool DownloadItemModel::ShouldShowTailoredWarning() const {
- - if (!IsBubbleV2Enabled() ||
- - !base::FeatureList::IsEnabled(safe_browsing::kDownloadTailoredWarnings)) {
- - return false;
- - }
- -
- - static const struct ValidCombination {
- - download::DownloadDangerType danger_type;
- - TailoredVerdict::TailoredVerdictType tailored_verdict_type;
- - } kValidTailoredWarningCombinations[]{
- - {download::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT,
- - TailoredVerdict::SUSPICIOUS_ARCHIVE},
- - {download::DOWNLOAD_DANGER_TYPE_DANGEROUS_ACCOUNT_COMPROMISE,
- - TailoredVerdict::COOKIE_THEFT}};
- -
- - download::DownloadDangerType danger_type = GetDangerType();
- - TailoredVerdict tailored_verdict = safe_browsing::DownloadProtectionService::
- - GetDownloadProtectionTailoredVerdict(download_);
- - for (const auto& combination : kValidTailoredWarningCombinations) {
- - if (danger_type == combination.danger_type &&
- - tailored_verdict.tailored_verdict_type() ==
- - combination.tailored_verdict_type) {
- - return true;
- - }
- - }
- -
- return false;
- }
-
- --- a/chrome/browser/download/download_stats.cc
- +++ b/chrome/browser/download/download_stats.cc
- @@ -10,6 +10,7 @@
- #include "build/build_config.h"
- #include "components/download/public/common/download_content.h"
- #include "components/profile_metrics/browser_profile_type.h"
- +#include "components/safe_browsing/buildflags.h"
- #include "components/safe_browsing/content/browser/download/download_stats.h"
-
- void RecordDownloadCount(ChromeDownloadCountTypes type) {
- @@ -29,8 +30,10 @@ void RecordDangerousDownloadWarningShown
- bool has_user_gesture) {
- base::UmaHistogramEnumeration("Download.ShowedDownloadWarning", danger_type,
- download::DOWNLOAD_DANGER_TYPE_MAX);
- +#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
- safe_browsing::RecordDangerousDownloadWarningShown(
- danger_type, file_path, is_https, has_user_gesture);
- +#endif
- }
-
- void RecordOpenedDangerousConfirmDialog(
- --- a/chrome/browser/download/download_target_determiner.cc
- +++ b/chrome/browser/download/download_target_determiner.cc
- @@ -956,12 +956,14 @@ void DownloadTargetDeterminer::CheckVisi
- bool visited_referrer_before) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- DCHECK_EQ(STATE_DETERMINE_INTERMEDIATE_PATH, next_state_);
- +#if BUILDFLAG(FULL_SAFE_BROWSING)
- safe_browsing::RecordDownloadFileTypeAttributes(
- safe_browsing::FileTypePolicies::GetInstance()->GetFileDangerLevel(
- virtual_path_.BaseName(), download_->GetURL(),
- GetProfile()->GetPrefs()),
- download_->HasUserGesture(), visited_referrer_before,
- GetLastDownloadBypassTimestamp());
- +#endif // BUILDFLAG(FULL_SAFE_BROWSING)
- danger_level_ = GetDangerLevel(
- visited_referrer_before ? VISITED_REFERRER : NO_VISITS_TO_REFERRER);
- if (danger_level_ != DownloadFileType::NOT_DANGEROUS &&
- @@ -1199,6 +1201,7 @@ DownloadFileType::DangerLevel DownloadTa
-
- absl::optional<base::Time>
- DownloadTargetDeterminer::GetLastDownloadBypassTimestamp() const {
- +#if BUILDFLAG(FULL_SAFE_BROWSING)
- safe_browsing::SafeBrowsingMetricsCollector* metrics_collector =
- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
- GetProfile());
- @@ -1207,6 +1210,9 @@ DownloadTargetDeterminer::GetLastDownloa
- safe_browsing::SafeBrowsingMetricsCollector::
- EventType::DANGEROUS_DOWNLOAD_BYPASS)
- : absl::nullopt;
- +#else
- + return absl::nullopt;
- +#endif // BUILDFLAG(FULL_SAFE_BROWSING)
- }
-
- void DownloadTargetDeterminer::OnDownloadDestroyed(
- --- a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
- +++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
- @@ -37,7 +37,6 @@
- #include "chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.h"
- #include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h"
- #include "chrome/browser/safe_browsing/cloud_content_scanning/file_analysis_request.h"
- -#include "chrome/browser/safe_browsing/download_protection/check_client_download_request.h"
- #include "chrome/grit/generated_resources.h"
- #include "components/enterprise/common/proto/connectors.pb.h"
- #include "components/policy/core/common/chrome_schema.h"
- --- a/chrome/browser/enterprise/connectors/analysis/content_analysis_downloads_delegate.cc
- +++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_downloads_delegate.cc
- @@ -82,10 +82,7 @@ absl::optional<GURL> ContentAnalysisDown
- }
-
- bool ContentAnalysisDownloadsDelegate::BypassRequiresJustification() const {
- - if (!base::FeatureList::IsEnabled(kBypassJustificationEnabled))
- return false;
- -
- - return bypass_justification_required_;
- }
-
- std::u16string ContentAnalysisDownloadsDelegate::GetBypassJustificationLabel()
- --- a/chrome/browser/enterprise/connectors/analysis/files_request_handler.cc
- +++ b/chrome/browser/enterprise/connectors/analysis/files_request_handler.cc
- @@ -233,15 +233,6 @@ void FilesRequestHandler::OnGotFileInfo(
- void FilesRequestHandler::FinishRequestEarly(
- std::unique_ptr<safe_browsing::BinaryUploadService::Request> request,
- safe_browsing::BinaryUploadService::Result result) {
- - // We add the request here in case we never actually uploaded anything, so it
- - // wasn't added in OnGetRequestData
- - safe_browsing::WebUIInfoSingleton::GetInstance()->AddToDeepScanRequests(
- - request->tab_url(), request->per_profile_request(),
- - request->content_analysis_request());
- - safe_browsing::WebUIInfoSingleton::GetInstance()->AddToDeepScanResponses(
- - /*token=*/"", safe_browsing::BinaryUploadService::ResultToString(result),
- - enterprise_connectors::ContentAnalysisResponse());
- -
- request->FinishRequest(result,
- enterprise_connectors::ContentAnalysisResponse());
- }
- --- a/chrome/browser/enterprise/connectors/connectors_service.cc
- +++ b/chrome/browser/enterprise/connectors/connectors_service.cc
- @@ -446,19 +446,6 @@ absl::optional<std::string> ConnectorsSe
- return absl::nullopt;
- }
-
- -safe_browsing::EnterpriseRealTimeUrlCheckMode
- -ConnectorsService::GetAppliedRealTimeUrlCheck() const {
- - if (!ConnectorsEnabled() ||
- - !GetDmToken(prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckScope)
- - .has_value()) {
- - return safe_browsing::REAL_TIME_CHECK_DISABLED;
- - }
- -
- - return static_cast<safe_browsing::EnterpriseRealTimeUrlCheckMode>(
- - Profile::FromBrowserContext(context_)->GetPrefs()->GetInteger(
- - prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckMode));
- -}
- -
- ConnectorsManager* ConnectorsService::ConnectorsManagerForTesting() {
- return connectors_manager_.get();
- }
- --- a/chrome/browser/enterprise/connectors/connectors_service.h
- +++ b/chrome/browser/enterprise/connectors/connectors_service.h
- @@ -98,12 +98,6 @@ class ConnectorsService : public KeyedSe
- // is no token to use.
- absl::optional<std::string> GetDMTokenForRealTimeUrlCheck() const;
-
- - // Returns the value to used by the enterprise real-time URL check Connector
- - // if it is set and if the scope it's set at has a valid browser-profile
- - // affiliation.
- - safe_browsing::EnterpriseRealTimeUrlCheckMode GetAppliedRealTimeUrlCheck()
- - const;
- -
- // Returns the CBCM domain or profile domain that enables connector policies.
- // If both set Connector policies, the CBCM domain is returned as it has
- // precedence.
- --- a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/context_signals_decorator.cc
- +++ b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/context_signals_decorator.cc
- @@ -26,25 +26,6 @@ enum class PasswordProtectionTrigger {
- kPhisingReuse = 3
- };
-
- -PasswordProtectionTrigger ConvertPasswordProtectionTrigger(
- - const absl::optional<safe_browsing::PasswordProtectionTrigger>&
- - policy_value) {
- - if (!policy_value) {
- - return PasswordProtectionTrigger::kUnset;
- - }
- -
- - switch (policy_value.value()) {
- - case safe_browsing::PASSWORD_PROTECTION_OFF:
- - return PasswordProtectionTrigger::kOff;
- - case safe_browsing::PASSWORD_REUSE:
- - return PasswordProtectionTrigger::kPasswordReuse;
- - case safe_browsing::PHISHING_REUSE:
- - return PasswordProtectionTrigger::kPhisingReuse;
- - case safe_browsing::PASSWORD_PROTECTION_TRIGGER_MAX:
- - NOTREACHED();
- - return PasswordProtectionTrigger::kUnset;
- - }
- -}
-
- } // namespace
-
- @@ -74,16 +55,8 @@ void ContextSignalsDecorator::OnSignalsF
- ToListValue(context_info.browser_affiliation_ids));
- signals.Set(device_signals::names::kProfileAffiliationIds,
- ToListValue(context_info.profile_affiliation_ids));
- - signals.Set(device_signals::names::kRealtimeUrlCheckMode,
- - static_cast<int32_t>(context_info.realtime_url_check_mode));
- - signals.Set(
- - device_signals::names::kSafeBrowsingProtectionLevel,
- - static_cast<int32_t>(context_info.safe_browsing_protection_level));
- signals.Set(device_signals::names::kSiteIsolationEnabled,
- context_info.site_isolation_enabled);
- - signals.Set(device_signals::names::kPasswordProtectionWarningTrigger,
- - static_cast<int32_t>(ConvertPasswordProtectionTrigger(
- - context_info.password_protection_warning_trigger)));
- signals.Set(device_signals::names::kChromeRemoteDesktopAppBlocked,
- context_info.chrome_remote_desktop_app_blocked);
- signals.Set(device_signals::names::kBuiltInDnsClientEnabled,
- --- a/chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.cc
- +++ b/chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.cc
- @@ -400,7 +400,7 @@ void RealtimeReportingClient::ReportReal
- }
-
- std::string RealtimeReportingClient::GetProfileUserName() const {
- - return safe_browsing::GetProfileEmail(identity_manager_);
- + return std::string();
- }
-
- #if BUILDFLAG(IS_CHROMEOS_ASH)
- --- a/chrome/browser/enterprise/connectors/reporting/reporting_service_settings.cc
- +++ b/chrome/browser/enterprise/connectors/reporting/reporting_service_settings.cc
- @@ -74,16 +74,6 @@ ReportingServiceSettings::ReportingServi
- else
- DVLOG(1) << "Enabled event name list contains a non string value!";
- }
- - } else {
- - // When the list of enabled event names is not set, we assume all events are
- - // enabled. This is to support the feature of selecting the "All always on"
- - // option in the policy UI, which means to always enable all events, even
- - // when new events may be added in the future. And this is also to support
- - // existing customer policies that were created before we introduced the
- - // concept of enabling/disabling events.
- - for (const char* event : kAllReportingEvents) {
- - enabled_event_names_.insert(event);
- - }
- }
-
- const base::Value* enabled_opt_in_events_value =
- --- a/chrome/browser/enterprise/signals/context_info_fetcher.cc
- +++ b/chrome/browser/enterprise/signals/context_info_fetcher.cc
- @@ -206,7 +206,6 @@ void ContextInfoFetcher::Fetch(ContextIn
- GetAnalysisConnectorProviders(enterprise_connectors::BULK_DATA_ENTRY);
- info.on_print_providers =
- GetAnalysisConnectorProviders(enterprise_connectors::PRINT);
- - info.realtime_url_check_mode = GetRealtimeUrlCheckMode();
- info.on_security_event_providers = GetOnSecurityEventProviders();
- info.browser_version = version_info::GetVersionNumber();
- info.site_isolation_enabled =
- @@ -264,11 +263,6 @@ std::vector<std::string> ContextInfoFetc
- return connectors_service_->GetAnalysisServiceProviderNames(connector);
- }
-
- -safe_browsing::EnterpriseRealTimeUrlCheckMode
- -ContextInfoFetcher::GetRealtimeUrlCheckMode() {
- - return connectors_service_->GetAppliedRealTimeUrlCheck();
- -}
- -
- std::vector<std::string> ContextInfoFetcher::GetOnSecurityEventProviders() {
- return connectors_service_->GetReportingServiceProviderNames(
- enterprise_connectors::ReportingConnector::SECURITY_EVENT);
- --- a/chrome/browser/enterprise/signals/context_info_fetcher.h
- +++ b/chrome/browser/enterprise/signals/context_info_fetcher.h
- @@ -6,6 +6,7 @@
- #define CHROME_BROWSER_ENTERPRISE_SIGNALS_CONTEXT_INFO_FETCHER_H_
-
- #include <string>
- +#include <memory>
- #include <vector>
-
- #include "base/callback_forward.h"
- @@ -39,7 +40,6 @@ struct ContextInfo {
- std::vector<std::string> on_bulk_data_entry_providers;
- std::vector<std::string> on_print_providers;
- std::vector<std::string> on_security_event_providers;
- - safe_browsing::EnterpriseRealTimeUrlCheckMode realtime_url_check_mode;
- std::string browser_version;
- safe_browsing::SafeBrowsingState safe_browsing_protection_level;
- bool site_isolation_enabled;
- @@ -90,7 +90,6 @@ class ContextInfoFetcher {
- std::vector<std::string> GetAnalysisConnectorProviders(
- enterprise_connectors::AnalysisConnector connector);
-
- - safe_browsing::EnterpriseRealTimeUrlCheckMode GetRealtimeUrlCheckMode();
-
- std::vector<std::string> GetOnSecurityEventProviders();
-
- --- a/chrome/browser/enterprise/signals/signals_utils.cc
- +++ b/chrome/browser/enterprise/signals/signals_utils.cc
- @@ -33,24 +33,6 @@ bool IsURLBlocked(const GURL& url, Polic
-
- } // namespace
-
- -safe_browsing::SafeBrowsingState GetSafeBrowsingProtectionLevel(
- - PrefService* profile_prefs) {
- - DCHECK(profile_prefs);
- - bool safe_browsing_enabled =
- - profile_prefs->GetBoolean(prefs::kSafeBrowsingEnabled);
- - bool safe_browsing_enhanced_enabled =
- - profile_prefs->GetBoolean(prefs::kSafeBrowsingEnhanced);
- -
- - if (safe_browsing_enabled) {
- - if (safe_browsing_enhanced_enabled)
- - return safe_browsing::SafeBrowsingState::ENHANCED_PROTECTION;
- - else
- - return safe_browsing::SafeBrowsingState::STANDARD_PROTECTION;
- - } else {
- - return safe_browsing::SafeBrowsingState::NO_SAFE_BROWSING;
- - }
- -}
- -
- absl::optional<bool> GetThirdPartyBlockingEnabled(PrefService* local_state) {
- DCHECK(local_state);
- #if BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
- @@ -65,15 +47,6 @@ bool GetBuiltInDnsClientEnabled(PrefServ
- return local_state->GetBoolean(prefs::kBuiltInDnsClientEnabled);
- }
-
- -absl::optional<safe_browsing::PasswordProtectionTrigger>
- -GetPasswordProtectionWarningTrigger(PrefService* profile_prefs) {
- - DCHECK(profile_prefs);
- - if (!profile_prefs->HasPrefPath(prefs::kPasswordProtectionWarningTrigger))
- - return absl::nullopt;
- - return static_cast<safe_browsing::PasswordProtectionTrigger>(
- - profile_prefs->GetInteger(prefs::kPasswordProtectionWarningTrigger));
- -}
- -
- absl::optional<bool> GetChromeCleanupEnabled(PrefService* local_state) {
- DCHECK(local_state);
- #if BUILDFLAG(IS_WIN)
- --- a/chrome/browser/enterprise/signals/signals_utils.h
- +++ b/chrome/browser/enterprise/signals/signals_utils.h
- @@ -21,12 +21,6 @@ bool GetBuiltInDnsClientEnabled(PrefServ
-
- absl::optional<bool> GetChromeCleanupEnabled(PrefService* local_state);
-
- -absl::optional<safe_browsing::PasswordProtectionTrigger>
- -GetPasswordProtectionWarningTrigger(PrefService* profile_prefs);
- -
- -safe_browsing::SafeBrowsingState GetSafeBrowsingProtectionLevel(
- - PrefService* profile_prefs);
- -
- bool GetChromeRemoteDesktopAppBlocked(PolicyBlocklistService* service);
-
- } // namespace utils
- --- a/chrome/browser/extensions/BUILD.gn
- +++ b/chrome/browser/extensions/BUILD.gn
- @@ -303,10 +303,6 @@ static_library("extensions") {
- "api/runtime/chrome_runtime_api_delegate.h",
- "api/safe_browsing_private/safe_browsing_private_api.cc",
- "api/safe_browsing_private/safe_browsing_private_api.h",
- - "api/safe_browsing_private/safe_browsing_private_event_router.cc",
- - "api/safe_browsing_private/safe_browsing_private_event_router.h",
- - "api/safe_browsing_private/safe_browsing_private_event_router_factory.cc",
- - "api/safe_browsing_private/safe_browsing_private_event_router_factory.h",
- "api/safe_browsing_private/safe_browsing_util.cc",
- "api/safe_browsing_private/safe_browsing_util.h",
- "api/scripting/scripting_api.cc",
- @@ -639,8 +635,6 @@ static_library("extensions") {
- "menu_manager_factory.h",
- "navigation_observer.cc",
- "navigation_observer.h",
- - "omaha_attributes_handler.cc",
- - "omaha_attributes_handler.h",
- "pack_extension_job.cc",
- "pack_extension_job.h",
- "pending_extension_info.cc",
- --- a/chrome/browser/extensions/api/cookies/cookies_api.cc
- +++ b/chrome/browser/extensions/api/cookies/cookies_api.cc
- @@ -285,21 +285,6 @@ void CookiesGetFunction::GetCookieListCa
- }
-
- void CookiesGetFunction::NotifyExtensionTelemetry() {
- - auto* telemetry_service =
- - safe_browsing::ExtensionTelemetryServiceFactory::GetForProfile(
- - Profile::FromBrowserContext(browser_context()));
- -
- - if (!telemetry_service || !telemetry_service->enabled() ||
- - !base::FeatureList::IsEnabled(
- - safe_browsing::kExtensionTelemetryCookiesGetSignal)) {
- - return;
- - }
- -
- - auto cookies_get_signal = std::make_unique<safe_browsing::CookiesGetSignal>(
- - extension_id(), parsed_args_->details.name,
- - parsed_args_->details.store_id.value_or(std::string()),
- - parsed_args_->details.url);
- - telemetry_service->AddSignal(std::move(cookies_get_signal));
- }
-
- CookiesGetAllFunction::CookiesGetAllFunction() {
- @@ -383,26 +368,6 @@ void CookiesGetAllFunction::GetCookieLis
- }
-
- void CookiesGetAllFunction::NotifyExtensionTelemetry() {
- - auto* telemetry_service =
- - safe_browsing::ExtensionTelemetryServiceFactory::GetForProfile(
- - Profile::FromBrowserContext(browser_context()));
- -
- - if (!telemetry_service || !telemetry_service->enabled() ||
- - !base::FeatureList::IsEnabled(
- - safe_browsing::kExtensionTelemetryCookiesGetAllSignal)) {
- - return;
- - }
- -
- - auto cookies_get_all_signal =
- - std::make_unique<safe_browsing::CookiesGetAllSignal>(
- - extension_id(), parsed_args_->details.domain.value_or(std::string()),
- - parsed_args_->details.name.value_or(std::string()),
- - parsed_args_->details.path.value_or(std::string()),
- - parsed_args_->details.secure.value_or(false),
- - parsed_args_->details.store_id.value_or(std::string()),
- - parsed_args_->details.url.value_or(std::string()),
- - parsed_args_->details.session.value_or(false));
- - telemetry_service->AddSignal(std::move(cookies_get_all_signal));
- }
-
- CookiesSetFunction::CookiesSetFunction()
- --- a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc
- +++ b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc
- @@ -92,17 +92,8 @@ api::enterprise_reporting_private::Conte
- info.third_party_blocking_enabled = signals.third_party_blocking_enabled;
- info.os_firewall = ToInfoSettingValue(signals.os_firewall);
- info.system_dns_servers = std::move(signals.system_dns_servers);
- - switch (signals.realtime_url_check_mode) {
- - case safe_browsing::REAL_TIME_CHECK_DISABLED:
- info.realtime_url_check_mode = extensions::api::
- enterprise_reporting_private::REALTIME_URL_CHECK_MODE_DISABLED;
- - break;
- - case safe_browsing::REAL_TIME_CHECK_FOR_MAINFRAME_ENABLED:
- - info.realtime_url_check_mode =
- - extensions::api::enterprise_reporting_private::
- - REALTIME_URL_CHECK_MODE_ENABLED_MAIN_FRAME;
- - break;
- - }
- info.browser_version = std::move(signals.browser_version);
- info.built_in_dns_client_enabled = signals.built_in_dns_client_enabled;
-
- --- a/chrome/browser/extensions/browser_context_keyed_service_factories.cc
- +++ b/chrome/browser/extensions/browser_context_keyed_service_factories.cc
- @@ -117,7 +117,6 @@ void EnsureBrowserContextKeyedServiceFac
- #endif
- extensions::PreferenceAPI::GetFactoryInstance();
- extensions::ProcessesAPI::GetFactoryInstance();
- - extensions::SafeBrowsingPrivateEventRouterFactory::GetInstance();
- extensions::SessionsAPI::GetFactoryInstance();
- extensions::SettingsPrivateEventRouterFactory::GetInstance();
- extensions::SettingsOverridesAPI::GetFactoryInstance();
- --- a/chrome/browser/extensions/chrome_extensions_browser_client.cc
- +++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc
- @@ -658,52 +658,22 @@ void ChromeExtensionsBrowserClient::Noti
- content::BrowserContext* context,
- const ExtensionId& extension_id,
- const std::string& code) const {
- - auto* telemetry_service =
- - safe_browsing::ExtensionTelemetryServiceFactory::GetForProfile(
- - Profile::FromBrowserContext(context));
- - if (!telemetry_service || !telemetry_service->enabled() ||
- - !base::FeatureList::IsEnabled(
- - safe_browsing::kExtensionTelemetryTabsExecuteScriptSignal)) {
- - return;
- - }
- -
- - auto signal = std::make_unique<safe_browsing::TabsExecuteScriptSignal>(
- - extension_id, code);
- - telemetry_service->AddSignal(std::move(signal));
- }
-
- bool ChromeExtensionsBrowserClient::IsExtensionTelemetryServiceEnabled(
- content::BrowserContext* context) const {
- - auto* telemetry_service =
- - safe_browsing::ExtensionTelemetryServiceFactory::GetForProfile(
- - Profile::FromBrowserContext(context));
- - return telemetry_service && telemetry_service->enabled();
- + return false;
- }
-
- bool ChromeExtensionsBrowserClient::
- IsExtensionTelemetryRemoteHostContactedSignalEnabled() const {
- - return base::FeatureList::IsEnabled(
- - safe_browsing::kExtensionTelemetryReportContactedHosts);
- + return false;
- }
-
- void ChromeExtensionsBrowserClient::NotifyExtensionRemoteHostContacted(
- content::BrowserContext* context,
- const ExtensionId& extension_id,
- const GURL& url) const {
- - if (!url.SchemeIsHTTPOrHTTPS()) {
- - return;
- - }
- - auto* telemetry_service =
- - safe_browsing::ExtensionTelemetryServiceFactory::GetForProfile(
- - Profile::FromBrowserContext(context));
- - if (!telemetry_service || !telemetry_service->enabled() ||
- - !IsExtensionTelemetryRemoteHostContactedSignalEnabled()) {
- - return;
- - }
- - auto remote_host_signal =
- - std::make_unique<safe_browsing::RemoteHostContactedSignal>(extension_id,
- - url);
- - telemetry_service->AddSignal(std::move(remote_host_signal));
- }
-
- // static
- --- a/chrome/browser/extensions/extension_service.cc
- +++ b/chrome/browser/extensions/extension_service.cc
- @@ -53,7 +53,6 @@
- #include "chrome/browser/extensions/forced_extensions/install_stage_tracker.h"
- #include "chrome/browser/extensions/install_verifier.h"
- #include "chrome/browser/extensions/installed_loader.h"
- -#include "chrome/browser/extensions/omaha_attributes_handler.h"
- #include "chrome/browser/extensions/pending_extension_manager.h"
- #include "chrome/browser/extensions/permissions_updater.h"
- #include "chrome/browser/extensions/shared_module_service.h"
- @@ -190,7 +189,6 @@ void ExtensionService::BlocklistExtensio
- blocklist_prefs::SetSafeBrowsingExtensionBlocklistState(
- extension_id, BitMapBlocklistState::BLOCKLISTED_MALWARE,
- extension_prefs_);
- - OnBlocklistStateAdded(extension_id);
- }
-
- bool ExtensionService::OnExternalExtensionUpdateUrlFound(
- @@ -356,9 +354,6 @@ ExtensionService::ExtensionService(Profi
- safe_browsing_verdict_handler_(extension_prefs,
- ExtensionRegistry::Get(profile),
- this),
- - omaha_attributes_handler_(extension_prefs,
- - ExtensionRegistry::Get(profile),
- - this),
- registry_(ExtensionRegistry::Get(profile)),
- pending_extension_manager_(profile),
- install_directory_(install_directory),
- @@ -862,100 +857,6 @@ bool ExtensionService::IsExtensionEnable
- return extension_registrar_.IsExtensionEnabled(extension_id);
- }
-
- -void ExtensionService::PerformActionBasedOnOmahaAttributes(
- - const std::string& extension_id,
- - const base::Value& attributes) {
- - DCHECK_CURRENTLY_ON(BrowserThread::UI);
- - omaha_attributes_handler_.PerformActionBasedOnOmahaAttributes(extension_id,
- - attributes);
- - allowlist_.PerformActionBasedOnOmahaAttributes(extension_id, attributes);
- - // Show an error for the newly blocklisted extension.
- - error_controller_->ShowErrorIfNeeded();
- -}
- -
- -void ExtensionService::OnGreylistStateRemoved(const std::string& extension_id) {
- - bool is_on_sb_list = (blocklist_prefs::GetSafeBrowsingExtensionBlocklistState(
- - extension_id, extension_prefs_) !=
- - BitMapBlocklistState::NOT_BLOCKLISTED);
- - bool is_on_omaha_list =
- - blocklist_prefs::HasAnyOmahaGreylistState(extension_id, extension_prefs_);
- - if (is_on_sb_list || is_on_omaha_list) {
- - return;
- - }
- - // Clear all acknowledged states so the extension will still get disabled if
- - // it is added to the greylist again.
- - blocklist_prefs::ClearAcknowledgedGreylistStates(extension_id,
- - extension_prefs_);
- - RemoveDisableReasonAndMaybeEnable(extension_id,
- - disable_reason::DISABLE_GREYLIST);
- -}
- -
- -void ExtensionService::OnGreylistStateAdded(const std::string& extension_id,
- - BitMapBlocklistState new_state) {
- -#if DCHECK_IS_ON()
- - bool has_new_state_on_sb_list =
- - (blocklist_prefs::GetSafeBrowsingExtensionBlocklistState(
- - extension_id, extension_prefs_) == new_state);
- - bool has_new_state_on_omaha_list = blocklist_prefs::HasOmahaBlocklistState(
- - extension_id, new_state, extension_prefs_);
- - DCHECK(has_new_state_on_sb_list || has_new_state_on_omaha_list);
- -#endif
- - if (blocklist_prefs::HasAcknowledgedBlocklistState(extension_id, new_state,
- - extension_prefs_)) {
- - // If the extension is already acknowledged, don't disable it again
- - // because it can be already re-enabled by the user. This could happen if
- - // the extension is added to the SafeBrowsing blocklist, and then
- - // subsequently marked by Omaha. In this case, we don't want to disable the
- - // extension twice.
- - return;
- - }
- -
- - // Set the current greylist states to acknowledge immediately because the
- - // extension is disabled silently. Clear the other acknowledged state because
- - // when the state changes to another greylist state in the future, we'd like
- - // to disable the extension again.
- - blocklist_prefs::UpdateCurrentGreylistStatesAsAcknowledged(extension_id,
- - extension_prefs_);
- - DisableExtension(extension_id, disable_reason::DISABLE_GREYLIST);
- -}
- -
- -void ExtensionService::OnBlocklistStateRemoved(
- - const std::string& extension_id) {
- - if (blocklist_prefs::IsExtensionBlocklisted(extension_id, extension_prefs_)) {
- - return;
- - }
- -
- - // Clear acknowledged state.
- - blocklist_prefs::RemoveAcknowledgedBlocklistState(
- - extension_id, BitMapBlocklistState::BLOCKLISTED_MALWARE,
- - extension_prefs_);
- -
- - scoped_refptr<const Extension> extension =
- - registry_->blocklisted_extensions().GetByID(extension_id);
- - DCHECK(extension);
- - registry_->RemoveBlocklisted(extension_id);
- - AddExtension(extension.get());
- -}
- -
- -void ExtensionService::OnBlocklistStateAdded(const std::string& extension_id) {
- - DCHECK(
- - blocklist_prefs::IsExtensionBlocklisted(extension_id, extension_prefs_));
- - // The extension was already acknowledged by the user, it should already be in
- - // the unloaded state.
- - if (blocklist_prefs::HasAcknowledgedBlocklistState(
- - extension_id, BitMapBlocklistState::BLOCKLISTED_MALWARE,
- - extension_prefs_)) {
- - DCHECK(base::Contains(registry_->blocklisted_extensions().GetIDs(),
- - extension_id));
- - return;
- - }
- -
- - scoped_refptr<const Extension> extension =
- - registry_->GetInstalledExtension(extension_id);
- - registry_->AddBlocklisted(extension);
- - UnloadExtension(extension_id, UnloadedExtensionReason::BLOCKLIST);
- -}
- -
- void ExtensionService::RemoveDisableReasonAndMaybeEnable(
- const std::string& extension_id,
- disable_reason::DisableReason reason_to_remove) {
- --- a/chrome/browser/extensions/extension_service.h
- +++ b/chrome/browser/extensions/extension_service.h
- @@ -26,7 +26,6 @@
- #include "chrome/browser/extensions/forced_extensions/force_installed_metrics.h"
- #include "chrome/browser/extensions/forced_extensions/force_installed_tracker.h"
- #include "chrome/browser/extensions/install_gate.h"
- -#include "chrome/browser/extensions/omaha_attributes_handler.h"
- #include "chrome/browser/extensions/pending_extension_manager.h"
- #include "chrome/browser/extensions/safe_browsing_verdict_handler.h"
- #include "chrome/browser/profiles/profile_manager.h"
- @@ -276,40 +275,11 @@ class ExtensionService : public Extensio
- // nothing.
- void EnableExtension(const std::string& extension_id);
-
- - // Takes Safe Browsing and Omaha blocklist states into account and decides
- - // whether to remove greylist disabled reason. Called when a greylisted
- - // state is removed from the Safe Browsing blocklist or Omaha blocklist. Also
- - // clears all acknowledged states if the greylist disabled reason is removed.
- - void OnGreylistStateRemoved(const std::string& extension_id);
- -
- - // Takes acknowledged blocklist states into account and decides whether to
- - // disable the greylisted extension. Called when a new greylisted state is
- - // added to the Safe Browsing blocklist or Omaha blocklist.
- - void OnGreylistStateAdded(const std::string& extension_id,
- - BitMapBlocklistState new_state);
- -
- - // Takes Safe Browsing and Omaha malware blocklist states into account and
- - // decides whether to remove the extension from the blocklist and reload it.
- - // Called when a blocklisted extension is removed from the Safe Browsing
- - // malware blocklist or Omaha malware blocklist. Also clears the acknowledged
- - // state if the extension is reloaded.
- - void OnBlocklistStateRemoved(const std::string& extension_id);
- -
- - // Takes acknowledged malware blocklist state into account and decides whether
- - // to add the extension to the blocklist and unload it. Called when the
- - // extension is added to the Safe Browsing malware blocklist or the Omaha
- - // malware blocklist.
- - void OnBlocklistStateAdded(const std::string& extension_id);
- -
- // Removes the disable reason and enable the extension if there are no disable
- // reasons left and is not blocked for another reason.
- void RemoveDisableReasonAndMaybeEnable(const std::string& extension_id,
- disable_reason::DisableReason reason);
-
- - // Performs action based on Omaha attributes for the extension.
- - void PerformActionBasedOnOmahaAttributes(const std::string& extension_id,
- - const base::Value& attributes);
- -
- // Disables the extension. If the extension is already disabled, just adds
- // the |disable_reasons| (a bitmask of disable_reason::DisableReason - there
- // can be multiple DisableReasons e.g. when an extension comes in disabled
- @@ -651,8 +621,6 @@ class ExtensionService : public Extensio
-
- SafeBrowsingVerdictHandler safe_browsing_verdict_handler_;
-
- - OmahaAttributesHandler omaha_attributes_handler_;
- -
- // Sets of enabled/disabled/terminated/blocklisted extensions. Not owned.
- raw_ptr<ExtensionRegistry> registry_ = nullptr;
-
- --- a/chrome/browser/extensions/extension_system_impl.cc
- +++ b/chrome/browser/extensions/extension_system_impl.cc
- @@ -464,8 +464,6 @@ void ExtensionSystemImpl::InstallUpdate(
- void ExtensionSystemImpl::PerformActionBasedOnOmahaAttributes(
- const std::string& extension_id,
- const base::Value& attributes) {
- - extension_service()->PerformActionBasedOnOmahaAttributes(extension_id,
- - attributes);
- }
-
- bool ExtensionSystemImpl::FinishDelayedInstallationIfReady(
- --- a/chrome/browser/extensions/safe_browsing_verdict_handler.cc
- +++ b/chrome/browser/extensions/safe_browsing_verdict_handler.cc
- @@ -119,7 +119,6 @@ void SafeBrowsingVerdictHandler::UpdateB
- blocklist_.Remove(id);
- blocklist_prefs::SetSafeBrowsingExtensionBlocklistState(
- id, BitMapBlocklistState::NOT_BLOCKLISTED, extension_prefs_);
- - extension_service_->OnBlocklistStateRemoved(id);
- UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.UnblacklistInstalled",
- extension->location());
- }
- @@ -133,7 +132,6 @@ void SafeBrowsingVerdictHandler::UpdateB
- blocklist_.Insert(extension);
- blocklist_prefs::SetSafeBrowsingExtensionBlocklistState(
- id, BitMapBlocklistState::BLOCKLISTED_MALWARE, extension_prefs_);
- - extension_service_->OnBlocklistStateAdded(id);
- UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlacklistInstalled",
- extension->location());
- }
- @@ -157,7 +155,6 @@ void SafeBrowsingVerdictHandler::UpdateG
- blocklist_prefs::SetSafeBrowsingExtensionBlocklistState(
- extension->id(), BitMapBlocklistState::NOT_BLOCKLISTED,
- extension_prefs_);
- - extension_service_->OnGreylistStateRemoved(extension->id());
- UMA_HISTOGRAM_ENUMERATION("Extensions.Greylist.Enabled",
- extension->location());
- }
- @@ -177,7 +174,6 @@ void SafeBrowsingVerdictHandler::UpdateG
- blocklist_prefs::BlocklistStateToBitMapBlocklistState(greylist_state);
- blocklist_prefs::SetSafeBrowsingExtensionBlocklistState(
- extension->id(), bitmap_greylist_state, extension_prefs_);
- - extension_service_->OnGreylistStateAdded(id, bitmap_greylist_state);
- UMA_HISTOGRAM_ENUMERATION("Extensions.Greylist.Disabled",
- extension->location());
- }
- --- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
- +++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
- @@ -37,8 +37,6 @@
- #include "chrome/browser/file_system_access/file_system_access_permission_request_manager.h"
- #include "chrome/browser/installable/installable_utils.h"
- #include "chrome/browser/profiles/profile.h"
- -#include "chrome/browser/safe_browsing/download_protection/download_protection_service.h"
- -#include "chrome/browser/safe_browsing/safe_browsing_service.h"
- #include "chrome/browser/ui/file_system_access_dialogs.h"
- #include "chrome/common/chrome_paths.h"
- #include "chrome/common/pdf_util.h"
- @@ -344,85 +342,6 @@ BindResultCallbackToCurrentSequence(
- base::SequencedTaskRunnerHandle::Get(), std::move(callback));
- }
-
- -void DoSafeBrowsingCheckOnUIThread(
- - content::GlobalRenderFrameHostId frame_id,
- - std::unique_ptr<content::FileSystemAccessWriteItem> item,
- - safe_browsing::CheckDownloadCallback callback) {
- - DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- - // Download Protection Service is not supported on Android.
- -#if BUILDFLAG(FULL_SAFE_BROWSING)
- - safe_browsing::SafeBrowsingService* sb_service =
- - g_browser_process->safe_browsing_service();
- - if (!sb_service || !sb_service->download_protection_service() ||
- - !sb_service->download_protection_service()->enabled()) {
- - std::move(callback).Run(safe_browsing::DownloadCheckResult::UNKNOWN);
- - return;
- - }
- -
- - if (!item->browser_context) {
- - content::RenderProcessHost* rph =
- - content::RenderProcessHost::FromID(frame_id.child_id);
- - if (!rph) {
- - std::move(callback).Run(safe_browsing::DownloadCheckResult::UNKNOWN);
- - return;
- - }
- - item->browser_context = rph->GetBrowserContext();
- - }
- -
- - if (!item->web_contents) {
- - content::RenderFrameHost* rfh = content::RenderFrameHost::FromID(frame_id);
- - if (rfh) {
- - DCHECK_NE(rfh->GetLifecycleState(),
- - content::RenderFrameHost::LifecycleState::kPrerendering);
- - item->web_contents = content::WebContents::FromRenderFrameHost(rfh);
- - }
- - }
- -
- - sb_service->download_protection_service()->CheckFileSystemAccessWrite(
- - std::move(item), std::move(callback));
- -#else
- - std::move(callback).Run(safe_browsing::DownloadCheckResult::UNKNOWN);
- -#endif
- -}
- -
- -ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult
- -InterpretSafeBrowsingResult(safe_browsing::DownloadCheckResult result) {
- - using Result = safe_browsing::DownloadCheckResult;
- - switch (result) {
- - // Only allow downloads that are marked as SAFE or UNKNOWN by SafeBrowsing.
- - // All other types are going to be blocked. UNKNOWN could be the result of a
- - // failed safe browsing ping or if Safe Browsing is not enabled.
- - case Result::UNKNOWN:
- - case Result::SAFE:
- - case Result::ALLOWLISTED_BY_POLICY:
- - return ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult::
- - kAllow;
- -
- - case Result::DANGEROUS:
- - case Result::UNCOMMON:
- - case Result::DANGEROUS_HOST:
- - case Result::POTENTIALLY_UNWANTED:
- - case Result::BLOCKED_PASSWORD_PROTECTED:
- - case Result::BLOCKED_TOO_LARGE:
- - case Result::BLOCKED_UNSUPPORTED_FILE_TYPE:
- - case Result::DANGEROUS_ACCOUNT_COMPROMISE:
- - return ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult::
- - kBlock;
- -
- - // This shouldn't be returned for File System Access write checks.
- - case Result::ASYNC_SCANNING:
- - case Result::SENSITIVE_CONTENT_WARNING:
- - case Result::SENSITIVE_CONTENT_BLOCK:
- - case Result::DEEP_SCANNED_SAFE:
- - case Result::PROMPT_FOR_SCANNING:
- - NOTREACHED();
- - return ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult::
- - kAllow;
- - }
- - NOTREACHED();
- - return ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult::kBlock;
- -}
- -
- std::string GenerateLastPickedDirectoryKey(const std::string& id) {
- return id.empty() ? kDefaultLastPickedDirectoryKey
- : base::StrCat({kCustomLastPickedDirectoryKey, "-", id});
- @@ -1204,28 +1123,6 @@ void ChromeFileSystemAccessPermissionCon
- frame_id, std::move(callback)));
- }
-
- -void ChromeFileSystemAccessPermissionContext::PerformAfterWriteChecks(
- - std::unique_ptr<content::FileSystemAccessWriteItem> item,
- - content::GlobalRenderFrameHostId frame_id,
- - base::OnceCallback<void(AfterWriteCheckResult)> callback) {
- - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- - content::GetUIThreadTaskRunner({})->PostTask(
- - FROM_HERE,
- - base::BindOnce(
- - &DoSafeBrowsingCheckOnUIThread, frame_id, std::move(item),
- - base::BindOnce(
- - [](scoped_refptr<base::TaskRunner> task_runner,
- - base::OnceCallback<void(AfterWriteCheckResult result)>
- - callback,
- - safe_browsing::DownloadCheckResult result) {
- - task_runner->PostTask(
- - FROM_HERE,
- - base::BindOnce(std::move(callback),
- - InterpretSafeBrowsingResult(result)));
- - },
- - base::SequencedTaskRunnerHandle::Get(), std::move(callback))));
- -}
- -
- void ChromeFileSystemAccessPermissionContext::
- DidConfirmSensitiveDirectoryAccess(
- const url::Origin& origin,
- @@ -1237,27 +1134,6 @@ void ChromeFileSystemAccessPermissionCon
- bool should_block) {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- if (!should_block) {
- - // If attempting to save a file with a dangerous extension, prompt the user
- - // to make them confirm they actually want to save the file.
- - if (user_action == UserAction::kSave) {
- - safe_browsing::DownloadFileType::DangerLevel danger_level =
- - safe_browsing::FileTypePolicies::GetInstance()->GetFileDangerLevel(
- - path, origin.GetURL(),
- - Profile::FromBrowserContext(profile_)->GetPrefs());
- - // See https://crbug.com/1320877#c4 for justification for why we show the
- - // prompt if `danger_level` is ALLOW_ON_USER_GESTURE as well as DANGEROUS.
- - if (danger_level == safe_browsing::DownloadFileType::DANGEROUS ||
- - danger_level ==
- - safe_browsing::DownloadFileType::ALLOW_ON_USER_GESTURE) {
- - auto result_callback =
- - BindResultCallbackToCurrentSequence(std::move(callback));
- - content::GetUIThreadTaskRunner({})->PostTask(
- - FROM_HERE,
- - base::BindOnce(&ShowFileSystemAccessDangerousFileDialogOnUIThread,
- - frame_id, origin, path, std::move(result_callback)));
- - return;
- - }
- - }
- std::move(callback).Run(SensitiveEntryResult::kAllowed);
- return;
- }
- --- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h
- +++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h
- @@ -88,10 +88,6 @@ class ChromeFileSystemAccessPermissionCo
- UserAction user_action,
- content::GlobalRenderFrameHostId frame_id,
- base::OnceCallback<void(SensitiveEntryResult)> callback) override;
- - void PerformAfterWriteChecks(
- - std::unique_ptr<content::FileSystemAccessWriteItem> item,
- - content::GlobalRenderFrameHostId frame_id,
- - base::OnceCallback<void(AfterWriteCheckResult)> callback) override;
- bool CanObtainReadPermission(const url::Origin& origin) override;
- bool CanObtainWritePermission(const url::Origin& origin) override;
-
- --- a/chrome/browser/media/webrtc/display_media_access_handler.cc
- +++ b/chrome/browser/media/webrtc/display_media_access_handler.cc
- @@ -24,6 +24,7 @@
- #include "chrome/browser/safe_browsing/user_interaction_observer.h"
- #include "chrome/common/pref_names.h"
- #include "components/prefs/pref_service.h"
- +#include "components/safe_browsing/buildflags.h"
- #include "components/url_formatter/elide_url.h"
- #include "content/public/browser/browser_thread.h"
- #include "content/public/browser/desktop_capture.h"
- @@ -112,6 +113,7 @@ void DisplayMediaAccessHandler::HandleRe
- return;
- }
-
- + #if BUILDFLAG(FULL_SAFE_BROWSING)
- // SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing
- // warnings until user interaction. If the current page has a delayed warning,
- // it'll have a user interaction observer attached. Show the warning
- @@ -127,6 +129,7 @@ void DisplayMediaAccessHandler::HandleRe
- observer->OnDesktopCaptureRequest();
- return;
- }
- + #endif // BUILDFLAG(FULL_SAFE_BROWSING)
-
- #if BUILDFLAG(IS_MAC)
- // Do not allow picker UI to be shown on a page that isn't in the foreground
- --- a/chrome/browser/notifications/notification_display_service_impl.cc
- +++ b/chrome/browser/notifications/notification_display_service_impl.cc
- @@ -88,13 +88,6 @@ NotificationDisplayServiceImpl::Notifica
- profile_));
- #endif
-
- -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
- - BUILDFLAG(IS_WIN)
- - AddNotificationHandler(
- - NotificationHandler::Type::TAILORED_SECURITY,
- - std::make_unique<safe_browsing::TailoredSecurityNotificationHandler>());
- -#endif
- -
- #if BUILDFLAG(ENABLE_EXTENSIONS)
- AddNotificationHandler(
- NotificationHandler::Type::EXTENSION,
- --- a/chrome/browser/password_manager/chrome_password_manager_client.cc
- +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
- @@ -36,7 +36,6 @@
- #include "chrome/browser/password_manager/password_scripts_fetcher_factory.h"
- #include "chrome/browser/password_manager/password_store_factory.h"
- #include "chrome/browser/profiles/profile.h"
- -#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
- #include "chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service.h"
- #include "chrome/browser/safe_browsing/extension_telemetry/extension_telemetry_service_factory.h"
- #include "chrome/browser/safe_browsing/extension_telemetry/password_reuse_signal.h"
- @@ -961,6 +960,7 @@ autofill::LanguageCode ChromePasswordMan
- return autofill::LanguageCode();
- }
-
- +#if BUILDFLAG(FULL_SAFE_BROWSING)
- safe_browsing::PasswordProtectionService*
- ChromePasswordManagerClient::GetPasswordProtectionService() const {
- return safe_browsing::ChromePasswordProtectionService::
- @@ -1034,13 +1034,9 @@ void ChromePasswordManagerClient::CheckP
- telemetry_service->AddSignal(std::move(password_reuse_signal));
- #endif // !BUILDFLAG(IS_ANDROID)
- }
- +#endif // BUILDFLAG(FULL_SAFE_BROWSING)
-
- void ChromePasswordManagerClient::LogPasswordReuseDetectedEvent() {
- - safe_browsing::PasswordProtectionService* pps =
- - GetPasswordProtectionService();
- - if (pps) {
- - pps->MaybeLogPasswordReuseDetectedEvent(web_contents());
- - }
- }
-
- #if !BUILDFLAG(IS_ANDROID)
- @@ -1049,36 +1045,10 @@ void ChromePasswordManagerClient::MaybeR
- bool is_federated,
- const url::Origin& federated_origin,
- const std::u16string& login_user_name) const {
- - if (!base::FeatureList::IsEnabled(policy::features::kLoginEventReporting))
- - return;
- -
- - extensions::SafeBrowsingPrivateEventRouter* router =
- - extensions::SafeBrowsingPrivateEventRouterFactory::GetForProfile(
- - profile_);
- - if (!router)
- - return;
- -
- - // The router is responsible for checking if the reporting of this event type
- - // is enabled by the admin.
- - router->OnLoginEvent(url, is_federated, federated_origin, login_user_name);
- }
-
- void ChromePasswordManagerClient::MaybeReportEnterprisePasswordBreachEvent(
- const std::vector<std::pair<GURL, std::u16string>>& identities) const {
- - if (!base::FeatureList::IsEnabled(
- - policy::features::kPasswordBreachEventReporting)) {
- - return;
- - }
- -
- - extensions::SafeBrowsingPrivateEventRouter* router =
- - extensions::SafeBrowsingPrivateEventRouterFactory::GetForProfile(
- - profile_);
- - if (!router)
- - return;
- -
- - // The router is responsible for checking if the reporting of this event type
- - // is enabled by the admin.
- - router->OnPasswordBreach(kPasswordBreachEntryTrigger, identities);
- }
- #endif
-
- @@ -1596,7 +1566,9 @@ void ChromePasswordManagerClient::OnPast
- }
-
- was_on_paste_called_ = true;
- +#if defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED)
- password_reuse_detection_manager_.OnPaste(std::move(text));
- +#endif // defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED)
- }
-
- void ChromePasswordManagerClient::RenderFrameCreated(
- @@ -1632,7 +1604,9 @@ void ChromePasswordManagerClient::OnInpu
- if (key_event.windows_key_code == (ui::VKEY_V & 0x1f)) {
- OnPaste();
- } else {
- +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED)
- password_reuse_detection_manager_.OnKeyPressedCommitted(key_event.text);
- +#endif // defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED)
- }
- #endif // BUILDFLAG(IS_ANDROID)
- }
- @@ -1671,6 +1645,7 @@ bool ChromePasswordManagerClient::IsPass
- is_enabled = false;
- }
-
- + #if BUILDFLAG(FULL_SAFE_BROWSING)
- // SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing
- // warnings until user interaction. If the current page has a delayed warning,
- // it'll have a user interaction observer attached. Disable password
- @@ -1681,6 +1656,7 @@ bool ChromePasswordManagerClient::IsPass
- observer->OnPasswordSaveOrAutofillDenied();
- is_enabled = false;
- }
- + #endif // BUILDFLAG(FULL_SAFE_BROWSING)
-
- if (log_manager_->IsLoggingActive()) {
- password_manager::BrowserSavePasswordProgressLogger logger(
- --- a/chrome/browser/password_manager/chrome_password_manager_client.h
- +++ b/chrome/browser/password_manager/chrome_password_manager_client.h
- @@ -233,13 +233,14 @@ class ChromePasswordManagerClient
- void AnnotateNavigationEntry(bool has_password_field) override;
- autofill::LanguageCode GetPageLanguage() const override;
-
- +#if BUILDFLAG(FULL_SAFE_BROWSING)
- safe_browsing::PasswordProtectionService* GetPasswordProtectionService()
- const override;
-
- #if defined(ON_FOCUS_PING_ENABLED)
- void CheckSafeBrowsingReputation(const GURL& form_action,
- const GURL& frame_url) override;
- -#endif
- +#endif // defined(ON_FOCUS_PING_ENABLED)
-
- void CheckProtectedPasswordEntry(
- password_manager::metrics_util::PasswordType reused_password_type,
- @@ -249,6 +250,7 @@ class ChromePasswordManagerClient
- bool password_field_exists,
- uint64_t reused_password_hash,
- const std::string& domain) override;
- +#endif // BUILDFLAG(FULL_SAFE_BROWSING)
-
- void LogPasswordReuseDetectedEvent() override;
-
- --- a/chrome/browser/permissions/contextual_notification_permission_ui_selector.cc
- +++ b/chrome/browser/permissions/contextual_notification_permission_ui_selector.cc
- @@ -16,7 +16,6 @@
- #include "chrome/browser/browser_process.h"
- #include "chrome/browser/permissions/quiet_notification_permission_ui_config.h"
- #include "chrome/browser/permissions/quiet_notification_permission_ui_state.h"
- -#include "chrome/browser/safe_browsing/safe_browsing_service.h"
- #include "chrome/common/chrome_features.h"
- #include "components/permissions/permission_request.h"
- #include "components/permissions/request_type.h"
- @@ -159,9 +158,6 @@ void ContextualNotificationPermissionUiS
- }
-
- void ContextualNotificationPermissionUiSelector::Cancel() {
- - // The computation either finishes synchronously above, or is waiting on the
- - // Safe Browsing check.
- - safe_browsing_request_.reset();
- }
-
- bool ContextualNotificationPermissionUiSelector::IsPermissionRequestSupported(
- @@ -187,24 +183,14 @@ void ContextualNotificationPermissionUiS
- absl::optional<Decision> decision =
- GetDecisionBasedOnSiteReputation(reputation);
-
- - // If the PreloadData suggests this is an unacceptable site, ping Safe
- - // Browsing to verify; but do not ping if it is not warranted.
- + // If the PreloadData suggests this is an unacceptable site, assume it is
- + // correct, since we can't access safe browsing.
- if (!decision || (!decision->quiet_ui_reason && !decision->warning_reason)) {
- Notify(Decision::UseNormalUiAndShowNoWarning());
- - return;
- + } else {
- + // decision has a value, unwrap with .value()
- + Notify(decision.value());
- }
- -
- - DCHECK(!safe_browsing_request_);
- - DCHECK(g_browser_process->safe_browsing_service());
- -
- - // It is fine to use base::Unretained() here, as |safe_browsing_request_|
- - // guarantees not to fire the callback after its destruction.
- - safe_browsing_request_.emplace(
- - g_browser_process->safe_browsing_service()->database_manager(),
- - base::DefaultClock::GetInstance(), origin,
- - base::BindOnce(&ContextualNotificationPermissionUiSelector::
- - OnSafeBrowsingVerdictReceived,
- - base::Unretained(this), *decision));
- }
-
- void ContextualNotificationPermissionUiSelector::OnSafeBrowsingVerdictReceived(
- --- a/chrome/browser/permissions/permission_revocation_request.cc
- +++ b/chrome/browser/permissions/permission_revocation_request.cc
- @@ -135,27 +135,7 @@ void PermissionRevocationRequest::CheckA
- DCHECK(profile_);
- DCHECK(callback_);
-
- - if (!safe_browsing::IsSafeBrowsingEnabled(*profile_->GetPrefs()) ||
- - IsOriginExemptedFromFutureRevocations(profile_, origin_) ||
- - (!NotificationsPermissionRevocationConfig::
- - IsAbusiveOriginPermissionRevocationEnabled() &&
- - !NotificationsPermissionRevocationConfig::
- - IsDisruptiveOriginPermissionRevocationEnabled())) {
- NotifyCallback(Outcome::PERMISSION_NOT_REVOKED);
- - return;
- - }
- -
- - CrowdDenyPreloadData* crowd_deny = CrowdDenyPreloadData::GetInstance();
- - permissions::PermissionUmaUtil::RecordCrowdDenyVersionAtAbuseCheckTime(
- - crowd_deny->version_on_disk());
- -
- - if (!crowd_deny->IsReadyToUse())
- - crowd_deny_request_start_time_ = base::TimeTicks::Now();
- -
- - crowd_deny->GetReputationDataForSiteAsync(
- - url::Origin::Create(origin_),
- - base::BindOnce(&PermissionRevocationRequest::OnSiteReputationReady,
- - weak_factory_.GetWeakPtr()));
- }
-
- void PermissionRevocationRequest::OnSiteReputationReady(
- @@ -165,33 +145,6 @@ void PermissionRevocationRequest::OnSite
- base::TimeTicks::Now() - crowd_deny_request_start_time_.value();
- }
-
- - if (site_reputation && !site_reputation->warning_only()) {
- - bool should_revoke_permission = false;
- - switch (site_reputation->notification_ux_quality()) {
- - case CrowdDenyPreloadData::SiteReputation::ABUSIVE_PROMPTS:
- - case CrowdDenyPreloadData::SiteReputation::ABUSIVE_CONTENT:
- - should_revoke_permission = NotificationsPermissionRevocationConfig::
- - IsAbusiveOriginPermissionRevocationEnabled();
- - break;
- - case CrowdDenyPreloadData::SiteReputation::DISRUPTIVE_BEHAVIOR:
- - should_revoke_permission = NotificationsPermissionRevocationConfig::
- - IsDisruptiveOriginPermissionRevocationEnabled();
- - break;
- - default:
- - should_revoke_permission = false;
- - }
- - DCHECK(g_browser_process->safe_browsing_service());
- - if (should_revoke_permission &&
- - g_browser_process->safe_browsing_service()) {
- - safe_browsing_request_.emplace(
- - g_browser_process->safe_browsing_service()->database_manager(),
- - base::DefaultClock::GetInstance(), url::Origin::Create(origin_),
- - base::BindOnce(
- - &PermissionRevocationRequest::OnSafeBrowsingVerdictReceived,
- - weak_factory_.GetWeakPtr(), site_reputation));
- - return;
- - }
- - }
- NotifyCallback(Outcome::PERMISSION_NOT_REVOKED);
- }
-
- --- a/chrome/browser/permissions/prediction_based_permission_ui_selector.cc
- +++ b/chrome/browser/permissions/prediction_based_permission_ui_selector.cc
- @@ -341,52 +341,5 @@ bool PredictionBasedPermissionUiSelector
-
- PredictionSource PredictionBasedPermissionUiSelector::GetPredictionTypeToUse(
- permissions::RequestType request_type) {
- - if (!safe_browsing::IsSafeBrowsingEnabled(*(profile_->GetPrefs()))) {
- return PredictionSource::USE_NONE;
- - }
- -
- - bool is_server_side_prediction_enabled = false;
- - bool is_ondevice_prediction_enabled = false;
- -
- - bool is_tflite_available = false;
- -#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
- - is_tflite_available = true;
- -#endif // BUILDFLAG(BUILD_WITH_TFLITE_LIB)
- -
- - // Notification supports both flavours of the quiet prompt
- - if (request_type == permissions::RequestType::kNotifications &&
- - (base::FeatureList::IsEnabled(features::kQuietNotificationPrompts) ||
- - base::FeatureList::IsEnabled(
- - permissions::features::kPermissionQuietChip))) {
- - is_server_side_prediction_enabled =
- - base::FeatureList::IsEnabled(features::kPermissionPredictions);
- -
- - is_ondevice_prediction_enabled =
- - is_tflite_available &&
- - base::FeatureList::IsEnabled(
- - permissions::features::kPermissionOnDeviceNotificationPredictions);
- - }
- -
- - // Geolocation supports only the quiet chip ui
- - if (request_type == permissions::RequestType::kGeolocation &&
- - base::FeatureList::IsEnabled(
- - permissions::features::kPermissionQuietChip)) {
- - is_server_side_prediction_enabled = base::FeatureList::IsEnabled(
- - features::kPermissionGeolocationPredictions);
- -
- - is_ondevice_prediction_enabled =
- - is_tflite_available &&
- - base::FeatureList::IsEnabled(
- - permissions::features::kPermissionOnDeviceGeolocationPredictions);
- - }
- -
- - if (is_server_side_prediction_enabled && is_ondevice_prediction_enabled) {
- - return PredictionSource::USE_ANY;
- - } else if (is_server_side_prediction_enabled) {
- - return PredictionSource::USE_SERVER_SIDE;
- - } else if (is_ondevice_prediction_enabled) {
- - return PredictionSource::USE_ONDEVICE;
- - } else {
- - return PredictionSource::USE_NONE;
- - }
- }
- --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc
- +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
- @@ -95,6 +95,7 @@
- #include "components/policy/policy_constants.h"
- #include "components/privacy_sandbox/privacy_sandbox_prefs.h"
- #include "components/proxy_config/proxy_policy_handler.h"
- +#include "components/safe_browsing/buildflags.h"
- #include "components/safe_browsing/content/common/file_type_policies_prefs.h"
- #include "components/safe_browsing/core/common/safe_browsing_policy_handler.h"
- #include "components/safe_browsing/core/common/safe_browsing_prefs.h"
- @@ -1847,8 +1848,6 @@ std::unique_ptr<ConfigurationPolicyHandl
- handlers->AddHandler(
- std::make_unique<bookmarks::ManagedBookmarksPolicyHandler>(
- chrome_schema));
- - handlers->AddHandler(
- - std::make_unique<safe_browsing::SafeBrowsingPolicyHandler>());
- handlers->AddHandler(std::make_unique<syncer::SyncPolicyHandler>());
- handlers->AddHandler(
- std::make_unique<URLBlocklistPolicyHandler>(key::kURLBlocklist));
- @@ -1906,13 +1905,6 @@ std::unique_ptr<ConfigurationPolicyHandl
- prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckMode,
- prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckScope, chrome_schema));
-
- - handlers->AddHandler(std::make_unique<SimpleSchemaValidatingPolicyHandler>(
- - key::kExemptDomainFileTypePairsFromFileTypeDownloadWarnings,
- - safe_browsing::file_type::prefs::
- - kExemptDomainFileTypePairsFromFileTypeDownloadWarnings,
- - chrome_schema, SCHEMA_ALLOW_UNKNOWN,
- - SimpleSchemaValidatingPolicyHandler::RECOMMENDED_PROHIBITED,
- - SimpleSchemaValidatingPolicyHandler::MANDATORY_ALLOWED));
- handlers->AddHandler(
- std::make_unique<ManagedAccountRestrictionsPolicyHandler>(chrome_schema));
-
- --- a/chrome/browser/prefs/browser_prefs.cc
- +++ b/chrome/browser/prefs/browser_prefs.cc
- @@ -259,7 +259,6 @@
- #include "chrome/browser/new_tab_page/modules/drive/drive_service.h"
- #include "chrome/browser/new_tab_page/modules/photos/photos_service.h"
- #include "chrome/browser/new_tab_page/modules/recipes/recipes_service.h"
- -#include "chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.h"
- #include "chrome/browser/new_tab_page/promos/promo_service.h"
- #include "chrome/browser/policy/developer_tools_policy_handler.h"
- #include "chrome/browser/search/background/ntp_custom_background_service.h"
- @@ -1408,7 +1407,6 @@ void RegisterProfilePrefs(user_prefs::Pr
- NewTabPageHandler::RegisterProfilePrefs(registry);
- NewTabPageUI::RegisterProfilePrefs(registry);
- NewTabUI::RegisterProfilePrefs(registry);
- - ntp::SafeBrowsingHandler::RegisterProfilePrefs(registry);
- ntp_tiles::CustomLinksManagerImpl::RegisterProfilePrefs(registry);
- PhotosService::RegisterProfilePrefs(registry);
- PinnedTabCodec::RegisterProfilePrefs(registry);
- --- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
- +++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
- @@ -589,7 +589,6 @@ void ChromeBrowserMainExtraPartsProfiles
- }
- #endif
- TabRestoreServiceFactory::GetInstance();
- - safe_browsing::TailoredSecurityServiceFactory::GetInstance();
- TemplateURLFetcherFactory::GetInstance();
- TemplateURLServiceFactory::GetInstance();
- #if !BUILDFLAG(IS_ANDROID)
- --- a/chrome/browser/reputation/reputation_service.cc
- +++ b/chrome/browser/reputation/reputation_service.cc
- @@ -116,9 +116,7 @@ void ReputationService::GetReputationSta
- ReputationCheckCallback callback) {
- DCHECK(url.SchemeIsHTTPOrHTTPS());
-
- - bool has_delayed_warning =
- - !!safe_browsing::SafeBrowsingUserInteractionObserver::FromWebContents(
- - web_contents);
- + bool has_delayed_warning = false;
-
- LookalikeUrlService* service = LookalikeUrlService::Get(profile_);
- if (service->EngagedSitesNeedUpdating()) {
- --- a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_page.ts
- +++ b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_page.ts
- @@ -17,7 +17,6 @@ import './privacy_guide_completion_fragm
- import './privacy_guide_cookies_fragment.js';
- import './privacy_guide_history_sync_fragment.js';
- import './privacy_guide_msbb_fragment.js';
- -import './privacy_guide_safe_browsing_fragment.js';
- import './privacy_guide_welcome_fragment.js';
- import './step_indicator.js';
-
- --- a/chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.cc
- +++ b/chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.cc
- @@ -17,15 +17,6 @@ SafeBrowsingMetricsProvider::~SafeBrowsi
-
- void SafeBrowsingMetricsProvider::ProvideCurrentSessionData(
- metrics::ChromeUserMetricsExtension* uma_proto) {
- - Profile* profile = cached_profile_.GetMetricsProfile();
- -
- - if (!profile)
- - return;
- -
- - SafeBrowsingState state = GetSafeBrowsingState(*profile->GetPrefs());
- -
- - base::UmaHistogramEnumeration(
- - "SafeBrowsing.Pref.MainProfile.SafeBrowsingState", state);
- }
-
- } // namespace safe_browsing
- --- a/chrome/browser/safe_browsing/url_lookup_service_factory.cc
- +++ b/chrome/browser/safe_browsing/url_lookup_service_factory.cc
- @@ -56,28 +56,7 @@ RealTimeUrlLookupServiceFactory::RealTim
-
- KeyedService* RealTimeUrlLookupServiceFactory::BuildServiceInstanceFor(
- content::BrowserContext* context) const {
- - if (!g_browser_process->safe_browsing_service()) {
- - return nullptr;
- - }
- - Profile* profile = Profile::FromBrowserContext(context);
- - auto url_loader_factory =
- - std::make_unique<network::CrossThreadPendingSharedURLLoaderFactory>(
- - g_browser_process->safe_browsing_service()->GetURLLoaderFactory(
- - profile));
- - return new RealTimeUrlLookupService(
- - network::SharedURLLoaderFactory::Create(std::move(url_loader_factory)),
- - VerdictCacheManagerFactory::GetForProfile(profile),
- - base::BindRepeating(&safe_browsing::GetUserPopulationForProfile, profile),
- - profile->GetPrefs(),
- - std::make_unique<SafeBrowsingPrimaryAccountTokenFetcher>(
- - IdentityManagerFactory::GetForProfile(profile)),
- - base::BindRepeating(&safe_browsing::SyncUtils::
- - AreSigninAndSyncSetUpForSafeBrowsingTokenFetches,
- - SyncServiceFactory::GetForProfile(profile),
- - IdentityManagerFactory::GetForProfile(profile)),
- - profile->IsOffTheRecord(), g_browser_process->variations_service(),
- - SafeBrowsingNavigationObserverManagerFactory::GetForBrowserContext(
- - profile));
- + return nullptr;
- }
-
- } // namespace safe_browsing
- --- a/chrome/browser/ssl/chrome_security_blocking_page_factory.cc
- +++ b/chrome/browser/ssl/chrome_security_blocking_page_factory.cc
- @@ -143,15 +143,6 @@ CreateSettingsPageHelper() {
- CreateChromeSettingsPageHelper();
- }
-
- -void LogSafeBrowsingSecuritySensitiveAction(
- - safe_browsing::SafeBrowsingMetricsCollector* metrics_collector) {
- - if (metrics_collector) {
- - metrics_collector->AddSafeBrowsingEventToPref(
- - safe_browsing::SafeBrowsingMetricsCollector::EventType::
- - SECURITY_SENSITIVE_SSL_INTERSTITIAL);
- - }
- -}
- -
- } // namespace
-
- std::unique_ptr<SSLBlockingPage>
- @@ -175,10 +166,6 @@ ChromeSecurityBlockingPageFactory::Creat
- Profile::FromBrowserContext(web_contents->GetBrowserContext()));
- state->DidDisplayErrorPage(cert_error);
-
- - LogSafeBrowsingSecuritySensitiveAction(
- - safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
- - Profile::FromBrowserContext(web_contents->GetBrowserContext())));
- -
- auto controller_client = std::make_unique<SSLErrorControllerClient>(
- web_contents, ssl_info, cert_error, request_url,
- std::move(metrics_helper), CreateSettingsPageHelper());
- @@ -248,10 +235,6 @@ ChromeSecurityBlockingPageFactory::Creat
- std::unique_ptr<SSLCertReporter> ssl_cert_reporter,
- const net::SSLInfo& ssl_info,
- const std::string& mitm_software_name) {
- - LogSafeBrowsingSecuritySensitiveAction(
- - safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
- - Profile::FromBrowserContext(web_contents->GetBrowserContext())));
- -
- auto page = std::make_unique<MITMSoftwareBlockingPage>(
- web_contents, cert_error, request_url, std::move(ssl_cert_reporter),
- /*can_show_enhanced_protection_message=*/true, ssl_info,
- @@ -273,10 +256,6 @@ ChromeSecurityBlockingPageFactory::Creat
- const GURL& request_url,
- std::unique_ptr<SSLCertReporter> ssl_cert_reporter,
- const net::SSLInfo& ssl_info) {
- - LogSafeBrowsingSecuritySensitiveAction(
- - safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile(
- - Profile::FromBrowserContext(web_contents->GetBrowserContext())));
- -
- auto page = std::make_unique<BlockedInterceptionBlockingPage>(
- web_contents, cert_error, request_url, std::move(ssl_cert_reporter),
- /*can_show_enhanced_protection_message=*/true, ssl_info,
- --- a/chrome/browser/ssl/sct_reporting_service_factory.cc
- +++ b/chrome/browser/ssl/sct_reporting_service_factory.cc
- @@ -31,15 +31,7 @@ SCTReportingServiceFactory::~SCTReportin
-
- KeyedService* SCTReportingServiceFactory::BuildServiceInstanceFor(
- content::BrowserContext* profile) const {
- - safe_browsing::SafeBrowsingService* safe_browsing_service =
- - g_browser_process->safe_browsing_service();
- - // In unit tests the safe browsing service can be null, if this happens,
- - // return null instead of crashing.
- - if (!safe_browsing_service)
- - return nullptr;
- -
- - return new SCTReportingService(safe_browsing_service,
- - static_cast<Profile*>(profile));
- + return nullptr;
- }
-
- // Force this to be created during BrowserContext creation, since we can't
- --- a/chrome/browser/ssl/ssl_error_controller_client.cc
- +++ b/chrome/browser/ssl/ssl_error_controller_client.cc
- @@ -91,8 +91,6 @@ void SSLErrorControllerClient::GoBack()
- }
-
- void SSLErrorControllerClient::Proceed() {
- - MaybeTriggerSecurityInterstitialProceededEvent(web_contents_, request_url_,
- - "SSL_ERROR", cert_error_);
- #if BUILDFLAG(ENABLE_EXTENSIONS)
- // Hosted Apps should not be allowed to run if there is a problem with their
- // certificate. So, when users click proceed on an interstitial, move the tab
- --- a/chrome/browser/subresource_filter/chrome_content_subresource_filter_web_contents_helper_factory.cc
- +++ b/chrome/browser/subresource_filter/chrome_content_subresource_filter_web_contents_helper_factory.cc
- @@ -6,7 +6,6 @@
-
- #include "chrome/browser/browser_process.h"
- #include "chrome/browser/profiles/profile.h"
- -#include "chrome/browser/safe_browsing/safe_browsing_service.h"
- #include "chrome/browser/subresource_filter/subresource_filter_profile_context_factory.h"
- #include "components/safe_browsing/core/browser/db/database_manager.h"
- #include "components/subresource_filter/content/browser/content_subresource_filter_web_contents_helper.h"
- @@ -18,10 +17,7 @@ namespace {
- // available. Otherwise returns nullptr.
- const scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager>
- GetDatabaseManagerFromSafeBrowsingService() {
- - safe_browsing::SafeBrowsingService* safe_browsing_service =
- - g_browser_process->safe_browsing_service();
- - return safe_browsing_service ? safe_browsing_service->database_manager()
- - : nullptr;
- + return nullptr;
- }
-
- } // namespace
- --- a/chrome/browser/ui/BUILD.gn
- +++ b/chrome/browser/ui/BUILD.gn
- @@ -553,7 +553,6 @@ static_library("ui") {
- "//components/renderer_context_menu",
- "//components/resources",
- "//components/safe_browsing/content/browser",
- - "//components/safe_browsing/content/browser:client_side_detection",
- "//components/safe_browsing/content/browser/password_protection",
- "//components/safe_browsing/content/browser/web_ui",
- "//components/safe_browsing/core/browser/db:database_manager",
- @@ -4918,8 +4917,6 @@ static_library("ui") {
- "views/safe_browsing/prompt_for_scanning_modal_dialog.h",
- "views/safe_browsing/tailored_security_desktop_dialog_manager.cc",
- "views/safe_browsing/tailored_security_desktop_dialog_manager.h",
- - "views/safe_browsing/tailored_security_unconsented_modal.cc",
- - "views/safe_browsing/tailored_security_unconsented_modal.h",
- "views/send_tab_to_self/manage_account_devices_link_view.cc",
- "views/send_tab_to_self/manage_account_devices_link_view.h",
- "views/send_tab_to_self/send_tab_to_self_bubble_device_button.cc",
- --- a/chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc
- +++ b/chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc
- @@ -16,6 +16,7 @@
- #include "components/javascript_dialogs/tab_modal_dialog_manager.h"
- #include "components/javascript_dialogs/tab_modal_dialog_view.h"
- #include "components/navigation_metrics/navigation_metrics.h"
- +#include "components/safe_browsing/buildflags.h"
- #include "content/public/browser/devtools_agent_host.h"
- #include "content/public/browser/navigation_handle.h"
- #include "content/public/browser/render_frame_host.h"
- @@ -35,6 +36,7 @@ JavaScriptTabModalDialogManagerDelegateD
-
- void JavaScriptTabModalDialogManagerDelegateDesktop::WillRunDialog() {
- BrowserList::AddObserver(this);
- + #if BUILDFLAG(FULL_SAFE_BROWSING)
- // SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing
- // warnings until user interaction. If the current page has a delayed warning,
- // it'll have a user interaction observer attached. Show the warning
- @@ -45,6 +47,7 @@ void JavaScriptTabModalDialogManagerDele
- if (observer) {
- observer->OnJavaScriptDialog();
- }
- + #endif // BUILDFLAG(FULL_SAFE_BROWSING)
- }
-
- void JavaScriptTabModalDialogManagerDelegateDesktop::DidCloseDialog() {
- --- a/chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.cc
- +++ b/chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.cc
- @@ -10,7 +10,10 @@
- #include "base/memory/weak_ptr.h"
- #include "base/strings/utf_string_conversions.h"
- #include "base/task/thread_pool.h"
- +#include "components/safe_browsing/buildflags.h"
- +#if BUILDFLAG(FULL_SAFE_BROWSING)
- #include "chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.h"
- +#endif
- #include "chrome/browser/profiles/profile.h"
- #include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h"
- #include "content/public/browser/web_contents.h"
- @@ -22,6 +25,7 @@
-
- namespace {
-
- +#if BUILDFLAG(FULL_SAFE_BROWSING)
- // Helper to keep a mapping of files to the index of their corresponding parent
- // entry in content::DropData::filenames. For instance, this means that for a
- // DropData with filenames = [ "a.txt", "dir/"], `PathsAndIndexes` might be
- @@ -113,6 +117,7 @@ ContentAnalysisDropData GetPathsToScan(
-
- return content_analysis_drop_data;
- }
- +#endif // BUILDFLAG(FULL_SAFE_BROWSING)
-
- // Helper class to handle WebContents being destroyed while files are opened in
- // the threadpool. This class deletes itself either when it's no longer needed
- @@ -128,6 +133,7 @@ class HandleDropScanData : public conten
- drop_data_(std::move(drop_data)),
- callback_(std::move(callback)) {}
-
- +#if BUILDFLAG(FULL_SAFE_BROWSING)
- void ScanData(ContentAnalysisDropData content_analysis_drop_data) {
- DCHECK(web_contents());
-
- @@ -140,6 +146,7 @@ class HandleDropScanData : public conten
-
- delete this;
- }
- +#endif // BUILDFLAG(FULL_SAFE_BROWSING)
-
- void WebContentsDestroyed() override { delete this; }
-
- @@ -160,13 +167,16 @@ void HandleOnPerformDrop(
- content::WebContents* web_contents,
- content::DropData drop_data,
- content::WebContentsViewDelegate::DropCompletionCallback callback) {
- +#if BUILDFLAG(FULL_SAFE_BROWSING)
- enterprise_connectors::ContentAnalysisDelegate::Data data;
- +#endif
- Profile* profile =
- Profile::FromBrowserContext(web_contents->GetBrowserContext());
- auto connector =
- drop_data.filenames.empty()
- ? enterprise_connectors::AnalysisConnector::BULK_DATA_ENTRY
- : enterprise_connectors::AnalysisConnector::FILE_ATTACHED;
- +#if BUILDFLAG(FULL_SAFE_BROWSING)
- if (!enterprise_connectors::ContentAnalysisDelegate::IsEnabled(
- profile, web_contents->GetLastCommittedURL(), &data, connector)) {
- std::move(callback).Run(std::move(drop_data));
- @@ -203,6 +213,7 @@ void HandleOnPerformDrop(
- base::BindOnce(&HandleDropScanData::ScanData,
- handle_drop_scan_data->GetWeakPtr()));
- }
- +#endif // BUILDFLAG(FULL_SAFE_BROWSING)
-
- if (!callback.is_null()) {
- std::move(callback).Run(std::move(drop_data));
- --- a/chrome/browser/ui/views/download/download_item_view.cc
- +++ b/chrome/browser/ui/views/download/download_item_view.cc
- @@ -840,9 +840,7 @@ void DownloadItemView::UpdateLabels() {
- deep_scanning_label_->SetVisible(mode_ ==
- download::DownloadItemMode::kDeepScanning);
- if (deep_scanning_label_->GetVisible()) {
- - const int id = (model_->GetDownloadItem() &&
- - safe_browsing::DeepScanningRequest::ShouldUploadBinary(
- - model_->GetDownloadItem()))
- + const int id = model_->GetDownloadItem()
- ? IDS_PROMPT_DEEP_SCANNING_DOWNLOAD
- : IDS_PROMPT_DEEP_SCANNING_APP_DOWNLOAD;
- const std::u16string filename = ElidedFilename(*deep_scanning_label_);
- @@ -868,11 +866,15 @@ void DownloadItemView::UpdateButtons() {
- }
-
- const bool allow_open_during_deep_scan =
- +#if BUILDFLAG(FULL_SAFE_BROWSING)
- (mode_ == download::DownloadItemMode::kDeepScanning) &&
- !enterprise_connectors::ConnectorsServiceFactory::GetForBrowserContext(
- model_->profile())
- ->DelayUntilVerdict(
- enterprise_connectors::AnalysisConnector::FILE_DOWNLOADED);
- +#else
- + false;
- +#endif // BUILDFLAG(FULL_SAFE_BROWSING)
- open_button_->SetEnabled((mode_ == download::DownloadItemMode::kNormal) ||
- prompt_to_scan || allow_open_during_deep_scan);
-
- @@ -1369,7 +1371,9 @@ void DownloadItemView::ShowContextMenuIm
- }
-
- void DownloadItemView::OpenDownloadDuringAsyncScanning() {
- +#if BUILDFLAG(FULL_SAFE_BROWSING)
- model_->CompleteSafeBrowsingScan();
- +#endif
- model_->SetOpenWhenComplete(true);
- }
-
- --- a/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc
- +++ b/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc
- @@ -376,12 +376,6 @@ void DownloadsDOMHandler::ReviewDangerou
- return;
- }
-
- - CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_REVIEW_DANGEROUS);
- - download::DownloadItem* download = GetDownloadByStringId(id);
- - if (download) {
- - DownloadItemModel model(download);
- - model.ReviewScanningVerdict(GetWebUIWebContents());
- - }
- }
-
- // DownloadsDOMHandler, private: --------------------------------------------
- --- a/chrome/browser/ui/webui/management/management_ui_handler.cc
- +++ b/chrome/browser/ui/webui/management/management_ui_handler.cc
- @@ -927,12 +927,6 @@ base::Value::Dict ManagementUIHandler::G
- &info);
- }
-
- - if (connectors_service->GetAppliedRealTimeUrlCheck() !=
- - safe_browsing::REAL_TIME_CHECK_DISABLED) {
- - AddThreatProtectionPermission(kManagementOnPageVisitedEvent,
- - kManagementOnPageVisitedVisibleData, &info);
- - }
- -
- const std::string enterprise_manager =
- connectors_service->GetManagementDomain();
-
- --- a/chrome/browser/webshare/share_service_impl.cc
- +++ b/chrome/browser/webshare/share_service_impl.cc
- @@ -17,7 +17,9 @@
- #include "chrome/browser/browser_process.h"
- #include "chrome/browser/safe_browsing/safe_browsing_service.h"
- #include "chrome/common/chrome_features.h"
- +#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
- #include "components/safe_browsing/content/common/file_type_policies.h"
- +#endif
- #include "components/safe_browsing/core/browser/db/database_manager.h"
- #include "content/public/browser/web_contents.h"
- #include "mojo/public/cpp/bindings/self_owned_receiver.h"
- @@ -200,11 +202,13 @@ void ShareServiceImpl::Share(const std::
-
- // Check if at least one file is marked by the download protection service
- // to send a ping to check this file type.
- +#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
- if (!should_check_url &&
- safe_browsing::FileTypePolicies::GetInstance()->IsCheckedBinaryFile(
- path)) {
- should_check_url = true;
- }
- +#endif // BUILDFLAG(SAFE_BROWSING_AVAILABLE)
-
- // In the case where the original blob handle was to a native file (of
- // unknown size), the serialized data does not contain an accurate file
- @@ -214,6 +218,7 @@ void ShareServiceImpl::Share(const std::
- }
-
- DCHECK(!safe_browsing_request_);
- +#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
- if (should_check_url && g_browser_process->safe_browsing_service()) {
- safe_browsing_request_.emplace(
- g_browser_process->safe_browsing_service()->database_manager(),
- @@ -223,6 +228,7 @@ void ShareServiceImpl::Share(const std::
- std::move(files), std::move(callback)));
- return;
- }
- +#endif // BUILDFLAG(SAFE_BROWSING_AVAILABLE)
-
- OnSafeBrowsingResultReceived(title, text, share_url, std::move(files),
- std::move(callback),
- --- a/chrome/test/BUILD.gn
- +++ b/chrome/test/BUILD.gn
- @@ -1406,7 +1406,6 @@ if (!is_android) {
- "//components/resources",
- "//components/safe_browsing:buildflags",
- "//components/safe_browsing/content/browser",
- - "//components/safe_browsing/content/browser:client_side_detection",
- "//components/safe_browsing/content/browser:safe_browsing_service",
- "//components/safe_browsing/content/browser/password_protection",
- "//components/safe_browsing/content/browser/password_protection:test_support",
- @@ -5951,7 +5950,6 @@ test("unit_tests") {
- "//components/resources",
- "//components/safe_browsing:buildflags",
- "//components/safe_browsing/content/browser",
- - "//components/safe_browsing/content/browser:client_side_detection",
- "//components/safe_browsing/content/browser/password_protection",
- "//components/safe_browsing/content/browser/password_protection:mock_password_protection",
- "//components/safe_browsing/content/browser/web_ui",
- --- a/components/password_manager/content/browser/content_password_manager_driver.cc
- +++ b/components/password_manager/content/browser/content_password_manager_driver.cc
- @@ -430,7 +430,7 @@ void ContentPasswordManagerDriver::Check
- if (!password_manager::bad_message::CheckFrameNotPrerendering(
- render_frame_host_))
- return;
- -#if defined(ON_FOCUS_PING_ENABLED)
- +#if defined(ON_FOCUS_PING_ENABLED) && BUILDFLAG(FULL_SAFE_BROWSING)
- client_->CheckSafeBrowsingReputation(form_action, frame_url);
- #endif
- }
- --- a/components/password_manager/core/browser/password_manager_client.h
- +++ b/components/password_manager/core/browser/password_manager_client.h
- @@ -394,11 +394,14 @@ class PasswordManagerClient {
- // Returns the current best guess as to the page's display language.
- virtual autofill::LanguageCode GetPageLanguage() const;
-
- +#if (defined(ON_FOCUS_PING_ENABLED) || defined(PASSWORD_REUSE_DETECTION_ENABLED)) && \
- + BUILDFLAG(FULL_SAFE_BROWSING)
- // Return the PasswordProtectionService associated with this instance.
- virtual safe_browsing::PasswordProtectionService*
- GetPasswordProtectionService() const = 0;
- +#endif
-
- -#if defined(ON_FOCUS_PING_ENABLED)
- +#if defined(ON_FOCUS_PING_ENABLED) && BUILDFLAG(FULL_SAFE_BROWSING)
- // Checks the safe browsing reputation of the webpage when the
- // user focuses on a username/password field. This is used for reporting
- // only, and won't trigger a warning.
- @@ -406,6 +409,7 @@ class PasswordManagerClient {
- const GURL& frame_url) = 0;
- #endif
-
- +#if defined(PASSWORD_REUSE_DETECTION_ENABLED)
- // Checks the safe browsing reputation of the webpage where password reuse
- // happens. This is called by the PasswordReuseDetectionManager when a
- // protected password is typed on the wrong domain. This may trigger a
- @@ -422,6 +426,7 @@ class PasswordManagerClient {
- bool password_field_exists,
- uint64_t reused_password_hash,
- const std::string& domain) = 0;
- +#endif
-
- // Records a Chrome Sync event that GAIA password reuse was detected.
- virtual void LogPasswordReuseDetectedEvent() = 0;
- --- a/components/password_manager/core/browser/password_reuse_detection_manager.cc
- +++ b/components/password_manager/core/browser/password_reuse_detection_manager.cc
- @@ -163,9 +163,11 @@ void PasswordReuseDetectionManager::OnRe
- ? reused_protected_password_hash->username
- : "";
-
- + #if defined(PASSWORD_REUSE_DETECTION_ENABLED)
- client_->CheckProtectedPasswordEntry(
- reused_password_type, username, matching_reused_credentials,
- password_field_detected, reused_password_hash, domain);
- + #endif
- }
-
- void PasswordReuseDetectionManager::SetClockForTesting(base::Clock* clock) {
- --- a/components/safe_browsing/content/common/proto/BUILD.gn
- +++ b/components/safe_browsing/content/common/proto/BUILD.gn
- @@ -5,8 +5,12 @@
- import("//components/safe_browsing/buildflags.gni")
- import("//third_party/protobuf/proto_library.gni")
-
- -if (safe_browsing_mode != 0) {
- +# Although this was gated on safe_browsing_mode != 0, a considerable amount
- +# of source code that relies on the types included in download_file_types.pb.h
- +# is not gated on BUILDFLAG(SAFE_BROWSING_AVAILABLE). This is far less
- +# invasive than the alternative.
- +# if (safe_browsing_mode != 0) {
- proto_library("download_file_types_proto") {
- sources = [ "download_file_types.proto" ]
- }
- -}
- +# }
- --- a/components/safe_browsing/content/common/safe_browsing.mojom
- +++ b/components/safe_browsing/content/common/safe_browsing.mojom
- @@ -138,7 +138,6 @@ interface PhishingDetector {
- => (PhishingDetectorResult result, string request_proto);
- };
-
- -[EnableIf=full_safe_browsing]
- // Interface for setting a phishing model. This is scoped to an entire
- // RenderProcess.
- interface PhishingModelSetter {
- --- a/components/safe_browsing/core/browser/BUILD.gn
- +++ b/components/safe_browsing/core/browser/BUILD.gn
- @@ -11,8 +11,6 @@ source_set("browser") {
- "safe_browsing_url_checker_impl.cc",
- "safe_browsing_url_checker_impl.h",
- "url_checker_delegate.h",
- - "user_population.cc",
- - "user_population.h",
- ]
-
- public_deps = [ "//google_apis:google_apis" ]
- --- a/components/safe_browsing/core/browser/verdict_cache_manager.cc
- +++ b/components/safe_browsing/core/browser/verdict_cache_manager.cc
- @@ -402,16 +402,6 @@ VerdictCacheManager::VerdictCacheManager
- // pref_service can be null in tests.
- if (pref_service) {
- pref_change_registrar_.Init(pref_service);
- - pref_change_registrar_.Add(
- - prefs::kSafeBrowsingEnhanced,
- - base::BindRepeating(&VerdictCacheManager::CleanUpAllPageLoadTokens,
- - weak_factory_.GetWeakPtr(),
- - ClearReason::kSafeBrowsingStateChanged));
- - pref_change_registrar_.Add(
- - prefs::kSafeBrowsingEnabled,
- - base::BindRepeating(&VerdictCacheManager::CleanUpAllPageLoadTokens,
- - weak_factory_.GetWeakPtr(),
- - ClearReason::kSafeBrowsingStateChanged));
- }
- // sync_observer_ can be null in some embedders that don't support sync.
- if (sync_observer_) {
- --- a/content/browser/file_system_access/file_system_access_safe_move_helper.cc
- +++ b/content/browser/file_system_access/file_system_access_safe_move_helper.cc
- @@ -166,15 +166,8 @@ void FileSystemAccessSafeMoveHelper::Sta
- return;
- }
-
- - if (!RequireSecurityChecks() || !manager_->permission_context()) {
- DidAfterWriteCheck(
- FileSystemAccessPermissionContext::AfterWriteCheckResult::kAllow);
- - return;
- - }
- -
- - ComputeHashForSourceFile(
- - base::BindOnce(&FileSystemAccessSafeMoveHelper::DoAfterWriteCheck,
- - weak_factory_.GetWeakPtr()));
- }
-
- void FileSystemAccessSafeMoveHelper::ComputeHashForSourceFile(
- @@ -195,45 +188,6 @@ void FileSystemAccessSafeMoveHelper::Com
- std::move(wrapped_callback), source_url()));
- }
-
- -void FileSystemAccessSafeMoveHelper::DoAfterWriteCheck(
- - base::File::Error hash_result,
- - const std::string& hash,
- - int64_t size) {
- - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- -
- - if (hash_result != base::File::FILE_OK) {
- - // Calculating the hash failed.
- - std::move(callback_).Run(file_system_access_error::FromStatus(
- - blink::mojom::FileSystemAccessStatus::kOperationAborted,
- - "Failed to perform Safe Browsing check."));
- - return;
- - }
- -
- - if (!manager_) {
- - std::move(callback_).Run(file_system_access_error::FromStatus(
- - blink::mojom::FileSystemAccessStatus::kOperationAborted));
- - return;
- - }
- -
- - content::GlobalRenderFrameHostId outermost_main_frame_id;
- - auto* rfh = content::RenderFrameHost::FromID(context_.frame_id);
- - if (rfh)
- - outermost_main_frame_id = rfh->GetOutermostMainFrame()->GetGlobalId();
- -
- - auto item = std::make_unique<FileSystemAccessWriteItem>();
- - item->target_file_path = dest_url().path();
- - item->full_path = source_url().path();
- - item->sha256_hash = hash;
- - item->size = size;
- - item->frame_url = context_.url;
- - item->outermost_main_frame_id = outermost_main_frame_id;
- - item->has_user_gesture = has_transient_user_activation_;
- - manager_->permission_context()->PerformAfterWriteChecks(
- - std::move(item), context_.frame_id,
- - base::BindOnce(&FileSystemAccessSafeMoveHelper::DidAfterWriteCheck,
- - weak_factory_.GetWeakPtr()));
- -}
- -
- void FileSystemAccessSafeMoveHelper::DidAfterWriteCheck(
- FileSystemAccessPermissionContext::AfterWriteCheckResult result) {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- --- a/content/browser/file_system_access/file_system_access_safe_move_helper.h
- +++ b/content/browser/file_system_access/file_system_access_safe_move_helper.h
- @@ -55,9 +55,6 @@ class CONTENT_EXPORT FileSystemAccessSaf
- private:
- SEQUENCE_CHECKER(sequence_checker_);
-
- - void DoAfterWriteCheck(base::File::Error hash_result,
- - const std::string& hash,
- - int64_t size);
- void DidAfterWriteCheck(
- FileSystemAccessPermissionContext::AfterWriteCheckResult result);
- void DidFileSkipQuarantine(base::File::Error result);
- --- a/content/public/browser/file_system_access_permission_context.h
- +++ b/content/public/browser/file_system_access_permission_context.h
- @@ -112,12 +112,6 @@ class FileSystemAccessPermissionContext
- base::OnceCallback<void(SensitiveEntryResult)> callback) = 0;
-
- enum class AfterWriteCheckResult { kAllow, kBlock };
- - // Runs a recently finished write operation through checks such as malware
- - // or other security checks to determine if the write should be allowed.
- - virtual void PerformAfterWriteChecks(
- - std::unique_ptr<FileSystemAccessWriteItem> item,
- - GlobalRenderFrameHostId frame_id,
- - base::OnceCallback<void(AfterWriteCheckResult)> callback) = 0;
-
- // Returns whether the give |origin| already allows read permission, or it is
- // possible to request one. This is used to block file dialogs from being
- --- a/extensions/browser/updater/update_service.cc
- +++ b/extensions/browser/updater/update_service.cc
- @@ -125,13 +125,6 @@ void UpdateService::OnEvent(Events event
- break;
- }
-
- - if (should_perform_action_on_omaha_attributes) {
- - base::Value attributes = GetExtensionOmahaAttributes(extension_id);
- - // Note that it's important to perform actions even if |attributes| is
- - // empty, missing values may default to false and have associated logic.
- - ExtensionSystem::Get(browser_context_)
- - ->PerformActionBasedOnOmahaAttributes(extension_id, attributes);
- - }
- }
-
- UpdateService::UpdateService(
- --- a/printing/buildflags/buildflags.gni
- +++ b/printing/buildflags/buildflags.gni
- @@ -36,7 +36,7 @@ declare_args() {
-
- # Enable snapshotting a page when printing for its content to be analyzed for
- # sensitive content by enterprise users.
- - enable_print_content_analysis = is_chromeos || is_win || is_linux || is_mac
- + enable_print_content_analysis = false
- }
-
- declare_args() {
- --- a/weblayer/BUILD.gn
- +++ b/weblayer/BUILD.gn
- @@ -477,7 +477,6 @@ source_set("weblayer_lib_base") {
- "//components/profile_metrics",
- "//components/reduce_accept_language/browser",
- "//components/safe_browsing/content/browser",
- - "//components/safe_browsing/content/browser:client_side_detection",
- "//components/safe_browsing/content/browser/web_ui",
- "//components/safe_browsing/content/common:interfaces",
- "//components/safe_browsing/content/renderer:throttles",
|